diff --git a/code/code_gen/code_gen.py b/code/code_gen/code_gen.py index 81f8bea..44a0e9d 100644 --- a/code/code_gen/code_gen.py +++ b/code/code_gen/code_gen.py @@ -65,9 +65,11 @@ calc_grammar = """ """ real_array_decl = "real*8, allocatable, dimension(:,:,:) :: {}" + real_array_alloc = "allocate({0}(nxp,nyp,nzp), stat=ierr) ; {0} = 0." avg_array_decl = "real*8, allocatable, dimension(:) :: {}" + avg_array_alloc = "allocate({0}(nxp), stat=ierr) ; {0} = 0." real_array_free = "deallocate({})" @@ -106,10 +108,16 @@ end do close (200) ''' -avg_array_divide = "{0} = {0} / denum {1}" +avg_array_divide = """ +call MPI_ALLREDUCE(MPI_IN_PLACE, {0}, nxp, MPI_REAL8, MPI_SUM, MPI_COMM_TASK, mpi_err) + +{0} = {0} / denum {1} +""" real_array_diff = "call {0[0]} ( {0[0]}_{0[1]}, {0[1]} )" + + class FortranCode: def __init__ (self, exp): self.exp = exp diff --git a/code/code_gen/resources/m_template.f90 b/code/code_gen/resources/m_template.f90 index 9d73d0b..3a5fb3b 100644 --- a/code/code_gen/resources/m_template.f90 +++ b/code/code_gen/resources/m_template.f90 @@ -1,5 +1,6 @@ module m_{0[module_name]} +use m_openmpi use m_parameters use m_arrays use m_calculate diff --git a/code/code_gen/terms.input b/code/code_gen/terms.input index 02ec9e2..410f77b 100644 --- a/code/code_gen/terms.input +++ b/code/code_gen/terms.input @@ -19,6 +19,6 @@ fu = (vn + sd) * nx t1 = sqr(fu') t2 = sqr(absk') -avg { fsd } +avg { c, fsd } avg fsd { t1, t2, fu, absk} diff --git a/code/m_openmpi.f90 b/code/m_openmpi.f90 new file mode 100644 index 0000000..9c22bdc --- /dev/null +++ b/code/m_openmpi.f90 @@ -0,0 +1,153 @@ +!================================================================================ +! Module contains interface to OpenMPI +! +! Time-stamp: <2009-08-20 14:22:13 (chumakov)> +!================================================================================ + + +module m_openmpi +!================================================================================ + implicit none + include 'mpif.h' + + ! Uncomment this for the systems that do not have OpenMPI + ! In OpenMPI, the parameter MPI_INTEGER_KIND is defined in 'mpif.h' + ! With other MPI implementations, this parameter has to be defined manually. + ! integer MPI_INTEGER_KIND + ! parameter (MPI_INTEGER_KIND = 4) + + ! --- MPI variables + logical :: iammaster + integer(kind=MPI_INTEGER_KIND) :: myid_world, numprocs_world + integer(kind=MPI_INTEGER_KIND) :: numprocs_hydro, numprocs_stats, numprocs_parts + integer(kind=MPI_INTEGER_KIND) :: myid, numprocs, master, mpi_err, mpi_info, mpi_provide + integer(kind=MPI_INTEGER_KIND) :: id_to, id_from, tag, count + integer(kind=MPI_INTEGER_KIND) :: id_root_hydro, id_root_stats, id_root_parts + + ! communicator for separate tasks + integer(kind=MPI_INTEGER_KIND) :: MPI_COMM_TASK + ! exclusive communicator for root processes of tasks + integer(kind=MPI_INTEGER_KIND) :: MPI_COMM_ROOTS + + integer (kind=MPI_INTEGER_KIND) :: sendtag, recvtag + integer (kind=MPI_INTEGER_KIND) :: request, request1, request2, request3, mpi_request + integer (kind=MPI_INTEGER_KIND) :: id_l, id_r + integer (kind=mpi_INTEGER_KIND) :: mpi_status(MPI_STATUS_SIZE) + + integer(kind=MPI_INTEGER_KIND) :: color, key + + character*5 :: task, split="nevah" + character*10 :: run_name_local + + logical :: task_split=.false. + +!================================================================================ +contains +!================================================================================ + + subroutine m_openmpi_init + + implicit none + + integer (kind=mpi_INTEGER_KIND) :: n + integer*4 :: np_local + integer :: i + + ! first getting the run name form the command line + ! (it's local, not global run_name) + ! also getting the parameter "split" which governs the process splitting: + ! split="split" means that hydro, statistics and particles are assigned three + ! separate process groups (they differ by the char*5 parameter "task"). + ! split="never" (default if the parameter is missing) means that all + ! processes do all tasks. (does not work for the particles at this point) + ! call openmpi_get_command_line + + + ! initializing MPI environment + !call MPI_INIT_THREAD(MPI_THREAD_SERIALIZED, mpi_provide, mpi_err) + call MPI_INIT(mpi_err) + call MPI_Comm_size(MPI_COMM_WORLD,numprocs_world,mpi_err) + call MPI_Comm_rank(MPI_COMM_WORLD,myid_world,mpi_err) + +!-------------------------------------------------------------------------------- +! Looking at the command line parameter called "split". If it equals "split" +! then we define task_split=.true. If not, task_split remains .false. (default) +!-------------------------------------------------------------------------------- + if (split == "split") task_split = .true. + +!-------------------------------------------------------------------------------- +! First check if we need to do any task splitting. If we don't (split="never") +! then we define task="hydro" and do a ficticious split with uniform color of +! all processors. +!-------------------------------------------------------------------------------- + task = 'hydro' + color = 0 + myid = myid_world + + call MPI_COMM_SPLIT(MPI_COMM_WORLD,color,myid,MPI_COMM_TASK,mpi_err) + call MPI_COMM_SIZE(MPI_COMM_TASK,numprocs,mpi_err) + call MPI_COMM_RANK(MPI_COMM_TASK,myid,mpi_err) + + + ! each task will have its master process + master = 0 + iammaster = .false. + if (myid.eq.master) iammaster=.true. + + +!!$ ! The following is put on hold because it looks like a crazy idea + +!!$ ! now creating separate exclusive communicator for the master nodes only +!!$ ! the name of the new communicator is MPI_COMM_ROOTS +!!$ ! if we want quickly broadcast something, then we can use two BCAST calls +!!$ color = 1 +!!$ if (iammaster) color = 0 +!!$ call MPI_COMM_SPLIT(MPI_COMM_WORLD,color,myid_world,MPI_COMM_ROOTS,mpi_err) + + + + return + end subroutine m_openmpi_init + +!================================================================================ + + subroutine m_openmpi_exit + + call MPI_COMM_FREE(MPI_COMM_TASK,mpi_err) + call MPI_FINALIZE(mpi_err) + + return + end subroutine m_openmpi_exit + + +!================================================================================ + + subroutine openmpi_get_command_line + implicit none + + character*80 :: tmp_str + integer :: iargc + + ! reading the run_name from the command line + if(iargc().eq.0) then + call getarg(0,tmp_str) + print*, 'Format: ',trim(tmp_str),' (run name) ["split"/"never"]' + stop + end if + call getarg(1,run_name_local) + if(len_trim(run_name_local).ne.10) then + print *, 'Run name: "',run_name_local,'"' + print *, ' "1234567890"' + print *, 'Length of run name is less than 10, sorry.' + stop + end if + + ! getting the split parameter, if it's there + if(iargc().eq.2) call getarg(2,split) + + + end subroutine openmpi_get_command_line + +!================================================================================ + +end module m_openmpi diff --git a/code/m_parameters.f90 b/code/m_parameters.f90 index b7f73eb..3e60021 100644 --- a/code/m_parameters.f90 +++ b/code/m_parameters.f90 @@ -1,5 +1,7 @@ module m_parameters + use m_openmpi + implicit none integer :: nxp,nyp,nzp @@ -24,6 +26,8 @@ module m_parameters integer, allocatable :: omit_t(:,:) + integer, allocatable :: file_dist(:) + real, parameter :: pi=3.14159265358979323846 real, parameter :: me=1.00e-20 @@ -53,6 +57,8 @@ subroutine read_intro integer :: first_file + integer :: file_count + real*8 :: tmp1, tmp2, tmp3 open (100, FILE='post-edge-cold-bc-hybrid-intro') @@ -121,6 +127,25 @@ subroutine read_intro close (101) + allocate (file_dist(startnum:endnum), stat=ierr) + + file_count = 0 + + distloop: DO i=startnum,endnum,skipnum + + IF ( .not. to_omit(i) ) THEN + + file_dist(i) = mod(file_count, numprocs) + + file_count = file_count + 1 + + ENDIF + + ENDDO distloop + + write(*,*) file_dist + + first_file = startnum fileloop: DO i=startnum,endnum,skipnum diff --git a/code/m_terms.f90 b/code/m_terms.f90 index 4d9b931..fdf728e 100644 --- a/code/m_terms.f90 +++ b/code/m_terms.f90 @@ -1,12 +1,13 @@ module m_terms +use m_openmpi use m_parameters use m_arrays use m_calculate implicit none -character (len = *), parameter :: output_header="x avg_fsd fsd_avg_t1 fsd_avg_t2 fsd_avg_fu fsd_avg_absk" +character (len = *), parameter :: output_header="x avg_c avg_fsd fsd_avg_t1 fsd_avg_t2 fsd_avg_fu fsd_avg_absk" real*8, allocatable, dimension(:,:,:) :: ddx_nx real*8, allocatable, dimension(:,:,:) :: t1_fsd real*8, allocatable, dimension(:,:,:) :: t2_fsd @@ -17,22 +18,23 @@ real*8, allocatable, dimension(:,:,:) :: ddx_c real*8, allocatable, dimension(:) :: fsd_avg_fu real*8, allocatable, dimension(:) :: fsd_avg_t2 real*8, allocatable, dimension(:) :: fsd_avg_t1 -real*8, allocatable, dimension(:,:,:) :: ny +real*8, allocatable, dimension(:,:,:) :: ddy_ny real*8, allocatable, dimension(:,:,:) :: wrate real*8, allocatable, dimension(:) :: avg_fsd real*8, allocatable, dimension(:) :: fsd_avg_absk real*8, allocatable, dimension(:,:,:) :: nx -real*8, allocatable, dimension(:,:,:) :: ddy_ny +real*8, allocatable, dimension(:,:,:) :: ny real*8, allocatable, dimension(:,:,:) :: nz real*8, allocatable, dimension(:,:,:) :: ddz_nz real*8, allocatable, dimension(:,:,:) :: fu real*8, allocatable, dimension(:,:,:) :: c +real*8, allocatable, dimension(:) :: avg_c real*8, allocatable, dimension(:,:,:) :: fsd real*8, allocatable, dimension(:,:,:) :: d2dy_c real*8, allocatable, dimension(:,:,:) :: d2dx_c real*8, allocatable, dimension(:,:,:) :: d2dz_c -real*8, allocatable, dimension(:,:,:) :: absk real*8, allocatable, dimension(:,:,:) :: sd +real*8, allocatable, dimension(:,:,:) :: absk contains @@ -51,22 +53,23 @@ allocate(ddx_c(nxp,nyp,nzp), stat=ierr) ; ddx_c = 0. allocate(fsd_avg_fu(nxp), stat=ierr) ; fsd_avg_fu = 0. allocate(fsd_avg_t2(nxp), stat=ierr) ; fsd_avg_t2 = 0. allocate(fsd_avg_t1(nxp), stat=ierr) ; fsd_avg_t1 = 0. -allocate(ny(nxp,nyp,nzp), stat=ierr) ; ny = 0. +allocate(ddy_ny(nxp,nyp,nzp), stat=ierr) ; ddy_ny = 0. allocate(wrate(nxp,nyp,nzp), stat=ierr) ; wrate = 0. allocate(avg_fsd(nxp), stat=ierr) ; avg_fsd = 0. allocate(fsd_avg_absk(nxp), stat=ierr) ; fsd_avg_absk = 0. allocate(nx(nxp,nyp,nzp), stat=ierr) ; nx = 0. -allocate(ddy_ny(nxp,nyp,nzp), stat=ierr) ; ddy_ny = 0. +allocate(ny(nxp,nyp,nzp), stat=ierr) ; ny = 0. allocate(nz(nxp,nyp,nzp), stat=ierr) ; nz = 0. allocate(ddz_nz(nxp,nyp,nzp), stat=ierr) ; ddz_nz = 0. allocate(fu(nxp,nyp,nzp), stat=ierr) ; fu = 0. allocate(c(nxp,nyp,nzp), stat=ierr) ; c = 0. +allocate(avg_c(nxp), stat=ierr) ; avg_c = 0. allocate(fsd(nxp,nyp,nzp), stat=ierr) ; fsd = 0. allocate(d2dy_c(nxp,nyp,nzp), stat=ierr) ; d2dy_c = 0. allocate(d2dx_c(nxp,nyp,nzp), stat=ierr) ; d2dx_c = 0. allocate(d2dz_c(nxp,nyp,nzp), stat=ierr) ; d2dz_c = 0. -allocate(absk(nxp,nyp,nzp), stat=ierr) ; absk = 0. allocate(sd(nxp,nyp,nzp), stat=ierr) ; sd = 0. +allocate(absk(nxp,nyp,nzp), stat=ierr) ; absk = 0. end subroutine m_terms_init @@ -84,22 +87,23 @@ deallocate(ddx_c) deallocate(fsd_avg_fu) deallocate(fsd_avg_t2) deallocate(fsd_avg_t1) -deallocate(ny) +deallocate(ddy_ny) deallocate(wrate) deallocate(avg_fsd) deallocate(fsd_avg_absk) deallocate(nx) -deallocate(ddy_ny) +deallocate(ny) deallocate(nz) deallocate(ddz_nz) deallocate(fu) deallocate(c) +deallocate(avg_c) deallocate(fsd) deallocate(d2dy_c) deallocate(d2dx_c) deallocate(d2dz_c) -deallocate(absk) deallocate(sd) +deallocate(absk) end subroutine m_terms_finalize @@ -123,6 +127,15 @@ call ddy ( ddy_c, c ) call d2dx ( d2dx_c, c ) call ddx ( ddx_c, c ) +do k = 1, nzp +do j = 1, nyp +do i = 1, nxp +avg_c(i) = avg_c(i) + c(i,j,k) +end do +end do +end do + + do k = 1, nzp do j = 1, nyp do i = 1, nxp @@ -132,6 +145,15 @@ end do end do +do k = 1, nzp +do j = 1, nyp +do i = 1, nxp +ny(i,j,k) = ( ( - ddy_c(i,j,k) ) / fsd(i,j,k) ) +end do +end do +end do + + do k = 1, nzp do j = 1, nyp do i = 1, nxp @@ -160,15 +182,6 @@ end do end do call ddx ( ddx_nx, nx ) - -do k = 1, nzp -do j = 1, nyp -do i = 1, nxp -ny(i,j,k) = ( ( - ddy_c(i,j,k) ) / fsd(i,j,k) ) -end do -end do -end do - call ddy ( ddy_ny, ny ) do k = 1, nzp @@ -191,6 +204,24 @@ end do call ddz ( ddz_nz, nz ) call d2dz ( d2dz_c, c ) +do k = 1, nzp +do j = 1, nyp +do i = 1, nxp +absk(i,j,k) = ( dabs ( ( ( ddx_nx(i,j,k) + ddy_ny(i,j,k) ) + ddz_nz(i,j,k) ) ) ) +end do +end do +end do + + +do k = 1, nzp +do j = 1, nyp +do i = 1, nxp +fsd_avg_absk(i) = fsd_avg_absk(i) + absk(i,j,k) * fsd(i,j,k) +end do +end do +end do + + do k = 1, nzp do j = 1, nyp do i = 1, nxp @@ -218,24 +249,6 @@ end do end do -do k = 1, nzp -do j = 1, nyp -do i = 1, nxp -absk(i,j,k) = ( dabs ( ( ( ddx_nx(i,j,k) + ddy_ny(i,j,k) ) + ddz_nz(i,j,k) ) ) ) -end do -end do -end do - - -do k = 1, nzp -do j = 1, nyp -do i = 1, nxp -fsd_avg_absk(i) = fsd_avg_absk(i) + absk(i,j,k) * fsd(i,j,k) -end do -end do -end do - - end subroutine m_terms_calculate_pass1 @@ -247,11 +260,28 @@ real*8 :: denum denum=real(nfiles*nyp*nzp) + +call MPI_ALLREDUCE(MPI_IN_PLACE, avg_c, nxp, MPI_REAL8, MPI_SUM, MPI_COMM_TASK, mpi_err) + +avg_c = avg_c / denum + + +call MPI_ALLREDUCE(MPI_IN_PLACE, avg_fsd, nxp, MPI_REAL8, MPI_SUM, MPI_COMM_TASK, mpi_err) + avg_fsd = avg_fsd / denum + + +call MPI_ALLREDUCE(MPI_IN_PLACE, fsd_avg_fu, nxp, MPI_REAL8, MPI_SUM, MPI_COMM_TASK, mpi_err) + fsd_avg_fu = fsd_avg_fu / denum / avg_fsd + + +call MPI_ALLREDUCE(MPI_IN_PLACE, fsd_avg_absk, nxp, MPI_REAL8, MPI_SUM, MPI_COMM_TASK, mpi_err) + fsd_avg_absk = fsd_avg_absk / denum / avg_fsd + end subroutine m_terms_average_pass1 @@ -406,10 +436,18 @@ real*8 :: denum denum=real(nfiles*nyp*nzp) + +call MPI_ALLREDUCE(MPI_IN_PLACE, fsd_avg_t1, nxp, MPI_REAL8, MPI_SUM, MPI_COMM_TASK, mpi_err) + fsd_avg_t1 = fsd_avg_t1 / denum / avg_fsd + + +call MPI_ALLREDUCE(MPI_IN_PLACE, fsd_avg_t2, nxp, MPI_REAL8, MPI_SUM, MPI_COMM_TASK, mpi_err) + fsd_avg_t2 = fsd_avg_t2 / denum / avg_fsd + end subroutine m_terms_average_pass2 @@ -423,7 +461,7 @@ open (200, file="qEdge_X.dat") write (200,*) output_header do i=1,nxp - write (200,'(6e20.10)') real(i)*hxp, avg_fsd(i), fsd_avg_t1(i), fsd_avg_t2(i), fsd_avg_fu(i), fsd_avg_absk(i) + write (200,'(7e20.10)') real(i)*hxp, avg_c(i), avg_fsd(i), fsd_avg_t1(i), fsd_avg_t2(i), fsd_avg_fu(i), fsd_avg_absk(i) end do close (200) diff --git a/code/makefile b/code/makefile index db687db..392eff4 100644 --- a/code/makefile +++ b/code/makefile @@ -12,11 +12,12 @@ ifdef DEBUG flags += -g endif -compiler = gfortran +compiler = mpif90 # Modules MODULES += \ + m_openmpi.o\ Compact.o\ m_parameters.o\ m_calculate.o\ diff --git a/code/post.f90 b/code/post.f90 index 52e51c0..13bd2d9 100644 --- a/code/post.f90 +++ b/code/post.f90 @@ -23,7 +23,7 @@ CALL ALLOCATE_ARRAYS - CALL PRINT_BANNER + if (iammaster) CALL PRINT_BANNER countnum=0 @@ -41,9 +41,13 @@ ELSE countnum=countnum+1 - CALL READ_FILE(fread) + IF (file_dist(fread).eq.myid) THEN - CALL m_terms_calculate_pass1 + CALL READ_FILE(fread) + + CALL m_terms_calculate_pass1 + + END IF ENDIF @@ -67,9 +71,13 @@ ELSE - CALL READ_FILE(fread) + IF (file_dist(fread).eq.myid) THEN - CALL m_terms_calculate_pass2 + CALL READ_FILE(fread) + + CALL m_terms_calculate_pass2 + + ENDIF ENDIF @@ -77,13 +85,14 @@ CALL m_terms_average_pass2(countnum) - CALL m_terms_write_result + if (iammaster) CALL m_terms_write_result CALL DEALLOCATES_CLOSE WRITE(*,*) ' Avergaing RAW data is FINISHED' WRITE(*,*) 'qEdge_X.dat is generated' + END SUBROUTINE main !======================================================================================== @@ -141,84 +150,6 @@ END SUBROUTINE READ_FILE -! SUBROUTINE SAVE_AVG_RESULTS -! INTEGER :: i -! OPEN (200,FILE="qEdge_X.dat") -! ! IRE1 -! WRITE(200,*) 'VARIABLES = "X","","","","","","",""' ! 8 -! !WRITE(200,*) 'VARIABLES = "X","","","","","","","",""' ! 9 -! ! WRITE(200,*) '"","","","","","","",""' ! 8 -> 17 -! ! WRITE(200,*) '"","_g",""' ! 3 -> 20 -! ! WRITE(200,*) '"d(1-)/dx","d(1-)/dy","d(1-)/dz"' ! 3 -> 23 -! ! WRITE(200,*) '"","","",""' ! 4 -> 27 -! ! WRITE(200,*) '"",""' ! 2 -> 29 -! -! ! IRE2 -! ! WRITE(200,*) '"","f","f","f","f","f","f","f"' ! 8 -> 8 -! ! WRITE(200,*) '"f","<|DivN|>f","<(dc/dx)/c>f"' ! 3 -> 11 -! ! WRITE(200,*) '"<-(dc/dn)/c>f","<(1/FSD`)*d(FSD`)/dx>f","<(1/FSD`)*d(FSD`)/dy>f"' ! 3 -> 14 -! ! WRITE(200,*) '"<(1/FSD`)*d(FSD`)/dz>f","f","f","f","f","f","f"' ! 7 -> 21 -! ! WRITE(200,*) '"f","f","f","f","f"' ! 5 -> 26 -! ! WRITE(200,*) '"f dot f","f","f dot f","f"' ! 4 -> 30 -! ! WRITE(200,*) '"|f|","f","df/dx"' ! 3 -> 33 -! ! WRITE(200,*) '"-f"' ! 1 -> 34 -! -! ! IRE3 -! WRITE(200,*) '"b","b","b","b","b_g","b_g","b_g","b_g"' ! 8 -> 8 -! ! IRE4 -! WRITE(200,*) '"u","u","u","u","u_g","u_g","u_g","u_g"' ! 8 -> 8 -! ! IRE5 -! WRITE(200,*) '"RMS(u`)","RMS(v`)","RMS(w`)",""' ! 4 -> 4 -! WRITE(200,*) '"RMS(u`)b","RMS(v`)b","RMS(w`)b","b"' ! 4 -> 8 -! WRITE(200,*) '"RMS(u`)u","RMS(v`)u","RMS(w`)u","u"' ! 4 -> 12 -! !WRITE(200,*) '"","",""' ! 3 -> 15 -! WRITE(200,*) '"","RMS(ux`)","RMS(uy`)"' ! 3 -> 15 -! WRITE(200,*) '"RMS(uz`)"' ! 1 -> 16 -! WRITE(200,*) '"RMS( U`)","RMS(ux`)_b","RMS(uy`)_b","RMS(uz`)_b"' ! 4 -> 20 -! WRITE(200,*) '"RMS(U`)_b","RMS(ux`)_u","RMS(uy`)_u","RMS(uz`)_u"' ! 4 -> 24 -! WRITE(200,*) '"RMS(U`)_u"' ! 1 -> 25 -! ! -! ! IRE6 -! WRITE(200,*) '"RMS(u`)_g","RMS(v`)_g","RMS(w`)_g","_g"' ! 4 -> 4 -! WRITE(200,*) '"RMS(u`)b_g","RMS(v`)b_g","RMS(w`)b_g","b_g"' ! 4 -> 8 -! WRITE(200,*) '"RMS(u`)u_g","RMS(v`)u_g","RMS(w`)u_g","u_g"' ! 4 -> 12 -! WRITE(200,*) '"_g","_g","_g"' ! 3 -> 15 -! !! IRE7 -! ! WRITE(200,*) '"k","k","k"' ! 3 -> 3 -! ! WRITE(200,*) '"k","k","k"' ! 3 -> 6 -! !! IRE8 -! ! WRITE(200,*) '"(1/)*(d/dx)","(1/)*(d/dx)","Dt_x","Dt_x_g"' ! 4 -> 4 -! ! WRITE(200,*) '"1/Lw_3_High_Turb"' ! 1 -> 5 -! ! WRITE(200,*) '"ST1","ST2","ST3","ST4","ST5","Lm*_x","Lm*_n","Lw","Lw_3"' ! 9 -> 14 -! ! WRITE(200,*) '"d/dx","Dts"' ! 2 -> 16 -! ! WRITE(200,*) '"(1/(1-))*(d(1-)/dx)"' ! 1 -> 17 -! ! WRITE(200,*) '"1/L_LE_3","1/L_LE_4","ST6","ST7","ST8"' ! 5 -> 22 -! ! WRITE(200,*) '"1/L_LE_5=1/Lm-f","ST_9"' ! 2 -> 24 -! ! WRITE(200,*) '"1/L_LE_6=1/(d/dx)*(d2/dx2)","ST_10"' ! 2 -> 26 -! ! -! !! IRE9 -! ! WRITE(200,*) '"dotGrad.","Dts*Lap.","f*"' ! 3 -> 3 -! ! WRITE(200,*) '"Dts**Div.(f)","f*","cEqnBalance"' ! 3 -> 6 -! ! WRITE(200,*) '"K","f/K","d
/dx"' ! 3 -> 9 -! ! WRITE(200,*) '"d/dx","1/(d<1-c>/dx)*(d2<1-c>/dx2)"' ! 2 -> 11 -! ! WRITE(200,*) '"1/(1-)*(d(1-)/dx)","d(L_LE)/dx","d(L_TE)/dx"' ! 3 -> 14 -! -! -! DO i=1,nxp -! ! WRITE(200,'(156e20.10)') REAL(i)*hxp,IRE1(1:28,i),IRE2(1:34,i),IRE3(1:8,i),& ! 1+28+34+8 = 71 -! ! IRE4(1:8,i),IRE5(1:16,i),IRE6(1:15,i),IRE7(1:6,i),IRE8(1:26,i),IRE9(1:14,i) -! ! ! 8+16+15+6+26+14 = 85 -> 156 -! WRITE(200,'(64e20.10)') REAL(i)*hxp,IRE1(1:7,i),IRE3(1:8,i),& ! 1+7+8 =16 -! IRE4(1:8,i),IRE5(1:25,i),IRE6(1:15,i) -! ! 8+25+15=48 -> 64 -! ENDDO -! -! -! CLOSE(200) -! !CLOSE(210) -! -! END SUBROUTINE SAVE_AVG_RESULTS - SUBROUTINE ALLOCATE_ARRAYS INTEGER :: ierr @@ -239,6 +170,7 @@ END SUBROUTINE ALLOCATE_ARRAYS + SUBROUTINE DEALLOCATES_CLOSE CALL m_arrays_finalize @@ -249,6 +181,9 @@ DEALLOCATE(new_scalar) IF(omitnum.gt.0) DEALLOCATE(omit_t) + + DEALLOCATE(file_dist) + END SUBROUTINE DEALLOCATES_CLOSE END MODULE post diff --git a/code/test.f90 b/code/test.f90 index bbe2343..9f40ed8 100644 --- a/code/test.f90 +++ b/code/test.f90 @@ -3,9 +3,14 @@ ! Purpose of this code is to postprocess results of stagnating DNS code PROGRAM test + USE m_openmpi USE post USE Compact + CALL m_openmpi_init + CALL main + CALL m_openmpi_exit + END PROGRAM