Skip to content

Commit d22471c

Browse files
committed
corrected hardtemp
1 parent 41f352e commit d22471c

File tree

5 files changed

+95
-14
lines changed

5 files changed

+95
-14
lines changed

biogeochem/EDMortalityFunctionsMod.F90

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,9 @@ subroutine Hardening_scheme(currentSite,currentPatch,cohort_in,bc_in ) !marius
407407
rate_dh=(Tmean-2.5_r8)*((max_h_dehard-min_h)/-62.22_r8)
408408
end if
409409
end if
410-
410+
411411
dayl_thresh= 42000.0_r8 + ( (-30.0_r8 - max(-60.0_r8,min(0.0_r8,currentSite%hardtemp)) )/15.0_r8) * 4500.0_r8
412+
!write(fates_log(),*) hlm_current_year,hlm_current_month,hlm_current_day,'hardtemp',currentSite%hardtemp
412413
!================================================
413414
!Hardening calculation
414415
cohort_in%hard_level_prev = cohort_in%hard_level
@@ -420,21 +421,23 @@ subroutine Hardening_scheme(currentSite,currentPatch,cohort_in,bc_in ) !marius
420421
else if (cohort_in%hard_level_prev < target_h) then
421422
cohort_in%hard_level = cohort_in%hard_level_prev + rate_dh
422423
end if
423-
424+
!write(fates_log(),*) hlm_current_year,hlm_current_month,hlm_current_day,'thresh',dayl_thresh,'dayl',bc_in%dayl_si,'prev dayl',bc_in%prev_dayl_si
424425
if (bc_in%dayl_si <= dayl_thresh .and. bc_in%dayl_si < bc_in%prev_dayl_si) then ! prev: 46260._r8
425426
if (cohort_in%hard_level_prev >= target_h) then
426427
cohort_in%hard_level = cohort_in%hard_level_prev - rate_h
427428
else
428429
cohort_in%hard_level = cohort_in%hard_level_prev ! now dehardening is not possible in autumn but the hardiness level is also allowed to remain steady
429430
end if
431+
!write(fates_log(),*) hlm_current_year,hlm_current_month,hlm_current_day,'hard_prev',cohort_in%hard_level_prev,'target',target_h,'rate',rate_h
430432
else if (bc_in%dayl_si > dayl_thresh .and. bc_in%dayl_si < bc_in%prev_dayl_si) then
431433
cohort_in%hard_level = min_h
432434
end if
433435
ipft = cohort_in%pft
434-
!if (prt_params%season_decid(ipft) == itrue .and. cohort_in%status_coh == leaves_on .and. bc_in%dayl_si > bc_in%prev_dayl_si .and. &
435-
! (nint(hlm_model_day) >= currentSite%cleafondate .or. nint(hlm_model_day) >= currentSite%dleafondate)) then
436-
! cohort_in%hard_level = min_h
437-
!end if
436+
if (prt_params%season_decid(ipft) == itrue .and. cohort_in%status_coh == leaves_on .and. bc_in%dayl_si > bc_in%prev_dayl_si .and. &
437+
(nint(hlm_model_day) >= currentSite%cleafondate .or. nint(hlm_model_day) >= currentSite%dleafondate)) then
438+
cohort_in%hard_level = min_h
439+
!write(fates_log(),*) hlm_current_year,hlm_current_month,hlm_current_day,'leaves_on'
440+
end if
438441
if (cohort_in%hard_level > min_h) then
439442
cohort_in%hard_level = min_h
440443
end if

biogeochem/EDPhysiologyMod.F90

Lines changed: 67 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module EDPhysiologyMod
1313
use FatesInterfaceTypesMod, only : hlm_day_of_year
1414
use FatesInterfaceTypesMod, only : numpft
1515
use FatesInterfaceTypesMod, only : nleafage
16-
use FatesInterfaceTypesMod, only : hlm_use_planthydro
16+
use FatesInterfaceTypesMod, only : hlm_use_planthydro,hlm_use_hydrohard
1717
use FatesInterfaceTypesMod, only : hlm_parteh_mode
1818
use FatesInterfaceTypesMod, only : hlm_use_fixed_biogeog
1919
use FatesInterfaceTypesMod, only : hlm_use_nocomp
@@ -1108,11 +1108,11 @@ subroutine phenology_leafonoff(currentSite)
11081108
! COLD LEAF ON
11091109
! The site level flags signify that it is no-longer too cold
11101110
! for leaves. Time to signal flushing
1111-
11121111
if (prt_params%season_decid(ipft) == itrue)then
1112+
if (hlm_use_hydrohard .eq. itrue) then
11131113
if ( currentSite%cstatus == phen_cstat_notcold )then ! we have just moved to leaves being on .
1114-
!max_h=min(max(EDPftvarcon_inst%freezetol(currentCohort%pft),max(currentSite%hardtemp,-60._r8)-10._r8),-2._r8)
1115-
!if ( currentSite%hard_level2(ipft) > max_h/2._r8)then ! we have just moved to leaves being on . marius
1114+
max_h=min(max(EDPftvarcon_inst%freezetol(currentCohort%pft),max(currentSite%hardtemp,-60._r8)-10._r8),-2._r8)
1115+
if ( currentSite%hard_level2(ipft) > max_h/2._r8)then ! we have just moved to leaves being on . marius
11161116
if (currentCohort%status_coh == leaves_off)then ! Are the leaves currently off?
11171117
currentCohort%status_coh = leaves_on ! Leaves are on, so change status to
11181118
! stop flow of carbon out of bstore.
@@ -1168,8 +1168,70 @@ subroutine phenology_leafonoff(currentSite)
11681168

