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

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dynamico-giant&amp;diff=1976</id>
		<title>Dynamico-giant</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dynamico-giant&amp;diff=1976"/>
				<updated>2024-03-06T17:30:01Z</updated>
		
		<summary type="html">&lt;p&gt;LTeinturier: /* I) Appel à la physique */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[transferred from github, now active here]&lt;br /&gt;
&lt;br /&gt;
= 1. Introduction =&lt;br /&gt;
&lt;br /&gt;
&amp;amp;quot;Welcome to the dynamico-giant wiki&amp;amp;quot;&lt;br /&gt;
&lt;br /&gt;
Dynamico-giant est un dépôt git qui permet d'installer le modèle Dynamico avec les fichiers de configs propres aux planètes géantes gazeuses et géantes glacées. Ci-dessous, vous trouverez presque (car nous ne sommes pas parfaits) toutes les informations sur l'installation, la compilation du modèle et les paramètres que vous pouvez modifier pour faire tourner le modèle.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;quot;Allons-y!&amp;amp;quot;&lt;br /&gt;
&lt;br /&gt;
= 2. Installation =&lt;br /&gt;
&lt;br /&gt;
== A) Fichiers d'architecture ==&lt;br /&gt;
&lt;br /&gt;
=== - Modules ===&lt;br /&gt;
&lt;br /&gt;
Before installation, set environment (do it once) in your .bash_profile.&lt;br /&gt;
&lt;br /&gt;
Modules used on Occigen:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ulimit -s unlimited&lt;br /&gt;
# modules&lt;br /&gt;
module purge&lt;br /&gt;
module load intel/17.0&lt;br /&gt;
module load intelmpi/2017.0.098&lt;br /&gt;
module load hdf5/1.8.17&lt;br /&gt;
module load netcdf/4.4.0_fortran-4.4.2&lt;br /&gt;
module load ncview&lt;br /&gt;
module load nco&lt;br /&gt;
module load qt&lt;br /&gt;
module load python&amp;lt;/pre&amp;gt;&lt;br /&gt;
Modules used on Ciclad:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;ulimit -s unlimited&lt;br /&gt;
# modules&lt;br /&gt;
module purge&lt;br /&gt;
module load gnu/4.9.3 &lt;br /&gt;
module load intel/15.0.6.233&lt;br /&gt;
module load openmpi/1.6.5-ifort&lt;br /&gt;
module load hdf5/1.8.18-parallel-ifort&lt;br /&gt;
module load netcdf4/4.4.1.1-parallel-ifort&amp;lt;/pre&amp;gt;&lt;br /&gt;
Beware, if you change version of model (newer or older version), it's possible that you have to change modules...&lt;br /&gt;
&lt;br /&gt;
=== - Installation sur un nouveau cluster ===&lt;br /&gt;
&lt;br /&gt;
En pratique LMDZ.COMMON, ICOSA_LMDZ et IOIPSL peuvent utiliser exactement le même fichier arch.fcm ; mais celui pour ICOSAGCM est légèrement différent (les %FPP_DEF diffèrent, peut-être aussi le %FPP).&lt;br /&gt;
&lt;br /&gt;
make_icosa_lmdz doit être lancé avec -arch_path ../ARCH puisque les arch.env et arch.path communs se trouvent dans ../ARCH (l'option -arch_path ne concerne d'ailleurs que les fichiers arch.env et arch.path; le fichier arch.fcm recherché sera toujours celui dans le &amp;amp;quot;arch&amp;amp;quot; de chacun des modèles. Donc il faut bien mettre pour chacun des quatre modèles (LMDZ.COMMON, ICOSA_LMDZ,IOIPSL et ICOSAGCM) le arch.fcm dans le sous-dossier arch/ du modèle correspondant.&lt;br /&gt;
&lt;br /&gt;
L'installation d'IOIPSL doit se faire à partir du bon script bash. Si vous utilisez un server autre qu'occigen, il vous faut changer le nom du script à utiliser dans install_ioipsl.sh. Par exemple, il vous faudra utiliser install_ioipsl_ciclad-ifort.bash pour CICLAD.&lt;br /&gt;
&lt;br /&gt;
XIOS est écrit en C++, et pas en Fortran. Le fichier arch.fcm correspondant est donc nécessairement différent de celui des quatre autres modèles. Pour créér ce arch.fcm, prendre exemple sur les fichiers .fcm déjà présent dans XIOS/arch/, avec une architecture similaire à celle du nouveau cluster. En particulier, il faut utiliser des versions de gcc/gfortran &amp;amp;gt; 6+. Il faut absolument avoir une bibliothèque HDF5 compilée en parallèle, ainsi que netcdf-C et netcdf-fortran (et peut être aussi netcdf-Cxx) compilé en parallèle. Sans ça, il sera peut-être possible de compiler le modèle, mais pas de lancer une simulation en utilisant XIOS.&lt;br /&gt;
&lt;br /&gt;
== B. Download ==&lt;br /&gt;
&lt;br /&gt;
Download structure&lt;br /&gt;
&lt;br /&gt;
Take place on a repository and git clone the model.&lt;br /&gt;
&lt;br /&gt;
On occigen:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd $SCRATCHDIR&lt;br /&gt;
git clone https://github.com/aymeric-spiga/dynamico-giant.git [optional different name]&amp;lt;/pre&amp;gt;&lt;br /&gt;
== C. Install ==&lt;br /&gt;
&lt;br /&gt;
Install code&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd dynamico-giant&lt;br /&gt;
./install.sh&lt;br /&gt;
./install_ioipsl.sh&amp;lt;/pre&amp;gt;&lt;br /&gt;
A login and a password are necessary to install IOIPSL (only for the first time, after that we can save them). Please contact TGCC computing center to get the login/password.&lt;br /&gt;
&lt;br /&gt;
After that, please add &amp;amp;quot;$PWD&amp;amp;quot;/FCM_V1.2/bin/ to PATH environment variable.&lt;br /&gt;
&lt;br /&gt;
Ant that's all, we can now change parameters of files or compile the code to do a test (part 6) or eat a beautiful tartiflette (can be also do during compilation).&lt;br /&gt;
&lt;br /&gt;
= 3. General parameters =&lt;br /&gt;
&lt;br /&gt;
== A) Mesh grid &amp;amp;amp; resolution ==&lt;br /&gt;
&lt;br /&gt;
On run_icosa.def:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;nbp --&amp;amp;gt; number of subdivision on a main triangle: integer (default=40)&lt;br /&gt;
        nbp = sqrt((nbr_lat x nbr_lon)/10)&lt;br /&gt;
        nbp                 20  40  80 160&lt;br /&gt;
        T-edge length (km) 500 250 120  60&lt;br /&gt;
        Example: nbp(128x96)=35 -&amp;amp;gt; 40&lt;br /&gt;
                 nbp(256x192)=70 -&amp;amp;gt; 80&lt;br /&gt;
                 nbp(360x720)=160 -&amp;amp;gt; 160&lt;br /&gt;
nsplit_i, nsplit_j --&amp;amp;gt; sub splitting of main rhombus: integer&lt;br /&gt;
                        Example: for nbp=80, nsplit_i=4,nsplit_j=6&lt;br /&gt;
                        nbp/nsplit_{i,j} = 20 &amp;amp;gt; 10 &amp;amp;amp; 13 &amp;amp;gt; 10 --&amp;amp;gt; GOOD&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== - Remapping ===&lt;br /&gt;
&lt;br /&gt;
Pour le remapping, il faut aller dans context_lmdz_physics.xml changer les paramètres ni_glo et nj_glo par exemple pour remapper sur du lat/lon à 360 pts en latitude et 720 pts en longitude (0.5°).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;amp;lt;domain id=&amp;amp;quot;dom_regular&amp;amp;quot; ni_glo=&amp;amp;quot;720&amp;amp;quot; nj_glo=&amp;amp;quot;360&amp;amp;quot; type=&amp;amp;quot;rectilinear&amp;amp;quot;&amp;amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== B) Time ==&lt;br /&gt;
&lt;br /&gt;
* ndays is number of days to simulate.&lt;br /&gt;
* day_step is number of dynamical time step per day&lt;br /&gt;
* Dynamics called every day_length(in s) / day_step per day&lt;br /&gt;
* 1 ts (physical timestep) = (day_length(in s)/day_step) x itau_physics&lt;br /&gt;
* Physics called (day_step / itau_physics) per day&lt;br /&gt;
* Physics called day_length(in s) / ts per day&lt;br /&gt;
* Radiative called every Physics x iradia physical timestep&lt;br /&gt;
* Radiative called every iradia/Physics days&lt;br /&gt;
&lt;br /&gt;
== C) Sponge layer ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;iflag_sponge=0 for no sponge (default)&lt;br /&gt;
iflag_sponge=1 for sponge over 4 topmost layers&lt;br /&gt;
iflag_sponge=2 for sponge from top to ~1% of top layer pressure&lt;br /&gt;
mode_sponge=1 for u,v --&amp;amp;gt; 0&lt;br /&gt;
mode_sponge=2 for u,v --&amp;amp;gt; zonal mean&lt;br /&gt;
mode_sponge=3 for u,v,h --&amp;amp;gt; zonal mean&lt;br /&gt;
tau_sponge --&amp;amp;gt; damping frequency at last layer&lt;br /&gt;
           --&amp;amp;gt; e-5 medium / e-4 strong yet reasonable / e-3 very strong&amp;lt;/pre&amp;gt;&lt;br /&gt;
