Skip to content

Commit

Permalink
Merge pull request #4 from jinyun1tang/jrgrant
Browse files Browse the repository at this point in the history
Jrgrant new code for maize
  • Loading branch information
jinyuntang authored Sep 7, 2019
2 parents e2a3813 + ad5a2c9 commit fdcc857
Show file tree
Hide file tree
Showing 21 changed files with 1,965 additions and 1,861 deletions.
2 changes: 1 addition & 1 deletion examples/sample_run/s022852
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00
0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00
5.77,5.77,5.77,5.77,5.80,5.80,5.80,5.80,4.35,4.35,4.35,4.35,4.35,4.35,4.35,0.00,0.00,0.00,0.00
0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,5.00,5.00,5.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00
10.00,10.00,10.00,10.00,10.00,10.00,10.00,10.00,5.00,5.00,5.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00
3.00,3.00,3.00,3.00,3.00,3.00,3.00,3.00,3.00,3.00,3.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00
3.87,2.87,2.6,2.6,2.00,2.00,2.00,2.00,3.00,0.50,0.50,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00
0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00
Expand Down
2 changes: 1 addition & 1 deletion f77src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ CMD = ecosys.x
# WARNING: SIMULTANEOUSLY PROFILING AND FLOWTRACING IS NOT RECOMMENDED
#FFLAGS = -axP -xW -ipo -O3 -r8 -i4 -align dcommons -cpp -save
#intel setup
FFLAGS = -O2 -mp1 -r8 -i4 -align dcommons -cpp -auto-scalar
FFLAGS = -O2 -mp1 -r8 -i4 -align dcommons -cpp -auto-scalar -fimf-arch-consistency=true
#gfortran
#FFLAGS = -O2

Expand Down
2 changes: 1 addition & 1 deletion f77src/blk13a.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
1,ZNO2SH(JZ,JY,JX),Z2GSH(JZ,JY,JX),Z2OSH(JZ,JY,JX),TRC0(JY,JX)
2,ZNO2BH(JZ,JY,JX),RC0(0:5,JY,JX),RA0(0:5,JY,JX),TRA0(JY,JX)
3,TOQCK(0:JZ,JY,JX),ORGN(0:JZ,JY,JX),ORGR(0:JZ,JY,JX)
4,ZNFNI(0:JZ,JY,JX),ZNFNG(0:JZ,JY,JX),ZNFN0(0:JZ,JY,JX)
4,ZNFNI(0:JZ,JY,JX),ZNFN0(0:JZ,JY,JX)
5,ZNHUI(0:JZ,JY,JX),ZNHU0(0:JZ,JY,JX),H1PO4(0:JZ,JY,JX)
6,H1POB(0:JZ,JY,JX),H1PO4H(JZ,JY,JX),H1POBH(JZ,JY,JX)

