SUEWS API Site
Documentation of SUEWS source code
Functions/Subroutines
dailystate_module Module Reference

Functions/Subroutines

subroutine suews_cal_dailystate (iy, id, it, imin, isec, tstep, tstep_prev, dt_since_start, dayofweek_id, tmin_id_prev, tmax_id_prev, lenday_id_prev, basetmethod, waterusemethod, ie_start, ie_end, laicalcyes, laitype, nsh_real, avkdn, temp_c, precip, baset_hc, baset_heating, baset_cooling, lat, faut, lai_obs, albmax_dectr, albmax_evetr, albmax_grass, albmin_dectr, albmin_evetr, albmin_grass, capmax_dec, capmin_dec, pormax_dec, pormin_dec, ie_a, ie_m, daywatper, daywat, baset, basete, gddfull, sddfull, laimin, laimax, laipower, decidcap_id_prev, storedrainprm_prev, lai_id_prev, gdd_id_prev, sdd_id_prev, albdectr_id_prev, albevetr_id_prev, albgrass_id_prev, porosity_id_prev, hdd_id_prev, state_id, soilstore_id, soilstorecap, h_maintain, hdd_id_next, tmin_id_next, tmax_id_next, lenday_id_next, albdectr_id_next, albevetr_id_next, albgrass_id_next, porosity_id_next, decidcap_id_next, storedrainprm_next, lai_id_next, gdd_id_next, sdd_id_next, wuday_id)
 
subroutine suews_cal_dailystate_dts (iy, id, it, imin, isec, tstep, tstep_prev, dt_since_start, dayofweek_id, tmin_id_prev, tmax_id_prev, lenday_id_prev, basetmethod, waterusemethod, ie_start, ie_end, laicalcyes, evetrlaitype, dectrlaitype, grasslaitype, nsh_real, avkdn, temp_c, precip, baset_hc, baset_heating_working, baset_heating_holiday, baset_cooling_working, baset_cooling_holiday, lat, faut, lai_obs, albmax_evetr, albmax_dectr, albmax_grass, albmin_evetr, albmin_dectr, albmin_grass, capmax_dec, capmin_dec, pormax_dec, pormin_dec, ie_a, ie_m, daywatper_mon, daywatper_tues, daywatper_wed, daywatper_thur, daywatper_fri, daywatper_sat, daywatper_sun, daywat_mon, daywat_tues, daywat_wed, daywat_thur, daywat_fri, daywat_sat, daywat_sun, evetrbaset, dectrbaset, grassbaset, evetrbasete, dectrbasete, grassbasete, evetrgddfull, dectrgddfull, grassgddfull, evetrsddfull, dectrsddfull, grasssddfull, evetrlaimin, dectrlaimin, grasslaimin, evetrlaimax, dectrlaimax, grasslaimax, evetrlaipower, dectrlaipower, grasslaipower, decidcap_id_prev, storedrainprm_prev, lai_id_prev, gdd_id_prev, sdd_id_prev, albdectr_id_prev, albevetr_id_prev, albgrass_id_prev, porosity_id_prev, hdd_id_prev, state_id, soilstore_id, soilstorecap, h_maintain, hdd_id_next, tmin_id_next, tmax_id_next, lenday_id_next, albdectr_id_next, albevetr_id_next, albgrass_id_next, porosity_id_next, decidcap_id_next, storedrainprm_next, lai_id_next, gdd_id_next, sdd_id_next, wuday_id)
 
subroutine update_dailystate_end (id, it, imin, tstep, dt_since_start, tmin_id, tmax_id, lenday_id, laitype, ie_end, ie_start, laicalcyes, waterusemethod, dayofweek_id, albmax_dectr, albmax_evetr, albmax_grass, albmin_dectr, albmin_evetr, albmin_grass, baset, basete, capmax_dec, capmin_dec, daywat, daywatper, faut, gddfull, ie_a, ie_m, laimax, laimin, laipower, lat, pormax_dec, pormin_dec, sddfull, lai_obs, state_id, soilstore_id, soilstorecap, h_maintain, gdd_id, sdd_id, hdd_id, lai_id, decidcap_id, albdectr_id, albevetr_id, albgrass_id, porosity_id, storedrainprm, wuday_id)
 
subroutine update_dailystate_day (basetmethod, dayofweek_id, avkdn, temp_c, precip, baset_hc, baset_heating, baset_cooling, nsh_real, tmin_id, tmax_id, lenday_id, hdd_id)
 
subroutine update_veg (laimax, laimin, albmax_dectr, albmax_evetr, albmax_grass, albmin_dectr, albmin_evetr, albmin_grass, capmax_dec, capmin_dec, pormax_dec, pormin_dec, lai_id, lai_id_prev, decidcap_id, albdectr_id, albevetr_id, albgrass_id, porosity_id, storedrainprm)
 
subroutine update_gddlai (id, laicalcyes, lat, lai_obs, tmin_id_prev, tmax_id_prev, lenday_id_prev, baset, basete, gddfull, sddfull, laimin, laimax, laipower, laitype, lai_id_prev, gdd_id, sdd_id, lai_id_next)
 
subroutine update_wateruse (id, waterusemethod, dayofweek_id, lat, frirriauto, hdd_id, state_id, soilstore_id, soilstorecap, h_maintain, ie_a, ie_m, ie_start, ie_end, daywatper, daywat, wuday_id)
 
subroutine update_hdd (dt_since_start, it, imin, tstep, hdd_id)
 
subroutine update_dailystate_start (it, imin, hdd_id)
 
subroutine suews_update_dailystate (id, datetimeline, gridiv, numberofgrids, dailystateline, dataoutdailystate)
 
subroutine update_dailystateline (it, imin, nsh_real, gdd_id, hdd_id, lai_id, sdd_id, tmin_id, tmax_id, lenday_id, decidcap_id, albdectr_id, albevetr_id, albgrass_id, porosity_id, wuday_id, vegphenlumps, snowalb, snowdens, a1, a2, a3, dailystateline)
 

Function/Subroutine Documentation

◆ suews_cal_dailystate()

subroutine dailystate_module::suews_cal_dailystate ( integer, intent(in) iy,
integer, intent(in) id,
integer, intent(in) it,
integer, intent(in) imin,
integer, intent(in) isec,
integer, intent(in) tstep,
integer, intent(in) tstep_prev,
integer, intent(in) dt_since_start,
integer, dimension(3), intent(in) dayofweek_id,
real(kind(1d0)), intent(in) tmin_id_prev,
real(kind(1d0)), intent(in) tmax_id_prev,
real(kind(1d0)), intent(in) lenday_id_prev,
integer, intent(in) basetmethod,
integer, intent(in) waterusemethod,
integer, intent(in) ie_start,
integer, intent(in) ie_end,
integer, intent(in) laicalcyes,
integer, dimension(nvegsurf), intent(in) laitype,
real(kind(1d0)), intent(in) nsh_real,
real(kind(1d0)), intent(in) avkdn,
real(kind(1d0)), intent(in) temp_c,
real(kind(1d0)), intent(in) precip,
real(kind(1d0)), intent(in) baset_hc,
real(kind(1d0)), dimension(2), intent(in) baset_heating,
real(kind(1d0)), dimension(2), intent(in) baset_cooling,
real(kind(1d0)), intent(in) lat,
real(kind(1d0)), intent(in) faut,
real(kind(1d0)), intent(in) lai_obs,
real(kind(1d0)), intent(in) albmax_dectr,
real(kind(1d0)), intent(in) albmax_evetr,
real(kind(1d0)), intent(in) albmax_grass,
real(kind(1d0)), intent(in) albmin_dectr,
real(kind(1d0)), intent(in) albmin_evetr,
real(kind(1d0)), intent(in) albmin_grass,
real(kind(1d0)), intent(in) capmax_dec,
real(kind(1d0)), intent(in) capmin_dec,
real(kind(1d0)), intent(in) pormax_dec,
real(kind(1d0)), intent(in) pormin_dec,
real(kind(1d0)), dimension(3), intent(in) ie_a,
real(kind(1d0)), dimension(3), intent(in) ie_m,
real(kind(1d0)), dimension(7), intent(in) daywatper,
real(kind(1d0)), dimension(7), intent(in) daywat,
real(kind(1d0)), dimension(nvegsurf), intent(in) baset,
real(kind(1d0)), dimension(nvegsurf), intent(in) basete,
real(kind(1d0)), dimension(nvegsurf), intent(in) gddfull,
real(kind(1d0)), dimension(nvegsurf), intent(in) sddfull,
real(kind(1d0)), dimension(nvegsurf), intent(in) laimin,
real(kind(1d0)), dimension(nvegsurf), intent(in) laimax,
real(kind(1d0)), dimension(4, nvegsurf), intent(in) laipower,
real(kind(1d0)), intent(in) decidcap_id_prev,
real(kind(1d0)), dimension(6, nsurf), intent(in) storedrainprm_prev,
real(kind(1d0)), dimension(3), intent(in) lai_id_prev,
real(kind(1d0)), dimension(3), intent(in) gdd_id_prev,
real(kind(1d0)), dimension(3), intent(in) sdd_id_prev,
real(kind(1d0)), intent(in) albdectr_id_prev,
real(kind(1d0)), intent(in) albevetr_id_prev,
real(kind(1d0)), intent(in) albgrass_id_prev,
real(kind(1d0)), intent(inout) porosity_id_prev,
real(kind(1d0)), dimension(12), intent(in) hdd_id_prev,
real(kind(1d0)), dimension(nsurf), intent(in) state_id,
real(kind(1d0)), dimension(nsurf), intent(in) soilstore_id,
real(kind(1d0)), dimension(nsurf), intent(in) soilstorecap,
real(kind(1d0)), intent(in) h_maintain,
real(kind(1d0)), dimension(12), intent(out) hdd_id_next,
real(kind(1d0)), intent(out) tmin_id_next,
real(kind(1d0)), intent(out) tmax_id_next,
real(kind(1d0)), intent(out) lenday_id_next,
real(kind(1d0)), intent(out) albdectr_id_next,
real(kind(1d0)), intent(out) albevetr_id_next,
real(kind(1d0)), intent(out) albgrass_id_next,
real(kind(1d0)), intent(inout) porosity_id_next,
real(kind(1d0)), intent(out) decidcap_id_next,
real(kind(1d0)), dimension(6, nsurf), intent(out) storedrainprm_next,
real(kind(1d0)), dimension(3), intent(out) lai_id_next,
real(kind(1d0)), dimension(3), intent(out) gdd_id_next,
real(kind(1d0)), dimension(3), intent(out) sdd_id_next,
real(kind(1d0)), dimension(9), intent(out) wuday_id )

Definition at line 57 of file suews_phys_dailystate.f95.

