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, WaterUseMethod, Ie_start, Ie_end, LAICalcYes, LAIType, nsh_real, avkdn, Temp_C, Precip, BaseTHDD, 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, 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, deltaLAI, 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, GDD_id, SDD_id, HDD_id, LAI_id, DecidCap_id, albDecTr_id, albEveTr_id, albGrass_id, porosity_id, StoreDrainPrm, WUDay_id, deltaLAI)
 
subroutine update_dailystate_day (avkdn, Temp_C, Precip, BaseTHDD, 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, deltaLAI)
 
subroutine update_gddlai (id, LAICalcYes, lat, LAI_obs, BaseT, BaseTe, GDDFull, SDDFull, LAIMin, LAIMax, LAIPower, LAIType, LAI_id_prev, GDD_id, LAI_id_next)
 
subroutine update_gddlai_x (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, Faut, HDD_id, 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, deltaLAI, 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)  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)  BaseTHDD,
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(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)), intent(out)  deltaLAI,
real(kind(1d0)), dimension(9), intent(out)  WUDay_id 
)

Definition at line 76 of file suews_phys_dailystate.f95.

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

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

References allocatearray::ncolumnsdataoutdailystate.

Referenced by suews_calculations().

1158 
1159  IMPLICIT NONE
1160 
1161  ! INTEGER,INTENT(IN) ::iy
1162  INTEGER, INTENT(IN) ::id
1163  ! INTEGER,INTENT(IN) ::it
1164  ! INTEGER,INTENT(IN) ::imin
1165 
1166  REAL(KIND(1d0)), DIMENSION(5), INTENT(IN)::datetimeline
1167 
1168  INTEGER, INTENT(IN)::gridiv
1169  INTEGER, INTENT(IN)::numberofgrids
1170  REAL(KIND(1d0)), DIMENSION(ncolumnsDataOutDailyState - 5), INTENT(IN) :: dailystateline
1171  REAL(KIND(1d0)), DIMENSION(ndays, ncolumnsDataOutDailyState, NumberOfGrids), INTENT(INOUT):: dataoutdailystate
1172 
1173  ! write out to dataOutDailyState
1174  dataoutdailystate(id, 1:5, gridiv) = datetimeline
1175  ! DailyStateLine will be -999 unless realistic values are calculated at the last timestep of each day
1177 
integer numberofgrids
integer, parameter ncolumnsdataoutdailystate
integer id
real(kind(1d0)), dimension(:, :, :), allocatable dataoutdailystate
real(kind(1d0)), dimension(ncolumnsdataoutdailystate - 5) dailystateline
real(kind(1d0)), dimension(5) datetimeline
Here is the caller graph for this function:

◆ update_dailystate_day()

