@@ -7,6 +7,7 @@ module EDInitMod
77 use FatesConstantsMod , only : r8 = > fates_r8
88 use FatesConstantsMod , only : ifalse
99 use FatesConstantsMod , only : itrue
10+ use FatesConstantsMod , only : fates_unset_int
1011 use FatesConstantsMod , only : primaryforest
1112 use FatesGlobals , only : endrun = > fates_endrun
1213 use EDTypesMod , only : nclmax
@@ -17,14 +18,21 @@ module EDInitMod
1718 use EDPatchDynamicsMod , only : create_patch
1819 use EDTypesMod , only : ed_site_type, ed_patch_type, ed_cohort_type
1920 use EDTypesMod , only : ncwd
20- use EDTypesMod , only : nuMWaterMem
21+ use EDTypesMod , only : numWaterMem
22+ use EDTypesMod , only : num_vegtemp_mem
2123 use EDTypesMod , only : maxpft
2224 use EDTypesMod , only : AREA
2325 use EDTypesMod , only : init_spread_near_bare_ground
2426 use EDTypesMod , only : init_spread_inventory
2527 use EDTypesMod , only : first_leaf_aclass
2628 use EDTypesMod , only : leaves_on
2729 use EDTypesMod , only : leaves_off
30+ use EDTypesMod , only : phen_cstat_nevercold
31+ use EDTypesMod , only : phen_cstat_iscold
32+ use EDTypesMod , only : phen_dstat_timeoff
33+ use EDTypesMod , only : phen_dstat_moistoff
34+ use EDTypesMod , only : phen_cstat_notcold
35+ use EDTypesMod , only : phen_dstat_moiston
2836 use FatesInterfaceMod , only : bc_in_type
2937 use FatesInterfaceMod , only : hlm_use_planthydro
3038 use FatesInterfaceMod , only : hlm_use_inventory_init
@@ -110,17 +118,18 @@ subroutine zero_site( site_in )
110118 site_in% total_burn_flux_to_atm = 0._r8
111119
112120 ! PHENOLOGY
113- site_in% is_cold = .false. ! Is cold deciduous leaf-off triggered?
114- site_in% is_drought = .false. ! Is drought deciduous leaf-off triggered?
115- site_in% ED_GDD_site = nan ! growing degree days
116- site_in% ncd = nan ! no chilling days
117- site_in% last_n_days(:) = 999 ! record of last 10 days temperature for senescence model.
118- site_in% leafondate = 999 ! doy of leaf on
119- site_in% leafoffdate = 999 ! doy of leaf off
120- site_in% dleafondate = 999 ! doy of leaf on drought
121- site_in% dleafoffdate = 999 ! doy of leaf on drought
122- site_in% water_memory(:) = nan
123121
122+ site_in% cstatus = fates_unset_int ! are leaves in this pixel on or off?
123+ site_in% dstatus = fates_unset_int
124+ site_in% grow_deg_days = nan ! growing degree days
125+ site_in% nchilldays = fates_unset_int
126+ site_in% ncolddays = fates_unset_int
127+ site_in% cleafondate = fates_unset_int ! doy of leaf on
128+ site_in% cleafoffdate = fates_unset_int ! doy of leaf off
129+ site_in% dleafondate = fates_unset_int ! doy of leaf on drought
130+ site_in% dleafoffdate = fates_unset_int ! doy of leaf on drought
131+ site_in% water_memory(:) = nan
132+ site_in% vegtemp_memory(:) = nan ! record of last 10 days temperature for senescence model.
124133
125134 ! SEED
126135 site_in% seed_bank(:) = 0._r8
@@ -185,66 +194,61 @@ subroutine set_site_properties( nsites, sites)
185194 !
186195 ! !LOCAL VARIABLES:
187196 integer :: s
188- real (r8 ) :: leafon
189- real (r8 ) :: leafoff
190- logical :: stat
191- real (r8 ) :: NCD
197+ integer :: cstat ! cold status phenology flag
192198 real (r8 ) :: GDD
193- logical :: dstat
199+ integer :: dstat ! drought status phenology flag
194200 real (r8 ) :: acc_NI
195- real (r8 ) :: watermem
196- integer :: dleafoff
197- integer :: dleafon
201+ real (r8 ) :: watermem
202+ integer :: cleafon ! DOY for cold-decid leaf-on, initial guess
203+ integer :: cleafoff ! DOY for cold-decid leaf-off, initial guess
204+ integer :: dleafoff ! DOY for drought-decid leaf-off, initial guess
205+ integer :: dleafon ! DOY for drought-decid leaf-on, initial guess
198206 !- ---------------------------------------------------------------------
199207
200- if ( hlm_is_restart == ifalse ) then
201- ! initial guess numbers for site condition.
202- NCD = 0.0_r8
203- GDD = 30.0_r8
204- leafon = 100.0_r8
205- leafoff = 300.0_r8
206- stat = .false.
207- acc_NI = 0.0_r8
208- dstat = .false.
209- dleafoff = 300
210- dleafon = 100
211- watermem = 0.5_r8
212208
213- else ! assignements for restarts
209+ ! If this is not a restart, we need to start with some reasonable
210+ ! starting points. If this is a restart, we leave the values
211+ ! as unset ints and reals, and let the restart values be read in
212+ ! after this routine
213+
214+ if ( hlm_is_restart == ifalse ) then
214215
215- NCD = 1.0_r8 ! NCD should be 1 on restart
216- GDD = 0.0_r8
217- leafon = 0.0_r8
218- leafoff = 0.0_r8
219- stat = .false.
216+ GDD = 30.0_r8
217+ cleafon = 100
218+ cleafoff = 300
219+ cstat = phen_cstat_notcold ! Leaves are on
220220 acc_NI = 0.0_r8
221- dstat = .false.
221+ dstat = phen_dstat_moiston ! Leaves are on
222222 dleafoff = 300
223223 dleafon = 100
224224 watermem = 0.5_r8
225225
226- endif
227-
228- do s = 1 ,nsites
229- sites(s)% ncd = NCD
230- sites(s)% leafondate = leafon
231- sites(s)% leafoffdate = leafoff
232- sites(s)% dleafoffdate = dleafoff
233- sites(s)% dleafondate = dleafon
234- sites(s)% ED_GDD_site = GDD
235-
236- if ( hlm_is_restart == ifalse ) then
226+ do s = 1 ,nsites
227+ sites(s)% nchilldays = 0
228+ sites(s)% ncolddays = 0 ! recalculated in phenology
229+ ! immediately, so yes this
230+ ! is memory-less, but needed
231+ ! for first value in history file
232+
233+ sites(s)% cleafondate = cleafon
234+ sites(s)% cleafoffdate = cleafoff
235+ sites(s)% dleafoffdate = dleafoff
236+ sites(s)% dleafondate = dleafon
237+ sites(s)% grow_deg_days = GDD
238+
237239 sites(s)% water_memory(1 :numWaterMem) = watermem
238- end if
239-
240- sites(s)% is_cold = stat
241- sites(s)% is_drought = dstat
242-
243- sites(s)% acc_NI = acc_NI
244- sites(s)% frac_burnt = 0.0_r8
245- sites(s)% old_stock = 0.0_r8
246-
247- end do
240+ sites(s)% vegtemp_memory(1 :num_vegtemp_mem) = 0._r8
241+
242+ sites(s)% cstatus = cstat
243+ sites(s)% dstatus = dstat
244+
245+ sites(s)% acc_NI = acc_NI
246+ sites(s)% frac_burnt = 0.0_r8
247+ sites(s)% old_stock = 0.0_r8
248+
249+ end do
250+
251+ end if
248252
249253 return
250254 end subroutine set_site_properties
@@ -439,13 +443,15 @@ subroutine init_cohorts( site_in, patch_in, bc_in)
439443 temp_cohort% laimemory = 0._r8
440444 cstatus = leaves_on
441445
442- if ( EDPftvarcon_inst% season_decid(pft) == itrue .and. site_in% is_cold ) then
446+ if ( EDPftvarcon_inst% season_decid(pft) == itrue .and. &
447+ any (site_in% cstatus == [phen_cstat_nevercold,phen_cstat_iscold])) then
443448 temp_cohort% laimemory = b_leaf
444449 b_leaf = 0._r8
445450 cstatus = leaves_off
446451 endif
447-
448- if ( EDPftvarcon_inst% stress_decid(pft) == itrue .and. site_in% is_drought ) then
452+
453+ if ( EDPftvarcon_inst% stress_decid(pft) == itrue .and. &
454+ any (site_in% dstatus == [phen_dstat_timeoff,phen_dstat_moistoff])) then
449455 temp_cohort% laimemory = b_leaf
450456 b_leaf = 0._r8
451457 cstatus = leaves_off
0 commit comments