Spiga et al (2020): Shaw and Shepherd (2007) showed that the inclusion of sponge-layer parameterizations that do not conserve angular momentum (which is the case for Rayleigh drag), or allow for momentum to escape to space, implies a sensitivity of the dynamical results (especially zonal wind speed) to the choice for model top or drag characteristic timescale, because of spurious downward influence when momentum conservation is violated.&lt;br /&gt;
&lt;br /&gt;
Il ne faut donc pas ajouter de sponge layer pour les planètes géantes (iflag_sponge = 0)&lt;br /&gt;
&lt;br /&gt;
== D) Dissipation ==&lt;br /&gt;
&lt;br /&gt;
Spiga et al (2020): A subgrid-scale dissipation term is included in our Saturn DYNAMICO GCM to prevent the accumulation of energy at scales close to the grid resolution, caused by the GCM not resolving the turbulent scales at which this energy is dissipated. This hyperviscosity term is written in our Saturn DYNAMICO model as an iterated Laplacian term on a given variable. The three variables denoted are vorticity, divergence, and potential temperature, chosen to set horizontal dissipation on respectively the rotational component of the flow (e.g. Rossby waves), the divergent component of the flow (e.g. gravity waves), and the diabatic perturbations (e.g. coming from the physical packages).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tau_graddiv --&amp;amp;gt; dissipation timescale of smallest wvl: u,v (gradiv) : real (default=5000)&lt;br /&gt;
tau_gradrot --&amp;amp;gt; dissipation timescale of smallest wvl: u,v (nxgradrot) : real (default=5000)&lt;br /&gt;
tau_divgrad --&amp;amp;gt; dissipation timescale of smallest wvl: h (divgrad) : real (default=5000)&lt;br /&gt;
nitergdiv --&amp;amp;gt; number of iterations for gradiv operator : integer (default=1)&lt;br /&gt;
nitergrot --&amp;amp;gt; number of iterations for nxgradrot operator : integer (default=1)&lt;br /&gt;
niterdivgrad --&amp;amp;gt; number of iterations for divgrad operator : integer (default=1)&amp;lt;/pre&amp;gt;&lt;br /&gt;
tau_graddiv,tau_gradrot,tau_divgrad correspondent au temps de dissipation (plus c'est petit, plus la dissipation est efficace). nitergdiv,nitergrot,niterdivgrad correspondent à l'ordre du laplacien (plus c'est grand, plus on dissipe sélectivement les petites échelles).&lt;br /&gt;
&lt;br /&gt;
Attention, Trop dissiper -&amp;amp;gt; instabilité numérique&lt;br /&gt;
&lt;br /&gt;
Pas assez dissiper -&amp;amp;gt; instabilité dynamique trop forte&lt;br /&gt;
&lt;br /&gt;
L'ordre du laplacien dans les fichiers .def est suffisant. S'il faut changer la dissipation, il vaut mieux changer les temps de dissipation que l'ordre du laplacien (risque d'instabilité numérique).&lt;br /&gt;
&lt;br /&gt;
=== - Facteurs de dissipation ===&lt;br /&gt;
&lt;br /&gt;
A partir de ces valeurs de temps de dissipation, il est également possible d'ajouter 2 facteurs de dissipation (fac_mid et fac_up) qui permettent d'augmenter la dissipation à partir de certains niveaux. Le fac_mid permet de diminuer le temps de dissipation d'un facteur sur toute l'atmosphère jusqu'au bottom. Il y a une zone transition de quelques niveaux entre le bottom (le temp de dissipation au bottom est sans facteur) et quelques niveaux au-dessus où la valeur du temps de dissipation est avec ce facteur jusqu'au top. On ne peut donc pas choisir l'altitude et la zone de transition avec ce facteur. Quant au fac_up, il permet de diminuer le temps de dissipation d'un facteur à partir d'une altitude et d'une épaisseur de zone de transition qu'on peut choisir. On peut utiliser la combinaison des 2 ou l'un des 2. Pour ne pas prendre en compte ces facteurs de dissipation, il faut qu'il soit mis à 1.&lt;br /&gt;
&lt;br /&gt;
Il existe 2 modes possibles pour le fac_up: le mode martien (en fonction de l'altitude) et le mode vénusien (en fonction de la pression). Dans le 1er cas, il faut renseigner l'altitude où démarre la zone de transition et l'épaisseur de cette zone. Dans le 2ème cas, il faut renseigner la pression où démarre la zone de transition et l'échelle de hauteur de cette zone de transition.&lt;br /&gt;
&lt;br /&gt;
Il est vivement conseillé de tracer votre profil de dissipation à partir des équations (dans vert_prof_dissip_icosa_lmdz.f90) afin d'être certain de leur allure.&lt;br /&gt;
&lt;br /&gt;
== E) Rayleigh Friction ==&lt;br /&gt;
&lt;br /&gt;
Spiga et al 2020: This drag plays the role devoted to surface friction on terrestrial planets, which allows to close the angular momentum budget through downward control (Haynes and McIntyre, 1987; Haynes et al., 1991). This could also be regarded as a zeroth-order parameterization for Magneto-HydroDynamic (MHD) drag as a result of Lorenz forces acting on jet streams putatively extending to the depths of Saturn's interior (Liu et al., 2008; Galanti et al., 2019), much deeper than the shallow GCM's model bottom.&lt;br /&gt;
&lt;br /&gt;
Comme Liu and Schneider (2010), cette couche de frottement ne s'exerce pas aux régions équatoriales car à l’extérieur du cylindre tangeant du rayon équatorial, les cylindres convectifs ne coupent pas cette couche et ne subissent pas les frottements liés aux effets de la MHD.&lt;br /&gt;
&lt;br /&gt;
Le paramètre rayleigh_limlat correspond à la latitude maximale de part et d'autre de l'équateur où cette friction n'est pas observée.&lt;br /&gt;
&lt;br /&gt;
Pour le temps (rayleigh_friction_tau), il est similaire à celui utilisé par Liu and Schneider (2010). Elle est fixée à 100 jours terrestres. Mais attention, on fonction de la valeur, la dynamique peut évoluer dans votre simulation.&lt;br /&gt;
&lt;br /&gt;
== F) Conservation ==&lt;br /&gt;
&lt;br /&gt;
Dans run_icosa.def:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;check_conservation = detailed &lt;br /&gt;
itau_check_conserv = 320&amp;lt;/pre&amp;gt;&lt;br /&gt;
Le itau_check_conserv est comme itau_physics pour que la contribution de la physique à AAM ne soit pas nulle. de plus il est coûteux d'appeler les diagnostics trop souvent.&lt;br /&gt;
&lt;br /&gt;
S. Lebonnois, C. Covey, A. Grossman, H. Parish, G. Schubert, R. Walterscheid, P. Lauritzen, and C. Jablonowski. Angular momentum budget in General Circulation Models of superrotating atmospheres: A critical diagnostic. Journal of Geophysical Research (Planets), 117:E12004, 2012.&lt;br /&gt;
&lt;br /&gt;
P. H. Lauritzen, J. T. Bacmeister, T. Dubos, S. Lebonnois, and M. A. Taylor. Held-Suarez simulations with the Community Atmosphere Model Spectral Element (CAM-SE) dynamical core: A global axial angular momentum analysis using Eulerian and floating Lagrangian vertical coordinates. Journal of Advances in Modeling Earth Systems, 6:129-140, 2014.&lt;br /&gt;
&lt;br /&gt;
== G) Traceur ==&lt;br /&gt;
&lt;br /&gt;
=== - Branche master version du 04/04/2022 dans le dossier Jupiter (traceur) ===&lt;br /&gt;
&lt;br /&gt;
La version actuelle des fichiers de réglage dans le dossier Jupiter est réglée pour utiliser des traceurs. Si vous souhaiter utiliser le modèle sans traceur, il vous faut modifier les fichiers suivants :&lt;br /&gt;
&lt;br /&gt;
run_icosa.def&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;        nqtot = 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
traceur.def&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;        0&amp;lt;/pre&amp;gt;&lt;br /&gt;
context_dynamico.xml (ligne 125)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;         &amp;amp;lt;field id=&amp;amp;quot;q_start&amp;amp;quot; name=&amp;amp;quot;q&amp;amp;quot;  grid_ref=&amp;amp;quot;grid_q_start&amp;amp;quot; prec=&amp;amp;quot;8&amp;amp;quot;/&amp;amp;gt;   &amp;lt;/pre&amp;gt;&lt;br /&gt;
== H) Bottom du modèle ==&lt;br /&gt;
&lt;br /&gt;
* refaire tourner le 1D&lt;br /&gt;
** changer la pression &amp;lt;code&amp;gt;psurf&amp;lt;/code&amp;gt; dans rcm1d.def&lt;br /&gt;
** changer &amp;lt;code&amp;gt;ichoice=1&amp;lt;/code&amp;gt; et changer &amp;lt;code&amp;gt;tref&amp;lt;/code&amp;gt; (ex: 10b: 330K)&lt;br /&gt;
* refaire tourner le 3D (avec makestart) en changeant &amp;lt;code&amp;gt;preff&amp;lt;/code&amp;gt; dans &amp;lt;code&amp;gt;[nom_de_la_planète]_const.def&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= 4. Physical parameterizations =&lt;br /&gt;
&lt;br /&gt;
== A) Cycle diurne ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;diurnal = .false.&amp;lt;/code&amp;gt; Car le temps radiatif est beaucoup plus long sur les planètes géantes.&lt;br /&gt;
&lt;br /&gt;
== B) Anneaux ==&lt;br /&gt;
&lt;br /&gt;
[Pour saturne uniquement] Il est possible d'ajouter l'ombre des anneaux dans le callphys.def:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rings_shadow = .true.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== C) Collision-induced absorption data ==&lt;br /&gt;
&lt;br /&gt;
L'absorption induite par collision est importante dans le transfet radiatif sur les planètes géantes, notamment celle provenant de H2. Cependant, le rapport ortho-para du H2 est différent selon les planètes et peut modifier fortement le chauffage sur ces planètes. Pour le cas des géantes gazeuses, le rapport ortho-para est normal (rapport 3:1). Mais pour le cas des géantes glacées, le rapport ortho-para est à l'équilibre. Par défaut, le rapport ortho-para est normal (H2orthopara_mixture = normal). Pour les géantes glacées, il faut mettre H2orthopara_mixture = equilibrium .&lt;br /&gt;
&lt;br /&gt;
Si vous voulez modifier le fichier utilisé dans un cas de CIA, il faut aller dans le code (dynamico-giant/code/LMDZ.GENERIC/libf/phystd/interpolate????.F90) et changer le nom du fichier (assurez-vous que ce fichier soit dans votre répertoire DATAGENERIC/continuum_data).&lt;br /&gt;
&lt;br /&gt;
Dans la version actuelle, il n'existe pas d'option qui permet de ne pas utiliser certaines contributions de CIA. Par exemple, si votre atmosphère est composé de H2, He et CH4 et que vous ne voulez pas des contributions venant du CH4, il vous faut commenter dans le modèle ces contributions.&lt;br /&gt;
&lt;br /&gt;
== D) K-correlated data ==&lt;br /&gt;
&lt;br /&gt;
Les fichiers k-corrélées doivent se situer dans votre répertoire DATAGENERIC/corrk_data .&lt;br /&gt;
&lt;br /&gt;
== E) Cpp mode ==&lt;br /&gt;
&lt;br /&gt;
cpp_mugaz_mode=0 pour que la valeur de cpp et de mugaz proviennent de la dynamique. cpp_mugaz_mode=1 pour forcer la valeur de cpp et de mugaz dans le callphys.def (à utiliser dans le makestart uniquement) cpp_mugaz_mode=2 pour calculer automatiquement à partir de données de références à 300 K et du gases.def (à éviter)&lt;br /&gt;
&lt;br /&gt;
== F) Generic n-layer aerosols (replaces the former 2-layer and NH3 cloud) ==&lt;br /&gt;
&lt;br /&gt;
Ce mode permet de créer des couches d'aérosols/nuages ayant une opacité (aeronlay_tauref) à une longueur d'onde donnée (aeronlay_lamref), un rayon de particule fixe (aeronlay_size) situés à une pression fixe et en fonction des propriétés optiques des particules (optprop_aeronlay_vis et optprop_aeronlay_ir). Pour le cas de l'altitude, on peut choisir soit (aeronlay_choice = 1) une pression max (aeronlay_ptop) et une pression min (aeronlay_pbot), soit (aeronlay_choice = 2) une pression min (aeronlay_pbot) et une échelle de hauteur (aeronlay_sclhght). On peut également choisir la variance effective pour les rayons de particules.&lt;br /&gt;
&lt;br /&gt;
Le nombre de couche de nuage (nlayero) est égal au nombre de scatterers dans la compilation (option -s ).&lt;br /&gt;
&lt;br /&gt;
Les fichiers de propriétés optiques doivent être dans votre DATAGENERIC.&lt;br /&gt;
&lt;br /&gt;
Un exemple pour 3 couches:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;aeronlay = .true.&lt;br /&gt;
nlayaero = 3&lt;br /&gt;
aeronlay_tauref       = 2.5 0.04 0.1&lt;br /&gt;
aeronlay_lamref       = 0.8e-6 0.8e-6 0.16e-6&lt;br /&gt;
aeronlay_choice       = 2 2 1&lt;br /&gt;
aeronlay_pbot         = 1.5e5 1.6e5 20.&lt;br /&gt;
aeronlay_ptop         = 1.1e5 1. 1.&lt;br /&gt;
aeronlay_sclhght      = 0.1 2.0 1&lt;br /&gt;
aeronlay_size         = 0.5e-6 0.05e-6 0.5e-6&lt;br /&gt;
aeronlay_nueff        = 0.3 0.3 0.3&lt;br /&gt;
optprop_aeronlay_vis  = optprop_aerosol2_vis.dat optprop_aerosol3_vis.dat optprop_carbon4_vis.dat&lt;br /&gt;
optprop_aeronlay_ir   = optprop_aerosol2_ir.dat optprop_aerosol3_ir.dat optprop_carbon4_ir.dat&amp;lt;/pre&amp;gt;&lt;br /&gt;
== G) Panaches thermiques ==&lt;br /&gt;
&lt;br /&gt;
# Comme pour toutes nouvelles simulations, il faut commencer par un run 1D de plusieurs décennies permettant d'obtenir un profil de température (&amp;lt;code&amp;gt;temp_profile.txt&amp;lt;/code&amp;gt;) et les coefficients ap et bp (&amp;lt;code&amp;gt;apbp.txt&amp;lt;/code&amp;gt;) en équilibre radiatif-convectif pour la planète que l'on étudie. Ce run 1D s'effectue dans les dossiers jupiter1d, saturn1d, neptune1d et/ou uranus1d, avec ces options pour le callphys.def :&lt;br /&gt;
&lt;br /&gt;
callrad = true calladj = true tous les autres mots clés à false (y compris &amp;lt;code&amp;gt;calltherm&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol start=&amp;quot;2&amp;quot; style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Faire un &amp;amp;quot;makestart&amp;amp;quot; run : permet d'obtenir les fichiers restart à partir du profil de température initial. Il s'agit du run dont l'état initial est le profil de température créé par run 1D (&amp;lt;code&amp;gt;temp_profile.txt&amp;lt;/code&amp;gt; est appliquer à chaque point de grille horizontale du modèle). L'état initial est ainsi une planète isotherme horizontalement mais qui varie verticalement. Pour ce run, aucun traceur ne va être utilisé dans le modèle. Néanmoins, il faut renseigner au modèle le nombre de traceurs que nous souhaitons utiliser avec le schéma des panaches thermiques afin qu'il puisse créer la dimension nq et le champ q dans les fichiers &amp;lt;code&amp;gt;restart_icosa.nc&amp;lt;/code&amp;gt; et &amp;lt;code&amp;gt;restartfi.nc&amp;lt;/code&amp;gt;. dans '''callphys.def''' :&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;          traceur = true&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;dans '''run_icosa.def''' : &amp;lt;code&amp;gt;nqtot = 2&amp;lt;/code&amp;gt; (par exemple, h2o_vap et h2o_ice) dans '''traceur.def''' :&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;           2&lt;br /&gt;
           h2o_vap&lt;br /&gt;
           h2o_ice&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Ajout des quantités pour chaque traceur. Ici, nous ajoutons les profils pour chacun des traceurs dans les fichiers &amp;lt;code&amp;gt;restart_icosa.nc&amp;lt;/code&amp;gt; et &amp;lt;code&amp;gt;restartfi.nc&amp;lt;/code&amp;gt; &amp;amp;quot;à la main&amp;amp;quot; en utilisant le programme python &amp;lt;code&amp;gt;/processing_codes/tracer_settings.py&amp;lt;/code&amp;gt; pour obtenir des fichiers restart avec la bonne abondance d'eau dans le cas présent.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Commencer la simulation : Il ne reste plus qu'à lancer la simulation 3D avec les nouveaux fichiers restart et les réglages suivant : dans '''callphys.def''' :&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;            traceur = true&lt;br /&gt;
            calltherm = true&lt;br /&gt;
            # thermal plume model options:&lt;br /&gt;
            divmpl = true&lt;br /&gt;
            r_aspect_thermals = 2.0&lt;br /&gt;
            tau_thermals      = 0.0&lt;br /&gt;
            betalpha          = 0.9&lt;br /&gt;
            afact             = 0.7&lt;br /&gt;
            fact_epsilon      = 2.e-4&lt;br /&gt;
            alpha_max         = 0.7&lt;br /&gt;
            fomass_max        = 0.5&lt;br /&gt;
            pres_limit        = 2.e5&lt;br /&gt;
            water             = true&lt;br /&gt;
            watercond         = true&lt;br /&gt;
            waterain          = true&lt;br /&gt;
            evap_prec         = true&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
dans '''run_icosa.def''' : &amp;lt;code&amp;gt;nqtot = 2&amp;lt;/code&amp;gt; dans '''traceur.def''' :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;               2&lt;br /&gt;
               h2o_vap&lt;br /&gt;
               h2o_ice&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enfin, ajouter la déclaration et l'écriture des variables relatives à l'utilisation du schéma des thermiques (&amp;lt;code&amp;gt;h2o_vap&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;h2o_ice&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;w_plm&amp;lt;/code&amp;gt;) dans les fichiers XML de la physique.&lt;br /&gt;
&lt;br /&gt;
== H) Rotation ==&lt;br /&gt;
&lt;br /&gt;
Dans [name_of_planet]_const.def, changer le taux de rotation.&lt;br /&gt;
&lt;br /&gt;
Cela n'a jamais été testé avec 0, mais cela pourrait créer des problèmes (ex: beta). ''vérifier que omega dans saturn_const.def n'intervient pas dans la physique LMDZ.GENERIC/libf/phystd/''&lt;br /&gt;
&lt;br /&gt;
== I) Appel à la physique ==&lt;br /&gt;
&lt;br /&gt;
Il faut changer à ''deux endroits'' en réglant la même valeur: - dans run_icosa.def, changer itau_physics ; - dans run.def, changer iphysiq. Ces paramètres sont exprimés en pas de temps dynamique. Pour appeler la physique à chaque pas de temps dynamique, régler ces paramètres à 1.&lt;br /&gt;
&lt;br /&gt;
'''Attention: ''' Lorsque l'on change dans le ''run_icosa.def'' la valeur de itau_physics, faire bien attention à la valeur du champ itau_adv (qui controle la frequence d'advection des traceurs par la dynamique, compté en pas de temps dynamique). Il faut que itau_physics soit un multiple de itau_adv. Cela veut dire, que l'on advecte notre champ de traceurs plus souvent (ou autant de fois) que l'on appelle la physique, qui peut transformer ces traceurs.&lt;br /&gt;
&lt;br /&gt;
= 5. Ecriture des fichiers =&lt;br /&gt;
&lt;br /&gt;
== A) Nombre d'écriture dans chaque Xhistins.nc ==&lt;br /&gt;
&lt;br /&gt;
Prenons l'exemple de l'écriture d'un fichier sur une simu Uranus pour 1000j&lt;br /&gt;
&lt;br /&gt;
Nombre d'écriture = day_step X ndays/(itau_physics X output_freq)&lt;br /&gt;
&lt;br /&gt;
* ndays = 1000&lt;br /&gt;
* day_step = 200&lt;br /&gt;
* itau_physics = 50&lt;br /&gt;
* output_freq = 200&lt;br /&gt;
&lt;br /&gt;
On a 20 sorties tous les 1000 jours.&lt;br /&gt;
&lt;br /&gt;
Globalement, il est conseillé d'avoir 800 à 1000 sorties minimum par année planétaire (voir beaucoup plus en fonction de votre étude).&lt;br /&gt;
&lt;br /&gt;
== B) Ajouter une variable ==&lt;br /&gt;
&lt;br /&gt;
Pour ajouter une variable dans le fichier de sortie Xhistins.nc, il faut l'ajouter dans le field_group correspondant et s'assurer que cette variable est présente en tant que variable de sortie dans dynamico-giant/code/LMDZ.GENERIC/libf/phystd/physiq_mod.F90. Si ce n'est pas le cas, il faut faire un call writediagfi de la variable puis l'ajouter dans un call send_xios_field.&lt;br /&gt;
&lt;br /&gt;
== C) Forcer XIOS à écrire tous les .... ==&lt;br /&gt;
&lt;br /&gt;
Il faut utiliser l'attribut (ici par ex pour forcer l'écriture tous les ts (==time step) ; d'autres délais doivent être possible): &amp;lt;code&amp;gt;sync_freq=&amp;amp;quot;1ts&amp;amp;quot;&amp;lt;/code&amp;gt; dans le &amp;lt;code&amp;gt;&amp;amp;lt;file id=... .... &amp;amp;gt;&amp;lt;/code&amp;gt; concerné.&lt;br /&gt;
&lt;br /&gt;
== D) XIOS server ou client ==&lt;br /&gt;
&lt;br /&gt;
# XIOS client &amp;lt;code&amp;gt;use_server=False&amp;lt;/code&amp;gt; Broadwell 24 processeurs sur 28&lt;br /&gt;
# XIOS server &amp;lt;code&amp;gt;use_server=true&amp;lt;/code&amp;gt; Broadwell 24 processurs sur 28 + 4 processeurs pour XIOS&lt;br /&gt;
&lt;br /&gt;
Le cas 1 est 3 min plus lent que le cas 2 -- sur 2h20...(!) parce qu'on fait peu de sorties.&lt;br /&gt;
&lt;br /&gt;
= 6. Running the model =&lt;br /&gt;
&lt;br /&gt;
== A) Compilation ==&lt;br /&gt;
&lt;br /&gt;
Pour compiler le modèle, il suffit d'aller dans le dossier avec vos fichiers .def et .xml et d'utiliser le script compile_occigen.sh si on est sur occigen ou compile_ciclad.sh si on est sur ciclad&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;./compile_occigen.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Les options qui peuvent être modifiées/ajoutées sont - -s : le nombre de scatterers - -parallel: mpi ou mpi_omp - -arch: le nom du ficher d'architecture - -arch_path: le chemin vers ce fichier - -job: 8 (conseillé) - -full: compile le code entièrement - -debug: pour trouver un éventuel bug. A ENLEVER obligatoirement s'il n'y a plus de bug car multiplie par 5 votre temp de calcul.&lt;br /&gt;
&lt;br /&gt;
En 1D, d'autres options sont nécessaires: - -t: nombre de traceurs - -d: nombre de niveaux verticaux - -parallel: none (en 1D uniquement)&lt;br /&gt;
&lt;br /&gt;
=== - Versions fonctionnelles de dynamico-giant ===&lt;br /&gt;
&lt;br /&gt;
'''Jupiter''' - XIOS revision 1583&amp;lt;br /&amp;gt;&lt;br /&gt;
- ICOSAGCM revision 756&amp;lt;br /&amp;gt;&lt;br /&gt;
- IOIPSL revision 339&amp;lt;br /&amp;gt;&lt;br /&gt;
- FCM_V1.2 revision 12&amp;lt;br /&amp;gt;&lt;br /&gt;
- Physics revision 2228 (LMDZ.COMMON, LMDZ.GENERIC, ICOSA_LMDZ, ARCH)&lt;br /&gt;
&lt;br /&gt;
but check Physics version 2142 and 2180&lt;br /&gt;
&lt;br /&gt;
'''Saturne (référence Spiga 2020, à vérifier)''' - DYNAMICO --&amp;amp;gt; Revision: 756 - PHYSICS --&amp;amp;gt; Revision: 2005 - XIOS --&amp;amp;gt; Revision: 1583 - IOIPSL --&amp;amp;gt; Revision: 310?&lt;br /&gt;
&lt;br /&gt;
'''Saturne (simulation de référence sur 61 niveaux, Bardet et al. Icarus 2021)''' - XIOS revision 1583&amp;lt;br /&amp;gt;&lt;br /&gt;
- ICOSAGCM revision 765&amp;lt;br /&amp;gt;&lt;br /&gt;
- IOIPSL revision 310&amp;lt;br /&amp;gt;&lt;br /&gt;
- FCM_V1.2 revision 12&amp;lt;br /&amp;gt;&lt;br /&gt;
- Physics revision 2005 (LMDZ.COMMON, LMDZ.GENERIC, ICOSA_LMDZ, ARCH)&lt;br /&gt;
&lt;br /&gt;
'''Saturne (simulation avec la GWD paramétrisation sur 61 niveaux, chapitre 6 PhD Bardet)''' - XIOS revision 1583&amp;lt;br /&amp;gt;&lt;br /&gt;
- ICOSAGCM revision 765&amp;lt;br /&amp;gt;&lt;br /&gt;
- IOIPSL revision 310&amp;lt;br /&amp;gt;&lt;br /&gt;
- FCM_V1.2 revision 12&amp;lt;br /&amp;gt;&lt;br /&gt;
- Physics revision 2213 (LMDZ.COMMON, LMDZ.GENERIC, ICOSA_LMDZ, ARCH)&lt;br /&gt;
&lt;br /&gt;
'''Saturne (simulation sur 96 niveaux, Bardet et al. Nature Astronomy 2022)''' - XIOS revision 1583&amp;lt;br /&amp;gt;&lt;br /&gt;
- ICOSAGCM revision 765&amp;lt;br /&amp;gt;&lt;br /&gt;
- IOIPSL revision 431&amp;lt;br /&amp;gt;&lt;br /&gt;
- FCM_V1.2 revision 12&amp;lt;br /&amp;gt;&lt;br /&gt;
- Physics revision 2305 (LMDZ.COMMON, LMDZ.GENERIC, ICOSA_LMDZ, ARCH)&lt;br /&gt;
&lt;br /&gt;
'''Saturne (simulation avec la GWD paramétrisation sur 96 niveaux, chapitre 6 PhD Bardet)''' - XIOS revision 1583&amp;lt;br /&amp;gt;&lt;br /&gt;
- ICOSAGCM revision 765&amp;lt;br /&amp;gt;&lt;br /&gt;
- IOIPSL revision 431&amp;lt;br /&amp;gt;&lt;br /&gt;
- FCM_V1.2 revision 12&amp;lt;br /&amp;gt;&lt;br /&gt;
- Physics revision 2403 (LMDZ.COMMON, LMDZ.GENERIC, ICOSA_LMDZ, ARCH)&lt;br /&gt;
&lt;br /&gt;
'''Uranus &amp;amp;amp; Neptune (old version)''' - XIOS revision 1944 - ICOSAGCM revision 765 - IOIPSL revision 431 - FCM_V1.2 revision 12&amp;lt;br /&amp;gt;&lt;br /&gt;
- Physics revision 2413 (LMDZ.COMMON, LMDZ.GENERIC, ICOSA_LMDZ, ARCH)&lt;br /&gt;
&lt;br /&gt;
'''Uranus &amp;amp;amp; Neptune (new version)''' - XIOS revision 2203 - ICOSAGCM revision (20/08/2021) - IOIPSL revision 450 - FCM_V1.2 revision 12&amp;lt;br /&amp;gt;&lt;br /&gt;
- Physics revision 2555 (LMDZ.COMMON, LMDZ.GENERIC, ICOSA_LMDZ, ARCH)&lt;br /&gt;
&lt;br /&gt;
'''Jupiter, Saturne, Uranus &amp;amp;amp; Neptune [OCCIGEN VERSION]''' - XIOS revision 2319 - ICOSAGCM revision (90f7138a60ebd3644fbbc42bc9dfa22923386385) - IOIPSL revision 453 - FCM_V1.2 revision 12&amp;lt;br /&amp;gt;&lt;br /&gt;
- Physics revision 2655 (LMDZ.COMMON, LMDZ.GENERIC, ICOSA_LMDZ, ARCH)&lt;br /&gt;
&lt;br /&gt;
'''Jupiter, Saturne, Uranus &amp;amp;amp; Neptune [IRENE VERSION]''' - XIOS revision 2399 - ICOSAGCM revision (4fbd393a9051fd9c1a5b662683f6ad8d0dc2867c) - IOIPSL revision 6234 - FCM_V1.2 revision 12&amp;lt;br /&amp;gt;&lt;br /&gt;
- Physics revision 2842 (LMDZ.COMMON, LMDZ.GENERIC, ICOSA_LMDZ, ARCH)&lt;br /&gt;
&lt;br /&gt;
== B) Run 1D ==&lt;br /&gt;
&lt;br /&gt;
Pour une simulation 1D, 1 seul CPU suffit.&lt;br /&gt;
&lt;br /&gt;
To run on Occigen:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sbatch job_mpi&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To run on Irene:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ccc_msub job_mpi&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To see evolution of your job on Occigen:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;squeue -u username&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To see evolution of your job on Irene:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ccc_mpp -u username&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To kill your job on Occigen:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;scancel id_of_your_job&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To kill your job on Irene:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ccc_mdel id_of_your_job&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Une fois que votre simulation est fini, lancer le script python printapbp.py qui vous permettra d'obtenir les fichiers apbp.txt et temp_profile.txt nécessaires pour les simulations en 3D.&lt;br /&gt;
&lt;br /&gt;
== C) Run 3D ==&lt;br /&gt;
&lt;br /&gt;
Pour lancer une première simulation, il faut tout d'abord le faire une seule fois dans le dossier makestart de l'un des dossiers jupiter, saturne, uranus ou neptune. Ce dernier permettra de créer les premiers fichiers restart_icosa.nc et restartfi.nc. Ensuite, il suffit revenir dans le dossier parent (jupiter, saturne, uranus, neptune) et de lancer ses simulations.&lt;br /&gt;
&lt;br /&gt;
=== - MPI ===&lt;br /&gt;
&lt;br /&gt;
Avant de lancer une simulation, il est nécessaire de déterminer - le nombre de procs - le nombre de noeuds&lt;br /&gt;
&lt;br /&gt;
Il faut avant tout savoir qu'il y a 10 x nsplit_i x nsplit_j domaines. Ces domaines sont divisés en plusieurs cellules. Il y a (nbp)²/(nsplit_i x nsplit_j) cellules par domaine. Ce nombre est égal au nombre de MPI process.&lt;br /&gt;
&lt;br /&gt;
Il est important de ne pas faire des tuiles &amp;amp;quot;trop petites&amp;amp;quot; et donc de garder nsplit_i et nsplit_j tels que nbp/nsplit_{i,j} &amp;amp;gt;=10-15 (plutôt 15). Car il y a des calculs &amp;amp;quot;redondants&amp;amp;quot; faits sur les bords du domaine. Admettons que ton domaine soit 10 x 10 (100 cellules par domaine). Le nombre de cellules au bord du domaine est égal à 2 x nsplit_i + 2 x nsplit_j - 4. Dans ce cas, le nombre de cellules au bord est de 36. Cela signifie que le bord du domaine correspond à 36% du domaine (36 points sur 100). Si le domaine est 15 x 15, alors le bord du domaine n'est plus que de 24.8 %. On aimerait avoir des domaines les plus grands possibles mais il faut aussi voir que chaque cellule correspond à une colonne à résoudre... Et c'est là ou il faut expérimenter un peu pour trouver l'optimum entre le nombre total de proc à employer et le gain effectif (temps total &amp;amp;quot;facturé&amp;amp;quot; au vu du nombre de procs monopolisés pour une simu donnée). Ehouarn&lt;br /&gt;
&lt;br /&gt;
Il faut au total que le nombre de procs soit égal à 10 x nsplit_i x nsplit_j qu'il faut répartir entre les noeuds.&lt;br /&gt;
&lt;br /&gt;
Pour les noeuds, il faut tenir compte qu'un noeud sur Occigen, c'est 24 (ou 28) procs. Disons 24. Quand on demande N procs, le système te donne M noeuds, soit M X 24 procs (les noeuds ne sont pas partagés avec d'autres applications). Et bien sûr on te facturera ces M noeuds, même si tu n'utilises pas tous les procs. Donc il faut s'efforcer de tomber juste et demander un multiple de 24 procs. Même raisonement si tu demandes à utiliser des noeuds de 28 procs.&lt;br /&gt;
&lt;br /&gt;
Par exemple, nsplit_i = 4 et nsplit_j = 6. 4 x 6 est égal à 24. On utilisera donc 10 noeuds pour avoir 240 nprocs.&lt;br /&gt;
&lt;br /&gt;
Prenons un autre exemple. nsplit_i = 5 et nsplit_j = 6. 5x6 = 30 Or il y a 24 procs par noeuds. Il faudra utiliser 13 noeuds. Et ce ne sont pas 300 procs qui seront facturés au total mais 312.&lt;br /&gt;
&lt;br /&gt;
Mais comme vu plus haut, en fonction de la configuration de tes domaines, il est possible que le 2nd exemple coûte moins cher en heure CPU que le 1er exemple car il sera plus rapide.&lt;br /&gt;
&lt;br /&gt;
=== - OpenMP / MPI ===&lt;br /&gt;
&lt;br /&gt;
Dans le cas mixte OpenMP/MPI, il est nécessaire de renseigner le nombre de tâche OpenMP et de MPI threads. Dans le script pour le job, on a :&lt;br /&gt;
&lt;br /&gt;
cpus-per-task et OMP_NUM_THREADS correspondent au nombre de tâche OpenMP ntask-per-node correspond au nombre de tâche par noeud&lt;br /&gt;
&lt;br /&gt;
Pour déterminer la configuration à utiliser en OpenMP/MPI, il faut respecter ces règles: - ntask-per-node x nodes correspond au nombre total de MPI threads qu'il devrait y avoir (c'est-à-dire dans le cas MPI seul). - cpus-per-task x ntask-per-node doit être égale ou inférieur au nombre de procs par noeuds (24 ou 28- sur Occigen) - cpus-per-task devrait être ~égal au nombre de niveaux verticaux / 10 - OMP_NUM_THREADS doit être égal au cpus-per-task - omp_level_size (dans le fichier run_icosa.def) devrait être ~égal au nombre de cpus-per-task. (dans le cas MPI seul, il faut le laisser égal à 1)&lt;br /&gt;
&lt;br /&gt;
Au total, le nombre total de nprocs est égal à cpus-per-task x ntask-per-node x nodes&lt;br /&gt;
&lt;br /&gt;
En reprenant le premier exemple MPI (on suppose qu'on a 40 niveaux verticaux), on aura - cpus-per-task = 4 - ntask-per-norde = 6 On a bien cpus-per-task x ntask-per-norde &amp;amp;lt;= 24. Le nombre de noeuds doit être égal à 40 car 6x40 = 240 nprocs MPI Le nombre de procs qu'on utilisera au total sera de 960.&lt;br /&gt;
&lt;br /&gt;
=== - Comment déterminer le nombre d'heure CPU (consommation en heure)? ===&lt;br /&gt;
&lt;br /&gt;
Heures CPU = durée_de_la_simu X nombre de procs total facturé&lt;br /&gt;
&lt;br /&gt;
Si on veut connaître le nombre d'heure CPU qu'on consommera à partir d'un test, voici le calcul&lt;br /&gt;
&lt;br /&gt;
Heures CPU = durée_de_la_simu_test X nombre de procs total facturé X nombre de jour qu'on veut simulé / (nombre de jour simulées pendant la simu test)&lt;br /&gt;
&lt;br /&gt;
== D) Optimisation ==&lt;br /&gt;
&lt;br /&gt;
Pour savoir quelle est la meilleure configuration en MPI seul, en OpenMP/MPI et entre les 2, des tests ont été effectués. Ces tests ont été réalisés sur Uranus à nbp80 sur les noeuds Broadwell (28 procs par noeud). 1000 jours uraniens ont été simulés à chaque fois.&lt;br /&gt;
&lt;br /&gt;
'''MPI:''' [[File:fig1.png]]&lt;br /&gt;
&lt;br /&gt;
'''OpenMP/MPI:''' [[File:fig2.png]]&lt;br /&gt;
&lt;br /&gt;
La comparaison du MPI seul et du mixte OpenMP/MPI permet de tirer la conclusion que le mixte OpenMP/MPI est beaucoup plus rapide (facteur 2.5 à 3) mais consomme plus (facteur 1.1 à 1.7).&lt;br /&gt;
&lt;br /&gt;
[[File:fig3.png]]&lt;br /&gt;
&lt;br /&gt;
== E) Visualizing the output files ==&lt;br /&gt;
&lt;br /&gt;
=== - Comment comparer deux fichiers? file1.nc file2.nc ===&lt;br /&gt;
&lt;br /&gt;
ncdiff file1.nc file2.nc output.nc&lt;br /&gt;
&lt;br /&gt;
=== - Comment coller plusieurs fichiers file1.nc file2.nc file3.nc ===&lt;br /&gt;
&lt;br /&gt;
ncrcat file1.nc file2.nc file3.nc output.nc&lt;br /&gt;
&lt;br /&gt;
Avec juste la vitesse u et v: ncrcat -v u -v v file1.nc file2.nc file3.nc output.nc&lt;br /&gt;
&lt;br /&gt;
Avec tous les fichiers fileXXX.nc disponibles ncrcat file*.nc output.nc&lt;br /&gt;
&lt;br /&gt;
=== - Comment tracer les champs et divers diagnostics en moyenne zonale? ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;mettre à jour planetoplot et planets&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;utiliser precast.py dans planetoplot/examples/ppclass_additional/dynanalysis&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;changer les options au début (il y a des exemples), exemple pour Saturne&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;fileAP=&amp;quot;Xhistins_42.nc&amp;quot;&lt;br /&gt;
p_upper,p_lower,nlev = 4.0e2,2.5e5,40&lt;br /&gt;
targetp1d = np.logspace(np.log10(p_lower),np.log10(p_upper),nlev)&lt;br /&gt;
myp = planets.Saturn&lt;br /&gt;
day_per_year = 24430.&lt;br /&gt;
short = False&lt;br /&gt;
includels = False&lt;br /&gt;
charx = &amp;quot;0,360&amp;quot;&lt;br /&gt;
ispressure = False&lt;br /&gt;
vartemp = &amp;quot;temperature&amp;quot;&lt;br /&gt;
outfile = &amp;quot;precast.nc&amp;quot;&lt;br /&gt;
nopole = True&amp;lt;/source&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Il faut que apbp.txt soit présent !&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Le résultat se trouve dans le fichier indiqué dans outfile.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== F) Debug ==&lt;br /&gt;
&lt;br /&gt;
=== - Pour debugger ===&lt;br /&gt;
&lt;br /&gt;
Réglez &amp;lt;code&amp;gt;info_level&amp;lt;/code&amp;gt; à &amp;lt;code&amp;gt;100&amp;lt;/code&amp;gt; dans le fichier &amp;lt;code&amp;gt;iodef.xml&amp;lt;/code&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
=== - Erreur en début de run, SEGMENTATION FAULT dans la routine &amp;lt;code&amp;gt;advect.f90&amp;lt;/code&amp;gt; (ICOSAGCM/ppsrc/transport) au niveau de l'appel à &amp;lt;code&amp;gt;cross_product2&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
La routine &amp;lt;code&amp;gt;cross_product2&amp;lt;/code&amp;gt; effectue des produits vectoriels. Cette erreur vient du fait qu'en essayant de faire des optimisations de calcul, le compilateur se prend &amp;amp;quot;les pieds dans le tapis&amp;amp;quot; et ne sait plus faire le produit vectoriel. Pour empêcher le compilateur de faire des optimisations trop poussées, il faut ajouter l'option &amp;lt;code&amp;gt;-fp-model strict&amp;lt;/code&amp;gt; au niveau du mot-clé &amp;lt;code&amp;gt;%BASE_FFLAGS&amp;lt;/code&amp;gt; dans tous les fichiers &amp;lt;code&amp;gt;.fcm&amp;lt;/code&amp;gt; du modèle (LMDZ.COMMON / ICOSAGCM / ICOSA_LMDZ).&lt;br /&gt;
&lt;br /&gt;
== G) Pas de radiatif et perturbations ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;faire descendre le modèle&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;modifier le code pour perturbations vitesse et pas température&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;compiler (voir README.md)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;changer dans callphys.def (dans saturn/makestart)&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;surfalbedo = 1.0&lt;br /&gt;
surfemis = 0.0&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;changer dans callphys.def (dans saturn '''et''' saturn/makestart)&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;corrk      = .false.&lt;br /&gt;
enertest  = .true.&lt;br /&gt;
randompert = 1&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;voir si on garde le flux interne ou non (&amp;lt;code&amp;gt;intheat&amp;lt;/code&amp;gt;)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;refaire les états initiaux (dans makestart)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;faire un run court pour voir sur les spectres l'injection d'Ek&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== H) PROFILING with DYNAMICO-Giant ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-pg&amp;lt;/code&amp;gt;: Generate extra code to write profile information suitable for analysis program &amp;lt;code&amp;gt;gprof&amp;lt;/code&amp;gt;. You must use this option when compiling the sources files you want data about and you must '''also use it when linking'''. 1. For DYNAMICO-Giant: in the arch.fcm file of each part of the model (ICOSAGCM, ICOSA_LMDZ, LMDZ.COMMON and XIOS), you have to add the option &amp;lt;code&amp;gt;-pg&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;%PROD_FFLAGS&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;%BASE_LD&amp;lt;/code&amp;gt; 2. Compile as usual 3. Execute your code as usual 4. Run &amp;lt;code&amp;gt;gprof&amp;lt;/code&amp;gt; tool:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;    gprof icosa_lmdz.exe goon.out &amp;amp;gt; analysis.txt&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= OLD WIKI (DEPRECATED, JUST FOR REFERENCE/INFORMATION) =&lt;br /&gt;
&lt;br /&gt;
``Welcome to the dynamico-giant wiki!&lt;br /&gt;
&lt;br /&gt;
== pour debugger ==&lt;br /&gt;
&lt;br /&gt;
régler &amp;lt;code&amp;gt;info_level&amp;lt;/code&amp;gt; à &amp;lt;code&amp;gt;100&amp;lt;/code&amp;gt; dans le fichier &amp;lt;code&amp;gt;iodef.xml&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== pourquoi diurnal=.false. ==&lt;br /&gt;
&lt;br /&gt;
le temps radiatif est beaucoup plus long sur les géantes&lt;br /&gt;
&lt;br /&gt;
== comment changer la fréquence d'appel à la physique? ==&lt;br /&gt;
&lt;br /&gt;
il faut changer à ''deux endroits'' en réglant la même valeur - dans run_icosa.def, changer itau_physics - dans run.def, changer iphysiq ces paramètres sont exprimés en pas de temps dynamique. pour appeler la physique à chaque pas de temps dynamique, régler ces paramètres à 1&lt;br /&gt;
&lt;br /&gt;
== comment changer la résolution ==&lt;br /&gt;
&lt;br /&gt;
[https://github.com/aymeric-spiga/dynamico-giant/commit/f39e3b651c19cefb26da72ab77933520ff8f27f5 voir lien ici]&lt;br /&gt;
&lt;br /&gt;
== comment choisir le nombre de processeurs pour la résolution ==&lt;br /&gt;
&lt;br /&gt;
voir commentaires sur run_icosa.def&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;###########################################&lt;br /&gt;
## There must be less MPIxOpenMP processes than the 10 x nsplit_i x nsplit_j tiles&lt;br /&gt;
## typically for pure MPI runs, let nproc = 10 x nsplit_i x nsplit_j&lt;br /&gt;
## it is better to have nbp/split &amp;amp;gt;~ 10&lt;br /&gt;
###########################################&lt;br /&gt;
#### 40 noeuds de 24 processeurs = 960 procs&lt;br /&gt;
nsplit_i=12&lt;br /&gt;
nsplit_j=8&amp;lt;/pre&amp;gt;&lt;br /&gt;
Ehouarn: ''Une règle à suivre est de ne pas faire des tuiles &amp;amp;quot;trop petites&amp;amp;quot; et donc de garder nbsplit_i et nbsplit_j tels que nbp/nbsplit &amp;amp;gt;=10-15 (plutôt 15). Car il y a des calculs &amp;amp;quot;redondants&amp;amp;quot; faits sur les bords du domaine. Or si ton domaine est 10''10, le bord du domaine c'est 38% du domaine (38 points sur le bord pour 100 points en tout) alors que si ton domaine est 15''15, le bord du domaine n'est plus que 56/(15''15) = 25.7%. 56=2''15+2''13 (pour ne pas compter 2 fois les coins). On voudrait du coup des domaine les plus grand possible, clairement, mais il faut aussi voir que chaque domaine c'est nbp''nbp colonnes à résoudre sur ce même proc... Et c'est là ou il faut expérimenter un peu pour trouver l'optimum entre le nombre total de proc à employer et le gain effectif (temps total &amp;amp;quot;facturé&amp;amp;quot; au vu du nombre de procs monopolisés pour une simu donnée).''&lt;br /&gt;
&lt;br /&gt;
_Pour les noeuds, il faut tenir compte qu'un noeud sur Occigen, c'est 24 (ou 28) procs. Disons 24. Quand on demande N procs, le système te donne M noeuds, soit M*24 procs (les noeuds ne sont pas partagés avec d'autres applications). Et bien sûr on te facturera ces M noeuds, même si tu n'utilises pas tous les procs. Donc il faut s'efforcer de tomber juste et demander un multiple de 24 procs. Même raisonement si tu demandes à utiliser des noeuds de 28 procs._&lt;br /&gt;
&lt;br /&gt;
== comment changer la rotation? ==&lt;br /&gt;
&lt;br /&gt;
dans saturn_const.def, changer le taux de rotation jamais testé avec 0, mais pourrait créer des problèmes (ex: beta) ''vérifier que omega dans saturn_const.def n'intervient pas dans la physique LMDZ.GENERIC/libf/phystd/''&lt;br /&gt;
&lt;br /&gt;
== la dissipation c'est où? ==&lt;br /&gt;
&lt;br /&gt;
laplacien itéré: hyperviscosity - tau_graddiv,tau_gradrot,tau_divgrad: periode (plus c'est petit, plus la dissipation est efficace) - nitergdiv,nitergrot,niterdivgrad: ordre du laplacien (plus c'est grand, plus on dissipe sélectivement les petites échelles)&lt;br /&gt;
&lt;br /&gt;
== comment changer la grille cible du remapping on-the-fly ==&lt;br /&gt;
&lt;br /&gt;
dans context_lmdz_physics.xml changer les paramètres ni_glo et nj_glo par exemple pour remapper sur du lat/lon à 360 pts en latitude et 720 pts en longitude (0.5°) &amp;lt;domain id=&amp;quot;dom_regular&amp;quot; ni_glo=&amp;quot;720&amp;quot; nj_glo=&amp;quot;360&amp;quot; type=&amp;quot;rectilinear&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Forcer XIOS à écrire tous les .... ==&lt;br /&gt;
&lt;br /&gt;
Il faut utiliser l'attribut (ici par ex pour forcer l'écriture tous les ts (==time step) ; d'autres délais doivent être possible): &amp;lt;code&amp;gt;sync_freq=&amp;amp;quot;1ts&amp;amp;quot;&amp;lt;/code&amp;gt; dans le &amp;lt;code&amp;gt;&amp;amp;lt;file id=... .... &amp;amp;gt;&amp;lt;/code&amp;gt; concerné.&lt;br /&gt;
&lt;br /&gt;
== comment changer le bottom du modele ==&lt;br /&gt;
&lt;br /&gt;
* refaire tourner le 1D&lt;br /&gt;
** changer la pression &amp;lt;code&amp;gt;psurf&amp;lt;/code&amp;gt; dans rcm1d.def&lt;br /&gt;
** changer &amp;lt;code&amp;gt;ichoice=1&amp;lt;/code&amp;gt; et changer &amp;lt;code&amp;gt;tref&amp;lt;/code&amp;gt; (ex: 10b: 330K)&lt;br /&gt;
* refaire tourner le 3D (avec makestart) en changeant &amp;lt;code&amp;gt;preff&amp;lt;/code&amp;gt; dans &amp;lt;code&amp;gt;saturn_const.def&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== comment changer la fréquence de sortie des Xhistins.nc ==&lt;br /&gt;
&lt;br /&gt;
les commandes XIOS sont appelées depuis la physique (dans la config présente) dans context_lmdz_physics.xml il suffit de changer output_freq ''attention'' ts se comprend comme le pas de temps physique (voir donc dans run_icosa.def les paramètres dt et itau_physics pour le connaître) par exemple, pour des sorties tous les 20 jours Saturne&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;file id=&amp;quot;histins&amp;quot;&lt;br /&gt;
      name=&amp;quot;Xhistins&amp;quot;&lt;br /&gt;
      output_freq=&amp;quot;40ts&amp;quot;&lt;br /&gt;
      type=&amp;quot;one_file&amp;quot;&lt;br /&gt;
      enabled=&amp;quot;.true.&amp;quot;&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
== pas de radiatif et perturbations ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;faire descendre le modèle&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;modifier le code pour perturbations vitesse et pas température&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;compiler (voir README.md)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;changer dans callphys.def (dans saturn/makestart)&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;surfalbedo = 1.0&lt;br /&gt;
surfemis = 0.0&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;changer dans callphys.def (dans saturn '''et''' saturn/makestart)&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;corrk      = .false.&lt;br /&gt;
enertest  = .true.&lt;br /&gt;
randompert = 1&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;voir si on garde le flux interne ou non (&amp;lt;code&amp;gt;intheat&amp;lt;/code&amp;gt;)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;refaire les états initiaux (dans makestart)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;faire un run court pour voir sur les spectres l'injection d'Ek&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== comment comparer deux fichiers? file1.nc file2.nc ==&lt;br /&gt;
&lt;br /&gt;
ncdiff file1.nc file2.nc output.nc&lt;br /&gt;
&lt;br /&gt;
== comment coller plusieurs fichiers file1.nc file2.nc file3.nc ==&lt;br /&gt;
&lt;br /&gt;
ncrcat file1.nc file2.nc file3.nc output.nc avec juste la vitesse u et v ncrcat -v u -v v file1.nc file2.nc file3.nc output.nc avec tous les fichiers fileXXX.nc disponibles ncrcat file*.nc output.nc&lt;br /&gt;
&lt;br /&gt;
== comment tracer les champs et divers diagnostics en moyenne zonale? ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;mettre à jour planetoplot et planets&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;utiliser precast.py dans planetoplot/examples/ppclass_additional/dynanalysis&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;changer les options au début (il y a des exemples), exemple pour Saturne&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;fileAP=&amp;quot;Xhistins_42.nc&amp;quot;&lt;br /&gt;
p_upper,p_lower,nlev = 4.0e2,2.5e5,40&lt;br /&gt;
targetp1d = np.logspace(np.log10(p_lower),np.log10(p_upper),nlev)&lt;br /&gt;
myp = planets.Saturn&lt;br /&gt;
day_per_year = 24430.&lt;br /&gt;
short = False&lt;br /&gt;
includels = False&lt;br /&gt;
charx = &amp;quot;0,360&amp;quot;&lt;br /&gt;
ispressure = False&lt;br /&gt;
vartemp = &amp;quot;temperature&amp;quot;&lt;br /&gt;
outfile = &amp;quot;precast.nc&amp;quot;&lt;br /&gt;
nopole = True&amp;lt;/source&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Il faut que apbp.txt soit présent !&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;le résultat se trouve dans le fichier indiqué dans outfile&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== bilan de moment cinétique ==&lt;br /&gt;
&lt;br /&gt;
dans run_icosa.def&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;check_conservation = detailed &lt;br /&gt;
itau_check_conserv = 160&amp;lt;/pre&amp;gt;&lt;br /&gt;
le itau_check_conserv est comme itau_physics pour que la contribution de la physique à AAM ne soit pas nulle. de plus il est coûteux d'appeler les diagnostics trop souvent.&lt;br /&gt;
&lt;br /&gt;
S. Lebonnois, C. Covey, A. Grossman, H. Parish, G. Schubert, R. Walterscheid, P. Lauritzen, and C. Jablonowski. Angular momentum budget in General Circulation Models of superrotating atmospheres: A critical diagnostic. Journal of Geophysical Research (Planets), 117:E12004, 2012.&lt;br /&gt;
&lt;br /&gt;
P. H. Lauritzen, J. T. Bacmeister, T. Dubos, S. Lebonnois, and M. A. Taylor. Held-Suarez simulations with the Community Atmosphere Model Spectral Element (CAM-SE) dynamical core: A global axial angular momentum analysis using Eulerian and floating Lagrangian vertical coordinates. Journal of Advances in Modeling Earth Systems, 6:129-140, 2014.&lt;br /&gt;
&lt;br /&gt;
== XIOS server ou client ==&lt;br /&gt;
&lt;br /&gt;
# XIOS client &amp;lt;code&amp;gt;use_server=False&amp;lt;/code&amp;gt; Broadwell 24 processeurs sur 28&lt;br /&gt;
# XIOS server &amp;lt;code&amp;gt;use_server=true&amp;lt;/code&amp;gt; Broadwell 24 processurs sur 28 + 4 processeurs pour XIOS&lt;br /&gt;
&lt;br /&gt;
cas 1 est 3 min plus lent que cas 2 -- sur 2h20...! parce qu'on fait peu de sorties&lt;br /&gt;
&lt;br /&gt;
== Optimisation ==&lt;br /&gt;
&lt;br /&gt;
# 40 noeuds au lieu de 50 noeuds, même temps de calcul...! Testé dans la branche https://github.com/aymeric-spiga/dynamico-giant/tree/work_61levels&lt;br /&gt;
# &amp;lt;code&amp;gt;sync_freq=40ts&amp;lt;/code&amp;gt; (ou multiple de, si 40ts est la fréquence d'écriture) dans context_lmdz_physics.xml doit être inclus sinon il n'est pas réglé et XIOS transfère tout à la fin du run ce qui prend du temps (et peut occasionner des problèmes de mémoire)&lt;br /&gt;
&lt;br /&gt;
== Versions fonctionnelles de dynamico-giant ==&lt;br /&gt;
&lt;br /&gt;
=== Jupiter ===&lt;br /&gt;
&lt;br /&gt;
* XIOS revision 1583&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* ICOSAGCM revision 756&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* IOIPSL revision 339&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* FCM_V1.2 revision 12&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Physics revision 2228 (LMDZ.COMMON, LMDZ.GENERIC, ICOSA_LMDZ, ARCH)&lt;br /&gt;
&lt;br /&gt;
but check Physics version 2142 and 2180&lt;br /&gt;
&lt;br /&gt;
=== Saturne (référence Spiga 2020, à vérifier) ===&lt;br /&gt;
&lt;br /&gt;
* DYNAMICO --&amp;amp;gt; Revision: 756&lt;br /&gt;
* PHYSICS --&amp;amp;gt; Revision: 2005&lt;br /&gt;
* XIOS --&amp;amp;gt; Revision: 1583&lt;br /&gt;
* IOIPSL --&amp;amp;gt; Revision: 310?&lt;br /&gt;
&lt;br /&gt;
=== Saturne (simulation de référence sur 61 niveaux, Bardet et al. Icarus 2021) ===&lt;br /&gt;
&lt;br /&gt;
* XIOS revision 1583&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* ICOSAGCM revision 765&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* IOIPSL revision 310&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* FCM_V1.2 revision 12&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Physics revision 2005 (LMDZ.COMMON, LMDZ.GENERIC, ICOSA_LMDZ, ARCH)&lt;br /&gt;
&lt;br /&gt;
=== Saturne (simulation avec la GWD paramétrisation sur 61 niveaux, chapitre 6 PhD Bardet) ===&lt;br /&gt;
&lt;br /&gt;
* XIOS revision 1583&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* ICOSAGCM revision 765&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* IOIPSL revision 310&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* FCM_V1.2 revision 12&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Physics revision 2213 (LMDZ.COMMON, LMDZ.GENERIC, ICOSA_LMDZ, ARCH)&lt;br /&gt;
&lt;br /&gt;
=== Saturne (simulation sur 96 niveaux, Bardet et al. Nature Astronomy 2022) ===&lt;br /&gt;
&lt;br /&gt;
* XIOS revision 1583&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* ICOSAGCM revision 765&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* IOIPSL revision 431&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* FCM_V1.2 revision 12&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Physics revision 2305 (LMDZ.COMMON, LMDZ.GENERIC, ICOSA_LMDZ, ARCH)&lt;br /&gt;
&lt;br /&gt;
=== Saturne (simulation avec la GWD paramétrisation sur 96 niveaux, chapitre 6 PhD Bardet) ===&lt;br /&gt;
&lt;br /&gt;
* XIOS revision 1583&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* ICOSAGCM revision 765&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* IOIPSL revision 431&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* FCM_V1.2 revision 12&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Physics revision 2403 (LMDZ.COMMON, LMDZ.GENERIC, ICOSA_LMDZ, ARCH)&lt;br /&gt;
&lt;br /&gt;
=== Uranus &amp;amp;amp; Neptune (old version) ===&lt;br /&gt;
&lt;br /&gt;
* XIOS revision 1944&lt;br /&gt;
* ICOSAGCM revision 765&lt;br /&gt;
* IOIPSL revision 431&lt;br /&gt;
* FCM_V1.2 revision 12&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Physics revision 2413 (LMDZ.COMMON, LMDZ.GENERIC, ICOSA_LMDZ, ARCH)&lt;br /&gt;
&lt;br /&gt;
=== Uranus &amp;amp;amp; Neptune (new version) ===&lt;br /&gt;
&lt;br /&gt;
* XIOS revision 2203&lt;br /&gt;
* ICOSAGCM revision (20/08/2021)&lt;br /&gt;
* IOIPSL revision 450&lt;br /&gt;
* FCM_V1.2 revision 12&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Physics revision 2555 (LMDZ.COMMON, LMDZ.GENERIC, ICOSA_LMDZ, ARCH)&lt;br /&gt;
&lt;br /&gt;
works on 03/03/2022 for all HEAD&lt;br /&gt;
&lt;br /&gt;
== Les fichiers d'architecture (Installation sur un nouveau cluster) ==&lt;br /&gt;
&lt;br /&gt;
En pratique LMDZ.COMMON, ICOSA_LMDZ et IOIPSL peuvent utiliser exactement le même fichier arch.fcm ; mais celui pour ICOSAGCM est légèrement différent (les %FPP_DEF diffèrent, peut-être aussi le %FPP).&lt;br /&gt;
&lt;br /&gt;
make_icosa_lmdz doit être lancé avec -arch_path ../ARCH puisque les arch.env et arch.path communs se trouvent dans ../ARCH (l'option -arch_path ne concerne d'ailleurs que les fichiers arch.env et arch.path; le fichier arch.fcm recherché sera toujours celui dans le &amp;amp;quot;arch&amp;amp;quot; de chacun des modèles. Donc il faut bien mettre pour chacun des quatre modèles (LMDZ.COMMON, ICOSA_LMDZ,IOIPSL et ICOSAGCM) le arch.fcm dans le sous-dossier arch/ du modèle correspondant.&lt;br /&gt;
&lt;br /&gt;
XIOS est écrit en C++, et pas en Fortran. Le fichier arch.fcm correspondant est donc nécessairement différent de celui des quatre autres modèles. Pour créér ce arch.fcm, prendre exemple sur les fichiers .fcm déjà présent dans XIOS/arch/, avec une architecture similaire à celle du nouveau cluster. En particulier, il faut utiliser des versions de gcc/gfortran &amp;amp;gt; 6+. Il faut absolument avoir une bibliothèque HDF5 compilée en parallèle, ainsi que netcdf-C et netcdf-fortran (et peut être aussi netcdf-Cxx) compilé en parallèle. Sans ça, il sera peut-être possible de compiler le modèle, mais pas de lancer une simulation en utilisant XIOS.&lt;br /&gt;
&lt;br /&gt;
== Commencer une nouvelle simulation en utilisant le schéma des panaches thermiques ==&lt;br /&gt;
&lt;br /&gt;
# Comme pour toutes nouvelles simulations, il faut commencer par un run 1D de plusieurs décennies permettant d'obtenir un profil de température (&amp;lt;code&amp;gt;temp_profile.txt&amp;lt;/code&amp;gt;) et les coefficients ap et bp (&amp;lt;code&amp;gt;apbp.txt&amp;lt;/code&amp;gt;) en équilibre radiatif-convectif pour la planète que l'on étudie. Ce run 1D s'effectue dans les dossiers jupiter1d, saturn1d, neptune1d et/ou uranus1d, avec ces options pour le callphys.def :&lt;br /&gt;
&lt;br /&gt;
callrad = true calladj = true tous les autres mots clés à false (y compris &amp;lt;code&amp;gt;calltherm&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol start=&amp;quot;2&amp;quot; style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Faire un &amp;amp;quot;makestart&amp;amp;quot; run : permet d'obtenir les fichiers restart à partir du profil de température initial. Il s'agit du run dont l'état initial est le profil de température créé par run 1D (&amp;lt;code&amp;gt;temp_profile.txt&amp;lt;/code&amp;gt; est appliquer à chaque point de grille horizontale du modèle). L'état initial est ainsi une planète isotherme horizontalement mais qui varie verticalement. Pour ce run, aucun traceur ne va être utilisé dans le modèle. Néanmoins, il faut renseigner au modèle le nombre de traceurs que nous souhaitons utiliser avec le schéma des panaches thermiques afin qu'il puisse créer la dimension nq et le champ q dans les fichiers &amp;lt;code&amp;gt;restart_icosa.nc&amp;lt;/code&amp;gt; et &amp;lt;code&amp;gt;restartfi.nc&amp;lt;/code&amp;gt;. dans '''callphys.def''' :&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;          traceur = true&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;dans '''run_icosa.def''' : &amp;lt;code&amp;gt;nqtot = 2&amp;lt;/code&amp;gt; (par exemple, h2o_vap et h2o_ice) dans '''traceur.def''' :&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;           2&lt;br /&gt;
           h2o_vap&lt;br /&gt;
           h2o_ice&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Ajout des quantités pour chaque traceur. Ici, nous ajoutons les profils pour chacun des traceurs dans les fichiers &amp;lt;code&amp;gt;restart_icosa.nc&amp;lt;/code&amp;gt; et &amp;lt;code&amp;gt;restartfi.nc&amp;lt;/code&amp;gt; &amp;amp;quot;à la main&amp;amp;quot; en utilisant le programme python &amp;lt;code&amp;gt;/processing_codes/tracer_settings.py&amp;lt;/code&amp;gt; pour obtenir des fichiers restart avec la bonne abondance d'eau dans le cas présent.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&amp;lt;p&amp;gt;Commencer la simulation : Il ne reste plus qu'à lancer la simulation 3D avec les nouveaux fichiers restart et les réglages suivant : dans '''callphys.def''' :&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;            traceur = true&lt;br /&gt;
            calltherm = true&lt;br /&gt;
            # thermal plume model options:&lt;br /&gt;
            divmpl = true&lt;br /&gt;
            r_aspect_thermals = 2.0&lt;br /&gt;
            tau_thermals      = 0.0&lt;br /&gt;
            betalpha          = 0.9&lt;br /&gt;
            afact             = 0.7&lt;br /&gt;
            fact_epsilon      = 2.e-4&lt;br /&gt;
            alpha_max         = 0.7&lt;br /&gt;
            fomass_max        = 0.5&lt;br /&gt;
            pres_limit        = 2.e5&lt;br /&gt;
            water             = true&lt;br /&gt;
            watercond         = true&lt;br /&gt;
            waterain          = true&lt;br /&gt;
            evap_prec         = true&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
dans '''run_icosa.def''' : &amp;lt;code&amp;gt;nqtot = 2&amp;lt;/code&amp;gt; dans '''traceur.def''' :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;               2&lt;br /&gt;
               h2o_vap&lt;br /&gt;
               h2o_ice&amp;lt;/pre&amp;gt;&lt;br /&gt;
Enfin, ajouter la déclaration et l'écriture des variables relatives à l'utilisation du schéma des thermiques (&amp;lt;code&amp;gt;h2o_vap&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;h2o_ice&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;w_plm&amp;lt;/code&amp;gt;) dans les fichiers XML de la physique.&lt;br /&gt;
&lt;br /&gt;
== Erreur en début de run, SEGMENTATION FAULT dans la routine &amp;lt;code&amp;gt;advect.f90&amp;lt;/code&amp;gt; (ICOSAGCM/ppsrc/transport) au niveau de l'appel à &amp;lt;code&amp;gt;cross_product2&amp;lt;/code&amp;gt;. ==&lt;br /&gt;
&lt;br /&gt;
La routine &amp;lt;code&amp;gt;cross_product2&amp;lt;/code&amp;gt; effectue des produits vectoriels. Cette erreur vient du fait qu'en essayant de faire des optimisations de calcul, le compilateur se prend &amp;amp;quot;les pieds dans le tapis&amp;amp;quot; et ne sait plus faire le produit vectoriel. Pour empêcher le compilateur de faire des optimisations trop poussées, il faut ajouter l'option &amp;lt;code&amp;gt;-fp-model strict&amp;lt;/code&amp;gt; au niveau du mot-clé &amp;lt;code&amp;gt;%BASE_FFLAGS&amp;lt;/code&amp;gt; dans tous les fichiers &amp;lt;code&amp;gt;.fcm&amp;lt;/code&amp;gt; du modèle (LMDZ.COMMON / ICOSAGCM / ICOSA_LMDZ)&lt;br /&gt;
&lt;br /&gt;
== Branche master version du 04/04/2022 dans le dossier Jupiter ==&lt;br /&gt;
&lt;br /&gt;
La version actuelle des fichiers de réglage dans le dossier Jupiter sont réglés pour utiliser des traceurs. Si vous souhaiter utiliser le modèle sans traceur, il vous faut modifier les fichiers suivants :&lt;br /&gt;
&lt;br /&gt;
run_icosa.def&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;        nqtot = 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
traceur.def&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;        0&amp;lt;/pre&amp;gt;&lt;br /&gt;
context_dynamico.xml (ligne 125)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;         &amp;amp;lt;field id=&amp;amp;quot;q_start&amp;amp;quot; name=&amp;amp;quot;q&amp;amp;quot;  grid_ref=&amp;amp;quot;grid_q_start&amp;amp;quot; prec=&amp;amp;quot;8&amp;amp;quot;/&amp;amp;gt;   &amp;lt;/pre&amp;gt;&lt;br /&gt;
== PROFILING with DYNAMICO-Giant: ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;-pg&amp;lt;/code&amp;gt;: Generate extra code to write profile information suitable for analysis program &amp;lt;code&amp;gt;gprof&amp;lt;/code&amp;gt;. You must use this option when compiling the sources files you want data about and you must '''also use it when linking'''. 1. For DYNAMICO-Giant: in the arch.fcm file of each part of the model (ICOSAGCM, ICOSA_LMDZ, LMDZ.COMMON and XIOS), you have to add the option &amp;lt;code&amp;gt;-pg&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;%PROD_FFLAGS&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;%BASE_LD&amp;lt;/code&amp;gt; 2. Compile as usual 3. Execute your code as usual 4. Run &amp;lt;code&amp;gt;gprof&amp;lt;/code&amp;gt; tool:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;    gprof icosa_lmdz.exe goon.out &amp;amp;gt; analysis.txt&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-DYNAMICO]]&lt;/div&gt;</summary>
		<author><name>LTeinturier</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Advanced_Use_of_the_GCM&amp;diff=1896</id>
		<title>Advanced Use of the GCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Advanced_Use_of_the_GCM&amp;diff=1896"/>
				<updated>2024-02-27T09:24:03Z</updated>
		
		<summary type="html">&lt;p&gt;LTeinturier: /* The generic condensable scheme */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Running in parallel ==&lt;br /&gt;
&lt;br /&gt;
For large simulation (long run, high resolution etc...), the computational cost can be huge and hence the run time very long.&lt;br /&gt;
To overcome this issue, the model can be run in parallel. This however requires a few extra steps (compared to compiling and running the serial version of the code).&lt;br /&gt;
For all the details see [[Parallelism | the dedicated page]].&lt;br /&gt;
&lt;br /&gt;
== Disambiguation between ifort, mpif90, etc. ==&lt;br /&gt;
&lt;br /&gt;
For users not used to compilers and/or compiling and running codes in parallel, namely in MPI mode, there is often some confusion which hopefully the following paragraph might help clarify:&lt;br /&gt;
* the compiler (typically gfortran, ifort, pgfortran, etc.) is the required tool to compile the Fortran source code and generate an executable. It is strongly recommended that libraries used by a program are also compiled using the same compiler. Thus if you plan to use different compilers to compile the model, note that you should also have at hand versions of the libraries it uses also compiled with these compilers.&lt;br /&gt;
* the MPI (Message Passing Interface) library is a library used to solve problems using multiple processes by enabling message-passing between the otherwise independent processes. There are a number of available MPI libraries out there, e.g. OpenMPI, MPICH or IntelMPI to name a few (you can check out the [[Building an MPI library]] page for some information about installing an MPI library). The important point here is that on a given machine the MPI library is related to a given compiler and that it provides related wrappers to compile and run with. Typically (but not always) the compiler wrapper is '''mpif90''' and the execution wrapper is '''mpirun'''. If you want to know which compiler is wrapped in the '''mpif90''' compiler wrapper, check out the output of:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mpif90 --version&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* In addition a second type of parallelism, shared memory parallelism known as OpenMP, is also implemented in the code. In contradistinction to MPI, OpenMP does not require an external library but is instead implemented as a compiler feature. At run time one must then specify some dedicated environment variables (such as OMP_NUM_THREADS and OMP_STACKSIZE) to specify the number of threads to use per process.&lt;br /&gt;
* In practice one should favor compiling and running with both MPI and OPenMP enabled.&lt;br /&gt;
* For much more detailed information about compiling and running in parallel, check out the [[Parallelism | the page dedicated to Parallelism]].&lt;br /&gt;
&lt;br /&gt;
== A word about the IOIPSL and XIOS libraries ==&lt;br /&gt;
* The IOIPSL (Input Output IPSL) library is a library that has developed by the IPSL community to handle input and outputs of (mostly terrestrial) climate models. For the Generic PCM only a small part of this library is actually used, related to reading and processing the input [[The_run.def_Input_File | run.def]] file. For more details check out the [[The IOIPSL Library]] page.&lt;br /&gt;
* The [https://forge.ipsl.jussieu.fr/ioserver/wiki XIOS] (Xml I/O Server) library is based on client-server principles where the server manages the outputs asynchronously from the client (the climate model) so that the bottleneck of writing data in a parallel environment is alleviated. All aspects of the outputs (name, units, file, post-processing operations, etc.) are then controlled by dedicated XML files which are read at run-time. Using XIOS is currently optional (and requires compiling the GCM with the XIOS library). More about the XIOS library, how to install and use it, etc. [[The XIOS Library| here]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Playing with the output files ==&lt;br /&gt;
&lt;br /&gt;
=== Changing the output temporal resolution and time duration ===&lt;br /&gt;
&lt;br /&gt;
* To change the total time of a simulation, you need to open the 'For all the details see [[The_run.def_Input_File | run.def]]. file and change the variable 'nday':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nday = 1000 # this means the simulation will run for 1000 days ; and that the associated output files will also be computed for a total duration of 1000 days&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: in the example, they are not necessarily 1000 Earth days, because it depends on the definition of the day duration that has been taken in the start files.&lt;br /&gt;
&lt;br /&gt;
* To change the temporal resolution of the output files, you need to open the [[The_run.def_Input_File | run.def]] file and change the variable 'ecritphy':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ecritphy = 200 # this means the simulation will write variables in the output files every 200 time steps of the simulation.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: The output temporal resolution of the output files then depends also on the number of timestep per day ('day_step' variable in [[The_run.def_Input_File | run.def]] file). In this example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nday = 1000&lt;br /&gt;
daystep = 800&lt;br /&gt;
ecritphy = 200&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output file will provide results every 0.25 days (800/200), and for a total duration of 1000 days (so 4000 time values in total).&lt;br /&gt;
&lt;br /&gt;
=== Changing the output variable ===&lt;br /&gt;
&lt;br /&gt;
To select the variable provided in the output file diagfi.nc, you simply need to add the list of variables needed in the [[The_diagfi.def_Input_File | diagfi.def]].&lt;br /&gt;
&lt;br /&gt;
Note for experts: Some technical variables need to be de-commented in 'physiq_mod.F90' file to be written in the output files.&lt;br /&gt;
&lt;br /&gt;
=== Spectral outputs ===&lt;br /&gt;
&lt;br /&gt;
It is possible to provide spectral outputs such as the OLR (Outgoing Longwave Radiation, i.e. the thermal emission of the planet at the top of the atmosphere), the OSR (Outgoing Stellar Radiation, i.e. the light reflected by the planet at the top of the atmosphere), or the GSR (Ground Stellar Radiation, i.e. the light emitted by the star that reaches the surface of the planet).&lt;br /&gt;
&lt;br /&gt;
For this, you need to activate the option 'specOLR' in the [[The_callphys.def_Input_File | callphys.def]] file, as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
specOLR    = .true.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulations will then create diagspec_VI.nc and diagspec_IR.nc files (along with the standard diagfi.nc file), which contain the spectra of OLR, OSR, GSR, etc.&lt;br /&gt;
&lt;br /&gt;
Note: The resolution of the spectra is defined by that of the correlated-k (opacity) files used for the simulation.&lt;br /&gt;
&lt;br /&gt;
=== Statistical outputs ===&lt;br /&gt;
&lt;br /&gt;
TBD (explain how to compute stats.nc files as well as what is inside)&lt;br /&gt;
&lt;br /&gt;
== How to Change Vertical and Horizontal Resolutions ==&lt;br /&gt;
&lt;br /&gt;
=== When you are using the regular longitude/latitude horizontal grid ===&lt;br /&gt;
To run at a different grid resolution than available initial conditions files, one needs to use the tools ''newstart.e'' and ''start2archive.e''&lt;br /&gt;
&lt;br /&gt;
For example, to create initial states at grid resolution 32×24×25 from NetCDF files start and startfi at grid resolution 64×48×32 :&lt;br /&gt;
&lt;br /&gt;
* Create file ''start_archive.nc'' with ''start2archive.e'' compiled at grid resolution 64×48×32 using old file ''z2sig.def'' used previously&lt;br /&gt;
* Create files ''restart.nc'' and ''restartfi.nc'' with ''newstart.e'' compiled at grid resolution 32×24×25, using a new file ''z2sig.def'' (more details below on the choice of the ''z2sig.def'').&lt;br /&gt;
* While executing ''newstart.e'', you need to choose the answer '0 - from a file start_archive' and then press enter to all other requests.&lt;br /&gt;
&lt;br /&gt;
==== What you need to ''know'' about the ''z2sig.def'' file ====&lt;br /&gt;
&lt;br /&gt;
For a model with Nlay layers, the [[The_z2sig.def_Input_File | z2sig.def]] file must contain at least Nlay+1 lines (the other not being read).&lt;br /&gt;
&lt;br /&gt;
The first line is a scale height ($$H$$). The following lines are the target pseudo-altitudes for the model from the bottom up ($$z_i$$).&lt;br /&gt;
The units do not matter as long as you use the same ones for both. &lt;br /&gt;
&lt;br /&gt;
The model will use these altitudes to compute a target pressure grid ($$p_i$$ ) as follows:&lt;br /&gt;
\begin{align}&lt;br /&gt;
  \label{def:pseudoalt}&lt;br /&gt;
  p_i &amp;amp;= p_s \exp(-z_i/H),&lt;br /&gt;
\end{align}&lt;br /&gt;
where $$p_s$$ is the surface pressure. &lt;br /&gt;
&lt;br /&gt;
As you can see, the scale height and pseudo altitudes enter the equation only through their ratio. So they do not have to to be the real scale-height and altitudes of the atmosphere you are simulating.&lt;br /&gt;
So you can use the same [[The_z2sig.def_Input_File | z2sig.def]].def for different planets. &lt;br /&gt;
&lt;br /&gt;
There is no hard rule to follow to determine the altitude/pressure levels you should use. As a rule of thumb, layers should be thiner near the surface to properly resolve the surface boundary layer. Then they should gradually increase in size over a couple scale heights and transition to constant thickness above that. Of course, some specific applications may require thinner layers in some specific parts of the atmospheres. &lt;br /&gt;
&lt;br /&gt;
A little trick for those who prefer to think in terms of (log)pressure: if you use $$H=  1/\ln 10 \approx 0.43429448$$, then $$z_i=x$$ corresponds to a pressure difference with the surface of exactly x pressure decades (i.e. at $$z=1$$, $$p=0.1p_s$$). This is particularly useful for giant-planet applications.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;!-- [NOT RELEVANT??] If you want to create starts files with tracers for 50 layers using a start archive.nc obtained for 32 layers, do not forget to use the ini_q option in newstart in order to correctly initialize tracers value for layer 33 to layer 50. You just have to answer yes to the question on thermosphere initialization if you want to initialize the thermosphere part only (l=33 to l=50), and no if you want to initialize tracers for all layers (l=0 to l=50). --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''WE SHOULD WRITE A PAGE (LINK HERE) ABOUT HYBRID VERTICAL COORDINATES'''&lt;br /&gt;
&lt;br /&gt;
=== When you are using the DYNAMICO icosahedral horizontal grid ===&lt;br /&gt;
&lt;br /&gt;
The horizontal resolution for the DYNAMICO dynamical core is managed from several setting files, online during the execution. &lt;br /&gt;
To this purpose, each part  of the GCM managing the in/output fields ('''ICOSAGCM''', '''ICOSA_LMDZ''', '''XIOS''') requires to know the input and output grids: &lt;br /&gt;
&lt;br /&gt;
'''1. ''context_lmdz_physics.xml'':'''&lt;br /&gt;
&lt;br /&gt;
You can find several grid setup already defined:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; line&amp;gt;&lt;br /&gt;
&amp;lt;domain_definition&amp;gt;&lt;br /&gt;
    &amp;lt;domain id=&amp;quot;dom_96_95&amp;quot; ni_glo=&amp;quot;96&amp;quot; nj_glo=&amp;quot;95&amp;quot; type=&amp;quot;rectilinear&amp;quot;  &amp;gt;&lt;br /&gt;
      &amp;lt;generate_rectilinear_domain/&amp;gt;&lt;br /&gt;
      &amp;lt;interpolate_domain order=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/domain&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;domain id=&amp;quot;dom_144_142&amp;quot; ni_glo=&amp;quot;144&amp;quot; nj_glo=&amp;quot;142&amp;quot; type=&amp;quot;rectilinear&amp;quot;  &amp;gt;&lt;br /&gt;
      &amp;lt;generate_rectilinear_domain/&amp;gt;&lt;br /&gt;
      &amp;lt;interpolate_domain order=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/domain&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;domain id=&amp;quot;dom_512_360&amp;quot; ni_glo=&amp;quot;512&amp;quot; nj_glo=&amp;quot;360&amp;quot; type=&amp;quot;rectilinear&amp;quot;  &amp;gt;&lt;br /&gt;
      &amp;lt;generate_rectilinear_domain/&amp;gt;&lt;br /&gt;
      &amp;lt;interpolate_domain order=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/domain&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;domain id=&amp;quot;dom_720_360&amp;quot; ni_glo=&amp;quot;720&amp;quot; nj_glo=&amp;quot;360&amp;quot; type=&amp;quot;rectilinear&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;generate_rectilinear_domain/&amp;gt;&lt;br /&gt;
      &amp;lt;interpolate_domain order=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/domain&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;domain id=&amp;quot;dom_out&amp;quot; domain_ref=&amp;quot;dom_720_360&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/domain_definition&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this example, the output grid for the physics fields is defined by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;domain id=&amp;quot;dom_out&amp;quot; domain_ref=&amp;quot;dom_720_360&amp;quot;/&amp;gt; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which is an half-degree horizontal resolution. To change this resolution, you have to change name of the '''domain_ref''' grid, for instance: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;domain id=&amp;quot;dom_out&amp;quot; domain_ref=&amp;quot;dom_96_95&amp;quot;/&amp;gt; &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. ''run_icosa.def'': setting file to execute a simulation''' &lt;br /&gt;
&lt;br /&gt;
In this file, regarding of the horizontal resolution intended, you have to set the number of subdivision on the main triangle. &lt;br /&gt;
For reminder, each hexagonal mesh is divided in several main triangles and each main triangles are divided in suitable number of sub-triangles according the horizontal resolution&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line&amp;gt;&lt;br /&gt;
#nbp --&amp;gt; number of subdivision on a main triangle: integer (default=40)&lt;br /&gt;
#              nbp = sqrt((nbr_lat x nbr_lon)/10)&lt;br /&gt;
#              nbp:                 20   40   80  160&lt;br /&gt;
#              T-edge length (km): 500  250  120   60&lt;br /&gt;
#              Example: nbp(128x96) = 35 -&amp;gt; 40&lt;br /&gt;
#                       nbp(256x192)= 70 -&amp;gt; 80&lt;br /&gt;
#                       nbp(360x720)= 160 -&amp;gt; 160&lt;br /&gt;
nbp = 160&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you have chosen the 96_95 output grid in ''context_lmdz_physics.xml'', you have to calculate $$nbp = \sqrt(96x95) / 10 = 10$$ and  in this case &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
nbp = 20&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
After the number of subdivision of the main triangle, you have to define the number subdivision over each direction. At this stage you need to be careful as the number of subdivisions on each direction:&lt;br /&gt;
* needs to be set according to the number of subdivisions on the main triangle '''nbp'''&lt;br /&gt;
* will determine the number of processors on which the GCM will be most effective&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line&amp;gt;&lt;br /&gt;
## sub splitting of main rhombus : integer (default=1)&lt;br /&gt;
#nsplit_i=1&lt;br /&gt;
#nsplit_j=1&lt;br /&gt;
#omp_level_size=1&lt;br /&gt;
###############################################################&lt;br /&gt;
## There must be less MPIxOpenMP processes than the 10 x nsplit_i x nsplit_j tiles&lt;br /&gt;
## typically for pure MPI runs, let nproc = 10 x nsplit_i x nsplit_j&lt;br /&gt;
## it is better to have nbp/nsplit_i  &amp;gt; 10 and nbp/nplit_j &amp;gt; 10&lt;br /&gt;
###############################################################&lt;br /&gt;
#### 40 noeuds de 24 processeurs = 960 procs&lt;br /&gt;
nsplit_i=12&lt;br /&gt;
nsplit_j=8&lt;br /&gt;
&lt;br /&gt;
#### 50 noeuds de 24 processeurs = 1200 procs&lt;br /&gt;
#nsplit_i=10&lt;br /&gt;
#nsplit_j=12&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the same example as above, the 96_95 output grid requires:&lt;br /&gt;
$$nsplit_i &amp;lt; 2$$ and $$nsplit_j &amp;lt; 2$$&lt;br /&gt;
We advise you to select:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
## sub splitting of main rhombus : integer (default=1)&lt;br /&gt;
nsplit_i=1&lt;br /&gt;
nsplit_j=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and using 10 processors.&lt;br /&gt;
&lt;br /&gt;
== How to Change the Topography (or remove it) ==&lt;br /&gt;
&lt;br /&gt;
The generic model can use in principle any type of surface topography, provided that the topographic data file is available in the right format, and put in the right place. The information content on the surface topography is contained in the ''startfi.nc'', and we do have developed tools (see below) to modify the ''startfi.nc'' to account for a new surface topography.&lt;br /&gt;
&lt;br /&gt;
To change the surface topography of a simulation, we recommend to follow the procedure detailed below:&lt;br /&gt;
&lt;br /&gt;
* Create file ''start_archive.nc'' with ''start2archive.e'' compiled at the same (horizontal and vertical) resolution than the ''start.nc'' and ''startfi.nc'' files.&lt;br /&gt;
* Create files ''restart.nc'' and ''restartfi.nc'' with ''newstart.e'' compiled again at the same (horizontal and vertical) resolution. &lt;br /&gt;
* While executing ''newstart.e'', you need to choose the answer '0 - from a file start_archive' and then press enter to all other requests.&lt;br /&gt;
* At some point, the script ''newstart.e'' asks you to chose the surface topography you want from the list of files available in your 'datagcm/surface_data/' directory. &lt;br /&gt;
&lt;br /&gt;
We do have a repository of for Venus, Earth and Mars through time available at https://web.lmd.jussieu.fr/~lmdz/planets/LMDZ.GENERIC/datagcm/surface_data/. You can download the surface topography files and place them in your 'datagcm/surface_data/' directory.&lt;br /&gt;
&lt;br /&gt;
We also offer a tutorial to design new topography maps here: https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/Building_Surface_Topography_Files&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Special note: To remove the topography, you can simply add the following tag in callphys.def:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
nosurf  = .true.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to Change the Stellar Spectrum ==&lt;br /&gt;
&lt;br /&gt;
To simulate the effect of the star's radiation on a given planetary atmosphere, it is necessary to accurately represent the stellar spectrum (spectral shape and total bolometric flux) at the top of this atmosphere. In the model, we have set up two different options to model the stellar spectra of any star.&lt;br /&gt;
&lt;br /&gt;
=== Black Body Stellar Spectra ===&lt;br /&gt;
&lt;br /&gt;
First, it is possible to simply use a black body. In this case, the stellar spectrum depends only on the effective temperature of the star which is provided to the model.&lt;br /&gt;
&lt;br /&gt;
For this, you need to activate the option 'stelbbody' in the [[The_callphys.def_Input_File | callphys.def]] file, as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
stelbbody  = .true.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and then add, also in the [[The_callphys.def_Input_File | callphys.def]] file, the following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
stelTbb   = 3500.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to specify the effective temperature of the host star. (in this example, we have chosen a M-star with an effective temperature of 3500K)&lt;br /&gt;
&lt;br /&gt;
=== Pre-Tabulated spectra ===&lt;br /&gt;
&lt;br /&gt;
Second, the model can read a file containing any pre-computed stellar spectrum. Traditionally, we have used synthetic spectra from the PHOENIX database, that we adapt to the Generic PCM by decreasing the spectral resolution (use 10000 points with a fixed spectral resolution of 0.001 micron) and by adapting the units (in W/m2/micron). This is the option that is generally preferred to better represent the effect of the star (whose real spectrum can strongly deviate from the black body approximation).&lt;br /&gt;
&lt;br /&gt;
For this, you need to make sure the option 'stelbbody' in the [[The_callphys.def_Input_File | callphys.def]] file is equal to .false. (it not specified, by default stelbbody is assumed to be .false.).&lt;br /&gt;
&lt;br /&gt;
Then you need to add in the [[The_callphys.def_Input_File | callphys.def]] file, the following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
startype = 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and change the value of startype depending on the star you want to model. (here 1 means we use the solar spectrum)&lt;br /&gt;
&lt;br /&gt;
To know which stellar spectra are available, you need to open the file LMDZ.GENERIC/libf/phystd/ave_stelspec.F90 and adapt the value of startype accordingly. You also need to make sure the spectra are available in your /datadir/stellar_spectra (or /datagcm/stellar_spectra) directory.&lt;br /&gt;
&lt;br /&gt;
To calculate the true stellar spectrum at the top of the atmosphere, the Generic PCM renormalizes the stellar spectrum by the bolometric flux at 1 Astronomical Unit (AU) provided by the user, which it then converts into the true stellar spectrum by using the star-planet distance. &lt;br /&gt;
&lt;br /&gt;
To specify the flux at 1 AU, you need to add in the [[The_callphys.def_Input_File | callphys.def]] file, the following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Fat1AU = 1366.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(here 1366W/m2 corresponds to the flux at 1AU for the Sun)&lt;br /&gt;
&lt;br /&gt;
1st NOTE: We will improve this second part (Martin and Mathilde) by the end of 2022.&lt;br /&gt;
&lt;br /&gt;
2nd NOTE: The Generic PCM eventually has the capability to run without any stellar flux. To do that, you can simply put Fat1AU = 0. (@LUCAS_TEINTURIER, could you check that?)&lt;br /&gt;
&lt;br /&gt;
== How to Change the Opacity Tables ==&lt;br /&gt;
&lt;br /&gt;
'''SECTION ET PAGES EN COURS D'ÉCRITURE'''&lt;br /&gt;
&lt;br /&gt;
The model uses opacity tables to compute heating rates throughout the atmosphere. These opacity tables are generated &amp;quot;offline&amp;quot; for a given set of pressures, temperatures, a given composition and a specific spectral decomposition. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Getting opacity tables for your desired atmospheric composition ===&lt;br /&gt;
&lt;br /&gt;
* You should first check our common repository here (https://web.lmd.jussieu.fr/~lmdz/planets/LMDZ.GENERIC/datagcm/corrk_data/) to check whether your desired opacity table is not already included.&lt;br /&gt;
We have a dedicated page on how to build new opacity tables here: https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/Building_Opacity_Tables ; N&lt;br /&gt;
&lt;br /&gt;
=== Implementing your opacity tables in the Generic PCM ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
, follow these steps:&lt;br /&gt;
&lt;br /&gt;
* copy your directory containing your opacity tables in .... It has to contain...  [[Building_Opacity_Tables | you need to build opacity tables]]&lt;br /&gt;
* change corrkdir = ... in [[The_callphys.def_Input_File | callphys.def]] with the name of that directory.&lt;br /&gt;
* change gases.def: it has to be consistent with Q.dat. A special case concerns...&lt;br /&gt;
* change -b option when compiling the model with makelmdz_fcm: it has to correspond to the number of bands (in the IR x in the visible) of the new opacity tables. For instance, compile with -b 38x26 if you used 38 bands in the infrared and 26 in the visible to generate the opacity tables.&lt;br /&gt;
&lt;br /&gt;
== How to Change the Aerosols Optical Properties ==&lt;br /&gt;
&lt;br /&gt;
Aerosol optical properties are represented using three distinct properties: the extinction coefficient (Q_ext), the single scattering albedo (omega) and the asymmetry factor (g). &lt;br /&gt;
&lt;br /&gt;
The Generic PCM can compute the radiative effects of any aerosol, provided that they optical properties (Q_ext, omega, g) are tabulated and provided in the right format.&lt;br /&gt;
&lt;br /&gt;
=== Getting optical properties for your aerosols ===&lt;br /&gt;
&lt;br /&gt;
* You should first check our common repository here (https://web.lmd.jussieu.fr/~lmdz/planets/LMDZ.GENERIC/datagcm/aerosol_properties/) to check whether your favorite aerosol is not already included. The optical properties of each aerosol is built using two distinct files: one in the 'visible' (which is used in the visible part of the radiative transfer, to compute the fate of stellar radiation) and one in the 'infrared' (which is used in the thermal infrared part of the radiative transfer, to compute the fate of thermal emission by the surface and atmosphere).&lt;br /&gt;
&lt;br /&gt;
For instance, if you want to include the radiative effect of CO2 ice clouds, then you just need the files: &lt;br /&gt;
&lt;br /&gt;
- optprop_co2ice_vis_n50.dat&lt;br /&gt;
&lt;br /&gt;
- optprop_co2ice_ir_n50.dat&lt;br /&gt;
&lt;br /&gt;
* Otherwise, you can create your own tables of optical properties, using existing databases. Check this page to learn how to do this: https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/Building_Tables_Of_Aerosol_Optical_Properties&lt;br /&gt;
&lt;br /&gt;
=== Implementing your aerosols in the Generic PCM ===&lt;br /&gt;
&lt;br /&gt;
There are two available aerosol schemes you can use to add a new aerosol in the Generic PCM:&lt;br /&gt;
&lt;br /&gt;
====The n-layer aerosol scheme====&lt;br /&gt;
&lt;br /&gt;
You can use the n-layer scheme (implemented by Jan Vatant) to easily prescribe an aerosol vertical distribution. The scheme is activated by adding aeronlay=.true. in callphys.def.&lt;br /&gt;
&lt;br /&gt;
In this scheme, each layer can have different optical properties, particle sizes, etc. You can use different options (e.g. to fix the aerosol distribution between two atmospheric pressures) of the scheme with aeronlay_choice = 1, 2, etc. &lt;br /&gt;
&lt;br /&gt;
You will need to provide the name of your aerosols optical properties tables in callphys.def. For instance:&lt;br /&gt;
* optprop_aeronlay_vis = 'optprop_saturn_vis_n20.dat'&lt;br /&gt;
* optprop_aeronlay_ir = 'optprop_saturn_ir_n20.dat'&lt;br /&gt;
&lt;br /&gt;
(here, to use the optical properties of aerosols for Saturn)&lt;br /&gt;
&lt;br /&gt;
We encourage you to search for the keyword &amp;quot;aeronlay&amp;quot; in the source code to use more specific options of the scheme.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====The generic condensable scheme====&lt;br /&gt;
&lt;br /&gt;
You can use the generic condensable scheme (implemented by Lucas Teinturier) to easily compute the radiative effect of cloud particles formed by condensation.&lt;br /&gt;
The scheme has to be used conjointly to the generic condensation scheme.&lt;br /&gt;
To activate it, one needs to add the '''aerogeneric=n'''( with n&amp;gt;0 the number of condensable species handled in the scheme) in callphys.def. On top of that, one needs to add in traceur.def, on the solid/ice traceur the option '''is_rgcs = 1'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the model itself, one needs then to manually add your aerosol by modifying the suaer_corrk.F90 routine (if your favorite aerosol is not there yet already) to specify the correct names for your condensing species. A more dynamical/flexible approach will be added at some point, so one won't need to directly modify the code.&lt;br /&gt;
&lt;br /&gt;
More information on how to use the scheme is provided here: https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/Radiative_Generic_Condensable_Specie&lt;br /&gt;
&lt;br /&gt;
====Last Comments====&lt;br /&gt;
&lt;br /&gt;
Don’t forget to add your new aerosol species in traceur.def and adapt the -s option (with the correct number of radiatively active aerosols) at the compilation stage.&lt;br /&gt;
&lt;br /&gt;
== How to Manage Tracers ==&lt;br /&gt;
&lt;br /&gt;
Tracers are managed thanks to the [https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/The_traceur.def_Input_File ''traceur.def''] file.&lt;br /&gt;
&lt;br /&gt;
Specific treatment of some tracers (e.g., water vapor cycle) can be added directly in the model and an option added in [https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/The_callphys.def_Input_File ''callphys.def''] file.&lt;br /&gt;
&lt;br /&gt;
== Use the Z of LMDZ : Zoomed version ==&lt;br /&gt;
&lt;br /&gt;
Do we need this? Has anyone already made use of the zoom module?&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LTeinturier</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=1773</id>
		<title>Tool Box</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=1773"/>
				<updated>2023-12-07T10:52:26Z</updated>
		
		<summary type="html">&lt;p&gt;LTeinturier: /* XARRAY python library (more modern) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Pre-processing Tools ==&lt;br /&gt;
=== newstart: a fortran program to modify start files ===&lt;br /&gt;
&lt;br /&gt;
Newstart is an interactive tool to modify the start files (''start.nc'' and ''startfi.nc''). &lt;br /&gt;
&lt;br /&gt;
To be usable, ''newstart'' should be compile in the ''LMDZ.COMMON'' directory by using the following command line:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./makelmdz_fcm -arch my_arch_file -p std -d 64x48x30 newstart&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
In the example, my_arch_file is the name the arch files (see [https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/The_Target_Architecture_(%22arch%22)_Files arch] ) and 64x48x30 is the resolution of the physical grid.&lt;br /&gt;
Then copy the executable from the ''LMDZ.COMMON/bin'' directory to your bench directory.&lt;br /&gt;
&lt;br /&gt;
When you execute newstart, you can use both a ''start2archive'' file or the start files (''start.nc'' and ''startfi.nc''). Then the interactive interface will propose to modify several physical quantities such as the gravity, the surface pressure or the rotation of the planet. At the end of the procedure, two files are created: '' '''re'''start.nc'' and '' '''re'''startfi.nc''. They can be renamed and used as start files to initialize a new simulation.&lt;br /&gt;
&lt;br /&gt;
We have prepared a simple tutorial to learn how to modify ''start.nc'' and ''startfi.nc'' files (= the the initial conditions) for the Generic PCM: https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/Modify_start_Files&lt;br /&gt;
&lt;br /&gt;
=== start2archive ===&lt;br /&gt;
&lt;br /&gt;
The start2archive tool is similar to newstart in the sense that it can be used to modify the start files. But start2archive can modify the resolution of the physical grid, the topography and the surface thermal inertia while newstart cannot. It is also useful to create an archive of different starting states, then extractable as start files.&lt;br /&gt;
The command line to compile start2archive is similar to the one used for newstart:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./makelmdz_fcm -arch my_arch_file -p std -d 64x48x30 start2archive&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
To modify the resolution, you should first create a start_archive (by using start2archive) file at the used resolution, then compile a newstart file at the new resolution. Newstart will interpolate all the physical quantities on the new grid.&lt;br /&gt;
&lt;br /&gt;
=== other third party scripts and tools ===&lt;br /&gt;
&lt;br /&gt;
You can easily modify start.nc and startfi.nc netcdf files with the xarray Python library. Below you can find an easy example where we modify the surface temperature field.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from    numpy import *&lt;br /&gt;
import  numpy                 as        np&lt;br /&gt;
import  matplotlib.pyplot     as        mpl&lt;br /&gt;
import  math&lt;br /&gt;
import xarray as xr&lt;br /&gt;
&lt;br /&gt;
#FIRST WE GET THE DATA FROM THE GCM SIMULATION&lt;br /&gt;
nc = xr.open_dataset('startfi.nc',decode_times=False) # can be any netcdf file (e.g. start/startfi.nc files)&lt;br /&gt;
&lt;br /&gt;
# BELOW PHYSICAL VARIABLES&lt;br /&gt;
physical_points=nc['physical_points']&lt;br /&gt;
lat=nc['latitude']&lt;br /&gt;
lon=nc['longitude']&lt;br /&gt;
aire_GCM=nc['area']&lt;br /&gt;
&lt;br /&gt;
# BELOW THE VARIABLE WE WANT TO UPDATE&lt;br /&gt;
tsurf=nc['tsurf']&lt;br /&gt;
new_tsurf = np.empty(len(physical_points))&lt;br /&gt;
&lt;br /&gt;
# LOOP TO MODIFY THE VARIABLE&lt;br /&gt;
for i in range(0,len(physical_points),1):&lt;br /&gt;
    new_tsurf[i]=300. # here you put whatever you want ; in this exemple, we assume an isothermal temperature distribution&lt;br /&gt;
&lt;br /&gt;
nc['tsurf'].values = new_tsurf&lt;br /&gt;
nc.to_netcdf('restartfi.nc')&lt;br /&gt;
&lt;br /&gt;
# SANITY CHECK PLOTS&lt;br /&gt;
&lt;br /&gt;
fig = mpl.figure(1)&lt;br /&gt;
mpl.plot(physical_points,tsurf)&lt;br /&gt;
mpl.plot(physical_points,new_tsurf)&lt;br /&gt;
mpl.xlabel('GCM Physical Points')&lt;br /&gt;
mpl.ylabel('Tsurf (K)')&lt;br /&gt;
mpl.show()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Post-processing tools ==&lt;br /&gt;
=== zrecast ===&lt;br /&gt;
&lt;br /&gt;
With this program you can recast atmospheric (i.e.: 4D-dimentional longitude-latitude-altitude-time) data from&lt;br /&gt;
GCM outputs (e.g. as given in diagfi.nc files) onto either ''pressure'' or ''altitude'' above ''areoid vertical'' coordinates.&lt;br /&gt;
Since integrating the hydrostatic equation is required to recast the data, the input file must contain surface pressure&lt;br /&gt;
and atmospheric temperature, as well as the ground geopotential.&lt;br /&gt;
If recasting data onto ''pressure'' coordinates, then the output file name is given by the input file name to which ''_P.nc'' will be appened. If recasting data onto altitude above areoid coordinates, then a ''_A.nc'' will be appened.&lt;br /&gt;
&lt;br /&gt;
=== mass stream function ===&lt;br /&gt;
&lt;br /&gt;
The mass stream function (and the total angular momentum) can be computed from a diagfi.nc or a stats.nc, using the '''streamfunction.F90''' script. The script is located at&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
trunk/LMDZ.GENERIC/utilities&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To compile the script, open the ''compile'' file in the same directory and do the following:&lt;br /&gt;
* Replace &amp;quot;pgf90&amp;quot; with your favorite fortran compiler &lt;br /&gt;
* replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/lib&amp;quot; with the lib address and directory that contains your NetCDF library (file ''libnetcdf.a'').&lt;br /&gt;
* Replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/include&amp;quot; with the address of the directory that contains the NetCDF include file (''netcdf.inc'').&lt;br /&gt;
* You can mess with the compiling options but it is not mandatory.&lt;br /&gt;
&lt;br /&gt;
Once the script is compiled, copy it in the same directory as your '''.nc''' file and run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./streamfunction.e&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The script will ask you for the name of your '''.nc''' file, and will run and produce a new '''nameofyourfile_stream.nc''' file.&lt;br /&gt;
&lt;br /&gt;
'''Be careful''' : In this new file, all fields are temporally and zonally averaged.&lt;br /&gt;
&lt;br /&gt;
If you want to use '''python''' instead of '''fortran''', you can take a look at this [https://github.com/aymeric-spiga/dynanalysis repo]. It hosts a tool to perform dynamical analysis of GCM simulations (and therefore, it computes the mass stream function and a lot of other stuff), but it is tailored for Dynamico only. This repo also takes care of recasting (it does the job of both ''zrecast.F90'' and ''streamfunction.F90'')&lt;br /&gt;
&lt;br /&gt;
== Continuing Simulations ==&lt;br /&gt;
&lt;br /&gt;
=== manually ===&lt;br /&gt;
&lt;br /&gt;
At the end of a simulation, the model generates restart files (files 'restart.nc' and 'restartfi.nc') which contain the final state of the model. The 'restart.nc' and 'restartfi.nc' files have the same format as the 'start.nc' and 'startfi.nc' files, respectively. &lt;br /&gt;
&lt;br /&gt;
These files can in fact be used as initial states to continue the simulation, using the following renaming command lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mv restart.nc start.nc&lt;br /&gt;
mv restartfi.nc startfi.nc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Running a simulation with these start files will in fact resume the simulation from where the previous run ended.&lt;br /&gt;
&lt;br /&gt;
=== with bash scripts ===&lt;br /&gt;
&lt;br /&gt;
We have set up very simple bash scripts to automatize the launching of chain simulations. Here is an example of bash script that does the job:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
###########################################################################&lt;br /&gt;
# Script to perform several chained LMD Mars GCM simulations&lt;br /&gt;
# SET HERE the maximum total number of simulations&lt;br /&gt;
&lt;br /&gt;
nummax=100&lt;br /&gt;
&lt;br /&gt;
###########################################################################&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;---------------------------------------------------------&amp;quot;&lt;br /&gt;
echo &amp;quot;STARTING LOOP RUN&amp;quot;&lt;br /&gt;
echo &amp;quot;---------------------------------------------------------&amp;quot;&lt;br /&gt;
&lt;br /&gt;
dir=`pwd`&lt;br /&gt;
machine=`hostname`&lt;br /&gt;
address=`whoami`&lt;br /&gt;
&lt;br /&gt;
# Look for file &amp;quot;num_run&amp;quot; which should contain &lt;br /&gt;
# the value of the previously computed season&lt;br /&gt;
# (defaults to 0 if file &amp;quot;num_run&amp;quot; does not exist)&lt;br /&gt;
if [[ -r num_run ]] ; then&lt;br /&gt;
  echo &amp;quot;found file num_run&amp;quot;&lt;br /&gt;
  numold=`cat num_run`&lt;br /&gt;
else&lt;br /&gt;
  numold=0&lt;br /&gt;
fi&lt;br /&gt;
echo &amp;quot;numold is set to&amp;quot; ${numold}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Set value of current season &lt;br /&gt;
(( numnew = ${numold} + 1 ))&lt;br /&gt;
echo &amp;quot;numnew is set to&amp;quot; ${numnew}&lt;br /&gt;
&lt;br /&gt;
# Look for initialization data files (exit if none found)&lt;br /&gt;
if [[ ( -r start${numold}.nc  &amp;amp;&amp;amp;  -r startfi${numold}.nc ) ]] ; then&lt;br /&gt;
   \cp -f start${numold}.nc start.nc&lt;br /&gt;
   \cp -f startfi${numold}.nc startfi.nc&lt;br /&gt;
else&lt;br /&gt;
   if (( ${numold} == 99999 )) ; then&lt;br /&gt;
    echo &amp;quot;No run because previous run crashed ! (99999 in num_run)&amp;quot;&lt;br /&gt;
    exit&lt;br /&gt;
   else&lt;br /&gt;
   echo &amp;quot;Where is file start&amp;quot;${numold}&amp;quot;.nc??&amp;quot;&lt;br /&gt;
   exit&lt;br /&gt;
   fi&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Run GCM -- THIS LINE NEEDS TO BE MODIFIED WITH THE CORRECT GCM EXECUTION COMMAND&lt;br /&gt;
mpirun -np 8 gcm_64x48x26_phystd_para.e &amp;lt; diagfi.def &amp;gt; lrun${numnew}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Check if run ended normaly and copy datafiles&lt;br /&gt;
if [[ ( -r restartfi.nc  &amp;amp;&amp;amp;  -r restart.nc ) ]] ; then&lt;br /&gt;
  echo &amp;quot;Run seems to have ended normaly&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  \mv -f restart.nc start${numnew}.nc&lt;br /&gt;
  \mv -f restartfi.nc startfi${numnew}.nc  &lt;br /&gt;
    &lt;br /&gt;
else&lt;br /&gt;
  if [[ -r num_run ]] ; then&lt;br /&gt;
    \mv -f num_run num_run.crash&lt;br /&gt;
  else&lt;br /&gt;
    echo &amp;quot;No file num_run to build num_run.crash from !!&amp;quot;&lt;br /&gt;
    # Impose a default value of 0 for num_run&lt;br /&gt;
    echo 0 &amp;gt; num_run.crash&lt;br /&gt;
  fi&lt;br /&gt;
 echo 99999 &amp;gt; num_run&lt;br /&gt;
 exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Copy other datafiles that may have been generated&lt;br /&gt;
if [[ -r diagfi.nc ]] ; then&lt;br /&gt;
  \mv -f diagfi.nc diagfi${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -r diagsoil.nc ]] ; then&lt;br /&gt;
  \mv -f diagsoil.nc diagsoil${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -r stats.nc ]] ; then&lt;br /&gt;
  \mv -f stats.nc stats${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -f profiles.dat ]] ; then&lt;br /&gt;
  \mv -f profiles.dat profiles${numnew}.dat&lt;br /&gt;
  \mv -f profiles.hdr profiles${numnew}.hdr&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Prepare things for upcoming runs by writing&lt;br /&gt;
# value of computed season in file num_run&lt;br /&gt;
echo ${numnew} &amp;gt; num_run&lt;br /&gt;
&lt;br /&gt;
# If we are over nummax : stop&lt;br /&gt;
if (( $numnew + 1 &amp;gt; $nummax )) ; then&lt;br /&gt;
   exit&lt;br /&gt;
# If not : restart the loop (copy the executable and run the copy)&lt;br /&gt;
else&lt;br /&gt;
   \cp -f run_gnome exe_mars&lt;br /&gt;
   ./exe_mars&lt;br /&gt;
fi &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Summary of what this bash script does''':&lt;br /&gt;
&lt;br /&gt;
* It reads the file 'num_run' which contains the step of the simulation. &lt;br /&gt;
If num_run is&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
then the script expects to read start5.nc and startfi5.nc.&lt;br /&gt;
* It modifies start5.nc and startfi5.nc into start.nc and startfi.nc, respectively.&lt;br /&gt;
* It runs the GCM.&lt;br /&gt;
* It modifies restart.nc and restartfi.nc into start6.nc and startfi6.nc&lt;br /&gt;
* It rewrite num_run as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* It restarts the loop until num_run reaches the value (defined in nummax):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Processing Output Files with NCOs ==&lt;br /&gt;
&lt;br /&gt;
NCOs (NetCdf OperatorS) are a set of powerful command-line utilities – available on Linux, Mac and PC – that allow to perform useful (and very fast!) post-processing operations on netCDF GCM output files. Full documentation can be found on http://research.jisao.washington.edu/data_sets/nco/, but we provide below a few examples of command lines.&lt;br /&gt;
&lt;br /&gt;
* How to calculate a time mean of a netCDF 'diagfi.nc' file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ncra -F -d Time,1,,1 diagfi.nc diagfi_MEAN.nc # format is &amp;quot;-d dimension,minimum,maximum,stride&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Subsetting time in a netCDF 'diagfi.nc' file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ncea -F -d Time,first,last diagfi.nc diagfi_subset.nc # format is &amp;quot;-d dimension,minimum,maximum&amp;quot; ; we recall you can type &amp;quot;ncdump -v time diagfi.nc&amp;quot; to see the Time values in the netCDF file.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Decimating a netCDF 'diagfi.nc' file in time&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ncks -F -d Time,1,,8 diagfi.nc diagfi_decimated.nc # format is &amp;quot;-d dimension,minimum,maximum,stride&amp;quot; ; In this example, this means that data is extracted 1 time every 8 time steps, starting from the first time step (number 1), ending at the last time step).&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Extract a variable from a netCDF 'diagfi.nc' file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ncks -v tsurf,temp,p diagfi.nc diagfi_out.nc # Here we created a new file named 'diagfi_out.nc' in which we only kept variables named 'tsurf' (surface temperatures), 'temp' (atmospheric temperatures) and p (atmospheric pressures).&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, more examples can be found on http://research.jisao.washington.edu/data_sets/nco/ .&lt;br /&gt;
&lt;br /&gt;
== Data Handling and Visualization Software ==&lt;br /&gt;
&lt;br /&gt;
There are several data handling and visualization tools that can be used to analyse and plot the results from GCM simulations (using the diagfi.nc NetCDF files). We provide below a panorama of most widely used solutions.&lt;br /&gt;
&lt;br /&gt;
=== panoply ===&lt;br /&gt;
Panoply is a user-friendly tool for viewing raw NetCDF data, available here: https://www.giss.nasa.gov/tools/panoply/ . It is very convenient to make pretty visuals (see an example for the exoplanet TRAPPIST-1e). There are many options that can be used (map projections, masks, colorbars, shadows, etc.) to make your plots fancy. However, the tool is not very well suited for manipulating data (compute averages, statistics, etc.).&lt;br /&gt;
&lt;br /&gt;
* Installation on Linux:&lt;br /&gt;
You simply need to download and untar the Package from the Panoply website. Note that to work it requires that Java and related Java Runtime environment (JRE) be installed on your system (otherwise it will simply look as if &amp;quot;nothing is happening&amp;quot; when you try to launch Panoply via the &amp;quot;panoply.sh&amp;quot; script), which on Ubuntu simply requires something like:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt install java&lt;br /&gt;
sudo apt install default-jre&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Run on Linux (assuming the panoply.sh script is in a directory included in your PATH environment variable):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
panoply.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Example panoply.png|thumb|Screenshot of panoply showing here Generic PCM results for the exoplanet TRAPPIST-1e (surface temperatures)]]&lt;br /&gt;
&lt;br /&gt;
=== ncview ===&lt;br /&gt;
ncview is another useful user-friendly tool for viewing raw NetCDF data. This is kind of a very archaic version of panoply, but it is convenient because it allows to have a very quick first look at netCDF data files.&lt;br /&gt;
&lt;br /&gt;
Command line tool to visualize NetCDF data:&lt;br /&gt;
* Installation on Linux-Ubuntu:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt install ncview&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Run on Linux:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ncview diagfi.nc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Example ncview.png|thumb|Screenshot of ncview showing here Generic PCM results for the exoplanet Proxima b (OLR - Thermal Emission)]]&lt;br /&gt;
&lt;br /&gt;
=== python scripts ===&lt;br /&gt;
&lt;br /&gt;
Python scripts provide a very useful mean to analyse and visualize netCDF files.&lt;br /&gt;
&lt;br /&gt;
==== NETCDF4 python library (old school) ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can use the netCDF4 python library to open a netCDF file and put data in tables that can then be manipulated and plotted.&lt;br /&gt;
&lt;br /&gt;
Here is an exemple of how to open and read a netCDF file with Python:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line&amp;gt;&lt;br /&gt;
import numpy&lt;br /&gt;
from netCDF4 import Dataset&lt;br /&gt;
&lt;br /&gt;
# HERE WE OPEN THE NETCDF FILE&lt;br /&gt;
nc = Dataset('diagfi.nc')&lt;br /&gt;
&lt;br /&gt;
# HERE WE READ THE VARIABLES (1D OUTPUT)&lt;br /&gt;
Time=nc.variables['Time'][:]&lt;br /&gt;
lat=nc.variables['latitude'][:]&lt;br /&gt;
lon=nc.variables['longitude'][:]&lt;br /&gt;
al=nc.variables['altitude'][:]&lt;br /&gt;
&lt;br /&gt;
# HERE WE READ THE AREA (2D OUTPUT)&lt;br /&gt;
aire_GCM=nc.variables['aire'][:][:]&lt;br /&gt;
&lt;br /&gt;
# HERE WE READ 3D OUTPUTS&lt;br /&gt;
tsurf=nc.variables['tsurf'][:][:][:] # this is the surface temperature 3D field (time, latitude, longitude, altitude)&lt;br /&gt;
&lt;br /&gt;
# HERE WE READ 4D OUTPUTS&lt;br /&gt;
temp=nc.variables['temp'][:][:][:][:] # this is the atmospheric temperature 4D field (time, latitude, longitude, altitude)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And here is an exemple of how to manipulate the netCDF data (here to compute the time averaged surface temperatures):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line&amp;gt;&lt;br /&gt;
from numpy import *&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
mean_tsurf=np.zeros((len(lat),len(lon)),dtype='f')&lt;br /&gt;
&lt;br /&gt;
for i in range(0,len(Time)):&lt;br /&gt;
    for j in range(0,len(lat)):&lt;br /&gt;
        for k in range(0,len(lon)):&lt;br /&gt;
            mean_tsurf[j,k]=mean_tsurf[j,k]+tsurf[i,j,k]*(1./len(Time))&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And here is a last exemple of how to plot the data (using matplotlib):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line&amp;gt;&lt;br /&gt;