79
80 ! USE Snow_module, ONLY: SnowUpdate
81 USE datetime_module, ONLY: datetime, timedelta
82
83 IMPLICIT NONE
84
85 INTEGER, INTENT(IN) :: iy
86 INTEGER, INTENT(IN) :: id
87 INTEGER, INTENT(IN) :: it
88 INTEGER, INTENT(IN) :: imin
89 INTEGER, INTENT(IN) :: isec
90 INTEGER, INTENT(IN) :: tstep
91 INTEGER, INTENT(IN) :: tstep_prev
92 INTEGER, INTENT(IN) :: dt_since_start
93
94 INTEGER, INTENT(IN) :: WaterUseMethod
95 INTEGER, INTENT(IN) :: BaseTMethod
96 INTEGER, INTENT(IN) :: Ie_start !Starting time of water use (DOY)
97 INTEGER, INTENT(IN) :: Ie_end !Ending time of water use (DOY)
98 INTEGER, INTENT(IN) :: LAICalcYes
99
100 INTEGER, DIMENSION(nvegsurf), INTENT(IN) :: LAIType !LAI equation to use: original (0) or new (1)
101
102 REAL(KIND(1D0)), INTENT(IN) :: nsh_real
103 REAL(KIND(1D0)), INTENT(IN) :: avkdn
104 REAL(KIND(1D0)), INTENT(IN) :: Temp_C
105 REAL(KIND(1D0)), INTENT(IN) :: Precip
106 REAL(KIND(1D0)), INTENT(IN) :: BaseT_HC
107 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: BaseT_Heating
108 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: BaseT_Cooling
109 REAL(KIND(1D0)), INTENT(IN) :: lat
110 REAL(KIND(1D0)), INTENT(IN) :: Faut
111 REAL(KIND(1D0)), INTENT(IN) :: LAI_obs
112 ! REAL(KIND(1D0)), INTENT(IN)::tau_a
113 ! REAL(KIND(1D0)), INTENT(IN)::tau_f
114 ! REAL(KIND(1D0)), INTENT(IN)::tau_r
115 ! REAL(KIND(1D0)), INTENT(IN)::SnowDensMax
116 ! REAL(KIND(1D0)), INTENT(IN)::SnowDensMin
117 ! REAL(KIND(1D0)), INTENT(in)::SnowAlbMax
118 ! REAL(KIND(1D0)), INTENT(IN)::SnowAlbMin
119 REAL(KIND(1D0)), INTENT(IN) :: AlbMax_DecTr
120 REAL(KIND(1D0)), INTENT(IN) :: AlbMax_EveTr
121 REAL(KIND(1D0)), INTENT(IN) :: AlbMax_Grass
122 REAL(KIND(1D0)), INTENT(IN) :: AlbMin_DecTr
123 REAL(KIND(1D0)), INTENT(IN) :: AlbMin_EveTr
124 REAL(KIND(1D0)), INTENT(IN) :: AlbMin_Grass
125 REAL(KIND(1D0)), INTENT(IN) :: CapMax_dec
126 REAL(KIND(1D0)), INTENT(IN) :: CapMin_dec
127 REAL(KIND(1D0)), INTENT(IN) :: PorMax_dec
128 REAL(KIND(1D0)), INTENT(IN) :: PorMin_dec
129 ! REAL(KIND(1d0)),INTENT(IN) ::VegPhenLumps
130
131 REAL(KIND(1D0)), DIMENSION(3), INTENT(IN) :: Ie_a
132 REAL(KIND(1D0)), DIMENSION(3), INTENT(IN) :: Ie_m !Coefficients for automatic and manual irrigation models
133 REAL(KIND(1D0)), DIMENSION(7), INTENT(IN) :: DayWatPer !% of houses following daily water
134 REAL(KIND(1D0)), DIMENSION(7), INTENT(IN) :: DayWat !Days of watering allowed
135
136 ! ponding-water related
137 REAL(KIND(1D0)), INTENT(IN) :: H_maintain ! ponding water depth to maintain [mm]
138 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(IN) :: state_id ! surface wetness [mm]
139 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(IN) :: soilstore_id ! soil water store [mm]
140 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: SoilStoreCap !Capacity of soil store for each surface [mm]
141
142 ! REAL(KIND(1d0)), DIMENSION(nsurf), INTENT(IN) ::SnowPack
143 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(IN) :: BaseT !Base temperature for growing degree days [degC]
144 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(IN) :: BaseTe !Base temperature for senescence degree days [degC]
145 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(IN) :: GDDFull !Growing degree days needed for full capacity [degC]
146 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(IN) :: SDDFull !Senescence degree days needed to initiate leaf off [degC]
147 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(IN) :: LAIMin !Min LAI [m2 m-2]
148 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(IN) :: LAIMax !Max LAI [m2 m-2]
149 REAL(KIND(1D0)), DIMENSION(4, nvegsurf), INTENT(IN) :: LAIPower !Coeffs for LAI equation: 1,2 - leaf growth; 3,4 - leaf off
150
151 ! REAL(KIND(1d0)), INTENT(INOUT)::SnowAlb
152
153 ! Growing Degree Days
154 REAL(KIND(1D0)), DIMENSION(3) :: GDD_id ! Growing Degree Days (see SUEWS_DailyState.f95)
155 REAL(KIND(1D0)), DIMENSION(3), INTENT(IN) :: GDD_id_prev ! Growing Degree Days (see SUEWS_DailyState.f95)
156 REAL(KIND(1D0)), DIMENSION(3), INTENT(OUT) :: GDD_id_next ! Growing Degree Days (see SUEWS_DailyState.f95)
157
158 ! Senescence Degree Days
159 REAL(KIND(1D0)), DIMENSION(3) :: SDD_id ! Senescence Degree Days (see SUEWS_DailyState.f95)
160 REAL(KIND(1D0)), DIMENSION(3), INTENT(IN) :: SDD_id_prev ! Senescence Degree Days (see SUEWS_DailyState.f95)
161 REAL(KIND(1D0)), DIMENSION(3), INTENT(OUT) :: SDD_id_next ! Senescence Degree Days (see SUEWS_DailyState.f95)
162
163 ! Daily min temp [degC]
164 REAL(KIND(1D0)) :: Tmin_id
165 REAL(KIND(1D0)), INTENT(IN) :: Tmin_id_prev
166 REAL(KIND(1D0)), INTENT(out) :: Tmin_id_next
167
168 ! Daily max temp [degC]
169 REAL(KIND(1D0)) :: Tmax_id
170 REAL(KIND(1D0)), INTENT(in) :: Tmax_id_prev
171 REAL(KIND(1D0)), INTENT(out) :: Tmax_id_next
172
173 ! Daytime hours [h]
174 REAL(KIND(1D0)) :: lenDay_id
175 REAL(KIND(1D0)), INTENT(IN) :: lenDay_id_prev
176 REAL(KIND(1D0)), INTENT(out) :: lenDay_id_next
177
178 ! LAI for each veg surface [m2 m-2]
179 REAL(KIND(1D0)), DIMENSION(3) :: LAI_id ! LAI for each veg surface [m2 m-2]
180 REAL(KIND(1D0)), DIMENSION(3), INTENT(IN) :: LAI_id_prev ! LAI for each veg surface [m2 m-2]
181 REAL(KIND(1D0)), DIMENSION(3), INTENT(OUT) :: LAI_id_next ! LAI for each veg surface [m2 m-2]
182
183 ! ------------- Key to daily arrays ----------------------------------------------
184 ! TS, 27 Dec 2018: updated the annotation for 2018b and WRF-SUEWS coupling
185
186 ! Heating Degree Days
187 REAL(KIND(1D0)), DIMENSION(12) :: HDD_id ! Heating Degree Days (see SUEWS_DailyState.f95)
188 REAL(KIND(1D0)), DIMENSION(12), INTENT(IN) :: HDD_id_prev ! Heating Degree Days (see SUEWS_DailyState.f95)
189 REAL(KIND(1D0)), DIMENSION(12), INTENT(OUT) :: HDD_id_next ! Heating Degree Days (see SUEWS_DailyState.f95)
190 ! HDD_id:
191 ! first half used for update through the day
192 ! HDD_id(1) ---- Heating [degC]: used for accumulation during calculation
193 ! HDD_id(2) ---- Cooling [degC]: used for accumulation during calculation
194 ! HDD_id(3) ---- Daily mean temp [degC]: used for accumulation during calculation
195 ! HDD_id(4) ---- 5-day running mean temp [degC]: used for actual calculation
196 ! HDD_id(5) ---- Daily precip total [mm]
197 ! HDD_id(6) ---- Days since rain [d]
198 ! second half used for storage of the first half for the prevous day
199 ! HDD_id(6+1) ---- Heating [degC]: used for accumulation during calculation
200 ! HDD_id(6+2) ---- Cooling [degC]: used for accumulation during calculation
201 ! HDD_id(6+3) ---- Daily mean temp [degC]: used for accumulation during calculation
202 ! HDD_id(6+4) ---- 5-day running mean temp [degC]: used for actual calculation
203 ! HDD_id(6+5) ---- Daily precip total [mm]
204 ! HDD_id(6+6) ---- Days since rain [d]
205 ! --------------------------------------------------------------------------------
206
207 ! --------------------------------------------------------------------------------
208 !Daily water use for EveTr, DecTr, Grass [mm] (see SUEWS_DailyState.f95)
209 REAL(KIND(1D0)), DIMENSION(9), INTENT(OUT) :: WUDay_id ! Water use related array
210 ! WUDay_id:
211 ! WUDay_id(1) - Daily water use total for Irr EveTr (automatic+manual) [mm]
212 ! WUDay_id(2) - Automatic irrigation for Irr EveTr [mm]
213 ! WUDay_id(3) - Manual irrigation for Irr EveTr [mm]
214 ! WUDay_id(4) - Daily water use total for Irr DecTr (automatic+manual) [mm]
215 ! WUDay_id(5) - Automatic irrigation for Irr DecTr [mm]
216 ! WUDay_id(6) - Manual irrigation for Irr DecTr [mm]
217 ! WUDay_id(7) - Daily water use total for Irr Grass (automatic+manual) [mm]
218 ! WUDay_id(8) - Automatic irrigation for Irr Grass [mm]
219 ! WUDay_id(9) - Manual irrigation for Irr Grass [mm]
220 ! --------------------------------------------------------------------------------
221
222 ! REAL(KIND(1d0)), DIMENSION(nsurf), INTENT(INOUT)::SnowDens
223 INTEGER, DIMENSION(3), INTENT(in) :: DayofWeek_id
224
225 ! REAL(KIND(1D0)), INTENT(OUT) :: deltaLAI
226
227 REAL(KIND(1D0)) :: DecidCap_id
228 REAL(KIND(1D0)), INTENT(IN) :: DecidCap_id_prev
229 REAL(KIND(1D0)), INTENT(OUT) :: DecidCap_id_next
230 REAL(KIND(1D0)) :: albDecTr_id
231 REAL(KIND(1D0)), INTENT(IN) :: albDecTr_id_prev
232 REAL(KIND(1D0)), INTENT(OUT) :: albDecTr_id_next
233 REAL(KIND(1D0)) :: albEveTr_id
234 REAL(KIND(1D0)), INTENT(IN) :: albEveTr_id_prev
235 REAL(KIND(1D0)), INTENT(OUT) :: albEveTr_id_next
236 REAL(KIND(1D0)) :: albGrass_id
237 REAL(KIND(1D0)), INTENT(IN) :: albGrass_id_prev
238 REAL(KIND(1D0)), INTENT(OUT) :: albGrass_id_next
239 REAL(KIND(1D0)) :: porosity_id
240 REAL(KIND(1D0)), INTENT(INOUT) :: porosity_id_prev
241 REAL(KIND(1D0)), INTENT(INOUT) :: porosity_id_next
242 REAL(KIND(1D0)), DIMENSION(6, nsurf) :: StoreDrainPrm
243 REAL(KIND(1D0)), DIMENSION(6, nsurf), INTENT(in) :: StoreDrainPrm_prev
244 REAL(KIND(1D0)), DIMENSION(6, nsurf), INTENT(out) :: StoreDrainPrm_next
245
246 LOGICAL :: first_tstep_Q ! if this is the first tstep of a day
247 LOGICAL :: last_tstep_Q ! if this is the last tstep of a day
248 TYPE(datetime) :: time_now, time_prev, time_next
249
250 ! transfer values
251 lai_id = lai_id_prev
252 gdd_id = gdd_id_prev
253 sdd_id = sdd_id_prev
254 tmin_id = tmin_id_prev
255 tmax_id = tmax_id_prev
256 lenday_id = lenday_id_prev
257 storedrainprm = storedrainprm_prev
258 decidcap_id = decidcap_id_prev
259 albdectr_id = albdectr_id_prev
260 albevetr_id = albevetr_id_prev
261 albgrass_id = albgrass_id_prev
262 porosity_id = porosity_id_prev
263 hdd_id = hdd_id_prev
264
265 ! get timestamps
266 time_now = datetime(year=iy) + timedelta(days=id - 1, hours=it, minutes=imin, seconds=isec)
267 time_prev = time_now - timedelta(seconds=tstep_prev)
268 time_next = time_now + timedelta(seconds=tstep)
269
270 ! test if time at now is the first/last tstep of today
271 first_tstep_q = time_now%getDay() /= time_prev%getDay()
272 last_tstep_q = time_now%getDay() /= time_next%getDay()
273
274 ! --------------------------------------------------------------------------------
275 ! On first timestep of each day, define whether the day each a workday or weekend
276 IF (first_tstep_q) THEN
277 CALL update_dailystate_start( &
278 it, imin, & !input
279 hdd_id) !inout
280
281 ! reset certain GDD columns
282 tmin_id = temp_c !Daily min T in column 3
283 tmax_id = temp_c !Daily max T in column 4
284 lenday_id = 0 !Cumulate daytime hours
285 END IF
286
287 ! --------------------------------------------------------------------------------
288 ! regular update at all timesteps of a day
289 CALL update_dailystate_day( &
290 basetmethod, &
291 dayofweek_id, &
292 avkdn, & !input
293 temp_c, &
294 precip, &
295 baset_hc, &
296 baset_heating, baset_cooling, &
297 nsh_real, &
298 tmin_id, tmax_id, lenday_id, & !inout
299 hdd_id) !inout
300
301 ! Update snow density, albedo surface fraction
302 ! IF (SnowUse == 1) CALL SnowUpdate( &
303 ! nsurf, tstep, Temp_C, tau_a, tau_f, tau_r, &!input
304 ! SnowDensMax, SnowDensMin, SnowAlbMax, SnowAlbMin, SnowPack, &
305 ! SnowAlb, SnowDens)!inout
306
307 ! --------------------------------------------------------------------------------
308 ! On last timestep, perform the daily calculations -------------------------------
309 ! Daily values not correct until end of each day,
310 ! so main program should use values from the previous day
311 IF (last_tstep_q) THEN
312 CALL update_dailystate_end( &
313 id, it, imin, tstep, dt_since_start, & !input
314 tmin_id, tmax_id, lenday_id, &
315 laitype, ie_end, ie_start, laicalcyes, &
316 waterusemethod, dayofweek_id, &
317 albmax_dectr, albmax_evetr, albmax_grass, albmin_dectr, albmin_evetr, albmin_grass, &
318 baset, basete, capmax_dec, capmin_dec, daywat, daywatper, faut, gddfull, &
319 ie_a, ie_m, laimax, laimin, laipower, lat, pormax_dec, pormin_dec, sddfull, lai_obs, &
320 state_id, soilstore_id, soilstorecap, h_maintain, & !input
321 gdd_id, sdd_id, & !inout
322 hdd_id, &
323 lai_id, &
324 decidcap_id, &
325 albdectr_id, &
326 albevetr_id, &
327 albgrass_id, &
328 porosity_id, &
329 storedrainprm, &
330 wuday_id) !output
331 END IF !End of section done only at the end of each day (i.e. only once per day)
332
333 ! translate values back
334 lai_id_next = lai_id
335 gdd_id_next = gdd_id
336 sdd_id_next = sdd_id
337 tmin_id_next = tmin_id
338 tmax_id_next = tmax_id
339 lenday_id_next = lenday_id
340 storedrainprm_next = storedrainprm
341 decidcap_id_next = decidcap_id
342 albdectr_id_next = albdectr_id
343 albevetr_id_next = albevetr_id
344 albgrass_id_next = albgrass_id
345 porosity_id_next = porosity_id
346 hdd_id_next = hdd_id
347 ! PRINT*, 'after_DailyState', iy,id,it,imin
348 ! PRINT*, 'HDD(id)', HDD(id,:)
349 ! PRINT*, 'HDD_id', HDD_id
350
351 ! RETURN
352

