ORCHIDEE

De Wikicima
Saltar a: navegación, buscar

Contenido

ORCHIDEE

This manual provides the information about the land-surface model ORCHIDEE (orchidee) from Institute Pierre Simone Laplace (IPSL). Its installation on the HPC of the CIMA called hydra

Model description

  • ORCHIDEE: sechiba & stomate
  • Two major modes of simulations: Off-line (no feedback) / on-line (LMDZ, WRF)
  • Off-line atmospheric forcings: ORforcings
    • Atmoshperic variables required by ORCHIDEE: LWdown, PSurf, Qair, Rainf, SWdown, Snowf, Tair, Wind_E, Wind_N
    • CRU-NCEP (v5.4, 0.5°): mixing CRU with NCEP: cruncep_halfdeg_[YYYY].nc at hydra (taking ${ORforcing}=/share/ORCHIDEE/data/IGCM/SRF):
${ORforcing}/METEO/CRU-NCEP/v5.4/halfdeg
  • Morphological forcings as data-base:
    • To be interpolated to the domain of simulation (region and resolution) at the first time step (done by ORCHIDEE)
    • Mandatory:
      • PFT map:
        • 13 PFT, percentage of each by grid-point (maxvegetfrac, see table for equivalencies of PFT)
num description
1 bared ground
2 tropical broad-leaved evergreen
3 tropical broad-leaved raingreen
4 temperate needleleaf evergreen
5 temperate broad-leaved evergreen
6 temperate broad-leaved summergreen
7 boreal needleleaf evergreen
8 boreal broad-leaved summergreen
9 boreal needleleaf summergreen
10 C3 grass
11 C4 grass
12 C3 agriculture
13 C4 agriculture
        • PFTmap_IPCC_[YYYY].nc (0.5°, basic), a file per/year ESA-LUH2, historical, v1.2 at:
${ORforcing}/PFTMAPS/CMIP6/ESA-LUH2/historical/v1.2/
        • carteveg5km.nc (94 PFT, 5km tranformation to 13 PFT) No temporal evolution at:
${ORforcing}/PFTMAPS/
(thumbnail)
Global Olson vegetation at 5 km of resolution Homolosine projection
      • Soil characterisitcs
        • soilcolor (1 to 8 to define background-albedo: albedowet, albedodry)
        • soiltexture (1 to 7 to define soil type, to be grouped as 3 types: corse, medium, fine)
        • soils_param.nc (1.°, basic), soils_param_zobler.nc, soils_param_usda.nc, ...
    • Additional:
      • LAI: on runs without stomate (otherwise, LAI is dynamic), one needs to provide climatologies of the LAI: 13 LAI values which evolves along time (monthly climatology) lai2D.nc
      • Albedo: on runs without stomate (otherwise, albedo is dynamic) new maps only for the albedo at higher resolution to avoid the use of soilcolor from soils_param.nc. Climatological values (12 months) for wet/dry background albedo
${ORforcing}/albedo
      • Routing: routing.nc: worldwide data-base of river basins at 0.5°: 1-8 direction, <89 point at the sea, ... (trip), riverID (basins), water retention (topoind), etc..., cartepente2d_15min.nc topography slope (0.25°)
      • Floodplains: floodplain.nc To account for maximum flooded area: lake, dam, swamp, saline, pond, irrig
      • Chemistry: orchidee_fertilizer_1995.nc with fertilization (for N2) for rice and the others
      • Reference Temperature: To be used as a reference temperature for the soil (reftemp.nc)
  • All ORCHIDEE configuration is controlled by run.def.: Domain, period, physics activation, sechiba/stomate, routing, floodplains, ... ORparameters
  • I/O controlled by *.xml files from XIOS libraries
    • iodef.xml: main XIOS configuration
    • context_orchidee.xml: I/O global configuration for ORCHIDEE
    • field_def_orchidee.xml: definition of I/O variables (names, units, dimensions, long-name, ...)
    • file_def_orchidee.xml: definition of variables at each file (output frequency, level of output, ...)

