diff --git a/biogeochem/EDCohortDynamicsMod.F90 b/biogeochem/EDCohortDynamicsMod.F90 index ee1e2d4a7c..9dfe8793da 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_cnp 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_cnp) 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 .eq. prt_cnp_flex_allom_hyp) then + if (hlm_parteh_mode == fates_cnp) then currentCohort%l2fr = (currentCohort%n*currentCohort%l2fr & + nextc%n*nextc%l2fr)/newn diff --git a/biogeochem/EDPatchDynamicsMod.F90 b/biogeochem/EDPatchDynamicsMod.F90 index 30a41e8790..4fbc3f3cc3 100644 --- a/biogeochem/EDPatchDynamicsMod.F90 +++ b/biogeochem/EDPatchDynamicsMod.F90 @@ -99,8 +99,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 016102dde0..384cd79e58 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 : prt_carbon_allom_hyp - use PRTGenericMod, only : prt_cnp_flex_allom_hyp + use PRTGenericMod, only : fates_c_only + use PRTGenericMod, only : fates_cnp 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 (prt_carbon_allom_hyp, prt_cnp_flex_allom_hyp) + 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) @@ -3330,7 +3330,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_cnp) 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 .ne. prt_cnp_flex_allom_hyp) return + if (hlm_parteh_mode /= fates_cnp) 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 .ne. prt_cnp_flex_allom_hyp) 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 15195e4d0f..13d0ba1ac8 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_cnp 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 .eq. prt_cnp_flex_allom_hyp) 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 @@ -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 .eq. prt_cnp_flex_allom_hyp) then + if (hlm_parteh_mode == fates_cnp) 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 (prt_carbon_allom_hyp) + case (fates_c_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 (prt_cnp_flex_allom_hyp) + case (fates_cnp) ! Register boundary conditions for the CNP Allometric Hypothesis diff --git a/biogeochem/FatesSoilBGCFluxMod.F90 b/biogeochem/FatesSoilBGCFluxMod.F90 index 8b6aad7542..25f3ce4b3e 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_cnp 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 (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 @@ -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==prt_cnp_flex_allom_hyp) ) 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 @@ -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==prt_cnp_flex_allom_hyp) ) + !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 60cf234a64..a9591c523e 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_cnp 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_cnp) 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 (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)) @@ -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(prt_cnp_flex_allom_hyp) + 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 4d5efcf241..c5be10d449 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_cnp 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_cnp) 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_cnp) ! 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_cnp) 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_cnp) 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_cnp) prt_global => prt_global_acnp end select diff --git a/main/EDInitMod.F90 b/main/EDInitMod.F90 index 09db71632c..48c4f47d8c 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_cnp 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 (prt_carbon_allom_hyp, prt_cnp_flex_allom_hyp ) + 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 df21329d30..facfbcecfd 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 : prt_carbon_allom_hyp - use PRTGenericMod , only : prt_cnp_flex_allom_hyp + use PRTGenericMod , only : fates_c_only + use PRTGenericMod , only : fates_cnp 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 (prt_cnp_flex_allom_hyp) + case (fates_cnp) call fates_hist%update_history_nutrflux(currentSite) end select diff --git a/main/EDPftvarcon.F90 b/main/EDPftvarcon.F90 index 5b04c5ed3a..de490ac778 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_cnp, fates_c_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 (prt_cnp_flex_allom_hyp) + case (fates_cnp) ! Check to see if either RD/ECA/MIC is turned on @@ -1027,7 +1027,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 72a8614992..924a7dcb35 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 ee8cc1ed3c..ff6ab063cc 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_cnp 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 @@ -2836,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 == prt_cnp_flex_allom_hyp) 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 a9c64488ca..ea4dfcbf7e 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 : prt_carbon_allom_hyp - use PRTGenericMod , only : prt_cnp_flex_allom_hyp + use PRTGenericMod , only : fates_c_only + use PRTGenericMod , only : fates_cnp 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(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 @@ -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(prt_cnp_flex_allom_hyp) + case(fates_cnp) 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 .eq. prt_cnp_flex_allom_hyp) 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)) @@ -690,7 +690,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)) @@ -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(prt_cnp_flex_allom_hyp) + 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)) @@ -956,10 +956,17 @@ 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 .eq. prt_cnp_flex_allom_hyp ) then + if (hlm_parteh_mode == fates_cnp) then if((p_uptake_mode==coupled_p_uptake) .or. (n_uptake_mode==coupled_n_uptake))then max_comp_per_site = fates_maxElementsPerSite @@ -1156,7 +1163,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)) @@ -1166,7 +1173,7 @@ subroutine InitPARTEHGlobals() call InitPRTGlobalAllometricCarbon() - case(prt_cnp_flex_allom_hyp) + case(fates_cnp) num_elements = 3 allocate(element_list(num_elements)) @@ -1727,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 .eq. prt_cnp_flex_allom_hyp))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__)) @@ -1800,12 +1807,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 @@ -2338,9 +2344,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 diff --git a/main/FatesInventoryInitMod.F90 b/main/FatesInventoryInitMod.F90 index 32f5c6714b..71d96783f7 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_cnp 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 (prt_carbon_allom_hyp,prt_cnp_flex_allom_hyp ) + 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 e3e6c579d0..1a4d873735 100644 --- a/main/FatesRestartInterfaceMod.F90 +++ b/main/FatesRestartInterfaceMod.F90 @@ -36,7 +36,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_cnp use EDCohortDynamicsMod, only : InitPRTObject use FatesPlantHydraulicsMod, only : InitHydrCohort use FatesInterfaceTypesMod, only : nlevsclass @@ -836,7 +836,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_cnp) then call this%set_restart_var(vname='fates_cx_int', vtype=cohort_r8, & long_name='ed cohort - emacx', units='fraction', flushval = flushzero, & @@ -2677,7 +2677,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_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 @@ -3717,7 +3717,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_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 eecace30b5..b1979a017e 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_cnp 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 = prt_cnp_flex_allom_hyp + prt_global_acnp%hyp_id = fates_cnp 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..b14cff887a 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_cnp = 2 ! ------------------------------------------------------------------------------------- ! Organ types diff --git a/parteh/PRTParamsFATESMod.F90 b/parteh/PRTParamsFATESMod.F90 index d16c686459..599dce605b 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_cnp, fates_c_only 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 (prt_carbon_allom_hyp,prt_cnp_flex_allom_hyp) + case (fates_c_only,fates_cnp) 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 .eq. prt_cnp_flex_allom_hyp) 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.' @@ -958,7 +958,7 @@ subroutine PRTCheckParams(is_master) end if select case (hlm_parteh_mode) - case (prt_cnp_flex_allom_hyp) + case (fates_cnp) ! Make sure nutrient storage fractions are positive if( prt_params%nitr_store_ratio(ipft) < 0._r8 ) then @@ -1054,7 +1054,6 @@ subroutine PRTCheckParams(is_master) ! Growth respiration - ! if (parteh_mode .eq. prt_carbon_allom_hyp) then if ( ( prt_params%grperc(ipft) < 0.0_r8) .or. & ( prt_params%grperc(ipft) > 1.0_r8 ) ) then write(fates_log(),*) "---~---" @@ -1065,21 +1064,9 @@ subroutine PRTCheckParams(is_master) write(fates_log(),*) '' nerror = nerror + 1 end if -! elseif(parteh_mode .eq. prt_cnp_flex_allom_hyp) 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 (prt_carbon_allom_hyp,prt_cnp_flex_allom_hyp) + 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 @@ -1095,7 +1082,7 @@ subroutine PRTCheckParams(is_master) end select select case (hlm_parteh_mode) - case (prt_cnp_flex_allom_hyp) + case (fates_cnp) do i = 1,norgans if ( (prt_params%nitr_stoich_p1(ipft,i) < 0._r8) .or. & @@ -1104,7 +1091,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_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 e1028008dc..95fb8d9cda 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 : prt_carbon_allom_hyp - use PRTGenericMod, only : prt_cnp_flex_allom_hyp + use PRTGenericMod, only : fates_c_only + use PRTGenericMod, only : fates_cnp 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 = prt_carbon_allom_hyp + hlm_parteh_mode = fates_c_only 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 (prt_carbon_allom_hyp, prt_cnp_flex_allom_hyp) + 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