wiki:CARAIBasVegModel

Steps for a run with the vegetation model CARAIB

1. Pre-industrial

  • In your caraib-git directory, modify caraib_main_01.F

#define CPL_MODE 1

#define OXYISO 0

#define LGM 0

#define TRANSIENT 0

  • Compile the CARAIB code to create the library

Execute the command make all


  • In iloveclim/ecbilt_clio/global_flags/choixcomposantes.h

#define CARAIB 1

  • In iloveclim/ecbilt_clio/parameters/emic.param desactivate the VECODE component

F VECODE

  • In iloveclim/caraib_cpl/parameters/file_input5

Change nyrmax, the total number of years of the simulation

The paths of the soil texture, max air temp and lightning data must be set to

/home/climwork/CLIM-DATA/CARAIB-DATA/PI/ecotxt.dat

/home/climwork/CLIM-DATA/CARAIB-DATA/PI/dte

/home/climwork/CLIM-DATA/CARAIB-DATA/PI/lightning.dat

There is no need to change the pCO2 concentration and the orbital parameters in the file since they are given by iLOVECLIM


  • Start a new loveclim run as usual
  • The vegetation results are created in the directory run/outputdata/vegetation


2. LGM

  • In your caraib-git directory, modify caraib_main_01.F

#define CPL_MODE 1

#define OXYISO 0

#define LGM 1

#define TRANSIENT 0

  • In caraib-git/com_18/parameter.common adapt the value of pix_car for the LGM simulation to 622
  • Compile the CARAIB code to create the library

Execute the command make all


  • In iloveclim/ecbilt_clio/global_flags/choixcomposantes.h

#define CARAIB 1

#define ROUTEAU 1

#define F_PALAEO 1

#define LGMSWITCH 1

  • In iloveclim/ecbilt_clio/parameters/emic.param desactivate the VECODE component

F VECODE

  • Set the palaeo_year to 21000 in ludus-code/ecbilt/parameters/palaeo_transient_parameters.dat
  • In iloveclim/caraib_cpl/parameters/file_input5

Adapt nyrmax to the total number of years of the simulation

Change the pixel number to 622

Change the name of the soil texture, max air temp and lightning data files to

/home/climwork/CLIM-DATA/CARAIB-DATA/LGM/ecotxt_LGM.dat

/home/climwork/CLIM-DATA/CARAIB-DATA/LGM/dte_LGM

/home/climwork/CLIM-DATA/CARAIB-DATA/LGM/lightning_LGM.dat

There is no need to change the pCO2 concentration and the orbital parameters in the file since they are given by iLOVECLIM


  • Start a new LGM loveclim run with something like this

./bin/loveclim-new-run -l CARAIB_LGM -n 3000 -r 250 -I /home/climwork/textier/iloveclim-1085/iloveclim/scenario/lgm-pmip2-PIcalotte/inputdata –P /home/climwork/textier/iloveclim-1085/iloveclim/scenario/lgm-pmip2-PIcalotte/parameters-r923

  • The vegetation results are created in the directory run/outputdata/vegetation


3. Run with additional isotopes of the atmospheric oxygen

The following lines are in complement to the previous sections and required to have CARAIB configured for the pre-industrial or the LGM.

  • In your caraib-git directory, modify caraib_main_01.F

#define CPL_MODE 1

#define OXYISO 1

#define LGM 0 (or 1 depending on the time period)

#define TRANSIENT 0 (or 1 depending if it is a transient run)

  • Compile the CARAIB code to create the library

Execute the command make all


  • In iloveclim/ecbilt_clio/global_flags/choixcomposantes.h

#define CARAIB 1

#define OXYISO 1

#define EVAPSI 1

#define ISOATM 2

#define ISOLBM 1

#define ISOOCN 2


  • Start a new loveclim run as usual
  • The results are created in the directory run/outputdata/d18Oatm


4. Transient run (with CARAIB and oxygen isotopes)

  • In your caraib-git directory, modify caraib_main_01.F

#define CPL_MODE 1

#define OXYISO 1

#define LGM 1

#define TRANSIENT 1

  • In caraib-git/com_18/parameter.common let the value of pix_car to 622
  • Compile the CARAIB code to create the library

Execute the command make all


  • In iloveclim/ecbilt_clio/global_flags/choixcomposantes.h

#define CARAIB 1

#define OXYISO 1

#define ROUTEAU 1

#define F_PALAEO 1

#define EVAPSI 1

#define ISOATM 2

#define ISOLBM 1

#define ISOOCN 2

#define LGMSWITCH 1

  • In iloveclim/ecbilt_clio/parameters/emic.param desactivate the VECODE component

F VECODE

  • In ludus-code/ecbilt/parameters/palaeo_transient_parameters.dat

Set the palaeo_year to the corresponding time of the beginning of the transient simulation (e.g. 21000 in case of the last deglaciation)

Change the ref_irunlabel to 6000 to restart from existing equilibrium simulation

Change the accel_rt to 10 for accelerated simulation (the irradiance, GHGs and ice sheets are updated with an acceleration factor of 10)

Change the equil_flag to 0 for transient run

  • In iloveclim/caraib_cpl/parameters/file_input5

Adapt nyrmax to the total number of years of the simulation

Change ifrac_rd, ilai_rd and iread to 1 to initialize the run with existing files

Change the name of the soil texture, max air temp and lightning data files according to the simulated period