Instalation

This installation guide is based on the installation in hydra, which it must have pre-installed: netCDF libraries, MPI libraries, Fortan and C compilers, pre-processing tools, subversion repository code tool

Installation steps using modipsl

  • Go to the installation directory [INSTALLDIR] (for hydra [INSTALLDIR]=/share)
$ cd [INSTALLDIR]
  • Getting the IPSL-models suite
$ svn co https://forge.ipsl.jussieu.fr/igcmg/svn/modipsl/trunk modipsl
  • Going to the util folder:
$ cd modipsl/util
  • Getting the off-line version of ORCHIDEE
$ ./model ORCHIDEE_trunk >& run_get_model.log
  • We got some issues with the ports, thus, it needs to be manually done:
$ cd ../modeles
  • Getting IOIPSL:
$ mkdir -p IOIPSL/src 
$ svn co https://forge.ipsl.jussieu.fr/igcmg/svn/IOIPSL/tags/v2_2_2/src IOIPSL/src
  • Getting XIOS library
$ svn co -r 1043 https://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/trunk XIOS
  • By the end one should have:
$ ls
IOIPSL  ORCHIDEE  XIOS
  • Going back to util to proceed
$ cd ../util
  • These are the final versions of the codes
    • ORCHIDEE: 4622
    • ORCHIDEE_OL: 4622
    • IOIPSL: 3379
    • XIOS: 1043
  • Preparing compilation environment for hydra. One need to add into AA_make.gdef specifications for hydra (at the end of file):
#-Q- ifort_hydra   #- Global definitions for hydra, ifort
#-Q- ifort_hydra LIB_MPI = MPI1
#-Q- ifort_hydra LIB_MPI_BIS = MPI1
#-Q- ifort_hydra FCM_ARCH = ifort_hydra
#-Q- ifort_hydra   M_K = make
#-Q- ifort_hydra   P_C = cpp
#-Q- ifort_hydra   P_O = -P -C -traditional $(P_P)
#-Q- ifort_hydra   F_C = /usr/local/bin/mpif90 -c -cpp
#-Q- ifort_hydra   #-D- MD    F_D = -g
#-Q- ifort_hydra   #-D- MN    F_D =
#-Q- ifort_hydra   #-P- I4R4  F_P = -i4
#-Q- ifort_hydra   #-P- I4R8  F_P = -i4 -r8
#-Q- ifort_hydra   #-P- I8R8  F_P = -i8 -r8
#-Q- ifort_hydra   F_O = -DCPP_PARA -O3 $(F_D) $(F_P) -I$(MODDIR) -module $(MODDIR) -fp-model precise
#-Q- ifort_hydra   F_L = /usr/local/bin/mpif90
#-Q- ifort_hydra   M_M = 0
#-Q- ifort_hydra   L_X = 0
#-Q- ifort_hydra   L_O =
#-Q- ifort_hydra   A_C = ar -rs
#-Q- ifort_hydra   A_G = ar -x
#-Q- ifort_hydra   C_C = cc -c
#-Q- ifort_hydra   C_O =
#-Q- ifort_hydra   C_L = cc
#-Q- ifort_hydra   #-
#-Q- ifort_hydra   NCDF_INC = /usr/local/include
#-Q- ifort_hydra   NCDF_LIB = -L/usr/local/lib -lnetcdf -lnetcdff
#-Q- ifort_hydra  #-
  • Creation of the configuration \verb+arch+ files for the compilation of each component
  • XIOS
    • going there:
$ cd ../modeles/XIOS/arch
    • Using CICLAD's ifort compilation as reference
$ cp arch-ifort_CICLAD.fcm arch-ifort_hydra.fcm
    • Adapting values (following ifort bug issue for version 12.0.3, ifort bug):
%CCOMPILER           /usr/local/bin/mpicc 
%FCOMPILER           /usr/local/bin/mpif90 
%LINKER        /usr/local/bin/mpif90 -nofor-main

