Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
ee61a5c
Temporary commit so I can fix a bug in another pull request.
mpaiao Apr 15, 2025
f85016c
Updated several site-level variables related to cold-deciduous phenol…
mpaiao Apr 15, 2025
759b041
This commit turns several variables and parameters associated with se…
mpaiao Apr 17, 2025
f3d6b7f
Remove code that handled formerly global cold deciduous parameters fr…
mpaiao Apr 17, 2025
93d9c63
Fixed names for a few variables in FatesHistoryInterfaceMod.F90
mpaiao Apr 17, 2025
2c4aa4e
Fix missing multiline command marker
mpaiao Apr 17, 2025
c128df9
Fix typo in PRTParamsFATESMod.F90
mpaiao Apr 17, 2025
64f8d7d
Fix typo in the loop name.
mpaiao Apr 18, 2025
4017659
Reverted incorrect update to phenology date, which is not defined by …
mpaiao Apr 18, 2025
4cd9cee
Merge branch 'main' into mpaiao-pr-colddecid-pft
mpaiao Apr 18, 2025
0b93526
Consolidate phenological variables to a single set that can be used b…
mpaiao Apr 20, 2025
cf31b9a
Fix typo
mpaiao Apr 20, 2025
4a67b43
Refactor: Per-age outputs, in existing subroutines.
samsrabin Jul 17, 2024
0343d42
Refactor: Age-class vars to update_history_hifrq2_ageclass().
samsrabin Sep 10, 2024
81654c3
Refactor: Age-class vars to update_history_dyn2_ageclass().
samsrabin Sep 10, 2024
f2bc4af
Bugfix: Add logging mortality to _SZAP outputs.
samsrabin Oct 3, 2024
bf79750
Add non-per-ageclass versions of some history vars.
samsrabin Sep 17, 2024
0cdc1a6
Change 7 hist vars to not be normalized to age-class area.
samsrabin Oct 2, 2024
3aec87c
Bugfix: Update FATES_VEGC_APPF even if cohort is new.
samsrabin Oct 2, 2024
9433de7
Bugfix: Add termination mortality to _SZAP outputs.
samsrabin Oct 3, 2024
3786757
Add postprocessing info to per-ageclass outputs.
samsrabin Oct 13, 2024
5abf19c
Cleanup: update_history_dyn2_ageclass().
samsrabin Oct 13, 2024
1033569
Cleanup: update_history_hifrq2_ageclass().
samsrabin Oct 13, 2024
0a96997
Move more calculations to update_history_dyn2_ageclass().
samsrabin Oct 13, 2024
937fba0
Cleanup: FatesHistoryInterfaceMod.
samsrabin Oct 13, 2024
028b04f
Move FATES_NCL from update_history_dyn2_ageclass() to update_history_…
samsrabin Oct 28, 2024
6dac428
Add units info to SumMortForHistory().
samsrabin Oct 28, 2024
d4eaa69
update_history subroutine names/descriptions now more descriptive.
samsrabin Oct 28, 2024
7c99394
update_history_dyn_subsite_ageclass(): Resolve a TODO.
samsrabin Oct 28, 2024
4e9ca52
Delete unused canopy_area_by_age.
samsrabin Oct 28, 2024
a7f2042
Rename _area_ vars in FatesHistoryInterfaceMod to _fracarea_.
samsrabin Oct 28, 2024
170789d
Fix some indentation.
samsrabin Oct 29, 2024
5fd5ccc
Resolve TODO about fire variable weighting.
samsrabin Oct 29, 2024
0cdc991
Remove unneeded cohort class index updates.
samsrabin Oct 29, 2024
a0fb3a4
Add prt_vartypes subroutine GetBiomass().
samsrabin Nov 6, 2024
89f644a
Add comment about reproductive mass being 0.
samsrabin Nov 6, 2024
dd803b0
Combine 2 nearby numpft loops.
samsrabin Jan 27, 2025
f6b5d81
Merge fix: Don't update hio_npp_si_age if cohort is new.
samsrabin Mar 28, 2025
0b3ab4c
Add FATES_PRIMARY_AREA history field.
samsrabin Apr 7, 2025
a40a9de
Rename FATES_SECONDARY_ANTHRODISTAGE_AP to FATES_SECONDARY_ANTHRODIST…
samsrabin Apr 7, 2025
36b076b
Fix/standardize FATES_SECONDARY_AREA_ANTHRO* names.
samsrabin Apr 8, 2025
87de5af
Delete an unneeded get_age_class_index() call.
samsrabin Apr 8, 2025
ac32c3a
Delete an outdated comment about fire variables.
samsrabin Apr 8, 2025
180beb3
Move 2 non-age vars out of update_history_dyn_subsite_ageclass().
samsrabin Apr 9, 2025
bb3902f
Rename *_fuel_amount_age_fuel vars to have _agfc suffix.
samsrabin Apr 9, 2025
4ff439f
Clean up calls of get_age_class_index().
samsrabin Apr 9, 2025
a194073
Rename some loops to satisfy nag compiler.
samsrabin Apr 14, 2025
bc5c3d0
making dlower_vai(1) = zero, using a dedicated function for veg layer…
rgknox Mar 18, 2025
0229056
declaration fixes for canopy layer fixes
rgknox Mar 18, 2025
d695d28
changed vai_dlower index on call for consistency
rgknox Apr 24, 2025
038ae60
added more comments to the dlower_vai array descriptor
rgknox Apr 24, 2025
5dfeb25
altenative bin counting method
rgknox Apr 24, 2025
4dd19d8
fix to trivial radiation transmission
rgknox Apr 1, 2025
b1372ba
make consistent with ctsm
mvdebolskiy Apr 9, 2025
9cdf9f3
updated descriptive text on trivial albedo defs
rgknox Apr 9, 2025
ef57898
changed to count method of calculating number of veg layers, its simp…
rgknox Apr 27, 2025
7fd5a0d
Simplified leaf sun-shade fraction for two-stream
rgknox Apr 2, 2025
f271e72
removed unused variables in two-stream absorption call
rgknox Apr 4, 2025
32fc5a0
Merge branch 'api40' into mpaiao-pr-colddecid-pft
mpaiao Jul 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
422 changes: 216 additions & 206 deletions biogeochem/EDPhysiologyMod.F90

