Skip to content

Commit 6bd60df

Browse files
AnandAnand
authored andcommitted
Create Directory for En FFT
1 parent 0384a60 commit 6bd60df

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/post_process/m_start_up.fpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@ contains
243243
-offset_z%beg:p + offset_z%end, 3) :: liutex_axis
244244
integer :: i, j, k, l, kx, ky, kz, kf, j_glb, k_glb, l_glb
245245
real(wp) :: En_tot
246-
character(20) :: filename
247-
logical :: file_exists
246+
character(50) :: filename, dirname
247+
logical :: file_exists, dir_exists
248248
integer :: x_beg, x_end, y_beg, y_end, z_beg, z_end
249249
250250
if (output_partial_domain) then
@@ -494,17 +494,18 @@ contains
494494

495495
call MPI_ALLREDUCE(MPI_IN_PLACE, En, Nf, mpi_p, MPI_SUM, MPI_COMM_WORLD, ierr)
496496

497-
if(proc_rank == 0) then
498-
write(filename,'(a,i0,a)') 'En_tot',t_step,'.dat'
497+
if (proc_rank == 0) then
498+
call s_create_directory('En_FFT_DATA')
499+
write (filename, '(a,i0,a)') 'En_FFT_DATA/En_tot', t_step, '.dat'
499500
inquire (FILE=filename, EXIST=file_exists)
500-
if(file_exists) then
501-
call s_delete_file(trim(case_dir)//'/'//trim(filename))
501+
if (file_exists) then
502+
call s_delete_file(trim(case_dir)//'/En_FFT_DATA/'//trim(filename))
502503
end if
503504
end if
504505

505506
do kf = 1, Nf
506-
if(proc_rank == 0) then
507-
write(filename,'(a,i0,a)') 'En_tot',t_step,'.dat'
507+
if (proc_rank == 0) then
508+
write (filename, '(a,i0,a)') 'En_FFT_DATA/En_tot', t_step, '.dat'
508509
inquire (FILE=filename, EXIST=file_exists)
509510
if (file_exists) then
510511
open (1, file=filename, position='append', status='old')

0 commit comments

Comments
 (0)