subroutine dailystate_module::update_dailystate_day ( real(kind(1d0)), intent(in)  avkdn,
real(kind(1d0)), intent(in)  Temp_C,
real(kind(1d0)), intent(in)  Precip,
real(kind(1d0)), intent(in)  BaseTHDD,
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 498 of file suews_phys_dailystate.f95.

Referenced by suews_cal_dailystate().

498  ! use time, only: id, id_prev_t
499  IMPLICIT NONE
500 
501  ! INTEGER,INTENT(IN)::id
502  REAL(KIND(1d0)), INTENT(IN)::avkdn
503  REAL(KIND(1d0)), INTENT(IN)::temp_c
504  REAL(KIND(1d0)), INTENT(IN)::precip
505  REAL(KIND(1d0)), INTENT(IN)::basethdd
506  REAL(KIND(1d0)), INTENT(IN)::nsh_real
507  REAL(KIND(1d0)), INTENT(INOUT)::tmin_id
508  REAL(KIND(1d0)), INTENT(INOUT)::tmax_id
509  REAL(KIND(1d0)), INTENT(INOUT)::lenday_id
510  ! REAL(KIND(1d0)), INTENT(out)::Tmin_id_next
511  ! REAL(KIND(1d0)), INTENT(out)::Tmax_id_next
512  ! REAL(KIND(1d0)), INTENT(out)::lenDay_id_next
513 
514  ! REAL(KIND(1d0))::tstepcount
515  ! REAL(KIND(1d0)),DIMENSION(-4:366,6),INTENT(INOUT):: HDD
516  ! REAL(KIND(1d0)), DIMENSION(5), INTENT(INOUT):: GDD_id !Growing Degree Days (see SUEWS_DailyState.f95)
517  REAL(KIND(1d0)), DIMENSION(12), INTENT(INOUT):: hdd_id !Heating Degree Days (see SUEWS_DailyState.f95)
518  ! REAL(KIND(1d0)),DIMENSION(5),INTENT(OUT):: GDD_id_prev !Growing Degree Days (see SUEWS_DailyState.f95)
519 
520  INTEGER::gamma1
521  INTEGER::gamma2
522 
523  ! Daily min and max temp (these get updated through the day) ---------------------
524  tmin_id = min(temp_c, tmin_id) !Daily min T in column 3
525  tmax_id = max(temp_c, tmax_id) !Daily max T in column 4
526  IF (avkdn > 10) THEN
527  lenday_id = lenday_id + 1/nsh_real !Cumulate daytime hours !Divide by nsh (HCW 01 Dec 2014)
528  ENDIF
529 
530  ! Calculations related to heating and cooling degree days (HDD) ------------------
531  ! See Sailor & Vasireddy (2006) EMS Eq 1,2 (theirs is hourly timestep)
532  gamma1 = merge(1, 0, (basethdd - temp_c) >= 0)
533  gamma2 = merge(1, 0, (temp_c - basethdd) >= 0)
534 
535  ! HDD(id,1)=HDD(id,1) + gamma1*(BaseTHDD-Temp_C) !Heating
536  ! HDD(id,2)=HDD(id,2) + gamma2*(Temp_C-BaseTHDD) !Cooling
537  ! HDD(id,3)=HDD(id,3) + Temp_C !Will become daily average temperature
538  ! ! 4 ------------------------------------! !5-day running mean
539  ! HDD(id,5)=HDD(id,5) + Precip !Daily precip total
540  ! 6 ------------------------------------! !Days since rain
541 
542  hdd_id(1) = hdd_id(1) + gamma1*(basethdd - temp_c) !Heating
543  hdd_id(2) = hdd_id(2) + gamma2*(temp_c - basethdd) !Cooling
544  hdd_id(3) = hdd_id(3) + temp_c !Will become daily average temperature
545  ! 4 ------------------------------------! !5-day running mean
546  hdd_id(5) = hdd_id(5) + precip !Daily precip total
547  ! 6 ------------------------------------! !Days since rain
548 
real(kind(1d0)) temp_c
real(kind(1d0)) basethdd
real(kind(1d0)) tmax_id
real(kind(1d0)), dimension(12) hdd_id
real(kind(1d0)) avkdn
real(kind(1d0)) tmin_id
real(kind(1d0)) lenday_id
real(kind(1d0)) nsh_real
real(kind(1d0)) precip
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(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,
real(kind(1d0)), intent(out)  deltaLAI 
)

Definition at line 355 of file suews_phys_dailystate.f95.

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

Referenced by suews_cal_dailystate().

355  IMPLICIT NONE
356 
357  INTEGER, INTENT(IN)::id
358  INTEGER, INTENT(IN)::it
359  INTEGER, INTENT(IN)::imin
360  INTEGER, INTENT(IN)::tstep
361  INTEGER, INTENT(IN)::dt_since_start
362  INTEGER, INTENT(IN)::laitype(nvegsurf)
363  INTEGER, INTENT(IN)::ie_end
364  INTEGER, INTENT(IN)::ie_start
365  INTEGER, INTENT(IN)::laicalcyes
366  INTEGER, INTENT(IN)::waterusemethod
367  INTEGER, INTENT(in)::dayofweek_id(3)
368 
369  REAL(KIND(1d0)), INTENT(IN)::albmax_dectr
370  REAL(KIND(1d0)), INTENT(IN)::albmax_evetr
371  REAL(KIND(1d0)), INTENT(IN)::albmax_grass
372  REAL(KIND(1d0)), INTENT(IN)::albmin_dectr
373  REAL(KIND(1d0)), INTENT(IN)::albmin_evetr
374  REAL(KIND(1d0)), INTENT(IN)::albmin_grass
375  REAL(KIND(1d0)), INTENT(IN)::baset(nvegsurf)
376  REAL(KIND(1d0)), INTENT(IN)::basete(nvegsurf)
377  REAL(KIND(1d0)), INTENT(IN)::capmax_dec
378  REAL(KIND(1d0)), INTENT(IN)::capmin_dec
379  REAL(KIND(1d0)), INTENT(IN)::daywat(7)
380  REAL(KIND(1d0)), INTENT(IN)::daywatper(7)
381  REAL(KIND(1d0)), INTENT(IN)::faut
382  REAL(KIND(1d0)), INTENT(IN)::gddfull(nvegsurf)
383  REAL(KIND(1d0)), INTENT(IN)::ie_a(3)
384  REAL(KIND(1d0)), INTENT(IN)::ie_m(3)
385  REAL(KIND(1d0)), INTENT(IN)::laimax(nvegsurf)
386  REAL(KIND(1d0)), INTENT(IN)::laimin(nvegsurf)
387  REAL(KIND(1d0)), INTENT(IN)::laipower(4, nvegsurf)
388  REAL(KIND(1d0)), INTENT(IN)::lat
389  REAL(KIND(1d0)), INTENT(IN)::pormax_dec
390  REAL(KIND(1d0)), INTENT(IN)::pormin_dec
391  REAL(KIND(1d0)), INTENT(IN)::sddfull(nvegsurf)
392  REAL(KIND(1d0)), INTENT(IN)::lai_obs
393  REAL(KIND(1d0)), INTENT(IN)::tmin_id
394  REAL(KIND(1d0)), INTENT(IN)::tmax_id
395  REAL(KIND(1d0)), INTENT(IN)::lenday_id
396 
397  REAL(KIND(1d0)), DIMENSION(3), INTENT(INOUT) ::gdd_id ! Growing Degree Days (see SUEWS_DailyState.f95)
398  REAL(KIND(1d0)), DIMENSION(3), INTENT(INOUT) ::sdd_id ! Senescence Degree Days (see SUEWS_DailyState.f95)
399  REAL(KIND(1d0)), DIMENSION(12), INTENT(INOUT) ::hdd_id
400  REAL(KIND(1d0)), DIMENSION(nvegsurf), INTENT(INOUT)::lai_id ! LAI for each veg surface [m2 m-2]
401 
402  ! REAL(KIND(1d0)),DIMENSION(6),INTENT(INOUT)::HDD_id_use ! HDD of previous day
403  REAL(KIND(1d0)), DIMENSION(nvegsurf)::lai_id_in ! LAI of previous day
404 
405  REAL(KIND(1d0)), DIMENSION(9), INTENT(OUT):: wuday_id
406  REAL(KIND(1d0)), INTENT(OUT)::deltalai
407 
408  REAL(KIND(1d0)), INTENT(INOUT):: decidcap_id
409  REAL(KIND(1d0)), INTENT(INOUT):: albdectr_id
410  REAL(KIND(1d0)), INTENT(INOUT):: albevetr_id
411  REAL(KIND(1d0)), INTENT(INOUT):: albgrass_id
412  REAL(KIND(1d0)), INTENT(INOUT):: porosity_id
413 
414  REAL(KIND(1d0)), DIMENSION(6, nsurf), INTENT(inout)::storedrainprm
415 
416  ! CALL update_HDD(&
417  ! id,it,imin,tstep,& !input
418  ! HDD) !inout
419 
420  CALL update_hdd( &
421  dt_since_start, it, imin, tstep, & !input
422  hdd_id)!inout
423 
424  ! Calculate modelled daily water use ------------------------------------------
425  ! CALL update_WaterUse(&
426  ! id,WaterUseMethod,DayofWeek_id,lat,Faut,HDD_id,&!input
427  ! Ie_a,Ie_m,Ie_start,Ie_end,DayWatPer,DayWat,&
428  ! WUDay) !inout
429 
430  CALL update_wateruse( &
431  id, waterusemethod, dayofweek_id, lat, faut, hdd_id, &!input
433  wuday_id) !output
434 
435  ! PRINT*, ''
436  ! PRINT*, 'WUDay(id)',WUDay(id,:)
437  ! PRINT*, 'WUDay_id',WUDay_id
438 
439  !------------------------------------------------------------------------------
440  ! Calculation of LAI from growing degree days
441  ! This was revised and checked on 16 Feb 2014 by LJ
442  !------------------------------------------------------------------------------
443  ! save initial LAI_id
444  lai_id_in = lai_id
445 
446  ! CALL update_GDDLAI( &
447  ! id, LAICalcYes, & !input
448  ! lat, LAI_obs, &
449  ! BaseT, BaseTe, &
450  ! GDDFull, SDDFull, &
451  ! LAIMin, LAIMax, LAIPower, LAIType, &
452  ! LAI_id_in, &
453  ! GDD_id, &!inout
454  ! LAI_id) !output
455 
456  CALL update_gddlai_x( &
457  id, laicalcyes, & !input
458  lat, lai_obs, &
460  baset, basete, &
461  gddfull, sddfull, &
463  lai_id_in, &
464  gdd_id, sdd_id, &!inout
465  lai_id) !output
466 
467  CALL update_veg( &
468  laimax, laimin, &!input
473  lai_id, lai_id_in, &
474  decidcap_id, &!inout
475  albdectr_id, &
476  albevetr_id, &
477  albgrass_id, &
478  porosity_id, &
479  storedrainprm, &
480  deltalai)!output
481 
482  ! PRINT*, 'DecidCap',DecidCap(id),DecidCap_id
483  ! PRINT*, 'albDecTr',albDecTr(id),albDecTr_id
484  ! PRINT*, 'albEveTr',albEveTr(id),albEveTr_id
485  ! PRINT*, 'albGrass',albGrass(id),albGrass_id
486  ! PRINT*, 'porosity',porosity(id),porosity_id
487 
real(kind(1d0)), dimension(3) ie_m
real(kind(1d0)) albmin_grass
real(kind(1d0)) albmin_evetr
real(kind(1d0)), dimension(nvegsurf) laimax
real(kind(1d0)), dimension(4, nvegsurf) laipower
real(kind(1d0)) albmax_evetr
real(kind(1d0)) albevetr_id
real(kind(1d0)) tmax_id
real(kind(1d0)), dimension(nvegsurf) sdd_id
real(kind(1d0)) albmax_grass
integer id
real(kind(1d0)), dimension(nvegsurf) gddfull
real(kind(1d0)), dimension(12) hdd_id
real(kind(1d0)) capmax_dec
integer, dimension(nvegsurf) laitype
integer imin
real(kind(1d0)) pormax_dec
integer laicalcyes
real(kind(1d0)) lai_obs
real(kind(1d0)) faut
real(kind(1d0)) tmin_id
real(kind(1d0)) lat
integer dt_since_start
real(kind(1d0)), dimension(nvegsurf) laimin
integer, parameter nvegsurf
real(kind(1d0)), dimension(3) ie_a
real(kind(1d0)), dimension(nvegsurf) lai_id
real(kind(1d0)) lenday_id
real(kind(1d0)) porosity_id
real(kind(1d0)) albmin_dectr
real(kind(1d0)), dimension(nvegsurf) basete
real(kind(1d0)) albgrass_id
real(kind(1d0)), dimension(6, nsurf) storedrainprm
real(kind(1d0)), dimension(7) daywatper
subroutine update_wateruse(id, WaterUseMethod, DayofWeek_id, lat, Faut, HDD_id, Ie_a, Ie_m, Ie_start, Ie_end, DayWatPer, DayWat, WUDay_id)
integer waterusemethod
real(kind(1d0)), dimension(9) wuday_id
integer it
real(kind(1d0)) pormin_dec
real(kind(1d0)) capmin_dec
real(kind(1d0)), dimension(nvegsurf) gdd_id
real(kind(1d0)), dimension(nvegsurf) sddfull
real(kind(1d0)), dimension(nvegsurf) baset
real(kind(1d0)), dimension(7) daywat
real(kind(1d0)) albdectr_id
real(kind(1d0)) decidcap_id
real(kind(1d0)) albmax_dectr
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 1133 of file suews_phys_dailystate.f95.

Referenced by suews_cal_dailystate().

1133  IMPLICIT NONE
1134  INTEGER, INTENT(IN) :: it
1135  INTEGER, INTENT(IN) ::imin
1136 
1137  REAL(KIND(1d0)), DIMENSION(6), INTENT(INOUT) ::hdd_id
1138  REAL(KIND(1d0))::hdd_id_mav, hdd_id_dayssr
1139 
1140  ! reset HDD_id to ZERO except for:
1141  ! 5-day moving average
1142  hdd_id_mav = hdd_id(4)
1143  ! Days Since Rain
1144  hdd_id_dayssr = hdd_id(6)
1145  IF (it == 0 .AND. imin == 0) THEN
1146  hdd_id = 0
1147  hdd_id(4) = hdd_id_mav
1148  hdd_id(6) = hdd_id_dayssr
1149  END IF
1150 
real(kind(1d0)), dimension(12) hdd_id
integer imin
integer it
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)  deltaLAI,
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 1196 of file suews_phys_dailystate.f95.