References update_dailystate_day(), update_dailystate_end(), and update_dailystate_start().

Referenced by suews_driver::suews_cal_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ suews_cal_dailystate_dts()

subroutine dailystate_module::suews_cal_dailystate_dts ( integer, intent(in) iy,
integer, intent(in) id,
integer, intent(in) it,
integer, intent(in) imin,
integer, intent(in) isec,
integer, intent(in) tstep,
integer, intent(in) tstep_prev,
integer, intent(in) dt_since_start,
integer, dimension(3), intent(in) dayofweek_id,
real(kind(1d0)), intent(in) tmin_id_prev,
real(kind(1d0)), intent(in) tmax_id_prev,
real(kind(1d0)), intent(in) lenday_id_prev,
integer, intent(in) basetmethod,
integer, intent(in) waterusemethod,
integer, intent(in) ie_start,
integer, intent(in) ie_end,
integer, intent(in) laicalcyes,
integer, intent(in) evetrlaitype,
integer, intent(in) dectrlaitype,
integer, intent(in) grasslaitype,
real(kind(1d0)), intent(in) nsh_real,
real(kind(1d0)), intent(in) avkdn,
real(kind(1d0)), intent(in) temp_c,
real(kind(1d0)), intent(in) precip,
real(kind(1d0)), intent(in) baset_hc,
real(kind(1d0)), intent(in) baset_heating_working,
real(kind(1d0)), intent(in) baset_heating_holiday,
real(kind(1d0)), intent(in) baset_cooling_working,
real(kind(1d0)), intent(in) baset_cooling_holiday,
real(kind(1d0)), intent(in) lat,
real(kind(1d0)), intent(in) faut,
real(kind(1d0)), intent(in) lai_obs,
real(kind(1d0)), intent(in) albmax_evetr,
real(kind(1d0)), intent(in) albmax_dectr,
real(kind(1d0)), intent(in) albmax_grass,
real(kind(1d0)), intent(in) albmin_evetr,
real(kind(1d0)), intent(in) albmin_dectr,
real(kind(1d0)), intent(in) albmin_grass,
real(kind(1d0)), intent(in) capmax_dec,
real(kind(1d0)), intent(in) capmin_dec,
real(kind(1d0)), intent(in) pormax_dec,
real(kind(1d0)), intent(in) pormin_dec,
real(kind(1d0)), dimension(3), intent(in) ie_a,
real(kind(1d0)), dimension(3), intent(in) ie_m,
real(kind(1d0)), intent(in) daywatper_mon,
real(kind(1d0)), intent(in) daywatper_tues,
real(kind(1d0)), intent(in) daywatper_wed,
real(kind(1d0)), intent(in) daywatper_thur,
real(kind(1d0)), intent(in) daywatper_fri,
real(kind(1d0)), intent(in) daywatper_sat,
real(kind(1d0)), intent(in) daywatper_sun,
real(kind(1d0)), intent(in) daywat_mon,
real(kind(1d0)), intent(in) daywat_tues,
real(kind(1d0)), intent(in) daywat_wed,
real(kind(1d0)), intent(in) daywat_thur,
real(kind(1d0)), intent(in) daywat_fri,
real(kind(1d0)), intent(in) daywat_sat,
real(kind(1d0)), intent(in) daywat_sun,
real(kind(1d0)), intent(in) evetrbaset,
real(kind(1d0)), intent(in) dectrbaset,
real(kind(1d0)), intent(in) grassbaset,
real(kind(1d0)), intent(in) evetrbasete,
real(kind(1d0)), intent(in) dectrbasete,
real(kind(1d0)), intent(in) grassbasete,
real(kind(1d0)), intent(in) evetrgddfull,
real(kind(1d0)), intent(in) dectrgddfull,
real(kind(1d0)), intent(in) grassgddfull,
real(kind(1d0)), intent(in) evetrsddfull,
real(kind(1d0)), intent(in) dectrsddfull,
real(kind(1d0)), intent(in) grasssddfull,
real(kind(1d0)), intent(in) evetrlaimin,
real(kind(1d0)), intent(in) dectrlaimin,
real(kind(1d0)), intent(in) grasslaimin,
real(kind(1d0)), intent(in) evetrlaimax,
real(kind(1d0)), intent(in) dectrlaimax,
real(kind(1d0)), intent(in) grasslaimax,
real(kind(1d0)), dimension(4), intent(in) evetrlaipower,
real(kind(1d0)), dimension(4), intent(in) dectrlaipower,
real(kind(1d0)), dimension(4), intent(in) grasslaipower,
real(kind(1d0)), intent(in) decidcap_id_prev,
real(kind(1d0)), dimension(6, nsurf), intent(in) storedrainprm_prev,
real(kind(1d0)), dimension(3), intent(in) lai_id_prev,
real(kind(1d0)), dimension(3), intent(in) gdd_id_prev,
real(kind(1d0)), dimension(3), intent(in) sdd_id_prev,
real(kind(1d0)), intent(in) albdectr_id_prev,
real(kind(1d0)), intent(in) albevetr_id_prev,
real(kind(1d0)), intent(in) albgrass_id_prev,
real(kind(1d0)), intent(inout) porosity_id_prev,
real(kind(1d0)), dimension(12), intent(in) hdd_id_prev,
real(kind(1d0)), dimension(nsurf), intent(in) state_id,
real(kind(1d0)), dimension(nsurf), intent(in) soilstore_id,
real(kind(1d0)), dimension(nsurf), intent(in) soilstorecap,
real(kind(1d0)), intent(in) h_maintain,
real(kind(1d0)), dimension(12), intent(out) hdd_id_next,
real(kind(1d0)), intent(out) tmin_id_next,
real(kind(1d0)), intent(out) tmax_id_next,
real(kind(1d0)), intent(out) lenday_id_next,
real(kind(1d0)), intent(out) albdectr_id_next,
real(kind(1d0)), intent(out) albevetr_id_next,
real(kind(1d0)), intent(out) albgrass_id_next,
real(kind(1d0)), intent(inout) porosity_id_next,
real(kind(1d0)), intent(out) decidcap_id_next,
real(kind(1d0)), dimension(6, nsurf), intent(out) storedrainprm_next,
real(kind(1d0)), dimension(3), intent(out) lai_id_next,
real(kind(1d0)), dimension(3), intent(out) gdd_id_next,
real(kind(1d0)), dimension(3), intent(out) sdd_id_next,
real(kind(1d0)), dimension(9), intent(out) wuday_id )

Definition at line 355 of file suews_phys_dailystate.f95.