Large diffs are not rendered by default.

90 changes: 56 additions & 34 deletions main/EDInitMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ module EDInitMod
use EDTypesMod , only : phen_dstat_moistoff
use EDTypesMod , only : phen_cstat_notcold
use EDTypesMod , only : phen_dstat_moiston
use EDTypesMod , only : phen_estat_evergreen
use FatesInterfaceTypesMod , only : bc_in_type,bc_out_type
use FatesInterfaceTypesMod , only : hlm_use_planthydro
use FatesInterfaceTypesMod , only : hlm_use_inventory_init
Expand Down Expand Up @@ -264,20 +265,15 @@ subroutine zero_site( site_in )

! PHENOLOGY

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%phen_status(:) = fates_unset_int ! are leaves in this pixel on or off?
site_in%grow_deg_days(:) = nan ! growing degree days
site_in%snow_depth = nan
site_in%nchilldays = fates_unset_int
site_in%ncolddays = fates_unset_int
site_in%cleafondate = fates_unset_int ! doy of leaf on (cold)
site_in%cleafoffdate = fates_unset_int ! doy of leaf off (cold)
site_in%dleafondate(:) = fates_unset_int ! doy of leaf on (drought)
site_in%dleafoffdate(:) = fates_unset_int ! doy of leaf off (drought)
site_in%cndaysleafon = fates_unset_int ! days since leaf on (cold)
site_in%cndaysleafoff = fates_unset_int ! days since leaf off (cold)
site_in%dndaysleafon(:) = fates_unset_int ! days since leaf on (drought)
site_in%dndaysleafoff(:) = fates_unset_int ! days since leaf off (drought)
site_in%nchilldays(:) = fates_unset_int ! number of chilling days
site_in%ncolddays(:) = fates_unset_int ! number of cold days
site_in%leafondate(:) = fates_unset_int ! doy of last leaf flushing event
site_in%leafoffdate(:) = fates_unset_int ! doy of last leaf abscission event
site_in%ndaysleafon(:) = fates_unset_int ! days since last leaf flushing
site_in%ndaysleafoff(: ) = fates_unset_int ! days since last leaf abscission
site_in%elong_factor(:) = nan ! Elongation factor (0 - full abscission; 1 - fully flushed)

site_in%liqvol_memory(:,:) = nan
Expand Down Expand Up @@ -396,6 +392,7 @@ subroutine set_site_properties( nsites, sites,bc_in )
!
! !LOCAL VARIABLES:
integer :: s
integer :: estat ! evergreen phenology flag
integer :: cstat ! cold status phenology flag
real(r8) :: GDD
integer :: dstat ! drought status phenology flag
Expand Down Expand Up @@ -427,44 +424,69 @@ subroutine set_site_properties( nsites, sites,bc_in )

if ( hlm_is_restart == ifalse ) then

GDD = 30.0_r8
cleafon = 100
cleafoff = 300
GDD = 30.0_r8
cleafon = 100
cleafoff = 300
cndleafon = 0
cndleafoff = 0
cstat = phen_cstat_notcold ! Leaves are on
dstat = phen_dstat_moiston ! Leaves are on
dleafoff = 300
dleafon = 100
estat = phen_estat_evergreen
cstat = phen_cstat_notcold ! Leaves are on
dstat = phen_dstat_moiston ! Leaves are on
dleafoff = 300
dleafon = 100
dndleafon = 0
dndleafoff = 0
liqvolmem = 0.5_r8
smpmem = 0._r8
elong_factor = 1._r8

do s = 1,nsites
sites(s)%nchilldays = 0
sites(s)%ncolddays = 0 ! recalculated in phenology
sites(s)%nchilldays(1:numpft) = 0
sites(s)%ncolddays(1:numpft) = 0 ! recalculated in phenology
! immediately, so yes this
! is memory-less, but needed
! for first value in history file
sites(s)%phen_model_date = 0
sites(s)%cleafondate = cleafon - hlm_day_of_year
sites(s)%cleafoffdate = cleafoff - hlm_day_of_year
sites(s)%cndaysleafon = cndleafon
sites(s)%cndaysleafoff = cndleafoff
sites(s)%dleafoffdate (1:numpft) = dleafoff - hlm_day_of_year
sites(s)%dleafondate (1:numpft) = dleafon - hlm_day_of_year
sites(s)%dndaysleafon (1:numpft) = dndleafon
sites(s)%dndaysleafoff(1:numpft) = dndleafoff
sites(s)%grow_deg_days = GDD
sites(s)%grow_deg_days(1:numpft) = GDD

sites(s)%liqvol_memory(1:numWaterMem,1:numpft) = liqvolmem
sites(s)%smp_memory(1:numWaterMem,1:numpft) = smpmem
sites(s)%vegtemp_memory(1:num_vegtemp_mem) = 0._r8

sites(s)%cstatus = cstat
sites(s)%dstatus(1:numpft) = dstat
do ft = 1, numpft
! These must be updated once the new parameter is integrated to FATES.
select case (prt_params%evergreen(ft))
case (itrue)
! Evergreens. These variables are not used, set them to any state
sites(s)%phen_status (ft) = estat
sites(s)%leafondate (ft) = cleafon - hlm_day_of_year
sites(s)%leafoffdate (ft) = cleafoff - hlm_day_of_year
sites(s)%ndaysleafon (ft) = 0
sites(s)%ndaysleafoff(ft) = 0
end select

select case (prt_params%season_decid(ft))
case (itrue)
! Cold deciduous
sites(s)%phen_status (ft) = cstat
sites(s)%leafondate (ft) = cleafon - hlm_day_of_year
sites(s)%leafoffdate (ft) = cleafoff - hlm_day_of_year
sites(s)%ndaysleafon (ft) = cndleafon
sites(s)%ndaysleafoff(ft) = cndleafoff
end select


select case (prt_params%stress_decid(ft))
case (ihard_stress_decid,isemi_stress_decid)
! Drought deciduous
sites(s)%phen_status (ft) = dstat
sites(s)%leafondate (ft) = dleafon - hlm_day_of_year
sites(s)%leafoffdate (ft) = dleafoff - hlm_day_of_year
sites(s)%ndaysleafon (ft) = dndleafon
sites(s)%ndaysleafoff(ft) = dndleafoff
end select
end do

sites(s)%elong_factor(1:numpft) = elong_factor

sites(s)%NF = 0.0_r8
Expand Down Expand Up @@ -1148,7 +1170,7 @@ subroutine init_cohorts(site_in, patch_in, bc_in)
! use built-in phenology
phen_select: select case (prt_params%phen_leaf_habit(pft))
case (ihard_season_decid)
if ( any(site_in%cstatus == [phen_cstat_nevercold, phen_cstat_iscold]) ) then
if ( any(site_in%phen_status(pft) == [phen_cstat_nevercold, phen_cstat_iscold]) ) then
! Cold deciduous, off season, assume complete abscission
efleaf_coh = 0.0_r8
effnrt_coh = 1.0_r8 - fnrt_drop_fraction
Expand Down
2 changes: 1 addition & 1 deletion main/EDMainMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ subroutine ed_integrate_state_variables(currentSite, bc_in, bc_out )

! Conduct Maintenance Turnover (parteh)
if(debug) call currentCohort%prt%CheckMassConservation(ft,3)
if(any(currentSite%dstatus(ft) == [phen_dstat_moiston,phen_dstat_timeon])) then
if(any(currentSite%phen_status(ft) == [phen_dstat_moiston,phen_dstat_timeon])) then
is_drought = .false.
else
is_drought = .true.
Expand Down
70 changes: 0 additions & 70 deletions main/EDParamsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,6 @@ module EDParamsMod
real(r8),protected, public :: ED_val_cwd_fcel ! Cellulose fraction for CWD
real(r8),protected, public :: ED_val_cwd_flig ! Lignin fraction of coarse woody debris
real(r8),protected, public :: maintresp_nonleaf_baserate ! Base maintenance respiration rate for plant tissues
real(r8),protected, public :: ED_val_phen_a ! GDD accumulation function, intercept parameter: gdd_thesh = a + b exp(c*ncd)
real(r8),protected, public :: ED_val_phen_b ! GDD accumulation function, multiplier parameter: gdd_thesh = a + b exp(c*ncd)
real(r8),protected, public :: ED_val_phen_c ! GDD accumulation function, exponent parameter: gdd_thesh = a + b exp(c*ncd)
real(r8),protected, public :: ED_val_phen_chiltemp ! chilling day counting threshold for vegetation
real(r8),protected, public :: ED_val_phen_mindayson ! day threshold compared against days since leaves became on-allometry
real(r8),protected, public :: ED_val_phen_ncolddayslim ! day threshold exceedance for temperature leaf-drop
real(r8),protected, public :: ED_val_phen_coldtemp ! vegetation temperature exceedance that flags a cold-day for leaf-drop
real(r8),protected, public :: ED_val_cohort_size_fusion_tol ! minimum fraction in difference in dbh between cohorts
real(r8),protected, public :: ED_val_cohort_age_fusion_tol ! minimum fraction in differece in cohort age between cohorts
real(r8),protected, public :: ED_val_patch_fusion_tol ! minimum fraction in difference in profiles between patches
Expand Down Expand Up @@ -141,13 +134,6 @@ module EDParamsMod
character(len=param_string_length),parameter,public :: ED_name_cwd_fcel= "fates_frag_cwd_fcel"
character(len=param_string_length),parameter,public :: ED_name_cwd_flig= "fates_frag_cwd_flig"
character(len=param_string_length),parameter,public :: fates_name_maintresp_nonleaf_baserate= "fates_maintresp_nonleaf_baserate"
character(len=param_string_length),parameter,public :: ED_name_phen_a= "fates_phen_gddthresh_a"
character(len=param_string_length),parameter,public :: ED_name_phen_b= "fates_phen_gddthresh_b"
character(len=param_string_length),parameter,public :: ED_name_phen_c= "fates_phen_gddthresh_c"
character(len=param_string_length),parameter,public :: ED_name_phen_chiltemp= "fates_phen_chilltemp"
character(len=param_string_length),parameter,public :: ED_name_phen_mindayson= "fates_phen_mindayson"
character(len=param_string_length),parameter,public :: ED_name_phen_ncolddayslim= "fates_phen_ncolddayslim"
character(len=param_string_length),parameter,public :: ED_name_phen_coldtemp= "fates_phen_coldtemp"
character(len=param_string_length),parameter,public :: ED_name_cohort_size_fusion_tol= "fates_cohort_size_fusion_tol"
character(len=param_string_length),parameter,public :: ED_name_cohort_age_fusion_tol = "fates_cohort_age_fusion_tol"
character(len=param_string_length),parameter,public :: ED_name_patch_fusion_tol= "fates_patch_fusion_tol"
Expand Down Expand Up @@ -310,13 +296,6 @@ subroutine FatesParamsInit()
ED_val_cwd_fcel = nan
ED_val_cwd_flig = nan
maintresp_nonleaf_baserate = nan
ED_val_phen_a = nan
ED_val_phen_b = nan
ED_val_phen_c = nan
ED_val_phen_chiltemp = nan
ED_val_phen_mindayson = nan
ED_val_phen_ncolddayslim = nan
ED_val_phen_coldtemp = nan
ED_val_cohort_size_fusion_tol = nan
ED_val_cohort_age_fusion_tol = nan
ED_val_patch_fusion_tol = nan
Expand Down Expand Up @@ -422,27 +401,6 @@ subroutine FatesRegisterParams(fates_params)
call fates_params%RegisterParameter(name=fates_name_maintresp_nonleaf_baserate, dimension_shape=dimension_shape_scalar, &
dimension_names=dim_names_scalar)

call fates_params%RegisterParameter(name=ED_name_phen_a, dimension_shape=dimension_shape_scalar, &
dimension_names=dim_names_scalar)

call fates_params%RegisterParameter(name=ED_name_phen_b, dimension_shape=dimension_shape_scalar, &
dimension_names=dim_names_scalar)

call fates_params%RegisterParameter(name=ED_name_phen_c, dimension_shape=dimension_shape_scalar, &
dimension_names=dim_names_scalar)

call fates_params%RegisterParameter(name=ED_name_phen_chiltemp, dimension_shape=dimension_shape_scalar, &
dimension_names=dim_names_scalar)

call fates_params%RegisterParameter(name=ED_name_phen_mindayson, dimension_shape=dimension_shape_scalar, &
dimension_names=dim_names_scalar)

call fates_params%RegisterParameter(name=ED_name_phen_ncolddayslim, dimension_shape=dimension_shape_scalar, &
dimension_names=dim_names_scalar)

call fates_params%RegisterParameter(name=ED_name_phen_coldtemp, dimension_shape=dimension_shape_scalar, &
dimension_names=dim_names_scalar)

call fates_params%RegisterParameter(name=ED_name_cohort_size_fusion_tol, dimension_shape=dimension_shape_scalar, &
dimension_names=dim_names_scalar)

Expand Down Expand Up @@ -632,27 +590,6 @@ subroutine FatesReceiveParams(fates_params)
call fates_params%RetrieveParameter(name=fates_name_maintresp_nonleaf_baserate, &
data=maintresp_nonleaf_baserate)

call fates_params%RetrieveParameter(name=ED_name_phen_a, &
data=ED_val_phen_a)

call fates_params%RetrieveParameter(name=ED_name_phen_b, &
data=ED_val_phen_b)

call fates_params%RetrieveParameter(name=ED_name_phen_c, &
data=ED_val_phen_c)

call fates_params%RetrieveParameter(name=ED_name_phen_chiltemp, &
data=ED_val_phen_chiltemp)

call fates_params%RetrieveParameter(name=ED_name_phen_mindayson, &
data=ED_val_phen_mindayson)

call fates_params%RetrieveParameter(name=ED_name_phen_ncolddayslim, &
data=ED_val_phen_ncolddayslim)

call fates_params%RetrieveParameter(name=ED_name_phen_coldtemp, &
data=ED_val_phen_coldtemp)

call fates_params%RetrieveParameter(name=ED_name_cohort_size_fusion_tol, &
data=ED_val_cohort_size_fusion_tol)

Expand Down Expand Up @@ -832,13 +769,6 @@ subroutine FatesReportParams(is_master)
write(fates_log(),fmt0) 'ED_val_cwd_fcel = ',ED_val_cwd_fcel
write(fates_log(),fmt0) 'ED_val_cwd_flig = ',ED_val_cwd_flig
write(fates_log(),fmt0) 'fates_maintresp_nonleaf_baserate = ', maintresp_nonleaf_baserate
write(fates_log(),fmt0) 'ED_val_phen_a = ',ED_val_phen_a
write(fates_log(),fmt0) 'ED_val_phen_b = ',ED_val_phen_b
write(fates_log(),fmt0) 'ED_val_phen_c = ',ED_val_phen_c
write(fates_log(),fmt0) 'ED_val_phen_chiltemp = ',ED_val_phen_chiltemp
write(fates_log(),fmt0) 'ED_val_phen_mindayson = ',ED_val_phen_mindayson
write(fates_log(),fmt0) 'ED_val_phen_ncolddayslim = ',ED_val_phen_ncolddayslim
write(fates_log(),fmt0) 'ED_val_phen_coldtemp = ',ED_val_phen_coldtemp
write(fates_log(),fmt0) 'ED_val_cohort_size_fusion_tol = ',ED_val_cohort_size_fusion_tol
write(fates_log(),fmt0) 'ED_val_cohort_age_fusion_tol = ',ED_val_cohort_age_fusion_tol
write(fates_log(),fmt0) 'ED_val_patch_fusion_tol = ',ED_val_patch_fusion_tol
Expand Down
Loading