LMDZ Setup : Différence entre versions

De LMDZPedia
Aller à : navigation, rechercher
m (add todo)
((WIP) Add information regarding new LMDZ_Setup)
Ligne 105 : Ligne 105 :
 
==== Compilation ====
 
==== Compilation ====
  
When launching <code>main.sh</code>, before launching the simulation, we first download and compile the required models. Although we call the compilation script every time, if the model has already been compiled before, the script should detect that and skip the actual compilation, and thus execute very quickly.
+
When launching <code>main.sh</code>, before running the simulation, we first download and compile the required models. Although we call the compilation script every time, if the model has already been compiled before, the script should detect that and skip the actual compilation, and thus execute very quickly.
 +
 
 +
''Note: on supported clusters, compilation is launched in jobs rather than on the login node. This speeds up the compilation.''
  
 
  '''/!\''' As written in the comments of <code>main.sh/setup.sh</code>, '''if you change the <code>veget</code> version or the <code>aerosols</code>, it is highly recommended to do so in a NEW clean <code>LMDZ_Setup</code> folder''' rather than recompiling in the same folder.
 
  '''/!\''' As written in the comments of <code>main.sh/setup.sh</code>, '''if you change the <code>veget</code> version or the <code>aerosols</code>, it is highly recommended to do so in a NEW clean <code>LMDZ_Setup</code> folder''' rather than recompiling in the same folder.
 +
 +
=== Nudging ===
 +
 +
Nudging is set via the <code>nudging</code> variable in <code>main.sh</code>. If activated, then after installing the model, <code>LMDZ_Setup</code> will prompt you to run <code>era2gcm_tuto.sh</code>. This script fetches reanalysis data and puts it in a <code>GUIDE/</code> folder.
 +
Once this is done, simply set <code>init=0</code> in <code>main.sh</code> and relaunch it.
 +
 +
'''/!\''' On Adastra, the reanalysis files are not yet available.
 +
 +
=== Aerosols ===
 +
 +
'''/!\ As written in <code>setup.sh</code>, it is highly recommended to install <code>LMDZ_Setup</code> in a new clean directory when changing aerosols options. Otherwise i.e. the <code>DEF/config.def</code> may not get modified accordingly.'''
 +
 +
When <code>aerosols</code> is set to anything other than <code>"n"</code> in <code>setup.sh</code>, aerosols files will be downloaded in <code>LIMIT/</code>, and will be interpolated to the horizontal grid resolution (vertical interpolation is performed at runtime by the GCM.)
 +
 +
==== More detail ====
 +
 +
The aerosols files used for the options <code>"n"</code> and <code>"clim"</code> are those used in CMIP6 with the LMDZORINCA configuration, from [https://www.lmd.jussieu.fr/~lmdz/pub/3DInputData/AerChem/ here].
 +
* For <code>"n"</code>, we only use <code>aerosols1850_from_inca.nc</code> (natural aerosols), interpolated as <code>aerosols.nat.nc</code>
 +
* For <code>"clim"</code>, we also use <code>aerosols9999_from_inca.nc</code> with the mean aerosols on 1995-2014, interpolated as <code>aerosols.clim.nc</code>.
 +
 +
=== ORCHIDEE ===
 +
 +
The officially supported versions of ORCHIDEE supported by LMDZ_Setup are:
 +
* the CMIP6 version (still using the two-layer hydrology channel)
 +
* version 2.2 r7983
 +
* version 4 (trunk) r7994 (corresponding to libIGCM's LMDZOR_6.4work configuration)
 +
 +
''Note:'' The relevant ORCHIDEE def file <code>DEF/orchidee.def_*</code> gets copied as <code>DEF/orchidee.def</code> at initialisation.
 +
 +
==== Activating sechiba outputs ====
 +
 +
Sechiba outputs are written to <code>$SIMRUNBASEDIR</code>, but are deleted by <code>tmp_SIM</code> before they're rebuilt. To counter that, remove the <code>sec*</code> on the relevant line <code>set +e ; \rm out* sec* sta* list* rest* gcm.e aer* ; set -e</code>.
 +
 +
==== Simple routing ====
 +
 +
From orch 2.2 r7597 onwards, the "simple" routing scheme by Y. Meurdesoif can be activated.
 +
 +
* In <code>DEF/orchidee.def_6.*</code>, set <code>RIVER_ROUTING=y</code>, <code>ROUTING_METHOD = simple</code>, <code>RIVER_DESC=y</code> (''Note: <code>RIVER_DESC</code> is automatically set to "n" after the first simulation period.)
 +
* In <code>DEF/XMLfilesOR7***/iodef.xml</code>, add at the end of <code>context_orchidee.xml</code>: <code><context id="orchidee" src="./context_routing_orchidee.xml"/></code>.
 +
 +
See also:[https://forge.ipsl.jussieu.fr/orchidee/wiki/Documentation/UserGuide/RoutageSimple User Guide/Routage Simple] (French).
 +
 +
=== Isotopes ===
 +
 +
To activate isotopes, simply change the <code>lmd_phys</code> parameter to <code>"lmdiso"</code> in <code>main.sh</code>. This will automatically
 +
* use <code>"phylmdiso"</code> instead of <code>"phylmd"</code>;
 +
* copy <code>DEF/PHYS/physiq.def_NPiso</code> to <code>DEF/physiq.def</code>.
 +
 +
''Note: for isotopes, <code>iflag_ice_thermo</code> is automatically set to <code>0</code> instead of <code>1</code>.''
  
 
== Cluster-specific information ==
 
== Cluster-specific information ==

Version du 9 juillet 2024 à 08:26

LMDZ_Setup is a set of scripts that allows a light automatic setup of LMDZ long chained climate simulations, including the installation of the model itself.


LMDZ_Setup can only be used on the Jean-Zay computer at Idris so far.

Coming VERY soon (summer 2024) : extension to other computing centers ("spirit", adastra) and Linux PCs


Documentation (in French): LMDZ_Setup_HowTo


To extract LMDZ_Setup :

a/ Recommended : extraction from svn repository :

   svn co https://svn.lmd.jussieu.fr/LMDZ/BOL/LMDZ_Setup

b/ Download of the "tar" archive :

   wget https://lmdz.lmd.jussieu.fr/pub/Training/LMDZ_Setup.tar

c/ For those used with the old name "tutorial_prod.tar" : a link with this name still exists, pointing to LMDZ_Setup.tar :

   wget https://lmdz.lmd.jussieu.fr/pub/Training/tutorial_prod.tar


(Text extracted from LMDZ_Setup/README0_HowTo):

LMDZ_Setup consists in running LMDZ coupled to Orchidee for land surface (optional), but with imposed sea surface temperature.

The basic default configuration makes use of the IPSL-CM6A grid configuration and tuning, and runs a multi annual simulation on "climatological" amip sea surface temperature (with a mean annual cycle) using a calendar with 360 days.

Optionally : the configuration includes the ability to use interannually varying SST and to activate "nudging" by a reanalysis. In both cases, the calendar is then a real one. When nudging is activated, the simulation must be run on a monthly basis, while otherwise, it can be either monthly or yearly.

Since LMDZ_Setup automatically generates its own initial files, it can be run with zoom configurations by only changing the number of grid points ("resol" in main.sh) and the DEF/gcm.def file (see bellow).

Aerosols can be read for the year 2000 (weighted average over 1999-2001 cf Lurton et al 2020), and instantaneous forcing with respect to 1850 can be computed as well.

LMDZ_Setup can also run LMDZ coupled with the SPLA model (SimPLe Aerosol, activated with option aerosols=spla in setup.sh). Emissions of dust and sea salt are then computed interactively. For the time being, SPLA-specific input files (anthropic aerosol emissions)are only available on the grid zoomed over N Africa used by J. Escribano in his PhD thesis, and by B. Diallo and H. Senghor in subsequent work on N-African dust (file DEF/gcm.def_zNAfrica_BiJe).

A configuration with isotopes is also available since 2023-04.



WIP - Migration de LMDZ_Setup_HowTo + inclusion nouveau LMDZ_Setup

TODO Amaury: reprendre à "SSTs et SIC" + vérifier réponse Adriana pour xios+omp>2 + rajouter commentaire compilation dans jobs dans section "compilation"

Old documentation (French): LMDZ_Setup_HowTo

User guide

 /!\ WARNING 06/2024 - (ignore if installing a new version)
The JeanZay calculator, as well as Adastra, do not allow (anymore) communication from/to $STORE for running jobs on the main computing partitions.
As a result, make sure to replace $STORE by $WORK in lmdz_env.sh wherever relevant.
READ comments at the top of scripts ! Often your questions are answered there.
Note: LMDZ_Setup has been tested on Adastra and Spirit, and to a lesser extent on JeanZay (legacy support only). No guarantee is made on other platforms, although it should be easy to adapt it. It can also be ran locally - for expert use only.

Downloading LMDZ_Setup

Structure

Once you have downloaded LMDZ_Setup, you will find the following main files:

  • main.sh: the main script. It contains the basic settings you will modify.
  • setup.sh: this script contains the internal workings of LMDZ_Setup. It's where you can edit expert-level settings.
  • lmdz_env.sh: this file contains platform-specific configuration, such as where to install the model, where to run the simulations, etc.

How to run a simulation

  1. Edit lmdz_env.sh. In lmdz_env.sh, in the function set_env, find the case corresponding to your supercomputer: jean-) for JeanZay, spiri) for Spirit, adast) for Adastra. Edit the variables required for your use case. All the variables are documented in the last *) case. In particular:
    • you must set root_dir to the path where you extracted LMDZ_Setup.
  2. Edit main.sh. In main.sh, edit all relevant settings.
  3. [optional] Edit setup.sh. In setup.sh, in the function define_expert_options, edit all relevant settings.
  4. [optional] Edit DEF/*. Edit the DEF/*.def or DEF/XMLfiles* files, such as config.def, to your liking. The options you specify in main.sh/setup.sh don't require any adjustment here; such adjustments are automatically performed at runtime.
  5. Launch main.sh.

Miscellanous notes

  • Simulations run in a subdirectory of $SIMRUNBASEDIR with the same name as the LMDZ_Setup folder (if you have extracted LMDZ_Setup and renamed it to My_Setup then simulations will run in $SIMRUNBASEDIR/My_Setup). Each simulation is contained in its own folder, named after the simulation's name + a process number. As a result, you don't need to clean $SIMRUNBASEDIR before relaunching a simulation.
  • If your simulation crashes, look directly in $SIMRUNBASEDIR for the relevant log.
  • If you need a version of ORCHIDEE different from the one provided by default in the model (such as CMIP6), a password is required - ask orchidee-help at listes.ipsl.fr if you need help.

XIOS

/!\ Although XIOS is not required for ORCHIDEE >=2.2, not using it will disable some features.

Different sets of *.xml files are available in LMDZ_Setup/DEF/XMLFiles*. However, only some common files (histf, histday, histmth) have been adapted for LMDZ_Setup. If you need other outputs, be sure to edit/check the relevant *.xml:

  • replace the _AUTO_ for output_level and enabled by actual values;
  • use compression_level=0 instead of the default values (2 or 4) (since LMDZ_Setup uses XIOS in attached mode rather than client-server mode, using non-zero compression levels would require running XIOS on 1+ dedicated MPI).
Note: After installing the model, two files are automatically initialized in DEF/XMLfiles*: context_lmdz.xml and field_def_lmdz.xml. Those files don't require user intervention, and must match the exact LMDZ revision used.

Compilation

When launching main.sh, before running the simulation, we first download and compile the required models. Although we call the compilation script every time, if the model has already been compiled before, the script should detect that and skip the actual compilation, and thus execute very quickly.

Note: on supported clusters, compilation is launched in jobs rather than on the login node. This speeds up the compilation.

/!\ As written in the comments of main.sh/setup.sh, if you change the veget version or the aerosols, it is highly recommended to do so in a NEW clean LMDZ_Setup folder rather than recompiling in the same folder.

Nudging

Nudging is set via the nudging variable in main.sh. If activated, then after installing the model, LMDZ_Setup will prompt you to run era2gcm_tuto.sh. This script fetches reanalysis data and puts it in a GUIDE/ folder. Once this is done, simply set init=0 in main.sh and relaunch it.

/!\ On Adastra, the reanalysis files are not yet available.

Aerosols

/!\ As written in setup.sh, it is highly recommended to install LMDZ_Setup in a new clean directory when changing aerosols options. Otherwise i.e. the DEF/config.def may not get modified accordingly.

When aerosols is set to anything other than "n" in setup.sh, aerosols files will be downloaded in LIMIT/, and will be interpolated to the horizontal grid resolution (vertical interpolation is performed at runtime by the GCM.)

More detail

The aerosols files used for the options "n" and "clim" are those used in CMIP6 with the LMDZORINCA configuration, from here.

  • For "n", we only use aerosols1850_from_inca.nc (natural aerosols), interpolated as aerosols.nat.nc
  • For "clim", we also use aerosols9999_from_inca.nc with the mean aerosols on 1995-2014, interpolated as aerosols.clim.nc.

ORCHIDEE

The officially supported versions of ORCHIDEE supported by LMDZ_Setup are:

  • the CMIP6 version (still using the two-layer hydrology channel)
  • version 2.2 r7983
  • version 4 (trunk) r7994 (corresponding to libIGCM's LMDZOR_6.4work configuration)
Note: The relevant ORCHIDEE def file DEF/orchidee.def_* gets copied as DEF/orchidee.def at initialisation.

Activating sechiba outputs

Sechiba outputs are written to $SIMRUNBASEDIR, but are deleted by tmp_SIM before they're rebuilt. To counter that, remove the sec* on the relevant line set +e ; \rm out* sec* sta* list* rest* gcm.e aer* ; set -e.

Simple routing

From orch 2.2 r7597 onwards, the "simple" routing scheme by Y. Meurdesoif can be activated.

  • In DEF/orchidee.def_6.*, set RIVER_ROUTING=y, ROUTING_METHOD = simple, RIVER_DESC=y (Note: RIVER_DESC is automatically set to "n" after the first simulation period.)
  • In DEF/XMLfilesOR7***/iodef.xml, add at the end of context_orchidee.xml: <context id="orchidee" src="./context_routing_orchidee.xml"/>.

See also:User Guide/Routage Simple (French).

Isotopes

To activate isotopes, simply change the lmd_phys parameter to "lmdiso" in main.sh. This will automatically

  • use "phylmdiso" instead of "phylmd";
  • copy DEF/PHYS/physiq.def_NPiso to DEF/physiq.def.

Note: for isotopes, iflag_ice_thermo is automatically set to 0 instead of 1.

Cluster-specific information

Generic

ORCH 4 (trunk)

ORCHIDEE 4 is currently not able to compile with gfortran, and as a result can't be used. This has been reported to the relevant team, and hopefully should be fixed soon (06/2024).

CDO & aerosols

The current version of cdo on Adastra (2.4.0) and Spirit (2.3.0) contain a bug which interferes with the script interpolating aerosols. This bug is supposedly solved in version 2.4.1+. This bug corrupts the aerosols files, and results in a hgardfou error when running the simulation.

JeanZay

JeanZay was the main supported cluster of the old LMDZ_Setup. Although the new version can be ran there, it is discouraged.

Slowness

Compilation of the various components of the model, in particular of LMDZ and XIOS, is extremely slow on JeanZay compared to other clusters (for unknown reasons) (~15 minutes for LMDZ+rrtm). Moreover, it seems that for uninvestigated reasons, the LMDZ model is systematically recompiled on each call to main.sh (expected behavior, as on other clusters: the fcm system detects that it's already compiled and avoids compiling again). As a result, the whole process of launching a simulation is much slower.