Skip to content

Commit 0f5d0e5

Browse files
committed
Rev 591
* Upstream closes #7 * Proper initializations in readsub.f * Fix for reservoir outflow
1 parent 751ce10 commit 0f5d0e5

File tree

9 files changed

+23
-21
lines changed

9 files changed

+23
-21
lines changed

src/allocate_parms.f

+1-1
Original file line numberDiff line numberDiff line change
@@ -1509,7 +1509,7 @@ subroutine allocate_parms
15091509
allocate (wshddayo(mstdo))
15101510
allocate (wshdmono(mstdo))
15111511
allocate (wshdyro(mstdo))
1512-
allocate (fcstaao(nstep))
1512+
allocate (fcstaao(16))
15131513

15141514
allocate (wpstaao(mpst,5))
15151515
allocate (wpstmono(mpst,5))

src/etact.f

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ subroutine etact
128128
!! method is used to calculate surface runoff. The curve number methods
129129
!! take canopy effects into account in the equations. For either of the
130130
!! CN methods, canstor will always equal zero.
131-
pet = pet - canstor(j)
131+
pet = pet - canev
132132
if (pet < 0.) then
133133
canstor(j) = -pet
134134
canev = pet_day

src/harvestop.f

+1-1
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ subroutine harvestop
418418
if (laiday(j) < alai_min(idplt(j))) then !Sue
419419
laiday(j) = alai_min(idplt(j))
420420
end if
421-
if (phuacc(j) < .999) phuacc(j) = phuacc(j) * (1. - ff3)
421+
phuacc(j) = phuacc(j) * (1. - ff3)
422422
rwt(j) = .4 - .2 * phuacc(j)
423423
else
424424
bio_ms(j) = 0.

src/main.f

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ program main
5555

5656
use parm
5757
implicit none
58-
prog = "SWAT Feb 21 2013 VER 2012/Rev 588"
58+
prog = "SWAT Apr 12 2013 VER 2012/Rev 591"
5959

6060
write (*,1000)
6161
1000 format(1x," SWAT2012 ",/, &
62-
& " Rev. 588 ",/, &
62+
& " Rev. 591 ",/, &
6363
& " Soil & Water Assessment Tool ",/, &
6464
& " PC Version ",/, &
6565
& " Program reading from file.cio . . . executing",/)
@@ -135,4 +135,4 @@ program main
135135

136136
iscen=1
137137
stop
138-
end
138+
end

src/newtillmix.f

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ subroutine newtillmix(jj,bmix)
77
!! Mixing was extended to all layers
88
!! A subroutine to simulate stimulation of organic matter decomposition was added
99
!! March 2009: testing has been minimal and further adjustments are expected
10-
!! use with caution and report anomalous results to akemanian@brc.tamus.edu and jeff.arnold@ars.usda.edu
10+
!! use with caution
1111

1212
!! ~ ~ ~ INCOMING VARIABLES ~ ~ ~
1313
!! name |units |definition

src/pmeas.f

+1-1
Original file line numberDiff line numberDiff line change
@@ -302,4 +302,4 @@ subroutine pmeas
302302
5300 format (9x,a1)
303303
5400 format (10x,"ERROR: Precipitation data dates do not match for", &
304304
& " simulation year: ",i4," and julian date: ",i3)
305-
end
305+
end

src/readsub.f

+8-7
Original file line numberDiff line numberDiff line change
@@ -378,13 +378,14 @@ subroutine readsub
378378
!! endif
379379
380380
!! set default values
381-
!! set default values
382-
if (re(ihru) <= 0.) re(ihru) = re_bsn
383-
if (sdrain(ihru) <= 0.) sdrain(ihru) = sdrain_bsn
384-
if (drain_co(ihru) <= 0.) drain_co(ihru) = drain_co_bsn
385-
if (pc(ihru) <= 0.) pc(ihru) = pc_bsn
386-
if (latksatf(ihru) <= 0.) latksatf(ihru) = latksatf_bsn
387-
if (sstmaxd(ihru) <= 0.) sstmaxd(ihru) = sstmaxd_bsn
381+
do ihru = jj, hrutot(i)
382+
if (re(ihru) <= 0.) re(ihru) = re_bsn
383+
if (sdrain(ihru) <= 0.) sdrain(ihru) = sdrain_bsn
384+
if (drain_co(ihru) <= 0.) drain_co(ihru) = drain_co_bsn
385+
if (pc(ihru) <= 0.) pc(ihru) = pc_bsn
386+
if (latksatf(ihru) <= 0.) latksatf(ihru) = latksatf_bsn
387+
if (sstmaxd(ihru) <= 0.) sstmaxd(ihru) = sstmaxd_bsn
388+
end do
388389
! estimate drainage area for urban on-line bmps in square km
389390
!subdr_km(i) = subdr_km(i) + sub_km(i)
390391

src/res.f

+6-5
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,6 @@ subroutine res
155155
resflwo = res_out(jres,i_mo,curyr)
156156
!! This will override the measured outflow! This is just a check
157157
!! should really calibrate inflow or check res volumes
158-
ndespill = ndtargr(nres)
159-
if (ndespill <= 0.) ndespill = 10.
160-
if (res_vol(jres) > res_evol(jres)) then
161-
resflwo = resflwo+(res_vol(jres)-res_evol(jres))/ndespill
162-
endif
163158

164159
case (2) !! controlled outflow-target release
165160
targ = 0.
@@ -208,6 +203,12 @@ subroutine res
208203
if (resflwo < oflowmn_fps(jres)) resflwo = oflowmn_fps(jres)
209204

210205
end select
206+
207+
ndespill = ndtargr(nres)
208+
if (ndespill <= 0.) ndespill = 10.
209+
if (res_vol(jres) > res_evol(jres)) then
210+
resflwo = resflwo+(res_vol(jres)-res_evol(jres))/ndespill
211+
endif
211212

212213
!! if reservoir volume is zero
213214
if (res_vol(jres) < 0.001) then

src/writeaa.f

+1-1
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ subroutine writeaa
349349
aairr = aairr / yrs
350350
do j = 1, nhru
351351
do nicr = 1, mcrhru(j)
352-
if (ncrops(nicr,j) > 0) then
352+
if (ncrops(nicr,j) > 0) then
353353
yldn(nicr,j) = yldkg(nicr,j) / ncrops(nicr,j)
354354
bio_aahv(nicr,j) = bio_hv(nicr,j) / ncrops(nicr,j)
355355
else

0 commit comments

Comments
 (0)