2 changes: 1 addition & 1 deletion f77src/blk8b.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
6,YDPTH(JZ,JY,JX),POROQ(0:JZ,JY,JX),TFND(0:JZ,JY,JX),VOLXA(JY,JX)
7,PSIMS(JY,JX),PSIMX(JY,JX),PSIMN(JY,JX),PSISD(JY,JX),PSIMD(JY,JX)
8,SAND(JZ,JY,JX),SILT(JZ,JY,JX),CLAY(JZ,JY,JX),CDPTHZ(0:JZ,JY,JX)
9,DPTHZ(JZ,JY,JX),AREA(3,0:JZ,JY,JX),DISP(3,JD,JV,JH),OXKM
9,DPTHZ(JZ,JY,JX),AREA(3,0:JZ,JY,JX),DISP(3,JD,JV,JH),OXKM,PSIHY
1,OMCI(3,0:4),OMCF(7),OMCA(7)
2,IUTYP(JY,JX),IXTYP(2,JY,JX),IYTYP(0:2,366,JY,JX)
95 changes: 57 additions & 38 deletions f77src/grosub.f
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ SUBROUTINE grosub(I,J,NHW,NHE,NVN,NVS)
DIMENSION RTNT(2),RLNT(2,JZ),RTSK1(2,JZ,10),RTSK2(2,JZ,10)
2,RTDPL(10,JZ),FWTR(JZ),FWTB(JP),FRTDP(0:3),RCCX(0:2),RCCQ(0:2)
3,RCCZ(0:3),RCCY(0:3),EFIRE(2,5:5),WGLFBL(JZ,10,JP,JY,JX)
4,WTSHTA(JZ,JY,JX),FLG4Y(0:3),ATRPX(0:1),GVMX(0:1)
4,WTSHTA(JZ,JY,JX),FLG4Y(0:3),ATRPX(0:1),GVMX(0:1),RTSK(0:2)
DIMENSION CH2O3(25),CH2O4(25),CPOOLK(10,JP,JY,JX),FHVSTK(0:25)
2,FHVSHK(0:25),WFNGR(2,JZ),PSILY(0:2)
DIMENSION FWOOD(0:1),FWOODN(0:1),FWOODP(0:1)
Expand Down Expand Up @@ -71,6 +71,7 @@ SUBROUTINE grosub(I,J,NHW,NHE,NVN,NVS)
DATA RCCY/0.333,0.333,0.333,0.333/
DATA RCCX/0.250,0.833,0.833/
DATA RCCQ/0.833,0.833,0.833/
DATA RTSK/1.0,1.0,4.0/
DATA FXRN/0.50,0.05,0.50,0.05/
DATA FXFB/1.0E-02,1.0E-02,1.0E-05,1.0E-05/
DATA FPART1/1.00/,FPART2/0.40/
Expand Down Expand Up @@ -1373,14 +1374,17 @@ SUBROUTINE grosub(I,J,NHW,NHE,NVN,NVS)
C
IF(IDAY(1,NB,NZ,NY,NX).NE.0
2.AND.CCPOLB(NB,NZ,NY,NX).GT.ZERO)THEN
CCC=AMIN1(CZPOLB(NB,NZ,NY,NX)/(CZPOLB(NB,NZ,NY,NX)
CCC=AMAX1(0.0,AMIN1(1.0
1,CZPOLB(NB,NZ,NY,NX)/(CZPOLB(NB,NZ,NY,NX)
2+CCPOLB(NB,NZ,NY,NX)*CNKI)
3,CPPOLB(NB,NZ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
1,CCPOLR(N,L,NZ,NY,NX)/(CCPOLR(N,L,NZ,NY,NX)
2+CZPOLR(N,L,NZ,NY,NX)/CNKI)))
CPC=AMAX1(0.0,AMIN1(1.0
1,CCPOLR(N,L,NZ,NY,NX)/(CCPOLR(N,L,NZ,NY,NX)
2+CPPOLR(N,L,NZ,NY,NX)/CPKI)))
ELSE
CCC=0.0
CNC=0.0
Expand Down Expand Up @@ -4475,11 +4490,15 @@ SUBROUTINE grosub(I,J,NHW,NHE,NVN,NVS)
CPPOLN=1.0
ENDIF
IF(CCPOLN.GT.ZERO)THEN
CCC=AMIN1(CZPOLN/(CZPOLN+CCPOLN*CNKI)
2,CPPOLN/(CPPOLN+CCPOLN*CPKI))
CNC=CCPOLN/(CCPOLN+CZPOLN/CNKI)
CPC=CCPOLN/(CCPOLN+CPPOLN/CPKI)
CNF=CCPOLN/(CCPOLN+CZPOLN/CNKF)
CCC=AMAX1(0.0,AMIN1(1.0
1,CZPOLN/(CZPOLN+CCPOLN*CNKI)
2,CPPOLN/(CPPOLN+CCPOLN*CPKI)))
CNC=AMAX1(0.0,AMIN1(1.0
1,CCPOLN/(CCPOLN+CZPOLN/CNKI)))
CPC=AMAX1(0.0,AMIN1(1.0
1,CCPOLN/(CCPOLN+CPPOLN/CPKI)))
CNF=AMAX1(0.0,AMIN1(1.0
1,CCPOLN/(CCPOLN+CZPOLN/CNKF)))
ELSE
CCC=0.0
CNC=0.0
Expand Down
2 changes: 1 addition & 1 deletion f77src/hfunc.f
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ SUBROUTINE hfunc(I,J,NHW,NHE,NVN,NVS)
C
IF(ISTYP(NZ,NY,NX).EQ.0.AND.IDAY(6,NB,NZ,NY,NX).EQ.0)THEN
WFNS=AMIN1(1.0,AMAX1(0.0,PSILG(NZ,NY,NX)-PSILM))
WFNSP=WFNS**0.25
WFNSP=WFNS**0.167
RNI=RNI*WFNSP
RLA=RLA*WFNSP
ENDIF
Expand Down
Loading

0 comments on commit fdcc857

Please sign in to comment.