11691169
endif
11701170
endif !pft phenology
1171-
!endif !marius
1171+
endif !marius
11721172
endif ! growing season
1173+
else !marius
1174+
if ( currentSite%cstatus == phen_cstat_notcold )then ! we have just moved to leaves being on .
1175+
if (currentCohort%status_coh == leaves_off)then ! Are the leaves currently off?
1176+
currentCohort%status_coh = leaves_on ! Leaves are on, so change status to
1177+
! stop flow of carbon out of bstore.
1178+
1179+
if(store_c>nearzero) then
1180+
! flush either the amount required from the laimemory, or -most- of the storage pool
1181+
! RF: added a criterion to stop the entire store pool emptying and triggering termination mortality
1182+
! n.b. this might not be necessary if we adopted a more gradual approach to leaf flushing...
1183+
store_c_transfer_frac = min((EDPftvarcon_inst%phenflush_fraction(ipft)* &
1184+
currentCohort%laimemory)/store_c,(1.0_r8-carbon_store_buffer))
1185+
1186+
if(prt_params%woody(ipft).ne.itrue)then
1187+
totalmemory=currentCohort%laimemory+currentCohort%sapwmemory+currentCohort%structmemory
1188+
store_c_transfer_frac = min((EDPftvarcon_inst%phenflush_fraction(ipft)* &
1189+
totalmemory)/store_c, (1.0_r8-carbon_store_buffer))
1190+
endif
1191+
1192+
else
1193+
store_c_transfer_frac = 0.0_r8
1194+
end if
1195+
1196+
! This call will request that storage carbon will be transferred to
1197+
! leaf tissues. It is specified as a fraction of the available storage
1198+
if(prt_params%woody(ipft) == itrue) then
1199+
1200+
call PRTPhenologyFlush(currentCohort%prt, ipft, leaf_organ, store_c_transfer_frac)
1201+
currentCohort%laimemory = 0.0_r8
1202+
1203+
else
1204+
1205+
! Check that the stem drop fraction is set to non-zero amount otherwise flush all carbon store to leaves
1206+
if (stem_drop_fraction .gt. 0.0_r8) then
1207+
1208+
call PRTPhenologyFlush(currentCohort%prt, ipft, leaf_organ, &
1209+
store_c_transfer_frac*currentCohort%laimemory/totalmemory)
1210+
1211+
call PRTPhenologyFlush(currentCohort%prt, ipft, sapw_organ, &
1212+
store_c_transfer_frac*currentCohort%sapwmemory/totalmemory)
1213+
1214+
call PRTPhenologyFlush(currentCohort%prt, ipft, struct_organ, &
1215+
store_c_transfer_frac*currentCohort%structmemory/totalmemory)
1216+
1217+
else
1218+
1219+
call PRTPhenologyFlush(currentCohort%prt, ipft, leaf_organ, &
1220+
store_c_transfer_frac)
1221+
1222+
end if
1223+
1224+
currentCohort%laimemory = 0.0_r8
1225+
currentCohort%structmemory = 0.0_r8
1226+
currentCohort%sapwmemory = 0.0_r8
1227+
1228+
endif
1229+
endif !pft phenology
1230+
endif ! growing season
1231+
endif !marius
1232+
1233+
1234+
11731235