1196 
1197  IMPLICIT NONE
1198 
1199  ! INTEGER,INTENT(IN) ::iy
1200  ! INTEGER,INTENT(IN) ::id
1201  INTEGER, INTENT(IN) ::it
1202  INTEGER, INTENT(IN) ::imin
1203  REAL(KIND(1d0)), INTENT(IN) ::nsh_real
1204 
1205  REAL(KIND(1d0)), DIMENSION(nvegsurf), INTENT(IN):: gdd_id !Growing Degree Days (see SUEWS_DailyState.f95)
1206  REAL(KIND(1d0)), DIMENSION(nvegsurf), INTENT(IN):: sdd_id !Growing Degree Days (see SUEWS_DailyState.f95)
1207  REAL(KIND(1d0)), DIMENSION(6), INTENT(IN):: hdd_id !Heating Degree Days (see SUEWS_DailyState.f95)
1208  REAL(KIND(1d0)), DIMENSION(nvegsurf), INTENT(IN):: lai_id !LAI for each veg surface [m2 m-2]
1209 
1210  REAL(KIND(1d0)), INTENT(IN) ::decidcap_id
1211  REAL(KIND(1d0)), INTENT(IN) ::albdectr_id
1212  REAL(KIND(1d0)), INTENT(IN) ::albevetr_id
1213  REAL(KIND(1d0)), INTENT(IN) ::albgrass_id
1214  REAL(KIND(1d0)), INTENT(IN) ::porosity_id
1215  REAL(KIND(1d0)), INTENT(IN) ::tmin_id
1216  REAL(KIND(1d0)), INTENT(IN) ::tmax_id
1217  REAL(KIND(1d0)), INTENT(IN) ::lenday_id
1218  REAL(KIND(1d0)), DIMENSION(9), INTENT(IN):: wuday_id !Daily water use for EveTr, DecTr, Grass [mm] (see SUEWS_DailyState.f95)
1219 
1220  REAL(KIND(1d0)), INTENT(IN) ::deltalai
1221  REAL(KIND(1d0)), INTENT(IN) ::vegphenlumps
1222  REAL(KIND(1d0)), INTENT(IN) ::snowalb
1223  REAL(KIND(1d0)), DIMENSION(7), INTENT(IN)::snowdens
1224  REAL(KIND(1d0)), INTENT(IN) ::a1
1225  REAL(KIND(1d0)), INTENT(IN) ::a2
1226  REAL(KIND(1d0)), INTENT(IN) ::a3
1227 
1228  REAL(KIND(1d0)), DIMENSION(ncolumnsDataOutDailyState - 5), INTENT(OUT) :: dailystateline
1229 
1230  ! initialise DailyStateLine
1231  dailystateline = -999
1232  IF (it == 23 .AND. imin == (nsh_real - 1)/nsh_real*60) THEN
1233  ! Write actual data only at the last timesstep of each day
1234  ! DailyStateLine(1:2) = [iy,id]
1235  ! DailyStateLine(1:6) = HDD_id
1236  ! DailyStateLine(6 + 1:6 + 5) = GDD_id
1237  ! DailyStateLine(11 + 1:11 + 3) = LAI_id
1238  ! DailyStateLine(14 + 1:14 + 5) = [DecidCap_id, Porosity_id, AlbEveTr_id, AlbDecTr_id, AlbGrass_id]
1239  ! DailyStateLine(19 + 1:19 + 9) = WUDay_id(1:9)
1240  ! DailyStateLine(28 + 1) = deltaLAI
1241  ! DailyStateLine(29 + 1) = VegPhenLumps
1242  ! DailyStateLine(30 + 1:30 + 8) = [SnowAlb, SnowDens(1:7)]
1243  ! DailyStateLine(38 + 1:38 + 3) = [a1, a2, a3]
1245  albevetr_id, albdectr_id, albgrass_id, wuday_id, deltalai, vegphenlumps, snowalb, snowdens, &
1246  a1, a2, a3]
1247 
1248  END IF
1249 
real(kind(1d0)), dimension(nsurf) snowdens
real(kind(1d0)) a2
real(kind(1d0)) snowalb
real(kind(1d0)) a1
real(kind(1d0)) albevetr_id
real(kind(1d0)) a3
real(kind(1d0)) tmax_id
real(kind(1d0)), dimension(nvegsurf) sdd_id
real(kind(1d0)), dimension(12) hdd_id
integer imin
real(kind(1d0)) tmin_id
real(kind(1d0)), dimension(nvegsurf) lai_id
real(kind(1d0)) lenday_id
real(kind(1d0)) porosity_id
real(kind(1d0)) albgrass_id
real(kind(1d0)) nsh_real
real(kind(1d0)), dimension(9) wuday_id
integer it
real(kind(1d0)), dimension(ncolumnsdataoutdailystate - 5) dailystateline
real(kind(1d0)), dimension(nvegsurf) gdd_id
real(kind(1d0)) albdectr_id
real(kind(1d0)) decidcap_id

◆ 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)), 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(5), intent(inout)  GDD_id,
real(kind(1d0)), dimension(nvegsurf), intent(out)  LAI_id_next 
)

Definition at line 666 of file suews_phys_dailystate.f95.

References allocatearray::nvegsurf.