387
388 ! USE Snow_module, ONLY: SnowUpdate
389 USE datetime_module, ONLY: datetime, timedelta
390
391 IMPLICIT NONE
392
393 INTEGER, INTENT(IN) :: iy
394 INTEGER, INTENT(IN) :: id
395 INTEGER, INTENT(IN) :: it
396 INTEGER, INTENT(IN) :: imin
397 INTEGER, INTENT(IN) :: isec
398 INTEGER, INTENT(IN) :: tstep
399 INTEGER, INTENT(IN) :: tstep_prev
400 INTEGER, INTENT(IN) :: dt_since_start
401
402 INTEGER, INTENT(IN) :: WaterUseMethod
403 INTEGER, INTENT(IN) :: BaseTMethod
404 INTEGER, INTENT(IN) :: Ie_start !Starting time of water use (DOY)
405 INTEGER, INTENT(IN) :: Ie_end !Ending time of water use (DOY)
406 INTEGER, INTENT(IN) :: LAICalcYes
407
408 INTEGER, INTENT(IN) :: dectrLAIType
409 INTEGER, INTENT(IN) :: evetrLAIType
410 INTEGER, INTENT(IN) :: grassLAIType
411 INTEGER, DIMENSION(nvegsurf) :: LAIType !LAI equation to use: original (0) or new (1)
412
413 REAL(KIND(1D0)), INTENT(IN) :: nsh_real
414 REAL(KIND(1D0)), INTENT(IN) :: avkdn
415 REAL(KIND(1D0)), INTENT(IN) :: Temp_C
416 REAL(KIND(1D0)), INTENT(IN) :: Precip
417 REAL(KIND(1D0)), INTENT(IN) :: BaseT_HC
418
419 REAL(KIND(1D0)), INTENT(IN) :: BaseT_Heating_working
420 REAL(KIND(1D0)), INTENT(IN) :: BaseT_Heating_holiday
421 REAL(KIND(1D0)), DIMENSION(2) :: BaseT_Heating
422
423 REAL(KIND(1D0)), INTENT(IN) :: BaseT_Cooling_working
424 REAL(KIND(1D0)), INTENT(IN) :: BaseT_Cooling_holiday
425 REAL(KIND(1D0)), DIMENSION(2) :: BaseT_Cooling
426
427 REAL(KIND(1D0)), INTENT(IN) :: lat
428 REAL(KIND(1D0)), INTENT(IN) :: Faut
429 REAL(KIND(1D0)), INTENT(IN) :: LAI_obs
430 ! REAL(KIND(1D0)), INTENT(IN)::tau_a
431 ! REAL(KIND(1D0)), INTENT(IN)::tau_f
432 ! REAL(KIND(1D0)), INTENT(IN)::tau_r
433 ! REAL(KIND(1D0)), INTENT(IN)::SnowDensMax
434 ! REAL(KIND(1D0)), INTENT(IN)::SnowDensMin
435 ! REAL(KIND(1D0)), INTENT(in)::SnowAlbMax
436 ! REAL(KIND(1D0)), INTENT(IN)::SnowAlbMin
437 REAL(KIND(1D0)), INTENT(IN) :: AlbMax_EveTr
438 REAL(KIND(1D0)), INTENT(IN) :: AlbMax_DecTr
439 REAL(KIND(1D0)), INTENT(IN) :: AlbMax_Grass
440 REAL(KIND(1D0)), INTENT(IN) :: AlbMin_EveTr
441 REAL(KIND(1D0)), INTENT(IN) :: AlbMin_DecTr
442 REAL(KIND(1D0)), INTENT(IN) :: AlbMin_Grass
443 REAL(KIND(1D0)), INTENT(IN) :: CapMax_dec
444 REAL(KIND(1D0)), INTENT(IN) :: CapMin_dec
445 REAL(KIND(1D0)), INTENT(IN) :: PorMax_dec
446 REAL(KIND(1D0)), INTENT(IN) :: PorMin_dec
447 ! REAL(KIND(1d0)),INTENT(IN) ::VegPhenLumps
448
449 REAL(KIND(1D0)), DIMENSION(3), INTENT(IN) :: Ie_a
450 REAL(KIND(1D0)), DIMENSION(3), INTENT(IN) :: Ie_m !Coefficients for automatic and manual irrigation models
451
452 REAL(KIND(1D0)), INTENT(IN) :: DayWatPer_mon
453 REAL(KIND(1D0)), INTENT(IN) :: DayWatPer_tues
454 REAL(KIND(1D0)), INTENT(IN) :: DayWatPer_wed
455 REAL(KIND(1D0)), INTENT(IN) :: DayWatPer_thur
456 REAL(KIND(1D0)), INTENT(IN) :: DayWatPer_fri
457 REAL(KIND(1D0)), INTENT(IN) :: DayWatPer_sat
458 REAL(KIND(1D0)), INTENT(IN) :: DayWatPer_sun
459 REAL(KIND(1D0)), DIMENSION(7) :: DayWatPer !% of houses following daily water
460
461 REAL(KIND(1D0)), INTENT(IN) :: DayWat_mon
462 REAL(KIND(1D0)), INTENT(IN) :: DayWat_tues
463 REAL(KIND(1D0)), INTENT(IN) :: DayWat_wed
464 REAL(KIND(1D0)), INTENT(IN) :: DayWat_thur
465 REAL(KIND(1D0)), INTENT(IN) :: DayWat_fri
466 REAL(KIND(1D0)), INTENT(IN) :: DayWat_sat
467 REAL(KIND(1D0)), INTENT(IN) :: DayWat_sun
468 REAL(KIND(1D0)), DIMENSION(7) :: DayWat !Days of watering allowed
469
470 ! ponding-water related
471 REAL(KIND(1D0)), INTENT(IN) :: H_maintain ! ponding water depth to maintain [mm]
472 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(IN) :: state_id ! surface wetness [mm]
473 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(IN) :: soilstore_id ! soil water store [mm]
474 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: SoilStoreCap !Capacity of soil store for each surface [mm]
475
476 ! REAL(KIND(1d0)), DIMENSION(nsurf), INTENT(IN) ::SnowPack
477 REAL(KIND(1D0)), INTENT(IN) :: evetrBaseT
478 REAL(KIND(1D0)), INTENT(IN) :: dectrBaseT
479 REAL(KIND(1D0)), INTENT(IN) :: grassBaseT
480 REAL(KIND(1D0)), DIMENSION(nvegsurf) :: BaseT !Base temperature for growing degree days [degC]
481
482 REAL(KIND(1D0)), INTENT(IN) :: evetrBaseTe
483 REAL(KIND(1D0)), INTENT(IN) :: dectrBaseTe
484 REAL(KIND(1D0)), INTENT(IN) :: grassBaseTe
485 REAL(KIND(1D0)), DIMENSION(nvegsurf) :: BaseTe !Base temperature for senescence degree days [degC]
486
487 REAL(KIND(1D0)), INTENT(IN) :: evetrGDDFull
488 REAL(KIND(1D0)), INTENT(IN) :: dectrGDDFull
489 REAL(KIND(1D0)), INTENT(IN) :: grassGDDFull
490 REAL(KIND(1D0)), DIMENSION(nvegsurf) :: GDDFull !Growing degree days needed for full capacity [degC]
491
492 REAL(KIND(1D0)), INTENT(IN) :: evetrSDDFull
493 REAL(KIND(1D0)), INTENT(IN) :: dectrSDDFull
494 REAL(KIND(1D0)), INTENT(IN) :: grassSDDFull
495 REAL(KIND(1D0)), DIMENSION(nvegsurf) :: SDDFull !Senescence degree days needed to initiate leaf off [degC]
496
497 REAL(KIND(1D0)), INTENT(IN) :: evetrLAIMin
498 REAL(KIND(1D0)), INTENT(IN) :: dectrLAIMin
499 REAL(KIND(1D0)), INTENT(IN) :: grassLAIMin
500 REAL(KIND(1D0)), DIMENSION(nvegsurf) :: LAIMin !Min LAI [m2 m-2]
501
502 REAL(KIND(1D0)), INTENT(IN) :: evetrLAIMax
503 REAL(KIND(1D0)), INTENT(IN) :: dectrLAIMax
504 REAL(KIND(1D0)), INTENT(IN) :: grassLAIMax
505 REAL(KIND(1D0)), DIMENSION(nvegsurf) :: LAIMax !Max LAI [m2 m-2]
506
507 REAL(KIND(1D0)), DIMENSION(4), INTENT(IN) :: evetrLAIPower
508 REAL(KIND(1D0)), DIMENSION(4), INTENT(IN) :: dectrLAIPower
509 REAL(KIND(1D0)), DIMENSION(4), INTENT(IN) :: grassLAIPower
510 REAL(KIND(1D0)), DIMENSION(4, nvegsurf) :: LAIPower !Coeffs for LAI equation: 1,2 - leaf growth; 3,4 - leaf off
511
512 ! REAL(KIND(1d0)), INTENT(INOUT)::SnowAlb
513
514 ! Growing Degree Days
515 REAL(KIND(1D0)), DIMENSION(3) :: GDD_id ! Growing Degree Days (see SUEWS_DailyState.f95)
516 REAL(KIND(1D0)), DIMENSION(3), INTENT(IN) :: GDD_id_prev ! Growing Degree Days (see SUEWS_DailyState.f95)
517 REAL(KIND(1D0)), DIMENSION(3), INTENT(OUT) :: GDD_id_next ! Growing Degree Days (see SUEWS_DailyState.f95)
518
519 ! Senescence Degree Days
520 REAL(KIND(1D0)), DIMENSION(3) :: SDD_id ! Senescence Degree Days (see SUEWS_DailyState.f95)
521 REAL(KIND(1D0)), DIMENSION(3), INTENT(IN) :: SDD_id_prev ! Senescence Degree Days (see SUEWS_DailyState.f95)
522 REAL(KIND(1D0)), DIMENSION(3), INTENT(OUT) :: SDD_id_next ! Senescence Degree Days (see SUEWS_DailyState.f95)
523
524 ! Daily min temp [degC]
525 REAL(KIND(1D0)) :: Tmin_id
526 REAL(KIND(1D0)), INTENT(IN) :: Tmin_id_prev
527 REAL(KIND(1D0)), INTENT(out) :: Tmin_id_next
528
529 ! Daily max temp [degC]
530 REAL(KIND(1D0)) :: Tmax_id
531 REAL(KIND(1D0)), INTENT(in) :: Tmax_id_prev
532 REAL(KIND(1D0)), INTENT(out) :: Tmax_id_next
533
534 ! Daytime hours [h]
535 REAL(KIND(1D0)) :: lenDay_id
536 REAL(KIND(1D0)), INTENT(IN) :: lenDay_id_prev
537 REAL(KIND(1D0)), INTENT(out) :: lenDay_id_next
538
539 ! LAI for each veg surface [m2 m-2]
540 REAL(KIND(1D0)), DIMENSION(3) :: LAI_id ! LAI for each veg surface [m2 m-2]
541 REAL(KIND(1D0)), DIMENSION(3), INTENT(IN) :: LAI_id_prev ! LAI for each veg surface [m2 m-2]
542 REAL(KIND(1D0)), DIMENSION(3), INTENT(OUT) :: LAI_id_next ! LAI for each veg surface [m2 m-2]
543
544 ! ------------- Key to daily arrays ----------------------------------------------
545 ! TS, 27 Dec 2018: updated the annotation for 2018b and WRF-SUEWS coupling
546
547 ! Heating Degree Days
548 REAL(KIND(1D0)), DIMENSION(12) :: HDD_id ! Heating Degree Days (see SUEWS_DailyState.f95)
549 REAL(KIND(1D0)), DIMENSION(12), INTENT(IN) :: HDD_id_prev ! Heating Degree Days (see SUEWS_DailyState.f95)
550 REAL(KIND(1D0)), DIMENSION(12), INTENT(OUT) :: HDD_id_next ! Heating Degree Days (see SUEWS_DailyState.f95)
551 ! HDD_id:
552 ! first half used for update through the day
553 ! HDD_id(1) ---- Heating [degC]: used for accumulation during calculation
554 ! HDD_id(2) ---- Cooling [degC]: used for accumulation during calculation
555 ! HDD_id(3) ---- Daily mean temp [degC]: used for accumulation during calculation
556 ! HDD_id(4) ---- 5-day running mean temp [degC]: used for actual calculation
557 ! HDD_id(5) ---- Daily precip total [mm]
558 ! HDD_id(6) ---- Days since rain [d]
559 ! second half used for storage of the first half for the prevous day
560 ! HDD_id(6+1) ---- Heating [degC]: used for accumulation during calculation
561 ! HDD_id(6+2) ---- Cooling [degC]: used for accumulation during calculation
562 ! HDD_id(6+3) ---- Daily mean temp [degC]: used for accumulation during calculation
563 ! HDD_id(6+4) ---- 5-day running mean temp [degC]: used for actual calculation
564 ! HDD_id(6+5) ---- Daily precip total [mm]
565 ! HDD_id(6+6) ---- Days since rain [d]
566 ! --------------------------------------------------------------------------------
567
568 ! --------------------------------------------------------------------------------
569 !Daily water use for EveTr, DecTr, Grass [mm] (see SUEWS_DailyState.f95)
570 REAL(KIND(1D0)), DIMENSION(9), INTENT(OUT) :: WUDay_id ! Water use related array
571 ! WUDay_id:
572 ! WUDay_id(1) - Daily water use total for Irr EveTr (automatic+manual) [mm]
573 ! WUDay_id(2) - Automatic irrigation for Irr EveTr [mm]
574 ! WUDay_id(3) - Manual irrigation for Irr EveTr [mm]
575 ! WUDay_id(4) - Daily water use total for Irr DecTr (automatic+manual) [mm]
576 ! WUDay_id(5) - Automatic irrigation for Irr DecTr [mm]
577 ! WUDay_id(6) - Manual irrigation for Irr DecTr [mm]
578 ! WUDay_id(7) - Daily water use total for Irr Grass (automatic+manual) [mm]
579 ! WUDay_id(8) - Automatic irrigation for Irr Grass [mm]
580 ! WUDay_id(9) - Manual irrigation for Irr Grass [mm]
581 ! --------------------------------------------------------------------------------
582
583 ! REAL(KIND(1d0)), DIMENSION(nsurf), INTENT(INOUT)::SnowDens
584 INTEGER, DIMENSION(3), INTENT(in) :: DayofWeek_id
585
586 ! REAL(KIND(1D0)), INTENT(OUT) :: deltaLAI
587
588 REAL(KIND(1D0)) :: DecidCap_id
589 REAL(KIND(1D0)), INTENT(IN) :: DecidCap_id_prev
590 REAL(KIND(1D0)), INTENT(OUT) :: DecidCap_id_next
591 REAL(KIND(1D0)) :: albDecTr_id
592 REAL(KIND(1D0)), INTENT(IN) :: albDecTr_id_prev
593 REAL(KIND(1D0)), INTENT(OUT) :: albDecTr_id_next
594 REAL(KIND(1D0)) :: albEveTr_id
595 REAL(KIND(1D0)), INTENT(IN) :: albEveTr_id_prev
596 REAL(KIND(1D0)), INTENT(OUT) :: albEveTr_id_next
597 REAL(KIND(1D0)) :: albGrass_id
598 REAL(KIND(1D0)), INTENT(IN) :: albGrass_id_prev
599 REAL(KIND(1D0)), INTENT(OUT) :: albGrass_id_next
600 REAL(KIND(1D0)) :: porosity_id
601 REAL(KIND(1D0)), INTENT(INOUT) :: porosity_id_prev
602 REAL(KIND(1D0)), INTENT(INOUT) :: porosity_id_next
603 REAL(KIND(1D0)), DIMENSION(6, nsurf) :: StoreDrainPrm
604 REAL(KIND(1D0)), DIMENSION(6, nsurf), INTENT(in) :: StoreDrainPrm_prev
605 REAL(KIND(1D0)), DIMENSION(6, nsurf), INTENT(out) :: StoreDrainPrm_next
606
607 LOGICAL :: first_tstep_Q ! if this is the first tstep of a day
608 LOGICAL :: last_tstep_Q ! if this is the last tstep of a day
609 TYPE(datetime) :: time_now, time_prev, time_next
610
611 daywatper(1) = daywatper_mon
612 daywatper(2) = daywatper_tues
613 daywatper(3) = daywatper_wed
614 daywatper(4) = daywatper_thur
615 daywatper(5) = daywatper_fri
616 daywatper(6) = daywatper_sat
617 daywatper(7) = daywatper_sun
618
619 daywat(1) = daywat_mon
620 daywat(2) = daywat_tues
621 daywat(3) = daywat_wed
622 daywat(4) = daywat_thur
623 daywat(5) = daywat_fri
624 daywat(6) = daywat_sat
625 daywat(7) = daywat_sun
626
627 laitype(1) = evetrlaitype
628 laitype(2) = dectrlaitype
629 laitype(3) = grasslaitype
630
631 baset_heating(1) = baset_heating_working
632 baset_heating(2) = baset_heating_holiday
633 baset_cooling(1) = baset_cooling_working
634 baset_cooling(2) = baset_cooling_holiday
635
636 baset(1) = evetrbaset
637 baset(2) = dectrbaset
638 baset(3) = grassbaset
639
640 basete(1) = evetrbasete
641 basete(2) = dectrbasete
642 basete(3) = grassbasete
643
644 gddfull(1) = evetrgddfull
645 gddfull(2) = dectrgddfull
646 gddfull(3) = grassgddfull
647
648 sddfull(1) = evetrsddfull
649 sddfull(2) = dectrsddfull
650 sddfull(3) = grasssddfull
651
652 laimin(1) = evetrlaimin
653 laimin(2) = dectrlaimin
654 laimin(3) = grasslaimin
655
656 laimax(1) = evetrlaimax
657 laimax(2) = dectrlaimax
658 laimax(3) = grasslaimax
659
660 laipower(:, 1) = evetrlaipower
661 laipower(:, 2) = dectrlaipower
662 laipower(:, 3) = grasslaipower
663
664 ! transfer values
665 lai_id = lai_id_prev
666 gdd_id = gdd_id_prev
667 sdd_id = sdd_id_prev
668 tmin_id = tmin_id_prev
669 tmax_id = tmax_id_prev
670 lenday_id = lenday_id_prev
671 storedrainprm = storedrainprm_prev
672 decidcap_id = decidcap_id_prev
673 albdectr_id = albdectr_id_prev
674 albevetr_id = albevetr_id_prev
675 albgrass_id = albgrass_id_prev
676 porosity_id = porosity_id_prev
677 hdd_id = hdd_id_prev
678
679 ! get timestamps
680 time_now = datetime(year=iy) + timedelta(days=id - 1, hours=it, minutes=imin, seconds=isec)
681 time_prev = time_now - timedelta(seconds=tstep_prev)
682 time_next = time_now + timedelta(seconds=tstep)
683
684 ! test if time at now is the first/last tstep of today
685 first_tstep_q = time_now%getDay() /= time_prev%getDay()
686 last_tstep_q = time_now%getDay() /= time_next%getDay()
687
688 ! --------------------------------------------------------------------------------
689 ! On first timestep of each day, define whether the day each a workday or weekend
690 IF (first_tstep_q) THEN
691 CALL update_dailystate_start( &
692 it, imin, & !input
693 hdd_id) !inout
694
695 ! reset certain GDD columns
696 tmin_id = temp_c !Daily min T in column 3
697 tmax_id = temp_c !Daily max T in column 4
698 lenday_id = 0 !Cumulate daytime hours
699 END IF
700
701 ! --------------------------------------------------------------------------------
702 ! regular update at all timesteps of a day
703 CALL update_dailystate_day( &
704 basetmethod, &
705 dayofweek_id, &
706 avkdn, & !input
707 temp_c, &
708 precip, &
709 baset_hc, &
710 baset_heating, baset_cooling, &
711 nsh_real, &
712 tmin_id, tmax_id, lenday_id, & !inout
713 hdd_id) !inout
714
715 ! Update snow density, albedo surface fraction
716 ! IF (SnowUse == 1) CALL SnowUpdate( &
717 ! nsurf, tstep, Temp_C, tau_a, tau_f, tau_r, &!input
718 ! SnowDensMax, SnowDensMin, SnowAlbMax, SnowAlbMin, SnowPack, &
719 ! SnowAlb, SnowDens)!inout
720
721 ! --------------------------------------------------------------------------------
722 ! On last timestep, perform the daily calculations -------------------------------
723 ! Daily values not correct until end of each day,
724 ! so main program should use values from the previous day
725 IF (last_tstep_q) THEN
726 CALL update_dailystate_end( &
727 id, it, imin, tstep, dt_since_start, & !input
728 tmin_id, tmax_id, lenday_id, &
729 laitype, ie_end, ie_start, laicalcyes, &
730 waterusemethod, dayofweek_id, &
731 albmax_dectr, albmax_evetr, albmax_grass, albmin_dectr, albmin_evetr, albmin_grass, &
732 baset, basete, capmax_dec, capmin_dec, daywat, daywatper, faut, gddfull, &
733 ie_a, ie_m, laimax, laimin, laipower, lat, pormax_dec, pormin_dec, sddfull, lai_obs, &
734 state_id, soilstore_id, soilstorecap, h_maintain, & !input
735 gdd_id, sdd_id, & !inout
736 hdd_id, &
737 lai_id, &
738 decidcap_id, &
739 albdectr_id, &
740 albevetr_id, &
741 albgrass_id, &
742 porosity_id, &
743 storedrainprm, &
744 wuday_id) !output
745 END IF !End of section done only at the end of each day (i.e. only once per day)
746
747 ! translate values back
748 lai_id_next = lai_id
749 gdd_id_next = gdd_id
750 sdd_id_next = sdd_id
751 tmin_id_next = tmin_id
752 tmax_id_next = tmax_id
753 lenday_id_next = lenday_id
754 storedrainprm_next = storedrainprm
755 decidcap_id_next = decidcap_id
756 albdectr_id_next = albdectr_id
757 albevetr_id_next = albevetr_id
758 albgrass_id_next = albgrass_id
759 porosity_id_next = porosity_id
760 hdd_id_next = hdd_id
761 ! PRINT*, 'after_DailyState', iy,id,it,imin
762 ! PRINT*, 'HDD(id)', HDD(id,:)
763 ! PRINT*, 'HDD_id', HDD_id
764
765 ! RETURN
766

