<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Guillaume.Chaverot</id>
		<title>Planets - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Guillaume.Chaverot"/>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/Special:Contributions/Guillaume.Chaverot"/>
		<updated>2026-06-12T18:01:31Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.7</generator>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Quick_Install_and_Run&amp;diff=2682</id>
		<title>Quick Install and Run</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Quick_Install_and_Run&amp;diff=2682"/>
				<updated>2025-04-16T13:33:11Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: /* Compiling the GCM */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In this page we give a hopefully exhaustive enough overview of the necessary prerequisites and steps to download, compile and run a simple simulation with the GCM in an &amp;quot;Early Mars&amp;quot; setup (i.e. a desert planet with a CO2 atmosphere) on a Linux computer.&lt;br /&gt;
&lt;br /&gt;
Note that there is a dedicated, install script, that attempts to do all these steps (up to and including running the simulation) that you can obtain here: https://web.lmd.jussieu.fr/~lmdz/planets/generic/install_scripts/install_lmdz_generic_earlymars.bash&lt;br /&gt;
Automating the process is not trivial as there are many subtle variants of Linux flavors and user account setups, so the script may fail in your case, but hopefully the information given in this page should help you solve the encountered problems.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites: Tools and Libraries ==&lt;br /&gt;
In order to use (i.e. compile and run) the GCM, one needs to have some tools and installed libraries at hand. We list below a (minimal) set that you should check that is available and/or that you'll need to first install on your machine. Note that we assume in this tutorial that you are on a Linux native-OS/cluster.&lt;br /&gt;
&lt;br /&gt;
===  Fortran compiler ===&lt;br /&gt;
The GCM source code is in Fortran. One thus needs a Fortran compiler to build (compile) the executable.&lt;br /&gt;
The most easily available one (on Linux) is gfortran and examples discussed here will assume it is the one used.&lt;br /&gt;
You can check that you indeed have a gfortran compiler at hand with the following Bash command:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
which gfortran&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
which should return something like&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/usr/bin/gfortran&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Subversion ===&lt;br /&gt;
The source code is managed using subversion (svn), which you'll need to download or update. Leaving aside the subtleties of svn and code organization for now, downloading the code amounts to doing the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
svn checkout https://svn.lmd.jussieu.fr/Planeto/trunk --depth empty&lt;br /&gt;
cd trunk&lt;br /&gt;
svn update LMDZ.COMMON LMDZ.GENERIC&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As a side note: the source code that will be fetched by svn can also be browsed online here: https://trac.lmd.jussieu.fr/Planeto&lt;br /&gt;
&lt;br /&gt;
Note: if the command line above doesn't work, you may also try to replace 'http' by 'https'.&lt;br /&gt;
&lt;br /&gt;
=== Git === &lt;br /&gt;
&lt;br /&gt;
Alternatively to svn, you can use [[Git usage|git to download the source code]]. &lt;br /&gt;
&lt;br /&gt;
=== FCM ===&lt;br /&gt;
The FCM (Flexible Configuration Management) tool is a suite of perl scripts to help building and managing codes. We use a slightly modified version which can be obtained using subversion (svn). Ideally you'll want to download it somewhere on your computer once in for all. To do this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
svn checkout https://forge.ipsl.jussieu.fr/fcm/svn/PATCHED/FCM_V1.2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You'll then need to add the resulting FCM_V1.2/bin to your PATH environment variable so that the command &amp;quot;fcm&amp;quot; may be used from anywhere on your machine. e.g. by adding the following line in your .bashrc:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export PATH=$PATH:$HOME/FCM_V1.2/bin&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The assumption here is that the downloaded FCM_V1.2 directory is in your home ($HOME) directory. Adapt accordingly if not.&lt;br /&gt;
&lt;br /&gt;
=== the NetCDF library ===&lt;br /&gt;
The GCM reads and writes input and output files in NetCDF format, therefore a NetCDF library is required. Most of the clusters propose a NetCDF library that you can load before using the model. &lt;br /&gt;
&lt;br /&gt;
If this library is not available, you can install it by yourself on your system (check out [[the netCDF library]] page for more). You can use the following home-made &amp;quot;install_netcdf4_hdf5_seq.bash&amp;quot; script to do so. For this, ensure that you are in your home directory:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir netcdf&lt;br /&gt;
cd netcdf&lt;br /&gt;
wget -nv --no-check-certificate http://www.lmd.jussieu.fr/~lmdz/pub/script_install/install_netcdf4_hdf5_seq.bash&lt;br /&gt;
chmod u=rwx install_netcdf4_hdf5_seq.bash&lt;br /&gt;
./install_netcdf4_hdf5_seq.bash &amp;gt; netcdf.log 2&amp;gt;&amp;amp;1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Compiling the library and dependencies can take a while (&amp;gt;&amp;gt;15 minutes; be patient).&lt;br /&gt;
Once this is done, check file netcdf.log to verify that all went well.&lt;br /&gt;
You may want to also add its &amp;quot;bin&amp;quot; directory to your PATH environment variable by adding in your .bashrc a line of:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export PATH=$PATH:$HOME/netcdf/bin&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The assumption here is that you have run the &amp;quot;install_netcdf4_hdf5_seq.bash&amp;quot; script in a &amp;quot;netcdf&amp;quot; subdirectory of your home directory. Adapt accordingly if not.&lt;br /&gt;
&lt;br /&gt;
As a side note: The NetCDF library provides a very simple command line tool (ncdump) to inspect the contents of NetCDF files, but you'll need more advanced visualization tools (e.g., Panoply, Python scripts, etc. - see further down this page in the &amp;quot;Checking the Results&amp;quot; section) for more advanced post-processing of the outputs.&lt;br /&gt;
&lt;br /&gt;
=== the IOIPSL library ===&lt;br /&gt;
&lt;br /&gt;
The IOIPSL (Input/Output IPSL) library is designed to handle both the reading of some input files used by the GCM (the *.def files which are described further below) and the writing of some NetCDF output files.&lt;br /&gt;
&lt;br /&gt;
==== Automated IOIPSL install script ====&lt;br /&gt;
Scripts to download and install the IOIPSL library can be found in the &amp;quot;ioipsl&amp;quot; subdirectory of the &amp;quot;LMDZ.COMMON&amp;quot; library. Since here we assume we're working with gfortran, the relevant one is &amp;quot;install_ioipsl_gfortran.bash&amp;quot;. If your PATH environment variable is already such that it includes the path to your NetCDF library distribution's bin directory (see previous section) then all you need to do is execute the script:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./install_ioipsl_gfortran.bash&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If all went well the script should end with:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
OK: ioipsl library is in ...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''(for further details about [[The_IOIPSL_Library|the IOIPSL library]] and installing it, follow the link and/or use the Search Box at the top of this page)''&lt;br /&gt;
&lt;br /&gt;
== GCM Input Datafiles and Datasets ==&lt;br /&gt;
In order to run, the GCM needs some inputs, such as initial conditions (values of state variables), external inputs (e.g. optical properties of aerosols) and simulation setup (e.g. specifications on how long to run, which parametrizations should be activated, etc.)&lt;br /&gt;
&lt;br /&gt;
In the spirit of the illustrative example considered here (an &amp;quot;Early Mars&amp;quot; simulation), a set of necessary input data may be downloaded with:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget -nv --no-check-certificate https://web.lmd.jussieu.fr/~lmdz/planets/generic/reference_setups/bench_earlymars_32x32x15_b32x36.tar.gz&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Once unpacked (&amp;quot;tar xvzf bench_earlymars_32x32x15_b32x36.tar.gz&amp;quot;) the resulting &amp;quot;bench_earlymars_32x32x15_b32x36&amp;quot; will contain all that is needed, namely:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
callphys.def  gases.def  startfi.nc  traceur.def&lt;br /&gt;
datadir/      run.def    start.nc    z2sig.def&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Initial condition NetCDF files ''start.nc'' and ''startfi.nc''; the first containing initial condition values for the dynamics and the second initial condition values for the physics.&lt;br /&gt;
* A '''datadir''' directory containing external inputs (aerosol properties, stellar spectra, etc.)&lt;br /&gt;
* Some ASCII *.def files containing run parameters, namely:&lt;br /&gt;
# [[The_run.def_Input_File | run.def]] : &amp;quot;master def file&amp;quot; containing main run parameters&lt;br /&gt;
# [[The_callphys.def_Input_File | callphys.def]] : file containing flags and keys for the various physics parametrizations&lt;br /&gt;
# [[The_z2sig.def_Input_File | z2sig.def]] : file describing the sought vertical discretization&lt;br /&gt;
# [[The_traceur.def_Input_File | traceur.def]] : file specifying the tracer number and names&lt;br /&gt;
# [[The_gases.def_Input_File | gases.def]] : file specifying the list of gases (main and trace) in the atmosphere&lt;br /&gt;
&lt;br /&gt;
== Compiling the GCM ==&lt;br /&gt;
Now that all the prerequisites are fulfilled, it is (almost!) time to compile the GCM&lt;br /&gt;
&lt;br /&gt;
=== Prior to a first compilation: setting up the target architecture files ===&lt;br /&gt;
Compiling the model is done using a dedicated Bash script ''makelmdz_fcm'' located in the '''LMDZ.COMMON''' directory. This script however relies on ''architecture files''. These files contain information on which compiler to use, what compilation options to use, where relevant libraries are located etc. In practice, one must thus create these ASCII text files in the '''arch/''' subdirectory of '''LMDZ.COMMON'''. The naming convention is rather straightforward, when the script ''makelmdz_fcm'' is run with the option '''-arch somename''', it will look for files ''arch/arch-somename.env'', ''arch/arch-somename.path'' and ''arch/arch-somename.fcm''. Leaving aside a detailed description for later (see [[The_Target_Architecture_(&amp;quot;arch&amp;quot;)_Files|this page]]), here we mention that:&lt;br /&gt;
* the ''arch*.env'' is an optional file containing ''environment'' information, such as setting up environment variables or loading modules on some machines, e.g.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export NETCDF_HOME=/path/to/the/netcdf/distribution&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
A more realistic (but more specific) example of a '''arch*.env''' file using &amp;quot;recent&amp;quot; module commands, adapted for compilation and visualisation on a given supercomputer, would look more like the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
module purge&lt;br /&gt;
module load GCC/10.3.0  OpenMPI/4.1.1&lt;br /&gt;
module load netCDF-Fortran/4.5.3&lt;br /&gt;
export NETCDF_INCDIR=&amp;quot;/opt/ebsofts/netCDF-Fortran/4.5.3-gompi-2021a/include&amp;quot;&lt;br /&gt;
export NETCDFF_LIBDIR=&amp;quot;/opt/ebsofts/netCDF-Fortran/4.5.3-gompi-2021a/lib&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Note that the last two lines above specify paths to the '''include''' and '''lib''' directories used on this system and will certainly vary from system to system. Likewise, the exact module versions will most likely need to be adapted in your specific '''arch*.env''' file.&lt;br /&gt;
* the '''arch*.path''' is a mandatory file containing information relative to external libraries such as NetCDF and IOIPSL, e.g.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ROOT=$PWD&lt;br /&gt;
&lt;br /&gt;
NETCDF_LIBDIR=&amp;quot;-L${NETCDF_HOME}/lib&amp;quot;&lt;br /&gt;
NETCDF_LIB=&amp;quot;-lnetcdf -lnetcdff&amp;quot;&lt;br /&gt;
NETCDF_INCDIR=&amp;quot;-I${NETCDF_HOME}/include&amp;quot;&lt;br /&gt;
&lt;br /&gt;
IOIPSL_INCDIR=&amp;quot;-I$ROOT/../IOIPSL/inc&amp;quot;&lt;br /&gt;
IOIPSL_LIBDIR=&amp;quot;-L$ROOT/../IOIPSL/lib&amp;quot;&lt;br /&gt;
IOIPSL_LIB=&amp;quot;-lioipsl&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Each library is referenced by a fixed identifier (NETCDF, IOIPSL, XIOS, ...) and 3 trailing strings: '''_LIBDIR''', for the path to the library, '''_LIB''', for the library name(s), and '''_INCDIR''' for the path to the library's ''include'' directory.&lt;br /&gt;
&lt;br /&gt;
* the '''arch*.fcm''' is a mandatory file containing information relative to the compiler and compilation options, e.g.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
%COMPILER            gfortran&lt;br /&gt;
%LINK                gfortran&lt;br /&gt;
%AR                  ar&lt;br /&gt;
%MAKE                make&lt;br /&gt;
%FPP_FLAGS           -P -traditional&lt;br /&gt;
%FPP_DEF             NC_DOUBLE&lt;br /&gt;
%BASE_FFLAGS         -c -fdefault-real-8 -fdefault-double-8 -ffree-line-length-none -fno-align-commons&lt;br /&gt;
%PROD_FFLAGS         -O3&lt;br /&gt;
%DEV_FFLAGS          -O&lt;br /&gt;
%DEBUG_FFLAGS        -ffpe-trap=invalid,zero,overflow -fbounds-check -g3 -O0 -fstack-protector-all -finit-real=snan -fbacktrace&lt;br /&gt;
%MPI_FFLAGS&lt;br /&gt;
%OMP_FFLAGS         &lt;br /&gt;
%BASE_LD     &lt;br /&gt;
%MPI_LD&lt;br /&gt;
%OMP_LD              &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Again, not going into a detailed description (follow [[The_Target_Architecture_(&amp;quot;arch&amp;quot;)_Files|this link]] for that), just note here that each line corresponds to a keyword (starting with &amp;quot;%&amp;quot;) followed by the relevant options. Here, we mention a few of the main ones:&lt;br /&gt;
* %COMPILER: The compiler to use (here, gfortran)&lt;br /&gt;
* %BASE_FFLAGS: compiler options (always included)&lt;br /&gt;
* %PROD_FFLAGS: compilation flags to include if makelmdz_fcm is run with the &amp;quot;-prod&amp;quot; option&lt;br /&gt;
* %DEBUG_FFLAGS: compilation flags to include if makelmdz_fcm is run with the &amp;quot;-debug&amp;quot; option&lt;br /&gt;
* %BASE_LD: flags to add at the linking step of the compilation&lt;br /&gt;
&lt;br /&gt;
Note that if you are using a recent version of gfortran (10 or more), you have to add an extra option in the %BASE_FFLAGS, that is '''-fallow-argument-mismatch'''&lt;br /&gt;
&lt;br /&gt;
=== Compiling a test case (early Mars) ===&lt;br /&gt;
To compile the GCM at the sought resolution for the Early Mars test case run (in LMDZ.COMMON):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./makelmdz_fcm -arch local -p std -d 32x32x15 -b 32x36 gcm &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;!-- -s option is no more needed ; * '''-s 2''': the physics parametrizations will handle 2 radiatively active tracers (water ice and dust for the Early Mars setup) --&amp;gt;&lt;br /&gt;
Here, we assume that you have generated the '''arch-local.*''' files as per what is suggested in the previous section.&lt;br /&gt;
The options for ''makelmdz_fcm'' used here imply:&lt;br /&gt;
* '''-p std''': the GCM will use the &amp;quot;std&amp;quot; physics package (i.e. the generic physics)&lt;br /&gt;
* '''-d 32x32x15''': the GCM grid will be 32x32 in longitude x latitude, with 15 vertical levels.&lt;br /&gt;
* '''-b 32x36''': the physics radiative transfer will be done using 32 bands in the IR and 36 in the visible.&lt;br /&gt;
For a glimpse at all the possible ''makelmdz_fcm'' options and their meanings, run:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./makelmdz_fcm -h&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
and/or check the dedicated [[The_makelmdz_fcm_GCM_Compilation_Script|makelmdz_fcm page]].&lt;br /&gt;
&lt;br /&gt;
Upon successful compilation, the executable '''gcm_32x32x15_phystd_b32x36_seq.e''' should be generated in the '''bin''' subdirectory.&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
If the compilation fails, it might be due to the options used in the arch file. &lt;br /&gt;
For example, if you are using gfortran prior to 10, you could get an error such as:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gfortran: error: unrecognized command line option ‘-fallow-argument-mismatch’; did you mean ‘-Wno-argument-mismatch’?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This can be solved by removing the option '''-fallow-argument-mismatch''' from the arch.fcm file.&lt;br /&gt;
&lt;br /&gt;
If you are using a recent version of gfortran (10 of beyond) without the option '''-fallow-argument-mismatch''', the compilation will probably fail ith the error:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  136 |      .       idim_index,nvarid)&lt;br /&gt;
      |             2                                       &lt;br /&gt;
......&lt;br /&gt;
  211 |       ierr = NF_DEF_VAR (nid, &amp;quot;aire&amp;quot;, NF_DOUBLE, 2, id,nvarid)&lt;br /&gt;
      |                                                    1&lt;br /&gt;
