Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions doc/source/namelists/jules_vegetation.nml.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions doc/source/overview/key-switches.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 7 additions & 0 deletions rose-meta/jules-standalone/HEAD/rose-meta.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 7 additions & 6 deletions rose-meta/jules-standalone/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
60 changes: 55 additions & 5 deletions src/control/shared/CN_utils_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

!-----------------------------------------------------------------------------
Expand All @@ -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 &
Expand All @@ -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)
Comment on lines +119 to +129

!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

Expand Down Expand Up @@ -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

Comment on lines +197 to +199
!------------------------------------------------------------------------------
! Calculate root and stem N.
!------------------------------------------------------------------------------
Expand All @@ -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

!#############################################################################
Expand Down
33 changes: 31 additions & 2 deletions src/control/shared/jules_soil_biogeochem_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
10 changes: 10 additions & 0 deletions src/control/shared/p_s_parms.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines +99 to +101
END TYPE

!================================
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand All @@ -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))
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading
Loading