References update_dailystate_day(), update_dailystate_end(), and update_dailystate_start().

Referenced by suews_driver::suews_cal_main_dts().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ suews_update_dailystate()

subroutine dailystate_module::suews_update_dailystate ( integer, intent(in) id,
real(kind(1d0)), dimension(5), intent(in) datetimeline,
integer, intent(in) gridiv,
integer, intent(in) numberofgrids,
real(kind(1d0)), dimension(ncolumnsdataoutdailystate - 5), intent(in) dailystateline,
real(kind(1d0)), dimension(ndays, ncolumnsdataoutdailystate, numberofgrids), intent(inout) dataoutdailystate )

Definition at line 1427 of file suews_phys_dailystate.f95.

1432
1433 IMPLICIT NONE
1434
1435 ! INTEGER,INTENT(IN) ::iy
1436 INTEGER, INTENT(IN) :: id
1437 ! INTEGER,INTENT(IN) ::it
1438 ! INTEGER,INTENT(IN) ::imin
1439
1440 REAL(KIND(1D0)), DIMENSION(5), INTENT(IN) :: datetimeline
1441
1442 INTEGER, INTENT(IN) :: Gridiv
1443 INTEGER, INTENT(IN) :: NumberOfGrids
1444 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutDailyState - 5), INTENT(IN) :: DailyStateLine
1445 REAL(KIND(1D0)), DIMENSION(ndays, ncolumnsDataOutDailyState, NumberOfGrids), INTENT(INOUT) :: dataOutDailyState
1446
1447 ! write out to dataOutDailyState
1448 dataoutdailystate(id, 1:5, gridiv) = datetimeline
1449 ! DailyStateLine will be -999 unless realistic values are calculated at the last timestep of each day
1450 dataoutdailystate(id, 6:ncolumnsdataoutdailystate, gridiv) = dailystateline
1451

References allocatearray::ncolumnsdataoutdailystate.

◆ update_dailystate_day()

subroutine dailystate_module::update_dailystate_day ( integer, intent(in) basetmethod,
integer, dimension(3), intent(in) dayofweek_id,
real(kind(1d0)), intent(in) avkdn,
real(kind(1d0)), intent(in) temp_c,
real(kind(1d0)), intent(in) precip,
real(kind(1d0)), intent(in) baset_hc,
real(kind(1d0)), dimension(2), intent(in) baset_heating,
real(kind(1d0)), dimension(2), intent(in) baset_cooling,
real(kind(1d0)), intent(in) nsh_real,
real(kind(1d0)), intent(inout) tmin_id,
real(kind(1d0)), intent(inout) tmax_id,
real(kind(1d0)), intent(inout) lenday_id,
real(kind(1d0)), dimension(12), intent(inout) hdd_id )

Definition at line 908 of file suews_phys_dailystate.f95.

919 ! use time, only: id, id_prev_t
920 IMPLICIT NONE
921
922 INTEGER, INTENT(IN) :: BaseTMethod
923 INTEGER, DIMENSION(3), INTENT(in) :: DayofWeek_id
924
925 REAL(KIND(1D0)), INTENT(IN) :: avkdn
926 REAL(KIND(1D0)), INTENT(IN) :: Temp_C
927 REAL(KIND(1D0)), INTENT(IN) :: Precip
928 REAL(KIND(1D0)), INTENT(IN) :: BaseT_HC
929 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: BaseT_Heating
930 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: BaseT_Cooling
931 REAL(KIND(1D0)), INTENT(IN) :: nsh_real
932 REAL(KIND(1D0)), INTENT(INOUT) :: Tmin_id
933 REAL(KIND(1D0)), INTENT(INOUT) :: Tmax_id
934 REAL(KIND(1D0)), INTENT(INOUT) :: lenDay_id
935 ! REAL(KIND(1d0)), INTENT(out)::Tmin_id_next
936 ! REAL(KIND(1d0)), INTENT(out)::Tmax_id_next
937 ! REAL(KIND(1d0)), INTENT(out)::lenDay_id_next
938
939 ! REAL(KIND(1d0))::tstepcount
940 ! REAL(KIND(1d0)),DIMENSION(-4:366,6),INTENT(INOUT):: HDD
941 ! REAL(KIND(1d0)), DIMENSION(5), INTENT(INOUT):: GDD_id !Growing Degree Days (see SUEWS_DailyState.f95)
942 REAL(KIND(1D0)), DIMENSION(12), INTENT(INOUT) :: HDD_id !Heating Degree Days (see SUEWS_DailyState.f95)
943 ! REAL(KIND(1d0)),DIMENSION(5),INTENT(OUT):: GDD_id_prev !Growing Degree Days (see SUEWS_DailyState.f95)
944 INTEGER :: iu ! flag for weekday/weekend
945
946 REAL(KIND(1D0)) :: dT_heating
947 REAL(KIND(1D0)) :: dT_cooling
948
949 REAL(KIND(1D0)) :: BaseT_Heating_use
950 REAL(KIND(1D0)) :: BaseT_Cooling_use
951
952 ! Set weekday/weekend counter
953 iu = 1 !Set to 1=weekday
954 IF (dayofweek_id(1) == 1 .OR. dayofweek_id(1) == 7) iu = 2 !Set to 2=weekend
955
956 SELECT CASE (basetmethod)
957 CASE (1)
958 baset_heating_use = baset_hc
959 baset_cooling_use = baset_hc
960 CASE (2)
961 baset_heating_use = baset_heating(iu)
962 baset_cooling_use = baset_cooling(iu)
963
964 CASE default
965 CALL errorhint(75, "RunControl.nml", -999, -999, -999)
966
967 END SELECT
968
969 ! Daily min and max temp (these get updated through the day) ---------------------
970 tmin_id = min(temp_c, tmin_id) !Daily min T in column 3
971 tmax_id = max(temp_c, tmax_id) !Daily max T in column 4
972 IF (avkdn > 10) THEN
973 lenday_id = lenday_id + 1/nsh_real !Cumulate daytime hours !Divide by nsh (HCW 01 Dec 2014)
974 END IF
975
976 ! Calculations related to heating and cooling degree days (HDD) ------------------
977 ! See Sailor & Vasireddy (2006) EMS Eq 1,2 (theirs is hourly timestep)
978 dt_heating = baset_heating_use - temp_c
979 dt_cooling = temp_c - baset_cooling_use
980
981 hdd_id(1) = hdd_id(1) + merge(dt_heating, 0d0, dt_heating >= 0) !Heating
982 hdd_id(2) = hdd_id(2) + merge(dt_cooling, 0d0, dt_cooling >= 0) !Cooling
983 hdd_id(3) = hdd_id(3) + temp_c !Will become daily average temperature
984 ! 4 ------------------------------------! !5-day running mean
985 hdd_id(5) = hdd_id(5) + precip !Daily precip total
986 ! 6 ------------------------------------! !Days since rain
987
subroutine errorhint(errh, problemfile, value, value2, valuei)

References errorhint().

Referenced by suews_cal_dailystate(), and suews_cal_dailystate_dts().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_dailystate_end()

subroutine dailystate_module::update_dailystate_end ( integer, intent(in) id,
integer, intent(in) it,
integer, intent(in) imin,
integer, intent(in) tstep,
integer, intent(in) dt_since_start,
real(kind(1d0)), intent(in) tmin_id,
real(kind(1d0)), intent(in) tmax_id,
real(kind(1d0)), intent(in) lenday_id,
integer, dimension(nvegsurf), intent(in) laitype,
integer, intent(in) ie_end,
integer, intent(in) ie_start,
integer, intent(in) laicalcyes,
integer, intent(in) waterusemethod,
integer, dimension(3), intent(in) dayofweek_id,
real(kind(1d0)), intent(in) albmax_dectr,
real(kind(1d0)), intent(in) albmax_evetr,
real(kind(1d0)), intent(in) albmax_grass,
real(kind(1d0)), intent(in) albmin_dectr,
real(kind(1d0)), intent(in) albmin_evetr,
real(kind(1d0)), intent(in) albmin_grass,
real(kind(1d0)), dimension(nvegsurf), intent(in) baset,
real(kind(1d0)), dimension(nvegsurf), intent(in) basete,
real(kind(1d0)), intent(in) capmax_dec,
real(kind(1d0)), intent(in) capmin_dec,
real(kind(1d0)), dimension(7), intent(in) daywat,
real(kind(1d0)), dimension(7), intent(in) daywatper,
real(kind(1d0)), intent(in) faut,
real(kind(1d0)), dimension(nvegsurf), intent(in) gddfull,
real(kind(1d0)), dimension(3), intent(in) ie_a,
real(kind(1d0)), dimension(3), intent(in) ie_m,
real(kind(1d0)), dimension(nvegsurf), intent(in) laimax,
real(kind(1d0)), dimension(nvegsurf), intent(in) laimin,
real(kind(1d0)), dimension(4, nvegsurf), intent(in) laipower,
real(kind(1d0)), intent(in) lat,
real(kind(1d0)), intent(in) pormax_dec,
real(kind(1d0)), intent(in) pormin_dec,
real(kind(1d0)), dimension(nvegsurf), intent(in) sddfull,
real(kind(1d0)), intent(in) lai_obs,
real(kind(1d0)), dimension(nsurf), intent(in) state_id,
real(kind(1d0)), dimension(nsurf), intent(in) soilstore_id,
real(kind(1d0)), dimension(nsurf), intent(in) soilstorecap,
real(kind(1d0)), intent(in) h_maintain,
real(kind(1d0)), dimension(3), intent(inout) gdd_id,
real(kind(1d0)), dimension(3), intent(inout) sdd_id,
real(kind(1d0)), dimension(12), intent(inout) hdd_id,
real(kind(1d0)), dimension(nvegsurf), intent(inout) lai_id,
real(kind(1d0)), intent(inout) decidcap_id,
real(kind(1d0)), intent(inout) albdectr_id,
real(kind(1d0)), intent(inout) albevetr_id,
real(kind(1d0)), intent(inout) albgrass_id,
real(kind(1d0)), intent(inout) porosity_id,
real(kind(1d0)), dimension(6, nsurf), intent(inout) storedrainprm,
real(kind(1d0)), dimension(9), intent(out) wuday_id )

Definition at line 769 of file suews_phys_dailystate.f95.

