wiki:DevelopmentActivities/inputRoutine

For r4535 and newer: External nitrogen and phosphorus inputs to the ecosystem PART 1: natural inputs

WARNING: If you are running an ENSEMBLE configuration see remarks at the bottom.

External inputs of nutrient to the ecosystem can be either (1) read in from global maps, (2) prescribed from run.def (for site simulations) or (3) computed dynamically in case of biological nitrogen fixation (BNF) and phosphorus weathering. Several flags handle this.

List of natural input fluxes currently considered

natural nitrogen input (g N m-2 yr-1)

  • Ndep_NHX: atmospheric NHX deposition
  • Ndep_NOY: atmospheric NOY deposition
  • Nbnf: Biological N2 fixation

natural phosphorus input (g P m-2 yr-1)

  • Pdep_p: atmospheric P deposition (labile P)
  • Pweat: P release from weathering

Flags to control the input fluxes in run.def

  • Ninput_update: 0=inputs are taken from restart file / 1=inputs are taken from run.def or maps
  • impose_Ninput: y=impose nutrient inputs either from map or run.def (default n)
  • impose_Nmap: y=read nutrient inputs from maps (if impose_Ninput=y), n=read from run.def (if impose_Ninput=y)

For impose_Nmap=n use the following variables to set the fluxes:

  1. Ndep_NHX: annual NHX input by deposition,
  2. Ndep_NOY: annual NOY input by deposition
  3. Nbnf: annual N input by BNF (if read_bnf=y)
  4. Pdep_p: annual P input by deposition
  5. Pweat: annual P input by wethering (if read_pweat=y)

For impose_Nmap=y use the following variables to set the input files:

  1. Ndep_NHX_FILE
  2. Ndep_NOY_FILE
  3. Nbnf_FILE (if read_bnf=y)
  4. Pdep_p_FILE
  5. Pweat_FILE (if read_weat=y)

examples

Prescribe all input fluxes from run.def (useful if you run a site simulation);

REMARK: see below how to let libIGCM update the values in run.def automatically.

# impose NP inputs(y) ....
NINPUT_UPDATE=1
NINPUT_YEAR=1
IMPOSE_NINPUT=y
# ... from run.def(n)
IMPOSE_NMAP=n
# annual fluxes [g m-2 yr-1]
Ndep_NHX=0.01
Ndep_NOY=0.02
Pdep_p=.01
# also read BNF (y); instead of computing dynamically
READ_BNF=y
Nbnf=1.
#  read BNF(y); instead of computing dynamically
READ_PWEAT=y
Pweat=.01

Prescribe all input fluxes from maps (default procedure for regional to global simulations

WARNING: The routine will automatically set any flux to zero for which you do not give the filename. Please check your outputs to make sure you fluxes are set correctly.

# in case you run ENSEMBLE configuration:
# hardcode NINPUT_UPDATE=1 in slowproc.f90

# impose NP inputs(y) ....
NINPUT_UPDATE=1
NINPUT_YEAR=1
IMPOSE_NINPUT=y
# ... from maps(y)
IMPOSE_NMAP=y
# I store the three fluxes as variables Ndep_NHX, Ndep_NOY, and Pdep in a single file:
Ndep_NHX_FILE=deposition.nc
Ndep_NOY_FILE=deposition.nc
Pdep_p_FILE=deposition.nc

# we compute BNF and weathering dynamically (input files are currently not available)
READ_PWEAT=n
READ_BNF=n

Deposition data

We have time series of N and P deposition from Wang et al. (2017) 'Global forest carbon uptake due to nitrogen and phosphorus deposition from 1850 to 2100' ready to use for ORCHIDEE.

since r4535

obelix:/home/surface3/common/CNP_files/deposition_20180416/

before

Mind the setup is different (other flags,etc)

curie:/ccc/work/cont003/dsm/p529goll/NP_deposition/final_NEW
obelix:/home/surface3/common/CNP_files/deposition/

use libIGCM to update yearly the fluxes in run.def in case of IMPOSE_NMAP=n

Add this to orchidee_ol.driver COMP/orchidee_ol.driver:

##########################################################################
# NP DEPOSITION FROM FILE - SITE SIMULATION
##############################################################################################
    if [ -f NPdeposition.txt ] ; then
        # If this file exist, then read N and P deposition 
        NOY=`grep Annee_${year} NPdeposition.txt | awk -F, '{print $2}'`
        NHX=`grep Annee_${year} NPdeposition.txt | awk -F, '{print $3}'`
        Pdep=`grep Annee_${year} NPdeposition.txt | awk -F, '{print $4}'`

        if [ X"${NOY}" = X ] ; then
            # The grep returned empty variable: stop execution
            IGCM_debug_Exit "The file NPdeposition.txt.txt do not contain the current year."
            IGCM_debug_Verif_Exit
        fi
        IGCM_comp_modifyDefFile nonblocker run.def Ndep_NHX ${NHX}
        IGCM_comp_modifyDefFile nonblocker run.def Ndep_NOY ${NOY}
        IGCM_comp_modifyDefFile nonblocker run.def Pdep_p   ${Pdep}
    fi

##############################################################################################

add to COMP/stomate.card the link to your deposition file

[ParametersFiles]
List=   (${SUBMIT_DIR}/PARAM/run.def, .),\
        (/ccc/work/cont003/dsm/p529goll/AmaFACE_forcing/v01/CO2_1850_2100_AmaFACE.txt, CO2.txt),\
        (/ccc/work/cont003/dsm/p529goll/AmaFACE_forcing/AmaFACE18502100_NPdeposition.txt, NPdeposition.txt)

the deposition file should store yearly fluxes in g/m2/yr; sequence is Annee_YEAR,NOY,NHX,Pdep:

Annee_1850,0.0715,0.0715,0.0144
Annee_1851,0.0715,0.0715,0.0144
Annee_1852,0.0715,0.0715,0.0144
Annee_1853,0.0715,0.0715,0.0144
Annee_1854,0.0715,0.0715,0.0144
Annee_1855,0.0715,0.0715,0.0144
Annee_1856,0.0715,0.0715,0.0144
Annee_1857,0.072,0.072,0.0144
Annee_1858,0.072,0.072,0.0144

set fluxes to _AUTO_ in PARAM/run.def:

# impose NP inputs(y) ....
NINPUT_UPDATE=1
NINPUT_YEAR=1
IMPOSE_NINPUT=y
# ... from map(y) or run.def(n)
IMPOSE_NMAP=n

# compute BNF dynamically(y) / if not(n) you need to set bnf=
READ_BNF=n
READ_PWEAT=n

### Let libIGCM fill them using the values from NPdeposition.txt
# Deposition ALL _AUTO_
Ndep_NHX=_AUTO_:DEFAULT=0.
Ndep_NOY=_AUTO_:DEFAULT=0.
Pdep_p=_AUTO_:DEFAULT=0.

For ENSEMBLE setup

Currently, the flag NINPUT_UPDATE is overwritten by libIGCM so that nutrient inputs are not read from run.def.

Till I found a solution you need to hardcode the value in the source code in src_sechiba/slowproc.f90:

    Ninput_update=1
    !DSG AMA Ninput_update=0
    !DSG AMA !JC modif just simply read the nutrient input file when Ninput_update
    !DSG AMA !> 0
    !DSG AMA CALL getin_p('NINPUT_UPDATE', Ninput_update)
    !DSG AMA IF (Ninput_update .GT. 0 ) THEN
    !DSG AMA   WRITE(numout,*) "Update Nutrient inputs",Ninput_update
    !DSG AMA ELSE
    !DSG AMA   WRITE(numout,*) "DONOT update Nutrient inputs",Ninput_update
    !DSG AMA ENDIF

then recompile the model.

Last modified 5 months ago Last modified on 06/05/18 11:10:00