Skip to content

Commit 023e2d3

Browse files
committed
Update to 2012Rev622
1 parent 5e09628 commit 023e2d3

File tree

300 files changed

+2518
-2401
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

300 files changed

+2518
-2401
lines changed

VERSIONS

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
VERSION_MAJOR 2012
2-
VERSION_MINOR 591
2+
VERSION_MINOR 622
33
VERSION_PATCH

src/CMakeLists.txt

+17-16
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,32 @@ file(GLOB F77SRCS *.f)
66
file(GLOB F90SRCS *.f90)
77

88
### Set Fortran line format for source file
9-
## Special sources that have fixed length of 79
10-
set(LEN79_SRCS "bmp_det_pond" "bmpinit" "ovr_sed" "percmain" "readbsn" "rthsed" "modparm" "main")
9+
10+
## Special sources that have fixed length of 72
11+
set(LEN72_SRCS "grow" "tran")
1112
foreach(F77FILE ${F77SRCS})
1213
get_filename_component(CORENAME ${F77FILE} NAME_WE)
13-
list(FIND LEN79_SRCS ${CORENAME} _FOUND_LEN79)
14+
list(FIND LEN72_SRCS ${CORENAME} _FOUND_LEN72)
1415
if(${CMAKE_Fortran_COMPILER} MATCHES "ifort.*")
1516
# ifort, reference https://software.intel.com/en-us/node/678225
1617
if(MSVC) # ifort integrated in Microsoft Visual Studio
17-
if(${_FOUND_LEN79} GREATER -1)
18-
set_source_files_properties(${F77FILE} PROPERTIES COMPILE_FLAGS /4L79)
19-
else()
18+
if(${_FOUND_LEN72} GREATER -1)
2019
set_source_files_properties(${F77FILE} PROPERTIES COMPILE_FLAGS /4L72)
20+
else()
21+
set_source_files_properties(${F77FILE} PROPERTIES COMPILE_FLAGS /4L79)
2122
endif()
2223
else()
23-
if(${_FOUND_LEN79} GREATER -1)
24-
set_source_files_properties(${F77FILE} PROPERTIES COMPILE_FLAGS -79)
25-
else()
24+
if(${_FOUND_LEN72} GREATER -1)
2625
set_source_files_properties(${F77FILE} PROPERTIES COMPILE_FLAGS -72)
26+
else()
27+
set_source_files_properties(${F77FILE} PROPERTIES COMPILE_FLAGS -79)
2728
endif()
2829
endif()
2930
else() # gfortran tested only
30-
if(${_FOUND_LEN79} GREATER -1)
31-
set_source_files_properties(${F77FILE} PROPERTIES COMPILE_FLAGS -ffixed-line-length-79)
32-
else()
31+
if(${_FOUND_LEN72} GREATER -1)
3332
set_source_files_properties(${F77FILE} PROPERTIES COMPILE_FLAGS -ffixed-line-length-72)
33+
else()
34+
set_source_files_properties(${F77FILE} PROPERTIES COMPILE_FLAGS -ffixed-line-length-79)
3435
endif()
3536
endif()
3637
endforeach()
@@ -70,13 +71,13 @@ if((NOT MSVC) AND (${First_Line_Of_Main_File} MATCHES " include 'modparm.f'
7071
endif()
7172
# Set compile flag according to Fortran line format. These should be consistent with settings above.
7273
if(${ext} STREQUAL ".f")
73-
set(Format_Flag "-ffixed-line-length-72")
74+
set(Format_Flag "-ffixed-line-length-79")
7475
else()
7576
set(Format_Flag "-ffree-line-length-none")
7677
endif()
77-
list(FIND LEN79_SRCS ${CORENAME} _FOUND_LEN79)
78-
if(${_FOUND_LEN79} GREATER -1)
79-
set(Format_Flag "-ffixed-line-length-79")
78+
list(FIND LEN72_SRCS ${CORENAME} _FOUND_LEN72)
79+
if(${_FOUND_LEN72} GREATER -1)
80+
set(Format_Flag "-ffixed-line-length-72")
8081
endif()
8182
add_custom_command(OUTPUT ${CORENAME}.o
8283
COMMAND ${CMAKE_Fortran_COMPILER} ${Compile_Flags_List} ${Format_Flag} -c

src/NCsed_leach.f90

+1-1
Original file line numberDiff line numberDiff line change
@@ -222,4 +222,4 @@ subroutine orgncswat2(iwave)
222222

223223

224224
return
225-
end
225+
end

src/addh.f

+12-12
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ subroutine addh
5050

5151
!! add loadings and store in new hydrograph location
5252
if (varoute(2,inum1) + varoute(2,inum2) > 0.1) then
53-
varoute(1,ihout) = (varoute(1,inum1) * varoute(2,inum1) + &
54-
& varoute(1,inum2) * varoute(2,inum2)) / &
53+
varoute(1,ihout) = (varoute(1,inum1) * varoute(2,inum1) +
54+
& varoute(1,inum2) * varoute(2,inum2)) /
5555
& (varoute(2,inum1) + varoute(2,inum2))
56-
varoute(18,ihout) = (varoute(18,inum1) * varoute(2,inum1) + &
57-
& varoute(18,inum2) * varoute(2,inum2)) / &
56+
varoute(18,ihout) = (varoute(18,inum1) * varoute(2,inum1) +
57+
& varoute(18,inum2) * varoute(2,inum2)) /
5858
& (varoute(2,inum1) + varoute(2,inum2))
59-
varoute(19,ihout) = (varoute(19,inum1) * varoute(2,inum1) + &
60-
& varoute(19,inum2) * varoute(2,inum2)) / &
59+
varoute(19,ihout) = (varoute(19,inum1) * varoute(2,inum1) +
60+
& varoute(19,inum2) * varoute(2,inum2)) /
6161
& (varoute(2,inum1) + varoute(2,inum2))
6262
end if
6363
do ii = 2, 17
@@ -74,17 +74,17 @@ subroutine addh
7474
! do kk = 1, 24
7575
do kk = 1, nstep ! modified for urban modeling by J.Jeong 4/15/2008
7676
if (hhvaroute(2,inum1,kk) + hhvaroute(2,inum2,kk) > 0.1) then
77-
hhvaroute(1,ihout,kk) = (hhvaroute(1,inum1,kk) * &
78-
& hhvaroute(2,inum1,kk) + hhvaroute(1,inum2,kk) * &
79-
& hhvaroute(2,inum2,kk)) / (hhvaroute(2,inum1,kk) + &
77+
hhvaroute(1,ihout,kk) = (hhvaroute(1,inum1,kk) *
78+
& hhvaroute(2,inum1,kk) + hhvaroute(1,inum2,kk) *
79+
& hhvaroute(2,inum2,kk)) / (hhvaroute(2,inum1,kk) +
8080
& hhvaroute(2,inum2,kk))
8181
end if
8282
end do
8383
do ii = 2, mvaro
8484
! do kk = 1, 24
8585
do kk = 1, nstep ! modified for urban modeling by J.Jeong 4/15/2008
86-
hhvaroute(ii,ihout,kk) = hhvaroute(ii,inum1,kk) + &
87-
& hhvaroute(ii,inum2,kk)
86+
hhvaroute(ii,ihout,kk) = hhvaroute(ii,inum1,kk) +
87+
* hhvaroute(ii,inum2,kk)
8888
end do
8989
end do
9090
endif
@@ -95,4 +95,4 @@ subroutine addh
9595
end do
9696

9797
return
98-
end
98+
end

src/albedo.f

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ subroutine albedo
5858
end if
5959

6060
return
61-
end
61+
end

src/allocate_parms.f

+26-7
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ subroutine allocate_parms
4848

4949

5050
use parm
51-
51+
52+
allocate (alph_e(mhru))
53+
allocate (co_p(mhru))
54+
55+
5256
!! initialize variables
5357
mvaro = 33
5458
mhruo = 78
@@ -331,7 +335,7 @@ subroutine allocate_parms
331335
allocate (icolr(mrcho))
332336
! allocate (ipdvar(mrcho))
333337
!! increased ipdvar(42) to 45 to add Total N/Total P/NO3conc(mg/l)
334-
allocate (ipdvar(45))
338+
allocate (ipdvar(46))
335339
allocate (rchaao(mrcho,mxsubch))
336340
allocate (rchdy(mrcho,mxsubch))
337341
allocate (rchmono(mrcho,mxsubch))
@@ -635,6 +639,12 @@ subroutine allocate_parms
635639
allocate (seccir(mres))
636640
allocate (sed_stlr(mres))
637641
allocate (starg_fps(mres))
642+
allocate (weirc(mres))
643+
allocate (weirk(mres))
644+
allocate (weirw(mres))
645+
allocate (acoef(mres))
646+
allocate (bcoef(mres))
647+
allocate (ccoef(mres))
638648
allocate (wurtnf(mres))
639649
allocate (lkpst_mass(mres))
640650
allocate (lkspst_mass(mres))
@@ -1162,6 +1172,10 @@ subroutine allocate_parms
11621172
allocate (pot_cla(mhru))
11631173
allocate (pot_sag(mhru))
11641174
allocate (pot_lag(mhru))
1175+
allocate (n_reduc(mhru))
1176+
allocate (n_lag(mhru))
1177+
allocate (n_ln(mhru))
1178+
allocate (n_lnco(mhru))
11651179

11661180
allocate (pot_tile(mhru))
11671181
allocate (pot_vol(mhru))
@@ -1454,6 +1468,8 @@ subroutine allocate_parms
14541468

14551469
!! arrays
14561470
allocate (ndays(13))
1471+
allocate (ndays_leap(13))
1472+
allocate (ndays_noleap(13))
14571473
allocate (idg(9))
14581474
allocate (ndmo(12))
14591475
! allocate (halgae(24))
@@ -1557,8 +1573,10 @@ subroutine allocate_parms
15571573
allocate (snam(mhru),hydgrp(mhru),kirr(mhru))
15581574
allocate (dratio(msub),init_abstrc(mhru))
15591575
allocate (sub_subp_dt(msub,nstep),sub_hhsedy(msub,nstep))
1560-
allocate (sub_atmp(msub,nstep))
1576+
allocate (sub_atmp(msub,nstep),bmp_recharge(msub))
15611577
allocate (rchhr(mrcho,mch,nstep),hrtevp(nstep),hrttlc(nstep))
1578+
allocate (hhresflwi(nstep), hhresflwo(nstep),hhressedi(nstep),
1579+
& hhressedo(nstep))
15621580
!! Arrays for bmp simulation by jaehak jeong
15631581
allocate (lu_nodrain(30),bmpdrain(mhru))
15641582
allocate (subdr_km(mhyd),subdr_ickm(mhyd),sub_cn2(msub))
@@ -1593,15 +1611,16 @@ subroutine allocate_parms
15931611
& dtp_stagdis(mhyd),dtp_reltype(mhyd),dtp_onoff(mhyd))
15941612

15951613
allocate(dtp_evrsv(msub),
1596-
& dtp_inflvol(msub),dtp_totwrwid(msub),dtp_parm(msub),
1614+
& dtp_inflvol(msub),dtp_totwrwid(msub),dtp_lwratio(msub),
15971615
& dtp_wdep(msub),dtp_totdep(msub),dtp_watdepact(msub),
15981616
& dtp_outflow(msub),dtp_totrel(msub),dtp_backoff(msub),
15991617
& dtp_seep_sa(msub),dtp_evap_sa(msub),dtp_pet_day(msub),
16001618
& dtp_pcpvol(msub),dtp_seepvol(msub),dtp_evapvol(msub),
16011619
& dtp_flowin(msub),dtp_backup_length(msub),dtp_intcept(msub),
16021620
& dtp_expont(msub),dtp_coef1(msub),dtp_coef2(msub),
1603-
& dtp_coef3(msub),dtp_ivol(msub),dtp_ised(msub))
1604-
1621+
& dtp_coef3(msub),dtp_dummy1(msub),dtp_dummy2(msub),
1622+
& dtp_dummy3(msub),dtp_ivol(msub),dtp_ised(msub))
1623+
16051624
allocate(dtp_wdratio(msub,10),dtp_depweir(msub,10),
16061625
& dtp_diaweir(msub,10),dtp_retperd(msub,10),dtp_pcpret(msub,10),
16071626
& dtp_cdis(msub,10),dtp_flowrate(msub,10),
@@ -1764,4 +1783,4 @@ subroutine allocate_parms
17641783
call zero_urbn
17651784

17661785
return
1767-
end
1786+
end

src/alph.f

+3-3
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ subroutine alph(iwave)
119119
rainsum = 0.
120120
do jj = 0, k
121121
if (precipdt(kk+jj) > (snomlt+ovrlnd(j))/nstep) then
122-
rainsum = rainsum + precipdt(kk+jj) - &
122+
rainsum = rainsum + precipdt(kk+jj) -
123123
& (snomlt + ovrlnd(j)) / nstep
124124
end if
125125
end do
@@ -157,7 +157,7 @@ subroutine alph(iwave)
157157
ajp = 0.
158158
ajp = 1. - Expo(-125. / (preceff + 5.))
159159
if (ised_det == 0) then
160-
al5 = Atri(ab, amp_r(i_mo,hru_sub(j)), ajp, &
160+
al5 = Atri(ab, amp_r(i_mo,hru_sub(j)), ajp,
161161
& rndseed(idg(6),j))
162162
else
163163
al5 = amp_r(i_mo,hru_sub(j))
@@ -167,4 +167,4 @@ subroutine alph(iwave)
167167
end select
168168

169169
return
170-
end
170+
end

src/anfert.f

+15-15
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,11 @@ subroutine anfert
222222

223223
!! add bacteria to surface layer
224224
bactpq(j) = bactpq(j) + bactkddb(ifrt) * bactpdb(ifrt) * dwfert
225-
bactlpq(j) = bactlpq(j) + bactkddb(ifrt) * bactlpdb(ifrt) * &
225+
bactlpq(j) = bactlpq(j) + bactkddb(ifrt) * bactlpdb(ifrt) *
226226
& dwfert
227-
bactps(j) = bactps(j) + (1. - bactkddb(ifrt)) * bactpdb(ifrt)* &
227+
bactps(j) = bactps(j) + (1. - bactkddb(ifrt)) * bactpdb(ifrt)*
228228
& dwfert
229-
bactlps(j) = bactlps(j) + (1. - bactkddb(ifrt)) *bactlpdb(ifrt) &
229+
bactlps(j) = bactlps(j) + (1. - bactkddb(ifrt)) *bactlpdb(ifrt)
230230
& * dwfert
231231

232232
do ly = 1, 2
@@ -237,19 +237,19 @@ subroutine anfert
237237
xx = 1. - afrt_surface(j)
238238
endif
239239

240-
sol_no3(ly,j) = sol_no3(ly,j) + xx * dwfert * fminn(ifrt) * &
240+
sol_no3(ly,j) = sol_no3(ly,j) + xx * dwfert * fminn(ifrt) *
241241
& (1. - fnh3n(ifrt))
242-
sol_nh3(ly,j) = sol_nh3(ly,j) + xx * dwfert * fminn(ifrt) * &
242+
sol_nh3(ly,j) = sol_nh3(ly,j) + xx * dwfert * fminn(ifrt) *
243243
& fnh3n(ifrt)
244244

245245
if (cswat == 0) then
246246
sol_fon(ly,j) = sol_fon(ly,j) + rtoaf * xx * dwfert
247247
& * forgn(ifrt)
248-
sol_aorgn(ly,j) = sol_aorgn(ly,j) + (1. - rtoaf) * xx &
248+
sol_aorgn(ly,j) = sol_aorgn(ly,j) + (1. - rtoaf) * xx
249249
& * dwfert * forgn(ifrt)
250-
sol_fop(ly,j) = sol_fop(ly,j) + rtoaf * xx * dwfert &
250+
sol_fop(ly,j) = sol_fop(ly,j) + rtoaf * xx * dwfert
251251
& * forgp(ifrt)
252-
sol_orgp(ly,j) = sol_orgp(ly,j) + (1. - rtoaf) * xx * &
252+
sol_orgp(ly,j) = sol_orgp(ly,j) + (1. - rtoaf) * xx *
253253
& dwfert* forgp(ifrt)
254254
end if
255255
if (cswat == 1) then
@@ -261,12 +261,12 @@ subroutine anfert
261261
!! add by zhang
262262
!!=================
263263
if (cswat == 2) then
264-
sol_fop(ly,j) = sol_fop(ly,j) + rtoaf * xx * dwfert &
264+
sol_fop(ly,j) = sol_fop(ly,j) + rtoaf * xx * dwfert
265265
& * forgp(ifrt)
266-
sol_orgp(ly,j) = sol_orgp(ly,j) + (1. - rtoaf) * xx * &
266+
sol_orgp(ly,j) = sol_orgp(ly,j) + (1. - rtoaf) * xx *
267267
& dwfert* forgp(ifrt)
268268
!!Allocate organic fertilizer to Slow (SWAT_active) N pool;
269-
sol_HSN(ly,j) = sol_HSN(ly,j) + (1. - rtoaf) * xx &
269+
sol_HSN(ly,j) = sol_HSN(ly,j) + (1. - rtoaf) * xx
270270
& * dwfert * forgn(ifrt)
271271
sol_aorgn(ly,j) = sol_HSN(ly,j)
272272

@@ -328,12 +328,12 @@ subroutine anfert
328328
tauton(j) = tauton(j) + auton
329329
tautop(j) = tautop(j) + autop
330330
if (curyr > nyskip) then
331-
wshd_ftotn = wshd_ftotn + dwfert * (fminn(ifrt) + &
331+
wshd_ftotn = wshd_ftotn + dwfert * (fminn(ifrt) +
332332
& forgn(ifrt))* hru_dafr(j)
333333
wshd_forgn = wshd_forgn + dwfert * forgn(ifrt) * hru_dafr(j)
334-
wshd_fno3 = wshd_fno3 + dwfert * fminn(ifrt) * &
334+
wshd_fno3 = wshd_fno3 + dwfert * fminn(ifrt) *
335335
& (1. - fnh3n(ifrt)) * hru_dafr(j)
336-
wshd_fnh3 = wshd_fnh3 + dwfert * fminn(ifrt) * fnh3n(ifrt) * &
336+
wshd_fnh3 = wshd_fnh3 + dwfert * fminn(ifrt) * fnh3n(ifrt) *
337337
& hru_dafr(j)
338338
wshd_fminp = wshd_fminp + dwfert * tfp * hru_dafr(j)
339339
wshd_forgp = wshd_forgp + dwfert * forgp(ifrt) * hru_dafr(j)
@@ -353,4 +353,4 @@ subroutine anfert
353353
1000 format (a5,1x,a4,3i6,2a15,7f10.2,20x,f10.2,10x,5f10.2)
354354

355355
return
356-
end subroutine
356+
end subroutine

src/apex_day.f

+5-5
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ subroutine apex_day
121121
!! changes for Mike Winchell if apex.swt files has a different start date than the SWAT run
122122
if (ifirsta(inum1) == 1) then
123123
do
124-
read (112+inum1,*) idapa(inum1), iypa(inum1), flodaya(inum1),
125-
& seddaya(inum1), orgndaya(inum1), orgpdaya(inum1), no3daya(inum1),
124+
read (112+inum1,*) idapa(inum1), iypa(inum1), flodaya(inum1),
125+
& seddaya(inum1), orgndaya(inum1), orgpdaya(inum1), no3daya(inum1),
126126
& minpdaya(inum1)
127127
if(idapa(inum1) == id1 .and. iypa(inum1) == iyr) exit
128128
end do
@@ -150,8 +150,8 @@ subroutine apex_day
150150
varoute(20,ihout) = 0.0
151151
varoute(21,ihout) = 0.0
152152
varoute(22,ihout) = 0.0
153-
read (112+inum1,*) idapa(inum1), iypa(inum1), flodaya(inum1), &
154-
& seddaya(inum1), orgndaya(inum1), orgpdaya(inum1), no3daya(inum1), &
153+
read (112+inum1,*) idapa(inum1), iypa(inum1), flodaya(inum1),
154+
& seddaya(inum1), orgndaya(inum1), orgpdaya(inum1), no3daya(inum1),
155155
& minpdaya(inum1)
156156
else
157157
varoute(2,ihout) = 0.0
@@ -189,4 +189,4 @@ subroutine apex_day
189189
end if
190190

191191
return
192-
end
192+
end

src/apply.f

+3-3
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ subroutine apply
100100
exit
101101
endif
102102
else
103-
if (pst_dep > sol_z((nly-1),j) .and. &
103+
if (pst_dep > sol_z((nly-1),j) .and.
104104
& pst_dep < sol_z(nly,j)) then
105105
sol_pst(k,j,nly) = sol_pst(k,j,nly) + xx
106106
exit
@@ -123,9 +123,9 @@ subroutine apply
123123

124124
!! summary calculations
125125
if (curyr > nyskip) then
126-
wshd_pstap(k) = wshd_pstap(k) + pst_kg * &
126+
wshd_pstap(k) = wshd_pstap(k) + pst_kg *
127127
& ap_ef(kk) * hru_dafr(j)
128128
end if
129129

130130
return
131-
end
131+
end

src/ascrv.f

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ subroutine ascrv(x1,x2,x3,x4,x5,x6)
5959

6060

6161
return
62-
end
62+
end

src/atri.f

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,4 @@ function atri(at1,at2,at3,at4i)
8686
if (atri <= 0.0) atri = 0.001
8787

8888
return
89-
end
89+
end

0 commit comments

Comments
 (0)