788 IMPLICIT NONE
789
790 INTEGER, INTENT(IN) :: id
791 INTEGER, INTENT(IN) :: it
792 INTEGER, INTENT(IN) :: imin
793 INTEGER, INTENT(IN) :: tstep
794 INTEGER, INTENT(IN) :: dt_since_start
795 INTEGER, INTENT(IN) :: LAIType(nvegsurf)
796 INTEGER, INTENT(IN) :: Ie_end
797 INTEGER, INTENT(IN) :: Ie_start
798 INTEGER, INTENT(IN) :: LAICalcYes
799 INTEGER, INTENT(IN) :: WaterUseMethod
800 INTEGER, INTENT(in) :: DayofWeek_id(3)
801
802 REAL(KIND(1D0)), INTENT(IN) :: AlbMax_DecTr
803 REAL(KIND(1D0)), INTENT(IN) :: AlbMax_EveTr
804 REAL(KIND(1D0)), INTENT(IN) :: AlbMax_Grass
805 REAL(KIND(1D0)), INTENT(IN) :: AlbMin_DecTr
806 REAL(KIND(1D0)), INTENT(IN) :: AlbMin_EveTr
807 REAL(KIND(1D0)), INTENT(IN) :: AlbMin_Grass
808 REAL(KIND(1D0)), INTENT(IN) :: BaseT(nvegsurf)
809 REAL(KIND(1D0)), INTENT(IN) :: BaseTe(nvegsurf)
810 REAL(KIND(1D0)), INTENT(IN) :: CapMax_dec
811 REAL(KIND(1D0)), INTENT(IN) :: CapMin_dec
812 REAL(KIND(1D0)), INTENT(IN) :: DayWat(7)
813 REAL(KIND(1D0)), INTENT(IN) :: DayWatPer(7)
814 REAL(KIND(1D0)), INTENT(IN) :: Faut
815 REAL(KIND(1D0)), INTENT(IN) :: GDDFull(nvegsurf)
816 REAL(KIND(1D0)), INTENT(IN) :: Ie_a(3)
817 REAL(KIND(1D0)), INTENT(IN) :: Ie_m(3)
818 REAL(KIND(1D0)), INTENT(IN) :: LAIMax(nvegsurf)
819 REAL(KIND(1D0)), INTENT(IN) :: LAIMin(nvegsurf)
820 REAL(KIND(1D0)), INTENT(IN) :: LAIPower(4, nvegsurf)
821 REAL(KIND(1D0)), INTENT(IN) :: lat
822 REAL(KIND(1D0)), INTENT(IN) :: PorMax_dec
823 REAL(KIND(1D0)), INTENT(IN) :: PorMin_dec
824 REAL(KIND(1D0)), INTENT(IN) :: SDDFull(nvegsurf)
825 REAL(KIND(1D0)), INTENT(IN) :: LAI_obs
826 REAL(KIND(1D0)), INTENT(IN) :: Tmin_id
827 REAL(KIND(1D0)), INTENT(IN) :: Tmax_id
828 REAL(KIND(1D0)), INTENT(IN) :: lenDay_id
829 REAL(KIND(1D0)), INTENT(IN) :: H_maintain ! ponding water depth to maintain
830 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(IN) :: state_id ! surface wetness [mm]
831 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(IN) :: soilstore_id ! soil water store [mm]
832 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: SoilStoreCap !Capacity of soil store for each surface [mm]
833
834 REAL(KIND(1D0)), DIMENSION(3), INTENT(INOUT) :: GDD_id ! Growing Degree Days (see SUEWS_DailyState.f95)
835 REAL(KIND(1D0)), DIMENSION(3), INTENT(INOUT) :: SDD_id ! Senescence Degree Days (see SUEWS_DailyState.f95)
836 REAL(KIND(1D0)), DIMENSION(12), INTENT(INOUT) :: HDD_id
837 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(INOUT) :: LAI_id ! LAI for each veg surface [m2 m-2]
838
839 ! REAL(KIND(1d0)),DIMENSION(6),INTENT(INOUT)::HDD_id_use ! HDD of previous day
840 REAL(KIND(1D0)), DIMENSION(nvegsurf) :: LAI_id_in ! LAI of previous day
841
842 REAL(KIND(1D0)), DIMENSION(9), INTENT(OUT) :: WUDay_id
843
844 REAL(KIND(1D0)), INTENT(INOUT) :: DecidCap_id
845 REAL(KIND(1D0)), INTENT(INOUT) :: albDecTr_id
846 REAL(KIND(1D0)), INTENT(INOUT) :: albEveTr_id
847 REAL(KIND(1D0)), INTENT(INOUT) :: albGrass_id
848 REAL(KIND(1D0)), INTENT(INOUT) :: porosity_id
849
850 REAL(KIND(1D0)), DIMENSION(6, nsurf), INTENT(inout) :: StoreDrainPrm
851
852 ! Calculate heating degree days ------------------------------------------
853 CALL update_hdd( &
854 dt_since_start, it, imin, tstep, & !input
855 hdd_id) !inout
856
857 ! Calculate modelled daily water use ------------------------------------------
858 CALL update_wateruse( &
859 id, waterusemethod, dayofweek_id, lat, faut, hdd_id, & !input
860 state_id, soilstore_id, soilstorecap, h_maintain, & !input
861 ie_a, ie_m, ie_start, ie_end, daywatper, daywat, &
862 wuday_id) !output
863
864 ! PRINT*, ''
865 ! PRINT*, 'WUDay(id)',WUDay(id,:)
866 ! PRINT*, 'WUDay_id',WUDay_id
867
868 !------------------------------------------------------------------------------
869 ! Calculation of LAI from growing degree days
870 ! This was revised and checked on 16 Feb 2014 by LJ
871 !------------------------------------------------------------------------------
872 ! save initial LAI_id
873 lai_id_in = lai_id
874
875 CALL update_gddlai( &
876 id, laicalcyes, & !input
877 lat, lai_obs, &
878 tmin_id, tmax_id, lenday_id, &
879 baset, basete, &
880 gddfull, sddfull, &
881 laimin, laimax, laipower, laitype, &
882 lai_id_in, &
883 gdd_id, sdd_id, & !inout
884 lai_id) !output
885
886 CALL update_veg( &
887 laimax, laimin, & !input
888 albmax_dectr, albmax_evetr, albmax_grass, &
889 albmin_dectr, albmin_evetr, albmin_grass, &
890 capmax_dec, capmin_dec, &
891 pormax_dec, pormin_dec, &
892 lai_id, lai_id_in, &
893 decidcap_id, & !inout
894 albdectr_id, &
895 albevetr_id, &
896 albgrass_id, &
897 porosity_id, &
898 storedrainprm)
899
900 ! PRINT*, 'DecidCap',DecidCap(id),DecidCap_id
901 ! PRINT*, 'albDecTr',albDecTr(id),albDecTr_id
902 ! PRINT*, 'albEveTr',albEveTr(id),albEveTr_id
903 ! PRINT*, 'albGrass',albGrass(id),albGrass_id
904 ! PRINT*, 'porosity',porosity(id),porosity_id
905

References update_gddlai(), update_hdd(), update_veg(), and update_wateruse().

Referenced by suews_cal_dailystate(), and suews_cal_dailystate_dts().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_dailystate_start()

subroutine dailystate_module::update_dailystate_start ( integer, intent(in) it,
integer, intent(in) imin,
real(kind(1d0)), dimension(6), intent(inout) hdd_id )

Definition at line 1404 of file suews_phys_dailystate.f95.

1407 IMPLICIT NONE
1408 INTEGER, INTENT(IN) :: it
1409 INTEGER, INTENT(IN) :: imin
1410
1411 REAL(KIND(1D0)), DIMENSION(6), INTENT(INOUT) :: HDD_id
1412 REAL(KIND(1D0)) :: HDD_id_mav, HDD_id_daysSR
1413
1414 ! reset HDD_id to ZERO except for:
1415 ! 5-day moving average
1416 hdd_id_mav = hdd_id(4)
1417 ! Days Since Rain
1418 hdd_id_dayssr = hdd_id(6)
1419 IF (it == 0 .AND. imin == 0) THEN
1420 hdd_id = 0
1421 hdd_id(4) = hdd_id_mav
1422 hdd_id(6) = hdd_id_dayssr
1423 END IF
1424

Referenced by suews_cal_dailystate(), and suews_cal_dailystate_dts().

Here is the caller graph for this function:

◆ update_dailystateline()

subroutine dailystate_module::update_dailystateline ( integer, intent(in) it,
integer, intent(in) imin,
real(kind(1d0)), intent(in) nsh_real,
real(kind(1d0)), dimension(nvegsurf), intent(in) gdd_id,
real(kind(1d0)), dimension(6), intent(in) hdd_id,
real(kind(1d0)), dimension(nvegsurf), intent(in) lai_id,
real(kind(1d0)), dimension(nvegsurf), intent(in) sdd_id,
real(kind(1d0)), intent(in) tmin_id,
real(kind(1d0)), intent(in) tmax_id,
real(kind(1d0)), intent(in) lenday_id,
real(kind(1d0)), intent(in) decidcap_id,
real(kind(1d0)), intent(in) albdectr_id,
real(kind(1d0)), intent(in) albevetr_id,
real(kind(1d0)), intent(in) albgrass_id,
real(kind(1d0)), intent(in) porosity_id,
real(kind(1d0)), dimension(9), intent(in) wuday_id,
real(kind(1d0)), intent(in) vegphenlumps,
real(kind(1d0)), intent(in) snowalb,
real(kind(1d0)), dimension(7), intent(in) snowdens,
real(kind(1d0)), intent(in) a1,
real(kind(1d0)), intent(in) a2,
real(kind(1d0)), intent(in) a3,
real(kind(1d0)), dimension(ncolumnsdataoutdailystate - 5), intent(out) dailystateline )

Definition at line 1455 of file suews_phys_dailystate.f95.

1470
1471 IMPLICIT NONE
1472
1473 ! INTEGER,INTENT(IN) ::iy
1474 ! INTEGER,INTENT(IN) ::id
1475 INTEGER, INTENT(IN) :: it
1476 INTEGER, INTENT(IN) :: imin
1477 REAL(KIND(1D0)), INTENT(IN) :: nsh_real
1478
1479 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(IN) :: GDD_id !Growing Degree Days (see SUEWS_DailyState.f95)
1480 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(IN) :: SDD_id !Growing Degree Days (see SUEWS_DailyState.f95)
1481 REAL(KIND(1D0)), DIMENSION(6), INTENT(IN) :: HDD_id !Heating Degree Days (see SUEWS_DailyState.f95)
1482 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(IN) :: LAI_id !LAI for each veg surface [m2 m-2]
1483
1484 REAL(KIND(1D0)), INTENT(IN) :: DecidCap_id
1485 REAL(KIND(1D0)), INTENT(IN) :: albDecTr_id
1486 REAL(KIND(1D0)), INTENT(IN) :: albEveTr_id
1487 REAL(KIND(1D0)), INTENT(IN) :: albGrass_id
1488 REAL(KIND(1D0)), INTENT(IN) :: porosity_id
1489 REAL(KIND(1D0)), INTENT(IN) :: Tmin_id
1490 REAL(KIND(1D0)), INTENT(IN) :: Tmax_id
1491 REAL(KIND(1D0)), INTENT(IN) :: lenday_id
1492 REAL(KIND(1D0)), DIMENSION(9), INTENT(IN) :: WUDay_id !Daily water use for EveTr, DecTr, Grass [mm] (see SUEWS_DailyState.f95)
1493
1494 ! REAL(KIND(1D0)), INTENT(IN) :: deltaLAI
1495 REAL(KIND(1D0)), INTENT(IN) :: VegPhenLumps
1496 REAL(KIND(1D0)), INTENT(IN) :: SnowAlb
1497 REAL(KIND(1D0)), DIMENSION(7), INTENT(IN) :: SnowDens
1498 REAL(KIND(1D0)), INTENT(IN) :: a1
1499 REAL(KIND(1D0)), INTENT(IN) :: a2
1500 REAL(KIND(1D0)), INTENT(IN) :: a3
1501
1502 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutDailyState - 5), INTENT(OUT) :: DailyStateLine
1503
1504 ! initialise DailyStateLine
1505 dailystateline = -999
1506 IF (it == 23 .AND. imin == (nsh_real - 1)/nsh_real*60) THEN
1507 ! Write actual data only at the last timesstep of each day
1508 ! DailyStateLine(1:2) = [iy,id]
1509 ! DailyStateLine(1:6) = HDD_id
1510 ! DailyStateLine(6 + 1:6 + 5) = GDD_id
1511 ! DailyStateLine(11 + 1:11 + 3) = LAI_id
1512 ! DailyStateLine(14 + 1:14 + 5) = [DecidCap_id, Porosity_id, AlbEveTr_id, AlbDecTr_id, AlbGrass_id]
1513 ! DailyStateLine(19 + 1:19 + 9) = WUDay_id(1:9)
1514 ! DailyStateLine(28 + 1) = deltaLAI
1515 ! DailyStateLine(29 + 1) = VegPhenLumps
1516 ! DailyStateLine(30 + 1:30 + 8) = [SnowAlb, SnowDens(1:7)]
1517 ! DailyStateLine(38 + 1:38 + 3) = [a1, a2, a3]
1518 dailystateline = [hdd_id, gdd_id, sdd_id, tmin_id, tmax_id, lenday_id, lai_id, decidcap_id, porosity_id, &
1519 albevetr_id, albdectr_id, albgrass_id, wuday_id, vegphenlumps, snowalb, snowdens, &
1520 a1, a2, a3]
1521
1522 END IF
1523

Referenced by suews_driver::suews_cal_main(), and suews_driver::suews_cal_main_dts().

Here is the caller graph for this function:

◆ update_gddlai()

subroutine dailystate_module::update_gddlai ( integer, intent(in) id,
integer, intent(in) laicalcyes,
real(kind(1d0)), intent(in) lat,
real(kind(1d0)), intent(in) lai_obs,
real(kind(1d0)), intent(in) tmin_id_prev,
real(kind(1d0)), intent(in) tmax_id_prev,
real(kind(1d0)), intent(in) lenday_id_prev,
real(kind(1d0)), dimension(nvegsurf), intent(in) baset,
real(kind(1d0)), dimension(nvegsurf), intent(in) basete,
real(kind(1d0)), dimension(nvegsurf), intent(in) gddfull,
real(kind(1d0)), dimension(nvegsurf), intent(in) sddfull,
real(kind(1d0)), dimension(nvegsurf), intent(in) laimin,
real(kind(1d0)), dimension(nvegsurf), intent(in) laimax,
real(kind(1d0)), dimension(4, nvegsurf), intent(in) laipower,
integer, dimension(nvegsurf), intent(in) laitype,
real(kind(1d0)), dimension(nvegsurf), intent(in) lai_id_prev,
real(kind(1d0)), dimension(3), intent(inout) gdd_id,
real(kind(1d0)), dimension(3), intent(inout) sdd_id,
real(kind(1d0)), dimension(nvegsurf), intent(out) lai_id_next )

