/
urbanhr.f
202 lines (178 loc) · 9.35 KB
/
urbanhr.f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
subroutine urbanhr
!! ~ ~ ~ PURPOSE ~ ~ ~
!! this subroutine computes loadings from urban areas using the
!! a build-up/wash-off algorithm at subdaily time intervals
!! ~ ~ ~ INCOMING VARIABLES ~ ~ ~
!! name |units |definition
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!! al5 |none |fraction of daily rainfall that occurs
!! |during 0.5h highest intensity
!! curbden(:) |km/ha |curb length density in HRU
!! dirtmx(:) |kg/curb km |maximum amount of solids allowed to
!! |build up on impervious surfaces
!! fimp(:) |fraction |fraction of HRU area that is
!! |impervious (both directly and
!! |indirectly connected)
!! hru_km(:) |km^2 |area of HRU in square kilometers
!! iida |julian date |day being simulated (current julian date)
!! ihru |none |HRU number
!! isweep(:,:,:)|julian date |date of street sweeping operation
!! iurban(:) |none |urban simulation code:
!! |0 no urban sections in HRU
!! |1 urban sections in HRU, simulate using
!! | USGS regression equations
!! |2 urban sections in HRU, simulate using
!! | build up/wash off algorithm
!! nro(:) |none |sequence number of year in rotation
!! nsweep(:) |none |sequence number of street sweeping operation
!! |within the year
!! peakr |m^3/s |peak runoff rate
!! precipday |mm H2O |precipitation for the day in HRU
!! sedorgn(:) |kg N/ha |amount of organic nitrogen in surface runoff
!! |in HRU for the day
!! sedorgp(:) |kg P/ha |amount of organic phosphorus in surface
!! |runoff in HRU for the day
!! sedyld(:) |metric tons |daily soil loss caused by water erosion
!! surfq(:) |mm H2O |surface runoff for the day in HRU
!! surqno3(:) |kg N/ha |amount of NO3-N in surface runoff in HRU for
!! |the day
!! surqsolp(:) |kg P/ha |amount of soluble phosphorus in surface
!! |runoff in HRU for the day
!! tconc(:) |hr |time of concentration
!! thalf(:) |days |time for the amount of solids on
!! |impervious areas to build up to 1/2
!! |the maximum level
!! tnconc(:) |mg N/kg sed |concentration of total nitrogen in
!! |suspended solid load from impervious
!! |areas
!! tno3conc(:) |mg NO3-N/kg sed|concentration of NO3-N in suspended
!! |solid load from impervious areas
!! tpconc(:) |mg P/kg sed |concentration of total phosphorus in
!! |suspended solid load from impervious
!! |areas
!! twash(:) |days |time that solids have built-up on streets
!! urbcoef(:) |1/mm |wash-off coefficient for removal of
!! |constituents from an impervious surface
!! ubntss(:) |metric tons |TSS loading from urban impervious cover
!! urblu(:) |none |urban land type identification number from
!! |urban database
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!! ~ ~ ~ OUTGOING VARIABLES ~ ~ ~
!! name |units |definition
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!! sedorgn(:) |kg N/ha |amount of organic nitrogen in surface runoff
!! |in HRU for the day
!! sedorgp(:) |kg P/ha |amount of organic phosphorus in surface runoff
!! |in HRU for the day
!! sedyld(:) |metric tons |daily soil loss caused by water erosion
!! surqno3(:) |kg N/ha |amount of NO3-N in surface runoff in HRU for
!! |the day
!! surqsolp(:) |kg P/ha |amount of soluble phosphorus in surface runoff
!! |in HRU for the day
!! twash(:) |
!! ubntss(:) |metric tons |TSS loading from urban impervious cover
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!! ~ ~ ~ LOCAL DEFINITIONS ~ ~ ~
!! name |units |definition
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!! cod |kg |carbonaceous biological oxygen demand of
!! |surface runoff from urban area
!! dirt |kg/curb km |amount of solids built up on impervious
!! |surfaces
!! dirto |kg/ha |amount of solids built up on impervious
!! |surfaces at the beginning of time step
!! j |none |HRU number
!! sus_sol |kg |suspended solid loading in surface runoff
!! |from urban area
!! tn |kg |total nitrogen in surface runoff from
!! |urban area
!! tp |kg |total phosphorus in surface runoff from
!! |urban area
!! urbk |1/hr |
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!! ~ ~ ~ SUBROUTINES/FUNCTIONS CALLED ~ ~ ~
!! Intrinsic: Exp, Max, Log
!! SWAT: Regres, sweep
!! ~ ~ ~ ~ ~ ~ END SPECIFICATIONS ~ ~ ~ ~ ~ ~
use parm
real :: cod, sus_sol, tn, tp, urbk, dirto, qdt
real*8 :: dirt
integer :: j, k
j = 0
j = ihru
do k = 1, nstep
select case (iurban(j))
case (1,2) !! build-up/wash-off algorithm
!! rainy day: no build-up, street cleaning allowed
qdt = ubnrunoff(k) * 60./ real(idt) !urban runoff in mm/hr
if (qdt > 0.025 .and. surfq(j) > 0.1) then ! SWMM : 0.001 in/hr (=0.0254mm/hr)
!! calculate amount of dirt on streets prior to wash-off
dirt = 0.
dirto = 0.
dirto = dirtmx(urblu(j)) * twash(j) /
& (thalf(urblu(j)) + twash(j))
!! calculate wash-off of solids
urbk = 0. ! peakr -> hhqday for subdaily time steps 6/19/09 JJ
urbk = urbcoef(urblu(j)) * qdt
dirt = dirto * Exp (- urbk * real(idt) / 60.)
if (dirt < 1.e-6) dirt = 0.0
!! set time to correspond to lower amount of dirt
twash(j) = 0.
twash(j) = thalf(urblu(j)) * dirt
& / (dirtmx(urblu(j)) - dirt)
sus_sol = 0.
tn = 0.
tp = 0.
tno3 = 0.
!! amounts are kg/ha
sus_sol = Max(0., (dirto - dirt) * curbden(urblu(j)))
tn = tnconc(urblu(j)) * sus_sol / 1.e6
tp = tpconc(urblu(j)) * sus_sol / 1.e6
tno3 = tno3conc(urblu(j)) * sus_sol / 1.e6
ubntss(k) = (.001 * sus_sol * hru_ha(j)) * fimp(urblu(j))
surqno3(j) = tno3 * fimp(urblu(j)) + surqno3(j) *
& (1. - fimp(urblu(j)))
sedorgn(j) = (tn - tno3) * fimp(urblu(j)) + sedorgn(j) *
& (1. - fimp(urblu(j)))
sedorgp(j) = .75 * tp * fimp(urblu(j)) + sedorgp(j) *
& (1. - fimp(urblu(j)))
surqsolp(j) = .25 * tp * fimp(urblu(j)) + surqsolp(j) *
& (1. - fimp(urblu(j)))
else
!! no surface runoff
twash(j) = twash(j) + idt / 1440.
!! perform street sweeping
if (isweep(j) > 0 .and. iida >= isweep(j)) then
call sweep
else if (phusw(j) > 0.0001) then
if (igro(j) == 0) then
if (phubase(j) > phusw(j)) call sweep
else
if (phuacc(j) > phusw(j)) call sweep
end if
end if
end if
end select
sus_sol=0
! Compute evaporation of water (initial abstraction) from impervious cover
init_abstrc(j) = init_abstrc(j) - etday / nstep
init_abstrc(j) = max(0.,init_abstrc(j))
end do
!! perform street sweeping
if(surfq(j) < 0.1) then
if (isweep(j) > 0 .and. iida >= isweep(j)) then
call sweep
else if (phusw(j) > 0.0001) then
if (igro(j) == 0) then
if (phubase(j) > phusw(j)) then
call sweep
endif
else
if (phuacc(j) > phusw(j)) then
call sweep
endif
end if
end if
end if
return
end