Skip to content

Commit 9e48aa2

Browse files
committed
Update to 2009Rev486
2 parents 506f27f + 75c8a32 commit 9e48aa2

31 files changed

+129
-91
lines changed

VERSIONS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
VERSION_MAJOR 2009
2-
VERSION_MINOR 477
2+
VERSION_MINOR 486
33
VERSION_PATCH

src/allocate_parms.f

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,8 @@ subroutine allocate_parms
606606
allocate (mat_yrs(mcrdb))
607607
allocate (rdmx(mcrdb))
608608
allocate (rsdco_pl(mcrdb))
609+
allocate (rsr1(mcrdb))
610+
allocate (rsr2(mcrdb))
609611
allocate (t_base(mcrdb))
610612
allocate (t_opt(mcrdb))
611613
allocate (vpd2(mcrdb))

src/etpot.f

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ subroutine etpot
229229
rc = 49. / (1.4 - 0.4 * co2(hru_sub(j)) / 330.)
230230
pet_day = (dlt * rn_pet + gma * rho * vpd / rv) / &
231231
& (xl * (dlt + gma * (1. + rc / rv)))
232+
232233
pet_day = Max(0., pet_day)
233234

234235
!! maximum plant ET

src/grow.f

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ subroutine grow
113113
!! phuacc(:) |none |fraction of plant heat units accumulated
114114
!! plt_et(:) |mm H2O |actual ET simulated during life of plant
115115
!! plt_pet(:) |mm H2O |potential ET simulated during life of plant
116+
!! rsr1c(:) | |initial root to shoot ratio at beg of growing season
117+
!! rsr2c(:) | |root to shoot ratio at end of growing season
116118
!! rwt(:) |none |fraction of total plant biomass that is
117119
!! |in roots
118120
!! wshd_nstrs |stress units |average annual number of nitrogen stress
@@ -247,8 +249,9 @@ subroutine grow
247249

248250