666  IMPLICIT NONE
667 
668  !------------------------------------------------------------------------------
669  ! Calculation of LAI from growing degree days
670  ! This was revised and checked on 16 Feb 2014 by LJ
671  !------------------------------------------------------------------------------
672 
673  INTEGER, INTENT(IN)::id
674  INTEGER, INTENT(IN)::laicalcyes
675 
676  REAL(KIND(1d0)), INTENT(IN)::lat
677  REAL(KIND(1d0)), INTENT(IN)::lai_obs
678 
679  ! --- Vegetation phenology ---------------------------------------------------------------------
680  ! Parameters provided in input information for each vegetation surface (SUEWS_Veg.txt)
681  REAL(KIND(1d0)), DIMENSION(nvegsurf), INTENT(IN) :: baset !Base temperature for growing degree days [degC]
682  REAL(KIND(1d0)), DIMENSION(nvegsurf), INTENT(IN) :: basete !Base temperature for senescence degree days [degC]
683  REAL(KIND(1d0)), DIMENSION(nvegsurf), INTENT(IN) :: gddfull !Growing degree days needed for full capacity [degC]
684  REAL(KIND(1d0)), DIMENSION(nvegsurf), INTENT(IN) :: sddfull !Senescence degree days needed to initiate leaf off [degC]
685  REAL(KIND(1d0)), DIMENSION(nvegsurf), INTENT(IN) :: laimin !Min LAI [m2 m-2]
686  REAL(KIND(1d0)), DIMENSION(nvegsurf), INTENT(IN) :: laimax !Max LAI [m2 m-2]
687  REAL(KIND(1d0)), DIMENSION(4, nvegsurf), INTENT(IN):: laipower !Coeffs for LAI equation: 1,2 - leaf growth; 3,4 - leaf off
688  !! N.B. currently DecTr only, although input provided for all veg types
689  INTEGER, DIMENSION(nvegsurf), INTENT(IN):: laitype !LAI equation to use: original (0) or new (1)
690 
691  REAL(KIND(1d0)), DIMENSION(5), INTENT(INOUT) :: gdd_id !Growing Degree Days (see SUEWS_DailyState.f95)
692  REAL(KIND(1d0)), DIMENSION(nvegsurf), INTENT(OUT):: lai_id_next !LAI for each veg surface [m2 m-2]
693  REAL(KIND(1d0)), DIMENSION(nvegsurf), INTENT(IN)::lai_id_prev ! LAI of previous day
694 
695  REAL(KIND(1d0)):: no !Switches and checks for GDD
696  REAL(KIND(1d0))::yes !Switches and checks for GDD
697  REAL(KIND(1d0))::indhelp !Switches and checks for GDD
698  REAL(KIND(1d0)), DIMENSION(5)::gdd_id_prev ! GDD of previous day
699 
700  INTEGER:: critdays
701  INTEGER::iv
702 
703  ! translate values of previous day to local variables
705  ! LAI_id_prev = LAI_id_next
706 
707  critdays = 50 !Critical limit for GDD when GDD or SDD is set to zero
708 
709  ! Loop through vegetation types (iv)
710  DO iv = 1, nvegsurf
711  ! Calculate GDD for each day from the minimum and maximum air temperature
712  yes = ((gdd_id_prev(3) + gdd_id_prev(4))/2 - baset(iv)) !Leaf on
713  no = ((gdd_id_prev(3) + gdd_id_prev(4))/2 - basete(iv)) !Leaf off
714 
715  indhelp = 0 !Help switch to allow GDD to go to zero in sprint-time !! QUESTION: What does this mean? HCW
716 
717  IF (yes < 0) THEN !GDD cannot be negative
718  indhelp = yes !Amount of negative GDD
719  yes = 0
720  ENDIF
721 
722  IF (no > 0) no = 0 !SDD cannot be positive
723 
724  ! Calculate cumulative growing and senescence degree days
725  gdd_id(1) = gdd_id_prev(1) + yes
726  gdd_id(2) = gdd_id_prev(2) + no
727 
728  ! Possibility for cold spring
729  IF (gdd_id(2) <= sddfull(iv) .AND. indhelp < 0) THEN
730  gdd_id(1) = 0
731  ENDIF
732 
733  IF (gdd_id(1) >= gddfull(iv)) THEN !Start senescence
734  gdd_id(1) = gddfull(iv) !Leaves should not grow so delete yes from earlier
735  IF (gdd_id(2) < -critdays) gdd_id(1) = 0
736  ENDIF
737 
738  IF (gdd_id(2) <= sddfull(iv)) THEN !After senescence now start growing leaves
739  gdd_id(2) = sddfull(iv) !Leaves off so add back earlier
740  IF (gdd_id(1) > critdays) gdd_id(2) = 0
741  ENDIF
742 
743  ! With these limits SDD, GDD is set to zero
744  IF (gdd_id(2) < -critdays .AND. gdd_id(2) > sddfull(iv)) gdd_id(1) = 0
745  IF (gdd_id(1) > critdays .AND. gdd_id(1) < gddfull(iv)) gdd_id(2) = 0
746 
747  ! Now calculate LAI itself
748  IF (lat >= 0) THEN !Northern hemispere
749  !If SDD is not zero by mid May, this is forced
750  IF (id == 140 .AND. gdd_id(2) /= 0) gdd_id(2) = 0
751  ! Set SDD to zero in summer time
752  IF (gdd_id(1) > critdays .AND. id < 170) gdd_id(2) = 0
753  ! Set GDD zero in winter time
754  IF (gdd_id(2) < -critdays .AND. id > 170) gdd_id(1) = 0
755 
756  IF (laitype(iv) < 0.5) THEN !Original LAI type
757  IF (gdd_id(1) > 0 .AND. gdd_id(1) < gddfull(iv)) THEN !Leaves can still grow
758  lai_id_next(iv) = (lai_id_prev(iv)**laipower(1, iv)*gdd_id(1)*laipower(2, iv)) + lai_id_prev(iv)
759  ELSEIF (gdd_id(2) < 0 .AND. gdd_id(2) > sddfull(iv)) THEN !Start senescence
760  lai_id_next(iv) = (lai_id_prev(iv)**laipower(3, iv)*gdd_id(2)*laipower(4, iv)) + lai_id_prev(iv)
761  ELSE
762  lai_id_next(iv) = lai_id_prev(iv)
763  ENDIF
764  ELSEIF (laitype(iv) >= 0.5) THEN
765  IF (gdd_id(1) > 0 .AND. gdd_id(1) < gddfull(iv)) THEN !Leaves can still grow
766  lai_id_next(iv) = (lai_id_prev(iv)**laipower(1, iv)*gdd_id(1)*laipower(2, iv)) + lai_id_prev(iv)
767  !! Use day length to start senescence at high latitudes (N hemisphere)
768  ELSEIF (gdd_id(5) <= 12 .AND. gdd_id(2) > sddfull(iv)) THEN !Start senescence
769  lai_id_next(iv) = (lai_id_prev(iv)*laipower(3, iv)*(1 - gdd_id(2))*laipower(4, iv)) + lai_id_prev(iv)
770  ELSE
771  lai_id_next(iv) = lai_id_prev(iv)
772  ENDIF
773  ENDIF
774 
775  ELSEIF (lat < 0) THEN !Southern hemisphere !! N.B. not identical to N hemisphere - return to later
776  !If SDD is not zero by late Oct, this is forced
777  IF (id == 300 .AND. gdd_id(2) /= 0) gdd_id(2) = 0
778  ! Set SDD to zero in summer time
779  IF (gdd_id(1) > critdays .AND. id > 250) gdd_id(2) = 0
780  ! Set GDD zero in winter time
781  IF (gdd_id(2) < -critdays .AND. id < 250) gdd_id(1) = 0
782 
783  IF (laitype(iv) < 0.5) THEN !Original LAI type
784  IF (gdd_id(1) > 0 .AND. gdd_id(1) < gddfull(iv)) THEN
785  lai_id_next(iv) = (lai_id_prev(iv)**laipower(1, iv)*gdd_id(1)*laipower(2, iv)) + lai_id_prev(iv)
786  ELSEIF (gdd_id(2) < 0 .AND. gdd_id(2) > sddfull(iv)) THEN
787  lai_id_next(iv) = (lai_id_prev(iv)**laipower(3, iv)*gdd_id(2)*laipower(4, iv)) + lai_id_prev(iv)
788  ELSE
789  lai_id_next(iv) = lai_id_prev(iv)
790  ENDIF
791  ELSE
792  IF (gdd_id(1) > 0 .AND. gdd_id(1) < gddfull(iv)) THEN
793  lai_id_next(iv) = (lai_id_prev(iv)**laipower(1, iv)*gdd_id(1)*laipower(2, iv)) + lai_id_prev(iv)
794  !! Day length not used to start senescence in S hemisphere (not much land)
795  ELSEIF (gdd_id(2) < 0 .AND. gdd_id(2) > sddfull(iv)) THEN
796  lai_id_next(iv) = (lai_id_prev(iv)*laipower(3, iv)*(1 - gdd_id(2))*laipower(4, iv)) + lai_id_prev(iv)
797  ELSE
798  lai_id_next(iv) = lai_id_prev(iv)
799  ENDIF
800  ENDIF
801  ENDIF !N or S hemisphere
802 
803  ! Check LAI within limits; if not set to limiting value
804  IF (lai_id_next(iv) > laimax(iv)) THEN
805  lai_id_next(iv) = laimax(iv)
806  ELSEIF (lai_id_next(iv) < laimin(iv)) THEN
807  lai_id_next(iv) = laimin(iv)
808  ENDIF
809 
810  ENDDO !End of loop over veg surfaces
811 
812  IF (laicalcyes == 0) THEN ! moved to SUEWS_cal_DailyState, TS 18 Sep 2017
813  ! LAI(id-1,:)=LAI_obs ! check -- this is going to be a problem as it is not for each vegetation class
814  lai_id_next = lai_obs
815  ENDIF
816  !------------------------------------------------------------------------------
817 
real(kind(1d0)), dimension(nvegsurf) lai_id_prev
real(kind(1d0)), dimension(nvegsurf) laimax
real(kind(1d0)), dimension(4, nvegsurf) laipower
integer id
real(kind(1d0)), dimension(nvegsurf) gddfull
integer, dimension(nvegsurf) laitype
integer laicalcyes
real(kind(1d0)) lai_obs
real(kind(1d0)) lat
real(kind(1d0)), dimension(nvegsurf) gdd_id_prev
real(kind(1d0)), dimension(nvegsurf) laimin
integer, parameter nvegsurf
real(kind(1d0)), dimension(nvegsurf) basete
real(kind(1d0)), dimension(nvegsurf) gdd_id
real(kind(1d0)), dimension(nvegsurf) sddfull
real(kind(1d0)), dimension(nvegsurf) baset

