<?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=Jorge</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=Jorge"/>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/Special:Contributions/Jorge"/>
		<updated>2026-06-10T20:56:28Z</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_Mars_PCM&amp;diff=3219</id>
		<title>Quick Install and Run Mars PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Quick_Install_and_Run_Mars_PCM&amp;diff=3219"/>
				<updated>2026-02-25T16:10:24Z</updated>
		
		<summary type="html">&lt;p&gt;Jorge: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&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 Mars PCM, set up 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_mars.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.MARS&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 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 must be available. As this library is not quite standard you'll probably have to install it 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 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;
==== Prior to a first compilation: ksh to bash conversion ====&lt;br /&gt;
Some of the IOIPSL install scripts are written in ksh (Korn shell).&lt;br /&gt;
Given that most systems currently use Bash (Bourne Again Shell) as their command-line interpreter and not ksh (Korn Shell), you might need to install ksh on your system (assuming you have super-user privileges), for e.g., on Linux-Ubuntu:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt install ksh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Or, if that is not an option, change the occurrences in the package's scripts ('''ins_m_prec''') 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;
==== 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;GCM6&amp;quot; simulation, i.e. simulation including CO2, dust and water cycles with a model top around 120 km), a set of necessary input data may be downloaded (note that a few reference cases are available on https://web.lmd.jussieu.fr/~lmdz/planets/mars/ ) 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/mars/reference_GCM6_64x48x54.tar.gz&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once unpacked (&amp;quot;tar xvzf reference_GCM6_64x48x54.tar.gz&amp;quot;) the resulting &amp;quot;reference_GCM6_64x48x54&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 diagfi.def run.def startfi.nc start.nc stats.def traceur.def 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. These also define the model resolution and number of atmospheric layers (64x48x54 - the compiled GCM binary must match this!) &lt;br /&gt;
* Some mandatory 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;
* Some optional ASCII *def files containing names of variables to output:&lt;br /&gt;
# [[The_diagfi.def_Input_File | diagfi.def]] : list of variables that will be included in output file diagfi.nc (if there is no diagfi.def file then ALL variables will be included; you probably don't want that as the resulting file will rapidly grow to be HUGE)&lt;br /&gt;
# [[The_stats.def_Input_File | stats.def]] : list of variables that will be included in output file stats.nc (if there is no stats.def file then ALL variables will be included and the resulting file will be large)&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;
* 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;
&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 the test case  ===&lt;br /&gt;
To compile the GCM at the sought resolution, 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 mars -d 64x48x54 -j 8 gcm &lt;br /&gt;
&amp;lt;/syntaxhighlight&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 mars''': the GCM will use the &amp;quot;mars&amp;quot; physics package&lt;br /&gt;
* '''-d 64x48x54''': the GCM grid will be 64x48 in longitude x latitude, with 54 vertical levels.&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_64x48x54_phymars_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 first need to have a ''datadir'' at hand, which is a directory containing some input datafiles (e.g. driving dust scenarios, aerosol properties, etc.) that the GCM will need at run time.&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/mars/datadir.tar.gz&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
And simply, after having un-tarred it&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tar xvzf datadir.tar.gz&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Link the resulting '''datadir''' directory to where you will run (e.g. the '''reference_GCM6_64x48x54''' directory), for instance if '''datadir''' is along side '''reference_GCM6_64x48x54''', then in the later do:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -s ../datadir .&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Secondly you need to copy (or move) the executable '''gcm_64x48x54_phymars_seq.e''' from '''LMDZ.COMMON/bin''' to the directory containing the initial conditions and parameter files, e.g. '''reference_GCM6_64x48x54'''.&lt;br /&gt;
&lt;br /&gt;
You can now run the GCM.&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_64x48x54_phymars_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_64x48x54_phymars_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 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;
&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;
...TODO...ADD HERE SOME ILLUSTRATIVE PLOTS OF THE EXPECTED BENCH OUTPUTS...&lt;br /&gt;
&lt;br /&gt;
== Taking Things to the Next Level ==&lt;br /&gt;
See [[Advanced_Topics_Mars_PCM|Advanced use of the Mars PCM]]&lt;br /&gt;
&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:Mars-Model]]&lt;br /&gt;
[[Category:Mars-LMDZ]]&lt;/div&gt;</summary>
		<author><name>Jorge</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Running_Mars_mesoscale_model&amp;diff=2661</id>
		<title>Running Mars mesoscale model</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Running_Mars_mesoscale_model&amp;diff=2661"/>
				<updated>2025-04-02T14:43:27Z</updated>
		
		<summary type="html">&lt;p&gt;Jorge: /* Restarting simulations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is page I start to introduce some notes to remind that could be useful for other users (Jorge).&lt;br /&gt;
&lt;br /&gt;
The user manual can be found at https://gitlab.in2p3.fr/la-communaut-des-mod-les-atmosph-riques-plan-taires/git-trunk/-/blob/master/MESOSCALE/MANUAL/SRC/user_manual.pdf?ref_type=heads&lt;br /&gt;
&lt;br /&gt;
==Regarding NaNs and parallel running==&lt;br /&gt;
The mesoscale model cannot run in parallel in spirit at the moment, it runs but it outputs NaNs everywhere.&lt;br /&gt;
&lt;br /&gt;
When running in a single core, in my case at least it produces NaNs with low output frequency (37) but by increasing the output frequency (6 works for me) it is solved. This is weird but seem to be right.&lt;br /&gt;
&lt;br /&gt;
Increasing the output frequency in parallel runs doesn't work. Even with a frequency of 1 doesn't work.&lt;br /&gt;
&lt;br /&gt;
==Notes on clear input and output files (TBD)==&lt;br /&gt;
&lt;br /&gt;
==Notes on configuration files (TBD)==&lt;br /&gt;
&lt;br /&gt;
===namelist.input===&lt;br /&gt;
&lt;br /&gt;
==Changing vertical resolution==&lt;br /&gt;
Before running real.exe, a new levels file needs to be generated. The script to do this is in SIMU/RUN/vert_level_python.&lt;br /&gt;
&lt;br /&gt;
==Smoothing topography in the borders==&lt;br /&gt;
This might help sometimes when simulations are breaking, but it didn't work for me so far. This script can smooth the topography in the borders of a wrfinput file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
import numpy as np&lt;br /&gt;
import xarray as xr&lt;br /&gt;
import sys&lt;br /&gt;
import os&lt;br /&gt;
&lt;br /&gt;
from scipy.ndimage import gaussian_filter&lt;br /&gt;
&lt;br /&gt;
def smooth_borders(a,margin):&lt;br /&gt;
    out=np.zeros(a.shape)&lt;br /&gt;
    for i in range(margin):&lt;br /&gt;
        if i&amp;gt;0:&lt;br /&gt;
            b=a[i:-i,i:-i]&lt;br /&gt;
        else:&lt;br /&gt;
            b=a[:]&lt;br /&gt;
        c=gaussian_filter(b, sigma=margin-i)&lt;br /&gt;
        if i&amp;gt;0:&lt;br /&gt;
            out[i:-i,i:-i]=c&lt;br /&gt;
        else:&lt;br /&gt;
            out=c[:]&lt;br /&gt;
&lt;br /&gt;
    return out&lt;br /&gt;
&lt;br /&gt;
margin=int(sys.argv[1])&lt;br /&gt;
input_file=sys.argv[2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#Open file&lt;br /&gt;
ds=xr.open_dataset(input_file)&lt;br /&gt;
&lt;br /&gt;
a=ds.HGT.values[0]&lt;br /&gt;
a=smooth_borders(a,margin)&lt;br /&gt;
ds.HGT.values[0]=a&lt;br /&gt;
&lt;br /&gt;
os.system('mv %s %s_presmooth'%(input_file,input_file))&lt;br /&gt;
ds.to_netcdf(input_file)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Restarting simulations==&lt;br /&gt;
In the file namelist.input there is the option &amp;quot;restart&amp;quot;. The comment for this option says &amp;quot;Output restart files?&amp;quot; but actually it refers to whether or not the simulation should try to start from a previous simulation.&lt;br /&gt;
Restart files are periodically saved, this can be configured with restart_interval. The value is an integer number corresponding to the number of &amp;quot;minutes&amp;quot; (with a Martian hour having 37 minutes) between restart files. By default this is very long (8880, corresponding to 10 sols). If we write 37 it will be every hour. If we write 37*6 it will be every 6 hours, etc.&lt;br /&gt;
&lt;br /&gt;
To restart from an existing restart file, we must change the &amp;quot;restart&amp;quot; option to .true., and the start_month,start_day, and start_hour need to be updated to coincide with the time of the restart file. Since we can tune the starting of the simulation with a resolution of hours (and not minutes), this means that the restart files need to be saved at integer hours, and therefore the restart_interval option should have values 37*N, with N the number of hours of interval between restart files.&lt;br /&gt;
&lt;br /&gt;
===Troubleshooting restart files in big simulations===&lt;br /&gt;
In big simulations restart files fail to be saved. This does not cause any problem, and the simulation keeps running. When increasing verbosity to one, the rsl.error file contains this error messages (Note that for this debug execution we set restart_interval to 1 to obtain the error quickly):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
 d01 2024-10-01_06:01:00 med_restart_out: opening wrfrst_d01_2024-10-01_06:01:00&lt;br /&gt;
  for writing&lt;br /&gt;
 d01 2024-10-01_06:01:00  NetCDF error: NetCDF: One or more variable sizes viola&lt;br /&gt;
 te format constraints&lt;br /&gt;
 d01 2024-10-01_06:01:00  NetCDF error in ext_ncd_open_for_write_commit wrf_io.F&lt;br /&gt;
 90, line        1279&lt;br /&gt;
 med_restart_out: opening wrfrst_d01_2024-10-01_06:01:00 for writing&lt;br /&gt;
 d01 2024-10-01_06:01:00  Warning 2 DRYRUNS 1 VARIABLE in wrf_io.F90, line&lt;br /&gt;
   2303&lt;br /&gt;
&lt;br /&gt;
[This line repeats many times]&lt;br /&gt;
&lt;br /&gt;
d01 2024-10-01_06:01:00  Warning 2 DRYRUNS 1 VARIABLE in wrf_io.F90, line&lt;br /&gt;
   2303&lt;br /&gt;
Timing for Writing restart for domain        1:    0.06920 elapsed seconds.&lt;br /&gt;
 d01 2024-10-01_06:01:00  Warning TRY TO CLOSE DRYRUN in ext_ncd_ioclose wrf_io.&lt;br /&gt;
 F90, line        1311&lt;br /&gt;
 d01 2024-10-01_06:01:00  NetCDF error: NetCDF: One or more variable sizes viola&lt;br /&gt;
 te format constraints&lt;br /&gt;
 d01 2024-10-01_06:01:00  NetCDF error in ext_ncd_ioclose wrf_io.F90, line&lt;br /&gt;
   1329&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem is in the file wrf_io.F90. We have to update two files&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
code/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/external/io_netcdf/wrf_io.F90: line 1188&lt;br /&gt;
code/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/external/io_pnetcdf/wrf_io.F90: line 1195&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem is caused by the big size of the restart files, it will happen when files are bigger than 2gb. &lt;br /&gt;
&lt;br /&gt;
Apparently, these parameters only work when writing files smaller than 2gb. We can fix that be replacing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
NF_CLOBBER&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
by&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
IOR(NF_CLOBBER,NF_64BIT_OFFSET)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the resulting line looks like&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
code/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/external/io_netcdf/wrf_io.F90: line 1188&lt;br /&gt;
stat = NF_CREATE(FileName, IOR(NF_CLOBBER,NF_64BIT_OFFSET), DH%NCID)&lt;br /&gt;
&lt;br /&gt;
code/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/external/io_pnetcdf/wrf_io.F90: line 1195&lt;br /&gt;
stat = NFMPI_CREATE(Comm, FileName, IOR(NF_CLOBBER,NF_64BIT_OFFSET), MPI_INFO_NULL, DH%NCID)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is documented in https://docs.unidata.ucar.edu/netcdf-fortran/current/nc_f77_interface_guide.html&lt;br /&gt;
&lt;br /&gt;
==Outputs in superhigh frequency==&lt;br /&gt;
The way I found involves changing the file SRC/WRFV2/share/set_timekeeping.F, by adding the two lines that are commented in the following code, the outputs can be made every 20 seconds (every dynamical timestep)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
CALL nl_get_history_interval( grid%id, history_interval )   ! same as minutes&lt;br /&gt;
   CALL nl_get_history_interval_mo( grid%id, history_interval_mo )&lt;br /&gt;
   CALL nl_get_history_interval_d( grid%id, history_interval_d )&lt;br /&gt;
   CALL nl_get_history_interval_h( grid%id, history_interval_h )&lt;br /&gt;
   CALL nl_get_history_interval_m( grid%id, history_interval_m )&lt;br /&gt;
   CALL nl_get_history_interval_s( grid%id, history_interval_s )&lt;br /&gt;
   IF ( history_interval_m .EQ. 0 ) history_interval_m = history_interval&lt;br /&gt;
&lt;br /&gt;
   !history_interval_m=0&lt;br /&gt;
   !history_interval_s=20&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jorge</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Running_Mars_mesoscale_model&amp;diff=2660</id>
		<title>Running Mars mesoscale model</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Running_Mars_mesoscale_model&amp;diff=2660"/>
				<updated>2025-03-20T15:31:27Z</updated>
		
		<summary type="html">&lt;p&gt;Jorge: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is page I start to introduce some notes to remind that could be useful for other users (Jorge).&lt;br /&gt;
&lt;br /&gt;
The user manual can be found at https://gitlab.in2p3.fr/la-communaut-des-mod-les-atmosph-riques-plan-taires/git-trunk/-/blob/master/MESOSCALE/MANUAL/SRC/user_manual.pdf?ref_type=heads&lt;br /&gt;
&lt;br /&gt;
==Regarding NaNs and parallel running==&lt;br /&gt;
The mesoscale model cannot run in parallel in spirit at the moment, it runs but it outputs NaNs everywhere.&lt;br /&gt;
&lt;br /&gt;
When running in a single core, in my case at least it produces NaNs with low output frequency (37) but by increasing the output frequency (6 works for me) it is solved. This is weird but seem to be right.&lt;br /&gt;
&lt;br /&gt;
Increasing the output frequency in parallel runs doesn't work. Even with a frequency of 1 doesn't work.&lt;br /&gt;
&lt;br /&gt;
==Notes on clear input and output files (TBD)==&lt;br /&gt;
&lt;br /&gt;
==Notes on configuration files (TBD)==&lt;br /&gt;
&lt;br /&gt;
===namelist.input===&lt;br /&gt;
&lt;br /&gt;
==Restarting simulations==&lt;br /&gt;
In the file namelist.input there is the option &amp;quot;restart&amp;quot;. The comment for this option says &amp;quot;Output restart files?&amp;quot; but actually it refers to whether or not the simulation should try to start from a previous simulation.&lt;br /&gt;
Restart files are periodically saved, this can be configured with restart_interval. The value is an integer number corresponding to the number of &amp;quot;minutes&amp;quot; (with a Martian hour having 37 minutes) between restart files. By default this is very long (8880, corresponding to 10 sols). If we write 37 it will be every hour. If we write 37*6 it will be every 6 hours, etc.&lt;br /&gt;
&lt;br /&gt;
To restart from an existing restart file, we must change the &amp;quot;restart&amp;quot; option to .true., and the start_month,start_day, and start_hour need to be updated to coincide with the time of the restart file. Since we can tune the starting of the simulation with a resolution of hours (and not minutes), this means that the restart files need to be saved at integer hours, and therefore the restart_interval option should have values 37*N, with N the number of hours of interval between restart files.&lt;br /&gt;
&lt;br /&gt;
===Troubleshooting restart files in big simulations===&lt;br /&gt;
In big simulations restart files fail to be saved. This does not cause any problem, and the simulation keeps running. When increasing verbosity to one, the rsl.error file contains this error messages (Note that for this debug execution we set restart_interval to 1 to obtain the error quickly):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
 d01 2024-10-01_06:01:00 med_restart_out: opening wrfrst_d01_2024-10-01_06:01:00&lt;br /&gt;
  for writing&lt;br /&gt;
 d01 2024-10-01_06:01:00  NetCDF error: NetCDF: One or more variable sizes viola&lt;br /&gt;
 te format constraints&lt;br /&gt;
 d01 2024-10-01_06:01:00  NetCDF error in ext_ncd_open_for_write_commit wrf_io.F&lt;br /&gt;
 90, line        1279&lt;br /&gt;
 med_restart_out: opening wrfrst_d01_2024-10-01_06:01:00 for writing&lt;br /&gt;
 d01 2024-10-01_06:01:00  Warning 2 DRYRUNS 1 VARIABLE in wrf_io.F90, line&lt;br /&gt;
   2303&lt;br /&gt;
&lt;br /&gt;
[This line repeats many times]&lt;br /&gt;
&lt;br /&gt;
d01 2024-10-01_06:01:00  Warning 2 DRYRUNS 1 VARIABLE in wrf_io.F90, line&lt;br /&gt;
   2303&lt;br /&gt;
Timing for Writing restart for domain        1:    0.06920 elapsed seconds.&lt;br /&gt;
 d01 2024-10-01_06:01:00  Warning TRY TO CLOSE DRYRUN in ext_ncd_ioclose wrf_io.&lt;br /&gt;
 F90, line        1311&lt;br /&gt;
 d01 2024-10-01_06:01:00  NetCDF error: NetCDF: One or more variable sizes viola&lt;br /&gt;
 te format constraints&lt;br /&gt;
 d01 2024-10-01_06:01:00  NetCDF error in ext_ncd_ioclose wrf_io.F90, line&lt;br /&gt;
   1329&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem is in the file wrf_io.F90. We have to update two files&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
code/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/external/io_netcdf/wrf_io.F90: line 1188&lt;br /&gt;
code/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/external/io_pnetcdf/wrf_io.F90: line 1195&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem is caused by the big size of the restart files, it will happen when files are bigger than 2gb. &lt;br /&gt;
&lt;br /&gt;
Apparently, these parameters only work when writing files smaller than 2gb. We can fix that be replacing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
NF_CLOBBER&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
by&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
IOR(NF_CLOBBER,NF_64BIT_OFFSET)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the resulting line looks like&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
code/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/external/io_netcdf/wrf_io.F90: line 1188&lt;br /&gt;
stat = NF_CREATE(FileName, IOR(NF_CLOBBER,NF_64BIT_OFFSET), DH%NCID)&lt;br /&gt;
&lt;br /&gt;
code/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/external/io_pnetcdf/wrf_io.F90: line 1195&lt;br /&gt;
stat = NFMPI_CREATE(Comm, FileName, IOR(NF_CLOBBER,NF_64BIT_OFFSET), MPI_INFO_NULL, DH%NCID)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is documented in https://docs.unidata.ucar.edu/netcdf-fortran/current/nc_f77_interface_guide.html&lt;br /&gt;
&lt;br /&gt;
==Outputs in superhigh frequency==&lt;br /&gt;
The way I found involves changing the file SRC/WRFV2/share/set_timekeeping.F, by adding the two lines that are commented in the following code, the outputs can be made every 20 seconds (every dynamical timestep)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
CALL nl_get_history_interval( grid%id, history_interval )   ! same as minutes&lt;br /&gt;
   CALL nl_get_history_interval_mo( grid%id, history_interval_mo )&lt;br /&gt;
   CALL nl_get_history_interval_d( grid%id, history_interval_d )&lt;br /&gt;
   CALL nl_get_history_interval_h( grid%id, history_interval_h )&lt;br /&gt;
   CALL nl_get_history_interval_m( grid%id, history_interval_m )&lt;br /&gt;
   CALL nl_get_history_interval_s( grid%id, history_interval_s )&lt;br /&gt;
   IF ( history_interval_m .EQ. 0 ) history_interval_m = history_interval&lt;br /&gt;
&lt;br /&gt;
   !history_interval_m=0&lt;br /&gt;
   !history_interval_s=20&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jorge</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Running_Mars_mesoscale_model&amp;diff=2656</id>
		<title>Running Mars mesoscale model</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Running_Mars_mesoscale_model&amp;diff=2656"/>
				<updated>2025-03-16T21:43:36Z</updated>
		
		<summary type="html">&lt;p&gt;Jorge: /* Troubleshooting restart files in big simulations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is page I start to introduce some notes to remind that could be useful for other users (Jorge).&lt;br /&gt;
&lt;br /&gt;
The user manual can be found at https://gitlab.in2p3.fr/la-communaut-des-mod-les-atmosph-riques-plan-taires/git-trunk/-/blob/master/MESOSCALE/MANUAL/SRC/user_manual.pdf?ref_type=heads&lt;br /&gt;
&lt;br /&gt;
==Regarding NaNs and parallel running==&lt;br /&gt;
The mesoscale model cannot run in parallel in spirit at the moment, it runs but it outputs NaNs everywhere.&lt;br /&gt;
&lt;br /&gt;
When running in a single core, in my case at least it produces NaNs with low output frequency (37) but by increasing the output frequency (6 works for me) it is solved. This is weird but seem to be right.&lt;br /&gt;
&lt;br /&gt;
Increasing the output frequency in parallel runs doesn't work. Even with a frequency of 1 doesn't work.&lt;br /&gt;
&lt;br /&gt;
==Notes on clear input and output files (TBD)==&lt;br /&gt;
&lt;br /&gt;
==Notes on configuration files (TBD)==&lt;br /&gt;
&lt;br /&gt;
===namelist.input===&lt;br /&gt;
&lt;br /&gt;
==Restarting simulations==&lt;br /&gt;
In the file namelist.input there is the option &amp;quot;restart&amp;quot;. The comment for this option says &amp;quot;Output restart files?&amp;quot; but actually it refers to whether or not the simulation should try to start from a previous simulation.&lt;br /&gt;
Restart files are periodically saved, this can be configured with restart_interval. The value is an integer number corresponding to the number of &amp;quot;minutes&amp;quot; (with a Martian hour having 37 minutes) between restart files. By default this is very long (8880, corresponding to 10 sols). If we write 37 it will be every hour. If we write 37*6 it will be every 6 hours, etc.&lt;br /&gt;
&lt;br /&gt;
To restart from an existing restart file, we must change the &amp;quot;restart&amp;quot; option to .true., and the start_month,start_day, and start_hour need to be updated to coincide with the time of the restart file. Since we can tune the starting of the simulation with a resolution of hours (and not minutes), this means that the restart files need to be saved at integer hours, and therefore the restart_interval option should have values 37*N, with N the number of hours of interval between restart files.&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting restart files in big simulations==&lt;br /&gt;
In big simulations restart files fail to be saved. This does not cause any problem, and the simulation keeps running. When increasing verbosity to one, the rsl.error file contains this error messages (Note that for this debug execution we set restart_interval to 1 to obtain the error quickly):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
 d01 2024-10-01_06:01:00 med_restart_out: opening wrfrst_d01_2024-10-01_06:01:00&lt;br /&gt;
  for writing&lt;br /&gt;
 d01 2024-10-01_06:01:00  NetCDF error: NetCDF: One or more variable sizes viola&lt;br /&gt;
 te format constraints&lt;br /&gt;
 d01 2024-10-01_06:01:00  NetCDF error in ext_ncd_open_for_write_commit wrf_io.F&lt;br /&gt;
 90, line        1279&lt;br /&gt;
 med_restart_out: opening wrfrst_d01_2024-10-01_06:01:00 for writing&lt;br /&gt;
 d01 2024-10-01_06:01:00  Warning 2 DRYRUNS 1 VARIABLE in wrf_io.F90, line&lt;br /&gt;
   2303&lt;br /&gt;
&lt;br /&gt;
[This line repeats many times]&lt;br /&gt;
&lt;br /&gt;
d01 2024-10-01_06:01:00  Warning 2 DRYRUNS 1 VARIABLE in wrf_io.F90, line&lt;br /&gt;
   2303&lt;br /&gt;
Timing for Writing restart for domain        1:    0.06920 elapsed seconds.&lt;br /&gt;
 d01 2024-10-01_06:01:00  Warning TRY TO CLOSE DRYRUN in ext_ncd_ioclose wrf_io.&lt;br /&gt;
 F90, line        1311&lt;br /&gt;
 d01 2024-10-01_06:01:00  NetCDF error: NetCDF: One or more variable sizes viola&lt;br /&gt;
 te format constraints&lt;br /&gt;
 d01 2024-10-01_06:01:00  NetCDF error in ext_ncd_ioclose wrf_io.F90, line&lt;br /&gt;
   1329&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem is in the file wrf_io.F90. We have to update two files&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
code/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/external/io_netcdf/wrf_io.F90: line 1188&lt;br /&gt;
code/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/external/io_pnetcdf/wrf_io.F90: line 1195&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem is caused by the big size of the restart files, it will happen when files are bigger than 2gb. &lt;br /&gt;
&lt;br /&gt;
Apparently, these parameters only work when writing files smaller than 2gb. We can fix that be replacing:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
NF_CLOBBER&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
by&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
IOR(NF_CLOBBER,NF_64BIT_OFFSET)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the resulting line looks like&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
code/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/external/io_netcdf/wrf_io.F90: line 1188&lt;br /&gt;
stat = NF_CREATE(FileName, IOR(NF_CLOBBER,NF_64BIT_OFFSET), DH%NCID)&lt;br /&gt;
&lt;br /&gt;
code/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/external/io_pnetcdf/wrf_io.F90: line 1195&lt;br /&gt;
stat = NFMPI_CREATE(Comm, FileName, IOR(NF_CLOBBER,NF_64BIT_OFFSET), MPI_INFO_NULL, DH%NCID)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is documented in https://docs.unidata.ucar.edu/netcdf-fortran/current/nc_f77_interface_guide.html&lt;/div&gt;</summary>
		<author><name>Jorge</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Sub-grid_water_ice_clouds_in_Mars_PCM&amp;diff=2655</id>
		<title>Sub-grid water ice clouds in Mars PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Sub-grid_water_ice_clouds_in_Mars_PCM&amp;diff=2655"/>
				<updated>2025-03-14T12:52:07Z</updated>
		
		<summary type="html">&lt;p&gt;Jorge: Created page with &amp;quot;There is a simple parametrization of sub-grid water ice clouds implemented in the Mars PCM. It is by default deactivated and it has not been used in some time, so it is not su...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There is a simple parametrization of sub-grid water ice clouds implemented in the Mars PCM. It is by default deactivated and it has not been used in some time, so it is not sure that it currently works.&lt;br /&gt;
&lt;br /&gt;
It can be activated with the flag &amp;quot;CLFvarying&amp;quot; in the callphys. And it is documented in the PhD thesis by Alizée Pottier, which can be found at: https://theses.hal.science/tel-01528574&lt;br /&gt;
&lt;br /&gt;
It includes an independent calculation of water saturation in the file &amp;quot;tcondwater&amp;quot;, that is weird because the rest of the model uses the saturation computed in watersat_mod, and that might require some analysis and review.&lt;/div&gt;</summary>
		<author><name>Jorge</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Running_Mars_mesoscale_model&amp;diff=2433</id>
		<title>Running Mars mesoscale model</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Running_Mars_mesoscale_model&amp;diff=2433"/>
				<updated>2025-02-24T16:52:09Z</updated>
		
		<summary type="html">&lt;p&gt;Jorge: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is page I start to introduce some notes to remind that could be useful for other users (Jorge).&lt;br /&gt;
&lt;br /&gt;
The user manual can be found at https://gitlab.in2p3.fr/la-communaut-des-mod-les-atmosph-riques-plan-taires/git-trunk/-/blob/master/MESOSCALE/MANUAL/SRC/user_manual.pdf?ref_type=heads&lt;br /&gt;
&lt;br /&gt;
==Regarding NaNs and parallel running==&lt;br /&gt;
The mesoscale model cannot run in parallel in spirit at the moment, it runs but it outputs NaNs everywhere.&lt;br /&gt;
&lt;br /&gt;
When running in a single core, in my case at least it produces NaNs with low output frequency (37) but by increasing the output frequency (6 works for me) it is solved. This is weird but seem to be right.&lt;br /&gt;
&lt;br /&gt;
Increasing the output frequency in parallel runs doesn't work. Even with a frequency of 1 doesn't work.&lt;br /&gt;
&lt;br /&gt;
==Notes on clear input and output files (TBD)==&lt;br /&gt;
&lt;br /&gt;
==Notes on configuration files (TBD)==&lt;br /&gt;
&lt;br /&gt;
===namelist.input===&lt;br /&gt;
&lt;br /&gt;
==Restarting simulations==&lt;br /&gt;
In the file namelist.input there is the option &amp;quot;restart&amp;quot;. The comment for this option says &amp;quot;Output restart files?&amp;quot; but actually it refers to whether or not the simulation should try to start from a previous simulation.&lt;br /&gt;
Restart files are periodically saved, this can be configured with restart_interval. The value is an integer number corresponding to the number of &amp;quot;minutes&amp;quot; (with a Martian hour having 37 minutes) between restart files. By default this is very long (8880, corresponding to 10 sols). If we write 37 it will be every hour. If we write 37*6 it will be every 6 hours, etc.&lt;br /&gt;
&lt;br /&gt;
To restart from an existing restart file, we must change the &amp;quot;restart&amp;quot; option to .true., and the start_month,start_day, and start_hour need to be updated to coincide with the time of the restart file. Since we can tune the starting of the simulation with a resolution of hours (and not minutes), this means that the restart files need to be saved at integer hours, and therefore the restart_interval option should have values 37*N, with N the number of hours of interval between restart files.&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting restart files in big simulations==&lt;br /&gt;
In big simulations restart files fail to be saved. This does not cause any problem, and the simulation keeps running. When increasing verbosity to one, the rsl.error file contains this error messages (Note that for this debug execution we set restart_interval to 1 to obtain the error quickly):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
 d01 2024-10-01_06:01:00 med_restart_out: opening wrfrst_d01_2024-10-01_06:01:00&lt;br /&gt;
  for writing&lt;br /&gt;
 d01 2024-10-01_06:01:00  NetCDF error: NetCDF: One or more variable sizes viola&lt;br /&gt;
 te format constraints&lt;br /&gt;
 d01 2024-10-01_06:01:00  NetCDF error in ext_ncd_open_for_write_commit wrf_io.F&lt;br /&gt;
 90, line        1279&lt;br /&gt;
 med_restart_out: opening wrfrst_d01_2024-10-01_06:01:00 for writing&lt;br /&gt;
 d01 2024-10-01_06:01:00  Warning 2 DRYRUNS 1 VARIABLE in wrf_io.F90, line&lt;br /&gt;
   2303&lt;br /&gt;
&lt;br /&gt;
[This line repeats many times]&lt;br /&gt;
&lt;br /&gt;
d01 2024-10-01_06:01:00  Warning 2 DRYRUNS 1 VARIABLE in wrf_io.F90, line&lt;br /&gt;
   2303&lt;br /&gt;
Timing for Writing restart for domain        1:    0.06920 elapsed seconds.&lt;br /&gt;
 d01 2024-10-01_06:01:00  Warning TRY TO CLOSE DRYRUN in ext_ncd_ioclose wrf_io.&lt;br /&gt;
 F90, line        1311&lt;br /&gt;
 d01 2024-10-01_06:01:00  NetCDF error: NetCDF: One or more variable sizes viola&lt;br /&gt;
 te format constraints&lt;br /&gt;
 d01 2024-10-01_06:01:00  NetCDF error in ext_ncd_ioclose wrf_io.F90, line&lt;br /&gt;
   1329&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem is in the file wrf_io.F90. When we execute a search for this file, there are various copies of it (only files with a number before deserve our attention, others are flags)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
NO./code/MESOSCALE/LMD_MM_MARS/mars_lmd_new_real_mpifort_64/WRFV2/inc/wrf_io_flags.h&lt;br /&gt;
02./code/MESOSCALE/LMD_MM_MARS/mars_lmd_new_real_mpifort_64/WRFV2/external/io_netcdf/wrf_io.F90&lt;br /&gt;
NO./code/MESOSCALE/LMD_MM_MARS/mars_lmd_new_real_mpifort_64/WRFV2/external/io_netcdf/wrf_io.o&lt;br /&gt;
04./code/MESOSCALE/LMD_MM_MARS/mars_lmd_new_real_mpifort_64/WRFV2/external/io_netcdf/wrf_io.f&lt;br /&gt;
NO./code/MESOSCALE/LMD_MM_MARS/mars_lmd_new_real_mpifort_64/WRFV2/external/io_grib_share/wrf_io_flags.h&lt;br /&gt;
06./code/MESOSCALE/LMD_MM_MARS/mars_lmd_new_real_mpifort_64/WRFV2/external/io_pnetcdf/wrf_io.F90&lt;br /&gt;
NO./code/MESOSCALE/LMD_MM_MARS/mars_lmd_new_real_mpifort_64/WRFV2/external/ioapi_share/wrf_io_flags.h&lt;br /&gt;
08./code/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/external/io_netcdf/wrf_io.F90&lt;br /&gt;
NO./code/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/external/io_grib_share/wrf_io_flags.h&lt;br /&gt;
10./code/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/external/io_pnetcdf/wrf_io.F90&lt;br /&gt;
NO./code/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/external/ioapi_share/wrf_io_flags.h&lt;br /&gt;
NO./code/MESOSCALE/LMD_MM_MARS/SRC/DEV/simpler_compile_LES_phys/external/io_grib_share/wrf_io_flags.h&lt;br /&gt;
NO./code/MESOSCALE/LMD_MM_MARS/SRC/LES/modif_mars/dble_preci/external/io_grib_share/wrf_io_flags.h&lt;br /&gt;
NO./code/MESOSCALE/LMD_MM_MARS/SRC/LES/modif_mars/dble_preci/external/ioapi_share/wrf_io_flags.h&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem is caused by the big size of the restart files, it will happen when files are bigger than 2gb. In line 1188 of wrf_io.*(1195 in some versions of the file we find:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
stat = NF_CREATE(FileName, NF_CLOBBER, DH%NCID)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This is documented in https://docs.unidata.ucar.edu/netcdf-fortran/current/nc_f77_interface_guide.html&lt;br /&gt;
&lt;br /&gt;
Apparently, these parameters only work when writing files smaller than 2gb. We can fix that be replacing this line by:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
stat = NF_CREATE(FileName, IOR(NF_CLOBBER,NF_64BIT_OFFSET), DH%NCID)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
IMPORTANT NOTES.&lt;br /&gt;
* Even if the error produced refers to wrf_io.F90, the problem didn't solve for me when updating just files finished by F90, I had to update them all.&lt;br /&gt;
* In some of these files the function is not NF_CREATE but something slightly different. The essence of the fix is to replace NF_CLOBBER by IOR(NF_CLOBBER,NF_64BIT_OFFSET)&lt;/div&gt;</summary>
		<author><name>Jorge</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Running_Mars_mesoscale_model&amp;diff=2432</id>
		<title>Running Mars mesoscale model</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Running_Mars_mesoscale_model&amp;diff=2432"/>
				<updated>2025-02-24T16:46:18Z</updated>
		
		<summary type="html">&lt;p&gt;Jorge: /* Troubleshooting restart files in big simulations (ONGOING) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is page I start to introduce some notes to remind that could be useful for other users (Jorge).&lt;br /&gt;
&lt;br /&gt;
The user manual can be found at https://gitlab.in2p3.fr/la-communaut-des-mod-les-atmosph-riques-plan-taires/git-trunk/-/blob/master/MESOSCALE/MANUAL/SRC/user_manual.pdf?ref_type=heads&lt;br /&gt;
&lt;br /&gt;
==Regarding NaNs and parallel running==&lt;br /&gt;
The mesoscale model cannot run in parallel in spirit at the moment, it runs but it outputs NaNs everywhere.&lt;br /&gt;
&lt;br /&gt;
When running in a single core, in my case at least it produces NaNs with low output frequency (37) but by increasing the output frequency (6 works for me) it is solved. This is weird but seem to be right.&lt;br /&gt;
&lt;br /&gt;
Increasing the output frequency in parallel runs doesn't work. Even with a frequency of 1 doesn't work.&lt;br /&gt;
&lt;br /&gt;
==Restarting simulations==&lt;br /&gt;
In the file namelist.input there is the option &amp;quot;restart&amp;quot;. The comment for this option says &amp;quot;Output restart files?&amp;quot; but actually it refers to whether or not the simulation should try to start from a previous simulation.&lt;br /&gt;
Restart files are periodically saved, this can be configured with restart_interval. The value is an integer number corresponding to the number of &amp;quot;minutes&amp;quot; (with a Martian hour having 37 minutes) between restart files. By default this is very long (8880, corresponding to 10 sols). If we write 37 it will be every hour. If we write 37*6 it will be every 6 hours, etc.&lt;br /&gt;
&lt;br /&gt;
To restart from an existing restart file, we must change the &amp;quot;restart&amp;quot; option to .true., and the start_month,start_day, and start_hour need to be updated to coincide with the time of the restart file. Since we can tune the starting of the simulation with a resolution of hours (and not minutes), this means that the restart files need to be saved at integer hours, and therefore the restart_interval option should have values 37*N, with N the number of hours of interval between restart files.&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting restart files in big simulations==&lt;br /&gt;
In big simulations restart files fail to be saved. This does not cause any problem, and the simulation keeps running. When increasing verbosity to one, the rsl.error file contains this error messages (Note that for this debug execution we set restart_interval to 1 to obtain the error quickly):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
 d01 2024-10-01_06:01:00 med_restart_out: opening wrfrst_d01_2024-10-01_06:01:00&lt;br /&gt;
  for writing&lt;br /&gt;
 d01 2024-10-01_06:01:00  NetCDF error: NetCDF: One or more variable sizes viola&lt;br /&gt;
 te format constraints&lt;br /&gt;
 d01 2024-10-01_06:01:00  NetCDF error in ext_ncd_open_for_write_commit wrf_io.F&lt;br /&gt;
 90, line        1279&lt;br /&gt;
 med_restart_out: opening wrfrst_d01_2024-10-01_06:01:00 for writing&lt;br /&gt;
 d01 2024-10-01_06:01:00  Warning 2 DRYRUNS 1 VARIABLE in wrf_io.F90, line&lt;br /&gt;
   2303&lt;br /&gt;
&lt;br /&gt;
[This line repeats many times]&lt;br /&gt;
&lt;br /&gt;
d01 2024-10-01_06:01:00  Warning 2 DRYRUNS 1 VARIABLE in wrf_io.F90, line&lt;br /&gt;
   2303&lt;br /&gt;
Timing for Writing restart for domain        1:    0.06920 elapsed seconds.&lt;br /&gt;
 d01 2024-10-01_06:01:00  Warning TRY TO CLOSE DRYRUN in ext_ncd_ioclose wrf_io.&lt;br /&gt;
 F90, line        1311&lt;br /&gt;
 d01 2024-10-01_06:01:00  NetCDF error: NetCDF: One or more variable sizes viola&lt;br /&gt;
 te format constraints&lt;br /&gt;
 d01 2024-10-01_06:01:00  NetCDF error in ext_ncd_ioclose wrf_io.F90, line&lt;br /&gt;
   1329&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem is in the file wrf_io.F90. When we execute a search for this file, there are various copies of it (only files with a number before deserve our attention, others are flags)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
NO./code/MESOSCALE/LMD_MM_MARS/mars_lmd_new_real_mpifort_64/WRFV2/inc/wrf_io_flags.h&lt;br /&gt;
02./code/MESOSCALE/LMD_MM_MARS/mars_lmd_new_real_mpifort_64/WRFV2/external/io_netcdf/wrf_io.F90&lt;br /&gt;
NO./code/MESOSCALE/LMD_MM_MARS/mars_lmd_new_real_mpifort_64/WRFV2/external/io_netcdf/wrf_io.o&lt;br /&gt;
04./code/MESOSCALE/LMD_MM_MARS/mars_lmd_new_real_mpifort_64/WRFV2/external/io_netcdf/wrf_io.f&lt;br /&gt;
NO./code/MESOSCALE/LMD_MM_MARS/mars_lmd_new_real_mpifort_64/WRFV2/external/io_grib_share/wrf_io_flags.h&lt;br /&gt;
06./code/MESOSCALE/LMD_MM_MARS/mars_lmd_new_real_mpifort_64/WRFV2/external/io_pnetcdf/wrf_io.F90&lt;br /&gt;
NO./code/MESOSCALE/LMD_MM_MARS/mars_lmd_new_real_mpifort_64/WRFV2/external/ioapi_share/wrf_io_flags.h&lt;br /&gt;
08./code/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/external/io_netcdf/wrf_io.F90&lt;br /&gt;
NO./code/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/external/io_grib_share/wrf_io_flags.h&lt;br /&gt;
10./code/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/external/io_pnetcdf/wrf_io.F90&lt;br /&gt;
NO./code/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/external/ioapi_share/wrf_io_flags.h&lt;br /&gt;
NO./code/MESOSCALE/LMD_MM_MARS/SRC/DEV/simpler_compile_LES_phys/external/io_grib_share/wrf_io_flags.h&lt;br /&gt;
NO./code/MESOSCALE/LMD_MM_MARS/SRC/LES/modif_mars/dble_preci/external/io_grib_share/wrf_io_flags.h&lt;br /&gt;
NO./code/MESOSCALE/LMD_MM_MARS/SRC/LES/modif_mars/dble_preci/external/ioapi_share/wrf_io_flags.h&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem is caused by the big size of the restart files, it will happen when files are bigger than 2gb. In line 1188 of wrf_io.*(1195 in some versions of the file we find:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
stat = NF_CREATE(FileName, NF_CLOBBER, DH%NCID)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This is documented in https://docs.unidata.ucar.edu/netcdf-fortran/current/nc_f77_interface_guide.html&lt;br /&gt;
&lt;br /&gt;
Apparently, these parameters only work when writing files smaller than 2gb. We can fix that be replacing this line by:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
stat = NF_CREATE(FileName, IOR(NF_CLOBBER,NF_64BIT_OFFSET), DH%NCID)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
IMPORTANT NOTES.&lt;br /&gt;
* Even if the error produced refers to wrf_io.F90, the problem didn't solve for me when updating just files finished by F90, I had to update them all.&lt;br /&gt;
* In some of these files the function is not NF_CREATE but something slightly different. The essence of the fix is to replace NF_CLOBBER by IOR(NF_CLOBBER,NF_64BIT_OFFSET)&lt;/div&gt;</summary>
		<author><name>Jorge</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Running_Mars_mesoscale_model&amp;diff=2431</id>
		<title>Running Mars mesoscale model</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Running_Mars_mesoscale_model&amp;diff=2431"/>
				<updated>2025-02-24T12:08:00Z</updated>
		
		<summary type="html">&lt;p&gt;Jorge: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is page I start to introduce some notes to remind that could be useful for other users (Jorge).&lt;br /&gt;
&lt;br /&gt;
The user manual can be found at https://gitlab.in2p3.fr/la-communaut-des-mod-les-atmosph-riques-plan-taires/git-trunk/-/blob/master/MESOSCALE/MANUAL/SRC/user_manual.pdf?ref_type=heads&lt;br /&gt;
&lt;br /&gt;
==Regarding NaNs and parallel running==&lt;br /&gt;
The mesoscale model cannot run in parallel in spirit at the moment, it runs but it outputs NaNs everywhere.&lt;br /&gt;
&lt;br /&gt;
When running in a single core, in my case at least it produces NaNs with low output frequency (37) but by increasing the output frequency (6 works for me) it is solved. This is weird but seem to be right.&lt;br /&gt;
&lt;br /&gt;
Increasing the output frequency in parallel runs doesn't work. Even with a frequency of 1 doesn't work.&lt;br /&gt;
&lt;br /&gt;
==Restarting simulations==&lt;br /&gt;
In the file namelist.input there is the option &amp;quot;restart&amp;quot;. The comment for this option says &amp;quot;Output restart files?&amp;quot; but actually it refers to whether or not the simulation should try to start from a previous simulation.&lt;br /&gt;
Restart files are periodically saved, this can be configured with restart_interval. The value is an integer number corresponding to the number of &amp;quot;minutes&amp;quot; (with a Martian hour having 37 minutes) between restart files. By default this is very long (8880, corresponding to 10 sols). If we write 37 it will be every hour. If we write 37*6 it will be every 6 hours, etc.&lt;br /&gt;
&lt;br /&gt;
To restart from an existing restart file, we must change the &amp;quot;restart&amp;quot; option to .true., and the start_month,start_day, and start_hour need to be updated to coincide with the time of the restart file. Since we can tune the starting of the simulation with a resolution of hours (and not minutes), this means that the restart files need to be saved at integer hours, and therefore the restart_interval option should have values 37*N, with N the number of hours of interval between restart files.&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting restart files in big simulations (ONGOING)==&lt;br /&gt;
In big simulations restart files fail to be saved. This does not cause any problem, and the simulation keeps running. When increasing verbosity to one, the rsl.error file contains this error messages (Note that for this debug execution we set restart_interval to 1 to obtain the error quickly):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
 d01 2024-10-01_06:01:00 med_restart_out: opening wrfrst_d01_2024-10-01_06:01:00&lt;br /&gt;
  for writing&lt;br /&gt;
 d01 2024-10-01_06:01:00  NetCDF error: NetCDF: One or more variable sizes viola&lt;br /&gt;
 te format constraints&lt;br /&gt;
 d01 2024-10-01_06:01:00  NetCDF error in ext_ncd_open_for_write_commit wrf_io.F&lt;br /&gt;
 90, line        1279&lt;br /&gt;
 med_restart_out: opening wrfrst_d01_2024-10-01_06:01:00 for writing&lt;br /&gt;
 d01 2024-10-01_06:01:00  Warning 2 DRYRUNS 1 VARIABLE in wrf_io.F90, line&lt;br /&gt;
   2303&lt;br /&gt;
&lt;br /&gt;
[This line repeats many times]&lt;br /&gt;
&lt;br /&gt;
d01 2024-10-01_06:01:00  Warning 2 DRYRUNS 1 VARIABLE in wrf_io.F90, line&lt;br /&gt;
   2303&lt;br /&gt;
Timing for Writing restart for domain        1:    0.06920 elapsed seconds.&lt;br /&gt;
 d01 2024-10-01_06:01:00  Warning TRY TO CLOSE DRYRUN in ext_ncd_ioclose wrf_io.&lt;br /&gt;
 F90, line        1311&lt;br /&gt;
 d01 2024-10-01_06:01:00  NetCDF error: NetCDF: One or more variable sizes viola&lt;br /&gt;
 te format constraints&lt;br /&gt;
 d01 2024-10-01_06:01:00  NetCDF error in ext_ncd_ioclose wrf_io.F90, line&lt;br /&gt;
   1329&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The problem is in the file wrf_io.F90. When we execute a search for this file, there are 4 different copies of it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
./code/MESOSCALE/LMD_MM_MARS/mars_lmd_new_real_mpifort_64/WRFV2/external/io_netcdf/wrf_io.F90&lt;br /&gt;
./code/MESOSCALE/LMD_MM_MARS/mars_lmd_new_real_mpifort_64/WRFV2/external/io_pnetcdf/wrf_io.F90&lt;br /&gt;
./code/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/external/io_netcdf/wrf_io.F90&lt;br /&gt;
./code/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/external/io_pnetcdf/wrf_io.F90&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apparently, the problem is related to the big size of the restart files. In line 1188 (1195 in some versions of the file we find:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
stat = NF_CREATE(FileName, NF_CLOBBER, DH%NCID)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This is documented in https://docs.unidata.ucar.edu/netcdf-fortran/current/nc_f77_interface_guide.html&lt;br /&gt;
&lt;br /&gt;
Apparently, these parameters only work when writing files smaller than 2gb. We can fix that be replacing this line by:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
stat = NF_CREATE(FileName, IOR(NF_CLOBBER,NF_64BIT_OFFSET), DH%NCID)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jorge</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Running_Mars_mesoscale_model&amp;diff=2430</id>
		<title>Running Mars mesoscale model</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Running_Mars_mesoscale_model&amp;diff=2430"/>
				<updated>2025-02-24T11:49:11Z</updated>
		
		<summary type="html">&lt;p&gt;Jorge: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is page I start to introduce some notes to remind that could be useful for other users (Jorge).&lt;br /&gt;
&lt;br /&gt;
The user manual can be found at https://gitlab.in2p3.fr/la-communaut-des-mod-les-atmosph-riques-plan-taires/git-trunk/-/blob/master/MESOSCALE/MANUAL/SRC/user_manual.pdf?ref_type=heads&lt;br /&gt;
&lt;br /&gt;
==Regarding NaNs and parallel running==&lt;br /&gt;
The mesoscale model cannot run in parallel in spirit at the moment, it runs but it outputs NaNs everywhere.&lt;br /&gt;
&lt;br /&gt;
When running in a single core, in my case at least it produces NaNs with low output frequency (37) but by increasing the output frequency (6 works for me) it is solved. This is weird but seem to be right.&lt;br /&gt;
&lt;br /&gt;
Increasing the output frequency in parallel runs doesn't work. Even with a frequency of 1 doesn't work.&lt;br /&gt;
&lt;br /&gt;
==Restarting simulations==&lt;br /&gt;
In the file namelist.input there is the option &amp;quot;restart&amp;quot;. The comment for this option says &amp;quot;Output restart files?&amp;quot; but actually it refers to whether or not the simulation should try to start from a previous simulation.&lt;br /&gt;
Restart files are periodically saved, this can be configured with restart_interval. The value is an integer number corresponding to the number of &amp;quot;minutes&amp;quot; (with a Martian hour having 37 minutes) between restart files. By default this is very long (8880, corresponding to 10 sols). If we write 37 it will be every hour. If we write 37*6 it will be every 6 hours, etc.&lt;br /&gt;
&lt;br /&gt;
To restart from an existing restart file, we must change the &amp;quot;restart&amp;quot; option to .true., and the start_month,start_day, and start_hour need to be updated to coincide with the time of the restart file. Since we can tune the starting of the simulation with a resolution of hours (and not minutes), this means that the restart files need to be saved at integer hours, and therefore the restart_interval option should have values 37*N, with N the number of hours of interval between restart files.&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting restart files in big simulations==&lt;br /&gt;
Restart files&lt;/div&gt;</summary>
		<author><name>Jorge</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Running_Mars_mesoscale_model&amp;diff=2424</id>
		<title>Running Mars mesoscale model</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Running_Mars_mesoscale_model&amp;diff=2424"/>
				<updated>2025-02-13T14:11:11Z</updated>
		
		<summary type="html">&lt;p&gt;Jorge: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is page I start to introduce some notes to remind that could be useful for other users (Jorge).&lt;br /&gt;
&lt;br /&gt;
The user manual can be found at https://gitlab.in2p3.fr/la-communaut-des-mod-les-atmosph-riques-plan-taires/git-trunk/-/blob/master/MESOSCALE/MANUAL/SRC/user_manual.pdf?ref_type=heads&lt;br /&gt;
&lt;br /&gt;
==Regarding NaNs and parallel running==&lt;br /&gt;
The mesoscale model cannot run in parallel in spirit at the moment, it runs but it outputs NaNs everywhere.&lt;br /&gt;
&lt;br /&gt;
When running in a single core, in my case at least it produces NaNs with low output frequency (37) but by increasing the output frequency (6 works for me) it is solved. This is weird but seem to be right.&lt;br /&gt;
&lt;br /&gt;
Increasing the output frequency in parallel runs doesn't work. Even with a frequency of 1 doesn't work.&lt;/div&gt;</summary>
		<author><name>Jorge</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Running_Mars_mesoscale_model&amp;diff=2423</id>
		<title>Running Mars mesoscale model</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Running_Mars_mesoscale_model&amp;diff=2423"/>
				<updated>2025-02-13T14:00:23Z</updated>
		
		<summary type="html">&lt;p&gt;Jorge: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is page I start to introduce some notes to remind that could be useful for other users (Jorge).&lt;br /&gt;
&lt;br /&gt;
The user manual can be found at https://gitlab.in2p3.fr/la-communaut-des-mod-les-atmosph-riques-plan-taires/git-trunk/-/blob/master/MESOSCALE/MANUAL/SRC/user_manual.pdf?ref_type=heads&lt;br /&gt;
&lt;br /&gt;
==Regarding NaNs and parallel running==&lt;br /&gt;
The mesoscale model cannot run in parallel in spirit at the moment, it runs but it outputs NaNs everywhere.&lt;br /&gt;
&lt;br /&gt;
When running in a single core, in my case at least it produces NaNs with low output frequency (37) but by increasing the output frequency (6 works for me) it is solved. This is weird but seem to be right.&lt;/div&gt;</summary>
		<author><name>Jorge</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Running_Mars_mesoscale_model&amp;diff=2422</id>
		<title>Running Mars mesoscale model</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Running_Mars_mesoscale_model&amp;diff=2422"/>
				<updated>2025-02-13T13:59:44Z</updated>
		
		<summary type="html">&lt;p&gt;Jorge: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is page I start to introduce some notes to remind that could be useful for other users (Jorge).&lt;br /&gt;
&lt;br /&gt;
The user manual can be found at https://gitlab.in2p3.fr/la-communaut-des-mod-les-atmosph-riques-plan-taires/git-trunk/-/blob/master/MESOSCALE/MANUAL/SRC/user_manual.pdf?ref_type=heads&lt;br /&gt;
&lt;br /&gt;
==Regarding NaNs and parallel running==&lt;br /&gt;
The mesoscale model cannot run in parallel in spirit at the moment, it runs but it outputs NaNs everywhere.&lt;br /&gt;
&lt;br /&gt;
When running in a single core, in my case at least it produces NaNs with low output frequency (37) but by reducing the output frequency to 6 it is solved. This is weird but seem to be right.&lt;/div&gt;</summary>
		<author><name>Jorge</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Running_Mars_mesoscale_model&amp;diff=2421</id>
		<title>Running Mars mesoscale model</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Running_Mars_mesoscale_model&amp;diff=2421"/>
				<updated>2025-02-13T13:52:51Z</updated>
		
		<summary type="html">&lt;p&gt;Jorge: Created page with &amp;quot;This is page I start to introduce some notes to remind that could be useful for other users (Jorge).  The user manual can be found at https://gitlab.in2p3.fr/la-communaut-des-...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is page I start to introduce some notes to remind that could be useful for other users (Jorge).&lt;br /&gt;
&lt;br /&gt;
The user manual can be found at https://gitlab.in2p3.fr/la-communaut-des-mod-les-atmosph-riques-plan-taires/git-trunk/-/blob/master/MESOSCALE/MANUAL/SRC/user_manual.pdf?ref_type=heads&lt;br /&gt;
&lt;br /&gt;
The mesoscale model cannot run in parallel in spirit at the moment, it runs but it outputs NaNs everywhere.&lt;br /&gt;
&lt;br /&gt;
When running in a single core, in my case at least it produces NaNs with low output frequency (37) but by reducing the output frequency to 6 it is solved. This is weird but seem to be right.&lt;/div&gt;</summary>
		<author><name>Jorge</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Installing_Mars_mesoscale_model_on_spirit&amp;diff=2362</id>
		<title>Installing Mars mesoscale model on spirit</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Installing_Mars_mesoscale_model_on_spirit&amp;diff=2362"/>
				<updated>2025-02-10T22:11:44Z</updated>
		
		<summary type="html">&lt;p&gt;Jorge: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Set up environment ==&lt;br /&gt;
=== Option 1 ===&lt;br /&gt;
Add this in your ~/.bashrc then source the file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;&lt;br /&gt;
module purge&lt;br /&gt;
module load intel/2021.4.0&lt;br /&gt;
module load intel-mkl/2020.4.304&lt;br /&gt;
module load openmpi/4.0.7&lt;br /&gt;
module load hdf5/1.10.7-mpi&lt;br /&gt;
module load netcdf-fortran/4.5.3-mpi&lt;br /&gt;
module load netcdf-c/4.7.4-mpi&lt;br /&gt;
declare -x WHERE_MPI=/net/nfs/tools/u20/22.3/PrgEnv/intel/linux-ubuntu20.04-zen2/openmpi/4.0.7-intel-2021.4.0-43fdcnab3ydwu7ycrplnzlp6xieusuz7/bin/&lt;br /&gt;
declare -x NETCDF=/scratchu/spiga/les_mars_project_spirit/netcdf_hacks/SPIRIT&lt;br /&gt;
declare -x NCDFLIB=$NETCDF/lib&lt;br /&gt;
declare -x NCDFINC=$NETCDF/include&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Do not forget to declare the local directory in PATH by adding this to your ~/.bashrc&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;&lt;br /&gt;
declare -x PATH=./:$PATH&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is necessary to unlimit the stacksize to avoit unwanted segmentation faults by adding this to your ~/.bashrc&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;&lt;br /&gt;
ulimit -s unlimited&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the end, source the .bashrc file!&lt;br /&gt;
&lt;br /&gt;
=== Option 2 ===&lt;br /&gt;
If you prefer to not modify your .bashrc file, you should instead put all the lines in a &amp;quot;mesoscale.env&amp;quot; file and add a&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
source mesoscale.env&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
at the beginning of the meso_install.sh script.&lt;br /&gt;
&lt;br /&gt;
Note that you will still need to have &amp;quot;.&amp;quot; in your PATH and unlimited stacksize. So you will definitely need to have:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;&lt;br /&gt;
declare -x PATH=./:$PATH&lt;br /&gt;
ulimit -s unlimited&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
in your .bashrc file&lt;br /&gt;
&lt;br /&gt;
=== Extra technical details===&lt;br /&gt;
* WRF needs a NETCDF environment variable where everything is in the same dir (Fortran and C stuff). If this is not available one needs to create a uniquer dire with links to all the C and Fortran stuff. NCDFLIB and NCDFINC are for the physics.&lt;br /&gt;
* WHERE_MPI env variable is used by some scripts to make sure we use the right one&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Set up the installer ==&lt;br /&gt;
&lt;br /&gt;
Go to your 'data' directory (cd /homedata/_MY_LOGIN_ ''or'' cd /data/_MY_LOGIN_) and download the installer with the following command&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;&lt;br /&gt;
svn co https://svn.lmd.jussieu.fr/Planeto/trunk/MESOSCALE/LMD_MM_MARS/SIMU&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure the installer can be executed&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod 755 SIMU/meso_install.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make a link (e.g. where you are, in the parent directory of /data) to the main script in this SIMU directory&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -sf SIMU/meso_install.sh .&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Run the installer with a simple display of possible options&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;&lt;br /&gt;
./meso_install.sh -h&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install the code ==&lt;br /&gt;
&lt;br /&gt;
Update to the latest version of installer&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;&lt;br /&gt;
cd SIMU&lt;br /&gt;
svn update&lt;br /&gt;
chmod 755 meso_install.sh&lt;br /&gt;
cd ..&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Run the installer by providing a name for your specific directory&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;&lt;br /&gt;
./meso_install.sh -n DESCRIBE_YOUR_RESEARCH_PROJECT&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
''Important'': This will only work if you have access (i.e. an account) to the IN2P3 Gitlab project &amp;quot;La communauté des modèles atmosphériques planétaires&amp;quot; AND if you have added your personal ssh key there. Otherwise proceed as indicated below.&lt;br /&gt;
&lt;br /&gt;
''Special case'': In case you do not have a gitlab account, ask for an archive (tar.gz) of the code.&lt;br /&gt;
Let us assume the name is git-trunk-mesoscale-compile-run-spirit.tar.gz &lt;br /&gt;
and the file is in the current directory (for instance in /homedata/_MY_LOGIN_)&lt;br /&gt;
then run the installer with the following command&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;&lt;br /&gt;
./meso_install.sh -n DESCRIBE_YOUR_RESEARCH_PROJECT -a git-trunk-mesoscale-compile-run-spirit&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Troubleshooting (in case this happens to you) ===&lt;br /&gt;
If GCM compilation fails with error message &amp;quot;Can't locate Fcm/Config.pm in @INC (you may need to install the Fcm::Config module)&amp;quot;, this is because &amp;quot;.&amp;quot; is in your PATH before &amp;quot;FCM_V1.2/bin&amp;quot;. &lt;br /&gt;
You can fix it by either adapting the PATH in the environment file by adding&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;&lt;br /&gt;
declare -x PATH=/homedata/_MY_LOGIN_/DESCRIBE_YOUR_RESEARCH_PROJECT/code/LMDZ.COMMON/FCM_V1.2/bin/:$PATH&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or by removing the symbolic link to &amp;quot;fcm&amp;quot; in &amp;quot;/homedata/_MY_LOGIN_/DESCRIBE_YOUR_RESEARCH_PROJECT/code/LMDZ.COMMON/&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Once you have fixed the problem you can recompile the GCM (which had failed previously) by doing:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /homedata/_MY_LOGIN_/DESCRIBE_YOUR_RESEARCH_PROJECT/&lt;br /&gt;
./compile_gcm.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
and recreate start files from a sample start_archive.nc by doing (in subdirectory gcm/newstart)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;&lt;br /&gt;
./mini_startbase.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A different option is to fix the problem directly in the meso_install.sh script, by adding this line (anywhere below the definition of $refrepo )&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;&lt;br /&gt;
 declare -x PATH=$refrepo/code/LMDZ.COMMON/FCM_V1.2/bin/:$PATH&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Extra technical stuff ===&lt;br /&gt;
&lt;br /&gt;
* in meso_install.sh is hard coded the git tag of the version that will be installed e.g. version=&amp;quot;tags/mesoscale-compile-run_MESOIPSL_exploration&amp;quot;. the tags point to specific versions which have been tested and are thus reference. e.g. mesoscale_compile-run_MESOIPSL on the git-trunk&lt;br /&gt;
&lt;br /&gt;
* To recompile WRF (see &amp;quot;readme&amp;quot; file)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;&lt;br /&gt;
cd code/MESOSCALE/LMD_MM_MARS&lt;br /&gt;
makemeso -p mars_lmd_new&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
To recompile WRF in debug mode:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;&lt;br /&gt;
cd code/MESOSCALE/LMD_MM_MARS&lt;br /&gt;
makemeso -p mars_lmd_new -g&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The compilation script (and options) is in MESOSCALE/LMD_MM_MARS/SRC/WRFV2/mars_lmd_new/makegcm_mpifort for physics&lt;br /&gt;
And in MESOSCALE/LMD_MM_MARS/makemeso for WRF&lt;br /&gt;
&lt;br /&gt;
== Run the full workflow GCM + initialization + mesoscale model ==&lt;br /&gt;
&lt;br /&gt;
Have a look in the script named launch just for info or to change the number of processors or the step at which you start. Send the launch job to the cluster by typing (note that you can change the number of core to run with in the header of the script, e.g. ''#SBATCH --ntasks=24'' to use 24 cores, but this doesn't work for now...)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;&lt;br /&gt;
sbatch launch&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
IMPORTANT: if you have used &amp;quot;Option 2&amp;quot; in the setup/environment, i.e. creating a dedicated &amp;quot;mesoscale.env&amp;quot; file, then you should source it in the &amp;quot;launch&amp;quot; script with something of the likes of:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;&lt;br /&gt;
source ../mesoscale.env&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can check the status of the run by typing&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;&lt;br /&gt;
squeue -u $USER&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Extra technical stuff ===&lt;br /&gt;
* The namelist.input file contains inputs for WRF. One can change output rate by specifying &amp;quot;history_interval_s&amp;quot; in seconds (instead of &amp;quot;history_interval&amp;quot;), e.g. set to the timestep for an output at every step to debug.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;&lt;br /&gt;
history_interval_s=20&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* to run in hydrostatic mode: it is a parameter for &amp;quot;&amp;amp;dynamics&amp;quot; namelist&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Bash&amp;quot;&amp;gt;&lt;br /&gt;
non_hydrostatic=F&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Note that the full list of options for namelist.in can be found in &amp;quot;SIMU/namelist.input_full&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== A more detailed run ==&lt;br /&gt;
&lt;br /&gt;
The best is probably to use a more complete startbase than the minimal one that was created. For instance, to get a more complete startbase, link 'data_gcm' to point towards '/data/spiga/2021_STARTBASES_rev2460/MY35'&lt;br /&gt;
&lt;br /&gt;
To use the tyler cap setting in namelist.wps, download the tylerall archive here 'https://web.lmd.jussieu.fr/~aslmd/mesoscale_model/data_static/' and extract the content in the folder named data_static&lt;br /&gt;
&lt;br /&gt;
[[Category:Mars-Mesoscale]]&lt;/div&gt;</summary>
		<author><name>Jorge</name></author>	</entry>

	</feed>