wiki:Documentation/UserGuide/TestCase1

Version 20 (modified by jgipsl, 4 years ago) (diff)

--

How to run a simple test case with ORCHIDEE

This page describes how to prepare the run directory and run ORCHIDEE interactively which means to launch directly in the terminal without passing trough the batch system. You can also run using a job and launch on the batch system: Documentation/UserGuide/TestCaseBatch.

You need the following files :

  • executable orchidee_ol
  • forcing_file.nc and other netcdf input files
  • run.def parameter file to set up the simulation
  • xml files to configure output using XIOS

Create a directory where you will run the model and copy input files as follow.

Executable orchidee_ol

Install and compile the model to get the executable orchidee_ol. Read more here: wiki:Documentation/UserGuide/InstallingORCHIDEEBasic

Get the input netcdf files

File in shared repository File name expected by ORCHIDEE
${R_IN}/SRF/METEO/CRU-NCEP/v5.3.2/twodeg/cruncep_twodeg_${year}.nc forcing_file.nc
${R_IN}/SRF/PFTmap_1850to2005_AR5_LUHa.rc2/PFTmap_IPCC_${year}.nc PFTmap.nc
${R_IN}/SRF/WOODHARVEST/LUH2v2/historical4/woodharvest_${year}.nc woodharvest.nc
${R_IN}/SRF/soils_param.nc soils_param.nc
${R_IN}/SRF/SOIL/soil_bulk_and_ph.nc soil_bulk_and_ph.nc
${R_IN}/SRF/cartepente2d_15min.nc cartepente2d_15min.nc
${R_IN}/SRF/reftemp.nc reftemp.nc
${R_IN}/SRF/albedo/alb_bg_modisopt_2D_ESA_v3.nc alb_bg.nc
${R_IN}/SRF/ROUTING/routing.nc routing.nc
${R_IN}/SRF/NITROGEN/N_FERTILISATION/NMIP/synthetic/historical/Nfer_pasture_${year}.nc nfert_pasture.nc
${R_IN}/SRF/NITROGEN/N_FERTILISATION/NMIP/synthetic/historical/Nfer_cropland_${year}.nc nfert_cropland.nc
${R_IN}/SRF/NITROGEN/N_FERTILISATION/NMIP/manure/historical/Nmanure_pasture_${year}.nc nmanure_pasture.nc
${R_IN}/SRF/NITROGEN/N_FERTILISATION/NMIP/manure/historical/Nmanure_cropland_${year}.nc nmanure_cropland.nc
${R_IN}/SRF/NITROGEN/N_DEPOSITION/CCMI_ndep/historical/CCMI_ndep_nhx_${year}.nc ndep_nhx.nc
${R_IN}/SRF/NITROGEN/N_DEPOSITION/CCMI_ndep/historical/CCMI_ndep_noy_${year}.nc ndep_noy.nc
${R_IN}/SRF/NITROGEN/BNF/bnf_1850.nc bnf.nc

where

Get xml files for running with XIOS

Note: If you do not compile with XIOS, you do not need to copy these files but you need to adapt run.def to activate output with IOIPSL, see further below.

The xml files controls the output of the model if you use XIOS. XIOS is the default since rev 3115 in the trunk and since rev 3839 only XIOS/trunk revision 965 (XIOS2) or later can be used. Copy all the xml files from the "modeles" directory ORCHIDEE/src_xml to your run directory: iodef.xml, context_orchidee.xml, context_input_orchidee.xml, field_def_orchidee.xml and file_def_orchidee.xml.

Edit file_def_orchidee.xml to change every instance of "_AUTO_" (3 for each output file)

  • output_level="_AUTO_" into output_level=X where X is an integer between 0-11
  • output_freq="_AUTO_" into output_freq="1mo" or output_freq="1d" par example
  • enabled="_AUTO_" into enabled="true" or enabled="false"
  • do any other change as you wish to adapt the output to your needs

Edit field_def_orchidee.xml only if you changed the ORCHDEE source code.

Parameter file run.def

Save following lines into a file named run.def:

# Simulation length
TIME_LENGTH=31D

# Parameters for regional run :
LIMIT_WEST =  -10.
LIMIT_EAST =  0.
LIMIT_NORTH =  10.
LIMIT_SOUTH =  0.

# Parameters for global run :
#LIMIT_WEST = -180.
#LIMIT_EAST =  180.
#LIMIT_NORTH =  90.
#LIMIT_SOUTH = -90.

# Set RIVER_ROUTING=n for regional domain
RIVER_ROUTING=n


# File and variable name for nitrogen input files
#**************************************************************************
Nammonium_FILE = ndep_nhx.nc
Nammonium_VAR = nhx

Nnitrate_FILE = ndep_noy.nc
Nnitrate_VAR = noy

Nfert_FILE = NONE
Nfert_VAR = nfer

Nmanure_FILE = NONE
Nmanure_VAR = Nmanure

Nfert_cropland_FILE = nfert_cropland.nc
Nfert_cropland_VAR = nfer

Nmanure_cropland_FILE = nmanure_cropland.nc
Nmanure_cropland_VAR = Nmanure

Nfert_pasture_FILE = nfert_pasture.nc
Nfert_pasture_VAR = Nfer

Nmanure_pasture_FILE = nmanure_pasture.nc
Nmanure_pasture_VAR = Nmanure

Nbnf_FILE= bnf.nc
Nbnf_VAR= BNF_MGN_PERM2_PERYR

If you want to run with IOIPSL for writing output files, then you need to deactivated XIOS and add control variables for IOIPSL in run.def. For example add following:

# Deactivate XIOS
XIOS_ORCHIDEE_OK=n

# Variables for output with IOIPSL :
WRITE_STEP= -1.
SECHIBA_HISTLEVEL= 11
SECHIBA_HISTFILE2= y
SECHIBA_HISTLEVEL2= 1
WRITE_STEP2= 10800.0
STOMATE_HIST_DT= -1.
STOMATE_HISTLEVEL= 10
STOMATE_IPCC_HIST_DT= -1.

Check you environment and launch the model

To run the model you first need to load the same netcdf library as the one used for the compilation. This depends on the machine you work at.

For example at obelix, check if you already have loaded netcdf and if yes, unload it and load netcdf/4p as follow:

module list
module unload netcdf
module load netcdf/4p

Once you've get all input files, launch the model in the same directory :

./orchidee_ol > out_orchidee_ol 2>&1

Other methods to set up a run directory

If you run with libIGCM, set up a normal job but add exit in the main Job after following:

  echo "#######################################"
  echo "#       DIR AFTER RUN EXECUTION       #"
  echo "#######################################"

  exit

Launch the job and the go to the run directory where you'll find all input netcdf files and parameter files. You can work directly in this run directory to make simpler test cases.

Note: at obelix and ada, set RUN_DIR_PATH in the main job so the run directory will be accessible.

Another way to do it from a run you've already finished with libIGCM is to look at the Script_* output file. Inside this file libIGCM lists all the files that it copies to the run directory (look for the commands where the commands IGCM_sys_Cp and IGCM_sys_Get appear in the Script_* file). If you copy those files manually to a new directory, you should be able to launch the exact same simulation.