◆ update_gddlai_x()

subroutine dailystate_module::update_gddlai_x ( 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 830 of file suews_phys_dailystate.f95.

References allocatearray::nvegsurf.

Referenced by update_dailystate_end().

830  IMPLICIT NONE
831 
832  !------------------------------------------------------------------------------
833  ! Calculation of LAI from growing degree days
834  ! This was revised and checked on 16 Feb 2014 by LJ
835  !------------------------------------------------------------------------------
836 
837  INTEGER, INTENT(IN)::id
838  INTEGER, INTENT(IN)::laicalcyes
839 
840  REAL(KIND(1d0)), INTENT(IN)::lat
841  REAL(KIND(1d0)), INTENT(IN)::lai_obs
842  REAL(KIND(1d0)), INTENT(IN)::tmin_id_prev
843  REAL(KIND(1d0)), INTENT(IN)::tmax_id_prev
844  REAL(KIND(1d0)), INTENT(IN)::lenday_id_prev
845 
846  ! --- Vegetation phenology ---------------------------------------------------------------------
847  ! Parameters provided in input information for each vegetation surface (SUEWS_Veg.txt)
848  REAL(KIND(1d0)), DIMENSION(nvegsurf), INTENT(IN) :: baset !Base temperature for growing degree days [degC]
849  REAL(KIND(1d0)), DIMENSION(nvegsurf), INTENT(IN) :: basete !Base temperature for senescence degree days [degC]
850  REAL(KIND(1d0)), DIMENSION(nvegsurf), INTENT(IN) :: gddfull !Growing degree days needed for full capacity [degC]
851  REAL(KIND(1d0)), DIMENSION(nvegsurf), INTENT(IN) :: sddfull !Senescence degree days needed to initiate leaf off [degC]
852  REAL(KIND(1d0)), DIMENSION(nvegsurf), INTENT(IN) :: laimin !Min LAI [m2 m-2]
853  REAL(KIND(1d0)), DIMENSION(nvegsurf), INTENT(IN) :: laimax !Max LAI [m2 m-2]
854  REAL(KIND(1d0)), DIMENSION(4, nvegsurf), INTENT(IN):: laipower !Coeffs for LAI equation: 1,2 - leaf growth; 3,4 - leaf off
855  !! N.B. currently DecTr only, although input provided for all veg types
856  INTEGER, DIMENSION(nvegsurf), INTENT(IN):: laitype !LAI equation to use: original (0) or new (1)
857 
858  REAL(KIND(1d0)), DIMENSION(3), INTENT(INOUT) :: gdd_id !Growing Degree Days (see SUEWS_DailyState.f95)
859  REAL(KIND(1d0)), DIMENSION(3), INTENT(INOUT) :: sdd_id !Senescence Degree Days (see SUEWS_DailyState.f95)
860  REAL(KIND(1d0)), DIMENSION(nvegsurf), INTENT(OUT):: lai_id_next !LAI for each veg surface [m2 m-2]
861  REAL(KIND(1d0)), DIMENSION(nvegsurf), INTENT(IN)::lai_id_prev ! LAI of previous day
862 
863  REAL(KIND(1d0)):: no !Switches and checks for GDD
864  REAL(KIND(1d0))::yes !Switches and checks for GDD
865  REAL(KIND(1d0))::indhelp !Switches and checks for GDD
866  REAL(KIND(1d0)), DIMENSION(3)::gdd_id_prev ! GDD of previous day
867  REAL(KIND(1d0)), DIMENSION(3)::sdd_id_prev ! SDD of previous day
868 
869  INTEGER:: critdays
870  INTEGER::iv
871 
872  ! translate values of previous day to local variables
874  sdd_id_prev = sdd_id
875  ! LAI_id_prev = LAI_id_next
876 
877  critdays = 50 !Critical limit for GDD when GDD or SDD is set to zero
878 
879  ! Loop through vegetation types (iv)
880  DO iv = 1, nvegsurf
881  ! Calculate GDD for each day from the minimum and maximum air temperature
882  yes = ((tmin_id_prev + tmax_id_prev)/2 - baset(iv)) !Leaf on
883  no = ((tmin_id_prev + tmax_id_prev)/2 - basete(iv)) !Leaf off
884 
885  indhelp = 0 !Help switch to allow GDD to go to zero in sprint-time !! QUESTION: What does this mean? HCW
886 
887  IF (yes < 0) THEN !GDD cannot be negative
888  indhelp = yes !Amount of negative GDD
889  yes = 0
890  ENDIF
891 
892  IF (no > 0) no = 0 !SDD cannot be positive
893 
894  ! Calculate cumulative growing and senescence degree days
895  gdd_id(iv) = gdd_id_prev(iv) + yes
896  sdd_id(iv) = sdd_id_prev(iv) + no
897 
898  ! Possibility for cold spring
899  IF (sdd_id(iv) <= sddfull(iv) .AND. indhelp < 0) THEN
900  gdd_id(iv) = 0
901  ENDIF
902 
903  IF (gdd_id(iv) >= gddfull(iv)) THEN !Start senescence
904  gdd_id(iv) = gddfull(iv) !Leaves should not grow so delete yes from earlier
905  IF (sdd_id(iv) < -critdays) gdd_id(iv) = 0
906  ENDIF
907 
908  IF (sdd_id(iv) <= sddfull(iv)) THEN !After senescence now start growing leaves
909  sdd_id(iv) = sddfull(iv) !Leaves off so add back earlier
910  IF (gdd_id(iv) > critdays) sdd_id(iv) = 0
911  ENDIF
912 
913  ! With these limits SDD, GDD is set to zero
914  IF (sdd_id(iv) < -critdays .AND. sdd_id(iv) > sddfull(iv)) gdd_id(iv) = 0
915  IF (gdd_id(iv) > critdays .AND. gdd_id(iv) < gddfull(iv)) sdd_id(iv) = 0
916 
917  ! Now calculate LAI itself
918  IF (lat >= 0) THEN !Northern hemispere
919  !If SDD is not zero by mid May, this is forced
920  IF (id == 140 .AND. sdd_id(iv) /= 0) sdd_id(iv) = 0
921  ! Set SDD to zero in summer time
922  IF (gdd_id(iv) > critdays .AND. id < 170) sdd_id(iv) = 0
923  ! Set GDD zero in winter time
924  IF (sdd_id(iv) < -critdays .AND. id > 170) gdd_id(iv) = 0
925 
926  IF (laitype(iv) < 0.5) THEN !Original LAI type
927  IF (gdd_id(iv) > 0 .AND. gdd_id(iv) < gddfull(iv)) THEN !Leaves can still grow
928  lai_id_next(iv) = (lai_id_prev(iv)**laipower(1, iv)*gdd_id(iv)*laipower(2, iv)) + lai_id_prev(iv)
929  ELSEIF (sdd_id(iv) < 0 .AND. sdd_id(iv) > sddfull(iv)) THEN !Start senescence
930  lai_id_next(iv) = (lai_id_prev(iv)**laipower(3, iv)*sdd_id(iv)*laipower(4, iv)) + lai_id_prev(iv)
931  ELSE
932  lai_id_next(iv) = lai_id_prev(iv)
933  ENDIF
934  ELSEIF (laitype(iv) >= 0.5) THEN
935  IF (gdd_id(iv) > 0 .AND. gdd_id(iv) < gddfull(iv)) THEN !Leaves can still grow
936  lai_id_next(iv) = (lai_id_prev(iv)**laipower(1, iv)*gdd_id(iv)*laipower(2, iv)) + lai_id_prev(iv)
937  !! Use day length to start senescence at high latitudes (N hemisphere)
938  ELSEIF (lenday_id_prev <= 12 .AND. sdd_id(iv) > sddfull(iv)) THEN !Start senescence
939  lai_id_next(iv) = (lai_id_prev(iv)*laipower(3, iv)*(1 - sdd_id(iv))*laipower(4, iv)) + lai_id_prev(iv)
940  ELSE
941  lai_id_next(iv) = lai_id_prev(iv)
942  ENDIF
943  ENDIF
944 
945  ELSEIF (lat < 0) THEN !Southern hemisphere !! N.B. not identical to N hemisphere - return to later
946  !If SDD is not zero by late Oct, this is forced
947  IF (id == 300 .AND. sdd_id(iv) /= 0) sdd_id(iv) = 0
948  ! Set SDD to zero in summer time
949  IF (gdd_id(iv) > critdays .AND. id > 250) sdd_id(iv) = 0
950  ! Set GDD zero in winter time
951  IF (sdd_id(iv) < -critdays .AND. id < 250) gdd_id(iv) = 0
952 
953  IF (laitype(iv) < 0.5) THEN !Original LAI type
954  IF (gdd_id(iv) > 0 .AND. gdd_id(iv) < gddfull(iv)) THEN
955  lai_id_next(iv) = (lai_id_prev(iv)**laipower(1, iv)*gdd_id(iv)*laipower(2, iv)) + lai_id_prev(iv)
956  ELSEIF (sdd_id(iv) < 0 .AND. sdd_id(iv) > sddfull(iv)) THEN
957  lai_id_next(iv) = (lai_id_prev(iv)**laipower(3, iv)*sdd_id(iv)*laipower(4, iv)) + lai_id_prev(iv)
958  ELSE
959  lai_id_next(iv) = lai_id_prev(iv)
960  ENDIF
961  ELSE
962  IF (gdd_id(iv) > 0 .AND. gdd_id(iv) < gddfull(iv)) THEN
963  lai_id_next(iv) = (lai_id_prev(iv)**laipower(1, iv)*gdd_id(iv)*laipower(2, iv)) + lai_id_prev(iv)
964  !! Day length not used to start senescence in S hemisphere (not much land)
965  ELSEIF (sdd_id(iv) < 0 .AND. sdd_id(iv) > sddfull(iv)) THEN
966  lai_id_next(iv) = (lai_id_prev(iv)*laipower(3, iv)*(1 - sdd_id(iv))*laipower(4, iv)) + lai_id_prev(iv)
967  ELSE
968  lai_id_next(iv) = lai_id_prev(iv)
969  ENDIF
970  ENDIF
971  ENDIF !N or S hemisphere
972 
973  ! Check LAI within limits; if not set to limiting value
974  IF (lai_id_next(iv) > laimax(iv)) THEN
975  lai_id_next(iv) = laimax(iv)
976  ELSEIF (lai_id_next(iv) < laimin(iv)) THEN
977  lai_id_next(iv) = laimin(iv)
978  ENDIF
979 
980  ENDDO !End of loop over veg surfaces
981 
982  IF (laicalcyes == 0) THEN ! moved to SUEWS_cal_DailyState, TS 18 Sep 2017
983  ! LAI(id-1,:)=LAI_obs ! check -- this is going to be a problem as it is not for each vegetation class
984  lai_id_next = lai_obs
985  ENDIF
986  !------------------------------------------------------------------------------
987 
real(kind(1d0)), dimension(nvegsurf) lai_id_prev
real(kind(1d0)), dimension(nvegsurf) laimax
real(kind(1d0)), dimension(4, nvegsurf) laipower
real(kind(1d0)), dimension(nvegsurf) sdd_id
integer id
real(kind(1d0)), dimension(nvegsurf) gddfull
integer, dimension(nvegsurf) laitype
integer laicalcyes
real(kind(1d0)) lai_obs
real(kind(1d0)) lat
real(kind(1d0)), dimension(nvegsurf) gdd_id_prev
real(kind(1d0)), dimension(nvegsurf) laimin
integer, parameter nvegsurf
real(kind(1d0)), dimension(nvegsurf) basete
real(kind(1d0)), dimension(nvegsurf) gdd_id
real(kind(1d0)), dimension(nvegsurf) sddfull
real(kind(1d0)), dimension(nvegsurf) baset
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 1097 of file suews_phys_dailystate.f95.

Referenced by update_dailystate_end().

1097  IMPLICIT NONE
1098  INTEGER, INTENT(IN)::dt_since_start, it, imin, tstep
1099 
1100  REAL(KIND(1d0)), DIMENSION(12), INTENT(INOUT):: hdd_id
1101  ! REAL(KIND(1d0)),DIMENSION(6),INTENT(OUT):: HDD_id_use
1102 
1103  INTEGER:: days_prev
1104  REAL(KIND(1d0))::tstepcount
1105 
1106  ! count of timesteps performed during day `id`
1107  tstepcount = (it*60 + imin)*60/tstep*1.
1108  ! Heating degree days (HDD) -------------
1109  hdd_id(1) = hdd_id(1)/tstepcount !Heating
1110  hdd_id(2) = hdd_id(2)/tstepcount !Cooling
1111  hdd_id(3) = hdd_id(3)/tstepcount !Average temp
1112 
1113  ! Calculate a quasi-5-day-running-mean temp
1114  days_prev = min(4, & ! dt_since_start >= 4 days
1115  floor(dt_since_start/(24*60*60)*1.)) ! dt_since_start < 4 days
1116  hdd_id(4) = (hdd_id(4)*days_prev + hdd_id(3))/(days_prev + 1)
1117 
1118  ! Calculate number of days since rain
1119  IF (hdd_id(5) > 0) THEN !Rain occurred
1120  hdd_id(6) = 0
1121  ELSE
1122  hdd_id(6) = hdd_id(6) + 1 !Days since rain
1123  ENDIF
1124 
1125  ! save updated HDD_id(1:6) values to the last-half part (i.e., HDD_id(7:12))
1126  hdd_id(6 + 1:6 + 6) = hdd_id(1:6)
1127 
real(kind(1d0)), dimension(12) hdd_id
integer imin
integer dt_since_start
real(kind(1d0)) tstepcount
integer it
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,
real(kind(1d0)), intent(out)  deltaLAI 
)