import matplotlib.pyplot as plt&lt;br /&gt;
&lt;br /&gt;
plt.figure(1)&lt;br /&gt;
plt.contourf(lon_GCM,lat_GCM,mean_tsurf)&lt;br /&gt;
plt.colorbar(label='Surface Temperature (K)')&lt;br /&gt;
plt.xlabel('Longitude ($^{\circ}$)')&lt;br /&gt;
plt.ylabel('Latitude ($^{\circ}$)')&lt;br /&gt;
plt.show()&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== XARRAY python library (more modern) ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another useful library to deal with netcdf files is ''xarray''. We provide a code snippet below, doing the same thing as the snippets above.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line&amp;gt;&lt;br /&gt;
import numpy as np&lt;br /&gt;
import xarray as xr &lt;br /&gt;
import matplotlib.pyplot as plt &lt;br /&gt;
&lt;br /&gt;
# HERE WE OPEN THE NETCDF FILE&lt;br /&gt;
data = xr.open_dataset('diagfi.nc',&lt;br /&gt;
                       decode_times=False)&lt;br /&gt;
&lt;br /&gt;
# HERE WE READ THE VARIABLES (1D OUTPUT)&lt;br /&gt;
Time=data['Time']&lt;br /&gt;
lat=data['latitude']&lt;br /&gt;
lon=data['longitude']&lt;br /&gt;
al=data['altitude']&lt;br /&gt;
&lt;br /&gt;
# HERE WE READ THE AREA (2D OUTPUT)&lt;br /&gt;
aire_GCM=data['aire']&lt;br /&gt;
&lt;br /&gt;
# HERE WE READ 3D OUTPUTS&lt;br /&gt;
tsurf=data['tsurf'] # this is the surface temperature 3D field (time, latitude, longitude, altitude)&lt;br /&gt;
&lt;br /&gt;
# HERE WE READ 4D OUTPUTS&lt;br /&gt;
temp=data['temp'] # this is the atmospheric temperature 4D field (time, latitude, longitude, altitude)&lt;br /&gt;
&lt;br /&gt;
## let's take the time-averaged surface temperature&lt;br /&gt;
mean_tsurf = np.mean(tsurf,axis=0)&lt;br /&gt;
&lt;br /&gt;
##Let's plot a lon-lat map&lt;br /&gt;
fig = plt.figure()&lt;br /&gt;
plt.contourf(lon,lat,mean_tsurf)&lt;br /&gt;
plt.colorbar(label='Surface Temperature (K)')&lt;br /&gt;
plt.xlabel('Longitude ($^{\circ}$)')&lt;br /&gt;
plt.ylabel('Latitude ($^{\circ}$)')&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Don't hesitate to use the function called ''.values'' to transform any ''xarray'' into a numpy array, especially in case of calculation time problems. &lt;br /&gt;
For more examples on how to use ''xarray'', take a look at the [https://docs.xarray.dev/en/stable/index.html documentation]. &lt;br /&gt;
Here is another example of how one can use xarray with multiples netcdfiles.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line&amp;gt;&lt;br /&gt;
&lt;br /&gt;
import xarray as xr&lt;br /&gt;
import os&lt;br /&gt;
&lt;br /&gt;
# your folder where output files are stored&lt;br /&gt;
FOLDER = './your_folder_with_output_files/'&lt;br /&gt;
&lt;br /&gt;
# take back the files from your FOLDER&lt;br /&gt;
list_files_folder=os.listdir(FOLDER)&lt;br /&gt;
&lt;br /&gt;
# If there are several files.&lt;br /&gt;
# Sort your simulation files by date,&lt;br /&gt;
# so beginning of simulation will be top of the list&lt;br /&gt;
# and end of simulation will be end of the list.&lt;br /&gt;
list_files_folder.sort()&lt;br /&gt;
&lt;br /&gt;
files = [FOLDER+str(f) for f in list_files_folder]&lt;br /&gt;
# if you want to keep only files of special_year you can add this option :&lt;br /&gt;
# files = [FOLDER+str(f) for f in list_files_folder if f.startswith(&amp;quot;special_year&amp;quot;)]&lt;br /&gt;
&lt;br /&gt;
# xarray will magically concatenate your outfiles by 'Time' (or any other 'concat_dime' you want)&lt;br /&gt;
nc=xr.open_mfdataset(files,decode_times=False, concat_dim='Time', combine='nested')&lt;br /&gt;
&lt;br /&gt;
# to check your keys&lt;br /&gt;
for key in nc.keys():&lt;br /&gt;
    print(key)&lt;br /&gt;
&lt;br /&gt;
# to load keys (example here with keys for a mesoscale simulation)&lt;br /&gt;
Times = nc['Times'][:]&lt;br /&gt;
PTOT = nc['PTOT'][:]&lt;br /&gt;
T = nc['T'][:]&lt;br /&gt;
W = nc['W'][:]&lt;br /&gt;
&lt;br /&gt;
# you can use some functions to make averages etc&lt;br /&gt;
&lt;br /&gt;
T_moy = T.mean(dim=['Time','south_north','west_east'])&lt;br /&gt;
&lt;br /&gt;
# other functions&lt;br /&gt;
# .cumsum (cumulative sum)&lt;br /&gt;
# .rename (change the name of the object)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One cool thing about xarray is that it is well optimized, and can do whatever you want to do on your data, but better than you. See for instance, the example below to plot a temperature lon-lat map. Xarray handles it in 5 lines of code, where you would need a lot more to set-up you plot in traditional matplotlib. And the results look almost good enough for a paper plot. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line&amp;gt;&lt;br /&gt;
import xarray as xr&lt;br /&gt;
import matplotlib.pyplot as plt &lt;br /&gt;
##Load your data and print it &lt;br /&gt;
file = '/home/lteinturier/Documents/PhD/wasp43b/chemistry_project/input_5xsolar.nc'&lt;br /&gt;
data = xr.open_dataset(file,decode_times=False)&lt;br /&gt;
print(data)&lt;br /&gt;
##extracting the altitude level #20 for the whole file&lt;br /&gt;
data = data.isel(altitude=20)&lt;br /&gt;
##let's assume that data hold a time-series of the temperature. Let's average it in time&lt;br /&gt;
temp = data['temp'].mean(&amp;quot;Time&amp;quot;,keep_attrs=True) #we keep the attribute when averaging to conserve the DataArray structure&lt;br /&gt;
##now we plot &lt;br /&gt;
fig = temp.plot.contourf(cmap='gnuplot',levels=50) #choose the colormap and the number of contourf levels &lt;br /&gt;
fig.ax.set_title(&amp;quot;P = {:.2e} mbar&amp;quot;.format(data.p.mean().values)) ##set-up your title. If you don't change it, the title will be the altitude in km of your atmospheric level&lt;br /&gt;
plt.show()&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This is only a fraction of what Xarray can do. Check the [https://docs.xarray.dev/en/stable/user-guide/index.html documentation] for more.&lt;br /&gt;
&lt;br /&gt;
==== Python tutorials to make pretty visuals ====&lt;br /&gt;
&lt;br /&gt;
We provide a tutorial on how to make pretty visuals using Generic PCM 3-D simulations [https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/Plots_With_PyVista here].&lt;br /&gt;
&lt;br /&gt;
=== Planetoplot ===&lt;br /&gt;
&lt;br /&gt;
Planetoplot is a in-house, python based library developped to vizualize Generic PCM data.&lt;br /&gt;
&lt;br /&gt;
The code and documentation can be found at: https://nbviewer.org/github/aymeric-spiga/planetoplot/blob/master/tutorial/planetoplot_tutorial.ipynb&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;br /&gt;
[[Category:Generic-LMDZ]]&lt;br /&gt;
[[Category:Generic-DYNAMICO]]&lt;br /&gt;
[[Category:Generic-WRF]]&lt;br /&gt;
[[Category:Generic-1D]]&lt;/div&gt;</summary>
		<author><name>LTeinturier</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=1772</id>
		<title>Tool Box</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=1772"/>
				<updated>2023-12-07T10:51:28Z</updated>
		
		<summary type="html">&lt;p&gt;LTeinturier: /* XARRAY python library (more modern) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Pre-processing Tools ==&lt;br /&gt;
=== newstart: a fortran program to modify start files ===&lt;br /&gt;
&lt;br /&gt;
Newstart is an interactive tool to modify the start files (''start.nc'' and ''startfi.nc''). &lt;br /&gt;
&lt;br /&gt;
To be usable, ''newstart'' should be compile in the ''LMDZ.COMMON'' directory by using the following command line:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./makelmdz_fcm -arch my_arch_file -p std -d 64x48x30 newstart&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
In the example, my_arch_file is the name the arch files (see [https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/The_Target_Architecture_(%22arch%22)_Files arch] ) and 64x48x30 is the resolution of the physical grid.&lt;br /&gt;
Then copy the executable from the ''LMDZ.COMMON/bin'' directory to your bench directory.&lt;br /&gt;
&lt;br /&gt;
When you execute newstart, you can use both a ''start2archive'' file or the start files (''start.nc'' and ''startfi.nc''). Then the interactive interface will propose to modify several physical quantities such as the gravity, the surface pressure or the rotation of the planet. At the end of the procedure, two files are created: '' '''re'''start.nc'' and '' '''re'''startfi.nc''. They can be renamed and used as start files to initialize a new simulation.&lt;br /&gt;
&lt;br /&gt;
We have prepared a simple tutorial to learn how to modify ''start.nc'' and ''startfi.nc'' files (= the the initial conditions) for the Generic PCM: https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/Modify_start_Files&lt;br /&gt;
&lt;br /&gt;
=== start2archive ===&lt;br /&gt;
&lt;br /&gt;
The start2archive tool is similar to newstart in the sense that it can be used to modify the start files. But start2archive can modify the resolution of the physical grid, the topography and the surface thermal inertia while newstart cannot. It is also useful to create an archive of different starting states, then extractable as start files.&lt;br /&gt;
The command line to compile start2archive is similar to the one used for newstart:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./makelmdz_fcm -arch my_arch_file -p std -d 64x48x30 start2archive&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
To modify the resolution, you should first create a start_archive (by using start2archive) file at the used resolution, then compile a newstart file at the new resolution. Newstart will interpolate all the physical quantities on the new grid.&lt;br /&gt;
&lt;br /&gt;
=== other third party scripts and tools ===&lt;br /&gt;
&lt;br /&gt;
You can easily modify start.nc and startfi.nc netcdf files with the xarray Python library. Below you can find an easy example where we modify the surface temperature field.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from    numpy import *&lt;br /&gt;
import  numpy                 as        np&lt;br /&gt;
import  matplotlib.pyplot     as        mpl&lt;br /&gt;
import  math&lt;br /&gt;
import xarray as xr&lt;br /&gt;
&lt;br /&gt;
#FIRST WE GET THE DATA FROM THE GCM SIMULATION&lt;br /&gt;
nc = xr.open_dataset('startfi.nc',decode_times=False) # can be any netcdf file (e.g. start/startfi.nc files)&lt;br /&gt;
&lt;br /&gt;
# BELOW PHYSICAL VARIABLES&lt;br /&gt;
physical_points=nc['physical_points']&lt;br /&gt;
lat=nc['latitude']&lt;br /&gt;
lon=nc['longitude']&lt;br /&gt;
aire_GCM=nc['area']&lt;br /&gt;
&lt;br /&gt;
# BELOW THE VARIABLE WE WANT TO UPDATE&lt;br /&gt;
tsurf=nc['tsurf']&lt;br /&gt;
new_tsurf = np.empty(len(physical_points))&lt;br /&gt;
&lt;br /&gt;
# LOOP TO MODIFY THE VARIABLE&lt;br /&gt;
for i in range(0,len(physical_points),1):&lt;br /&gt;
    new_tsurf[i]=300. # here you put whatever you want ; in this exemple, we assume an isothermal temperature distribution&lt;br /&gt;
&lt;br /&gt;
nc['tsurf'].values = new_tsurf&lt;br /&gt;
nc.to_netcdf('restartfi.nc')&lt;br /&gt;
&lt;br /&gt;
# SANITY CHECK PLOTS&lt;br /&gt;
&lt;br /&gt;
fig = mpl.figure(1)&lt;br /&gt;
mpl.plot(physical_points,tsurf)&lt;br /&gt;
mpl.plot(physical_points,new_tsurf)&lt;br /&gt;
mpl.xlabel('GCM Physical Points')&lt;br /&gt;
mpl.ylabel('Tsurf (K)')&lt;br /&gt;
mpl.show()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Post-processing tools ==&lt;br /&gt;
=== zrecast ===&lt;br /&gt;
&lt;br /&gt;
With this program you can recast atmospheric (i.e.: 4D-dimentional longitude-latitude-altitude-time) data from&lt;br /&gt;
GCM outputs (e.g. as given in diagfi.nc files) onto either ''pressure'' or ''altitude'' above ''areoid vertical'' coordinates.&lt;br /&gt;
Since integrating the hydrostatic equation is required to recast the data, the input file must contain surface pressure&lt;br /&gt;
and atmospheric temperature, as well as the ground geopotential.&lt;br /&gt;
If recasting data onto ''pressure'' coordinates, then the output file name is given by the input file name to which ''_P.nc'' will be appened. If recasting data onto altitude above areoid coordinates, then a ''_A.nc'' will be appened.&lt;br /&gt;
&lt;br /&gt;
=== mass stream function ===&lt;br /&gt;
&lt;br /&gt;
The mass stream function (and the total angular momentum) can be computed from a diagfi.nc or a stats.nc, using the '''streamfunction.F90''' script. The script is located at&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
trunk/LMDZ.GENERIC/utilities&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To compile the script, open the ''compile'' file in the same directory and do the following:&lt;br /&gt;
* Replace &amp;quot;pgf90&amp;quot; with your favorite fortran compiler &lt;br /&gt;
* replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/lib&amp;quot; with the lib address and directory that contains your NetCDF library (file ''libnetcdf.a'').&lt;br /&gt;
* Replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/include&amp;quot; with the address of the directory that contains the NetCDF include file (''netcdf.inc'').&lt;br /&gt;
* You can mess with the compiling options but it is not mandatory.&lt;br /&gt;
&lt;br /&gt;
Once the script is compiled, copy it in the same directory as your '''.nc''' file and run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./streamfunction.e&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The script will ask you for the name of your '''.nc''' file, and will run and produce a new '''nameofyourfile_stream.nc''' file.&lt;br /&gt;
&lt;br /&gt;
'''Be careful''' : In this new file, all fields are temporally and zonally averaged.&lt;br /&gt;
&lt;br /&gt;
If you want to use '''python''' instead of '''fortran''', you can take a look at this [https://github.com/aymeric-spiga/dynanalysis repo]. It hosts a tool to perform dynamical analysis of GCM simulations (and therefore, it computes the mass stream function and a lot of other stuff), but it is tailored for Dynamico only. This repo also takes care of recasting (it does the job of both ''zrecast.F90'' and ''streamfunction.F90'')&lt;br /&gt;
&lt;br /&gt;
== Continuing Simulations ==&lt;br /&gt;
&lt;br /&gt;
=== manually ===&lt;br /&gt;
&lt;br /&gt;
At the end of a simulation, the model generates restart files (files 'restart.nc' and 'restartfi.nc') which contain the final state of the model. The 'restart.nc' and 'restartfi.nc' files have the same format as the 'start.nc' and 'startfi.nc' files, respectively. &lt;br /&gt;
&lt;br /&gt;
These files can in fact be used as initial states to continue the simulation, using the following renaming command lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mv restart.nc start.nc&lt;br /&gt;
mv restartfi.nc startfi.nc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Running a simulation with these start files will in fact resume the simulation from where the previous run ended.&lt;br /&gt;
&lt;br /&gt;
=== with bash scripts ===&lt;br /&gt;
&lt;br /&gt;
We have set up very simple bash scripts to automatize the launching of chain simulations. Here is an example of bash script that does the job:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
###########################################################################&lt;br /&gt;
# Script to perform several chained LMD Mars GCM simulations&lt;br /&gt;
# SET HERE the maximum total number of simulations&lt;br /&gt;
&lt;br /&gt;
nummax=100&lt;br /&gt;
&lt;br /&gt;
###########################################################################&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;---------------------------------------------------------&amp;quot;&lt;br /&gt;
echo &amp;quot;STARTING LOOP RUN&amp;quot;&lt;br /&gt;
echo &amp;quot;---------------------------------------------------------&amp;quot;&lt;br /&gt;
&lt;br /&gt;
dir=`pwd`&lt;br /&gt;
machine=`hostname`&lt;br /&gt;
address=`whoami`&lt;br /&gt;
&lt;br /&gt;
# Look for file &amp;quot;num_run&amp;quot; which should contain &lt;br /&gt;
# the value of the previously computed season&lt;br /&gt;
# (defaults to 0 if file &amp;quot;num_run&amp;quot; does not exist)&lt;br /&gt;
if [[ -r num_run ]] ; then&lt;br /&gt;
  echo &amp;quot;found file num_run&amp;quot;&lt;br /&gt;
  numold=`cat num_run`&lt;br /&gt;
else&lt;br /&gt;
  numold=0&lt;br /&gt;
fi&lt;br /&gt;
echo &amp;quot;numold is set to&amp;quot; ${numold}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Set value of current season &lt;br /&gt;
(( numnew = ${numold} + 1 ))&lt;br /&gt;
echo &amp;quot;numnew is set to&amp;quot; ${numnew}&lt;br /&gt;
&lt;br /&gt;
# Look for initialization data files (exit if none found)&lt;br /&gt;
if [[ ( -r start${numold}.nc  &amp;amp;&amp;amp;  -r startfi${numold}.nc ) ]] ; then&lt;br /&gt;
   \cp -f start${numold}.nc start.nc&lt;br /&gt;
   \cp -f startfi${numold}.nc startfi.nc&lt;br /&gt;
else&lt;br /&gt;
   if (( ${numold} == 99999 )) ; then&lt;br /&gt;
    echo &amp;quot;No run because previous run crashed ! (99999 in num_run)&amp;quot;&lt;br /&gt;
    exit&lt;br /&gt;
   else&lt;br /&gt;
   echo &amp;quot;Where is file start&amp;quot;${numold}&amp;quot;.nc??&amp;quot;&lt;br /&gt;
   exit&lt;br /&gt;
   fi&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Run GCM -- THIS LINE NEEDS TO BE MODIFIED WITH THE CORRECT GCM EXECUTION COMMAND&lt;br /&gt;
mpirun -np 8 gcm_64x48x26_phystd_para.e &amp;lt; diagfi.def &amp;gt; lrun${numnew}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Check if run ended normaly and copy datafiles&lt;br /&gt;
if [[ ( -r restartfi.nc  &amp;amp;&amp;amp;  -r restart.nc ) ]] ; then&lt;br /&gt;
  echo &amp;quot;Run seems to have ended normaly&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  \mv -f restart.nc start${numnew}.nc&lt;br /&gt;
  \mv -f restartfi.nc startfi${numnew}.nc  &lt;br /&gt;
    &lt;br /&gt;
else&lt;br /&gt;
  if [[ -r num_run ]] ; then&lt;br /&gt;
    \mv -f num_run num_run.crash&lt;br /&gt;
  else&lt;br /&gt;
    echo &amp;quot;No file num_run to build num_run.crash from !!&amp;quot;&lt;br /&gt;
    # Impose a default value of 0 for num_run&lt;br /&gt;
    echo 0 &amp;gt; num_run.crash&lt;br /&gt;
  fi&lt;br /&gt;
 echo 99999 &amp;gt; num_run&lt;br /&gt;
 exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Copy other datafiles that may have been generated&lt;br /&gt;
if [[ -r diagfi.nc ]] ; then&lt;br /&gt;
  \mv -f diagfi.nc diagfi${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -r diagsoil.nc ]] ; then&lt;br /&gt;
  \mv -f diagsoil.nc diagsoil${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -r stats.nc ]] ; then&lt;br /&gt;
  \mv -f stats.nc stats${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -f profiles.dat ]] ; then&lt;br /&gt;
  \mv -f profiles.dat profiles${numnew}.dat&lt;br /&gt;
  \mv -f profiles.hdr profiles${numnew}.hdr&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Prepare things for upcoming runs by writing&lt;br /&gt;
# value of computed season in file num_run&lt;br /&gt;
echo ${numnew} &amp;gt; num_run&lt;br /&gt;
&lt;br /&gt;
# If we are over nummax : stop&lt;br /&gt;
if (( $numnew + 1 &amp;gt; $nummax )) ; then&lt;br /&gt;
   exit&lt;br /&gt;
# If not : restart the loop (copy the executable and run the copy)&lt;br /&gt;
else&lt;br /&gt;
   \cp -f run_gnome exe_mars&lt;br /&gt;
   ./exe_mars&lt;br /&gt;
fi &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Summary of what this bash script does''':&lt;br /&gt;
&lt;br /&gt;
* It reads the file 'num_run' which contains the step of the simulation. &lt;br /&gt;
If num_run is&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
then the script expects to read start5.nc and startfi5.nc.&lt;br /&gt;
* It modifies start5.nc and startfi5.nc into start.nc and startfi.nc, respectively.&lt;br /&gt;
* It runs the GCM.&lt;br /&gt;
* It modifies restart.nc and restartfi.nc into start6.nc and startfi6.nc&lt;br /&gt;
* It rewrite num_run as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* It restarts the loop until num_run reaches the value (defined in nummax):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Processing Output Files with NCOs ==&lt;br /&gt;
&lt;br /&gt;
NCOs (NetCdf OperatorS) are a set of powerful command-line utilities – available on Linux, Mac and PC – that allow to perform useful (and very fast!) post-processing operations on netCDF GCM output files. Full documentation can be found on http://research.jisao.washington.edu/data_sets/nco/, but we provide below a few examples of command lines.&lt;br /&gt;
&lt;br /&gt;
* How to calculate a time mean of a netCDF 'diagfi.nc' file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ncra -F -d Time,1,,1 diagfi.nc diagfi_MEAN.nc # format is &amp;quot;-d dimension,minimum,maximum,stride&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Subsetting time in a netCDF 'diagfi.nc' file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ncea -F -d Time,first,last diagfi.nc diagfi_subset.nc # format is &amp;quot;-d dimension,minimum,maximum&amp;quot; ; we recall you can type &amp;quot;ncdump -v time diagfi.nc&amp;quot; to see the Time values in the netCDF file.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Decimating a netCDF 'diagfi.nc' file in time&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ncks -F -d Time,1,,8 diagfi.nc diagfi_decimated.nc # format is &amp;quot;-d dimension,minimum,maximum,stride&amp;quot; ; In this example, this means that data is extracted 1 time every 8 time steps, starting from the first time step (number 1), ending at the last time step).&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Extract a variable from a netCDF 'diagfi.nc' file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ncks -v tsurf,temp,p diagfi.nc diagfi_out.nc # Here we created a new file named 'diagfi_out.nc' in which we only kept variables named 'tsurf' (surface temperatures), 'temp' (atmospheric temperatures) and p (atmospheric pressures).&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, more examples can be found on http://research.jisao.washington.edu/data_sets/nco/ .&lt;br /&gt;
&lt;br /&gt;
== Data Handling and Visualization Software ==&lt;br /&gt;
&lt;br /&gt;
There are several data handling and visualization tools that can be used to analyse and plot the results from GCM simulations (using the diagfi.nc NetCDF files). We provide below a panorama of most widely used solutions.&lt;br /&gt;
&lt;br /&gt;
=== panoply ===&lt;br /&gt;
Panoply is a user-friendly tool for viewing raw NetCDF data, available here: https://www.giss.nasa.gov/tools/panoply/ . It is very convenient to make pretty visuals (see an example for the exoplanet TRAPPIST-1e). There are many options that can be used (map projections, masks, colorbars, shadows, etc.) to make your plots fancy. However, the tool is not very well suited for manipulating data (compute averages, statistics, etc.).&lt;br /&gt;
&lt;br /&gt;
* Installation on Linux:&lt;br /&gt;
You simply need to download and untar the Package from the Panoply website. Note that to work it requires that Java and related Java Runtime environment (JRE) be installed on your system (otherwise it will simply look as if &amp;quot;nothing is happening&amp;quot; when you try to launch Panoply via the &amp;quot;panoply.sh&amp;quot; script), which on Ubuntu simply requires something like:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt install java&lt;br /&gt;
sudo apt install default-jre&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Run on Linux (assuming the panoply.sh script is in a directory included in your PATH environment variable):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
panoply.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Example panoply.png|thumb|Screenshot of panoply showing here Generic PCM results for the exoplanet TRAPPIST-1e (surface temperatures)]]&lt;br /&gt;
&lt;br /&gt;
=== ncview ===&lt;br /&gt;
ncview is another useful user-friendly tool for viewing raw NetCDF data. This is kind of a very archaic version of panoply, but it is convenient because it allows to have a very quick first look at netCDF data files.&lt;br /&gt;
&lt;br /&gt;
Command line tool to visualize NetCDF data:&lt;br /&gt;
* Installation on Linux-Ubuntu:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt install ncview&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Run on Linux:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ncview diagfi.nc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Example ncview.png|thumb|Screenshot of ncview showing here Generic PCM results for the exoplanet Proxima b (OLR - Thermal Emission)]]&lt;br /&gt;
&lt;br /&gt;
=== python scripts ===&lt;br /&gt;
&lt;br /&gt;
Python scripts provide a very useful mean to analyse and visualize netCDF files.&lt;br /&gt;
&lt;br /&gt;
==== NETCDF4 python library (old school) ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can use the netCDF4 python library to open a netCDF file and put data in tables that can then be manipulated and plotted.&lt;br /&gt;
&lt;br /&gt;
Here is an exemple of how to open and read a netCDF file with Python:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line&amp;gt;&lt;br /&gt;
import numpy&lt;br /&gt;
from netCDF4 import Dataset&lt;br /&gt;
&lt;br /&gt;
# HERE WE OPEN THE NETCDF FILE&lt;br /&gt;
nc = Dataset('diagfi.nc')&lt;br /&gt;
&lt;br /&gt;
# HERE WE READ THE VARIABLES (1D OUTPUT)&lt;br /&gt;
Time=nc.variables['Time'][:]&lt;br /&gt;
lat=nc.variables['latitude'][:]&lt;br /&gt;
lon=nc.variables['longitude'][:]&lt;br /&gt;
al=nc.variables['altitude'][:]&lt;br /&gt;
&lt;br /&gt;
# HERE WE READ THE AREA (2D OUTPUT)&lt;br /&gt;
aire_GCM=nc.variables['aire'][:][:]&lt;br /&gt;
&lt;br /&gt;
# HERE WE READ 3D OUTPUTS&lt;br /&gt;
tsurf=nc.variables['tsurf'][:][:][:] # this is the surface temperature 3D field (time, latitude, longitude, altitude)&lt;br /&gt;
&lt;br /&gt;
# HERE WE READ 4D OUTPUTS&lt;br /&gt;
temp=nc.variables['temp'][:][:][:][:] # this is the atmospheric temperature 4D field (time, latitude, longitude, altitude)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And here is an exemple of how to manipulate the netCDF data (here to compute the time averaged surface temperatures):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line&amp;gt;&lt;br /&gt;
from numpy import *&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
mean_tsurf=np.zeros((len(lat),len(lon)),dtype='f')&lt;br /&gt;
&lt;br /&gt;
for i in range(0,len(Time)):&lt;br /&gt;
    for j in range(0,len(lat)):&lt;br /&gt;
        for k in range(0,len(lon)):&lt;br /&gt;
            mean_tsurf[j,k]=mean_tsurf[j,k]+tsurf[i,j,k]*(1./len(Time))&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And here is a last exemple of how to plot the data (using matplotlib):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line&amp;gt;&lt;br /&gt;
import matplotlib.pyplot as plt&lt;br /&gt;
&lt;br /&gt;
plt.figure(1)&lt;br /&gt;
plt.contourf(lon_GCM,lat_GCM,mean_tsurf)&lt;br /&gt;
plt.colorbar(label='Surface Temperature (K)')&lt;br /&gt;
plt.xlabel('Longitude ($^{\circ}$)')&lt;br /&gt;
plt.ylabel('Latitude ($^{\circ}$)')&lt;br /&gt;
plt.show()&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== XARRAY python library (more modern) ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another useful library to deal with netcdf files is ''xarray''. We provide a code snippet below, doing the same thing as the snippets above.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line&amp;gt;&lt;br /&gt;
import numpy as np&lt;br /&gt;
import xarray as xr &lt;br /&gt;
import matplotlib.pyplot as plt &lt;br /&gt;
&lt;br /&gt;
# HERE WE OPEN THE NETCDF FILE&lt;br /&gt;
data = xr.open_dataset('diagfi.nc',&lt;br /&gt;
                       decode_times=False)&lt;br /&gt;
&lt;br /&gt;
# HERE WE READ THE VARIABLES (1D OUTPUT)&lt;br /&gt;
Time=data['Time']&lt;br /&gt;
lat=data['latitude']&lt;br /&gt;
lon=data['longitude']&lt;br /&gt;
al=data['altitude']&lt;br /&gt;
&lt;br /&gt;
# HERE WE READ THE AREA (2D OUTPUT)&lt;br /&gt;
aire_GCM=data['aire']&lt;br /&gt;
&lt;br /&gt;
# HERE WE READ 3D OUTPUTS&lt;br /&gt;
tsurf=data['tsurf'] # this is the surface temperature 3D field (time, latitude, longitude, altitude)&lt;br /&gt;
&lt;br /&gt;
# HERE WE READ 4D OUTPUTS&lt;br /&gt;
temp=data['temp'] # this is the atmospheric temperature 4D field (time, latitude, longitude, altitude)&lt;br /&gt;
&lt;br /&gt;
## let's take the time-averaged surface temperature&lt;br /&gt;
mean_tsurf = np.mean(tsurf,axis=0)&lt;br /&gt;
&lt;br /&gt;
##Let's plot a lon-lat map&lt;br /&gt;
fig = plt.figure()&lt;br /&gt;
plt.contourf(lon,lat,mean_tsurf)&lt;br /&gt;
plt.colorbar(label='Surface Temperature (K)')&lt;br /&gt;
plt.xlabel('Longitude ($^{\circ}$)')&lt;br /&gt;
plt.ylabel('Latitude ($^{\circ}$)')&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Don't hesitate to use the function called ''.values'' to transform any ''xarray'' into a numpy array, especially in case of calculation time problems. &lt;br /&gt;
For more examples on how to use ''xarray'', take a look at the [https://docs.xarray.dev/en/stable/index.html documentation]. &lt;br /&gt;
Here is another example of how one can use xarray with multiples netcdfiles.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line&amp;gt;&lt;br /&gt;
&lt;br /&gt;
import xarray as xr&lt;br /&gt;
import os&lt;br /&gt;
&lt;br /&gt;
# your folder where output files are stored&lt;br /&gt;
FOLDER = './your_folder_with_output_files/'&lt;br /&gt;
&lt;br /&gt;
# take back the files from your FOLDER&lt;br /&gt;
list_files_folder=os.listdir(FOLDER)&lt;br /&gt;
&lt;br /&gt;
# If there are several files.&lt;br /&gt;
# Sort your simulation files by date,&lt;br /&gt;
# so beginning of simulation will be top of the list&lt;br /&gt;
# and end of simulation will be end of the list.&lt;br /&gt;
list_files_folder.sort()&lt;br /&gt;
&lt;br /&gt;
files = [FOLDER+str(f) for f in list_files_folder]&lt;br /&gt;
# if you want to keep only files of special_year you can add this option :&lt;br /&gt;
# files = [FOLDER+str(f) for f in list_files_folder if f.startswith(&amp;quot;special_year&amp;quot;)]&lt;br /&gt;
&lt;br /&gt;
# xarray will magically concatenate your outfiles by 'Time' (or any other 'concat_dime' you want)&lt;br /&gt;
nc=xr.open_mfdataset(files,decode_times=False, concat_dim='Time', combine='nested')&lt;br /&gt;
&lt;br /&gt;
# to check your keys&lt;br /&gt;
for key in nc.keys():&lt;br /&gt;
    print(key)&lt;br /&gt;
&lt;br /&gt;
# to load keys (example here with keys for a mesoscale simulation)&lt;br /&gt;
Times = nc['Times'][:]&lt;br /&gt;
PTOT = nc['PTOT'][:]&lt;br /&gt;
T = nc['T'][:]&lt;br /&gt;
W = nc['W'][:]&lt;br /&gt;
&lt;br /&gt;
# you can use some functions to make averages etc&lt;br /&gt;
&lt;br /&gt;
T_moy = T.mean(dim=['Time','south_north','west_east'])&lt;br /&gt;
&lt;br /&gt;
# other functions&lt;br /&gt;
# .cumsum (cumulative sum)&lt;br /&gt;
# .rename (change the name of the object)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One cool thing about xarray is that it is well optimized, and can do whatever you want to do on your data, but better than you. See for instance, the example below to plot a temperature lon-lat map. Xarray handles it in 5 lines of code, where you would need a lot more to set-up you plot in traditional matplotlib. And the results look almost good enough for a paper plot. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line&amp;gt;&lt;br /&gt;
import xarray as xr&lt;br /&gt;
import matplotlib.pyplot as plt &lt;br /&gt;
##Load your data and print it &lt;br /&gt;
file = '/home/lteinturier/Documents/PhD/wasp43b/chemistry_project/input_5xsolar.nc'&lt;br /&gt;
data = xr.open_dataset(file,decode_times=False)&lt;br /&gt;
print(data)&lt;br /&gt;
##extracting the altitude level # for the whole file&lt;br /&gt;
data = data.isel(altitude=20)&lt;br /&gt;
##let's assume that data hold a time-series of the temperature. Let's average it in time&lt;br /&gt;
temp = data['temp'].mean(&amp;quot;Time&amp;quot;,keep_attrs=True) #we keep the attribute when averaging&lt;br /&gt;
##now we plot &lt;br /&gt;
fig = temp.plot.contourf(cmap='gnuplot',levels=50) #choose the colormap and the number of contourf levels &lt;br /&gt;
fig.ax.set_title(&amp;quot;P = {:.2e} mbar&amp;quot;.format(data.p.mean().values)) ##set-up your title. If you don't change it, the title will be the altitude in km of your atmospheric level&lt;br /&gt;
plt.show()&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This is only a fraction of what Xarray can do. Check the [https://docs.xarray.dev/en/stable/user-guide/index.html documentation] for more.&lt;br /&gt;
&lt;br /&gt;
==== Python tutorials to make pretty visuals ====&lt;br /&gt;
&lt;br /&gt;
We provide a tutorial on how to make pretty visuals using Generic PCM 3-D simulations [https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/Plots_With_PyVista here].&lt;br /&gt;
&lt;br /&gt;
=== Planetoplot ===&lt;br /&gt;
&lt;br /&gt;
Planetoplot is a in-house, python based library developped to vizualize Generic PCM data.&lt;br /&gt;
&lt;br /&gt;
The code and documentation can be found at: https://nbviewer.org/github/aymeric-spiga/planetoplot/blob/master/tutorial/planetoplot_tutorial.ipynb&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;br /&gt;
[[Category:Generic-LMDZ]]&lt;br /&gt;
[[Category:Generic-DYNAMICO]]&lt;br /&gt;
[[Category:Generic-WRF]]&lt;br /&gt;
[[Category:Generic-1D]]&lt;/div&gt;</summary>
		<author><name>LTeinturier</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Radiative_Generic_Condensable_Specie&amp;diff=1227</id>
		<title>Radiative Generic Condensable Specie</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Radiative_Generic_Condensable_Specie&amp;diff=1227"/>
				<updated>2023-03-02T09:50:50Z</updated>
		
		<summary type="html">&lt;p&gt;LTeinturier: /* Radiative Generic Condensable Specie */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Radiative Generic Condensable Specie ==&lt;br /&gt;
The model can take into account the radiative effects of Generic condensable specie in the radiative transfer. This is only tested for Hot Jupiter simulations for now.&lt;br /&gt;
Here is just a copy of the merge request to include the code into the master branch. This will need further editing: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can activate the scheme by putting aerogeneric = # of aerosols in callphys.def. This is the only needed thing for activating the radiative effects. They must be tracer in modern tracer.def&lt;br /&gt;
&lt;br /&gt;
Commented out the abort if we use more than 4 aerosols&lt;br /&gt;
&lt;br /&gt;
Added reading of optprop files for Radiative Generic Condensable Aerosols&lt;br /&gt;
&lt;br /&gt;
We use the same file for IR and VI channel. For now, only MnS, Cr,Fe and Mg2SiO4 can be read. If you want to add another specie, check the code, it is explained how to quickly do that (right above the Initializations)&lt;br /&gt;
&lt;br /&gt;
Added radii calculation for Radiative Generic Condensable aerosols&lt;br /&gt;
&lt;br /&gt;
Changed the hardcoded size of the totalemit array&lt;br /&gt;
&lt;br /&gt;
The hardcoded size is now 1900 instead of 100 so we don't exceed the array size when working at high spectral resolution (very rare case)&lt;br /&gt;
&lt;br /&gt;
Added opacity computation for Radiative Generic Condensable aerosols&lt;br /&gt;
&lt;br /&gt;
We do this computation in the same fashion as what's performed on water and dust.&lt;br /&gt;
&lt;br /&gt;
switch iniaerosol and initracer order, to prepare for the RGCS scheme&lt;br /&gt;
&lt;br /&gt;
Needed to switch the order of initialization so we can use the RGCS scheme without the assumption that ice and vap tracer of the same specie are following each other in the traceur.def file&lt;br /&gt;
All my commits regarding the radiative effects of generic tracers. A lot of changes have been made. I've rebased the branch on the latest revision of master + squashed a lot of commits together to avoid the &amp;quot;avalanche de commits&amp;quot;. By default, the scheme is NOT activated. Read above on how to activate it&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Adding stuff on how to really add a specie (because I'm once again stuck even though I coded that) == &lt;br /&gt;
&lt;br /&gt;
go to suaer_corrk. There, need to add the reading of the optical properties file. &lt;br /&gt;
&lt;br /&gt;
Check that in your datadir, the table_tracers_condensable containe the species you wan. You need to have delta_vapH Tref, Pref, mass and metallicity_coeff. &lt;br /&gt;
In you have all that, you need your traceur.def with the mmol (actually we do't since it's in the table ? check that because weird), the radius and is_condensable=1, is_Rgcs=1&lt;/div&gt;</summary>
		<author><name>LTeinturier</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=1057</id>
		<title>Tool Box</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=1057"/>
				<updated>2022-11-23T14:12:50Z</updated>
		
		<summary type="html">&lt;p&gt;LTeinturier: /* python scripts */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Pre-processing Tools ==&lt;br /&gt;
=== newstart: a fortran program to modify start files ===&lt;br /&gt;
&lt;br /&gt;
Newstart is an interactive tool to modify the start files (''start.nc'' and ''startfi.nc''). &lt;br /&gt;
&lt;br /&gt;
To be usable, ''newstart'' should be compile in the ''LMDZ.COMMON'' directory by using the following command line:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./makelmdz_fcm -arch my_arch_file -p std -d 64x48x30 newstart&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
In the example, my_arch_file is the name the arch files (see [https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/The_Target_Architecture_(%22arch%22)_Files arch] ) and 64x48x30 is the resolution of the physical grid.&lt;br /&gt;
Then copy the executable from the ''LMDZ.COMMON/bin'' directory to your bench directory.&lt;br /&gt;
&lt;br /&gt;
When you execute newstart, you can use both a ''start2archive'' file or the start files (''start.nc'' and ''startfi.nc''). Then the interactive interface will propose to modify several physical quantities such as the gravity, the surface pressure or the rotation of the planet. At the end of the procedure, two files are created: ''restart.nc'' and ''restartfi.nc''. They can be renamed and used as start files to initialize a new simulation.&lt;br /&gt;
&lt;br /&gt;
=== start2archive ===&lt;br /&gt;
&lt;br /&gt;
The start2archive tool is similar to newstart in the sense that it can be used to modify the start files. But start2archive can modify the resolution of the physical grid, the topography and the surface thermal inertia while newstart cannot. It is also useful to create an archive of different starting states, then extractable as start files.&lt;br /&gt;
The command line to compile start2archive is similar to the one used for newstart:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./makelmdz_fcm -arch my_arch_file -p std -d 64x48x30 start2archive&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
To modify the resolution, you should first create a start_archive (by using start2archive) file at the used resolution, then compile a newstart file at the new resolution. Newstart will interpolate all the physical quantities on the new grid.&lt;br /&gt;
&lt;br /&gt;
=== other third party scripts and tools ===&lt;br /&gt;
&lt;br /&gt;
TO BE COMPLETED&lt;br /&gt;
&lt;br /&gt;
== Post-processing tools ==&lt;br /&gt;
=== zrecast ===&lt;br /&gt;
&lt;br /&gt;
With this program you can recast atmospheric (i.e.: 4D-dimentional longitude-latitude-altitude-time) data from&lt;br /&gt;
GCM outputs (e.g. as given in diagfi.nc files) onto either ''pressure'' or ''altitude'' above ''areoid vertical'' coordinates.&lt;br /&gt;
Since integrating the hydrostatic equation is required to recast the data, the input file must contain surface pressure&lt;br /&gt;
and atmospheric temperature, as well as the ground geopotential.&lt;br /&gt;
If recasting data onto ''pressure'' coordinates, then the output file name is given by the input file name to which ''_P.nc'' will be appened. If recasting data onto altitude above areoid coordinates, then a ''_A.nc'' will be appened.&lt;br /&gt;
&lt;br /&gt;
=== mass stream function ===&lt;br /&gt;
&lt;br /&gt;
The mass stream function (and the total angular momentum) can be computed from a diagfi.nc or a stats.nc, using the '''streamfunction.F90''' script. The script is located at&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
trunk/LMDZ.GENERIC/utilities&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To compile the script, open the ''compile'' file in the same directory and do the following:&lt;br /&gt;
* Replace &amp;quot;pgf90&amp;quot; with your favorite fortran compiler &lt;br /&gt;
* replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/lib&amp;quot; with the lib address and directory that contains your NetCDF library (file ''libnetcdf.a'').&lt;br /&gt;
* Replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/include&amp;quot; with the address of the directory that contains the NetCDF include file (''netcdf.inc'').&lt;br /&gt;
* You can mess with the compiling options but it is not mandatory.&lt;br /&gt;
&lt;br /&gt;
Once the script is compiled, copy it in the same directory as your '''.nc''' file and run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./streamfunction.e&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The script will ask you for the name of your '''.nc''' file, and will run and produce a new '''nameofyourfile_stream.nc''' file.&lt;br /&gt;
&lt;br /&gt;
'''Be careful''' : In this new file, all fields are temporally and zonally averaged.&lt;br /&gt;
&lt;br /&gt;
If you want to use '''python''' instead of '''fortran''', you can take a look at this [https://github.com/aymeric-spiga/dynanalysis repo]. It hosts a tool to perform dynamical analysis of GCM simulations (and therefore, it computes the mass stream function and a lot of other stuff), but it is tailored for Dynamico only. This repo also takes care of recasting (it does the job of both ''zrecast.F90'' and ''streamfunction.F90'')&lt;br /&gt;
&lt;br /&gt;
== Continuing Simulations ==&lt;br /&gt;
&lt;br /&gt;
=== manually ===&lt;br /&gt;
&lt;br /&gt;
At the end of a simulation, the model generates restart files (files 'restart.nc' and 'restartfi.nc') which contain the final state of the model. The 'restart.nc' and 'restartfi.nc' files have the same format as the 'start.nc' and 'startfi.nc' files, respectively. &lt;br /&gt;
&lt;br /&gt;
These files can in fact be used as initial states to continue the simulation, using the following renaming command lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mv restart.nc start.nc&lt;br /&gt;
mv restartfi.nc startfi.nc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Running a simulation with these start files will in fact resume the simulation from where the previous run ended.&lt;br /&gt;
&lt;br /&gt;
=== with bash scripts ===&lt;br /&gt;
&lt;br /&gt;
We have set up very simple bash scripts to automatize the launching of chain simulations. Here is an example of bash script that does the job:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
###########################################################################&lt;br /&gt;
# Script to perform several chained LMD Mars GCM simulations&lt;br /&gt;
# SET HERE the maximum total number of simulations&lt;br /&gt;
&lt;br /&gt;
nummax=100&lt;br /&gt;
&lt;br /&gt;
###########################################################################&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;---------------------------------------------------------&amp;quot;&lt;br /&gt;
echo &amp;quot;STARTING LOOP RUN&amp;quot;&lt;br /&gt;
echo &amp;quot;---------------------------------------------------------&amp;quot;&lt;br /&gt;
&lt;br /&gt;
dir=`pwd`&lt;br /&gt;
machine=`hostname`&lt;br /&gt;
address=`whoami`&lt;br /&gt;
&lt;br /&gt;
# Look for file &amp;quot;num_run&amp;quot; which should contain &lt;br /&gt;
# the value of the previously computed season&lt;br /&gt;
# (defaults to 0 if file &amp;quot;num_run&amp;quot; does not exist)&lt;br /&gt;
if [[ -r num_run ]] ; then&lt;br /&gt;
  echo &amp;quot;found file num_run&amp;quot;&lt;br /&gt;
  numold=`cat num_run`&lt;br /&gt;
else&lt;br /&gt;
  numold=0&lt;br /&gt;
fi&lt;br /&gt;
echo &amp;quot;numold is set to&amp;quot; ${numold}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Set value of current season &lt;br /&gt;
(( numnew = ${numold} + 1 ))&lt;br /&gt;
echo &amp;quot;numnew is set to&amp;quot; ${numnew}&lt;br /&gt;
&lt;br /&gt;
# Look for initialization data files (exit if none found)&lt;br /&gt;
if [[ ( -r start${numold}.nc  &amp;amp;&amp;amp;  -r startfi${numold}.nc ) ]] ; then&lt;br /&gt;
   \cp -f start${numold}.nc start.nc&lt;br /&gt;
   \cp -f startfi${numold}.nc startfi.nc&lt;br /&gt;
else&lt;br /&gt;
   if (( ${numold} == 99999 )) ; then&lt;br /&gt;
    echo &amp;quot;No run because previous run crashed ! (99999 in num_run)&amp;quot;&lt;br /&gt;
    exit&lt;br /&gt;
   else&lt;br /&gt;
   echo &amp;quot;Where is file start&amp;quot;${numold}&amp;quot;.nc??&amp;quot;&lt;br /&gt;
   exit&lt;br /&gt;
   fi&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Run GCM -- THIS LINE NEEDS TO BE MODIFIED WITH THE CORRECT GCM EXECUTION COMMAND&lt;br /&gt;
mpirun -np 8 gcm_64x48x26_phystd_para.e &amp;lt; diagfi.def &amp;gt; lrun${numnew}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Check if run ended normaly and copy datafiles&lt;br /&gt;
if [[ ( -r restartfi.nc  &amp;amp;&amp;amp;  -r restart.nc ) ]] ; then&lt;br /&gt;
  echo &amp;quot;Run seems to have ended normaly&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  \mv -f restart.nc start${numnew}.nc&lt;br /&gt;
  \mv -f restartfi.nc startfi${numnew}.nc  &lt;br /&gt;
    &lt;br /&gt;
else&lt;br /&gt;
  if [[ -r num_run ]] ; then&lt;br /&gt;
    \mv -f num_run num_run.crash&lt;br /&gt;
  else&lt;br /&gt;
    echo &amp;quot;No file num_run to build num_run.crash from !!&amp;quot;&lt;br /&gt;
    # Impose a default value of 0 for num_run&lt;br /&gt;
    echo 0 &amp;gt; num_run.crash&lt;br /&gt;
  fi&lt;br /&gt;
 echo 99999 &amp;gt; num_run&lt;br /&gt;
 exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Copy other datafiles that may have been generated&lt;br /&gt;
if [[ -r diagfi.nc ]] ; then&lt;br /&gt;
  \mv -f diagfi.nc diagfi${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -r diagsoil.nc ]] ; then&lt;br /&gt;
  \mv -f diagsoil.nc diagsoil${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -r stats.nc ]] ; then&lt;br /&gt;
  \mv -f stats.nc stats${numnew}.nc&lt;br /&gt;
