From fa1d5bcec80110dac19bc8afed90bec4fbdeb9ce Mon Sep 17 00:00:00 2001 From: Yeongdo Park Date: Sat, 16 Mar 2019 15:03:57 -0400 Subject: [PATCH] array for variable diffusivity --- .gitlab-ci.yml | 4 +++- code/makefile | 4 ++++ code/ysolve.f90 | 8 +++++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a7ffe17..75bef67 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,4 +16,6 @@ test: script: - cd ${CI_PROJECT_DIR} - cd code - - make test + - make clean && make + - cd sample/4pi-IC1 + - ../../ex diff --git a/code/makefile b/code/makefile index b54a0bd..33bd812 100644 --- a/code/makefile +++ b/code/makefile @@ -1,5 +1,9 @@ flags = -Wall -O3 -fdefault-integer-8 -fdefault-double-8 -fdefault-real-8 -march=native +ifdef CHECK +flags += -fcheck=all +endif + compiler = gfortran ex : test.o ysolve.mod compact.mod diff --git a/code/ysolve.f90 b/code/ysolve.f90 index 6a9886a..3efdf14 100644 --- a/code/ysolve.f90 +++ b/code/ysolve.f90 @@ -11,6 +11,7 @@ INTEGER :: ncyc=0,int_pr,nx REAL, DIMENSION(:,:,:), ALLOCATABLE :: u,y1,y2,yf REAL, DIMENSION(:), ALLOCATABLE :: uxt,duxt + REAL, DIMENSION(:), ALLOCATABLE :: dm INTEGER :: istage REAL, DIMENSION(5) :: a=(/ 970286171893./4311952581923., & @@ -128,14 +129,14 @@ dely=ABS(dux(1,i)) sdr=wrate/dely - sdd=-diff*d2ux(1,i)/dely + sdd=-dm(i)*d2ux(1,i)/dely IF (dely.eq.0.) THEN sdr=0.; sdd=0. ENDIF sd=sdr+sdd uu=u(1,1,1) onelw=(-dux(1,i))/c - dd=-diff*d2ux(1,i) + dd=-dm(i)*d2ux(1,i) if (c.eq.0.) onelw=0. sav(1,i)=sav(1,i)+yr @@ -323,6 +324,7 @@ ALLOCATE(yf(nx,1,1),STAT=ierr) ; yf=0. ALLOCATE(uxt(nx),STAT=ierr) ; uxt=0. ALLOCATE(duxt(nx),STAT=ierr) ; duxt=0. + ALLOCATE(dm(nx),STAT=ierr) ; dm=diff END SUBROUTINE READ_INTRO @@ -400,7 +402,7 @@ ! -0.5*( d(u*Y)/dx + u*dY/dx + Y*du/dx ) + D*d2Y/d2x f(i,j,k)=-0.5*( dux(1,i) + ux(2,i)*dux(3,i) + & ux(3,i)*dux(2,i) ) & - + diff*d2ux(1,i) - wrate + + dm(i)*d2ux(1,i) - wrate IF (i.eq.nx) THEN Ly=ux(2,nx)*dux(3,nx) ! Ly = u*dYr/dx f(nx,1,1)=-wrate