%BASE_CFLAGS    -std=c++0x 
%PROD_CFLAGS    -O3 -D BOOST_DISABLE_ASSERTS 
%DEV_CFLAGS     -g -traceback 
%DEBUG_CFLAGS   -DBZ_DEBUG -g -traceback -fno-inline 

%BASE_FFLAGS    -D__NONE__
%PROD_FFLAGS    -O3 
%DEV_FFLAGS     -g -O2 -traceback 
%DEBUG_FFLAGS   -g -traceback 

%BASE_INC       -D__NONE__
%BASE_LD        -lstdc++ 

%CPP            /usr/local/bin/mpicc -EP 
%FPP            cpp -P 
%MAKE           gmake
    • Getting paths:
$ cp arch-ifort_CICLAD.path arch-ifort_hydra.path
    • Adapting values:
NETCDF_INCDIR="-I/usr/local/include" 
NETCDF_LIBDIR="-L/usr/local/lib" 
NETCDF_LIB="-lnetcdf -lnetcdff" 
MPI_INCDIR="" 
MPI_LIBDIR="" 
MPI_LIB="" 
HDF5_INCDIR="" 
HDF5_LIBDIR="" 
HDF5_LIB=""
  • ORCHIDEE
    • Going there
$ cd ../../ORCHIDEE/arch
    • Using CICLAD's ifort compilation as reference
$ cp arch-ifort_CICLAD.fcm arch-ifort_hydra.fcm
    • Adapting values:
%COMPILER            /usr/local/bin/mpif90 
%LINK                /usr/local/bin/mpif90
%AR                  ar 
%MAKE                gmake
%FPP_FLAGS           -P -traditional
%FPP_DEF
%BASE_FFLAGS         -i4 -r8 -fp-model precise 
%PROD_FFLAGS         -O3 
%DEV_FFLAGS          -g -O2 -traceback -fp-stack-check -ftrapuv -check bounds 
%DEBUG_FFLAGS        -fpe0 -O0 -g -traceback -fp-stack-check -ftrapuv -check bounds -check all
%MPI_FFLAGS 
%OMP_FFLAGS          -openmp -openmp-threadprivate compat
%BASE_LD             -i4 -r8
%MPI_LD 
%OMP_LD              -openmp
    • getting paths
$ cp arch-ifort_CICLAD.path arch-ifort_hydra.path
    • Adapting values:
NETCDF_LIBDIR="/usr/local/lib -lnetcdf -lnetcdff -lstdc++" 
NETCDF_INCDIR=/usr/local/include 
IOIPSL_INCDIR=../../../lib
IOIPSL_LIBDIR=../../../lib 
XIOS_INCDIR=${ORCHDIR}/../XIOS/inc 
XIOS_LIBDIR="${ORCHDIR}/../XIOS/lib -lxios"

\end{enumerate}

    • Going back to util to proceed
$ cd ../../../util
    • Installing the code:
$ ./ins_make -t ifort_hydra >& run_ins_make.log
    • Going there:
$ cd ../config/ORCHIDEE_OL
    • No need to loading the right environment since in hydra its by default
    • Compiling XIOS in sequential (in Makefile, adding no-parallel compilation):
./make_xios --netcdf_lib netcdf4_seq (...)
    • Compiling:
$ gmake >& run_gmake.log
    • Checking if everything went fine:
$ cat -n run_gmake.log | grep Error
$ cat -n run_gmake.log | grep undefined
$ ls ../../bin/ 
orchidee_ol  xios_server.exe

Running the model

ORCHDEE can run in a large variety of forms. Here is desribed a simple way to run a year of simulation

  • Assuming a working directory ${WORKDIR} (e.g.: /home/lluis.fita/estudios/LUPA). Creation of the running folder
$ mkdir -p tests/control 
$ cd tests/control
  • Writting of a simple run.def with stomate and routing activated for the 1977 year
# Use XIOS for writing diagnostics file
# defulat = n
XIOS_ORCHIDEE_OK = y
#
START_DATE = 1977-01-01_00
END_DATE = 1978-01-01_00
TIME_LENGTH = 1Y
DT_SECHIBA = 1800

