-
Notifications
You must be signed in to change notification settings - Fork 1
/
impndday.f
244 lines (229 loc) · 11.9 KB
/
impndday.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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
subroutine impndday
!! ~ ~ ~ PURPOSE ~ ~ ~
!! this subroutine writes daily HRU output to the output.wtr file
!! ~ ~ ~ INCOMING VARIABLES ~ ~ ~
!! name |units |definition
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!! cpnm(:) |NA |four character code to represent crop name
!! ep_day |mm H2O |actual amount of transpiration that occurs on
!! |day in HRU
!! es_day |mm H2O |actual amount of evaporation (from soil) that
!! |occurs on day in HRU
!! hru_km(:) |km^2 |area of HRU in square kilometers
!! hru_ha(:) |ha |area of HRU in hectares
!! hrugis(:) |none |GIS code printed to output files(output.hru,.rch)
!! icr(:) |none |sequence number of crop grown within the
!! |current year
!! iida |julian date |current day of simulation
!! idplt(:,:,:) |none |land cover code from crop.dat
!! ihru |none |HRU number
!! inum1 |none |subbasin number
!! ipot(:) |none |number of HRU (in subbasin) that is ponding
!! |water--the HRU that the surface runoff from
!! |current HRU drains into. This variable is
!! |used only for rice paddys or closed
!! |depressional areas
!! nmgt(:) |none |management code (for GIS output only)
!! nro(:) |none |sequence number of year in rotation
!! pnd_chla(:) |kg chl_a |amount of chlorophyll-a in pond at end of day
!! pnd_fr(:) |none |fraction of HRU/subbasin area that drains
!! |into ponds
!! pnd_no3(:) |kg N |amount of nitrate originating from surface
!! |runoff in pond at end of day
!! pnd_no3g(:) |kg N |amount of nitrate originating from
!! |groundwater in pond at end of day
!! pnd_no3s(:) |kg N |amount of nitrate originating from lateral
!! |flow in pond at end of day
!! pnd_orgn(:) |kg N |amount of organic N originating from
!! |surface runoff in pond at end of day
!! pnd_orgp(:) |kg P |amount of organic P originating from
!! |surface runoff in pond at end of day
!! pnd_psed(:) |kg P |amount of mineral P attached to sediment
!! |originating from surface runoff in pond at
!! |end of day
!! pnd_seci(:) |m |secchi-disk depth of pond
!! pnd_solp(:) |kg P |amount of soluble P originating from surface
!! |runoff in pond at end of day
!! pnd_solpg(:) |kg P |amount of soluble P originating from
!! |groundwater in pond at end of day
!! pnd_vol(:) |m^3 H2O |volume of water in pond
!! pndev |m^3 H2O |evaporation from pond on day
!! pndflwi |m^3 H2O |volume of water flowing into pond on day
!! pndflwo |m^3 H2O |volume of water flowing out of pond on day
!! pndpcp |m^3 H2O |precipitation on pond during day
!! pndsedin |metric tons |sediment entering pond during day
!! pndsedo |metric tons |sediment leaving pond during day
!! pndsep |m^3 H2O |seepage from pond on day
!! pot_vol(:) |m**3 H2O |current volume of water stored in the
!! |depression/impounded area
!! potevmm |mm H2O |volume of water evaporated from pothole
!! |expressed as depth over HRU
!! potflwi(:) |m^3 H2O |water entering pothole on day
!! potflwo |mm H2O |discharge from pothole expressed as depth
!! |over HRU
!! potpcpmm |mm H2O |precipitation falling on pothole water body
!! |expressed as depth over HRU
!! potsa(:) |ha |surface area of impounded water body
!! potsedi(:) |metric tons |sediment entering pothole on day
!! potsedo |metric tons |sediment leaving pothole on day
!! potsepmm |mm H2O |seepage from pothole expressed as depth over
!! |HRU
!! qday |mm H2O |surface runoff loading to main channel for
!! |day in HRU
!! tloss |mm H2O |amount of water removed from surface runoff
!! |via transmission losses on day in HRU
!! wet_chla(:) |kg chla |amount of chlorophyll-a in wetland at end
!! |of day
!! wet_fr(:) |none |fraction of HRU/subbasin area that drains
!! |into wetlands
!! wet_no3(:) |kg N |amount of nitrate originating from surface
!! |runoff in wetland at end of day
!! wet_no3g(:) |kg N |amount of nitrate originating from
!! |groundwater in wetland at end of day
!! wet_no3s(:) |kg N |amount of nitrate originating from lateral
!! |flow in wetland at end of day
!! wet_orgn(:) |kg N |amount of organic N originating from
!! |surface runoff in wetland at end of day
!! wet_orgp(:) |kg P |amount of organic P originating from
!! |surface runoff in wetland at end of day
!! wet_psed(:) |kg P |amount of mineral P attached to sediment
!! |originating from surface runoff in wetland at
!! |end of day
!! wet_seci(:) |m |secchi-disk depth in wetland at end of day
!! wet_solp(:) |kg P |amount of soluble P originating from surface
!! |runoff in wetland at end of day
!! wet_solpg(:) |kg P |amount of soluble P originating from
!! |groundwater in wetland at end of day
!! wet_vol(:) |m^3 H2O |volume of water in wetlands
!! wetev |m^3 H2O |evaporation from wetland for day
!! wetflwi |m^3 H2O |volume of water flowing in wetland on day
!! wetflwo |m^3 H2O |volume of water flowing out wetland on day
!! wetpcp |m^3 H2O |precipitation on wetland for day
!! wetsedi |metric tons |sediment loading to wetland for day
!! wetsedo |metric tons |sediment loading from wetland for day
!! wetsep |m^3 H2O |seepage from wetland bottom for day
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!! ~ ~ ~ LOCAL DEFINITIONS ~ ~ ~
!! name |units |definition
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!! ano3_ppm |mg N/L |nitrate concentration in pond
!! ano3_ppw |mg N/L |nitrate concentration in wetland
!! chla_ppm |mg chla/L |chlorophyll-a concentration in pond
!! chla_ppw |mg chla/L |chlorophyll-a concentration in wetland
!! cnv |none |convert mm H2O to m^3 H2O
!! iflag |none |flag to denote presence of impoundment in
!! |HRU
!! ii |none |counter
!! j |none |HRU number
!! minp_ppm |mg P/L |mineral P concentration in pond
!! minp_ppw |mg P/L |mineral P concentration in wetland
!! orgn_ppm |mg N/L |organic N concentration in pond
!! orgn_ppw |mg N/L |organic N concentration in wetland
!! orgp_ppm |mg P/L |organic P concentration in pond
!! orgp_ppw |mg P/L |organic P concentration in wetland
!! pdvas(:) |varies |array to hold HRU output values
!! sb |none |subbasin number
!! ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
!! ~ ~ ~ ~ ~ ~ END SPECIFICATIONS ~ ~ ~ ~ ~ ~
use parm
integer :: j, sb, ii, iflag
real :: orgn_ppm, orgp_ppm, ano3_ppm, minp_ppm, chla_ppm
real :: orgn_ppw, orgp_ppw, ano3_ppw, solp_ppw, chla_ppw, cnv
real, dimension (40) :: pdvas
character*4 cropname
j = 0
sb = 0
j = ihru
sb = inum1
iflag = 0
if (pnd_fr(j) >= 0.01) iflag = 1
if (wet_fr(j) >= 0.01) iflag = 1
!! if (ipot(j) == j) iflag = 1
if (pot_fr(j) > 0.) iflag = 1
if (iflag == 1) then
cnv = 0.
cnv = 10. * hru_ha(j)
!! calculate nutrient concentrations
orgn_ppm = 0.
orgp_ppm = 0.
ano3_ppm = 0.
minp_ppm = 0.
chla_ppm = 0.
orgn_ppw = 0.
orgp_ppw = 0.
ano3_ppw = 0.
solp_ppw = 0.
chla_ppw = 0.
if (pnd_vol(j) > 1.) then
orgn_ppm = 1000. * pnd_orgn(j) / pnd_vol(j)
orgp_ppm = 1000. * pnd_orgp(j) / pnd_vol(j)
ano3_ppm = 1000. * (pnd_no3(j) + pnd_no3s(j) + pnd_no3g(j)) /
& pnd_vol(j)
minp_ppm = 1000. * (pnd_solp(j) + pnd_psed(j) + pnd_solpg(j)) /
& pnd_vol(j)
chla_ppm = 1000. * pnd_chla(j) / pnd_vol(j)
endif
if (wet_vol(j) > 1.) then
orgn_ppw = 1000. * wet_orgn(j) / wet_vol(j)
orgp_ppw = 1000. * wet_orgp(j) / wet_vol(j)
ano3_ppw = 1000. * (wet_no3(j) + wet_no3s(j) + wet_no3g(j)) /
& wet_vol(j)
solp_ppw = 1000. * (wet_solp(j) + wet_solpg(j) + wet_psed(j)) /
& wet_vol(j)
chla_ppw = 1000. * wet_chla(j) / wet_vol(j)
end if
pdvas = 0.
pdvas(1) = pndpcp / cnv
pdvas(2) = pndflwi / cnv
pdvas(3) = pndsedin / hru_ha(j)
pdvas(4) = pndev / cnv
pdvas(5) = pndsep / cnv
pdvas(6) = pndflwo / cnv
pdvas(7) = pndsedo / hru_ha(j)
pdvas(8) = pnd_vol(j)
pdvas(9) = orgn_ppm
pdvas(10) = ano3_ppm
pdvas(11) = orgp_ppm
pdvas(12) = minp_ppm
pdvas(13) = chla_ppm
pdvas(14) = pnd_seci(j)
pdvas(15) = wetpcp / cnv
pdvas(16) = wetflwi / cnv
pdvas(17) = wetsedi / hru_ha(j)
pdvas(18) = wetev / cnv
pdvas(19) = wetsep / cnv
pdvas(20) = wetflwo / cnv
pdvas(21) = wetsedo / hru_ha(j)
pdvas(22) = wet_vol(j)
pdvas(23) = orgn_ppw
pdvas(24) = ano3_ppw
pdvas(25) = orgp_ppw
pdvas(26) = solp_ppw
pdvas(27) = chla_ppw
pdvas(28) = wet_seci(j)
pdvas(29) = potpcpmm
pdvas(30) = potflwi(j) / cnv
pdvas(31) = potsedi(j) / hru_ha(j)
pdvas(32) = potevmm
pdvas(33) = potsepmm
pdvas(34) = potflwo
pdvas(35) = potsedo / hru_ha(j)
pdvas(36) = pot_vol(j)
pdvas(37) = potsa(j)
pdvas(38) = qday + tloss
pdvas(39) = ep_day
pdvas(40) = es_day
if (idplt(j) > 0) then
cropname = cpnm(idplt(j))
else
cropname = 'BARR'
end if
if (iwtr == 1) then
write (29,1000) cropname, j, subnum(j), hruno(j), sb,
& nmgt(j), iida, hru_km(j), (pdvas(ii), ii = 1, 40)
end if
end if
return
1000 format (a4,i5,1x,a5,a4,1x,i4,1x,i4,1x,i4,8f10.3,1e10.4,13f10.3,
& 1e10.4,13f10.3,1e10.4,5f10.3)
end