Skip to content

Commit

Permalink
Merge pull request #1116 from ckoven/luh2_nocomp_merge
Browse files Browse the repository at this point in the history
V2 Land Use Change
  • Loading branch information
glemieux authored Jul 8, 2024
2 parents b8e4eee + 4ae398b commit fd7f343
Show file tree
Hide file tree
Showing 21 changed files with 3,888 additions and 698 deletions.
209 changes: 143 additions & 66 deletions biogeochem/EDLoggingMortalityMod.F90

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions biogeochem/EDMortalityFunctionsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ end subroutine mortality_rates

subroutine Mortality_Derivative( currentSite, currentCohort, bc_in, btran_ft, &
mean_temp, land_use_label, age_since_anthro_disturbance, &
frac_site_primary, harvestable_forest_c, harvest_tag)
frac_site_primary, frac_site_secondary, harvestable_forest_c, harvest_tag)

!
! !DESCRIPTION:
Expand All @@ -301,6 +301,7 @@ subroutine Mortality_Derivative( currentSite, currentCohort, bc_in, btran_ft, &
integer, intent(in) :: land_use_label
real(r8), intent(in) :: age_since_anthro_disturbance
real(r8), intent(in) :: frac_site_primary
real(r8), intent(in) :: frac_site_secondary

real(r8), intent(in) :: harvestable_forest_c(:) ! total carbon available for logging, kgC site-1
integer, intent(out) :: harvest_tag(:) ! tag to record the harvest status
Expand Down Expand Up @@ -329,7 +330,7 @@ subroutine Mortality_Derivative( currentSite, currentCohort, bc_in, btran_ft, &
!if trees are in the canopy, then their death is 'disturbance'. This probably needs a different terminology
call mortality_rates(currentCohort,bc_in,btran_ft, mean_temp, &
cmort,hmort,bmort,frmort, smort, asmort, dgmort)
call LoggingMortality_frac(ipft, currentCohort%dbh, currentCohort%canopy_layer, &
call LoggingMortality_frac(currentSite, bc_in, ipft, currentCohort%dbh, currentCohort%canopy_layer, &
currentCohort%lmort_direct, &
currentCohort%lmort_collateral, &
currentCohort%lmort_infra, &
Expand All @@ -339,7 +340,7 @@ subroutine Mortality_Derivative( currentSite, currentCohort, bc_in, btran_ft, &
bc_in%hlm_harvest_units, &
land_use_label, &
age_since_anthro_disturbance, &
frac_site_primary, harvestable_forest_c, harvest_tag)
frac_site_primary, frac_site_secondary, harvestable_forest_c, harvest_tag)

if (currentCohort%canopy_layer > 1)then
! Include understory logging mortality rates not associated with disturbance
Expand Down
930 changes: 773 additions & 157 deletions biogeochem/EDPatchDynamicsMod.F90

Large diffs are not rendered by default.

43 changes: 31 additions & 12 deletions biogeochem/EDPhysiologyMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module EDPhysiologyMod
use FatesInterfaceTypesMod, only : hlm_parteh_mode
use FatesInterfaceTypesMod, only : hlm_use_fixed_biogeog
use FatesInterfaceTypesMod, only : hlm_use_nocomp
use EDParamsMod , only : crop_lu_pft_vector
use FatesInterfaceTypesMod, only : hlm_nitrogen_spec
use FatesInterfaceTypesMod, only : hlm_phosphorus_spec
use FatesInterfaceTypesMod, only : hlm_use_tree_damage
Expand All @@ -34,6 +35,8 @@ module EDPhysiologyMod
use FatesConstantsMod, only : g_per_kg
use FatesConstantsMod, only : ndays_per_year
use FatesConstantsMod, only : nocomp_bareground
use FatesConstantsMod, only : nocomp_bareground_land
use FatesConstantsMod, only : is_crop
use FatesConstantsMod, only : area_error_2
use EDPftvarcon , only : EDPftvarcon_inst
use PRTParametersMod , only : prt_params
Expand Down Expand Up @@ -140,7 +143,8 @@ module EDPhysiologyMod
use FatesParameterDerivedMod, only : param_derived
use FatesPlantHydraulicsMod, only : InitHydrCohort
use PRTInitParamsFatesMod, only : NewRecruitTotalStoichiometry

use FatesInterfaceTypesMod , only : hlm_use_luh

implicit none
private

Expand Down Expand Up @@ -2492,20 +2496,35 @@ subroutine recruitment(currentSite, currentPatch, bc_in)
real(r8) :: seedling_layer_smp ! soil matric potential at seedling rooting depth [mm H2O suction]
integer, parameter :: recruitstatus = 1 ! whether the newly created cohorts are recruited or initialized
integer :: ilayer_seedling_root ! the soil layer at seedling rooting depth

logical :: use_this_pft ! logical flag for whether or not to allow a given PFT to recruit
!---------------------------------------------------------------------------

do ft = 1, numpft

! The following if block is for the prescribed biogeography and/or nocomp modes.
! Since currentSite%use_this_pft is a site-level quantity and thus only limits whether a given PFT
! is permitted on a given gridcell or not, it applies to the prescribed biogeography case only.
! If nocomp is enabled, then we must determine whether a given PFT is allowed on a given patch or not.
! The following if block is for the prescribed biogeography and/or nocomp modes and/or crop land use types
! Since currentSite%use_this_pft is a site-level quantity and thus only limits whether a given PFT
! is permitted on a given gridcell or not, it applies to the prescribed biogeography case only.
! If nocomp is enabled, then we must determine whether a given PFT is allowed on a given patch or not.
! Whether or not nocomp or prescribed biogeography is enabled, if land use change is enabled, then we only want to
! allow crop PFTs on patches with crop land use types

use_this_pft = .false.
if(currentSite%use_this_pft(ft).eq.itrue &
.and. ((hlm_use_nocomp .eq. ifalse) .or. (ft .eq. currentPatch%nocomp_pft_label)))then
use_this_pft = .true.
end if

if (currentSite%use_this_pft(ft) .eq. itrue .and. &
((hlm_use_nocomp .eq. ifalse) .or. &
(ft .eq. currentPatch%nocomp_pft_label))) then
if ( currentPatch%land_use_label .ne. nocomp_bareground_land ) then ! cdk
if ((hlm_use_luh .eq. itrue) .and. (is_crop(currentPatch%land_use_label))) then
if ( crop_lu_pft_vector(currentPatch%land_use_label) .eq. ft ) then
use_this_pft = .true.
else
use_this_pft = .false.
end if
end if
endif

use_this_pft_if: if(use_this_pft) then
height = EDPftvarcon_inst%hgt_min(ft)
stem_drop_fraction = prt_params%phen_stem_drop_fraction(ft)
fnrt_drop_fraction = prt_params%phen_fnrt_drop_fraction(ft)
Expand Down Expand Up @@ -2749,11 +2768,11 @@ subroutine recruitment(currentSite, currentPatch, bc_in)
currentSite%recruitment_rate(ft) = currentSite%recruitment_rate(ft) + cohort_n

endif any_recruits
endif !use_this_pft
endif use_this_pft_if
enddo !pft loop
end subroutine recruitment

! ======================================================================================
! ======================================================================================

subroutine CWDInput( currentSite, currentPatch, litt, bc_in)

Expand Down Expand Up @@ -3022,7 +3041,7 @@ subroutine CWDInput( currentSite, currentPatch, litt, bc_in)
SF_val_CWD_frac_adj(c) * dead_n_dlogging * &
prt_params%allom_agb_frac(pft)

site_mass%wood_product = site_mass%wood_product + &
site_mass%wood_product_harvest(pft) = site_mass%wood_product_harvest(pft) + &
trunk_wood * currentPatch%area * logging_export_frac

! Add AG wood to litter from the non-exported fraction of wood
Expand Down
Loading

0 comments on commit fd7f343

Please sign in to comment.