# Atmospheric forcing file
FORCING_FILE = atmos_forcing.nc

#
# South America
#
#WEST_EAST = -85., -31.
#SOUTH_NORTH = -57, 14.
LIMIT_WEST = -85.
LIMIT_EAST = -31.
LIMIT_SOUTH = -57.
LIMIT_NORTH = 14.
MERID_RES = 0.5
ZONAL_RES = 0.5

VEGET_YEAR=1

# Activation of stomate
STOMATE_OK_CO2= y
STOMATE_OK_STOMATE= y

# For routing
RIVER_ROUTING = y
ROUTING_FILE = routing.nc
HYDROL_CWRR = y
DT_ROUTING = 86400
RIVER_DESC = y
RIVER_DESC_FILE = river_desc.nc
ROUTING_RIVERS = 50

# Debug standard output printing level
PRINTLEV = 0
  • Linking atomspheric forcing files (0.5° CRU-NCEP v5.4 files)
$ ln -s /share/ORCHIDEE/data/IGCM/SRF/METEO/CRU-NCEP/v5.4/halfdeg/cruncep_halfdeg_1977.nc ./atmos_forcing.nc
  • Linking the routing data-base
$ ln -s /share/ORCHIDEE/data/IGCM/SRF/routing.nc ./
  • Linking the topographical slope
$ ln -s /share/ORCHIDEE/data/IGCM/SRF/cartepente2d_15min.nc ./
  • Linking the morphological files
$ ln -s /share/ORCHIDEE/data/IGCM/SRF/soils_param.nc ./ 
$ ln -s /share/ORCHIDEE/data/IGCM/SRF/PFTmap_IPCC_1850.nc ./PFTmap.nc
  • Getting the XIOS files