249251
!! calculate fraction of total biomass that is in the roots
250-
rwt(j) = .4 - .2 * phuacc(j)
251-
252+
!! rwt(j) = .4 - .2 * phuacc(j)
253+
rwt(j) = rsr1(idplt(nro(j),icr(j),j))-rsr2(idplt(nro(j),icr(j),j))&
254+
& * phuacc(j)
252255
f = 0.
253256
ff = 0.
254257
f = phuacc(j) / (phuacc(j) + Exp(leaf1(idp) &

src/harvestop.f

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ subroutine harvestop
8888
!! plantn(:) |kg N/ha |amount of nitrogen in plant biomass
8989
!! plantp(:) |kg P/ha |amount of phosphorus in plant biomass
9090
!! plt_pst(:,:)|kg/ha |pesticide on plant foliage
91+
!! rsr1c(:) | |initial root to shoot ratio at beg of growing season
92+
!! rsr2c(:) | |root to shoot ratio at end of growing season
9193
!! sol_fon(:,:)|kg N/ha |amount of nitrogen stored in the fresh
9294
!! |organic (residue) pool
9395
!! sol_fop(:,:)|kg P/ha |amount of phosphorus stored in the fresh
@@ -262,7 +264,9 @@ subroutine harvestop
262264
if (ssb > 0.001) then
263265
laiday(j) = laiday(j) * (1. - ff3)
264266
if (phuacc(j) < .999) phuacc(j) = phuacc(j) * (1. - ff3)
265-
rwt(j) = .4 - .2 * phuacc(j)
267+
!! rwt(j) = .4 - .2 * phuacc(j)
268+
rwt(j) = rsr1(idplt(nro(j),icr(j),j))-rsr2(idplt(nro(j),icr(j),j))&
269+
& * phuacc(j)
266270
else
267271
bio_ms(j) = 0.
268272
laiday(j) = 0.

src/hmeas.f

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -73,29 +73,33 @@ subroutine hmeas
7373
end do
7474
end if
7575

76+
7677
!! assign relative humidity data to HRUs
7778
inum3sprev = 0
7879
do k = 1, nhru
79-
if (irelh(hru_sub(k)) == 1) then
80-
rhd(k) = rhmeas(ihgage(hru_sub(k)))
81-
else
82-
tmpmean=(tmpmx(i_mo,hru_sub(k))+tmpmn(i_mo,hru_sub(k)))/2.
83-
rhd(k) = Ee(rhmeas(ihgage(hru_sub(k)))) / Ee(tmpmean)
84-
endif
85-
!! generate values to replace missing data
86-
if (rhd(k) < -97.) then
87-
!! use same generated data for all HRUs in a subbasin
88-
if (hru_sub(k) == inum3sprev .and. hru_sub(k) /= 0) then
89-
rhd(k) = rhdbsb
90-
else
91-
call rhgen(k)
92-
!! set subbasin generated values
93-
inum3sprev = 0
94-
rhdbsb = 0.
95-
inum3sprev = hru_sub(k)
96-
rhdbsb = rhd(k)
97-
end if
80+
!! generate values to replace missing data
81+
if (rhmeas(ihgage(hru_sub(k))) < -97.) then
82+
!! use same generated data for all HRUs in a subbasin
83+
if (hru_sub(k) == inum3sprev .and. hru_sub(k) /= 0) then
84+
rhd(k) = rhdbsb
85+
else
86+
call rhgen(k)
87+
!! set subbasin generated values
88+
inum3sprev = 0
89+
rhdbsb = 0.
90+
inum3sprev = hru_sub(k)
91+
rhdbsb = rhd(k)
9892
end if
93+
else
94+
!! if (i == 1) then
95+
if (rhmeas(ihgage(hru_sub(k))) < 1. .and.
96+
* rhmeas(ihgage(hru_sub(k))) > 0.) then
97+
rhd(k) = rhmeas(ihgage(hru_sub(k)))
98+
else
99+
tmpmean=(tmpmx(i_mo,hru_sub(k))+tmpmn(i_mo,hru_sub(k)))/2.
100+
rhd(k) = Ee(rhmeas(ihgage(hru_sub(k)))) / Ee(tmpmean)
101+
endif
102+
end if
99103
end do
100104

101105
return

src/main.f

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ program main
5555

5656
use parm
5757
implicit none
58-
prog = "SWAT Apr 11 2011 VER 2009/Rev. 477"
58+
prog = "SWAT Jul 26 2011 VER 2009/Rev. 486"
5959

6060
write (*,1000)
6161
1000 format(1x," SWAT2009 ",/, &
62-
& " Rev. 477 ",/, &
62+
& " Rev. 486 ",/, &
6363
& " Soil & Water Assessment Tool ",/, &
6464
& " PC Version ",/, &
6565
& " Program reading from file.cio . . . executing",/)

src/modparm.f

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module parm
2626
real :: rttime, rchdep, rtevp, rttlc, da_km, resflwi, wdlps, wglps
2727
real :: resflwo, respcp, resev, ressep,ressedi,ressedo,dtot,wdprch
2828
real :: nperco, pperco, rsdco, phoskd, voltot, volcrmin, msk_x
29-
real :: uno3d, canev, usle, rcn, surlag, bactkdq, precipday, wdpf
29+
real :: uno3d, canev, usle, surlag, bactkdq, precipday, wdpf
3030
real :: thbact, wpq20, wlpq20, wps20, wlps20, bactrop, bactsedp
3131
real :: bactlchp, bactlchlp, enratio, wetpcp, pndpcp, wetsep, wgpf
3232
real :: pndsep, wetev, pndev, pndsedo, wetsedo, pndflwi, wetflwi
@@ -327,6 +327,7 @@ module parm
327327
real, dimension (:), allocatable :: blai,dlai,rdmx,cpyld,bio_leaf
328328
real, dimension (:), allocatable :: bio_n1,bio_n2,bio_p1,bio_p2
329329
real, dimension (:), allocatable :: bmx_trees,ext_coef,bm_dieoff
330+
real, dimension (:), allocatable :: rsr1, rsr2
330331
! real, dimension (:), allocatable :: air_str
331332
real, dimension (:,:), allocatable :: pltnfr,pltpfr
332333
integer, dimension (:), allocatable :: idc, mat_yrs
@@ -538,12 +539,12 @@ module parm
538539
real, dimension (:), allocatable :: wshd_pstap, wshd_pstdg
539540
integer, dimension (:), allocatable :: ndmo,npno
540541
character(len=13), dimension (18) :: rfile,tfile
541-
! character(len=1), dimension (250000) :: hydgrp, kirr !!for srin's big runs
542+
! character(len=1), dimension (50000) :: hydgrp, kirr !!for srin's big runs
542543
543544
character(len=1), dimension (20000) :: hydgrp, kirr
544545
! character(len=4), dimension (50) :: urbname
545546
character(len=4), dimension (1000) :: urbname
546-
! character(len=16), dimension (250000) :: snam !! for srin's big runs
547+
! character(len=16), dimension (50000) :: snam !! for srin's big runs
547548

548549
character(len=16), dimension (20000) :: snam
549550
character(len=17), dimension (300) :: pname

src/pestlch.f

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ subroutine pestlch
99
!! name |units |definition
1010
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
1111
!! flat(:,:) |mm H2O |lateral flow in soil layer on current day
12+
1213
!! hrupest(:) |none |pesticide use flag:
1314
!! | 0: no pesticides used in HRU
1415
!! | 1: pesticides used in HRU
@@ -47,8 +48,7 @@ subroutine pestlch
4748
!! pstsol(:) |kg/ha |amount of pesticide type leached from soil
4849
!! |profile on current day
4950
!! zdb(:,:) |
50-
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
51-
51+
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
5252
!! ~ ~ ~ LOCAL DEFINITIONS ~ ~ ~
5353
!! name |units |definition
5454
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

src/rchinit.f

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ subroutine rchinit
146146
soxy = 0.
147147
volatpst = 0.
148148

149-
vel_chan = 0.
149+
vel_chan(jrch) = 0.
150150
sedrch = 0.
151151
rch_san = 0.
152152
rch_sil = 0.

0 commit comments

Comments
 (0)