fi&lt;br /&gt;
if [[ -f profiles.dat ]] ; then&lt;br /&gt;
  \mv -f profiles.dat profiles${numnew}.dat&lt;br /&gt;
  \mv -f profiles.hdr profiles${numnew}.hdr&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
# Prepare things for upcoming runs by writing&lt;br /&gt;
# value of computed season in file num_run&lt;br /&gt;
echo ${numnew} &amp;gt; num_run&lt;br /&gt;
&lt;br /&gt;
# If we are over nummax : stop&lt;br /&gt;
if (( $numnew + 1 &amp;gt; $nummax )) ; then&lt;br /&gt;
   exit&lt;br /&gt;
else&lt;br /&gt;
   \cp -f run_gnome exe_mars&lt;br /&gt;
   ./exe_mars&lt;br /&gt;
fi &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Summary of what this bash script does''':&lt;br /&gt;
&lt;br /&gt;
* It reads the file 'num_run' which contains the step of the simulation. &lt;br /&gt;
If num_run is&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
then the script expects to read start5.nc and startfi5.nc.&lt;br /&gt;
* It modifies start5.nc and startfi5.nc into start.nc and startfi.nc, respectively.&lt;br /&gt;
* It runs the GCM.&lt;br /&gt;
* It modifies restart.nc and restartfi.nc into start6.nc and startfi6.nc&lt;br /&gt;
* It rewrite num_run as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* It restarts the loop until num_run reaches the value (defined in nummax):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Processing Output Files with NCOs ==&lt;br /&gt;
&lt;br /&gt;
NCOs (NetCdf OperatorS) are a set of powerful command-line utilities – available on Linux, Mac and PC – that allow to perform useful (and very fast!) post-processing operations on netCDF GCM output files. Full documentation can be found on http://research.jisao.washington.edu/data_sets/nco/, but we provide below a few examples of command lines.&lt;br /&gt;
&lt;br /&gt;
* How to calculate a time mean of a netCDF 'diagfi.nc' file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ncra -F -d Time,1,,1 diagfi.nc diagfi_MEAN.nc # format is &amp;quot;-d dimension,minimum,maximum,stride&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Subsetting time in a netCDF 'diagfi.nc' file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ncea -F -d Time,first,last diagfi.nc diagfi_subset.nc # format is &amp;quot;-d dimension,minimum,maximum&amp;quot; ; we recall you can type &amp;quot;ncdump -v time diagfi.nc&amp;quot; to see the Time values in the netCDF file.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Decimating a netCDF 'diagfi.nc' file in time&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ncks -F -d Time,1,,8 diagfi.nc diagfi_decimated.nc # format is &amp;quot;-d dimension,minimum,maximum,stride&amp;quot; ; In this example, this means that data is extracted 1 time every 8 time steps, starting from the first time step (number 1), ending at the last time step).&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Extract a variable from a netCDF 'diagfi.nc' file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ncks -v tsurf,temp,p diagfi.nc diagfi_out.nc # Here we created a new file named 'diagfi_out.nc' in which we only kept variables named 'tsurf' (surface temperatures), 'temp' (atmospheric temperatures) and p (atmospheric pressures).&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, more examples can be found on http://research.jisao.washington.edu/data_sets/nco/ .&lt;br /&gt;
&lt;br /&gt;
== Data Handling and Visualization Software ==&lt;br /&gt;
&lt;br /&gt;
There are several data handling and visualization tools that can be used to analyse and plot the results from GCM simulations (using the diagfi.nc NetCDF files). We provide below a panorama of most widely used solutions.&lt;br /&gt;
&lt;br /&gt;
=== panoply ===&lt;br /&gt;
Panoply is a user-friendly tool for viewing raw NetCDF data, available here: https://www.giss.nasa.gov/tools/panoply/ . It is very convenient to make pretty visuals (see an example for the exoplanet TRAPPIST-1e). There are many options that can be used (map projections, masks, colorbars, shadows, etc.) to make your plots fancy. However, the tool is not very well suited for manipulating data (compute averages, statistics, etc.).&lt;br /&gt;
&lt;br /&gt;
[[File:Example panoply.png|thumb|Screenshot of panoply showing here Generic PCM results for the exoplanet TRAPPIST-1e (surface temperatures)]]&lt;br /&gt;
&lt;br /&gt;
=== ncview ===&lt;br /&gt;
ncview is another useful user-friendly tool for viewing raw NetCDF data. This is kind of a very archaic version of panoply, but it is convenient because it allows to have a very quick first look at netCDF data files.&lt;br /&gt;
&lt;br /&gt;
Command line tool to visualize NetCDF data:&lt;br /&gt;
* Installation on Linux:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt install ncview&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Run on Linux:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ncview diagfi.nc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Example ncview.png|thumb|Screenshot of ncview showing here Generic PCM results for the exoplanet Proxima b (OLR - Thermal Emission)]]&lt;br /&gt;
&lt;br /&gt;
=== python scripts ===&lt;br /&gt;
&lt;br /&gt;
Python scripts provide a very useful mean to analyse and visualize netCDF files.&lt;br /&gt;
&lt;br /&gt;
You can use the netCDF4 python library to open a netCDF file and put data in tables that can then be manipulated and plotted.&lt;br /&gt;
&lt;br /&gt;
Here is an exemple of how to open and read a netCDF file with Python:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line&amp;gt;&lt;br /&gt;
import numpy&lt;br /&gt;
from netCDF4 import Dataset&lt;br /&gt;
&lt;br /&gt;
# HERE WE OPEN THE NETCDF FILE&lt;br /&gt;
nc = Dataset('diagfi.nc')&lt;br /&gt;
&lt;br /&gt;
# HERE WE READ THE VARIABLES (1D OUTPUT)&lt;br /&gt;
Time=nc.variables['Time'][:]&lt;br /&gt;
lat=nc.variables['latitude'][:]&lt;br /&gt;
lon=nc.variables['longitude'][:]&lt;br /&gt;
al=nc.variables['altitude'][:]&lt;br /&gt;
&lt;br /&gt;
# HERE WE READ THE AREA (2D OUTPUT)&lt;br /&gt;
aire_GCM=nc.variables['aire'][:][:]&lt;br /&gt;
&lt;br /&gt;
# HERE WE READ 3D OUTPUTS&lt;br /&gt;
tsurf=nc.variables['tsurf'][:][:][:] # this is the surface temperature 3D field (time, latitude, longitude, altitude)&lt;br /&gt;
&lt;br /&gt;
# HERE WE READ 4D OUTPUTS&lt;br /&gt;
temp=nc.variables['temp'][:][:][:][:] # this is the atmospheric temperature 4D field (time, latitude, longitude, altitude)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And here is an exemple of how to manipulate the netCDF data (here to compute the time averaged surface temperatures):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line&amp;gt;&lt;br /&gt;
from numpy import *&lt;br /&gt;
import numpy as np&lt;br /&gt;
&lt;br /&gt;
mean_tsurf=np.zeros((len(lat_GCM),len(lon_GCM)),dtype='f')&lt;br /&gt;
&lt;br /&gt;
for i in range(0,len(Time)):&lt;br /&gt;
    for j in range(0,len(lat)):&lt;br /&gt;
        for k in range(0,len(lon)):&lt;br /&gt;
            mean_tsurf[j,k]=mean_tsurf[j,k]+tsurf[i,j,k]*(1./len(Time))&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And here is a last exemple of how to plot the data (using matplotlib):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line&amp;gt;&lt;br /&gt;
import matplotlib.pyplot as plt&lt;br /&gt;
&lt;br /&gt;
plt.figure(1)&lt;br /&gt;
plt.contourf(lon_GCM,lat_GCM,mean_tsurf)&lt;br /&gt;
plt.colorbar(label='Surface Temperature (K)')&lt;br /&gt;
plt.xlabel('Longitude ($^{\circ}$)')&lt;br /&gt;
plt.ylabel('Latitude ($^{\circ}$)')&lt;br /&gt;
plt.show()&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another useful library to deal with netcdf files is ''xarray''. We provide a code snippet below, doing the same thing as the snippets above.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line&amp;gt;&lt;br /&gt;
import numpy as np&lt;br /&gt;
import xarray as xr &lt;br /&gt;
import matplotlib.pyplot as plt &lt;br /&gt;
&lt;br /&gt;
# HERE WE OPEN THE NETCDF FILE&lt;br /&gt;
data = xr.open_dataset('diagfi.nc',&lt;br /&gt;
                       decode_times=False)&lt;br /&gt;
&lt;br /&gt;
# HERE WE READ THE VARIABLES (1D OUTPUT)&lt;br /&gt;
Time=data['Time']&lt;br /&gt;
lat=data['latitude']&lt;br /&gt;
lon=data['longitude']&lt;br /&gt;
al=data['altitude']&lt;br /&gt;
&lt;br /&gt;
# HERE WE READ THE AREA (2D OUTPUT)&lt;br /&gt;
aire_GCM=data['aire']&lt;br /&gt;
&lt;br /&gt;
# HERE WE READ 3D OUTPUTS&lt;br /&gt;
tsurf=data['tsurf'] # this is the surface temperature 3D field (time, latitude, longitude, altitude)&lt;br /&gt;
&lt;br /&gt;
# HERE WE READ 4D OUTPUTS&lt;br /&gt;
temp=data['temp'] # this is the atmospheric temperature 4D field (time, latitude, longitude, altitude)&lt;br /&gt;
&lt;br /&gt;
## let's take the time-averaged surface temperature&lt;br /&gt;
mean_tsurf = np.mean(tsurf,axis=0)&lt;br /&gt;
&lt;br /&gt;
##Let's plot a lon-lat map&lt;br /&gt;
fig = plt.figure()&lt;br /&gt;
plt.contourf(lon,lat,mean_tsurf)&lt;br /&gt;
plt.colorbar(label='Surface Temperature (K)')&lt;br /&gt;
plt.xlabel('Longitude ($^{\circ}$)')&lt;br /&gt;
plt.ylabel('Latitude ($^{\circ}$)')&lt;br /&gt;
plt.show()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
For more examples on how to use ''xarray'', take a look at the [https://docs.xarray.dev/en/stable/index.html documentation].&lt;br /&gt;
Here is another example of how one can use xarray with multiples netcdfiles.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line&amp;gt;&lt;br /&gt;
&lt;br /&gt;
import xarray as xr&lt;br /&gt;
import os&lt;br /&gt;
&lt;br /&gt;
# your folder where output files are stored&lt;br /&gt;
FOLDER = './your_folder_with_output_files/'&lt;br /&gt;
&lt;br /&gt;
# take back the files from your FOLDER&lt;br /&gt;
list_files_folder=os.listdir(FOLDER)&lt;br /&gt;
&lt;br /&gt;
# If there are several files.&lt;br /&gt;
# Sort your simulation files by date,&lt;br /&gt;
# so beginning of simulation will be top of the list&lt;br /&gt;
# and end of simulation will be end of the list.&lt;br /&gt;
list_files_folder.sort()&lt;br /&gt;
&lt;br /&gt;
files = [FOLDER+str(f) for f in list_files_folder]&lt;br /&gt;
# if you want to keep only files of special_year you can add this option :&lt;br /&gt;
# files = [FOLDER+str(f) for f in list_files_folder if f.startswith(&amp;quot;special_year&amp;quot;)]&lt;br /&gt;
&lt;br /&gt;
# xarray will magically concatenate your outfiles by 'Time' (or any other 'concat_dime' you want)&lt;br /&gt;
nc=xr.open_mfdataset(files,decode_times=False, concat_dim='Time', combine='nested')&lt;br /&gt;
&lt;br /&gt;
# to check your keys&lt;br /&gt;
for key in nc.keys():&lt;br /&gt;
    print(key)&lt;br /&gt;
&lt;br /&gt;
# to load keys (example here with keys for a mesoscale simulation)&lt;br /&gt;
Times = nc['Times'][:]&lt;br /&gt;
PTOT = nc['PTOT'][:]&lt;br /&gt;
T = nc['T'][:]&lt;br /&gt;
W = nc['W'][:]&lt;br /&gt;
&lt;br /&gt;
# you can use some functions to make averages etc&lt;br /&gt;
&lt;br /&gt;
T_moy = T.mean(dim=['Time','south_north','west_east'])&lt;br /&gt;
&lt;br /&gt;
# other functions&lt;br /&gt;
# .cumsum (cumulative sum)&lt;br /&gt;
# .rename (change the name of the object)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: ADD SOMETHING HERE ABOUT XARRAY LIBRARY? AYMERIC? (with a simple tutorial?) TBD&lt;br /&gt;
&lt;br /&gt;
We provide a tutorial on how to make pretty visuals using Generic PCM 3-D simulations [https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/Plots_With_PyVista here].&lt;br /&gt;
&lt;br /&gt;
=== Planetoplot ===&lt;br /&gt;
&lt;br /&gt;
Planetoplot is a in-house, python based library developped to vizualize Generic PCM data.&lt;br /&gt;
&lt;br /&gt;
The code and documentation can be found at: https://nbviewer.org/github/aymeric-spiga/planetoplot/blob/master/tutorial/planetoplot_tutorial.ipynb&lt;/div&gt;</summary>
		<author><name>LTeinturier</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Radiative_Generic_Condensable_Specie&amp;diff=1023</id>
		<title>Radiative Generic Condensable Specie</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Radiative_Generic_Condensable_Specie&amp;diff=1023"/>
				<updated>2022-10-19T11:48:25Z</updated>
		
		<summary type="html">&lt;p&gt;LTeinturier: Created page with &amp;quot;== Radiative Generic Condensable Specie == The model can take into account the radiative effects of Generic condensable specie in the radiative transfer. This is only tested f...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Radiative Generic Condensable Specie ==&lt;br /&gt;
The model can take into account the radiative effects of Generic condensable specie in the radiative transfer. This is only tested for Hot Jupiter simulations for now.&lt;br /&gt;
Here is just a copy of the merge request to include the code into the master branch. This will need further editing: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can activate the scheme by putting aerogeneric = # of aerosols in callphys.def. This is the only needed thing for activating the radiative effects. They must be tracer in modern tracer.def&lt;br /&gt;
&lt;br /&gt;
Commented out the abort if we use more than 4 aerosols&lt;br /&gt;
&lt;br /&gt;
Added reading of optprop files for Radiative Generic Condensable Aerosols&lt;br /&gt;
&lt;br /&gt;
We use the same file for IR and VI channel. For now, only MnS, Cr,Fe and Mg2SiO4 can be read. If you want to add another specie, check the code, it is explained how to quickly do that (right above the Initializations)&lt;br /&gt;
&lt;br /&gt;
Added radii calculation for Radiative Generic Condensable aerosols&lt;br /&gt;
&lt;br /&gt;
Changed the hardcoded size of the totalemit array&lt;br /&gt;
&lt;br /&gt;
The hardcoded size is now 1900 instead of 100 so we don't exceed the array size when working at high spectral resolution (very rare case)&lt;br /&gt;
&lt;br /&gt;
Added opacity computation for Radiative Generic Condensable aerosols&lt;br /&gt;
&lt;br /&gt;
We do this computation in the same fashion as what's performed on water and dust.&lt;br /&gt;
&lt;br /&gt;
switch iniaerosol and initracer order, to prepare for the RGCS scheme&lt;br /&gt;
&lt;br /&gt;
Needed to switch the order of initialization so we can use the RGCS scheme without the assumption that ice and vap tracer of the same specie are following each other in the traceur.def file&lt;br /&gt;
All my commits regarding the radiative effects of generic tracers. A lot of changes have been made. I've rebased the branch on the latest revision of master + squashed a lot of commits together to avoid the &amp;quot;avalanche de commits&amp;quot;. By default, the scheme is NOT activated. Read above on how to activate it&lt;/div&gt;</summary>
		<author><name>LTeinturier</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Other_GCM_Configurations_worth_knowing_about&amp;diff=743</id>
		<title>Other GCM Configurations worth knowing about</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Other_GCM_Configurations_worth_knowing_about&amp;diff=743"/>
				<updated>2022-09-02T09:47:04Z</updated>
		
		<summary type="html">&lt;p&gt;LTeinturier: /* Hot Jupiter with DYNAMICO */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== 3D lon-lat LMDZ setup ==&lt;br /&gt;
&lt;br /&gt;
=== early Mars ===&lt;br /&gt;
&lt;br /&gt;
It is already described in the [https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/Quick_Install_and_Run ''Quick Install and Run''] section.&lt;br /&gt;
&lt;br /&gt;
=== Earth with slab ocean ===&lt;br /&gt;
&lt;br /&gt;
TBD by Martin&lt;br /&gt;
&lt;br /&gt;
=== TRAPPIST-1e with photochemistry ===&lt;br /&gt;
&lt;br /&gt;
A temperate rocky planet in synchronous rotation around a low mass star&lt;br /&gt;
&lt;br /&gt;
TBD by Yassin&lt;br /&gt;
&lt;br /&gt;
=== TRAPPIST-1c in Venus-like conditions ===&lt;br /&gt;
&lt;br /&gt;
A warm rocky planet in synchronous rotation around a low mass star&lt;br /&gt;
&lt;br /&gt;
TBD by Gabriella (waiting for the SVN update by Ehouarn)&lt;br /&gt;
&lt;br /&gt;
=== mini-Neptune GJ1214b ===&lt;br /&gt;
&lt;br /&gt;
A warm mini-Neptune&lt;br /&gt;
&lt;br /&gt;
TBD by Benjamin&lt;br /&gt;
&lt;br /&gt;
== 3D DYNAMICO setup ==&lt;br /&gt;
&lt;br /&gt;
Due to the rich dynamical activities in their atmospheres (banded zonal jets, eddies, vortices, storms, equatorial oscillations,...) resulting from multi-scale dynamic interactions, the Global Climate Modelling of the giant planet requires to resolve eddies arising from hydrodynamical instabilities to correctly establish the planetary-scaled jets regime. To this purpose, their Rossby radius deformation $$L_D$$, which is the length scale at which rotational effects become as important as buoyancy or gravity wave effects in the evolution of the flow about some disturbance, is calculated to determine the most suitable horizontal grid resolution. At mid-latitude range, for the giant planets, $$L_D$$ is of the same order of magnitude as that of the Earth. As the giant planets have a size of roughly 10 times the Earth size (i.e., Jupiter and Saturn), the modelling grid must be of a horizontal resolution of 0.5$$^{\circ}$$ over longitude and latitude (vs 5$$^{\circ}$$ for the Earth), considering 3 grid points to resolved $$L_D$$. &lt;br /&gt;
Moreover, to have a chance to model the equatorial oscillation, meridional cell circulations and/or a seasonal inter-hemispheric circulation, a giant planet GCM must also include a high vertical resolution. Indeed, these climate phenomena have been studied for decades for the Earth's atmosphere, and result from small- and large-scale interactions between the troposphere and stratosphere. This implies that the propagation of dynamic instabilities, waves and turbulence should be resolved as far as possible along the vertical. Contrary to horizontal resolution, it doesn't really exist a criterion (similar to $$L_D$$) to determine the most suitable vertical grid resolution and still an adjustable parameter according to the processes to be represented. However, we advise the user to set a vertical resolution of at least 5 grid points per scale height as first stage.    &lt;br /&gt;
Finally, these atmospheres are cold, with long radiative response time which needs radiative transfer computations over decade-long years of Jupiter (given that a Jupiter year $$\approx$$ 12 Earth years), Saturn ( a Saturn year $$\approx$$ 30 Earth years), Uranus (a Uranus year $$\approx$$ 84 earth years) or Neptune (a Neptune year $$\approx$$ 169 Earth years), depending on the chosen planet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To be able to deal with these three -- and non-exhaustive -- requirements to build a giant planet GCM, we need massive computational ressources. For this, we use a dynamical core suitable and numerical stable for massive parallel ressource computations: DYNAMICO [Dubos et al,. 2015].  &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
In these two following subsections, we purpose an example of installation for Jupiter and a Hot Jupiter. All the install, compiling, setting and parameters files for each giant planets could be found on: &lt;br /&gt;
https://github.com/aymeric-spiga/dynamico-giant&lt;br /&gt;
&lt;br /&gt;
If you have already downloaded '''LMDZ.COMMON''', '''LMDZ.GENERIC''', '''IOIPSL''', '''ARCH''', you only have to download:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''ICOSAGCM''': the DYNAMICO dynamical core&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone https://gitlab.in2p3.fr/ipsl/projets/dynamico/dynamico.git ICOSAGCM&lt;br /&gt;
cd ICOSAGCM&lt;br /&gt;
git checkout 90f7138a60ebd3644fbbc42bc9dfa22923386385&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ICOSA_LMDZ''': the interface using to link LMDZ.GENERIC physical packages and ICOSAGCM&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
svn update -r 2655 -q ICOSA_LMDZ&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''XIOS (XML Input Output Server)''': the library to interpolate input/output fields between the icosahedral and longitude/latitude regular grids on fly&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
svn co -r 2319 -q http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/trunk XIOS&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
If you haven't already download '''LMDZ.COMMON''', '''LMDZ.GENERIC''', '''IOIPSL''', '''ARCH''', you can use the '''install.sh''' script provided by the Github repository. &lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
=== Jupiter with DYNAMICO ===&lt;br /&gt;
&lt;br /&gt;
TBD by Deborah&lt;br /&gt;
&lt;br /&gt;
=== Hot Jupiter with DYNAMICO ===&lt;br /&gt;
&lt;br /&gt;
Modelling the atmosphere of Hot Jupiter is challenging because of the extreme temperature conditions, and the fact that these planets are gas giants. Therefore, using a dynamical core such as Dynamico is strongly recommended. Here, we discuss how to perform a cloudless simulation of the Hot Jupiter WASP-43 b, using Dynamico.&lt;br /&gt;
&lt;br /&gt;
'''1st step''': You need to go to the github mentionned previously for Dynamico: https://github.com/aymeric-spiga/dynamico-giant. ''Git clone'' this repo on your favorite cluster, and ''checkout'' to the &amp;quot;hot_jupiter&amp;quot; branch.&lt;br /&gt;
&lt;br /&gt;
'''2nd step''': Now, run the install.sh script. This script will install '''all''' the required models ('''LMDZ.COMMON''', '''LMDZ.GENERIC''','''ICOSA_LMDZ''','''XIOS''','''FCM''','''ICOSAGCM'''). At this point, you only miss '''IOIPSL'''. To install it, go to &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt; &lt;br /&gt;
dynamico-giant/code/LMDZ.COMMON/ioipsl/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There, you will find some examples of installations script. You need to create one that will work on your cluster, with your own arch files.&lt;br /&gt;
During the installation of '''IOIPSL''', you might be asked for a login/password. Contact TGCC computing center to get access.&lt;br /&gt;
&lt;br /&gt;
'''3rd step''': Great, now we have all we need to get started. Navigate to the ''hot_jupiter'' folder. You will find a ''compile_mesopsl.sh'' and a ''compile_occigen.sh'' script. Use them as examples to create the compile script adapted to your own cluster, then run it. &lt;br /&gt;
While running, I suggest that you take a look at the ''log_compile'' file. The compilation can take a while (~ 10minutes, especially because of XIOS). On quick trick to make sure that everything went right is to check the number of ''Build command finished'' messages in ''log_compile''. If everything worked out, there should be 6 of them.&lt;br /&gt;
&lt;br /&gt;
'''4th step''': Okay, the model compiled, good job ! Now we need to create the initial condition for our run. In the hot_jupiter1d folder, you already have a ''temp_profile.txt'' computed with the 1D version of the LMDZ.GENERIC (see rcm1d on this page). Thus, no need to recompute a 1D model but it will be needed if you want to model another Hot Jupiter.&lt;br /&gt;
Navigate to the 'makestart' folder, located at &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt; &lt;br /&gt;
dynamico-giant/hot_jupiter/makestart/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
To generate the initial conditions for the 3D run, we're gonna start the model using the temperature profile from the 1D run. to do that, you will find a &amp;quot;job_mpi&amp;quot; script. Open it, and adapt it to your cluster and launch the job. This job is using 20 procs, and it runs 5 days of simulations. &lt;br /&gt;
If everything goes well, you should see few netcdf files appear. The important ones are '''start_icosa0.nc''', '''startfi0.nc''' and '''Xhistins.nc'''. &lt;br /&gt;
If you see these files, you're all set to launch a real simulation !&lt;br /&gt;
&lt;br /&gt;
'''5th step''': Go back to ''hot_jupiter'' folder. There are a bunch of script to launch your simulation. Take a look at the ''astro_fat_mpi'' script, and adapt it to your cluster. Then you can launch your simulation by doing &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt; &lt;br /&gt;
./run_astro_fat&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This will start the simulation, using 90 procs. In the same folder, check if the icosa_lmdz.out file is created. This is the logfile of the simulation, while it is running. You can check there that everything is going well.&lt;br /&gt;
&lt;br /&gt;
'''Important side note''': When using the ''run_astro_fat'' script to run a simulation, it will run a chained simulation, restarting the simulation from the previous state after 100 days of simulations and generating ''Xhistins.nc'' files. This is your results file, where you will find all the variables that controls your atmosphere (temperature field, wind fields, etc..). &lt;br /&gt;
&lt;br /&gt;
Good luck and enjoy the generic PCM Dynamico for Hot Jupiter !&lt;br /&gt;
&lt;br /&gt;
'''2nd important side note''': These 5 steps are the basic needed steps to run a simulation. If you want to tune simulations to another planet, or change other stuff, you need to take a look at '''*.def''' and '''*.xml''' files. If you're lost in all of this, take a look at the different pages of this website and/or contact us !&lt;br /&gt;
Also, you might want to check the wiki on the [https://github.com/aymeric-spiga/dynamico-giant ''Github''], that explains a lot of settings for Dynamico&lt;br /&gt;
&lt;br /&gt;
== 3D LES setup ==&lt;br /&gt;
&lt;br /&gt;
=== Proxima b with LES ===&lt;br /&gt;
&lt;br /&gt;
TBD by Maxence&lt;br /&gt;
&lt;br /&gt;
== 1D setup ==&lt;br /&gt;
&lt;br /&gt;
=== rcm1d test case ===&lt;br /&gt;
&lt;br /&gt;
Our 1-D forward model&lt;br /&gt;
&lt;br /&gt;
TBD by Gwenael ? (you can have a look at the Generic GCM User Manual for inspiration)&lt;br /&gt;
&lt;br /&gt;
=== kcm1d test case ===&lt;br /&gt;
&lt;br /&gt;
Our 1-D inverse model&lt;br /&gt;
&lt;br /&gt;
TBD by Guillaume or Martin&lt;/div&gt;</summary>
		<author><name>LTeinturier</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Other_GCM_Configurations_worth_knowing_about&amp;diff=740</id>
		<title>Other GCM Configurations worth knowing about</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Other_GCM_Configurations_worth_knowing_about&amp;diff=740"/>
				<updated>2022-09-02T09:27:13Z</updated>
		
		<summary type="html">&lt;p&gt;LTeinturier: /* Hot Jupiter with DYNAMICO */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== 3D lon-lat LMDZ setup ==&lt;br /&gt;
&lt;br /&gt;
=== early Mars ===&lt;br /&gt;
&lt;br /&gt;
It is already described in the [https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/Quick_Install_and_Run ''Quick Install and Run''] section.&lt;br /&gt;
&lt;br /&gt;
=== Earth with slab ocean ===&lt;br /&gt;
&lt;br /&gt;
TBD by Martin&lt;br /&gt;
&lt;br /&gt;
=== TRAPPIST-1e with photochemistry ===&lt;br /&gt;
&lt;br /&gt;
A temperate rocky planet in synchronous rotation around a low mass star&lt;br /&gt;
&lt;br /&gt;
TBD by Yassin&lt;br /&gt;
&lt;br /&gt;
=== TRAPPIST-1c in Venus-like conditions ===&lt;br /&gt;
&lt;br /&gt;
A warm rocky planet in synchronous rotation around a low mass star&lt;br /&gt;
&lt;br /&gt;
TBD by Gabriella (waiting for the SVN update by Ehouarn)&lt;br /&gt;
&lt;br /&gt;
=== mini-Neptune GJ1214b ===&lt;br /&gt;
&lt;br /&gt;
A warm mini-Neptune&lt;br /&gt;
&lt;br /&gt;
TBD by Benjamin&lt;br /&gt;
&lt;br /&gt;
== 3D DYNAMICO setup ==&lt;br /&gt;
&lt;br /&gt;
Due to the rich dynamical activities in their atmospheres (banded zonal jets, eddies, vortices, storms, equatorial oscillations,...) resulting from multi-scale dynamic interactions, the Global Climate Modelling of the giant planet requires to resolve eddies arising from hydrodynamical instabilities to correctly establish the planetary-scaled jets regime. To this purpose, their Rossby radius deformation $$L_D$$, which is the length scale at which rotational effects become as important as buoyancy or gravity wave effects in the evolution of the flow about some disturbance, is calculated to determine the most suitable horizontal grid resolution. At mid-latitude range, for the giant planets, $$L_D$$ is of the same order of magnitude as that of the Earth. As the giant planets have a size of roughly 10 times the Earth size (i.e., Jupiter and Saturn), the modelling grid must be of a horizontal resolution of 0.5$$^{\circ}$$ over longitude and latitude (vs 5$$^{\circ}$$ for the Earth), considering 3 grid points to resolved $$L_D$$. &lt;br /&gt;
Moreover, to have a chance to model the equatorial oscillation, meridional cell circulations and/or a seasonal inter-hemispheric circulation, a giant planet GCM must also include a high vertical resolution. Indeed, these climate phenomena have been studied for decades for the Earth's atmosphere, and result from small- and large-scale interactions between the troposphere and stratosphere. This implies that the propagation of dynamic instabilities, waves and turbulence should be resolved as far as possible along the vertical. Contrary to horizontal resolution, it doesn't really exist a criterion (similar to $$L_D$$) to determine the most suitable vertical grid resolution and still an adjustable parameter according to the processes to be represented. However, we advise the user to set a vertical resolution of at least 5 grid points per scale height as first stage.    &lt;br /&gt;
Finally, these atmospheres are cold, with long radiative response time which needs radiative transfer computations over decade-long years of Jupiter (given that a Jupiter year $$\approx$$ 12 Earth years), Saturn ( a Saturn year $$\approx$$ 30 Earth years), Uranus (a Uranus year $$\approx$$ 84 earth years) or Neptune (a Neptune year $$\approx$$ 169 Earth years), depending on the chosen planet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To be able to deal with these three -- and non-exhaustive -- requirements to build a giant planet GCM, we need massive computational ressources. For this, we use a dynamical core suitable and numerical stable for massive parallel ressource computations: DYNAMICO [Dubos et al,. 2015].  &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
In these two following subsections, we purpose an example of installation for Jupiter and a Hot Jupiter. All the install, compiling, setting and parameters files for each giant planets could be found on: &lt;br /&gt;
https://github.com/aymeric-spiga/dynamico-giant&lt;br /&gt;
&lt;br /&gt;
If you have already downloaded '''LMDZ.COMMON''', '''LMDZ.GENERIC''', '''IOIPSL''', '''ARCH''', you only have to download:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''ICOSAGCM''': the DYNAMICO dynamical core&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone https://gitlab.in2p3.fr/ipsl/projets/dynamico/dynamico.git ICOSAGCM&lt;br /&gt;
cd ICOSAGCM&lt;br /&gt;
git checkout 90f7138a60ebd3644fbbc42bc9dfa22923386385&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ICOSA_LMDZ''': the interface using to link LMDZ.GENERIC physical packages and ICOSAGCM&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
svn update -r 2655 -q ICOSA_LMDZ&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''XIOS (XML Input Output Server)''': the library to interpolate input/output fields between the icosahedral and longitude/latitude regular grids on fly&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
svn co -r 2319 -q http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/trunk XIOS&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
If you haven't already download '''LMDZ.COMMON''', '''LMDZ.GENERIC''', '''IOIPSL''', '''ARCH''', you can use the '''install.sh''' script provided by the Github repository. &lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
=== Jupiter with DYNAMICO ===&lt;br /&gt;
&lt;br /&gt;
TBD by Deborah&lt;br /&gt;
&lt;br /&gt;
=== Hot Jupiter with DYNAMICO ===&lt;br /&gt;
&lt;br /&gt;
Modelling the atmosphere of Hot Jupiter is challenging because of the extreme temperature conditions, and the fact that these planets are gas giants. Therefore, using a dynamical core such as Dynamico is strongly recommended. Here, we discuss how to perform a cloudless simulation of the Hot Jupiter WASP-43 b, using Dynamico.&lt;br /&gt;
&lt;br /&gt;
'''1st step''': You need to go to the github mentionned previously for Dynamico: https://github.com/aymeric-spiga/dynamico-giant. ''Git clone'' this repo on your favorite cluster, and ''checkout'' to the &amp;quot;hot_jupiter&amp;quot; branch.&lt;br /&gt;
&lt;br /&gt;
'''2nd step''': Now, run the install.sh script. This script will install '''all''' the required models ('''LMDZ.COMMON''', '''LMDZ.GENERIC''','''ICOSA_LMDZ''','''XIOS''','''FCM''','''ICOSAGCM'''). At this point, you only miss '''IOIPSL'''. To install it, go to &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt; &lt;br /&gt;
dynamico-giant/code/LMDZ.COMMON/ioipsl/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There, you will find some examples of installations script. You need to create one that will work on your cluster, with your own arch files.&lt;br /&gt;
During the installation of '''IOIPSL''', you might be asked for a login/password. Contact TGCC computing center to get access.&lt;br /&gt;
&lt;br /&gt;
'''3rd step''': Great, now we have all we need to get started. Navigate to the ''hot_jupiter'' folder. You will find a ''compile_mesopsl.sh'' and a ''compile_occigen.sh'' script. Use them as examples to create the compile script adapted to your own cluster, then run it. &lt;br /&gt;
While running, I suggest that you take a look at the ''log_compile'' file. The compilation can take a while (~ 10minutes, especially because of XIOS). On quick trick to make sure that everything went right is to check the number of ''Build command finished'' messages in ''log_compile''. If everything worked out, there should be 6 of them.&lt;br /&gt;
&lt;br /&gt;
'''4th step''': Okay, the model compiled, good job ! Now we need to create the initial condition for our run. In the hot_jupiter1d folder, you already have a ''temp_profile.txt'' computed with the 1D version of the LMDZ.GENERIC (see rcm1d on this page). Thus, no need to recompute a 1D model but it will be needed if you want to model another Hot Jupiter.&lt;br /&gt;
Navigate to the 'makestart' folder, located at &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt; &lt;br /&gt;
dynamico-giant/hot_jupiter/makestart/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
To generate the initial conditions for the 3D run, we're gonna start the model using the temperature profile from the 1D run. to do that, you will find a &amp;quot;job_mpi&amp;quot; script. Open it, and adapt it to your cluster and launch the job. This job is using 20 procs, and it runs 5 days of simulations. &lt;br /&gt;
If everything goes well, you should see few netcdf files appear. The important ones are '''start_icosa0.nc''', '''startfi0.nc''' and '''Xhistins.nc'''. &lt;br /&gt;
If you see these files, you're all set to launch a real simulation !&lt;br /&gt;
&lt;br /&gt;
'''5th step''': Go back to ''hot_jupiter'' folder. There are a bunch of script to launch your simulation. Take a look at the ''astro_fat_mpi'' script, and adapt it to your cluster. Then you can launch your simulation by doing &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt; &lt;br /&gt;
./run_astro_fat&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This will start the simulation, using 90 procs. In the same folder, check if the icosa_lmdz.out file is created. This is the logfile of the simulation, while it is running. You can check there that everything is going well.&lt;br /&gt;
&lt;br /&gt;
'''Important side note''': When using the ''run_astro_fat'' script to run a simulation, it will run a chained simulation, restarting the simulation from the previous state after 100 days of simulations and generating ''Xhistins.nc'' files. This is your results file, where you will find all the variables that controls your atmosphere (temperature field, wind fields, etc..). &lt;br /&gt;
&lt;br /&gt;
Good luck and enjoy the generic PCM Dynamico for Hot Jupiter !&lt;br /&gt;
&lt;br /&gt;
'''2nd important side note''': These 5 steps are the basic needed steps to run a simulation. If you want to tune simulations to another planet, or change other stuff, you need to take a look at '''*.def''' and '''*.xml''' files. If you're lost in all of this, take a look at the different pages of this website and/or contact us !&lt;br /&gt;
&lt;br /&gt;
== 3D LES setup ==&lt;br /&gt;
&lt;br /&gt;
=== Proxima b with LES ===&lt;br /&gt;
&lt;br /&gt;
TBD by Maxence&lt;br /&gt;
&lt;br /&gt;
== 1D setup ==&lt;br /&gt;
&lt;br /&gt;
=== rcm1d test case ===&lt;br /&gt;
&lt;br /&gt;
Our 1-D forward model&lt;br /&gt;
&lt;br /&gt;
TBD by Gwenael ? (you can have a look at the Generic GCM User Manual for inspiration)&lt;br /&gt;
&lt;br /&gt;
=== kcm1d test case ===&lt;br /&gt;
&lt;br /&gt;
Our 1-D inverse model&lt;br /&gt;
&lt;br /&gt;
TBD by Guillaume or Martin&lt;/div&gt;</summary>
		<author><name>LTeinturier</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Other_GCM_Configurations_worth_knowing_about&amp;diff=739</id>
		<title>Other GCM Configurations worth knowing about</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Other_GCM_Configurations_worth_knowing_about&amp;diff=739"/>
				<updated>2022-09-02T09:24:58Z</updated>
		
		<summary type="html">&lt;p&gt;LTeinturier: /* Hot Jupiter with DYNAMICO */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== 3D lon-lat LMDZ setup ==&lt;br /&gt;
&lt;br /&gt;
=== early Mars ===&lt;br /&gt;
&lt;br /&gt;
It is already described in the [https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/Quick_Install_and_Run ''Quick Install and Run''] section.&lt;br /&gt;
&lt;br /&gt;
=== Earth with slab ocean ===&lt;br /&gt;
&lt;br /&gt;
TBD by Martin&lt;br /&gt;
&lt;br /&gt;
=== TRAPPIST-1e with photochemistry ===&lt;br /&gt;
&lt;br /&gt;
A temperate rocky planet in synchronous rotation around a low mass star&lt;br /&gt;
&lt;br /&gt;
TBD by Yassin&lt;br /&gt;
&lt;br /&gt;
=== TRAPPIST-1c in Venus-like conditions ===&lt;br /&gt;
&lt;br /&gt;
A warm rocky planet in synchronous rotation around a low mass star&lt;br /&gt;
&lt;br /&gt;
TBD by Gabriella (waiting for the SVN update by Ehouarn)&lt;br /&gt;
&lt;br /&gt;
=== mini-Neptune GJ1214b ===&lt;br /&gt;
&lt;br /&gt;
A warm mini-Neptune&lt;br /&gt;
&lt;br /&gt;
TBD by Benjamin&lt;br /&gt;
&lt;br /&gt;
== 3D DYNAMICO setup ==&lt;br /&gt;
&lt;br /&gt;
Due to the rich dynamical activities in their atmospheres (banded zonal jets, eddies, vortices, storms, equatorial oscillations,...) resulting from multi-scale dynamic interactions, the Global Climate Modelling of the giant planet requires to resolve eddies arising from hydrodynamical instabilities to correctly establish the planetary-scaled jets regime. To this purpose, their Rossby radius deformation $$L_D$$, which is the length scale at which rotational effects become as important as buoyancy or gravity wave effects in the evolution of the flow about some disturbance, is calculated to determine the most suitable horizontal grid resolution. At mid-latitude range, for the giant planets, $$L_D$$ is of the same order of magnitude as that of the Earth. As the giant planets have a size of roughly 10 times the Earth size (i.e., Jupiter and Saturn), the modelling grid must be of a horizontal resolution of 0.5$$^{\circ}$$ over longitude and latitude (vs 5$$^{\circ}$$ for the Earth), considering 3 grid points to resolved $$L_D$$. &lt;br /&gt;
Moreover, to have a chance to model the equatorial oscillation, meridional cell circulations and/or a seasonal inter-hemispheric circulation, a giant planet GCM must also include a high vertical resolution. Indeed, these climate phenomena have been studied for decades for the Earth's atmosphere, and result from small- and large-scale interactions between the troposphere and stratosphere. This implies that the propagation of dynamic instabilities, waves and turbulence should be resolved as far as possible along the vertical. Contrary to horizontal resolution, it doesn't really exist a criterion (similar to $$L_D$$) to determine the most suitable vertical grid resolution and still an adjustable parameter according to the processes to be represented. However, we advise the user to set a vertical resolution of at least 5 grid points per scale height as first stage.    &lt;br /&gt;
Finally, these atmospheres are cold, with long radiative response time which needs radiative transfer computations over decade-long years of Jupiter (given that a Jupiter year $$\approx$$ 12 Earth years), Saturn ( a Saturn year $$\approx$$ 30 Earth years), Uranus (a Uranus year $$\approx$$ 84 earth years) or Neptune (a Neptune year $$\approx$$ 169 Earth years), depending on the chosen planet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To be able to deal with these three -- and non-exhaustive -- requirements to build a giant planet GCM, we need massive computational ressources. For this, we use a dynamical core suitable and numerical stable for massive parallel ressource computations: DYNAMICO [Dubos et al,. 2015].  &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
In these two following subsections, we purpose an example of installation for Jupiter and a Hot Jupiter. All the install, compiling, setting and parameters files for each giant planets could be found on: &lt;br /&gt;
https://github.com/aymeric-spiga/dynamico-giant&lt;br /&gt;
&lt;br /&gt;
If you have already downloaded '''LMDZ.COMMON''', '''LMDZ.GENERIC''', '''IOIPSL''', '''ARCH''', you only have to download:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''ICOSAGCM''': the DYNAMICO dynamical core&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone https://gitlab.in2p3.fr/ipsl/projets/dynamico/dynamico.git ICOSAGCM&lt;br /&gt;
cd ICOSAGCM&lt;br /&gt;
git checkout 90f7138a60ebd3644fbbc42bc9dfa22923386385&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ICOSA_LMDZ''': the interface using to link LMDZ.GENERIC physical packages and ICOSAGCM&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
svn update -r 2655 -q ICOSA_LMDZ&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''XIOS (XML Input Output Server)''': the library to interpolate input/output fields between the icosahedral and longitude/latitude regular grids on fly&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
svn co -r 2319 -q http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/trunk XIOS&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
If you haven't already download '''LMDZ.COMMON''', '''LMDZ.GENERIC''', '''IOIPSL''', '''ARCH''', you can use the '''install.sh''' script provided by the Github repository. &lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
=== Jupiter with DYNAMICO ===&lt;br /&gt;
&lt;br /&gt;
TBD by Deborah&lt;br /&gt;
&lt;br /&gt;
=== Hot Jupiter with DYNAMICO ===&lt;br /&gt;
&lt;br /&gt;
Modelling the atmosphere of Hot Jupiter is challenging because of the extreme temperature conditions, and the fact that these planets are gas giants. Therefore, using a dynamical core such as Dynamico is strongly recommended. Here, we discuss how to perform a cloudless simulation of the Hot Jupiter WASP-43 b, using Dynamico.&lt;br /&gt;
&lt;br /&gt;
'''1st step''': You need to go to the github mentionned previously for Dynamico: https://github.com/aymeric-spiga/dynamico-giant. ''Git clone'' this repo on your favorite cluster, and ''checkout'' to the &amp;quot;hot_jupiter&amp;quot; branch.&lt;br /&gt;
&lt;br /&gt;
'''2nd step''': Now, run the install.sh script. This script will install '''all''' the required models ('''LMDZ.COMMON''', '''LMDZ.GENERIC''','''ICOSA_LMDZ''','''XIOS''','''FCM''','''ICOSAGCM'''). At this point, you only miss '''IOIPSL'''. To install it, go to &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt; &lt;br /&gt;
dynamico-giant/code/LMDZ.COMMON/ioipsl/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There, you will find some examples of installations script. You need to create one that will work on your cluster, with your own arch files.&lt;br /&gt;
During the installation of '''IOIPSL''', you might be asked for a login/password. Contact TGCC computing center to get access.&lt;br /&gt;
&lt;br /&gt;
'''3rd step''': Great, now we have all we need to get started. Navigate to the ''hot_jupiter'' folder. You will find a ''compile_mesopsl.sh'' and a ''compile_occigen.sh'' script. Use them as examples to create the compile script adapted to your own cluster, then run it. &lt;br /&gt;
While running, I suggest that you take a look at the ''log_compile'' file. The compilation can take a while (~ 10minutes, especially because of XIOS). On quick trick to make sure that everything went right is to check the number of ''Build command finished'' messages in ''log_compile''. If everything worked out, there should be 6 of them.&lt;br /&gt;
&lt;br /&gt;
'''4th step''': Okay, the model compiled, good job ! Now we need to create the initial condition for our run. In the hot_jupiter1d folder, you already have a ''temp_profile.txt'' computed with the 1D version of the LMDZ.GENERIC (see rcm1d on this page). Thus, no need to recompute a 1D model but it will be needed if you want to model another Hot Jupiter.&lt;br /&gt;
Navigate to the 'makestart' folder, located at &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt; &lt;br /&gt;
dynamico-giant/hot_jupiter/makestart/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
To generate the initial conditions for the 3D run, we're gonna start the model using the temperature profile from the 1D run. to do that, you will find a &amp;quot;job_mpi&amp;quot; script. Open it, and adapt it to your cluster and launch the job. This job is using 20 procs, and it runs 5 days of simulations. &lt;br /&gt;
If everything goes well, you should see few netcdf files appear. The important ones are '''start_icosa0.nc''', '''startfi0.nc''' and '''Xhistins.nc'''. &lt;br /&gt;
If you see these files, you're all set to launch a real simulation !&lt;br /&gt;
&lt;br /&gt;
'''5th step''': Go back to ''hot_jupiter'' folder. There are a bunch of script to launch your simulation. Take a look at the ''astro_fat_mpi'' script, and adapt it to your cluster. Then you can launch your simulation by doing &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt; &lt;br /&gt;
./run_astro_fat&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This will start the simulation, using 90 procs. In the same folder, check if the icosa_lmdz.out file is created. This is the logfile of the simulation, while it is running. You can check there that everything is going well.&lt;br /&gt;
&lt;br /&gt;
'''Important side note''': When using the ''run_astro_fat'' script to run a simulation, it will run a chained simulation, restarting the simulation from the previous state after 100 days of simulations and generating ''Xhistins.nc'' files. This is your results file, where you will find all the variables that controls your atmosphere (temperature field, wind fields, etc..). &lt;br /&gt;
&lt;br /&gt;
Good luck and enjoy the generic PCM Dynamico for Hot Jupiter !&lt;br /&gt;
&lt;br /&gt;
== 3D LES setup ==&lt;br /&gt;
&lt;br /&gt;
=== Proxima b with LES ===&lt;br /&gt;
&lt;br /&gt;
TBD by Maxence&lt;br /&gt;
&lt;br /&gt;
== 1D setup ==&lt;br /&gt;
&lt;br /&gt;
=== rcm1d test case ===&lt;br /&gt;
&lt;br /&gt;
Our 1-D forward model&lt;br /&gt;
&lt;br /&gt;
TBD by Gwenael ? (you can have a look at the Generic GCM User Manual for inspiration)&lt;br /&gt;
&lt;br /&gt;
=== kcm1d test case ===&lt;br /&gt;
&lt;br /&gt;
Our 1-D inverse model&lt;br /&gt;
&lt;br /&gt;
TBD by Guillaume or Martin&lt;/div&gt;</summary>
		<author><name>LTeinturier</name></author>	</entry>

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

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dissipation&amp;diff=304</id>
		<title>Dissipation</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dissipation&amp;diff=304"/>
				<updated>2022-05-11T09:08:34Z</updated>
		
		<summary type="html">&lt;p&gt;LTeinturier: /* How to change it in the model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Description==&lt;br /&gt;
In the LMD grid point model, nonlinear interactions between explicitly resolved scales&lt;br /&gt;
and subgrid-scale processes are parameterized by applying a scale-selective horizontal dissipation operator based on an $$n$$ time iterated Laplacian $$\Delta^n$$. For the grid point model, for&lt;br /&gt;
instance, this can be written: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\begin{align}&lt;br /&gt;
  \label{def:Wns}&lt;br /&gt;
\frac{\partial q}{\partial t} = \frac{(-1)^n}{\tau_{diss}}(\delta x)^{2n}\Delta^nq&lt;br /&gt;
\end{align}&lt;br /&gt;
&lt;br /&gt;
where $$q$$ is a field component on which disspation is applied, $$\delta x$$ is the smallest horizontal distance represented in the model and $$\tau_{diss}$$ is the dissipation timescale for a structure of scale $$\delta x$$. These operators are necessary to ensure the grid point model numerical stability. In practice, the operator is separately applied to three components : &lt;br /&gt;
* the divergence of the flow, &lt;br /&gt;
* the vorticity of the flow,&lt;br /&gt;
* potential temperature.&lt;br /&gt;
&lt;br /&gt;
We classically use n = 2, n = 1,and n = 2.&lt;br /&gt;
&lt;br /&gt;
== How to change it in the model ==&lt;br /&gt;
&lt;br /&gt;
In practise, the values of $$n$$ and $$\tau_{diss}$$ are prescribed in the [https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/The_run.def_Input_File run.def] with the keys: &lt;br /&gt;
*nitergdiv&lt;br /&gt;
*nitergrot&lt;br /&gt;
*niterh &lt;br /&gt;
for the values of $$n$$ on each field, and the associated $$\tau$$: &lt;br /&gt;
*tetagdiv&lt;br /&gt;
*tetagrot&lt;br /&gt;
*tetatemp&lt;br /&gt;
&lt;br /&gt;
In [https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/The_run.def_Input_File run.def], there is also a key ''idissip'' which is the frequency (in dynamical steps) at which to apply the dissipation.&lt;br /&gt;
&lt;br /&gt;
== Good to know rules and rules of thumb == &lt;br /&gt;
*If your simulation shows numerical instabilities, a good idea is to increase dissipation. This means decreasing parameters $$\tau$$.&lt;br /&gt;
* Optimal values for the dissipation timescales depends on the resolution of the horizontal grid. The higher the resolution, the more dissipation we need.&lt;/div&gt;</summary>
		<author><name>LTeinturier</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dissipation&amp;diff=299</id>
		<title>Dissipation</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dissipation&amp;diff=299"/>
				<updated>2022-05-11T09:04:16Z</updated>
		
		<summary type="html">&lt;p&gt;LTeinturier: /* Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Description==&lt;br /&gt;
In the LMD grid point model, nonlinear interactions between explicitly resolved scales&lt;br /&gt;
and subgrid-scale processes are parameterized by applying a scale-selective horizontal dissipation operator based on an $$n$$ time iterated Laplacian $$\Delta^n$$. For the grid point model, for&lt;br /&gt;
instance, this can be written: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\begin{align}&lt;br /&gt;
  \label{def:Wns}&lt;br /&gt;
\frac{\partial q}{\partial t} = \frac{(-1)^n}{\tau_{diss}}(\delta x)^{2n}\Delta^nq&lt;br /&gt;
\end{align}&lt;br /&gt;
&lt;br /&gt;
where $$q$$ is a field component on which disspation is applied, $$\delta x$$ is the smallest horizontal distance represented in the model and $$\tau_{diss}$$ is the dissipation timescale for a structure of scale $$\delta x$$. These operators are necessary to ensure the grid point model numerical stability. In practice, the operator is separately applied to three components : &lt;br /&gt;
* the divergence of the flow, &lt;br /&gt;
* the vorticity of the flow,&lt;br /&gt;
* potential temperature.&lt;br /&gt;
&lt;br /&gt;
We classically use n = 2, n = 1,and n = 2.&lt;br /&gt;
&lt;br /&gt;
== How to change it in the model ==&lt;br /&gt;
&lt;br /&gt;
In practise, the values of $$n$$ and $$\tau_{diss}$$ are prescribed in the ''run.def'' with the keys: &lt;br /&gt;
*nitergdiv&lt;br /&gt;
*nitergrot&lt;br /&gt;
*niterh &lt;br /&gt;
for the values of $$n$$ on each field, and the associated $$\tau$$: &lt;br /&gt;
*tetagdiv&lt;br /&gt;
*tetagrot&lt;br /&gt;
*tetatemp&lt;br /&gt;
&lt;br /&gt;
In ''run.def'', there is also a key ''idissip'' which is the frequency (in dynamical steps) at which to apply the dissipation.&lt;br /&gt;
== Good to know rules and rules of thumb == &lt;br /&gt;
*If your simulation shows numerical instabilities, a good idea is to increase dissipation. This means decreasing parameters $$\tau$$.&lt;br /&gt;
* Optimal values for the dissipation timescales depends on the resolution of the horizontal grid. The higher the resolution, the more dissipation we need.&lt;/div&gt;</summary>
		<author><name>LTeinturier</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dissipation&amp;diff=267</id>
		<title>Dissipation</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dissipation&amp;diff=267"/>
				<updated>2022-05-11T08:44:44Z</updated>
		
		<summary type="html">&lt;p&gt;LTeinturier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Description==&lt;br /&gt;
In the LMD grid point model, nonlinear interactions between explicitly resolved scales&lt;br /&gt;
and subgrid-scale processes are parameterized by applying a scale-selective horizontal dissipation operator based on an $$n$$ time iterated Laplacian $$\Delta^n$$. For the grid point model, for&lt;br /&gt;
instance, this can be written: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\begin{align}&lt;br /&gt;
  \label{def:Wns}&lt;br /&gt;
\frac{\partial q}{\partial t} = \frac{(-1)^n}{\tau_{diss}}(\delta x)^{2n}\Delta^nq&lt;br /&gt;
\end{align}&lt;br /&gt;
&lt;br /&gt;
where $$\delta x$$ is the smallest horizontal distance represented in the model and $$\tau_{diss}$$ is the dissipation timescale for a structure of scale $$\delta x$$. These operators are necessary to ensure the grid point model numerical stability. In practice, the operator is separately applied to three components : &lt;br /&gt;
* the divergence of the flow, &lt;br /&gt;
* the vorticity of the flow,&lt;br /&gt;
* potential temperature.&lt;br /&gt;
&lt;br /&gt;
We classically use n = 2, n = 1,and n = 2.&lt;br /&gt;
== How to change it in the model ==&lt;br /&gt;
&lt;br /&gt;
In practise, the values of $$n$$ and $$\tau_{diss}$$ are prescribed in the ''run.def'' with the keys: &lt;br /&gt;
*nitergdiv&lt;br /&gt;
*nitergrot&lt;br /&gt;
*niterh &lt;br /&gt;
for the values of $$n$$ on each field, and the associated $$\tau$$: &lt;br /&gt;
*tetagdiv&lt;br /&gt;
*tetagrot&lt;br /&gt;
*tetatemp&lt;br /&gt;
&lt;br /&gt;
In ''run.def'', there is also a key ''idissip'' which is the frequency (in dynamical steps) at which to apply the dissipation.&lt;br /&gt;
== Good to know rules and rules of thumb == &lt;br /&gt;
*If your simulation shows numerical instabilities, a good idea is to increase dissipation. This means decreasing parameters $$\tau$$.&lt;br /&gt;
* Optimal values for the dissipation timescales depends on the resolution of the horizontal grid. The higher the resolution, the more dissipation we need.&lt;/div&gt;</summary>
		<author><name>LTeinturier</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dissipation&amp;diff=253</id>
		<title>Dissipation</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dissipation&amp;diff=253"/>
				<updated>2022-05-11T08:37:19Z</updated>
		
		<summary type="html">&lt;p&gt;LTeinturier: Created page with &amp;quot;In the LMD grid point model, nonlinear interactions between explicitly resolved scales and subgrid-scale processes are parameterized by applying a scale-selective horizontal d...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In the LMD grid point model, nonlinear interactions between explicitly resolved scales&lt;br /&gt;
and subgrid-scale processes are parameterized by applying a scale-selective horizontal dis-&lt;br /&gt;
sipation operator based on an n time iterated Laplacian $$\Delta^n$$. For the grid point model, for&lt;br /&gt;
instance, this can be written: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\begin{align}&lt;br /&gt;
  \label{def:Wns}&lt;br /&gt;
\frac{\partial q}{\partial t} = \frac{(-1)^n}{\tau_{diss}}(\delta x)^{2n}\Delta^nq&lt;br /&gt;
\end{align}&lt;br /&gt;
&lt;br /&gt;
where $$\delta x$$ is the smallest horizontal distance represented in the model and $$\tau_{diss}$$ is the dissipation timescale for a structure of scale $$\delta x$$. These operators are necessary to ensure the grid point model numerical stability. In practice, the operator is separately applied to three components : &lt;br /&gt;
* the divergence of the flow, &lt;br /&gt;
* the vorticity of the flow,&lt;br /&gt;
* potential temperature.&lt;br /&gt;
&lt;br /&gt;
We classically use n = 2, n = 1,and n = 2.&lt;br /&gt;
&lt;br /&gt;
In practise, the values of $$n$$ and $$\tau_{diss}$$ are prescribed in the ''run.def'' with the keys: &lt;br /&gt;
*nitergdiv&lt;br /&gt;
*nitergrot&lt;br /&gt;
*niterh &lt;br /&gt;
for the values of $$n$$ on each field, and the associated $$\tau$$: &lt;br /&gt;
*tetagdiv&lt;br /&gt;
*tetagrot&lt;br /&gt;
*tetatemp&lt;/div&gt;</summary>
		<author><name>LTeinturier</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=225</id>
		<title>Tool Box</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=225"/>
				<updated>2022-05-11T08:14:24Z</updated>
		
		<summary type="html">&lt;p&gt;LTeinturier: /* mass stream function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Pre-processing Tools ==&lt;br /&gt;
=== newstart ===&lt;br /&gt;
=== start2archive ===&lt;br /&gt;
=== visualization tools ===&lt;br /&gt;
=== other third party scripts and tools ===&lt;br /&gt;
&lt;br /&gt;
TO BE COMPLETED&lt;br /&gt;
&lt;br /&gt;
== Post-processing tools ==&lt;br /&gt;
=== zrecast ===&lt;br /&gt;
&lt;br /&gt;
TO BE COMPLETED&lt;br /&gt;
&lt;br /&gt;
=== mass stream function ===&lt;br /&gt;
&lt;br /&gt;
The mass stream function (and the total angular momentum) can be computed from a diagfi.nc or a stats.nc, using the '''streamfunction.F90''' script. The script is located at&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
trunk/LMDZ.GENERIC/utilities&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To compile the script, open the ''compile'' file in the same directory and do the following:&lt;br /&gt;
* Replace &amp;quot;pgf90&amp;quot; with your favorite fortran compiler &lt;br /&gt;
* replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/lib&amp;quot; with the lib address and directory that contains your NetCDF library (file ''libnetcdf.a'').&lt;br /&gt;
* Replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/include&amp;quot; with the address of the directory that contains the NetCDF include file (''netcdf.inc'').&lt;br /&gt;
* You can mess with the compiling options but it is not mandatory.&lt;br /&gt;
&lt;br /&gt;
Once the script is compiled, copy it in the same directory as your '''.nc''' file and run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./streamfunction.e&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The script will ask you for the name of your '''.nc''' file, and will run and produce a new '''nameofyourfile_stream.nc''' file.&lt;br /&gt;
&lt;br /&gt;
'''Be careful''' : In this new file, all fields are temporally and zonally averaged.&lt;br /&gt;
&lt;br /&gt;
If you want to use '''python''' instead of '''fortran''', you can take a look at this [https://github.com/aymeric-spiga/dynanalysis repo]. It hosts a tool to perform dynamical analysis of GCM simulations (and therefore, it computes the mass stream function and a lot of other stuff), but it is tailored for Dynamico only.&lt;br /&gt;
&lt;br /&gt;
== Continuing Simulations ==&lt;br /&gt;
&lt;br /&gt;
At the end of a simulation, the model generates restart files (files 'restart.nc' and 'restartfi.nc') which contain the final state of the model. The 'restart.nc' and 'restartfi.nc' files have the same format as the 'start.nc' and 'startfi.nc' files, respectively. &lt;br /&gt;
&lt;br /&gt;
These files can in fact be used as initial states using the following renaming:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mv restart.nc start.nc&lt;br /&gt;
mv restartfi.nc startfi.nc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and running a simulation with these will in fact resume the simulation from where the&lt;br /&gt;
previous run ended.&lt;br /&gt;
&lt;br /&gt;
=== bash scripts ===&lt;br /&gt;
&lt;br /&gt;
== Visualization software ==&lt;br /&gt;
=== Panoply ===&lt;br /&gt;
&lt;br /&gt;
[[File:Example panoply.png|thumb|Screenshot of panoply showing here LMD Generic results for the exoplanet TRAPPIST-1e]]&lt;br /&gt;
&lt;br /&gt;
=== ncview ===&lt;br /&gt;
=== paraview ===&lt;br /&gt;
=== planetoplot ===&lt;br /&gt;
=== python scripts ===&lt;br /&gt;
&lt;br /&gt;
TO BE COMPLETED&lt;/div&gt;</summary>
		<author><name>LTeinturier</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=223</id>
		<title>Tool Box</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=223"/>
				<updated>2022-05-11T08:14:12Z</updated>
		
		<summary type="html">&lt;p&gt;LTeinturier: /* mass stream function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Pre-processing Tools ==&lt;br /&gt;
=== newstart ===&lt;br /&gt;
=== start2archive ===&lt;br /&gt;
=== visualization tools ===&lt;br /&gt;
=== other third party scripts and tools ===&lt;br /&gt;
&lt;br /&gt;
TO BE COMPLETED&lt;br /&gt;
&lt;br /&gt;
== Post-processing tools ==&lt;br /&gt;
=== zrecast ===&lt;br /&gt;
&lt;br /&gt;
TO BE COMPLETED&lt;br /&gt;
&lt;br /&gt;
=== mass stream function ===&lt;br /&gt;
&lt;br /&gt;
The mass stream function (and the total angular momentum) can be computed from a diagfi.nc or a stats.nc, using the '''streamfunction.F90''' script. The script is located at&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
trunk/LMDZ.GENERIC/utilities&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To compile the script, open the ''compile'' file in the same directory and do the following:&lt;br /&gt;
* Replace &amp;quot;pgf90&amp;quot; with your favorite fortran compiler &lt;br /&gt;
* replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/lib&amp;quot; with the lib address and directory that contains your NetCDF library (file ''libnetcdf.a'').&lt;br /&gt;
* Replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/include&amp;quot; with the address of the directory that contains the NetCDF include file (''netcdf.inc'').&lt;br /&gt;
* You can mess with the compiling options but it is not mandatory.&lt;br /&gt;
&lt;br /&gt;
Once the script is compiled, copy it in the same directory as your '''.nc''' file and run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./streamfunction.e&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The script will ask you for the nam of your '''.nc''' file, and will run and produce a new '''nameofyourfile_stream.nc''' file.&lt;br /&gt;
&lt;br /&gt;
'''Be careful''' : In this new file, all fields are temporally and zonally averaged.&lt;br /&gt;
&lt;br /&gt;
If you want to use '''python''' instead of '''fortran''', you can take a look at this [https://github.com/aymeric-spiga/dynanalysis repo]. It hosts a tool to perform dynamical analysis of GCM simulations (and therefore, it computes the mass stream function and a lot of other stuff), but it is tailored for Dynamico only.&lt;br /&gt;
&lt;br /&gt;
== Continuing Simulations ==&lt;br /&gt;
&lt;br /&gt;
At the end of a simulation, the model generates restart files (files 'restart.nc' and 'restartfi.nc') which contain the final state of the model. The 'restart.nc' and 'restartfi.nc' files have the same format as the 'start.nc' and 'startfi.nc' files, respectively. &lt;br /&gt;
&lt;br /&gt;
These files can in fact be used as initial states using the following renaming:&lt;br /&gt;
&lt;br /&gt;
for a new simulation.&lt;br /&gt;
The restart files just need to be renamed:&lt;br /&gt;
mv restart.nc start.nc&lt;br /&gt;
mv restartfi.nc startfi.nc&lt;br /&gt;
and running a simulation with these will in fact resume the simulation from where the&lt;br /&gt;
previous run ended.&lt;br /&gt;
&lt;br /&gt;
=== bash scripts ===&lt;br /&gt;
&lt;br /&gt;
== Visualization software ==&lt;br /&gt;
=== Panoply ===&lt;br /&gt;
&lt;br /&gt;
[[File:Example panoply.png|thumb|Screenshot of panoply showing here LMD Generic results for the exoplanet TRAPPIST-1e]]&lt;br /&gt;
&lt;br /&gt;
=== ncview ===&lt;br /&gt;
=== paraview ===&lt;br /&gt;
=== planetoplot ===&lt;br /&gt;
=== python scripts ===&lt;br /&gt;
&lt;br /&gt;
TO BE COMPLETED&lt;/div&gt;</summary>
		<author><name>LTeinturier</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=221</id>
		<title>Tool Box</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Tool_Box&amp;diff=221"/>
				<updated>2022-05-11T08:13:39Z</updated>
		
		<summary type="html">&lt;p&gt;LTeinturier: /* mass stream function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Pre-processing Tools ==&lt;br /&gt;
=== newstart ===&lt;br /&gt;
=== start2archive ===&lt;br /&gt;
=== visualization tools ===&lt;br /&gt;
=== other third party scripts and tools ===&lt;br /&gt;
&lt;br /&gt;
TO BE COMPLETED&lt;br /&gt;
&lt;br /&gt;
== Post-processing tools ==&lt;br /&gt;
=== zrecast ===&lt;br /&gt;
&lt;br /&gt;
TO BE COMPLETED&lt;br /&gt;
&lt;br /&gt;
=== mass stream function ===&lt;br /&gt;
&lt;br /&gt;
The mass stream function (and the total angular momentum) can be computed from a diagfi.nc or a stats.nc, using the '''streamfunction.F90''' script. The script is located at&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
trunk/LMDZ.GENERIC/utilities&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To compile the script, open the ''compile'' file in the same directory and do the following:&lt;br /&gt;
* Replace &amp;quot;pgf90&amp;quot; with your favorite fortran compiler &lt;br /&gt;
* replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/lib&amp;quot; with the lib address and directory that contains your NetCDF library (file ''libnetcdf.a'').&lt;br /&gt;
* Replace &amp;quot;/distrib/local/netcdf/pgi_7.1-6_32/include&amp;quot; with the address of the directory that contains the NetCDF include file (''netcdf.inc'').&lt;br /&gt;
* You can mess with the compiling options but it is not mandatory.&lt;br /&gt;
&lt;br /&gt;
Once the script is compiled, copy it in the same directory as your '''.nc''' file and run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./streamfunction.e&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The script will ask you for the nam of your '''.nc''' file, and will run and produce a new '''nameofyourfile_stream.nc''' file.&lt;br /&gt;
&lt;br /&gt;
'''Be careful''' : In this new file, all fields are temporally and zonally averaged.&lt;br /&gt;
&lt;br /&gt;
If you want to use python instead of fortran, you can take a look at this [https://github.com/aymeric-spiga/dynanalysis repo]. It hosts a tool to perform dynamical analysis of GCM simulations (and therefore, it computes the mass stream function and a lot of other stuff), but it is tailored for Dynamico only.&lt;br /&gt;
&lt;br /&gt;
== Continuing Simulations ==&lt;br /&gt;
&lt;br /&gt;
At the end of a simulation, the model generates restart files (files 'restart.nc' and 'restartfi.nc') which contain the final state of the model. The 'restart.nc' and 'restartfi.nc' files have the same format as the 'start.nc' and 'startfi.nc' files, respectively. &lt;br /&gt;
&lt;br /&gt;
These files can in fact be used as initial states using the following renaming:&lt;br /&gt;
&lt;br /&gt;
for a new simulation.&lt;br /&gt;
The restart files just need to be renamed:&lt;br /&gt;
mv restart.nc start.nc&lt;br /&gt;
mv restartfi.nc startfi.nc&lt;br /&gt;
and running a simulation with these will in fact resume the simulation from where the&lt;br /&gt;
previous run ended.&lt;br /&gt;
&lt;br /&gt;
=== bash scripts ===&lt;br /&gt;
&lt;br /&gt;
== Visualization software ==&lt;br /&gt;
=== Panoply ===&lt;br /&gt;
&lt;br /&gt;
[[File:Example panoply.png|thumb|Screenshot of panoply showing here LMD Generic results for the exoplanet TRAPPIST-1e]]&lt;br /&gt;
&lt;br /&gt;
=== ncview ===&lt;br /&gt;
=== paraview ===&lt;br /&gt;
=== planetoplot ===&lt;br /&gt;
=== python scripts ===&lt;br /&gt;
&lt;br /&gt;
TO BE COMPLETED&lt;/div&gt;</summary>
		<author><name>LTeinturier</name></author>	</entry>

	</feed>