Definition at line 565 of file suews_phys_dailystate.f95.

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

Referenced by update_dailystate_end().

565 
566  IMPLICIT NONE
567 
568  ! INTEGER,INTENT(IN)::id
569  REAL(KIND(1d0)), DIMENSION(nvegsurf), INTENT(IN)::laimax
570  REAL(KIND(1d0)), DIMENSION(nvegsurf), INTENT(IN)::laimin
571 
572  REAL(KIND(1d0)), INTENT(IN)::albmax_dectr
573  REAL(KIND(1d0)), INTENT(IN)::albmax_evetr
574  REAL(KIND(1d0)), INTENT(IN)::albmax_grass
575  REAL(KIND(1d0)), INTENT(IN)::albmin_dectr
576  REAL(KIND(1d0)), INTENT(IN)::albmin_evetr
577  REAL(KIND(1d0)), INTENT(IN)::albmin_grass
578  REAL(KIND(1d0)), INTENT(IN)::capmax_dec
579  REAL(KIND(1d0)), INTENT(IN)::capmin_dec
580  REAL(KIND(1d0)), INTENT(IN)::pormax_dec
581  REAL(KIND(1d0)), INTENT(IN)::pormin_dec
582  REAL(KIND(1d0)), DIMENSION(nvegsurf), INTENT(IN)::lai_id, lai_id_prev
583 
584  REAL(KIND(1d0)), INTENT(INOUT)::decidcap_id
585  REAL(KIND(1d0)), INTENT(INOUT)::albdectr_id
586  REAL(KIND(1d0)), INTENT(INOUT)::albevetr_id
587  REAL(KIND(1d0)), INTENT(INOUT)::albgrass_id
588  REAL(KIND(1d0)), INTENT(INOUT)::porosity_id
589 
590  REAL(KIND(1d0)), DIMENSION(6, nsurf), INTENT(inout)::storedrainprm
591 
592  REAL(KIND(1d0)), INTENT(OUT)::deltalai
593 
594  INTEGER::iv
595 
596  REAL(KIND(1d0))::albchangedectr
597  REAL(KIND(1d0))::albchangeevetr
598  REAL(KIND(1d0))::albchangegrass
599  REAL(KIND(1d0))::capchange
600 
601  REAL(KIND(1d0))::deltalaievetr
602  REAL(KIND(1d0))::deltalaigrass
603  REAL(KIND(1d0))::porchange
604  !::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
605  ! Calculate the development of vegetation cover
606  ! Albedo changes with LAI for each vegetation type
607  ! Storage capacity and porosity are updated based on DecTr LAI only (seasonal variation in Grass and EveTr assumed small)
608  ! If only LUMPS is used, set deciduous capacities to 0
609  ! QUESTION: Assume porosity Change based on GO99- Heisler?
610  deltalai = 0
611  deltalaievetr = 0
612  deltalaigrass = 0
613  capchange = 0
614  porchange = 0
615  albchangedectr = 0
616  albchangeevetr = 0
617  albchangegrass = 0
618 
619  iv = ivdecid
620  IF ((lai_id(iv) - lai_id_prev(iv)) /= 0) THEN
621  deltalai = (lai_id(iv) - lai_id_prev(iv))/(laimax(iv) - laimin(iv))
622  albchangedectr = (albmax_dectr - albmin_dectr)*deltalai
623  capchange = (capmin_dec - capmax_dec)*deltalai
624  porchange = (pormin_dec - pormax_dec)*deltalai
625  ENDIF
626 
627  iv = ivconif
628  IF ((lai_id(iv) - lai_id_prev(iv)) /= 0) THEN
629  deltalaievetr = (lai_id(iv) - lai_id_prev(iv))/(laimax(iv) - laimin(iv))
630  albchangeevetr = (albmax_evetr - albmin_evetr)*deltalaievetr !!N.B. Currently uses deltaLAI for deciduous trees only!!
631  ENDIF
632 
633  iv = ivgrass
634  IF ((lai_id(iv) - lai_id_prev(iv)) /= 0) THEN
635  deltalaigrass = (lai_id(iv) - lai_id_prev(iv))/(laimax(iv) - laimin(iv))
636  albchangegrass = (albmax_grass - albmin_grass)*deltalaigrass !!N.B. Currently uses deltaLAI for deciduous trees only!!
637  ENDIF
638 
639  iv = ivdecid
640 
641  !write(*,*) deltaLAI, deltaLAIEveTr, deltaLAIGrass
642 
643  decidcap_id = decidcap_id - capchange
644  storedrainprm(6, decidsurf) = decidcap_id !Change current storage capacity of deciduous trees
645  porosity_id = porosity_id + porchange !- changed to + by HCW 20 Aug 2015 (porosity greatest when LAI smallest)
646 
647  ! update albedo values while limiting these to valid ranges
648  albdectr_id = min(max(albdectr_id + albchangedectr, albmin_dectr), albmax_dectr)
649  albevetr_id = min(max(albevetr_id + albchangeevetr, albmin_evetr), albmax_evetr)
650  albgrass_id = min(max(albgrass_id + albchangegrass, albmin_grass), albmax_grass)
651  ! albDecTr_id = albDecTr_id + albChangeDecTr
652  ! albEveTr_id = albEveTr_id + albChangeEveTr
653  ! albGrass_id = albGrass_id + albChangeGrass
654 
real(kind(1d0)), dimension(nvegsurf) lai_id_prev
real(kind(1d0)) albmin_grass
real(kind(1d0)) albmin_evetr
integer, parameter ivgrass
real(kind(1d0)), dimension(nvegsurf) laimax
real(kind(1d0)) albmax_evetr
real(kind(1d0)) albevetr_id
real(kind(1d0)) albmax_grass
real(kind(1d0)) capmax_dec
real(kind(1d0)) pormax_dec
integer, parameter ivconif
real(kind(1d0)), dimension(nvegsurf) laimin
real(kind(1d0)), dimension(nvegsurf) lai_id
real(kind(1d0)) porosity_id
real(kind(1d0)) albmin_dectr
real(kind(1d0)) albgrass_id
real(kind(1d0)), dimension(6, nsurf) storedrainprm
integer, parameter decidsurf
real(kind(1d0)) pormin_dec
real(kind(1d0)) capmin_dec
real(kind(1d0)) albdectr_id
integer, parameter ivdecid
real(kind(1d0)) decidcap_id
real(kind(1d0)) albmax_dectr
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)  Faut,
real(kind(1d0)), dimension(12), intent(in)  HDD_id,
real(kind(1d0)), dimension(3), intent(in)  Ie_a,
real(kind(1d0)), dimension(3), intent(in)  Ie_m,
integer, intent(in)  Ie_start,
integer, intent(in)  Ie_end,
real(kind(1d0)), dimension(7), intent(in)  DayWatPer,
real(kind(1d0)), dimension(7), intent(in)  DayWat,
real(kind(1d0)), dimension(9), intent(out)  WUDay_id 
)

