diff --git a/code/Compact.f90 b/code/Compact.f90 index 6bb0adc..6741278 100644 --- a/code/Compact.f90 +++ b/code/Compact.f90 @@ -10,13 +10,13 @@ use, intrinsic :: iso_fortran_env, only: real64 IMPLICIT NONE - REAL(KIND=8), DIMENSION(:), ALLOCATABLE :: lxf,lxs,wxf,wxs, & !< x-방향 LU Decomposition 밴드 계수 + real(real64), DIMENSION(:), ALLOCATABLE :: lxf,lxs,wxf,wxs, & !< x-방향 LU Decomposition 밴드 계수 lyf,lys,wyf,wys, & !< y-방향 LU Decomposition 밴드 계수 lzf,lzs,wzf,wzs !< z-방향 LU Decomposition 밴드 계수 INTEGER :: nxc,nyc,nzc !< 각 방향의 실제 격자 사이즈 수치 (x, y, z) - REAL(KIND=8), PARAMETER :: ezero = 1.0e-14 + real(real64), PARAMETER :: ezero = 1.0e-14 CONTAINS @@ -224,8 +224,8 @@ SUBROUTINE test_nonp_lud1(xx, coef) INTEGER :: xx - REAL(KIND=8), DIMENSION(xx) :: aa - REAL(KIND=8), DIMENSION(xx), INTENT(OUT) :: coef + real(real64), DIMENSION(xx) :: aa + real(real64), DIMENSION(xx), INTENT(OUT) :: coef aa=3. aa(1)=0.5 ; aa(2)=4. aa(xx-1)=4. ; aa(xx)=0.5 @@ -236,8 +236,8 @@ SUBROUTINE test_nonp_lud2(xx, coef) INTEGER :: xx - REAL(KIND=8), DIMENSION(xx) :: aa - REAL(KIND=8), DIMENSION(xx), INTENT(OUT) :: coef + real(real64), DIMENSION(xx) :: aa + real(real64), DIMENSION(xx), INTENT(OUT) :: coef aa=5.5 aa(1)=2./11. ; aa(2)=10. aa(xx-1)=10. ; aa(xx)=2./11. @@ -248,8 +248,8 @@ SUBROUTINE test_p_lud1(xx, coef1, coef2) INTEGER :: xx - REAL(KIND=8) :: a - REAL(KIND=8), DIMENSION(xx), INTENT(OUT) :: coef1, coef2 + real(real64) :: a + real(real64), DIMENSION(xx), INTENT(OUT) :: coef1, coef2 a=3. ! first derivative CALL ptdlu(a,xx,coef1,coef2) ! x-direction @@ -258,8 +258,8 @@ SUBROUTINE test_p_lud2(xx, coef1, coef2) INTEGER :: xx - REAL(KIND=8) :: a - REAL(KIND=8), DIMENSION(xx), INTENT(OUT) :: coef1, coef2 + real(real64) :: a + real(real64), DIMENSION(xx), INTENT(OUT) :: coef1, coef2 a=11./2. ! second derivative CALL ptdlu(a,xx,coef1,coef2) ! x-direction @@ -268,7 +268,7 @@ SUBROUTINE nonp_lud(xyz,xx) INTEGER :: i,xyz,xx - REAL(KIND=8), DIMENSION(xx) :: aa + real(real64), DIMENSION(xx) :: aa aa=3. aa(1)=0.5 ; aa(2)=4. aa(xx-1)=4. ; aa(xx)=0.5 @@ -288,7 +288,7 @@ SUBROUTINE p_lud(xyz,xx) INTEGER :: i,xyz,xx - REAL(KIND=8) :: a + real(real64) :: a a=3. ! first derivative IF (xyz.eq.1) CALL ptdlu(a,xx,lxf,wxf) ! x-direction IF (xyz.eq.2) CALL ptdlu(a,xx,lyf,wyf) ! y-direction @@ -301,9 +301,9 @@ SUBROUTINE stdlu(a,n,l) INTEGER :: n - REAL(KIND=8), INTENT(IN) :: a(n) - REAL(KIND=8), INTENT(OUT) :: l(n) - REAL(KIND=8) :: d + real(real64), INTENT(IN) :: a(n) + real(real64), INTENT(OUT) :: l(n) + real(real64) :: d INTEGER :: i l(1)=1.0d0/a(1) DO i=2,n @@ -314,10 +314,10 @@ SUBROUTINE ptdlu(a,n,l,w) INTEGER :: n - REAL(KIND=8), INTENT(IN) :: a - REAL(KIND=8), INTENT(OUT) :: l(n),w(n) + real(real64), INTENT(IN) :: a + real(real64), INTENT(OUT) :: l(n),w(n) INTEGER :: i - REAL(KIND=8) :: aa(n),d + real(real64) :: aa(n),d DO i=1,n-1 aa(i)=a @@ -342,11 +342,11 @@ SUBROUTINE rhs1np(n,h,x,dx,nd) INTEGER,INTENT(IN) :: n,nd - REAL(KIND=8),INTENT(IN) :: h - REAL(KIND=8),INTENT(IN),DIMENSION(nd,n) :: x - REAL(KIND=8),INTENT(OUT),DIMENSION(nd,n) :: dx + real(real64),INTENT(IN) :: h + real(real64),INTENT(IN),DIMENSION(nd,n) :: x + real(real64),INTENT(OUT),DIMENSION(nd,n) :: dx INTEGER :: i,j - REAL(KIND=8) :: r1,r2,r3,a,b,c,h1,t1,t2,t3,t4 + real(real64) :: r1,r2,r3,a,b,c,h1,t1,t2,t3,t4 h1=1.d0/h @@ -383,11 +383,11 @@ SUBROUTINE dfnonp(n,h,x,dx,nd,dir) INTEGER,INTENT(IN) :: n,nd,dir - REAL(KIND=8),INTENT(IN) :: h - REAL(KIND=8),INTENT(IN),DIMENSION(nd,n) :: x - REAL(KIND=8),INTENT(OUT),DIMENSION(nd,n) :: dx + real(real64),INTENT(IN) :: h + real(real64),INTENT(IN),DIMENSION(nd,n) :: x + real(real64),INTENT(OUT),DIMENSION(nd,n) :: dx INTEGER :: i,j - REAL(KIND=8) :: r1,r2,r3,a,b,c,h1,t1,t2,t3,t4 + real(real64) :: r1,r2,r3,a,b,c,h1,t1,t2,t3,t4 CALL rhs1np (n,h,x,dx,nd) @@ -398,11 +398,11 @@ SUBROUTINE dfp(n,h,x,dx,nd,dir) INTEGER,INTENT(IN) :: n,nd,dir - REAL(KIND=8),INTENT(IN) :: h - REAL(KIND=8),INTENT(IN),DIMENSION(nd,n) :: x - REAL(KIND=8),INTENT(OUT),DIMENSION(nd,n) :: dx + real(real64),INTENT(IN) :: h + real(real64),INTENT(IN),DIMENSION(nd,n) :: x + real(real64),INTENT(OUT),DIMENSION(nd,n) :: dx INTEGER :: i,j - REAL(KIND=8) :: r1,r2,h1 + real(real64) :: r1,r2,h1 ! print *, "dfnonp received (nd,n)", nd, n @@ -437,10 +437,10 @@ SUBROUTINE ptdslv(r,n,l,w,nd) INTEGER,INTENT(IN) :: n,nd - REAL(KIND=8),INTENT(INOUT),DIMENSION(nd,n) :: r - REAL(KIND=8),INTENT(IN),DIMENSION(n) :: l,w + real(real64),INTENT(INOUT),DIMENSION(nd,n) :: r + real(real64),INTENT(IN),DIMENSION(n) :: l,w INTEGER i,j - REAL(KIND=8), DIMENSION(nd) :: sum + real(real64), DIMENSION(nd) :: sum DO j=1,nd sum(j)=w(1)*r(j,1) r(j,1)=r(j,1)*l(1) @@ -465,11 +465,11 @@ SUBROUTINE d2fp(n,h,x,dx,nd,dir) INTEGER,INTENT(IN) :: n,nd,dir - REAL(KIND=8),INTENT(IN) :: h - REAL(KIND=8),INTENT(IN),DIMENSION(nd,n) :: x - REAL(KIND=8),INTENT(OUT),DIMENSION(nd,n) :: dx + real(real64),INTENT(IN) :: h + real(real64),INTENT(IN),DIMENSION(nd,n) :: x + real(real64),INTENT(OUT),DIMENSION(nd,n) :: dx INTEGER :: i,j - REAL(KIND=8) :: h2,r1,r2,t1,t2 + real(real64) :: h2,r1,r2,t1,t2 h2=1./(h*h) @@ -530,10 +530,10 @@ SUBROUTINE tdslv(r,n,l,nd) INTEGER,INTENT(IN) :: n,nd - REAL(KIND=8),INTENT(INOUT),DIMENSION(nd,n) :: r - REAL(KIND=8),INTENT(IN),DIMENSION(n) :: l + real(real64),INTENT(INOUT),DIMENSION(nd,n) :: r + real(real64),INTENT(IN),DIMENSION(n) :: l INTEGER i,j - REAL(KIND=8) t1 + real(real64) t1 DO j=1,nd r(j,1)=r(j,1)*l(1) ENDDO @@ -552,11 +552,11 @@ SUBROUTINE d2fnonp(n,h,x,dx,nd,dir) INTEGER,INTENT(IN) :: n,nd,dir - REAL(KIND=8),INTENT(IN) :: h - REAL(KIND=8),INTENT(IN),DIMENSION(nd,n) :: x - REAL(KIND=8),INTENT(OUT),DIMENSION(nd,n) :: dx + real(real64),INTENT(IN) :: h + real(real64),INTENT(IN),DIMENSION(nd,n) :: x + real(real64),INTENT(OUT),DIMENSION(nd,n) :: dx INTEGER :: i,j - REAL(KIND=8) :: h2,r1,r2,r3,a,b,c,e,t1,t2 + real(real64) :: h2,r1,r2,r3,a,b,c,e,t1,t2 h2=1./(h*h) diff --git a/code/m_calculate.f90 b/code/m_calculate.f90 index 1c004a0..086f5e0 100644 --- a/code/m_calculate.f90 +++ b/code/m_calculate.f90 @@ -76,8 +76,8 @@ contains subroutine ddx1d(dst, src) - real*8, dimension(1,nxp), intent(in) :: src - real*8, dimension(1,nxp), intent(out) :: dst + real(real64), dimension(1,nxp), intent(in) :: src + real(real64), dimension(1,nxp), intent(out) :: dst integer :: i, j ,k integer :: ju @@ -93,8 +93,8 @@ contains !! @param dst 3D output derivative field (nxp, nyp, nzp). subroutine ddx(dst, src) - real*8, dimension(nxp,nyp,nzp), intent(in) :: src - real*8, dimension(nxp,nyp,nzp), intent(out) :: dst + real(real64), dimension(nxp,nyp,nzp), intent(in) :: src + real(real64), dimension(nxp,nyp,nzp), intent(out) :: dst integer :: i, j ,k integer :: ju @@ -123,8 +123,8 @@ contains !! @param dst 3D output derivative field (nxp, nyp, nzp). subroutine ddy(dst, src) - real*8, dimension(nxp,nyp,nzp), intent(in) :: src - real*8, dimension(nxp,nyp,nzp), intent(out) :: dst + real(real64), dimension(nxp,nyp,nzp), intent(in) :: src + real(real64), dimension(nxp,nyp,nzp), intent(out) :: dst integer :: i, j ,k @@ -144,8 +144,8 @@ contains !! @param dst 3D output derivative field (nxp, nyp, nzp). subroutine ddz(dst, src) - real*8, dimension(nxp,nyp,nzp), intent(in) :: src - real*8, dimension(nxp,nyp,nzp), intent(out) :: dst + real(real64), dimension(nxp,nyp,nzp), intent(in) :: src + real(real64), dimension(nxp,nyp,nzp), intent(out) :: dst integer :: i, j ,k @@ -168,8 +168,8 @@ contains subroutine d2dx1d(dst, src) - real*8, dimension(nxp), intent(in) :: src - real*8, dimension(nxp), intent(out) :: dst + real(real64), dimension(nxp), intent(in) :: src + real(real64), dimension(nxp), intent(out) :: dst integer :: i, j ,k integer :: ju @@ -181,8 +181,8 @@ contains subroutine d2dx(dst, src) - real*8, dimension(nxp,nyp,nzp), intent(in) :: src - real*8, dimension(nxp,nyp,nzp), intent(out) :: dst + real(real64), dimension(nxp,nyp,nzp), intent(in) :: src + real(real64), dimension(nxp,nyp,nzp), intent(out) :: dst integer :: i, j ,k integer :: ju @@ -207,8 +207,8 @@ contains subroutine d2dy(dst, src) - real*8, dimension(nxp,nyp,nzp), intent(in) :: src - real*8, dimension(nxp,nyp,nzp), intent(out) :: dst + real(real64), dimension(nxp,nyp,nzp), intent(in) :: src + real(real64), dimension(nxp,nyp,nzp), intent(out) :: dst integer :: i, j ,k @@ -224,8 +224,8 @@ contains subroutine d2dz(dst, src) - real*8, dimension(nxp,nyp,nzp), intent(in) :: src - real*8, dimension(nxp,nyp,nzp), intent(out) :: dst + real(real64), dimension(nxp,nyp,nzp), intent(in) :: src + real(real64), dimension(nxp,nyp,nzp), intent(out) :: dst integer :: i, j ,k @@ -251,8 +251,8 @@ contains integer,intent(in) :: nx - real*8,intent(out) :: a(nb,nx) - real*8,intent(in) :: b(nx,nb) + real(real64),intent(out) :: a(nb,nx) + real(real64),intent(in) :: b(nx,nb) call tp2(a, b, nb, nx) @@ -264,8 +264,8 @@ contains implicit none integer,intent(in) :: n1, n2 - real*8,intent(out) :: a(n1,n2) - real*8,intent(in) :: b(n2,n1) + real(real64),intent(out) :: a(n1,n2) + real(real64),intent(in) :: b(n2,n1) integer :: i,j,ii,jj DO jj=1,n2,nb diff --git a/code/m_parameters.f90 b/code/m_parameters.f90 index b7d8090..c7ea23e 100644 --- a/code/m_parameters.f90 +++ b/code/m_parameters.f90 @@ -131,7 +131,15 @@ subroutine read_intro allocate (file_dist(startnum:endnum), stat=ierr) + if (ierr /= 0) then + write(0,*) "Error: allocation of file_dist failed on process", myid + call MPI_ABORT(MPI_COMM_TASK, 1, mpi_err) + end if allocate (export_offset(startnum:endnum), stat=ierr) + if (ierr /= 0) then + write(0,*) "Error: allocation of export_offset failed on process", myid + call MPI_ABORT(MPI_COMM_TASK, 1, mpi_err) + end if file_count = 0 diff --git a/code/makefile b/code/makefile index c586fac..cb95099 100644 --- a/code/makefile +++ b/code/makefile @@ -1,8 +1,7 @@ -#flags = -r8 -i8 -msse3 -O3 -axT -m64 -fPIC -i_dynamic -openmp -#Neuman flags -#flags = -O3 -r8 -i8 -openmp -msse3 -axSSSE3 -m64 -fPIC -i_dynamic -#Cluster_2(16.161) flags - +CC?=gcc +FC = mpif90 +LD?=ld +PYTHON?=python3 BLOCKSIZE?=32 @@ -20,8 +19,6 @@ endif flags += -cpp -DBLOCKSIZE=$(BLOCKSIZE) -Wall -ffree-line-length-0 -fdefault-integer-8 -fdefault-double-8 -fdefault-real-8 -march=native -fallow-argument-mismatch -compiler = mpif90 - # Modules MODULES += \ @@ -42,15 +39,15 @@ ODATA = build_info.odata latex_equations.odata Post_Cbar_FSD_Incomp : x-edge-cold-bc-uPrime-hybrid x-edge-cold-bc-uPrime-hybrid : ${MODULES} ${OBJ} print_build_info.o ${ODATA} - ${compiler} -o x-edge-cold-bc-uPrime-hybrid ${flags} ${MODULES} ${OBJ} print_build_info.o ${ODATA} + ${FC} -o x-edge-cold-bc-uPrime-hybrid ${flags} ${MODULES} ${OBJ} print_build_info.o ${ODATA} ${OBJ} : ${MODULES} m_terms.f90 : code_gen/code_gen.py ${TERMSPEC} code_gen/resources/m_template.py - python code_gen/code_gen.py ${TERMSPEC} > $@ + ${PYTHON} code_gen/code_gen.py ${TERMSPEC} > $@ %.o: %.f90 - ${compiler} -c ${flags} $< + ${FC} -c ${flags} $< cleanAll: clean rm -f m_terms.f90 @@ -62,26 +59,26 @@ test : test_calculate ./test_calculate test_field : test_field.o m_openmpi.o m_parameters.o Compact.o m_calculate.o m_arrays.o - ${compiler} -o test_field ${flags} m_openmpi.o m_parameters.o Compact.o m_calculate.o m_arrays.o test_field.o + ${FC} -o test_field ${flags} m_openmpi.o m_parameters.o Compact.o m_calculate.o m_arrays.o test_field.o test_calculate : test_calculate.o - ${compiler} -o test_calculate ${flags} m_openmpi.o m_parameters.o Compact.o m_calculate.o test_calculate.o + ${FC} -o test_calculate ${flags} m_openmpi.o m_parameters.o Compact.o m_calculate.o test_calculate.o test_calculate.o : m_openmpi.o m_parameters.o Compact.o m_calculate.o test_compact : Compact.o test_compact.o - ${compiler} -o test_compact ${flags} Compact.o test_compact.o + ${FC} -o test_compact ${flags} Compact.o test_compact.o test_compact.o : Compact.o print_build_info.o : print_build_info.c - gcc -c print_build_info.c + ${CC} -c print_build_info.c %.odata : %.txt - ld -r -b binary -o $@ $< + ${LD} -r -b binary -o $@ $< -build_info.txt : ${TEMSPEC} - python code_gen/code_gen.py -b ${TERMSPEC} > $@ +build_info.txt : ${TERMSPEC} + ${PYTHON} code_gen/code_gen.py -b ${TERMSPEC} > $@ -latex_equations.txt : ${TEMSPEC} - python code_gen/code_gen.py -x ${TERMSPEC} > $@ +latex_equations.txt : ${TERMSPEC} + ${PYTHON} code_gen/code_gen.py -x ${TERMSPEC} > $@ diff --git a/code/post.f90 b/code/post.f90 index 8d291bc..120d64a 100644 --- a/code/post.f90 +++ b/code/post.f90 @@ -269,6 +269,7 @@ MODULE post IF(omitnum.gt.0) DEALLOCATE(omit_t) DEALLOCATE(file_dist) + DEALLOCATE(export_offset) END SUBROUTINE DEALLOCATES_CLOSE diff --git a/code/post_dns.f90 b/code/post_dns.f90 index 58b3631..88fef14 100644 --- a/code/post_dns.f90 +++ b/code/post_dns.f90 @@ -31,7 +31,12 @@ !First, make sure the right number of inputs have been provided - IF(COMMAND_ARGUMENT_COUNT() > 0) THEN + IF(COMMAND_ARGUMENT_COUNT() > 1) THEN + + WRITE(*,*) 'ERROR, TOO MANY COMMAND-LINE ARGUMENTS(MORE THAN ONE). STOPPING' + STOP + + ELSE IF(COMMAND_ARGUMENT_COUNT() > 0) THEN CALL GET_COMMAND_ARGUMENT(1,num1char) !first, read in the two values @@ -52,11 +57,6 @@ STOP - ELSE IF(COMMAND_ARGUMENT_COUNT() > 1) THEN - - WRITE(*,*) 'ERROR, TOO MANY COMMAND-LINE ARGUMENTS(MORE THAN ONE). STOPPING' - STOP - ELSE CALL m_openmpi_init