11741236
!COLD LEAF OFF
11751237
if (currentSite%cstatus == phen_cstat_nevercold .or. &

biogeophys/FatesPlantHydraulicsMod.F90

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2549,6 +2549,7 @@ subroutine hydraulics_bc ( nsites, sites, bc_in, bc_out, dtime)
25492549

25502550
! Zero out diagnotsics that rely on accumulation
25512551
csite_hydr%sapflow_scpf(:,:) = 0._r8
2552+
csite_hydr%rootuptake_scpf(:,:) = 0._r8
25522553
csite_hydr%rootuptake_sl(:) = 0._r8
25532554
csite_hydr%rootuptake0_scpf(:,:) = 0._r8
25542555
csite_hydr%rootuptake10_scpf(:,:) = 0._r8
@@ -2730,6 +2731,9 @@ subroutine hydraulics_bc ( nsites, sites, bc_in, bc_out, dtime)
27302731
! These are normalized by depth (in case the desired horizon extends
27312732
! beyond the actual rhizosphere)
27322733

2734+
csite_hydr%rootuptake_scpf(sc,ft) = csite_hydr%rootuptake_scpf(sc,ft) + & !marius
2735+
SumBetweenDepths(csite_hydr,0._r8,1.e10_r8,rootuptake(1:nlevrhiz))*ccohort%n/dtime
2736+
27332737
csite_hydr%rootuptake0_scpf(sc,ft) = csite_hydr%rootuptake0_scpf(sc,ft) + &
27342738
SumBetweenDepths(csite_hydr,0._r8,0.1_r8,rootuptake(1:nlevrhiz))*ccohort%n/dtime
27352739

main/EDMainMod.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,10 +345,10 @@ subroutine ed_integrate_state_variables(currentSite, bc_in, bc_out )
345345
if (hlm_use_hydrohard.eq.itrue .or. hlm_use_frosthard.eq.itrue) then
346346
currentSite%Tmin_24_fates=bc_in%tmin24_si-273.15_r8
347347
if (nint(hlm_model_day)>=366) then
348-
write(fates_log(),*) '5yrmean was taken'
348+
write(fates_log(),*) '5yrmean was taken',bc_in%t_mean_5yr_si,bc_in%t_min_yr_inst_si
349349
currentSite%hardtemp=bc_in%t_mean_5yr_si-273.15_r8
350350
else if (nint(hlm_model_day)<366) then
351-
write(fates_log(),*) 'minyrinst was taken'
351+
!write(fates_log(),*) 'minyrinst was taken'
352352
currentSite%hardtemp=bc_in%t_min_yr_inst_si-273.15_r8
353353
end if
354354
currentPatch => currentSite%youngest_patch

main/FatesHistoryInterfaceMod.F90

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,8 @@ module FatesHistoryInterfaceMod
574574
integer :: ih_hard_level2_si_pft
575575
integer :: ih_hardlevel_si_pft !marius
576576
integer :: ih_Tmin_24_fates_si !marius
577-
577+
integer :: ih_lai_canopy_si_scpf
578+
578579
! Hydro: Soil water states
579580
integer :: ih_rootwgt_soilvwc_si
580581
integer :: ih_rootwgt_soilvwcsat_si
@@ -2028,6 +2029,7 @@ subroutine update_history_dyn(this,nc,nsites,sites)
20282029
hio_hardtemp_si => this%hvars(ih_hardtemp_si)%r81d, & !marius
20292030
hio_hard_level2_si_pft => this%hvars(ih_hard_level2_si_pft)%r82d, &
20302031
hio_Tmin_24_fates_si => this%hvars(ih_Tmin_24_fates_si)%r81d, & !marius
2032+
hio_lai_canopy_si_scpf => this%hvars(ih_lai_canopy_si_scpf)%r82d, &
20312033
hio_site_ncolddays_si => this%hvars(ih_site_ncolddays_si)%r81d, &
20322034
hio_site_nchilldays_si => this%hvars(ih_site_nchilldays_si)%r81d, &
20332035
hio_cleafoff_si => this%hvars(ih_cleafoff_si)%r81d, &
@@ -2688,6 +2690,8 @@ subroutine update_history_dyn(this,nc,nsites,sites)
26882690
store_m * ccohort%n / m2_per_ha
26892691
hio_bleaf_canopy_si_scpf(io_si,scpf) = hio_bleaf_canopy_si_scpf(io_si,scpf) + &
26902692
leaf_m * ccohort%n / m2_per_ha
2693+
hio_lai_canopy_si_scpf(io_si,scpf) = hio_lai_canopy_si_scpf(io_si,scpf) + &
2694+
ccohort%treelai*ccohort%c_area * AREA_INV
26912695

26922696
hio_canopy_biomass_si(io_si) = hio_canopy_biomass_si(io_si) + n_perm2 * total_m
26932697

@@ -5881,6 +5885,14 @@ subroutine define_history_vars(this, initialize_variables)
58815885
ivar=ivar, initialize=initialize_variables, &
58825886
index = ih_bleaf_canopy_si_scpf)
58835887

5888+
call this%set_history_var(vname='FATES_LAI_CANOPY_SZPF', &
5889+
units = 'm2 m-2', &
5890+
long='Leaf area index (LAI) of canopy plants by pft/size', &
5891+
use_default='active', &
5892+
avgflag='A', vtype=site_size_pft_r8, hlms='CLM:ALM', upfreq=1, &
5893+
ivar=ivar, initialize=initialize_variables, &
5894+
index = ih_lai_canopy_si_scpf )
5895+
58845896
call this%set_history_var(vname='FATES_NPLANT_CANOPY_SZPF', units = 'm-2', &
58855897
long='number of canopy plants by size/pft per m2', &
58865898
use_default='inactive', avgflag='A', vtype=site_size_pft_r8, &

0 commit comments

Comments
 (0)