mpi based data parallel post processing with generated term calculation

This commit is contained in:
ignis 2019-04-29 23:39:04 +09:00
parent 5943744e64
commit 600558334f
9 changed files with 291 additions and 125 deletions

View file

@ -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

View file

@ -1,5 +1,6 @@
module m_{0[module_name]}
use m_openmpi
use m_parameters
use m_arrays
use m_calculate

View file

@ -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}

153
code/m_openmpi.f90 Normal file
View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -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\

View file

@ -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","<C>","<FSD>","<Yr>","<Wc/rho>","<u>","<v>","<w>"' ! 8
! !WRITE(200,*) 'VARIABLES = "X","<C>","<FSD>","<Yr>","<Wc/rho>","<u>","<v>","<w>","<rho>"' ! 9
! ! WRITE(200,*) '"<T>","<D>","<dc/dx>","<dc/dy>","<dc/dz>","<du/dx>","<dv/dy>","<dw/dz>"' ! 8 -> 17
! ! WRITE(200,*) '"<Div(rho*V)>","<c>_g","<d2c/dn2>"' ! 3 -> 20
! ! WRITE(200,*) '"d(1-<c>)/dx","d(1-<c>)/dy","d(1-<c>)/dz"' ! 3 -> 23
! ! WRITE(200,*) '"<Lap.(c)>","<d2c/dx2>","<d2c/dy2>","<d2c/dz2>"' ! 4 -> 27
! ! WRITE(200,*) '"<Nx*(d2c/dn2)>","<d2(1-c)/dx2>"' ! 2 -> 29
!
! ! IRE2
! ! WRITE(200,*) '"<FSD2>","<Sd>f","<Sdr>f","<Sdd>f","<Sdn>f","<Sdt>f","<Sdd2>f","<Sd2>f"' ! 8 -> 8
! ! WRITE(200,*) '"<DivN>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","<Nx>f","<Ny>f","<Nz>f","<u>f","<v>f","<w>f"' ! 7 -> 21
! ! WRITE(200,*) '"<vn>f","<N dot N>f","<d(vn)/dn>f","<d(Sd)/dn>f","<d(Vn+Sd)/dn>f"' ! 5 -> 26
! ! WRITE(200,*) '"<v>f dot <N>f","<v``dot N``>f","<N>f dot <N>f","<N``dot N``>f"' ! 4 -> 30
! ! WRITE(200,*) '"|<N>f|","<vn+Sd>f","d<Nx>f/dx"' ! 3 -> 33
! ! WRITE(200,*) '"-<N dot (grad.(FSD`))/FSD`>f"' ! 1 -> 34
!
! ! IRE3
! WRITE(200,*) '"<u>b","<v>b","<w>b","<rho>b","<u>b_g","<v>b_g","<w>b_g","<rho>b_g"' ! 8 -> 8
! ! IRE4
! WRITE(200,*) '"<u>u","<v>u","<w>u","<rho>u","<u>u_g","<v>u_g","<w>u_g","<rho>u_g"' ! 8 -> 8
! ! IRE5
! WRITE(200,*) '"RMS(u`)","RMS(v`)","RMS(w`)","<k>"' ! 4 -> 4
! WRITE(200,*) '"RMS(u`)b","RMS(v`)b","RMS(w`)b","<k>b"' ! 4 -> 8
! WRITE(200,*) '"RMS(u`)u","RMS(v`)u","RMS(w`)u","<k>u"' ! 4 -> 12
! !WRITE(200,*) '"<u`c`>","<v`c`>","<w`c`>"' ! 3 -> 15
! WRITE(200,*) '"<u`c`>","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","<k>_g"' ! 4 -> 4
! WRITE(200,*) '"RMS(u`)b_g","RMS(v`)b_g","RMS(w`)b_g","<k>b_g"' ! 4 -> 8
! WRITE(200,*) '"RMS(u`)u_g","RMS(v`)u_g","RMS(w`)u_g","<k>u_g"' ! 4 -> 12
! WRITE(200,*) '"<u`c`>_g","<v`c`>_g","<w`c`>_g"' ! 3 -> 15
! !! IRE7
! ! WRITE(200,*) '"<vn>k<d2c/dn2>","<sd>k<d2c/dn2>","<vn+sd>k<d2c/dn2>"' ! 3 -> 3
! ! WRITE(200,*) '"<vn>k","<sd>k","<vn+sd>k"' ! 3 -> 6
! !! IRE8
! ! WRITE(200,*) '"(1/<c>)*(d<c>/dx)","(1/<FSD>)*(d<FSD>/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<FSD>/dx","Dts"' ! 2 -> 16
! ! WRITE(200,*) '"(1/(1-<c>))*(d(1-<c>)/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-<DivN>f","ST_9"' ! 2 -> 24
! ! WRITE(200,*) '"1/L_LE_6=1/(d<c>/dx)*(d2<c>/dx2)","ST_10"' ! 2 -> 26
! !
! !! IRE9
! ! WRITE(200,*) '"<v>dotGrad.<c>","Dts*Lap.<c>","<Sd>f*<FSD>"' ! 3 -> 3
! ! WRITE(200,*) '"Dts*<FSD>*Div.(<n>f)","<V`` dot N``>f*<FSD>","cEqnBalance"' ! 3 -> 6
! ! WRITE(200,*) '"<Nx>K","<Nx>f/<Nx>K","d<Dt>/dx"' ! 3 -> 9
! ! WRITE(200,*) '"d<Dm+Dt>/dx","1/(d<1-c>/dx)*(d2<1-c>/dx2)"' ! 2 -> 11
! ! WRITE(200,*) '"1/(1-<c>)*(d(1-<c>)/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

View file

@ -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