Error: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)&lt;br /&gt;
fcm_internal compile failed (256)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Add the compilation option in the arch file to solve the issue.&lt;br /&gt;
&lt;br /&gt;
== Running the GCM ==&lt;br /&gt;
To run your first simulation, you need to first copy (or move) the executable '''gcm_32x32x15_phystd_b32x36_seq.e''' to the directory containing the initial conditions and parameter files, e.g. '''bench_earlymars_32x32x15_b32x36''' and run it.&lt;br /&gt;
This is usually a two-step process: the (optional) first step is to source the environment architecture file (the very same that was used to compile the model), e.g.,:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source ../LMDZ.COMMON/arch.env&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The second step is to execute the model, e.g.,:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./gcm_32x32x15_phystd_b32x36_seq.e &amp;gt; gcm.out 2&amp;gt;&amp;amp;1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this command line, the (text) outputs messages are redirected into a text file, '''gcm.out'''. It is convenient to keep this file for later inspection (e.g., to track a bug). If there is no redirection (only '''./gcm_32x32x15_phystd_b32x36_seq.e'''), then the outputs will be directly on the screen.&lt;br /&gt;
&lt;br /&gt;
== Checking the Results of a Simulation ==&lt;br /&gt;
Once the simulation is finished, you'll know that all went well (&amp;quot;everything is cool&amp;quot;) if the last few lines of the standard text output reads:&lt;br /&gt;
[[File:tsurf_benchmark_early_Mars.png|300px|thumb|Final surface temperature map of the benchmark simulation (plotted using Panoply).]]&lt;br /&gt;
[[File:water_ice_cloud_column_benchmark_early_Mars.png|300px|thumb|Final water ice cloud column map of the benchmark simulation (plotted using Panoply).]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 in abort_gcm&lt;br /&gt;
 Stopping in leapfrog&lt;br /&gt;
 Reason = Simulation finished &lt;br /&gt;
 Everything is cool&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If not, start looking for an error message and a way to fix the problem...&lt;br /&gt;
&lt;br /&gt;
Apart from the standard text output messages from the GCM, which are mostly for monitoring and checking the simulation progress, the user will more likely be interested in checking the contents of the ''diagfi.nc'' file produced by the GCM, as it contains instantaneous values of the main model variables (atmospheric temperature, winds, etc.).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To check that you have successfully run the simulation, we provide some graphs to evaluate the results of your simulations, for the simulation described in this tutorial (early Mars benchmark, 32x32x15 resolution).&lt;br /&gt;
&lt;br /&gt;
In the plots shown here, we present maps of the surface temperatures ('tsurf' variable) and the water ice cloud column ('h2o_ice_col' variable), both plotted using Panoply.&lt;br /&gt;
&lt;br /&gt;
Side note: There are a variety of freely available software that can be used to visualise the NetCDF ''diagfi.nc'' file, such as Panoply, Ferret, Ncview, Grads, Python, etc. (see more details in the [[Tool_Box | Tool Box section]])&lt;br /&gt;
&lt;br /&gt;
== Taking Things to the Next Level ==&lt;br /&gt;
The short tutorial presented in this page is meant to be useful to get an overview of what is required to install and run the GCM, in addition to checking the results of a simulation. Moving on to a more intensive and problem-specific usage will require diving into additional topics and aspects such as:&lt;br /&gt;
* Selecting the appropriate inputs and run parameters for a given study.&lt;br /&gt;
* Compiling and running in parallel (MPI and/or OpenMP) to obtain results in a reasonable time frame.&lt;br /&gt;
* post-processing and analysis of model outputs.&lt;br /&gt;
All these points and much more are detailed in the many pages of this site (do check out the menu on the left and dare use intensively the site's search engine)!&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;br /&gt;
[[Category:Generic-LMDZ]]&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Quick_Install_and_Run&amp;diff=2681</id>
		<title>Quick Install and Run</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Quick_Install_and_Run&amp;diff=2681"/>
				<updated>2025-04-16T13:30:13Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: /* Known issues */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In this page we give a hopefully exhaustive enough overview of the necessary prerequisites and steps to download, compile and run a simple simulation with the GCM in an &amp;quot;Early Mars&amp;quot; setup (i.e. a desert planet with a CO2 atmosphere) on a Linux computer.&lt;br /&gt;
&lt;br /&gt;
Note that there is a dedicated, install script, that attempts to do all these steps (up to and including running the simulation) that you can obtain here: https://web.lmd.jussieu.fr/~lmdz/planets/generic/install_scripts/install_lmdz_generic_earlymars.bash&lt;br /&gt;
Automating the process is not trivial as there are many subtle variants of Linux flavors and user account setups, so the script may fail in your case, but hopefully the information given in this page should help you solve the encountered problems.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites: Tools and Libraries ==&lt;br /&gt;
In order to use (i.e. compile and run) the GCM, one needs to have some tools and installed libraries at hand. We list below a (minimal) set that you should check that is available and/or that you'll need to first install on your machine. Note that we assume in this tutorial that you are on a Linux native-OS/cluster.&lt;br /&gt;
&lt;br /&gt;
===  Fortran compiler ===&lt;br /&gt;
The GCM source code is in Fortran. One thus needs a Fortran compiler to build (compile) the executable.&lt;br /&gt;
The most easily available one (on Linux) is gfortran and examples discussed here will assume it is the one used.&lt;br /&gt;
You can check that you indeed have a gfortran compiler at hand with the following Bash command:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
which gfortran&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
which should return something like&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/usr/bin/gfortran&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Subversion ===&lt;br /&gt;
The source code is managed using subversion (svn), which you'll need to download or update. Leaving aside the subtleties of svn and code organization for now, downloading the code amounts to doing the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
svn checkout https://svn.lmd.jussieu.fr/Planeto/trunk --depth empty&lt;br /&gt;
cd trunk&lt;br /&gt;
svn update LMDZ.COMMON LMDZ.GENERIC&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As a side note: the source code that will be fetched by svn can also be browsed online here: https://trac.lmd.jussieu.fr/Planeto&lt;br /&gt;
&lt;br /&gt;
Note: if the command line above doesn't work, you may also try to replace 'http' by 'https'.&lt;br /&gt;
&lt;br /&gt;
=== Git === &lt;br /&gt;
&lt;br /&gt;
Alternatively to svn, you can use [[Git usage|git to download the source code]]. &lt;br /&gt;
&lt;br /&gt;
=== FCM ===&lt;br /&gt;
The FCM (Flexible Configuration Management) tool is a suite of perl scripts to help building and managing codes. We use a slightly modified version which can be obtained using subversion (svn). Ideally you'll want to download it somewhere on your computer once in for all. To do this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
svn checkout https://forge.ipsl.jussieu.fr/fcm/svn/PATCHED/FCM_V1.2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You'll then need to add the resulting FCM_V1.2/bin to your PATH environment variable so that the command &amp;quot;fcm&amp;quot; may be used from anywhere on your machine. e.g. by adding the following line in your .bashrc:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export PATH=$PATH:$HOME/FCM_V1.2/bin&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The assumption here is that the downloaded FCM_V1.2 directory is in your home ($HOME) directory. Adapt accordingly if not.&lt;br /&gt;
&lt;br /&gt;
=== the NetCDF library ===&lt;br /&gt;
The GCM reads and writes input and output files in NetCDF format, therefore a NetCDF library is required. Most of the clusters propose a NetCDF library that you can load before using the model. &lt;br /&gt;
&lt;br /&gt;
If this library is not available, you can install it by yourself on your system (check out [[the netCDF library]] page for more). You can use the following home-made &amp;quot;install_netcdf4_hdf5_seq.bash&amp;quot; script to do so. For this, ensure that you are in your home directory:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir netcdf&lt;br /&gt;
cd netcdf&lt;br /&gt;
wget -nv --no-check-certificate http://www.lmd.jussieu.fr/~lmdz/pub/script_install/install_netcdf4_hdf5_seq.bash&lt;br /&gt;
chmod u=rwx install_netcdf4_hdf5_seq.bash&lt;br /&gt;
./install_netcdf4_hdf5_seq.bash &amp;gt; netcdf.log 2&amp;gt;&amp;amp;1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Compiling the library and dependencies can take a while (&amp;gt;&amp;gt;15 minutes; be patient).&lt;br /&gt;
Once this is done, check file netcdf.log to verify that all went well.&lt;br /&gt;
You may want to also add its &amp;quot;bin&amp;quot; directory to your PATH environment variable by adding in your .bashrc a line of:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export PATH=$PATH:$HOME/netcdf/bin&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The assumption here is that you have run the &amp;quot;install_netcdf4_hdf5_seq.bash&amp;quot; script in a &amp;quot;netcdf&amp;quot; subdirectory of your home directory. Adapt accordingly if not.&lt;br /&gt;
&lt;br /&gt;
As a side note: The NetCDF library provides a very simple command line tool (ncdump) to inspect the contents of NetCDF files, but you'll need more advanced visualization tools (e.g., Panoply, Python scripts, etc. - see further down this page in the &amp;quot;Checking the Results&amp;quot; section) for more advanced post-processing of the outputs.&lt;br /&gt;
&lt;br /&gt;
=== the IOIPSL library ===&lt;br /&gt;
&lt;br /&gt;
The IOIPSL (Input/Output IPSL) library is designed to handle both the reading of some input files used by the GCM (the *.def files which are described further below) and the writing of some NetCDF output files.&lt;br /&gt;
&lt;br /&gt;
==== Automated IOIPSL install script ====&lt;br /&gt;
Scripts to download and install the IOIPSL library can be found in the &amp;quot;ioipsl&amp;quot; subdirectory of the &amp;quot;LMDZ.COMMON&amp;quot; library. Since here we assume we're working with gfortran, the relevant one is &amp;quot;install_ioipsl_gfortran.bash&amp;quot;. If your PATH environment variable is already such that it includes the path to your NetCDF library distribution's bin directory (see previous section) then all you need to do is execute the script:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./install_ioipsl_gfortran.bash&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If all went well the script should end with:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
OK: ioipsl library is in ...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''(for further details about [[The_IOIPSL_Library|the IOIPSL library]] and installing it, follow the link and/or use the Search Box at the top of this page)''&lt;br /&gt;
&lt;br /&gt;
== GCM Input Datafiles and Datasets ==&lt;br /&gt;
In order to run, the GCM needs some inputs, such as initial conditions (values of state variables), external inputs (e.g. optical properties of aerosols) and simulation setup (e.g. specifications on how long to run, which parametrizations should be activated, etc.)&lt;br /&gt;
&lt;br /&gt;
In the spirit of the illustrative example considered here (an &amp;quot;Early Mars&amp;quot; simulation), a set of necessary input data may be downloaded with:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget -nv --no-check-certificate https://web.lmd.jussieu.fr/~lmdz/planets/generic/reference_setups/bench_earlymars_32x32x15_b32x36.tar.gz&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Once unpacked (&amp;quot;tar xvzf bench_earlymars_32x32x15_b32x36.tar.gz&amp;quot;) the resulting &amp;quot;bench_earlymars_32x32x15_b32x36&amp;quot; will contain all that is needed, namely:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
callphys.def  gases.def  startfi.nc  traceur.def&lt;br /&gt;
datadir/      run.def    start.nc    z2sig.def&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Initial condition NetCDF files ''start.nc'' and ''startfi.nc''; the first containing initial condition values for the dynamics and the second initial condition values for the physics.&lt;br /&gt;
* A '''datadir''' directory containing external inputs (aerosol properties, stellar spectra, etc.)&lt;br /&gt;
* Some ASCII *.def files containing run parameters, namely:&lt;br /&gt;
# [[The_run.def_Input_File | run.def]] : &amp;quot;master def file&amp;quot; containing main run parameters&lt;br /&gt;
# [[The_callphys.def_Input_File | callphys.def]] : file containing flags and keys for the various physics parametrizations&lt;br /&gt;
# [[The_z2sig.def_Input_File | z2sig.def]] : file describing the sought vertical discretization&lt;br /&gt;
# [[The_traceur.def_Input_File | traceur.def]] : file specifying the tracer number and names&lt;br /&gt;
# [[The_gases.def_Input_File | gases.def]] : file specifying the list of gases (main and trace) in the atmosphere&lt;br /&gt;
&lt;br /&gt;
== Compiling the GCM ==&lt;br /&gt;
Now that all the prerequisites are fulfilled, it is (almost!) time to compile the GCM&lt;br /&gt;
&lt;br /&gt;
=== Prior to a first compilation: setting up the target architecture files ===&lt;br /&gt;
Compiling the model is done using a dedicated Bash script ''makelmdz_fcm'' located in the '''LMDZ.COMMON''' directory. This script however relies on ''architecture files''. These files contain information on which compiler to use, what compilation options to use, where relevant libraries are located etc. In practice, one must thus create these ASCII text files in the '''arch/''' subdirectory of '''LMDZ.COMMON'''. The naming convention is rather straightforward, when the script ''makelmdz_fcm'' is run with the option '''-arch somename''', it will look for files ''arch/arch-somename.env'', ''arch/arch-somename.path'' and ''arch/arch-somename.fcm''. Leaving aside a detailed description for later (see [[The_Target_Architecture_(&amp;quot;arch&amp;quot;)_Files|this page]]), here we mention that:&lt;br /&gt;
* the ''arch*.env'' is an optional file containing ''environment'' information, such as setting up environment variables or loading modules on some machines, e.g.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export NETCDF_HOME=/path/to/the/netcdf/distribution&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
A more realistic (but more specific) example of a '''arch*.env''' file using &amp;quot;recent&amp;quot; module commands, adapted for compilation and visualisation on a given supercomputer, would look more like the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
module purge&lt;br /&gt;
module load GCC/10.3.0  OpenMPI/4.1.1&lt;br /&gt;
module load netCDF-Fortran/4.5.3&lt;br /&gt;
export NETCDF_INCDIR=&amp;quot;/opt/ebsofts/netCDF-Fortran/4.5.3-gompi-2021a/include&amp;quot;&lt;br /&gt;
export NETCDFF_LIBDIR=&amp;quot;/opt/ebsofts/netCDF-Fortran/4.5.3-gompi-2021a/lib&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Note that the last two lines above specify paths to the '''include''' and '''lib''' directories used on this system and will certainly vary from system to system. Likewise, the exact module versions will most likely need to be adapted in your specific '''arch*.env''' file.&lt;br /&gt;
* the '''arch*.path''' is a mandatory file containing information relative to external libraries such as NetCDF and IOIPSL, e.g.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ROOT=$PWD&lt;br /&gt;
&lt;br /&gt;
NETCDF_LIBDIR=&amp;quot;-L${NETCDF_HOME}/lib&amp;quot;&lt;br /&gt;
NETCDF_LIB=&amp;quot;-lnetcdf -lnetcdff&amp;quot;&lt;br /&gt;
NETCDF_INCDIR=&amp;quot;-I${NETCDF_HOME}/include&amp;quot;&lt;br /&gt;
&lt;br /&gt;
IOIPSL_INCDIR=&amp;quot;-I$ROOT/../IOIPSL/inc&amp;quot;&lt;br /&gt;
IOIPSL_LIBDIR=&amp;quot;-L$ROOT/../IOIPSL/lib&amp;quot;&lt;br /&gt;
IOIPSL_LIB=&amp;quot;-lioipsl&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Each library is referenced by a fixed identifier (NETCDF, IOIPSL, XIOS, ...) and 3 trailing strings: '''_LIBDIR''', for the path to the library, '''_LIB''', for the library name(s), and '''_INCDIR''' for the path to the library's ''include'' directory.&lt;br /&gt;
&lt;br /&gt;
* the '''arch*.fcm''' is a mandatory file containing information relative to the compiler and compilation options, e.g.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
%COMPILER            gfortran&lt;br /&gt;
%LINK                gfortran&lt;br /&gt;
%AR                  ar&lt;br /&gt;
%MAKE                make&lt;br /&gt;
%FPP_FLAGS           -P -traditional&lt;br /&gt;
%FPP_DEF             NC_DOUBLE&lt;br /&gt;
%BASE_FFLAGS         -c -fdefault-real-8 -fdefault-double-8 -ffree-line-length-none -fno-align-commons&lt;br /&gt;
%PROD_FFLAGS         -O3&lt;br /&gt;
%DEV_FFLAGS          -O&lt;br /&gt;
%DEBUG_FFLAGS        -ffpe-trap=invalid,zero,overflow -fbounds-check -g3 -O0 -fstack-protector-all -finit-real=snan -fbacktrace&lt;br /&gt;
%MPI_FFLAGS&lt;br /&gt;
%OMP_FFLAGS         &lt;br /&gt;
%BASE_LD     &lt;br /&gt;
%MPI_LD&lt;br /&gt;
%OMP_LD              &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Again, not going into a detailed description (follow [[The_Target_Architecture_(&amp;quot;arch&amp;quot;)_Files|this link]] for that), just note here that each line corresponds to a keyword (starting with &amp;quot;%&amp;quot;) followed by the relevant options. Here, we mention a few of the main ones:&lt;br /&gt;
* %COMPILER: The compiler to use (here, gfortran)&lt;br /&gt;
* %BASE_FFLAGS: compiler options (always included)&lt;br /&gt;
* %PROD_FFLAGS: compilation flags to include if makelmdz_fcm is run with the &amp;quot;-prod&amp;quot; option&lt;br /&gt;
* %DEBUG_FFLAGS: compilation flags to include if makelmdz_fcm is run with the &amp;quot;-debug&amp;quot; option&lt;br /&gt;
* %BASE_LD: flags to add at the linking step of the compilation&lt;br /&gt;
&lt;br /&gt;
=== Compiling a test case (early Mars) ===&lt;br /&gt;
To compile the GCM at the sought resolution for the Early Mars test case run (in LMDZ.COMMON):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./makelmdz_fcm -arch local -p std -d 32x32x15 -b 32x36 gcm &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;!-- -s option is no more needed ; * '''-s 2''': the physics parametrizations will handle 2 radiatively active tracers (water ice and dust for the Early Mars setup) --&amp;gt;&lt;br /&gt;
Here, we assume that you have generated the '''arch-local.*''' files as per what is suggested in the previous section.&lt;br /&gt;
The options for ''makelmdz_fcm'' used here imply:&lt;br /&gt;
* '''-p std''': the GCM will use the &amp;quot;std&amp;quot; physics package (i.e. the generic physics)&lt;br /&gt;
* '''-d 32x32x15''': the GCM grid will be 32x32 in longitude x latitude, with 15 vertical levels.&lt;br /&gt;
* '''-b 32x36''': the physics radiative transfer will be done using 32 bands in the IR and 36 in the visible.&lt;br /&gt;
For a glimpse at all the possible ''makelmdz_fcm'' options and their meanings, run:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./makelmdz_fcm -h&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
and/or check the dedicated [[The_makelmdz_fcm_GCM_Compilation_Script|makelmdz_fcm page]].&lt;br /&gt;
&lt;br /&gt;
Upon successful compilation, the executable '''gcm_32x32x15_phystd_b32x36_seq.e''' should be generated in the '''bin''' subdirectory.&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
If the compilation fails, it might be due to the options used in the arch file. &lt;br /&gt;
For example, if you are using gfortran prior to 10, you could get an error such as:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gfortran: error: unrecognized command line option ‘-fallow-argument-mismatch’; did you mean ‘-Wno-argument-mismatch’?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This can be solved by removing the option '''-fallow-argument-mismatch''' from the arch.fcm file.&lt;br /&gt;
&lt;br /&gt;
If you are using a recent version of gfortran (10 of beyond) without the option '''-fallow-argument-mismatch''', the compilation will probably fail ith the error:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  136 |      .       idim_index,nvarid)&lt;br /&gt;
      |             2                                       &lt;br /&gt;
......&lt;br /&gt;
  211 |       ierr = NF_DEF_VAR (nid, &amp;quot;aire&amp;quot;, NF_DOUBLE, 2, id,nvarid)&lt;br /&gt;
      |                                                    1&lt;br /&gt;
Error: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)&lt;br /&gt;
fcm_internal compile failed (256)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Add the compilation option in the arch file to solve the issue.&lt;br /&gt;
&lt;br /&gt;
== Running the GCM ==&lt;br /&gt;
To run your first simulation, you need to first copy (or move) the executable '''gcm_32x32x15_phystd_b32x36_seq.e''' to the directory containing the initial conditions and parameter files, e.g. '''bench_earlymars_32x32x15_b32x36''' and run it.&lt;br /&gt;
This is usually a two-step process: the (optional) first step is to source the environment architecture file (the very same that was used to compile the model), e.g.,:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source ../LMDZ.COMMON/arch.env&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The second step is to execute the model, e.g.,:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./gcm_32x32x15_phystd_b32x36_seq.e &amp;gt; gcm.out 2&amp;gt;&amp;amp;1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this command line, the (text) outputs messages are redirected into a text file, '''gcm.out'''. It is convenient to keep this file for later inspection (e.g., to track a bug). If there is no redirection (only '''./gcm_32x32x15_phystd_b32x36_seq.e'''), then the outputs will be directly on the screen.&lt;br /&gt;
&lt;br /&gt;
== Checking the Results of a Simulation ==&lt;br /&gt;
Once the simulation is finished, you'll know that all went well (&amp;quot;everything is cool&amp;quot;) if the last few lines of the standard text output reads:&lt;br /&gt;
[[File:tsurf_benchmark_early_Mars.png|300px|thumb|Final surface temperature map of the benchmark simulation (plotted using Panoply).]]&lt;br /&gt;
[[File:water_ice_cloud_column_benchmark_early_Mars.png|300px|thumb|Final water ice cloud column map of the benchmark simulation (plotted using Panoply).]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 in abort_gcm&lt;br /&gt;
 Stopping in leapfrog&lt;br /&gt;
 Reason = Simulation finished &lt;br /&gt;
 Everything is cool&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If not, start looking for an error message and a way to fix the problem...&lt;br /&gt;
&lt;br /&gt;
Apart from the standard text output messages from the GCM, which are mostly for monitoring and checking the simulation progress, the user will more likely be interested in checking the contents of the ''diagfi.nc'' file produced by the GCM, as it contains instantaneous values of the main model variables (atmospheric temperature, winds, etc.).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To check that you have successfully run the simulation, we provide some graphs to evaluate the results of your simulations, for the simulation described in this tutorial (early Mars benchmark, 32x32x15 resolution).&lt;br /&gt;
&lt;br /&gt;
In the plots shown here, we present maps of the surface temperatures ('tsurf' variable) and the water ice cloud column ('h2o_ice_col' variable), both plotted using Panoply.&lt;br /&gt;
&lt;br /&gt;
Side note: There are a variety of freely available software that can be used to visualise the NetCDF ''diagfi.nc'' file, such as Panoply, Ferret, Ncview, Grads, Python, etc. (see more details in the [[Tool_Box | Tool Box section]])&lt;br /&gt;
&lt;br /&gt;
== Taking Things to the Next Level ==&lt;br /&gt;
The short tutorial presented in this page is meant to be useful to get an overview of what is required to install and run the GCM, in addition to checking the results of a simulation. Moving on to a more intensive and problem-specific usage will require diving into additional topics and aspects such as:&lt;br /&gt;
* Selecting the appropriate inputs and run parameters for a given study.&lt;br /&gt;
* Compiling and running in parallel (MPI and/or OpenMP) to obtain results in a reasonable time frame.&lt;br /&gt;
* post-processing and analysis of model outputs.&lt;br /&gt;
All these points and much more are detailed in the many pages of this site (do check out the menu on the left and dare use intensively the site's search engine)!&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;br /&gt;
[[Category:Generic-LMDZ]]&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Quick_Install_and_Run&amp;diff=2680</id>
		<title>Quick Install and Run</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Quick_Install_and_Run&amp;diff=2680"/>
				<updated>2025-04-16T13:24:10Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In this page we give a hopefully exhaustive enough overview of the necessary prerequisites and steps to download, compile and run a simple simulation with the GCM in an &amp;quot;Early Mars&amp;quot; setup (i.e. a desert planet with a CO2 atmosphere) on a Linux computer.&lt;br /&gt;
&lt;br /&gt;
Note that there is a dedicated, install script, that attempts to do all these steps (up to and including running the simulation) that you can obtain here: https://web.lmd.jussieu.fr/~lmdz/planets/generic/install_scripts/install_lmdz_generic_earlymars.bash&lt;br /&gt;
Automating the process is not trivial as there are many subtle variants of Linux flavors and user account setups, so the script may fail in your case, but hopefully the information given in this page should help you solve the encountered problems.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites: Tools and Libraries ==&lt;br /&gt;
In order to use (i.e. compile and run) the GCM, one needs to have some tools and installed libraries at hand. We list below a (minimal) set that you should check that is available and/or that you'll need to first install on your machine. Note that we assume in this tutorial that you are on a Linux native-OS/cluster.&lt;br /&gt;
&lt;br /&gt;
===  Fortran compiler ===&lt;br /&gt;
The GCM source code is in Fortran. One thus needs a Fortran compiler to build (compile) the executable.&lt;br /&gt;
The most easily available one (on Linux) is gfortran and examples discussed here will assume it is the one used.&lt;br /&gt;
You can check that you indeed have a gfortran compiler at hand with the following Bash command:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
which gfortran&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
which should return something like&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/usr/bin/gfortran&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Subversion ===&lt;br /&gt;
The source code is managed using subversion (svn), which you'll need to download or update. Leaving aside the subtleties of svn and code organization for now, downloading the code amounts to doing the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
svn checkout https://svn.lmd.jussieu.fr/Planeto/trunk --depth empty&lt;br /&gt;
cd trunk&lt;br /&gt;
svn update LMDZ.COMMON LMDZ.GENERIC&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As a side note: the source code that will be fetched by svn can also be browsed online here: https://trac.lmd.jussieu.fr/Planeto&lt;br /&gt;
&lt;br /&gt;
Note: if the command line above doesn't work, you may also try to replace 'http' by 'https'.&lt;br /&gt;
&lt;br /&gt;
=== Git === &lt;br /&gt;
&lt;br /&gt;
Alternatively to svn, you can use [[Git usage|git to download the source code]]. &lt;br /&gt;
&lt;br /&gt;
=== FCM ===&lt;br /&gt;
The FCM (Flexible Configuration Management) tool is a suite of perl scripts to help building and managing codes. We use a slightly modified version which can be obtained using subversion (svn). Ideally you'll want to download it somewhere on your computer once in for all. To do this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
svn checkout https://forge.ipsl.jussieu.fr/fcm/svn/PATCHED/FCM_V1.2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You'll then need to add the resulting FCM_V1.2/bin to your PATH environment variable so that the command &amp;quot;fcm&amp;quot; may be used from anywhere on your machine. e.g. by adding the following line in your .bashrc:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export PATH=$PATH:$HOME/FCM_V1.2/bin&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The assumption here is that the downloaded FCM_V1.2 directory is in your home ($HOME) directory. Adapt accordingly if not.&lt;br /&gt;
&lt;br /&gt;
=== the NetCDF library ===&lt;br /&gt;
The GCM reads and writes input and output files in NetCDF format, therefore a NetCDF library is required. Most of the clusters propose a NetCDF library that you can load before using the model. &lt;br /&gt;
&lt;br /&gt;
If this library is not available, you can install it by yourself on your system (check out [[the netCDF library]] page for more). You can use the following home-made &amp;quot;install_netcdf4_hdf5_seq.bash&amp;quot; script to do so. For this, ensure that you are in your home directory:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir netcdf&lt;br /&gt;
cd netcdf&lt;br /&gt;
wget -nv --no-check-certificate http://www.lmd.jussieu.fr/~lmdz/pub/script_install/install_netcdf4_hdf5_seq.bash&lt;br /&gt;
chmod u=rwx install_netcdf4_hdf5_seq.bash&lt;br /&gt;
./install_netcdf4_hdf5_seq.bash &amp;gt; netcdf.log 2&amp;gt;&amp;amp;1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Compiling the library and dependencies can take a while (&amp;gt;&amp;gt;15 minutes; be patient).&lt;br /&gt;
Once this is done, check file netcdf.log to verify that all went well.&lt;br /&gt;
You may want to also add its &amp;quot;bin&amp;quot; directory to your PATH environment variable by adding in your .bashrc a line of:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export PATH=$PATH:$HOME/netcdf/bin&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The assumption here is that you have run the &amp;quot;install_netcdf4_hdf5_seq.bash&amp;quot; script in a &amp;quot;netcdf&amp;quot; subdirectory of your home directory. Adapt accordingly if not.&lt;br /&gt;
&lt;br /&gt;
As a side note: The NetCDF library provides a very simple command line tool (ncdump) to inspect the contents of NetCDF files, but you'll need more advanced visualization tools (e.g., Panoply, Python scripts, etc. - see further down this page in the &amp;quot;Checking the Results&amp;quot; section) for more advanced post-processing of the outputs.&lt;br /&gt;
&lt;br /&gt;
=== the IOIPSL library ===&lt;br /&gt;
&lt;br /&gt;
The IOIPSL (Input/Output IPSL) library is designed to handle both the reading of some input files used by the GCM (the *.def files which are described further below) and the writing of some NetCDF output files.&lt;br /&gt;
&lt;br /&gt;
==== Automated IOIPSL install script ====&lt;br /&gt;
Scripts to download and install the IOIPSL library can be found in the &amp;quot;ioipsl&amp;quot; subdirectory of the &amp;quot;LMDZ.COMMON&amp;quot; library. Since here we assume we're working with gfortran, the relevant one is &amp;quot;install_ioipsl_gfortran.bash&amp;quot;. If your PATH environment variable is already such that it includes the path to your NetCDF library distribution's bin directory (see previous section) then all you need to do is execute the script:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./install_ioipsl_gfortran.bash&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If all went well the script should end with:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
OK: ioipsl library is in ...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''(for further details about [[The_IOIPSL_Library|the IOIPSL library]] and installing it, follow the link and/or use the Search Box at the top of this page)''&lt;br /&gt;
&lt;br /&gt;
== GCM Input Datafiles and Datasets ==&lt;br /&gt;
In order to run, the GCM needs some inputs, such as initial conditions (values of state variables), external inputs (e.g. optical properties of aerosols) and simulation setup (e.g. specifications on how long to run, which parametrizations should be activated, etc.)&lt;br /&gt;
&lt;br /&gt;
In the spirit of the illustrative example considered here (an &amp;quot;Early Mars&amp;quot; simulation), a set of necessary input data may be downloaded with:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget -nv --no-check-certificate https://web.lmd.jussieu.fr/~lmdz/planets/generic/reference_setups/bench_earlymars_32x32x15_b32x36.tar.gz&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Once unpacked (&amp;quot;tar xvzf bench_earlymars_32x32x15_b32x36.tar.gz&amp;quot;) the resulting &amp;quot;bench_earlymars_32x32x15_b32x36&amp;quot; will contain all that is needed, namely:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
callphys.def  gases.def  startfi.nc  traceur.def&lt;br /&gt;
datadir/      run.def    start.nc    z2sig.def&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Initial condition NetCDF files ''start.nc'' and ''startfi.nc''; the first containing initial condition values for the dynamics and the second initial condition values for the physics.&lt;br /&gt;
* A '''datadir''' directory containing external inputs (aerosol properties, stellar spectra, etc.)&lt;br /&gt;
* Some ASCII *.def files containing run parameters, namely:&lt;br /&gt;
# [[The_run.def_Input_File | run.def]] : &amp;quot;master def file&amp;quot; containing main run parameters&lt;br /&gt;
# [[The_callphys.def_Input_File | callphys.def]] : file containing flags and keys for the various physics parametrizations&lt;br /&gt;
# [[The_z2sig.def_Input_File | z2sig.def]] : file describing the sought vertical discretization&lt;br /&gt;
# [[The_traceur.def_Input_File | traceur.def]] : file specifying the tracer number and names&lt;br /&gt;
# [[The_gases.def_Input_File | gases.def]] : file specifying the list of gases (main and trace) in the atmosphere&lt;br /&gt;
&lt;br /&gt;
== Compiling the GCM ==&lt;br /&gt;
Now that all the prerequisites are fulfilled, it is (almost!) time to compile the GCM&lt;br /&gt;
&lt;br /&gt;
=== Prior to a first compilation: setting up the target architecture files ===&lt;br /&gt;
Compiling the model is done using a dedicated Bash script ''makelmdz_fcm'' located in the '''LMDZ.COMMON''' directory. This script however relies on ''architecture files''. These files contain information on which compiler to use, what compilation options to use, where relevant libraries are located etc. In practice, one must thus create these ASCII text files in the '''arch/''' subdirectory of '''LMDZ.COMMON'''. The naming convention is rather straightforward, when the script ''makelmdz_fcm'' is run with the option '''-arch somename''', it will look for files ''arch/arch-somename.env'', ''arch/arch-somename.path'' and ''arch/arch-somename.fcm''. Leaving aside a detailed description for later (see [[The_Target_Architecture_(&amp;quot;arch&amp;quot;)_Files|this page]]), here we mention that:&lt;br /&gt;
* the ''arch*.env'' is an optional file containing ''environment'' information, such as setting up environment variables or loading modules on some machines, e.g.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export NETCDF_HOME=/path/to/the/netcdf/distribution&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
A more realistic (but more specific) example of a '''arch*.env''' file using &amp;quot;recent&amp;quot; module commands, adapted for compilation and visualisation on a given supercomputer, would look more like the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
module purge&lt;br /&gt;
module load GCC/10.3.0  OpenMPI/4.1.1&lt;br /&gt;
module load netCDF-Fortran/4.5.3&lt;br /&gt;
export NETCDF_INCDIR=&amp;quot;/opt/ebsofts/netCDF-Fortran/4.5.3-gompi-2021a/include&amp;quot;&lt;br /&gt;
export NETCDFF_LIBDIR=&amp;quot;/opt/ebsofts/netCDF-Fortran/4.5.3-gompi-2021a/lib&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Note that the last two lines above specify paths to the '''include''' and '''lib''' directories used on this system and will certainly vary from system to system. Likewise, the exact module versions will most likely need to be adapted in your specific '''arch*.env''' file.&lt;br /&gt;
* the '''arch*.path''' is a mandatory file containing information relative to external libraries such as NetCDF and IOIPSL, e.g.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ROOT=$PWD&lt;br /&gt;
&lt;br /&gt;
NETCDF_LIBDIR=&amp;quot;-L${NETCDF_HOME}/lib&amp;quot;&lt;br /&gt;
NETCDF_LIB=&amp;quot;-lnetcdf -lnetcdff&amp;quot;&lt;br /&gt;
NETCDF_INCDIR=&amp;quot;-I${NETCDF_HOME}/include&amp;quot;&lt;br /&gt;
&lt;br /&gt;
IOIPSL_INCDIR=&amp;quot;-I$ROOT/../IOIPSL/inc&amp;quot;&lt;br /&gt;
IOIPSL_LIBDIR=&amp;quot;-L$ROOT/../IOIPSL/lib&amp;quot;&lt;br /&gt;
IOIPSL_LIB=&amp;quot;-lioipsl&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Each library is referenced by a fixed identifier (NETCDF, IOIPSL, XIOS, ...) and 3 trailing strings: '''_LIBDIR''', for the path to the library, '''_LIB''', for the library name(s), and '''_INCDIR''' for the path to the library's ''include'' directory.&lt;br /&gt;
&lt;br /&gt;
* the '''arch*.fcm''' is a mandatory file containing information relative to the compiler and compilation options, e.g.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
%COMPILER            gfortran&lt;br /&gt;
%LINK                gfortran&lt;br /&gt;
%AR                  ar&lt;br /&gt;
%MAKE                make&lt;br /&gt;
%FPP_FLAGS           -P -traditional&lt;br /&gt;
%FPP_DEF             NC_DOUBLE&lt;br /&gt;
%BASE_FFLAGS         -c -fdefault-real-8 -fdefault-double-8 -ffree-line-length-none -fno-align-commons&lt;br /&gt;
%PROD_FFLAGS         -O3&lt;br /&gt;
%DEV_FFLAGS          -O&lt;br /&gt;
%DEBUG_FFLAGS        -ffpe-trap=invalid,zero,overflow -fbounds-check -g3 -O0 -fstack-protector-all -finit-real=snan -fbacktrace&lt;br /&gt;
%MPI_FFLAGS&lt;br /&gt;
%OMP_FFLAGS         &lt;br /&gt;
%BASE_LD     &lt;br /&gt;
%MPI_LD&lt;br /&gt;
%OMP_LD              &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Again, not going into a detailed description (follow [[The_Target_Architecture_(&amp;quot;arch&amp;quot;)_Files|this link]] for that), just note here that each line corresponds to a keyword (starting with &amp;quot;%&amp;quot;) followed by the relevant options. Here, we mention a few of the main ones:&lt;br /&gt;
* %COMPILER: The compiler to use (here, gfortran)&lt;br /&gt;
* %BASE_FFLAGS: compiler options (always included)&lt;br /&gt;
* %PROD_FFLAGS: compilation flags to include if makelmdz_fcm is run with the &amp;quot;-prod&amp;quot; option&lt;br /&gt;
* %DEBUG_FFLAGS: compilation flags to include if makelmdz_fcm is run with the &amp;quot;-debug&amp;quot; option&lt;br /&gt;
* %BASE_LD: flags to add at the linking step of the compilation&lt;br /&gt;
&lt;br /&gt;
=== Compiling a test case (early Mars) ===&lt;br /&gt;
To compile the GCM at the sought resolution for the Early Mars test case run (in LMDZ.COMMON):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./makelmdz_fcm -arch local -p std -d 32x32x15 -b 32x36 gcm &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;!-- -s option is no more needed ; * '''-s 2''': the physics parametrizations will handle 2 radiatively active tracers (water ice and dust for the Early Mars setup) --&amp;gt;&lt;br /&gt;
Here, we assume that you have generated the '''arch-local.*''' files as per what is suggested in the previous section.&lt;br /&gt;
The options for ''makelmdz_fcm'' used here imply:&lt;br /&gt;
* '''-p std''': the GCM will use the &amp;quot;std&amp;quot; physics package (i.e. the generic physics)&lt;br /&gt;
* '''-d 32x32x15''': the GCM grid will be 32x32 in longitude x latitude, with 15 vertical levels.&lt;br /&gt;
* '''-b 32x36''': the physics radiative transfer will be done using 32 bands in the IR and 36 in the visible.&lt;br /&gt;
For a glimpse at all the possible ''makelmdz_fcm'' options and their meanings, run:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./makelmdz_fcm -h&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
and/or check the dedicated [[The_makelmdz_fcm_GCM_Compilation_Script|makelmdz_fcm page]].&lt;br /&gt;
&lt;br /&gt;
Upon successful compilation, the executable '''gcm_32x32x15_phystd_b32x36_seq.e''' should be generated in the '''bin''' subdirectory.&lt;br /&gt;
&lt;br /&gt;
=== Known issues ===&lt;br /&gt;
&lt;br /&gt;
If the compilation fails, it might be due to the options used in the arch file. &lt;br /&gt;
For example, if you are using gfortran prior to 10, you could get an error such as:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gfortran: error: unrecognized command line option ‘-fallow-argument-mismatch’; did you mean ‘-Wno-argument-mismatch’?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This can be solved by removing the option '''-fallow-argument-mismatch''' from the arch.fcm file.&lt;br /&gt;
&lt;br /&gt;
== Running the GCM ==&lt;br /&gt;
To run your first simulation, you need to first copy (or move) the executable '''gcm_32x32x15_phystd_b32x36_seq.e''' to the directory containing the initial conditions and parameter files, e.g. '''bench_earlymars_32x32x15_b32x36''' and run it.&lt;br /&gt;
This is usually a two-step process: the (optional) first step is to source the environment architecture file (the very same that was used to compile the model), e.g.,:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source ../LMDZ.COMMON/arch.env&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The second step is to execute the model, e.g.,:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./gcm_32x32x15_phystd_b32x36_seq.e &amp;gt; gcm.out 2&amp;gt;&amp;amp;1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With this command line, the (text) outputs messages are redirected into a text file, '''gcm.out'''. It is convenient to keep this file for later inspection (e.g., to track a bug). If there is no redirection (only '''./gcm_32x32x15_phystd_b32x36_seq.e'''), then the outputs will be directly on the screen.&lt;br /&gt;
&lt;br /&gt;
== Checking the Results of a Simulation ==&lt;br /&gt;
Once the simulation is finished, you'll know that all went well (&amp;quot;everything is cool&amp;quot;) if the last few lines of the standard text output reads:&lt;br /&gt;
[[File:tsurf_benchmark_early_Mars.png|300px|thumb|Final surface temperature map of the benchmark simulation (plotted using Panoply).]]&lt;br /&gt;
[[File:water_ice_cloud_column_benchmark_early_Mars.png|300px|thumb|Final water ice cloud column map of the benchmark simulation (plotted using Panoply).]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 in abort_gcm&lt;br /&gt;
 Stopping in leapfrog&lt;br /&gt;
 Reason = Simulation finished &lt;br /&gt;
 Everything is cool&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If not, start looking for an error message and a way to fix the problem...&lt;br /&gt;
&lt;br /&gt;
Apart from the standard text output messages from the GCM, which are mostly for monitoring and checking the simulation progress, the user will more likely be interested in checking the contents of the ''diagfi.nc'' file produced by the GCM, as it contains instantaneous values of the main model variables (atmospheric temperature, winds, etc.).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To check that you have successfully run the simulation, we provide some graphs to evaluate the results of your simulations, for the simulation described in this tutorial (early Mars benchmark, 32x32x15 resolution).&lt;br /&gt;
&lt;br /&gt;
In the plots shown here, we present maps of the surface temperatures ('tsurf' variable) and the water ice cloud column ('h2o_ice_col' variable), both plotted using Panoply.&lt;br /&gt;
&lt;br /&gt;
Side note: There are a variety of freely available software that can be used to visualise the NetCDF ''diagfi.nc'' file, such as Panoply, Ferret, Ncview, Grads, Python, etc. (see more details in the [[Tool_Box | Tool Box section]])&lt;br /&gt;
&lt;br /&gt;
== Taking Things to the Next Level ==&lt;br /&gt;
The short tutorial presented in this page is meant to be useful to get an overview of what is required to install and run the GCM, in addition to checking the results of a simulation. Moving on to a more intensive and problem-specific usage will require diving into additional topics and aspects such as:&lt;br /&gt;
* Selecting the appropriate inputs and run parameters for a given study.&lt;br /&gt;
* Compiling and running in parallel (MPI and/or OpenMP) to obtain results in a reasonable time frame.&lt;br /&gt;
* post-processing and analysis of model outputs.&lt;br /&gt;
All these points and much more are detailed in the many pages of this site (do check out the menu on the left and dare use intensively the site's search engine)!&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;br /&gt;
[[Category:Generic-LMDZ]]&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=404</id>
		<title>Tool Box</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=404"/>
				<updated>2022-06-21T00:38:59Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: /* Pre-processing Tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Pre-processing Tools ==&lt;br /&gt;
=== newstart: a fortran program to modify start files ===&lt;br /&gt;
&lt;br /&gt;
Newstart is an interactive tool to modify the start files (''start.nc'' and ''startfi.nc''). &lt;br /&gt;
&lt;br /&gt;
To be usable, ''newstart'' should be compile in the ''LMDZ.COMMON'' directory by using the following command line:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./makelmdz_fcm -arch my_arch_file -p std -d 64x48x30 newstart&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
In the example, my_arch_file is the name the arch files (see [https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/The_Target_Architecture_(%22arch%22)_Files arch] ) and 64x48x30 is the resolution of the physical grid.&lt;br /&gt;
Then copy the executable from the ''LMDZ.COMMON/bin'' directory to your bench directory.&lt;br /&gt;
&lt;br /&gt;
When you execute newstart, you can use both a ''start2archive'' file or the start files (''start.nc'' and ''startfi.nc''). Then the interactive interface will propose to modify several physical quantities such as the gravity, the surface pressure or the rotation of the planet. At the end of the procedure, two files are created: ''restart.nc'' and ''restartfi.nc''. They can be renamed and used as start files to initialize a new simulation.&lt;br /&gt;
&lt;br /&gt;
=== start2archive ===&lt;br /&gt;
&lt;br /&gt;
The start2archive tool is similar to newstart in the sense that it can be used to modify the start files. But start2archive can modify the resolution of the physical grid, the topography and the surface thermal inertia while newstart cannot. It is also useful to create an archive of different starting states, then extractable as start files.&lt;br /&gt;
The command line to compile start2archive is similar to the one used for newstart:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./makelmdz_fcm -arch my_arch_file -p std -d 64x48x30 start2archive&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
To modify the resolution, you should first create a start_archive (by using start2archive) file at the used resolution, then compile a newstart file at the new resolution. Newstart will interpolate all the physical quantities on the new grid.&lt;br /&gt;
&lt;br /&gt;
=== other third party scripts and tools ===&lt;br /&gt;
&lt;br /&gt;
TO BE COMPLETED&lt;br /&gt;
&lt;br /&gt;
== Post-processing tools ==&lt;br /&gt;
=== zrecast ===&lt;br /&gt;
&lt;br /&gt;
With this program you can recast atmospheric (i.e.: 4D-dimentional longitude-latitude-altitude-time) data from&lt;br /&gt;
GCM outputs (e.g. as given in diagfi.nc files) onto either ''pressure'' or ''altitude'' above ''areoid vertical'' coordinates.&lt;br /&gt;
Since integrating the hydrostatic equation is required to recast the data, the input file must contain surface pressure&lt;br /&gt;
and atmospheric temperature, as well as the ground geopotential.&lt;br /&gt;
If recasting data onto ''pressure'' coordinates, then the output file name is given by the input file name to which ''_P.nc'' will be appened. If recasting data onto altitude above areoid coordinates, then a ''_A.nc'' will be appened.&lt;br /&gt;
&lt;br /&gt;
=== mass stream function ===&lt;br /&gt;
&lt;br /&gt;
The mass stream function (and the total angular momentum) can be computed from a diagfi.nc or a stats.nc, using the '''streamfunction.F90''' script. The script is located at&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
trunk/LMDZ.GENERIC/utilities&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To compile the script, open the ''compile'' file in the same directory and do the following:&lt;br /&gt;
* Replace &amp;quot;pgf90&amp;quot; with your favorite fortran compiler &lt;br /&gt;
* replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/lib&amp;quot; with the lib address and directory that contains your NetCDF library (file ''libnetcdf.a'').&lt;br /&gt;
* Replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/include&amp;quot; with the address of the directory that contains the NetCDF include file (''netcdf.inc'').&lt;br /&gt;
* You can mess with the compiling options but it is not mandatory.&lt;br /&gt;
&lt;br /&gt;
Once the script is compiled, copy it in the same directory as your '''.nc''' file and run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./streamfunction.e&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The script will ask you for the name of your '''.nc''' file, and will run and produce a new '''nameofyourfile_stream.nc''' file.&lt;br /&gt;
&lt;br /&gt;
'''Be careful''' : In this new file, all fields are temporally and zonally averaged.&lt;br /&gt;
&lt;br /&gt;
If you want to use '''python''' instead of '''fortran''', you can take a look at this [https://github.com/aymeric-spiga/dynanalysis repo]. It hosts a tool to perform dynamical analysis of GCM simulations (and therefore, it computes the mass stream function and a lot of other stuff), but it is tailored for Dynamico only. This repo also takes care of recasting (it does the job of both ''zrecast.F90'' and ''streamfunction.F90'')&lt;br /&gt;
&lt;br /&gt;
== Continuing Simulations ==&lt;br /&gt;
&lt;br /&gt;
=== manually ===&lt;br /&gt;
&lt;br /&gt;
At the end of a simulation, the model generates restart files (files 'restart.nc' and 'restartfi.nc') which contain the final state of the model. The 'restart.nc' and 'restartfi.nc' files have the same format as the 'start.nc' and 'startfi.nc' files, respectively. &lt;br /&gt;
&lt;br /&gt;
These files can in fact be used as initial states to continue the simulation, using the following renaming command lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mv restart.nc start.nc&lt;br /&gt;
mv restartfi.nc startfi.nc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Running a simulation with these start files will in fact resume the simulation from where the previous run ended.&lt;br /&gt;
&lt;br /&gt;
=== with bash scripts ===&lt;br /&gt;
&lt;br /&gt;
We have set up very simple bash scripts to automatize the launching of chain simulations. Here is an example of bash script that does the job:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
###########################################################################&lt;br /&gt;
# Script to perform several chained LMD Mars GCM simulations&lt;br /&gt;
# SET HERE the maximum total number of simulations&lt;br /&gt;
&lt;br /&gt;
nummax=100&lt;br /&gt;
&lt;br /&gt;
###########################################################################&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;---------------------------------------------------------&amp;quot;&lt;br /&gt;
echo &amp;quot;STARTING LOOP RUN&amp;quot;&lt;br /&gt;
echo &amp;quot;---------------------------------------------------------&amp;quot;&lt;br /&gt;
&lt;br /&gt;
dir=`pwd`&lt;br /&gt;
machine=`hostname`&lt;br /&gt;
address=`whoami`&lt;br /&gt;
&lt;br /&gt;
# Look for file &amp;quot;num_run&amp;quot; which should contain &lt;br /&gt;
# the value of the previously computed season&lt;br /&gt;
# (defaults to 0 if file &amp;quot;num_run&amp;quot; does not exist)&lt;br /&gt;
if [[ -r num_run ]] ; then&lt;br /&gt;
  echo &amp;quot;found file num_run&amp;quot;&lt;br /&gt;
  numold=`cat num_run`&lt;br /&gt;
else&lt;br /&gt;
  numold=0&lt;br /&gt;
fi&lt;br /&gt;
echo &amp;quot;numold is set to&amp;quot; ${numold}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Set value of current season &lt;br /&gt;
(( numnew = ${numold} + 1 ))&lt;br /&gt;
echo &amp;quot;numnew is set to&amp;quot; ${numnew}&lt;br /&gt;
&lt;br /&gt;
# Look for initialization data files (exit if none found)&lt;br /&gt;
if [[ ( -r start${numold}.nc  &amp;amp;&amp;amp;  -r startfi${numold}.nc ) ]] ; then&lt;br /&gt;
   \cp -f start${numold}.nc start.nc&lt;br /&gt;
   \cp -f startfi${numold}.nc startfi.nc&lt;br /&gt;
else&lt;br /&gt;
   if (( ${numold} == 99999 )) ; then&lt;br /&gt;
    echo &amp;quot;No run because previous run crashed ! (99999 in num_run)&amp;quot;&lt;br /&gt;
    exit&lt;br /&gt;
   else&lt;br /&gt;
   echo &amp;quot;Where is file start&amp;quot;${numold}&amp;quot;.nc??&amp;quot;&lt;br /&gt;
   exit&lt;br /&gt;
   fi&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Run GCM -- THIS LINE NEEDS TO BE MODIFIED WITH THE CORRECT GCM EXECUTION COMMAND&lt;br /&gt;
mpirun -np 8 gcm_64x48x26_phystd_para.e &amp;lt; diagfi.def &amp;gt; lrun${numnew}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Check if run ended normaly and copy datafiles&lt;br /&gt;
if [[ ( -r restartfi.nc  &amp;amp;&amp;amp;  -r restart.nc ) ]] ; then&lt;br /&gt;
  echo &amp;quot;Run seems to have ended normaly&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  \mv -f restart.nc start${numnew}.nc&lt;br /&gt;
  \mv -f restartfi.nc startfi${numnew}.nc  &lt;br /&gt;
    &lt;br /&gt;
else&lt;br /&gt;
  if [[ -r num_run ]] ; then&lt;br /&gt;
    \mv -f num_run num_run.crash&lt;br /&gt;
  else&lt;br /&gt;
    echo &amp;quot;No file num_run to build num_run.crash from !!&amp;quot;&lt;br /&gt;
    # Impose a default value of 0 for num_run&lt;br /&gt;
    echo 0 &amp;gt; num_run.crash&lt;br /&gt;
  fi&lt;br /&gt;
 echo 99999 &amp;gt; num_run&lt;br /&gt;
 exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Copy other datafiles that may have been generated&lt;br /&gt;
if [[ -r diagfi.nc ]] ; then&lt;br /&gt;
  \mv -f diagfi.nc diagfi${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -r diagsoil.nc ]] ; then&lt;br /&gt;
  \mv -f diagsoil.nc diagsoil${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -r stats.nc ]] ; then&lt;br /&gt;
  \mv -f stats.nc stats${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -f profiles.dat ]] ; then&lt;br /&gt;
  \mv -f profiles.dat profiles${numnew}.dat&lt;br /&gt;
  \mv -f profiles.hdr profiles${numnew}.hdr&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Prepare things for upcoming runs by writing&lt;br /&gt;
# value of computed season in file num_run&lt;br /&gt;
echo ${numnew} &amp;gt; num_run&lt;br /&gt;
&lt;br /&gt;
# If we are over nummax : stop&lt;br /&gt;
if (( $numnew + 1 &amp;gt; $nummax )) ; then&lt;br /&gt;
   exit&lt;br /&gt;
else&lt;br /&gt;
   \cp -f run_gnome exe_mars&lt;br /&gt;
   ./exe_mars&lt;br /&gt;
fi &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Summary of what this bash script does''':&lt;br /&gt;
&lt;br /&gt;
* It reads the file 'num_run' which contains the step of the simulation. &lt;br /&gt;
If num_run is&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
then the script expects to read start5.nc and startfi5.nc.&lt;br /&gt;
* It modifies start5.nc and startfi5.nc into start.nc and startfi.nc, respectively.&lt;br /&gt;
* It runs the GCM.&lt;br /&gt;
* It modifies restart.nc and restartfi.nc into start6.nc and startfi6.nc&lt;br /&gt;
* It rewrite num_run as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* It restarts the loop until num_run reaches the value (defined in nummax):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visualization software ==&lt;br /&gt;
=== Panoply ===&lt;br /&gt;
Panoply is a user-friendly tool for viewing raw NetCDF data, available here: https://www.giss.nasa.gov/tools/panoply/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Example panoply.png|thumb|Screenshot of panoply showing here LMD Generic results for the exoplanet TRAPPIST-1e]]&lt;br /&gt;
&lt;br /&gt;
=== Planetoplot ===&lt;br /&gt;
&lt;br /&gt;
Planetoplot is a in-house, python based library developped to vizualize LMDG data.&lt;br /&gt;
&lt;br /&gt;
The code and documentation can be found at: https://nbviewer.org/github/aymeric-spiga/planetoplot/blob/master/tutorial/planetoplot_tutorial.ipynb&lt;br /&gt;
&lt;br /&gt;
=== ncview ===&lt;br /&gt;
Command line tool to visualize NetCDF data.&lt;br /&gt;
* Installation on Linux:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt install ncview&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== paraview ===&lt;br /&gt;
=== python scripts ===&lt;br /&gt;
&lt;br /&gt;
The xarray python library is a very good tool to easily load and plot netcdf data.&lt;br /&gt;
&lt;br /&gt;
TBD&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=403</id>
		<title>Tool Box</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=403"/>
				<updated>2022-06-21T00:36:54Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: /* Pre-processing Tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Pre-processing Tools ==&lt;br /&gt;
=== newstart: a fortran program to modify start files ===&lt;br /&gt;
&lt;br /&gt;
Newstart is an interactive tool to modify the start files (''start.nc'' and ''startfi.nc''). &lt;br /&gt;
&lt;br /&gt;
To be usable, ''newstart'' should be compile in the ''LMDZ.COMMON'' directory by using the following command line:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./makelmdz_fcm -arch my_arch_file -p std -d 64x48x30 newstart&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
In the example, my_arch_file is the name the arch files (see [https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/The_Target_Architecture_(%22arch%22)_Files arch] ) and 64x48x30 is the resolution of the physical grid.&lt;br /&gt;
Then copy the executable from the ''LMDZ.COMMON/bin'' directory to your bench directory.&lt;br /&gt;
&lt;br /&gt;
When you execute newstart, you can use both a ''start2archive'' file or the start files (''start.nc'' and ''startfi.nc''). Then the interactive interface will propose to modify several physical quantities such as the gravity, the surface pressure or the rotation of the planet. At the end of the procedure, two files are created: ''restart.nc'' and ''restartfi.nc''. They can be renamed and used as start files to initialize a new simulation.&lt;br /&gt;
&lt;br /&gt;
=== start2archive ===&lt;br /&gt;
&lt;br /&gt;
The start2archive tool is similar to newstart in the sense that it can be used to modify the start files. But start2archive can modify the resolution of the physical grid, the topography and the surface thermal inertia while newstart cannot. It is also useful to create an archive of different starting states, then extractable as start files.&lt;br /&gt;
The command line to compile start2archive is similar to the one used for newstart:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./makelmdz_fcm -arch my_arch_file -p std -d 64x48x30 start2archive&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
To modify the resolution, you should first create a start_archive (by using start2archive) file at the used resolution. Then compile a newstart file at the new physical resolution. Newstart will interpolate all the quantities on the new grid.&lt;br /&gt;
&lt;br /&gt;
=== other third party scripts and tools ===&lt;br /&gt;
&lt;br /&gt;
TO BE COMPLETED&lt;br /&gt;
&lt;br /&gt;
== Post-processing tools ==&lt;br /&gt;
=== zrecast ===&lt;br /&gt;
&lt;br /&gt;
With this program you can recast atmospheric (i.e.: 4D-dimentional longitude-latitude-altitude-time) data from&lt;br /&gt;
GCM outputs (e.g. as given in diagfi.nc files) onto either ''pressure'' or ''altitude'' above ''areoid vertical'' coordinates.&lt;br /&gt;
Since integrating the hydrostatic equation is required to recast the data, the input file must contain surface pressure&lt;br /&gt;
and atmospheric temperature, as well as the ground geopotential.&lt;br /&gt;
If recasting data onto ''pressure'' coordinates, then the output file name is given by the input file name to which ''_P.nc'' will be appened. If recasting data onto altitude above areoid coordinates, then a ''_A.nc'' will be appened.&lt;br /&gt;
&lt;br /&gt;
=== mass stream function ===&lt;br /&gt;
&lt;br /&gt;
The mass stream function (and the total angular momentum) can be computed from a diagfi.nc or a stats.nc, using the '''streamfunction.F90''' script. The script is located at&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
trunk/LMDZ.GENERIC/utilities&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To compile the script, open the ''compile'' file in the same directory and do the following:&lt;br /&gt;
* Replace &amp;quot;pgf90&amp;quot; with your favorite fortran compiler &lt;br /&gt;
* replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/lib&amp;quot; with the lib address and directory that contains your NetCDF library (file ''libnetcdf.a'').&lt;br /&gt;
* Replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/include&amp;quot; with the address of the directory that contains the NetCDF include file (''netcdf.inc'').&lt;br /&gt;
* You can mess with the compiling options but it is not mandatory.&lt;br /&gt;
&lt;br /&gt;
Once the script is compiled, copy it in the same directory as your '''.nc''' file and run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./streamfunction.e&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The script will ask you for the name of your '''.nc''' file, and will run and produce a new '''nameofyourfile_stream.nc''' file.&lt;br /&gt;
&lt;br /&gt;
'''Be careful''' : In this new file, all fields are temporally and zonally averaged.&lt;br /&gt;
&lt;br /&gt;
If you want to use '''python''' instead of '''fortran''', you can take a look at this [https://github.com/aymeric-spiga/dynanalysis repo]. It hosts a tool to perform dynamical analysis of GCM simulations (and therefore, it computes the mass stream function and a lot of other stuff), but it is tailored for Dynamico only. This repo also takes care of recasting (it does the job of both ''zrecast.F90'' and ''streamfunction.F90'')&lt;br /&gt;
&lt;br /&gt;
== Continuing Simulations ==&lt;br /&gt;
&lt;br /&gt;
=== manually ===&lt;br /&gt;
&lt;br /&gt;
At the end of a simulation, the model generates restart files (files 'restart.nc' and 'restartfi.nc') which contain the final state of the model. The 'restart.nc' and 'restartfi.nc' files have the same format as the 'start.nc' and 'startfi.nc' files, respectively. &lt;br /&gt;
&lt;br /&gt;
These files can in fact be used as initial states to continue the simulation, using the following renaming command lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mv restart.nc start.nc&lt;br /&gt;
mv restartfi.nc startfi.nc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Running a simulation with these start files will in fact resume the simulation from where the previous run ended.&lt;br /&gt;
&lt;br /&gt;
=== with bash scripts ===&lt;br /&gt;
&lt;br /&gt;
We have set up very simple bash scripts to automatize the launching of chain simulations. Here is an example of bash script that does the job:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
###########################################################################&lt;br /&gt;
# Script to perform several chained LMD Mars GCM simulations&lt;br /&gt;
# SET HERE the maximum total number of simulations&lt;br /&gt;
&lt;br /&gt;
nummax=100&lt;br /&gt;
&lt;br /&gt;
###########################################################################&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;---------------------------------------------------------&amp;quot;&lt;br /&gt;
echo &amp;quot;STARTING LOOP RUN&amp;quot;&lt;br /&gt;
echo &amp;quot;---------------------------------------------------------&amp;quot;&lt;br /&gt;
&lt;br /&gt;
dir=`pwd`&lt;br /&gt;
machine=`hostname`&lt;br /&gt;
address=`whoami`&lt;br /&gt;
&lt;br /&gt;
# Look for file &amp;quot;num_run&amp;quot; which should contain &lt;br /&gt;
# the value of the previously computed season&lt;br /&gt;
# (defaults to 0 if file &amp;quot;num_run&amp;quot; does not exist)&lt;br /&gt;
if [[ -r num_run ]] ; then&lt;br /&gt;
  echo &amp;quot;found file num_run&amp;quot;&lt;br /&gt;
  numold=`cat num_run`&lt;br /&gt;
else&lt;br /&gt;
  numold=0&lt;br /&gt;
fi&lt;br /&gt;
echo &amp;quot;numold is set to&amp;quot; ${numold}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Set value of current season &lt;br /&gt;
(( numnew = ${numold} + 1 ))&lt;br /&gt;
echo &amp;quot;numnew is set to&amp;quot; ${numnew}&lt;br /&gt;
&lt;br /&gt;
# Look for initialization data files (exit if none found)&lt;br /&gt;
if [[ ( -r start${numold}.nc  &amp;amp;&amp;amp;  -r startfi${numold}.nc ) ]] ; then&lt;br /&gt;
   \cp -f start${numold}.nc start.nc&lt;br /&gt;
   \cp -f startfi${numold}.nc startfi.nc&lt;br /&gt;
else&lt;br /&gt;
   if (( ${numold} == 99999 )) ; then&lt;br /&gt;
    echo &amp;quot;No run because previous run crashed ! (99999 in num_run)&amp;quot;&lt;br /&gt;
    exit&lt;br /&gt;
   else&lt;br /&gt;
   echo &amp;quot;Where is file start&amp;quot;${numold}&amp;quot;.nc??&amp;quot;&lt;br /&gt;
   exit&lt;br /&gt;
   fi&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Run GCM -- THIS LINE NEEDS TO BE MODIFIED WITH THE CORRECT GCM EXECUTION COMMAND&lt;br /&gt;
mpirun -np 8 gcm_64x48x26_phystd_para.e &amp;lt; diagfi.def &amp;gt; lrun${numnew}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Check if run ended normaly and copy datafiles&lt;br /&gt;
if [[ ( -r restartfi.nc  &amp;amp;&amp;amp;  -r restart.nc ) ]] ; then&lt;br /&gt;
  echo &amp;quot;Run seems to have ended normaly&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  \mv -f restart.nc start${numnew}.nc&lt;br /&gt;
  \mv -f restartfi.nc startfi${numnew}.nc  &lt;br /&gt;
    &lt;br /&gt;
else&lt;br /&gt;
  if [[ -r num_run ]] ; then&lt;br /&gt;
    \mv -f num_run num_run.crash&lt;br /&gt;
  else&lt;br /&gt;
    echo &amp;quot;No file num_run to build num_run.crash from !!&amp;quot;&lt;br /&gt;
    # Impose a default value of 0 for num_run&lt;br /&gt;
    echo 0 &amp;gt; num_run.crash&lt;br /&gt;
  fi&lt;br /&gt;
 echo 99999 &amp;gt; num_run&lt;br /&gt;
 exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Copy other datafiles that may have been generated&lt;br /&gt;
if [[ -r diagfi.nc ]] ; then&lt;br /&gt;
  \mv -f diagfi.nc diagfi${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -r diagsoil.nc ]] ; then&lt;br /&gt;
  \mv -f diagsoil.nc diagsoil${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -r stats.nc ]] ; then&lt;br /&gt;
  \mv -f stats.nc stats${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -f profiles.dat ]] ; then&lt;br /&gt;
  \mv -f profiles.dat profiles${numnew}.dat&lt;br /&gt;
  \mv -f profiles.hdr profiles${numnew}.hdr&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Prepare things for upcoming runs by writing&lt;br /&gt;
# value of computed season in file num_run&lt;br /&gt;
echo ${numnew} &amp;gt; num_run&lt;br /&gt;
&lt;br /&gt;
# If we are over nummax : stop&lt;br /&gt;
if (( $numnew + 1 &amp;gt; $nummax )) ; then&lt;br /&gt;
   exit&lt;br /&gt;
else&lt;br /&gt;
   \cp -f run_gnome exe_mars&lt;br /&gt;
   ./exe_mars&lt;br /&gt;
fi &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Summary of what this bash script does''':&lt;br /&gt;
&lt;br /&gt;
* It reads the file 'num_run' which contains the step of the simulation. &lt;br /&gt;
If num_run is&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
then the script expects to read start5.nc and startfi5.nc.&lt;br /&gt;
* It modifies start5.nc and startfi5.nc into start.nc and startfi.nc, respectively.&lt;br /&gt;
* It runs the GCM.&lt;br /&gt;
* It modifies restart.nc and restartfi.nc into start6.nc and startfi6.nc&lt;br /&gt;
* It rewrite num_run as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* It restarts the loop until num_run reaches the value (defined in nummax):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visualization software ==&lt;br /&gt;
=== Panoply ===&lt;br /&gt;
Panoply is a user-friendly tool for viewing raw NetCDF data, available here: https://www.giss.nasa.gov/tools/panoply/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Example panoply.png|thumb|Screenshot of panoply showing here LMD Generic results for the exoplanet TRAPPIST-1e]]&lt;br /&gt;
&lt;br /&gt;
=== Planetoplot ===&lt;br /&gt;
&lt;br /&gt;
Planetoplot is a in-house, python based library developped to vizualize LMDG data.&lt;br /&gt;
&lt;br /&gt;
The code and documentation can be found at: https://nbviewer.org/github/aymeric-spiga/planetoplot/blob/master/tutorial/planetoplot_tutorial.ipynb&lt;br /&gt;
&lt;br /&gt;
=== ncview ===&lt;br /&gt;
Command line tool to visualize NetCDF data.&lt;br /&gt;
* Installation on Linux:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt install ncview&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== paraview ===&lt;br /&gt;
=== python scripts ===&lt;br /&gt;
&lt;br /&gt;
The xarray python library is a very good tool to easily load and plot netcdf data.&lt;br /&gt;
&lt;br /&gt;
TBD&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=402</id>
		<title>Tool Box</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=402"/>
				<updated>2022-06-21T00:36:08Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: /* start2archive */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Pre-processing Tools ==&lt;br /&gt;
=== newstart: a fortran program to modify start files ===&lt;br /&gt;
&lt;br /&gt;
Newstart is an interactive tool to modify the start files (''start.nc'' and ''startfi.nc''). &lt;br /&gt;
&lt;br /&gt;
To be usable, ''newstart'' should be compile in the ''LMDZ.COMMON'' directory by using the following command line:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./makelmdz_fcm -arch my_arch_file -p std -d 64x48x30 newstart&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
In the example, my_arch_file is the name the arch files (see [https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/The_Target_Architecture_(%22arch%22)_Files arch] ) and 64x48x30 is the resolution of the physical grid.&lt;br /&gt;
Then copy the executable from the ''LMDZ.COMMON/bin'' directory to your bench directory.&lt;br /&gt;
&lt;br /&gt;
When you execute newstart, you can use both a ''start2archive'' file or the start files (''start.nc'' and ''startfi.nc''). Then the interactive interface will propose to modify several physical quantities such as the gravity, the surface pressure or the rotation of the planet. At the end of the procedure, two files are created: ''restart.nc'' and ''restartfi.nc''. They can be renamed and used as start files to initialize a new simulation.&lt;br /&gt;
&lt;br /&gt;
=== start2archive ===&lt;br /&gt;
&lt;br /&gt;
The start2archive tool is similar to newstart in the sense that it can be used to modify the start files. But start2archive can modify the resolution of the physical grid, the topography and the surface thermal inertia while newstart cannot. It is also useful to create an archive of different starting states, then extractable as start files.&lt;br /&gt;
The command line to compile start2archive is similar to the one used for newstart:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To modify the resolution, you should first create a start_archive (by using start2archive) file at the used resolution. Then compile a newstart file at the new physical resolution. Newstart will interpolate all the quantities on the new grid.&lt;br /&gt;
&lt;br /&gt;
=== other third party scripts and tools ===&lt;br /&gt;
&lt;br /&gt;
TO BE COMPLETED&lt;br /&gt;
&lt;br /&gt;
== Post-processing tools ==&lt;br /&gt;
=== zrecast ===&lt;br /&gt;
&lt;br /&gt;
With this program you can recast atmospheric (i.e.: 4D-dimentional longitude-latitude-altitude-time) data from&lt;br /&gt;
GCM outputs (e.g. as given in diagfi.nc files) onto either ''pressure'' or ''altitude'' above ''areoid vertical'' coordinates.&lt;br /&gt;
Since integrating the hydrostatic equation is required to recast the data, the input file must contain surface pressure&lt;br /&gt;
and atmospheric temperature, as well as the ground geopotential.&lt;br /&gt;
If recasting data onto ''pressure'' coordinates, then the output file name is given by the input file name to which ''_P.nc'' will be appened. If recasting data onto altitude above areoid coordinates, then a ''_A.nc'' will be appened.&lt;br /&gt;
&lt;br /&gt;
=== mass stream function ===&lt;br /&gt;
&lt;br /&gt;
The mass stream function (and the total angular momentum) can be computed from a diagfi.nc or a stats.nc, using the '''streamfunction.F90''' script. The script is located at&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
trunk/LMDZ.GENERIC/utilities&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To compile the script, open the ''compile'' file in the same directory and do the following:&lt;br /&gt;
* Replace &amp;quot;pgf90&amp;quot; with your favorite fortran compiler &lt;br /&gt;
* replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/lib&amp;quot; with the lib address and directory that contains your NetCDF library (file ''libnetcdf.a'').&lt;br /&gt;
* Replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/include&amp;quot; with the address of the directory that contains the NetCDF include file (''netcdf.inc'').&lt;br /&gt;
* You can mess with the compiling options but it is not mandatory.&lt;br /&gt;
&lt;br /&gt;
Once the script is compiled, copy it in the same directory as your '''.nc''' file and run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./streamfunction.e&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The script will ask you for the name of your '''.nc''' file, and will run and produce a new '''nameofyourfile_stream.nc''' file.&lt;br /&gt;
&lt;br /&gt;
'''Be careful''' : In this new file, all fields are temporally and zonally averaged.&lt;br /&gt;
&lt;br /&gt;
If you want to use '''python''' instead of '''fortran''', you can take a look at this [https://github.com/aymeric-spiga/dynanalysis repo]. It hosts a tool to perform dynamical analysis of GCM simulations (and therefore, it computes the mass stream function and a lot of other stuff), but it is tailored for Dynamico only. This repo also takes care of recasting (it does the job of both ''zrecast.F90'' and ''streamfunction.F90'')&lt;br /&gt;
&lt;br /&gt;
== Continuing Simulations ==&lt;br /&gt;
&lt;br /&gt;
=== manually ===&lt;br /&gt;
&lt;br /&gt;
At the end of a simulation, the model generates restart files (files 'restart.nc' and 'restartfi.nc') which contain the final state of the model. The 'restart.nc' and 'restartfi.nc' files have the same format as the 'start.nc' and 'startfi.nc' files, respectively. &lt;br /&gt;
&lt;br /&gt;
These files can in fact be used as initial states to continue the simulation, using the following renaming command lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mv restart.nc start.nc&lt;br /&gt;
mv restartfi.nc startfi.nc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Running a simulation with these start files will in fact resume the simulation from where the previous run ended.&lt;br /&gt;
&lt;br /&gt;
=== with bash scripts ===&lt;br /&gt;
&lt;br /&gt;
We have set up very simple bash scripts to automatize the launching of chain simulations. Here is an example of bash script that does the job:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
###########################################################################&lt;br /&gt;
# Script to perform several chained LMD Mars GCM simulations&lt;br /&gt;
# SET HERE the maximum total number of simulations&lt;br /&gt;
&lt;br /&gt;
nummax=100&lt;br /&gt;
&lt;br /&gt;
###########################################################################&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;---------------------------------------------------------&amp;quot;&lt;br /&gt;
echo &amp;quot;STARTING LOOP RUN&amp;quot;&lt;br /&gt;
echo &amp;quot;---------------------------------------------------------&amp;quot;&lt;br /&gt;
&lt;br /&gt;
dir=`pwd`&lt;br /&gt;
machine=`hostname`&lt;br /&gt;
address=`whoami`&lt;br /&gt;
&lt;br /&gt;
# Look for file &amp;quot;num_run&amp;quot; which should contain &lt;br /&gt;
# the value of the previously computed season&lt;br /&gt;
# (defaults to 0 if file &amp;quot;num_run&amp;quot; does not exist)&lt;br /&gt;
if [[ -r num_run ]] ; then&lt;br /&gt;
  echo &amp;quot;found file num_run&amp;quot;&lt;br /&gt;
  numold=`cat num_run`&lt;br /&gt;
else&lt;br /&gt;
  numold=0&lt;br /&gt;
fi&lt;br /&gt;
echo &amp;quot;numold is set to&amp;quot; ${numold}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Set value of current season &lt;br /&gt;
(( numnew = ${numold} + 1 ))&lt;br /&gt;
echo &amp;quot;numnew is set to&amp;quot; ${numnew}&lt;br /&gt;
&lt;br /&gt;
# Look for initialization data files (exit if none found)&lt;br /&gt;
if [[ ( -r start${numold}.nc  &amp;amp;&amp;amp;  -r startfi${numold}.nc ) ]] ; then&lt;br /&gt;
   \cp -f start${numold}.nc start.nc&lt;br /&gt;
   \cp -f startfi${numold}.nc startfi.nc&lt;br /&gt;
else&lt;br /&gt;
   if (( ${numold} == 99999 )) ; then&lt;br /&gt;
    echo &amp;quot;No run because previous run crashed ! (99999 in num_run)&amp;quot;&lt;br /&gt;
    exit&lt;br /&gt;
   else&lt;br /&gt;
   echo &amp;quot;Where is file start&amp;quot;${numold}&amp;quot;.nc??&amp;quot;&lt;br /&gt;
   exit&lt;br /&gt;
   fi&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Run GCM -- THIS LINE NEEDS TO BE MODIFIED WITH THE CORRECT GCM EXECUTION COMMAND&lt;br /&gt;
mpirun -np 8 gcm_64x48x26_phystd_para.e &amp;lt; diagfi.def &amp;gt; lrun${numnew}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Check if run ended normaly and copy datafiles&lt;br /&gt;
if [[ ( -r restartfi.nc  &amp;amp;&amp;amp;  -r restart.nc ) ]] ; then&lt;br /&gt;
  echo &amp;quot;Run seems to have ended normaly&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  \mv -f restart.nc start${numnew}.nc&lt;br /&gt;
  \mv -f restartfi.nc startfi${numnew}.nc  &lt;br /&gt;
    &lt;br /&gt;
else&lt;br /&gt;
  if [[ -r num_run ]] ; then&lt;br /&gt;
    \mv -f num_run num_run.crash&lt;br /&gt;
  else&lt;br /&gt;
    echo &amp;quot;No file num_run to build num_run.crash from !!&amp;quot;&lt;br /&gt;
    # Impose a default value of 0 for num_run&lt;br /&gt;
    echo 0 &amp;gt; num_run.crash&lt;br /&gt;
  fi&lt;br /&gt;
 echo 99999 &amp;gt; num_run&lt;br /&gt;
 exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Copy other datafiles that may have been generated&lt;br /&gt;
if [[ -r diagfi.nc ]] ; then&lt;br /&gt;
  \mv -f diagfi.nc diagfi${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -r diagsoil.nc ]] ; then&lt;br /&gt;
  \mv -f diagsoil.nc diagsoil${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -r stats.nc ]] ; then&lt;br /&gt;
  \mv -f stats.nc stats${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -f profiles.dat ]] ; then&lt;br /&gt;
  \mv -f profiles.dat profiles${numnew}.dat&lt;br /&gt;
  \mv -f profiles.hdr profiles${numnew}.hdr&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Prepare things for upcoming runs by writing&lt;br /&gt;
# value of computed season in file num_run&lt;br /&gt;
echo ${numnew} &amp;gt; num_run&lt;br /&gt;
&lt;br /&gt;
# If we are over nummax : stop&lt;br /&gt;
if (( $numnew + 1 &amp;gt; $nummax )) ; then&lt;br /&gt;
   exit&lt;br /&gt;
else&lt;br /&gt;
   \cp -f run_gnome exe_mars&lt;br /&gt;
   ./exe_mars&lt;br /&gt;
fi &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Summary of what this bash script does''':&lt;br /&gt;
&lt;br /&gt;
* It reads the file 'num_run' which contains the step of the simulation. &lt;br /&gt;
If num_run is&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
then the script expects to read start5.nc and startfi5.nc.&lt;br /&gt;
* It modifies start5.nc and startfi5.nc into start.nc and startfi.nc, respectively.&lt;br /&gt;
* It runs the GCM.&lt;br /&gt;
* It modifies restart.nc and restartfi.nc into start6.nc and startfi6.nc&lt;br /&gt;
* It rewrite num_run as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* It restarts the loop until num_run reaches the value (defined in nummax):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visualization software ==&lt;br /&gt;
=== Panoply ===&lt;br /&gt;
Panoply is a user-friendly tool for viewing raw NetCDF data, available here: https://www.giss.nasa.gov/tools/panoply/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Example panoply.png|thumb|Screenshot of panoply showing here LMD Generic results for the exoplanet TRAPPIST-1e]]&lt;br /&gt;
&lt;br /&gt;
=== Planetoplot ===&lt;br /&gt;
&lt;br /&gt;
Planetoplot is a in-house, python based library developped to vizualize LMDG data.&lt;br /&gt;
&lt;br /&gt;
The code and documentation can be found at: https://nbviewer.org/github/aymeric-spiga/planetoplot/blob/master/tutorial/planetoplot_tutorial.ipynb&lt;br /&gt;
&lt;br /&gt;
=== ncview ===&lt;br /&gt;
Command line tool to visualize NetCDF data.&lt;br /&gt;
* Installation on Linux:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt install ncview&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== paraview ===&lt;br /&gt;
=== python scripts ===&lt;br /&gt;
&lt;br /&gt;
The xarray python library is a very good tool to easily load and plot netcdf data.&lt;br /&gt;
&lt;br /&gt;
TBD&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=401</id>
		<title>Tool Box</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=401"/>
				<updated>2022-06-21T00:25:56Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: /* newstart: a fortran program to modify start files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Pre-processing Tools ==&lt;br /&gt;
=== newstart: a fortran program to modify start files ===&lt;br /&gt;
&lt;br /&gt;
Newstart is an interactive tool to modify the start files (''start.nc'' and ''startfi.nc''). &lt;br /&gt;
&lt;br /&gt;
To be usable, ''newstart'' should be compile in the ''LMDZ.COMMON'' directory by using the following command line:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./makelmdz_fcm -arch my_arch_file -p std -d 64x48x30 newstart&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
In the example, my_arch_file is the name the arch files (see [https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/The_Target_Architecture_(%22arch%22)_Files arch] ) and 64x48x30 is the resolution of the physical grid.&lt;br /&gt;
Then copy the executable from the ''LMDZ.COMMON/bin'' directory to your bench directory.&lt;br /&gt;
&lt;br /&gt;
When you execute newstart, you can use both a ''start2archive'' file or the start files (''start.nc'' and ''startfi.nc''). Then the interactive interface will propose to modify several physical quantities such as the gravity, the surface pressure or the rotation of the planet. At the end of the procedure, two files are created: ''restart.nc'' and ''restartfi.nc''. They can be renamed and used as start files to initialize a new simulation.&lt;br /&gt;
&lt;br /&gt;
=== start2archive ===&lt;br /&gt;
&lt;br /&gt;
description of start2archive&lt;br /&gt;
&lt;br /&gt;
- TBD by Guillaume&lt;br /&gt;
&lt;br /&gt;
=== other third party scripts and tools ===&lt;br /&gt;
&lt;br /&gt;
TO BE COMPLETED&lt;br /&gt;
&lt;br /&gt;
== Post-processing tools ==&lt;br /&gt;
=== zrecast ===&lt;br /&gt;
&lt;br /&gt;
With this program you can recast atmospheric (i.e.: 4D-dimentional longitude-latitude-altitude-time) data from&lt;br /&gt;
GCM outputs (e.g. as given in diagfi.nc files) onto either ''pressure'' or ''altitude'' above ''areoid vertical'' coordinates.&lt;br /&gt;
Since integrating the hydrostatic equation is required to recast the data, the input file must contain surface pressure&lt;br /&gt;
and atmospheric temperature, as well as the ground geopotential.&lt;br /&gt;
If recasting data onto ''pressure'' coordinates, then the output file name is given by the input file name to which ''_P.nc'' will be appened. If recasting data onto altitude above areoid coordinates, then a ''_A.nc'' will be appened.&lt;br /&gt;
&lt;br /&gt;
=== mass stream function ===&lt;br /&gt;
&lt;br /&gt;
The mass stream function (and the total angular momentum) can be computed from a diagfi.nc or a stats.nc, using the '''streamfunction.F90''' script. The script is located at&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
trunk/LMDZ.GENERIC/utilities&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To compile the script, open the ''compile'' file in the same directory and do the following:&lt;br /&gt;
* Replace &amp;quot;pgf90&amp;quot; with your favorite fortran compiler &lt;br /&gt;
* replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/lib&amp;quot; with the lib address and directory that contains your NetCDF library (file ''libnetcdf.a'').&lt;br /&gt;
* Replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/include&amp;quot; with the address of the directory that contains the NetCDF include file (''netcdf.inc'').&lt;br /&gt;
* You can mess with the compiling options but it is not mandatory.&lt;br /&gt;
&lt;br /&gt;
Once the script is compiled, copy it in the same directory as your '''.nc''' file and run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./streamfunction.e&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The script will ask you for the name of your '''.nc''' file, and will run and produce a new '''nameofyourfile_stream.nc''' file.&lt;br /&gt;
&lt;br /&gt;
'''Be careful''' : In this new file, all fields are temporally and zonally averaged.&lt;br /&gt;
&lt;br /&gt;
If you want to use '''python''' instead of '''fortran''', you can take a look at this [https://github.com/aymeric-spiga/dynanalysis repo]. It hosts a tool to perform dynamical analysis of GCM simulations (and therefore, it computes the mass stream function and a lot of other stuff), but it is tailored for Dynamico only. This repo also takes care of recasting (it does the job of both ''zrecast.F90'' and ''streamfunction.F90'')&lt;br /&gt;
&lt;br /&gt;
== Continuing Simulations ==&lt;br /&gt;
&lt;br /&gt;
=== manually ===&lt;br /&gt;
&lt;br /&gt;
At the end of a simulation, the model generates restart files (files 'restart.nc' and 'restartfi.nc') which contain the final state of the model. The 'restart.nc' and 'restartfi.nc' files have the same format as the 'start.nc' and 'startfi.nc' files, respectively. &lt;br /&gt;
&lt;br /&gt;
These files can in fact be used as initial states to continue the simulation, using the following renaming command lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mv restart.nc start.nc&lt;br /&gt;
mv restartfi.nc startfi.nc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Running a simulation with these start files will in fact resume the simulation from where the previous run ended.&lt;br /&gt;
&lt;br /&gt;
=== with bash scripts ===&lt;br /&gt;
&lt;br /&gt;
We have set up very simple bash scripts to automatize the launching of chain simulations. Here is an example of bash script that does the job:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
###########################################################################&lt;br /&gt;
# Script to perform several chained LMD Mars GCM simulations&lt;br /&gt;
# SET HERE the maximum total number of simulations&lt;br /&gt;
&lt;br /&gt;
nummax=100&lt;br /&gt;
&lt;br /&gt;
###########################################################################&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;---------------------------------------------------------&amp;quot;&lt;br /&gt;
echo &amp;quot;STARTING LOOP RUN&amp;quot;&lt;br /&gt;
echo &amp;quot;---------------------------------------------------------&amp;quot;&lt;br /&gt;
&lt;br /&gt;
dir=`pwd`&lt;br /&gt;
machine=`hostname`&lt;br /&gt;
address=`whoami`&lt;br /&gt;
&lt;br /&gt;
# Look for file &amp;quot;num_run&amp;quot; which should contain &lt;br /&gt;
# the value of the previously computed season&lt;br /&gt;
# (defaults to 0 if file &amp;quot;num_run&amp;quot; does not exist)&lt;br /&gt;
if [[ -r num_run ]] ; then&lt;br /&gt;
  echo &amp;quot;found file num_run&amp;quot;&lt;br /&gt;
  numold=`cat num_run`&lt;br /&gt;
else&lt;br /&gt;
  numold=0&lt;br /&gt;
fi&lt;br /&gt;
echo &amp;quot;numold is set to&amp;quot; ${numold}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Set value of current season &lt;br /&gt;
(( numnew = ${numold} + 1 ))&lt;br /&gt;
echo &amp;quot;numnew is set to&amp;quot; ${numnew}&lt;br /&gt;
&lt;br /&gt;
# Look for initialization data files (exit if none found)&lt;br /&gt;
if [[ ( -r start${numold}.nc  &amp;amp;&amp;amp;  -r startfi${numold}.nc ) ]] ; then&lt;br /&gt;
   \cp -f start${numold}.nc start.nc&lt;br /&gt;
   \cp -f startfi${numold}.nc startfi.nc&lt;br /&gt;
else&lt;br /&gt;
   if (( ${numold} == 99999 )) ; then&lt;br /&gt;
    echo &amp;quot;No run because previous run crashed ! (99999 in num_run)&amp;quot;&lt;br /&gt;
    exit&lt;br /&gt;
   else&lt;br /&gt;
   echo &amp;quot;Where is file start&amp;quot;${numold}&amp;quot;.nc??&amp;quot;&lt;br /&gt;
   exit&lt;br /&gt;
   fi&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Run GCM -- THIS LINE NEEDS TO BE MODIFIED WITH THE CORRECT GCM EXECUTION COMMAND&lt;br /&gt;
mpirun -np 8 gcm_64x48x26_phystd_para.e &amp;lt; diagfi.def &amp;gt; lrun${numnew}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Check if run ended normaly and copy datafiles&lt;br /&gt;
if [[ ( -r restartfi.nc  &amp;amp;&amp;amp;  -r restart.nc ) ]] ; then&lt;br /&gt;
  echo &amp;quot;Run seems to have ended normaly&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  \mv -f restart.nc start${numnew}.nc&lt;br /&gt;
  \mv -f restartfi.nc startfi${numnew}.nc  &lt;br /&gt;
    &lt;br /&gt;
else&lt;br /&gt;
  if [[ -r num_run ]] ; then&lt;br /&gt;
    \mv -f num_run num_run.crash&lt;br /&gt;
  else&lt;br /&gt;
    echo &amp;quot;No file num_run to build num_run.crash from !!&amp;quot;&lt;br /&gt;
    # Impose a default value of 0 for num_run&lt;br /&gt;
    echo 0 &amp;gt; num_run.crash&lt;br /&gt;
  fi&lt;br /&gt;
 echo 99999 &amp;gt; num_run&lt;br /&gt;
 exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Copy other datafiles that may have been generated&lt;br /&gt;
if [[ -r diagfi.nc ]] ; then&lt;br /&gt;
  \mv -f diagfi.nc diagfi${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -r diagsoil.nc ]] ; then&lt;br /&gt;
  \mv -f diagsoil.nc diagsoil${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -r stats.nc ]] ; then&lt;br /&gt;
  \mv -f stats.nc stats${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -f profiles.dat ]] ; then&lt;br /&gt;
  \mv -f profiles.dat profiles${numnew}.dat&lt;br /&gt;
  \mv -f profiles.hdr profiles${numnew}.hdr&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Prepare things for upcoming runs by writing&lt;br /&gt;
# value of computed season in file num_run&lt;br /&gt;
echo ${numnew} &amp;gt; num_run&lt;br /&gt;
&lt;br /&gt;
# If we are over nummax : stop&lt;br /&gt;
if (( $numnew + 1 &amp;gt; $nummax )) ; then&lt;br /&gt;
   exit&lt;br /&gt;
else&lt;br /&gt;
   \cp -f run_gnome exe_mars&lt;br /&gt;
   ./exe_mars&lt;br /&gt;
fi &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Summary of what this bash script does''':&lt;br /&gt;
&lt;br /&gt;
* It reads the file 'num_run' which contains the step of the simulation. &lt;br /&gt;
If num_run is&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
then the script expects to read start5.nc and startfi5.nc.&lt;br /&gt;
* It modifies start5.nc and startfi5.nc into start.nc and startfi.nc, respectively.&lt;br /&gt;
* It runs the GCM.&lt;br /&gt;
* It modifies restart.nc and restartfi.nc into start6.nc and startfi6.nc&lt;br /&gt;
* It rewrite num_run as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* It restarts the loop until num_run reaches the value (defined in nummax):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visualization software ==&lt;br /&gt;
=== Panoply ===&lt;br /&gt;
Panoply is a user-friendly tool for viewing raw NetCDF data, available here: https://www.giss.nasa.gov/tools/panoply/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Example panoply.png|thumb|Screenshot of panoply showing here LMD Generic results for the exoplanet TRAPPIST-1e]]&lt;br /&gt;
&lt;br /&gt;
=== Planetoplot ===&lt;br /&gt;
&lt;br /&gt;
Planetoplot is a in-house, python based library developped to vizualize LMDG data.&lt;br /&gt;
&lt;br /&gt;
The code and documentation can be found at: https://nbviewer.org/github/aymeric-spiga/planetoplot/blob/master/tutorial/planetoplot_tutorial.ipynb&lt;br /&gt;
&lt;br /&gt;
=== ncview ===&lt;br /&gt;
Command line tool to visualize NetCDF data.&lt;br /&gt;
* Installation on Linux:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt install ncview&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== paraview ===&lt;br /&gt;
=== python scripts ===&lt;br /&gt;
&lt;br /&gt;
The xarray python library is a very good tool to easily load and plot netcdf data.&lt;br /&gt;
&lt;br /&gt;
TBD&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=400</id>
		<title>Tool Box</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=400"/>
				<updated>2022-06-21T00:23:23Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: /* newstart: a fortran program to modify start files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Pre-processing Tools ==&lt;br /&gt;
=== newstart: a fortran program to modify start files ===&lt;br /&gt;
&lt;br /&gt;
Newstart is an interactive tool to modify the start files (''start.nc'' and ''startfi.nc''). &lt;br /&gt;
&lt;br /&gt;
To be usable, ''newstart'' should be compile in the ''LMDZ.COMMON'' directory by using the following command line:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./makelmdz_fcm -arch my_arch_file -p std -d 64x48x30 newstart&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
In the example, my_arch_file is the name the arch files (see [https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/The_Target_Architecture_(%22arch%22)_Files|arch] ) and 64x48x30 is the resolution of the physical grid.&lt;br /&gt;
Then copy the executable from the ''LMDZ.COMMON/bin'' directory to your bench directory.&lt;br /&gt;
&lt;br /&gt;
When you execute newstart, you can use both a ''start2archive'' file or the start files (''start.nc'' and ''startfi.nc''). Then the interactive interface will propose to modify several physical quantities such as the gravity, the surface pressure or the rotation of the planet. At the end of the procedure, two files are created: ''restart.nc'' and ''restartfi.nc''. They can be renamed and used as start files to initialize a new simulation.&lt;br /&gt;
&lt;br /&gt;
=== start2archive ===&lt;br /&gt;
&lt;br /&gt;
description of start2archive&lt;br /&gt;
&lt;br /&gt;
- TBD by Guillaume&lt;br /&gt;
&lt;br /&gt;
=== other third party scripts and tools ===&lt;br /&gt;
&lt;br /&gt;
TO BE COMPLETED&lt;br /&gt;
&lt;br /&gt;
== Post-processing tools ==&lt;br /&gt;
=== zrecast ===&lt;br /&gt;
&lt;br /&gt;
With this program you can recast atmospheric (i.e.: 4D-dimentional longitude-latitude-altitude-time) data from&lt;br /&gt;
GCM outputs (e.g. as given in diagfi.nc files) onto either ''pressure'' or ''altitude'' above ''areoid vertical'' coordinates.&lt;br /&gt;
Since integrating the hydrostatic equation is required to recast the data, the input file must contain surface pressure&lt;br /&gt;
and atmospheric temperature, as well as the ground geopotential.&lt;br /&gt;
If recasting data onto ''pressure'' coordinates, then the output file name is given by the input file name to which ''_P.nc'' will be appened. If recasting data onto altitude above areoid coordinates, then a ''_A.nc'' will be appened.&lt;br /&gt;
&lt;br /&gt;
=== mass stream function ===&lt;br /&gt;
&lt;br /&gt;
The mass stream function (and the total angular momentum) can be computed from a diagfi.nc or a stats.nc, using the '''streamfunction.F90''' script. The script is located at&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
trunk/LMDZ.GENERIC/utilities&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To compile the script, open the ''compile'' file in the same directory and do the following:&lt;br /&gt;
* Replace &amp;quot;pgf90&amp;quot; with your favorite fortran compiler &lt;br /&gt;
* replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/lib&amp;quot; with the lib address and directory that contains your NetCDF library (file ''libnetcdf.a'').&lt;br /&gt;
* Replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/include&amp;quot; with the address of the directory that contains the NetCDF include file (''netcdf.inc'').&lt;br /&gt;
* You can mess with the compiling options but it is not mandatory.&lt;br /&gt;
&lt;br /&gt;
Once the script is compiled, copy it in the same directory as your '''.nc''' file and run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./streamfunction.e&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The script will ask you for the name of your '''.nc''' file, and will run and produce a new '''nameofyourfile_stream.nc''' file.&lt;br /&gt;
&lt;br /&gt;
'''Be careful''' : In this new file, all fields are temporally and zonally averaged.&lt;br /&gt;
&lt;br /&gt;
If you want to use '''python''' instead of '''fortran''', you can take a look at this [https://github.com/aymeric-spiga/dynanalysis repo]. It hosts a tool to perform dynamical analysis of GCM simulations (and therefore, it computes the mass stream function and a lot of other stuff), but it is tailored for Dynamico only. This repo also takes care of recasting (it does the job of both ''zrecast.F90'' and ''streamfunction.F90'')&lt;br /&gt;
&lt;br /&gt;
== Continuing Simulations ==&lt;br /&gt;
&lt;br /&gt;
=== manually ===&lt;br /&gt;
&lt;br /&gt;
At the end of a simulation, the model generates restart files (files 'restart.nc' and 'restartfi.nc') which contain the final state of the model. The 'restart.nc' and 'restartfi.nc' files have the same format as the 'start.nc' and 'startfi.nc' files, respectively. &lt;br /&gt;
&lt;br /&gt;
These files can in fact be used as initial states to continue the simulation, using the following renaming command lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mv restart.nc start.nc&lt;br /&gt;
mv restartfi.nc startfi.nc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Running a simulation with these start files will in fact resume the simulation from where the previous run ended.&lt;br /&gt;
&lt;br /&gt;
=== with bash scripts ===&lt;br /&gt;
&lt;br /&gt;
We have set up very simple bash scripts to automatize the launching of chain simulations. Here is an example of bash script that does the job:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
###########################################################################&lt;br /&gt;
# Script to perform several chained LMD Mars GCM simulations&lt;br /&gt;
# SET HERE the maximum total number of simulations&lt;br /&gt;
&lt;br /&gt;
nummax=100&lt;br /&gt;
&lt;br /&gt;
###########################################################################&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;---------------------------------------------------------&amp;quot;&lt;br /&gt;
echo &amp;quot;STARTING LOOP RUN&amp;quot;&lt;br /&gt;
echo &amp;quot;---------------------------------------------------------&amp;quot;&lt;br /&gt;
&lt;br /&gt;
dir=`pwd`&lt;br /&gt;
machine=`hostname`&lt;br /&gt;
address=`whoami`&lt;br /&gt;
&lt;br /&gt;
# Look for file &amp;quot;num_run&amp;quot; which should contain &lt;br /&gt;
# the value of the previously computed season&lt;br /&gt;
# (defaults to 0 if file &amp;quot;num_run&amp;quot; does not exist)&lt;br /&gt;
if [[ -r num_run ]] ; then&lt;br /&gt;
  echo &amp;quot;found file num_run&amp;quot;&lt;br /&gt;
  numold=`cat num_run`&lt;br /&gt;
else&lt;br /&gt;
  numold=0&lt;br /&gt;
fi&lt;br /&gt;
echo &amp;quot;numold is set to&amp;quot; ${numold}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Set value of current season &lt;br /&gt;
(( numnew = ${numold} + 1 ))&lt;br /&gt;
echo &amp;quot;numnew is set to&amp;quot; ${numnew}&lt;br /&gt;
&lt;br /&gt;
# Look for initialization data files (exit if none found)&lt;br /&gt;
if [[ ( -r start${numold}.nc  &amp;amp;&amp;amp;  -r startfi${numold}.nc ) ]] ; then&lt;br /&gt;
   \cp -f start${numold}.nc start.nc&lt;br /&gt;
   \cp -f startfi${numold}.nc startfi.nc&lt;br /&gt;
else&lt;br /&gt;
   if (( ${numold} == 99999 )) ; then&lt;br /&gt;
    echo &amp;quot;No run because previous run crashed ! (99999 in num_run)&amp;quot;&lt;br /&gt;
    exit&lt;br /&gt;
   else&lt;br /&gt;
   echo &amp;quot;Where is file start&amp;quot;${numold}&amp;quot;.nc??&amp;quot;&lt;br /&gt;
   exit&lt;br /&gt;
   fi&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Run GCM -- THIS LINE NEEDS TO BE MODIFIED WITH THE CORRECT GCM EXECUTION COMMAND&lt;br /&gt;
mpirun -np 8 gcm_64x48x26_phystd_para.e &amp;lt; diagfi.def &amp;gt; lrun${numnew}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Check if run ended normaly and copy datafiles&lt;br /&gt;
if [[ ( -r restartfi.nc  &amp;amp;&amp;amp;  -r restart.nc ) ]] ; then&lt;br /&gt;
  echo &amp;quot;Run seems to have ended normaly&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  \mv -f restart.nc start${numnew}.nc&lt;br /&gt;
  \mv -f restartfi.nc startfi${numnew}.nc  &lt;br /&gt;
    &lt;br /&gt;
else&lt;br /&gt;
  if [[ -r num_run ]] ; then&lt;br /&gt;
    \mv -f num_run num_run.crash&lt;br /&gt;
  else&lt;br /&gt;
    echo &amp;quot;No file num_run to build num_run.crash from !!&amp;quot;&lt;br /&gt;
    # Impose a default value of 0 for num_run&lt;br /&gt;
    echo 0 &amp;gt; num_run.crash&lt;br /&gt;
  fi&lt;br /&gt;
 echo 99999 &amp;gt; num_run&lt;br /&gt;
 exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Copy other datafiles that may have been generated&lt;br /&gt;
if [[ -r diagfi.nc ]] ; then&lt;br /&gt;
  \mv -f diagfi.nc diagfi${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -r diagsoil.nc ]] ; then&lt;br /&gt;
  \mv -f diagsoil.nc diagsoil${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -r stats.nc ]] ; then&lt;br /&gt;
  \mv -f stats.nc stats${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -f profiles.dat ]] ; then&lt;br /&gt;
  \mv -f profiles.dat profiles${numnew}.dat&lt;br /&gt;
  \mv -f profiles.hdr profiles${numnew}.hdr&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Prepare things for upcoming runs by writing&lt;br /&gt;
# value of computed season in file num_run&lt;br /&gt;
echo ${numnew} &amp;gt; num_run&lt;br /&gt;
&lt;br /&gt;
# If we are over nummax : stop&lt;br /&gt;
if (( $numnew + 1 &amp;gt; $nummax )) ; then&lt;br /&gt;
   exit&lt;br /&gt;
else&lt;br /&gt;
   \cp -f run_gnome exe_mars&lt;br /&gt;
   ./exe_mars&lt;br /&gt;
fi &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Summary of what this bash script does''':&lt;br /&gt;
&lt;br /&gt;
* It reads the file 'num_run' which contains the step of the simulation. &lt;br /&gt;
If num_run is&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
then the script expects to read start5.nc and startfi5.nc.&lt;br /&gt;
* It modifies start5.nc and startfi5.nc into start.nc and startfi.nc, respectively.&lt;br /&gt;
* It runs the GCM.&lt;br /&gt;
* It modifies restart.nc and restartfi.nc into start6.nc and startfi6.nc&lt;br /&gt;
* It rewrite num_run as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* It restarts the loop until num_run reaches the value (defined in nummax):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visualization software ==&lt;br /&gt;
=== Panoply ===&lt;br /&gt;
Panoply is a user-friendly tool for viewing raw NetCDF data, available here: https://www.giss.nasa.gov/tools/panoply/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Example panoply.png|thumb|Screenshot of panoply showing here LMD Generic results for the exoplanet TRAPPIST-1e]]&lt;br /&gt;
&lt;br /&gt;
=== Planetoplot ===&lt;br /&gt;
&lt;br /&gt;
Planetoplot is a in-house, python based library developped to vizualize LMDG data.&lt;br /&gt;
&lt;br /&gt;
The code and documentation can be found at: https://nbviewer.org/github/aymeric-spiga/planetoplot/blob/master/tutorial/planetoplot_tutorial.ipynb&lt;br /&gt;
&lt;br /&gt;
=== ncview ===&lt;br /&gt;
Command line tool to visualize NetCDF data.&lt;br /&gt;
* Installation on Linux:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt install ncview&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== paraview ===&lt;br /&gt;
=== python scripts ===&lt;br /&gt;
&lt;br /&gt;
The xarray python library is a very good tool to easily load and plot netcdf data.&lt;br /&gt;
&lt;br /&gt;
TBD&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=399</id>
		<title>Tool Box</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=399"/>
				<updated>2022-06-21T00:22:48Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: /* newstart: a fortran program to modify start files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Pre-processing Tools ==&lt;br /&gt;
=== newstart: a fortran program to modify start files ===&lt;br /&gt;
&lt;br /&gt;
Newstart is an interactive tool to modify the start files (''start.nc'' and ''startfi.nc''). &lt;br /&gt;
&lt;br /&gt;
To be usable, ''newstart'' should be compile in the ''LMDZ.COMMON'' directory by using the following command line:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./makelmdz_fcm -arch my_arch_file -p std -d 64x48x30 newstart&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
In the example, my_arch_file is the name the arch files (see [https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/The_Target_Architecture_(%22arch%22)_Files | arch] ) and 64x48x30 is the resolution of the physical grid.&lt;br /&gt;
Then copy the executable from the ''LMDZ.COMMON/bin'' directory to your bench directory.&lt;br /&gt;
&lt;br /&gt;
When you execute newstart, you can use both a ''start2archive'' file or the start files (''start.nc'' and ''startfi.nc''). Then the interactive interface will propose to modify several physical quantities such as the gravity, the surface pressure or the rotation of the planet. At the end of the procedure, two files are created: ''restart.nc'' and ''restartfi.nc''. They can be renamed and used as start files to initialize a new simulation.&lt;br /&gt;
&lt;br /&gt;
=== start2archive ===&lt;br /&gt;
&lt;br /&gt;
description of start2archive&lt;br /&gt;
&lt;br /&gt;
- TBD by Guillaume&lt;br /&gt;
&lt;br /&gt;
=== other third party scripts and tools ===&lt;br /&gt;
&lt;br /&gt;
TO BE COMPLETED&lt;br /&gt;
&lt;br /&gt;
== Post-processing tools ==&lt;br /&gt;
=== zrecast ===&lt;br /&gt;
&lt;br /&gt;
With this program you can recast atmospheric (i.e.: 4D-dimentional longitude-latitude-altitude-time) data from&lt;br /&gt;
GCM outputs (e.g. as given in diagfi.nc files) onto either ''pressure'' or ''altitude'' above ''areoid vertical'' coordinates.&lt;br /&gt;
Since integrating the hydrostatic equation is required to recast the data, the input file must contain surface pressure&lt;br /&gt;
and atmospheric temperature, as well as the ground geopotential.&lt;br /&gt;
If recasting data onto ''pressure'' coordinates, then the output file name is given by the input file name to which ''_P.nc'' will be appened. If recasting data onto altitude above areoid coordinates, then a ''_A.nc'' will be appened.&lt;br /&gt;
&lt;br /&gt;
=== mass stream function ===&lt;br /&gt;
&lt;br /&gt;
The mass stream function (and the total angular momentum) can be computed from a diagfi.nc or a stats.nc, using the '''streamfunction.F90''' script. The script is located at&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
trunk/LMDZ.GENERIC/utilities&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To compile the script, open the ''compile'' file in the same directory and do the following:&lt;br /&gt;
* Replace &amp;quot;pgf90&amp;quot; with your favorite fortran compiler &lt;br /&gt;
* replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/lib&amp;quot; with the lib address and directory that contains your NetCDF library (file ''libnetcdf.a'').&lt;br /&gt;
* Replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/include&amp;quot; with the address of the directory that contains the NetCDF include file (''netcdf.inc'').&lt;br /&gt;
* You can mess with the compiling options but it is not mandatory.&lt;br /&gt;
&lt;br /&gt;
Once the script is compiled, copy it in the same directory as your '''.nc''' file and run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./streamfunction.e&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The script will ask you for the name of your '''.nc''' file, and will run and produce a new '''nameofyourfile_stream.nc''' file.&lt;br /&gt;
&lt;br /&gt;
'''Be careful''' : In this new file, all fields are temporally and zonally averaged.&lt;br /&gt;
&lt;br /&gt;
If you want to use '''python''' instead of '''fortran''', you can take a look at this [https://github.com/aymeric-spiga/dynanalysis repo]. It hosts a tool to perform dynamical analysis of GCM simulations (and therefore, it computes the mass stream function and a lot of other stuff), but it is tailored for Dynamico only. This repo also takes care of recasting (it does the job of both ''zrecast.F90'' and ''streamfunction.F90'')&lt;br /&gt;
&lt;br /&gt;
== Continuing Simulations ==&lt;br /&gt;
&lt;br /&gt;
=== manually ===&lt;br /&gt;
&lt;br /&gt;
At the end of a simulation, the model generates restart files (files 'restart.nc' and 'restartfi.nc') which contain the final state of the model. The 'restart.nc' and 'restartfi.nc' files have the same format as the 'start.nc' and 'startfi.nc' files, respectively. &lt;br /&gt;
&lt;br /&gt;
These files can in fact be used as initial states to continue the simulation, using the following renaming command lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mv restart.nc start.nc&lt;br /&gt;
mv restartfi.nc startfi.nc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Running a simulation with these start files will in fact resume the simulation from where the previous run ended.&lt;br /&gt;
&lt;br /&gt;
=== with bash scripts ===&lt;br /&gt;
&lt;br /&gt;
We have set up very simple bash scripts to automatize the launching of chain simulations. Here is an example of bash script that does the job:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
###########################################################################&lt;br /&gt;
# Script to perform several chained LMD Mars GCM simulations&lt;br /&gt;
# SET HERE the maximum total number of simulations&lt;br /&gt;
&lt;br /&gt;
nummax=100&lt;br /&gt;
&lt;br /&gt;
###########################################################################&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;---------------------------------------------------------&amp;quot;&lt;br /&gt;
echo &amp;quot;STARTING LOOP RUN&amp;quot;&lt;br /&gt;
echo &amp;quot;---------------------------------------------------------&amp;quot;&lt;br /&gt;
&lt;br /&gt;
dir=`pwd`&lt;br /&gt;
machine=`hostname`&lt;br /&gt;
address=`whoami`&lt;br /&gt;
&lt;br /&gt;
# Look for file &amp;quot;num_run&amp;quot; which should contain &lt;br /&gt;
# the value of the previously computed season&lt;br /&gt;
# (defaults to 0 if file &amp;quot;num_run&amp;quot; does not exist)&lt;br /&gt;
if [[ -r num_run ]] ; then&lt;br /&gt;
  echo &amp;quot;found file num_run&amp;quot;&lt;br /&gt;
  numold=`cat num_run`&lt;br /&gt;
else&lt;br /&gt;
  numold=0&lt;br /&gt;
fi&lt;br /&gt;
echo &amp;quot;numold is set to&amp;quot; ${numold}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Set value of current season &lt;br /&gt;
(( numnew = ${numold} + 1 ))&lt;br /&gt;
echo &amp;quot;numnew is set to&amp;quot; ${numnew}&lt;br /&gt;
&lt;br /&gt;
# Look for initialization data files (exit if none found)&lt;br /&gt;
if [[ ( -r start${numold}.nc  &amp;amp;&amp;amp;  -r startfi${numold}.nc ) ]] ; then&lt;br /&gt;
   \cp -f start${numold}.nc start.nc&lt;br /&gt;
   \cp -f startfi${numold}.nc startfi.nc&lt;br /&gt;
else&lt;br /&gt;
   if (( ${numold} == 99999 )) ; then&lt;br /&gt;
    echo &amp;quot;No run because previous run crashed ! (99999 in num_run)&amp;quot;&lt;br /&gt;
    exit&lt;br /&gt;
   else&lt;br /&gt;
   echo &amp;quot;Where is file start&amp;quot;${numold}&amp;quot;.nc??&amp;quot;&lt;br /&gt;
   exit&lt;br /&gt;
   fi&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Run GCM -- THIS LINE NEEDS TO BE MODIFIED WITH THE CORRECT GCM EXECUTION COMMAND&lt;br /&gt;
mpirun -np 8 gcm_64x48x26_phystd_para.e &amp;lt; diagfi.def &amp;gt; lrun${numnew}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Check if run ended normaly and copy datafiles&lt;br /&gt;
if [[ ( -r restartfi.nc  &amp;amp;&amp;amp;  -r restart.nc ) ]] ; then&lt;br /&gt;
  echo &amp;quot;Run seems to have ended normaly&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  \mv -f restart.nc start${numnew}.nc&lt;br /&gt;
  \mv -f restartfi.nc startfi${numnew}.nc  &lt;br /&gt;
    &lt;br /&gt;
else&lt;br /&gt;
  if [[ -r num_run ]] ; then&lt;br /&gt;
    \mv -f num_run num_run.crash&lt;br /&gt;
  else&lt;br /&gt;
    echo &amp;quot;No file num_run to build num_run.crash from !!&amp;quot;&lt;br /&gt;
    # Impose a default value of 0 for num_run&lt;br /&gt;
    echo 0 &amp;gt; num_run.crash&lt;br /&gt;
  fi&lt;br /&gt;
 echo 99999 &amp;gt; num_run&lt;br /&gt;
 exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Copy other datafiles that may have been generated&lt;br /&gt;
if [[ -r diagfi.nc ]] ; then&lt;br /&gt;
  \mv -f diagfi.nc diagfi${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -r diagsoil.nc ]] ; then&lt;br /&gt;
  \mv -f diagsoil.nc diagsoil${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -r stats.nc ]] ; then&lt;br /&gt;
  \mv -f stats.nc stats${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -f profiles.dat ]] ; then&lt;br /&gt;
  \mv -f profiles.dat profiles${numnew}.dat&lt;br /&gt;
  \mv -f profiles.hdr profiles${numnew}.hdr&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Prepare things for upcoming runs by writing&lt;br /&gt;
# value of computed season in file num_run&lt;br /&gt;
echo ${numnew} &amp;gt; num_run&lt;br /&gt;
&lt;br /&gt;
# If we are over nummax : stop&lt;br /&gt;
if (( $numnew + 1 &amp;gt; $nummax )) ; then&lt;br /&gt;
   exit&lt;br /&gt;
else&lt;br /&gt;
   \cp -f run_gnome exe_mars&lt;br /&gt;
   ./exe_mars&lt;br /&gt;
fi &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Summary of what this bash script does''':&lt;br /&gt;
&lt;br /&gt;
* It reads the file 'num_run' which contains the step of the simulation. &lt;br /&gt;
If num_run is&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
then the script expects to read start5.nc and startfi5.nc.&lt;br /&gt;
* It modifies start5.nc and startfi5.nc into start.nc and startfi.nc, respectively.&lt;br /&gt;
* It runs the GCM.&lt;br /&gt;
* It modifies restart.nc and restartfi.nc into start6.nc and startfi6.nc&lt;br /&gt;
* It rewrite num_run as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* It restarts the loop until num_run reaches the value (defined in nummax):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visualization software ==&lt;br /&gt;
=== Panoply ===&lt;br /&gt;
Panoply is a user-friendly tool for viewing raw NetCDF data, available here: https://www.giss.nasa.gov/tools/panoply/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Example panoply.png|thumb|Screenshot of panoply showing here LMD Generic results for the exoplanet TRAPPIST-1e]]&lt;br /&gt;
&lt;br /&gt;
=== Planetoplot ===&lt;br /&gt;
&lt;br /&gt;
Planetoplot is a in-house, python based library developped to vizualize LMDG data.&lt;br /&gt;
&lt;br /&gt;
The code and documentation can be found at: https://nbviewer.org/github/aymeric-spiga/planetoplot/blob/master/tutorial/planetoplot_tutorial.ipynb&lt;br /&gt;
&lt;br /&gt;
=== ncview ===&lt;br /&gt;
Command line tool to visualize NetCDF data.&lt;br /&gt;
* Installation on Linux:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt install ncview&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== paraview ===&lt;br /&gt;
=== python scripts ===&lt;br /&gt;
&lt;br /&gt;
The xarray python library is a very good tool to easily load and plot netcdf data.&lt;br /&gt;
&lt;br /&gt;
TBD&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=398</id>
		<title>Tool Box</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=398"/>
				<updated>2022-06-21T00:18:45Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: /* newstart: a fortran program to modify start files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Pre-processing Tools ==&lt;br /&gt;
=== newstart: a fortran program to modify start files ===&lt;br /&gt;
&lt;br /&gt;
Newstart is an interactive tool to modify the start files (''start.nc'' and ''startfi.nc''). &lt;br /&gt;
&lt;br /&gt;
To be usable, ''newstart'' should be compile in the ''LMDZ.COMMON'' directory by using the following command line:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./makelmdz_fcm -arch my_arch_files -p std -d 64x48x30 newstart&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
In the example, my_arch_file is the name the arch files (see [https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/The_Target_Architecture_(%22arch%22)_Files|arch]) and 64x48x30 is the resolution of the physical grid.&lt;br /&gt;
Then copy the executable from the bin directory to your bench directory.&lt;br /&gt;
&lt;br /&gt;
When you execute newstart, you can use both a ''start2archive'' file or the start files (''start.nc'' and ''startfi.nc''). Then the interactive interface will propose to modify few physical quantities such as the gravity, the tracer concentrations or the rotation of the planet. At the end of the procedure, two files are created: ''restart.nc'' and ''restartfi.nc''. They can be renamed and used as start files to initialize a new simulation.&lt;br /&gt;
&lt;br /&gt;
=== start2archive ===&lt;br /&gt;
&lt;br /&gt;
description of start2archive&lt;br /&gt;
&lt;br /&gt;
- TBD by Guillaume&lt;br /&gt;
&lt;br /&gt;
=== other third party scripts and tools ===&lt;br /&gt;
&lt;br /&gt;
TO BE COMPLETED&lt;br /&gt;
&lt;br /&gt;
== Post-processing tools ==&lt;br /&gt;
=== zrecast ===&lt;br /&gt;
&lt;br /&gt;
With this program you can recast atmospheric (i.e.: 4D-dimentional longitude-latitude-altitude-time) data from&lt;br /&gt;
GCM outputs (e.g. as given in diagfi.nc files) onto either ''pressure'' or ''altitude'' above ''areoid vertical'' coordinates.&lt;br /&gt;
Since integrating the hydrostatic equation is required to recast the data, the input file must contain surface pressure&lt;br /&gt;
and atmospheric temperature, as well as the ground geopotential.&lt;br /&gt;
If recasting data onto ''pressure'' coordinates, then the output file name is given by the input file name to which ''_P.nc'' will be appened. If recasting data onto altitude above areoid coordinates, then a ''_A.nc'' will be appened.&lt;br /&gt;
&lt;br /&gt;
=== mass stream function ===&lt;br /&gt;
&lt;br /&gt;
The mass stream function (and the total angular momentum) can be computed from a diagfi.nc or a stats.nc, using the '''streamfunction.F90''' script. The script is located at&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
trunk/LMDZ.GENERIC/utilities&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To compile the script, open the ''compile'' file in the same directory and do the following:&lt;br /&gt;
* Replace &amp;quot;pgf90&amp;quot; with your favorite fortran compiler &lt;br /&gt;
* replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/lib&amp;quot; with the lib address and directory that contains your NetCDF library (file ''libnetcdf.a'').&lt;br /&gt;
* Replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/include&amp;quot; with the address of the directory that contains the NetCDF include file (''netcdf.inc'').&lt;br /&gt;
* You can mess with the compiling options but it is not mandatory.&lt;br /&gt;
&lt;br /&gt;
Once the script is compiled, copy it in the same directory as your '''.nc''' file and run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./streamfunction.e&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The script will ask you for the name of your '''.nc''' file, and will run and produce a new '''nameofyourfile_stream.nc''' file.&lt;br /&gt;
&lt;br /&gt;
'''Be careful''' : In this new file, all fields are temporally and zonally averaged.&lt;br /&gt;
&lt;br /&gt;
If you want to use '''python''' instead of '''fortran''', you can take a look at this [https://github.com/aymeric-spiga/dynanalysis repo]. It hosts a tool to perform dynamical analysis of GCM simulations (and therefore, it computes the mass stream function and a lot of other stuff), but it is tailored for Dynamico only. This repo also takes care of recasting (it does the job of both ''zrecast.F90'' and ''streamfunction.F90'')&lt;br /&gt;
&lt;br /&gt;
== Continuing Simulations ==&lt;br /&gt;
&lt;br /&gt;
=== manually ===&lt;br /&gt;
&lt;br /&gt;
At the end of a simulation, the model generates restart files (files 'restart.nc' and 'restartfi.nc') which contain the final state of the model. The 'restart.nc' and 'restartfi.nc' files have the same format as the 'start.nc' and 'startfi.nc' files, respectively. &lt;br /&gt;
&lt;br /&gt;
These files can in fact be used as initial states to continue the simulation, using the following renaming command lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mv restart.nc start.nc&lt;br /&gt;
mv restartfi.nc startfi.nc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Running a simulation with these start files will in fact resume the simulation from where the previous run ended.&lt;br /&gt;
&lt;br /&gt;
=== with bash scripts ===&lt;br /&gt;
&lt;br /&gt;
We have set up very simple bash scripts to automatize the launching of chain simulations. Here is an example of bash script that does the job:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
###########################################################################&lt;br /&gt;
# Script to perform several chained LMD Mars GCM simulations&lt;br /&gt;
# SET HERE the maximum total number of simulations&lt;br /&gt;
&lt;br /&gt;
nummax=100&lt;br /&gt;
&lt;br /&gt;
###########################################################################&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;---------------------------------------------------------&amp;quot;&lt;br /&gt;
echo &amp;quot;STARTING LOOP RUN&amp;quot;&lt;br /&gt;
echo &amp;quot;---------------------------------------------------------&amp;quot;&lt;br /&gt;
&lt;br /&gt;
dir=`pwd`&lt;br /&gt;
machine=`hostname`&lt;br /&gt;
address=`whoami`&lt;br /&gt;
&lt;br /&gt;
# Look for file &amp;quot;num_run&amp;quot; which should contain &lt;br /&gt;
# the value of the previously computed season&lt;br /&gt;
# (defaults to 0 if file &amp;quot;num_run&amp;quot; does not exist)&lt;br /&gt;
if [[ -r num_run ]] ; then&lt;br /&gt;
  echo &amp;quot;found file num_run&amp;quot;&lt;br /&gt;
  numold=`cat num_run`&lt;br /&gt;
else&lt;br /&gt;
  numold=0&lt;br /&gt;
fi&lt;br /&gt;
echo &amp;quot;numold is set to&amp;quot; ${numold}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Set value of current season &lt;br /&gt;
(( numnew = ${numold} + 1 ))&lt;br /&gt;
echo &amp;quot;numnew is set to&amp;quot; ${numnew}&lt;br /&gt;
&lt;br /&gt;
# Look for initialization data files (exit if none found)&lt;br /&gt;
if [[ ( -r start${numold}.nc  &amp;amp;&amp;amp;  -r startfi${numold}.nc ) ]] ; then&lt;br /&gt;
   \cp -f start${numold}.nc start.nc&lt;br /&gt;
   \cp -f startfi${numold}.nc startfi.nc&lt;br /&gt;
else&lt;br /&gt;
   if (( ${numold} == 99999 )) ; then&lt;br /&gt;
    echo &amp;quot;No run because previous run crashed ! (99999 in num_run)&amp;quot;&lt;br /&gt;
    exit&lt;br /&gt;
   else&lt;br /&gt;
   echo &amp;quot;Where is file start&amp;quot;${numold}&amp;quot;.nc??&amp;quot;&lt;br /&gt;
   exit&lt;br /&gt;
   fi&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Run GCM -- THIS LINE NEEDS TO BE MODIFIED WITH THE CORRECT GCM EXECUTION COMMAND&lt;br /&gt;
mpirun -np 8 gcm_64x48x26_phystd_para.e &amp;lt; diagfi.def &amp;gt; lrun${numnew}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Check if run ended normaly and copy datafiles&lt;br /&gt;
if [[ ( -r restartfi.nc  &amp;amp;&amp;amp;  -r restart.nc ) ]] ; then&lt;br /&gt;
  echo &amp;quot;Run seems to have ended normaly&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  \mv -f restart.nc start${numnew}.nc&lt;br /&gt;
  \mv -f restartfi.nc startfi${numnew}.nc  &lt;br /&gt;
    &lt;br /&gt;
else&lt;br /&gt;
  if [[ -r num_run ]] ; then&lt;br /&gt;
    \mv -f num_run num_run.crash&lt;br /&gt;
  else&lt;br /&gt;
    echo &amp;quot;No file num_run to build num_run.crash from !!&amp;quot;&lt;br /&gt;
    # Impose a default value of 0 for num_run&lt;br /&gt;
    echo 0 &amp;gt; num_run.crash&lt;br /&gt;
  fi&lt;br /&gt;
 echo 99999 &amp;gt; num_run&lt;br /&gt;
 exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Copy other datafiles that may have been generated&lt;br /&gt;
if [[ -r diagfi.nc ]] ; then&lt;br /&gt;
  \mv -f diagfi.nc diagfi${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -r diagsoil.nc ]] ; then&lt;br /&gt;
  \mv -f diagsoil.nc diagsoil${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -r stats.nc ]] ; then&lt;br /&gt;
  \mv -f stats.nc stats${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -f profiles.dat ]] ; then&lt;br /&gt;
  \mv -f profiles.dat profiles${numnew}.dat&lt;br /&gt;
  \mv -f profiles.hdr profiles${numnew}.hdr&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Prepare things for upcoming runs by writing&lt;br /&gt;
# value of computed season in file num_run&lt;br /&gt;
echo ${numnew} &amp;gt; num_run&lt;br /&gt;
&lt;br /&gt;
# If we are over nummax : stop&lt;br /&gt;
if (( $numnew + 1 &amp;gt; $nummax )) ; then&lt;br /&gt;
   exit&lt;br /&gt;
else&lt;br /&gt;
   \cp -f run_gnome exe_mars&lt;br /&gt;
   ./exe_mars&lt;br /&gt;
fi &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Summary of what this bash script does''':&lt;br /&gt;
&lt;br /&gt;
* It reads the file 'num_run' which contains the step of the simulation. &lt;br /&gt;
If num_run is&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
then the script expects to read start5.nc and startfi5.nc.&lt;br /&gt;
* It modifies start5.nc and startfi5.nc into start.nc and startfi.nc, respectively.&lt;br /&gt;
* It runs the GCM.&lt;br /&gt;
* It modifies restart.nc and restartfi.nc into start6.nc and startfi6.nc&lt;br /&gt;
* It rewrite num_run as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* It restarts the loop until num_run reaches the value (defined in nummax):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visualization software ==&lt;br /&gt;
=== Panoply ===&lt;br /&gt;
Panoply is a user-friendly tool for viewing raw NetCDF data, available here: https://www.giss.nasa.gov/tools/panoply/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Example panoply.png|thumb|Screenshot of panoply showing here LMD Generic results for the exoplanet TRAPPIST-1e]]&lt;br /&gt;
&lt;br /&gt;
=== Planetoplot ===&lt;br /&gt;
&lt;br /&gt;
Planetoplot is a in-house, python based library developped to vizualize LMDG data.&lt;br /&gt;
&lt;br /&gt;
The code and documentation can be found at: https://nbviewer.org/github/aymeric-spiga/planetoplot/blob/master/tutorial/planetoplot_tutorial.ipynb&lt;br /&gt;
&lt;br /&gt;
=== ncview ===&lt;br /&gt;
Command line tool to visualize NetCDF data.&lt;br /&gt;
* Installation on Linux:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt install ncview&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== paraview ===&lt;br /&gt;
=== python scripts ===&lt;br /&gt;
&lt;br /&gt;
The xarray python library is a very good tool to easily load and plot netcdf data.&lt;br /&gt;
&lt;br /&gt;
TBD&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=397</id>
		<title>Tool Box</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=397"/>
				<updated>2022-06-21T00:09:03Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: /* newstart: a fortran program to modify start files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Pre-processing Tools ==&lt;br /&gt;
=== newstart: a fortran program to modify start files ===&lt;br /&gt;
&lt;br /&gt;
Newstart is an interactive tool to modify the start files (start.nc and startfi.nc). &lt;br /&gt;
&lt;br /&gt;
To be usable, ''newstart'' should be compile in the ''LMDZ.COMMON'' directory by using the following command line:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./makelmdz_fcm -arch my_arch_files -p std -d 64x48x30 newstart&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
In the example, my_arch_file is the name the arch files (see [https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/The_Target_Architecture_(%22arch%22)_Files|arch]) and 64x48x30 is the resolution of the physical grid.&lt;br /&gt;
Then put the executable in your bench directory.&lt;br /&gt;
&lt;br /&gt;
=== start2archive ===&lt;br /&gt;
&lt;br /&gt;
description of start2archive&lt;br /&gt;
&lt;br /&gt;
- TBD by Guillaume&lt;br /&gt;
&lt;br /&gt;
=== other third party scripts and tools ===&lt;br /&gt;
&lt;br /&gt;
TO BE COMPLETED&lt;br /&gt;
&lt;br /&gt;
== Post-processing tools ==&lt;br /&gt;
=== zrecast ===&lt;br /&gt;
&lt;br /&gt;
With this program you can recast atmospheric (i.e.: 4D-dimentional longitude-latitude-altitude-time) data from&lt;br /&gt;
GCM outputs (e.g. as given in diagfi.nc files) onto either ''pressure'' or ''altitude'' above ''areoid vertical'' coordinates.&lt;br /&gt;
Since integrating the hydrostatic equation is required to recast the data, the input file must contain surface pressure&lt;br /&gt;
and atmospheric temperature, as well as the ground geopotential.&lt;br /&gt;
If recasting data onto ''pressure'' coordinates, then the output file name is given by the input file name to which ''_P.nc'' will be appened. If recasting data onto altitude above areoid coordinates, then a ''_A.nc'' will be appened.&lt;br /&gt;
&lt;br /&gt;
=== mass stream function ===&lt;br /&gt;
&lt;br /&gt;
The mass stream function (and the total angular momentum) can be computed from a diagfi.nc or a stats.nc, using the '''streamfunction.F90''' script. The script is located at&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
trunk/LMDZ.GENERIC/utilities&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To compile the script, open the ''compile'' file in the same directory and do the following:&lt;br /&gt;
* Replace &amp;quot;pgf90&amp;quot; with your favorite fortran compiler &lt;br /&gt;
* replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/lib&amp;quot; with the lib address and directory that contains your NetCDF library (file ''libnetcdf.a'').&lt;br /&gt;
* Replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/include&amp;quot; with the address of the directory that contains the NetCDF include file (''netcdf.inc'').&lt;br /&gt;
* You can mess with the compiling options but it is not mandatory.&lt;br /&gt;
&lt;br /&gt;
Once the script is compiled, copy it in the same directory as your '''.nc''' file and run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./streamfunction.e&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The script will ask you for the name of your '''.nc''' file, and will run and produce a new '''nameofyourfile_stream.nc''' file.&lt;br /&gt;
&lt;br /&gt;
'''Be careful''' : In this new file, all fields are temporally and zonally averaged.&lt;br /&gt;
&lt;br /&gt;
If you want to use '''python''' instead of '''fortran''', you can take a look at this [https://github.com/aymeric-spiga/dynanalysis repo]. It hosts a tool to perform dynamical analysis of GCM simulations (and therefore, it computes the mass stream function and a lot of other stuff), but it is tailored for Dynamico only. This repo also takes care of recasting (it does the job of both ''zrecast.F90'' and ''streamfunction.F90'')&lt;br /&gt;
&lt;br /&gt;
== Continuing Simulations ==&lt;br /&gt;
&lt;br /&gt;
=== manually ===&lt;br /&gt;
&lt;br /&gt;
At the end of a simulation, the model generates restart files (files 'restart.nc' and 'restartfi.nc') which contain the final state of the model. The 'restart.nc' and 'restartfi.nc' files have the same format as the 'start.nc' and 'startfi.nc' files, respectively. &lt;br /&gt;
&lt;br /&gt;
These files can in fact be used as initial states to continue the simulation, using the following renaming command lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mv restart.nc start.nc&lt;br /&gt;
mv restartfi.nc startfi.nc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Running a simulation with these start files will in fact resume the simulation from where the previous run ended.&lt;br /&gt;
&lt;br /&gt;
=== with bash scripts ===&lt;br /&gt;
&lt;br /&gt;
We have set up very simple bash scripts to automatize the launching of chain simulations. Here is an example of bash script that does the job:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
###########################################################################&lt;br /&gt;
# Script to perform several chained LMD Mars GCM simulations&lt;br /&gt;
# SET HERE the maximum total number of simulations&lt;br /&gt;
&lt;br /&gt;
nummax=100&lt;br /&gt;
&lt;br /&gt;
###########################################################################&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;---------------------------------------------------------&amp;quot;&lt;br /&gt;
echo &amp;quot;STARTING LOOP RUN&amp;quot;&lt;br /&gt;
echo &amp;quot;---------------------------------------------------------&amp;quot;&lt;br /&gt;
&lt;br /&gt;
dir=`pwd`&lt;br /&gt;
machine=`hostname`&lt;br /&gt;
address=`whoami`&lt;br /&gt;
&lt;br /&gt;
# Look for file &amp;quot;num_run&amp;quot; which should contain &lt;br /&gt;
# the value of the previously computed season&lt;br /&gt;
# (defaults to 0 if file &amp;quot;num_run&amp;quot; does not exist)&lt;br /&gt;
if [[ -r num_run ]] ; then&lt;br /&gt;
  echo &amp;quot;found file num_run&amp;quot;&lt;br /&gt;
  numold=`cat num_run`&lt;br /&gt;
else&lt;br /&gt;
  numold=0&lt;br /&gt;
fi&lt;br /&gt;
echo &amp;quot;numold is set to&amp;quot; ${numold}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Set value of current season &lt;br /&gt;
(( numnew = ${numold} + 1 ))&lt;br /&gt;
echo &amp;quot;numnew is set to&amp;quot; ${numnew}&lt;br /&gt;
&lt;br /&gt;
# Look for initialization data files (exit if none found)&lt;br /&gt;
if [[ ( -r start${numold}.nc  &amp;amp;&amp;amp;  -r startfi${numold}.nc ) ]] ; then&lt;br /&gt;
   \cp -f start${numold}.nc start.nc&lt;br /&gt;
   \cp -f startfi${numold}.nc startfi.nc&lt;br /&gt;
else&lt;br /&gt;
   if (( ${numold} == 99999 )) ; then&lt;br /&gt;
    echo &amp;quot;No run because previous run crashed ! (99999 in num_run)&amp;quot;&lt;br /&gt;
    exit&lt;br /&gt;
   else&lt;br /&gt;
   echo &amp;quot;Where is file start&amp;quot;${numold}&amp;quot;.nc??&amp;quot;&lt;br /&gt;
   exit&lt;br /&gt;
   fi&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Run GCM -- THIS LINE NEEDS TO BE MODIFIED WITH THE CORRECT GCM EXECUTION COMMAND&lt;br /&gt;
mpirun -np 8 gcm_64x48x26_phystd_para.e &amp;lt; diagfi.def &amp;gt; lrun${numnew}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Check if run ended normaly and copy datafiles&lt;br /&gt;
if [[ ( -r restartfi.nc  &amp;amp;&amp;amp;  -r restart.nc ) ]] ; then&lt;br /&gt;
  echo &amp;quot;Run seems to have ended normaly&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  \mv -f restart.nc start${numnew}.nc&lt;br /&gt;
  \mv -f restartfi.nc startfi${numnew}.nc  &lt;br /&gt;
    &lt;br /&gt;
else&lt;br /&gt;
  if [[ -r num_run ]] ; then&lt;br /&gt;
    \mv -f num_run num_run.crash&lt;br /&gt;
  else&lt;br /&gt;
    echo &amp;quot;No file num_run to build num_run.crash from !!&amp;quot;&lt;br /&gt;
    # Impose a default value of 0 for num_run&lt;br /&gt;
    echo 0 &amp;gt; num_run.crash&lt;br /&gt;
  fi&lt;br /&gt;
 echo 99999 &amp;gt; num_run&lt;br /&gt;
 exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Copy other datafiles that may have been generated&lt;br /&gt;
if [[ -r diagfi.nc ]] ; then&lt;br /&gt;
  \mv -f diagfi.nc diagfi${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -r diagsoil.nc ]] ; then&lt;br /&gt;
  \mv -f diagsoil.nc diagsoil${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -r stats.nc ]] ; then&lt;br /&gt;
  \mv -f stats.nc stats${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -f profiles.dat ]] ; then&lt;br /&gt;
  \mv -f profiles.dat profiles${numnew}.dat&lt;br /&gt;
  \mv -f profiles.hdr profiles${numnew}.hdr&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Prepare things for upcoming runs by writing&lt;br /&gt;
# value of computed season in file num_run&lt;br /&gt;
echo ${numnew} &amp;gt; num_run&lt;br /&gt;
&lt;br /&gt;
# If we are over nummax : stop&lt;br /&gt;
if (( $numnew + 1 &amp;gt; $nummax )) ; then&lt;br /&gt;
   exit&lt;br /&gt;
else&lt;br /&gt;
   \cp -f run_gnome exe_mars&lt;br /&gt;
   ./exe_mars&lt;br /&gt;
fi &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Summary of what this bash script does''':&lt;br /&gt;
&lt;br /&gt;
* It reads the file 'num_run' which contains the step of the simulation. &lt;br /&gt;
If num_run is&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
then the script expects to read start5.nc and startfi5.nc.&lt;br /&gt;
* It modifies start5.nc and startfi5.nc into start.nc and startfi.nc, respectively.&lt;br /&gt;
* It runs the GCM.&lt;br /&gt;
* It modifies restart.nc and restartfi.nc into start6.nc and startfi6.nc&lt;br /&gt;
* It rewrite num_run as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* It restarts the loop until num_run reaches the value (defined in nummax):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visualization software ==&lt;br /&gt;
=== Panoply ===&lt;br /&gt;
Panoply is a user-friendly tool for viewing raw NetCDF data, available here: https://www.giss.nasa.gov/tools/panoply/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Example panoply.png|thumb|Screenshot of panoply showing here LMD Generic results for the exoplanet TRAPPIST-1e]]&lt;br /&gt;
&lt;br /&gt;
=== Planetoplot ===&lt;br /&gt;
&lt;br /&gt;
Planetoplot is a in-house, python based library developped to vizualize LMDG data.&lt;br /&gt;
&lt;br /&gt;
The code and documentation can be found at: https://nbviewer.org/github/aymeric-spiga/planetoplot/blob/master/tutorial/planetoplot_tutorial.ipynb&lt;br /&gt;
&lt;br /&gt;
=== ncview ===&lt;br /&gt;
Command line tool to visualize NetCDF data.&lt;br /&gt;
* Installation on Linux:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt install ncview&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== paraview ===&lt;br /&gt;
=== python scripts ===&lt;br /&gt;
&lt;br /&gt;
The xarray python library is a very good tool to easily load and plot netcdf data.&lt;br /&gt;
&lt;br /&gt;
TBD&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=396</id>
		<title>Tool Box</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=396"/>
				<updated>2022-06-21T00:01:43Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: /* newstart: a fortran program to modify start files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Pre-processing Tools ==&lt;br /&gt;
=== newstart: a fortran program to modify start files ===&lt;br /&gt;
&lt;br /&gt;
description of newstart&lt;br /&gt;
&lt;br /&gt;
- TBD by Guillaume&lt;br /&gt;
&lt;br /&gt;
Newstart is an interactive tool to modify the start files (start.nc and startfi.nc). &lt;br /&gt;
&lt;br /&gt;
To be executable, ''newstart'' should be compile in the ''LMDZ.COMMON'' directory by using the following command line:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./makelmdz_fcm -arch my_arch_files -p std -d 64x48x30 newstart&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== start2archive ===&lt;br /&gt;
&lt;br /&gt;
description of start2archive&lt;br /&gt;
&lt;br /&gt;
- TBD by Guillaume&lt;br /&gt;
&lt;br /&gt;
=== other third party scripts and tools ===&lt;br /&gt;
&lt;br /&gt;
TO BE COMPLETED&lt;br /&gt;
&lt;br /&gt;
== Post-processing tools ==&lt;br /&gt;
=== zrecast ===&lt;br /&gt;
&lt;br /&gt;
With this program you can recast atmospheric (i.e.: 4D-dimentional longitude-latitude-altitude-time) data from&lt;br /&gt;
GCM outputs (e.g. as given in diagfi.nc files) onto either ''pressure'' or ''altitude'' above ''areoid vertical'' coordinates.&lt;br /&gt;
Since integrating the hydrostatic equation is required to recast the data, the input file must contain surface pressure&lt;br /&gt;
and atmospheric temperature, as well as the ground geopotential.&lt;br /&gt;
If recasting data onto ''pressure'' coordinates, then the output file name is given by the input file name to which ''_P.nc'' will be appened. If recasting data onto altitude above areoid coordinates, then a ''_A.nc'' will be appened.&lt;br /&gt;
&lt;br /&gt;
=== mass stream function ===&lt;br /&gt;
&lt;br /&gt;
The mass stream function (and the total angular momentum) can be computed from a diagfi.nc or a stats.nc, using the '''streamfunction.F90''' script. The script is located at&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
trunk/LMDZ.GENERIC/utilities&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To compile the script, open the ''compile'' file in the same directory and do the following:&lt;br /&gt;
* Replace &amp;quot;pgf90&amp;quot; with your favorite fortran compiler &lt;br /&gt;
* replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/lib&amp;quot; with the lib address and directory that contains your NetCDF library (file ''libnetcdf.a'').&lt;br /&gt;
* Replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/include&amp;quot; with the address of the directory that contains the NetCDF include file (''netcdf.inc'').&lt;br /&gt;
* You can mess with the compiling options but it is not mandatory.&lt;br /&gt;
&lt;br /&gt;
Once the script is compiled, copy it in the same directory as your '''.nc''' file and run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./streamfunction.e&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The script will ask you for the name of your '''.nc''' file, and will run and produce a new '''nameofyourfile_stream.nc''' file.&lt;br /&gt;
&lt;br /&gt;
'''Be careful''' : In this new file, all fields are temporally and zonally averaged.&lt;br /&gt;
&lt;br /&gt;
If you want to use '''python''' instead of '''fortran''', you can take a look at this [https://github.com/aymeric-spiga/dynanalysis repo]. It hosts a tool to perform dynamical analysis of GCM simulations (and therefore, it computes the mass stream function and a lot of other stuff), but it is tailored for Dynamico only. This repo also takes care of recasting (it does the job of both ''zrecast.F90'' and ''streamfunction.F90'')&lt;br /&gt;
&lt;br /&gt;
== Continuing Simulations ==&lt;br /&gt;
&lt;br /&gt;
=== manually ===&lt;br /&gt;
&lt;br /&gt;
At the end of a simulation, the model generates restart files (files 'restart.nc' and 'restartfi.nc') which contain the final state of the model. The 'restart.nc' and 'restartfi.nc' files have the same format as the 'start.nc' and 'startfi.nc' files, respectively. &lt;br /&gt;
&lt;br /&gt;
These files can in fact be used as initial states to continue the simulation, using the following renaming command lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mv restart.nc start.nc&lt;br /&gt;
mv restartfi.nc startfi.nc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Running a simulation with these start files will in fact resume the simulation from where the previous run ended.&lt;br /&gt;
&lt;br /&gt;
=== with bash scripts ===&lt;br /&gt;
&lt;br /&gt;
We have set up very simple bash scripts to automatize the launching of chain simulations. Here is an example of bash script that does the job:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
###########################################################################&lt;br /&gt;
# Script to perform several chained LMD Mars GCM simulations&lt;br /&gt;
# SET HERE the maximum total number of simulations&lt;br /&gt;
&lt;br /&gt;
nummax=100&lt;br /&gt;
&lt;br /&gt;
###########################################################################&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;---------------------------------------------------------&amp;quot;&lt;br /&gt;
echo &amp;quot;STARTING LOOP RUN&amp;quot;&lt;br /&gt;
echo &amp;quot;---------------------------------------------------------&amp;quot;&lt;br /&gt;
&lt;br /&gt;
dir=`pwd`&lt;br /&gt;
machine=`hostname`&lt;br /&gt;
address=`whoami`&lt;br /&gt;
&lt;br /&gt;
# Look for file &amp;quot;num_run&amp;quot; which should contain &lt;br /&gt;
# the value of the previously computed season&lt;br /&gt;
# (defaults to 0 if file &amp;quot;num_run&amp;quot; does not exist)&lt;br /&gt;
if [[ -r num_run ]] ; then&lt;br /&gt;
  echo &amp;quot;found file num_run&amp;quot;&lt;br /&gt;
  numold=`cat num_run`&lt;br /&gt;
else&lt;br /&gt;
  numold=0&lt;br /&gt;
fi&lt;br /&gt;
echo &amp;quot;numold is set to&amp;quot; ${numold}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Set value of current season &lt;br /&gt;
(( numnew = ${numold} + 1 ))&lt;br /&gt;
echo &amp;quot;numnew is set to&amp;quot; ${numnew}&lt;br /&gt;
&lt;br /&gt;
# Look for initialization data files (exit if none found)&lt;br /&gt;
if [[ ( -r start${numold}.nc  &amp;amp;&amp;amp;  -r startfi${numold}.nc ) ]] ; then&lt;br /&gt;
   \cp -f start${numold}.nc start.nc&lt;br /&gt;
   \cp -f startfi${numold}.nc startfi.nc&lt;br /&gt;
else&lt;br /&gt;
   if (( ${numold} == 99999 )) ; then&lt;br /&gt;
    echo &amp;quot;No run because previous run crashed ! (99999 in num_run)&amp;quot;&lt;br /&gt;
    exit&lt;br /&gt;
   else&lt;br /&gt;
   echo &amp;quot;Where is file start&amp;quot;${numold}&amp;quot;.nc??&amp;quot;&lt;br /&gt;
   exit&lt;br /&gt;
   fi&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Run GCM -- THIS LINE NEEDS TO BE MODIFIED WITH THE CORRECT GCM EXECUTION COMMAND&lt;br /&gt;
mpirun -np 8 gcm_64x48x26_phystd_para.e &amp;lt; diagfi.def &amp;gt; lrun${numnew}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Check if run ended normaly and copy datafiles&lt;br /&gt;
if [[ ( -r restartfi.nc  &amp;amp;&amp;amp;  -r restart.nc ) ]] ; then&lt;br /&gt;
  echo &amp;quot;Run seems to have ended normaly&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  \mv -f restart.nc start${numnew}.nc&lt;br /&gt;
  \mv -f restartfi.nc startfi${numnew}.nc  &lt;br /&gt;
    &lt;br /&gt;
else&lt;br /&gt;
  if [[ -r num_run ]] ; then&lt;br /&gt;
    \mv -f num_run num_run.crash&lt;br /&gt;
  else&lt;br /&gt;
    echo &amp;quot;No file num_run to build num_run.crash from !!&amp;quot;&lt;br /&gt;
    # Impose a default value of 0 for num_run&lt;br /&gt;
    echo 0 &amp;gt; num_run.crash&lt;br /&gt;
  fi&lt;br /&gt;
 echo 99999 &amp;gt; num_run&lt;br /&gt;
 exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Copy other datafiles that may have been generated&lt;br /&gt;
if [[ -r diagfi.nc ]] ; then&lt;br /&gt;
  \mv -f diagfi.nc diagfi${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -r diagsoil.nc ]] ; then&lt;br /&gt;
  \mv -f diagsoil.nc diagsoil${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -r stats.nc ]] ; then&lt;br /&gt;
  \mv -f stats.nc stats${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -f profiles.dat ]] ; then&lt;br /&gt;
  \mv -f profiles.dat profiles${numnew}.dat&lt;br /&gt;
  \mv -f profiles.hdr profiles${numnew}.hdr&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Prepare things for upcoming runs by writing&lt;br /&gt;
# value of computed season in file num_run&lt;br /&gt;
echo ${numnew} &amp;gt; num_run&lt;br /&gt;
&lt;br /&gt;
# If we are over nummax : stop&lt;br /&gt;
if (( $numnew + 1 &amp;gt; $nummax )) ; then&lt;br /&gt;
   exit&lt;br /&gt;
else&lt;br /&gt;
   \cp -f run_gnome exe_mars&lt;br /&gt;
   ./exe_mars&lt;br /&gt;
fi &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Summary of what this bash script does''':&lt;br /&gt;
&lt;br /&gt;
* It reads the file 'num_run' which contains the step of the simulation. &lt;br /&gt;
If num_run is&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
then the script expects to read start5.nc and startfi5.nc.&lt;br /&gt;
* It modifies start5.nc and startfi5.nc into start.nc and startfi.nc, respectively.&lt;br /&gt;
* It runs the GCM.&lt;br /&gt;
* It modifies restart.nc and restartfi.nc into start6.nc and startfi6.nc&lt;br /&gt;
* It rewrite num_run as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* It restarts the loop until num_run reaches the value (defined in nummax):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visualization software ==&lt;br /&gt;
=== Panoply ===&lt;br /&gt;
Panoply is a user-friendly tool for viewing raw NetCDF data, available here: https://www.giss.nasa.gov/tools/panoply/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Example panoply.png|thumb|Screenshot of panoply showing here LMD Generic results for the exoplanet TRAPPIST-1e]]&lt;br /&gt;
&lt;br /&gt;
=== Planetoplot ===&lt;br /&gt;
&lt;br /&gt;
Planetoplot is a in-house, python based library developped to vizualize LMDG data.&lt;br /&gt;
&lt;br /&gt;
The code and documentation can be found at: https://nbviewer.org/github/aymeric-spiga/planetoplot/blob/master/tutorial/planetoplot_tutorial.ipynb&lt;br /&gt;
&lt;br /&gt;
=== ncview ===&lt;br /&gt;
Command line tool to visualize NetCDF data.&lt;br /&gt;
* Installation on Linux:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt install ncview&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== paraview ===&lt;br /&gt;
=== python scripts ===&lt;br /&gt;
&lt;br /&gt;
The xarray python library is a very good tool to easily load and plot netcdf data.&lt;br /&gt;
&lt;br /&gt;
TBD&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=357</id>
		<title>Tool Box</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=357"/>
				<updated>2022-05-11T10:14:12Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: /* ncview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Pre-processing Tools ==&lt;br /&gt;
=== newstart: a fortran program to modify start files ===&lt;br /&gt;
&lt;br /&gt;
description of Newstart&lt;br /&gt;
&lt;br /&gt;
=== start2archive ===&lt;br /&gt;
=== other third party scripts and tools ===&lt;br /&gt;
&lt;br /&gt;
TO BE COMPLETED&lt;br /&gt;
&lt;br /&gt;
== Post-processing tools ==&lt;br /&gt;
=== zrecast ===&lt;br /&gt;
&lt;br /&gt;
With this program you can recast atmospheric (i.e.: 4D-dimentional longitude-latitude-altitude-time) data from&lt;br /&gt;
GCM outputs (e.g. as given in diagfi.nc files) onto either ''pressure'' or ''altitude'' above ''areoid vertical'' coordinates.&lt;br /&gt;
Since integrating the hydrostatic equation is required to recast the data, the input file must contain surface pressure&lt;br /&gt;
and atmospheric temperature, as well as the ground geopotential.&lt;br /&gt;
If recasting data onto ''pressure'' coordinates, then the output file name is given by the input file name to which ''_P.nc'' will be appened. If recasting data onto altitude above areoid coordinates, then a ''_A.nc'' will be appened.&lt;br /&gt;
&lt;br /&gt;
=== mass stream function ===&lt;br /&gt;
&lt;br /&gt;
The mass stream function (and the total angular momentum) can be computed from a diagfi.nc or a stats.nc, using the '''streamfunction.F90''' script. The script is located at&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
trunk/LMDZ.GENERIC/utilities&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To compile the script, open the ''compile'' file in the same directory and do the following:&lt;br /&gt;
* Replace &amp;quot;pgf90&amp;quot; with your favorite fortran compiler &lt;br /&gt;
* replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/lib&amp;quot; with the lib address and directory that contains your NetCDF library (file ''libnetcdf.a'').&lt;br /&gt;
* Replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/include&amp;quot; with the address of the directory that contains the NetCDF include file (''netcdf.inc'').&lt;br /&gt;
* You can mess with the compiling options but it is not mandatory.&lt;br /&gt;
&lt;br /&gt;
Once the script is compiled, copy it in the same directory as your '''.nc''' file and run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./streamfunction.e&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The script will ask you for the name of your '''.nc''' file, and will run and produce a new '''nameofyourfile_stream.nc''' file.&lt;br /&gt;
&lt;br /&gt;
'''Be careful''' : In this new file, all fields are temporally and zonally averaged.&lt;br /&gt;
&lt;br /&gt;
If you want to use '''python''' instead of '''fortran''', you can take a look at this [https://github.com/aymeric-spiga/dynanalysis repo]. It hosts a tool to perform dynamical analysis of GCM simulations (and therefore, it computes the mass stream function and a lot of other stuff), but it is tailored for Dynamico only. This repo also takes care of recasting (it does the job of both ''zrecast.F90'' and ''streamfunction.F90'')&lt;br /&gt;
&lt;br /&gt;
== Continuing Simulations ==&lt;br /&gt;
&lt;br /&gt;
=== manually ===&lt;br /&gt;
&lt;br /&gt;
At the end of a simulation, the model generates restart files (files 'restart.nc' and 'restartfi.nc') which contain the final state of the model. The 'restart.nc' and 'restartfi.nc' files have the same format as the 'start.nc' and 'startfi.nc' files, respectively. &lt;br /&gt;
&lt;br /&gt;
These files can in fact be used as initial states to continue the simulation, using the following renaming command lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mv restart.nc start.nc&lt;br /&gt;
mv restartfi.nc startfi.nc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Running a simulation with these start files will in fact resume the simulation from where the previous run ended.&lt;br /&gt;
&lt;br /&gt;
=== with bash scripts ===&lt;br /&gt;
&lt;br /&gt;
We have set up very simple bash scripts to automatize the launching of chain simulations. Here is an example of bash script that does the job:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
###########################################################################&lt;br /&gt;
# Script to perform several chained LMD Mars GCM simulations&lt;br /&gt;
# SET HERE the maximum total number of simulations&lt;br /&gt;
&lt;br /&gt;
nummax=100&lt;br /&gt;
&lt;br /&gt;
###########################################################################&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;---------------------------------------------------------&amp;quot;&lt;br /&gt;
echo &amp;quot;STARTING LOOP RUN&amp;quot;&lt;br /&gt;
echo &amp;quot;---------------------------------------------------------&amp;quot;&lt;br /&gt;
&lt;br /&gt;
dir=`pwd`&lt;br /&gt;
machine=`hostname`&lt;br /&gt;
address=`whoami`&lt;br /&gt;
&lt;br /&gt;
# Look for file &amp;quot;num_run&amp;quot; which should contain &lt;br /&gt;
# the value of the previously computed season&lt;br /&gt;
# (defaults to 0 if file &amp;quot;num_run&amp;quot; does not exist)&lt;br /&gt;
if [[ -r num_run ]] ; then&lt;br /&gt;
  echo &amp;quot;found file num_run&amp;quot;&lt;br /&gt;
  numold=`cat num_run`&lt;br /&gt;
else&lt;br /&gt;
  numold=0&lt;br /&gt;
fi&lt;br /&gt;
echo &amp;quot;numold is set to&amp;quot; ${numold}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Set value of current season &lt;br /&gt;
(( numnew = ${numold} + 1 ))&lt;br /&gt;
echo &amp;quot;numnew is set to&amp;quot; ${numnew}&lt;br /&gt;
&lt;br /&gt;
# Look for initialization data files (exit if none found)&lt;br /&gt;
if [[ ( -r start${numold}.nc  &amp;amp;&amp;amp;  -r startfi${numold}.nc ) ]] ; then&lt;br /&gt;
   \cp -f start${numold}.nc start.nc&lt;br /&gt;
   \cp -f startfi${numold}.nc startfi.nc&lt;br /&gt;
else&lt;br /&gt;
   if (( ${numold} == 99999 )) ; then&lt;br /&gt;
    echo &amp;quot;No run because previous run crashed ! (99999 in num_run)&amp;quot;&lt;br /&gt;
    exit&lt;br /&gt;
   else&lt;br /&gt;
   echo &amp;quot;Where is file start&amp;quot;${numold}&amp;quot;.nc??&amp;quot;&lt;br /&gt;
   exit&lt;br /&gt;
   fi&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Run GCM -- THIS LINE NEEDS TO BE MODIFIED WITH THE CORRECT GCM EXECUTION COMMAND&lt;br /&gt;
mpirun -np 8 gcm_64x48x26_phystd_para.e &amp;lt; diagfi.def &amp;gt; lrun${numnew}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Check if run ended normaly and copy datafiles&lt;br /&gt;
if [[ ( -r restartfi.nc  &amp;amp;&amp;amp;  -r restart.nc ) ]] ; then&lt;br /&gt;
  echo &amp;quot;Run seems to have ended normaly&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  \mv -f restart.nc start${numnew}.nc&lt;br /&gt;
  \mv -f restartfi.nc startfi${numnew}.nc  &lt;br /&gt;
    &lt;br /&gt;
else&lt;br /&gt;
  if [[ -r num_run ]] ; then&lt;br /&gt;
    \mv -f num_run num_run.crash&lt;br /&gt;
  else&lt;br /&gt;
    echo &amp;quot;No file num_run to build num_run.crash from !!&amp;quot;&lt;br /&gt;
    # Impose a default value of 0 for num_run&lt;br /&gt;
    echo 0 &amp;gt; num_run.crash&lt;br /&gt;
  fi&lt;br /&gt;
 echo 99999 &amp;gt; num_run&lt;br /&gt;
 exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Copy other datafiles that may have been generated&lt;br /&gt;
if [[ -r diagfi.nc ]] ; then&lt;br /&gt;
  \mv -f diagfi.nc diagfi${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -r diagsoil.nc ]] ; then&lt;br /&gt;
  \mv -f diagsoil.nc diagsoil${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -r stats.nc ]] ; then&lt;br /&gt;
  \mv -f stats.nc stats${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -f profiles.dat ]] ; then&lt;br /&gt;
  \mv -f profiles.dat profiles${numnew}.dat&lt;br /&gt;
  \mv -f profiles.hdr profiles${numnew}.hdr&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Prepare things for upcoming runs by writing&lt;br /&gt;
# value of computed season in file num_run&lt;br /&gt;
echo ${numnew} &amp;gt; num_run&lt;br /&gt;
&lt;br /&gt;
# If we are over nummax : stop&lt;br /&gt;
if (( $numnew + 1 &amp;gt; $nummax )) ; then&lt;br /&gt;
   exit&lt;br /&gt;
else&lt;br /&gt;
   \cp -f run_gnome exe_mars&lt;br /&gt;
   ./exe_mars&lt;br /&gt;
fi &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Summary of what this bash script does''':&lt;br /&gt;
&lt;br /&gt;
* It reads the file 'num_run' which contains the step of the simulation. &lt;br /&gt;
If num_run is&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
then the script expects to read start5.nc and startfi5.nc.&lt;br /&gt;
* It modifies start5.nc and startfi5.nc into start.nc and startfi.nc, respectively.&lt;br /&gt;
* It runs the GCM.&lt;br /&gt;
* It modifies restart.nc and restartfi.nc into start6.nc and startfi6.nc&lt;br /&gt;
* It rewrite num_run as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* It restarts the loop until num_run reaches the value (defined in nummax):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visualization software ==&lt;br /&gt;
=== Panoply ===&lt;br /&gt;
Panoply is a user-friendly tool for viewing raw NetCDF data, available here: https://www.giss.nasa.gov/tools/panoply/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Example panoply.png|thumb|Screenshot of panoply showing here LMD Generic results for the exoplanet TRAPPIST-1e]]&lt;br /&gt;
&lt;br /&gt;
=== Planetoplot ===&lt;br /&gt;
&lt;br /&gt;
Planetoplot is a in-house, python based library developped to vizualize LMDG data.&lt;br /&gt;
&lt;br /&gt;
The code and documentation can be found at: https://nbviewer.org/github/aymeric-spiga/planetoplot/blob/master/tutorial/planetoplot_tutorial.ipynb&lt;br /&gt;
&lt;br /&gt;
=== ncview ===&lt;br /&gt;
Command line tool to visualize NetCDF data.&lt;br /&gt;
* Installation on Linux:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt install ncview&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== paraview ===&lt;br /&gt;
=== python scripts ===&lt;br /&gt;
&lt;br /&gt;
The xarray python library is a very good tool to easily load and plot netcdf data.&lt;br /&gt;
&lt;br /&gt;
TBD&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=The_run.def_Input_File&amp;diff=351</id>
		<title>The run.def Input File</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=The_run.def_Input_File&amp;diff=351"/>
				<updated>2022-05-11T10:04:57Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== The run.def input file and its format ==&lt;br /&gt;
&lt;br /&gt;
The run.def file is a text file that is read at run time by the GCM (and must thus be present in the same directory as the executable).&lt;br /&gt;
It contains the values of various parameters that the user can specify (as &amp;quot;key = value&amp;quot;, where &amp;quot;key&amp;quot; is a predefined keyword and &amp;quot;value&amp;quot; may be a real, an integer, a string or a logical) and modify depending on the specific simulation that is intended, e.g. the line:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
planet_type = generic&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
means that when the GCM will run, it will set parameter ''planet_type'' (which identifies the physics package that is used) to ''generic''.&lt;br /&gt;
&lt;br /&gt;
Any line starting with # is a comment, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Number of days to run model for&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The order in which parameters are given in the run.def file is not important, except if a parameter value is given more than once (not recommended!), then it is the last occurrence that prevails.&lt;br /&gt;
&lt;br /&gt;
Worth knowing about: if a given &amp;quot;key&amp;quot; is not present in the file, then a default value (hard coded in the code) will be used for the related parameter.&lt;br /&gt;
&lt;br /&gt;
== *.def files included in run.def ==&lt;br /&gt;
&lt;br /&gt;
The run.def file can include other files (based on the same format, lines containing &amp;quot;key = value&amp;quot; or comments) using the INCLUDEDEF keyword, e.g.:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
INCLUDEDEF=callphys.def&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is a convenient way to separate related sets of parameters in separate files; common practice is to put dynamics related parameters in '''run.def''' and physics related parameters in '''callphys.def'''&lt;br /&gt;
&lt;br /&gt;
== Reference def files ==&lt;br /&gt;
Reference *.def files are provided in the LMDZ.GENERIC/deftank directory&lt;br /&gt;
&lt;br /&gt;
== Outputted used_*def files ==&lt;br /&gt;
When the GCM run finishes, for each of the input def files *.def, an ASCII output file '''used_*.def''' is generated (in practice these would be '''used_run.def''' and '''used_callphys.def'''). These files contain, along the same format as the *.def input files, the &amp;quot;key = value&amp;quot; that were used, along with comments about whether &amp;quot;value&amp;quot; was read in the input def file or if the code default was used (i.e. the sought &amp;quot;keyword&amp;quot; was not present in the input def files).&lt;br /&gt;
&lt;br /&gt;
[[Category:Inputs]]&lt;br /&gt;
[[Category:WhatIs]]&lt;br /&gt;
&lt;br /&gt;
== Example of ''run.def'' file ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
#----------------------------------------------------------------------- &lt;br /&gt;
#Parametres de controle du run:                                          &lt;br /&gt;
#------------------------------                                          &lt;br /&gt;
&lt;br /&gt;
planet_type = generic&lt;br /&gt;
&lt;br /&gt;
# Nombre de jours d'integration                                         &lt;br /&gt;
     nday=2&lt;br /&gt;
&lt;br /&gt;
# ndynstep overrides&lt;br /&gt;
     ndynstep=-2000&lt;br /&gt;
&lt;br /&gt;
# nombre de pas par jour (multiple de iperiod) ( ici pour  dt = 1 min )      &lt;br /&gt;
 day_step = 480&lt;br /&gt;
&lt;br /&gt;
# periode pour le pas Matsuno (en pas)                                  &lt;br /&gt;
  iperiod=5&lt;br /&gt;
&lt;br /&gt;
# periode de sortie des variables de controle (en pas)                  &lt;br /&gt;
  iconser=120&lt;br /&gt;
&lt;br /&gt;
# periode d'ecriture du fichier histoire (en jour)                      &lt;br /&gt;
    iecri=100&lt;br /&gt;
&lt;br /&gt;
# periode de stockage fichier histmoy (en jour)                         &lt;br /&gt;
 periodav=60.&lt;br /&gt;
&lt;br /&gt;
# periode de la dissipation (en pas)                                    &lt;br /&gt;
  idissip=5&lt;br /&gt;
&lt;br /&gt;
# choix de l'operateur de dissipation (star ou  non star )              &lt;br /&gt;
 lstardis=.true.&lt;br /&gt;
&lt;br /&gt;
# avec ou sans coordonnee hybrides&lt;br /&gt;
 hybrid=.true.&lt;br /&gt;
&lt;br /&gt;
# nombre d'iterations de l'operateur de dissipation   gradiv            &lt;br /&gt;
nitergdiv=1&lt;br /&gt;
&lt;br /&gt;
# nombre d'iterations de l'operateur de dissipation  nxgradrot          &lt;br /&gt;
nitergrot=2&lt;br /&gt;
&lt;br /&gt;
# nombre d'iterations de l'operateur de dissipation  divgrad            &lt;br /&gt;
   niterh=2&lt;br /&gt;
&lt;br /&gt;
# temps de dissipation des plus petites long.d ondes pour u,v (gradiv)  &lt;br /&gt;
 tetagdiv= 3000.&lt;br /&gt;
&lt;br /&gt;
# temps de dissipation des plus petites long.d ondes pour u,v(nxgradrot)&lt;br /&gt;
 tetagrot=9000.&lt;br /&gt;
&lt;br /&gt;
# temps de dissipation des plus petites long.d ondes pour  h ( divgrad) &lt;br /&gt;
 tetatemp=9000.&lt;br /&gt;
&lt;br /&gt;
# coefficient pour gamdissip                                            &lt;br /&gt;
  coefdis=0.&lt;br /&gt;
&lt;br /&gt;
# choix du shema d'integration temporelle (Matsuno ou Matsuno-leapfrog) &lt;br /&gt;
  purmats=.false.&lt;br /&gt;
&lt;br /&gt;
# avec ou sans physique                                                 &lt;br /&gt;
   physic=.true.&lt;br /&gt;
&lt;br /&gt;
# periode de la physique (en pas)                                       &lt;br /&gt;
  iphysiq=10&lt;br /&gt;
&lt;br /&gt;
# choix d'une grille reguliere                                          &lt;br /&gt;
  grireg=.true.&lt;br /&gt;
&lt;br /&gt;
# frequence (en pas) de l'ecriture du fichier diagfi               &lt;br /&gt;
 ecritphy=120&lt;br /&gt;
# ecritphy=10&lt;br /&gt;
&lt;br /&gt;
# longitude en degres du centre du zoom                                 &lt;br /&gt;
   clon=63.&lt;br /&gt;
&lt;br /&gt;
# latitude en degres du centre du zoom                                  &lt;br /&gt;
   clat=0.&lt;br /&gt;
&lt;br /&gt;
# facteur de grossissement du zoom,selon longitude                      &lt;br /&gt;
  grossismx=1.&lt;br /&gt;
&lt;br /&gt;
# facteur de grossissement du zoom ,selon latitude                      &lt;br /&gt;
 grossismy=1.&lt;br /&gt;
&lt;br /&gt;
#  Fonction  f(y)  hyperbolique  si = .true.  , sinon  sinusoidale         &lt;br /&gt;
  fxyhypb=.false.&lt;br /&gt;
&lt;br /&gt;
# extension en longitude  de la zone du zoom  ( fraction de la zone totale)&lt;br /&gt;
   dzoomx= 0.&lt;br /&gt;
&lt;br /&gt;
# extension en latitude de la zone  du zoom  ( fraction de la zone totale)&lt;br /&gt;
   dzoomy=0.&lt;br /&gt;
&lt;br /&gt;
#  raideur du zoom en  X&lt;br /&gt;
    taux=2.&lt;br /&gt;
&lt;br /&gt;
#  raideur du zoom en  Y&lt;br /&gt;
    tauy=2.&lt;br /&gt;
&lt;br /&gt;
#  Fonction  f(y) avec y = Sin(latit.) si = .TRUE. ,  Sinon  y = latit.&lt;br /&gt;
  ysinus= .false.&lt;br /&gt;
&lt;br /&gt;
# Avec sponge layer&lt;br /&gt;
  callsponge  = .true.&lt;br /&gt;
 &lt;br /&gt;
# Sponge:  mode0(u=v=0), mode1(u=umoy,v=0), mode2(u=umoy,v=vmoy)&lt;br /&gt;
  mode_sponge= 2&lt;br /&gt;
&lt;br /&gt;
# Sponge:  hauteur de sponge (km)&lt;br /&gt;
  hsponge= 90&lt;br /&gt;
&lt;br /&gt;
# Sponge:  tetasponge (secondes)&lt;br /&gt;
  tetasponge = 50000&lt;br /&gt;
&lt;br /&gt;
# some definitions for the physics, in file 'callphys.def'&lt;br /&gt;
INCLUDEDEF=callphys.def&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note''': Lines beginning with a hashtag are not read&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Quick_Install_and_Run&amp;diff=342</id>
		<title>Quick Install and Run</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Quick_Install_and_Run&amp;diff=342"/>
				<updated>2022-05-11T10:00:56Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: /* Checking the Results of a Simulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In this page we give a hopefully exhaustive enough overview of the necessary prerequisites and steps to download, compile and run a simple simulation with the GCM in an &amp;quot;Early Mars&amp;quot; setup (i.e. a desert planet with a CO2 atmosphere) on a Linux computer.&lt;br /&gt;
&lt;br /&gt;
Note that there is a dedicated, install script, that attempts to do all these steps (up to and including running the simulation) that you can obtain here: https://web.lmd.jussieu.fr/~lmdz/planets/install_lmdz_generic_earlymars.bash&lt;br /&gt;
Automating the process is not trivial as there are many subtle variants of Linux flavors and user account setups, so the script may fail in your case, but hopefully the information given in this page should help you solve the encountered problems.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites: Tools and Libraries ==&lt;br /&gt;
In order to use (i.e. compile and run) the GCM, one needs to have some tools and installed libraries at hand. We list below a (minimal) set that you should check that is available and/or that you'll need to first install on your machine. By the way we also assume you're on a Linux OS. &lt;br /&gt;
&lt;br /&gt;
===  Fortran compiler ===&lt;br /&gt;
The GCM source code is in Fortran. One thus needs a Fortran compiler to build (compile) the executable.&lt;br /&gt;
The most easily available one (on Linux) is gfortran and examples discussed here will assume it is the one used.&lt;br /&gt;
You can check that you indeed have a gfortran compiler at hand with the following Bash command:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
which gfortran&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
which should return something like&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/usr/bin/gfortran&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Subversion ===&lt;br /&gt;
The source code is managed using subversion (svn), which you'll need to download or update your copy. Leaving aside the subtleties of svn and code organization for now, downloading the code amounts to doing the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
svn checkout http://svn.lmd.jussieu.fr/Planeto/trunk --depth empty&lt;br /&gt;
cd trunk&lt;br /&gt;
svn update LMDZ.COMMON LMDZ.GENERIC&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As a side note: the source code that will be fetched by svn can also be browsed online here: https://trac.lmd.jussieu.fr/Planeto&lt;br /&gt;
&lt;br /&gt;
=== FCM ===&lt;br /&gt;
The FCM (Flexible Configuration Management) tool is a suite of perl scripts to help building and managing codes. We use a slightly modified version which can be obtained using subversion (svn). Ideally you'll want to download it somewhere on your computer once in for all. To do this:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
svn checkout http://forge.ipsl.jussieu.fr/fcm/svn/PATCHED/FCM_V1.2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You'll then need to add the resulting FCM_V1.2/bin to your PATH environment variable so that the command &amp;quot;fcm&amp;quot; may be used from anywhere on your machine. e.g. by adding the following line in your .bashrc:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export PATH=$PATH:$HOME/FCM_V1.2/bin&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Assuming here that the downloaded FCM_V1.2 directory is in your home ($HOME) directory. Adapt accordingly if not.&lt;br /&gt;
&lt;br /&gt;
=== the NetCDF library ===&lt;br /&gt;
The GCM reads and writes input and output files in NetCDF format. Therefore a NetCDF library must be available. As this library is not quite standard you'll probably have to install it yourself on your system. You can use the following home-made &amp;quot;install_netcdf4_hdf5_seq.bash&amp;quot; script to do so:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget -nv --no-check-certificate http://www.lmd.jussieu.fr/~lmdz/pub/import/install_netcdf4_hdf5_seq.bash&lt;br /&gt;
chmod u=rwx install_netcdf4_hdf5_seq.bash&lt;br /&gt;
./install_netcdf4_hdf5_seq.bash &amp;gt; netcdf.log 2&amp;gt;&amp;amp;1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Compiling the library and dependencies takes a while (more than 10 minutes; be patient).&lt;br /&gt;
Once it is done do check file netcdf.log to verify all went well.&lt;br /&gt;
You may want to also add its &amp;quot;bin&amp;quot; directory to your PATH environment variable by adding in your .bashrc a line of:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export PATH=$PATH:$HOME/netcdf/bin&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Assuming here that you have run the &amp;quot;install_netcdf4_hdf5_seq.bash&amp;quot; script in a &amp;quot;netcdf&amp;quot; subdirectory of your home directory. Adapt accordingly if not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As a side note: The NetCDF library provides a very simple command line tool (ncdump) to inspect the contents of NetCDF files, but you'll need more advanced visualization tools (e.g. ncview, Ferret, Panoply, etc. seem further down this page in the &amp;quot;Checking the Results&amp;quot; section).&lt;br /&gt;
&lt;br /&gt;
=== the IOIPSL library ===&lt;br /&gt;
&lt;br /&gt;
The IOIPSL (Input/Output IPSL) library is a library designed to handle both the reading of some input files used by the GCM (the *.def files which are described further below) and the writing of some NetCDF output files.&lt;br /&gt;
&lt;br /&gt;
Scripts to download and install the IOIPSL library can be found in the &amp;quot;ioipsl&amp;quot; subdirectory of the &amp;quot;LMDZ.COMMON&amp;quot; library. Since here we assume we're working with gfortran, the relevant one is &amp;quot;install_ioipsl_gfortran.bash&amp;quot;. If your PATH environment variable is already such that it includes the path to your NetCDF library distribution's bin directory (see previous section) then all you need to do is execute the script:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./install_ioipsl_gfortran.bash&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
If all went well the script should end with:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
OK: ioipsl library is in ...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''(for further details about [[The_IOIPSL_Library|the IOIPSL library]] and installing it, follow the link and/or use the Search Box at the top of this page)''&lt;br /&gt;
&lt;br /&gt;
== GCM Input Datafiles and Datasets ==&lt;br /&gt;
In order to run, the GCM needs some inputs, such as initial conditions (values of state variables), external inputs (e.g. optical properties of aerosols) and simulation setup (e.g. specifications on how long to run, which parametrizations should be activated, etc.)&lt;br /&gt;
&lt;br /&gt;
In the spirit of the illustrative example considered here (an &amp;quot;Early Mars&amp;quot; simulation), a set of necessary input data may be downloaded with:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget -nv --no-check-certificate http://www.lmd.jussieu.fr/~lmdz/planets/generic/bench_earlymars_32x32x15_b32x36.tar.gz&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Once unpacked (&amp;quot;tar xvzf bench_earlymars_32x32x15_b32x36.tar.gz&amp;quot;) the resulting &amp;quot;bench_earlymars_32x32x15_b32x36&amp;quot; will contain all that is needed, namely:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
callphys.def  gases.def  startfi.nc  traceur.def&lt;br /&gt;
datadir/      run.def    start.nc    z2sig.def&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Initial condition NetCDF files ''start.nc'' and ''startfi.nc''; the first containing initial condition values for the dynamics and the second initial condition values for the physics.&lt;br /&gt;
* A '''datadir''' directory containing external inputs (aerosol properties, stellar spectra, etc.)&lt;br /&gt;
* Some ASCII *.def files containing run parameters, namely:&lt;br /&gt;
# ''run.def''' : &amp;quot;master def file&amp;quot; containing main run parameters&lt;br /&gt;
# ''callphys.def'' : file containing flags and keys for the various physics parametrizations&lt;br /&gt;
# ''z2sig.def'' : file describing the sought vertical discretization&lt;br /&gt;
# ''traceur.def'' : file specifying the tracer number and names&lt;br /&gt;
# ''gases.def'' : file specifying the list of gases (main and trace) in the atmosphere&lt;br /&gt;
&lt;br /&gt;
== Compiling the GCM ==&lt;br /&gt;
Now that all the prerequisites are fulfilled, it is time to compile the GCM&lt;br /&gt;
&lt;br /&gt;
=== Prior to a first compilation: ksh to bash conversion ===&lt;br /&gt;
Given that most systems currently use bash (Bourne Again Shell) as their command-line interpreter and not ksh (Korn Shell), a few small changes may need to be made to certain files in the ''LMDZ.COMMON'' directory. Namely, the first line in each of the files ''build_gcm'', ''makelmdz_fcm'' and ''makelmdz'', has to be changed from:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/ksh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
to &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Prior to a first compilation: setting up the target architecture files ===&lt;br /&gt;
Compiling the model is done using a dedicated Bash script ''makelmdz_fcm'' located in the '''LMDZ.COMMON''' directory. This script however relies on ''architecture files''. These files contain information on which compiler to use, what compilation options to use, where relevant libraries are located etc. In practice one must thus create these ASCII text files in the '''arch/''' subdirectory of '''LMDZ.COMMON'''. The naming convention is rather straightforward, when the script ''makelmdz_fcm'' is run with the option '''-arch somename''', it will look for files ''arch/arch-somename.env'', ''arch/arch-somename.path'' and ''arch/arch-somename.fcm''. Leaving aside a detailed description for later (see [[The_Target_Architecture_(&amp;quot;arch&amp;quot;)_Files|this page]]) let us mention here that:&lt;br /&gt;
* the ''arch*.env'' is an optional file containing ''environment'' information, such as setting up environment variables or loading modules on some machines, e.g.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export NETCDF_HOME=/path/to/the/netcdf/distribution&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
An example of an '''arch*.env''' file where &amp;quot;recent&amp;quot; modules (as of May 2022) required for compilation and visualisation are loaded, has been given below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
module purge&lt;br /&gt;
module load GCC/10.3.0  OpenMPI/4.1.1&lt;br /&gt;
module load netCDF-Fortran/4.5.3&lt;br /&gt;
export NETCDF_INCDIR=&amp;quot;/opt/ebsofts/netCDF-Fortran/4.5.3-gompi-2021a/include&amp;quot;&lt;br /&gt;
export NETCDFF_LIBDIR=&amp;quot;/opt/ebsofts/netCDF-Fortran/4.5.3-gompi-2021a/lib&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Note that the last two lines above specify paths to the '''include''' and '''lib''' directories used on this system and will most likely vary from system to system. Likewise, the exact module versions might have to be modified in your specific '''arch*.env''' file.&lt;br /&gt;
* the '''arch*.path''' is a mandatory file containing information relative to external libraries such as NetCDF an IOIPSL, e.g.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ROOT=$PWD&lt;br /&gt;
&lt;br /&gt;
NETCDF_LIBDIR=&amp;quot;-L${NETCDF_HOME}/lib&amp;quot;&lt;br /&gt;
NETCDF_LIB=&amp;quot;-lnetcdf -lnetcdff&amp;quot;&lt;br /&gt;
NETCDF_INCDIR=&amp;quot;-I${NETCDF_HOME}/include&amp;quot;&lt;br /&gt;
&lt;br /&gt;
IOIPSL_INCDIR=&amp;quot;-I$ROOT/../IOIPSL/inc&amp;quot;&lt;br /&gt;
IOIPSL_LIBDIR=&amp;quot;-L$ROOT/../IOIPSL/lib&amp;quot;&lt;br /&gt;
IOIPSL_LIB=&amp;quot;-lioipsl&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Where each library is referenced by a fixed identifier (NETCDF, IOIPSL, XIOS, ...) and 3 trailing strings '''_LIBDIR''', for the path to the library, '''_LIB''', for the library name(s), and '''_INCDIR''' for the path to the library's ''include'' directory.&lt;br /&gt;
&lt;br /&gt;
* the '''arch*.fcm''' is a mandatory file containing information relative to the compiler and compilation options, e.g.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
%COMPILER            gfortran&lt;br /&gt;
%LINK                gfortran&lt;br /&gt;
%AR                  ar&lt;br /&gt;
%MAKE                make&lt;br /&gt;
%FPP_FLAGS           -P -traditional&lt;br /&gt;
%FPP_DEF             NC_DOUBLE&lt;br /&gt;
%BASE_FFLAGS         -c -fdefault-real-8 -fdefault-double-8 -ffree-line-length-none -fno-align-commons&lt;br /&gt;
%PROD_FFLAGS         -O3&lt;br /&gt;
%DEV_FFLAGS          -O&lt;br /&gt;
%DEBUG_FFLAGS        -ffpe-trap=invalid,zero,overflow -fbounds-check -g3 -O0 -fstack-protector-all -finit-real=snan -fbacktrace&lt;br /&gt;
%MPI_FFLAGS&lt;br /&gt;
%OMP_FFLAGS         &lt;br /&gt;
%BASE_LD     &lt;br /&gt;
%MPI_LD&lt;br /&gt;
%OMP_LD              &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Again not going into a detailed description (follow [[The_Target_Architecture_(&amp;quot;arch&amp;quot;)_Files|this link]] for that), just note that each line corresponds to a keyword (starting with &amp;quot;%&amp;quot;) followed by the relevant options, to mention a few of the main ones:&lt;br /&gt;
* %COMPILER: The compiler to use (here gfortran)&lt;br /&gt;
* %BASE_FFLAGS: compiler options (always included)&lt;br /&gt;
* %PROD_FFLAGS: compilation flags to include if makelmdz_fcm is run with the &amp;quot;-prod&amp;quot; option&lt;br /&gt;
* %DEBUG_FFLAGS: compilation flags to include if makelmdz_fcm is run with the &amp;quot;-debug&amp;quot; option&lt;br /&gt;
* %BASE_LD: flags to add at the linking step of the compilation&lt;br /&gt;
&lt;br /&gt;
=== compiling a test case (early Mars) ===&lt;br /&gt;
To compile the GCM at the sought resolution for the Early Mars test case run (in LMDZ.COMMON):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./makelmdz_fcm -arch local -p std -s 2 -d 32x32x15 -b 32x36 gcm &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Where we assume you have generated the '''arch-local.*''' files along the lines of what is suggested in the previous section.&lt;br /&gt;
Let us mention here what the other options to ''makelmdz_fcm'' used here imply:&lt;br /&gt;
* '''-p std''': the GCM will use the &amp;quot;std&amp;quot; physics package (i.e. the generic physics)&lt;br /&gt;
* '''-d 32x32x15''': the GCM grid will be 32x32 in longitude x latitude, with 15 vertical levels.&lt;br /&gt;
* '''-s 2''': the physics parametrizations will handle 2 radiatively active tracers (water ice and dust for the Early Mars setup)&lt;br /&gt;
* '''-b 32x36''': the physics radiative transfer will be done using 32 bands in the IR and 36 in the visible.&lt;br /&gt;
For a glimpse at all the possible ''makelmdz_fcm'' options and their meaning, run&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./makelmdz_fcm -h&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
And/or check the dedicated [[The_makelmdz_fcm_GCM_Compilation_Script|makelmdz_fcm page]].&lt;br /&gt;
&lt;br /&gt;
Upon successful compilation, the executable '''gcm_32x32x15_phystd_seq.e''' should be generated in the '''bin''' subdirectory.&lt;br /&gt;
&lt;br /&gt;
== Running the GCM ==&lt;br /&gt;
To run your first simulation you need to copy (or move) the executable '''gcm_32x32x15_phystd_seq.e''' to the directory containing initial conditions and parameter files, e.g. '''bench_earlymars_32x32x15_b32x36''' and run it.&lt;br /&gt;
This is usually a two-step process, where the (optional) first step is sourcing the environment architecture file (the very same that was used to compile the model), e.g.:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source ../LMDZ.COMMON/arch.env&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The second step is executing the model, e.g.:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./gcm_32x32x15_phystd_seq.e &amp;gt; gcm.out 2&amp;gt;&amp;amp;1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
here the (text) outputs messages are redirected into a text file, '''gcm.out'''; more convenient for later inspection then if there is no redirection and then the outputs will be to the screen.&lt;br /&gt;
&lt;br /&gt;
== Checking the Results of a Simulation ==&lt;br /&gt;
Once the simulation is finished, you'll know that all went well if its last outputs are:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 in abort_gcm&lt;br /&gt;
 Stopping in leapfrog&lt;br /&gt;
 Reason = Simulation finished &lt;br /&gt;
 Everything is cool&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If not, start looking for an error message and a way to fix the problem...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Apart from the text standard outputs messages from the GCM, which are mostly for monitoring and checking that the simulation is proceeding, the user will most likely be more interested in checking the contents of the '''diagfi.nc''' file produced by the GCM, as it contains instantaneous values of the main model variables (atmospheric temperature, winds, etc.).&lt;br /&gt;
&lt;br /&gt;
TO BE COMPLETED WITH SOME ILLUSTRATIVE PLOTS?&lt;br /&gt;
&lt;br /&gt;
Side note: there is a variety of freely available software that can be used to visualize the NetCDF '''diagfi.nc''' file, such as Ferret, Ncview, Panoply, Grads, etc.&lt;br /&gt;
&lt;br /&gt;
== Taking Things to the Next Level ==&lt;br /&gt;
The short tutorial presented in this page is meant to be useful to get an overview of what is required to install and run the GCM. Moving on to a more intensive and problem-specific usage will require diving into additional topics and aspects such as:&lt;br /&gt;
* Selecting the appropriate inputs and run parameters for a given study.&lt;br /&gt;
* Compiling and running in parallel (MPI and/or OpenMP) to obtains results in a reasonable time frame.&lt;br /&gt;
* post-processing and analysis of model outputs.&lt;br /&gt;
All these points and much more are detailed in the many pages of this site (do check out the menu on the left and dare use intensively the site's search engine)&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=329</id>
		<title>Tool Box</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=329"/>
				<updated>2022-05-11T09:46:57Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: /* ncview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Pre-processing Tools ==&lt;br /&gt;
=== newstart ===&lt;br /&gt;
=== start2archive ===&lt;br /&gt;
=== visualization tools ===&lt;br /&gt;
=== other third party scripts and tools ===&lt;br /&gt;
&lt;br /&gt;
TO BE COMPLETED&lt;br /&gt;
&lt;br /&gt;
== Post-processing tools ==&lt;br /&gt;
=== zrecast ===&lt;br /&gt;
&lt;br /&gt;
TO BE COMPLETED&lt;br /&gt;
&lt;br /&gt;
=== mass stream function ===&lt;br /&gt;
&lt;br /&gt;
The mass stream function (and the total angular momentum) can be computed from a diagfi.nc or a stats.nc, using the '''streamfunction.F90''' script. The script is located at&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
trunk/LMDZ.GENERIC/utilities&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To compile the script, open the ''compile'' file in the same directory and do the following:&lt;br /&gt;
* Replace &amp;quot;pgf90&amp;quot; with your favorite fortran compiler &lt;br /&gt;
* replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/lib&amp;quot; with the lib address and directory that contains your NetCDF library (file ''libnetcdf.a'').&lt;br /&gt;
* Replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/include&amp;quot; with the address of the directory that contains the NetCDF include file (''netcdf.inc'').&lt;br /&gt;
* You can mess with the compiling options but it is not mandatory.&lt;br /&gt;
&lt;br /&gt;
Once the script is compiled, copy it in the same directory as your '''.nc''' file and run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./streamfunction.e&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The script will ask you for the name of your '''.nc''' file, and will run and produce a new '''nameofyourfile_stream.nc''' file.&lt;br /&gt;
&lt;br /&gt;
'''Be careful''' : In this new file, all fields are temporally and zonally averaged.&lt;br /&gt;
&lt;br /&gt;
If you want to use '''python''' instead of '''fortran''', you can take a look at this [https://github.com/aymeric-spiga/dynanalysis repo]. It hosts a tool to perform dynamical analysis of GCM simulations (and therefore, it computes the mass stream function and a lot of other stuff), but it is tailored for Dynamico only. This repo also takes care of recasting (it does the job of both ''zrecast.F90'' and ''streamfunction.F90'')&lt;br /&gt;
&lt;br /&gt;
== Continuing Simulations ==&lt;br /&gt;
&lt;br /&gt;
=== manually ===&lt;br /&gt;
&lt;br /&gt;
At the end of a simulation, the model generates restart files (files 'restart.nc' and 'restartfi.nc') which contain the final state of the model. The 'restart.nc' and 'restartfi.nc' files have the same format as the 'start.nc' and 'startfi.nc' files, respectively. &lt;br /&gt;
&lt;br /&gt;
These files can in fact be used as initial states to continue the simulation, using the following renaming command lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mv restart.nc start.nc&lt;br /&gt;
mv restartfi.nc startfi.nc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Running a simulation with these start files will in fact resume the simulation from where the previous run ended.&lt;br /&gt;
&lt;br /&gt;
=== with bash scripts ===&lt;br /&gt;
&lt;br /&gt;
We have set up very simple bash scripts to automatize the launching of chain simulations. Here is an example of bash script that does the job:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
###########################################################################&lt;br /&gt;
# Script to perform several chained LMD Mars GCM simulations&lt;br /&gt;
# SET HERE the maximum total number of simulations&lt;br /&gt;
&lt;br /&gt;
nummax=100&lt;br /&gt;
&lt;br /&gt;
###########################################################################&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;---------------------------------------------------------&amp;quot;&lt;br /&gt;
echo &amp;quot;STARTING LOOP RUN&amp;quot;&lt;br /&gt;
echo &amp;quot;---------------------------------------------------------&amp;quot;&lt;br /&gt;
&lt;br /&gt;
dir=`pwd`&lt;br /&gt;
machine=`hostname`&lt;br /&gt;
address=`whoami`&lt;br /&gt;
&lt;br /&gt;
# Look for file &amp;quot;num_run&amp;quot; which should contain &lt;br /&gt;
# the value of the previously computed season&lt;br /&gt;
# (defaults to 0 if file &amp;quot;num_run&amp;quot; does not exist)&lt;br /&gt;
if [[ -r num_run ]] ; then&lt;br /&gt;
  echo &amp;quot;found file num_run&amp;quot;&lt;br /&gt;
  numold=`cat num_run`&lt;br /&gt;
else&lt;br /&gt;
  numold=0&lt;br /&gt;
fi&lt;br /&gt;
echo &amp;quot;numold is set to&amp;quot; ${numold}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Set value of current season &lt;br /&gt;
(( numnew = ${numold} + 1 ))&lt;br /&gt;
echo &amp;quot;numnew is set to&amp;quot; ${numnew}&lt;br /&gt;
&lt;br /&gt;
# Look for initialization data files (exit if none found)&lt;br /&gt;
if [[ ( -r start${numold}.nc  &amp;amp;&amp;amp;  -r startfi${numold}.nc ) ]] ; then&lt;br /&gt;
   \cp -f start${numold}.nc start.nc&lt;br /&gt;
   \cp -f startfi${numold}.nc startfi.nc&lt;br /&gt;
else&lt;br /&gt;
   if (( ${numold} == 99999 )) ; then&lt;br /&gt;
    echo &amp;quot;No run because previous run crashed ! (99999 in num_run)&amp;quot;&lt;br /&gt;
    exit&lt;br /&gt;
   else&lt;br /&gt;
   echo &amp;quot;Where is file start&amp;quot;${numold}&amp;quot;.nc??&amp;quot;&lt;br /&gt;
   exit&lt;br /&gt;
   fi&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Run GCM -- THIS LINE NEEDS TO BE MODIFIED WITH THE CORRECT GCM EXECUTION COMMAND&lt;br /&gt;
mpirun -np 8 gcm_64x48x26_phystd_para.e &amp;lt; diagfi.def &amp;gt; lrun${numnew}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Check if run ended normaly and copy datafiles&lt;br /&gt;
if [[ ( -r restartfi.nc  &amp;amp;&amp;amp;  -r restart.nc ) ]] ; then&lt;br /&gt;
  echo &amp;quot;Run seems to have ended normaly&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  \mv -f restart.nc start${numnew}.nc&lt;br /&gt;
  \mv -f restartfi.nc startfi${numnew}.nc  &lt;br /&gt;
    &lt;br /&gt;
else&lt;br /&gt;
  if [[ -r num_run ]] ; then&lt;br /&gt;
    \mv -f num_run num_run.crash&lt;br /&gt;
  else&lt;br /&gt;
    echo &amp;quot;No file num_run to build num_run.crash from !!&amp;quot;&lt;br /&gt;
    # Impose a default value of 0 for num_run&lt;br /&gt;
    echo 0 &amp;gt; num_run.crash&lt;br /&gt;
  fi&lt;br /&gt;
 echo 99999 &amp;gt; num_run&lt;br /&gt;
 exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Copy other datafiles that may have been generated&lt;br /&gt;
if [[ -r diagfi.nc ]] ; then&lt;br /&gt;
  \mv -f diagfi.nc diagfi${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -r diagsoil.nc ]] ; then&lt;br /&gt;
  \mv -f diagsoil.nc diagsoil${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -r stats.nc ]] ; then&lt;br /&gt;
  \mv -f stats.nc stats${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -f profiles.dat ]] ; then&lt;br /&gt;
  \mv -f profiles.dat profiles${numnew}.dat&lt;br /&gt;
  \mv -f profiles.hdr profiles${numnew}.hdr&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Prepare things for upcoming runs by writing&lt;br /&gt;
# value of computed season in file num_run&lt;br /&gt;
echo ${numnew} &amp;gt; num_run&lt;br /&gt;
&lt;br /&gt;
# If we are over nummax : stop&lt;br /&gt;
if (( $numnew + 1 &amp;gt; $nummax )) ; then&lt;br /&gt;
   exit&lt;br /&gt;
else&lt;br /&gt;
   \cp -f run_gnome exe_mars&lt;br /&gt;
   ./exe_mars&lt;br /&gt;
fi &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Summary of what this bash script does''':&lt;br /&gt;
&lt;br /&gt;
* It reads the file 'num_run' which contains the step of the simulation. &lt;br /&gt;
If num_run is&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
then the script expects to read start5.nc and startfi5.nc.&lt;br /&gt;
* It modifies start5.nc and startfi5.nc into start.nc and startfi.nc, respectively.&lt;br /&gt;
* It runs the GCM.&lt;br /&gt;
* It modifies restart.nc and restartfi.nc into start6.nc and startfi6.nc&lt;br /&gt;
* It rewrite num_run as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* It restarts the loop until num_run reaches the value (defined in nummax):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visualization software ==&lt;br /&gt;
=== Panoply ===&lt;br /&gt;
Panoply is a user-friendly tool for viewing raw NetCDF data, available here: https://www.giss.nasa.gov/tools/panoply/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Example panoply.png|thumb|Screenshot of panoply showing here LMD Generic results for the exoplanet TRAPPIST-1e]]&lt;br /&gt;
&lt;br /&gt;
=== Planetoplot ===&lt;br /&gt;
&lt;br /&gt;
Planetoplot is a in-house, python based library developped to vizualize LMDG data.&lt;br /&gt;
&lt;br /&gt;
The code and documentation can be found at: https://nbviewer.org/github/aymeric-spiga/planetoplot/blob/master/tutorial/planetoplot_tutorial.ipynb&lt;br /&gt;
&lt;br /&gt;
=== ncview ===&lt;br /&gt;
Command line tool to visualize NetCDF data.&lt;br /&gt;
* Installation on Linux:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt install ncview&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Installation on Mac:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== paraview ===&lt;br /&gt;
=== planetoplot ===&lt;br /&gt;
=== python scripts ===&lt;br /&gt;
&lt;br /&gt;
The xarray python library is a very good tool to easily load and plot netcdf data.&lt;br /&gt;
&lt;br /&gt;
TBD&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=328</id>
		<title>Tool Box</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=328"/>
				<updated>2022-05-11T09:46:21Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: /* ncview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Pre-processing Tools ==&lt;br /&gt;
=== newstart ===&lt;br /&gt;
=== start2archive ===&lt;br /&gt;
=== visualization tools ===&lt;br /&gt;
=== other third party scripts and tools ===&lt;br /&gt;
&lt;br /&gt;
TO BE COMPLETED&lt;br /&gt;
&lt;br /&gt;
== Post-processing tools ==&lt;br /&gt;
=== zrecast ===&lt;br /&gt;
&lt;br /&gt;
TO BE COMPLETED&lt;br /&gt;
&lt;br /&gt;
=== mass stream function ===&lt;br /&gt;
&lt;br /&gt;
The mass stream function (and the total angular momentum) can be computed from a diagfi.nc or a stats.nc, using the '''streamfunction.F90''' script. The script is located at&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
trunk/LMDZ.GENERIC/utilities&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To compile the script, open the ''compile'' file in the same directory and do the following:&lt;br /&gt;
* Replace &amp;quot;pgf90&amp;quot; with your favorite fortran compiler &lt;br /&gt;
* replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/lib&amp;quot; with the lib address and directory that contains your NetCDF library (file ''libnetcdf.a'').&lt;br /&gt;
* Replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/include&amp;quot; with the address of the directory that contains the NetCDF include file (''netcdf.inc'').&lt;br /&gt;
* You can mess with the compiling options but it is not mandatory.&lt;br /&gt;
&lt;br /&gt;
Once the script is compiled, copy it in the same directory as your '''.nc''' file and run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./streamfunction.e&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The script will ask you for the name of your '''.nc''' file, and will run and produce a new '''nameofyourfile_stream.nc''' file.&lt;br /&gt;
&lt;br /&gt;
'''Be careful''' : In this new file, all fields are temporally and zonally averaged.&lt;br /&gt;
&lt;br /&gt;
If you want to use '''python''' instead of '''fortran''', you can take a look at this [https://github.com/aymeric-spiga/dynanalysis repo]. It hosts a tool to perform dynamical analysis of GCM simulations (and therefore, it computes the mass stream function and a lot of other stuff), but it is tailored for Dynamico only. This repo also takes care of recasting (it does the job of both ''zrecast.F90'' and ''streamfunction.F90'')&lt;br /&gt;
&lt;br /&gt;
== Continuing Simulations ==&lt;br /&gt;
&lt;br /&gt;
=== manually ===&lt;br /&gt;
&lt;br /&gt;
At the end of a simulation, the model generates restart files (files 'restart.nc' and 'restartfi.nc') which contain the final state of the model. The 'restart.nc' and 'restartfi.nc' files have the same format as the 'start.nc' and 'startfi.nc' files, respectively. &lt;br /&gt;
&lt;br /&gt;
These files can in fact be used as initial states to continue the simulation, using the following renaming command lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mv restart.nc start.nc&lt;br /&gt;
mv restartfi.nc startfi.nc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Running a simulation with these start files will in fact resume the simulation from where the previous run ended.&lt;br /&gt;
&lt;br /&gt;
=== with bash scripts ===&lt;br /&gt;
&lt;br /&gt;
We have set up very simple bash scripts to automatize the launching of chain simulations. Here is an example of bash script that does the job:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
###########################################################################&lt;br /&gt;
# Script to perform several chained LMD Mars GCM simulations&lt;br /&gt;
# SET HERE the maximum total number of simulations&lt;br /&gt;
&lt;br /&gt;
nummax=100&lt;br /&gt;
&lt;br /&gt;
###########################################################################&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;---------------------------------------------------------&amp;quot;&lt;br /&gt;
echo &amp;quot;STARTING LOOP RUN&amp;quot;&lt;br /&gt;
echo &amp;quot;---------------------------------------------------------&amp;quot;&lt;br /&gt;
&lt;br /&gt;
dir=`pwd`&lt;br /&gt;
machine=`hostname`&lt;br /&gt;
address=`whoami`&lt;br /&gt;
&lt;br /&gt;
# Look for file &amp;quot;num_run&amp;quot; which should contain &lt;br /&gt;
# the value of the previously computed season&lt;br /&gt;
# (defaults to 0 if file &amp;quot;num_run&amp;quot; does not exist)&lt;br /&gt;
if [[ -r num_run ]] ; then&lt;br /&gt;
  echo &amp;quot;found file num_run&amp;quot;&lt;br /&gt;
  numold=`cat num_run`&lt;br /&gt;
else&lt;br /&gt;
  numold=0&lt;br /&gt;
fi&lt;br /&gt;
echo &amp;quot;numold is set to&amp;quot; ${numold}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Set value of current season &lt;br /&gt;
(( numnew = ${numold} + 1 ))&lt;br /&gt;
echo &amp;quot;numnew is set to&amp;quot; ${numnew}&lt;br /&gt;
&lt;br /&gt;
# Look for initialization data files (exit if none found)&lt;br /&gt;
if [[ ( -r start${numold}.nc  &amp;amp;&amp;amp;  -r startfi${numold}.nc ) ]] ; then&lt;br /&gt;
   \cp -f start${numold}.nc start.nc&lt;br /&gt;
   \cp -f startfi${numold}.nc startfi.nc&lt;br /&gt;
else&lt;br /&gt;
   if (( ${numold} == 99999 )) ; then&lt;br /&gt;
    echo &amp;quot;No run because previous run crashed ! (99999 in num_run)&amp;quot;&lt;br /&gt;
    exit&lt;br /&gt;
   else&lt;br /&gt;
   echo &amp;quot;Where is file start&amp;quot;${numold}&amp;quot;.nc??&amp;quot;&lt;br /&gt;
   exit&lt;br /&gt;
   fi&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Run GCM -- THIS LINE NEEDS TO BE MODIFIED WITH THE CORRECT GCM EXECUTION COMMAND&lt;br /&gt;
mpirun -np 8 gcm_64x48x26_phystd_para.e &amp;lt; diagfi.def &amp;gt; lrun${numnew}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Check if run ended normaly and copy datafiles&lt;br /&gt;
if [[ ( -r restartfi.nc  &amp;amp;&amp;amp;  -r restart.nc ) ]] ; then&lt;br /&gt;
  echo &amp;quot;Run seems to have ended normaly&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  \mv -f restart.nc start${numnew}.nc&lt;br /&gt;
  \mv -f restartfi.nc startfi${numnew}.nc  &lt;br /&gt;
    &lt;br /&gt;
else&lt;br /&gt;
  if [[ -r num_run ]] ; then&lt;br /&gt;
    \mv -f num_run num_run.crash&lt;br /&gt;
  else&lt;br /&gt;
    echo &amp;quot;No file num_run to build num_run.crash from !!&amp;quot;&lt;br /&gt;
    # Impose a default value of 0 for num_run&lt;br /&gt;
    echo 0 &amp;gt; num_run.crash&lt;br /&gt;
  fi&lt;br /&gt;
 echo 99999 &amp;gt; num_run&lt;br /&gt;
 exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Copy other datafiles that may have been generated&lt;br /&gt;
if [[ -r diagfi.nc ]] ; then&lt;br /&gt;
  \mv -f diagfi.nc diagfi${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -r diagsoil.nc ]] ; then&lt;br /&gt;
  \mv -f diagsoil.nc diagsoil${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -r stats.nc ]] ; then&lt;br /&gt;
  \mv -f stats.nc stats${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -f profiles.dat ]] ; then&lt;br /&gt;
  \mv -f profiles.dat profiles${numnew}.dat&lt;br /&gt;
  \mv -f profiles.hdr profiles${numnew}.hdr&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Prepare things for upcoming runs by writing&lt;br /&gt;
# value of computed season in file num_run&lt;br /&gt;
echo ${numnew} &amp;gt; num_run&lt;br /&gt;
&lt;br /&gt;
# If we are over nummax : stop&lt;br /&gt;
if (( $numnew + 1 &amp;gt; $nummax )) ; then&lt;br /&gt;
   exit&lt;br /&gt;
else&lt;br /&gt;
   \cp -f run_gnome exe_mars&lt;br /&gt;
   ./exe_mars&lt;br /&gt;
fi &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Summary of what this bash script does''':&lt;br /&gt;
&lt;br /&gt;
* It reads the file 'num_run' which contains the step of the simulation. &lt;br /&gt;
If num_run is&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
then the script expects to read start5.nc and startfi5.nc.&lt;br /&gt;
* It modifies start5.nc and startfi5.nc into start.nc and startfi.nc, respectively.&lt;br /&gt;
* It runs the GCM.&lt;br /&gt;
* It modifies restart.nc and restartfi.nc into start6.nc and startfi6.nc&lt;br /&gt;
* It rewrite num_run as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* It restarts the loop until num_run reaches the value (defined in nummax):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Visualization software ==&lt;br /&gt;
=== Panoply ===&lt;br /&gt;
Panoply is a user-friendly tool for viewing raw NetCDF data, available here: https://www.giss.nasa.gov/tools/panoply/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Example panoply.png|thumb|Screenshot of panoply showing here LMD Generic results for the exoplanet TRAPPIST-1e]]&lt;br /&gt;
&lt;br /&gt;
=== Planetoplot ===&lt;br /&gt;
&lt;br /&gt;
Planetoplot is a in-house, python based library developped to vizualize LMDG data.&lt;br /&gt;
&lt;br /&gt;
The code and documentation can be found at: https://nbviewer.org/github/aymeric-spiga/planetoplot/blob/master/tutorial/planetoplot_tutorial.ipynb&lt;br /&gt;
&lt;br /&gt;
=== ncview ===&lt;br /&gt;
Command line tool to visualize NetCDF data.&lt;br /&gt;
Installation on Linux:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt install ncview&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== paraview ===&lt;br /&gt;
=== planetoplot ===&lt;br /&gt;
=== python scripts ===&lt;br /&gt;
&lt;br /&gt;
The xarray python library is a very good tool to easily load and plot netcdf data.&lt;br /&gt;
&lt;br /&gt;
TBD&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=The_z2sig.def_Input_File&amp;diff=318</id>
		<title>The z2sig.def Input File</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=The_z2sig.def_Input_File&amp;diff=318"/>
				<updated>2022-05-11T09:26:48Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: /* Example of z2sig.def file: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The z2sig.def file contains the pseudo-altitudes (in km) at which the user wants to set the vertical levels. Note that levels should be unevenly spread, with a higher resolution near the surface in order to capture the rapid variations of variables there. It is recommended to use the altitude levels as set in the ''z2sig.def'' file provided in the ''deftank'' directory.&lt;br /&gt;
&lt;br /&gt;
== Example of ''z2sig.def'' file: ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
8                       H: atmospheric scale height (km) (used as a reference only)&lt;br /&gt;
0.004                   Typical pseudo-altitude (m) for 1st layer (z=H*log(sigma))&lt;br /&gt;
0.017415589434569632    ,, ,, ,, ,, ,, ,, ,, ,, ,, 2nd layer, etc...&lt;br /&gt;
0.04197041134830409&lt;br /&gt;
0.09573548831202484&lt;br /&gt;
0.19905425549248695&lt;br /&gt;
0.37769312558816376&lt;br /&gt;
0.6610287582071787&lt;br /&gt;
1.0796026837077486&lt;br /&gt;
1.6625722655258326&lt;br /&gt;
2.4354958342473516&lt;br /&gt;
3.4187160120951323&lt;br /&gt;
4.626429653543951&lt;br /&gt;
6.066400344124698&lt;br /&gt;
7.740192276155182&lt;br /&gt;
9.643775222138789&lt;br /&gt;
11.768354425931134&lt;br /&gt;
14.10130177147987&lt;br /&gt;
17.&lt;br /&gt;
20.&lt;br /&gt;
23.&lt;br /&gt;
26.5&lt;br /&gt;
30.&lt;br /&gt;
34.&lt;br /&gt;
38.&lt;br /&gt;
42.&lt;br /&gt;
47.&lt;br /&gt;
52.&lt;br /&gt;
60.&lt;br /&gt;
68.&lt;br /&gt;
76.&lt;br /&gt;
82.&lt;br /&gt;
88.&lt;br /&gt;
94.&lt;br /&gt;
100.&lt;br /&gt;
105.&lt;br /&gt;
110.&lt;br /&gt;
115.&lt;br /&gt;
120.&lt;br /&gt;
125.&lt;br /&gt;
130.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note''': Lines beginning with a hashtag are not read&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=The_z2sig.def_Input_File&amp;diff=316</id>
		<title>The z2sig.def Input File</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=The_z2sig.def_Input_File&amp;diff=316"/>
				<updated>2022-05-11T09:25:40Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The z2sig.def file contains the pseudo-altitudes (in km) at which the user wants to set the vertical levels. Note that levels should be unevenly spread, with a higher resolution near the surface in order to capture the rapid variations of variables there. It is recommended to use the altitude levels as set in the ''z2sig.def'' file provided in the ''deftank'' directory.&lt;br /&gt;
&lt;br /&gt;
== Example of ''z2sig.def'' file: ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
8&lt;br /&gt;
0.004&lt;br /&gt;
0.017415589434569632&lt;br /&gt;
0.04197041134830409&lt;br /&gt;
0.09573548831202484&lt;br /&gt;
0.19905425549248695&lt;br /&gt;
0.37769312558816376&lt;br /&gt;
0.6610287582071787&lt;br /&gt;
1.0796026837077486&lt;br /&gt;
1.6625722655258326&lt;br /&gt;
2.4354958342473516&lt;br /&gt;
3.4187160120951323&lt;br /&gt;
4.626429653543951&lt;br /&gt;
6.066400344124698&lt;br /&gt;
7.740192276155182&lt;br /&gt;
9.643775222138789&lt;br /&gt;
11.768354425931134&lt;br /&gt;
14.10130177147987&lt;br /&gt;
17.&lt;br /&gt;
20.&lt;br /&gt;
23.&lt;br /&gt;
26.5&lt;br /&gt;
30.&lt;br /&gt;
34.&lt;br /&gt;
38.&lt;br /&gt;
42.&lt;br /&gt;
47.&lt;br /&gt;
52.&lt;br /&gt;
60.&lt;br /&gt;
68.&lt;br /&gt;
76.&lt;br /&gt;
82.&lt;br /&gt;
88.&lt;br /&gt;
94.&lt;br /&gt;
100.&lt;br /&gt;
105.&lt;br /&gt;
110.&lt;br /&gt;
115.&lt;br /&gt;
120.&lt;br /&gt;
125.&lt;br /&gt;
130.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note''': Lines beginning with a hashtag are not read&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=The_callphys.def_Input_File&amp;diff=315</id>
		<title>The callphys.def Input File</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=The_callphys.def_Input_File&amp;diff=315"/>
				<updated>2022-05-11T09:23:37Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The ''callphys.def'' file (along the same format as the ''run.def'' file) contains parameter/value sets for the physics.&lt;br /&gt;
&lt;br /&gt;
== Example of ''callphys.def'' file ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
## Orbit / general options&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# Run with or without tracer transport ?&lt;br /&gt;
tracer    = .true.&lt;br /&gt;
# Diurnal cycle ?  if diurnal=false, diurnally averaged solar heating&lt;br /&gt;
diurnal   = .true.&lt;br /&gt;
# Seasonal cycle ? if season=false, Ls stays constant, to value set in &amp;quot;start&amp;quot;&lt;br /&gt;
season    = .true. &lt;br /&gt;
# Tidally resonant orbit ? must have diurnal=false, correct rotation rate in newstart&lt;br /&gt;
tlocked   = .false.&lt;br /&gt;
# Tidal resonance ratio ? ratio T_orbit to T_rotation&lt;br /&gt;
nres      = 1&lt;br /&gt;
# Write some more output on the screen ?&lt;br /&gt;
lwrite    = .false.&lt;br /&gt;
# Save statistics in file &amp;quot;stats.nc&amp;quot; ?&lt;br /&gt;
callstats = .false.&lt;br /&gt;
# Test energy conservation of model physics ?&lt;br /&gt;
enertest  = .false.&lt;br /&gt;
# Check to see if cpp, mugaz values used match gas mixture defined in gases.def (recommended) ?&lt;br /&gt;
check_cpp_match=.false.&lt;br /&gt;
&lt;br /&gt;
## Radiative transfer options&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# call radiative transfer?&lt;br /&gt;
callrad    = .true.&lt;br /&gt;
# the rad. transfer is computed every &amp;quot;iradia&amp;quot; physical timestep&lt;br /&gt;
iradia     = 4&lt;br /&gt;
# call multilayer correlated-k radiative transfer ?&lt;br /&gt;
corrk      = .true.&lt;br /&gt;
# Include continuum absorption in radiative transfer (note CO2 is treated separately) ?&lt;br /&gt;
continuum  = .true.&lt;br /&gt;
# folder in which correlated-k data is stored ?&lt;br /&gt;
#corrkdir   = CO2_H2Ovar&lt;br /&gt;
corrkdir   = Earth_JL13_extend&lt;br /&gt;
#corrkdir   = corrk_H2O-N2_extend&lt;br /&gt;
# call visible gaseous absorption in radiative transfer ?&lt;br /&gt;
callgasvis = .true.&lt;br /&gt;
# Include Rayleigh scattering in the visible ?&lt;br /&gt;
rayleigh   = .true.&lt;br /&gt;
# Characteristic planetary equilibrium (black body) temperature&lt;br /&gt;
# This is used only in the aerosol radiative transfer setup. (see aerave.F)&lt;br /&gt;
tplanet    = 215.&lt;br /&gt;
# Output spectral OLR in 1D/3D?&lt;br /&gt;
specOLR    = .false.&lt;br /&gt;
# Output global radiative balance in file 'rad_bal.out' - slow for 1D!!&lt;br /&gt;
meanOLR    = .true.&lt;br /&gt;
# Variable gas species: Radiatively active ?&lt;br /&gt;
varactive  = .true.&lt;br /&gt;
# Variable gas species: Fixed vertical distribution ?&lt;br /&gt;
varfixed   = .false.&lt;br /&gt;
# Variable gas species: Saturation percentage value at ground ?&lt;br /&gt;
satval     = 0.0&lt;br /&gt;
&lt;br /&gt;
## Star type&lt;br /&gt;
## ~~~~~~~~~&lt;br /&gt;
startype = 1&lt;br /&gt;
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# The choices are:&lt;br /&gt;
#&lt;br /&gt;
#	startype = 1		Sol        (G2V-class main sequence)&lt;br /&gt;
#	startype = 2		Ad Leo     (M-class, synthetic)&lt;br /&gt;
#       startype = 3            GJ644&lt;br /&gt;
#       startype = 4            HD128167&lt;br /&gt;
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# Stellar flux at 1 AU. Examples:&lt;br /&gt;
# 1366.0 W m-2		Sol today&lt;br /&gt;
# 1024.5 W m-2		Sol today x 0.75 = weak Sun 3.8 GYa&lt;br /&gt;
# 18.462 W m-2		The feeble GJ581&lt;br /&gt;
# 19.960 W m-2		GJ581 with e=0.38 orbital average&lt;br /&gt;
Fat1AU = 1300&lt;br /&gt;
&lt;br /&gt;
## Tracer and aerosol options &lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# Gravitational sedimentation of tracers (KEEP FALSE FOR NOW) ?&lt;br /&gt;
sedimentation = .false.&lt;br /&gt;
&lt;br /&gt;
## Other physics options&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# call turbulent vertical diffusion ?&lt;br /&gt;
calldifv = .true.&lt;br /&gt;
# use turbdiff instead of vdifc ?&lt;br /&gt;
UseTurbDiff = .true.&lt;br /&gt;
# call convective adjustment ?&lt;br /&gt;
calladj  = .true.&lt;br /&gt;
# call thermal conduction in the soil ?&lt;br /&gt;
callsoil = .true.&lt;br /&gt;
&lt;br /&gt;
#########################################################################&lt;br /&gt;
## extra non-standard definitions for Early Mars&lt;br /&gt;
#########################################################################&lt;br /&gt;
&lt;br /&gt;
## Tracer and aerosol options &lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# Radiatively active CO2 aerosol?&lt;br /&gt;
aeroco2       = .true.&lt;br /&gt;
# Fixed CO2 aerosol distribution?&lt;br /&gt;
aerofixco2    = .false.&lt;br /&gt;
# Radiatively active water aerosol?&lt;br /&gt;
aeroh2o       = .true.&lt;br /&gt;
# Fixed water aerosol distribution?&lt;br /&gt;
aerofixh2o  = .false.&lt;br /&gt;
# basic dust opacity&lt;br /&gt;
dusttau       = 0.0&lt;br /&gt;
# Varying H2O cloud fraction?&lt;br /&gt;
CLFvarying    = .false.&lt;br /&gt;
# H2O cloud fraction?&lt;br /&gt;
CLFfixval     = 0.5&lt;br /&gt;
# fixed radii for cloud particles?&lt;br /&gt;
radfixed=.false.&lt;br /&gt;
# number mixing ratio of CO2 ice particles&lt;br /&gt;
Nmix_co2      = 1.E5&lt;br /&gt;
# number mixing ratio of water particles (for rafixed=.false.)&lt;br /&gt;
Nmix_h2o      = 4.e6&lt;br /&gt;
# number mixing ratio of water ice particles (for rafixed=.false.)&lt;br /&gt;
Nmix_h2o_ice      = 2.e4&lt;br /&gt;
# radius of H2O water particles (for rafixed=.true.):&lt;br /&gt;
rad_h2o=10.e-6&lt;br /&gt;
# radius of H2O ice particles (for rafixed=.true.):&lt;br /&gt;
rad_h2o_ice=35.e-6&lt;br /&gt;
# atm mass update due to tracer evaporation/condensation?&lt;br /&gt;
mass_redistrib = .false.&lt;br /&gt;
&lt;br /&gt;
## Water options &lt;br /&gt;
## ~~~~~~~~~~~~~&lt;br /&gt;
# Model water cycle&lt;br /&gt;
water         = .true.&lt;br /&gt;
# Model water cloud formation&lt;br /&gt;
watercond     = .true.&lt;br /&gt;
# Model water precipitation (including coagulation etc.)&lt;br /&gt;
waterrain     = .true.&lt;br /&gt;
# Use simple precipitation scheme?&lt;br /&gt;
precip_scheme=4&lt;br /&gt;
# multiplicative constant in Boucher 95 precip scheme&lt;br /&gt;
Cboucher=1.&lt;br /&gt;
# Include hydrology ?&lt;br /&gt;
hydrology     = .true.&lt;br /&gt;
# H2O snow (and ice) albedo ?&lt;br /&gt;
albedosnow    = 0.5&lt;br /&gt;
# Maximum sea ice thickness ?&lt;br /&gt;
maxicethick   = 0.05&lt;br /&gt;
# Freezing point of seawater (degrees C) ?&lt;br /&gt;
Tsaldiff      = 0.0&lt;br /&gt;
# Evolve surface water sources ?&lt;br /&gt;
sourceevol    = .false.&lt;br /&gt;
# Ice evolution timestep ?&lt;br /&gt;
icetstep      = 10&lt;br /&gt;
&lt;br /&gt;
# Use slab-ocean ?&lt;br /&gt;
ok_slab_ocean = .true.&lt;br /&gt;
# Use heat transport for the ocean ? (Do not use it because it is not parallel)&lt;br /&gt;
ok_slab_heat_transp = .false.&lt;br /&gt;
&lt;br /&gt;
## CO2 options &lt;br /&gt;
## ~~~~~~~~~~~&lt;br /&gt;
# gas is non-ideal CO2 ?&lt;br /&gt;
nonideal      = .false.&lt;br /&gt;
# call CO2 condensation ?&lt;br /&gt;
co2cond       = .true.&lt;br /&gt;
# Set initial temperature profile to 1 K above CO2 condensation everywhere?&lt;br /&gt;
nearco2cond   = .false.&lt;br /&gt;
# adress for spectroscopic file&lt;br /&gt;
datadir = datadir&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note''': Lines beginning with a hashtag are not read&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=The_callphys.def_Input_File&amp;diff=314</id>
		<title>The callphys.def Input File</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=The_callphys.def_Input_File&amp;diff=314"/>
				<updated>2022-05-11T09:21:51Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Example of ''callphys.def'' file ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
## Orbit / general options&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# Run with or without tracer transport ?&lt;br /&gt;
tracer    = .true.&lt;br /&gt;
# Diurnal cycle ?  if diurnal=false, diurnally averaged solar heating&lt;br /&gt;
diurnal   = .true.&lt;br /&gt;
# Seasonal cycle ? if season=false, Ls stays constant, to value set in &amp;quot;start&amp;quot;&lt;br /&gt;
season    = .true. &lt;br /&gt;
# Tidally resonant orbit ? must have diurnal=false, correct rotation rate in newstart&lt;br /&gt;
tlocked   = .false.&lt;br /&gt;
# Tidal resonance ratio ? ratio T_orbit to T_rotation&lt;br /&gt;
nres      = 1&lt;br /&gt;
# Write some more output on the screen ?&lt;br /&gt;
lwrite    = .false.&lt;br /&gt;
# Save statistics in file &amp;quot;stats.nc&amp;quot; ?&lt;br /&gt;
callstats = .false.&lt;br /&gt;
# Test energy conservation of model physics ?&lt;br /&gt;
enertest  = .false.&lt;br /&gt;
# Check to see if cpp, mugaz values used match gas mixture defined in gases.def (recommended) ?&lt;br /&gt;
check_cpp_match=.false.&lt;br /&gt;
&lt;br /&gt;
## Radiative transfer options&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# call radiative transfer?&lt;br /&gt;
callrad    = .true.&lt;br /&gt;
# the rad. transfer is computed every &amp;quot;iradia&amp;quot; physical timestep&lt;br /&gt;
iradia     = 4&lt;br /&gt;
# call multilayer correlated-k radiative transfer ?&lt;br /&gt;
corrk      = .true.&lt;br /&gt;
# Include continuum absorption in radiative transfer (note CO2 is treated separately) ?&lt;br /&gt;
continuum  = .true.&lt;br /&gt;
# folder in which correlated-k data is stored ?&lt;br /&gt;
#corrkdir   = CO2_H2Ovar&lt;br /&gt;
corrkdir   = Earth_JL13_extend&lt;br /&gt;
#corrkdir   = corrk_H2O-N2_extend&lt;br /&gt;
# call visible gaseous absorption in radiative transfer ?&lt;br /&gt;
callgasvis = .true.&lt;br /&gt;
# Include Rayleigh scattering in the visible ?&lt;br /&gt;
rayleigh   = .true.&lt;br /&gt;
# Characteristic planetary equilibrium (black body) temperature&lt;br /&gt;
# This is used only in the aerosol radiative transfer setup. (see aerave.F)&lt;br /&gt;
tplanet    = 215.&lt;br /&gt;
# Output spectral OLR in 1D/3D?&lt;br /&gt;
specOLR    = .false.&lt;br /&gt;
# Output global radiative balance in file 'rad_bal.out' - slow for 1D!!&lt;br /&gt;
meanOLR    = .true.&lt;br /&gt;
# Variable gas species: Radiatively active ?&lt;br /&gt;
varactive  = .true.&lt;br /&gt;
# Variable gas species: Fixed vertical distribution ?&lt;br /&gt;
varfixed   = .false.&lt;br /&gt;
# Variable gas species: Saturation percentage value at ground ?&lt;br /&gt;
satval     = 0.0&lt;br /&gt;
&lt;br /&gt;
## Star type&lt;br /&gt;
## ~~~~~~~~~&lt;br /&gt;
startype = 1&lt;br /&gt;
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# The choices are:&lt;br /&gt;
#&lt;br /&gt;
#	startype = 1		Sol        (G2V-class main sequence)&lt;br /&gt;
#	startype = 2		Ad Leo     (M-class, synthetic)&lt;br /&gt;
#       startype = 3            GJ644&lt;br /&gt;
#       startype = 4            HD128167&lt;br /&gt;
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# Stellar flux at 1 AU. Examples:&lt;br /&gt;
# 1366.0 W m-2		Sol today&lt;br /&gt;
# 1024.5 W m-2		Sol today x 0.75 = weak Sun 3.8 GYa&lt;br /&gt;
# 18.462 W m-2		The feeble GJ581&lt;br /&gt;
# 19.960 W m-2		GJ581 with e=0.38 orbital average&lt;br /&gt;
Fat1AU = 1300&lt;br /&gt;
&lt;br /&gt;
## Tracer and aerosol options &lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# Gravitational sedimentation of tracers (KEEP FALSE FOR NOW) ?&lt;br /&gt;
sedimentation = .false.&lt;br /&gt;
&lt;br /&gt;
## Other physics options&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# call turbulent vertical diffusion ?&lt;br /&gt;
calldifv = .true.&lt;br /&gt;
# use turbdiff instead of vdifc ?&lt;br /&gt;
UseTurbDiff = .true.&lt;br /&gt;
# call convective adjustment ?&lt;br /&gt;
calladj  = .true.&lt;br /&gt;
# call thermal conduction in the soil ?&lt;br /&gt;
callsoil = .true.&lt;br /&gt;
&lt;br /&gt;
#########################################################################&lt;br /&gt;
## extra non-standard definitions for Early Mars&lt;br /&gt;
#########################################################################&lt;br /&gt;
&lt;br /&gt;
## Tracer and aerosol options &lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# Radiatively active CO2 aerosol?&lt;br /&gt;
aeroco2       = .true.&lt;br /&gt;
# Fixed CO2 aerosol distribution?&lt;br /&gt;
aerofixco2    = .false.&lt;br /&gt;
# Radiatively active water aerosol?&lt;br /&gt;
aeroh2o       = .true.&lt;br /&gt;
# Fixed water aerosol distribution?&lt;br /&gt;
aerofixh2o  = .false.&lt;br /&gt;
# basic dust opacity&lt;br /&gt;
dusttau       = 0.0&lt;br /&gt;
# Varying H2O cloud fraction?&lt;br /&gt;
CLFvarying    = .false.&lt;br /&gt;
# H2O cloud fraction?&lt;br /&gt;
CLFfixval     = 0.5&lt;br /&gt;
# fixed radii for cloud particles?&lt;br /&gt;
radfixed=.false.&lt;br /&gt;
# number mixing ratio of CO2 ice particles&lt;br /&gt;
Nmix_co2      = 1.E5&lt;br /&gt;
# number mixing ratio of water particles (for rafixed=.false.)&lt;br /&gt;
Nmix_h2o      = 4.e6&lt;br /&gt;
# number mixing ratio of water ice particles (for rafixed=.false.)&lt;br /&gt;
Nmix_h2o_ice      = 2.e4&lt;br /&gt;
# radius of H2O water particles (for rafixed=.true.):&lt;br /&gt;
rad_h2o=10.e-6&lt;br /&gt;
# radius of H2O ice particles (for rafixed=.true.):&lt;br /&gt;
rad_h2o_ice=35.e-6&lt;br /&gt;
# atm mass update due to tracer evaporation/condensation?&lt;br /&gt;
mass_redistrib = .false.&lt;br /&gt;
&lt;br /&gt;
## Water options &lt;br /&gt;
## ~~~~~~~~~~~~~&lt;br /&gt;
# Model water cycle&lt;br /&gt;
water         = .true.&lt;br /&gt;
# Model water cloud formation&lt;br /&gt;
watercond     = .true.&lt;br /&gt;
# Model water precipitation (including coagulation etc.)&lt;br /&gt;
waterrain     = .true.&lt;br /&gt;
# Use simple precipitation scheme?&lt;br /&gt;
precip_scheme=4&lt;br /&gt;
# multiplicative constant in Boucher 95 precip scheme&lt;br /&gt;
Cboucher=1.&lt;br /&gt;
# Include hydrology ?&lt;br /&gt;
hydrology     = .true.&lt;br /&gt;
# H2O snow (and ice) albedo ?&lt;br /&gt;
albedosnow    = 0.5&lt;br /&gt;
# Maximum sea ice thickness ?&lt;br /&gt;
maxicethick   = 0.05&lt;br /&gt;
# Freezing point of seawater (degrees C) ?&lt;br /&gt;
Tsaldiff      = 0.0&lt;br /&gt;
# Evolve surface water sources ?&lt;br /&gt;
sourceevol    = .false.&lt;br /&gt;
# Ice evolution timestep ?&lt;br /&gt;
icetstep      = 10&lt;br /&gt;
&lt;br /&gt;
# Use slab-ocean ?&lt;br /&gt;
ok_slab_ocean = .true.&lt;br /&gt;
# Use heat transport for the ocean ? (Do not use it because it is not parallel)&lt;br /&gt;
ok_slab_heat_transp = .false.&lt;br /&gt;
&lt;br /&gt;
## CO2 options &lt;br /&gt;
## ~~~~~~~~~~~&lt;br /&gt;
# gas is non-ideal CO2 ?&lt;br /&gt;
nonideal      = .false.&lt;br /&gt;
# call CO2 condensation ?&lt;br /&gt;
co2cond       = .true.&lt;br /&gt;
# Set initial temperature profile to 1 K above CO2 condensation everywhere?&lt;br /&gt;
nearco2cond   = .false.&lt;br /&gt;
# adress for spectroscopic file&lt;br /&gt;
datadir = datadir&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note''': Lines beginning with a hashtag are not read&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=The_diagfi.def_Input_File&amp;diff=313</id>
		<title>The diagfi.def Input File</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=The_diagfi.def_Input_File&amp;diff=313"/>
				<updated>2022-05-11T09:21:08Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Example of ''diagfi.def'' file ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
aire&lt;br /&gt;
altitude&lt;br /&gt;
ap&lt;br /&gt;
aps&lt;br /&gt;
ASR&lt;br /&gt;
ASRcs&lt;br /&gt;
beta&lt;br /&gt;
bp&lt;br /&gt;
bps&lt;br /&gt;
CLF&lt;br /&gt;
CLFt&lt;br /&gt;
controle&lt;br /&gt;
Declin&lt;br /&gt;
dt_ekman1&lt;br /&gt;
dt_ekman2&lt;br /&gt;
dt_diff1&lt;br /&gt;
dt_diff2&lt;br /&gt;
DYN&lt;br /&gt;
evap_surf_flux&lt;br /&gt;
fluxsurf_rad&lt;br /&gt;
GND&lt;br /&gt;
h2o_ice&lt;br /&gt;
h2o_ice_col&lt;br /&gt;
h2o_ice_surf&lt;br /&gt;
h2o_vap&lt;br /&gt;
h2o_vap_col&lt;br /&gt;
h2o_vap_surf&lt;br /&gt;
H2Oice_reffcol&lt;br /&gt;
ISR&lt;br /&gt;
latentFlux&lt;br /&gt;
latitude&lt;br /&gt;
longitude&lt;br /&gt;
Ls&lt;br /&gt;
Lss&lt;br /&gt;
mass_evap_col&lt;br /&gt;
OLR&lt;br /&gt;
OLRcs&lt;br /&gt;
p&lt;br /&gt;
pctsrf_sic&lt;br /&gt;
phisinit&lt;br /&gt;
ps&lt;br /&gt;
RA&lt;br /&gt;
rain&lt;br /&gt;
reevap&lt;br /&gt;
RH&lt;br /&gt;
rnat&lt;br /&gt;
sea_ice&lt;br /&gt;
sensibFlux&lt;br /&gt;
shad&lt;br /&gt;
snow&lt;br /&gt;
soildepth&lt;br /&gt;
tau_col&lt;br /&gt;
temp&lt;br /&gt;
Time&lt;br /&gt;
Tsat&lt;br /&gt;
tsea_ice&lt;br /&gt;
tslab1&lt;br /&gt;
tslab2&lt;br /&gt;
tsurf&lt;br /&gt;
u&lt;br /&gt;
v&lt;br /&gt;
w&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note''': Lines beginning with a hashtag are not read&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=The_gases.def_Input_File&amp;diff=312</id>
		<title>The gases.def Input File</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=The_gases.def_Input_File&amp;diff=312"/>
				<updated>2022-05-11T09:20:33Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
A typical gases.def file for the Earth case:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# gases&lt;br /&gt;
3&lt;br /&gt;
N2_&lt;br /&gt;
CO2&lt;br /&gt;
H2O&lt;br /&gt;
0.999611900E+00&lt;br /&gt;
0.375999962E-03&lt;br /&gt;
-1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# First line is number of gases&lt;br /&gt;
# Followed by gas names (always 3 characters)&lt;br /&gt;
# and then mixing ratios.&lt;br /&gt;
# mixing ratio -1 means the gas is variable.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note''': Lines beginning with a hashtag are not read&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Technical aspects ==&lt;br /&gt;
In the code this file is read by ....&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=The_z2sig.def_Input_File&amp;diff=311</id>
		<title>The z2sig.def Input File</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=The_z2sig.def_Input_File&amp;diff=311"/>
				<updated>2022-05-11T09:20:08Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Example of ''z2sig.def'' file: ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
8&lt;br /&gt;
0.004&lt;br /&gt;
0.017415589434569632&lt;br /&gt;
0.04197041134830409&lt;br /&gt;
0.09573548831202484&lt;br /&gt;
0.19905425549248695&lt;br /&gt;
0.37769312558816376&lt;br /&gt;
0.6610287582071787&lt;br /&gt;
1.0796026837077486&lt;br /&gt;
1.6625722655258326&lt;br /&gt;
2.4354958342473516&lt;br /&gt;
3.4187160120951323&lt;br /&gt;
4.626429653543951&lt;br /&gt;
6.066400344124698&lt;br /&gt;
7.740192276155182&lt;br /&gt;
9.643775222138789&lt;br /&gt;
11.768354425931134&lt;br /&gt;
14.10130177147987&lt;br /&gt;
17.&lt;br /&gt;
20.&lt;br /&gt;
23.&lt;br /&gt;
26.5&lt;br /&gt;
30.&lt;br /&gt;
34.&lt;br /&gt;
38.&lt;br /&gt;
42.&lt;br /&gt;
47.&lt;br /&gt;
52.&lt;br /&gt;
60.&lt;br /&gt;
68.&lt;br /&gt;
76.&lt;br /&gt;
82.&lt;br /&gt;
88.&lt;br /&gt;
94.&lt;br /&gt;
100.&lt;br /&gt;
105.&lt;br /&gt;
110.&lt;br /&gt;
115.&lt;br /&gt;
120.&lt;br /&gt;
125.&lt;br /&gt;
130.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note''': Lines beginning with a hashtag are not read&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=The_callphys.def_Input_File&amp;diff=310</id>
		<title>The callphys.def Input File</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=The_callphys.def_Input_File&amp;diff=310"/>
				<updated>2022-05-11T09:18:50Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Example of ''callphys.def'' file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
## Orbit / general options&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# Run with or without tracer transport ?&lt;br /&gt;
tracer    = .true.&lt;br /&gt;
# Diurnal cycle ?  if diurnal=false, diurnally averaged solar heating&lt;br /&gt;
diurnal   = .true.&lt;br /&gt;
# Seasonal cycle ? if season=false, Ls stays constant, to value set in &amp;quot;start&amp;quot;&lt;br /&gt;
season    = .true. &lt;br /&gt;
# Tidally resonant orbit ? must have diurnal=false, correct rotation rate in newstart&lt;br /&gt;
tlocked   = .false.&lt;br /&gt;
# Tidal resonance ratio ? ratio T_orbit to T_rotation&lt;br /&gt;
nres      = 1&lt;br /&gt;
# Write some more output on the screen ?&lt;br /&gt;
lwrite    = .false.&lt;br /&gt;
# Save statistics in file &amp;quot;stats.nc&amp;quot; ?&lt;br /&gt;
callstats = .false.&lt;br /&gt;
# Test energy conservation of model physics ?&lt;br /&gt;
enertest  = .false.&lt;br /&gt;
# Check to see if cpp, mugaz values used match gas mixture defined in gases.def (recommended) ?&lt;br /&gt;
check_cpp_match=.false.&lt;br /&gt;
&lt;br /&gt;
## Radiative transfer options&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# call radiative transfer?&lt;br /&gt;
callrad    = .true.&lt;br /&gt;
# the rad. transfer is computed every &amp;quot;iradia&amp;quot; physical timestep&lt;br /&gt;
iradia     = 4&lt;br /&gt;
# call multilayer correlated-k radiative transfer ?&lt;br /&gt;
corrk      = .true.&lt;br /&gt;
# Include continuum absorption in radiative transfer (note CO2 is treated separately) ?&lt;br /&gt;
continuum  = .true.&lt;br /&gt;
# folder in which correlated-k data is stored ?&lt;br /&gt;
#corrkdir   = CO2_H2Ovar&lt;br /&gt;
corrkdir   = Earth_JL13_extend&lt;br /&gt;
#corrkdir   = corrk_H2O-N2_extend&lt;br /&gt;
# call visible gaseous absorption in radiative transfer ?&lt;br /&gt;
callgasvis = .true.&lt;br /&gt;
# Include Rayleigh scattering in the visible ?&lt;br /&gt;
rayleigh   = .true.&lt;br /&gt;
# Characteristic planetary equilibrium (black body) temperature&lt;br /&gt;
# This is used only in the aerosol radiative transfer setup. (see aerave.F)&lt;br /&gt;
tplanet    = 215.&lt;br /&gt;
# Output spectral OLR in 1D/3D?&lt;br /&gt;
specOLR    = .false.&lt;br /&gt;
# Output global radiative balance in file 'rad_bal.out' - slow for 1D!!&lt;br /&gt;
meanOLR    = .true.&lt;br /&gt;
# Variable gas species: Radiatively active ?&lt;br /&gt;
varactive  = .true.&lt;br /&gt;
# Variable gas species: Fixed vertical distribution ?&lt;br /&gt;
varfixed   = .false.&lt;br /&gt;
# Variable gas species: Saturation percentage value at ground ?&lt;br /&gt;
satval     = 0.0&lt;br /&gt;
&lt;br /&gt;
## Star type&lt;br /&gt;
## ~~~~~~~~~&lt;br /&gt;
startype = 1&lt;br /&gt;
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# The choices are:&lt;br /&gt;
#&lt;br /&gt;
#	startype = 1		Sol        (G2V-class main sequence)&lt;br /&gt;
#	startype = 2		Ad Leo     (M-class, synthetic)&lt;br /&gt;
#       startype = 3            GJ644&lt;br /&gt;
#       startype = 4            HD128167&lt;br /&gt;
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# Stellar flux at 1 AU. Examples:&lt;br /&gt;
# 1366.0 W m-2		Sol today&lt;br /&gt;
# 1024.5 W m-2		Sol today x 0.75 = weak Sun 3.8 GYa&lt;br /&gt;
# 18.462 W m-2		The feeble GJ581&lt;br /&gt;
# 19.960 W m-2		GJ581 with e=0.38 orbital average&lt;br /&gt;
Fat1AU = 1300&lt;br /&gt;
&lt;br /&gt;
## Tracer and aerosol options &lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# Gravitational sedimentation of tracers (KEEP FALSE FOR NOW) ?&lt;br /&gt;
sedimentation = .false.&lt;br /&gt;
&lt;br /&gt;
## Other physics options&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# call turbulent vertical diffusion ?&lt;br /&gt;
calldifv = .true.&lt;br /&gt;
# use turbdiff instead of vdifc ?&lt;br /&gt;
UseTurbDiff = .true.&lt;br /&gt;
# call convective adjustment ?&lt;br /&gt;
calladj  = .true.&lt;br /&gt;
# call thermal conduction in the soil ?&lt;br /&gt;
callsoil = .true.&lt;br /&gt;
&lt;br /&gt;
#########################################################################&lt;br /&gt;
## extra non-standard definitions for Early Mars&lt;br /&gt;
#########################################################################&lt;br /&gt;
&lt;br /&gt;
## Tracer and aerosol options &lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# Radiatively active CO2 aerosol?&lt;br /&gt;
aeroco2       = .true.&lt;br /&gt;
# Fixed CO2 aerosol distribution?&lt;br /&gt;
aerofixco2    = .false.&lt;br /&gt;
# Radiatively active water aerosol?&lt;br /&gt;
aeroh2o       = .true.&lt;br /&gt;
# Fixed water aerosol distribution?&lt;br /&gt;
aerofixh2o  = .false.&lt;br /&gt;
# basic dust opacity&lt;br /&gt;
dusttau       = 0.0&lt;br /&gt;
# Varying H2O cloud fraction?&lt;br /&gt;
CLFvarying    = .false.&lt;br /&gt;
# H2O cloud fraction?&lt;br /&gt;
CLFfixval     = 0.5&lt;br /&gt;
# fixed radii for cloud particles?&lt;br /&gt;
radfixed=.false.&lt;br /&gt;
# number mixing ratio of CO2 ice particles&lt;br /&gt;
Nmix_co2      = 1.E5&lt;br /&gt;
# number mixing ratio of water particles (for rafixed=.false.)&lt;br /&gt;
Nmix_h2o      = 4.e6&lt;br /&gt;
# number mixing ratio of water ice particles (for rafixed=.false.)&lt;br /&gt;
Nmix_h2o_ice      = 2.e4&lt;br /&gt;
# radius of H2O water particles (for rafixed=.true.):&lt;br /&gt;
rad_h2o=10.e-6&lt;br /&gt;
# radius of H2O ice particles (for rafixed=.true.):&lt;br /&gt;
rad_h2o_ice=35.e-6&lt;br /&gt;
# atm mass update due to tracer evaporation/condensation?&lt;br /&gt;
mass_redistrib = .false.&lt;br /&gt;
&lt;br /&gt;
## Water options &lt;br /&gt;
## ~~~~~~~~~~~~~&lt;br /&gt;
# Model water cycle&lt;br /&gt;
water         = .true.&lt;br /&gt;
# Model water cloud formation&lt;br /&gt;
watercond     = .true.&lt;br /&gt;
# Model water precipitation (including coagulation etc.)&lt;br /&gt;
waterrain     = .true.&lt;br /&gt;
# Use simple precipitation scheme?&lt;br /&gt;
precip_scheme=4&lt;br /&gt;
# multiplicative constant in Boucher 95 precip scheme&lt;br /&gt;
Cboucher=1.&lt;br /&gt;
# Include hydrology ?&lt;br /&gt;
hydrology     = .true.&lt;br /&gt;
# H2O snow (and ice) albedo ?&lt;br /&gt;
albedosnow    = 0.5&lt;br /&gt;
# Maximum sea ice thickness ?&lt;br /&gt;
maxicethick   = 0.05&lt;br /&gt;
# Freezing point of seawater (degrees C) ?&lt;br /&gt;
Tsaldiff      = 0.0&lt;br /&gt;
# Evolve surface water sources ?&lt;br /&gt;
sourceevol    = .false.&lt;br /&gt;
# Ice evolution timestep ?&lt;br /&gt;
icetstep      = 10&lt;br /&gt;
&lt;br /&gt;
# Use slab-ocean ?&lt;br /&gt;
ok_slab_ocean = .true.&lt;br /&gt;
# Use heat transport for the ocean ? (Do not use it because it is not parallel)&lt;br /&gt;
ok_slab_heat_transp = .false.&lt;br /&gt;
&lt;br /&gt;
## CO2 options &lt;br /&gt;
## ~~~~~~~~~~~&lt;br /&gt;
# gas is non-ideal CO2 ?&lt;br /&gt;
nonideal      = .false.&lt;br /&gt;
# call CO2 condensation ?&lt;br /&gt;
co2cond       = .true.&lt;br /&gt;
# Set initial temperature profile to 1 K above CO2 condensation everywhere?&lt;br /&gt;
nearco2cond   = .false.&lt;br /&gt;
# adress for spectroscopic file&lt;br /&gt;
datadir = datadir&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note''': Lines beginning with a hashtag are not read&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=The_z2sig.def_Input_File&amp;diff=307</id>
		<title>The z2sig.def Input File</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=The_z2sig.def_Input_File&amp;diff=307"/>
				<updated>2022-05-11T09:10:04Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Example of ''z2sig.def'' file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
8&lt;br /&gt;
0.004&lt;br /&gt;
0.017415589434569632&lt;br /&gt;
0.04197041134830409&lt;br /&gt;
0.09573548831202484&lt;br /&gt;
0.19905425549248695&lt;br /&gt;
0.37769312558816376&lt;br /&gt;
0.6610287582071787&lt;br /&gt;
1.0796026837077486&lt;br /&gt;
1.6625722655258326&lt;br /&gt;
2.4354958342473516&lt;br /&gt;
3.4187160120951323&lt;br /&gt;
4.626429653543951&lt;br /&gt;
6.066400344124698&lt;br /&gt;
7.740192276155182&lt;br /&gt;
9.643775222138789&lt;br /&gt;
11.768354425931134&lt;br /&gt;
14.10130177147987&lt;br /&gt;
17.&lt;br /&gt;
20.&lt;br /&gt;
23.&lt;br /&gt;
26.5&lt;br /&gt;
30.&lt;br /&gt;
34.&lt;br /&gt;
38.&lt;br /&gt;
42.&lt;br /&gt;
47.&lt;br /&gt;
52.&lt;br /&gt;
60.&lt;br /&gt;
68.&lt;br /&gt;
76.&lt;br /&gt;
82.&lt;br /&gt;
88.&lt;br /&gt;
94.&lt;br /&gt;
100.&lt;br /&gt;
105.&lt;br /&gt;
110.&lt;br /&gt;
115.&lt;br /&gt;
120.&lt;br /&gt;
125.&lt;br /&gt;
130.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=The_callphys.def_Input_File&amp;diff=303</id>
		<title>The callphys.def Input File</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=The_callphys.def_Input_File&amp;diff=303"/>
				<updated>2022-05-11T09:08:16Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Example of ''callphys.def'' file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
## Orbit / general options&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# Run with or without tracer transport ?&lt;br /&gt;
tracer    = .true.&lt;br /&gt;
# Diurnal cycle ?  if diurnal=false, diurnally averaged solar heating&lt;br /&gt;
diurnal   = .true.&lt;br /&gt;
# Seasonal cycle ? if season=false, Ls stays constant, to value set in &amp;quot;start&amp;quot;&lt;br /&gt;
season    = .true. &lt;br /&gt;
# Tidally resonant orbit ? must have diurnal=false, correct rotation rate in newstart&lt;br /&gt;
tlocked   = .false.&lt;br /&gt;
# Tidal resonance ratio ? ratio T_orbit to T_rotation&lt;br /&gt;
nres      = 1&lt;br /&gt;
# Write some more output on the screen ?&lt;br /&gt;
lwrite    = .false.&lt;br /&gt;
# Save statistics in file &amp;quot;stats.nc&amp;quot; ?&lt;br /&gt;
callstats = .false.&lt;br /&gt;
# Test energy conservation of model physics ?&lt;br /&gt;
enertest  = .false.&lt;br /&gt;
# Check to see if cpp, mugaz values used match gas mixture defined in gases.def (recommended) ?&lt;br /&gt;
check_cpp_match=.false.&lt;br /&gt;
&lt;br /&gt;
## Radiative transfer options&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# call radiative transfer?&lt;br /&gt;
callrad    = .true.&lt;br /&gt;
# the rad. transfer is computed every &amp;quot;iradia&amp;quot; physical timestep&lt;br /&gt;
iradia     = 4&lt;br /&gt;
# call multilayer correlated-k radiative transfer ?&lt;br /&gt;
corrk      = .true.&lt;br /&gt;
# Include continuum absorption in radiative transfer (note CO2 is treated separately) ?&lt;br /&gt;
continuum  = .true.&lt;br /&gt;
# folder in which correlated-k data is stored ?&lt;br /&gt;
#corrkdir   = CO2_H2Ovar&lt;br /&gt;
corrkdir   = Earth_JL13_extend&lt;br /&gt;
#corrkdir   = corrk_H2O-N2_extend&lt;br /&gt;
# call visible gaseous absorption in radiative transfer ?&lt;br /&gt;
callgasvis = .true.&lt;br /&gt;
# Include Rayleigh scattering in the visible ?&lt;br /&gt;
rayleigh   = .true.&lt;br /&gt;
# Characteristic planetary equilibrium (black body) temperature&lt;br /&gt;
# This is used only in the aerosol radiative transfer setup. (see aerave.F)&lt;br /&gt;
tplanet    = 215.&lt;br /&gt;
# Output spectral OLR in 1D/3D?&lt;br /&gt;
specOLR    = .false.&lt;br /&gt;
# Output global radiative balance in file 'rad_bal.out' - slow for 1D!!&lt;br /&gt;
meanOLR    = .true.&lt;br /&gt;
# Variable gas species: Radiatively active ?&lt;br /&gt;
varactive  = .true.&lt;br /&gt;
# Variable gas species: Fixed vertical distribution ?&lt;br /&gt;
varfixed   = .false.&lt;br /&gt;
# Variable gas species: Saturation percentage value at ground ?&lt;br /&gt;
satval     = 0.0&lt;br /&gt;
&lt;br /&gt;
## Star type&lt;br /&gt;
## ~~~~~~~~~&lt;br /&gt;
startype = 1&lt;br /&gt;
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# The choices are:&lt;br /&gt;
#&lt;br /&gt;
#	startype = 1		Sol        (G2V-class main sequence)&lt;br /&gt;
#	startype = 2		Ad Leo     (M-class, synthetic)&lt;br /&gt;
#       startype = 3            GJ644&lt;br /&gt;
#       startype = 4            HD128167&lt;br /&gt;
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# Stellar flux at 1 AU. Examples:&lt;br /&gt;
# 1366.0 W m-2		Sol today&lt;br /&gt;
# 1024.5 W m-2		Sol today x 0.75 = weak Sun 3.8 GYa&lt;br /&gt;
# 18.462 W m-2		The feeble GJ581&lt;br /&gt;
# 19.960 W m-2		GJ581 with e=0.38 orbital average&lt;br /&gt;
Fat1AU = 1300&lt;br /&gt;
&lt;br /&gt;
## Tracer and aerosol options &lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# Gravitational sedimentation of tracers (KEEP FALSE FOR NOW) ?&lt;br /&gt;
sedimentation = .false.&lt;br /&gt;
&lt;br /&gt;
## Other physics options&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# call turbulent vertical diffusion ?&lt;br /&gt;
calldifv = .true.&lt;br /&gt;
# use turbdiff instead of vdifc ?&lt;br /&gt;
UseTurbDiff = .true.&lt;br /&gt;
# call convective adjustment ?&lt;br /&gt;
calladj  = .true.&lt;br /&gt;
# call thermal conduction in the soil ?&lt;br /&gt;
callsoil = .true.&lt;br /&gt;
&lt;br /&gt;
#########################################################################&lt;br /&gt;
## extra non-standard definitions for Early Mars&lt;br /&gt;
#########################################################################&lt;br /&gt;
&lt;br /&gt;
## Tracer and aerosol options &lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# Radiatively active CO2 aerosol?&lt;br /&gt;
aeroco2       = .true.&lt;br /&gt;
# Fixed CO2 aerosol distribution?&lt;br /&gt;
aerofixco2    = .false.&lt;br /&gt;
# Radiatively active water aerosol?&lt;br /&gt;
aeroh2o       = .true.&lt;br /&gt;
# Fixed water aerosol distribution?&lt;br /&gt;
aerofixh2o  = .false.&lt;br /&gt;
# basic dust opacity&lt;br /&gt;
dusttau       = 0.0&lt;br /&gt;
# Varying H2O cloud fraction?&lt;br /&gt;
CLFvarying    = .false.&lt;br /&gt;
# H2O cloud fraction?&lt;br /&gt;
CLFfixval     = 0.5&lt;br /&gt;
# fixed radii for cloud particles?&lt;br /&gt;
radfixed=.false.&lt;br /&gt;
# number mixing ratio of CO2 ice particles&lt;br /&gt;
Nmix_co2      = 1.E5&lt;br /&gt;
# number mixing ratio of water particles (for rafixed=.false.)&lt;br /&gt;
Nmix_h2o      = 4.e6&lt;br /&gt;
# number mixing ratio of water ice particles (for rafixed=.false.)&lt;br /&gt;
Nmix_h2o_ice      = 2.e4&lt;br /&gt;
# radius of H2O water particles (for rafixed=.true.):&lt;br /&gt;
rad_h2o=10.e-6&lt;br /&gt;
# radius of H2O ice particles (for rafixed=.true.):&lt;br /&gt;
rad_h2o_ice=35.e-6&lt;br /&gt;
# atm mass update due to tracer evaporation/condensation?&lt;br /&gt;
mass_redistrib = .false.&lt;br /&gt;
&lt;br /&gt;
## Water options &lt;br /&gt;
## ~~~~~~~~~~~~~&lt;br /&gt;
# Model water cycle&lt;br /&gt;
water         = .true.&lt;br /&gt;
# Model water cloud formation&lt;br /&gt;
watercond     = .true.&lt;br /&gt;
# Model water precipitation (including coagulation etc.)&lt;br /&gt;
waterrain     = .true.&lt;br /&gt;
# Use simple precipitation scheme?&lt;br /&gt;
precip_scheme=4&lt;br /&gt;
# multiplicative constant in Boucher 95 precip scheme&lt;br /&gt;
Cboucher=1.&lt;br /&gt;
# Include hydrology ?&lt;br /&gt;
hydrology     = .true.&lt;br /&gt;
# H2O snow (and ice) albedo ?&lt;br /&gt;
albedosnow    = 0.5&lt;br /&gt;
# Maximum sea ice thickness ?&lt;br /&gt;
maxicethick   = 0.05&lt;br /&gt;
# Freezing point of seawater (degrees C) ?&lt;br /&gt;
Tsaldiff      = 0.0&lt;br /&gt;
# Evolve surface water sources ?&lt;br /&gt;
sourceevol    = .false.&lt;br /&gt;
# Ice evolution timestep ?&lt;br /&gt;
icetstep      = 10&lt;br /&gt;
&lt;br /&gt;
# Use slab-ocean ?&lt;br /&gt;
ok_slab_ocean = .true.&lt;br /&gt;
# Use heat transport for the ocean ? (Do not use it because it is not parallel)&lt;br /&gt;
ok_slab_heat_transp = .false.&lt;br /&gt;
&lt;br /&gt;
## CO2 options &lt;br /&gt;
## ~~~~~~~~~~~&lt;br /&gt;
# gas is non-ideal CO2 ?&lt;br /&gt;
nonideal      = .false.&lt;br /&gt;
# call CO2 condensation ?&lt;br /&gt;
co2cond       = .true.&lt;br /&gt;
# Set initial temperature profile to 1 K above CO2 condensation everywhere?&lt;br /&gt;
nearco2cond   = .false.&lt;br /&gt;
# adress for spectroscopic file&lt;br /&gt;
datadir = datadir&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=The_diagfi.def_Input_File&amp;diff=302</id>
		<title>The diagfi.def Input File</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=The_diagfi.def_Input_File&amp;diff=302"/>
				<updated>2022-05-11T09:06:26Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Example of ''diagfi.def'' file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
aire&lt;br /&gt;
altitude&lt;br /&gt;
ap&lt;br /&gt;
aps&lt;br /&gt;
ASR&lt;br /&gt;
ASRcs&lt;br /&gt;
beta&lt;br /&gt;
bp&lt;br /&gt;
bps&lt;br /&gt;
CLF&lt;br /&gt;
CLFt&lt;br /&gt;
controle&lt;br /&gt;
Declin&lt;br /&gt;
dt_ekman1&lt;br /&gt;
dt_ekman2&lt;br /&gt;
dt_diff1&lt;br /&gt;
dt_diff2&lt;br /&gt;
DYN&lt;br /&gt;
evap_surf_flux&lt;br /&gt;
fluxsurf_rad&lt;br /&gt;
GND&lt;br /&gt;
h2o_ice&lt;br /&gt;
h2o_ice_col&lt;br /&gt;
h2o_ice_surf&lt;br /&gt;
h2o_vap&lt;br /&gt;
h2o_vap_col&lt;br /&gt;
h2o_vap_surf&lt;br /&gt;
H2Oice_reffcol&lt;br /&gt;
ISR&lt;br /&gt;
latentFlux&lt;br /&gt;
latitude&lt;br /&gt;
longitude&lt;br /&gt;
Ls&lt;br /&gt;
Lss&lt;br /&gt;
mass_evap_col&lt;br /&gt;
OLR&lt;br /&gt;
OLRcs&lt;br /&gt;
p&lt;br /&gt;
pctsrf_sic&lt;br /&gt;
phisinit&lt;br /&gt;
ps&lt;br /&gt;
RA&lt;br /&gt;
rain&lt;br /&gt;
reevap&lt;br /&gt;
RH&lt;br /&gt;
rnat&lt;br /&gt;
sea_ice&lt;br /&gt;
sensibFlux&lt;br /&gt;
shad&lt;br /&gt;
snow&lt;br /&gt;
soildepth&lt;br /&gt;
tau_col&lt;br /&gt;
temp&lt;br /&gt;
Time&lt;br /&gt;
Tsat&lt;br /&gt;
tsea_ice&lt;br /&gt;
tslab1&lt;br /&gt;
tslab2&lt;br /&gt;
tsurf&lt;br /&gt;
u&lt;br /&gt;
v&lt;br /&gt;
w&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Useful_Examples&amp;diff=296</id>
		<title>Useful Examples</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Useful_Examples&amp;diff=296"/>
				<updated>2022-05-11T09:03:50Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: /* Editing convention */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Editing convention ==&lt;br /&gt;
*Name of the files: ''italic''&lt;br /&gt;
&lt;br /&gt;
== To Edit Sidebar (as admin only!!!) ==&lt;br /&gt;
Go to [[MediaWiki:Sidebar]]&lt;br /&gt;
&lt;br /&gt;
== To write some LateX ==&lt;br /&gt;
See e.g. [https://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php/ExempleMaths LMDZPedia]&lt;br /&gt;
And check out this page in &amp;quot;edit&amp;quot; mode!&lt;br /&gt;
&amp;lt;!-- some LaTeX macros we want to use: --&amp;gt;&lt;br /&gt;
$$\newcommand{\Re}{\mathrm{Re}\,}&lt;br /&gt;
\newcommand{\pFq}[5]{{}_{#1}\mathrm{F}_{#2} \left( \genfrac{}{}{0pt}{}{#3}{#4} \bigg| {#5} \right)}$$&lt;br /&gt;
&lt;br /&gt;
We consider, for various values of $$s$$, the $$n$$-dimensional integral&lt;br /&gt;
\begin{align}&lt;br /&gt;
  \label{def:Wns}&lt;br /&gt;
  W_n (s)&lt;br /&gt;
  &amp;amp;:= &lt;br /&gt;
  \int_{[0, 1]^n} &lt;br /&gt;
    \left| \sum_{k = 1}^n \mathrm{e}^{2 \pi \mathrm{i} \, x_k} \right|^s \mathrm{d}\boldsymbol{x}&lt;br /&gt;
\end{align}&lt;br /&gt;
which occurs in the theory of uniform random walk integrals in the plane, &lt;br /&gt;
where at each step a unit-step is taken in a random direction.  As such, &lt;br /&gt;
the integral \eqref{def:Wns} expresses the $$s$$-th moment of the distance &lt;br /&gt;
to the origin after $$n$$ steps.&lt;br /&gt;
&lt;br /&gt;
By experimentation and some sketchy arguments we quickly conjectured and &lt;br /&gt;
strongly believed that, for $$k$$ a nonnegative integer&lt;br /&gt;
\begin{align}&lt;br /&gt;
  \label{eq:W3k}&lt;br /&gt;
  W_3(k) &amp;amp;= \Re \, \pFq32{\frac12, -\frac k2, -\frac k2}{1, 1}{4}.&lt;br /&gt;
\end{align}&lt;br /&gt;
&lt;br /&gt;
Appropriately defined, \eqref{eq:W3k} also holds for negative odd integers. &lt;br /&gt;
The reason for \eqref{eq:W3k} was  long a mystery, but it will be explained &lt;br /&gt;
at the end of the paper.&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous ==&lt;br /&gt;
* HTML like syntax works! e.g. comments with&lt;br /&gt;
&amp;lt;!-- This is a comment you don't see unless in &amp;quot;edit mode&amp;quot; --&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;lt;!-- This is a comment in the page --&amp;gt;&lt;br /&gt;
 which you see because between &amp;quot;pre&amp;quot; tags&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Some special features:&lt;br /&gt;
Link to the internal page with all special features: [[Special:Version]]&lt;br /&gt;
&lt;br /&gt;
* Examples of Syntax Highlighting:&lt;br /&gt;
Some Fortran Code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
program truc&lt;br /&gt;
implicit none&lt;br /&gt;
integer :: i&lt;br /&gt;
do i=1,10&lt;br /&gt;
  write(*,*) &amp;quot;i=&amp;quot;,i,&amp;quot; for each hello planeto world&amp;quot;&lt;br /&gt;
end do&lt;br /&gt;
end program &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some Python Code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line&amp;gt;&lt;br /&gt;
import numpy&lt;br /&gt;
import matplotlib as plt&lt;br /&gt;
for i in range(0,5,1):&lt;br /&gt;
 print('hello planeto world&amp;quot;)&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some bash code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line&amp;gt;&lt;br /&gt;
echo 'hello planeto world'&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to create a new page ==&lt;br /&gt;
Option 1: Make a link to that page from a currently existing page, and when you click on that link (will be displayed in red as the system notices that it is a broken link) and the system will ask you if you want to create the page. A reminder on how to add (code-wise) a link to another MediaWiki page (try to follow CamelCase formatting, see option 2 below):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[[Link_To_Some_Page|some descriptive text]]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
which will be rendered as:&lt;br /&gt;
[[Link_To_Some_Page|some descriptive text]]&lt;br /&gt;
&lt;br /&gt;
Option 2: Look for it via the search bar! Advice: you should use CamelCase formating (with a &amp;quot;_&amp;quot; between words) as this page name will end up also being the title of the page (with the &amp;quot;_&amp;quot; replaced by spaces), e.g. The_Best_Page_Ever&lt;br /&gt;
&lt;br /&gt;
== Link to the LMD Generic GCM user manual ==&lt;br /&gt;
&lt;br /&gt;
link to the one on the trac which is what is on svn and thus will always be up to date:&lt;br /&gt;
https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.GENERIC/ManualGCM_GENERIC.pdf&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Useful_Examples&amp;diff=295</id>
		<title>Useful Examples</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Useful_Examples&amp;diff=295"/>
				<updated>2022-05-11T09:03:36Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Editing convention ==&lt;br /&gt;
Name of the files: ''italic''&lt;br /&gt;
&lt;br /&gt;
== To Edit Sidebar (as admin only!!!) ==&lt;br /&gt;
Go to [[MediaWiki:Sidebar]]&lt;br /&gt;
&lt;br /&gt;
== To write some LateX ==&lt;br /&gt;
See e.g. [https://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php/ExempleMaths LMDZPedia]&lt;br /&gt;
And check out this page in &amp;quot;edit&amp;quot; mode!&lt;br /&gt;
&amp;lt;!-- some LaTeX macros we want to use: --&amp;gt;&lt;br /&gt;
$$\newcommand{\Re}{\mathrm{Re}\,}&lt;br /&gt;
\newcommand{\pFq}[5]{{}_{#1}\mathrm{F}_{#2} \left( \genfrac{}{}{0pt}{}{#3}{#4} \bigg| {#5} \right)}$$&lt;br /&gt;
&lt;br /&gt;
We consider, for various values of $$s$$, the $$n$$-dimensional integral&lt;br /&gt;
\begin{align}&lt;br /&gt;
  \label{def:Wns}&lt;br /&gt;
  W_n (s)&lt;br /&gt;
  &amp;amp;:= &lt;br /&gt;
  \int_{[0, 1]^n} &lt;br /&gt;
    \left| \sum_{k = 1}^n \mathrm{e}^{2 \pi \mathrm{i} \, x_k} \right|^s \mathrm{d}\boldsymbol{x}&lt;br /&gt;
\end{align}&lt;br /&gt;
which occurs in the theory of uniform random walk integrals in the plane, &lt;br /&gt;
where at each step a unit-step is taken in a random direction.  As such, &lt;br /&gt;
the integral \eqref{def:Wns} expresses the $$s$$-th moment of the distance &lt;br /&gt;
to the origin after $$n$$ steps.&lt;br /&gt;
&lt;br /&gt;
By experimentation and some sketchy arguments we quickly conjectured and &lt;br /&gt;
strongly believed that, for $$k$$ a nonnegative integer&lt;br /&gt;
\begin{align}&lt;br /&gt;
  \label{eq:W3k}&lt;br /&gt;
  W_3(k) &amp;amp;= \Re \, \pFq32{\frac12, -\frac k2, -\frac k2}{1, 1}{4}.&lt;br /&gt;
\end{align}&lt;br /&gt;
&lt;br /&gt;
Appropriately defined, \eqref{eq:W3k} also holds for negative odd integers. &lt;br /&gt;
The reason for \eqref{eq:W3k} was  long a mystery, but it will be explained &lt;br /&gt;
at the end of the paper.&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous ==&lt;br /&gt;
* HTML like syntax works! e.g. comments with&lt;br /&gt;
&amp;lt;!-- This is a comment you don't see unless in &amp;quot;edit mode&amp;quot; --&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;lt;!-- This is a comment in the page --&amp;gt;&lt;br /&gt;
 which you see because between &amp;quot;pre&amp;quot; tags&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Some special features:&lt;br /&gt;
Link to the internal page with all special features: [[Special:Version]]&lt;br /&gt;
&lt;br /&gt;
* Examples of Syntax Highlighting:&lt;br /&gt;
Some Fortran Code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
program truc&lt;br /&gt;
implicit none&lt;br /&gt;
integer :: i&lt;br /&gt;
do i=1,10&lt;br /&gt;
  write(*,*) &amp;quot;i=&amp;quot;,i,&amp;quot; for each hello planeto world&amp;quot;&lt;br /&gt;
end do&lt;br /&gt;
end program &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some Python Code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line&amp;gt;&lt;br /&gt;
import numpy&lt;br /&gt;
import matplotlib as plt&lt;br /&gt;
for i in range(0,5,1):&lt;br /&gt;
 print('hello planeto world&amp;quot;)&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some bash code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line&amp;gt;&lt;br /&gt;
echo 'hello planeto world'&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to create a new page ==&lt;br /&gt;
Option 1: Make a link to that page from a currently existing page, and when you click on that link (will be displayed in red as the system notices that it is a broken link) and the system will ask you if you want to create the page. A reminder on how to add (code-wise) a link to another MediaWiki page (try to follow CamelCase formatting, see option 2 below):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[[Link_To_Some_Page|some descriptive text]]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
which will be rendered as:&lt;br /&gt;
[[Link_To_Some_Page|some descriptive text]]&lt;br /&gt;
&lt;br /&gt;
Option 2: Look for it via the search bar! Advice: you should use CamelCase formating (with a &amp;quot;_&amp;quot; between words) as this page name will end up also being the title of the page (with the &amp;quot;_&amp;quot; replaced by spaces), e.g. The_Best_Page_Ever&lt;br /&gt;
&lt;br /&gt;
== Link to the LMD Generic GCM user manual ==&lt;br /&gt;
&lt;br /&gt;
link to the one on the trac which is what is on svn and thus will always be up to date:&lt;br /&gt;
https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.GENERIC/ManualGCM_GENERIC.pdf&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=The_diagfi.def_Input_File&amp;diff=289</id>
		<title>The diagfi.def Input File</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=The_diagfi.def_Input_File&amp;diff=289"/>
				<updated>2022-05-11T09:00:25Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: Created blank page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=The_z2sig.def_Input_File&amp;diff=287</id>
		<title>The z2sig.def Input File</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=The_z2sig.def_Input_File&amp;diff=287"/>
				<updated>2022-05-11T08:59:40Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: Created blank page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=The_callphys.def_Input_File&amp;diff=283</id>
		<title>The callphys.def Input File</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=The_callphys.def_Input_File&amp;diff=283"/>
				<updated>2022-05-11T08:58:49Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: Created blank page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=240</id>
		<title>Tool Box</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=240"/>
				<updated>2022-05-11T08:30:03Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: /* Panoply */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Pre-processing Tools ==&lt;br /&gt;
=== newstart ===&lt;br /&gt;
=== start2archive ===&lt;br /&gt;
=== visualization tools ===&lt;br /&gt;
=== other third party scripts and tools ===&lt;br /&gt;
&lt;br /&gt;
TO BE COMPLETED&lt;br /&gt;
&lt;br /&gt;
== Post-processing tools ==&lt;br /&gt;
=== zrecast ===&lt;br /&gt;
&lt;br /&gt;
TO BE COMPLETED&lt;br /&gt;
&lt;br /&gt;
=== mass stream function ===&lt;br /&gt;
&lt;br /&gt;
The mass stream function (and the total angular momentum) can be computed from a diagfi.nc or a stats.nc, using the '''streamfunction.F90''' script. The script is located at&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
trunk/LMDZ.GENERIC/utilities&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To compile the script, open the ''compile'' file in the same directory and do the following:&lt;br /&gt;
* Replace &amp;quot;pgf90&amp;quot; with your favorite fortran compiler &lt;br /&gt;
* replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/lib&amp;quot; with the lib address and directory that contains your NetCDF library (file ''libnetcdf.a'').&lt;br /&gt;
* Replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/include&amp;quot; with the address of the directory that contains the NetCDF include file (''netcdf.inc'').&lt;br /&gt;
* You can mess with the compiling options but it is not mandatory.&lt;br /&gt;
&lt;br /&gt;
Once the script is compiled, copy it in the same directory as your '''.nc''' file and run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./streamfunction.e&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The script will ask you for the name of your '''.nc''' file, and will run and produce a new '''nameofyourfile_stream.nc''' file.&lt;br /&gt;
&lt;br /&gt;
'''Be careful''' : In this new file, all fields are temporally and zonally averaged.&lt;br /&gt;
&lt;br /&gt;
If you want to use '''python''' instead of '''fortran''', you can take a look at this [https://github.com/aymeric-spiga/dynanalysis repo]. It hosts a tool to perform dynamical analysis of GCM simulations (and therefore, it computes the mass stream function and a lot of other stuff), but it is tailored for Dynamico only.&lt;br /&gt;
&lt;br /&gt;
== Continuing Simulations ==&lt;br /&gt;
&lt;br /&gt;
At the end of a simulation, the model generates restart files (files 'restart.nc' and 'restartfi.nc') which contain the final state of the model. The 'restart.nc' and 'restartfi.nc' files have the same format as the 'start.nc' and 'startfi.nc' files, respectively. &lt;br /&gt;
&lt;br /&gt;
These files can in fact be used as initial states to continue the simulation, using the following renaming command lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mv restart.nc start.nc&lt;br /&gt;
mv restartfi.nc startfi.nc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Running a simulation with these start files will in fact resume the simulation from where the previous run ended.&lt;br /&gt;
&lt;br /&gt;
=== bash scripts ===&lt;br /&gt;
&lt;br /&gt;
We have set up very simple bash scripts to automatize the launching of chain simulations. Here is an example of bash script that does the job:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
###########################################################################&lt;br /&gt;
# Script to perform several chained LMD Mars GCM simulations&lt;br /&gt;
# SET HERE the maximum total number of simulations&lt;br /&gt;
&lt;br /&gt;
nummax=100&lt;br /&gt;
&lt;br /&gt;
###########################################################################&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;---------------------------------------------------------&amp;quot;&lt;br /&gt;
echo &amp;quot;STARTING LOOP RUN&amp;quot;&lt;br /&gt;
echo &amp;quot;---------------------------------------------------------&amp;quot;&lt;br /&gt;
&lt;br /&gt;
dir=`pwd`&lt;br /&gt;
machine=`hostname`&lt;br /&gt;
address=`whoami`&lt;br /&gt;
&lt;br /&gt;
# Look for file &amp;quot;num_run&amp;quot; which should contain &lt;br /&gt;
# the value of the previously computed season&lt;br /&gt;
# (defaults to 0 if file &amp;quot;num_run&amp;quot; does not exist)&lt;br /&gt;
if [[ -r num_run ]] ; then&lt;br /&gt;
  echo &amp;quot;found file num_run&amp;quot;&lt;br /&gt;
  numold=`cat num_run`&lt;br /&gt;
else&lt;br /&gt;
  numold=0&lt;br /&gt;
fi&lt;br /&gt;
echo &amp;quot;numold is set to&amp;quot; ${numold}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Set value of current season &lt;br /&gt;
(( numnew = ${numold} + 1 ))&lt;br /&gt;
echo &amp;quot;numnew is set to&amp;quot; ${numnew}&lt;br /&gt;
&lt;br /&gt;
# Look for initialization data files (exit if none found)&lt;br /&gt;
if [[ ( -r start${numold}.nc  &amp;amp;&amp;amp;  -r startfi${numold}.nc ) ]] ; then&lt;br /&gt;
   \cp -f start${numold}.nc start.nc&lt;br /&gt;
   \cp -f startfi${numold}.nc startfi.nc&lt;br /&gt;
else&lt;br /&gt;
   if (( ${numold} == 99999 )) ; then&lt;br /&gt;
    echo &amp;quot;No run because previous run crashed ! (99999 in num_run)&amp;quot;&lt;br /&gt;
    exit&lt;br /&gt;
   else&lt;br /&gt;
   echo &amp;quot;Where is file start&amp;quot;${numold}&amp;quot;.nc??&amp;quot;&lt;br /&gt;
   exit&lt;br /&gt;
   fi&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Run GCM -- THIS LINE NEEDS TO BE MODIFIED WITH THE CORRECT GCM EXECUTION COMMAND&lt;br /&gt;
mpirun -np 8 gcm_64x48x26_phystd_para.e &amp;lt; diagfi.def &amp;gt; lrun${numnew}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Check if run ended normaly and copy datafiles&lt;br /&gt;
if [[ ( -r restartfi.nc  &amp;amp;&amp;amp;  -r restart.nc ) ]] ; then&lt;br /&gt;
  echo &amp;quot;Run seems to have ended normaly&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  \mv -f restart.nc start${numnew}.nc&lt;br /&gt;
  \mv -f restartfi.nc startfi${numnew}.nc  &lt;br /&gt;
    &lt;br /&gt;
else&lt;br /&gt;
  if [[ -r num_run ]] ; then&lt;br /&gt;
    \mv -f num_run num_run.crash&lt;br /&gt;
  else&lt;br /&gt;
    echo &amp;quot;No file num_run to build num_run.crash from !!&amp;quot;&lt;br /&gt;
    # Impose a default value of 0 for num_run&lt;br /&gt;
    echo 0 &amp;gt; num_run.crash&lt;br /&gt;
  fi&lt;br /&gt;
 echo 99999 &amp;gt; num_run&lt;br /&gt;
 exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Copy other datafiles that may have been generated&lt;br /&gt;
if [[ -r diagfi.nc ]] ; then&lt;br /&gt;
  \mv -f diagfi.nc diagfi${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -r diagsoil.nc ]] ; then&lt;br /&gt;
  \mv -f diagsoil.nc diagsoil${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -r stats.nc ]] ; then&lt;br /&gt;
  \mv -f stats.nc stats${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -f profiles.dat ]] ; then&lt;br /&gt;
  \mv -f profiles.dat profiles${numnew}.dat&lt;br /&gt;
  \mv -f profiles.hdr profiles${numnew}.hdr&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Prepare things for upcoming runs by writing&lt;br /&gt;
# value of computed season in file num_run&lt;br /&gt;
echo ${numnew} &amp;gt; num_run&lt;br /&gt;
&lt;br /&gt;
# If we are over nummax : stop&lt;br /&gt;
if (( $numnew + 1 &amp;gt; $nummax )) ; then&lt;br /&gt;
   exit&lt;br /&gt;
else&lt;br /&gt;
   \cp -f run_gnome exe_mars&lt;br /&gt;
   ./exe_mars&lt;br /&gt;
fi &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Summary of what this bash script does,&lt;br /&gt;
&lt;br /&gt;
* Bulleted list item&lt;br /&gt;
&lt;br /&gt;
== Visualization software ==&lt;br /&gt;
=== Panoply ===&lt;br /&gt;
Panoply is a user-friendly tool for viewing raw NetCDF data, available here: https://www.giss.nasa.gov/tools/panoply/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Example panoply.png|thumb|Screenshot of panoply showing here LMD Generic results for the exoplanet TRAPPIST-1e]]&lt;br /&gt;
&lt;br /&gt;
=== ncview ===&lt;br /&gt;
=== paraview ===&lt;br /&gt;
=== planetoplot ===&lt;br /&gt;
=== python scripts ===&lt;br /&gt;
&lt;br /&gt;
TO BE COMPLETED&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Profiling_Method&amp;diff=218</id>
		<title>Profiling Method</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Profiling_Method&amp;diff=218"/>
				<updated>2022-05-11T08:12:43Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you want to do some profiling of the GCM (like knowing the time passed in each subroutine when running a simulation), here is a simple methodology to follow:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; add the option -pg in the lines %BASE_FFLAGS and %BASE_LD of your arch.fcm file&lt;br /&gt;
&amp;lt;li&amp;gt; compile the GCM&lt;br /&gt;
&amp;lt;li&amp;gt; run your simulation ; after it is completed, you should have a binary file named gmon.out&lt;br /&gt;
&amp;lt;li&amp;gt; use the unix command gprof on your gcm executable, and write the output in a text file, for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
gprof gcm.e &amp;gt; profiling.txt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
gprof will read the gmon.out file, and output profiling information. For more information on how to use gprof, type man gprof&lt;br /&gt;
&lt;br /&gt;
You now have in your text file a lot of information on time used by the subroutines of the GCM code and their proportion to the whole run's duration. Especially, you have first the &amp;quot;Flat profile&amp;quot;, which sorts the subroutines by their own time consumption (&amp;quot;self&amp;quot;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
Flat profile:&lt;br /&gt;
Each sample counts as 0.01 seconds.&lt;br /&gt;
  %   cumulative   self              self     total           &lt;br /&gt;
 time   seconds   seconds    calls   s/call   s/call  name    &lt;br /&gt;
 10.32      0.16     0.16      360     0.00     0.00  aerave_&lt;br /&gt;
  7.74      0.28     0.12       60     0.00     0.00  lwxd_&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and second, the &amp;quot;Call graph&amp;quot;, which displays the parents-children links between the subroutines, and sorts them by their &amp;quot;total&amp;quot; time (self+children).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
		     Call graph (explanation follows)&lt;br /&gt;
granularity: each sample hit covers 2 byte(s) for 0.65% of 1.55 seconds&lt;br /&gt;
index % time    self  children    called     name&lt;br /&gt;
                0.00    1.55       1/1           main [2]&lt;br /&gt;
[1]    100.0    0.00    1.55       1         MAIN__ [1]&lt;br /&gt;
                0.00    1.49       1/1           leapfrog_p_ [3]&lt;br /&gt;
                0.00    0.04       1/1           filtreg_mod_mp_inifilr_ [30]&lt;br /&gt;
                0.00    0.01       1/1           inidissip_ [75]&lt;br /&gt;
                0.00    0.01       1/1           iniphysiq_mod_mp_iniphysiq_ [77]&lt;br /&gt;
                0.00    0.00       1/1           conf_gcm_ [272]&lt;br /&gt;
                0.00    0.00       1/1           parallel_lmdz_mp_init_parallel_ [355]&lt;br /&gt;
                0.00    0.00       1/1           mod_const_mpi_mp_init_const_mpi_ [317]&lt;br /&gt;
                0.00    0.00       1/1           bands_mp_read_distrib_ [250]&lt;br /&gt;
                0.00    0.00       1/1           parallel_lmdz_mp_barrier_ [353]&lt;br /&gt;
                0.00    0.00       1/1           bands_mp_set_bands_ [251]&lt;br /&gt;
                0.00    0.00       1/1           bands_mp_writebands_ [252]&lt;br /&gt;
                0.00    0.00       1/1           mod_hallo_mp_init_mod_hallo_ [321]&lt;br /&gt;
                0.00    0.00       1/30          parallel_lmdz_mp_setdistrib_ [172]&lt;br /&gt;
                0.00    0.00       1/1           cpdet_mod_mp_ini_cpdet_ [275]&lt;br /&gt;
                0.00    0.00       1/1           infotrac_mp_infotrac_init_ [299]&lt;br /&gt;
                0.00    0.00       1/1           dynetat0_ [287]&lt;br /&gt;
                0.00    0.00       1/1           dynredem0_p_ [290]&lt;br /&gt;
                0.00    0.00       1/1           iniconst_ [301]&lt;br /&gt;
                0.00    0.00       1/1           inigeom_ [302]&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, for nice profiling visualizations like call trees, you can use the python script from ​https://github.com/jrfonseca/gprof2dot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''From https://trac.lmd.jussieu.fr/Planeto/wiki/ProfilingMethod''&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Profiling_Method&amp;diff=207</id>
		<title>Profiling Method</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Profiling_Method&amp;diff=207"/>
				<updated>2022-05-11T08:02:11Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;If you want to do some profiling of the GCM (like knowing the time passed in each subroutine when running a simulation), here is a simple methodology to follow:&lt;br /&gt;
&lt;br /&gt;
    1) add the option -pg in the lines %BASE_FFLAGS and %BASE_LD of your arch.fcm file&lt;br /&gt;
&lt;br /&gt;
    2) compile the GCM&lt;br /&gt;
&lt;br /&gt;
    3) run your simulation ; after it is completed, you should have a binary file named gmon.out&lt;br /&gt;
&lt;br /&gt;
    4) use the unix command gprof on your gcm executable, and write the output in a text file, for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line&amp;gt;&lt;br /&gt;
gprof gcm.e &amp;gt; profiling.txt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
gprof will read the gmon.out file, and output profiling information. For more information on how to use gprof, type man gprof&lt;br /&gt;
&lt;br /&gt;
You now have in your text file a lot of information on time used by the subroutines of the GCM code and their proportion to the whole run's duration. Especially, you have first the &amp;quot;Flat profile&amp;quot;, which sorts the subroutines by their own time consumption (&amp;quot;self&amp;quot;):&lt;br /&gt;
&lt;br /&gt;
Flat profile:&lt;br /&gt;
Each sample counts as 0.01 seconds.&lt;br /&gt;
  %   cumulative   self              self     total           &lt;br /&gt;
 time   seconds   seconds    calls   s/call   s/call  name    &lt;br /&gt;
 10.32      0.16     0.16      360     0.00     0.00  aerave_&lt;br /&gt;
  7.74      0.28     0.12       60     0.00     0.00  lwxd_&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
    and second, the &amp;quot;Call graph&amp;quot;, which displays the parents-children links between the subroutines, and sorts them by their &amp;quot;total&amp;quot; time (self+children).&lt;br /&gt;
&lt;br /&gt;
		     Call graph (explanation follows)&lt;br /&gt;
granularity: each sample hit covers 2 byte(s) for 0.65% of 1.55 seconds&lt;br /&gt;
index % time    self  children    called     name&lt;br /&gt;
                0.00    1.55       1/1           main [2]&lt;br /&gt;
[1]    100.0    0.00    1.55       1         MAIN__ [1]&lt;br /&gt;
                0.00    1.49       1/1           leapfrog_p_ [3]&lt;br /&gt;
                0.00    0.04       1/1           filtreg_mod_mp_inifilr_ [30]&lt;br /&gt;
                0.00    0.01       1/1           inidissip_ [75]&lt;br /&gt;
                0.00    0.01       1/1           iniphysiq_mod_mp_iniphysiq_ [77]&lt;br /&gt;
                0.00    0.00       1/1           conf_gcm_ [272]&lt;br /&gt;
                0.00    0.00       1/1           parallel_lmdz_mp_init_parallel_ [355]&lt;br /&gt;
                0.00    0.00       1/1           mod_const_mpi_mp_init_const_mpi_ [317]&lt;br /&gt;
                0.00    0.00       1/1           bands_mp_read_distrib_ [250]&lt;br /&gt;
                0.00    0.00       1/1           parallel_lmdz_mp_barrier_ [353]&lt;br /&gt;
                0.00    0.00       1/1           bands_mp_set_bands_ [251]&lt;br /&gt;
                0.00    0.00       1/1           bands_mp_writebands_ [252]&lt;br /&gt;
                0.00    0.00       1/1           mod_hallo_mp_init_mod_hallo_ [321]&lt;br /&gt;
                0.00    0.00       1/30          parallel_lmdz_mp_setdistrib_ [172]&lt;br /&gt;
                0.00    0.00       1/1           cpdet_mod_mp_ini_cpdet_ [275]&lt;br /&gt;
                0.00    0.00       1/1           infotrac_mp_infotrac_init_ [299]&lt;br /&gt;
                0.00    0.00       1/1           dynetat0_ [287]&lt;br /&gt;
                0.00    0.00       1/1           dynredem0_p_ [290]&lt;br /&gt;
                0.00    0.00       1/1           iniconst_ [301]&lt;br /&gt;
                0.00    0.00       1/1           inigeom_ [302]&lt;br /&gt;
-----------------------------------------------&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
        5) for nice profiling visualizations, like call trees, you can use the python script from ​https://github.com/jrfonseca/gprof2dot&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Profiling_Method&amp;diff=205</id>
		<title>Profiling Method</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Profiling_Method&amp;diff=205"/>
				<updated>2022-05-11T07:59:36Z</updated>
		
		<summary type="html">&lt;p&gt;Guillaume.Chaverot: Created blank page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Guillaume.Chaverot</name></author>	</entry>

	</feed>