Put the right file paths between L68-74, corresponding to the vegetation fraction and other initial conditions of previous equilibrium simulation

There is no need to change the pCO2 concentration and the orbital parameters in the file since they are given by iLOVECLIM at every time steps of the simulation


  • Start a new run with something like this (e.g. for the last deglaciation)

./bin/loveclim-new-run -l CARAIB_TRdegla -n 2100 -r 300 -s 6000 -S /home/climwork/textier/iloveclim-1085/iloveclim/data/LGM_EQ_Rtopo_ecbilt_clio/ic006000 -I /home/climwork/textier/iloveclim-1085/iloveclim/scenario/lgm-pmip2-PIcalotte/inputdata –P /home/climwork/textier/iloveclim-1085/iloveclim/scenario/lgm-pmip2-PIcalotte/parameters-r923


5. Computation of the required files to run CARAIB

The first file is the environmental file ecotxt.dat (which contains the pixel number, longitude, latitude, FAO soil number, clay content, silt content, sand content, elevation above sea level and soil color). Its computation needs to be done before running of simulation with CARAIB and requires information from iLOVECLIM. All the needed scripts are in /home/climwork/textier/tools/make_ecotxt

  • We need the orographu.ctl and orographu.dat files from a previous equilibrium simulation to generate a netcdf file:

cdo -f nc import_binary orographu.ctl orographu.nc

  • We need to recover the continental fraction from previous equilibrium simulation using the script extract-value-fracto.f90 with corresponding file paths

ifort extract-value-fracto.f90

./a.out > frac_land.txt

  • This file is then covert to netcdf using python script txt_to_nc.py after changing the file paths
  • A new orography file is created considering only the pixel with a land fraction >= 0.3 using nc_oro_to_txt.py after changing the file paths. The pixels above 60°S need to be removed since CARAIB does not take into account Antarctica
  • The same is done for the dte file (maximum-minimum daily temperature) using a T21 climatic mean file between 1961-2012 and the script nc_dte_to_txt.py after changing the file paths
  • The ecotxt.dat file can now be generated using the script make_ecotxt_coupl_5deg.f in the mkinputs directory of the caraib-git depository. The pixel number ngr has to be changed according to the time period as well as the file paths L81-88

ifort -o make_ecotxt_coupl_5deg.out make_ecotxt_coupl_5deg.f

./make_ecotxt_coupl_5deg.out

  • The same is done to generate the lightning.dat file, changing the pixel number ngr and the file paths L73-77


The three files ecotxt.dat, dte.dat, lightning.dat are then used in the configuration file file_input5


6. Offline run with CARAIB

(This part is written to work with the CARAIB_dj version)

In this case the climatic variables are not transmitted by iLOVECLIM at every time steps but come from existing climatic datasets. Note that all the input data must have 365 days. You can use inputdata such as CRU or use the ECBilt climatology following the steps below:

  • Install the lasted CARAIB_dj version after cloning it from the git depository with ./simple_install.sh
  • Then in iLOVECLIM change the path in config/caraib.path to match your own and install the model with CARAIB as extra component with ./New_install_ludus.sh -E
  • In caraib_cpl/sources/ec_co2ca.f90 define the flag OUTPUT_FORC to 1 in order to write the 365 days climatology during the simulation
  • Then run a classical iLOVECLIM simulation with CARAIB after changing the choixcomposantes.h, caraib_main_01.F, emic.param and file_input5 as already shown in previous sections.

The climatology files (temperature, precipitation, relative humidity, sunshine hours and wind speed) are written in outputdata/coupler. Remember to then move the files to the corresponding directories in caraib_dj/inputdata/std-test.


Once the climatology is generated you can run an offline CARAIB simulation:

  • In your caraib_dj directory, modify sources/caraib_main_01.F

#define CPL_MODE 0

The others flags depend on your simulation.

  • In caraib_dj/configs change the file caraib01_offline.dat with the corresponding nyrmax, pixel number, spatial resolution (declg,declat - 5.625 by default), orbital parameters (exc, obl, xlsper), soil texture, air temperature, max air temp./dte, precipitation, sunshine hours, relative humidity, wind speed, lightning data paths and pco2 value
  • In caraib_dj/configs the caraib_unit5.dat file should point to ../../configs/caraib01_offline.dat
  • Adapt the pixel number and number of years of the simulation in sources/program_01.f
  • Prepare a run with ./simple_run.sh my_run
  • Start a run with ./caraib01.x < caraib_unit5.dat in your experiment directory


7. Biome computation

During a CARAIB run, only the fractions of the 26 PFTs are calculated. To look at the biome distribution, another post-processing step is needed using the scripts in caraib-git/biome_configs/. The following example is given for the LGM but can be adapted for any time period:

  • Modify the biome_LGM.dat file depending on the number of runs you want

Adapt the number of pixels ngr

Change the path and year of the climatic data (temperature, precipitation, humidity, wind speed, sunshine hours)

Change the path of the texture ecotxt.dat file

Change the path and year of the vegetation outputs

The d13C of atmosphere and resolution have to be changed depending on the time period or spatial resolution

  • In biome_unit5.dat, write biome_configs/biome_LGM.dat
  • Compile with ./compilbiome and run with ./runbiome

These steps create several files: biome.res, biome_carbon.res, pft_carbon, latitude_carbon, pixfrcC13

Last modified 4 years ago Last modified on 05/20/20 14:50:40