Definition at line 1095 of file suews_phys_dailystate.f95.

1105 IMPLICIT NONE
1106
1107 !------------------------------------------------------------------------------
1108 ! Calculation of LAI from growing degree days
1109 ! This was revised and checked on 16 Feb 2014 by LJ
1110 !------------------------------------------------------------------------------
1111
1112 INTEGER, INTENT(IN) :: id
1113 INTEGER, INTENT(IN) :: LAICalcYes
1114
1115 REAL(KIND(1D0)), INTENT(IN) :: lat
1116 REAL(KIND(1D0)), INTENT(IN) :: LAI_obs
1117 REAL(KIND(1D0)), INTENT(IN) :: Tmin_id_prev
1118 REAL(KIND(1D0)), INTENT(IN) :: Tmax_id_prev
1119 REAL(KIND(1D0)), INTENT(IN) :: lenDay_id_prev
1120
1121 ! --- Vegetation phenology ---------------------------------------------------------------------
1122 ! Parameters provided in input information for each vegetation surface (SUEWS_Veg.txt)
1123 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(IN) :: BaseT !Base temperature for growing degree days [degC]
1124 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(IN) :: BaseTe !Base temperature for senescence degree days [degC]
1125 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(IN) :: GDDFull !Growing degree days needed for full capacity [degC]
1126 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(IN) :: SDDFull !Senescence degree days needed to initiate leaf off [degC]
1127 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(IN) :: LAIMin !Min LAI [m2 m-2]
1128 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(IN) :: LAIMax !Max LAI [m2 m-2]
1129 REAL(KIND(1D0)), DIMENSION(4, nvegsurf), INTENT(IN) :: LAIPower !Coeffs for LAI equation: 1,2 - leaf growth; 3,4 - leaf off
1130 !! N.B. currently DecTr only, although input provided for all veg types
1131 INTEGER, DIMENSION(nvegsurf), INTENT(IN) :: LAIType !LAI equation to use: original (0) or new (1)
1132
1133 REAL(KIND(1D0)), DIMENSION(3), INTENT(INOUT) :: GDD_id !Growing Degree Days (see SUEWS_DailyState.f95)
1134 REAL(KIND(1D0)), DIMENSION(3), INTENT(INOUT) :: SDD_id !Senescence Degree Days (see SUEWS_DailyState.f95)
1135 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(OUT) :: LAI_id_next !LAI for each veg surface [m2 m-2]
1136 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(IN) :: LAI_id_prev ! LAI of previous day
1137
1138 REAL(KIND(1D0)) :: delta_SDD !Switches and checks for GDD
1139 REAL(KIND(1D0)) :: delta_GDD !Switches and checks for GDD
1140 REAL(KIND(1D0)) :: indHelp !Switches and checks for GDD
1141 REAL(KIND(1D0)), DIMENSION(3) :: GDD_id_prev ! GDD of previous day
1142 REAL(KIND(1D0)), DIMENSION(3) :: SDD_id_prev ! SDD of previous day
1143
1144 INTEGER :: critDays
1145 INTEGER :: iv
1146
1147 ! translate values of previous day to local variables
1148 gdd_id_prev = gdd_id
1149 sdd_id_prev = sdd_id
1150 ! LAI_id_prev = LAI_id_next
1151
1152 critdays = 50 !Critical limit for GDD when GDD or SDD is set to zero
1153
1154 ! Loop through vegetation types (iv)
1155 DO iv = 1, nvegsurf
1156 ! Calculate GDD for each day from the minimum and maximum air temperature
1157 delta_gdd = ((tmin_id_prev + tmax_id_prev)/2 - baset(iv)) !Leaf on
1158 delta_sdd = ((tmin_id_prev + tmax_id_prev)/2 - basete(iv)) !Leaf off
1159
1160 indhelp = 0 !Help switch to allow GDD to go to zero in sprint-time !! QUESTION: What does this mean? HCW
1161
1162 IF (delta_gdd < 0) THEN !GDD cannot be negative
1163 indhelp = delta_gdd !Amount of negative GDD
1164 delta_gdd = 0
1165 END IF
1166
1167 IF (delta_sdd > 0) delta_sdd = 0 !SDD cannot be positive
1168
1169 ! Calculate cumulative growing and senescence degree days
1170 gdd_id(iv) = gdd_id_prev(iv) + delta_gdd
1171 sdd_id(iv) = sdd_id_prev(iv) + delta_sdd
1172
1173 ! Possibility for cold spring
1174 IF (sdd_id(iv) <= sddfull(iv) .AND. indhelp < 0) THEN
1175 gdd_id(iv) = 0
1176 END IF
1177
1178 IF (gdd_id(iv) >= gddfull(iv)) THEN !Start senescence
1179 gdd_id(iv) = gddfull(iv) !Leaves should not grow so delete yes from earlier
1180 IF (sdd_id(iv) < -critdays) gdd_id(iv) = 0
1181 END IF
1182
1183 IF (sdd_id(iv) <= sddfull(iv)) THEN !After senescence now start growing leaves
1184 sdd_id(iv) = sddfull(iv) !Leaves off so add back earlier
1185 IF (gdd_id(iv) > critdays) sdd_id(iv) = 0
1186 END IF
1187
1188 ! With these limits SDD, GDD is set to zero
1189 IF (sdd_id(iv) < -critdays .AND. sdd_id(iv) > sddfull(iv)) gdd_id(iv) = 0
1190 IF (gdd_id(iv) > critdays .AND. gdd_id(iv) < gddfull(iv)) sdd_id(iv) = 0
1191
1192 ! Now calculate LAI itself
1193 IF (lat >= 0) THEN !Northern hemispere
1194 !If SDD is not zero by mid May, this is forced
1195 IF (id == 140 .AND. sdd_id(iv) /= 0) sdd_id(iv) = 0
1196 ! Set SDD to zero in summer time
1197 IF (gdd_id(iv) > critdays .AND. id < 170) sdd_id(iv) = 0
1198 ! Set GDD zero in winter time
1199 IF (sdd_id(iv) < -critdays .AND. id > 170) gdd_id(iv) = 0
1200
1201 IF (laitype(iv) < 0.5) THEN !Original LAI type
1202 IF (gdd_id(iv) > 0 .AND. gdd_id(iv) < gddfull(iv)) THEN !Leaves can still grow
1203 lai_id_next(iv) = (lai_id_prev(iv)**laipower(1, iv)*gdd_id(iv)*laipower(2, iv)) + lai_id_prev(iv)
1204 ELSEIF (sdd_id(iv) < 0 .AND. sdd_id(iv) > sddfull(iv)) THEN !Start senescence
1205 lai_id_next(iv) = (lai_id_prev(iv)**laipower(3, iv)*sdd_id(iv)*laipower(4, iv)) + lai_id_prev(iv)
1206 ELSE
1207 lai_id_next(iv) = lai_id_prev(iv)
1208 END IF
1209 ELSEIF (laitype(iv) >= 0.5) THEN
1210 IF (gdd_id(iv) > 0 .AND. gdd_id(iv) < gddfull(iv)) THEN !Leaves can still grow
1211 lai_id_next(iv) = (lai_id_prev(iv)**laipower(1, iv)*gdd_id(iv)*laipower(2, iv)) + lai_id_prev(iv)
1212 !! Use day length to start senescence at high latitudes (N hemisphere)
1213 ELSEIF (lenday_id_prev <= 12 .AND. sdd_id(iv) > sddfull(iv)) THEN !Start senescence
1214 lai_id_next(iv) = (lai_id_prev(iv)*laipower(3, iv)*(1 - sdd_id(iv))*laipower(4, iv)) + lai_id_prev(iv)
1215 ELSE
1216 lai_id_next(iv) = lai_id_prev(iv)
1217 END IF
1218 END IF
1219
1220 ELSEIF (lat < 0) THEN !Southern hemisphere !! N.B. not identical to N hemisphere - return to later
1221 !If SDD is not zero by late Oct, this is forced
1222 IF (id == 300 .AND. sdd_id(iv) /= 0) sdd_id(iv) = 0
1223 ! Set SDD to zero in summer time
1224 IF (gdd_id(iv) > critdays .AND. id > 250) sdd_id(iv) = 0
1225 ! Set GDD zero in winter time
1226 IF (sdd_id(iv) < -critdays .AND. id < 250) gdd_id(iv) = 0
1227
1228 IF (laitype(iv) < 0.5) THEN !Original LAI type
1229 IF (gdd_id(iv) > 0 .AND. gdd_id(iv) < gddfull(iv)) THEN
1230 lai_id_next(iv) = (lai_id_prev(iv)**laipower(1, iv)*gdd_id(iv)*laipower(2, iv)) + lai_id_prev(iv)
1231 ELSEIF (sdd_id(iv) < 0 .AND. sdd_id(iv) > sddfull(iv)) THEN
1232 lai_id_next(iv) = (lai_id_prev(iv)**laipower(3, iv)*sdd_id(iv)*laipower(4, iv)) + lai_id_prev(iv)
1233 ELSE
1234 lai_id_next(iv) = lai_id_prev(iv)
1235 END IF
1236 ELSE
1237 IF (gdd_id(iv) > 0 .AND. gdd_id(iv) < gddfull(iv)) THEN
1238 lai_id_next(iv) = (lai_id_prev(iv)**laipower(1, iv)*gdd_id(iv)*laipower(2, iv)) + lai_id_prev(iv)
1239 !! Day length not used to start senescence in S hemisphere (not much land)
1240 ELSEIF (sdd_id(iv) < 0 .AND. sdd_id(iv) > sddfull(iv)) THEN
1241 lai_id_next(iv) = (lai_id_prev(iv)*laipower(3, iv)*(1 - sdd_id(iv))*laipower(4, iv)) + lai_id_prev(iv)
1242 ELSE
1243 lai_id_next(iv) = lai_id_prev(iv)
1244 END IF
1245 END IF
1246 END IF !N or S hemisphere
1247
1248 ! Check LAI within limits; if not set to limiting value
1249 IF (lai_id_next(iv) > laimax(iv)) THEN
1250 lai_id_next(iv) = laimax(iv)
1251 ELSEIF (lai_id_next(iv) < laimin(iv)) THEN
1252 lai_id_next(iv) = laimin(iv)
1253 END IF
1254
1255 END DO !End of loop over veg surfaces
1256
1257 IF (laicalcyes == 0) THEN ! moved to SUEWS_cal_DailyState, TS 18 Sep 2017
1258 ! LAI(id-1,:)=LAI_obs ! check -- this is going to be a problem as it is not for each vegetation class
1259 lai_id_next = lai_obs
1260 END IF
1261 !------------------------------------------------------------------------------
1262

References allocatearray::nvegsurf.

Referenced by update_dailystate_end().

Here is the caller graph for this function:

◆ update_hdd()

subroutine dailystate_module::update_hdd ( integer, intent(in) dt_since_start,
integer, intent(in) it,
integer, intent(in) imin,
integer, intent(in) tstep,
real(kind(1d0)), dimension(12), intent(inout) hdd_id )

Definition at line 1368 of file suews_phys_dailystate.f95.

1371 IMPLICIT NONE
1372 INTEGER, INTENT(IN) :: dt_since_start, it, imin, tstep
1373
1374 REAL(KIND(1D0)), DIMENSION(12), INTENT(INOUT) :: HDD_id
1375 ! REAL(KIND(1d0)),DIMENSION(6),INTENT(OUT):: HDD_id_use
1376
1377 INTEGER :: days_prev
1378 REAL(KIND(1D0)) :: tstepcount
1379
1380 ! count of timesteps performed during day
1381 tstepcount = (it*60 + imin)*60/tstep*1.
1382 ! Heating degree days (HDD) -------------
1383 hdd_id(1) = hdd_id(1)/tstepcount !Heating
1384 hdd_id(2) = hdd_id(2)/tstepcount !Cooling
1385 hdd_id(3) = hdd_id(3)/tstepcount !Average temp
1386
1387 ! Calculate a quasi-5-day-running-mean temp
1388 days_prev = min(4, & ! dt_since_start >= 4 days
1389 floor(dt_since_start/(24*60*60)*1.)) ! dt_since_start < 4 days
1390 hdd_id(4) = (hdd_id(4)*days_prev + hdd_id(3))/(days_prev + 1)
1391
1392 ! Calculate number of days since rain
1393 IF (hdd_id(5) > 0) THEN !Rain occurred
1394 hdd_id(6) = 0
1395 ELSE
1396 hdd_id(6) = hdd_id(6) + 1 !Days since rain
1397 END IF
1398
1399 ! save updated HDD_id(1:6) values to the last-half part (i.e., HDD_id(7:12))
1400 hdd_id(6 + 1:6 + 6) = hdd_id(1:6)
1401

Referenced by update_dailystate_end().

Here is the caller graph for this function:

◆ update_veg()