$ cp /share/modipsl/modeles/ORCHIDEE/src_xml/*xml ./
  • Edit the file_def_orchidee.xml to define output frequency and level of of output (remove all the _AUTO_)
$ vim file_def_orchidee.xml
  • The final configuration gets:
$ cat file_def_orchidee.xml | grep 'file id' 
  <file id="sechiba1" name="sechiba_history" output_level="11" output_freq="1d" enabled=".TRUE."> 
  <file id="sechiba2" name="sechiba_out_2" output_level="2" output_freq="1mo" enabled=".FALSE."> 
  <file id="sechiba3" name="sechiba_history_4dim" output_level="11" output_freq="1d" enabled=".TRUE."> 
  <file id="sechiba1_alma" name="sechiba_history_alma" output_level="10" output_freq="1mo" enabled=".FALSE."> 
  <file id="sechiba2_alma" name="sechiba_out_2_alma" output_level="10" output_freq="1d" enabled=".FALSE."> 
  <file id="stomate1" name="stomate_history" output_level="10" output_freq="1d" enabled=".TRUE.">
  <file id="stomate2" name="stomate_ipcc_history" output_level="1" output_freq="1mo" enabled=".FALSE.">
  • Linking the ORCHIDEE executable
$ ln -s /share/modipsl/bin/orchidee_ol ./
  • Getting the PBS scheduling job to run ORCHIDEE
$ cp /share/ORCHIDEE/run_or.pbs ./
  • Launching the model
$ qsub run_or.pbs
  • If everything went fine, one should have (at least)
orout/sechiba_history.nc  orout/sechiba_history_4dim.nc  stomate_history.nc
    • sechiba_history.nc, sechiba_history_4dim.nc, stomate_history.nc: Outputs (optional, only when stomate is activated)
    • sechiba_rest_out.nc, stomate_restart.nc: restarts for sechiba<code> and <code>stomate (optional, only when stomate is activated)
    • out_orchidee_[nnnn]: standard output files for each process
    • river_desc.nc: output with river description (optional, only when routing is activated)

Compiling rebuild

Due to the fact that hydra does not have the netcdf libraries compiled in parallel, ORCHDEE output is written with multiple files being a file for each process. In order to overcome this output. IPSL does prepare a tool to join the files and provide the expected output. This tool is called rebuild (a Kornshell script which encapsulates de exacutable flio_rbld) and it comes with the IOIPSL libraries. The IOIPSL libraries, are a set of old libraries developed by the IPSL (M. A. Foujuls, J. Polcher among others) to deal with the netCDF data access for all the models developed at the IOIPSL. Compiling IOIPSL (following install rebuild. It has to be compiled independently. Here it is explained how it has to be done.

  • Go to the instalation directory [INSTALLDIR] (at hydra share)
$ cd [INSTALLDIR]
  • getting the last version of the code
$ svn co https://forge.ipsl.jussieu.fr/igcmg/svn/modipsl/trunk modipsl_IOIPSLtools
  • going to prepare compilation/installation
$ cd modipsl_IOIPSLtools/util
  • preparing environment
./model IOIPSL_PLUS
  • We got some issues with the ports, thus, it needs to be manually done:
$ cd ../modeles
  • Getting IOIPSL (NOTE: notice the difference in library's version from the previous one):
$ svn co https://forge.ipsl.jussieu.fr/igcmg/svn/IOIPSL/tags/v2_2_3 IOIPSL
  • Comming back to the util folder
$ cd ../util
  • Creation of the compilation environment for `hydra' using 'ifort' inside AA_make.gdef as in the full compilation
$ cp ../../modipsl/util/AA_make.gdef ./
  • Preparing makefiles
$ ./ins_make -t "ifort_hydra" -p I4R8
  • going to src folder to compile
$ cd ../modeles/IOIPSL/src
  • cleaning (you never know...)
$ make clean
  • compiling
$ make >& run_make.log
  • Checking no errors:
$ cat -n run_make.log | grep Error
  • compilation of tools (file concatenation)
$ cd ../tools 
  • cleaning (you never know...)
$ make clean
  • compiling
$ make >& run_make.log
  • Checking no errors:
$ cat -n run_make.log | grep Error
  • One should have:
$ ls ../../../bin/ 
flio_rbld  rebuild

debug Instalation

Getting a debugging copy for test purposes

Instalation steps using modipsl

  • Go to the instalation directory [INSTALLDIR] (/share in hydra)
$ cd [INSTALLDIR]
  • Getting the IPSL-models suite (r 3379)
$ svn co https://forge.ipsl.jussieu.fr/igcmg/svn/modipsl/trunk modipsl_dbg
  • Once we got the codes, we need to copy the specificities of the installation for hydra
$ cp ../../modipsl/util/AA_make.gdef ./
$ cp ../../modipsl/modeles/XIOS/arch/*hydra* ../modeles/XIOS/arch/
$ cp ../../modipsl/modeles/ORCHIDEE/arch/*hydra* ../modeles/ORCHIDEE/arch/
  • Everything is the same as for the installation, except that we need to indicate debugging compilation:
./ins_make -t ifort_hydra -d >& run_ins_make.log
  • And on Makefile from config/ORCHIDEE_OL, change all the -prod by -debug
(...)
xios : 
        (cd  ../../modeles/XIOS ; ./make_xios --netcdf_lib netcdf4_seq \
--debug --arch ${FCM_ARCH} --job 8 ; cp bin/xios_server.exe ../../bin/. ; ) 
(...)
driver : 
        (cd ../../modeles/ORCHIDEE ; ./makeorchidee_fcm -j 8 -parallel mpi -debug -arch ${FCM_ARCH} -driver ; )
(...)
driver_xios : 
        (cd ../../modeles/ORCHIDEE ; ./makeorchidee_fcm -xios2 -j 8 -parallel mpi -debug -arch ${FCM_ARCH} -driver ; ) 
(...)
  • Compiling:
$ gmake >& run_gmake.log
  • Checking if everything went fine:
$ cat -n run_gmake.log | grep Error 
$ cat -n run_gmake.log | grep undefined
$ ls ../../bin/ 
orchidee_ol  xios_server.exe
Herramientas personales