Definition at line 994 of file suews_phys_dailystate.f95.

Referenced by initialstate(), and update_dailystate_end().

994 
995  IMPLICIT NONE
996 
997  INTEGER, INTENT(IN) :: id
998  INTEGER, INTENT(IN) :: waterusemethod
999  INTEGER, INTENT(IN)::ie_start !Starting time of water use (DOY)
1000  INTEGER, INTENT(IN)::ie_end !Ending time of water use (DOY)
1001  INTEGER, DIMENSION(3), INTENT(IN)::dayofweek_id
1002 
1003  REAL(KIND(1d0)), INTENT(IN)::lat
1004  REAL(KIND(1d0)), INTENT(IN)::faut !Fraction of irrigated area using automatic irrigation
1005 
1006  REAL(KIND(1d0)), DIMENSION(12), INTENT(IN)::hdd_id
1007  REAL(KIND(1d0)), DIMENSION(3), INTENT(IN)::ie_a
1008  REAL(KIND(1d0)), DIMENSION(3), INTENT(IN)::ie_m !Coefficients for automatic and manual irrigation models
1009  REAL(KIND(1d0)), DIMENSION(7), INTENT(IN)::daywatper !% of houses following daily water
1010  REAL(KIND(1d0)), DIMENSION(7), INTENT(IN)::daywat !Days of watering allowed
1011 
1012  REAL(KIND(1d0)), DIMENSION(9), INTENT(OUT):: wuday_id !Daily water use for EveTr, DecTr, Grass [mm] (see SUEWS_DailyState.f95)
1013 
1014  INTEGER::wd !Water use calculation is done when calc = 1
1015  INTEGER::calc !Water use calculation is done when calc = 1
1016 
1017  REAL(KIND(1d0))::temp_avg
1018  REAL(KIND(1d0))::days_since_rain
1019 
1020  ! transfer HDD values
1021  temp_avg = hdd_id(9)
1022  days_since_rain = hdd_id(12)
1023 
1024  ! initialise WUDay_id
1025  wuday_id = 0
1026 
1027  IF (waterusemethod == 0) THEN !If water use is to be modelled (rather than observed)
1028 
1029  wd = dayofweek_id(1)
1030 
1031  IF (daywat(wd) == 1.0) THEN !1 indicates watering permitted on this day
1032  calc = 0
1033  IF (lat >= 0) THEN !Northern Hemisphere
1034  IF (id >= ie_start - 1 .AND. id <= ie_end + 1) calc = 1 !Day between irrigation period
1035  ELSE !Southern Hemisphere
1036  calc = 1
1037  IF (id >= ie_end .AND. id <= ie_start) calc = 0 !Day between irrigation period
1038  ENDIF
1039 
1040  IF (calc == 1) THEN
1041  ! Model daily water use based on days_since_rain (days since rain) and temp_avg (average temp)
1042  ! WUDay is the amount of water [mm] per day, applied to each of the irrigated areas
1043  ! N.B. These are the same for each vegetation type at the moment
1044 
1045  ! ---- Automatic irrigation (evergreen trees) ----
1046  wuday_id(2) = faut*(ie_a(1) + ie_a(2)*temp_avg + ie_a(3)*days_since_rain)*daywatper(wd)
1047  IF (wuday_id(2) < 0) wuday_id(2) = 0 !If modelled WU is negative -> 0
1048 
1049  ! ---- Manual irrigation (evergreen trees) ----
1050  wuday_id(3) = (1 - faut)*(ie_m(1) + ie_m(2)*temp_avg + ie_m(3)*days_since_rain)*daywatper(wd)
1051  IF (wuday_id(3) < 0) wuday_id(3) = 0 !If modelled WU is negative -> 0
1052 
1053  ! ---- Total evergreen trees water use (automatic + manual) ----
1054  wuday_id(1) = (wuday_id(2) + wuday_id(3))
1055 
1056  ! ---- Automatic irrigation (deciduous trees) ----
1057  wuday_id(5) = faut*(ie_a(1) + ie_a(2)*temp_avg + ie_a(3)*days_since_rain)*daywatper(wd)
1058  IF (wuday_id(5) < 0) wuday_id(5) = 0 !If modelled WU is negative -> 0
1059 
1060  ! ---- Manual irrigation (deciduous trees) ----
1061  wuday_id(6) = (1 - faut)*(ie_m(1) + ie_m(2)*temp_avg + ie_m(3)*days_since_rain)*daywatper(wd)
1062  IF (wuday_id(6) < 0) wuday_id(6) = 0 !If modelled WU is negative -> 0
1063 
1064  ! ---- Total deciduous trees water use (automatic + manual) ----
1065  wuday_id(4) = (wuday_id(5) + wuday_id(6))
1066 
1067  ! ---- Automatic irrigation (grass) ----
1068  wuday_id(8) = faut*(ie_a(1) + ie_a(2)*temp_avg + ie_a(3)*days_since_rain)*daywatper(wd)
1069  IF (wuday_id(8) < 0) wuday_id(8) = 0 !If modelled WU is negative -> 0
1070 
1071  ! ---- Manual irrigation (grass) ----
1072  wuday_id(9) = (1 - faut)*(ie_m(1) + ie_m(2)*temp_avg + ie_m(3)*days_since_rain)*daywatper(wd)
1073  IF (wuday_id(9) < 0) wuday_id(9) = 0 !If modelled WU is negative -> 0
1074 
1075  ! ---- Total grass water use (automatic + manual) ----
1076  wuday_id(7) = (wuday_id(8) + wuday_id(9))
1077 
1078  ELSE !If no irrigation on this day
1079  wuday_id(1) = 0
1080  wuday_id(2) = 0
1081  wuday_id(3) = 0
1082  wuday_id(4) = 0
1083  wuday_id(5) = 0
1084  wuday_id(6) = 0
1085  wuday_id(7) = 0
1086  wuday_id(8) = 0
1087  wuday_id(9) = 0
1088  ENDIF
1089  ENDIF
1090  ENDIF
1091 
real(kind(1d0)), dimension(3) ie_m
integer id
real(kind(1d0)), dimension(12) hdd_id
real(kind(1d0)) faut
real(kind(1d0)) lat
real(kind(1d0)), dimension(3) ie_a
real(kind(1d0)), dimension(7) daywatper
integer waterusemethod
real(kind(1d0)), dimension(9) wuday_id
real(kind(1d0)), dimension(7) daywat
Here is the caller graph for this function: