From e95d3838a61b8137cb0107110b6aff344d1fb05f Mon Sep 17 00:00:00 2001 From: GiorgiaLine <39632763+GiorgiaLine@users.noreply.github.com> Date: Tue, 25 Aug 2026 19:27:40 +0100 Subject: [PATCH 1/2] Doc and metadata changes --- doc/source/namelists/jules_vegetation.nml.rst | 14 ++++++++++++++ doc/source/overview/key-switches.rst | 4 ++++ rose-meta/jules-standalone/HEAD/rose-meta.conf | 7 +++++++ rose-meta/jules-standalone/versions.py | 13 +++++++------ 4 files changed, 32 insertions(+), 6 deletions(-) diff --git a/doc/source/namelists/jules_vegetation.nml.rst b/doc/source/namelists/jules_vegetation.nml.rst index ccdf9aa2..81d5beb1 100644 --- a/doc/source/namelists/jules_vegetation.nml.rst +++ b/doc/source/namelists/jules_vegetation.nml.rst @@ -115,6 +115,20 @@ This file sets the vegetation options. It contains one namelist called :nml:lst: FALSE No Nitrogen limitation. Nitrogen fluxes are calculated as diagnostics only. +.. nml:member:: l_phosphorus + :type: logical + :default: F + + Only used if :nml:mem:`l_triffid` = TRUE. + + TRUE + Enable Phosphorus limitation of carbon uptake. A phosphorus + deposition field should be provided otherwise no P deposition is + assumed. + + FALSE + No Phosphorus limitation. Phosphorus fluxes are calculated as diagnostics only. + .. nml:member:: l_trif_eq :type: logical diff --git a/doc/source/overview/key-switches.rst b/doc/source/overview/key-switches.rst index 9365c48a..5373898b 100644 --- a/doc/source/overview/key-switches.rst +++ b/doc/source/overview/key-switches.rst @@ -18,6 +18,10 @@ When TRIFFID is on, competition between tiles is switched on with :nml:mem:`JULES_VEGETATION::l_veg_compete` and the effect of nitrogen on vegetation growth is enabled via :nml:mem:`JULES_VEGETATION::l_nitrogen`. +:nml:mem:`JULES_VEGETATION::l_veg_compete`, the effect of nitrogen on +vegetation growth is enabled via :nml:mem:`JULES_VEGETATION::l_nitrogen`, and the effect of phosphorus on +vegetation growth is enabled via :nml:mem:`JULES_VEGETATION::l_phosphorus`. + The crop model, which is simulates phenology and carbon stocks in crops, can be switched on by setting the number of crop tiles :nml:mem:`JULES_SURFACE_TYPES::ncpft` to a non-zero value. diff --git a/rose-meta/jules-standalone/HEAD/rose-meta.conf b/rose-meta/jules-standalone/HEAD/rose-meta.conf index e30a27c5..19cd36fd 100644 --- a/rose-meta/jules-standalone/HEAD/rose-meta.conf +++ b/rose-meta/jules-standalone/HEAD/rose-meta.conf @@ -2395,6 +2395,13 @@ fail-if=len(this) != namelist:jules_initial=nvars; = namelist:jules_vegetation=l_landuse == '.true.' and not any(this == "'wood_prod_slow'"); # must be given if l_landuse = TRUE = namelist:jules_vegetation=l_nitrogen == '.true.' and not any(this == "'ns'"); # must be given if l_nitrogen = TRUE = namelist:jules_vegetation=l_nitrogen == '.true.' and not any(this == "'n_inorg'"); # must be given if l_nitrogen = TRUE + = namelist:jules_vegetation=l_phosphorus == '.true.' and not any(this == "'ps_occ'"); # must be given if l_phosphorus = TRUE + = namelist:jules_vegetation=l_phosphorus == '.true.' and not any(this == "'ps_org'"); # must be given if l_phosphorus = TRUE + = namelist:jules_vegetation=l_phosphorus == '.true.' and not any(this == "'ps_par'"); # must be given if l_phosphorus = TRUE + = namelist:jules_vegetation=l_phosphorus == '.true.' and not any(this == "'ps_in_sorbed'"); # must be given if l_phosphorus = TRUE + = namelist:jules_vegetation=l_phosphorus == '.true.' and not any(this == "'ps_or_sorbed'"); # must be given if l_phosphorus = TRUE + = namelist:jules_vegetation=l_phosphorus == '.true.' and not any(this == "'p_inorg'"); # must be given if l_phosphorus = TRUE + = namelist:jules_vegetation=l_phosphorus == '.true.' and not any(this == "'plant_p_pool'"); # must be given if l_phosphorus = TRUE = namelist:jules_surface_types=ncpft > 0 and not any(this == "'cropdvi'"); # cropdvi must be given if ncpft > 0 = namelist:jules_surface_types=ncpft > 0 and not any(this == "'croprootc'"); # croprootc must be given if ncpft > 0 = namelist:jules_surface_types=ncpft > 0 and not any(this == "'cropharvc'"); # cropharvc must be given if ncpft > 0 diff --git a/rose-meta/jules-standalone/versions.py b/rose-meta/jules-standalone/versions.py index 1d4c41a9..4aa2f2a5 100644 --- a/rose-meta/jules-standalone/versions.py +++ b/rose-meta/jules-standalone/versions.py @@ -45,15 +45,16 @@ from .version81_82 import * -class vnYY_txxxx(MacroUpgrade): +class vn81_tphos(MacroUpgrade): - """Upgrade macro from JULES by Author""" + """Upgrade macro from JULES by Carolina Duran Rojas""" - BEFORE_TAG = "vnY.Y" - AFTER_TAG = "vnY.Y_txxxx" + BEFORE_TAG = "vn8.2" + AFTER_TAG = "vn8.2_tphos" def upgrade(self, config, meta_config=None): """Upgrade a JULES runtime app configuration.""" - # Add settings - return config, self.reports + # Adding logical and real to the jules biogeochemical namelist + self.add_setting(config, + ["namelist:jules_vegetation", "l_phosphorus"], ".false.") From 51ccc2d1736a06f75b5375a18fbcdc2baa1eeba9 Mon Sep 17 00:00:00 2001 From: GiorgiaLine <39632763+GiorgiaLine@users.noreply.github.com> Date: Tue, 1 Sep 2026 19:24:31 +0100 Subject: [PATCH 2/2] Builds so far --- src/control/shared/CN_utils_mod.F90 | 60 +- .../shared/jules_soil_biogeochem_mod.F90 | 33 +- src/control/shared/p_s_parms.F90 | 10 + src/control/shared/trif_vars_mod.F90 | 635 ++++++++++++++++++ .../standalone/init_vars_tmp.F90 | 22 +- src/science/vegetation/plant_growth_n.F90 | 36 +- src/science/vegetation/triffid_jls.F90 | 43 +- src/science/vegetation/vegcarb_jls.F90 | 26 +- 8 files changed, 829 insertions(+), 36 deletions(-) diff --git a/src/control/shared/CN_utils_mod.F90 b/src/control/shared/CN_utils_mod.F90 index 862b2482..f502a107 100644 --- a/src/control/shared/CN_utils_mod.F90 +++ b/src/control/shared/CN_utils_mod.F90 @@ -30,8 +30,8 @@ MODULE CN_utils_mod !----------------------------------------------------------------------------- CONTAINS -SUBROUTINE calc_n_comps_triffid(l, n, phen, lai_bal, wood, root, n_leaf, & - n_root, n_stem, dvi_cpft) +SUBROUTINE calc_n_comps_triffid(l, n, phen, lai_bal, leaf, wood, root, n_leaf, & + n_root, n_stem, p_leaf, p_root, p_stem, dvi_cpft) USE jules_vegetation_mod, ONLY: & ! imported scalars that are not altered @@ -45,6 +45,10 @@ SUBROUTINE calc_n_comps_triffid(l, n, phen, lai_bal, wood, root, n_leaf, & ! imported arrays that are not altered retran_l +USE jules_fields_mod, ONLY: psparms + +USE jules_soil_biogeochem_mod, ONLY: l_cp_r, w_cp_r, r_cp_r + IMPLICIT NONE !----------------------------------------------------------------------------- @@ -57,6 +61,8 @@ SUBROUTINE calc_n_comps_triffid(l, n, phen, lai_bal, wood, root, n_leaf, & REAL(KIND=real_jlslsm), INTENT(IN) :: & lai_bal & ! Balanced LAI +, leaf & + ! Leaf carbon (kg C m-2) , wood & ! Wood carbon (kg C m-2) , root & @@ -74,28 +80,65 @@ SUBROUTINE calc_n_comps_triffid(l, n, phen, lai_bal, wood, root, n_leaf, & ! Leaf N content (kg N m-2) , n_root & ! Root N content (kg N m-2) -, n_stem +, n_stem & ! Wood N content (kg N m-2) +, p_leaf & + ! Leaf P content (kg P m-2) +, p_root & + ! Root P content (kg P m-2) +, p_stem + ! Wood P content (kg P m-2) !----------------------------------------------------------------------------- ! Local scalar variables. !----------------------------------------------------------------------------- INTEGER :: & - errcode + errcode & ! Error code to pass to ereport. + , st_int REAL(KIND=real_jlslsm) :: & fstem & ! Ratio of respiring stem wood to total wood , nl_ave & ! Leaf nitrogen per unit LAI, averaged over the canopy (kg m-2). -, x_tmp +, x_tmp & ! Temporary factor used in calculation of canopy average. +, l_cp & + ! Ratio of leaf C to P +, r_cp & + ! Ratio of root C to P +, w_cp & + ! Ratio of wood C to P +, st_real CHARACTER(LEN=*), PARAMETER :: RoutineName = 'CALC_N_COMPS_TRIFFID' !----------------------------------------------------------------------------- !end of header +!!! GL CNP_PHOS Something is missing here +st_real = psparms%stype_soilt(l,1,1) +st_int = INT(st_real) +!!! GL CNP_PHOS This should be a warning but doing it to check everything else +IF (st_int < 1) THEN + st_int = 1 +END IF +! Need the index to be an integer not a real? +l_cp = l_cp_r(st_int) +r_cp = r_cp_r(st_int) +w_cp = w_cp_r(st_int) + +!values for veg P coming from Iain Hartley and Beto (the values are total +!leaf, stem and root P. Now we are using C:P and C pools +! for C values: Leaf (Fyllas 2009, BGS- BNT site), Stem and root: from AFEX +! project) +!P concentrations (g kg-1): Leaf 0.5; Stem and branch 0.06; Fine root 0.4; +!coarseroot 0.1 +!C concnetrations (mg g-1): Leaf 491; Stem and branch 440; Fine root 450; +!coarseroot 0.1 +! p_leaf= 0.00192 +! p_root = 0.00105 +! p_stem = 0.00029 IF ( l_leaf_n_resp_fix ) THEN @@ -151,6 +194,9 @@ SUBROUTINE calc_n_comps_triffid(l, n, phen, lai_bal, wood, root, n_leaf, & END IF +! Eq. 1 in CNP GMD paper: +p_leaf = leaf / l_cp + !------------------------------------------------------------------------------ ! Calculate root and stem N. !------------------------------------------------------------------------------ @@ -163,6 +209,10 @@ SUBROUTINE calc_n_comps_triffid(l, n, phen, lai_bal, wood, root, n_leaf, & n_stem = ns_nl(n) * nl0(n) * wood END IF +! Eqs. 2-3 in CNP GMD paper: +p_root = root / r_cp +p_stem = wood / w_cp + END SUBROUTINE calc_n_comps_triffid !############################################################################# diff --git a/src/control/shared/jules_soil_biogeochem_mod.F90 b/src/control/shared/jules_soil_biogeochem_mod.F90 index 4b6588f6..5dec46cd 100644 --- a/src/control/shared/jules_soil_biogeochem_mod.F90 +++ b/src/control/shared/jules_soil_biogeochem_mod.F90 @@ -153,7 +153,7 @@ MODULE jules_soil_biogeochem_mod ! Namelist variables used only by the 4-pool soil C model. !----------------------------------------------------------------------------- REAL(KIND=real_jlslsm) :: & - bio_hum_CN = rmdi, & + bio_hum_CN= rmdi, & ! Soil Bio and Hum CN ratio parameter sorp = rmdi, & ! Soil inorganic N factor in leaching. @@ -164,8 +164,37 @@ MODULE jules_soil_biogeochem_mod ! roots after the roots uptake from the soil around them) ! per 360 days. Should be quicker than the turnover rate of inorganic ! N hence choice of value (100 vs 1). - tau_resp = rmdi + tau_resp = rmdi, & ! Parameter controlling decay of respiration with depth (m-1) + ! P Vars + bio_hum_CP(18) = rmdi, & + ! Soil Bio and Hum CP ratio parameter + l_cp_r(18) = rmdi, & + ! Leaf C:P ratio + w_cp_r(18) = rmdi, & + ! Wood C:P ratio + r_cp_r(18) = rmdi, & + ! Root C:P ratio + ps_in_max(18) = rmdi, & + ! Maximum inorganic P + ps_or_max(18) = rmdi, & + ! Maximum organic P + npr_soil = rmdi, & + ! Soil Bio and Hum NP ratio parameter + a_root = rmdi, & + ! Soil Bio and Hum CN ratio parameter + fpl = rmdi, & + ! Soil Bio and Hum CN ratio parameter + k_org_sorp = rmdi, & + ! Organic P sorbed ratio parameter + k_org_desorp = rmdi, & + ! Organic P desorbed ratio parameter + k_in_sorp = rmdi, & + ! Inorganic P sorbed ratio parameter + k_in_desorp = rmdi, & + ! Inorganic P sorbed ratio parameter + sorp_pl = rmdi + ! Soil inorganic P factor in leaching. REAL(KIND=real_jlslsm) :: & kaps_4pool(4) = rmdi diff --git a/src/control/shared/p_s_parms.F90 b/src/control/shared/p_s_parms.F90 index e5e032d9..f1d7600a 100644 --- a/src/control/shared/p_s_parms.F90 +++ b/src/control/shared/p_s_parms.F90 @@ -96,6 +96,9 @@ MODULE p_s_parms ! thaw depth calculation based on unfrozen water content fraction. REAL(KIND=real_jlslsm), ALLOCATABLE :: soil_ph_soilt(:,:,:) ! Soil pH, defined on soil layers. + ! P Vars + REAL(KIND=real_jlslsm), ALLOCATABLE :: stype_soilt(:,:,:) + ! Soil pH, defined on soil layers. - ported from CNP_FAR END TYPE !================================ @@ -127,6 +130,7 @@ MODULE p_s_parms REAL(KIND=real_jlslsm), POINTER :: sthf_soilt(:,:,:) REAL(KIND=real_jlslsm), POINTER :: sthu_min_soilt(:,:,:) REAL(KIND=real_jlslsm), POINTER :: soil_ph_soilt(:,:,:) + REAL(KIND=real_jlslsm), POINTER :: stype_soilt(:,:,:) END TYPE CHARACTER(LEN=*), PARAMETER, PRIVATE :: ModuleName='P_S_PARMS' @@ -173,6 +177,7 @@ SUBROUTINE psparms_alloc(land_pts,t_i_length,t_j_length, & ALLOCATE(psparms_data%smvcwt_soilt(land_pts,nsoilt,sm_levels)) ALLOCATE(psparms_data%smvcst_soilt(land_pts,nsoilt,sm_levels)) ALLOCATE(psparms_data%clay_soilt(land_pts,nsoilt,dim_cslayer)) +ALLOCATE(psparms_data%stype_soilt(land_pts,nsoilt,dim_cslayer)) psparms_data%bexp_soilt(:,:,:) = 0.0 psparms_data%sathh_soilt(:,:,:) = 0.0 @@ -183,6 +188,7 @@ SUBROUTINE psparms_alloc(land_pts,t_i_length,t_j_length, & psparms_data%smvcwt_soilt(:,:,:) = 0.0 psparms_data%smvcst_soilt(:,:,:) = 0.0 psparms_data%clay_soilt(:,:,:) = 0.0 +psparms_data%stype_soilt(:,:,:) = 0.0 ! Plant and soil parameters ALLOCATE(psparms_data%albsoil_soilt(land_pts,nsoilt)) @@ -286,6 +292,7 @@ SUBROUTINE psparms_dealloc(psparms_data) DEALLOCATE(psparms_data%soil_ph_soilt) DEALLOCATE(psparms_data%v_close_pft) DEALLOCATE(psparms_data%v_open_pft) +DEALLOCATE(psparms_data%stype_soilt) IF (lhook) CALL dr_hook(ModuleName//':'//RoutineName,zhook_out,zhook_handle) RETURN @@ -345,6 +352,7 @@ SUBROUTINE psparms_assoc(psparms,psparms_data) psparms%soil_ph_soilt => psparms_data%soil_ph_soilt psparms%v_close_pft => psparms_data%v_close_pft psparms%v_open_pft => psparms_data%v_open_pft +psparms%stype_soilt => psparms_data%stype_soilt IF (lhook) CALL dr_hook(ModuleName//':'//RoutineName,zhook_out,zhook_handle) RETURN @@ -400,6 +408,8 @@ SUBROUTINE psparms_nullify(psparms) NULLIFY(psparms%soil_ph_soilt) NULLIFY(psparms%v_close_pft) NULLIFY(psparms%v_open_pft) +NULLIFY(psparms%stype_soilt) +!!! GL CNP_PHOS: DO I need to put the the other soilt vars here? IF (lhook) CALL dr_hook(ModuleName//':'//RoutineName,zhook_out,zhook_handle) RETURN diff --git a/src/control/shared/trif_vars_mod.F90 b/src/control/shared/trif_vars_mod.F90 index 80a4f2b2..23fbdf84 100644 --- a/src/control/shared/trif_vars_mod.F90 +++ b/src/control/shared/trif_vars_mod.F90 @@ -189,6 +189,59 @@ MODULE trif_vars_mod REAL(KIND=real_jlslsm), ALLOCATABLE :: cnsrv_prod_triffid_gb(:) ! Diagnostic of error in wood product carbon ! conservation in the triffid routine (kg m-2). + ! P Vars + REAL(KIND=real_jlslsm), ALLOCATABLE :: lit_p_orig_pft(:,:) + ! Loss of vegetation phosphorus due to litter, + ! landuse change and fire (kg/m2/360days). + REAL(KIND=real_jlslsm), ALLOCATABLE :: lit_p_ag_pft(:,:) + ! Phosphorus removed from system due to landuse change + ! this flux is removed from vegetation and not added + ! to any other store (kg/m2/360days). + REAL(KIND=real_jlslsm), ALLOCATABLE :: lit_p_fire_pft(:,:) + ! Loss of vegetation phosphorus due to fire + ! (kg/m2/360days). + REAL(KIND=real_jlslsm), ALLOCATABLE :: lit_p_nofire_pft(:,:) + ! Loss of vegetation phosphorus due to litter and + ! landuse change (kg/m2/360days). + REAL(KIND=real_jlslsm), ALLOCATABLE :: root_abandon_p_pft(:,:) + ! Root P moved to soil nitrogen during + ! landuse change (kg/(m2 PFT)/360days). + REAL(KIND=real_jlslsm), ALLOCATABLE :: root_abandon_p_gb(:) + ! Root P moved to soil nitrogen during + ! landuse change (kg/(m2 land)/360days). + REAL(KIND=real_jlslsm), ALLOCATABLE :: harvest_p_pft(:,:) + ! Nitrogen harvested from crops (kg/(m2 PFT)/360days). + REAL(KIND=real_jlslsm), ALLOCATABLE :: harvest_p_gb(:) + ! P harvested from crops: gridbox mean + ! (kg/(m2 land)/360days). + REAL(KIND=real_jlslsm), ALLOCATABLE :: p_fertiliser_pft(:,:) + ! Phosphorus available to crop PFTs in addition + ! to soil phosphorus (kg/(m2 PFT)/360days) + REAL(KIND=real_jlslsm), ALLOCATABLE :: p_fertiliser_gb(:) + ! P available to crop PFTs in addition to + ! soil P: gridbox mean (kg/(m2 land)/360days). + REAL(KIND=real_jlslsm), ALLOCATABLE :: p_leaf_pft(:,:) + ! Leaf P content scaled by LAI, in sf_stom (kg/m2). + REAL(KIND=real_jlslsm), ALLOCATABLE :: p_root_pft(:,:) + ! Root P content scaled by LAI_BAL, in sf_stom (kg/m2). + REAL(KIND=real_jlslsm), ALLOCATABLE :: p_stem_pft(:,:) + ! Stem P content scaled by LAI_BAL, in sf_stom (kg/m2). + REAL(KIND=real_jlslsm), ALLOCATABLE :: p_leaf_trif_pft(:,:) + ! Total Leaf P content (labile + allocated components) + ! scaled by lai_bal, in triffid (kg/m2). + REAL(KIND=real_jlslsm), ALLOCATABLE :: p_root_trif_pft(:,:) + ! Root N content scaled by LAI_BAL, in triffid (kg/m2). + REAL(KIND=real_jlslsm), ALLOCATABLE :: p_stem_trif_pft(:,:) + ! Stem N content scaled by LAI_BAL, in triffid (kg/m2). + REAL(KIND=real_jlslsm), ALLOCATABLE :: p_luc(:) + ! Phosphorus lost through landuse + ! including harvest (kg/m2/360d). + REAL(KIND=real_jlslsm), ALLOCATABLE :: lit_p_pft_diag(:,:) + ! Phosphorus on tiles flux to soil P + ! including harvest (kg/m2/360d). + REAL(KIND=real_jlslsm), ALLOCATABLE :: lit_p_ag_pft_diag(:,:) + ! Phosphorus on tiles lost through landuse + ! including harvest (kg/m2/360d). !----------------------------------------------------------------------------- ! Variables added for nitrogen conservation checks @@ -206,6 +259,142 @@ MODULE trif_vars_mod ! Diagnostic of error in inorganic nitrogen ! conservation in the triffid routine (kg m-2). + !----------------------------------------------------------------------------- + ! Variables added for phosphorus conservation checks + !----------------------------------------------------------------------------- + REAL(KIND=real_jlslsm), ALLOCATABLE :: cnsrv_phosphorus_triffid_gb(:) + ! Diagnostic of error in land phosphorus + ! conservation in the triffid routine (kg m-2). + REAL(KIND=real_jlslsm), ALLOCATABLE :: cnsrv_vegP_triffid_gb(:) + ! Diagnostic of error in vegetation phosphorus + ! conservation in the triffid routine (kg m-2). + REAL(KIND=real_jlslsm), ALLOCATABLE :: cnsrv_soilP_triffid_gb(:) + ! Diagnostic of error in soil phosphorus + ! conservation in the triffid routine (kg m-2). + REAL(KIND=real_jlslsm), ALLOCATABLE :: cnsrv_P_inorg_triffid_gb(:) + ! Diagnostic of error in inorganic phosphorus + ! conservation in the triffid routine (kg m-2). + + !----------------------------------------------------------------------------- + ! Variables added for ticket Phosphorus scheme + !----------------------------------------------------------------------------- + REAL(KIND=real_jlslsm), ALLOCATABLE :: root_litP_pft(:,:) + ! Root litter P turnover on PFTs (kg/m2/360 day). + REAL(KIND=real_jlslsm), ALLOCATABLE :: leaf_litP_pft(:,:) + ! Leaf litter P turnover on PFTs (kg/m2/360 day). + REAL(KIND=real_jlslsm), ALLOCATABLE :: wood_litP_pft(:,:) + ! Wood litter P turnover on PFTs (kg/m2/360 day). + REAL(KIND=real_jlslsm), ALLOCATABLE :: litterP_pft(:,:) + ! Phosphorus in local litter production (kgP/m2/360 day). + REAL(KIND=real_jlslsm), ALLOCATABLE :: lit_p_pft(:,:) + ! Phosphorus in total litter production (kgP/m2/360 day). + REAL(KIND=real_jlslsm), ALLOCATABLE :: minl_p_gb(:,:,:) + ! Mineralised P on soil pools (kg/m2/360 days). + REAL(KIND=real_jlslsm), ALLOCATABLE :: minl_p_pot_gb(:,:,:) + ! Unlimited mineralised P on soil pools + ! (kg/m2/360 days). + REAL(KIND=real_jlslsm), ALLOCATABLE :: immob_p_gb(:,:,:) + ! Immobilised P on soil pools (kg/m2/360 days). + REAL(KIND=real_jlslsm), ALLOCATABLE :: immob_p_pot_gb(:,:,:) + ! Unlimited immobilised P on soil pools + ! (kg/m2/360 days). + REAL(KIND=real_jlslsm), ALLOCATABLE :: f_up_gb(:) + ! plant uptake avg. over 4 layers + REAL(KIND=real_jlslsm), ALLOCATABLE :: f_up(:,:) + ! plant P uptade (kg/m2/360 days). + REAL(KIND=real_jlslsm), ALLOCATABLE :: ps_or_p_out(:) + ! organic sorbed P out from 30cm (kg/m2/360 days). + REAL(KIND=real_jlslsm), ALLOCATABLE :: ps_out(:) + ! inorganic P out from 30cm (kg/m2/360 days). + REAL(KIND=real_jlslsm), ALLOCATABLE :: ps_or_out(:) + ! organic sorbed P out from 30cm (kg/m2/360 days). + REAL(KIND=real_jlslsm), ALLOCATABLE :: ps_in_out(:) + ! inorganic sorbed P out from 30cm (kg/m2/360 days). + REAL(KIND=real_jlslsm), ALLOCATABLE :: ps_par_out(:) + ! Parent material P out from 30cm (kg/m2/360 days). + REAL(KIND=real_jlslsm), ALLOCATABLE :: ps_occ_out(:) + ! Occluded P out from 30cm (kg/m2/360 days). + REAL(KIND=real_jlslsm), ALLOCATABLE :: fn_out(:,:) + ! N limiting + REAL(KIND=real_jlslsm), ALLOCATABLE :: fp_out(:,:) + ! P limiting + REAL(KIND=real_jlslsm), ALLOCATABLE :: p_litter_flux(:) + ! plant litter P flux (kg/m2/360 days). + ! Last 18 P vars required by the output.nml + ! (2 of them are in tifctl.F90 and prognostic.F90) + + REAL(KIND=real_jlslsm), ALLOCATABLE :: p_inorg_sorp_f(:,:) + ! inorg P adsorp (kg/m2/360 days). + REAL(KIND=real_jlslsm), ALLOCATABLE :: p_inorg_desorp_f(:,:) + ! inorg P desorp (kg/m2/360 days). + REAL(KIND=real_jlslsm), ALLOCATABLE :: p_org_sorp_f(:,:,:) + ! org P adsorp (kg/m2/360 days). + REAL(KIND=real_jlslsm), ALLOCATABLE :: p_org_desorp_f(:,:,:) + ! org P desorp (kg/m2/360 days). + + + REAL(KIND=real_jlslsm), ALLOCATABLE :: p_uptake_growth_pft(:,:) + ! Vegetation P uptake for growth on PFTs + ! (kg/m2/360 days). + REAL(KIND=real_jlslsm), ALLOCATABLE :: p_demand_growth_pft(:,:) + ! Vegetation P demand for growth on PFTs + ! (kg/m2/360 days). + REAL(KIND=real_jlslsm), ALLOCATABLE :: p_demand_lit_pft(:,:) + ! Vegetation P demand for balanced litter + ! production on PFTs (kg/m2/360 days). + REAL(KIND=real_jlslsm), ALLOCATABLE :: p_demand_spread_pft(:,:) + ! Vegetation P demand for spreading on + ! PFTs(kg/m2/360 days). + REAL(KIND=real_jlslsm), ALLOCATABLE :: p_uptake_pft(:,:) + ! Vegetation P uptake on PFTs (kg/m2/360 days). + REAL(KIND=real_jlslsm), ALLOCATABLE :: p_demand_pft(:,:) + ! Vegetation P demand on PFTs(kg/m2/360 days). + REAL(KIND=real_jlslsm), ALLOCATABLE :: p_uptake_gb(:) + ! Vegetation P uptake (kg/m2/360 days). + REAL(KIND=real_jlslsm), ALLOCATABLE :: p_demand_gb(:) + ! Vegetation P demand (kg/m2/360 days). + REAL(KIND=real_jlslsm), ALLOCATABLE :: p_veg_gb(:) + ! Veg P (kg/m2). + REAL(KIND=real_jlslsm), ALLOCATABLE :: p_veg_pft(:,:) + ! Veg P on PFTs (kg/m2). + REAL(KIND=real_jlslsm), ALLOCATABLE :: dpveg_pft(:,:) + ! Increment in veg P on PFTs (kg m-2 per TRIFFID + ! timestep). + REAL(KIND=real_jlslsm), ALLOCATABLE :: dpveg_gb(:) + ! Increment in veg P (kg m-2 per TRIFFID timestep). + REAL(KIND=real_jlslsm), ALLOCATABLE :: lit_p_t_gb(:) + ! Total P litter flux (kg/m2/360 days). + REAL(KIND=real_jlslsm), ALLOCATABLE :: p_tot(:) + !TOTAL P + REAL(KIND=real_jlslsm), ALLOCATABLE :: p_tot2(:) + !TOTAL P including all soil layers + REAL(KIND=real_jlslsm), ALLOCATABLE :: p_uptake_extract_gb(:) + + REAL(KIND=real_jlslsm), ALLOCATABLE :: p_leach_soilt(:,:) + ! Leached P (kg/m2/s) + + REAL(KIND=real_jlslsm), ALLOCATABLE :: p_uptake_extract(:,:,:) + ! Phosphorus removed from each soil layer by plant + ! uptake (kg m-2). + + REAL(KIND=real_jlslsm), ALLOCATABLE :: p_uptake_spread_pft(:,:) + ! Vegetation P uptake for spreading in PFTs + ! (kg/m2/360 days). + REAL(KIND=real_jlslsm), ALLOCATABLE :: p_leach_gb_acc(:) + ! Accumulated leached phosphorus term for outputting + ! on leached P on TRIFFID timesteps via + ! diagnostics_veg.F90 (kg/m2/360days). + REAL(KIND=real_jlslsm), ALLOCATABLE :: smcl_gb(:,:) + ! Soil moisture content in each layer (kg/m2). Used for P uptake calcs + REAL(KIND=real_jlslsm), ALLOCATABLE :: p_avail_out(:) + ! Soil available P used to defined the P limitation level + REAL(KIND=real_jlslsm), ALLOCATABLE :: n_avail_out(:) + ! Soil available N used to defined the N limitation level + REAL(KIND=real_jlslsm), ALLOCATABLE :: p_fertiliser_add(:,:,:) + ! Phosphorus added to each soil layer by fertiliser + ! (kg m-2). + ! end add P vars + !----------------------------------------------------------------------------- ! Variables added for ticket #7,#127 (nitrogen scheme) !----------------------------------------------------------------------------- @@ -560,6 +749,80 @@ MODULE trif_vars_mod INTEGER, POINTER :: harvest_doy(:,:) REAL(KIND=real_jlslsm), POINTER :: frac_biocrop_gb(:) + ! P Vars + REAL(KIND=real_jlslsm), POINTER :: lit_p_orig_pft(:,:) + REAL(KIND=real_jlslsm), POINTER :: lit_p_ag_pft(:,:) + REAL(KIND=real_jlslsm), POINTER ::lit_p_fire_pft(:,:) + REAL(KIND=real_jlslsm), POINTER ::lit_p_nofire_pft(:,:) + REAL(KIND=real_jlslsm), POINTER :: root_abandon_p_pft(:,:) + REAL(KIND=real_jlslsm), POINTER :: root_abandon_p_gb(:) + REAL(KIND=real_jlslsm), POINTER :: harvest_p_pft(:,:) + REAL(KIND=real_jlslsm), POINTER :: harvest_p_gb(:) + REAL(KIND=real_jlslsm), POINTER :: p_fertiliser_pft(:,:) + REAL(KIND=real_jlslsm), POINTER :: p_fertiliser_gb(:) + REAL(KIND=real_jlslsm), POINTER :: p_leaf_pft(:,:) + REAL(KIND=real_jlslsm), POINTER :: p_root_pft(:,:) + REAL(KIND=real_jlslsm), POINTER :: p_stem_pft(:,:) + REAL(KIND=real_jlslsm), POINTER :: p_leaf_trif_pft(:,:) + REAL(KIND=real_jlslsm), POINTER :: p_root_trif_pft(:,:) + REAL(KIND=real_jlslsm), POINTER :: p_stem_trif_pft(:,:) + REAL(KIND=real_jlslsm), POINTER :: p_luc(:) + REAL(KIND=real_jlslsm), POINTER :: lit_p_pft_diag(:,:) + REAL(KIND=real_jlslsm), POINTER :: lit_p_ag_pft_diag(:,:) + REAL(KIND=real_jlslsm), POINTER :: cnsrv_phosphorus_triffid_gb(:) + REAL(KIND=real_jlslsm), POINTER :: cnsrv_vegP_triffid_gb(:) + REAL(KIND=real_jlslsm), POINTER :: cnsrv_soilP_triffid_gb(:) + REAL(KIND=real_jlslsm), POINTER :: cnsrv_P_inorg_triffid_gb(:) + REAL(KIND=real_jlslsm), POINTER :: root_litP_pft(:,:) + REAL(KIND=real_jlslsm), POINTER :: leaf_litP_pft(:,:) + REAL(KIND=real_jlslsm), POINTER :: wood_litP_pft(:,:) + REAL(KIND=real_jlslsm), POINTER :: litterP_pft(:,:) + REAL(KIND=real_jlslsm), POINTER :: lit_p_pft(:,:) + REAL(KIND=real_jlslsm), POINTER :: immob_p_gb(:,:,:) + REAL(KIND=real_jlslsm), POINTER :: immob_p_pot_gb(:,:,:) + REAL(KIND=real_jlslsm), POINTER :: minl_p_gb(:,:,:) + REAL(KIND=real_jlslsm), POINTER :: minl_p_pot_gb(:,:,:) + REAL(KIND=real_jlslsm), POINTER :: f_up_gb(:) + REAL(KIND=real_jlslsm), POINTER :: f_up(:,:) + REAL(KIND=real_jlslsm), POINTER :: ps_or_p_out(:) + REAL(KIND=real_jlslsm), POINTER :: ps_out(:) + REAL(KIND=real_jlslsm), POINTER :: ps_or_out(:) + REAL(KIND=real_jlslsm), POINTER :: ps_in_out(:) + REAL(KIND=real_jlslsm), POINTER :: ps_par_out(:) + REAL(KIND=real_jlslsm), POINTER :: ps_occ_out(:) + REAL(KIND=real_jlslsm), POINTER :: fn_out(:,:) + REAL(KIND=real_jlslsm), POINTER :: fp_out(:,:) + REAL(KIND=real_jlslsm), POINTER :: p_litter_flux(:) + REAL(KIND=real_jlslsm), POINTER :: p_inorg_sorp_f(:,:) + REAL(KIND=real_jlslsm), POINTER :: p_inorg_desorp_f(:,:) + REAL(KIND=real_jlslsm), POINTER :: p_org_sorp_f(:,:,:) + REAL(KIND=real_jlslsm), POINTER :: p_org_desorp_f(:,:,:) + REAL(KIND=real_jlslsm), POINTER :: p_uptake_growth_pft(:,:) + REAL(KIND=real_jlslsm), POINTER :: p_demand_growth_pft(:,:) + REAL(KIND=real_jlslsm), POINTER :: p_demand_lit_pft(:,:) + REAL(KIND=real_jlslsm), POINTER :: p_demand_spread_pft(:,:) + REAL(KIND=real_jlslsm), POINTER :: p_uptake_pft(:,:) + REAL(KIND=real_jlslsm), POINTER :: p_demand_pft(:,:) + REAL(KIND=real_jlslsm), POINTER :: p_uptake_gb(:) + REAL(KIND=real_jlslsm), POINTER :: p_demand_gb(:) + REAL(KIND=real_jlslsm), POINTER :: p_veg_gb(:) + REAL(KIND=real_jlslsm), POINTER :: p_veg_pft(:,:) + REAL(KIND=real_jlslsm), POINTER :: dpveg_pft(:,:) + REAL(KIND=real_jlslsm), POINTER :: dpveg_gb(:) + REAL(KIND=real_jlslsm), POINTER :: lit_p_t_gb(:) + REAL(KIND=real_jlslsm), POINTER :: p_tot(:) + REAL(KIND=real_jlslsm), POINTER :: p_tot2(:) + REAL(KIND=real_jlslsm), POINTER :: p_uptake_extract_gb(:) + REAL(KIND=real_jlslsm), POINTER :: p_leach_soilt(:,:) + REAL(KIND=real_jlslsm), POINTER :: p_uptake_extract(:,:,:) + REAL(KIND=real_jlslsm), POINTER :: p_uptake_spread_pft(:,:) + REAL(KIND=real_jlslsm), POINTER :: p_leach_gb_acc(:) + REAL(KIND=real_jlslsm), POINTER :: smcl_gb(:,:) + ! Soil moisture content in each layer (kg/m2). Used for P uptake calcs + REAL(KIND=real_jlslsm), POINTER :: p_avail_out(:) + REAL(KIND=real_jlslsm), POINTER :: n_avail_out(:) + REAL(KIND=real_jlslsm), POINTER :: p_fertiliser_add(:,:,:) + END TYPE trif_vars_type @@ -886,6 +1149,154 @@ SUBROUTINE trif_vars_alloc(land_pts, & trif_vars_data%harvest_biocrop_n_gb(:) = 0.0 trif_vars_data%harvest_doy(:,:) = 0 +! P Vars +ALLOCATE(trif_vars_data%p_leaf_pft(land_pts,npft)) +ALLOCATE(trif_vars_data%p_root_pft(land_pts,npft)) +ALLOCATE(trif_vars_data%p_stem_pft(land_pts,npft)) +ALLOCATE(trif_vars_data%lit_p_fire_pft(land_pts_dim,npft_dim)) +ALLOCATE(trif_vars_data%lit_p_nofire_pft(land_pts_dim,npft_dim)) +ALLOCATE(trif_vars_data%cnsrv_phosphorus_triffid_gb(land_pts_dim)) +ALLOCATE(trif_vars_data%cnsrv_vegP_triffid_gb(land_pts_dim)) +ALLOCATE(trif_vars_data%cnsrv_soilP_triffid_gb(land_pts_dim)) +ALLOCATE(trif_vars_data%cnsrv_P_inorg_triffid_gb(land_pts_dim)) +ALLOCATE(trif_vars_data%root_abandon_p_pft(land_pts_dim,npft_dim)) +ALLOCATE(trif_vars_data%root_abandon_p_gb(land_pts_dim)) +ALLOCATE(trif_vars_data%harvest_p_pft(land_pts_dim,npft_dim)) +ALLOCATE(trif_vars_data%harvest_p_gb(land_pts_dim)) +ALLOCATE(trif_vars_data%p_fertiliser_add(land_pts_dim,nsoilt_dim,dim_cslayer_dim)) +ALLOCATE(trif_vars_data%p_fertiliser_pft(land_pts_dim,npft_dim)) +ALLOCATE(trif_vars_data%p_fertiliser_gb(land_pts_dim)) +ALLOCATE(trif_vars_data%p_leaf_trif_pft(land_pts_dim,npft_dim)) +ALLOCATE(trif_vars_data%p_root_trif_pft(land_pts_dim,npft_dim)) +ALLOCATE(trif_vars_data%p_stem_trif_pft(land_pts_dim,npft_dim)) +ALLOCATE(trif_vars_data%p_luc(land_pts_dim)) +ALLOCATE(trif_vars_data%lit_p_ag_pft_diag(land_pts_dim,npft_dim)) +ALLOCATE(trif_vars_data%lit_p_pft_diag(land_pts_dim,npft_dim)) +ALLOCATE(trif_vars_data%root_litP_pft(land_pts_dim,npft_dim)) +ALLOCATE(trif_vars_data%leaf_litP_pft(land_pts_dim,npft_dim)) +ALLOCATE(trif_vars_data%wood_litP_pft(land_pts_dim,npft_dim)) +ALLOCATE(trif_vars_data%lit_P_pft(land_pts_dim,npft_dim)) +ALLOCATE(trif_vars_data%minl_p_pot_gb(land_pts_dim,dim_cslayer_dim,dim_cs1_dim+1)) +ALLOCATE(trif_vars_data%immob_p_gb(land_pts_dim,dim_cslayer_dim,dim_cs1_dim+1)) +ALLOCATE(trif_vars_data%immob_p_pot_gb(land_pts_dim,dim_cslayer_dim,dim_cs1_dim+1)) +ALLOCATE(trif_vars_data%minl_p_gb(land_pts_dim,dim_cslayer_dim,dim_cs1_dim+1)) +ALLOCATE(trif_vars_data%f_up_gb(land_pts_dim)) +ALLOCATE(trif_vars_data%f_up(land_pts_dim,dim_cslayer_dim)) +ALLOCATE(trif_vars_data%ps_or_p_out(land_pts_dim)) +ALLOCATE(trif_vars_data%ps_out(land_pts_dim)) +ALLOCATE(trif_vars_data%ps_or_out(land_pts_dim)) +ALLOCATE(trif_vars_data%ps_in_out(land_pts_dim)) +ALLOCATE(trif_vars_data%ps_par_out(land_pts_dim)) +ALLOCATE(trif_vars_data%ps_occ_out(land_pts_dim)) +ALLOCATE(trif_vars_data%fn_out(land_pts_dim,dim_cslayer_dim)) +ALLOCATE(trif_vars_data%fp_out(land_pts_dim,dim_cslayer_dim)) +ALLOCATE(trif_vars_data%p_litter_flux(land_pts_dim)) +ALLOCATE(trif_vars_data%p_inorg_sorp_f(land_pts_dim,dim_cslayer_dim)) +ALLOCATE(trif_vars_data%p_inorg_desorp_f(land_pts_dim,dim_cslayer_dim)) +ALLOCATE(trif_vars_data%p_org_sorp_f(land_pts_dim,dim_cslayer_dim,dim_cs1_dim+1)) +ALLOCATE(trif_vars_data%p_org_desorp_f(land_pts_dim,dim_cslayer_dim,dim_cs1_dim+1)) +! 18 rest vars required by the ouptut: +ALLOCATE(trif_vars_data%p_uptake_growth_pft(land_pts_dim,npft_dim)) +ALLOCATE(trif_vars_data%p_demand_growth_pft(land_pts_dim,npft_dim)) +ALLOCATE(trif_vars_data%p_demand_lit_pft(land_pts_dim,npft_dim)) +ALLOCATE(trif_vars_data%p_demand_spread_pft(land_pts_dim,npft_dim)) +ALLOCATE(trif_vars_data%p_uptake_pft(land_pts_dim,npft_dim)) +ALLOCATE(trif_vars_data%p_demand_pft(land_pts_dim,npft_dim)) +ALLOCATE(trif_vars_data%p_uptake_gb(land_pts_dim)) +ALLOCATE(trif_vars_data%p_demand_gb(land_pts_dim)) +ALLOCATE(trif_vars_data%p_veg_gb(land_pts_dim)) +ALLOCATE(trif_vars_data%p_veg_pft(land_pts_dim,npft_dim)) +ALLOCATE(trif_vars_data%dpveg_pft(land_pts_dim,npft_dim)) +ALLOCATE(trif_vars_data%dpveg_gb(land_pts_dim)) +ALLOCATE(trif_vars_data%lit_p_t_gb(land_pts_dim)) +ALLOCATE(trif_vars_data%p_tot(land_pts_dim)) +ALLOCATE(trif_vars_data%p_tot2(land_pts_dim)) +ALLOCATE(trif_vars_data%p_uptake_extract_gb(land_pts_dim)) +ALLOCATE(trif_vars_data%p_leach_soilt(land_pts_dim,nsoilt_dim)) +ALLOCATE(trif_vars_data%p_uptake_extract(land_pts_dim,nsoilt_dim,dim_cslayer_dim)) +ALLOCATE(trif_vars_data%p_uptake_spread_pft(land_pts_dim,npft_dim)) +ALLOCATE(trif_vars_data%p_leach_gb_acc(land_pts_dim)) +ALLOCATE(trif_vars_data%smcl_gb(land_pts_dim,dim_cslayer_dim)) +ALLOCATE(trif_vars_data%p_avail_out(land_pts_dim)) +ALLOCATE(trif_vars_data%n_avail_out(land_pts_dim)) +ALLOCATE(trif_vars_data%litterP_pft(land_pts_dim,npft_dim)) +ALLOCATE(trif_vars_data%lit_p_orig_pft(land_pts_dim,npft_dim)) +ALLOCATE(trif_vars_data%lit_p_ag_pft(land_pts_dim,npft_dim)) + +trif_vars_data%p_leaf_pft(:,:) = 0.0 +trif_vars_data%p_root_pft(:,:) = 0.0 +trif_vars_data%p_stem_pft(:,:) = 0.0 +trif_vars_data%lit_p_fire_pft(:,:) = 0.0 +trif_vars_data%lit_p_nofire_pft(:,:) = 0.0 +trif_vars_data%cnsrv_phosphorus_triffid_gb(:) = 0.0 +trif_vars_data%cnsrv_vegP_triffid_gb(:) = 0.0 +trif_vars_data%cnsrv_soilP_triffid_gb(:) = 0.0 +trif_vars_data%cnsrv_P_inorg_triffid_gb(:) = 0.0 +trif_vars_data%root_abandon_p_pft(:,:) = 0.0 +trif_vars_data%root_abandon_p_gb(:) = 0.0 +trif_vars_data%harvest_p_pft(:,:) = 0.0 +trif_vars_data%harvest_p_gb(:) = 0.0 +trif_vars_data%p_fertiliser_add(:,:,:) = 0.0 +trif_vars_data%p_fertiliser_pft(:,:) = 0.0 +trif_vars_data%p_fertiliser_gb(:) = 0.0 +trif_vars_data%p_leaf_trif_pft(:,:) = 0.0 +trif_vars_data%p_root_trif_pft(:,:) = 0.0 +trif_vars_data%p_stem_trif_pft(:,:) = 0.0 +trif_vars_data%p_luc(:) = 0.0 +trif_vars_data%lit_p_ag_pft_diag(:,:) = 0.0 +trif_vars_data%lit_p_pft_diag(:,:) = 0.0 +trif_vars_data%root_litP_pft(:,:) = 0.0 +trif_vars_data%leaf_litP_pft(:,:) = 0.0 +trif_vars_data%wood_litP_pft(:,:) = 0.0 +trif_vars_data%lit_P_pft(:,:) = 0.0 +trif_vars_data%minl_p_pot_gb(:,:,:) = 0.0 +trif_vars_data%immob_p_gb(:,:,:) = 0.0 +trif_vars_data%immob_p_pot_gb(:,:,:) = 0.0 +trif_vars_data%minl_p_gb(:,:,:) = 0.0 +trif_vars_data%f_up_gb(:) = 0.0 +trif_vars_data%f_up(:,:) = 0.0 +trif_vars_data%ps_or_p_out(:) = 0.0 +trif_vars_data%ps_out(:) = 0.0 +trif_vars_data%ps_or_out(:) = 0.0 +trif_vars_data%ps_in_out(:) = 0.0 +trif_vars_data%ps_par_out(:) = 0.0 +trif_vars_data%ps_occ_out(:) = 0.0 +trif_vars_data%fn_out(:,:) = 0.0 +trif_vars_data%fp_out(:,:) = 0.0 +trif_vars_data%p_litter_flux(:) = 0.0 +trif_vars_data%p_inorg_sorp_f(:,:) = 0.0 +trif_vars_data%p_inorg_desorp_f(:,:) = 0.0 +trif_vars_data%p_org_sorp_f(:,:,:) = 0.0 +trif_vars_data%p_org_desorp_f(:,:,:) = 0.0 +! 18 rest vars required by the ouptut: +trif_vars_data%p_uptake_growth_pft(:,:) = 0.0 +trif_vars_data%p_demand_growth_pft(:,:) = 0.0 +trif_vars_data%p_demand_lit_pft(:,:) = 0.0 +trif_vars_data%p_demand_spread_pft(:,:) = 0.0 +trif_vars_data%p_uptake_pft(:,:) = 0.0 +trif_vars_data%p_demand_pft(:,:) = 0.0 +trif_vars_data%p_uptake_gb(:) = 0.0 +trif_vars_data%p_demand_gb(:) = 0.0 +trif_vars_data%p_veg_gb(:) = 0.0 +trif_vars_data%p_veg_pft(:,:) = 0.0 +trif_vars_data%dpveg_pft(:,:) = 0.0 +trif_vars_data%dpveg_gb(:) = 0.0 +trif_vars_data%lit_p_t_gb(:) = 0.0 +trif_vars_data%p_tot(:) = 0.0 +trif_vars_data%p_tot2(:) = 0.0 +trif_vars_data%p_uptake_extract_gb(:) = 0.0 +trif_vars_data%p_leach_soilt(:,:) = 0.0 +trif_vars_data%p_uptake_extract(:,:,:) = 0.0 +trif_vars_data%p_uptake_spread_pft(:,:) = 0.0 +trif_vars_data%p_leach_gb_acc(:) = 0.0 +trif_vars_data%smcl_gb(:,:) = 0.0 +trif_vars_data%p_avail_out(:) = 0.0 +trif_vars_data%n_avail_out(:) = 0.0 +trif_vars_data%litterP_pft(:,:) = 0.0 +trif_vars_data%lit_p_orig_pft(:,:) = 0.0 +trif_vars_data%lit_p_ag_pft(:,:) = 0.0 + + IF (lhook) CALL dr_hook(ModuleName//':'//RoutineName,zhook_out,zhook_handle) RETURN END SUBROUTINE trif_vars_alloc @@ -1051,6 +1462,80 @@ SUBROUTINE trif_vars_dealloc(trif_vars_data) DEALLOCATE(trif_vars_data%harvest_biocrop_n_gb) DEALLOCATE(trif_vars_data%harvest_doy) +! P Vars +DEALLOCATE(trif_vars_data%p_leaf_pft) +DEALLOCATE(trif_vars_data%p_root_pft) +DEALLOCATE(trif_vars_data%p_stem_pft) +DEALLOCATE(trif_vars_data%lit_p_fire_pft) +DEALLOCATE(trif_vars_data%lit_p_nofire_pft) +DEALLOCATE(trif_vars_data%cnsrv_phosphorus_triffid_gb) +DEALLOCATE(trif_vars_data%cnsrv_vegP_triffid_gb) +DEALLOCATE(trif_vars_data%cnsrv_soilP_triffid_gb) +DEALLOCATE(trif_vars_data%cnsrv_P_inorg_triffid_gb) +DEALLOCATE(trif_vars_data%root_abandon_p_pft) +DEALLOCATE(trif_vars_data%root_abandon_p_gb) +DEALLOCATE(trif_vars_data%harvest_p_pft) +DEALLOCATE(trif_vars_data%harvest_p_gb) +DEALLOCATE(trif_vars_data%p_fertiliser_add) +DEALLOCATE(trif_vars_data%p_fertiliser_pft) +DEALLOCATE(trif_vars_data%p_fertiliser_gb) +DEALLOCATE(trif_vars_data%p_leaf_trif_pft) +DEALLOCATE(trif_vars_data%p_root_trif_pft) +DEALLOCATE(trif_vars_data%p_stem_trif_pft) +DEALLOCATE(trif_vars_data%p_luc) +DEALLOCATE(trif_vars_data%lit_p_ag_pft_diag) +DEALLOCATE(trif_vars_data%lit_p_pft_diag) +DEALLOCATE(trif_vars_data%root_litP_pft) +DEALLOCATE(trif_vars_data%leaf_litP_pft) +DEALLOCATE(trif_vars_data%wood_litP_pft) +DEALLOCATE(trif_vars_data%lit_P_pft) +DEALLOCATE(trif_vars_data%minl_p_pot_gb) +DEALLOCATE(trif_vars_data%immob_p_gb) +DEALLOCATE(trif_vars_data%immob_p_pot_gb) +DEALLOCATE(trif_vars_data%minl_p_gb) +DEALLOCATE(trif_vars_data%f_up_gb) +DEALLOCATE(trif_vars_data%f_up) +DEALLOCATE(trif_vars_data%ps_or_p_out) +DEALLOCATE(trif_vars_data%ps_out) +DEALLOCATE(trif_vars_data%ps_or_out) +DEALLOCATE(trif_vars_data%ps_in_out) +DEALLOCATE(trif_vars_data%ps_par_out) +DEALLOCATE(trif_vars_data%ps_occ_out) +DEALLOCATE(trif_vars_data%fn_out) +DEALLOCATE(trif_vars_data%fp_out) +DEALLOCATE(trif_vars_data%p_litter_flux) +DEALLOCATE(trif_vars_data%p_inorg_sorp_f) +DEALLOCATE(trif_vars_data%p_inorg_desorp_f) +DEALLOCATE(trif_vars_data%p_org_sorp_f) +DEALLOCATE(trif_vars_data%p_org_desorp_f) +! 18 rest vars required by the ouptut: +DEALLOCATE(trif_vars_data%p_uptake_growth_pft) +DEALLOCATE(trif_vars_data%p_demand_growth_pft) +DEALLOCATE(trif_vars_data%p_demand_lit_pft) +DEALLOCATE(trif_vars_data%p_demand_spread_pft) +DEALLOCATE(trif_vars_data%p_uptake_pft) +DEALLOCATE(trif_vars_data%p_demand_pft) +DEALLOCATE(trif_vars_data%p_uptake_gb) +DEALLOCATE(trif_vars_data%p_demand_gb) +DEALLOCATE(trif_vars_data%p_veg_gb) +DEALLOCATE(trif_vars_data%p_veg_pft) +DEALLOCATE(trif_vars_data%dpveg_pft) +DEALLOCATE(trif_vars_data%dpveg_gb) +DEALLOCATE(trif_vars_data%lit_p_t_gb) +DEALLOCATE(trif_vars_data%p_tot) +DEALLOCATE(trif_vars_data%p_tot2) +DEALLOCATE(trif_vars_data%p_uptake_extract_gb) +DEALLOCATE(trif_vars_data%p_leach_soilt) +DEALLOCATE(trif_vars_data%p_uptake_extract) +DEALLOCATE(trif_vars_data%p_uptake_spread_pft) +DEALLOCATE(trif_vars_data%p_leach_gb_acc) +DEALLOCATE(trif_vars_data%smcl_gb) +DEALLOCATE(trif_vars_data%p_avail_out) +DEALLOCATE(trif_vars_data%n_avail_out) +DEALLOCATE(trif_vars_data%litterP_pft) +DEALLOCATE(trif_vars_data%lit_p_orig_pft) +DEALLOCATE(trif_vars_data%lit_p_ag_pft) + IF (lhook) CALL dr_hook(ModuleName//':'//RoutineName,zhook_out,zhook_handle) RETURN END SUBROUTINE trif_vars_dealloc @@ -1218,6 +1703,81 @@ SUBROUTINE trif_vars_assoc(trif_vars, trif_vars_data) trif_vars%harvest_biocrop_n_gb => trif_vars_data%harvest_biocrop_n_gb trif_vars%harvest_doy => trif_vars_data%harvest_doy +!P Vars +trif_vars%p_leaf_pft => trif_vars_data%p_leaf_pft +trif_vars%p_root_pft => trif_vars_data%p_root_pft +trif_vars%p_stem_pft => trif_vars_data%p_stem_pft +trif_vars%lit_p_fire_pft => trif_vars_data%lit_p_fire_pft +trif_vars%lit_p_nofire_pft => trif_vars_data%lit_p_nofire_pft +trif_vars%cnsrv_phosphorus_triffid_gb => trif_vars_data%cnsrv_phosphorus_triffid_gb +trif_vars%cnsrv_vegP_triffid_gb => trif_vars_data%cnsrv_vegP_triffid_gb +trif_vars%cnsrv_soilP_triffid_gb => trif_vars_data%cnsrv_soilP_triffid_gb +trif_vars%cnsrv_P_inorg_triffid_gb => trif_vars_data%cnsrv_P_inorg_triffid_gb +trif_vars%root_abandon_p_pft => trif_vars_data%root_abandon_p_pft +trif_vars%root_abandon_p_gb => trif_vars_data%root_abandon_p_gb +trif_vars%harvest_p_pft => trif_vars_data%harvest_p_pft +trif_vars%harvest_p_gb => trif_vars_data%harvest_p_gb +trif_vars%p_fertiliser_add => trif_vars_data%p_fertiliser_add +trif_vars%p_fertiliser_pft => trif_vars_data%p_fertiliser_pft +trif_vars%p_fertiliser_gb => trif_vars_data%p_fertiliser_gb +trif_vars%p_leaf_trif_pft => trif_vars_data%p_leaf_trif_pft +trif_vars%p_root_trif_pft => trif_vars_data%p_root_trif_pft +trif_vars%p_stem_trif_pft => trif_vars_data%p_stem_trif_pft +trif_vars%p_luc => trif_vars_data%p_luc +trif_vars%lit_p_ag_pft_diag => trif_vars_data%lit_p_ag_pft_diag +trif_vars%lit_p_pft_diag => trif_vars_data%lit_p_pft_diag +trif_vars%root_litP_pft => trif_vars_data%root_litP_pft +trif_vars%leaf_litP_pft => trif_vars_data%leaf_litP_pft +trif_vars%wood_litP_pft => trif_vars_data%wood_litP_pft +trif_vars%lit_P_pft => trif_vars_data%lit_P_pft +trif_vars%minl_p_pot_gb => trif_vars_data%minl_p_pot_gb +trif_vars%immob_p_gb => trif_vars_data%immob_p_gb +trif_vars%immob_p_pot_gb => trif_vars_data%immob_p_pot_gb +trif_vars%minl_p_gb => trif_vars_data%minl_p_gb +trif_vars%f_up_gb => trif_vars_data%f_up_gb +trif_vars%f_up => trif_vars_data%f_up +trif_vars%ps_or_p_out => trif_vars_data%ps_or_p_out +trif_vars%ps_out => trif_vars_data%ps_out +trif_vars%ps_or_out => trif_vars_data%ps_or_out +trif_vars%ps_in_out => trif_vars_data%ps_in_out +trif_vars%ps_par_out => trif_vars_data%ps_par_out +trif_vars%ps_occ_out => trif_vars_data%ps_occ_out +trif_vars%fn_out => trif_vars_data%fn_out +trif_vars%fp_out => trif_vars_data%fp_out +trif_vars%p_litter_flux => trif_vars_data%p_litter_flux +trif_vars%p_inorg_sorp_f => trif_vars_data%p_inorg_sorp_f +trif_vars%p_inorg_desorp_f => trif_vars_data%p_inorg_desorp_f +trif_vars%p_org_sorp_f => trif_vars_data%p_org_sorp_f +trif_vars%p_org_desorp_f => trif_vars_data%p_org_desorp_f +! 18 rest vars required by the ouptut: +trif_vars%p_uptake_growth_pft => trif_vars_data%p_uptake_growth_pft +trif_vars%p_demand_growth_pft => trif_vars_data%p_demand_growth_pft +trif_vars%p_demand_lit_pft => trif_vars_data%p_demand_lit_pft +trif_vars%p_demand_spread_pft => trif_vars_data%p_demand_spread_pft +trif_vars%p_uptake_pft => trif_vars_data%p_uptake_pft +trif_vars%p_demand_pft => trif_vars_data%p_demand_pft +trif_vars%p_uptake_gb => trif_vars_data%p_uptake_gb +trif_vars%p_demand_gb => trif_vars_data%p_demand_gb +trif_vars%p_veg_gb => trif_vars_data%p_veg_gb +trif_vars%p_veg_pft => trif_vars_data%p_veg_pft +trif_vars%dpveg_pft => trif_vars_data%dpveg_pft +trif_vars%dpveg_gb => trif_vars_data%dpveg_gb +trif_vars%lit_p_t_gb => trif_vars_data%lit_p_t_gb +trif_vars%p_tot => trif_vars_data%p_tot +trif_vars%p_tot2 => trif_vars_data%p_tot2 +trif_vars%p_uptake_extract_gb => trif_vars_data%p_uptake_extract_gb +trif_vars%p_leach_soilt => trif_vars_data%p_leach_soilt +trif_vars%p_uptake_extract => trif_vars_data%p_uptake_extract +trif_vars%p_uptake_spread_pft => trif_vars_data%p_uptake_spread_pft +trif_vars%p_leach_gb_acc => trif_vars_data%p_leach_gb_acc +trif_vars%smcl_gb => trif_vars_data%smcl_gb +trif_vars%p_avail_out => trif_vars_data%p_avail_out +trif_vars%n_avail_out => trif_vars_data%n_avail_out +trif_vars%litterP_pft => trif_vars_data%litterP_pft +trif_vars%lit_p_orig_pft => trif_vars_data%lit_p_orig_pft +trif_vars%lit_p_ag_pft => trif_vars_data%lit_p_ag_pft + + IF (lhook) CALL dr_hook(ModuleName//':'//RoutineName,zhook_out,zhook_handle) RETURN END SUBROUTINE trif_vars_assoc @@ -1384,6 +1944,81 @@ SUBROUTINE trif_vars_nullify(trif_vars) NULLIFY(trif_vars%harvest_biocrop_n_gb) NULLIFY(trif_vars%harvest_doy) +! P Vars +NULLIFY(trif_vars%p_leaf_pft) +NULLIFY(trif_vars%p_root_pft) +NULLIFY(trif_vars%p_stem_pft) +NULLIFY(trif_vars%lit_p_fire_pft) +NULLIFY(trif_vars%lit_p_nofire_pft) +NULLIFY(trif_vars%cnsrv_phosphorus_triffid_gb) +NULLIFY(trif_vars%cnsrv_vegP_triffid_gb) +NULLIFY(trif_vars%cnsrv_soilP_triffid_gb) +NULLIFY(trif_vars%cnsrv_P_inorg_triffid_gb) +NULLIFY(trif_vars%root_abandon_p_pft) +NULLIFY(trif_vars%root_abandon_p_gb) +NULLIFY(trif_vars%harvest_p_pft) +NULLIFY(trif_vars%harvest_p_gb) +NULLIFY(trif_vars%p_fertiliser_add) +NULLIFY(trif_vars%p_fertiliser_pft) +NULLIFY(trif_vars%p_fertiliser_gb) +NULLIFY(trif_vars%p_leaf_trif_pft) +NULLIFY(trif_vars%p_root_trif_pft) +NULLIFY(trif_vars%p_stem_trif_pft) +NULLIFY(trif_vars%p_luc) +NULLIFY(trif_vars%lit_p_ag_pft_diag) +NULLIFY(trif_vars%lit_p_pft_diag) +NULLIFY(trif_vars%root_litP_pft) +NULLIFY(trif_vars%leaf_litP_pft) +NULLIFY(trif_vars%wood_litP_pft) +NULLIFY(trif_vars%lit_P_pft) +NULLIFY(trif_vars%minl_p_pot_gb) +NULLIFY(trif_vars%immob_p_gb) +NULLIFY(trif_vars%immob_p_pot_gb) +NULLIFY(trif_vars%minl_p_gb) +NULLIFY(trif_vars%f_up_gb) +NULLIFY(trif_vars%f_up) +NULLIFY(trif_vars%ps_or_p_out) +NULLIFY(trif_vars%ps_out) +NULLIFY(trif_vars%ps_or_out) +NULLIFY(trif_vars%ps_in_out) +NULLIFY(trif_vars%ps_par_out) +NULLIFY(trif_vars%ps_occ_out) +NULLIFY(trif_vars%fn_out) +NULLIFY(trif_vars%fp_out) +NULLIFY(trif_vars%p_litter_flux) +NULLIFY(trif_vars%p_inorg_sorp_f) +NULLIFY(trif_vars%p_inorg_desorp_f) +NULLIFY(trif_vars%p_org_sorp_f) +NULLIFY(trif_vars%p_org_desorp_f) +! 18 rest vars required by the ouptut: +NULLIFY(trif_vars%p_uptake_growth_pft) +NULLIFY(trif_vars%p_demand_growth_pft) +NULLIFY(trif_vars%p_demand_lit_pft) +NULLIFY(trif_vars%p_demand_spread_pft) +NULLIFY(trif_vars%p_uptake_pft) +NULLIFY(trif_vars%p_demand_pft) +NULLIFY(trif_vars%p_uptake_gb) +NULLIFY(trif_vars%p_demand_gb) +NULLIFY(trif_vars%p_veg_gb) +NULLIFY(trif_vars%p_veg_pft) +NULLIFY(trif_vars%dpveg_pft) +NULLIFY(trif_vars%dpveg_gb) +NULLIFY(trif_vars%lit_p_t_gb) +NULLIFY(trif_vars%p_tot) +NULLIFY(trif_vars%p_tot2) +NULLIFY(trif_vars%p_uptake_extract_gb) +NULLIFY(trif_vars%p_leach_soilt) +NULLIFY(trif_vars%p_uptake_extract) +NULLIFY(trif_vars%p_uptake_spread_pft) +NULLIFY(trif_vars%p_leach_gb_acc) +NULLIFY(trif_vars%smcl_gb) +NULLIFY(trif_vars%p_avail_out) +NULLIFY(trif_vars%n_avail_out) +NULLIFY(trif_vars%litterP_pft) +NULLIFY(trif_vars%lit_p_orig_pft) +NULLIFY(trif_vars%lit_p_ag_pft) + + IF (lhook) CALL dr_hook(ModuleName//':'//RoutineName,zhook_out,zhook_handle) RETURN END SUBROUTINE trif_vars_nullify diff --git a/src/initialisation/standalone/init_vars_tmp.F90 b/src/initialisation/standalone/init_vars_tmp.F90 index c0dc8c05..ffa3796b 100644 --- a/src/initialisation/standalone/init_vars_tmp.F90 +++ b/src/initialisation/standalone/init_vars_tmp.F90 @@ -205,13 +205,21 @@ SUBROUTINE init_vars_tmp(crop_vars,psparms,toppdm,ainfo,trif_vars, aerotype, & trif_vars%rootC_pft = 0.0 trif_vars%woodC_pft = 0.0 trif_vars%leafC_pft = 0.0 - trifctltype%c_veg_pft = 0.0 + trifctltype%c_veg_pft = 0.0 trif_vars%n_leaf_pft = 0.0 trif_vars%n_root_pft = 0.0 trif_vars%n_stem_pft = 0.0 + ! P vars: + trif_vars%p_leaf_pft = 0.0 + trif_vars%p_root_pft = 0.0 + trif_vars%p_stem_pft = 0.0 + ! end P vars trif_vars%lai_bal_pft = 0.0 - trifctltype%cv_gb = 0.0 + trifctltype%cv_gb = 0.0 trif_vars%n_veg_gb = 0.0 + ! p_veg_gb: + trif_vars%p_veg_gb = 0.0 + ! p_veg_gb: trif_vars%wp_fast_out_gb = 0.0 trif_vars%wp_med_out_gb = 0.0 trif_vars%wp_slow_out_gb = 0.0 @@ -248,21 +256,31 @@ SUBROUTINE init_vars_tmp(crop_vars,psparms,toppdm,ainfo,trif_vars, aerotype, & END IF CALL calc_n_comps_triffid(l ,n, phen, trif_vars%lai_bal_pft(l,n), & + trif_vars%leafC_pft(l,n), & trif_vars%woodC_pft(l,n), & trif_vars%rootC_pft(l,n), & trif_vars%n_leaf_pft(l,n), & trif_vars%n_root_pft(l,n), & trif_vars%n_stem_pft(l,n), & + trif_vars%p_leaf_pft(l,n), & + trif_vars%p_root_pft(l,n), & + trif_vars%p_stem_pft(l,n), & crop_vars%dvi_cpft) trif_vars%n_veg_pft(l,n) = trif_vars%n_leaf_pft(l,n) + & trif_vars%n_root_pft(l,n) + trif_vars%n_stem_pft(l,n) + + trif_vars%p_veg_pft(l,n) = trif_vars%p_leaf_pft(l,n) + & + trif_vars%p_root_pft(l,n) + trif_vars%p_stem_pft(l,n) trifctltype%cv_gb(l) = trifctltype%cv_gb(l) + & ainfo%frac_surft(l,n) * trifctltype%c_veg_pft(l,n) trif_vars%n_veg_gb(l) = trif_vars%n_veg_gb(l) + & ainfo%frac_surft(l,n) * trif_vars%n_veg_pft(l,n) + + trif_vars%p_veg_gb(l) = trif_vars%p_veg_gb(l) + & + ainfo%frac_surft(l,n) * trif_vars%p_veg_pft(l,n) END IF END DO END DO diff --git a/src/science/vegetation/plant_growth_n.F90 b/src/science/vegetation/plant_growth_n.F90 index afbf961b..39885f54 100644 --- a/src/science/vegetation/plant_growth_n.F90 +++ b/src/science/vegetation/plant_growth_n.F90 @@ -163,8 +163,22 @@ SUBROUTINE plant_growth_n (land_pts, trif_pts, n, trif_index, & ! Unlimited stem N (kgN m-2). n_leaf_pot, & ! Unlimited leaf N (kgN m-2). - lai_pot + lai_pot, & ! Unlimited Balanced LAI. + ! P Vars + p_leaf, & + ! Leaf P (kgP m-2). + p_root, & + ! Root P (kgP m-2). + p_stem, & + ! Stem P (kgP m-2). + p_root_pot, & + ! Unlimited root P (kgP m-2). + p_stem_pot, & + ! Unlimited stem P (kgP m-2). + p_leaf_pot + ! Unlimited leaf P (kgP m-2). + ! End P Vars REAL(KIND=real_jlslsm) :: & n_veg(land_pts), & @@ -233,8 +247,8 @@ SUBROUTINE plant_growth_n (land_pts, trif_pts, n, trif_index, & END IF droot_pot = dleaf_pot - CALL calc_n_comps_triffid(l, n, phen(l), lai, wood(l), root(l), & - n_leaf, n_root, n_stem, dvi_cpft) + CALL calc_n_comps_triffid(l, n, phen(l), lai, leaf(l), wood(l), root(l), & + n_leaf, n_root, n_stem, p_leaf, p_root, p_stem, dvi_cpft) n_veg(l) = n_leaf + n_root + n_stem @@ -243,9 +257,11 @@ SUBROUTINE plant_growth_n (land_pts, trif_pts, n, trif_index, & ELSE lai_pot = (leaf(l) + dleaf_pot) / sigl(n) END IF - CALL calc_n_comps_triffid(l, n,phen(l), lai_pot, wood(l) + dwood_pot, & + CALL calc_n_comps_triffid(l, n,phen(l), lai_pot, leaf(l), wood(l) + dwood_pot,& root(l) + droot_pot, n_leaf_pot, n_root_pot, & - n_stem_pot, dvi_cpft) + n_stem_pot, p_leaf_pot, p_root_pot, p_stem_pot, & + dvi_cpft) + !!! GL CNP_PHOS: Having calculations in argument lists is probably bot ideal n_plant_pot = n_leaf_pot + n_root_pot + n_stem_pot nit_pot = n_plant_pot - n_veg(l) @@ -313,9 +329,10 @@ SUBROUTINE plant_growth_n (land_pts, trif_pts, n, trif_index, & droot(l) = dleaf(l) ! Calculate the nitrogen required to satisfy the demand in new growth. - CALL calc_n_comps_triffid(l, n, phen(l), lai_pot, wood(l) + dwood(l), & + CALL calc_n_comps_triffid(l, n, phen(l), lai_pot, leaf(l), wood(l) + dwood(l),& root(l) + droot(l), n_leaf_pot, & - n_root_pot, n_stem_pot, dvi_cpft) + n_root_pot, n_stem_pot, p_leaf_pot, & + p_root_pot, p_stem_pot, dvi_cpft) n_plant_pot = n_leaf_pot + n_root_pot + n_stem_pot nit_pot = n_plant_pot - n_veg(l) @@ -357,8 +374,9 @@ SUBROUTINE plant_growth_n (land_pts, trif_pts, n, trif_index, & ELSE lai = leaf(l) / sigl(n) END IF - CALL calc_n_comps_triffid(l, n, phen(l), lai, wood(l), root(l), & - n_leaf, n_root, n_stem, dvi_cpft) + CALL calc_n_comps_triffid(l, n, phen(l), lai, leaf(l), wood(l), root(l), & + n_leaf, n_root, n_stem, p_leaf, p_root, p_stem, & + dvi_cpft) n_veg_old(l) = n_veg(l) n_veg(l) = n_leaf + n_root + n_stem diff --git a/src/science/vegetation/triffid_jls.F90 b/src/science/vegetation/triffid_jls.F90 index 5fcf3a61..66c78bd2 100644 --- a/src/science/vegetation/triffid_jls.F90 +++ b/src/science/vegetation/triffid_jls.F90 @@ -148,6 +148,9 @@ SUBROUTINE triffid (land_pts, trif_pts, trif_index, forw, r_gamma, & USE yomhook, ONLY: lhook, dr_hook +!!! GL TEMP to get things working +USE trif_vars_mod, ONLY: trif_vars_type + IMPLICIT NONE !----------------------------------------------------------------------------- @@ -261,6 +264,9 @@ SUBROUTINE triffid (land_pts, trif_pts, trif_index, forw, r_gamma, & ! Sub-surface temperature on layers and soil tiles accumulated over ! TRIFFID timestep (K). + +! TYPES containing field data +TYPE(trif_vars_type) :: trif_vars !trif_vars_mod REAL(KIND=real_jlslsm), INTENT(IN OUT) :: cnsrv_veg_triffid_gb(land_pts) REAL(KIND=real_jlslsm), INTENT(IN OUT) :: cnsrv_soil_triffid_gb(land_pts) @@ -381,6 +387,11 @@ SUBROUTINE triffid (land_pts, trif_pts, trif_index, forw, r_gamma, & REAL(KIND=real_jlslsm), INTENT(IN OUT) :: & resp_s_to_atmos_gb(land_pts,dim_cslayer) REAL(KIND=real_jlslsm), INTENT(IN) :: deposition_n_gb(land_pts) +!P Vars +!REAL(KIND=real_jlslsm), INTENT(OUT) :: p_leaf_trif_pft(land_pts,npft) +!REAL(KIND=real_jlslsm), INTENT(OUT) :: p_root_trif_pft(land_pts,npft) +!REAL(KIND=real_jlslsm), INTENT(OUT) :: p_stem_trif_pft(land_pts,npft) +! End P Vars !p_s_parms REAL(KIND=real_jlslsm), INTENT(IN) :: sthu_soilt(land_pts,nsoilt,sm_levels) @@ -605,10 +616,18 @@ SUBROUTINE triffid (land_pts, trif_pts, trif_index, forw, r_gamma, & !------------------------------------------------------------------------- ! Diagnose nitrogen pools. !------------------------------------------------------------------------- + !CALL calc_n_comps_triffid(l, n, phen(l,n), lai_bal_pft(l,n), & + ! leafc_pft(l,n), woodc_pft(l,n), rootc_pft(l,n), & + ! n_leaf_trif_pft(l,n), n_root_trif_pft(l,n), & + ! n_stem_trif_pft(l,n), p_leaf_trif_pft(l,n), & + ! p_root_trif_pft(l,n), p_stem_trif_pft(l,n), & + ! dvi_cpft) CALL calc_n_comps_triffid(l, n, phen(l,n), lai_bal_pft(l,n), & - woodc_pft(l,n), rootc_pft(l,n), & + leafc_pft(l,n), woodc_pft(l,n), rootc_pft(l,n), & n_leaf_trif_pft(l,n), n_root_trif_pft(l,n), & - n_stem_trif_pft(l,n), dvi_cpft) + n_stem_trif_pft(l,n), trif_vars%p_leaf_trif_pft(l,n), & + trif_vars%p_root_trif_pft(l,n), trif_vars%p_stem_trif_pft(l,n), & + dvi_cpft) n_veg_pft(l,n) = n_leaf_trif_pft(l,n) + n_root_trif_pft(l,n) & + n_stem_trif_pft(l,n) @@ -665,9 +684,11 @@ SUBROUTINE triffid (land_pts, trif_pts, trif_index, forw, r_gamma, & phen(l,n) = MAX(0.0, phen(l,n)) CALL calc_n_comps_triffid(l, n, phen(l,n), lai_bal_pft(l,n), & - woodc_pft(l,n), rootc_pft(l,n), & + leafc_pft(l,n), woodc_pft(l,n), rootc_pft(l,n), & n_leaf_trif_pft(l,n), n_root_trif_pft(l,n), & - n_stem_trif_pft(l,n), dvi_cpft) + n_stem_trif_pft(l,n), trif_vars%p_leaf_trif_pft(l,n), & + trif_vars%p_root_trif_pft(l,n), trif_vars%p_stem_trif_pft(l,n), & + dvi_cpft) n_veg_pft(l,n) = n_leaf_trif_pft(l,n) + n_root_trif_pft(l,n) & + n_stem_trif_pft(l,n) @@ -843,18 +864,20 @@ SUBROUTINE triffid (land_pts, trif_pts, trif_index, forw, r_gamma, & ! Diagnose updated nitrogen pools. !------------------------------------------------------------------------- ! Work out n_leaf for 100% labile pool - CALL calc_n_comps_triffid(l, n, 0.0, lai_bal_pft(l,n), woodc_pft(l,n), & - rootc_pft(l,n), n_leaf_trif_pft(l,n), & - n_root_trif_pft(l,n), n_stem_trif_pft(l,n), & - dvi_cpft) + CALL calc_n_comps_triffid(l, n, 0.0, lai_bal_pft(l,n), leafc_pft(l,n), & + woodc_pft(l,n), rootc_pft(l,n), & + n_leaf_trif_pft(l,n), n_root_trif_pft(l,n), & + n_stem_trif_pft(l,n), trif_vars%p_leaf_trif_pft(l,n), & + trif_vars%p_root_trif_pft(l,n), trif_vars%p_stem_trif_pft(l,n), dvi_cpft) n_leaf_labile_trif_pft(l,n) = n_leaf_trif_pft(l,n) * (1.0 - phen(l,n)) ! Now for the actual phenological state. - CALL calc_n_comps_triffid(l, n, phen(l,n), lai_bal_pft(l,n), & + CALL calc_n_comps_triffid(l, n, phen(l,n), lai_bal_pft(l,n),leafc_pft(l,n),& woodc_pft(l,n), rootc_pft(l,n), & n_leaf_trif_pft(l,n), n_root_trif_pft(l,n), & - n_stem_trif_pft(l,n), dvi_cpft) + n_stem_trif_pft(l,n), trif_vars%p_leaf_trif_pft(l,n), & + trif_vars%p_root_trif_pft(l,n), trif_vars%p_stem_trif_pft(l,n), dvi_cpft) n_leaf_alloc_trif_pft(l,n) = n_leaf_trif_pft(l,n) & - n_leaf_labile_trif_pft(l,n) diff --git a/src/science/vegetation/vegcarb_jls.F90 b/src/science/vegetation/vegcarb_jls.F90 index 9642a98a..fdeab715 100644 --- a/src/science/vegetation/vegcarb_jls.F90 +++ b/src/science/vegetation/vegcarb_jls.F90 @@ -153,6 +153,8 @@ SUBROUTINE vegcarb (land_pts, trif_pts, n, trif_index, & ! Fraction of NPP available for spreading. n_root, n_leaf, n_stem, n_leaf0, n_leaf1, & ! N_pools (kg N). + p_root, p_leaf, p_stem, p_leaf0, p_leaf1, & + ! P Pools root_cn, & ! Root C:N Ratio. stem_cn, & @@ -220,14 +222,20 @@ SUBROUTINE vegcarb (land_pts, trif_pts, n, trif_index, & + g_wood(n) * wood(l) ! leaf N at full leaf - CALL calc_n_comps_triffid(l, n, 1.0, lai(l), wood(l), root(l), & - n_leaf1, n_root, n_stem, dvi_cpft) + CALL calc_n_comps_triffid(l, n, 1.0, lai(l), leaf(l), wood(l), root(l), & + n_leaf1, n_root, n_stem, & + p_leaf1, p_root, p_stem, & + dvi_cpft) ! leaf N without phenological change - CALL calc_n_comps_triffid(l, n, phen(l) + dphen(l), lai(l), wood(l), & - root(l), n_leaf0, n_root, n_stem, dvi_cpft) + CALL calc_n_comps_triffid(l, n, phen(l) + dphen(l), lai(l), leaf(l), wood(l),& + root(l), n_leaf0, n_root, n_stem, & + p_leaf0, p_root, p_stem, & + dvi_cpft) ! leaf N after phenology - CALL calc_n_comps_triffid(l, n, phen(l), lai(l), wood(l), root(l), & - n_leaf, n_root, n_stem, dvi_cpft) + CALL calc_n_comps_triffid(l, n, phen(l), lai(l), leaf(l), wood(l), root(l), & + n_leaf, n_root, n_stem, & + p_leaf, p_root, p_stem, & + dvi_cpft) root_cn = root(l) / n_root stem_cn = wood(l) / n_stem @@ -324,8 +332,10 @@ SUBROUTINE vegcarb (land_pts, trif_pts, n, trif_index, & pc_s(l) = pc(l) + forw * dpc_dlai(l) * dlai - dcveg(l) * r_gamma & - exudate(l) - CALL calc_n_comps_triffid(l, n, phen (l), lai(l), wood(l), root(l), & - n_leaf, n_root, n_stem, dvi_cpft) + CALL calc_n_comps_triffid(l, n, phen (l), lai(l), leaf(l), wood(l), root(l), & + n_leaf, n_root, n_stem, & + p_leaf, p_root, p_stem, & + dvi_cpft) plant_cn = (leaf(l) + root(l) + wood(l)) / (n_leaf + n_root + n_stem)