From 2a9e514bbfb872dd5c1d58618d99faa73ad3f79a Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 22 Sep 2025 17:26:52 -0600 Subject: [PATCH 01/13] prt_carbon_allom_hyp -> fates_c_only & prt_cnp_flex_allom_hyp ->fates_cn This renaming of variables corresponds to 116b310cd20f29bf5ca07b1d89f9e812f4e94477 --- biogeochem/EDCohortDynamicsMod.F90 | 10 ++++---- biogeochem/EDPatchDynamicsMod.F90 | 2 -- biogeochem/EDPhysiologyMod.F90 | 12 +++++----- biogeochem/FatesCohortMod.F90 | 12 +++++----- biogeochem/FatesSoilBGCFluxMod.F90 | 10 ++++---- biogeophys/FatesPlantRespPhotosynthMod.F90 | 14 +++++------ .../parteh/f90src/FatesCohortWrapMod.F90 | 24 +++++++++---------- main/EDInitMod.F90 | 6 ++--- main/EDMainMod.F90 | 6 ++--- main/EDPftvarcon.F90 | 6 ++--- main/EDTypesMod.F90 | 2 -- main/FatesHistoryInterfaceMod.F90 | 5 ++-- main/FatesInterfaceMod.F90 | 22 ++++++++--------- main/FatesInventoryInitMod.F90 | 6 ++--- main/FatesRestartInterfaceMod.F90 | 8 +++---- parteh/PRTAllometricCNPMod.F90 | 4 ++-- parteh/PRTAllometricCarbonMod.F90 | 4 ++-- parteh/PRTGenericMod.F90 | 4 ++-- parteh/PRTParamsFATESMod.F90 | 18 +++++++------- testing/testing_shr/FatesFactoryMod.F90 | 8 +++---- 20 files changed, 89 insertions(+), 94 deletions(-) diff --git a/biogeochem/EDCohortDynamicsMod.F90 b/biogeochem/EDCohortDynamicsMod.F90 index 1acc2a7835..290c3ac647 100644 --- a/biogeochem/EDCohortDynamicsMod.F90 +++ b/biogeochem/EDCohortDynamicsMod.F90 @@ -68,8 +68,8 @@ Module EDCohortDynamicsMod use FatesAllometryMod , only : bstore_allom use FatesAllometryMod , only : ForceDBH use FatesAllometryMod , only : set_root_fraction - use PRTGenericMod, only : prt_carbon_allom_hyp - use PRTGenericMod, only : prt_cnp_flex_allom_hyp + use PRTGenericMod, only : fates_c_only + use PRTGenericMod, only : fates_cn use PRTGenericMod, only : prt_vartypes use PRTGenericMod, only : carbon12_element use PRTGenericMod, only : nitrogen_element @@ -251,12 +251,12 @@ subroutine InitPRTObject(prt) select case(hlm_parteh_mode) - case (prt_carbon_allom_hyp) + case (fates_c_only) allocate(c_allom_prt) prt => c_allom_prt - case (prt_cnp_flex_allom_hyp) + case (fates_cn) allocate(cnp_allom_prt) prt => cnp_allom_prt @@ -1030,7 +1030,7 @@ subroutine fuse_cohorts(currentSite, currentPatch, bc_in) currentCohort%frmort = (currentCohort%n*currentCohort%frmort + nextc%n*nextc%frmort)/newn ! Nutrients - if(hlm_parteh_mode .eq. prt_cnp_flex_allom_hyp) then + if (hlm_parteh_mode == fates_cn) then if(nextc%n > currentCohort%n) currentCohort%cnp_limiter = nextc%cnp_limiter diff --git a/biogeochem/EDPatchDynamicsMod.F90 b/biogeochem/EDPatchDynamicsMod.F90 index b1fc9af66d..a391c4e3cc 100644 --- a/biogeochem/EDPatchDynamicsMod.F90 +++ b/biogeochem/EDPatchDynamicsMod.F90 @@ -100,8 +100,6 @@ module EDPatchDynamicsMod use PRTGenericMod, only : struct_organ use PRTLossFluxesMod, only : PRTBurnLosses use FatesInterfaceTypesMod, only : hlm_parteh_mode - use PRTGenericMod, only : prt_carbon_allom_hyp - use PRTGenericMod, only : prt_cnp_flex_allom_hyp use SFParamsMod, only : SF_VAL_CWD_FRAC use EDParamsMod, only : logging_event_code use EDParamsMod, only : logging_export_frac diff --git a/biogeochem/EDPhysiologyMod.F90 b/biogeochem/EDPhysiologyMod.F90 index 58e2a0bc2c..6051349aa2 100644 --- a/biogeochem/EDPhysiologyMod.F90 +++ b/biogeochem/EDPhysiologyMod.F90 @@ -118,8 +118,8 @@ module EDPhysiologyMod use FatesAllometryMod , only : carea_allom use FatesAllometryMod , only : CheckIntegratedAllometries use FatesAllometryMod, only : set_root_fraction - use PRTGenericMod, only : prt_carbon_allom_hyp - use PRTGenericMod, only : prt_cnp_flex_allom_hyp + use PRTGenericMod, only : fates_c_only + use PRTGenericMod, only : fates_cn use PRTGenericMod, only : prt_vartypes use PRTGenericMod, only : leaf_organ use PRTGenericMod, only : sapw_organ, struct_organ @@ -2715,7 +2715,7 @@ subroutine recruitment(currentSite, currentPatch, bc_in) select case(hlm_parteh_mode) - case (prt_carbon_allom_hyp, prt_cnp_flex_allom_hyp) + case (fates_c_only, fates_cn) ! put all of the leaf mass into the first bin call SetState(prt, leaf_organ, element_id, m_leaf, 1) @@ -3317,7 +3317,7 @@ subroutine UpdateRecruitL2FR(csite) ! Difference in dbh (cm) to consider a plant was recruited fairly recently - if(hlm_parteh_mode .ne. prt_cnp_flex_allom_hyp) return + if (hlm_parteh_mode /= fates_cn) return rec_n(1:numpft,1:nclmax) = 0._r8 rec_l2fr0(1:numpft,1:nclmax) = 0._r8 @@ -3379,7 +3379,7 @@ subroutine UpdateRecruitStoich(csite) ! Update the total plant stoichiometry of a new recruit, based on the updated ! L2FR values - if(hlm_parteh_mode .ne. prt_cnp_flex_allom_hyp) return + if (hlm_parteh_mode /= fates_cn) return cpatch => csite%youngest_patch do while(associated(cpatch)) @@ -3417,7 +3417,7 @@ subroutine SetRecruitL2FR(csite) type(fates_cohort_type), pointer :: ccohort integer :: ft,cl - if(hlm_parteh_mode .ne. prt_cnp_flex_allom_hyp) return + if (hlm_parteh_mode /= fates_cn) return cpatch => csite%youngest_patch do while(associated(cpatch)) diff --git a/biogeochem/FatesCohortMod.F90 b/biogeochem/FatesCohortMod.F90 index 0ead43fc6e..4e45381019 100644 --- a/biogeochem/FatesCohortMod.F90 +++ b/biogeochem/FatesCohortMod.F90 @@ -12,8 +12,8 @@ module FatesCohortMod use FatesGlobals, only : fates_log use PRTGenericMod, only : max_nleafage use PRTGenericMod, only : prt_vartypes - use PRTGenericMod, only : prt_carbon_allom_hyp - use PRTGenericMod, only : prt_cnp_flex_allom_hyp + use PRTGenericMod, only : fates_c_only + use PRTGenericMod, only : fates_cn use PRTGenericMod, only : leaf_organ, fnrt_organ, sapw_organ use PRTGenericMod, only : repro_organ, store_organ, struct_organ use PRTGenericMod, only : carbon12_element @@ -609,7 +609,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 .eq. prt_cnp_flex_allom_hyp) then + if (hlm_parteh_mode == fates_cn) 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 @@ -727,7 +727,7 @@ subroutine Copy(this, copyCohort) copyCohort%year_net_uptake = this%year_net_uptake copyCohort%cnp_limiter = this%cnp_limiter - if (hlm_parteh_mode .eq. prt_cnp_flex_allom_hyp) then + if (hlm_parteh_mode == fates_cn) then copyCohort%cx_int = this%cx_int copyCohort%ema_dcxdt = this%ema_dcxdt copyCohort%cx0 = this%cx0 @@ -852,7 +852,7 @@ subroutine InitPRTBoundaryConditions(this) class(fates_cohort_type), intent(inout), target :: this select case(hlm_parteh_mode) - case (prt_carbon_allom_hyp) + case (fates_c_only) ! Register boundary conditions for the Carbon Only Allometric Hypothesis @@ -866,7 +866,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 (prt_cnp_flex_allom_hyp) + case (fates_cn) ! Register boundary conditions for the CNP Allometric Hypothesis diff --git a/biogeochem/FatesSoilBGCFluxMod.F90 b/biogeochem/FatesSoilBGCFluxMod.F90 index e0af2a9e0f..a9b4bf18b5 100644 --- a/biogeochem/FatesSoilBGCFluxMod.F90 +++ b/biogeochem/FatesSoilBGCFluxMod.F90 @@ -15,8 +15,8 @@ module FatesSoilBGCFluxMod use PRTGenericMod , only : num_elements use PRTGenericMod , only : element_list use PRTGenericMod , only : element_pos - use PRTGenericMod , only : prt_carbon_allom_hyp - use PRTGenericMod , only : prt_cnp_flex_allom_hyp + use PRTGenericMod , only : fates_c_only + use PRTGenericMod , only : fates_cn use PRTGenericMod , only : prt_vartypes use PRTGenericMod , only : leaf_organ use PRTGenericMod , only : sapw_organ, struct_organ @@ -133,7 +133,7 @@ subroutine UnPackNutrientAquisitionBCs(sites, bc_in) ! We can exit if this is a c-only simulation select case (hlm_parteh_mode) - case (prt_carbon_allom_hyp) + case (fates_c_only) ! These can now be zero'd do s = 1, nsites bc_in(s)%plant_nh4_uptake_flux(:,:) = 0._r8 @@ -269,7 +269,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==prt_cnp_flex_allom_hyp) ) return + ! if(.not.(hlm_use_ch4==itrue) .and. .not.(hlm_parteh_mode==fates_cn) ) return ! Initialize to zero bc_out%annavg_agnpp_pa(:) = 0._r8 @@ -282,7 +282,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==prt_cnp_flex_allom_hyp) ) + !if(.not.(hlm_use_ch4==itrue) .and. .not.(hlm_parteh_mode==fates_cn) ) cpatch => csite%oldest_patch do while (associated(cpatch)) diff --git a/biogeophys/FatesPlantRespPhotosynthMod.F90 b/biogeophys/FatesPlantRespPhotosynthMod.F90 index a88dc681fd..6fe11c2d63 100644 --- a/biogeophys/FatesPlantRespPhotosynthMod.F90 +++ b/biogeophys/FatesPlantRespPhotosynthMod.F90 @@ -44,8 +44,8 @@ module FATESPlantRespPhotosynthMod use FatesCohortMod, only : fates_cohort_type use FatesConstantsMod, only : lmrmodel_ryan_1991 use FatesConstantsMod, only : lmrmodel_atkin_etal_2017 - use PRTGenericMod, only : prt_carbon_allom_hyp - use PRTGenericMod, only : prt_cnp_flex_allom_hyp + use PRTGenericMod, only : fates_c_only + use PRTGenericMod, only : fates_cn use PRTGenericMod, only : carbon12_element use PRTGenericMod, only : nitrogen_element use PRTGenericMod, only : leaf_organ @@ -497,7 +497,7 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime) (hlm_use_planthydro.eq.itrue) .or. & (hlm_radiation_model .eq. twostr_solver ) .or. & (nleafage > 1) .or. & - (hlm_parteh_mode .ne. prt_carbon_allom_hyp ) ) then + (hlm_parteh_mode /= fates_c_only) ) then ! These values are incremented, therefore since @@ -564,11 +564,11 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime) ! Then scale this value at the top of the canopy for canopy depth ! Leaf nitrogen concentration at the top of the canopy (g N leaf / m**2 leaf) select case(hlm_parteh_mode) - case (prt_carbon_allom_hyp) + case (fates_c_only) lnc_top = prt_params%nitr_stoich_p1(ft,prt_params%organ_param_id(leaf_organ))/slatop(ft) - case (prt_cnp_flex_allom_hyp) + case (fates_cn) leaf_c = currentCohort%prt%GetState(leaf_organ, carbon12_element) if( (leaf_c*slatop(ft)) > nearzero) then @@ -919,7 +919,7 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime) select case(hlm_parteh_mode) - case (prt_carbon_allom_hyp) + case (fates_c_only) live_stem_n = sapw_c_agw * prt_params%nitr_stoich_p1(ft,prt_params%organ_param_id(sapw_organ)) @@ -927,7 +927,7 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime) fnrt_n = fnrt_c * prt_params%nitr_stoich_p1(ft,prt_params%organ_param_id(fnrt_organ)) - case(prt_cnp_flex_allom_hyp) + case(fates_cn) live_stem_n = prt_params%allom_agb_frac(currentCohort%pft) * & currentCohort%prt%GetState(sapw_organ, nitrogen_element) diff --git a/functional_unit_testing/parteh/f90src/FatesCohortWrapMod.F90 b/functional_unit_testing/parteh/f90src/FatesCohortWrapMod.F90 index 4d5efcf241..7740818d40 100644 --- a/functional_unit_testing/parteh/f90src/FatesCohortWrapMod.F90 +++ b/functional_unit_testing/parteh/f90src/FatesCohortWrapMod.F90 @@ -35,8 +35,8 @@ module FatesCohortWrapMod use PRTGenericMod, only : carbon12_element use PRTGenericMod, only : SetState use PRTGenericMod, only : prt_global - use PRTGenericMod, only : prt_carbon_allom_hyp - use PRTGenericMod, only : prt_cnp_flex_allom_hyp + use PRTGenericMod, only : fates_c_only + use PRTGenericMod, only : fates_cn use PRTAllometricCarbonMod, only : callom_prt_vartypes use PRTAllometricCarbonMod, only : ac_bc_inout_id_netdc @@ -257,12 +257,12 @@ subroutine CohortPySet(ipft,hgt_min,canopy_trim) ! ----------------------------------------------------- select case(ccohort%parteh_mode) - case (prt_carbon_allom_hyp) + case (fates_c_only) prt_global => prt_global_ac allocate(callom_prt) ccohort%prt => callom_prt - case(prt_cnp_flex_allom_hyp) + case(fates_cn) prt_global => prt_global_acnp allocate(cnpallom_prt) ccohort%prt => cnpallom_prt @@ -276,7 +276,7 @@ subroutine CohortPySet(ipft,hgt_min,canopy_trim) call ccohort%prt%InitPRTVartype() select case(ccohort%parteh_mode) - case (prt_carbon_allom_hyp) + case (fates_c_only) call SetState(ccohort%prt,leaf_organ, carbon12_element, leaf_c) call SetState(ccohort%prt,fnrt_organ, carbon12_element, fnrt_c) @@ -291,7 +291,7 @@ subroutine CohortPySet(ipft,hgt_min,canopy_trim) call ccohort%prt%RegisterBCIn(ac_bc_in_id_pft,bc_ival = ccohort%pft) call ccohort%prt%RegisterBCIn(ac_bc_in_id_ctrim,bc_rval = ccohort%canopy_trim) - case (prt_cnp_flex_allom_hyp) + case (fates_cn) ! Initializing with the target stoichiometric ratios ! (OR you can initialize with the minimum ratios too.... p2) @@ -394,7 +394,7 @@ subroutine WrapDailyPRT(ipft,daily_carbon_gain,canopy_trim,flush_c,drop_frac_c,l call PRTMaintTurnover(ccohort%prt, ipft, is_drought) select case(ccohort%parteh_mode) - case (prt_carbon_allom_hyp) + case (fates_c_only) prt_global => prt_global_ac ccohort%daily_carbon_gain = daily_carbon_gain @@ -403,7 +403,7 @@ subroutine WrapDailyPRT(ipft,daily_carbon_gain,canopy_trim,flush_c,drop_frac_c,l ccohort%daily_r_grow = 0.0_r8 ccohort%carbon_root_efflux = 0.0_r8 - case (prt_cnp_flex_allom_hyp) + case (fates_cn) prt_global => prt_global_acnp ccohort%daily_carbon_gain = daily_carbon_gain @@ -457,9 +457,9 @@ subroutine WrapQueryVars(ipft,crowndamage, leaf_area,crown_area,agb,store_c,targ canopy_lai(:) = 0._r8 select case(ccohort%parteh_mode) - case (prt_carbon_allom_hyp) + case (fates_c_only) prt_global => prt_global_ac - case (prt_cnp_flex_allom_hyp) + case (fates_cn) prt_global => prt_global_acnp end select @@ -547,9 +547,9 @@ subroutine WrapQueryDiagnostics(ipft, dbh, & ccohort => cohort_array(ipft) select case(ccohort%parteh_mode) - case (prt_carbon_allom_hyp ) + case (fates_c_only ) prt_global => prt_global_ac - case (prt_cnp_flex_allom_hyp) + case (fates_cn) prt_global => prt_global_acnp end select diff --git a/main/EDInitMod.F90 b/main/EDInitMod.F90 index 314a93adbd..b6b0bc8de5 100644 --- a/main/EDInitMod.F90 +++ b/main/EDInitMod.F90 @@ -79,8 +79,8 @@ module EDInitMod use FatesAllometryMod , only : carea_allom use PRTGenericMod , only : StorageNutrientTarget use FatesInterfaceTypesMod, only : hlm_parteh_mode - use PRTGenericMod, only : prt_carbon_allom_hyp - use PRTGenericMod, only : prt_cnp_flex_allom_hyp + use PRTGenericMod, only : fates_c_only + use PRTGenericMod, only : fates_cn use PRTGenericMod, only : prt_vartypes use PRTGenericMod, only : leaf_organ use PRTGenericMod, only : fnrt_organ @@ -1310,7 +1310,7 @@ subroutine init_cohorts(site_in, patch_in, bc_in) end select select case(hlm_parteh_mode) - case (prt_carbon_allom_hyp, prt_cnp_flex_allom_hyp ) + case (fates_c_only, fates_cn ) ! Put all of the leaf mass into the first bin call SetState(prt, leaf_organ, element_id, m_leaf, 1) do iage = 2,nleafage diff --git a/main/EDMainMod.F90 b/main/EDMainMod.F90 index bfba6d7d56..54113c0c6e 100644 --- a/main/EDMainMod.F90 +++ b/main/EDMainMod.F90 @@ -27,8 +27,8 @@ module EDMainMod use FatesInterfaceTypesMod , only : hlm_masterproc use FatesInterfaceTypesMod , only : numpft use FatesInterfaceTypesMod , only : hlm_use_nocomp - use PRTGenericMod , only : prt_carbon_allom_hyp - use PRTGenericMod , only : prt_cnp_flex_allom_hyp + use PRTGenericMod , only : fates_c_only + use PRTGenericMod , only : fates_cn use PRTGenericMod , only : nitrogen_element use PRTGenericMod , only : phosphorus_element use EDCohortDynamicsMod , only : terminate_cohorts @@ -748,7 +748,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 (prt_cnp_flex_allom_hyp) + case (fates_cn) call fates_hist%update_history_nutrflux(currentSite) end select diff --git a/main/EDPftvarcon.F90 b/main/EDPftvarcon.F90 index 835ffab36f..0505d88c0e 100644 --- a/main/EDPftvarcon.F90 +++ b/main/EDPftvarcon.F90 @@ -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 : prt_cnp_flex_allom_hyp,prt_carbon_allom_hyp + use PRTGenericMod, only : fates_cn, fates_c_only use FatesInterfaceTypesMod, only : hlm_nitrogen_spec, hlm_phosphorus_spec use FatesInterfaceTypesMod, only : hlm_parteh_mode use FatesInterfaceTypesMod, only : hlm_nu_com @@ -1714,7 +1714,7 @@ subroutine FatesCheckParams(is_master) if(.not.is_master) return select case (hlm_parteh_mode) - case (prt_cnp_flex_allom_hyp) + case (fates_cn) ! Check to see if either RD/ECA/MIC is turned on @@ -1792,7 +1792,7 @@ subroutine FatesCheckParams(is_master) end if end if - case (prt_carbon_allom_hyp) + case (fates_c_only) ! No additional checks needed for now. continue diff --git a/main/EDTypesMod.F90 b/main/EDTypesMod.F90 index c21cdd6fe1..77864ed282 100644 --- a/main/EDTypesMod.F90 +++ b/main/EDTypesMod.F90 @@ -15,8 +15,6 @@ module EDTypesMod use PRTGenericMod, only : prt_vartypes use PRTGenericMod, only : leaf_organ, fnrt_organ, sapw_organ use PRTGenericMod, only : repro_organ, store_organ, struct_organ - use PRTGenericMod, only : prt_carbon_allom_hyp - use PRTGenericMod, only : prt_cnp_flex_allom_hyp use PRTGenericMod, only : num_organ_types use PRTGenericMod, only : num_elements use PRTGenericMod, only : element_list diff --git a/main/FatesHistoryInterfaceMod.F90 b/main/FatesHistoryInterfaceMod.F90 index 86d3bbeddb..cb0628ea9e 100644 --- a/main/FatesHistoryInterfaceMod.F90 +++ b/main/FatesHistoryInterfaceMod.F90 @@ -22,7 +22,7 @@ module FatesHistoryInterfaceMod use FatesConstantsMod , only : ican_upper use PRTGenericMod , only : element_pos use PRTGenericMod , only : num_elements - use PRTGenericMod , only : prt_cnp_flex_allom_hyp + use PRTGenericMod , only : fates_cn use EDTypesMod , only : site_fluxdiags_type use EDTypesMod , only : elem_diag_type use EDtypesMod , only : ed_site_type @@ -120,7 +120,6 @@ module FatesHistoryInterfaceMod use PRTGenericMod , only : struct_organ, store_organ, repro_organ use PRTGenericMod , only : carbon12_element use PRTGenericMod , only : nitrogen_element, phosphorus_element - use PRTGenericMod , only : prt_carbon_allom_hyp use PRTAllometricCNPMod , only : stoich_max,stoich_growth_min use FatesSizeAgeTypeIndicesMod, only : get_layersizetype_class_index use FatesSizeAgeTypeIndicesMod, only : get_age_class_index @@ -2790,7 +2789,7 @@ subroutine update_history_dyn_sitelevel(this,nc,nsites,sites,bc_in) 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 == prt_cnp_flex_allom_hyp) then + if (hlm_parteh_mode == fates_cn) 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 diff --git a/main/FatesInterfaceMod.F90 b/main/FatesInterfaceMod.F90 index 555fa526c1..c64db9b5f1 100644 --- a/main/FatesInterfaceMod.F90 +++ b/main/FatesInterfaceMod.F90 @@ -87,8 +87,8 @@ module FatesInterfaceMod use PRTGenericMod , only : element_list use PRTGenericMod , only : element_pos use EDParamsMod , only : eca_plant_escalar - use PRTGenericMod , only : prt_carbon_allom_hyp - use PRTGenericMod , only : prt_cnp_flex_allom_hyp + use PRTGenericMod , only : fates_c_only + use PRTGenericMod , only : fates_cn use PRTGenericMod , only : carbon12_element use PRTGenericMod , only : nitrogen_element use PRTGenericMod , only : phosphorus_element @@ -336,7 +336,7 @@ subroutine zero_bcs(fates,s) ! Fates -> BGC fragmentation mass fluxes select case(hlm_parteh_mode) - case(prt_carbon_allom_hyp) + case(fates_c_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 @@ -346,7 +346,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(prt_cnp_flex_allom_hyp) + case(fates_cn) fates%bc_in(s)%plant_nh4_uptake_flux(:,:) = 0._r8 fates%bc_in(s)%plant_no3_uptake_flux(:,:) = 0._r8 @@ -474,7 +474,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 .eq. prt_cnp_flex_allom_hyp) then + if (hlm_parteh_mode == fates_cn) 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)) @@ -673,7 +673,7 @@ subroutine allocate_bcout(bc_out, nlevsoil_in, nlevdecomp_in) ! Fates -> BGC fragmentation mass fluxes select case(hlm_parteh_mode) - case(prt_carbon_allom_hyp) + case(fates_c_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)) @@ -683,7 +683,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(prt_cnp_flex_allom_hyp) + case(fates_cn) 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)) @@ -917,7 +917,7 @@ subroutine SetFatesGlobalElements2(use_fates) p_uptake_mode = coupled_p_uptake end if - if (hlm_parteh_mode .eq. prt_cnp_flex_allom_hyp ) then + if (hlm_parteh_mode == fates_cn) then if((p_uptake_mode==coupled_p_uptake) .or. (n_uptake_mode==coupled_n_uptake))then max_comp_per_site = fates_maxElementsPerSite @@ -1105,7 +1105,7 @@ subroutine InitPARTEHGlobals() ! automatically. select case(hlm_parteh_mode) - case(prt_carbon_allom_hyp) + case(fates_c_only) num_elements = 1 allocate(element_list(num_elements)) @@ -1115,7 +1115,7 @@ subroutine InitPARTEHGlobals() call InitPRTGlobalAllometricCarbon() - case(prt_cnp_flex_allom_hyp) + case(fates_cn) num_elements = 3 allocate(element_list(num_elements)) @@ -1678,7 +1678,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 .eq. prt_cnp_flex_allom_hyp))then + (hlm_parteh_mode == fates_cn)) 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__)) diff --git a/main/FatesInventoryInitMod.F90 b/main/FatesInventoryInitMod.F90 index 6673f4b819..83fe451141 100644 --- a/main/FatesInventoryInitMod.F90 +++ b/main/FatesInventoryInitMod.F90 @@ -58,8 +58,8 @@ module FatesInventoryInitMod use EDPftvarcon , only : EDPftvarcon_inst use FatesInterfaceTypesMod, only : hlm_parteh_mode use EDCohortDynamicsMod, only : InitPRTObject - use PRTGenericMod, only : prt_carbon_allom_hyp - use PRTGenericMod, only : prt_cnp_flex_allom_hyp + use PRTGenericMod, only : fates_c_only + use PRTGenericMod, only : fates_cn use PRTGenericMod, only : prt_vartypes use PRTGenericMod, only : leaf_organ use PRTGenericMod, only : fnrt_organ @@ -1105,7 +1105,7 @@ subroutine set_inventory_cohort_type1(csite,bc_in,css_file_unit,npatches, & end select select case(hlm_parteh_mode) - case (prt_carbon_allom_hyp,prt_cnp_flex_allom_hyp ) + case (fates_c_only, fates_cn) ! Equally distribute leaf mass into available age-bins do iage = 1,nleafage diff --git a/main/FatesRestartInterfaceMod.F90 b/main/FatesRestartInterfaceMod.F90 index f2c78051a1..12d98c407d 100644 --- a/main/FatesRestartInterfaceMod.F90 +++ b/main/FatesRestartInterfaceMod.F90 @@ -35,7 +35,7 @@ module FatesRestartInterfaceMod use FatesHydraulicsMemMod, only : nlevsoi_hyd_max use FatesPlantHydraulicsMod, only : UpdatePlantPsiFTCFromTheta use PRTGenericMod, only : prt_global - use PRTGenericMod, only : prt_cnp_flex_allom_hyp + use PRTGenericMod, only : fates_cn use EDCohortDynamicsMod, only : InitPRTObject use FatesPlantHydraulicsMod, only : InitHydrCohort use FatesInterfaceTypesMod, only : nlevsclass @@ -798,7 +798,7 @@ subroutine define_restart_vars(this, initialize_variables) long_name='ed cohort - l2fr', units='fraction', flushval = flushzero, & hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_l2fr_co ) - if(hlm_parteh_mode .eq. prt_cnp_flex_allom_hyp) then + if (hlm_parteh_mode == fates_cn) then call this%set_restart_var(vname='fates_cx_int', vtype=cohort_r8, & long_name='ed cohort - emacx', units='fraction', flushval = flushzero, & @@ -2447,7 +2447,7 @@ subroutine set_restart_vectors(this,nc,nsites,sites) rio_l2fr_co(io_idx_co) = ccohort%l2fr - if(hlm_parteh_mode .eq. prt_cnp_flex_allom_hyp) then + if (hlm_parteh_mode == fates_cn) then this%rvars(ir_cx_int_co)%r81d(io_idx_co) = ccohort%cx_int this%rvars(ir_emadcxdt_co)%r81d(io_idx_co) = ccohort%ema_dcxdt this%rvars(ir_cx0_co)%r81d(io_idx_co) = ccohort%cx0 @@ -3428,7 +3428,7 @@ subroutine get_restart_vectors(this, nc, nsites, sites) call this%GetCohortRealVector(ccohort%year_net_uptake,nlevleaf,ir_year_net_up_co,io_idx_co) - if(hlm_parteh_mode .eq. prt_cnp_flex_allom_hyp) then + if (hlm_parteh_mode == fates_cn) then ccohort%cx_int = this%rvars(ir_cx_int_co)%r81d(io_idx_co) ccohort%ema_dcxdt = this%rvars(ir_emadcxdt_co)%r81d(io_idx_co) ccohort%cx0 = this%rvars(ir_cx0_co)%r81d(io_idx_co) diff --git a/parteh/PRTAllometricCNPMod.F90 b/parteh/PRTAllometricCNPMod.F90 index 47d6d95443..1eb70703f6 100644 --- a/parteh/PRTAllometricCNPMod.F90 +++ b/parteh/PRTAllometricCNPMod.F90 @@ -26,7 +26,7 @@ module PRTAllometricCNPMod use PRTGenericMod , only : repro_organ use PRTGenericMod , only : struct_organ use PRTGenericMod , only : num_organ_types - use PRTGenericMod , only : prt_cnp_flex_allom_hyp + use PRTGenericMod , only : fates_cn use PRTGenericMod , only : StorageNutrientTarget use FatesAllometryMod , only : bleaf @@ -309,7 +309,7 @@ subroutine InitPRTGlobalAllometricCNP() prt_global_acnp%hyp_name = 'Allometric Flexible C+N+P' - prt_global_acnp%hyp_id = prt_cnp_flex_allom_hyp + prt_global_acnp%hyp_id = fates_cn call prt_global_acnp%ZeroGlobal() diff --git a/parteh/PRTAllometricCarbonMod.F90 b/parteh/PRTAllometricCarbonMod.F90 index c5e46f783e..20be6ff10b 100644 --- a/parteh/PRTAllometricCarbonMod.F90 +++ b/parteh/PRTAllometricCarbonMod.F90 @@ -23,7 +23,7 @@ module PRTAllometricCarbonMod use PRTGenericMod , only : repro_organ use PRTGenericMod , only : struct_organ use PRTGenericMod , only : un_initialized - use PRTGenericMod , only : prt_carbon_allom_hyp + use PRTGenericMod , only : fates_c_only use FatesAllometryMod , only : bleaf use FatesAllometryMod , only : bsap_allom @@ -209,7 +209,7 @@ subroutine InitPRTGlobalAllometricCarbon() prt_global_ac%hyp_name = 'Allometric Carbon Only' - prt_global_ac%hyp_id = prt_carbon_allom_hyp + prt_global_ac%hyp_id = fates_c_only ! Set mapping tables to zero call prt_global_ac%ZeroGlobal() diff --git a/parteh/PRTGenericMod.F90 b/parteh/PRTGenericMod.F90 index 573a99cf3a..8425bcff61 100644 --- a/parteh/PRTGenericMod.F90 +++ b/parteh/PRTGenericMod.F90 @@ -66,8 +66,8 @@ module PRTGenericMod ! These should each have their own module ! ------------------------------------------------------------------------------------- - integer, parameter, public :: prt_carbon_allom_hyp = 1 - integer, parameter, public :: prt_cnp_flex_allom_hyp = 2 + integer, parameter, public :: fates_c_only = 1 + integer, parameter, public :: fates_cn = 2 ! ------------------------------------------------------------------------------------- ! Organ types diff --git a/parteh/PRTParamsFATESMod.F90 b/parteh/PRTParamsFATESMod.F90 index a668d6529d..754c9f1452 100644 --- a/parteh/PRTParamsFATESMod.F90 +++ b/parteh/PRTParamsFATESMod.F90 @@ -17,7 +17,7 @@ module PRTInitParamsFatesMod use FatesGlobals, only : fates_log use shr_log_mod, only : errMsg => shr_log_errMsg use EDPftvarcon, only : EDPftvarcon_inst - use PRTGenericMod, only : prt_cnp_flex_allom_hyp,prt_carbon_allom_hyp + use PRTGenericMod, only : fates_cn, fates_c_only use FatesAllometryMod , only : h_allom use FatesAllometryMod , only : h2d_allom use FatesAllometryMod , only : bagw_allom @@ -1142,7 +1142,7 @@ subroutine PRTCheckParams(is_master) ! Check to make sure the organ ids are valid if this is the ! cnp_flex_allom_hypothesis select case (hlm_parteh_mode) - case (prt_carbon_allom_hyp,prt_cnp_flex_allom_hyp) + case (fates_c_only,fates_cn) do io = 1,norgans if(prt_params%organ_id(io) == repro_organ) then @@ -1175,7 +1175,7 @@ subroutine PRTCheckParams(is_master) ! Make sure that the N fixation respiration surcharge fraction is ! between 0 and 1 - if (hlm_parteh_mode .eq. prt_cnp_flex_allom_hyp) then + if (hlm_parteh_mode == fates_cn) then if(any(prt_params%nfix_mresp_scfrac(:)<0._r8) .or. any(prt_params%nfix_mresp_scfrac(:)>1.0_r8)) then write(fates_log(),*) '---~---' write(fates_log(),*) 'The N fixation surcharge nfix_mresp_sfrac (fates_nfix1) must be between 0-1.' @@ -1525,7 +1525,7 @@ subroutine PRTCheckParams(is_master) end if select case (hlm_parteh_mode) - case (prt_cnp_flex_allom_hyp) + case (fates_cn) ! Make sure nutrient storage fractions are positive if( prt_params%nitr_store_ratio(ipft) < 0._r8 ) then @@ -1621,7 +1621,7 @@ subroutine PRTCheckParams(is_master) ! Growth respiration - ! if (parteh_mode .eq. prt_carbon_allom_hyp) then + ! if (parteh_mode .eq. fates_c_only) then if ( ( prt_params%grperc(ipft) < 0.0_r8) .or. & ( prt_params%grperc(ipft) > 1.0_r8 ) ) then write(fates_log(),*) "---~---" @@ -1632,7 +1632,7 @@ subroutine PRTCheckParams(is_master) write(fates_log(),*) '' nerror = nerror + 1 end if -! elseif(parteh_mode .eq. prt_cnp_flex_allom_hyp) then +! elseif(parteh_mode .eq. fates_cn) then ! if ( ( any(prt_params%grperc_organ(ipft,:) < 0.0_r8)) .or. & ! ( any(prt_params%grperc_organ(ipft,:) >= 1.0_r8)) ) then ! write(fates_log(),*) "---~---" @@ -1646,7 +1646,7 @@ subroutine PRTCheckParams(is_master) ! end if select case (hlm_parteh_mode) - case (prt_carbon_allom_hyp,prt_cnp_flex_allom_hyp) + case (fates_c_only, fates_cn) ! The first nitrogen stoichiometry is used in all cases if ( (any(prt_params%nitr_stoich_p1(ipft,:) < 0.0_r8)) .or. & (any(prt_params%nitr_stoich_p1(ipft,:) >= 1.0_r8))) then @@ -1662,7 +1662,7 @@ subroutine PRTCheckParams(is_master) end select select case (hlm_parteh_mode) - case (prt_cnp_flex_allom_hyp) + case (fates_cn) do i = 1,norgans if ( (prt_params%nitr_stoich_p1(ipft,i) < 0._r8) .or. & @@ -1671,7 +1671,7 @@ subroutine PRTCheckParams(is_master) (prt_params%phos_stoich_p1(ipft,i) > 1._r8) ) then write(fates_log(),*) "---~---" write(fates_log(),*) 'When the C,N,P allocation hypothesis with flexible' - write(fates_log(),*) 'stoichiometry is turned on (prt_cnp_flex_allom_hyp),' + write(fates_log(),*) 'stoichiometry is turned on (fates_cn),' write(fates_log(),*) 'all stoichiometries must be greater than or equal to zero,' write(fates_log(),*) 'and less than 1 (probably way less than 1).' write(fates_log(),*) 'You specified an organ/pft less than zero.' diff --git a/testing/testing_shr/FatesFactoryMod.F90 b/testing/testing_shr/FatesFactoryMod.F90 index 1f4446887c..3467b867e6 100644 --- a/testing/testing_shr/FatesFactoryMod.F90 +++ b/testing/testing_shr/FatesFactoryMod.F90 @@ -40,8 +40,8 @@ module FatesFactoryMod use PRTGenericMod, only : carbon12_element use PRTGenericMod, only : nitrogen_element use PRTGenericMod, only : phosphorus_element - use PRTGenericMod, only : prt_carbon_allom_hyp - use PRTGenericMod, only : prt_cnp_flex_allom_hyp + use PRTGenericMod, only : fates_c_only + use PRTGenericMod, only : fates_cn use PRTGenericMod, only : StorageNutrientTarget use PRTAllometricCarbonMod, only : InitPRTGlobalAllometricCarbon use FatesAllometryMod, only : h_allom @@ -81,7 +81,7 @@ subroutine InitializeGlobals(step_size) integer :: i ! looping index ! initialize some values - hlm_parteh_mode = prt_carbon_allom_hyp + hlm_parteh_mode = fates_c_only num_elements = 1 allocate(element_list(num_elements)) element_list(1) = carbon12_element @@ -177,7 +177,7 @@ subroutine PRTFactory(prt, pft, c_struct, c_leaf, c_fnrt, c_sapw, c_store) select case(hlm_parteh_mode) - case (prt_carbon_allom_hyp, prt_cnp_flex_allom_hyp) + case (fates_c_only, fates_cn) ! Put all of the leaf mass into the first bin call SetState(prt, leaf_organ, element_id, m_leaf, 1) do iage = 2, nleafage From 97839f187e44599c3183afa34fd5de16982560a3 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 17 Oct 2025 18:10:05 -0600 Subject: [PATCH 02/13] Error check recommended in https://github.com/NGEET/fates/issues/1454 --- main/FatesInterfaceMod.F90 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main/FatesInterfaceMod.F90 b/main/FatesInterfaceMod.F90 index c64db9b5f1..8451bc7465 100644 --- a/main/FatesInterfaceMod.F90 +++ b/main/FatesInterfaceMod.F90 @@ -914,6 +914,10 @@ subroutine SetFatesGlobalElements2(use_fates) if (any(abs(EDPftvarcon_inst%prescribed_puptake(:)) > nearzero )) then p_uptake_mode = prescribed_p_uptake else + if (trim(hlm_name) == 'CLM') then + write(fates_log(), *) 'hlm_name cannot be CLM while prescribed_puptake == 0, because the CLM does not do prognostic phosphorus. Exiting. ' + call endrun(msg=errMsg(sourcefile, __LINE__)) + end if p_uptake_mode = coupled_p_uptake end if From b2a1da62afbf2dee82df50decc8b781f9ab7cfa9 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 8 Dec 2025 12:23:33 -0700 Subject: [PATCH 03/13] Fix site_npp unit conversion from /s to /yr from code review w Ryan K. --- main/FatesInterfaceMod.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main/FatesInterfaceMod.F90 b/main/FatesInterfaceMod.F90 index 8451bc7465..ff0be38e0f 100644 --- a/main/FatesInterfaceMod.F90 +++ b/main/FatesInterfaceMod.F90 @@ -2322,9 +2322,9 @@ subroutine UpdateFatesRMeansTStep(sites,bc_in, bc_out) do while (associated(ccohort)) ! call ccohort%tveg_lpa%UpdateRMean(bc_in(s)%t_veg_pa(ifp)) if(.not.ccohort%isnew)then - ! [kgC/plant/yr] -> [gC/m2/s] + ! [kgC/plant/yr] -> [gC/m2/yr] site_npp = site_npp + ccohort%npp_acc_hold * ccohort%n*area_inv * & - g_per_kg * hlm_days_per_year / sec_per_day + g_per_kg end if ccohort => ccohort%shorter end do From 3c82e7bc6e289bca136bb547e814ed3a1f6a3dc5 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 10 Dec 2025 14:56:37 -0700 Subject: [PATCH 04/13] Remove commented out code that's obsolete --- parteh/PRTParamsFATESMod.F90 | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/parteh/PRTParamsFATESMod.F90 b/parteh/PRTParamsFATESMod.F90 index 754c9f1452..f46d269850 100644 --- a/parteh/PRTParamsFATESMod.F90 +++ b/parteh/PRTParamsFATESMod.F90 @@ -1621,7 +1621,6 @@ subroutine PRTCheckParams(is_master) ! Growth respiration - ! if (parteh_mode .eq. fates_c_only) then if ( ( prt_params%grperc(ipft) < 0.0_r8) .or. & ( prt_params%grperc(ipft) > 1.0_r8 ) ) then write(fates_log(),*) "---~---" @@ -1632,18 +1631,6 @@ subroutine PRTCheckParams(is_master) write(fates_log(),*) '' nerror = nerror + 1 end if -! elseif(parteh_mode .eq. fates_cn) then -! if ( ( any(prt_params%grperc_organ(ipft,:) < 0.0_r8)) .or. & -! ( any(prt_params%grperc_organ(ipft,:) >= 1.0_r8)) ) then -! write(fates_log(),*) "---~---" -! write(fates_log(),*) ' PFT#: ',ipft -! write(fates_log(),*) ' Growth respiration must be between 0 and 1: ',prt_params%grperc_organ(ipft,:) -! write(fates_log(),*) "---~---" -! write(fates_log(),*) '' -! write(fates_log(),*) '' -! nerror = nerror + 1 -! end if -! end if select case (hlm_parteh_mode) case (fates_c_only, fates_cn) From 47ef7ed289f4561d8a51d16fdba8a9448b641e17 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 10 Dec 2025 15:01:03 -0700 Subject: [PATCH 05/13] Move the error check recommended in https://github.com/NGEET/fates/issues/1454 --- main/FatesInterfaceMod.F90 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main/FatesInterfaceMod.F90 b/main/FatesInterfaceMod.F90 index ff0be38e0f..59aa3ae21a 100644 --- a/main/FatesInterfaceMod.F90 +++ b/main/FatesInterfaceMod.F90 @@ -914,15 +914,15 @@ subroutine SetFatesGlobalElements2(use_fates) if (any(abs(EDPftvarcon_inst%prescribed_puptake(:)) > nearzero )) then p_uptake_mode = prescribed_p_uptake else - if (trim(hlm_name) == 'CLM') then - write(fates_log(), *) 'hlm_name cannot be CLM while prescribed_puptake == 0, because the CLM does not do prognostic phosphorus. Exiting. ' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if p_uptake_mode = coupled_p_uptake end if if (hlm_parteh_mode == fates_cn) then + if (p_uptake_mode == coupled_p_uptake .and. trim(hlm_name) == 'CLM') then + write(fates_log(), *) 'CLM-FATES must have prescribed phosphorus when hlm_parteh_mode == fates_cn. To select prescribed phosphorus, set fates_cnp_prescribed_puptake > 1 (recommended 10) in the fates parameter file. Exiting. ' + call endrun(msg=errMsg(sourcefile, __LINE__)) + end if if((p_uptake_mode==coupled_p_uptake) .or. (n_uptake_mode==coupled_n_uptake))then max_comp_per_site = fates_maxElementsPerSite fates_np_comp_scaling = coupled_np_comp_scaling From 6d79db13861014392067bf753364acbab4b5a191 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 15 Dec 2025 17:45:36 -0700 Subject: [PATCH 06/13] Replace fates_cn with fates_cnp throughout --- biogeochem/EDCohortDynamicsMod.F90 | 6 +++--- biogeochem/EDPhysiologyMod.F90 | 10 +++++----- biogeochem/FatesCohortMod.F90 | 8 ++++---- biogeochem/FatesSoilBGCFluxMod.F90 | 6 +++--- biogeophys/FatesPlantRespPhotosynthMod.F90 | 6 +++--- .../parteh/f90src/FatesCohortWrapMod.F90 | 12 ++++++------ main/EDInitMod.F90 | 4 ++-- main/EDMainMod.F90 | 4 ++-- main/EDPftvarcon.F90 | 4 ++-- main/FatesHistoryInterfaceMod.F90 | 4 ++-- main/FatesInterfaceMod.F90 | 16 ++++++++-------- main/FatesInventoryInitMod.F90 | 4 ++-- main/FatesRestartInterfaceMod.F90 | 8 ++++---- parteh/PRTAllometricCNPMod.F90 | 4 ++-- parteh/PRTGenericMod.F90 | 2 +- parteh/PRTParamsFATESMod.F90 | 14 +++++++------- testing/testing_shr/FatesFactoryMod.F90 | 4 ++-- 17 files changed, 58 insertions(+), 58 deletions(-) diff --git a/biogeochem/EDCohortDynamicsMod.F90 b/biogeochem/EDCohortDynamicsMod.F90 index 290c3ac647..22848ae252 100644 --- a/biogeochem/EDCohortDynamicsMod.F90 +++ b/biogeochem/EDCohortDynamicsMod.F90 @@ -69,7 +69,7 @@ Module EDCohortDynamicsMod use FatesAllometryMod , only : ForceDBH use FatesAllometryMod , only : set_root_fraction use PRTGenericMod, only : fates_c_only - use PRTGenericMod, only : fates_cn + use PRTGenericMod, only : fates_cnp use PRTGenericMod, only : prt_vartypes use PRTGenericMod, only : carbon12_element use PRTGenericMod, only : nitrogen_element @@ -256,7 +256,7 @@ subroutine InitPRTObject(prt) allocate(c_allom_prt) prt => c_allom_prt - case (fates_cn) + case (fates_cnp) allocate(cnp_allom_prt) prt => cnp_allom_prt @@ -1030,7 +1030,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_cn) then + if (hlm_parteh_mode == fates_cnp) then if(nextc%n > currentCohort%n) currentCohort%cnp_limiter = nextc%cnp_limiter diff --git a/biogeochem/EDPhysiologyMod.F90 b/biogeochem/EDPhysiologyMod.F90 index 6051349aa2..5c03d6fbad 100644 --- a/biogeochem/EDPhysiologyMod.F90 +++ b/biogeochem/EDPhysiologyMod.F90 @@ -119,7 +119,7 @@ module EDPhysiologyMod use FatesAllometryMod , only : CheckIntegratedAllometries use FatesAllometryMod, only : set_root_fraction use PRTGenericMod, only : fates_c_only - use PRTGenericMod, only : fates_cn + use PRTGenericMod, only : fates_cnp use PRTGenericMod, only : prt_vartypes use PRTGenericMod, only : leaf_organ use PRTGenericMod, only : sapw_organ, struct_organ @@ -2715,7 +2715,7 @@ subroutine recruitment(currentSite, currentPatch, bc_in) select case(hlm_parteh_mode) - case (fates_c_only, fates_cn) + case (fates_c_only, fates_cnp) ! put all of the leaf mass into the first bin call SetState(prt, leaf_organ, element_id, m_leaf, 1) @@ -3317,7 +3317,7 @@ subroutine UpdateRecruitL2FR(csite) ! Difference in dbh (cm) to consider a plant was recruited fairly recently - if (hlm_parteh_mode /= fates_cn) return + if (hlm_parteh_mode /= fates_cnp) return rec_n(1:numpft,1:nclmax) = 0._r8 rec_l2fr0(1:numpft,1:nclmax) = 0._r8 @@ -3379,7 +3379,7 @@ subroutine UpdateRecruitStoich(csite) ! Update the total plant stoichiometry of a new recruit, based on the updated ! L2FR values - if (hlm_parteh_mode /= fates_cn) return + if (hlm_parteh_mode /= fates_cnp) return cpatch => csite%youngest_patch do while(associated(cpatch)) @@ -3417,7 +3417,7 @@ subroutine SetRecruitL2FR(csite) type(fates_cohort_type), pointer :: ccohort integer :: ft,cl - if (hlm_parteh_mode /= fates_cn) return + if (hlm_parteh_mode /= fates_cnp) return cpatch => csite%youngest_patch do while(associated(cpatch)) diff --git a/biogeochem/FatesCohortMod.F90 b/biogeochem/FatesCohortMod.F90 index 4e45381019..2c3ce64e50 100644 --- a/biogeochem/FatesCohortMod.F90 +++ b/biogeochem/FatesCohortMod.F90 @@ -13,7 +13,7 @@ module FatesCohortMod use PRTGenericMod, only : max_nleafage use PRTGenericMod, only : prt_vartypes use PRTGenericMod, only : fates_c_only - use PRTGenericMod, only : fates_cn + use PRTGenericMod, only : fates_cnp use PRTGenericMod, only : leaf_organ, fnrt_organ, sapw_organ use PRTGenericMod, only : repro_organ, store_organ, struct_organ use PRTGenericMod, only : carbon12_element @@ -609,7 +609,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_cn) then + if (hlm_parteh_mode == fates_cnp) 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 @@ -727,7 +727,7 @@ subroutine Copy(this, copyCohort) copyCohort%year_net_uptake = this%year_net_uptake copyCohort%cnp_limiter = this%cnp_limiter - if (hlm_parteh_mode == fates_cn) then + if (hlm_parteh_mode == fates_cnp) then copyCohort%cx_int = this%cx_int copyCohort%ema_dcxdt = this%ema_dcxdt copyCohort%cx0 = this%cx0 @@ -866,7 +866,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_cn) + case (fates_cnp) ! Register boundary conditions for the CNP Allometric Hypothesis diff --git a/biogeochem/FatesSoilBGCFluxMod.F90 b/biogeochem/FatesSoilBGCFluxMod.F90 index a9b4bf18b5..1202c64c32 100644 --- a/biogeochem/FatesSoilBGCFluxMod.F90 +++ b/biogeochem/FatesSoilBGCFluxMod.F90 @@ -16,7 +16,7 @@ module FatesSoilBGCFluxMod use PRTGenericMod , only : element_list use PRTGenericMod , only : element_pos use PRTGenericMod , only : fates_c_only - use PRTGenericMod , only : fates_cn + use PRTGenericMod , only : fates_cnp use PRTGenericMod , only : prt_vartypes use PRTGenericMod , only : leaf_organ use PRTGenericMod , only : sapw_organ, struct_organ @@ -269,7 +269,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_cn) ) return + ! if(.not.(hlm_use_ch4==itrue) .and. .not.(hlm_parteh_mode==fates_cnp) ) return ! Initialize to zero bc_out%annavg_agnpp_pa(:) = 0._r8 @@ -282,7 +282,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_cn) ) + !if(.not.(hlm_use_ch4==itrue) .and. .not.(hlm_parteh_mode==fates_cnp) ) cpatch => csite%oldest_patch do while (associated(cpatch)) diff --git a/biogeophys/FatesPlantRespPhotosynthMod.F90 b/biogeophys/FatesPlantRespPhotosynthMod.F90 index 6fe11c2d63..fa580afecb 100644 --- a/biogeophys/FatesPlantRespPhotosynthMod.F90 +++ b/biogeophys/FatesPlantRespPhotosynthMod.F90 @@ -45,7 +45,7 @@ module FATESPlantRespPhotosynthMod use FatesConstantsMod, only : lmrmodel_ryan_1991 use FatesConstantsMod, only : lmrmodel_atkin_etal_2017 use PRTGenericMod, only : fates_c_only - use PRTGenericMod, only : fates_cn + use PRTGenericMod, only : fates_cnp use PRTGenericMod, only : carbon12_element use PRTGenericMod, only : nitrogen_element use PRTGenericMod, only : leaf_organ @@ -568,7 +568,7 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime) lnc_top = prt_params%nitr_stoich_p1(ft,prt_params%organ_param_id(leaf_organ))/slatop(ft) - case (fates_cn) + case (fates_cnp) leaf_c = currentCohort%prt%GetState(leaf_organ, carbon12_element) if( (leaf_c*slatop(ft)) > nearzero) then @@ -927,7 +927,7 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime) fnrt_n = fnrt_c * prt_params%nitr_stoich_p1(ft,prt_params%organ_param_id(fnrt_organ)) - case(fates_cn) + case(fates_cnp) live_stem_n = prt_params%allom_agb_frac(currentCohort%pft) * & currentCohort%prt%GetState(sapw_organ, nitrogen_element) diff --git a/functional_unit_testing/parteh/f90src/FatesCohortWrapMod.F90 b/functional_unit_testing/parteh/f90src/FatesCohortWrapMod.F90 index 7740818d40..c5be10d449 100644 --- a/functional_unit_testing/parteh/f90src/FatesCohortWrapMod.F90 +++ b/functional_unit_testing/parteh/f90src/FatesCohortWrapMod.F90 @@ -36,7 +36,7 @@ module FatesCohortWrapMod use PRTGenericMod, only : SetState use PRTGenericMod, only : prt_global use PRTGenericMod, only : fates_c_only - use PRTGenericMod, only : fates_cn + use PRTGenericMod, only : fates_cnp use PRTAllometricCarbonMod, only : callom_prt_vartypes use PRTAllometricCarbonMod, only : ac_bc_inout_id_netdc @@ -262,7 +262,7 @@ subroutine CohortPySet(ipft,hgt_min,canopy_trim) allocate(callom_prt) ccohort%prt => callom_prt - case(fates_cn) + case(fates_cnp) prt_global => prt_global_acnp allocate(cnpallom_prt) ccohort%prt => cnpallom_prt @@ -291,7 +291,7 @@ subroutine CohortPySet(ipft,hgt_min,canopy_trim) call ccohort%prt%RegisterBCIn(ac_bc_in_id_pft,bc_ival = ccohort%pft) call ccohort%prt%RegisterBCIn(ac_bc_in_id_ctrim,bc_rval = ccohort%canopy_trim) - case (fates_cn) + case (fates_cnp) ! Initializing with the target stoichiometric ratios ! (OR you can initialize with the minimum ratios too.... p2) @@ -403,7 +403,7 @@ subroutine WrapDailyPRT(ipft,daily_carbon_gain,canopy_trim,flush_c,drop_frac_c,l ccohort%daily_r_grow = 0.0_r8 ccohort%carbon_root_efflux = 0.0_r8 - case (fates_cn) + case (fates_cnp) prt_global => prt_global_acnp ccohort%daily_carbon_gain = daily_carbon_gain @@ -459,7 +459,7 @@ subroutine WrapQueryVars(ipft,crowndamage, leaf_area,crown_area,agb,store_c,targ select case(ccohort%parteh_mode) case (fates_c_only) prt_global => prt_global_ac - case (fates_cn) + case (fates_cnp) prt_global => prt_global_acnp end select @@ -549,7 +549,7 @@ subroutine WrapQueryDiagnostics(ipft, dbh, & select case(ccohort%parteh_mode) case (fates_c_only ) prt_global => prt_global_ac - case (fates_cn) + case (fates_cnp) prt_global => prt_global_acnp end select diff --git a/main/EDInitMod.F90 b/main/EDInitMod.F90 index b6b0bc8de5..61d2da7275 100644 --- a/main/EDInitMod.F90 +++ b/main/EDInitMod.F90 @@ -80,7 +80,7 @@ module EDInitMod use PRTGenericMod , only : StorageNutrientTarget use FatesInterfaceTypesMod, only : hlm_parteh_mode use PRTGenericMod, only : fates_c_only - use PRTGenericMod, only : fates_cn + use PRTGenericMod, only : fates_cnp use PRTGenericMod, only : prt_vartypes use PRTGenericMod, only : leaf_organ use PRTGenericMod, only : fnrt_organ @@ -1310,7 +1310,7 @@ subroutine init_cohorts(site_in, patch_in, bc_in) end select select case(hlm_parteh_mode) - case (fates_c_only, fates_cn ) + case (fates_c_only, fates_cnp ) ! Put all of the leaf mass into the first bin call SetState(prt, leaf_organ, element_id, m_leaf, 1) do iage = 2,nleafage diff --git a/main/EDMainMod.F90 b/main/EDMainMod.F90 index 54113c0c6e..d587f53a25 100644 --- a/main/EDMainMod.F90 +++ b/main/EDMainMod.F90 @@ -28,7 +28,7 @@ module EDMainMod use FatesInterfaceTypesMod , only : numpft use FatesInterfaceTypesMod , only : hlm_use_nocomp use PRTGenericMod , only : fates_c_only - use PRTGenericMod , only : fates_cn + use PRTGenericMod , only : fates_cnp use PRTGenericMod , only : nitrogen_element use PRTGenericMod , only : phosphorus_element use EDCohortDynamicsMod , only : terminate_cohorts @@ -748,7 +748,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_cn) + case (fates_cnp) call fates_hist%update_history_nutrflux(currentSite) end select diff --git a/main/EDPftvarcon.F90 b/main/EDPftvarcon.F90 index 0505d88c0e..f5ba0fb7a2 100644 --- a/main/EDPftvarcon.F90 +++ b/main/EDPftvarcon.F90 @@ -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_cn, fates_c_only + use PRTGenericMod, only : fates_cnp, fates_c_only use FatesInterfaceTypesMod, only : hlm_nitrogen_spec, hlm_phosphorus_spec use FatesInterfaceTypesMod, only : hlm_parteh_mode use FatesInterfaceTypesMod, only : hlm_nu_com @@ -1714,7 +1714,7 @@ subroutine FatesCheckParams(is_master) if(.not.is_master) return select case (hlm_parteh_mode) - case (fates_cn) + case (fates_cnp) ! Check to see if either RD/ECA/MIC is turned on diff --git a/main/FatesHistoryInterfaceMod.F90 b/main/FatesHistoryInterfaceMod.F90 index cb0628ea9e..23321b8727 100644 --- a/main/FatesHistoryInterfaceMod.F90 +++ b/main/FatesHistoryInterfaceMod.F90 @@ -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_cn + use PRTGenericMod , only : fates_cnp use EDTypesMod , only : site_fluxdiags_type use EDTypesMod , only : elem_diag_type use EDtypesMod , only : ed_site_type @@ -2789,7 +2789,7 @@ subroutine update_history_dyn_sitelevel(this,nc,nsites,sites,bc_in) 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_cn) then + if (hlm_parteh_mode == fates_cnp) 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 diff --git a/main/FatesInterfaceMod.F90 b/main/FatesInterfaceMod.F90 index 59aa3ae21a..7ed5276794 100644 --- a/main/FatesInterfaceMod.F90 +++ b/main/FatesInterfaceMod.F90 @@ -88,7 +88,7 @@ module FatesInterfaceMod use PRTGenericMod , only : element_pos use EDParamsMod , only : eca_plant_escalar use PRTGenericMod , only : fates_c_only - use PRTGenericMod , only : fates_cn + use PRTGenericMod , only : fates_cnp use PRTGenericMod , only : carbon12_element use PRTGenericMod , only : nitrogen_element use PRTGenericMod , only : phosphorus_element @@ -346,7 +346,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_cn) + case(fates_cnp) fates%bc_in(s)%plant_nh4_uptake_flux(:,:) = 0._r8 fates%bc_in(s)%plant_no3_uptake_flux(:,:) = 0._r8 @@ -474,7 +474,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_cn) then + if (hlm_parteh_mode == fates_cnp) 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)) @@ -683,7 +683,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_cn) + case(fates_cnp) 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)) @@ -917,10 +917,10 @@ subroutine SetFatesGlobalElements2(use_fates) p_uptake_mode = coupled_p_uptake end if - if (hlm_parteh_mode == fates_cn) then + if (hlm_parteh_mode == fates_cnp) then if (p_uptake_mode == coupled_p_uptake .and. trim(hlm_name) == 'CLM') then - write(fates_log(), *) 'CLM-FATES must have prescribed phosphorus when hlm_parteh_mode == fates_cn. To select prescribed phosphorus, set fates_cnp_prescribed_puptake > 1 (recommended 10) in the fates parameter file. Exiting. ' + write(fates_log(), *) 'CLM-FATES must have prescribed phosphorus when hlm_parteh_mode == fates_cnp. To select prescribed phosphorus, set fates_cnp_prescribed_puptake > 1 (recommended 10) in the fates parameter file. Exiting. ' call endrun(msg=errMsg(sourcefile, __LINE__)) end if if((p_uptake_mode==coupled_p_uptake) .or. (n_uptake_mode==coupled_n_uptake))then @@ -1119,7 +1119,7 @@ subroutine InitPARTEHGlobals() call InitPRTGlobalAllometricCarbon() - case(fates_cn) + case(fates_cnp) num_elements = 3 allocate(element_list(num_elements)) @@ -1682,7 +1682,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_cn)) then + (hlm_parteh_mode == fates_cnp)) 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__)) diff --git a/main/FatesInventoryInitMod.F90 b/main/FatesInventoryInitMod.F90 index 83fe451141..ac1dc38462 100644 --- a/main/FatesInventoryInitMod.F90 +++ b/main/FatesInventoryInitMod.F90 @@ -59,7 +59,7 @@ module FatesInventoryInitMod use FatesInterfaceTypesMod, only : hlm_parteh_mode use EDCohortDynamicsMod, only : InitPRTObject use PRTGenericMod, only : fates_c_only - use PRTGenericMod, only : fates_cn + use PRTGenericMod, only : fates_cnp use PRTGenericMod, only : prt_vartypes use PRTGenericMod, only : leaf_organ use PRTGenericMod, only : fnrt_organ @@ -1105,7 +1105,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_cn) + case (fates_c_only, fates_cnp) ! Equally distribute leaf mass into available age-bins do iage = 1,nleafage diff --git a/main/FatesRestartInterfaceMod.F90 b/main/FatesRestartInterfaceMod.F90 index 12d98c407d..479c90bc7a 100644 --- a/main/FatesRestartInterfaceMod.F90 +++ b/main/FatesRestartInterfaceMod.F90 @@ -35,7 +35,7 @@ module FatesRestartInterfaceMod use FatesHydraulicsMemMod, only : nlevsoi_hyd_max use FatesPlantHydraulicsMod, only : UpdatePlantPsiFTCFromTheta use PRTGenericMod, only : prt_global - use PRTGenericMod, only : fates_cn + use PRTGenericMod, only : fates_cnp use EDCohortDynamicsMod, only : InitPRTObject use FatesPlantHydraulicsMod, only : InitHydrCohort use FatesInterfaceTypesMod, only : nlevsclass @@ -798,7 +798,7 @@ subroutine define_restart_vars(this, initialize_variables) long_name='ed cohort - l2fr', units='fraction', flushval = flushzero, & hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_l2fr_co ) - if (hlm_parteh_mode == fates_cn) then + if (hlm_parteh_mode == fates_cnp) then call this%set_restart_var(vname='fates_cx_int', vtype=cohort_r8, & long_name='ed cohort - emacx', units='fraction', flushval = flushzero, & @@ -2447,7 +2447,7 @@ subroutine set_restart_vectors(this,nc,nsites,sites) rio_l2fr_co(io_idx_co) = ccohort%l2fr - if (hlm_parteh_mode == fates_cn) then + if (hlm_parteh_mode == fates_cnp) then this%rvars(ir_cx_int_co)%r81d(io_idx_co) = ccohort%cx_int this%rvars(ir_emadcxdt_co)%r81d(io_idx_co) = ccohort%ema_dcxdt this%rvars(ir_cx0_co)%r81d(io_idx_co) = ccohort%cx0 @@ -3428,7 +3428,7 @@ subroutine get_restart_vectors(this, nc, nsites, sites) call this%GetCohortRealVector(ccohort%year_net_uptake,nlevleaf,ir_year_net_up_co,io_idx_co) - if (hlm_parteh_mode == fates_cn) then + if (hlm_parteh_mode == fates_cnp) then ccohort%cx_int = this%rvars(ir_cx_int_co)%r81d(io_idx_co) ccohort%ema_dcxdt = this%rvars(ir_emadcxdt_co)%r81d(io_idx_co) ccohort%cx0 = this%rvars(ir_cx0_co)%r81d(io_idx_co) diff --git a/parteh/PRTAllometricCNPMod.F90 b/parteh/PRTAllometricCNPMod.F90 index 1eb70703f6..dcff700370 100644 --- a/parteh/PRTAllometricCNPMod.F90 +++ b/parteh/PRTAllometricCNPMod.F90 @@ -26,7 +26,7 @@ module PRTAllometricCNPMod use PRTGenericMod , only : repro_organ use PRTGenericMod , only : struct_organ use PRTGenericMod , only : num_organ_types - use PRTGenericMod , only : fates_cn + use PRTGenericMod , only : fates_cnp use PRTGenericMod , only : StorageNutrientTarget use FatesAllometryMod , only : bleaf @@ -309,7 +309,7 @@ subroutine InitPRTGlobalAllometricCNP() prt_global_acnp%hyp_name = 'Allometric Flexible C+N+P' - prt_global_acnp%hyp_id = fates_cn + prt_global_acnp%hyp_id = fates_cnp call prt_global_acnp%ZeroGlobal() diff --git a/parteh/PRTGenericMod.F90 b/parteh/PRTGenericMod.F90 index 8425bcff61..b14cff887a 100644 --- a/parteh/PRTGenericMod.F90 +++ b/parteh/PRTGenericMod.F90 @@ -67,7 +67,7 @@ module PRTGenericMod ! ------------------------------------------------------------------------------------- integer, parameter, public :: fates_c_only = 1 - integer, parameter, public :: fates_cn = 2 + integer, parameter, public :: fates_cnp = 2 ! ------------------------------------------------------------------------------------- ! Organ types diff --git a/parteh/PRTParamsFATESMod.F90 b/parteh/PRTParamsFATESMod.F90 index f46d269850..275009eec2 100644 --- a/parteh/PRTParamsFATESMod.F90 +++ b/parteh/PRTParamsFATESMod.F90 @@ -17,7 +17,7 @@ module PRTInitParamsFatesMod use FatesGlobals, only : fates_log use shr_log_mod, only : errMsg => shr_log_errMsg use EDPftvarcon, only : EDPftvarcon_inst - use PRTGenericMod, only : fates_cn, fates_c_only + use PRTGenericMod, only : fates_cnp, fates_c_only use FatesAllometryMod , only : h_allom use FatesAllometryMod , only : h2d_allom use FatesAllometryMod , only : bagw_allom @@ -1142,7 +1142,7 @@ subroutine PRTCheckParams(is_master) ! Check to make sure the organ ids are valid if this is the ! cnp_flex_allom_hypothesis select case (hlm_parteh_mode) - case (fates_c_only,fates_cn) + case (fates_c_only,fates_cnp) do io = 1,norgans if(prt_params%organ_id(io) == repro_organ) then @@ -1175,7 +1175,7 @@ subroutine PRTCheckParams(is_master) ! Make sure that the N fixation respiration surcharge fraction is ! between 0 and 1 - if (hlm_parteh_mode == fates_cn) then + if (hlm_parteh_mode == fates_cnp) then if(any(prt_params%nfix_mresp_scfrac(:)<0._r8) .or. any(prt_params%nfix_mresp_scfrac(:)>1.0_r8)) then write(fates_log(),*) '---~---' write(fates_log(),*) 'The N fixation surcharge nfix_mresp_sfrac (fates_nfix1) must be between 0-1.' @@ -1525,7 +1525,7 @@ subroutine PRTCheckParams(is_master) end if select case (hlm_parteh_mode) - case (fates_cn) + case (fates_cnp) ! Make sure nutrient storage fractions are positive if( prt_params%nitr_store_ratio(ipft) < 0._r8 ) then @@ -1633,7 +1633,7 @@ subroutine PRTCheckParams(is_master) end if select case (hlm_parteh_mode) - case (fates_c_only, fates_cn) + case (fates_c_only, fates_cnp) ! The first nitrogen stoichiometry is used in all cases if ( (any(prt_params%nitr_stoich_p1(ipft,:) < 0.0_r8)) .or. & (any(prt_params%nitr_stoich_p1(ipft,:) >= 1.0_r8))) then @@ -1649,7 +1649,7 @@ subroutine PRTCheckParams(is_master) end select select case (hlm_parteh_mode) - case (fates_cn) + case (fates_cnp) do i = 1,norgans if ( (prt_params%nitr_stoich_p1(ipft,i) < 0._r8) .or. & @@ -1658,7 +1658,7 @@ subroutine PRTCheckParams(is_master) (prt_params%phos_stoich_p1(ipft,i) > 1._r8) ) then write(fates_log(),*) "---~---" write(fates_log(),*) 'When the C,N,P allocation hypothesis with flexible' - write(fates_log(),*) 'stoichiometry is turned on (fates_cn),' + write(fates_log(),*) 'stoichiometry is turned on (fates_cnp),' write(fates_log(),*) 'all stoichiometries must be greater than or equal to zero,' write(fates_log(),*) 'and less than 1 (probably way less than 1).' write(fates_log(),*) 'You specified an organ/pft less than zero.' diff --git a/testing/testing_shr/FatesFactoryMod.F90 b/testing/testing_shr/FatesFactoryMod.F90 index 3467b867e6..033da40cc9 100644 --- a/testing/testing_shr/FatesFactoryMod.F90 +++ b/testing/testing_shr/FatesFactoryMod.F90 @@ -41,7 +41,7 @@ module FatesFactoryMod use PRTGenericMod, only : nitrogen_element use PRTGenericMod, only : phosphorus_element use PRTGenericMod, only : fates_c_only - use PRTGenericMod, only : fates_cn + use PRTGenericMod, only : fates_cnp use PRTGenericMod, only : StorageNutrientTarget use PRTAllometricCarbonMod, only : InitPRTGlobalAllometricCarbon use FatesAllometryMod, only : h_allom @@ -177,7 +177,7 @@ subroutine PRTFactory(prt, pft, c_struct, c_leaf, c_fnrt, c_sapw, c_store) select case(hlm_parteh_mode) - case (fates_c_only, fates_cn) + case (fates_c_only, fates_cnp) ! Put all of the leaf mass into the first bin call SetState(prt, leaf_organ, element_id, m_leaf, 1) do iage = 2, nleafage From 0d268e09fb15ffee296143243b28204fe986ad1c Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 16 Dec 2025 18:38:14 -0700 Subject: [PATCH 07/13] Remove the new error check and update similar preexisting error check --- main/FatesInterfaceMod.F90 | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/main/FatesInterfaceMod.F90 b/main/FatesInterfaceMod.F90 index 7ed5276794..72b8f06f44 100644 --- a/main/FatesInterfaceMod.F90 +++ b/main/FatesInterfaceMod.F90 @@ -914,15 +914,18 @@ subroutine SetFatesGlobalElements2(use_fates) if (any(abs(EDPftvarcon_inst%prescribed_puptake(:)) > nearzero )) then p_uptake_mode = prescribed_p_uptake else + ! 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. + ! 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 (p_uptake_mode == coupled_p_uptake .and. trim(hlm_name) == 'CLM') then - write(fates_log(), *) 'CLM-FATES must have prescribed phosphorus when hlm_parteh_mode == fates_cnp. To select prescribed phosphorus, set fates_cnp_prescribed_puptake > 1 (recommended 10) in the fates parameter file. Exiting. ' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if if((p_uptake_mode==coupled_p_uptake) .or. (n_uptake_mode==coupled_n_uptake))then max_comp_per_site = fates_maxElementsPerSite fates_np_comp_scaling = coupled_np_comp_scaling @@ -1762,12 +1765,11 @@ subroutine set_fates_ctrlparms(tag,ival,rval,cval) call endrun(msg=errMsg(sourcefile, __LINE__)) end if - if(trim(hlm_name).eq.'CLM' .and. hlm_parteh_mode .eq. 2) then - if( sum(abs(EDPftvarcon_inst%prescribed_puptake(:))) 0' + if(trim(hlm_name) == 'CLM' .and. hlm_parteh_mode == fates_cnp) 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(), *) 'phosphorus boundary conditions for CLM (currently).' + write(fates_log(), *) 'prescribed_puptake must > 0 (recommended is 10)' call endrun(msg=errMsg(sourcefile, __LINE__)) end if end if From 27efbee5e43d31dcace435755399c00e1bc66f8c Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Fri, 16 Jan 2026 17:24:22 -0500 Subject: [PATCH 08/13] changed fates_cnp to carbon_nitrogen_phosphorus --- main/EDInitMod.F90 | 6 +++--- main/EDMainMod.F90 | 6 +++--- main/EDPftvarcon.F90 | 6 +++--- main/FatesHistoryInterfaceMod.F90 | 4 ++-- main/FatesInterfaceMod.F90 | 31 ++++++++++++++++--------------- main/FatesInventoryInitMod.F90 | 6 +++--- main/FatesRestartInterfaceMod.F90 | 9 +++++---- parteh/PRTGenericMod.F90 | 4 ++-- 8 files changed, 37 insertions(+), 35 deletions(-) diff --git a/main/EDInitMod.F90 b/main/EDInitMod.F90 index 48c4f47d8c..bbecba4a8b 100644 --- a/main/EDInitMod.F90 +++ b/main/EDInitMod.F90 @@ -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 @@ -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 diff --git a/main/EDMainMod.F90 b/main/EDMainMod.F90 index facfbcecfd..986be7e1a8 100644 --- a/main/EDMainMod.F90 +++ b/main/EDMainMod.F90 @@ -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 @@ -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 diff --git a/main/EDPftvarcon.F90 b/main/EDPftvarcon.F90 index de490ac778..385cc8e286 100644 --- a/main/EDPftvarcon.F90 +++ b/main/EDPftvarcon.F90 @@ -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 @@ -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 @@ -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 diff --git a/main/FatesHistoryInterfaceMod.F90 b/main/FatesHistoryInterfaceMod.F90 index ff6ab063cc..7014f1857f 100644 --- a/main/FatesHistoryInterfaceMod.F90 +++ b/main/FatesHistoryInterfaceMod.F90 @@ -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 @@ -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 diff --git a/main/FatesInterfaceMod.F90 b/main/FatesInterfaceMod.F90 index ea4dfcbf7e..0916680dc4 100644 --- a/main/FatesInterfaceMod.F90 +++ b/main/FatesInterfaceMod.F90 @@ -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 @@ -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 @@ -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 @@ -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)) @@ -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)) @@ -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)) @@ -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 @@ -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)) @@ -1173,7 +1173,7 @@ subroutine InitPARTEHGlobals() call InitPRTGlobalAllometricCarbon() - case(fates_cnp) + case(carbon_nitrogen_phosphorus) num_elements = 3 allocate(element_list(num_elements)) @@ -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__)) @@ -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__)) diff --git a/main/FatesInventoryInitMod.F90 b/main/FatesInventoryInitMod.F90 index 71d96783f7..f1dc937be1 100644 --- a/main/FatesInventoryInitMod.F90 +++ b/main/FatesInventoryInitMod.F90 @@ -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 @@ -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 diff --git a/main/FatesRestartInterfaceMod.F90 b/main/FatesRestartInterfaceMod.F90 index 1a4d873735..316f56c33b 100644 --- a/main/FatesRestartInterfaceMod.F90 +++ b/main/FatesRestartInterfaceMod.F90 @@ -36,7 +36,8 @@ module FatesRestartInterfaceMod use FatesHydraulicsMemMod, only : nlevsoi_hyd_max use FatesPlantHydraulicsMod, only : UpdatePlantPsiFTCFromTheta use PRTGenericMod, only : prt_global - use PRTGenericMod, only : fates_cnp + use PRTGenericMod, only : carbon_only + use PRTGenericMod, only : carbon_nitrogen_phosphorus use EDCohortDynamicsMod, only : InitPRTObject use FatesPlantHydraulicsMod, only : InitHydrCohort use FatesInterfaceTypesMod, only : nlevsclass @@ -836,7 +837,7 @@ subroutine define_restart_vars(this, initialize_variables) long_name='ed cohort - l2fr', units='fraction', flushval = flushzero, & hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_l2fr_co ) - if (hlm_parteh_mode == fates_cnp) then + if (hlm_parteh_mode == carbon_nitrogen_phosphorus) then call this%set_restart_var(vname='fates_cx_int', vtype=cohort_r8, & long_name='ed cohort - emacx', units='fraction', flushval = flushzero, & @@ -2677,7 +2678,7 @@ subroutine set_restart_vectors(this,nc,nsites,sites) rio_l2fr_co(io_idx_co) = ccohort%l2fr - if (hlm_parteh_mode == fates_cnp) then + if (hlm_parteh_mode == carbon_nitrogen_phosphorus) then this%rvars(ir_cx_int_co)%r81d(io_idx_co) = ccohort%cx_int this%rvars(ir_emadcxdt_co)%r81d(io_idx_co) = ccohort%ema_dcxdt this%rvars(ir_cx0_co)%r81d(io_idx_co) = ccohort%cx0 @@ -3717,7 +3718,7 @@ subroutine get_restart_vectors(this, nc, nsites, sites) call this%GetCohortRealVector(ccohort%year_net_uptake,nlevleaf,ir_year_net_up_co,io_idx_co) - if (hlm_parteh_mode == fates_cnp) then + if (hlm_parteh_mode == carbon_nitrogen_phosphorus) then ccohort%cx_int = this%rvars(ir_cx_int_co)%r81d(io_idx_co) ccohort%ema_dcxdt = this%rvars(ir_emadcxdt_co)%r81d(io_idx_co) ccohort%cx0 = this%rvars(ir_cx0_co)%r81d(io_idx_co) diff --git a/parteh/PRTGenericMod.F90 b/parteh/PRTGenericMod.F90 index b14cff887a..583dc9f3e4 100644 --- a/parteh/PRTGenericMod.F90 +++ b/parteh/PRTGenericMod.F90 @@ -66,8 +66,8 @@ module PRTGenericMod ! These should each have their own module ! ------------------------------------------------------------------------------------- - integer, parameter, public :: fates_c_only = 1 - integer, parameter, public :: fates_cnp = 2 + integer, parameter, public :: carbon_only = 1 + integer, parameter, public :: carbon_nitrogen_phosphorus = 2 ! ------------------------------------------------------------------------------------- ! Organ types From 1d870da8f9703c57f81facbcb9d01b15979748ad Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Fri, 16 Jan 2026 17:36:59 -0500 Subject: [PATCH 09/13] converting fates_cnp and fates_conly --- biogeochem/EDCohortDynamicsMod.F90 | 10 +++++----- biogeochem/EDPhysiologyMod.F90 | 12 ++++++------ biogeochem/FatesCohortMod.F90 | 12 ++++++------ biogeochem/FatesSoilBGCFluxMod.F90 | 10 +++++----- parteh/PRTParamsFATESMod.F90 | 15 +++++++-------- testing/testing_shr/FatesFactoryMod.F90 | 8 ++++---- 6 files changed, 33 insertions(+), 34 deletions(-) diff --git a/biogeochem/EDCohortDynamicsMod.F90 b/biogeochem/EDCohortDynamicsMod.F90 index 9dfe8793da..636f0c646e 100644 --- a/biogeochem/EDCohortDynamicsMod.F90 +++ b/biogeochem/EDCohortDynamicsMod.F90 @@ -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 @@ -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 @@ -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 diff --git a/biogeochem/EDPhysiologyMod.F90 b/biogeochem/EDPhysiologyMod.F90 index 384cd79e58..d5afcd8f69 100644 --- a/biogeochem/EDPhysiologyMod.F90 +++ b/biogeochem/EDPhysiologyMod.F90 @@ -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 @@ -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) @@ -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 @@ -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)) @@ -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)) diff --git a/biogeochem/FatesCohortMod.F90 b/biogeochem/FatesCohortMod.F90 index 13d0ba1ac8..276993285a 100644 --- a/biogeochem/FatesCohortMod.F90 +++ b/biogeochem/FatesCohortMod.F90 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/biogeochem/FatesSoilBGCFluxMod.F90 b/biogeochem/FatesSoilBGCFluxMod.F90 index 25f3ce4b3e..304b127921 100644 --- a/biogeochem/FatesSoilBGCFluxMod.F90 +++ b/biogeochem/FatesSoilBGCFluxMod.F90 @@ -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 @@ -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 @@ -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 @@ -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)) diff --git a/parteh/PRTParamsFATESMod.F90 b/parteh/PRTParamsFATESMod.F90 index 599dce605b..8c41e41daf 100644 --- a/parteh/PRTParamsFATESMod.F90 +++ b/parteh/PRTParamsFATESMod.F90 @@ -17,7 +17,7 @@ module PRTInitParamsFatesMod use FatesGlobals, only : fates_log use shr_log_mod, only : errMsg => shr_log_errMsg use EDPftvarcon, only : EDPftvarcon_inst - use PRTGenericMod, only : fates_cnp, fates_c_only + use PRTGenericMod, only : carbon_only,carbon_nitrogen_phosphorus use FatesAllometryMod , only : h_allom use FatesAllometryMod , only : h2d_allom use FatesAllometryMod , only : bagw_allom @@ -575,7 +575,7 @@ subroutine PRTCheckParams(is_master) ! Check to make sure the organ ids are valid if this is the ! cnp_flex_allom_hypothesis select case (hlm_parteh_mode) - case (fates_c_only,fates_cnp) + case (carbon_only,carbon_nitrogen_phosphorus) do io = 1,norgans if(prt_params%organ_id(io) == repro_organ) then @@ -608,7 +608,7 @@ subroutine PRTCheckParams(is_master) ! Make sure that the N fixation respiration surcharge fraction is ! between 0 and 1 - if (hlm_parteh_mode == fates_cnp) then + if (hlm_parteh_mode == carbon_nitrogen_phosphorus) then if(any(prt_params%nfix_mresp_scfrac(:)<0._r8) .or. any(prt_params%nfix_mresp_scfrac(:)>1.0_r8)) then write(fates_log(),*) '---~---' write(fates_log(),*) 'The N fixation surcharge nfix_mresp_sfrac (fates_nfix1) must be between 0-1.' @@ -958,7 +958,7 @@ subroutine PRTCheckParams(is_master) end if select case (hlm_parteh_mode) - case (fates_cnp) + case (carbon_nitrogen_phosphorus) ! Make sure nutrient storage fractions are positive if( prt_params%nitr_store_ratio(ipft) < 0._r8 ) then @@ -1066,7 +1066,7 @@ subroutine PRTCheckParams(is_master) end if select case (hlm_parteh_mode) - case (fates_c_only, fates_cnp) + case (carbon_only,carbon_nitrogen_phosphorus) ! The first nitrogen stoichiometry is used in all cases if ( (any(prt_params%nitr_stoich_p1(ipft,:) < 0.0_r8)) .or. & (any(prt_params%nitr_stoich_p1(ipft,:) >= 1.0_r8))) then @@ -1082,8 +1082,7 @@ subroutine PRTCheckParams(is_master) end select select case (hlm_parteh_mode) - case (fates_cnp) - + case (carbon_nitrogen_phosphorus) do i = 1,norgans if ( (prt_params%nitr_stoich_p1(ipft,i) < 0._r8) .or. & (prt_params%phos_stoich_p1(ipft,i) < 0._r8) .or. & @@ -1091,7 +1090,7 @@ subroutine PRTCheckParams(is_master) (prt_params%phos_stoich_p1(ipft,i) > 1._r8) ) then write(fates_log(),*) "---~---" write(fates_log(),*) 'When the C,N,P allocation hypothesis with flexible' - write(fates_log(),*) 'stoichiometry is turned on (fates_cnp),' + write(fates_log(),*) 'stoichiometry is turned on (CNP),' write(fates_log(),*) 'all stoichiometries must be greater than or equal to zero,' write(fates_log(),*) 'and less than 1 (probably way less than 1).' write(fates_log(),*) 'You specified an organ/pft less than zero.' diff --git a/testing/testing_shr/FatesFactoryMod.F90 b/testing/testing_shr/FatesFactoryMod.F90 index 95fb8d9cda..7092a0e05f 100644 --- a/testing/testing_shr/FatesFactoryMod.F90 +++ b/testing/testing_shr/FatesFactoryMod.F90 @@ -41,8 +41,8 @@ module FatesFactoryMod use PRTGenericMod, only : carbon12_element use PRTGenericMod, only : nitrogen_element use PRTGenericMod, only : phosphorus_element - 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 : StorageNutrientTarget use PRTAllometricCarbonMod, only : InitPRTGlobalAllometricCarbon use FatesAllometryMod, only : h_allom @@ -82,7 +82,7 @@ subroutine InitializeGlobals(step_size) integer :: i ! looping index ! initialize some values - hlm_parteh_mode = fates_c_only + hlm_parteh_mode = carbon_nitrogen_phosphorus num_elements = 1 allocate(element_list(num_elements)) element_list(1) = carbon12_element @@ -180,7 +180,7 @@ subroutine PRTFactory(prt, pft, c_struct, c_leaf, c_fnrt, c_sapw, c_store) 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 From 0fdcde0c3b8bbf3dff3329fd90bb90480f7cda15 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Sun, 18 Jan 2026 09:28:03 -0700 Subject: [PATCH 10/13] updates to naming convention of c-only and cnp --- parteh/PRTAllometricCNPMod.F90 | 4 ++-- parteh/PRTAllometricCarbonMod.F90 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/parteh/PRTAllometricCNPMod.F90 b/parteh/PRTAllometricCNPMod.F90 index b1979a017e..df8594995d 100644 --- a/parteh/PRTAllometricCNPMod.F90 +++ b/parteh/PRTAllometricCNPMod.F90 @@ -26,7 +26,7 @@ module PRTAllometricCNPMod use PRTGenericMod , only : repro_organ use PRTGenericMod , only : struct_organ use PRTGenericMod , only : num_organ_types - use PRTGenericMod , only : fates_cnp + use PRTGenericMod , only : carbon_nitrogen_phosphorus use PRTGenericMod , only : StorageNutrientTarget use FatesAllometryMod , only : bleaf @@ -314,7 +314,7 @@ subroutine InitPRTGlobalAllometricCNP() prt_global_acnp%hyp_name = 'Allometric Flexible C+N+P' - prt_global_acnp%hyp_id = fates_cnp + prt_global_acnp%hyp_id = carbon_nitrogen_phosphorus call prt_global_acnp%ZeroGlobal() diff --git a/parteh/PRTAllometricCarbonMod.F90 b/parteh/PRTAllometricCarbonMod.F90 index 20be6ff10b..ce5744bf9c 100644 --- a/parteh/PRTAllometricCarbonMod.F90 +++ b/parteh/PRTAllometricCarbonMod.F90 @@ -23,7 +23,7 @@ module PRTAllometricCarbonMod use PRTGenericMod , only : repro_organ use PRTGenericMod , only : struct_organ use PRTGenericMod , only : un_initialized - use PRTGenericMod , only : fates_c_only + use PRTGenericMod , only : carbon_only use FatesAllometryMod , only : bleaf use FatesAllometryMod , only : bsap_allom @@ -209,7 +209,7 @@ subroutine InitPRTGlobalAllometricCarbon() prt_global_ac%hyp_name = 'Allometric Carbon Only' - prt_global_ac%hyp_id = fates_c_only + prt_global_ac%hyp_id = carbon_only ! Set mapping tables to zero call prt_global_ac%ZeroGlobal() From e415750485fbaa3537d0ba1ee6d05f398b2da6a9 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 27 Jan 2026 15:58:06 -0700 Subject: [PATCH 11/13] Replace fates_c_only and fates_cnp with new names in one more file --- biogeophys/FatesPlantRespPhotosynthMod.F90 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/biogeophys/FatesPlantRespPhotosynthMod.F90 b/biogeophys/FatesPlantRespPhotosynthMod.F90 index a9591c523e..dea1d26e6b 100644 --- a/biogeophys/FatesPlantRespPhotosynthMod.F90 +++ b/biogeophys/FatesPlantRespPhotosynthMod.F90 @@ -44,8 +44,8 @@ module FATESPlantRespPhotosynthMod use FatesCohortMod, only : fates_cohort_type use FatesConstantsMod, only : lmrmodel_ryan_1991 use FatesConstantsMod, only : lmrmodel_atkin_etal_2017 - 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 : leaf_organ @@ -497,7 +497,7 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime) (hlm_use_planthydro.eq.itrue) .or. & (hlm_radiation_model .eq. twostr_solver ) .or. & (nleafage > 1) .or. & - (hlm_parteh_mode /= fates_c_only) ) then + (hlm_parteh_mode /= carbon_only) ) then ! These values are incremented, therefore since @@ -564,11 +564,11 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime) ! Then scale this value at the top of the canopy for canopy depth ! Leaf nitrogen concentration at the top of the canopy (g N leaf / m**2 leaf) select case(hlm_parteh_mode) - case (fates_c_only) + case (carbon_only) lnc_top = prt_params%nitr_stoich_p1(ft,prt_params%organ_param_id(leaf_organ))/slatop(ft) - case (fates_cnp) + case (carbon_nitrogen_phosphorus) leaf_c = currentCohort%prt%GetState(leaf_organ, carbon12_element) if( (leaf_c*slatop(ft)) > nearzero) then @@ -920,7 +920,7 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime) select case(hlm_parteh_mode) - case (fates_c_only) + case (carbon_only) live_stem_n = sapw_c_agw * prt_params%nitr_stoich_p1(ft,prt_params%organ_param_id(sapw_organ)) @@ -928,7 +928,7 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime) fnrt_n = fnrt_c * prt_params%nitr_stoich_p1(ft,prt_params%organ_param_id(fnrt_organ)) - case(fates_cnp) + case(carbon_nitrogen_phosphorus) live_stem_n = prt_params%allom_agb_frac(currentCohort%pft) * & currentCohort%prt%GetState(sapw_organ, nitrogen_element) From ee5eb944286d7a1986deb77cda74616d79871b72 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Fri, 30 Jan 2026 14:12:47 -0500 Subject: [PATCH 12/13] fixed carbon_only tag --- testing/testing_shr/FatesFactoryMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/testing_shr/FatesFactoryMod.F90 b/testing/testing_shr/FatesFactoryMod.F90 index 7092a0e05f..6224fec09f 100644 --- a/testing/testing_shr/FatesFactoryMod.F90 +++ b/testing/testing_shr/FatesFactoryMod.F90 @@ -82,7 +82,7 @@ subroutine InitializeGlobals(step_size) integer :: i ! looping index ! initialize some values - hlm_parteh_mode = carbon_nitrogen_phosphorus + hlm_parteh_mode = carbon_only num_elements = 1 allocate(element_list(num_elements)) element_list(1) = carbon12_element From 68edace9c7ddc8ae45d426faeffc2962a6f1ddee Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Fri, 27 Feb 2026 10:11:43 -0500 Subject: [PATCH 13/13] Update functional_unit_testing/parteh/f90src/FatesCohortWrapMod.F90 Co-authored-by: Samuel Levis --- functional_unit_testing/parteh/f90src/FatesCohortWrapMod.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functional_unit_testing/parteh/f90src/FatesCohortWrapMod.F90 b/functional_unit_testing/parteh/f90src/FatesCohortWrapMod.F90 index c5be10d449..4a3cebd151 100644 --- a/functional_unit_testing/parteh/f90src/FatesCohortWrapMod.F90 +++ b/functional_unit_testing/parteh/f90src/FatesCohortWrapMod.F90 @@ -35,8 +35,8 @@ module FatesCohortWrapMod use PRTGenericMod, only : carbon12_element use PRTGenericMod, only : SetState use PRTGenericMod, only : prt_global - use PRTGenericMod, only : fates_c_only - use PRTGenericMod, only : fates_cnp + use PRTGenericMod, only : carbon_only + use PRTGenericMod, only : carbon_nitrogen_phosphorus use PRTAllometricCarbonMod, only : callom_prt_vartypes use PRTAllometricCarbonMod, only : ac_bc_inout_id_netdc