Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
10 changes: 5 additions & 5 deletions biogeochem/EDCohortDynamicsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ Module EDCohortDynamicsMod
use FatesAllometryMod , only : bstore_allom
use FatesAllometryMod , only : ForceDBH
use FatesAllometryMod , only : set_root_fraction
use PRTGenericMod, only : fates_c_only
use PRTGenericMod, only : fates_cnp
use PRTGenericMod, only : carbon_only
use PRTGenericMod, only : carbon_nitrogen_phosphorus
use PRTGenericMod, only : prt_vartypes
use PRTGenericMod, only : carbon12_element
use PRTGenericMod, only : nitrogen_element
Expand Down Expand Up @@ -251,12 +251,12 @@ subroutine InitPRTObject(prt)


select case(hlm_parteh_mode)
case (fates_c_only)
case (carbon_only)

allocate(c_allom_prt)
prt => c_allom_prt

case (fates_cnp)
case (carbon_nitrogen_phosphorus)

allocate(cnp_allom_prt)
prt => cnp_allom_prt
Expand Down Expand Up @@ -1039,7 +1039,7 @@ subroutine fuse_cohorts(currentSite, currentPatch, bc_in)
currentCohort%frmort = (currentCohort%n*currentCohort%frmort + nextc%n*nextc%frmort)/newn

! Nutrients
if (hlm_parteh_mode == fates_cnp) then
if (hlm_parteh_mode == carbon_nitrogen_phosphorus) then

currentCohort%l2fr = (currentCohort%n*currentCohort%l2fr &
+ nextc%n*nextc%l2fr)/newn
Expand Down
12 changes: 6 additions & 6 deletions biogeochem/EDPhysiologyMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ module EDPhysiologyMod
use FatesAllometryMod , only : carea_allom
use FatesAllometryMod , only : CheckIntegratedAllometries
use FatesAllometryMod, only : set_root_fraction
use PRTGenericMod, only : fates_c_only
use PRTGenericMod, only : fates_cnp
use PRTGenericMod, only : carbon_only
use PRTGenericMod, only : carbon_nitrogen_phosphorus
use PRTGenericMod, only : prt_vartypes
use PRTGenericMod, only : leaf_organ
use PRTGenericMod, only : sapw_organ, struct_organ
Expand Down Expand Up @@ -2732,7 +2732,7 @@ subroutine recruitment(currentSite, currentPatch, bc_in)


select case(hlm_parteh_mode)
case (fates_c_only, fates_cnp)
case (carbon_only,carbon_nitrogen_phosphorus)

! put all of the leaf mass into the first bin
call SetState(prt, leaf_organ, element_id, m_leaf, 1)
Expand Down Expand Up @@ -3330,7 +3330,7 @@ subroutine UpdateRecruitL2FR(csite)

! Difference in dbh (cm) to consider a plant was recruited fairly recently

if (hlm_parteh_mode /= fates_cnp) return
if (hlm_parteh_mode /= carbon_nitrogen_phosphorus) return

rec_n(1:numpft,1:nclmax) = 0._r8
rec_l2fr0(1:numpft,1:nclmax) = 0._r8
Expand Down Expand Up @@ -3392,7 +3392,7 @@ subroutine UpdateRecruitStoich(csite)
! Update the total plant stoichiometry of a new recruit, based on the updated
! L2FR values

if (hlm_parteh_mode /= fates_cnp) return
if (hlm_parteh_mode /= carbon_nitrogen_phosphorus) return

cpatch => csite%youngest_patch
do while(associated(cpatch))
Expand Down Expand Up @@ -3430,7 +3430,7 @@ subroutine SetRecruitL2FR(csite)
type(fates_cohort_type), pointer :: ccohort
integer :: ft,cl

if (hlm_parteh_mode /= fates_cnp) return
if (hlm_parteh_mode /= carbon_nitrogen_phosphorus) return

cpatch => csite%youngest_patch
do while(associated(cpatch))
Expand Down
12 changes: 6 additions & 6 deletions biogeochem/FatesCohortMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ module FatesCohortMod
use FatesGlobals, only : fates_log
use PRTGenericMod, only : max_nleafage
use PRTGenericMod, only : prt_vartypes
use PRTGenericMod, only : fates_c_only
use PRTGenericMod, only : fates_cnp
use PRTGenericMod, only : carbon_only
use PRTGenericMod, only : carbon_nitrogen_phosphorus
use PRTGenericMod, only : leaf_organ, fnrt_organ, sapw_organ
use PRTGenericMod, only : repro_organ, store_organ, struct_organ
use PRTGenericMod, only : carbon12_element
Expand Down Expand Up @@ -625,7 +625,7 @@ subroutine Create(this, prt, pft, nn, height, coage, dbh, status, &
! initialized with full stores, which match with minimum fineroot biomass
this%l2fr = prt_params%allom_l2fr(pft)

if (hlm_parteh_mode == fates_cnp) then
if (hlm_parteh_mode == carbon_nitrogen_phosphorus) then
this%cx_int = 0._r8 ! Assume balanced N,P/C stores ie log(1) = 0
this%cx0 = 0._r8 ! Assume balanced N,P/C stores ie log(1) = 0
this%ema_dcxdt = 0._r8 ! Assume unchanged dCX/dt
Expand Down Expand Up @@ -743,7 +743,7 @@ subroutine Copy(this, copyCohort)
copyCohort%year_net_uptake = this%year_net_uptake
copyCohort%cnp_limiter = this%cnp_limiter

if (hlm_parteh_mode == fates_cnp) then
if (hlm_parteh_mode == carbon_nitrogen_phosphorus) then
copyCohort%cx_int = this%cx_int
copyCohort%ema_dcxdt = this%ema_dcxdt
copyCohort%cx0 = this%cx0
Expand Down Expand Up @@ -873,7 +873,7 @@ subroutine InitPRTBoundaryConditions(this)
class(fates_cohort_type), intent(inout), target :: this

select case(hlm_parteh_mode)
case (fates_c_only)
case (carbon_only)

! Register boundary conditions for the Carbon Only Allometric Hypothesis

Expand All @@ -887,7 +887,7 @@ subroutine InitPRTBoundaryConditions(this)
call this%prt%RegisterBCIn(ac_bc_in_id_effnrt, bc_rval = this%effnrt_coh)
call this%prt%RegisterBCIn(ac_bc_in_id_efstem, bc_rval = this%efstem_coh)

case (fates_cnp)
case (carbon_nitrogen_phosphorus)

! Register boundary conditions for the CNP Allometric Hypothesis

Expand Down
10 changes: 5 additions & 5 deletions biogeochem/FatesSoilBGCFluxMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ module FatesSoilBGCFluxMod
use PRTGenericMod , only : num_elements
use PRTGenericMod , only : element_list
use PRTGenericMod , only : element_pos
use PRTGenericMod , only : fates_c_only
use PRTGenericMod , only : fates_cnp
use PRTGenericMod , only : carbon_only
use PRTGenericMod , only : carbon_nitrogen_phosphorus
use PRTGenericMod , only : prt_vartypes
use PRTGenericMod , only : leaf_organ
use PRTGenericMod , only : sapw_organ, struct_organ
Expand Down Expand Up @@ -153,7 +153,7 @@ subroutine UnPackNutrientAquisitionBCs(sites, bc_in, nitr_suppl, phos_suppl)

! We can exit if this is a c-only simulation
select case (hlm_parteh_mode)
case (fates_c_only)
case (carbon_only)
! These can now be zero'd
do s = 1, nsites
bc_in(s)%plant_nh4_uptake_flux(:,:) = 0._r8
Expand Down Expand Up @@ -289,7 +289,7 @@ subroutine PrepCH4BCs(csite,bc_in,bc_out)


! Exit if we need not communicate with the hlm's ch4 module
! if(.not.(hlm_use_ch4==itrue) .and. .not.(hlm_parteh_mode==fates_cnp) ) return
! if(.not.(hlm_use_ch4==itrue) .and. .not.(hlm_parteh_mode==carbon_nitrogen_phosphorus) ) return

! Initialize to zero
bc_out%annavg_agnpp_pa(:) = 0._r8
Expand All @@ -302,7 +302,7 @@ subroutine PrepCH4BCs(csite,bc_in,bc_out)
bc_out%ema_npp = 0._r8

! Process CH4 variables first
!if(.not.(hlm_use_ch4==itrue) .and. .not.(hlm_parteh_mode==fates_cnp) )
!if(.not.(hlm_use_ch4==itrue) .and. .not.(hlm_parteh_mode==carbon_nitrogen_phosphorus) )

cpatch => csite%oldest_patch
do while (associated(cpatch))
Expand Down
6 changes: 3 additions & 3 deletions main/EDInitMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ module EDInitMod
use FatesAllometryMod , only : carea_allom
use PRTGenericMod , only : StorageNutrientTarget
use FatesInterfaceTypesMod, only : hlm_parteh_mode
use PRTGenericMod, only : fates_c_only
use PRTGenericMod, only : fates_cnp
use PRTGenericMod, only : carbon_only
use PRTGenericMod, only : carbon_nitrogen_phosphorus
use PRTGenericMod, only : prt_vartypes
use PRTGenericMod, only : leaf_organ
use PRTGenericMod, only : fnrt_organ
Expand Down Expand Up @@ -1373,7 +1373,7 @@ subroutine init_cohorts(site_in, patch_in, bc_in)
end select

select case(hlm_parteh_mode)
case (fates_c_only, fates_cnp )
case (carbon_only, carbon_nitrogen_phosphorus)
! Put all of the leaf mass into the first bin
call SetState(prt, leaf_organ, element_id, m_leaf, 1)
do iage = 2,nleafage
Expand Down
6 changes: 3 additions & 3 deletions main/EDMainMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ module EDMainMod
use FatesInterfaceTypesMod , only : numpft
use FatesInterfaceTypesMod , only : hlm_use_nocomp
use FatesInterfaceTypesMod , only : ZeroBCOutCarbonFluxes
use PRTGenericMod , only : fates_c_only
use PRTGenericMod , only : fates_cnp
use PRTGenericMod , only : carbon_only
use PRTGenericMod , only : carbon_nitrogen_phosphorus
use PRTGenericMod , only : nitrogen_element
use PRTGenericMod , only : phosphorus_element
use EDCohortDynamicsMod , only : terminate_cohorts
Expand Down Expand Up @@ -739,7 +739,7 @@ subroutine ed_integrate_state_variables(currentSite, bc_in, bc_out )
! Update history diagnostics related to Nutrients (if any)
! -----------------------------------------------------------------------------
select case(hlm_parteh_mode)
case (fates_cnp)
case (carbon_nitrogen_phosphorus)
call fates_hist%update_history_nutrflux(currentSite)
end select

Expand Down
6 changes: 3 additions & 3 deletions main/EDPftvarcon.F90
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module EDPftvarcon
use FatesLitterMod, only : ilabile,icellulose,ilignin
use PRTGenericMod, only : leaf_organ, fnrt_organ, store_organ
use PRTGenericMod, only : sapw_organ, struct_organ, repro_organ
use PRTGenericMod, only : fates_cnp, fates_c_only
use PRTGenericMod, only : carbon_nitrogen_phosphorus,carbon_only
use FatesInterfaceTypesMod, only : hlm_parteh_mode
use FatesInterfaceTypesMod, only : hlm_nu_com
use FatesConstantsMod , only : ievergreen
Expand Down Expand Up @@ -956,7 +956,7 @@ subroutine FatesCheckParams(is_master)
if(.not.is_master) return

select case (hlm_parteh_mode)
case (fates_cnp)
case (carbon_nitrogen_phosphorus)

! Check to see if either RD/ECA/MIC is turned on

Expand Down Expand Up @@ -1027,7 +1027,7 @@ subroutine FatesCheckParams(is_master)
end if
end if

case (fates_c_only)
case (carbon_only)
! No additional checks needed for now.
continue

Expand Down
4 changes: 2 additions & 2 deletions main/FatesHistoryInterfaceMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module FatesHistoryInterfaceMod
use FatesConstantsMod , only : ican_upper
use PRTGenericMod , only : element_pos
use PRTGenericMod , only : num_elements
use PRTGenericMod , only : fates_cnp
use PRTGenericMod , only : carbon_nitrogen_phosphorus
use EDTypesMod , only : site_fluxdiags_type
use EDTypesMod , only : elem_diag_type
use EDtypesMod , only : ed_site_type
Expand Down Expand Up @@ -2835,7 +2835,7 @@ subroutine update_history_dyn_sitelevel(this,nc,nsites,sites)
hio_agb_si(io_si) = hio_agb_si(io_si) + n_perm2 * &
( leaf_m + (sapw_m + struct_m + store_m) * prt_params%allom_agb_frac(ccohort%pft) )

if (hlm_parteh_mode == fates_cnp) then
if (hlm_parteh_mode == carbon_nitrogen_phosphorus) then
this%hvars(ih_l2fr_si)%r81d(io_si) = &
this%hvars(ih_l2fr_si)%r81d(io_si) + &
ccohort%l2fr *ccohort%n * fnrt_m / m2_per_ha
Expand Down
31 changes: 16 additions & 15 deletions main/FatesInterfaceMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ module FatesInterfaceMod
use PRTGenericMod , only : element_list
use PRTGenericMod , only : element_pos
use EDParamsMod , only : eca_plant_escalar
use PRTGenericMod , only : fates_c_only
use PRTGenericMod , only : fates_cnp
use PRTGenericMod , only : carbon_only
use PRTGenericMod , only : carbon_nitrogen_phosphorus
use PRTGenericMod , only : carbon12_element
use PRTGenericMod , only : nitrogen_element
use PRTGenericMod , only : phosphorus_element
Expand Down Expand Up @@ -342,7 +342,7 @@ subroutine zero_bcs(fates,s)

! Fates -> BGC fragmentation mass fluxes
select case(hlm_parteh_mode)
case(fates_c_only)
case(carbon_only)
fates%bc_out(s)%litt_flux_cel_c_si(:) = 0._r8
fates%bc_out(s)%litt_flux_lig_c_si(:) = 0._r8
fates%bc_out(s)%litt_flux_lab_c_si(:) = 0._r8
Expand All @@ -352,7 +352,7 @@ subroutine zero_bcs(fates,s)
fates%bc_out(s)%litt_flux_cel_n_si(:) = 0._r8
fates%bc_out(s)%litt_flux_lig_n_si(:) = 0._r8
fates%bc_out(s)%litt_flux_lab_n_si(:) = 0._r8
case(fates_cnp)
case(carbon_nitrogen_phosphorus)

fates%bc_in(s)%plant_nh4_uptake_flux(:,:) = 0._r8
fates%bc_in(s)%plant_no3_uptake_flux(:,:) = 0._r8
Expand Down Expand Up @@ -491,7 +491,7 @@ subroutine allocate_bcin(bc_in, nlevsoil_in, nlevdecomp_in, num_lu_harvest_cats,
! uptake for each cohort, and don't need to allocate by layer
! Allocating differently could save a lot of memory and time

if (hlm_parteh_mode == fates_cnp) then
if (hlm_parteh_mode == carbon_nitrogen_phosphorus) then
allocate(bc_in%plant_nh4_uptake_flux(max_comp_per_site,1))
allocate(bc_in%plant_no3_uptake_flux(max_comp_per_site,1))
allocate(bc_in%plant_p_uptake_flux(max_comp_per_site,1))
Expand Down Expand Up @@ -690,7 +690,7 @@ subroutine allocate_bcout(bc_out, nlevsoil_in, nlevdecomp_in)

! Fates -> BGC fragmentation mass fluxes
select case(hlm_parteh_mode)
case(fates_c_only)
case(carbon_only)
allocate(bc_out%litt_flux_cel_c_si(nlevdecomp_in))
allocate(bc_out%litt_flux_lig_c_si(nlevdecomp_in))
allocate(bc_out%litt_flux_lab_c_si(nlevdecomp_in))
Expand All @@ -700,7 +700,7 @@ subroutine allocate_bcout(bc_out, nlevsoil_in, nlevdecomp_in)
allocate(bc_out%litt_flux_cel_n_si(nlevdecomp_in))
allocate(bc_out%litt_flux_lig_n_si(nlevdecomp_in))
allocate(bc_out%litt_flux_lab_n_si(nlevdecomp_in))
case(fates_cnp)
case(carbon_nitrogen_phosphorus)
allocate(bc_out%litt_flux_cel_c_si(nlevdecomp_in))
allocate(bc_out%litt_flux_lig_c_si(nlevdecomp_in))
allocate(bc_out%litt_flux_lab_c_si(nlevdecomp_in))
Expand Down Expand Up @@ -959,14 +959,14 @@ subroutine SetFatesGlobalElements2(use_fates)
! An error check in subroutine set_fates_ctrlparms stops the run earlier if
! - hlm_name is CLM
! - p_uptake_mode is coupled_p_uptake and
! - hlm_parteh_mode is fates_cnp
! because CLM-FATES must have prescribed phosphorus when hlm_parteh_mode == fates_cnp.
! - hlm_parteh_mode is CNP
! because CLM-FATES must have prescribed phosphorus when hlm_parteh_mode == carbon_nitrogen_phosphorus.
! To select prescribed phosphorus, set fates_cnp_prescribed_puptake > 1 (recommended 10)
! in the fates parameter file.
p_uptake_mode = coupled_p_uptake
end if

if (hlm_parteh_mode == fates_cnp) then
if (hlm_parteh_mode == carbon_nitrogen_phosphorus) then

if((p_uptake_mode==coupled_p_uptake) .or. (n_uptake_mode==coupled_n_uptake))then
max_comp_per_site = fates_maxElementsPerSite
Expand Down Expand Up @@ -1163,7 +1163,7 @@ subroutine InitPARTEHGlobals()
! automatically.

select case(hlm_parteh_mode)
case(fates_c_only)
case(carbon_only)

num_elements = 1
allocate(element_list(num_elements))
Expand All @@ -1173,7 +1173,7 @@ subroutine InitPARTEHGlobals()

call InitPRTGlobalAllometricCarbon()

case(fates_cnp)
case(carbon_nitrogen_phosphorus)

num_elements = 3
allocate(element_list(num_elements))
Expand Down Expand Up @@ -1734,7 +1734,7 @@ subroutine set_fates_ctrlparms(tag,ival,rval,cval)
call endrun(msg=errMsg(sourcefile, __LINE__))
else
if((hlm_use_tree_damage .eq. itrue) .and. &
(hlm_parteh_mode == fates_cnp)) then
(hlm_parteh_mode == carbon_nitrogen_phosphorus)) then
write(fates_log(),*) 'FATES tree damage (use_fates_tree_damage = .true.) is not'
write(fates_log(),*) '(yet) compatible with CNP allocation (fates_parteh_mode = 2)'
call endrun(msg=errMsg(sourcefile, __LINE__))
Expand Down Expand Up @@ -1807,9 +1807,10 @@ subroutine set_fates_ctrlparms(tag,ival,rval,cval)
call endrun(msg=errMsg(sourcefile, __LINE__))
end if

if(trim(hlm_name) == 'CLM' .and. hlm_parteh_mode == fates_cnp) then
if(trim(hlm_name) == 'CLM' .and. &
hlm_parteh_mode == carbon_nitrogen_phosphorus) then
if( sum(abs(EDPftvarcon_inst%prescribed_puptake(:))) < nearzero ) then
write(fates_log(), *) 'PARTEH hypothesis 2 (i.e. fates_cnp) is only viable with forced'
write(fates_log(), *) 'PARTEH hypothesis 2 (i.e. CNP) is only viable with forced'
write(fates_log(), *) 'phosphorus boundary conditions for CLM (currently).'
write(fates_log(), *) 'prescribed_puptake must > 0 (recommended is 10)'
call endrun(msg=errMsg(sourcefile, __LINE__))
Expand Down
6 changes: 3 additions & 3 deletions main/FatesInventoryInitMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ module FatesInventoryInitMod
use EDPftvarcon , only : EDPftvarcon_inst
use FatesInterfaceTypesMod, only : hlm_parteh_mode
use EDCohortDynamicsMod, only : InitPRTObject
use PRTGenericMod, only : fates_c_only
use PRTGenericMod, only : fates_cnp
use PRTGenericMod, only : carbon_only
use PRTGenericMod, only : carbon_nitrogen_phosphorus
use PRTGenericMod, only : prt_vartypes
use PRTGenericMod, only : leaf_organ
use PRTGenericMod, only : fnrt_organ
Expand Down Expand Up @@ -1116,7 +1116,7 @@ subroutine set_inventory_cohort_type1(csite,bc_in,css_file_unit,npatches, &
end select

select case(hlm_parteh_mode)
case (fates_c_only, fates_cnp)
case (carbon_only,carbon_nitrogen_phosphorus)

! Equally distribute leaf mass into available age-bins
do iage = 1,nleafage
Expand Down
Loading