diff --git a/biogeochem/EDPhysiologyMod.F90 b/biogeochem/EDPhysiologyMod.F90 index 488b6ec0b6..5f3c8c842f 100644 --- a/biogeochem/EDPhysiologyMod.F90 +++ b/biogeochem/EDPhysiologyMod.F90 @@ -29,7 +29,7 @@ module EDPhysiologyMod use EDTypesMod , only : dl_sf, dinc_ed use EDTypesMod , only : ncwd use EDTypesMod , only : nlevleaf - use EDTypesMod , only : senes + use EDTypesMod , only : num_vegtemp_mem use EDTypesMod , only : maxpft use EDTypesMod , only : ed_site_type, ed_patch_type, ed_cohort_type use EDTypesMod , only : dump_cohort @@ -37,6 +37,13 @@ module EDPhysiologyMod use EDTypesMod , only : leaves_on use EDTypesMod , only : leaves_off use EDTypesMod , only : min_n_safemath + use EDTypesMod , only : phen_cstat_nevercold + use EDTypesMod , only : phen_cstat_iscold + use EDTypesMod , only : phen_cstat_notcold + use EDTypesMod , only : phen_dstat_timeoff + use EDTypesMod , only : phen_dstat_moistoff + use EDTypesMod , only : phen_dstat_moiston + use EDTypesMod , only : phen_dstat_timeon use shr_log_mod , only : errMsg => shr_log_errMsg use FatesGlobals , only : fates_log @@ -106,6 +113,7 @@ module EDPhysiologyMod integer, parameter :: i_cdead = 6 ! Array index associated with structural carbon integer, parameter :: i_crepro = 7 ! Array index associated with reproductive carbon integer, parameter :: n_cplantpools = 7 ! Size of the carbon only integration framework + integer, parameter :: dleafon_drycheck = 100 ! Drought deciduous leaves max days on check parameter ! ============================================================================ @@ -314,8 +322,8 @@ subroutine trim_canopy( currentSite ) !Leaf Cost kgC/m2/year-1 !decidous costs. - if (EDPftvarcon_inst%season_decid(ipft) == 1.or. & - EDPftvarcon_inst%stress_decid(ipft) == 1)then + if (EDPftvarcon_inst%season_decid(ipft) == itrue .or. & + EDPftvarcon_inst%stress_decid(ipft) == itrue )then ! Leaf cost at leaf level z accounting for sla profile (kgC/m2) currentCohort%leaf_cost = 1._r8/(sla_levleaf*1000.0_r8) @@ -408,41 +416,54 @@ subroutine phenology( currentSite, bc_in ) ! ! !LOCAL VARIABLES: - integer :: t ! day of year - integer :: ncolddays ! no days underneath the threshold for leaf drop - integer :: i - integer :: timesincedleafon,timesincedleafoff,timesinceleafon,timesinceleafoff - integer :: refdate - integer :: curdate - - integer :: yr ! year (0, ...) - integer :: mon ! month (1, ..., 12) - integer :: day ! day of month (1, ..., 31) - integer :: sec ! seconds of the day - - real(r8) :: leaf_c ! leaf carbon [kg] - real(r8) :: fnrt_c ! fineroot carbon [kg] - real(r8) :: sapw_c ! sapwood carbon [kg] - real(r8) :: store_c ! storage carbon [kg] - real(r8) :: struct_c ! structure carbon [kg] - - real(r8) :: gdd_threshold - integer :: ncdstart ! beginning of counting period for chilling degree days. - integer :: gddstart ! beginning of counting period for growing degree days. - real(r8) :: temp_in_C ! daily averaged temperature in celcius - - real(r8), parameter :: canopy_leaf_lifespan = 365.0_r8 ! Mean lifespan canopy leaves - ! FIX(RGK 07/10/17) - ! This is a band-aid on unusual code - + integer :: model_day_int ! integer model day 1 - inf + integer :: ncolddays ! no days underneath the threshold for leaf drop + integer :: i_wmem ! Loop counter for water mem days + integer :: i_tmem ! Loop counter for veg temp mem days + integer :: dayssincedleafon ! Days since drought-decid leaf-on started + integer :: dayssincedleafoff ! Days since drought-decid leaf-off started + integer :: dayssincecleafon ! Days since cold-decid leaf-on started + integer :: dayssincecleafoff ! Days since cold-decid leaf-off started + real(r8) :: mean_10day_liqvol ! mean liquid volume (m3/m3) over last 10 days + real(r8) :: leaf_c ! leaf carbon [kg] + real(r8) :: fnrt_c ! fineroot carbon [kg] + real(r8) :: sapw_c ! sapwood carbon [kg] + real(r8) :: store_c ! storage carbon [kg] + real(r8) :: struct_c ! structure carbon [kg] + real(r8) :: gdd_threshold ! GDD accumulation function, + integer :: ilayer_swater ! Layer index for soil water + ! which also depends on chilling days. + integer :: ncdstart ! beginning of counting period for chilling degree days. + integer :: gddstart ! beginning of counting period for growing degree days. + real(r8) :: temp_in_C ! daily averaged temperature in celcius + + integer, parameter :: canopy_leaf_lifespan = 365 ! Maximum lifespan of drought decid leaves + + integer, parameter :: min_daysoff_dforcedflush = 30 ! THis is the number of days that must had elapsed + ! since leaves had dropped, in order to forcably + ! flush leaves again. This does not impact flushing + ! due to real moisture constraints, and will prevent + ! drought deciduous in perennially wet environments + ! that have been forced to drop their leaves, from + ! flushing them back immediately. + + real(r8),parameter :: dphen_soil_depth = 0.1 ! Use liquid soil water that is + ! closest to this depth [m] + + ! This is the integer model day. The first day of the simulation is 1, and it + ! continues monotonically, indefinitely + model_day_int = nint(hlm_model_day) + + + ! Use the following layer index to calculate drought conditions + ilayer_swater = minloc(abs(bc_in%z_sisl(:)-dphen_soil_depth),dim=1) + ! Parameter of drought decid leaf loss in mm in top layer...FIX(RF,032414) ! - this is arbitrary and poorly understood. Needs work. ED_ - !Parameters: defaults from Botta et al. 2000 GCB,6 709-725 !Parameters, default from from SDGVM model of senesence - t = hlm_day_of_year temp_in_C = bc_in%t_veg24_si - tfrz !-----------------Cold Phenology--------------------! @@ -450,32 +471,37 @@ subroutine phenology( currentSite, bc_in ) !Zero growing degree and chilling day counters if (currentSite%lat > 0)then ncdstart = 270 !Northern Hemisphere begining November - gddstart = 1 !Northern Hemisphere begining January + gddstart = 1 !Northern Hemisphere begining January else ncdstart = 120 !Southern Hemisphere beginning May gddstart = 181 !Northern Hemisphere begining July endif - ! FIX(SPM,032414) - this will only work for the first year, no? - if (t == ncdstart)then - currentSite%ncd = 0._r8 + ! Count the number of chilling days over a seasonal window. + ! For comparing against GDD, we start calculating chilling + ! in the late autumn. + ! This value is used to determine the GDD exceedance threshold + if (hlm_day_of_year == ncdstart)then + currentSite%nchilldays = 0 endif !Accumulate growing/chilling days after start of counting period if (temp_in_C < ED_val_phen_chiltemp)then - currentSite%ncd = currentSite%ncd + 1.0_r8 + currentSite%nchilldays = currentSite%nchilldays + 1 endif !GDD accumulation function, which also depends on chilling days. - gdd_threshold = ED_val_phen_a + ED_val_phen_b*exp(ED_val_phen_c*currentSite%ncd) + ! -68 + 638 * (-0.001 * ncd) + gdd_threshold = ED_val_phen_a + ED_val_phen_b*exp(ED_val_phen_c*real(currentSite%nchilldays,r8)) !Accumulate temperature of last 10 days. - currentSite%last_n_days(2:senes) = currentSite%last_n_days(1:senes-1) - currentSite%last_n_days(1) = temp_in_C + currentSite%vegtemp_memory(2:num_vegtemp_mem) = currentSite%vegtemp_memory(1:num_vegtemp_mem-1) + currentSite%vegtemp_memory(1) = temp_in_C + !count number of days for leaves off ncolddays = 0 - do i = 1,senes - if (currentSite%last_n_days(i) < ED_val_phen_coldtemp)then + do i_tmem = 1,num_vegtemp_mem + if (currentSite%vegtemp_memory(i_tmem) < ED_val_phen_coldtemp)then ncolddays = ncolddays + 1 endif enddo @@ -483,33 +509,51 @@ subroutine phenology( currentSite, bc_in ) ! Here is where we do the GDD accumulation calculation ! ! reset GDD on set dates - if (t == gddstart)then - currentSite%ED_GDD_site = 0._r8 + if (hlm_day_of_year == gddstart)then + currentSite%grow_deg_days = 0._r8 endif ! ! accumulate the GDD using daily mean temperatures if (bc_in%t_veg24_si .gt. tfrz) then - currentSite%ED_GDD_site = currentSite%ED_GDD_site + bc_in%t_veg24_si - tfrz + currentSite%grow_deg_days = currentSite%grow_deg_days + bc_in%t_veg24_si - tfrz endif + ! Calculate the number of days since the leaves last came on + ! and off. If this is the beginning of the simulation, that day might + ! not had occured yet, so set it to last year to get things rolling + + if (model_day_int < currentSite%cleafoffdate) then + dayssincecleafoff = model_day_int - (currentSite%cleafoffdate - 365) + else + dayssincecleafoff = model_day_int - currentSite%cleafoffdate + end if + + if (model_day_int < currentSite%cleafondate) then + dayssincecleafon = model_day_int - (currentSite%cleafondate-365) + else + dayssincecleafon = model_day_int - currentSite%cleafondate + end if + + - timesinceleafoff = hlm_model_day - currentSite%leafoffdate !LEAF ON: COLD DECIDUOUS. Needs to !1) have exceeded the growing degree day threshold !2) The leaves should not be on already - !3) There should have been at least on chilling day in the counting period. - if (currentSite%ED_GDD_site > gdd_threshold)then - if (currentSite%is_cold) then - if (currentSite%ncd >= 1) then - ! NOTE(bja, 2015-01) should leafondate = model_day to be consistent with leaf off? - currentSite%is_cold = .false. - currentSite%leafondate = t ! record leaf on date - if ( debug ) write(fates_log(),*) 'leaves on' - endif !ncd - endif !status + !3) There should have been at least one chilling day in the counting period. + ! this prevents tropical or warm climate plants that are "cold-deciduous" + ! from ever re-flushing after they have reached their maximum age (thus + ! preventing them from competing + + if ( (currentSite%cstatus == phen_cstat_iscold .or. & + currentSite%cstatus == phen_cstat_nevercold) .and. & + (currentSite%grow_deg_days > gdd_threshold) .and. & + (currentSite%nchilldays >= 1)) then + currentSite%cstatus = phen_cstat_notcold ! Set to not-cold status (leaves can come on) + currentSite%cleafondate = model_day_int + if ( debug ) write(fates_log(),*) 'leaves on' endif !GDD - timesinceleafon = hlm_model_day - currentSite%leafondate + !LEAF OFF: COLD THRESHOLD @@ -517,26 +561,42 @@ subroutine phenology( currentSite, bc_in ) !1) have exceeded the number of cold days threshold !2) have exceeded the minimum leafon time. !3) The leaves should not be off already - !4) The day of the year should be larger than the counting period. - ! (not sure if we need this/if it will break the restarting) + !4) The day of simulation should be larger than the counting period. + - if (ncolddays > ED_val_phen_ncolddayslim)then - if (timesinceleafon > ED_val_phen_mindayson)then - if (.not.currentSite%is_cold)then - currentSite%is_cold = .true. ! now cold enough for leaf-off - currentSite%leafoffdate = hlm_model_day ! record leaf off date - if ( debug ) write(fates_log(),*) 'leaves off' - endif - endif + if ( (currentSite%cstatus == phen_cstat_notcold) .and. & + (model_day_int > num_vegtemp_mem) .and. & + (ncolddays > ED_val_phen_ncolddayslim) .and. & + (dayssincecleafon > ED_val_phen_mindayson) )then + + currentSite%grow_deg_days = 0._r8 ! The equations for Botta et al + ! are for calculations of + ! first flush, but if we dont + ! clear this value, it will cause + ! leaves to flush later in the year + currentSite%cstatus = phen_cstat_iscold ! alter status of site to 'leaves off' + currentSite%cleafoffdate = model_day_int ! record leaf off date + + if ( debug ) write(fates_log(),*) 'leaves off' endif - - !LEAF OFF: COLD LIFESPAN THRESHOLD - if(timesinceleafoff > 400)then !remove leaves after a whole year when there is no 'off' period. - if(.not.currentSite%is_cold)then - currentSite%is_cold = .true. ! cold enough for leaf-off - currentSite%leafoffdate = hlm_model_day !record leaf off date - if ( debug ) write(fates_log(),*) 'leaves off' - endif + + ! LEAF OFF: COLD LIFESPAN THRESHOLD + ! NOTE: Some areas of the planet will never generate a cold day + ! and thus %nchilldays will never go from zero to 1. The following logic + ! when coupled with this fact will essentially prevent cold-deciduous + ! plants from re-emerging in areas without at least some cold days + + if( (currentSite%cstatus == phen_cstat_notcold) .and. & + (dayssincecleafoff > 400)) then ! remove leaves after a whole year + ! when there is no 'off' period. + currentSite%grow_deg_days = 0._r8 + + currentSite%cstatus = phen_cstat_nevercold ! alter status of site to imply that this + ! site is never really cold enough + ! for cold deciduous + currentSite%cleafoffdate = model_day_int ! record leaf off date + + if ( debug ) write(fates_log(),*) 'leaves off' endif !-----------------Drought Phenology--------------------! @@ -548,97 +608,132 @@ subroutine phenology( currentSite, bc_in ) ! B*: If the soil is only wet for a very short time, then the leaves stay on for 100 days ! C*: The leaves are only permitted to come ON for a 60 day window around when they last came on, ! to prevent 'flickering' on in response to wet season storms - ! D*: We don't allow anything to happen in the first ten days to allow the water memory window to come into equlibirum. - ! E*: If the soil is always wet, the leaves come on at the beginning of the window, and then last for their lifespan. + ! D*: We don't allow anything to happen in the first ten days to allow the water memory window + ! to come into equlibirium. + ! E*: If the soil is always wet, the leaves come on at the beginning of the window, and then + ! last for their lifespan. ! ISSUES ! 1. It's not clear what water content we should track. Here we are tracking the top layer, - ! but we probably should track something like BTRAN, - ! but BTRAN is defined for each PFT, and there could potentially be more than one stress-dec PFT.... ? - ! 2. In the beginning, the window is set at an arbitrary time of the year, so the leaves might come on - ! in the dry season, using up stored reserves - ! for the stress-dec plants, and potentially killing them. To get around this, we need to read in the - ! 'leaf on' date from some kind of start-up file + ! but we probably should track something like BTRAN, but BTRAN is defined for each PFT, + ! and there could potentially be more than one stress-dec PFT.... ? + ! 2. In the beginning, the window is set at an arbitrary time of the year, so the leaves + ! might come on in the dry season, using up stored reserves + ! for the stress-dec plants, and potentially killing them. To get around this, + ! we need to read in the 'leaf on' date from some kind of start-up file ! but we would need that to happen for every resolution, etc. - ! 3. Will this methodology properly kill off the stress-dec trees where there is no water stress? - ! What about where the wet period coincides with the - ! warm period? We would just get them overlapping with the cold-dec trees, even though that isn't appropriate.... - ! Why don't the drought deciduous trees grow - ! in the North? Is cold decidousness maybe even the same as drought deciduosness there (and so does this + ! 3. Will this methodology properly kill off the stress-dec trees where there is no + ! water stress? What about where the wet period coincides with the warm period? + ! We would just get them overlapping with the cold-dec trees, even though that isn't appropriate + ! Why don't the drought deciduous trees grow in the North? + ! Is cold decidousness maybe even the same as drought deciduosness there (and so does this ! distinction actually matter??).... - !Accumulate surface water memory of last 10 days. - - do i = 1,numWaterMem-1 !shift memory along one - currentSite%water_memory(numWaterMem+1-i) = currentSite%water_memory(numWaterMem-i) + ! Accumulate surface water memory of last 10 days. + ! Liquid volume in ground layer (m3/m3) + do i_wmem = 1,numWaterMem-1 !shift memory along one + currentSite%water_memory(numWaterMem+1-i_wmem) = currentSite%water_memory(numWaterMem-i_wmem) enddo - currentSite%water_memory(1) = bc_in%h2o_liqvol_sl(1) !waterstate_inst%h2osoi_vol_col(coli,1) - - ! In drought phenology, we often need to force the leaves to stay on or off as moisture fluctuates... - ! Here we incremend how long the leaves have been off; - ! We set the default assumption that no time has elapsed, but if drought - ! status is true, then we update the time - ! If the leaves are off. How long have they been off? - ! leaves have come on, but last year, so at a later date than now. - timesincedleafoff = 0 - if ( currentSite%is_drought )then - if (currentSite%dleafoffdate > 0.and.currentSite%dleafoffdate > t)then - timesincedleafoff = t + (360 - currentSite%dleafoffdate) - else - timesincedleafoff = t - currentSite%dleafoffdate - endif - endif + currentSite%water_memory(1) = bc_in%h2o_liqvol_sl(ilayer_swater) - timesincedleafon = 0 - !the leaves are on. How long have they been on? - if ( .not.currentSite%is_drought )then - !leaves have come on, but last year, so at a later date than now. - if (currentSite%dleafondate > 0.and.currentSite%dleafondate > t)then - timesincedleafon = t + (360 - currentSite%dleafondate) - else - timesincedleafon = t - currentSite%dleafondate - endif + ! Calculate the mean water content over the last 10 days (m3/m3) + mean_10day_liqvol = sum(currentSite%water_memory(1:numWaterMem))/real(numWaterMem,r8) + + ! In drought phenology, we often need to force the leaves to stay + ! on or off as moisture fluctuates... + + ! Calculate days since leaves have come off, but make a provision + ! for the first year of simulation, we have to assume a leaf drop + ! date to start, so if that is in the future, set it to last year + + if (model_day_int < currentSite%dleafoffdate) then + dayssincedleafoff = model_day_int - (currentSite%dleafoffdate-365) + else + dayssincedleafoff = model_day_int - currentSite%dleafoffdate + endif + + ! the leaves are on. How long have they been on? + if (model_day_int < currentSite%dleafondate) then + dayssincedleafon = model_day_int - (currentSite%dleafondate-365) + else + dayssincedleafon = model_day_int - currentSite%dleafondate endif - !LEAF ON: DROUGHT DECIDUOUS WETNESS - !Here, we used a window of oppurtunity to determine if we are close to the time when then leaves came on last year - if ((t >= currentSite%dleafondate - 30.and.t <= currentSite%dleafondate + 30).or.(t > 360 - 15.and. & - currentSite%dleafondate < 15))then ! are we in the window? - - if ( sum(currentSite%water_memory(1:numWaterMem))/real(numWaterMem,r8) & - >= ED_val_phen_drought_threshold .and. & - currentSite%is_drought .and. & - (t >= 10) ) then - ! leave some minimum time between leaf off and leaf on to prevent 'flickering'. - if (timesincedleafoff > ED_val_phen_doff_time)then - currentSite%is_drought = .false. ! end the drought - currentSite%dleafondate = t !record leaf on date - endif + ! LEAF ON: DROUGHT DECIDUOUS WETNESS + ! Here, we used a window of oppurtunity to determine if we are + ! close to the time when then leaves came on last year + + ! Has it been ... + ! a) a year, plus or minus 1 month since we last had leaf-on? + ! b) Has there also been at least a nominaly short amount of "leaf-off" + ! c) is the model day at least > 10 (let soil water spin-up) + ! Note that cold-starts begin in the "leaf-on" + ! status + if ( (currentSite%dstatus == phen_dstat_timeoff .or. & + currentSite%dstatus == phen_dstat_moistoff) .and. & + (model_day_int > numWaterMem) .and. & + (dayssincedleafon >= 365-30 .and. dayssincedleafon <= 365+30 ) .and. & + (dayssincedleafoff > ED_val_phen_doff_time) ) then + + ! If leaves are off, and have been off for at least a few days + ! and the time is consistent with the correct + ! time window... test if the moisture conditions allow for leaf-on + + if ( mean_10day_liqvol >= ED_val_phen_drought_threshold ) then + currentSite%dstatus = phen_dstat_moiston ! set status to leaf-on + currentSite%dleafondate = model_day_int ! save the model day we start flushing + dayssincedleafon = 0 endif endif - ! we still haven't done budburst by end of window - if (t == currentSite%dleafondate+30 .and. currentSite%is_drought)then - currentSite%is_drought = .false. ! force budburst! - currentSite%dleafondate = t ! record leaf on date - endif + ! LEAF ON: DROUGHT DECIDUOUS TIME EXCEEDANCE + ! If we still haven't done budburst by end of window, then force it + + ! If the status is "phen_dstat_moistoff", it means this site currently has + ! leaves off due to actual moisture limitations. + ! So we trigger bud-burst at the end of the month since + ! last year's bud-burst. If this is imposed, then we set the new + ! status to indicate bud-burst was forced by timing + + if( currentSite%dstatus == phen_dstat_moistoff ) then + if ( dayssincedleafon > 365+30 ) then + currentSite%dstatus = phen_dstat_timeon ! force budburst! + currentSite%dleafondate = model_day_int ! record leaf on date + dayssincedleafon = 0 + end if + end if - !LEAF OFF: DROUGHT DECIDUOUS LIFESPAN - if the leaf gets to the end of its useful life. A*, E* - if ( .not.currentSite%is_drought .and. (t >= 10) ) then !D* - !Are the leaves at the end of their lives? - if ( timesincedleafon > canopy_leaf_lifespan )then - currentSite%is_drought = .true. !alter status of site to 'leaves off' - currentSite%dleafoffdate = t !record leaf off date - endif + ! But if leaves are off due to time, then we enforce + ! a longer cool-down (because this is a perrenially wet system) + + if(currentSite%dstatus == phen_dstat_timeoff ) then + if (dayssincedleafoff > min_daysoff_dforcedflush) then + currentSite%dstatus = phen_dstat_timeon ! force budburst! + currentSite%dleafondate = model_day_int ! record leaf on date + dayssincedleafon = 0 + end if + end if + + ! LEAF OFF: DROUGHT DECIDUOUS LIFESPAN - if the leaf gets to + ! the end of its useful life. A*, E* + ! i.e. Are the leaves rouhgly at the end of their lives? + + if ( (currentSite%dstatus == phen_dstat_moiston .or. & + currentSite%dstatus == phen_dstat_timeon ) .and. & + (dayssincedleafon > canopy_leaf_lifespan) )then + currentSite%dstatus = phen_dstat_timeoff !alter status of site to 'leaves off' + currentSite%dleafoffdate = model_day_int !record leaf on date endif - !LEAF OFF: DROUGHT DECIDUOUS DRYNESS - if the soil gets too dry, and the leaves have already been on a while... - if ( .not.currentSite%is_drought .and. (t >= 10) ) then !D* - if (sum(currentSite%water_memory(1:10)/10._r8) <= ED_val_phen_drought_threshold)then - if (timesincedleafon > 100)then !B* Have the leaves been on for some reasonable length of time? To prevent flickering. - currentSite%is_drought = .true. !alter status of site to 'leaves on' - currentSite%dleafoffdate = t !record leaf on date - endif - endif + ! LEAF OFF: DROUGHT DECIDUOUS DRYNESS - if the soil gets too dry, + ! and the leaves have already been on a while... + + if ( (currentSite%dstatus == phen_dstat_moiston .or. & + currentSite%dstatus == phen_dstat_timeon ) .and. & + (model_day_int > numWaterMem) .and. & + (mean_10day_liqvol <= ED_val_phen_drought_threshold) .and. & + (dayssincedleafon > dleafon_drycheck ) ) then + currentSite%dstatus = phen_dstat_moistoff ! alter status of site to 'leaves off' + currentSite%dleafoffdate = model_day_int ! record leaf on date endif call phenology_leafonoff(currentSite) @@ -687,9 +782,9 @@ subroutine phenology_leafonoff(currentSite) ! The site level flags signify that it is no-longer too cold ! for leaves. Time to signal flushing - if (EDPftvarcon_inst%season_decid(ipft) == 1)then - if ( .not.currentSite%is_cold )then !we have just moved to leaves being on . - if (currentCohort%status_coh == leaves_off)then !Are the leaves currently off? + if (EDPftvarcon_inst%season_decid(ipft) == itrue)then + if ( currentSite%cstatus == phen_cstat_notcold )then ! we have just moved to leaves being on . + if (currentCohort%status_coh == leaves_off)then ! Are the leaves currently off? currentCohort%status_coh = leaves_on ! Leaves are on, so change status to ! stop flow of carbon out of bstore. @@ -709,12 +804,12 @@ subroutine phenology_leafonoff(currentSite) endif !pft phenology endif ! growing season - ! COLD LEAF OFF - ! The site level flag signifies that it is now too cold for - ! deciduous leaves. Time to drop if they have not already + !COLD LEAF OFF + if (currentSite%cstatus == phen_cstat_nevercold .or. & + currentSite%cstatus == phen_cstat_iscold) then ! past leaf drop day? Leaves still on tree? + + if (currentCohort%status_coh == leaves_on) then ! leaves have not dropped - if (currentSite%is_cold) then - if (currentCohort%status_coh == leaves_on)then ! leaves have not dropped ! This sets the cohort to the "leaves off" flag currentCohort%status_coh = leaves_off @@ -740,9 +835,10 @@ subroutine phenology_leafonoff(currentSite) ! Site level flag indicates it is no longer in drought condition ! deciduous plants can flush - if (EDPftvarcon_inst%stress_decid(ipft) == 1)then + if (EDPftvarcon_inst%stress_decid(ipft) == itrue )then - if ( .not.currentSite%is_drought ) then + if (currentSite%dstatus == phen_dstat_moiston .or. & + currentSite%dstatus == phen_dstat_timeon )then ! we have just moved to leaves being on . if (currentCohort%status_coh == leaves_off)then @@ -769,12 +865,11 @@ subroutine phenology_leafonoff(currentSite) endif !currentCohort status again? endif !currentSite status - ! DROUGHT LEAF OFF - ! Site level flag indicates a drought condition is in effect - ! deciduous plants should drop leaves if have not already + !DROUGHT LEAF OFF + if (currentSite%dstatus == phen_dstat_moistoff .or. & + currentSite%dstatus == phen_dstat_timeoff) then - if ( currentSite%is_drought ) then - if (currentCohort%status_coh == leaves_on)then ! leaves have not dropped + if (currentCohort%status_coh == leaves_on) then ! leaves have not dropped ! This sets the cohort to the "leaves off" flag currentCohort%status_coh = leaves_off @@ -957,11 +1052,13 @@ subroutine seed_germination( currentSite, currentPatch ) currentPatch%seed_germination(p) = min(currentSite%seed_bank(p) * & EDPftvarcon_inst%germination_timescale(p),max_germination) !set the germination only under the growing season...c.xu - if (EDPftvarcon_inst%season_decid(p) == itrue .and. currentSite%is_cold)then - currentPatch%seed_germination(p) = 0.0_r8 + if ( (EDPftvarcon_inst%season_decid(p) == itrue) .and. & + (any(currentSite%cstatus == [phen_cstat_nevercold,phen_cstat_iscold]))) then + currentPatch%seed_germination(p) = 0.0_r8 endif - if (EDPftvarcon_inst%stress_decid(p) == itrue .and. currentSite%is_drought)then - currentPatch%seed_germination(p) = 0.0_r8 + if ( (EDPftvarcon_inst%stress_decid(p) == itrue) .and. & + (any(currentSite%dstatus == [phen_dstat_timeoff,phen_dstat_moistoff]))) then + currentPatch%seed_germination(p) = 0.0_r8 endif enddo @@ -1020,18 +1117,15 @@ subroutine recruitment( currentSite, currentPatch, bc_in ) cohortstatus = leaves_on temp_cohort%laimemory = 0.0_r8 - ! But if the plant is seasonally (cold) deciduous, and the site status is flagged - ! as "cold", then set the cohort's status to leaves_off, and remember the leaf biomass - if (EDPftvarcon_inst%season_decid(ft) == itrue .and. currentSite%is_cold)then + if ( (EDPftvarcon_inst%season_decid(temp_cohort%pft) == itrue) .and. & + (any(currentSite%cstatus == [phen_cstat_nevercold,phen_cstat_iscold]))) then temp_cohort%laimemory = b_leaf b_leaf = 0.0_r8 cohortstatus = leaves_off endif - - ! Or.. if the plant is drought deciduous, and the site status is flagged as - ! "in a drought", then likewise, set the cohort's status to leaves_off, and remember leaf - ! biomass - if (EDPftvarcon_inst%stress_decid(ft) == itrue .and. currentSite%is_drought )then + + if ( (EDPftvarcon_inst%stress_decid(temp_cohort%pft) == itrue) .and. & + (any(currentSite%dstatus == [phen_dstat_timeoff,phen_dstat_moistoff]))) then temp_cohort%laimemory = b_leaf b_leaf = 0.0_r8 cohortstatus = leaves_off @@ -1046,6 +1140,7 @@ subroutine recruitment( currentSite, currentPatch, bc_in ) temp_cohort%n = currentPatch%area * EDPftvarcon_inst%prescribed_recruitment(ft) * hlm_freq_day endif + ! Only bother allocating a new cohort if there is a reasonable amount of it if (temp_cohort%n > min_n_safemath )then if ( debug ) write(fates_log(),*) 'EDPhysiologyMod.F90 call create_cohort ' @@ -1071,6 +1166,7 @@ subroutine recruitment( currentSite, currentPatch, bc_in ) currentSite%flux_out = currentSite%flux_out + currentPatch%area * currentPatch%seed_germination(ft)*hlm_freq_day endif + endif enddo !pft loop diff --git a/main/EDInitMod.F90 b/main/EDInitMod.F90 index ba19974b41..bba2cb139f 100644 --- a/main/EDInitMod.F90 +++ b/main/EDInitMod.F90 @@ -7,6 +7,7 @@ module EDInitMod use FatesConstantsMod , only : r8 => fates_r8 use FatesConstantsMod , only : ifalse use FatesConstantsMod , only : itrue + use FatesConstantsMod , only : fates_unset_int use FatesConstantsMod , only : primaryforest use FatesGlobals , only : endrun => fates_endrun use EDTypesMod , only : nclmax @@ -17,7 +18,8 @@ module EDInitMod use EDPatchDynamicsMod , only : create_patch use EDTypesMod , only : ed_site_type, ed_patch_type, ed_cohort_type use EDTypesMod , only : ncwd - use EDTypesMod , only : nuMWaterMem + use EDTypesMod , only : numWaterMem + use EDTypesMod , only : num_vegtemp_mem use EDTypesMod , only : maxpft use EDTypesMod , only : AREA use EDTypesMod , only : init_spread_near_bare_ground @@ -25,6 +27,12 @@ module EDInitMod use EDTypesMod , only : first_leaf_aclass use EDTypesMod , only : leaves_on use EDTypesMod , only : leaves_off + use EDTypesMod , only : phen_cstat_nevercold + use EDTypesMod , only : phen_cstat_iscold + use EDTypesMod , only : phen_dstat_timeoff + use EDTypesMod , only : phen_dstat_moistoff + use EDTypesMod , only : phen_cstat_notcold + use EDTypesMod , only : phen_dstat_moiston use FatesInterfaceMod , only : bc_in_type use FatesInterfaceMod , only : hlm_use_planthydro use FatesInterfaceMod , only : hlm_use_inventory_init @@ -110,17 +118,18 @@ subroutine zero_site( site_in ) site_in%total_burn_flux_to_atm = 0._r8 ! PHENOLOGY - site_in%is_cold = .false. ! Is cold deciduous leaf-off triggered? - site_in%is_drought = .false. ! Is drought deciduous leaf-off triggered? - site_in%ED_GDD_site = nan ! growing degree days - site_in%ncd = nan ! no chilling days - site_in%last_n_days(:) = 999 ! record of last 10 days temperature for senescence model. - site_in%leafondate = 999 ! doy of leaf on - site_in%leafoffdate = 999 ! doy of leaf off - site_in%dleafondate = 999 ! doy of leaf on drought - site_in%dleafoffdate = 999 ! doy of leaf on drought - site_in%water_memory(:) = nan + site_in%cstatus = fates_unset_int ! are leaves in this pixel on or off? + site_in%dstatus = fates_unset_int + site_in%grow_deg_days = nan ! growing degree days + site_in%nchilldays = fates_unset_int + site_in%ncolddays = fates_unset_int + site_in%cleafondate = fates_unset_int ! doy of leaf on + site_in%cleafoffdate = fates_unset_int ! doy of leaf off + site_in%dleafondate = fates_unset_int ! doy of leaf on drought + site_in%dleafoffdate = fates_unset_int ! doy of leaf on drought + site_in%water_memory(:) = nan + site_in%vegtemp_memory(:) = nan ! record of last 10 days temperature for senescence model. ! SEED site_in%seed_bank(:) = 0._r8 @@ -185,66 +194,61 @@ subroutine set_site_properties( nsites, sites) ! ! !LOCAL VARIABLES: integer :: s - real(r8) :: leafon - real(r8) :: leafoff - logical :: stat - real(r8) :: NCD + integer :: cstat ! cold status phenology flag real(r8) :: GDD - logical :: dstat + integer :: dstat ! drought status phenology flag real(r8) :: acc_NI - real(r8) :: watermem - integer :: dleafoff - integer :: dleafon + real(r8) :: watermem + integer :: cleafon ! DOY for cold-decid leaf-on, initial guess + integer :: cleafoff ! DOY for cold-decid leaf-off, initial guess + integer :: dleafoff ! DOY for drought-decid leaf-off, initial guess + integer :: dleafon ! DOY for drought-decid leaf-on, initial guess !---------------------------------------------------------------------- - if ( hlm_is_restart == ifalse ) then - !initial guess numbers for site condition. - NCD = 0.0_r8 - GDD = 30.0_r8 - leafon = 100.0_r8 - leafoff = 300.0_r8 - stat = .false. - acc_NI = 0.0_r8 - dstat = .false. - dleafoff = 300 - dleafon = 100 - watermem = 0.5_r8 - else ! assignements for restarts + ! If this is not a restart, we need to start with some reasonable + ! starting points. If this is a restart, we leave the values + ! as unset ints and reals, and let the restart values be read in + ! after this routine + + if ( hlm_is_restart == ifalse ) then - NCD = 1.0_r8 ! NCD should be 1 on restart - GDD = 0.0_r8 - leafon = 0.0_r8 - leafoff = 0.0_r8 - stat = .false. + GDD = 30.0_r8 + cleafon = 100 + cleafoff = 300 + cstat = phen_cstat_notcold ! Leaves are on acc_NI = 0.0_r8 - dstat = .false. + dstat = phen_dstat_moiston ! Leaves are on dleafoff = 300 dleafon = 100 watermem = 0.5_r8 - endif - - do s = 1,nsites - sites(s)%ncd = NCD - sites(s)%leafondate = leafon - sites(s)%leafoffdate = leafoff - sites(s)%dleafoffdate = dleafoff - sites(s)%dleafondate = dleafon - sites(s)%ED_GDD_site = GDD - - if ( hlm_is_restart == ifalse ) then + do s = 1,nsites + sites(s)%nchilldays = 0 + sites(s)%ncolddays = 0 ! recalculated in phenology + ! immediately, so yes this + ! is memory-less, but needed + ! for first value in history file + + sites(s)%cleafondate = cleafon + sites(s)%cleafoffdate = cleafoff + sites(s)%dleafoffdate = dleafoff + sites(s)%dleafondate = dleafon + sites(s)%grow_deg_days = GDD + sites(s)%water_memory(1:numWaterMem) = watermem - end if - - sites(s)%is_cold = stat - sites(s)%is_drought = dstat - - sites(s)%acc_NI = acc_NI - sites(s)%frac_burnt = 0.0_r8 - sites(s)%old_stock = 0.0_r8 - - end do + sites(s)%vegtemp_memory(1:num_vegtemp_mem) = 0._r8 + + sites(s)%cstatus = cstat + sites(s)%dstatus = dstat + + sites(s)%acc_NI = acc_NI + sites(s)%frac_burnt = 0.0_r8 + sites(s)%old_stock = 0.0_r8 + + end do + + end if return end subroutine set_site_properties @@ -439,13 +443,15 @@ subroutine init_cohorts( site_in, patch_in, bc_in) temp_cohort%laimemory = 0._r8 cstatus = leaves_on - if( EDPftvarcon_inst%season_decid(pft) == itrue .and. site_in%is_cold ) then + if( EDPftvarcon_inst%season_decid(pft) == itrue .and. & + any(site_in%cstatus == [phen_cstat_nevercold,phen_cstat_iscold])) then temp_cohort%laimemory = b_leaf b_leaf = 0._r8 cstatus = leaves_off endif - - if ( EDPftvarcon_inst%stress_decid(pft) == itrue .and. site_in%is_drought ) then + + if ( EDPftvarcon_inst%stress_decid(pft) == itrue .and. & + any(site_in%dstatus == [phen_dstat_timeoff,phen_dstat_moistoff])) then temp_cohort%laimemory = b_leaf b_leaf = 0._r8 cstatus = leaves_off diff --git a/main/EDMainMod.F90 b/main/EDMainMod.F90 index c515a5e678..20aa3b3103 100644 --- a/main/EDMainMod.F90 +++ b/main/EDMainMod.F90 @@ -42,6 +42,8 @@ module EDMainMod use EDtypesMod , only : ed_patch_type use EDtypesMod , only : ed_cohort_type use EDTypesMod , only : AREA + use EDTypesMod , only : phen_dstat_moiston + use EDTypesMod , only : phen_dstat_timeon use FatesConstantsMod , only : itrue,ifalse use FatesConstantsMod , only : primaryforest, secondaryforest use FatesPlantHydraulicsMod , only : do_growthrecruiteffects @@ -270,6 +272,7 @@ subroutine ed_integrate_state_variables(currentSite, bc_in ) real(r8) :: cohort_biomass_store ! remembers the biomass in the cohort for balance checking real(r8) :: dbh_old ! dbh of plant before daily PRT [cm] real(r8) :: hite_old ! height of plant before daily PRT [m] + logical :: is_drought ! logical for if the plant (site) is in a drought state real(r8) :: leaf_c real(r8) :: delta_dbh ! correction for dbh real(r8) :: delta_hite ! correction for hite @@ -361,9 +364,13 @@ subroutine ed_integrate_state_variables(currentSite, bc_in ) ! Conduct Maintenance Turnover (parteh) - call currentCohort%prt%CheckMassConservation(ft,3) - call PRTMaintTurnover(currentCohort%prt,ft,currentSite%is_drought) + if(any(currentSite%dstatus == [phen_dstat_moiston,phen_dstat_timeon])) then + is_drought = .false. + else + is_drought = .true. + end if + call PRTMaintTurnover(currentCohort%prt,ft,is_drought) call currentCohort%prt%CheckMassConservation(ft,4) leaf_c = currentCohort%prt%GetState(leaf_organ, all_carbon_elements) @@ -750,8 +757,8 @@ subroutine bypass_dynamics(currentSite) currentCohort%frmort = 0.0_r8 currentCohort%dndt = 0.0_r8 - currentCohort%dhdt = 0.0_r8 - currentCohort%ddbhdt = 0.0_r8 + currentCohort%dhdt = 0.0_r8 + currentCohort%ddbhdt = 0.0_r8 currentCohort => currentCohort%taller enddo diff --git a/main/EDTypesMod.F90 b/main/EDTypesMod.F90 index 0cb82ced35..633e365678 100644 --- a/main/EDTypesMod.F90 +++ b/main/EDTypesMod.F90 @@ -76,6 +76,7 @@ module EDTypesMod integer, parameter :: leaves_on = 2 ! Flag specifying that a deciduous plant has leaves ! and should be allocating to them as well + integer, parameter :: leaves_off = 1 ! Flag specifying that a deciduous plant has dropped ! its leaves and should not be trying to allocate ! towards any growth. @@ -107,7 +108,7 @@ module EDTypesMod integer, parameter :: numWaterMem = 10 ! watermemory saved as site level var ! BIOLOGY/BIOGEOCHEMISTRY - integer , parameter :: SENES = 10 ! Window of time over which we track temp for cold sensecence (days) + integer , parameter :: num_vegtemp_mem = 10 ! Window of time over which we track temp for cold sensecence (days) real(r8), parameter :: dinc_ed = 1.0_r8 ! size of VAI bins (LAI+SAI) [CHANGE THIS NAME WITH NEXT INTERFACE ! UPDATE] integer , parameter :: N_DIST_TYPES = 3 ! Disturbance Modes 1) tree-fall, 2) fire, 3) logging @@ -115,6 +116,20 @@ module EDTypesMod integer , parameter :: dtype_ifire = 2 ! index for fire generated disturbance event integer , parameter :: dtype_ilog = 3 ! index for logging generated disturbance event + + ! Phenology status flag definitions (cold type is cstat, dry type is dstat) + + integer, parameter :: phen_cstat_nevercold = 0 ! This (location/plant) has not experienced a cold period over a large number + ! of days, leaves are dropped and flagged as non-cold region + integer, parameter :: phen_cstat_iscold = 1 ! This (location/plant) is in a cold-state where leaves should have fallen + integer, parameter :: phen_cstat_notcold = 2 ! This site is in a warm-state where leaves are allowed to flush + + integer, parameter :: phen_dstat_timeoff = 0 ! Leaves off due to time exceedance (drought phenology) + integer, parameter :: phen_dstat_moistoff = 1 ! Leaves off due to moisture avail (drought phenology) + integer, parameter :: phen_dstat_moiston = 2 ! Leaves on due to moisture avail (drought phenology) + integer, parameter :: phen_dstat_timeon = 3 ! Leaves on due to time exceedance (drought phenology) + + ! SPITFIRE integer, parameter :: NCWD = 4 ! number of coarse woody debris pools (twig,s branch,l branch, trunk) integer , parameter :: NFSC = NCWD+2 ! number fuel size classes (4 cwd size classes, leaf litter, and grass) @@ -611,15 +626,26 @@ module EDTypesMod ! PHENOLOGY - real(r8) :: ED_GDD_site ! ED Phenology growing degree days. - logical :: is_cold ! is this site/column in a cold-status where its cohorts drop leaves? - logical :: is_drought ! is this site/column in a drought-status where its cohorts drop leaves? - real(r8) :: ncd ! no chilling days:- - real(r8) :: last_n_days(senes) ! record of last 10 days temperature for senescence model. deg C - integer :: leafondate ! doy of leaf on:- - integer :: leafoffdate ! doy of leaf off:- - integer :: dleafondate ! doy of leaf on drought:- - integer :: dleafoffdate ! doy of leaf on drought:- + real(r8) :: grow_deg_days ! Phenology growing degree days + + integer :: cstatus ! are leaves in this pixel on or off for cold decid + ! 0 = this site has not experienced a cold period over at least + ! 400 days, leaves are dropped and flagged as non-cold region + ! 1 = this site is in a cold-state where leaves should have fallen + ! 2 = this site is in a warm-state where leaves are allowed to flush + integer :: dstatus ! are leaves in this pixel on or off for drought decid + ! 0 = leaves off due to time exceedance + ! 1 = leaves off due to moisture avail + ! 2 = leaves on due to moisture avail + ! 3 = leaves on due to time exceedance + integer :: nchilldays ! num chilling days: (for botta gdd trheshold calculation) + integer :: ncolddays ! num cold days: (must exceed threshold to drop leaves) + real(r8) :: vegtemp_memory(num_vegtemp_mem) ! record of last 10 days temperature for senescence model. deg C + integer :: cleafondate ! model date (day integer) of leaf on (cold):- + integer :: cleafoffdate ! model date (day integer) of leaf off (cold):- + integer :: dleafondate ! model date (day integer) of leaf on drought:- + integer :: dleafoffdate ! model date (day integer) of leaf off drought:- + real(r8) :: water_memory(numWaterMem) ! last 10 days of soil moisture memory... !SEED BANK diff --git a/main/FatesConstantsMod.F90 b/main/FatesConstantsMod.F90 index 449e8c486e..bff05b7e1c 100644 --- a/main/FatesConstantsMod.F90 +++ b/main/FatesConstantsMod.F90 @@ -15,10 +15,12 @@ module FatesConstantsMod integer, parameter :: fates_short_string_length = 32 integer, parameter :: fates_long_string_length = 199 - ! Unset and various other 'special' values + ! Used to initialize and test unset integers integer, parameter :: fates_unset_int = -9999 - real(fates_r8), parameter :: fates_unset_r8 = -9999._fates_r8 - + + ! Used to initialize and test unset r8s + real(fates_r8), parameter :: fates_unset_r8 = -1.e36_fates_r8 + ! Integer equivalent of true (in case some compilers dont auto convert) integer, parameter :: itrue = 1 diff --git a/main/FatesHistoryInterfaceMod.F90 b/main/FatesHistoryInterfaceMod.F90 index 1f577a8cc5..f9821b45f4 100644 --- a/main/FatesHistoryInterfaceMod.F90 +++ b/main/FatesHistoryInterfaceMod.F90 @@ -10,6 +10,8 @@ module FatesHistoryInterfaceMod use FatesGlobals , only : endrun => fates_endrun use EDTypesMod , only : nclmax use EDTypesMod , only : ican_upper + use EDTypesMod , only : numWaterMem + use EDTypesMod , only : num_vegtemp_mem use FatesIODimensionsMod , only : fates_io_dimension_type use FatesIOVariableKindMod , only : fates_io_variable_kind_type use FatesHistoryVariableType , only : fates_history_variable_type @@ -19,8 +21,10 @@ module FatesHistoryInterfaceMod use FatesInterfaceMod , only : numpft use FatesInterfaceMod , only : hlm_freq_day use EDParamsMod , only : ED_val_comp_excln + use EDParamsMod , only : ED_val_phen_coldtemp use FatesInterfaceMod , only : nlevsclass, nlevage use FatesInterfaceMod , only : nlevheight + use FatesInterfaceMod , only : hlm_model_day ! FIXME(bja, 2016-10) need to remove CLM dependancy use EDPftvarcon , only : EDPftvarcon_inst @@ -184,8 +188,6 @@ module FatesHistoryInterfaceMod integer, private :: ih_c_stomata_si integer, private :: ih_c_lblayer_si integer, private :: ih_fire_c_to_atm_si - integer, private :: ih_ed_to_bgc_this_edts_si - integer, private :: ih_ed_to_bgc_last_edts_si integer, private :: ih_totecosysc_si integer, private :: ih_totecosysc_old_si integer, private :: ih_totedc_si @@ -224,10 +226,19 @@ module FatesHistoryInterfaceMod integer, private :: ih_h2oveg_growturn_err_si integer, private :: ih_h2oveg_pheno_err_si integer, private :: ih_h2oveg_hydro_err_si - + + integer, private :: ih_site_cstatus_si + integer, private :: ih_site_dstatus_si + integer, private :: ih_gdd_si + integer, private :: ih_site_nchilldays_si + integer, private :: ih_site_ncolddays_si + integer, private :: ih_cleafoff_si + integer, private :: ih_cleafon_si + integer, private :: ih_dleafoff_si + integer, private :: ih_dleafon_si + integer, private :: ih_meanliqvol_si - ! Indices to (site x scpf [multiplexed size- and age- bins]) variables integer, private :: ih_nplant_si_scpf integer, private :: ih_gpp_si_scpf integer, private :: ih_npp_totl_si_scpf @@ -472,7 +483,11 @@ module FatesHistoryInterfaceMod ! The number of variable dim/kind types we have defined (static) integer, parameter :: fates_history_num_dimensions = 16 integer, parameter :: fates_history_num_dim_kinds = 18 - + + ! These flags are used to help specify what to do with non-fates + ! locations in the host model + integer, parameter :: zero_flag = 0 + integer, parameter :: ignore_flag = 1 ! This structure is allocated by thread, and must be calculated after the FATES @@ -1145,6 +1160,7 @@ subroutine set_history_var(this, vname, units, long, use_default, avgflag, vtype ! explict name (for fast reference during update) ! A zero is passed back when the variable is ! not used + ! locals integer :: ub1, lb1, ub2, lb2 ! Bounds for allocating the var @@ -1159,8 +1175,8 @@ subroutine set_history_var(this, vname, units, long, use_default, avgflag, vtype if (initialize) then call this%hvars(ivar)%Init(vname, units, long, use_default, & - vtype, avgflag, flushval, upfreq, fates_history_num_dim_kinds, this%dim_kinds, & - this%dim_bounds) + vtype, avgflag, flushval, upfreq, & + fates_history_num_dim_kinds, this%dim_kinds, this%dim_bounds) end if else index = 0 @@ -1382,8 +1398,11 @@ subroutine update_history_dyn(this,nc,nsites,sites) integer :: ican, ileaf, cnlf_indx ! iterators for leaf and canopy level integer :: height_bin_max, height_bin_min ! which height bin a given cohort's canopy is in integer :: i_heightbin ! iterator for height bins + integer :: i_tmem ! iterator for veg temp bins + integer :: model_day_int ! integer model day from reference integer :: ageclass_since_anthrodist ! what is the equivalent age class for ! time-since-anthropogenic-disturbance of secondary forest + real(r8) :: n_density ! individual of cohort per m2. real(r8) :: n_perm2 ! individuals per m2 for the whole column @@ -1606,7 +1625,17 @@ subroutine update_history_dyn(this,nc,nsites,sites) hio_ddbh_canopy_si_scag => this%hvars(ih_ddbh_canopy_si_scag)%r82d, & hio_ddbh_understory_si_scag => this%hvars(ih_ddbh_understory_si_scag)%r82d, & hio_mortality_canopy_si_scag => this%hvars(ih_mortality_canopy_si_scag)%r82d, & - hio_mortality_understory_si_scag => this%hvars(ih_mortality_understory_si_scag)%r82d) + hio_mortality_understory_si_scag => this%hvars(ih_mortality_understory_si_scag)%r82d, & + hio_site_cstatus_si => this%hvars(ih_site_cstatus_si)%r81d, & + hio_site_dstatus_si => this%hvars(ih_site_dstatus_si)%r81d, & + hio_gdd_si => this%hvars(ih_gdd_si)%r81d, & + hio_site_ncolddays_si => this%hvars(ih_site_ncolddays_si)%r81d, & + hio_site_nchilldays_si => this%hvars(ih_site_nchilldays_si)%r81d, & + hio_cleafoff_si => this%hvars(ih_cleafoff_si)%r81d, & + hio_cleafon_si => this%hvars(ih_cleafon_si)%r81d, & + hio_dleafoff_si => this%hvars(ih_dleafoff_si)%r81d, & + hio_dleafon_si => this%hvars(ih_dleafoff_si)%r81d, & + hio_meanliqvol_si => this%hvars(ih_meanliqvol_si)%r81d ) ! --------------------------------------------------------------------------------- @@ -1619,6 +1648,8 @@ subroutine update_history_dyn(this,nc,nsites,sites) ! If we don't have dynamics turned on, we just abort these diagnostics if (hlm_use_ed_st3.eq.itrue) return + model_day_int = nint(hlm_model_day) + ! --------------------------------------------------------------------------------- ! Loop through the FATES scale hierarchy and fill the history IO arrays ! --------------------------------------------------------------------------------- @@ -1637,10 +1668,31 @@ subroutine update_history_dyn(this,nc,nsites,sites) hio_canopy_spread_si(io_si) = sites(s)%spread + ! Update the site statuses (stati?) + hio_site_cstatus_si(io_si) = real(sites(s)%cstatus,r8) + hio_site_dstatus_si(io_si) = real(sites(s)%dstatus,r8) + + !count number of days for leaves off + hio_site_nchilldays_si(io_si) = real(sites(s)%nchilldays,r8) + hio_site_ncolddays_si(io_si) = real(sites(s)%ncolddays,r8) + + + hio_gdd_si(io_si) = sites(s)%grow_deg_days + hio_cleafoff_si(io_si) = real(model_day_int - sites(s)%cleafoffdate,r8) + hio_cleafon_si(io_si) = real(model_day_int - sites(s)%cleafondate,r8) + hio_dleafoff_si(io_si) = real(model_day_int - sites(s)%dleafoffdate,r8) + hio_dleafon_si(io_si) = real(model_day_int - sites(s)%dleafondate,r8) + + if(model_day_int>numWaterMem)then + hio_meanliqvol_si(io_si) = & + sum(sites(s)%water_memory(1:numWaterMem))/real(numWaterMem,r8) + end if + ! track total wood product accumulation at the site level hio_woodproduct_si(io_si) = sites(s)%resources_management%trunk_product_site & * AREA_INV * g_per_kg + ! If hydraulics are turned on, track the error terms ! associated with dynamics @@ -3333,6 +3385,66 @@ subroutine define_history_vars(this, initialize_variables) avgflag='A', vtype=patch_r8, hlms='CLM:ALM', flushval=0.0_r8, upfreq=1, & ivar=ivar, initialize=initialize_variables, index = ih_area_treespread_pa) + call this%set_history_var(vname='SITE_COLD_STATUS', units='0,1,2', & + long='Site level cold status, 0=not cold-dec, 1=too cold for leaves, 2=not-too cold', & + use_default='active', & + avgflag='A', vtype=site_r8, hlms='CLM:ALM', flushval=hlm_hio_ignore_val, upfreq=1, & + ivar=ivar, initialize=initialize_variables, index = ih_site_cstatus_si ) + + call this%set_history_var(vname='SITE_DROUGHT_STATUS', units='0,1,2,3', & + long='Site level drought status, <2 too dry for leaves, >=2 not-too dry', & + use_default='active', & + avgflag='A', vtype=site_r8, hlms='CLM:ALM', flushval=hlm_hio_ignore_val, upfreq=1, & + ivar=ivar, initialize=initialize_variables, index = ih_site_dstatus_si) + + call this%set_history_var(vname='SITE_GDD', units='degC', & + long='site level growing degree days', & + use_default='active', & + avgflag='A', vtype=site_r8, hlms='CLM:ALM', flushval=hlm_hio_ignore_val, upfreq=1, & + ivar=ivar, initialize=initialize_variables, index = ih_gdd_si) + + call this%set_history_var(vname='SITE_NCHILLDAYS', units = 'days', & + long='site level number of chill days', & + use_default='active', & + avgflag='A', vtype=site_r8, hlms='CLM:ALM', flushval=hlm_hio_ignore_val, upfreq=1, & + ivar=ivar, initialize=initialize_variables, index = ih_site_nchilldays_si) + + call this%set_history_var(vname='SITE_NCOLDDAYS', units = 'days', & + long='site level number of cold days', & + use_default='active', & + avgflag='A', vtype=site_r8, hlms='CLM:ALM', flushval=hlm_hio_ignore_val, upfreq=1, & + ivar=ivar, initialize=initialize_variables, index = ih_site_ncolddays_si) + + call this%set_history_var(vname='SITE_DAYSINCE_COLDLEAFOFF', units='days', & + long='site level days elapsed since cold leaf drop', & + use_default='active', & + avgflag='A', vtype=site_r8, hlms='CLM:ALM', flushval=hlm_hio_ignore_val, upfreq=1, & + ivar=ivar, initialize=initialize_variables, index = ih_cleafoff_si) + + call this%set_history_var(vname='SITE_DAYSINCE_COLDLEAFON', units='days', & + long='site level days elapsed since cold leaf flush', & + use_default='active', & + avgflag='A', vtype=site_r8, hlms='CLM:ALM', flushval=hlm_hio_ignore_val, upfreq=1, & + ivar=ivar, initialize=initialize_variables, index = ih_cleafon_si) + + call this%set_history_var(vname='SITE_DAYSINCE_DROUGHTLEAFOFF', units='days', & + long='site level days elapsed since drought leaf drop', & + use_default='active', & + avgflag='A', vtype=site_r8, hlms='CLM:ALM', flushval=hlm_hio_ignore_val, upfreq=1, & + ivar=ivar, initialize=initialize_variables, index = ih_dleafoff_si) + + call this%set_history_var(vname='SITE_DAYSINCE_DROUGHTLEAFON', units='days', & + long='site level days elapsed since drought leaf flush', & + use_default='active', & + avgflag='A', vtype=site_r8, hlms='CLM:ALM', flushval=hlm_hio_ignore_val, upfreq=1, & + ivar=ivar, initialize=initialize_variables, index = ih_dleafon_si) + + call this%set_history_var(vname='SITE_MEANLIQVOL_DROUGHTPHEN', units='m3/m3', & + long='site level mean liquid water volume for drought phen', & + use_default='active', & + avgflag='A', vtype=site_r8, hlms='CLM:ALM', flushval=hlm_hio_ignore_val, upfreq=1, & + ivar=ivar, initialize=initialize_variables, index = ih_meanliqvol_si) + call this%set_history_var(vname='CANOPY_SPREAD', units='0-1', & long='Scaling factor between tree basal area and canopy area', & use_default='active', & diff --git a/main/FatesHistoryVariableType.F90 b/main/FatesHistoryVariableType.F90 index 07b24176f4..8bdc5b2442 100644 --- a/main/FatesHistoryVariableType.F90 +++ b/main/FatesHistoryVariableType.F90 @@ -21,8 +21,8 @@ module FatesHistoryVariableType integer :: upfreq ! Update frequency (this is for checks and flushing) ! 1 = dynamics "dyn" (daily) ! 2 = production "prod" (prob model tstep) - real(r8) :: flushval - integer :: dim_kinds_index + real(r8) :: flushval + integer :: dim_kinds_index ! Pointers (only one of these is allocated per variable) real(r8), pointer :: r81d(:) real(r8), pointer :: r82d(:,:) diff --git a/main/FatesInventoryInitMod.F90 b/main/FatesInventoryInitMod.F90 index 4de1931b5c..e7d45f1708 100644 --- a/main/FatesInventoryInitMod.F90 +++ b/main/FatesInventoryInitMod.F90 @@ -37,6 +37,10 @@ module FatesInventoryInitMod use EDTypesMod , only : equal_leaf_aclass use EDTypesMod , only : leaves_on use EDTypesMod , only : leaves_off + use EDTypesMod , only : phen_cstat_nevercold + use EDTypesMod , only : phen_cstat_iscold + use EDTypesMod , only : phen_dstat_timeoff + use EDTypesMod , only : phen_dstat_moistoff use EDPftvarcon , only : EDPftvarcon_inst use FatesConstantsMod, only : primaryforest @@ -898,7 +902,6 @@ subroutine set_inventory_edcohort_type1(csite,bc_in,css_file_unit,npatches, & ! use of the allometry functions ! Don't need to allocate leaf age classes (not used) - if (c_pft .ne. 0 ) then ! normal case: assign each cohort to its specified PFT temp_cohort%pft = c_pft @@ -936,13 +939,16 @@ subroutine set_inventory_edcohort_type1(csite,bc_in,css_file_unit,npatches, & temp_cohort%laimemory = 0._r8 cstatus = leaves_on - if( EDPftvarcon_inst%season_decid(temp_cohort%pft) == itrue .and. csite%is_cold ) then + + if( EDPftvarcon_inst%season_decid(temp_cohort%pft) == itrue .and. & + any(csite%cstatus == [phen_cstat_nevercold,phen_cstat_iscold])) then temp_cohort%laimemory = b_leaf b_leaf = 0._r8 cstatus = leaves_off endif - - if ( EDPftvarcon_inst%stress_decid(temp_cohort%pft) == itrue .and. csite%is_drought ) then + + if ( EDPftvarcon_inst%stress_decid(temp_cohort%pft) == itrue .and. & + any(csite%dstatus == [phen_dstat_timeoff,phen_dstat_moistoff])) then temp_cohort%laimemory = b_leaf b_leaf = 0._r8 cstatus = leaves_off diff --git a/main/FatesRestartInterfaceMod.F90 b/main/FatesRestartInterfaceMod.F90 index 4dc9969e24..4129136ef5 100644 --- a/main/FatesRestartInterfaceMod.F90 +++ b/main/FatesRestartInterfaceMod.F90 @@ -70,6 +70,7 @@ module FatesRestartInterfaceMod integer, private :: ir_cd_status_si integer, private :: ir_dd_status_si integer, private :: ir_nchill_days_si + integer, private :: ir_ncold_days_si integer, private :: ir_leafondate_si integer, private :: ir_leafoffdate_si integer, private :: ir_dleafondate_si @@ -147,6 +148,7 @@ module FatesRestartInterfaceMod ! Site level integer, private :: ir_watermem_siwm + integer, private :: ir_vegtempmem_sitm integer, private :: ir_seed_bank_sift integer, private :: ir_spread_si integer, private :: ir_recrate_sift @@ -566,24 +568,28 @@ subroutine define_restart_vars(this, initialize_variables) long_name='status flag for drought deciduous plants', units='unitless', flushval = flushinvalid, & hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_dd_status_si ) - call this%set_restart_var(vname='fates_chilling_days', vtype=site_r8, & - long_name='chilling day counter', units='unitless', flushval = flushzero, & + call this%set_restart_var(vname='fates_chilling_days', vtype=site_int, & + long_name='chilling day counter', units='unitless', flushval = flushinvalid, & hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_nchill_days_si ) - call this%set_restart_var(vname='fates_leafondate', vtype=site_r8, & - long_name='the day of year for leaf on', units='day of year', flushval = flushzero, & + call this%set_restart_var(vname='fates_cold_days', vtype=site_int, & + long_name='cold day counter', units='unitless', flushval = flushinvalid, & + hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_ncold_days_si ) + + call this%set_restart_var(vname='fates_leafondate', vtype=site_int, & + long_name='the day of year for leaf on', units='day of year', flushval = flushinvalid, & hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_leafondate_si ) - call this%set_restart_var(vname='fates_leafoffdate', vtype=site_r8, & - long_name='the day of year for leaf off', units='day of year', flushval = flushzero, & + call this%set_restart_var(vname='fates_leafoffdate', vtype=site_int, & + long_name='the day of year for leaf off', units='day of year', flushval = flushinvalid, & hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_leafoffdate_si ) - call this%set_restart_var(vname='fates_drought_leafondate', vtype=site_r8, & - long_name='the day of year for drought based leaf-on', units='day of year', flushval = flushzero, & + call this%set_restart_var(vname='fates_drought_leafondate', vtype=site_int, & + long_name='the day of year for drought based leaf-on', units='day of year', flushval = flushinvalid, & hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_dleafondate_si ) - call this%set_restart_var(vname='fates_drought_leafoffdate', vtype=site_r8, & - long_name='the day of year for drought based leaf-off', units='day of year', flushval = flushzero, & + call this%set_restart_var(vname='fates_drought_leafoffdate', vtype=site_int, & + long_name='the day of year for drought based leaf-off', units='day of year', flushval = flushinvalid, & hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_dleafoffdate_si ) call this%set_restart_var(vname='fates_acc_nesterov_id', vtype=site_r8, & @@ -981,6 +987,10 @@ subroutine define_restart_vars(this, initialize_variables) units='m3/m3', flushval = flushzero, & hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_watermem_siwm ) + call this%set_restart_var(vname='fates_vegtemp_memory', vtype=cohort_r8, & + long_name='last 10 days of 24-hour vegetation temperature, by site x day-index', & + units='m3/m3', flushval = flushzero, & + hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_vegtempmem_sitm ) call this%set_restart_var(vname='fates_recrate', vtype=cohort_r8, & long_name='fates diagnostics on recruitment', & @@ -1394,6 +1404,7 @@ subroutine set_restart_vectors(this,nc,nsites,sites) use EDTypesMod, only : ncwd use EDTypesMod, only : maxSWb use EDTypesMod, only : numWaterMem + use EDTypesMod, only : num_vegtemp_mem ! Arguments class(fates_restart_interface_type) :: this @@ -1422,6 +1433,7 @@ subroutine set_restart_vectors(this,nc,nsites,sites) integer :: io_idx_si_lyr_shell ! site - layer x shell index integer :: io_idx_si_scpf ! each size-class x pft index within site integer :: io_idx_si_sc ! each size-class index within site + integer :: io_idx_si_vtmem ! indices for veg-temp memory at site ! Some counters (for checking mostly) integer :: totalcohorts ! total cohort count on this thread (diagnostic) @@ -1442,14 +1454,15 @@ subroutine set_restart_vectors(this,nc,nsites,sites) associate( rio_npatch_si => this%rvars(ir_npatch_si)%int1d, & - rio_old_stock_si => this%rvars(ir_oldstock_si)%r81d, & + rio_old_stock_si => this%rvars(ir_oldstock_si)%r81d, & rio_cd_status_si => this%rvars(ir_cd_status_si)%int1d, & rio_dd_status_si => this%rvars(ir_dd_status_si)%int1d, & - rio_nchill_days_si => this%rvars(ir_nchill_days_si)%r81d, & - rio_leafondate_si => this%rvars(ir_leafondate_si)%r81d, & - rio_leafoffdate_si => this%rvars(ir_leafoffdate_si)%r81d, & - rio_dleafondate_si => this%rvars(ir_dleafondate_si)%r81d, & - rio_dleafoffdate_si => this%rvars(ir_dleafoffdate_si)%r81d, & + rio_nchill_days_si => this%rvars(ir_nchill_days_si)%int1d, & + rio_ncold_days_si => this%rvars(ir_ncold_days_si)%int1d, & + rio_leafondate_si => this%rvars(ir_leafondate_si)%int1d, & + rio_leafoffdate_si => this%rvars(ir_leafoffdate_si)%int1d, & + rio_dleafondate_si => this%rvars(ir_dleafondate_si)%int1d, & + rio_dleafoffdate_si => this%rvars(ir_dleafoffdate_si)%int1d, & rio_acc_ni_si => this%rvars(ir_acc_ni_si)%r81d, & rio_gdd_si => this%rvars(ir_gdd_si)%r81d, & rio_nep_timeintegrated_si => this%rvars(ir_nep_timeintegrated_si)%r81d, & @@ -1511,6 +1524,7 @@ subroutine set_restart_vectors(this,nc,nsites,sites) rio_agesinceanthrodist_pa => this%rvars(ir_agesinceanthrodist_pa)%r81d, & rio_area_pa => this%rvars(ir_area_pa)%r81d, & rio_watermem_siwm => this%rvars(ir_watermem_siwm)%r81d, & + rio_vegtempmem_sitm => this%rvars(ir_vegtempmem_sitm)%r81d, & rio_recrate_sift => this%rvars(ir_recrate_sift)%r81d, & rio_fmortrate_cano_siscpf => this%rvars(ir_fmortrate_cano_siscpf)%r81d, & rio_fmortrate_usto_siscpf => this%rvars(ir_fmortrate_usto_siscpf)%r81d, & @@ -1554,6 +1568,7 @@ subroutine set_restart_vectors(this,nc,nsites,sites) io_idx_pa_cwd = io_idx_co_1st io_idx_pa_ib = io_idx_co_1st io_idx_si_wmem = io_idx_co_1st + io_idx_si_vtmem = io_idx_co_1st ! Hydraulics counters lyr = hydraulic layer, shell = rhizosphere shell @@ -1803,28 +1818,17 @@ subroutine set_restart_vectors(this,nc,nsites,sites) rio_fmortcflux_cano_si(io_idx_si) = sites(s)%fmort_carbonflux_canopy rio_fmortcflux_usto_si(io_idx_si) = sites(s)%fmort_carbonflux_ustory - - rio_old_stock_si(io_idx_si) = sites(s)%old_stock - - if(sites(s)%is_cold) then - rio_cd_status_si(io_idx_si) = itrue - else - rio_cd_status_si(io_idx_si) = ifalse - end if - if(sites(s)%is_drought) then - rio_dd_status_si(io_idx_si) = itrue - else - rio_dd_status_si(io_idx_si) = ifalse - end if - - rio_nchill_days_si(io_idx_si) = sites(s)%ncd - rio_leafondate_si(io_idx_si) = sites(s)%leafondate - rio_leafoffdate_si(io_idx_si) = sites(s)%leafoffdate + rio_cd_status_si(io_idx_si) = sites(s)%cstatus + rio_dd_status_si(io_idx_si) = sites(s)%dstatus + rio_nchill_days_si(io_idx_si) = sites(s)%nchilldays + rio_ncold_days_si(io_idx_si) = sites(s)%ncolddays + rio_leafondate_si(io_idx_si) = sites(s)%cleafondate + rio_leafoffdate_si(io_idx_si) = sites(s)%cleafoffdate rio_dleafondate_si(io_idx_si) = sites(s)%dleafondate rio_dleafoffdate_si(io_idx_si) = sites(s)%dleafoffdate rio_acc_ni_si(io_idx_si) = sites(s)%acc_NI - rio_gdd_si(io_idx_si) = sites(s)%ED_GDD_site + rio_gdd_si(io_idx_si) = sites(s)%grow_deg_days ! Carbon Balance and Checks rio_nep_timeintegrated_si(io_idx_si) = sites(s)%nep_timeintegrated @@ -1851,6 +1855,11 @@ subroutine set_restart_vectors(this,nc,nsites,sites) io_idx_si_wmem = io_idx_si_wmem + 1 end do + do i = 1, num_vegtemp_mem + rio_vegtempmem_sitm( io_idx_si_vtmem ) = sites(s)%vegtemp_memory(i) + io_idx_si_vtmem = io_idx_si_vtmem + 1 + end do + ! ----------------------------------------------------------------------------- ! Set site-level hydraulics arrays ! ----------------------------------------------------------------------------- @@ -1970,13 +1979,6 @@ subroutine create_patchcohort_structure(this, nc, nsites, sites, bc_in) call init_site_vars( sites(s) ) call zero_site( sites(s) ) - ! - ! set a few items that are necessary on restart for ED but not on the - ! restart file - ! - - sites(s)%ncd = 0.0_r8 - if ( rio_npatch_si(io_idx_si)<0 .or. rio_npatch_si(io_idx_si) > 10000 ) then write(fates_log(),*) 'a column was expected to contain a valid number of patches' write(fates_log(),*) '0 is a valid number, but this column seems uninitialized',rio_npatch_si(io_idx_si) @@ -2107,6 +2109,7 @@ subroutine get_restart_vectors(this, nc, nsites, sites) use FatesInterfaceMod, only : numpft use FatesInterfaceMod, only : fates_maxElementsPerPatch use EDTypesMod, only : numWaterMem + use EDTypesMod, only : num_vegtemp_mem use FatesSizeAgeTypeIndicesMod, only : get_age_class_index ! !ARGUMENTS: @@ -2140,6 +2143,7 @@ subroutine get_restart_vectors(this, nc, nsites, sites) integer :: io_idx_pa_cwd ! each cwd class within each patch (pa_cwd) integer :: io_idx_pa_ib ! each SW radiation band per patch (pa_ib) integer :: io_idx_si_wmem ! each water memory class within each site + integer :: io_idx_si_vtmem ! counter for vegetation temp memory integer :: io_idx_si_lyr_shell ! site - layer x shell index integer :: io_idx_si_scpf ! each size-class x pft index within site integer :: io_idx_si_sc ! each size-class index within site @@ -2158,11 +2162,12 @@ subroutine get_restart_vectors(this, nc, nsites, sites) rio_old_stock_si => this%rvars(ir_oldstock_si)%r81d, & rio_cd_status_si => this%rvars(ir_cd_status_si)%int1d, & rio_dd_status_si => this%rvars(ir_dd_status_si)%int1d, & - rio_nchill_days_si => this%rvars(ir_nchill_days_si)%r81d, & - rio_leafondate_si => this%rvars(ir_leafondate_si)%r81d, & - rio_leafoffdate_si => this%rvars(ir_leafoffdate_si)%r81d, & - rio_dleafondate_si => this%rvars(ir_dleafondate_si)%r81d, & - rio_dleafoffdate_si => this%rvars(ir_dleafoffdate_si)%r81d, & + rio_nchill_days_si => this%rvars(ir_nchill_days_si)%int1d, & + rio_ncold_days_si => this%rvars(ir_ncold_days_si)%int1d, & + rio_leafondate_si => this%rvars(ir_leafondate_si)%int1d, & + rio_leafoffdate_si => this%rvars(ir_leafoffdate_si)%int1d, & + rio_dleafondate_si => this%rvars(ir_dleafondate_si)%int1d, & + rio_dleafoffdate_si => this%rvars(ir_dleafoffdate_si)%int1d, & rio_acc_ni_si => this%rvars(ir_acc_ni_si)%r81d, & rio_gdd_si => this%rvars(ir_gdd_si)%r81d, & rio_nep_timeintegrated_si => this%rvars(ir_nep_timeintegrated_si)%r81d, & @@ -2224,6 +2229,7 @@ subroutine get_restart_vectors(this, nc, nsites, sites) rio_agesinceanthrodist_pa => this%rvars(ir_agesinceanthrodist_pa)%r81d, & rio_area_pa => this%rvars(ir_area_pa)%r81d, & rio_watermem_siwm => this%rvars(ir_watermem_siwm)%r81d, & + rio_vegtempmem_sitm => this%rvars(ir_vegtempmem_sitm)%r81d, & rio_recrate_sift => this%rvars(ir_recrate_sift)%r81d, & rio_fmortrate_cano_siscpf => this%rvars(ir_fmortrate_cano_siscpf)%r81d, & rio_fmortrate_usto_siscpf => this%rvars(ir_fmortrate_usto_siscpf)%r81d, & @@ -2256,6 +2262,7 @@ subroutine get_restart_vectors(this, nc, nsites, sites) io_idx_pa_cwd = io_idx_co_1st io_idx_pa_ib = io_idx_co_1st io_idx_si_wmem = io_idx_co_1st + io_idx_si_vtmem = io_idx_co_1st ! Hydraulics counters lyr = hydraulic layer, shell = rhizosphere shell io_idx_si_lyr_shell = io_idx_co_1st @@ -2486,6 +2493,11 @@ subroutine get_restart_vectors(this, nc, nsites, sites) io_idx_si_wmem = io_idx_si_wmem + 1 end do + do i = 1, num_vegtemp_mem + sites(s)%vegtemp_memory(i) = rio_vegtempmem_sitm( io_idx_si_vtmem ) + io_idx_si_vtmem = io_idx_si_vtmem + 1 + end do + ! ----------------------------------------------------------------------------- ! Retrieve site-level hydraulics arrays ! Note that Hydraulics structures, their allocations, and the length @@ -2550,34 +2562,17 @@ subroutine get_restart_vectors(this, nc, nsites, sites) sites(s)%old_stock = rio_old_stock_si(io_idx_si) ! Site level phenology status flags - if(rio_cd_status_si(io_idx_si) .eq. itrue) then - sites(s)%is_cold = .true. - elseif(rio_cd_status_si(io_idx_si) .eq. ifalse) then - sites(s)%is_cold = .false. - else - write(fates_log(),*) 'An invalid site level cold stress status was found' - write(fates_log(),*) 'io_idx_si = ',io_idx_si - write(fates_log(),*) 'rio_cd_status_si(io_idx_si) = ',rio_cd_status_si(io_idx_si) - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - if(rio_dd_status_si(io_idx_si) .eq. itrue)then - sites(s)%is_drought = .true. - elseif(rio_dd_status_si(io_idx_si) .eq. ifalse) then - sites(s)%is_drought = .false. - else - write(fates_log(),*) 'An invalid site level drought stress status was found' - write(fates_log(),*) 'io_idx_si = ',io_idx_si - write(fates_log(),*) 'rio_dd_status_si(io_idx_si) = ',rio_dd_status_si(io_idx_si) - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - sites(s)%ncd = rio_nchill_days_si(io_idx_si) - sites(s)%leafondate = rio_leafondate_si(io_idx_si) - sites(s)%leafoffdate = rio_leafoffdate_si(io_idx_si) + sites(s)%cstatus = rio_cd_status_si(io_idx_si) + sites(s)%dstatus = rio_dd_status_si(io_idx_si) + sites(s)%nchilldays = rio_nchill_days_si(io_idx_si) + sites(s)%ncolddays = rio_ncold_days_si(io_idx_si) + sites(s)%cleafondate = rio_leafondate_si(io_idx_si) + sites(s)%cleafoffdate = rio_leafoffdate_si(io_idx_si) sites(s)%dleafondate = rio_dleafondate_si(io_idx_si) sites(s)%dleafoffdate = rio_dleafoffdate_si(io_idx_si) sites(s)%acc_NI = rio_acc_ni_si(io_idx_si) - sites(s)%ED_GDD_site = rio_gdd_si(io_idx_si) + sites(s)%grow_deg_days = rio_gdd_si(io_idx_si) ! Carbon Balance and Checks sites(s)%nep_timeintegrated = rio_nep_timeintegrated_si(io_idx_si) diff --git a/parameter_files/fates_params_default.cdl b/parameter_files/fates_params_default.cdl index bebbe3f720..39787c469f 100644 --- a/parameter_files/fates_params_default.cdl +++ b/parameter_files/fates_params_default.cdl @@ -649,7 +649,7 @@ data: fates_phen_b = 638 ; - fates_phen_c = -0.001 ; + fates_phen_c = -0.01 ; fates_phen_chiltemp = 5 ;