<?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=Csegonne</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=Csegonne"/>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/Special:Contributions/Csegonne"/>
		<updated>2026-06-11T15:01:36Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.7</generator>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Vdifc_mod&amp;diff=2215</id>
		<title>Vdifc mod</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Vdifc_mod&amp;diff=2215"/>
				<updated>2024-11-21T10:37:44Z</updated>
		
		<summary type="html">&lt;p&gt;Csegonne: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''IMPORTANT''': This page concerns the vdifc routine in the Mars physics package (by the way the latest version may be checked here on the trac: https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/libf/phymars/vdifc_mod.F)&lt;br /&gt;
&lt;br /&gt;
== Overview of the vdifc routine ==&lt;br /&gt;
&lt;br /&gt;
Vdifc is a Fortran routine used to compute the turbulent diffusion for the temperature, the wind (U and V, horizontal wind only) and all tracers. It works in a implicit fashion as it actually solves the following equation :&lt;br /&gt;
&lt;br /&gt;
x(t+1) =  x(t) + dt * (dx/dt)phys(t)  +  dt * (dx/dt)difv(t+1)&lt;br /&gt;
&lt;br /&gt;
Authorship : Hourdin/Forget/Fournier&lt;br /&gt;
&lt;br /&gt;
== Naming convention of the variables ==&lt;br /&gt;
&lt;br /&gt;
As this routine is very ancient, it has been written using the old convention for variables. At first sight they seem hard to read but their nomenclature is very straightforward :&lt;br /&gt;
&lt;br /&gt;
 - All variables coming from an upper-level subroutine are preceded by the letter &amp;quot;p&amp;quot;. This includes output variables in vdifc like &amp;quot;pdudif(ngrid,nlay),pdvdif(ngrid,nlay),pdqdif(ngrid,nlay,nq),pdqsdif(ngrid,nq)&amp;quot; and others.&lt;br /&gt;
 - All local variables are preceded by the letter &amp;quot;z&amp;quot;. Those are variables used specifically in vdifc_mod, such as &amp;quot;ztrsf&amp;quot; for the treatment of surface water ice, or &amp;quot;za, zb, zc, zq1temp&amp;quot; for the implicit scheme.&lt;br /&gt;
 - The routine computes tendencies which are later added to the physical variables outside of vdifc_mod, in physiq_mod.F. The tendency variables are named with the suffix &amp;quot;dif&amp;quot; such as &amp;quot;pdudif(ngrid,nlay), dwatercap_dif(ngrid,nlay)&amp;quot;. This is specific to vdifc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Exhaustive inventory of variables used in vdifc_mod.F ==&lt;br /&gt;
&lt;br /&gt;
Someone do something about za, zb, zc...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Explanation of the subtimestep for water ice condensation/sublimation ==&lt;br /&gt;
&lt;br /&gt;
[[Category:Mars-Model]]&lt;/div&gt;</summary>
		<author><name>Csegonne</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Vdifc_mod&amp;diff=2214</id>
		<title>Vdifc mod</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Vdifc_mod&amp;diff=2214"/>
				<updated>2024-11-21T10:34:51Z</updated>
		
		<summary type="html">&lt;p&gt;Csegonne: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''IMPORTANT''': This page concerns the vdifc routine in the Mars physics package (by the way the latest version may be checked here on the trac: https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/libf/phymars/vdifc_mod.F)&lt;br /&gt;
&lt;br /&gt;
An Overleaf document about vdifc_mod is available here: https://fr.overleaf.com/project/6463f677f39720c0fae06c68&lt;br /&gt;
&lt;br /&gt;
== Overview of the vdifc routine ==&lt;br /&gt;
&lt;br /&gt;
Vdifc is a Fortran routine used to compute the turbulent diffusion for the temperature, the wind (U and V, horizontal wind only) and all tracers. It works in a implicit fashion as it actually solves the following equation :&lt;br /&gt;
&lt;br /&gt;
x(t+1) =  x(t) + dt * (dx/dt)phys(t)  +  dt * (dx/dt)difv(t+1)&lt;br /&gt;
&lt;br /&gt;
Authorship : Hourdin/Forget/Fournier&lt;br /&gt;
&lt;br /&gt;
== Naming convention of the variables ==&lt;br /&gt;
&lt;br /&gt;
As this routine is very ancient, it has been written using the old convention for variables. At first sight they seem hard to read but their nomenclature is very straightforward :&lt;br /&gt;
&lt;br /&gt;
 - All variables coming from an upper-level subroutine are preceded by the letter &amp;quot;p&amp;quot;. This includes output variables in vdifc like &amp;quot;pdudif(ngrid,nlay),pdvdif(ngrid,nlay),pdqdif(ngrid,nlay,nq),pdqsdif(ngrid,nq)&amp;quot; and others.&lt;br /&gt;
 - All local variables are preceded by the letter &amp;quot;z&amp;quot;. Those are variables used specifically in vdifc_mod, such as &amp;quot;ztrsf&amp;quot; for the treatment of surface water ice, or &amp;quot;za, zb, zc, zq1temp&amp;quot; for the implicit scheme.&lt;br /&gt;
 - The routine computes tendencies which are later added to the physical variables outside of vdifc_mod, in physiq_mod.F. The tendency variables are named with the suffix &amp;quot;dif&amp;quot; such as &amp;quot;pdudif(ngrid,nlay), dwatercap_dif(ngrid,nlay)&amp;quot;. This is specific to vdifc.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Exhaustive inventory of variables used in vdifc_mod.F ==&lt;br /&gt;
&lt;br /&gt;
Someone do something about za, zb, zc...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Explanation of the subtimestep for water ice condensation/sublimation ==&lt;br /&gt;
&lt;br /&gt;
[[Category:Mars-Model]]&lt;/div&gt;</summary>
		<author><name>Csegonne</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Installing_Mars_mesoscale_model_on_spirit&amp;diff=2055</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=2055"/>
				<updated>2024-05-15T13:37:10Z</updated>
		
		<summary type="html">&lt;p&gt;Csegonne: /* Troubleshooting (in case this happens to you) */&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;
=== 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>Csegonne</name></author>	</entry>

	</feed>