subroutine dailystate_module::update_veg ( real(kind(1d0)), dimension(nvegsurf), intent(in) laimax,
real(kind(1d0)), dimension(nvegsurf), intent(in) laimin,
real(kind(1d0)), intent(in) albmax_dectr,
real(kind(1d0)), intent(in) albmax_evetr,
real(kind(1d0)), intent(in) albmax_grass,
real(kind(1d0)), intent(in) albmin_dectr,
real(kind(1d0)), intent(in) albmin_evetr,
real(kind(1d0)), intent(in) albmin_grass,
real(kind(1d0)), intent(in) capmax_dec,
real(kind(1d0)), intent(in) capmin_dec,
real(kind(1d0)), intent(in) pormax_dec,
real(kind(1d0)), intent(in) pormin_dec,
real(kind(1d0)), dimension(nvegsurf), intent(in) lai_id,
real(kind(1d0)), dimension(nvegsurf), intent(in) lai_id_prev,
real(kind(1d0)), intent(inout) decidcap_id,
real(kind(1d0)), intent(inout) albdectr_id,
real(kind(1d0)), intent(inout) albevetr_id,
real(kind(1d0)), intent(inout) albgrass_id,
real(kind(1d0)), intent(inout) porosity_id,
real(kind(1d0)), dimension(6, nsurf), intent(inout) storedrainprm )

Definition at line 990 of file suews_phys_dailystate.f95.

1003
1004 IMPLICIT NONE
1005
1006 ! INTEGER,INTENT(IN)::id
1007 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(IN) :: LAImax
1008 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(IN) :: LAIMin
1009
1010 REAL(KIND(1D0)), INTENT(IN) :: AlbMax_DecTr
1011 REAL(KIND(1D0)), INTENT(IN) :: AlbMax_EveTr
1012 REAL(KIND(1D0)), INTENT(IN) :: AlbMax_Grass
1013 REAL(KIND(1D0)), INTENT(IN) :: AlbMin_DecTr
1014 REAL(KIND(1D0)), INTENT(IN) :: AlbMin_EveTr
1015 REAL(KIND(1D0)), INTENT(IN) :: AlbMin_Grass
1016 REAL(KIND(1D0)), INTENT(IN) :: CapMax_dec
1017 REAL(KIND(1D0)), INTENT(IN) :: CapMin_dec
1018 REAL(KIND(1D0)), INTENT(IN) :: PorMax_dec
1019 REAL(KIND(1D0)), INTENT(IN) :: PorMin_dec
1020 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(IN) :: LAI_id, LAI_id_prev
1021
1022 REAL(KIND(1D0)), INTENT(INOUT) :: DecidCap_id
1023 REAL(KIND(1D0)), INTENT(INOUT) :: albDecTr_id
1024 REAL(KIND(1D0)), INTENT(INOUT) :: albEveTr_id
1025 REAL(KIND(1D0)), INTENT(INOUT) :: albGrass_id
1026 REAL(KIND(1D0)), INTENT(INOUT) :: porosity_id
1027
1028 REAL(KIND(1D0)), DIMENSION(6, nsurf), INTENT(inout) :: StoreDrainPrm
1029
1030 INTEGER :: iv
1031
1032 REAL(KIND(1D0)) :: albChangeDecTr
1033 REAL(KIND(1D0)) :: albChangeEveTr
1034 REAL(KIND(1D0)) :: albChangeGrass
1035 REAL(KIND(1D0)) :: CapChange
1036
1037 REAL(KIND(1D0)) :: deltaLAIDecTr
1038 REAL(KIND(1D0)) :: deltaLAIEveTr
1039 REAL(KIND(1D0)) :: deltaLAIGrass
1040 REAL(KIND(1D0)) :: porChange
1041 !::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
1042 ! Calculate the development of vegetation cover
1043 ! Albedo changes with LAI for each vegetation type
1044 ! Storage capacity and porosity are updated based on DecTr LAI only (seasonal variation in Grass and EveTr assumed small)
1045 ! If only LUMPS is used, set deciduous capacities to 0
1046 ! QUESTION: Assume porosity Change based on GO99- Heisler?
1047 deltalaidectr = 0
1048 deltalaievetr = 0
1049 deltalaigrass = 0
1050 capchange = 0
1051 porchange = 0
1052 albchangedectr = 0
1053 albchangeevetr = 0
1054 albchangegrass = 0
1055
1056 iv = ivdecid
1057 IF ((lai_id(iv) - lai_id_prev(iv)) /= 0) THEN
1058 deltalaidectr = (lai_id(iv) - lai_id_prev(iv))/(laimax(iv) - laimin(iv))
1059 albchangedectr = (albmax_dectr - albmin_dectr)*deltalaidectr
1060 capchange = (capmin_dec - capmax_dec)*deltalaidectr
1061 porchange = (pormin_dec - pormax_dec)*deltalaidectr
1062 END IF
1063
1064 iv = ivconif
1065 IF ((lai_id(iv) - lai_id_prev(iv)) /= 0) THEN
1066 deltalaievetr = (lai_id(iv) - lai_id_prev(iv))/(laimax(iv) - laimin(iv))
1067 albchangeevetr = (albmax_evetr - albmin_evetr)*deltalaievetr
1068 END IF
1069
1070 iv = ivgrass
1071 IF ((lai_id(iv) - lai_id_prev(iv)) /= 0) THEN
1072 deltalaigrass = (lai_id(iv) - lai_id_prev(iv))/(laimax(iv) - laimin(iv))
1073 albchangegrass = (albmax_grass - albmin_grass)*deltalaigrass
1074 END IF
1075
1076 iv = ivdecid
1077
1078 !write(*,*) deltaLAI, deltaLAIEveTr, deltaLAIGrass
1079
1080 decidcap_id = decidcap_id - capchange
1081 storedrainprm(6, decidsurf) = decidcap_id !Change current storage capacity of deciduous trees
1082 porosity_id = porosity_id + porchange !- changed to + by HCW 20 Aug 2015 (porosity greatest when LAI smallest)
1083 porosity_id = min(max(porosity_id, max(pormin_dec, 0.1)), min(pormax_dec, 0.9)) ! limit porosity to valid range, TS 26 Jun 2023
1084
1085 ! update albedo values while limiting these to valid ranges
1086 !albDecTr_id = min(max(albDecTr_id + albChangeDecTr, AlbMin_DecTr), AlbMax_DecTr)
1087 !albEveTr_id = min(max(albEveTr_id + albChangeEveTr, AlbMin_EveTr), AlbMax_EveTr)
1088 !albGrass_id = min(max(albGrass_id + albChangeGrass, AlbMin_Grass), AlbMax_Grass)
1089 albdectr_id = albdectr_id + albchangedectr
1090 albevetr_id = albevetr_id + albchangeevetr
1091 albgrass_id = albgrass_id + albchangegrass
1092

References allocatearray::decidsurf, allocatearray::ivconif, allocatearray::ivdecid, and allocatearray::ivgrass.

Referenced by update_dailystate_end().

Here is the caller graph for this function:

◆ update_wateruse()

subroutine dailystate_module::update_wateruse ( integer, intent(in) id,
integer, intent(in) waterusemethod,
integer, dimension(3), intent(in) dayofweek_id,
real(kind(1d0)), intent(in) lat,
real(kind(1d0)), intent(in) frirriauto,
real(kind(1d0)), dimension(12), intent(in) hdd_id,
real(kind(1d0)), dimension(nsurf), intent(in) state_id,
real(kind(1d0)), dimension(nsurf), intent(in) soilstore_id,
real(kind(1d0)), dimension(nsurf), intent(in) soilstorecap,
real(kind(1d0)), intent(in) h_maintain,
real(kind(1d0)), dimension(nvegsurf), intent(in) ie_a,
real(kind(1d0)), dimension(nvegsurf), intent(in) ie_m,
integer, intent(in) ie_start,
integer, intent(in) ie_end,
real(kind(1d0)), dimension(nsurf), intent(in) daywatper,
real(kind(1d0)), dimension(nsurf), intent(in) daywat,
real(kind(1d0)), dimension(9), intent(out) wuday_id )

Definition at line 1265 of file suews_phys_dailystate.f95.

1270
1271 IMPLICIT NONE
1272
1273 INTEGER, INTENT(IN) :: id
1274 INTEGER, INTENT(IN) :: WaterUseMethod
1275 INTEGER, INTENT(IN) :: Ie_start !Starting time of water use (DOY)
1276 INTEGER, INTENT(IN) :: Ie_end !Ending time of water use (DOY)
1277 INTEGER, DIMENSION(3), INTENT(IN) :: DayofWeek_id
1278
1279 REAL(KIND(1D0)), INTENT(IN) :: lat
1280 REAL(KIND(1D0)), INTENT(IN) :: FrIrriAuto !Fraction of irrigated area using automatic irrigation
1281
1282 REAL(KIND(1D0)), DIMENSION(12), INTENT(IN) :: HDD_id
1283 REAL(KIND(1D0)), DIMENSION(NVegSurf), INTENT(IN) :: Ie_a !Coefficients for automatic irrigation models
1284 REAL(KIND(1D0)), DIMENSION(NVegSurf), INTENT(IN) :: Ie_m !Coefficients for manual irrigation models
1285 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(IN) :: DayWatPer !% of houses following daily water
1286 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(IN) :: DayWat !Days of watering allowed
1287
1288 ! ponding control related
1289 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(IN) :: state_id ! surface wetness [mm]
1290 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(IN) :: soilstore_id ! soil water store [mm]
1291 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: SoilStoreCap !Capacity of soil store for each surface [mm]
1292 REAL(KIND(1D0)), INTENT(IN) :: H_maintain ! ponding water depth to maintain [mm]
1293
1294 REAL(KIND(1D0)), DIMENSION(9), INTENT(OUT) :: WUDay_id !Daily water use for EveTr, DecTr, Grass [mm] (see SUEWS_DailyState.f95)
1295
1296 REAL(KIND(1D0)), DIMENSION(3) :: h_need !water level to maintain: surface+soil [mm]
1297 REAL(KIND(1D0)), DIMENSION(3) :: store_total !current water level: surface+soil [mm]
1298 REAL(KIND(1D0)), DIMENSION(3) :: WUDay_P !water used to maintain ponding level [mm]
1299 REAL(KIND(1D0)), DIMENSION(3) :: WUDay_A !automatic irrigation [mm]
1300 REAL(KIND(1D0)), DIMENSION(3) :: WUDay_M !manual irrigation [mm]
1301 REAL(KIND(1D0)), DIMENSION(3) :: WUDay_total !Coefficients for manual irrigation models
1302
1303 INTEGER :: wd !Water use calculation is done when calc = 1
1304 INTEGER :: calc !Water use calculation is done when calc = 1
1305 INTEGER :: i
1306
1307 REAL(KIND(1D0)) :: temp_avg
1308 REAL(KIND(1D0)) :: days_since_rain
1309
1310 ! transfer HDD values
1311 temp_avg = hdd_id(9)
1312 days_since_rain = hdd_id(12)
1313
1314 ! initialise WUDay_id
1315 wuday_id = 0
1316
1317 IF (waterusemethod == 0) THEN !If water use is to be modelled (rather than observed)
1318
1319 wd = dayofweek_id(1)
1320
1321 IF (daywat(wd) == 1.0) THEN !1 indicates watering permitted on this day
1322 calc = 0
1323 IF (lat >= 0) THEN !Northern Hemisphere
1324 IF (id >= ie_start - 1 .AND. id <= ie_end + 1) calc = 1 !Day between irrigation period
1325 ELSE !Southern Hemisphere
1326 calc = 1
1327 IF (id >= ie_end .AND. id <= ie_start) calc = 0 !Day between irrigation period
1328 END IF
1329
1330 IF (calc == 1) THEN
1331 ! Model daily water use based on days_since_rain (days since rain) and temp_avg (average temp)
1332 ! WUDay is the amount of water [mm] per day, applied to each of the irrigated areas
1333 ! N.B. These are the same for each vegetation type at the moment
1334
1335 ! ---- irrigation amount to maintain a certain water availability----
1336 ! NB: H_maintain can be either positive or negative
1337 h_need = soilstorecap(3:5) + h_maintain
1338 store_total = state_id(3:5) + soilstore_id(3:5)
1339 wuday_p = h_need - store_total
1340 wuday_p = merge(wuday_p, 0d0, wuday_p > 0)
1341
1342 ! ---- automatic irrigation ----
1343 wuday_a = frirriauto*(ie_a(1) + ie_a(2)*temp_avg + ie_a(3)*days_since_rain)*daywatper(wd)
1344 wuday_a = merge(wuday_a, 0d0, wuday_a > 0)
1345 ! add ponding-demand to auto-irrigation
1346 wuday_a = wuday_a + wuday_p
1347
1348 ! ---- Manual irrigation----
1349 wuday_m = (1 - frirriauto)*(ie_m(1) + ie_m(2)*temp_avg + ie_m(3)*days_since_rain)*daywatper(wd)
1350 wuday_m = merge(wuday_m, 0d0, wuday_m > 0)
1351
1352 ! ---- total irrigation
1353 wuday_total = wuday_p + wuday_a + wuday_m
1354
1355 ! transfer values to WUDay_id
1356 wuday_id([((i - 1)*3 + 1, i=1, 3)]) = wuday_total
1357 wuday_id([((i - 1)*3 + 2, i=1, 3)]) = wuday_a
1358 wuday_id([((i - 1)*3 + 3, i=1, 3)]) = wuday_m
1359
1360 ELSE !If no irrigation on this day
1361 wuday_id = 0
1362 END IF
1363 END IF
1364 END IF
1365

Referenced by update_dailystate_end().

Here is the caller graph for this function: