Skip to content

Commit 1495bbb

Browse files
authored
Merge pull request #316 from ckoven/pftagevars
Adding new age*pft and size*age*pft hist dims and a few new vars for them
2 parents e7e93fd + 819609f commit 1495bbb

10 files changed

+385
-13
lines changed

biogeochem/EDCanopyStructureMod.F90

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ subroutine DemoteFromLayer(currentSite,currentPatch,i_lyr)
465465
call carea_allom(currentCohort%dbh,currentCohort%n, &
466466
currentSite%spread,currentCohort%pft,currentCohort%c_area)
467467
endif
468-
468+
469469
call carea_allom(copyc%dbh,copyc%n,currentSite%spread,copyc%pft,copyc%c_area)
470470

471471

@@ -540,7 +540,8 @@ subroutine DemoteFromLayer(currentSite,currentPatch,i_lyr)
540540
currentCohort%c_area = 0._r8
541541

542542
else
543-
call carea_allom(currentCohort%dbh,currentCohort%n,currentSite%spread,currentCohort%pft,currentCohort%c_area)
543+
call carea_allom(currentCohort%dbh,currentCohort%n,currentSite%spread, &
544+
currentCohort%pft,currentCohort%c_area)
544545
endif
545546

546547
endif ! matches: if (cc_loss < currentCohort%c_area)then

biogeochem/EDPatchDynamicsMod.F90

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,14 +1104,17 @@ subroutine mortality_litter_fluxes(currentSite, cp_target, new_patch_target, pat
11041104

11051105
new_patch%cwd_ag(c) = new_patch%cwd_ag(c) + EDPftvarcon_inst%allom_agb_frac(p) * cwd_litter_density * np_mult
11061106
currentPatch%cwd_ag(c) = currentPatch%cwd_ag(c) + EDPftvarcon_inst%allom_agb_frac(p) * cwd_litter_density
1107-
new_patch%cwd_bg(c) = new_patch%cwd_bg(c) + (1._r8-EDPftvarcon_inst%allom_agb_frac(p)) * cwd_litter_density * np_mult
1107+
new_patch%cwd_bg(c) = new_patch%cwd_bg(c) + (1._r8-EDPftvarcon_inst%allom_agb_frac(p)) * cwd_litter_density &
1108+
* np_mult
11081109
currentPatch%cwd_bg(c) = currentPatch%cwd_bg(c) + (1._r8-EDPftvarcon_inst%allom_agb_frac(p)) * cwd_litter_density
11091110

11101111
! track as diagnostic fluxes
11111112
currentSite%CWD_AG_diagnostic_input_carbonflux(c) = currentSite%CWD_AG_diagnostic_input_carbonflux(c) + &
1112-
SF_val_CWD_frac(c) * canopy_mortality_woody_litter(p) * hlm_days_per_year * EDPftvarcon_inst%allom_agb_frac(p)/ AREA
1113+
SF_val_CWD_frac(c) * canopy_mortality_woody_litter(p) * hlm_days_per_year * EDPftvarcon_inst%allom_agb_frac(p) &
1114+
/ AREA
11131115
currentSite%CWD_BG_diagnostic_input_carbonflux(c) = currentSite%CWD_BG_diagnostic_input_carbonflux(c) + &
1114-
SF_val_CWD_frac(c) * canopy_mortality_woody_litter(p) * hlm_days_per_year * (1.0_r8 - EDPftvarcon_inst%allom_agb_frac(p)) / AREA
1116+
SF_val_CWD_frac(c) * canopy_mortality_woody_litter(p) * hlm_days_per_year * (1.0_r8 &
1117+
- EDPftvarcon_inst%allom_agb_frac(p)) / AREA
11151118
enddo
11161119

11171120
new_patch%leaf_litter(p) = new_patch%leaf_litter(p) + canopy_mortality_leaf_litter(p) / litter_area * np_mult

main/EDParamsMod.F90

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ module EDParamsMod
4646
! two special parameters whose size is defined in the parameter file
4747
real(r8),protected,allocatable :: ED_val_history_sizeclass_bin_edges(:)
4848
real(r8),protected,allocatable :: ED_val_history_ageclass_bin_edges(:)
49+
real(r8),protected,allocatable :: ED_val_history_height_bin_edges(:)
4950

5051
character(len=param_string_length),parameter :: ED_name_mort_disturb_frac = "fates_mort_disturb_frac"
5152
character(len=param_string_length),parameter :: ED_name_comp_excln = "fates_comp_excln"
@@ -73,6 +74,7 @@ module EDParamsMod
7374
! non-scalar parameter names
7475
character(len=param_string_length),parameter :: ED_name_history_sizeclass_bin_edges= "fates_history_sizeclass_bin_edges"
7576
character(len=param_string_length),parameter :: ED_name_history_ageclass_bin_edges= "fates_history_ageclass_bin_edges"
77+
character(len=param_string_length),parameter :: ED_name_history_height_bin_edges= "fates_history_height_bin_edges"
7678

7779
! Hydraulics Control Parameters (ONLY RELEVANT WHEN USE_FATES_HYDR = TRUE)
7880
! ----------------------------------------------------------------------------------------------
@@ -171,6 +173,7 @@ subroutine FatesRegisterParams(fates_params)
171173

172174
use FatesParametersInterface, only : fates_parameters_type, dimension_name_scalar1d, dimension_shape_1d
173175
use FatesParametersInterface, only : dimension_name_history_size_bins, dimension_name_history_age_bins
176+
use FatesParametersInterface, only : dimension_name_history_height_bins
174177

175178
implicit none
176179

@@ -179,6 +182,7 @@ subroutine FatesRegisterParams(fates_params)
179182
character(len=param_string_length), parameter :: dim_names(1) = (/dimension_name_scalar1d/)
180183
character(len=param_string_length), parameter :: dim_names_sizeclass(1) = (/dimension_name_history_size_bins/)
181184
character(len=param_string_length), parameter :: dim_names_ageclass(1) = (/dimension_name_history_age_bins/)
185+
character(len=param_string_length), parameter :: dim_names_height(1) = (/dimension_name_history_height_bins/)
182186

183187
call FatesParamsInit()
184188

@@ -285,6 +289,9 @@ subroutine FatesRegisterParams(fates_params)
285289
call fates_params%RegisterParameter(name=ED_name_history_ageclass_bin_edges, dimension_shape=dimension_shape_1d, &
286290
dimension_names=dim_names_ageclass)
287291

292+
call fates_params%RegisterParameter(name=ED_name_history_height_bin_edges, dimension_shape=dimension_shape_1d, &
293+
dimension_names=dim_names_height)
294+
288295
end subroutine FatesRegisterParams
289296

290297

@@ -400,6 +407,9 @@ subroutine FatesReceiveParams(fates_params)
400407
call fates_params%RetreiveParameterAllocate(name=ED_name_history_ageclass_bin_edges, &
401408
data=ED_val_history_ageclass_bin_edges)
402409

410+
call fates_params%RetreiveParameterAllocate(name=ED_name_history_height_bin_edges, &
411+
data=ED_val_history_height_bin_edges)
412+
403413

404414
end subroutine FatesReceiveParams
405415

0 commit comments

Comments
 (0)