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

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1814</id>
		<title>Dust Cycle in Mars PCM6</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1814"/>
				<updated>2024-01-07T22:30:31Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: /* Level 2 (developper) : Parametrizations and tunable parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details at different levels how to use and what is featured in the dust cycle in Mars PCM6. '''This is still work in progress for now !'''&lt;br /&gt;
&lt;br /&gt;
== Level 1 (user) : Flags for PCM6 dust cycle ==&lt;br /&gt;
To run a simulation with the PCM6 dust cycle, you need to set up several flags and parameters in your ''callphys.def'' (see an example here: https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/callphys.def.GCM6)&lt;br /&gt;
&lt;br /&gt;
We list below all the relevant flags and parameters directly related to PCM6 dust cycle :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line&amp;gt;&lt;br /&gt;
##General options&lt;br /&gt;
##~~~~~~~~~~~~~~~&lt;br /&gt;
#Directory where external input files are:&lt;br /&gt;
datadir=/path/to/datadir&lt;br /&gt;
&lt;br /&gt;
#Run with or without tracer transport ?&lt;br /&gt;
tracer=.true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
## Dust scenario. Used to prescribe the dust&lt;br /&gt;
## ~~~~~~~~~~~~~&lt;br /&gt;
#  =1 Dust opt.deph read in startfi; =2 Viking scenario; =3 MGS scenario [default],&lt;br /&gt;
#  =4 Mars Year 24 from TES assimilation (old version of MY24; dust_tes.nc file)&lt;br /&gt;
#  =6 &amp;quot;cold&amp;quot; (low dust) scenario ; =7 &amp;quot;warm&amp;quot; (high dust) scenario&lt;br /&gt;
#  =8 &amp;quot;climatology&amp;quot; (our best guess of a typical Mars year) scenario&lt;br /&gt;
#  =24 Mars Year 24 from TES assimilation (ie: MCD reference case)&lt;br /&gt;
#  =25 Mars Year 25 from TES assimilation (ie: a year with a global dust storm)&lt;br /&gt;
#  =26 Mars Year 26 from TES assimilation&lt;br /&gt;
#  ...&lt;br /&gt;
#  =35 Mars Year 35 from observers assimilation&lt;br /&gt;
iaervar = 8&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# Dust IR opacity ref. wavelength (for dso diagnostics only)&lt;br /&gt;
# &amp;quot;tes&amp;quot; (9.3 microns) [default] or &amp;quot;mcs&amp;quot; (21.6 microns)&lt;br /&gt;
dustiropacity = tes&lt;br /&gt;
# Use an IR to VIS scenario conversion coefficient that is&lt;br /&gt;
# dependent on the GCM dust effective radius,&lt;br /&gt;
# instead of a fixed 2.6 coefficient ?&lt;br /&gt;
#(only if dustiropacity = tes ; default = .false.)&lt;br /&gt;
reff_driven_IRtoVIS_scenario = .true.&lt;br /&gt;
&lt;br /&gt;
## Physical Parameterizations :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# call radiative transfer ? (default=.true.)&lt;br /&gt;
callrad   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
## Radiative transfer options :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# SCATTERERS: set number of scatterers.&lt;br /&gt;
# Must be compliant with other options: +1 if active, +1 if rdstorm, +1 if topflows, +1 if activice ; default=1)&lt;br /&gt;
naerkind = 4&lt;br /&gt;
&lt;br /&gt;
## Tracer (dust water, ice and/or chemical species) options (used if tracer=T):&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# DUST: Transported dust ? (if &amp;gt;0, use 'dustbin' dust bins ; default=0)&lt;br /&gt;
dustbin    = 2&lt;br /&gt;
# DUST: Radiatively active dust ? (matters if dustbin&amp;gt;0 ; default=.false.)&lt;br /&gt;
active  = .true.&lt;br /&gt;
# DUST: use mass and number mixing ratios to predict dust size ? (default=.false.)&lt;br /&gt;
doubleq   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: lifted by GCM surface winds ? (default=.false.)&lt;br /&gt;
lifting = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: Scavenging by H2O snowfall ? (default=.false.)&lt;br /&gt;
scavenging = .true.&lt;br /&gt;
&lt;br /&gt;
# DUST: freedust ? (default=.false.)&lt;br /&gt;
freedust=.true.&lt;br /&gt;
# DUST: dustscaling_mode?&lt;br /&gt;
#     =0 --&amp;gt; freedust, tauscaling=1&lt;br /&gt;
#     =1 --&amp;gt; GCM5.3-like, tauscaling&lt;br /&gt;
#     =2 --&amp;gt; tauscaling=1,dust_rad_adjust&lt;br /&gt;
dustscaling_mode=2&lt;br /&gt;
# DUST: dust injection scheme (if &amp;gt;0, use 'dustinjection' ; default=0)&lt;br /&gt;
dustinjection=1&lt;br /&gt;
# DUST: dust injection scheme coefficient (default=0.25)&lt;br /&gt;
coeff_injection=0.25&lt;br /&gt;
# DUST: dust injection scheme initial local time (default=0.)&lt;br /&gt;
ti_injection=0.&lt;br /&gt;
# DUST: dust injection scheme final local time (default=24.)&lt;br /&gt;
tf_injection=24.&lt;br /&gt;
# DUST: Rocket Dust Storm scheme (default=.false.)&lt;br /&gt;
rdstorm=.true.&lt;br /&gt;
# DUST: RDS detrainment coefficient (default=0.02)&lt;br /&gt;
coeff_detrainment=0.02&lt;br /&gt;
# DUST: Dust entrainment by subgrid-scale slope winds (default=.false.)&lt;br /&gt;
topflows=.true.&lt;br /&gt;
&lt;br /&gt;
# DUST/WATERICE: Scavenging by CO2 condensation? (default=.false.)&lt;br /&gt;
scavco2cond = .true.&lt;br /&gt;
# DUST/WATERICE: Gravitationnal sedimentation ? (default=.true.)&lt;br /&gt;
sedimentation = .true.&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note''' that the PCM6 dust cycle has mainly been tested with the non-dust-related flags and parameters that are featured in ''callphys.def.GCM6'' and ''callphys.def.MCD6'' (cf https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/), and in general with the ''*.def'' files (''run.def'', ''traceur.def'', ''z2sig.def'') that are suffixed with ''.GCM6'' or ''.MCD6''. If you depart from these files, even for non-dust related processes, we do not ensure the good tuning of the dust cycle, nor to a lesser extent the good compilation/execution of the model. If this happens, please reach out to us !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Level 2 (developper) : Parametrizations and tunable parameters ==&lt;br /&gt;
The technical document that sums up the features of the dust cycle in the PCM6, referred to as TN2022_ESA below, can be found here : https://www-mars.lmd.jussieu.fr/esa/contract2020_2022/deliverables/MS3/D2.1_dust_cycle.pdf&lt;br /&gt;
&lt;br /&gt;
For more insights into the development and tuning of all the parametrizations related to the PCM6 Dust Cycle, please find below the reference technical documents :&lt;br /&gt;
* TN2019_ESA : https://www-mars.lmd.jussieu.fr/WP2018/LMD_gcm_report_part1_dust.pdf&lt;br /&gt;
* TN2019_CNES : https://www-mars.lmd.jussieu.fr/cnes/2019/LMD_CNES_EXM_gcm6.0.pdf&lt;br /&gt;
* TN2020_CNES : https://www-mars.lmd.jussieu.fr/cnes/2020/note_technique_GCM_dust.pdf&lt;br /&gt;
* TN2021_CNES : https://www-mars.lmd.jussieu.fr/cnes/2021/note_technique_dust_cycle2021.pdf&lt;br /&gt;
* TN2022_ESA : https://www-mars.lmd.jussieu.fr/esa/contract2020_2022/deliverables/MS3/D2.1_dust_cycle.pdf ; ''Erratum : in section 2 of this document, it is said that &amp;quot;Corrected values for [ the assumptions done on the tuple ($$r_{eff}$$,$$Q_{ext}$$) ] which were a bit erroneous, lead to a typical opacity of 6 instead of 10 for the dust storm we simulate in the model using $$q_{storm,ref}$$ = $$5 × 10^{−4}$$kg/kg&amp;quot; (&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;mmr_ref&amp;lt;/span&amp;gt;). These &amp;quot;corrected&amp;quot; values were actually wrong. If we consider $$r_{eff}$$=2µm like in [https://doi.org/10.1002/2017JE005255 Wang et al. (2018)] or TN2019_ESA, using a mmr_ref of 5e-4kg/kg leads to an opacity of 10.5. If we use $$r_{eff}$$=3µm like the default &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;reff_lift&amp;lt;/span&amp;gt;, this leads to an opacity of 6.6.''&lt;br /&gt;
&lt;br /&gt;
The table below sums up all the parameters related to PCM6 Dust Cycle, a short description, their default value in PCM6, a reasonable range that can explored for tuning, where to find/modify them in the code, and references addressing their tuning in the PCM or their explorable range according to our current knowledge of Mars climate.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto&amp;quot;&lt;br /&gt;
! Process !! Parameter !! Description !! Default value !! Reasonable range for tuning !! In the code&lt;br /&gt;
(D: declaration ; A: assignment ; U: use)&lt;br /&gt;
! References&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;7&amp;quot;|Injection &lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U) || TN2019_CNES, TN2020_CNES, TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''ti_injection'''&amp;lt;/span&amp;gt; || Beginning local time for injection window [h] || style=&amp;quot;text-align:center;&amp;quot;| 0 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 18 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U) ; ''vdifc_mod.F'' (U) || TN2019_ESA, TN2019_CNES, TN2020_CNES, TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''tf_injection'''&amp;lt;/span&amp;gt; || Ending local time for injection window [h] || style=&amp;quot;text-align:center;&amp;quot;| 24 || style=&amp;quot;text-align:center;&amp;quot;| 6 - 24 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U) ; ''vdifc_mod.F'' (U) || TN2019_ESA, TN2019_CNES, TN2020_CNES, TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''reff_lift'''&amp;lt;/span&amp;gt; || Effective radius of injected dust [m] || style=&amp;quot;text-align:center;&amp;quot;| 3e-6 || style=&amp;quot;text-align:center;&amp;quot;| 1e-6 - 5e-6 || ''initracer.F'' (D,A,U) ; impacts ''vdifc_mod.F''  || TN2021_CNES&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''reff_storm'''&amp;lt;/span&amp;gt; || Effective radius of injected dust when &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;rdstorm&amp;lt;/span&amp;gt;=.true. [m] || style=&amp;quot;text-align:center;&amp;quot;| 3e-6 || style=&amp;quot;text-align:center;&amp;quot;| (should be equal to reff_lift) || ''initracer.F'' (D,A,U) ; impacts ''vdifc_mod.F'' || TN2021_CNES&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''nueff_lift'''&amp;lt;/span&amp;gt; || Effective variance of injected dust [no unit] ; is also the variance in the atmosphere &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;nueffdust&amp;lt;/span&amp;gt; || style=&amp;quot;text-align:center;&amp;quot;| 0.5 || style=&amp;quot;text-align:center;&amp;quot;| 0.2 - 0.6 || ''initracer.F'' (D,A,U) ; impacts ''aeroptproperties.F'', ''callsedim_mod.F'' || [https://doi.org/10.1029/2006JE002786 Wolff et al. (2006)], [https://doi.org/10.1029/2020JE006419 Luginin et al. (2020)]&lt;br /&gt;
|-&lt;br /&gt;
|| $$Q_{ext}$$ for &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''alpha_lift(igcm_[dust&amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt;stormdust]_mass)'''&amp;lt;/span&amp;gt; || Extinction coefficient in the visible [no unit] used for the lifted mass coefficient ; should depend on &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;reff_[lift&amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt;storm]&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;nueff_lift&amp;lt;/span&amp;gt; || style=&amp;quot;text-align:center;&amp;quot;| 2.4  (hard-coded, no variable) || style=&amp;quot;text-align:center;&amp;quot;| (for $$\nu _{eff}$$=0.5)&lt;br /&gt;
$$r_{eff}$$=3µm -&amp;gt; $$Q_{ext}$$=2.46 ;&lt;br /&gt;
$$r_{eff}$$=2.5µm -&amp;gt; $$Q_{ext}$$=2.5 ;&lt;br /&gt;
$$r_{eff}$$=2µm -&amp;gt; $$Q_{ext}$$=2.6 ;&lt;br /&gt;
$$r_{eff}$$=1µm -&amp;gt; $$Q_{ext}$$=2.85 ;&lt;br /&gt;
|| ''initracer.F'' (A,U) ; impacts ''vdifc_mod.F''&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;|Rocket dust storm&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''mmr_ref'''&amp;lt;/span&amp;gt; || Reference mass mixing ratio [kg/kg] for the rocket dust storm sub-mesh fraction || style=&amp;quot;text-align:center;&amp;quot;| 5e-4 || style=&amp;quot;text-align:center;&amp;quot;| 2.5e-4 - 7.5e-4 || ''calcstormfract_mod.F90'' (D,A,U) ; impacts ''rocketduststorm_mod.F90'', ''callradite_mod.F90'' || TN2019_ESA, [https://doi.org/10.1002/2017JE005255 Wang et al. (2018)], TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''fracmin'''&amp;lt;/span&amp;gt; ; &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''fracmax'''&amp;lt;/span&amp;gt; || Bounds for the rocket dust storm sub-mesh fraction [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.01 ; 0.6 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''calcstormfract_mod.F90'' (D,A,U) ; impacts ''rocketduststorm_mod.F90'', ''callradite_mod.F90'' || TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_detrainment'''&amp;lt;/span&amp;gt; || Detrainment coefficient $$C_{det}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.02 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1'''*''' || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''rocketduststorm_mod.F90'' (U) || TN2019_CNES, TN2020_CNES, TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;|Mountain top flows&lt;br /&gt;
|| $$C_{mons}$$ for &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''alpha_hmons'''&amp;lt;/span&amp;gt; || Dampening coefficient $$C_{mons}$$ [no unit] for the mountain top flows sub-mesh fraction || style=&amp;quot;text-align:center;&amp;quot;| 0.5 (hard-coded, no variable) || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''topmons_mod.F90'' (A,U) || TN2020_CNES, TN2021_CNES, TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''k0'''&amp;lt;/span&amp;gt; ; &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''k1'''&amp;lt;/span&amp;gt; ; &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''k2'''&amp;lt;/span&amp;gt; || Coefficients [m/s ; m$$^{-1}$$ ; no unit] for the slope winds vertical velocity || style=&amp;quot;text-align:center;&amp;quot;| 0.25 ; 5e-4 ; 5e-3  (wmax = 3m/s) || style=&amp;quot;text-align:center;&amp;quot;| 1. ; 5e-4 ; 30e-3  (wmax = 10m/s) || ''topmons_mod.F90'' (D,A,U) || TN2019_CNES&lt;br /&gt;
|-&lt;br /&gt;
|| $$C_{detr}$$ for &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coefdetrain'''&amp;lt;/span&amp;gt; || Dampening coefficient $$C_{detr}$$ [no unit] for the mountain top flows detrainment || style=&amp;quot;text-align:center;&amp;quot;| 1. (hard-coded, no variable) || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''topmons_mod.F90'' (A,U) || TN2019_CNES&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;1&amp;quot;|Sedimentation&lt;br /&gt;
|| $$\beta$$ in call of newsedim for dust, stormdust and topdust || Particle shape correction factor for the Stokes-Cunningham sedimentation velocity [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.5 (hard-coded, no variable) || style=&amp;quot;text-align:center;&amp;quot;| 0.5 - 1&lt;br /&gt;
(disk -&amp;gt; irregular -&amp;gt; sphere)&lt;br /&gt;
|| ''callsedim_mod.F90'' (A,U) || [https://doi.org/10.1029/JB095iB09p14629 Murphy et al. (1990)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''''*'''Note on the rocket dust storm detrainment : The rocket dust storm detrainment, currently tuned with the coefficient &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;coeff_detrainment&amp;lt;/span&amp;gt;, should actually be revisited to match the one that is done for mountain top flows. (ticket [ #...])''&lt;br /&gt;
&lt;br /&gt;
== What's going on for rocket dust storms and injection : a detailed example through the physics parametrizations ==&lt;br /&gt;
We detail below the successive steps and processes performed concerning the coupling between the rocket dust storms and the dust injection. We place ourselves in one column of the model, which will serve as an example. The Fortran subroutines that are involved at each step are referred as '''''subroutine'''''.&lt;br /&gt;
&lt;br /&gt;
0. as we reach 2pm in this column, we read and interpolate the value of the optical depth scenario for the next day ('''''compute_dtau'''''). Let's say the scenario features an opacity of 5 (big dusty event), while the current day's GCM column has an opacity of 1 (which has been computed before, in '''''aeropacity''''')&lt;br /&gt;
&lt;br /&gt;
1. ('''''compute_dtau''''') we calculate the optical depth difference dtau=5-1=4, then what this means in terms of dust mass to be added to the atmosphere, assuming an effective size reff_lift = 3µm by default (defined in '''''initracer'''''). We dampen this quantity of dust by a coefficient Cinj (=0.25 by default) to take into account that the jump in tau_pref_scenario from the current day to the next may not come from local injection but from transport from adjacent meshes. For the values considered in this example, this gives an injection of ~5e-8 kg/m²/s.&lt;br /&gt;
&lt;br /&gt;
2. all this dust is injected uniformly during the injection window, by default between 2 p.m. this day and 2 p.m. the next day (when we are supposed to reach the scenario target), in the form of stormdust into the 1st layer by '''''vdifc''''', which already mixes it a little on several layers. Then this stormdust undergoes processes like thermals ('''''calltherm_interface'''''), convective adjustment ('''''convadj''''') and sedimentation ('''''callsedim''''') that further mix it in the atmosphere. For the latter, stormdust is prevented from falling to the ground, and remains in the 1st layer instead. We need to do so, because the main process responsible for the stormdust rising, represented by the routine '''''rocketduststorm''''', only happens at the beginning of the next timestep (see point 5).&lt;br /&gt;
&lt;br /&gt;
3. the stormdust is further mixed by the dynamics, and may also be transported to adjacent meshes. The column may also receive stormdust from other meshes.&lt;br /&gt;
&lt;br /&gt;
4. once back to the next physical time step, we calculate a sub-mesh fraction that is representative of the size of the stormdust plume ('''''calcstormfract'''''). To do so, we use the maximum mass mixing ratio of stormdust in the entire column (apart from the 1st layer), and compute the sub-mesh fraction that is needed to reach a reference mixing ratio mmr_ref=5e-4kg/kg. This reference mmr is a value that we consider representative of an opacity of 10 that was measured in a local dust storm by OMEGA, given some assumptions like a vertical extent of $$\Delta P$$=200Pa for the dust plume (''see also Wang et al. 2018, JGRPlanets, doi:10.1002/2017JE005255'').&lt;br /&gt;
&lt;br /&gt;
5. finally, we enter the '''''rocketduststorm''''' routine, where we check whether anywhere in the column, the mmr of stormdust (not concentrated in the sub-mesh fraction, but expanded to the whole mesh) is greater than $$10^{-4}$$ times that of background dust. If so, we activate the scheme in the column, and calculate the heating difference between the sub-mesh fraction (where we have concentrated stormdust, and background dust) and the rest of the mesh (only background dust), the resulting vertical transport in the sub-mesh fraction, and the horizontal detrainment where the stormdust plume vertical velocity decreases. If there is not enough stormdust compared to background dust at any level, the stormdust is detrained into background dust at all levels of the column.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Mars-Model]]&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1813</id>
		<title>Dust Cycle in Mars PCM6</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1813"/>
				<updated>2024-01-07T22:29:31Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: /* Level 2 (developper) : Parametrizations and tunable parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details at different levels how to use and what is featured in the dust cycle in Mars PCM6. '''This is still work in progress for now !'''&lt;br /&gt;
&lt;br /&gt;
== Level 1 (user) : Flags for PCM6 dust cycle ==&lt;br /&gt;
To run a simulation with the PCM6 dust cycle, you need to set up several flags and parameters in your ''callphys.def'' (see an example here: https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/callphys.def.GCM6)&lt;br /&gt;
&lt;br /&gt;
We list below all the relevant flags and parameters directly related to PCM6 dust cycle :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line&amp;gt;&lt;br /&gt;
##General options&lt;br /&gt;
##~~~~~~~~~~~~~~~&lt;br /&gt;
#Directory where external input files are:&lt;br /&gt;
datadir=/path/to/datadir&lt;br /&gt;
&lt;br /&gt;
#Run with or without tracer transport ?&lt;br /&gt;
tracer=.true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
## Dust scenario. Used to prescribe the dust&lt;br /&gt;
## ~~~~~~~~~~~~~&lt;br /&gt;
#  =1 Dust opt.deph read in startfi; =2 Viking scenario; =3 MGS scenario [default],&lt;br /&gt;
#  =4 Mars Year 24 from TES assimilation (old version of MY24; dust_tes.nc file)&lt;br /&gt;
#  =6 &amp;quot;cold&amp;quot; (low dust) scenario ; =7 &amp;quot;warm&amp;quot; (high dust) scenario&lt;br /&gt;
#  =8 &amp;quot;climatology&amp;quot; (our best guess of a typical Mars year) scenario&lt;br /&gt;
#  =24 Mars Year 24 from TES assimilation (ie: MCD reference case)&lt;br /&gt;
#  =25 Mars Year 25 from TES assimilation (ie: a year with a global dust storm)&lt;br /&gt;
#  =26 Mars Year 26 from TES assimilation&lt;br /&gt;
#  ...&lt;br /&gt;
#  =35 Mars Year 35 from observers assimilation&lt;br /&gt;
iaervar = 8&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# Dust IR opacity ref. wavelength (for dso diagnostics only)&lt;br /&gt;
# &amp;quot;tes&amp;quot; (9.3 microns) [default] or &amp;quot;mcs&amp;quot; (21.6 microns)&lt;br /&gt;
dustiropacity = tes&lt;br /&gt;
# Use an IR to VIS scenario conversion coefficient that is&lt;br /&gt;
# dependent on the GCM dust effective radius,&lt;br /&gt;
# instead of a fixed 2.6 coefficient ?&lt;br /&gt;
#(only if dustiropacity = tes ; default = .false.)&lt;br /&gt;
reff_driven_IRtoVIS_scenario = .true.&lt;br /&gt;
&lt;br /&gt;
## Physical Parameterizations :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# call radiative transfer ? (default=.true.)&lt;br /&gt;
callrad   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
## Radiative transfer options :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# SCATTERERS: set number of scatterers.&lt;br /&gt;
# Must be compliant with other options: +1 if active, +1 if rdstorm, +1 if topflows, +1 if activice ; default=1)&lt;br /&gt;
naerkind = 4&lt;br /&gt;
&lt;br /&gt;
## Tracer (dust water, ice and/or chemical species) options (used if tracer=T):&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# DUST: Transported dust ? (if &amp;gt;0, use 'dustbin' dust bins ; default=0)&lt;br /&gt;
dustbin    = 2&lt;br /&gt;
# DUST: Radiatively active dust ? (matters if dustbin&amp;gt;0 ; default=.false.)&lt;br /&gt;
active  = .true.&lt;br /&gt;
# DUST: use mass and number mixing ratios to predict dust size ? (default=.false.)&lt;br /&gt;
doubleq   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: lifted by GCM surface winds ? (default=.false.)&lt;br /&gt;
lifting = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: Scavenging by H2O snowfall ? (default=.false.)&lt;br /&gt;
scavenging = .true.&lt;br /&gt;
&lt;br /&gt;
# DUST: freedust ? (default=.false.)&lt;br /&gt;
freedust=.true.&lt;br /&gt;
# DUST: dustscaling_mode?&lt;br /&gt;
#     =0 --&amp;gt; freedust, tauscaling=1&lt;br /&gt;
#     =1 --&amp;gt; GCM5.3-like, tauscaling&lt;br /&gt;
#     =2 --&amp;gt; tauscaling=1,dust_rad_adjust&lt;br /&gt;
dustscaling_mode=2&lt;br /&gt;
# DUST: dust injection scheme (if &amp;gt;0, use 'dustinjection' ; default=0)&lt;br /&gt;
dustinjection=1&lt;br /&gt;
# DUST: dust injection scheme coefficient (default=0.25)&lt;br /&gt;
coeff_injection=0.25&lt;br /&gt;
# DUST: dust injection scheme initial local time (default=0.)&lt;br /&gt;
ti_injection=0.&lt;br /&gt;
# DUST: dust injection scheme final local time (default=24.)&lt;br /&gt;
tf_injection=24.&lt;br /&gt;
# DUST: Rocket Dust Storm scheme (default=.false.)&lt;br /&gt;
rdstorm=.true.&lt;br /&gt;
# DUST: RDS detrainment coefficient (default=0.02)&lt;br /&gt;
coeff_detrainment=0.02&lt;br /&gt;
# DUST: Dust entrainment by subgrid-scale slope winds (default=.false.)&lt;br /&gt;
topflows=.true.&lt;br /&gt;
&lt;br /&gt;
# DUST/WATERICE: Scavenging by CO2 condensation? (default=.false.)&lt;br /&gt;
scavco2cond = .true.&lt;br /&gt;
# DUST/WATERICE: Gravitationnal sedimentation ? (default=.true.)&lt;br /&gt;
sedimentation = .true.&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note''' that the PCM6 dust cycle has mainly been tested with the non-dust-related flags and parameters that are featured in ''callphys.def.GCM6'' and ''callphys.def.MCD6'' (cf https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/), and in general with the ''*.def'' files (''run.def'', ''traceur.def'', ''z2sig.def'') that are suffixed with ''.GCM6'' or ''.MCD6''. If you depart from these files, even for non-dust related processes, we do not ensure the good tuning of the dust cycle, nor to a lesser extent the good compilation/execution of the model. If this happens, please reach out to us !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Level 2 (developper) : Parametrizations and tunable parameters ==&lt;br /&gt;
The technical document that sums up the features of the dust cycle in the PCM6, referred to as TN2022_ESA below, can be found here : https://www-mars.lmd.jussieu.fr/esa/contract2020_2022/deliverables/MS3/D2.1_dust_cycle.pdf&lt;br /&gt;
&lt;br /&gt;
For more insights into the development and tuning of all the parametrizations related to the PCM6 Dust Cycle, please find below the reference technical documents :&lt;br /&gt;
* TN2019_ESA : https://www-mars.lmd.jussieu.fr/WP2018/LMD_gcm_report_part1_dust.pdf&lt;br /&gt;
* TN2019_CNES : https://www-mars.lmd.jussieu.fr/cnes/2019/LMD_CNES_EXM_gcm6.0.pdf&lt;br /&gt;
* TN2020_CNES : https://www-mars.lmd.jussieu.fr/cnes/2020/note_technique_GCM_dust.pdf&lt;br /&gt;
* TN2021_CNES : https://www-mars.lmd.jussieu.fr/cnes/2021/note_technique_dust_cycle2021.pdf&lt;br /&gt;
* TN2022_ESA : https://www-mars.lmd.jussieu.fr/esa/contract2020_2022/deliverables/MS3/D2.1_dust_cycle.pdf ; ''Erratum : in section 2 of this document, it is said that &amp;quot;Corrected values for [ the assumptions done on the tuple ($$r_{eff}$$,$$Q_{ext}$$) ] which were a bit erroneous, lead to a typical opacity of 6 instead of 10 for the dust storm we simulate in the model using $$q_{storm,ref}$$ = $$5 × 10^{−4}$$kg/kg&amp;quot; (&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;mmr_ref&amp;lt;/span&amp;gt;). These &amp;quot;corrected&amp;quot; values were actually wrong. If we consider $$r_{eff}$$=2µm like in [https://doi.org/10.1002/2017JE005255 Wang et al. (2018)] or TN2019_ESA, using a mmr_ref of 5e-4kg/kg leads to an opacity of 10.5. If we use $$r_{eff}$$=3µm like the default &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;reff_lift&amp;lt;/span&amp;gt;, this leads to an opacity of 6.6.''&lt;br /&gt;
&lt;br /&gt;
The table below sums up all the parameters related to PCM6 Dust Cycle, a short description, their default value in PCM6, a reasonable range that can explored for tuning, where to find/modify them in the code, and references addressing their tuning in the PCM or their explorable range according to our current knowledge of Mars climate.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto&amp;quot;&lt;br /&gt;
! Process !! Parameter !! Description !! Default value !! Reasonable range for tuning !! In the code&lt;br /&gt;
(D: declaration ; A: assignment ; U: use)&lt;br /&gt;
! References&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;7&amp;quot;|Injection &lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U) || TN2019_CNES, TN2020_CNES, TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''ti_injection'''&amp;lt;/span&amp;gt; || Beginning local time for injection window [h] || style=&amp;quot;text-align:center;&amp;quot;| 0 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 18 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U) ; ''vdifc_mod.F'' (U) || TN2019_ESA, TN2019_CNES, TN2020_CNES, TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''tf_injection'''&amp;lt;/span&amp;gt; || Ending local time for injection window [h] || style=&amp;quot;text-align:center;&amp;quot;| 24 || style=&amp;quot;text-align:center;&amp;quot;| 6 - 24 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U) ; ''vdifc_mod.F'' (U) || TN2019_ESA, TN2019_CNES, TN2020_CNES, TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''reff_lift'''&amp;lt;/span&amp;gt; || Effective radius of injected dust [m] || style=&amp;quot;text-align:center;&amp;quot;| 3e-6 || style=&amp;quot;text-align:center;&amp;quot;| 1e-6 - 5e-6 || ''initracer.F'' (D,A,U) ; impacts ''vdifc_mod.F''  || TN2021_CNES&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''reff_storm'''&amp;lt;/span&amp;gt; || Effective radius of injected dust when &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;rdstorm&amp;lt;/span&amp;gt;=.true. [m] || style=&amp;quot;text-align:center;&amp;quot;| 3e-6 || style=&amp;quot;text-align:center;&amp;quot;| (should be equal to reff_lift) || ''initracer.F'' (D,A,U) ; impacts ''vdifc_mod.F'' || TN2021_CNES&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''nueff_lift'''&amp;lt;/span&amp;gt; || Effective variance of injected dust [no unit] ; is also the variance in the atmosphere &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;nueffdust&amp;lt;/span&amp;gt; || style=&amp;quot;text-align:center;&amp;quot;| 0.5 || style=&amp;quot;text-align:center;&amp;quot;| 0.2 - 0.6 || ''initracer.F'' (D,A,U) ; impacts ''aeroptproperties.F'', ''callsedim_mod.F'' || [https://doi.org/10.1029/2006JE002786 Wolff et al. (2006)], [https://doi.org/10.1029/2020JE006419 Luginin et al. (2020)]&lt;br /&gt;
|-&lt;br /&gt;
|| $$Q_{ext}$$ for &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''alpha_lift(igcm_[dust&amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt;stormdust]_mass)'''&amp;lt;/span&amp;gt; || Extinction coefficient in the visible [no unit] used for the lifted mass coefficient ; should depend on &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;reff_[lift&amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt;storm]&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;nueff_lift&amp;lt;/span&amp;gt; || style=&amp;quot;text-align:center;&amp;quot;| 2.4  (hard-coded, no variable) || style=&amp;quot;text-align:center;&amp;quot;| (for $$\nu _{eff}$$=0.5)&lt;br /&gt;
$$r_{eff}$$=3µm -&amp;gt; $$Q_{ext}$$=2.46 ;&lt;br /&gt;
$$r_{eff}$$=2.5µm -&amp;gt; $$Q_{ext}$$=2.5 ;&lt;br /&gt;
$$r_{eff}$$=2µm -&amp;gt; $$Q_{ext}$$=2.6 ;&lt;br /&gt;
$$r_{eff}$$=1µm -&amp;gt; $$Q_{ext}$$=2.85 ;&lt;br /&gt;
|| ''initracer.F'' (A,U) ; impacts ''vdifc_mod.F''&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;|Rocket dust storm&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''mmr_ref'''&amp;lt;/span&amp;gt; || Reference mass mixing ratio [kg/kg] for the rocket dust storm sub-mesh fraction || style=&amp;quot;text-align:center;&amp;quot;| 5e-4 || style=&amp;quot;text-align:center;&amp;quot;| 2.5e-4 - 7.5e-4 || ''calcstormfract_mod.F90'' (D,A,U) ; impacts ''rocketduststorm_mod.F90'', ''callradite_mod.F90'' || TN2019_ESA, [https://doi.org/10.1002/2017JE005255 Wang et al. (2018)], TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''fracmin'''&amp;lt;/span&amp;gt; ; &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''fracmax'''&amp;lt;/span&amp;gt; || Bounds for the rocket dust storm sub-mesh fraction [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.01 ; 0.6 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''calcstormfract_mod.F90'' (D,A,U) ; impacts ''rocketduststorm_mod.F90'', ''callradite_mod.F90'' || TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_detrainment'''&amp;lt;/span&amp;gt; || Detrainment coefficient $$C_{det}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.02 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1'''*''' || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''rocketduststorm_mod.F90'' (U) || TN2019_CNES, TN2020_CNES, TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;|Mountain top flows&lt;br /&gt;
|| $$C_{mons}$$ for &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''alpha_hmons'''&amp;lt;/span&amp;gt; || Dampening coefficient $$C_{mons}$$ [no unit] for the mountain top flows sub-mesh fraction || style=&amp;quot;text-align:center;&amp;quot;| 0.5 (hard-coded, no variable) || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''topmons_mod.F90'' (A,U) || TN2020_CNES, TN2021_CNES, TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''k0'''&amp;lt;/span&amp;gt; ; &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''k1'''&amp;lt;/span&amp;gt; ; &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''k2'''&amp;lt;/span&amp;gt; || Coefficients [m/s ; m$$^{-1}$$ ; no unit] for the slope winds vertical velocity || style=&amp;quot;text-align:center;&amp;quot;| 0.25 ; 5e-4 ; 5e-3  (wmax = 3m/s) || style=&amp;quot;text-align:center;&amp;quot;| 1. ; 5e-4 ; 30e-3  (wmax = 10m/s) || ''topmons_mod.F90'' (D,A,U) || TN2019_CNES&lt;br /&gt;
|-&lt;br /&gt;
|| $$C_{detr}$$ for &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coefdetrain'''&amp;lt;/span&amp;gt; || Dampening coefficient $$C_{detr}$$ [no unit] for the mountain top flows detrainment || style=&amp;quot;text-align:center;&amp;quot;| 1. (hard-coded, no variable) || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''topmons_mod.F90'' (A,U) || TN2019_CNES&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;1&amp;quot;|Sedimentation&lt;br /&gt;
|| $$\beta$$ in call of newsedim for dust, stormdust and topdust || Particle shape correction factor for the Stokes-Cunningham sedimentation velocity [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.5 (hard-coded, no variable) || style=&amp;quot;text-align:center;&amp;quot;| 0.5 - 1&lt;br /&gt;
(disk -&amp;gt; irregular -&amp;gt; sphere)&lt;br /&gt;
|| ''callsedim_mod.F90'' (A,U) || [https://doi.org/10.1029/JB095iB09p14629 Murphy et al. (1990)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''''*'''Note on the rocket dust storm detrainment : The rocket dust storm detrainment, currently tuned with the coefficient &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;coeff_detrainment&amp;lt;/span&amp;gt;, should actually be revisited to match the one that is done for mountain top flows. (ticket [ #XXX])''&lt;br /&gt;
&lt;br /&gt;
== What's going on for rocket dust storms and injection : a detailed example through the physics parametrizations ==&lt;br /&gt;
We detail below the successive steps and processes performed concerning the coupling between the rocket dust storms and the dust injection. We place ourselves in one column of the model, which will serve as an example. The Fortran subroutines that are involved at each step are referred as '''''subroutine'''''.&lt;br /&gt;
&lt;br /&gt;
0. as we reach 2pm in this column, we read and interpolate the value of the optical depth scenario for the next day ('''''compute_dtau'''''). Let's say the scenario features an opacity of 5 (big dusty event), while the current day's GCM column has an opacity of 1 (which has been computed before, in '''''aeropacity''''')&lt;br /&gt;
&lt;br /&gt;
1. ('''''compute_dtau''''') we calculate the optical depth difference dtau=5-1=4, then what this means in terms of dust mass to be added to the atmosphere, assuming an effective size reff_lift = 3µm by default (defined in '''''initracer'''''). We dampen this quantity of dust by a coefficient Cinj (=0.25 by default) to take into account that the jump in tau_pref_scenario from the current day to the next may not come from local injection but from transport from adjacent meshes. For the values considered in this example, this gives an injection of ~5e-8 kg/m²/s.&lt;br /&gt;
&lt;br /&gt;
2. all this dust is injected uniformly during the injection window, by default between 2 p.m. this day and 2 p.m. the next day (when we are supposed to reach the scenario target), in the form of stormdust into the 1st layer by '''''vdifc''''', which already mixes it a little on several layers. Then this stormdust undergoes processes like thermals ('''''calltherm_interface'''''), convective adjustment ('''''convadj''''') and sedimentation ('''''callsedim''''') that further mix it in the atmosphere. For the latter, stormdust is prevented from falling to the ground, and remains in the 1st layer instead. We need to do so, because the main process responsible for the stormdust rising, represented by the routine '''''rocketduststorm''''', only happens at the beginning of the next timestep (see point 5).&lt;br /&gt;
&lt;br /&gt;
3. the stormdust is further mixed by the dynamics, and may also be transported to adjacent meshes. The column may also receive stormdust from other meshes.&lt;br /&gt;
&lt;br /&gt;
4. once back to the next physical time step, we calculate a sub-mesh fraction that is representative of the size of the stormdust plume ('''''calcstormfract'''''). To do so, we use the maximum mass mixing ratio of stormdust in the entire column (apart from the 1st layer), and compute the sub-mesh fraction that is needed to reach a reference mixing ratio mmr_ref=5e-4kg/kg. This reference mmr is a value that we consider representative of an opacity of 10 that was measured in a local dust storm by OMEGA, given some assumptions like a vertical extent of $$\Delta P$$=200Pa for the dust plume (''see also Wang et al. 2018, JGRPlanets, doi:10.1002/2017JE005255'').&lt;br /&gt;
&lt;br /&gt;
5. finally, we enter the '''''rocketduststorm''''' routine, where we check whether anywhere in the column, the mmr of stormdust (not concentrated in the sub-mesh fraction, but expanded to the whole mesh) is greater than $$10^{-4}$$ times that of background dust. If so, we activate the scheme in the column, and calculate the heating difference between the sub-mesh fraction (where we have concentrated stormdust, and background dust) and the rest of the mesh (only background dust), the resulting vertical transport in the sub-mesh fraction, and the horizontal detrainment where the stormdust plume vertical velocity decreases. If there is not enough stormdust compared to background dust at any level, the stormdust is detrained into background dust at all levels of the column.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Mars-Model]]&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1812</id>
		<title>Dust Cycle in Mars PCM6</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1812"/>
				<updated>2024-01-05T22:00:24Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: /* Level 2 (developper) : Parametrizations and tunable parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details at different levels how to use and what is featured in the dust cycle in Mars PCM6. '''This is still work in progress for now !'''&lt;br /&gt;
&lt;br /&gt;
== Level 1 (user) : Flags for PCM6 dust cycle ==&lt;br /&gt;
To run a simulation with the PCM6 dust cycle, you need to set up several flags and parameters in your ''callphys.def'' (see an example here: https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/callphys.def.GCM6)&lt;br /&gt;
&lt;br /&gt;
We list below all the relevant flags and parameters directly related to PCM6 dust cycle :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line&amp;gt;&lt;br /&gt;
##General options&lt;br /&gt;
##~~~~~~~~~~~~~~~&lt;br /&gt;
#Directory where external input files are:&lt;br /&gt;
datadir=/path/to/datadir&lt;br /&gt;
&lt;br /&gt;
#Run with or without tracer transport ?&lt;br /&gt;
tracer=.true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
## Dust scenario. Used to prescribe the dust&lt;br /&gt;
## ~~~~~~~~~~~~~&lt;br /&gt;
#  =1 Dust opt.deph read in startfi; =2 Viking scenario; =3 MGS scenario [default],&lt;br /&gt;
#  =4 Mars Year 24 from TES assimilation (old version of MY24; dust_tes.nc file)&lt;br /&gt;
#  =6 &amp;quot;cold&amp;quot; (low dust) scenario ; =7 &amp;quot;warm&amp;quot; (high dust) scenario&lt;br /&gt;
#  =8 &amp;quot;climatology&amp;quot; (our best guess of a typical Mars year) scenario&lt;br /&gt;
#  =24 Mars Year 24 from TES assimilation (ie: MCD reference case)&lt;br /&gt;
#  =25 Mars Year 25 from TES assimilation (ie: a year with a global dust storm)&lt;br /&gt;
#  =26 Mars Year 26 from TES assimilation&lt;br /&gt;
#  ...&lt;br /&gt;
#  =35 Mars Year 35 from observers assimilation&lt;br /&gt;
iaervar = 8&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# Dust IR opacity ref. wavelength (for dso diagnostics only)&lt;br /&gt;
# &amp;quot;tes&amp;quot; (9.3 microns) [default] or &amp;quot;mcs&amp;quot; (21.6 microns)&lt;br /&gt;
dustiropacity = tes&lt;br /&gt;
# Use an IR to VIS scenario conversion coefficient that is&lt;br /&gt;
# dependent on the GCM dust effective radius,&lt;br /&gt;
# instead of a fixed 2.6 coefficient ?&lt;br /&gt;
#(only if dustiropacity = tes ; default = .false.)&lt;br /&gt;
reff_driven_IRtoVIS_scenario = .true.&lt;br /&gt;
&lt;br /&gt;
## Physical Parameterizations :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# call radiative transfer ? (default=.true.)&lt;br /&gt;
callrad   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
## Radiative transfer options :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# SCATTERERS: set number of scatterers.&lt;br /&gt;
# Must be compliant with other options: +1 if active, +1 if rdstorm, +1 if topflows, +1 if activice ; default=1)&lt;br /&gt;
naerkind = 4&lt;br /&gt;
&lt;br /&gt;
## Tracer (dust water, ice and/or chemical species) options (used if tracer=T):&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# DUST: Transported dust ? (if &amp;gt;0, use 'dustbin' dust bins ; default=0)&lt;br /&gt;
dustbin    = 2&lt;br /&gt;
# DUST: Radiatively active dust ? (matters if dustbin&amp;gt;0 ; default=.false.)&lt;br /&gt;
active  = .true.&lt;br /&gt;
# DUST: use mass and number mixing ratios to predict dust size ? (default=.false.)&lt;br /&gt;
doubleq   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: lifted by GCM surface winds ? (default=.false.)&lt;br /&gt;
lifting = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: Scavenging by H2O snowfall ? (default=.false.)&lt;br /&gt;
scavenging = .true.&lt;br /&gt;
&lt;br /&gt;
# DUST: freedust ? (default=.false.)&lt;br /&gt;
freedust=.true.&lt;br /&gt;
# DUST: dustscaling_mode?&lt;br /&gt;
#     =0 --&amp;gt; freedust, tauscaling=1&lt;br /&gt;
#     =1 --&amp;gt; GCM5.3-like, tauscaling&lt;br /&gt;
#     =2 --&amp;gt; tauscaling=1,dust_rad_adjust&lt;br /&gt;
dustscaling_mode=2&lt;br /&gt;
# DUST: dust injection scheme (if &amp;gt;0, use 'dustinjection' ; default=0)&lt;br /&gt;
dustinjection=1&lt;br /&gt;
# DUST: dust injection scheme coefficient (default=0.25)&lt;br /&gt;
coeff_injection=0.25&lt;br /&gt;
# DUST: dust injection scheme initial local time (default=0.)&lt;br /&gt;
ti_injection=0.&lt;br /&gt;
# DUST: dust injection scheme final local time (default=24.)&lt;br /&gt;
tf_injection=24.&lt;br /&gt;
# DUST: Rocket Dust Storm scheme (default=.false.)&lt;br /&gt;
rdstorm=.true.&lt;br /&gt;
# DUST: RDS detrainment coefficient (default=0.02)&lt;br /&gt;
coeff_detrainment=0.02&lt;br /&gt;
# DUST: Dust entrainment by subgrid-scale slope winds (default=.false.)&lt;br /&gt;
topflows=.true.&lt;br /&gt;
&lt;br /&gt;
# DUST/WATERICE: Scavenging by CO2 condensation? (default=.false.)&lt;br /&gt;
scavco2cond = .true.&lt;br /&gt;
# DUST/WATERICE: Gravitationnal sedimentation ? (default=.true.)&lt;br /&gt;
sedimentation = .true.&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note''' that the PCM6 dust cycle has mainly been tested with the non-dust-related flags and parameters that are featured in ''callphys.def.GCM6'' and ''callphys.def.MCD6'' (cf https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/), and in general with the ''*.def'' files (''run.def'', ''traceur.def'', ''z2sig.def'') that are suffixed with ''.GCM6'' or ''.MCD6''. If you depart from these files, even for non-dust related processes, we do not ensure the good tuning of the dust cycle, nor to a lesser extent the good compilation/execution of the model. If this happens, please reach out to us !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Level 2 (developper) : Parametrizations and tunable parameters ==&lt;br /&gt;
The technical document that sums up the features of the dust cycle in the PCM6, referred to as TN2022_ESA below, can be found here : https://www-mars.lmd.jussieu.fr/esa/contract2020_2022/deliverables/MS3/D2.1_dust_cycle.pdf&lt;br /&gt;
&lt;br /&gt;
For more insights into the development and tuning of all the parametrizations related to the PCM6 Dust Cycle, please find below the reference technical documents :&lt;br /&gt;
* TN2019_ESA : https://www-mars.lmd.jussieu.fr/WP2018/LMD_gcm_report_part1_dust.pdf&lt;br /&gt;
* TN2019_CNES : https://www-mars.lmd.jussieu.fr/cnes/2019/LMD_CNES_EXM_gcm6.0.pdf&lt;br /&gt;
* TN2020_CNES : https://www-mars.lmd.jussieu.fr/cnes/2020/note_technique_GCM_dust.pdf&lt;br /&gt;
* TN2021_CNES : https://www-mars.lmd.jussieu.fr/cnes/2021/note_technique_dust_cycle2021.pdf&lt;br /&gt;
* TN2022_ESA : https://www-mars.lmd.jussieu.fr/esa/contract2020_2022/deliverables/MS3/D2.1_dust_cycle.pdf ; ''Erratum : in section 2 of this document, it is said that &amp;quot;Corrected values for [ the assumptions done on the tuple ($$r_{eff}$$,$$Q_{ext}$$) ] which were a bit erroneous, lead to a typical opacity of 6 instead of 10 for the dust storm we simulate in the model using $$q_{storm,ref}$$ = $$5 × 10^{−4}$$kg/kg&amp;quot; (&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;mmr_ref&amp;lt;/span&amp;gt;). These &amp;quot;corrected&amp;quot; values were actually wrong. If we consider $$r_{eff}$$=2µm like in [https://doi.org/10.1002/2017JE005255 Wang et al. (2018)] or TN2019_ESA, using a mmr_ref of 5e-4kg/kg leads to an opacity of 10.5. If we use $$r_{eff}$$=3µm like the default &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;reff_lift&amp;lt;/span&amp;gt;, this leads to an opacity of 6.6.''&lt;br /&gt;
&lt;br /&gt;
The table below sums up all the parameters related to PCM6 Dust Cycle, a short description, their default value in PCM6, a reasonable range that can explored for tuning, where to find/modify them in the code, and references addressing their tuning in the PCM or their explorable range according to our current knowledge of Mars climate.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto&amp;quot;&lt;br /&gt;
! Process !! Parameter !! Description !! Default value !! Reasonable range for tuning !! In the code&lt;br /&gt;
(D: declaration ; A: assignment ; U: use)&lt;br /&gt;
! References&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;7&amp;quot;|Injection &lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U) || TN2019_CNES, TN2020_CNES, TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''ti_injection'''&amp;lt;/span&amp;gt; || Beginning local time for injection window [h] || style=&amp;quot;text-align:center;&amp;quot;| 0 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 18 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U) ; ''vdifc_mod.F'' (U) || TN2019_ESA, TN2019_CNES, TN2020_CNES, TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''tf_injection'''&amp;lt;/span&amp;gt; || Ending local time for injection window [h] || style=&amp;quot;text-align:center;&amp;quot;| 24 || style=&amp;quot;text-align:center;&amp;quot;| 6 - 24 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U) ; ''vdifc_mod.F'' (U) || TN2019_ESA, TN2019_CNES, TN2020_CNES, TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''reff_lift'''&amp;lt;/span&amp;gt; || Effective radius of injected dust [m] || style=&amp;quot;text-align:center;&amp;quot;| 3e-6 || style=&amp;quot;text-align:center;&amp;quot;| 1e-6 - 5e-6 || ''initracer.F'' (D,A,U) ; impacts ''vdifc_mod.F''  || TN2021_CNES&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''reff_storm'''&amp;lt;/span&amp;gt; || Effective radius of injected dust when &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;rdstorm&amp;lt;/span&amp;gt;=.true. [m] || style=&amp;quot;text-align:center;&amp;quot;| 3e-6 || style=&amp;quot;text-align:center;&amp;quot;| (should be equal to reff_lift) || ''initracer.F'' (D,A,U) ; impacts ''vdifc_mod.F'' || TN2021_CNES&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''nueff_lift'''&amp;lt;/span&amp;gt; || Effective variance of injected dust [no unit] ; is also the variance in the atmosphere &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;nueffdust&amp;lt;/span&amp;gt; || style=&amp;quot;text-align:center;&amp;quot;| 0.5 || style=&amp;quot;text-align:center;&amp;quot;| 0.2 - 0.6 || ''initracer.F'' (D,A,U) ; impacts ''aeroptproperties.F'', ''callsedim_mod.F'' || [https://doi.org/10.1029/2006JE002786 Wolff et al. (2006)], [https://doi.org/10.1029/2020JE006419 Luginin et al. (2020)]&lt;br /&gt;
|-&lt;br /&gt;
|| $$Q_{ext}$$ for &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''alpha_lift(igcm_[dust&amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt;stormdust]_mass)'''&amp;lt;/span&amp;gt; || Extinction coefficient [no unit] used for the lifted mass coefficient ; should depend on &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;reff_[lift&amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt;storm]&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;nueff_lift&amp;lt;/span&amp;gt; || style=&amp;quot;text-align:center;&amp;quot;| 2.4  (hard-coded, no variable) || style=&amp;quot;text-align:center;&amp;quot;| (for $$\nu _{eff}$$=0.5)&lt;br /&gt;
$$r_{eff}$$=3µm -&amp;gt; $$Q_{ext}$$=2.46 ;&lt;br /&gt;
$$r_{eff}$$=2.5µm -&amp;gt; $$Q_{ext}$$=2.5 ;&lt;br /&gt;
$$r_{eff}$$=2µm -&amp;gt; $$Q_{ext}$$=2.6&lt;br /&gt;
|| ''initracer.F'' (A,U) ; impacts ''vdifc_mod.F''&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;|Rocket dust storm&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''mmr_ref'''&amp;lt;/span&amp;gt; || Reference mass mixing ratio [kg/kg] for the rocket dust storm sub-mesh fraction || style=&amp;quot;text-align:center;&amp;quot;| 5e-4 || style=&amp;quot;text-align:center;&amp;quot;| 2.5e-4 - 7.5e-4 || ''calcstormfract_mod.F90'' (D,A,U) ; impacts ''rocketduststorm_mod.F90'', ''callradite_mod.F90'' || TN2019_ESA, [https://doi.org/10.1002/2017JE005255 Wang et al. (2018)], TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''fracmin'''&amp;lt;/span&amp;gt; ; &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''fracmax'''&amp;lt;/span&amp;gt; || Bounds for the rocket dust storm sub-mesh fraction [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.01 ; 0.6 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''calcstormfract_mod.F90'' (D,A,U) ; impacts ''rocketduststorm_mod.F90'', ''callradite_mod.F90'' || TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_detrainment'''&amp;lt;/span&amp;gt; || Detrainment coefficient $$C_{det}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.02 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 ; ''see the note on detrainment below'' || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''rocketduststorm_mod.F90'' (U) || TN2019_CNES, TN2020_CNES, TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;|Mountain top flows&lt;br /&gt;
|| $$C_{mons}$$ for &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''alpha_hmons'''&amp;lt;/span&amp;gt; || Dampening coefficient $$C_{mons}$$ [no unit] for the mountain top flows sub-mesh fraction || style=&amp;quot;text-align:center;&amp;quot;| 0.5 (hard-coded, no variable) || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''topmons_mod.F90'' (A,U) || TN2020_CNES, TN2021_CNES, TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''k0'''&amp;lt;/span&amp;gt; ; &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''k1'''&amp;lt;/span&amp;gt; ; &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''k2'''&amp;lt;/span&amp;gt; || Coefficients [m/s ; m$$^{-1}$$ ; no unit] for the slope winds vertical velocity || style=&amp;quot;text-align:center;&amp;quot;| 0.25 ; 5e-4 ; 5e-3  (wmax = 3m/s) || style=&amp;quot;text-align:center;&amp;quot;| 1. ; 5e-4 ; 30e-3  (wmax = 10m/s) || ''topmons_mod.F90'' (D,A,U) || TN2019_CNES&lt;br /&gt;
|-&lt;br /&gt;
|| $$C_{detr}$$ for &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coefdetrain'''&amp;lt;/span&amp;gt; || Dampening coefficient $$C_{detr}$$ [no unit] for the mountain top flows detrainment || style=&amp;quot;text-align:center;&amp;quot;| 1. (hard-coded, no variable) || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''topmons_mod.F90'' (A,U) || TN2019_CNES&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;1&amp;quot;|Sedimentation&lt;br /&gt;
|| $$\beta$$ in call of newsedim for dust, stormdust and topdust || Particle shape correction factor for the Stokes-Cunningham sedimentation velocity [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.5 (hard-coded, no variable) || style=&amp;quot;text-align:center;&amp;quot;| 0.5 - 1&lt;br /&gt;
(disk -&amp;gt; irregular -&amp;gt; sphere)&lt;br /&gt;
|| ''callsedim_mod.F90'' (A,U) || [https://doi.org/10.1029/JB095iB09p14629 Murphy et al. (1990)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note on the rocket dust storm detrainment :&lt;br /&gt;
&lt;br /&gt;
== What's going on for rocket dust storms and injection : a detailed example through the physics parametrizations ==&lt;br /&gt;
We detail below the successive steps and processes performed concerning the coupling between the rocket dust storms and the dust injection. We place ourselves in one column of the model, which will serve as an example. The Fortran subroutines that are involved at each step are referred as '''''subroutine'''''.&lt;br /&gt;
&lt;br /&gt;
0. as we reach 2pm in this column, we read and interpolate the value of the optical depth scenario for the next day ('''''compute_dtau'''''). Let's say the scenario features an opacity of 5 (big dusty event), while the current day's GCM column has an opacity of 1 (which has been computed before, in '''''aeropacity''''')&lt;br /&gt;
&lt;br /&gt;
1. ('''''compute_dtau''''') we calculate the optical depth difference dtau=5-1=4, then what this means in terms of dust mass to be added to the atmosphere, assuming an effective size reff_lift = 3µm by default (defined in '''''initracer'''''). We dampen this quantity of dust by a coefficient Cinj (=0.25 by default) to take into account that the jump in tau_pref_scenario from the current day to the next may not come from local injection but from transport from adjacent meshes. For the values considered in this example, this gives an injection of ~5e-8 kg/m²/s.&lt;br /&gt;
&lt;br /&gt;
2. all this dust is injected uniformly during the injection window, by default between 2 p.m. this day and 2 p.m. the next day (when we are supposed to reach the scenario target), in the form of stormdust into the 1st layer by '''''vdifc''''', which already mixes it a little on several layers. Then this stormdust undergoes processes like thermals ('''''calltherm_interface'''''), convective adjustment ('''''convadj''''') and sedimentation ('''''callsedim''''') that further mix it in the atmosphere. For the latter, stormdust is prevented from falling to the ground, and remains in the 1st layer instead. We need to do so, because the main process responsible for the stormdust rising, represented by the routine '''''rocketduststorm''''', only happens at the beginning of the next timestep (see point 5).&lt;br /&gt;
&lt;br /&gt;
3. the stormdust is further mixed by the dynamics, and may also be transported to adjacent meshes. The column may also receive stormdust from other meshes.&lt;br /&gt;
&lt;br /&gt;
4. once back to the next physical time step, we calculate a sub-mesh fraction that is representative of the size of the stormdust plume ('''''calcstormfract'''''). To do so, we use the maximum mass mixing ratio of stormdust in the entire column (apart from the 1st layer), and compute the sub-mesh fraction that is needed to reach a reference mixing ratio mmr_ref=5e-4kg/kg. This reference mmr is a value that we consider representative of an opacity of 10 that was measured in a local dust storm by OMEGA, given some assumptions like a vertical extent of $$\Delta P$$=200Pa for the dust plume (''see also Wang et al. 2018, JGRPlanets, doi:10.1002/2017JE005255'').&lt;br /&gt;
&lt;br /&gt;
5. finally, we enter the '''''rocketduststorm''''' routine, where we check whether anywhere in the column, the mmr of stormdust (not concentrated in the sub-mesh fraction, but expanded to the whole mesh) is greater than $$10^{-4}$$ times that of background dust. If so, we activate the scheme in the column, and calculate the heating difference between the sub-mesh fraction (where we have concentrated stormdust, and background dust) and the rest of the mesh (only background dust), the resulting vertical transport in the sub-mesh fraction, and the horizontal detrainment where the stormdust plume vertical velocity decreases. If there is not enough stormdust compared to background dust at any level, the stormdust is detrained into background dust at all levels of the column.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Mars-Model]]&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1811</id>
		<title>Dust Cycle in Mars PCM6</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1811"/>
				<updated>2024-01-05T21:52:51Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: /* Level 2 (developper) : Parametrizations and tunable parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details at different levels how to use and what is featured in the dust cycle in Mars PCM6. '''This is still work in progress for now !'''&lt;br /&gt;
&lt;br /&gt;
== Level 1 (user) : Flags for PCM6 dust cycle ==&lt;br /&gt;
To run a simulation with the PCM6 dust cycle, you need to set up several flags and parameters in your ''callphys.def'' (see an example here: https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/callphys.def.GCM6)&lt;br /&gt;
&lt;br /&gt;
We list below all the relevant flags and parameters directly related to PCM6 dust cycle :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line&amp;gt;&lt;br /&gt;
##General options&lt;br /&gt;
##~~~~~~~~~~~~~~~&lt;br /&gt;
#Directory where external input files are:&lt;br /&gt;
datadir=/path/to/datadir&lt;br /&gt;
&lt;br /&gt;
#Run with or without tracer transport ?&lt;br /&gt;
tracer=.true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
## Dust scenario. Used to prescribe the dust&lt;br /&gt;
## ~~~~~~~~~~~~~&lt;br /&gt;
#  =1 Dust opt.deph read in startfi; =2 Viking scenario; =3 MGS scenario [default],&lt;br /&gt;
#  =4 Mars Year 24 from TES assimilation (old version of MY24; dust_tes.nc file)&lt;br /&gt;
#  =6 &amp;quot;cold&amp;quot; (low dust) scenario ; =7 &amp;quot;warm&amp;quot; (high dust) scenario&lt;br /&gt;
#  =8 &amp;quot;climatology&amp;quot; (our best guess of a typical Mars year) scenario&lt;br /&gt;
#  =24 Mars Year 24 from TES assimilation (ie: MCD reference case)&lt;br /&gt;
#  =25 Mars Year 25 from TES assimilation (ie: a year with a global dust storm)&lt;br /&gt;
#  =26 Mars Year 26 from TES assimilation&lt;br /&gt;
#  ...&lt;br /&gt;
#  =35 Mars Year 35 from observers assimilation&lt;br /&gt;
iaervar = 8&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# Dust IR opacity ref. wavelength (for dso diagnostics only)&lt;br /&gt;
# &amp;quot;tes&amp;quot; (9.3 microns) [default] or &amp;quot;mcs&amp;quot; (21.6 microns)&lt;br /&gt;
dustiropacity = tes&lt;br /&gt;
# Use an IR to VIS scenario conversion coefficient that is&lt;br /&gt;
# dependent on the GCM dust effective radius,&lt;br /&gt;
# instead of a fixed 2.6 coefficient ?&lt;br /&gt;
#(only if dustiropacity = tes ; default = .false.)&lt;br /&gt;
reff_driven_IRtoVIS_scenario = .true.&lt;br /&gt;
&lt;br /&gt;
## Physical Parameterizations :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# call radiative transfer ? (default=.true.)&lt;br /&gt;
callrad   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
## Radiative transfer options :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# SCATTERERS: set number of scatterers.&lt;br /&gt;
# Must be compliant with other options: +1 if active, +1 if rdstorm, +1 if topflows, +1 if activice ; default=1)&lt;br /&gt;
naerkind = 4&lt;br /&gt;
&lt;br /&gt;
## Tracer (dust water, ice and/or chemical species) options (used if tracer=T):&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# DUST: Transported dust ? (if &amp;gt;0, use 'dustbin' dust bins ; default=0)&lt;br /&gt;
dustbin    = 2&lt;br /&gt;
# DUST: Radiatively active dust ? (matters if dustbin&amp;gt;0 ; default=.false.)&lt;br /&gt;
active  = .true.&lt;br /&gt;
# DUST: use mass and number mixing ratios to predict dust size ? (default=.false.)&lt;br /&gt;
doubleq   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: lifted by GCM surface winds ? (default=.false.)&lt;br /&gt;
lifting = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: Scavenging by H2O snowfall ? (default=.false.)&lt;br /&gt;
scavenging = .true.&lt;br /&gt;
&lt;br /&gt;
# DUST: freedust ? (default=.false.)&lt;br /&gt;
freedust=.true.&lt;br /&gt;
# DUST: dustscaling_mode?&lt;br /&gt;
#     =0 --&amp;gt; freedust, tauscaling=1&lt;br /&gt;
#     =1 --&amp;gt; GCM5.3-like, tauscaling&lt;br /&gt;
#     =2 --&amp;gt; tauscaling=1,dust_rad_adjust&lt;br /&gt;
dustscaling_mode=2&lt;br /&gt;
# DUST: dust injection scheme (if &amp;gt;0, use 'dustinjection' ; default=0)&lt;br /&gt;
dustinjection=1&lt;br /&gt;
# DUST: dust injection scheme coefficient (default=0.25)&lt;br /&gt;
coeff_injection=0.25&lt;br /&gt;
# DUST: dust injection scheme initial local time (default=0.)&lt;br /&gt;
ti_injection=0.&lt;br /&gt;
# DUST: dust injection scheme final local time (default=24.)&lt;br /&gt;
tf_injection=24.&lt;br /&gt;
# DUST: Rocket Dust Storm scheme (default=.false.)&lt;br /&gt;
rdstorm=.true.&lt;br /&gt;
# DUST: RDS detrainment coefficient (default=0.02)&lt;br /&gt;
coeff_detrainment=0.02&lt;br /&gt;
# DUST: Dust entrainment by subgrid-scale slope winds (default=.false.)&lt;br /&gt;
topflows=.true.&lt;br /&gt;
&lt;br /&gt;
# DUST/WATERICE: Scavenging by CO2 condensation? (default=.false.)&lt;br /&gt;
scavco2cond = .true.&lt;br /&gt;
# DUST/WATERICE: Gravitationnal sedimentation ? (default=.true.)&lt;br /&gt;
sedimentation = .true.&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note''' that the PCM6 dust cycle has mainly been tested with the non-dust-related flags and parameters that are featured in ''callphys.def.GCM6'' and ''callphys.def.MCD6'' (cf https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/), and in general with the ''*.def'' files (''run.def'', ''traceur.def'', ''z2sig.def'') that are suffixed with ''.GCM6'' or ''.MCD6''. If you depart from these files, even for non-dust related processes, we do not ensure the good tuning of the dust cycle, nor to a lesser extent the good compilation/execution of the model. If this happens, please reach out to us !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Level 2 (developper) : Parametrizations and tunable parameters ==&lt;br /&gt;
The table below sums up all the parameters related to PCM6 Dust Cycle, a short description, their default value in PCM6, a reasonable range that can explored for tuning, and where to find/modify them in the code.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto&amp;quot;&lt;br /&gt;
! Process !! Parameter !! Description !! Default value !! Reasonable range for tuning !! In the code&lt;br /&gt;
(D: declaration ; A: assignment ; U: use)&lt;br /&gt;
! References&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;7&amp;quot;|Injection &lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U) || TN2019_CNES, TN2020_CNES, TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''ti_injection'''&amp;lt;/span&amp;gt; || Beginning local time for injection window [h] || style=&amp;quot;text-align:center;&amp;quot;| 0 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 18 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U) ; ''vdifc_mod.F'' (U) || TN2019_ESA, TN2019_CNES, TN2020_CNES, TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''tf_injection'''&amp;lt;/span&amp;gt; || Ending local time for injection window [h] || style=&amp;quot;text-align:center;&amp;quot;| 24 || style=&amp;quot;text-align:center;&amp;quot;| 6 - 24 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U) ; ''vdifc_mod.F'' (U) || TN2019_ESA, TN2019_CNES, TN2020_CNES, TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''reff_lift'''&amp;lt;/span&amp;gt; || Effective radius of injected dust [m] || style=&amp;quot;text-align:center;&amp;quot;| 3e-6 || style=&amp;quot;text-align:center;&amp;quot;| 1e-6 - 5e-6 || ''initracer.F'' (D,A,U) ; impacts ''vdifc_mod.F''  || TN2021_CNES&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''reff_storm'''&amp;lt;/span&amp;gt; || Effective radius of injected dust when &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;rdstorm&amp;lt;/span&amp;gt;=.true. [m] || style=&amp;quot;text-align:center;&amp;quot;| 3e-6 || style=&amp;quot;text-align:center;&amp;quot;| (should be equal to reff_lift) || ''initracer.F'' (D,A,U) ; impacts ''vdifc_mod.F'' || TN2021_CNES&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''nueff_lift'''&amp;lt;/span&amp;gt; || Effective variance of injected dust [no unit] ; is also the variance in the atmosphere &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;nueffdust&amp;lt;/span&amp;gt; || style=&amp;quot;text-align:center;&amp;quot;| 0.5 || style=&amp;quot;text-align:center;&amp;quot;| 0.2 - 0.6 || ''initracer.F'' (D,A,U) ; impacts ''aeroptproperties.F'', ''callsedim_mod.F'' || [https://doi.org/10.1029/2006JE002786 Wolff et al. (2006)], [https://doi.org/10.1029/2020JE006419 Luginin et al. (2020)]&lt;br /&gt;
|-&lt;br /&gt;
|| $$Q_{ext}$$ for &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''alpha_lift(igcm_[dust&amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt;stormdust]_mass)'''&amp;lt;/span&amp;gt; || Extinction coefficient [no unit] used for the lifted mass coefficient ; should depend on &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;reff_[lift&amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt;storm]&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;nueff_lift&amp;lt;/span&amp;gt; || style=&amp;quot;text-align:center;&amp;quot;| 2.4  (hard-coded, no variable) || style=&amp;quot;text-align:center;&amp;quot;| (for $$\nu _{eff}$$=0.5)&lt;br /&gt;
$$r_{eff}$$=3µm -&amp;gt; $$Q_{ext}$$=2.46 ;&lt;br /&gt;
$$r_{eff}$$=2.5µm -&amp;gt; $$Q_{ext}$$=2.5 ;&lt;br /&gt;
$$r_{eff}$$=2µm -&amp;gt; $$Q_{ext}$$=2.6&lt;br /&gt;
|| ''initracer.F'' (A,U) ; impacts ''vdifc_mod.F''&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;|Rocket dust storm&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''mmr_ref'''&amp;lt;/span&amp;gt; || Reference mass mixing ratio [kg/kg] for the rocket dust storm sub-mesh fraction || style=&amp;quot;text-align:center;&amp;quot;| 5e-4 || style=&amp;quot;text-align:center;&amp;quot;| 2.5e-4 - 7.5e-4 || ''calcstormfract_mod.F90'' (D,A,U) ; impacts ''rocketduststorm_mod.F90'', ''callradite_mod.F90'' || TN2019_ESA, [https://doi.org/10.1002/2017JE005255 Wang et al. (2018)], TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''fracmin'''&amp;lt;/span&amp;gt; ; &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''fracmax'''&amp;lt;/span&amp;gt; || Bounds for the rocket dust storm sub-mesh fraction [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.01 ; 0.6 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''calcstormfract_mod.F90'' (D,A,U) ; impacts ''rocketduststorm_mod.F90'', ''callradite_mod.F90'' || TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_detrainment'''&amp;lt;/span&amp;gt; || Detrainment coefficient $$C_{det}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.02 || style=&amp;quot;text-align:center;&amp;quot;| ''see the note on detrainment below'' || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''rocketduststorm_mod.F90'' (U) || TN2019_CNES, TN2020_CNES, TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;|Mountain top flows&lt;br /&gt;
|| $$C_{mons}$$ for &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''alpha_hmons'''&amp;lt;/span&amp;gt; || Dampening coefficient $$C_{mons}$$ [no unit] for the mountain top flows sub-mesh fraction || style=&amp;quot;text-align:center;&amp;quot;| 0.5 (hard-coded, no variable) || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''topmons_mod.F90'' (A,U) || TN2020_CNES, TN2021_CNES, TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''k0'''&amp;lt;/span&amp;gt; ; &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''k1'''&amp;lt;/span&amp;gt; ; &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''k2'''&amp;lt;/span&amp;gt; || Coefficients [m/s ; m$$^{-1}$$ ; no unit] for the slope winds vertical velocity || style=&amp;quot;text-align:center;&amp;quot;| 0.25 ; 5e-4 ; 5e-3  (wmax = 3m/s) || style=&amp;quot;text-align:center;&amp;quot;| 1. ; 5e-4 ; 30e-3  (wmax = 10m/s) || ''topmons_mod.F90'' (D,A,U) || TN2019_CNES&lt;br /&gt;
|-&lt;br /&gt;
|| $$C_{detr}$$ for &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coefdetrain'''&amp;lt;/span&amp;gt; || Dampening coefficient $$C_{detr}$$ [no unit] for the mountain top flows detrainment || style=&amp;quot;text-align:center;&amp;quot;| 1. (hard-coded, no variable) || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''topmons_mod.F90'' (A,U) || TN2019_CNES&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;1&amp;quot;|Sedimentation&lt;br /&gt;
|| $$\beta$$ in call of newsedim for dust, stormdust and topdust || Particle shape correction factor for the Stokes-Cunningham sedimentation velocity [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.5 (hard-coded, no variable) || style=&amp;quot;text-align:center;&amp;quot;| 0.5 - 1&lt;br /&gt;
(disk -&amp;gt; irregular -&amp;gt; sphere)&lt;br /&gt;
|| ''callsedim_mod.F90'' (A,U) || [https://doi.org/10.1029/JB095iB09p14629 Murphy et al. (1990)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reference technical documents :&lt;br /&gt;
* TN2019_ESA : https://www-mars.lmd.jussieu.fr/WP2018/LMD_gcm_report_part1_dust.pdf&lt;br /&gt;
* TN2019_CNES : https://www-mars.lmd.jussieu.fr/cnes/2019/LMD_CNES_EXM_gcm6.0.pdf&lt;br /&gt;
* TN2020_CNES : https://www-mars.lmd.jussieu.fr/cnes/2020/note_technique_GCM_dust.pdf&lt;br /&gt;
* TN2021_CNES : https://www-mars.lmd.jussieu.fr/cnes/2021/note_technique_dust_cycle2021.pdf&lt;br /&gt;
* TN2022_ESA : https://www-mars.lmd.jussieu.fr/esa/contract2020_2022/deliverables/MS3/D2.1_dust_cycle.pdf ; ''Erratum : in section 2 of this document, it is said that &amp;quot;Corrected values for [ the assumptions done on the tuple ($$r_{eff}$$,$$Q_{ext}$$) ] which were a bit erroneous, lead to a typical opacity of 6 instead of 10 for the dust storm we simulate in the model using $$q_{storm,ref}$$ = $$5 × 10^{−4}$$kg/kg&amp;quot; (&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;mmr_ref&amp;lt;/span&amp;gt;). These &amp;quot;corrected&amp;quot; values were actually wrong. If we consider $$r_{eff}$$=2µm like in [https://doi.org/10.1002/2017JE005255 Wang et al. (2018)] or TN2019_ESA, using a mmr_ref of 5e-4kg/kg leads to an opacity of 10.5. If we use $$r_{eff}$$=3µm like the default &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;reff_lift&amp;lt;/span&amp;gt;, this leads to an opacity of 6.6.''&lt;br /&gt;
&lt;br /&gt;
Note on the rocket dust storm detrainment :&lt;br /&gt;
&lt;br /&gt;
== What's going on for rocket dust storms and injection : a detailed example through the physics parametrizations ==&lt;br /&gt;
We detail below the successive steps and processes performed concerning the coupling between the rocket dust storms and the dust injection. We place ourselves in one column of the model, which will serve as an example. The Fortran subroutines that are involved at each step are referred as '''''subroutine'''''.&lt;br /&gt;
&lt;br /&gt;
0. as we reach 2pm in this column, we read and interpolate the value of the optical depth scenario for the next day ('''''compute_dtau'''''). Let's say the scenario features an opacity of 5 (big dusty event), while the current day's GCM column has an opacity of 1 (which has been computed before, in '''''aeropacity''''')&lt;br /&gt;
&lt;br /&gt;
1. ('''''compute_dtau''''') we calculate the optical depth difference dtau=5-1=4, then what this means in terms of dust mass to be added to the atmosphere, assuming an effective size reff_lift = 3µm by default (defined in '''''initracer'''''). We dampen this quantity of dust by a coefficient Cinj (=0.25 by default) to take into account that the jump in tau_pref_scenario from the current day to the next may not come from local injection but from transport from adjacent meshes. For the values considered in this example, this gives an injection of ~5e-8 kg/m²/s.&lt;br /&gt;
&lt;br /&gt;
2. all this dust is injected uniformly during the injection window, by default between 2 p.m. this day and 2 p.m. the next day (when we are supposed to reach the scenario target), in the form of stormdust into the 1st layer by '''''vdifc''''', which already mixes it a little on several layers. Then this stormdust undergoes processes like thermals ('''''calltherm_interface'''''), convective adjustment ('''''convadj''''') and sedimentation ('''''callsedim''''') that further mix it in the atmosphere. For the latter, stormdust is prevented from falling to the ground, and remains in the 1st layer instead. We need to do so, because the main process responsible for the stormdust rising, represented by the routine '''''rocketduststorm''''', only happens at the beginning of the next timestep (see point 5).&lt;br /&gt;
&lt;br /&gt;
3. the stormdust is further mixed by the dynamics, and may also be transported to adjacent meshes. The column may also receive stormdust from other meshes.&lt;br /&gt;
&lt;br /&gt;
4. once back to the next physical time step, we calculate a sub-mesh fraction that is representative of the size of the stormdust plume ('''''calcstormfract'''''). To do so, we use the maximum mass mixing ratio of stormdust in the entire column (apart from the 1st layer), and compute the sub-mesh fraction that is needed to reach a reference mixing ratio mmr_ref=5e-4kg/kg. This reference mmr is a value that we consider representative of an opacity of 10 that was measured in a local dust storm by OMEGA, given some assumptions like a vertical extent of $$\Delta P$$=200Pa for the dust plume (''see also Wang et al. 2018, JGRPlanets, doi:10.1002/2017JE005255'').&lt;br /&gt;
&lt;br /&gt;
5. finally, we enter the '''''rocketduststorm''''' routine, where we check whether anywhere in the column, the mmr of stormdust (not concentrated in the sub-mesh fraction, but expanded to the whole mesh) is greater than $$10^{-4}$$ times that of background dust. If so, we activate the scheme in the column, and calculate the heating difference between the sub-mesh fraction (where we have concentrated stormdust, and background dust) and the rest of the mesh (only background dust), the resulting vertical transport in the sub-mesh fraction, and the horizontal detrainment where the stormdust plume vertical velocity decreases. If there is not enough stormdust compared to background dust at any level, the stormdust is detrained into background dust at all levels of the column.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Mars-Model]]&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1810</id>
		<title>Dust Cycle in Mars PCM6</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1810"/>
				<updated>2024-01-05T21:01:10Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: /* Level 2 (developper) : Parametrizations and tunable parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details at different levels how to use and what is featured in the dust cycle in Mars PCM6. '''This is still work in progress for now !'''&lt;br /&gt;
&lt;br /&gt;
== Level 1 (user) : Flags for PCM6 dust cycle ==&lt;br /&gt;
To run a simulation with the PCM6 dust cycle, you need to set up several flags and parameters in your ''callphys.def'' (see an example here: https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/callphys.def.GCM6)&lt;br /&gt;
&lt;br /&gt;
We list below all the relevant flags and parameters directly related to PCM6 dust cycle :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line&amp;gt;&lt;br /&gt;
##General options&lt;br /&gt;
##~~~~~~~~~~~~~~~&lt;br /&gt;
#Directory where external input files are:&lt;br /&gt;
datadir=/path/to/datadir&lt;br /&gt;
&lt;br /&gt;
#Run with or without tracer transport ?&lt;br /&gt;
tracer=.true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
## Dust scenario. Used to prescribe the dust&lt;br /&gt;
## ~~~~~~~~~~~~~&lt;br /&gt;
#  =1 Dust opt.deph read in startfi; =2 Viking scenario; =3 MGS scenario [default],&lt;br /&gt;
#  =4 Mars Year 24 from TES assimilation (old version of MY24; dust_tes.nc file)&lt;br /&gt;
#  =6 &amp;quot;cold&amp;quot; (low dust) scenario ; =7 &amp;quot;warm&amp;quot; (high dust) scenario&lt;br /&gt;
#  =8 &amp;quot;climatology&amp;quot; (our best guess of a typical Mars year) scenario&lt;br /&gt;
#  =24 Mars Year 24 from TES assimilation (ie: MCD reference case)&lt;br /&gt;
#  =25 Mars Year 25 from TES assimilation (ie: a year with a global dust storm)&lt;br /&gt;
#  =26 Mars Year 26 from TES assimilation&lt;br /&gt;
#  ...&lt;br /&gt;
#  =35 Mars Year 35 from observers assimilation&lt;br /&gt;
iaervar = 8&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# Dust IR opacity ref. wavelength (for dso diagnostics only)&lt;br /&gt;
# &amp;quot;tes&amp;quot; (9.3 microns) [default] or &amp;quot;mcs&amp;quot; (21.6 microns)&lt;br /&gt;
dustiropacity = tes&lt;br /&gt;
# Use an IR to VIS scenario conversion coefficient that is&lt;br /&gt;
# dependent on the GCM dust effective radius,&lt;br /&gt;
# instead of a fixed 2.6 coefficient ?&lt;br /&gt;
#(only if dustiropacity = tes ; default = .false.)&lt;br /&gt;
reff_driven_IRtoVIS_scenario = .true.&lt;br /&gt;
&lt;br /&gt;
## Physical Parameterizations :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# call radiative transfer ? (default=.true.)&lt;br /&gt;
callrad   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
## Radiative transfer options :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# SCATTERERS: set number of scatterers.&lt;br /&gt;
# Must be compliant with other options: +1 if active, +1 if rdstorm, +1 if topflows, +1 if activice ; default=1)&lt;br /&gt;
naerkind = 4&lt;br /&gt;
&lt;br /&gt;
## Tracer (dust water, ice and/or chemical species) options (used if tracer=T):&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# DUST: Transported dust ? (if &amp;gt;0, use 'dustbin' dust bins ; default=0)&lt;br /&gt;
dustbin    = 2&lt;br /&gt;
# DUST: Radiatively active dust ? (matters if dustbin&amp;gt;0 ; default=.false.)&lt;br /&gt;
active  = .true.&lt;br /&gt;
# DUST: use mass and number mixing ratios to predict dust size ? (default=.false.)&lt;br /&gt;
doubleq   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: lifted by GCM surface winds ? (default=.false.)&lt;br /&gt;
lifting = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: Scavenging by H2O snowfall ? (default=.false.)&lt;br /&gt;
scavenging = .true.&lt;br /&gt;
&lt;br /&gt;
# DUST: freedust ? (default=.false.)&lt;br /&gt;
freedust=.true.&lt;br /&gt;
# DUST: dustscaling_mode?&lt;br /&gt;
#     =0 --&amp;gt; freedust, tauscaling=1&lt;br /&gt;
#     =1 --&amp;gt; GCM5.3-like, tauscaling&lt;br /&gt;
#     =2 --&amp;gt; tauscaling=1,dust_rad_adjust&lt;br /&gt;
dustscaling_mode=2&lt;br /&gt;
# DUST: dust injection scheme (if &amp;gt;0, use 'dustinjection' ; default=0)&lt;br /&gt;
dustinjection=1&lt;br /&gt;
# DUST: dust injection scheme coefficient (default=0.25)&lt;br /&gt;
coeff_injection=0.25&lt;br /&gt;
# DUST: dust injection scheme initial local time (default=0.)&lt;br /&gt;
ti_injection=0.&lt;br /&gt;
# DUST: dust injection scheme final local time (default=24.)&lt;br /&gt;
tf_injection=24.&lt;br /&gt;
# DUST: Rocket Dust Storm scheme (default=.false.)&lt;br /&gt;
rdstorm=.true.&lt;br /&gt;
# DUST: RDS detrainment coefficient (default=0.02)&lt;br /&gt;
coeff_detrainment=0.02&lt;br /&gt;
# DUST: Dust entrainment by subgrid-scale slope winds (default=.false.)&lt;br /&gt;
topflows=.true.&lt;br /&gt;
&lt;br /&gt;
# DUST/WATERICE: Scavenging by CO2 condensation? (default=.false.)&lt;br /&gt;
scavco2cond = .true.&lt;br /&gt;
# DUST/WATERICE: Gravitationnal sedimentation ? (default=.true.)&lt;br /&gt;
sedimentation = .true.&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note''' that the PCM6 dust cycle has mainly been tested with the non-dust-related flags and parameters that are featured in ''callphys.def.GCM6'' and ''callphys.def.MCD6'' (cf https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/), and in general with the ''*.def'' files (''run.def'', ''traceur.def'', ''z2sig.def'') that are suffixed with ''.GCM6'' or ''.MCD6''. If you depart from these files, even for non-dust related processes, we do not ensure the good tuning of the dust cycle, nor to a lesser extent the good compilation/execution of the model. If this happens, please reach out to us !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Level 2 (developper) : Parametrizations and tunable parameters ==&lt;br /&gt;
The table below sums up all the parameters related to PCM6 Dust Cycle, a short description, their default value in PCM6, a reasonable range that can explored for tuning, and where to find/modify them in the code.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto&amp;quot;&lt;br /&gt;
|+ Caption text&lt;br /&gt;
|-&lt;br /&gt;
! Process !! Parameter !! Description !! Default value !! Reasonable range for tuning !! In the code (D: declaration ; A: assignment ; U: use) !! References&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;7&amp;quot;|Injection &lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U) || TN2019_CNES, TN2020_CNES, TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''ti_injection'''&amp;lt;/span&amp;gt; || Beginning local time for injection window [h] || style=&amp;quot;text-align:center;&amp;quot;| 0 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 18 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U) ; ''vdifc_mod.F'' (U) || TN2019_ESA, TN2019_CNES, TN2020_CNES, TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''tf_injection'''&amp;lt;/span&amp;gt; || Ending local time for injection window [h] || style=&amp;quot;text-align:center;&amp;quot;| 24 || style=&amp;quot;text-align:center;&amp;quot;| 6 - 24 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U) ; ''vdifc_mod.F'' (U) || TN2019_ESA, TN2019_CNES, TN2020_CNES, TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''reff_lift'''&amp;lt;/span&amp;gt; || Effective radius of injected dust [m] || style=&amp;quot;text-align:center;&amp;quot;| 3e-6 || style=&amp;quot;text-align:center;&amp;quot;| 1e-6 - 5e-6 || ''initracer.F'' (D,A,U) ; impacts ''vdifc_mod.F''  || TN2021_CNES&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''reff_storm'''&amp;lt;/span&amp;gt; || Effective radius of injected dust when &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;rdstorm&amp;lt;/span&amp;gt;=.true. [m] || style=&amp;quot;text-align:center;&amp;quot;| 3e-6 || style=&amp;quot;text-align:center;&amp;quot;| (should be equal to reff_lift) || ''initracer.F'' (D,A,U) ; impacts ''vdifc_mod.F'' || TN2021_CNES&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''nueff_lift'''&amp;lt;/span&amp;gt; || Effective variance of injected dust [no unit] ; is also the variance in the atmosphere &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;nueffdust&amp;lt;/span&amp;gt; || style=&amp;quot;text-align:center;&amp;quot;| 0.5 || style=&amp;quot;text-align:center;&amp;quot;| 0.2 - 0.6 || ''initracer.F'' (D,A,U) ; impacts ''aeroptproperties.F'', ''callsedim_mod.F'' || [https://doi.org/10.1029/2006JE002786 Wolff et al. (2006)], [https://doi.org/10.1029/2020JE006419 Luginin et al. (2020)]&lt;br /&gt;
|-&lt;br /&gt;
|| $$Q_{ext}$$ for &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''alpha_lift(igcm_[dust&amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt;stormdust]_mass)'''&amp;lt;/span&amp;gt; || Extinction coefficient [no unit] used for the lifted mass coefficient ; should depend on &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;reff_[lift&amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt;storm]&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;nueff_lift&amp;lt;/span&amp;gt; || style=&amp;quot;text-align:center;&amp;quot;| 2.4  (hard-coded, no variable) || style=&amp;quot;text-align:center;&amp;quot;| (for $$\nu _{eff}$$=0.5)&lt;br /&gt;
$$r_{eff}$$=3µm -&amp;gt; $$Q_{ext}$$=2.46 ;&lt;br /&gt;
$$r_{eff}$$=2.5µm -&amp;gt; $$Q_{ext}$$=2.5 ;&lt;br /&gt;
$$r_{eff}$$=2µm -&amp;gt; $$Q_{ext}$$=2.6&lt;br /&gt;
|| ''initracer.F'' (A,U) ; impacts ''vdifc_mod.F''&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;|Rocket dust storm&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''mmr_ref'''&amp;lt;/span&amp;gt; || Reference mass mixing ratio [kg/kg] for the rocket dust storm sub-mesh fraction || style=&amp;quot;text-align:center;&amp;quot;| 5e-4 || style=&amp;quot;text-align:center;&amp;quot;|  || ''calcstormfract_mod.F90'' (D,A,U) ; impacts ''rocketduststorm_mod.F90'', ''callradite_mod.F90'' || TN2019_ESA, [https://doi.org/10.1002/2017JE005255 Wang et al. (2018)], TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''fracmin'''&amp;lt;/span&amp;gt; ; &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''fracmax'''&amp;lt;/span&amp;gt; || Bounds for the rocket dust storm sub-mesh fraction [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.01 ; 0.6 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''calcstormfract_mod.F90'' (D,A,U) ; impacts ''rocketduststorm_mod.F90'', ''callradite_mod.F90'' || TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_detrainment'''&amp;lt;/span&amp;gt; || Detrainment coefficient $$C_{det}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.02 || style=&amp;quot;text-align:center;&amp;quot;| ''see the note on detrainment below'' || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''rocketduststorm_mod.F90'' (U) || TN2019_CNES, TN2020_CNES, TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;|Mountain top flows&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Dampening injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Dampening injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;1&amp;quot;|Sedimentation&lt;br /&gt;
|| $$\beta$$ in call for newsedim || Particle shape correction factor for the Stokes-Cunningham sedimentation velocity [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.5 (hard-coded, no variable) || style=&amp;quot;text-align:center;&amp;quot;| 0.5 (disk) - 1 (sphere) || ''callsedim_mod.F90'' (A,U) || [https://doi.org/10.1029/JB095iB09p14629 Murphy et al. (1990)]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reference technical documents :&lt;br /&gt;
* TN2019_ESA : https://www-mars.lmd.jussieu.fr/WP2018/LMD_gcm_report_part1_dust.pdf&lt;br /&gt;
* TN2019_CNES : https://www-mars.lmd.jussieu.fr/cnes/2019/LMD_CNES_EXM_gcm6.0.pdf&lt;br /&gt;
* TN2020_CNES : https://www-mars.lmd.jussieu.fr/cnes/2020/note_technique_GCM_dust.pdf (calibration of &lt;br /&gt;
* TN2021_CNES : https://www-mars.lmd.jussieu.fr/cnes/2021/note_technique_dust_cycle2021.pdf&lt;br /&gt;
* TN2022_ESA : https://www-mars.lmd.jussieu.fr/esa/contract2020_2022/deliverables/MS3/D2.1_dust_cycle.pdf ; ''Erratum : in section 2 of this document, it is said that &amp;quot;Corrected values for [ the assumptions done on the tuple ($$r_{eff}$$,$$Q_{ext}$$) ] which were a bit erroneous, lead to a typical opacity of 6 instead of 10 for the dust storm we simulate in the model using $$q_{storm,ref}$$ = $$5 × 10^{−4}$$kg/kg&amp;quot; (&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;mmr_ref&amp;lt;/span&amp;gt;). These &amp;quot;corrected&amp;quot; values were actually wrong. If we consider $$r_{eff}$$=2µm like in [https://doi.org/10.1002/2017JE005255 Wang et al. (2018)] or TN2019_ESA, using a mmr_ref of 5e-4kg/kg leads to an opacity of 10.5. If we use $$r_{eff}$$=3µm like the default &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;reff_lift&amp;lt;/span&amp;gt;, this leads to an opacity of 6.6.''&lt;br /&gt;
&lt;br /&gt;
Note on the rocket dust storm detrainment :&lt;br /&gt;
&lt;br /&gt;
== What's going on for rocket dust storms and injection : a detailed example through the physics parametrizations ==&lt;br /&gt;
We detail below the successive steps and processes performed concerning the coupling between the rocket dust storms and the dust injection. We place ourselves in one column of the model, which will serve as an example. The Fortran subroutines that are involved at each step are referred as '''''subroutine'''''.&lt;br /&gt;
&lt;br /&gt;
0. as we reach 2pm in this column, we read and interpolate the value of the optical depth scenario for the next day ('''''compute_dtau'''''). Let's say the scenario features an opacity of 5 (big dusty event), while the current day's GCM column has an opacity of 1 (which has been computed before, in '''''aeropacity''''')&lt;br /&gt;
&lt;br /&gt;
1. ('''''compute_dtau''''') we calculate the optical depth difference dtau=5-1=4, then what this means in terms of dust mass to be added to the atmosphere, assuming an effective size reff_lift = 3µm by default (defined in '''''initracer'''''). We dampen this quantity of dust by a coefficient Cinj (=0.25 by default) to take into account that the jump in tau_pref_scenario from the current day to the next may not come from local injection but from transport from adjacent meshes. For the values considered in this example, this gives an injection of ~5e-8 kg/m²/s.&lt;br /&gt;
&lt;br /&gt;
2. all this dust is injected uniformly during the injection window, by default between 2 p.m. this day and 2 p.m. the next day (when we are supposed to reach the scenario target), in the form of stormdust into the 1st layer by '''''vdifc''''', which already mixes it a little on several layers. Then this stormdust undergoes processes like thermals ('''''calltherm_interface'''''), convective adjustment ('''''convadj''''') and sedimentation ('''''callsedim''''') that further mix it in the atmosphere. For the latter, stormdust is prevented from falling to the ground, and remains in the 1st layer instead. We need to do so, because the main process responsible for the stormdust rising, represented by the routine '''''rocketduststorm''''', only happens at the beginning of the next timestep (see point 5).&lt;br /&gt;
&lt;br /&gt;
3. the stormdust is further mixed by the dynamics, and may also be transported to adjacent meshes. The column may also receive stormdust from other meshes.&lt;br /&gt;
&lt;br /&gt;
4. once back to the next physical time step, we calculate a sub-mesh fraction that is representative of the size of the stormdust plume ('''''calcstormfract'''''). To do so, we use the maximum mass mixing ratio of stormdust in the entire column (apart from the 1st layer), and compute the sub-mesh fraction that is needed to reach a reference mixing ratio mmr_ref=5e-4kg/kg. This reference mmr is a value that we consider representative of an opacity of 10 that was measured in a local dust storm by OMEGA, given some assumptions like a vertical extent of $$\Delta P$$=200Pa for the dust plume (''see also Wang et al. 2018, JGRPlanets, doi:10.1002/2017JE005255'').&lt;br /&gt;
&lt;br /&gt;
5. finally, we enter the '''''rocketduststorm''''' routine, where we check whether anywhere in the column, the mmr of stormdust (not concentrated in the sub-mesh fraction, but expanded to the whole mesh) is greater than $$10^{-4}$$ times that of background dust. If so, we activate the scheme in the column, and calculate the heating difference between the sub-mesh fraction (where we have concentrated stormdust, and background dust) and the rest of the mesh (only background dust), the resulting vertical transport in the sub-mesh fraction, and the horizontal detrainment where the stormdust plume vertical velocity decreases. If there is not enough stormdust compared to background dust at any level, the stormdust is detrained into background dust at all levels of the column.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Mars-Model]]&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1809</id>
		<title>Dust Cycle in Mars PCM6</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1809"/>
				<updated>2024-01-05T20:35:08Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: /* Level 2 (developper) : Parametrizations and tunable parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details at different levels how to use and what is featured in the dust cycle in Mars PCM6. '''This is still work in progress for now !'''&lt;br /&gt;
&lt;br /&gt;
== Level 1 (user) : Flags for PCM6 dust cycle ==&lt;br /&gt;
To run a simulation with the PCM6 dust cycle, you need to set up several flags and parameters in your ''callphys.def'' (see an example here: https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/callphys.def.GCM6)&lt;br /&gt;
&lt;br /&gt;
We list below all the relevant flags and parameters directly related to PCM6 dust cycle :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line&amp;gt;&lt;br /&gt;
##General options&lt;br /&gt;
##~~~~~~~~~~~~~~~&lt;br /&gt;
#Directory where external input files are:&lt;br /&gt;
datadir=/path/to/datadir&lt;br /&gt;
&lt;br /&gt;
#Run with or without tracer transport ?&lt;br /&gt;
tracer=.true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
## Dust scenario. Used to prescribe the dust&lt;br /&gt;
## ~~~~~~~~~~~~~&lt;br /&gt;
#  =1 Dust opt.deph read in startfi; =2 Viking scenario; =3 MGS scenario [default],&lt;br /&gt;
#  =4 Mars Year 24 from TES assimilation (old version of MY24; dust_tes.nc file)&lt;br /&gt;
#  =6 &amp;quot;cold&amp;quot; (low dust) scenario ; =7 &amp;quot;warm&amp;quot; (high dust) scenario&lt;br /&gt;
#  =8 &amp;quot;climatology&amp;quot; (our best guess of a typical Mars year) scenario&lt;br /&gt;
#  =24 Mars Year 24 from TES assimilation (ie: MCD reference case)&lt;br /&gt;
#  =25 Mars Year 25 from TES assimilation (ie: a year with a global dust storm)&lt;br /&gt;
#  =26 Mars Year 26 from TES assimilation&lt;br /&gt;
#  ...&lt;br /&gt;
#  =35 Mars Year 35 from observers assimilation&lt;br /&gt;
iaervar = 8&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# Dust IR opacity ref. wavelength (for dso diagnostics only)&lt;br /&gt;
# &amp;quot;tes&amp;quot; (9.3 microns) [default] or &amp;quot;mcs&amp;quot; (21.6 microns)&lt;br /&gt;
dustiropacity = tes&lt;br /&gt;
# Use an IR to VIS scenario conversion coefficient that is&lt;br /&gt;
# dependent on the GCM dust effective radius,&lt;br /&gt;
# instead of a fixed 2.6 coefficient ?&lt;br /&gt;
#(only if dustiropacity = tes ; default = .false.)&lt;br /&gt;
reff_driven_IRtoVIS_scenario = .true.&lt;br /&gt;
&lt;br /&gt;
## Physical Parameterizations :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# call radiative transfer ? (default=.true.)&lt;br /&gt;
callrad   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
## Radiative transfer options :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# SCATTERERS: set number of scatterers.&lt;br /&gt;
# Must be compliant with other options: +1 if active, +1 if rdstorm, +1 if topflows, +1 if activice ; default=1)&lt;br /&gt;
naerkind = 4&lt;br /&gt;
&lt;br /&gt;
## Tracer (dust water, ice and/or chemical species) options (used if tracer=T):&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# DUST: Transported dust ? (if &amp;gt;0, use 'dustbin' dust bins ; default=0)&lt;br /&gt;
dustbin    = 2&lt;br /&gt;
# DUST: Radiatively active dust ? (matters if dustbin&amp;gt;0 ; default=.false.)&lt;br /&gt;
active  = .true.&lt;br /&gt;
# DUST: use mass and number mixing ratios to predict dust size ? (default=.false.)&lt;br /&gt;
doubleq   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: lifted by GCM surface winds ? (default=.false.)&lt;br /&gt;
lifting = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: Scavenging by H2O snowfall ? (default=.false.)&lt;br /&gt;
scavenging = .true.&lt;br /&gt;
&lt;br /&gt;
# DUST: freedust ? (default=.false.)&lt;br /&gt;
freedust=.true.&lt;br /&gt;
# DUST: dustscaling_mode?&lt;br /&gt;
#     =0 --&amp;gt; freedust, tauscaling=1&lt;br /&gt;
#     =1 --&amp;gt; GCM5.3-like, tauscaling&lt;br /&gt;
#     =2 --&amp;gt; tauscaling=1,dust_rad_adjust&lt;br /&gt;
dustscaling_mode=2&lt;br /&gt;
# DUST: dust injection scheme (if &amp;gt;0, use 'dustinjection' ; default=0)&lt;br /&gt;
dustinjection=1&lt;br /&gt;
# DUST: dust injection scheme coefficient (default=0.25)&lt;br /&gt;
coeff_injection=0.25&lt;br /&gt;
# DUST: dust injection scheme initial local time (default=0.)&lt;br /&gt;
ti_injection=0.&lt;br /&gt;
# DUST: dust injection scheme final local time (default=24.)&lt;br /&gt;
tf_injection=24.&lt;br /&gt;
# DUST: Rocket Dust Storm scheme (default=.false.)&lt;br /&gt;
rdstorm=.true.&lt;br /&gt;
# DUST: RDS detrainment coefficient (default=0.02)&lt;br /&gt;
coeff_detrainment=0.02&lt;br /&gt;
# DUST: Dust entrainment by subgrid-scale slope winds (default=.false.)&lt;br /&gt;
topflows=.true.&lt;br /&gt;
&lt;br /&gt;
# DUST/WATERICE: Scavenging by CO2 condensation? (default=.false.)&lt;br /&gt;
scavco2cond = .true.&lt;br /&gt;
# DUST/WATERICE: Gravitationnal sedimentation ? (default=.true.)&lt;br /&gt;
sedimentation = .true.&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note''' that the PCM6 dust cycle has mainly been tested with the non-dust-related flags and parameters that are featured in ''callphys.def.GCM6'' and ''callphys.def.MCD6'' (cf https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/), and in general with the ''*.def'' files (''run.def'', ''traceur.def'', ''z2sig.def'') that are suffixed with ''.GCM6'' or ''.MCD6''. If you depart from these files, even for non-dust related processes, we do not ensure the good tuning of the dust cycle, nor to a lesser extent the good compilation/execution of the model. If this happens, please reach out to us !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Level 2 (developper) : Parametrizations and tunable parameters ==&lt;br /&gt;
The table below sums up all the parameters related to PCM6 Dust Cycle, a short description, their default value in PCM6, a reasonable range that can explored for tuning, and where to find/modify them in the code.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto&amp;quot;&lt;br /&gt;
|+ Caption text&lt;br /&gt;
|-&lt;br /&gt;
! Process !! Parameter !! Description !! Default value !! Reasonable range for tuning !! In the code (D: declaration ; A: assignment ; U: use) !! References&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;7&amp;quot;|Injection &lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U) || TN2019_CNES, TN2020_CNES, TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''ti_injection'''&amp;lt;/span&amp;gt; || Beginning local time for injection window [h] || style=&amp;quot;text-align:center;&amp;quot;| 0 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 18 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U) ; ''vdifc_mod.F'' (U) || TN2019_ESA, TN2019_CNES, TN2020_CNES, TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''tf_injection'''&amp;lt;/span&amp;gt; || Ending local time for injection window [h] || style=&amp;quot;text-align:center;&amp;quot;| 24 || style=&amp;quot;text-align:center;&amp;quot;| 6 - 24 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U) ; ''vdifc_mod.F'' (U) || TN2019_ESA, TN2019_CNES, TN2020_CNES, TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''reff_lift'''&amp;lt;/span&amp;gt; || Effective radius of injected dust [m] || style=&amp;quot;text-align:center;&amp;quot;| 3e-6 || style=&amp;quot;text-align:center;&amp;quot;| 1e-6 - 5e-6 || ''initracer.F'' (D,A,U) ; impacts ''vdifc_mod.F''  || TN2021_CNES&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''reff_storm'''&amp;lt;/span&amp;gt; || Effective radius of injected dust when &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;rdstorm&amp;lt;/span&amp;gt;=.true. [m] || style=&amp;quot;text-align:center;&amp;quot;| 3e-6 || style=&amp;quot;text-align:center;&amp;quot;| (should be equal to reff_lift) || ''initracer.F'' (D,A,U) ; impacts ''vdifc_mod.F'' || TN2021_CNES&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''nueff_lift'''&amp;lt;/span&amp;gt; || Effective variance of injected dust [no unit] ; is also the variance in the atmosphere &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;nueffdust&amp;lt;/span&amp;gt; || style=&amp;quot;text-align:center;&amp;quot;| 0.5 || style=&amp;quot;text-align:center;&amp;quot;| 0.2 - 0.6 || ''initracer.F'' (D,A,U) ; impacts ''aeroptproperties.F'', ''callsedim_mod.F'' || Wolff et al. &lt;br /&gt;
|-&lt;br /&gt;
|| $$Q_{ext}$$ for &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''alpha_lift(igcm_[dust&amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt;stormdust]_mass)'''&amp;lt;/span&amp;gt; || Extinction coefficient [no unit] used for the lifted mass coefficient ; should depend on &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;reff_[lift&amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt;storm]&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;nueff_lift&amp;lt;/span&amp;gt; || style=&amp;quot;text-align:center;&amp;quot;| 2.4  (hard-coded, no variable) || style=&amp;quot;text-align:center;&amp;quot;| (for $$\nu _{eff}$$=0.5)&lt;br /&gt;
$$r_{eff}$$=3µm -&amp;gt; $$Q_{ext}$$=2.46 ;&lt;br /&gt;
$$r_{eff}$$=2.5µm -&amp;gt; $$Q_{ext}$$=2.5 ;&lt;br /&gt;
$$r_{eff}$$=2µm -&amp;gt; $$Q_{ext}$$=2.6&lt;br /&gt;
|| ''initracer.F'' (A,U) ; impacts ''vdifc_mod.F''&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;|Rocket dust storm&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''mmr_ref'''&amp;lt;/span&amp;gt; || Reference mass mixing ratio [kg/kg] for the rocket dust storm sub-mesh fraction || style=&amp;quot;text-align:center;&amp;quot;| 5e-4 || style=&amp;quot;text-align:center;&amp;quot;|  || ''calcstormfract_mod.F90'' (D,A,U) ; impacts ''rocketduststorm_mod.F90'', ''callradite_mod.F90'' || TN2019_ESA, Wang et al. JGRPlanets (2018)&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''fracmin'''&amp;lt;/span&amp;gt; ; &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''fracmax'''&amp;lt;/span&amp;gt; || Bounds for the rocket dust storm sub-mesh fraction [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.01 ; 0.6 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''calcstormfract_mod.F90'' (D,A,U) ; impacts ''rocketduststorm_mod.F90'', ''callradite_mod.F90''&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_detrainment'''&amp;lt;/span&amp;gt; || Detrainment coefficient $$C_{det}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.02 || style=&amp;quot;text-align:center;&amp;quot;| ''see the note on detrainment below'' || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''rocketduststorm_mod.F90'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;|Mountain top flows&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Dampening injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Dampening injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;|Sedimentation&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Dampening injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Dampening injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reference technical documents :&lt;br /&gt;
* TN2019_ESA : https://www-mars.lmd.jussieu.fr/WP2018/LMD_gcm_report_part1_dust.pdf&lt;br /&gt;
* TN2019_CNES : https://www-mars.lmd.jussieu.fr/cnes/2019/LMD_CNES_EXM_gcm6.0.pdf&lt;br /&gt;
* TN2020_CNES : https://www-mars.lmd.jussieu.fr/cnes/2020/note_technique_GCM_dust.pdf (calibration of &lt;br /&gt;
* TN2021_CNES : https://www-mars.lmd.jussieu.fr/cnes/2021/note_technique_dust_cycle2021.pdf&lt;br /&gt;
* TN2022_ESA : https://www-mars.lmd.jussieu.fr/esa/contract2020_2022/deliverables/MS3/D2.1_dust_cycle.pdf ; ''Erratum : in section 2 of this document, it is said that &amp;quot;Corrected values for [ the assumptions done on the tuple ($$r_{eff}$$,$$Q_{ext}$$) ] which were a bit erroneous, lead to a typical opacity of 6 instead of 10 for the dust storm we simulate in the model using $$q_{storm,ref}$$ = $$5 × 10^{−4}$$kg/kg&amp;quot; (&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;mmr_ref&amp;lt;/span&amp;gt;). These &amp;quot;corrected&amp;quot; values were actually wrong. If we consider $$r_{eff}$$=2µm like in [https://doi.org/10.1002/2017JE005255 Wang et al. (2018)] or TN2019_ESA, using a mmr_ref of 5e-4kg/kg leads to an opacity of 10.5. If we use $$r_{eff}$$=3µm like the default &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;reff_lift&amp;lt;/span&amp;gt;, this leads to an opacity of 6.6.''&lt;br /&gt;
&lt;br /&gt;
Note on the rocket dust storm detrainment :&lt;br /&gt;
&lt;br /&gt;
== What's going on for rocket dust storms and injection : a detailed example through the physics parametrizations ==&lt;br /&gt;
We detail below the successive steps and processes performed concerning the coupling between the rocket dust storms and the dust injection. We place ourselves in one column of the model, which will serve as an example. The Fortran subroutines that are involved at each step are referred as '''''subroutine'''''.&lt;br /&gt;
&lt;br /&gt;
0. as we reach 2pm in this column, we read and interpolate the value of the optical depth scenario for the next day ('''''compute_dtau'''''). Let's say the scenario features an opacity of 5 (big dusty event), while the current day's GCM column has an opacity of 1 (which has been computed before, in '''''aeropacity''''')&lt;br /&gt;
&lt;br /&gt;
1. ('''''compute_dtau''''') we calculate the optical depth difference dtau=5-1=4, then what this means in terms of dust mass to be added to the atmosphere, assuming an effective size reff_lift = 3µm by default (defined in '''''initracer'''''). We dampen this quantity of dust by a coefficient Cinj (=0.25 by default) to take into account that the jump in tau_pref_scenario from the current day to the next may not come from local injection but from transport from adjacent meshes. For the values considered in this example, this gives an injection of ~5e-8 kg/m²/s.&lt;br /&gt;
&lt;br /&gt;
2. all this dust is injected uniformly during the injection window, by default between 2 p.m. this day and 2 p.m. the next day (when we are supposed to reach the scenario target), in the form of stormdust into the 1st layer by '''''vdifc''''', which already mixes it a little on several layers. Then this stormdust undergoes processes like thermals ('''''calltherm_interface'''''), convective adjustment ('''''convadj''''') and sedimentation ('''''callsedim''''') that further mix it in the atmosphere. For the latter, stormdust is prevented from falling to the ground, and remains in the 1st layer instead. We need to do so, because the main process responsible for the stormdust rising, represented by the routine '''''rocketduststorm''''', only happens at the beginning of the next timestep (see point 5).&lt;br /&gt;
&lt;br /&gt;
3. the stormdust is further mixed by the dynamics, and may also be transported to adjacent meshes. The column may also receive stormdust from other meshes.&lt;br /&gt;
&lt;br /&gt;
4. once back to the next physical time step, we calculate a sub-mesh fraction that is representative of the size of the stormdust plume ('''''calcstormfract'''''). To do so, we use the maximum mass mixing ratio of stormdust in the entire column (apart from the 1st layer), and compute the sub-mesh fraction that is needed to reach a reference mixing ratio mmr_ref=5e-4kg/kg. This reference mmr is a value that we consider representative of an opacity of 10 that was measured in a local dust storm by OMEGA, given some assumptions like a vertical extent of $$\Delta P$$=200Pa for the dust plume (''see also Wang et al. 2018, JGRPlanets, doi:10.1002/2017JE005255'').&lt;br /&gt;
&lt;br /&gt;
5. finally, we enter the '''''rocketduststorm''''' routine, where we check whether anywhere in the column, the mmr of stormdust (not concentrated in the sub-mesh fraction, but expanded to the whole mesh) is greater than $$10^{-4}$$ times that of background dust. If so, we activate the scheme in the column, and calculate the heating difference between the sub-mesh fraction (where we have concentrated stormdust, and background dust) and the rest of the mesh (only background dust), the resulting vertical transport in the sub-mesh fraction, and the horizontal detrainment where the stormdust plume vertical velocity decreases. If there is not enough stormdust compared to background dust at any level, the stormdust is detrained into background dust at all levels of the column.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Mars-Model]]&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1808</id>
		<title>Dust Cycle in Mars PCM6</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1808"/>
				<updated>2024-01-05T20:20:55Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: /* Level 2 (developper) : Parametrizations and tunable parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details at different levels how to use and what is featured in the dust cycle in Mars PCM6. '''This is still work in progress for now !'''&lt;br /&gt;
&lt;br /&gt;
== Level 1 (user) : Flags for PCM6 dust cycle ==&lt;br /&gt;
To run a simulation with the PCM6 dust cycle, you need to set up several flags and parameters in your ''callphys.def'' (see an example here: https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/callphys.def.GCM6)&lt;br /&gt;
&lt;br /&gt;
We list below all the relevant flags and parameters directly related to PCM6 dust cycle :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line&amp;gt;&lt;br /&gt;
##General options&lt;br /&gt;
##~~~~~~~~~~~~~~~&lt;br /&gt;
#Directory where external input files are:&lt;br /&gt;
datadir=/path/to/datadir&lt;br /&gt;
&lt;br /&gt;
#Run with or without tracer transport ?&lt;br /&gt;
tracer=.true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
## Dust scenario. Used to prescribe the dust&lt;br /&gt;
## ~~~~~~~~~~~~~&lt;br /&gt;
#  =1 Dust opt.deph read in startfi; =2 Viking scenario; =3 MGS scenario [default],&lt;br /&gt;
#  =4 Mars Year 24 from TES assimilation (old version of MY24; dust_tes.nc file)&lt;br /&gt;
#  =6 &amp;quot;cold&amp;quot; (low dust) scenario ; =7 &amp;quot;warm&amp;quot; (high dust) scenario&lt;br /&gt;
#  =8 &amp;quot;climatology&amp;quot; (our best guess of a typical Mars year) scenario&lt;br /&gt;
#  =24 Mars Year 24 from TES assimilation (ie: MCD reference case)&lt;br /&gt;
#  =25 Mars Year 25 from TES assimilation (ie: a year with a global dust storm)&lt;br /&gt;
#  =26 Mars Year 26 from TES assimilation&lt;br /&gt;
#  ...&lt;br /&gt;
#  =35 Mars Year 35 from observers assimilation&lt;br /&gt;
iaervar = 8&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# Dust IR opacity ref. wavelength (for dso diagnostics only)&lt;br /&gt;
# &amp;quot;tes&amp;quot; (9.3 microns) [default] or &amp;quot;mcs&amp;quot; (21.6 microns)&lt;br /&gt;
dustiropacity = tes&lt;br /&gt;
# Use an IR to VIS scenario conversion coefficient that is&lt;br /&gt;
# dependent on the GCM dust effective radius,&lt;br /&gt;
# instead of a fixed 2.6 coefficient ?&lt;br /&gt;
#(only if dustiropacity = tes ; default = .false.)&lt;br /&gt;
reff_driven_IRtoVIS_scenario = .true.&lt;br /&gt;
&lt;br /&gt;
## Physical Parameterizations :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# call radiative transfer ? (default=.true.)&lt;br /&gt;
callrad   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
## Radiative transfer options :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# SCATTERERS: set number of scatterers.&lt;br /&gt;
# Must be compliant with other options: +1 if active, +1 if rdstorm, +1 if topflows, +1 if activice ; default=1)&lt;br /&gt;
naerkind = 4&lt;br /&gt;
&lt;br /&gt;
## Tracer (dust water, ice and/or chemical species) options (used if tracer=T):&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# DUST: Transported dust ? (if &amp;gt;0, use 'dustbin' dust bins ; default=0)&lt;br /&gt;
dustbin    = 2&lt;br /&gt;
# DUST: Radiatively active dust ? (matters if dustbin&amp;gt;0 ; default=.false.)&lt;br /&gt;
active  = .true.&lt;br /&gt;
# DUST: use mass and number mixing ratios to predict dust size ? (default=.false.)&lt;br /&gt;
doubleq   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: lifted by GCM surface winds ? (default=.false.)&lt;br /&gt;
lifting = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: Scavenging by H2O snowfall ? (default=.false.)&lt;br /&gt;
scavenging = .true.&lt;br /&gt;
&lt;br /&gt;
# DUST: freedust ? (default=.false.)&lt;br /&gt;
freedust=.true.&lt;br /&gt;
# DUST: dustscaling_mode?&lt;br /&gt;
#     =0 --&amp;gt; freedust, tauscaling=1&lt;br /&gt;
#     =1 --&amp;gt; GCM5.3-like, tauscaling&lt;br /&gt;
#     =2 --&amp;gt; tauscaling=1,dust_rad_adjust&lt;br /&gt;
dustscaling_mode=2&lt;br /&gt;
# DUST: dust injection scheme (if &amp;gt;0, use 'dustinjection' ; default=0)&lt;br /&gt;
dustinjection=1&lt;br /&gt;
# DUST: dust injection scheme coefficient (default=0.25)&lt;br /&gt;
coeff_injection=0.25&lt;br /&gt;
# DUST: dust injection scheme initial local time (default=0.)&lt;br /&gt;
ti_injection=0.&lt;br /&gt;
# DUST: dust injection scheme final local time (default=24.)&lt;br /&gt;
tf_injection=24.&lt;br /&gt;
# DUST: Rocket Dust Storm scheme (default=.false.)&lt;br /&gt;
rdstorm=.true.&lt;br /&gt;
# DUST: RDS detrainment coefficient (default=0.02)&lt;br /&gt;
coeff_detrainment=0.02&lt;br /&gt;
# DUST: Dust entrainment by subgrid-scale slope winds (default=.false.)&lt;br /&gt;
topflows=.true.&lt;br /&gt;
&lt;br /&gt;
# DUST/WATERICE: Scavenging by CO2 condensation? (default=.false.)&lt;br /&gt;
scavco2cond = .true.&lt;br /&gt;
# DUST/WATERICE: Gravitationnal sedimentation ? (default=.true.)&lt;br /&gt;
sedimentation = .true.&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note''' that the PCM6 dust cycle has mainly been tested with the non-dust-related flags and parameters that are featured in ''callphys.def.GCM6'' and ''callphys.def.MCD6'' (cf https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/), and in general with the ''*.def'' files (''run.def'', ''traceur.def'', ''z2sig.def'') that are suffixed with ''.GCM6'' or ''.MCD6''. If you depart from these files, even for non-dust related processes, we do not ensure the good tuning of the dust cycle, nor to a lesser extent the good compilation/execution of the model. If this happens, please reach out to us !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Level 2 (developper) : Parametrizations and tunable parameters ==&lt;br /&gt;
The table below sums up all the parameters related to PCM6 Dust Cycle, a short description, their default value in PCM6, a reasonable range that can explored for tuning, and where to find/modify them in the code.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto&amp;quot;&lt;br /&gt;
|+ Caption text&lt;br /&gt;
|-&lt;br /&gt;
! Process !! Parameter !! Description !! Default value !! Reasonable range for tuning !! In the code (D: declaration ; A: assignment ; U: use) !! References&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;7&amp;quot;|Injection &lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U) || TN2019_CNES, TN2020_CNES, TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''ti_injection'''&amp;lt;/span&amp;gt; || Beginning local time for injection window [h] || style=&amp;quot;text-align:center;&amp;quot;| 0 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 18 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U) ; ''vdifc_mod.F'' (U) || TN2019_ESA, TN2019_CNES, TN2020_CNES, TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''tf_injection'''&amp;lt;/span&amp;gt; || Ending local time for injection window [h] || style=&amp;quot;text-align:center;&amp;quot;| 24 || style=&amp;quot;text-align:center;&amp;quot;| 6 - 24 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U) ; ''vdifc_mod.F'' (U) || TN2019_ESA, TN2019_CNES, TN2020_CNES, TN2022_ESA&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''reff_lift'''&amp;lt;/span&amp;gt; || Effective radius of injected dust [m] || style=&amp;quot;text-align:center;&amp;quot;| 3e-6 || style=&amp;quot;text-align:center;&amp;quot;| 1e-6 - 5e-6 || ''initracer.F'' (D,A,U) ; impacts ''vdifc_mod.F''  || TN2021_CNES&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''reff_storm'''&amp;lt;/span&amp;gt; || Effective radius of injected dust when &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;rdstorm&amp;lt;/span&amp;gt;=.true. [m] || style=&amp;quot;text-align:center;&amp;quot;| 3e-6 || style=&amp;quot;text-align:center;&amp;quot;| (should be equal to reff_lift) || ''initracer.F'' (D,A,U) ; impacts ''vdifc_mod.F'' || TN2021_CNES&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''nueff_lift'''&amp;lt;/span&amp;gt; || Effective variance of injected dust [no unit] ; is also the variance in the atmosphere &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;nueffdust&amp;lt;/span&amp;gt; || style=&amp;quot;text-align:center;&amp;quot;| 0.5 || style=&amp;quot;text-align:center;&amp;quot;| 0.2 - 0.6 || ''initracer.F'' (D,A,U) ; impacts ''aeroptproperties.F'', ''callsedim_mod.F'' || Wolff et al. &lt;br /&gt;
|-&lt;br /&gt;
|| $$Q_{ext}$$ for &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''alpha_lift(igcm_[dust&amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt;stormdust]_mass)'''&amp;lt;/span&amp;gt; || Extinction coefficient [no unit] used for the lifted mass coefficient ; should depend on &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;reff_[lift&amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt;storm]&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;nueff_lift&amp;lt;/span&amp;gt; || style=&amp;quot;text-align:center;&amp;quot;| 2.4  (hard-coded, no variable) || style=&amp;quot;text-align:center;&amp;quot;| (for $$\nu _{eff}$$=0.5)&lt;br /&gt;
$$r_{eff}$$=3µm -&amp;gt; $$Q_{ext}$$=2.46 ;&lt;br /&gt;
$$r_{eff}$$=2.5µm -&amp;gt; $$Q_{ext}$$=2.5 ;&lt;br /&gt;
$$r_{eff}$$=2µm -&amp;gt; $$Q_{ext}$$=2.6&lt;br /&gt;
|| ''initracer.F'' (A,U) ; impacts ''vdifc_mod.F''&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;|Rocket dust storm&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''mmr_ref'''&amp;lt;/span&amp;gt; || Reference mass mixing ratio [kg/kg] for the rocket dust storm sub-mesh fraction || style=&amp;quot;text-align:center;&amp;quot;| 5e-4 || style=&amp;quot;text-align:center;&amp;quot;|  || ''calcstormfract_mod.F90'' (D,A,U) ; impacts ''rocketduststorm_mod.F90'', ''callradite_mod.F90''&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''fracmin'''&amp;lt;/span&amp;gt; ; &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''fracmax'''&amp;lt;/span&amp;gt; || Bounds for the rocket dust storm sub-mesh fraction [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.01 ; 0.6 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''calcstormfract_mod.F90'' (D,A,U) ; impacts ''rocketduststorm_mod.F90'', ''callradite_mod.F90''&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_detrainment'''&amp;lt;/span&amp;gt; || Detrainment coefficient $$C_{det}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.02 || style=&amp;quot;text-align:center;&amp;quot;| ''see the note on detrainment below'' || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''rocketduststorm_mod.F90'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;|Mountain top flows&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Dampening injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Dampening injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;|Sedimentation&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Dampening injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Dampening injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reference technical documents :&lt;br /&gt;
* TN2019_ESA : https://www-mars.lmd.jussieu.fr/WP2018/LMD_gcm_report_part1_dust.pdf&lt;br /&gt;
* TN2019_CNES : https://www-mars.lmd.jussieu.fr/cnes/2019/LMD_CNES_EXM_gcm6.0.pdf&lt;br /&gt;
* TN2020_CNES : https://www-mars.lmd.jussieu.fr/cnes/2020/note_technique_GCM_dust.pdf (calibration of &lt;br /&gt;
* TN2021_CNES : https://www-mars.lmd.jussieu.fr/cnes/2021/note_technique_dust_cycle2021.pdf&lt;br /&gt;
* TN2022_ESA : https://www-mars.lmd.jussieu.fr/esa/contract2020_2022/deliverables/MS3/D2.1_dust_cycle.pdf ; ''Erratum : in section 2 of this document, it is said that &amp;quot;Corrected values for [ the assumptions done on the tuple ($$r_{eff}$$,$$Q_{ext}$$) ] which were a bit erroneous, lead to a typical opacity of 6 instead of 10 for the dust storm we simulate in the model using $$q_{storm,ref}$$ = $$5 × 10^{−4}$$kg/kg&amp;quot; (&amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;mmr_ref&amp;lt;/span&amp;gt;). The corrected values were actually wrong, and the new ones lead to an opacity between 10.5 and 6.6 with $$r_{eff}$$ ranging between 2 and 3µm.''&lt;br /&gt;
&lt;br /&gt;
Note on the rocket dust storm detrainment :&lt;br /&gt;
&lt;br /&gt;
== What's going on for rocket dust storms and injection : a detailed example through the physics parametrizations ==&lt;br /&gt;
We detail below the successive steps and processes performed concerning the coupling between the rocket dust storms and the dust injection. We place ourselves in one column of the model, which will serve as an example. The Fortran subroutines that are involved at each step are referred as '''''subroutine'''''.&lt;br /&gt;
&lt;br /&gt;
0. as we reach 2pm in this column, we read and interpolate the value of the optical depth scenario for the next day ('''''compute_dtau'''''). Let's say the scenario features an opacity of 5 (big dusty event), while the current day's GCM column has an opacity of 1 (which has been computed before, in '''''aeropacity''''')&lt;br /&gt;
&lt;br /&gt;
1. ('''''compute_dtau''''') we calculate the optical depth difference dtau=5-1=4, then what this means in terms of dust mass to be added to the atmosphere, assuming an effective size reff_lift = 3µm by default (defined in '''''initracer'''''). We dampen this quantity of dust by a coefficient Cinj (=0.25 by default) to take into account that the jump in tau_pref_scenario from the current day to the next may not come from local injection but from transport from adjacent meshes. For the values considered in this example, this gives an injection of ~5e-8 kg/m²/s.&lt;br /&gt;
&lt;br /&gt;
2. all this dust is injected uniformly during the injection window, by default between 2 p.m. this day and 2 p.m. the next day (when we are supposed to reach the scenario target), in the form of stormdust into the 1st layer by '''''vdifc''''', which already mixes it a little on several layers. Then this stormdust undergoes processes like thermals ('''''calltherm_interface'''''), convective adjustment ('''''convadj''''') and sedimentation ('''''callsedim''''') that further mix it in the atmosphere. For the latter, stormdust is prevented from falling to the ground, and remains in the 1st layer instead. We need to do so, because the main process responsible for the stormdust rising, represented by the routine '''''rocketduststorm''''', only happens at the beginning of the next timestep (see point 5).&lt;br /&gt;
&lt;br /&gt;
3. the stormdust is further mixed by the dynamics, and may also be transported to adjacent meshes. The column may also receive stormdust from other meshes.&lt;br /&gt;
&lt;br /&gt;
4. once back to the next physical time step, we calculate a sub-mesh fraction that is representative of the size of the stormdust plume ('''''calcstormfract'''''). To do so, we use the maximum mass mixing ratio of stormdust in the entire column (apart from the 1st layer), and compute the sub-mesh fraction that is needed to reach a reference mixing ratio mmr_ref=5e-4kg/kg. This reference mmr is a value that we consider representative of an opacity of 10 that was measured in a local dust storm by OMEGA, given some assumptions like a vertical extent of $$\Delta P$$=200Pa for the dust plume (''see also Wang et al. 2018, JGRPlanets, doi:10.1002/2017JE005255'').&lt;br /&gt;
&lt;br /&gt;
5. finally, we enter the '''''rocketduststorm''''' routine, where we check whether anywhere in the column, the mmr of stormdust (not concentrated in the sub-mesh fraction, but expanded to the whole mesh) is greater than $$10^{-4}$$ times that of background dust. If so, we activate the scheme in the column, and calculate the heating difference between the sub-mesh fraction (where we have concentrated stormdust, and background dust) and the rest of the mesh (only background dust), the resulting vertical transport in the sub-mesh fraction, and the horizontal detrainment where the stormdust plume vertical velocity decreases. If there is not enough stormdust compared to background dust at any level, the stormdust is detrained into background dust at all levels of the column.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Mars-Model]]&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1807</id>
		<title>Dust Cycle in Mars PCM6</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1807"/>
				<updated>2024-01-05T19:54:04Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: /* Level 2 (developper) : Parametrizations and tunable parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details at different levels how to use and what is featured in the dust cycle in Mars PCM6. '''This is still work in progress for now !'''&lt;br /&gt;
&lt;br /&gt;
== Level 1 (user) : Flags for PCM6 dust cycle ==&lt;br /&gt;
To run a simulation with the PCM6 dust cycle, you need to set up several flags and parameters in your ''callphys.def'' (see an example here: https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/callphys.def.GCM6)&lt;br /&gt;
&lt;br /&gt;
We list below all the relevant flags and parameters directly related to PCM6 dust cycle :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line&amp;gt;&lt;br /&gt;
##General options&lt;br /&gt;
##~~~~~~~~~~~~~~~&lt;br /&gt;
#Directory where external input files are:&lt;br /&gt;
datadir=/path/to/datadir&lt;br /&gt;
&lt;br /&gt;
#Run with or without tracer transport ?&lt;br /&gt;
tracer=.true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
## Dust scenario. Used to prescribe the dust&lt;br /&gt;
## ~~~~~~~~~~~~~&lt;br /&gt;
#  =1 Dust opt.deph read in startfi; =2 Viking scenario; =3 MGS scenario [default],&lt;br /&gt;
#  =4 Mars Year 24 from TES assimilation (old version of MY24; dust_tes.nc file)&lt;br /&gt;
#  =6 &amp;quot;cold&amp;quot; (low dust) scenario ; =7 &amp;quot;warm&amp;quot; (high dust) scenario&lt;br /&gt;
#  =8 &amp;quot;climatology&amp;quot; (our best guess of a typical Mars year) scenario&lt;br /&gt;
#  =24 Mars Year 24 from TES assimilation (ie: MCD reference case)&lt;br /&gt;
#  =25 Mars Year 25 from TES assimilation (ie: a year with a global dust storm)&lt;br /&gt;
#  =26 Mars Year 26 from TES assimilation&lt;br /&gt;
#  ...&lt;br /&gt;
#  =35 Mars Year 35 from observers assimilation&lt;br /&gt;
iaervar = 8&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# Dust IR opacity ref. wavelength (for dso diagnostics only)&lt;br /&gt;
# &amp;quot;tes&amp;quot; (9.3 microns) [default] or &amp;quot;mcs&amp;quot; (21.6 microns)&lt;br /&gt;
dustiropacity = tes&lt;br /&gt;
# Use an IR to VIS scenario conversion coefficient that is&lt;br /&gt;
# dependent on the GCM dust effective radius,&lt;br /&gt;
# instead of a fixed 2.6 coefficient ?&lt;br /&gt;
#(only if dustiropacity = tes ; default = .false.)&lt;br /&gt;
reff_driven_IRtoVIS_scenario = .true.&lt;br /&gt;
&lt;br /&gt;
## Physical Parameterizations :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# call radiative transfer ? (default=.true.)&lt;br /&gt;
callrad   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
## Radiative transfer options :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# SCATTERERS: set number of scatterers.&lt;br /&gt;
# Must be compliant with other options: +1 if active, +1 if rdstorm, +1 if topflows, +1 if activice ; default=1)&lt;br /&gt;
naerkind = 4&lt;br /&gt;
&lt;br /&gt;
## Tracer (dust water, ice and/or chemical species) options (used if tracer=T):&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# DUST: Transported dust ? (if &amp;gt;0, use 'dustbin' dust bins ; default=0)&lt;br /&gt;
dustbin    = 2&lt;br /&gt;
# DUST: Radiatively active dust ? (matters if dustbin&amp;gt;0 ; default=.false.)&lt;br /&gt;
active  = .true.&lt;br /&gt;
# DUST: use mass and number mixing ratios to predict dust size ? (default=.false.)&lt;br /&gt;
doubleq   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: lifted by GCM surface winds ? (default=.false.)&lt;br /&gt;
lifting = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: Scavenging by H2O snowfall ? (default=.false.)&lt;br /&gt;
scavenging = .true.&lt;br /&gt;
&lt;br /&gt;
# DUST: freedust ? (default=.false.)&lt;br /&gt;
freedust=.true.&lt;br /&gt;
# DUST: dustscaling_mode?&lt;br /&gt;
#     =0 --&amp;gt; freedust, tauscaling=1&lt;br /&gt;
#     =1 --&amp;gt; GCM5.3-like, tauscaling&lt;br /&gt;
#     =2 --&amp;gt; tauscaling=1,dust_rad_adjust&lt;br /&gt;
dustscaling_mode=2&lt;br /&gt;
# DUST: dust injection scheme (if &amp;gt;0, use 'dustinjection' ; default=0)&lt;br /&gt;
dustinjection=1&lt;br /&gt;
# DUST: dust injection scheme coefficient (default=0.25)&lt;br /&gt;
coeff_injection=0.25&lt;br /&gt;
# DUST: dust injection scheme initial local time (default=0.)&lt;br /&gt;
ti_injection=0.&lt;br /&gt;
# DUST: dust injection scheme final local time (default=24.)&lt;br /&gt;
tf_injection=24.&lt;br /&gt;
# DUST: Rocket Dust Storm scheme (default=.false.)&lt;br /&gt;
rdstorm=.true.&lt;br /&gt;
# DUST: RDS detrainment coefficient (default=0.02)&lt;br /&gt;
coeff_detrainment=0.02&lt;br /&gt;
# DUST: Dust entrainment by subgrid-scale slope winds (default=.false.)&lt;br /&gt;
topflows=.true.&lt;br /&gt;
&lt;br /&gt;
# DUST/WATERICE: Scavenging by CO2 condensation? (default=.false.)&lt;br /&gt;
scavco2cond = .true.&lt;br /&gt;
# DUST/WATERICE: Gravitationnal sedimentation ? (default=.true.)&lt;br /&gt;
sedimentation = .true.&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note''' that the PCM6 dust cycle has mainly been tested with the non-dust-related flags and parameters that are featured in ''callphys.def.GCM6'' and ''callphys.def.MCD6'' (cf https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/), and in general with the ''*.def'' files (''run.def'', ''traceur.def'', ''z2sig.def'') that are suffixed with ''.GCM6'' or ''.MCD6''. If you depart from these files, even for non-dust related processes, we do not ensure the good tuning of the dust cycle, nor to a lesser extent the good compilation/execution of the model. If this happens, please reach out to us !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Level 2 (developper) : Parametrizations and tunable parameters ==&lt;br /&gt;
The table below sums up all the parameters related to PCM6 Dust Cycle, a short description, their default value in PCM6, a reasonable range that can explored for tuning, and where to find/modify them in the code.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto&amp;quot;&lt;br /&gt;
|+ Caption text&lt;br /&gt;
|-&lt;br /&gt;
! Process !! Parameter !! Description !! Default value !! Reasonable range for tuning !! In the code (D: declaration ; A: assignment ; U: use) !! References&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;7&amp;quot;|Injection &lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U) || TN2019, TN2020, TN2022&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''ti_injection'''&amp;lt;/span&amp;gt; || Beginning local time for injection window [h] || style=&amp;quot;text-align:center;&amp;quot;| 0 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 18 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U) ; ''vdifc_mod.F'' (U) || TN2018, TN2019, TN2020, TN2022&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''tf_injection'''&amp;lt;/span&amp;gt; || Ending local time for injection window [h] || style=&amp;quot;text-align:center;&amp;quot;| 24 || style=&amp;quot;text-align:center;&amp;quot;| 6 - 24 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U) ; ''vdifc_mod.F'' (U) || TN2018, TN2019, TN2020, TN2022&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''reff_lift'''&amp;lt;/span&amp;gt; || Effective radius of injected dust [m] || style=&amp;quot;text-align:center;&amp;quot;| 3e-6 || style=&amp;quot;text-align:center;&amp;quot;| 1e-6 - 5e-6 || ''initracer.F'' (D,A,U) ; impacts ''vdifc_mod.F''  || TN2021&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''reff_storm'''&amp;lt;/span&amp;gt; || Effective radius of injected dust when &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;rdstorm&amp;lt;/span&amp;gt;=.true. [m] || style=&amp;quot;text-align:center;&amp;quot;| 3e-6 || style=&amp;quot;text-align:center;&amp;quot;| (should be equal to reff_lift) || ''initracer.F'' (D,A,U) ; impacts ''vdifc_mod.F'' || TN2021&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''nueff_lift'''&amp;lt;/span&amp;gt; || Effective variance of injected dust [no unit] ; is also the variance in the atmosphere &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;nueffdust&amp;lt;/span&amp;gt; || style=&amp;quot;text-align:center;&amp;quot;| 0.5 || style=&amp;quot;text-align:center;&amp;quot;| 0.2 - 0.6 || ''initracer.F'' (D,A,U) ; impacts ''aeroptproperties.F'', ''callsedim_mod.F'' || Wolff et al. &lt;br /&gt;
|-&lt;br /&gt;
|| $$Q_{ext}$$ for &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''alpha_lift(igcm_[dust&amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt;stormdust]_mass)'''&amp;lt;/span&amp;gt; || Extinction coefficient [no unit] used for the lifted mass coefficient ; should depend on &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;reff_[lift&amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt;storm]&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;nueff_lift&amp;lt;/span&amp;gt; || style=&amp;quot;text-align:center;&amp;quot;| 2.4  (hard-coded, no variable) || style=&amp;quot;text-align:center;&amp;quot;| (for $$\nu _{eff}$$=0.5)&lt;br /&gt;
$$r_{eff}$$=3µm -&amp;gt; $$Q_{ext}$$=2.46 ;&lt;br /&gt;
$$r_{eff}$$=2.5µm -&amp;gt; $$Q_{ext}$$=2.5 ;&lt;br /&gt;
$$r_{eff}$$=2µm -&amp;gt; $$Q_{ext}$$=2.6&lt;br /&gt;
|| ''initracer.F'' (A,U) ; impacts ''vdifc_mod.F''&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;|Rocket dust storm&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''mmr_ref'''&amp;lt;/span&amp;gt; || Reference mass mixing ratio [kg/kg] for the rocket dust storm sub-mesh fraction || style=&amp;quot;text-align:center;&amp;quot;| 5e-4 || style=&amp;quot;text-align:center;&amp;quot;|  || ''calcstormfract_mod.F90'' (D,A,U) ; impacts ''rocketduststorm_mod.F90'', ''callradite_mod.F90''&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''fracmin'''&amp;lt;/span&amp;gt; ; &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''fracmax'''&amp;lt;/span&amp;gt; || Bounds for the rocket dust storm sub-mesh fraction [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.01 ; 0.6 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''calcstormfract_mod.F90'' (D,A,U) ; impacts ''rocketduststorm_mod.F90'', ''callradite_mod.F90''&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_detrainment'''&amp;lt;/span&amp;gt; || Detrainment coefficient $$C_{det}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.02 || style=&amp;quot;text-align:center;&amp;quot;| ''see the note on detrainment below'' || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''rocketduststorm_mod.F90'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;|Mountain top flows&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Dampening injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Dampening injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;|Sedimentation&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Dampening injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Dampening injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reference technical documents :&lt;br /&gt;
* TN2018 : https://www-mars.lmd.jussieu.fr/WP2018/LMD_gcm_report_part1_dust.pdf&lt;br /&gt;
* TN2019 : https://www-mars.lmd.jussieu.fr/cnes/2019/LMD_CNES_EXM_gcm6.0.pdf&lt;br /&gt;
* TN2020 : https://www-mars.lmd.jussieu.fr/cnes/2020/note_technique_GCM_dust.pdf (calibration of &lt;br /&gt;
* TN2021 : https://www-mars.lmd.jussieu.fr/cnes/2021/note_technique_dust_cycle2021.pdf&lt;br /&gt;
* TN2022 : https://www-mars.lmd.jussieu.fr/esa/contract2020_2022/deliverables/MS3/D2.1_dust_cycle.pdf&lt;br /&gt;
&lt;br /&gt;
Note on the rocket dust storm detrainment :&lt;br /&gt;
&lt;br /&gt;
== What's going on for rocket dust storms and injection : a detailed example through the physics parametrizations ==&lt;br /&gt;
We detail below the successive steps and processes performed concerning the coupling between the rocket dust storms and the dust injection. We place ourselves in one column of the model, which will serve as an example. The Fortran subroutines that are involved at each step are referred as '''''subroutine'''''.&lt;br /&gt;
&lt;br /&gt;
0. as we reach 2pm in this column, we read and interpolate the value of the optical depth scenario for the next day ('''''compute_dtau'''''). Let's say the scenario features an opacity of 5 (big dusty event), while the current day's GCM column has an opacity of 1 (which has been computed before, in '''''aeropacity''''')&lt;br /&gt;
&lt;br /&gt;
1. ('''''compute_dtau''''') we calculate the optical depth difference dtau=5-1=4, then what this means in terms of dust mass to be added to the atmosphere, assuming an effective size reff_lift = 3µm by default (defined in '''''initracer'''''). We dampen this quantity of dust by a coefficient Cinj (=0.25 by default) to take into account that the jump in tau_pref_scenario from the current day to the next may not come from local injection but from transport from adjacent meshes. For the values considered in this example, this gives an injection of ~5e-8 kg/m²/s.&lt;br /&gt;
&lt;br /&gt;
2. all this dust is injected uniformly during the injection window, by default between 2 p.m. this day and 2 p.m. the next day (when we are supposed to reach the scenario target), in the form of stormdust into the 1st layer by '''''vdifc''''', which already mixes it a little on several layers. Then this stormdust undergoes processes like thermals ('''''calltherm_interface'''''), convective adjustment ('''''convadj''''') and sedimentation ('''''callsedim''''') that further mix it in the atmosphere. For the latter, stormdust is prevented from falling to the ground, and remains in the 1st layer instead. We need to do so, because the main process responsible for the stormdust rising, represented by the routine '''''rocketduststorm''''', only happens at the beginning of the next timestep (see point 5).&lt;br /&gt;
&lt;br /&gt;
3. the stormdust is further mixed by the dynamics, and may also be transported to adjacent meshes. The column may also receive stormdust from other meshes.&lt;br /&gt;
&lt;br /&gt;
4. once back to the next physical time step, we calculate a sub-mesh fraction that is representative of the size of the stormdust plume ('''''calcstormfract'''''). To do so, we use the maximum mass mixing ratio of stormdust in the entire column (apart from the 1st layer), and compute the sub-mesh fraction that is needed to reach a reference mixing ratio mmr_ref=5e-4kg/kg. This reference mmr is a value that we consider representative of an opacity of 10 that was measured in a local dust storm by OMEGA, given some assumptions like a vertical extent of $$\Delta P$$=200Pa for the dust plume (''see also Wang et al. 2018, JGRPlanets, doi:10.1002/2017JE005255'').&lt;br /&gt;
&lt;br /&gt;
5. finally, we enter the '''''rocketduststorm''''' routine, where we check whether anywhere in the column, the mmr of stormdust (not concentrated in the sub-mesh fraction, but expanded to the whole mesh) is greater than $$10^{-4}$$ times that of background dust. If so, we activate the scheme in the column, and calculate the heating difference between the sub-mesh fraction (where we have concentrated stormdust, and background dust) and the rest of the mesh (only background dust), the resulting vertical transport in the sub-mesh fraction, and the horizontal detrainment where the stormdust plume vertical velocity decreases. If there is not enough stormdust compared to background dust at any level, the stormdust is detrained into background dust at all levels of the column.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Mars-Model]]&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1806</id>
		<title>Dust Cycle in Mars PCM6</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1806"/>
				<updated>2024-01-05T19:18:28Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: /* Level 2 (developper) : Parametrizations and tunable parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details at different levels how to use and what is featured in the dust cycle in Mars PCM6. '''This is still work in progress for now !'''&lt;br /&gt;
&lt;br /&gt;
== Level 1 (user) : Flags for PCM6 dust cycle ==&lt;br /&gt;
To run a simulation with the PCM6 dust cycle, you need to set up several flags and parameters in your ''callphys.def'' (see an example here: https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/callphys.def.GCM6)&lt;br /&gt;
&lt;br /&gt;
We list below all the relevant flags and parameters directly related to PCM6 dust cycle :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line&amp;gt;&lt;br /&gt;
##General options&lt;br /&gt;
##~~~~~~~~~~~~~~~&lt;br /&gt;
#Directory where external input files are:&lt;br /&gt;
datadir=/path/to/datadir&lt;br /&gt;
&lt;br /&gt;
#Run with or without tracer transport ?&lt;br /&gt;
tracer=.true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
## Dust scenario. Used to prescribe the dust&lt;br /&gt;
## ~~~~~~~~~~~~~&lt;br /&gt;
#  =1 Dust opt.deph read in startfi; =2 Viking scenario; =3 MGS scenario [default],&lt;br /&gt;
#  =4 Mars Year 24 from TES assimilation (old version of MY24; dust_tes.nc file)&lt;br /&gt;
#  =6 &amp;quot;cold&amp;quot; (low dust) scenario ; =7 &amp;quot;warm&amp;quot; (high dust) scenario&lt;br /&gt;
#  =8 &amp;quot;climatology&amp;quot; (our best guess of a typical Mars year) scenario&lt;br /&gt;
#  =24 Mars Year 24 from TES assimilation (ie: MCD reference case)&lt;br /&gt;
#  =25 Mars Year 25 from TES assimilation (ie: a year with a global dust storm)&lt;br /&gt;
#  =26 Mars Year 26 from TES assimilation&lt;br /&gt;
#  ...&lt;br /&gt;
#  =35 Mars Year 35 from observers assimilation&lt;br /&gt;
iaervar = 8&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# Dust IR opacity ref. wavelength (for dso diagnostics only)&lt;br /&gt;
# &amp;quot;tes&amp;quot; (9.3 microns) [default] or &amp;quot;mcs&amp;quot; (21.6 microns)&lt;br /&gt;
dustiropacity = tes&lt;br /&gt;
# Use an IR to VIS scenario conversion coefficient that is&lt;br /&gt;
# dependent on the GCM dust effective radius,&lt;br /&gt;
# instead of a fixed 2.6 coefficient ?&lt;br /&gt;
#(only if dustiropacity = tes ; default = .false.)&lt;br /&gt;
reff_driven_IRtoVIS_scenario = .true.&lt;br /&gt;
&lt;br /&gt;
## Physical Parameterizations :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# call radiative transfer ? (default=.true.)&lt;br /&gt;
callrad   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
## Radiative transfer options :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# SCATTERERS: set number of scatterers.&lt;br /&gt;
# Must be compliant with other options: +1 if active, +1 if rdstorm, +1 if topflows, +1 if activice ; default=1)&lt;br /&gt;
naerkind = 4&lt;br /&gt;
&lt;br /&gt;
## Tracer (dust water, ice and/or chemical species) options (used if tracer=T):&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# DUST: Transported dust ? (if &amp;gt;0, use 'dustbin' dust bins ; default=0)&lt;br /&gt;
dustbin    = 2&lt;br /&gt;
# DUST: Radiatively active dust ? (matters if dustbin&amp;gt;0 ; default=.false.)&lt;br /&gt;
active  = .true.&lt;br /&gt;
# DUST: use mass and number mixing ratios to predict dust size ? (default=.false.)&lt;br /&gt;
doubleq   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: lifted by GCM surface winds ? (default=.false.)&lt;br /&gt;
lifting = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: Scavenging by H2O snowfall ? (default=.false.)&lt;br /&gt;
scavenging = .true.&lt;br /&gt;
&lt;br /&gt;
# DUST: freedust ? (default=.false.)&lt;br /&gt;
freedust=.true.&lt;br /&gt;
# DUST: dustscaling_mode?&lt;br /&gt;
#     =0 --&amp;gt; freedust, tauscaling=1&lt;br /&gt;
#     =1 --&amp;gt; GCM5.3-like, tauscaling&lt;br /&gt;
#     =2 --&amp;gt; tauscaling=1,dust_rad_adjust&lt;br /&gt;
dustscaling_mode=2&lt;br /&gt;
# DUST: dust injection scheme (if &amp;gt;0, use 'dustinjection' ; default=0)&lt;br /&gt;
dustinjection=1&lt;br /&gt;
# DUST: dust injection scheme coefficient (default=0.25)&lt;br /&gt;
coeff_injection=0.25&lt;br /&gt;
# DUST: dust injection scheme initial local time (default=0.)&lt;br /&gt;
ti_injection=0.&lt;br /&gt;
# DUST: dust injection scheme final local time (default=24.)&lt;br /&gt;
tf_injection=24.&lt;br /&gt;
# DUST: Rocket Dust Storm scheme (default=.false.)&lt;br /&gt;
rdstorm=.true.&lt;br /&gt;
# DUST: RDS detrainment coefficient (default=0.02)&lt;br /&gt;
coeff_detrainment=0.02&lt;br /&gt;
# DUST: Dust entrainment by subgrid-scale slope winds (default=.false.)&lt;br /&gt;
topflows=.true.&lt;br /&gt;
&lt;br /&gt;
# DUST/WATERICE: Scavenging by CO2 condensation? (default=.false.)&lt;br /&gt;
scavco2cond = .true.&lt;br /&gt;
# DUST/WATERICE: Gravitationnal sedimentation ? (default=.true.)&lt;br /&gt;
sedimentation = .true.&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note''' that the PCM6 dust cycle has mainly been tested with the non-dust-related flags and parameters that are featured in ''callphys.def.GCM6'' and ''callphys.def.MCD6'' (cf https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/), and in general with the ''*.def'' files (''run.def'', ''traceur.def'', ''z2sig.def'') that are suffixed with ''.GCM6'' or ''.MCD6''. If you depart from these files, even for non-dust related processes, we do not ensure the good tuning of the dust cycle, nor to a lesser extent the good compilation/execution of the model. If this happens, please reach out to us !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Level 2 (developper) : Parametrizations and tunable parameters ==&lt;br /&gt;
The table below sums up all the parameters related to PCM6 Dust Cycle, a short description, their default value in PCM6, a reasonable range that can explored for tuning, and where to find/modify them in the code.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto&amp;quot;&lt;br /&gt;
|+ Caption text&lt;br /&gt;
|-&lt;br /&gt;
! Process !! Parameter !! Description !! Default value !! Reasonable range for tuning !! In the code (D: declaration ; A: assignment ; U: use)&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;7&amp;quot;|Injection &lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Dampening injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''ti_injection'''&amp;lt;/span&amp;gt; || Beginning local time for injection window [h] || style=&amp;quot;text-align:center;&amp;quot;| 0 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 18 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U) ; ''vdifc_mod.F'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''tf_injection'''&amp;lt;/span&amp;gt; || Ending local time for injection window [h] || style=&amp;quot;text-align:center;&amp;quot;| 24 || style=&amp;quot;text-align:center;&amp;quot;| 6 - 24 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U) ; ''vdifc_mod.F'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''reff_lift'''&amp;lt;/span&amp;gt; || Effective radius of injected dust [m] || style=&amp;quot;text-align:center;&amp;quot;| 3e-6 || style=&amp;quot;text-align:center;&amp;quot;| 0.5e-6 - 5e-6 || ''initracer.F'' (D,A,U) ; impacts ''vdifc_mod.F''&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''reff_storm'''&amp;lt;/span&amp;gt; || Effective radius of injected dust when &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;rdstorm&amp;lt;/span&amp;gt;=.true. [m] || style=&amp;quot;text-align:center;&amp;quot;| 3e-6 || style=&amp;quot;text-align:center;&amp;quot;| (should be equal to reff_lift) || ''initracer.F'' (D,A,U) ; impacts ''vdifc_mod.F''&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''nueff_lift'''&amp;lt;/span&amp;gt; || Effective variance of injected dust [no unit] ; is also the variance in the atmosphere &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;nueffdust&amp;lt;/span&amp;gt; || style=&amp;quot;text-align:center;&amp;quot;| 0.5 || style=&amp;quot;text-align:center;&amp;quot;| 0.1 - 0.6 || ''initracer.F'' (D,A,U) ; impacts ''aeroptproperties.F'', ''callsedim_mod.F''&lt;br /&gt;
|-&lt;br /&gt;
|| $$Q_{ext}$$ for &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''alpha_lift(igcm_[dust&amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt;stormdust]_mass)'''&amp;lt;/span&amp;gt; || Extinction coefficient [no unit] used for the lifted mass coefficient ; should depend on &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;reff_[lift&amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt;storm]&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;nueff_lift&amp;lt;/span&amp;gt; || style=&amp;quot;text-align:center;&amp;quot;| 2.4  (hard-coded, no variable) || style=&amp;quot;text-align:center;&amp;quot;| (for $$\nu _{eff}$$=0.5)&lt;br /&gt;
$$r_{eff}$$=3µm -&amp;gt; $$Q_{ext}$$=2.46 ;&lt;br /&gt;
$$r_{eff}$$=2.5µm -&amp;gt; $$Q_{ext}$$=2.5 ;&lt;br /&gt;
$$r_{eff}$$=2µm -&amp;gt; $$Q_{ext}$$=2.6&lt;br /&gt;
|| ''initracer.F'' (A,U) ; impacts ''vdifc_mod.F''&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;|Rocket dust storm&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''mmr_ref'''&amp;lt;/span&amp;gt; || Reference mass mixing ratio [kg/kg] for the rocket dust storm sub-mesh fraction || style=&amp;quot;text-align:center;&amp;quot;| 5e-4 || style=&amp;quot;text-align:center;&amp;quot;|  || ''calcstormfract_mod.F90'' (D,A,U) ; impacts ''rocketduststorm_mod.F90'', ''callradite_mod.F90''&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''fracmin'''&amp;lt;/span&amp;gt; ; &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''fracmax'''&amp;lt;/span&amp;gt; || Bounds for the rocket dust storm sub-mesh fraction [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.01 ; 0.6 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''calcstormfract_mod.F90'' (D,A,U) ; impacts ''rocketduststorm_mod.F90'', ''callradite_mod.F90''&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_detrainment'''&amp;lt;/span&amp;gt; || Detrainment coefficient $$C_{det}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.02 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''rocketduststorm_mod.F90'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;|Mountain top flows&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Dampening injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Dampening injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;|Sedimentation&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Dampening injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Dampening injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reference technical notes :&lt;br /&gt;
* https://www-mars.lmd.jussieu.fr/WP2018/LMD_gcm_report_part1_dust.pdf&lt;br /&gt;
&lt;br /&gt;
* https://www-mars.lmd.jussieu.fr/cnes/2019/LMD_CNES_EXM_gcm6.0.pdf&lt;br /&gt;
&lt;br /&gt;
* https://www-mars.lmd.jussieu.fr/cnes/2020/note_technique_GCM_dust.pdf (calibration of &lt;br /&gt;
&lt;br /&gt;
* https://www-mars.lmd.jussieu.fr/cnes/2021/note_technique_dust_cycle2021.pdf&lt;br /&gt;
&lt;br /&gt;
== What's going on for rocket dust storms and injection : a detailed example through the physics parametrizations ==&lt;br /&gt;
We detail below the successive steps and processes performed concerning the coupling between the rocket dust storms and the dust injection. We place ourselves in one column of the model, which will serve as an example. The Fortran subroutines that are involved at each step are referred as '''''subroutine'''''.&lt;br /&gt;
&lt;br /&gt;
0. as we reach 2pm in this column, we read and interpolate the value of the optical depth scenario for the next day ('''''compute_dtau'''''). Let's say the scenario features an opacity of 5 (big dusty event), while the current day's GCM column has an opacity of 1 (which has been computed before, in '''''aeropacity''''')&lt;br /&gt;
&lt;br /&gt;
1. ('''''compute_dtau''''') we calculate the optical depth difference dtau=5-1=4, then what this means in terms of dust mass to be added to the atmosphere, assuming an effective size reff_lift = 3µm by default (defined in '''''initracer'''''). We dampen this quantity of dust by a coefficient Cinj (=0.25 by default) to take into account that the jump in tau_pref_scenario from the current day to the next may not come from local injection but from transport from adjacent meshes. For the values considered in this example, this gives an injection of ~5e-8 kg/m²/s.&lt;br /&gt;
&lt;br /&gt;
2. all this dust is injected uniformly during the injection window, by default between 2 p.m. this day and 2 p.m. the next day (when we are supposed to reach the scenario target), in the form of stormdust into the 1st layer by '''''vdifc''''', which already mixes it a little on several layers. Then this stormdust undergoes processes like thermals ('''''calltherm_interface'''''), convective adjustment ('''''convadj''''') and sedimentation ('''''callsedim''''') that further mix it in the atmosphere. For the latter, stormdust is prevented from falling to the ground, and remains in the 1st layer instead. We need to do so, because the main process responsible for the stormdust rising, represented by the routine '''''rocketduststorm''''', only happens at the beginning of the next timestep (see point 5).&lt;br /&gt;
&lt;br /&gt;
3. the stormdust is further mixed by the dynamics, and may also be transported to adjacent meshes. The column may also receive stormdust from other meshes.&lt;br /&gt;
&lt;br /&gt;
4. once back to the next physical time step, we calculate a sub-mesh fraction that is representative of the size of the stormdust plume ('''''calcstormfract'''''). To do so, we use the maximum mass mixing ratio of stormdust in the entire column (apart from the 1st layer), and compute the sub-mesh fraction that is needed to reach a reference mixing ratio mmr_ref=5e-4kg/kg. This reference mmr is a value that we consider representative of an opacity of 10 that was measured in a local dust storm by OMEGA, given some assumptions like a vertical extent of $$\Delta P$$=200Pa for the dust plume (''see also Wang et al. 2018, JGRPlanets, doi:10.1002/2017JE005255'').&lt;br /&gt;
&lt;br /&gt;
5. finally, we enter the '''''rocketduststorm''''' routine, where we check whether anywhere in the column, the mmr of stormdust (not concentrated in the sub-mesh fraction, but expanded to the whole mesh) is greater than $$10^{-4}$$ times that of background dust. If so, we activate the scheme in the column, and calculate the heating difference between the sub-mesh fraction (where we have concentrated stormdust, and background dust) and the rest of the mesh (only background dust), the resulting vertical transport in the sub-mesh fraction, and the horizontal detrainment where the stormdust plume vertical velocity decreases. If there is not enough stormdust compared to background dust at any level, the stormdust is detrained into background dust at all levels of the column.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Mars-Model]]&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1805</id>
		<title>Dust Cycle in Mars PCM6</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1805"/>
				<updated>2024-01-05T19:17:38Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: /* Level 2 (developper) : Parametrizations and tunable parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details at different levels how to use and what is featured in the dust cycle in Mars PCM6. '''This is still work in progress for now !'''&lt;br /&gt;
&lt;br /&gt;
== Level 1 (user) : Flags for PCM6 dust cycle ==&lt;br /&gt;
To run a simulation with the PCM6 dust cycle, you need to set up several flags and parameters in your ''callphys.def'' (see an example here: https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/callphys.def.GCM6)&lt;br /&gt;
&lt;br /&gt;
We list below all the relevant flags and parameters directly related to PCM6 dust cycle :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line&amp;gt;&lt;br /&gt;
##General options&lt;br /&gt;
##~~~~~~~~~~~~~~~&lt;br /&gt;
#Directory where external input files are:&lt;br /&gt;
datadir=/path/to/datadir&lt;br /&gt;
&lt;br /&gt;
#Run with or without tracer transport ?&lt;br /&gt;
tracer=.true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
## Dust scenario. Used to prescribe the dust&lt;br /&gt;
## ~~~~~~~~~~~~~&lt;br /&gt;
#  =1 Dust opt.deph read in startfi; =2 Viking scenario; =3 MGS scenario [default],&lt;br /&gt;
#  =4 Mars Year 24 from TES assimilation (old version of MY24; dust_tes.nc file)&lt;br /&gt;
#  =6 &amp;quot;cold&amp;quot; (low dust) scenario ; =7 &amp;quot;warm&amp;quot; (high dust) scenario&lt;br /&gt;
#  =8 &amp;quot;climatology&amp;quot; (our best guess of a typical Mars year) scenario&lt;br /&gt;
#  =24 Mars Year 24 from TES assimilation (ie: MCD reference case)&lt;br /&gt;
#  =25 Mars Year 25 from TES assimilation (ie: a year with a global dust storm)&lt;br /&gt;
#  =26 Mars Year 26 from TES assimilation&lt;br /&gt;
#  ...&lt;br /&gt;
#  =35 Mars Year 35 from observers assimilation&lt;br /&gt;
iaervar = 8&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# Dust IR opacity ref. wavelength (for dso diagnostics only)&lt;br /&gt;
# &amp;quot;tes&amp;quot; (9.3 microns) [default] or &amp;quot;mcs&amp;quot; (21.6 microns)&lt;br /&gt;
dustiropacity = tes&lt;br /&gt;
# Use an IR to VIS scenario conversion coefficient that is&lt;br /&gt;
# dependent on the GCM dust effective radius,&lt;br /&gt;
# instead of a fixed 2.6 coefficient ?&lt;br /&gt;
#(only if dustiropacity = tes ; default = .false.)&lt;br /&gt;
reff_driven_IRtoVIS_scenario = .true.&lt;br /&gt;
&lt;br /&gt;
## Physical Parameterizations :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# call radiative transfer ? (default=.true.)&lt;br /&gt;
callrad   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
## Radiative transfer options :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# SCATTERERS: set number of scatterers.&lt;br /&gt;
# Must be compliant with other options: +1 if active, +1 if rdstorm, +1 if topflows, +1 if activice ; default=1)&lt;br /&gt;
naerkind = 4&lt;br /&gt;
&lt;br /&gt;
## Tracer (dust water, ice and/or chemical species) options (used if tracer=T):&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# DUST: Transported dust ? (if &amp;gt;0, use 'dustbin' dust bins ; default=0)&lt;br /&gt;
dustbin    = 2&lt;br /&gt;
# DUST: Radiatively active dust ? (matters if dustbin&amp;gt;0 ; default=.false.)&lt;br /&gt;
active  = .true.&lt;br /&gt;
# DUST: use mass and number mixing ratios to predict dust size ? (default=.false.)&lt;br /&gt;
doubleq   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: lifted by GCM surface winds ? (default=.false.)&lt;br /&gt;
lifting = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: Scavenging by H2O snowfall ? (default=.false.)&lt;br /&gt;
scavenging = .true.&lt;br /&gt;
&lt;br /&gt;
# DUST: freedust ? (default=.false.)&lt;br /&gt;
freedust=.true.&lt;br /&gt;
# DUST: dustscaling_mode?&lt;br /&gt;
#     =0 --&amp;gt; freedust, tauscaling=1&lt;br /&gt;
#     =1 --&amp;gt; GCM5.3-like, tauscaling&lt;br /&gt;
#     =2 --&amp;gt; tauscaling=1,dust_rad_adjust&lt;br /&gt;
dustscaling_mode=2&lt;br /&gt;
# DUST: dust injection scheme (if &amp;gt;0, use 'dustinjection' ; default=0)&lt;br /&gt;
dustinjection=1&lt;br /&gt;
# DUST: dust injection scheme coefficient (default=0.25)&lt;br /&gt;
coeff_injection=0.25&lt;br /&gt;
# DUST: dust injection scheme initial local time (default=0.)&lt;br /&gt;
ti_injection=0.&lt;br /&gt;
# DUST: dust injection scheme final local time (default=24.)&lt;br /&gt;
tf_injection=24.&lt;br /&gt;
# DUST: Rocket Dust Storm scheme (default=.false.)&lt;br /&gt;
rdstorm=.true.&lt;br /&gt;
# DUST: RDS detrainment coefficient (default=0.02)&lt;br /&gt;
coeff_detrainment=0.02&lt;br /&gt;
# DUST: Dust entrainment by subgrid-scale slope winds (default=.false.)&lt;br /&gt;
topflows=.true.&lt;br /&gt;
&lt;br /&gt;
# DUST/WATERICE: Scavenging by CO2 condensation? (default=.false.)&lt;br /&gt;
scavco2cond = .true.&lt;br /&gt;
# DUST/WATERICE: Gravitationnal sedimentation ? (default=.true.)&lt;br /&gt;
sedimentation = .true.&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note''' that the PCM6 dust cycle has mainly been tested with the non-dust-related flags and parameters that are featured in ''callphys.def.GCM6'' and ''callphys.def.MCD6'' (cf https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/), and in general with the ''*.def'' files (''run.def'', ''traceur.def'', ''z2sig.def'') that are suffixed with ''.GCM6'' or ''.MCD6''. If you depart from these files, even for non-dust related processes, we do not ensure the good tuning of the dust cycle, nor to a lesser extent the good compilation/execution of the model. If this happens, please reach out to us !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Level 2 (developper) : Parametrizations and tunable parameters ==&lt;br /&gt;
The table below sums up all the parameters related to PCM6 Dust Cycle, a short description, their default value in PCM6, a reasonable range that can explored for tuning, and where to find/modify them in the code.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto&amp;quot;&lt;br /&gt;
|+ Caption text&lt;br /&gt;
|-&lt;br /&gt;
! Process !! Parameter !! Description !! Default value !! Reasonable range for tuning !! In the code (D: declaration ; A: assignment ; U: use)&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;7&amp;quot;|Injection &lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Dampening injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''ti_injection'''&amp;lt;/span&amp;gt; || Beginning local time for injection window [h] || style=&amp;quot;text-align:center;&amp;quot;| 0 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 18 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U) ; ''vdifc_mod.F'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''tf_injection'''&amp;lt;/span&amp;gt; || Ending local time for injection window [h] || style=&amp;quot;text-align:center;&amp;quot;| 24 || style=&amp;quot;text-align:center;&amp;quot;| 6 - 24 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U) ; ''vdifc_mod.F'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''reff_lift'''&amp;lt;/span&amp;gt; || Effective radius of injected dust [m] || style=&amp;quot;text-align:center;&amp;quot;| 3e-6 || style=&amp;quot;text-align:center;&amp;quot;| 0.5e-6 - 5e-6 || ''initracer.F'' (D,A,U) ; impacts ''vdifc_mod.F''&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''reff_storm'''&amp;lt;/span&amp;gt; || Effective radius of injected dust when &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;rdstorm&amp;lt;/span&amp;gt;=.true. [m] || style=&amp;quot;text-align:center;&amp;quot;| 3e-6 || style=&amp;quot;text-align:center;&amp;quot;| (should be equal to reff_lift) || ''initracer.F'' (D,A,U) ; impacts ''vdifc_mod.F''&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''nueff_lift'''&amp;lt;/span&amp;gt; || Effective variance of injected dust [no unit] ; is also the variance in the atmosphere &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;nueffdust&amp;lt;/span&amp;gt; || style=&amp;quot;text-align:center;&amp;quot;| 0.5 || style=&amp;quot;text-align:center;&amp;quot;| 0.1 - 0.6 || ''initracer.F'' (D,A,U) ; impacts ''aeroptproperties.F'', ''callsedim_mod.F''&lt;br /&gt;
|-&lt;br /&gt;
|| $$Q_{ext}$$ for &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''alpha_lift(igcm_[dust&amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt;stormdust]_mass)'''&amp;lt;/span&amp;gt; || Extinction coefficient [no unit] used for the lifted mass coefficient ; should depend on &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;reff_[lift&amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt;storm]&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;nueff_lift&amp;lt;/span&amp;gt; || style=&amp;quot;text-align:center;&amp;quot;| 2.4  (hard-coded, no variable) || style=&amp;quot;text-align:center;&amp;quot;| (for $$\nu _{eff}$$=0.5)&lt;br /&gt;
$$r_{eff}$$=3µm -&amp;gt; $$Q_{ext}$$=2.46 ;&lt;br /&gt;
$$r_{eff}$$=2.5µm -&amp;gt; $$Q_{ext}$$=2.5 ;&lt;br /&gt;
$$r_{eff}$$=2µm -&amp;gt; $$Q_{ext}$$=2.6&lt;br /&gt;
|| ''initracer.F'' (A,U) ; impacts ''vdifc_mod.F''&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot;|Rocket dust storm&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''mmr_ref'''&amp;lt;/span&amp;gt; || Reference mass mixing ratio [kg/kg] for the rocket dust storm sub-mesh fraction || style=&amp;quot;text-align:center;&amp;quot;| 5e-4 || style=&amp;quot;text-align:center;&amp;quot;|  || ''calcstormfract_mod.F90'' (D,A,U) ; impacts ''rocketduststorm_mod.F90'', ''callradite_mod.F90''&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''fracmin'''&amp;lt;/span&amp;gt; ; &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''fracmax'''&amp;lt;/span&amp;gt; || Bounds for the rocket dust storm sub-mesh fraction [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.01 ; 0.6 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''calcstormfract_mod.F90'' (D,A,U) ; impacts ''rocketduststorm_mod.F90'', ''callradite_mod.F90''&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_detrainment'''&amp;lt;/span&amp;gt; || Detrainment coefficient $$C_{det}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.02 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''rocketduststorm_mod.F90'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Dampening injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;|Mountain top flows&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Dampening injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Dampening injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;|Sedimentation&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Dampening injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Dampening injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reference technical notes :&lt;br /&gt;
* https://www-mars.lmd.jussieu.fr/WP2018/LMD_gcm_report_part1_dust.pdf&lt;br /&gt;
&lt;br /&gt;
* https://www-mars.lmd.jussieu.fr/cnes/2019/LMD_CNES_EXM_gcm6.0.pdf&lt;br /&gt;
&lt;br /&gt;
* https://www-mars.lmd.jussieu.fr/cnes/2020/note_technique_GCM_dust.pdf (calibration of &lt;br /&gt;
&lt;br /&gt;
* https://www-mars.lmd.jussieu.fr/cnes/2021/note_technique_dust_cycle2021.pdf&lt;br /&gt;
&lt;br /&gt;
== What's going on for rocket dust storms and injection : a detailed example through the physics parametrizations ==&lt;br /&gt;
We detail below the successive steps and processes performed concerning the coupling between the rocket dust storms and the dust injection. We place ourselves in one column of the model, which will serve as an example. The Fortran subroutines that are involved at each step are referred as '''''subroutine'''''.&lt;br /&gt;
&lt;br /&gt;
0. as we reach 2pm in this column, we read and interpolate the value of the optical depth scenario for the next day ('''''compute_dtau'''''). Let's say the scenario features an opacity of 5 (big dusty event), while the current day's GCM column has an opacity of 1 (which has been computed before, in '''''aeropacity''''')&lt;br /&gt;
&lt;br /&gt;
1. ('''''compute_dtau''''') we calculate the optical depth difference dtau=5-1=4, then what this means in terms of dust mass to be added to the atmosphere, assuming an effective size reff_lift = 3µm by default (defined in '''''initracer'''''). We dampen this quantity of dust by a coefficient Cinj (=0.25 by default) to take into account that the jump in tau_pref_scenario from the current day to the next may not come from local injection but from transport from adjacent meshes. For the values considered in this example, this gives an injection of ~5e-8 kg/m²/s.&lt;br /&gt;
&lt;br /&gt;
2. all this dust is injected uniformly during the injection window, by default between 2 p.m. this day and 2 p.m. the next day (when we are supposed to reach the scenario target), in the form of stormdust into the 1st layer by '''''vdifc''''', which already mixes it a little on several layers. Then this stormdust undergoes processes like thermals ('''''calltherm_interface'''''), convective adjustment ('''''convadj''''') and sedimentation ('''''callsedim''''') that further mix it in the atmosphere. For the latter, stormdust is prevented from falling to the ground, and remains in the 1st layer instead. We need to do so, because the main process responsible for the stormdust rising, represented by the routine '''''rocketduststorm''''', only happens at the beginning of the next timestep (see point 5).&lt;br /&gt;
&lt;br /&gt;
3. the stormdust is further mixed by the dynamics, and may also be transported to adjacent meshes. The column may also receive stormdust from other meshes.&lt;br /&gt;
&lt;br /&gt;
4. once back to the next physical time step, we calculate a sub-mesh fraction that is representative of the size of the stormdust plume ('''''calcstormfract'''''). To do so, we use the maximum mass mixing ratio of stormdust in the entire column (apart from the 1st layer), and compute the sub-mesh fraction that is needed to reach a reference mixing ratio mmr_ref=5e-4kg/kg. This reference mmr is a value that we consider representative of an opacity of 10 that was measured in a local dust storm by OMEGA, given some assumptions like a vertical extent of $$\Delta P$$=200Pa for the dust plume (''see also Wang et al. 2018, JGRPlanets, doi:10.1002/2017JE005255'').&lt;br /&gt;
&lt;br /&gt;
5. finally, we enter the '''''rocketduststorm''''' routine, where we check whether anywhere in the column, the mmr of stormdust (not concentrated in the sub-mesh fraction, but expanded to the whole mesh) is greater than $$10^{-4}$$ times that of background dust. If so, we activate the scheme in the column, and calculate the heating difference between the sub-mesh fraction (where we have concentrated stormdust, and background dust) and the rest of the mesh (only background dust), the resulting vertical transport in the sub-mesh fraction, and the horizontal detrainment where the stormdust plume vertical velocity decreases. If there is not enough stormdust compared to background dust at any level, the stormdust is detrained into background dust at all levels of the column.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Mars-Model]]&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1804</id>
		<title>Dust Cycle in Mars PCM6</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1804"/>
				<updated>2024-01-05T14:49:20Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: /* Level 2 (developper) : Parametrizations and tunable parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details at different levels how to use and what is featured in the dust cycle in Mars PCM6. '''This is still work in progress for now !'''&lt;br /&gt;
&lt;br /&gt;
== Level 1 (user) : Flags for PCM6 dust cycle ==&lt;br /&gt;
To run a simulation with the PCM6 dust cycle, you need to set up several flags and parameters in your ''callphys.def'' (see an example here: https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/callphys.def.GCM6)&lt;br /&gt;
&lt;br /&gt;
We list below all the relevant flags and parameters directly related to PCM6 dust cycle :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line&amp;gt;&lt;br /&gt;
##General options&lt;br /&gt;
##~~~~~~~~~~~~~~~&lt;br /&gt;
#Directory where external input files are:&lt;br /&gt;
datadir=/path/to/datadir&lt;br /&gt;
&lt;br /&gt;
#Run with or without tracer transport ?&lt;br /&gt;
tracer=.true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
## Dust scenario. Used to prescribe the dust&lt;br /&gt;
## ~~~~~~~~~~~~~&lt;br /&gt;
#  =1 Dust opt.deph read in startfi; =2 Viking scenario; =3 MGS scenario [default],&lt;br /&gt;
#  =4 Mars Year 24 from TES assimilation (old version of MY24; dust_tes.nc file)&lt;br /&gt;
#  =6 &amp;quot;cold&amp;quot; (low dust) scenario ; =7 &amp;quot;warm&amp;quot; (high dust) scenario&lt;br /&gt;
#  =8 &amp;quot;climatology&amp;quot; (our best guess of a typical Mars year) scenario&lt;br /&gt;
#  =24 Mars Year 24 from TES assimilation (ie: MCD reference case)&lt;br /&gt;
#  =25 Mars Year 25 from TES assimilation (ie: a year with a global dust storm)&lt;br /&gt;
#  =26 Mars Year 26 from TES assimilation&lt;br /&gt;
#  ...&lt;br /&gt;
#  =35 Mars Year 35 from observers assimilation&lt;br /&gt;
iaervar = 8&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# Dust IR opacity ref. wavelength (for dso diagnostics only)&lt;br /&gt;
# &amp;quot;tes&amp;quot; (9.3 microns) [default] or &amp;quot;mcs&amp;quot; (21.6 microns)&lt;br /&gt;
dustiropacity = tes&lt;br /&gt;
# Use an IR to VIS scenario conversion coefficient that is&lt;br /&gt;
# dependent on the GCM dust effective radius,&lt;br /&gt;
# instead of a fixed 2.6 coefficient ?&lt;br /&gt;
#(only if dustiropacity = tes ; default = .false.)&lt;br /&gt;
reff_driven_IRtoVIS_scenario = .true.&lt;br /&gt;
&lt;br /&gt;
## Physical Parameterizations :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# call radiative transfer ? (default=.true.)&lt;br /&gt;
callrad   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
## Radiative transfer options :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# SCATTERERS: set number of scatterers.&lt;br /&gt;
# Must be compliant with other options: +1 if active, +1 if rdstorm, +1 if topflows, +1 if activice ; default=1)&lt;br /&gt;
naerkind = 4&lt;br /&gt;
&lt;br /&gt;
## Tracer (dust water, ice and/or chemical species) options (used if tracer=T):&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# DUST: Transported dust ? (if &amp;gt;0, use 'dustbin' dust bins ; default=0)&lt;br /&gt;
dustbin    = 2&lt;br /&gt;
# DUST: Radiatively active dust ? (matters if dustbin&amp;gt;0 ; default=.false.)&lt;br /&gt;
active  = .true.&lt;br /&gt;
# DUST: use mass and number mixing ratios to predict dust size ? (default=.false.)&lt;br /&gt;
doubleq   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: lifted by GCM surface winds ? (default=.false.)&lt;br /&gt;
lifting = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: Scavenging by H2O snowfall ? (default=.false.)&lt;br /&gt;
scavenging = .true.&lt;br /&gt;
&lt;br /&gt;
# DUST: freedust ? (default=.false.)&lt;br /&gt;
freedust=.true.&lt;br /&gt;
# DUST: dustscaling_mode?&lt;br /&gt;
#     =0 --&amp;gt; freedust, tauscaling=1&lt;br /&gt;
#     =1 --&amp;gt; GCM5.3-like, tauscaling&lt;br /&gt;
#     =2 --&amp;gt; tauscaling=1,dust_rad_adjust&lt;br /&gt;
dustscaling_mode=2&lt;br /&gt;
# DUST: dust injection scheme (if &amp;gt;0, use 'dustinjection' ; default=0)&lt;br /&gt;
dustinjection=1&lt;br /&gt;
# DUST: dust injection scheme coefficient (default=0.25)&lt;br /&gt;
coeff_injection=0.25&lt;br /&gt;
# DUST: dust injection scheme initial local time (default=0.)&lt;br /&gt;
ti_injection=0.&lt;br /&gt;
# DUST: dust injection scheme final local time (default=24.)&lt;br /&gt;
tf_injection=24.&lt;br /&gt;
# DUST: Rocket Dust Storm scheme (default=.false.)&lt;br /&gt;
rdstorm=.true.&lt;br /&gt;
# DUST: RDS detrainment coefficient (default=0.02)&lt;br /&gt;
coeff_detrainment=0.02&lt;br /&gt;
# DUST: Dust entrainment by subgrid-scale slope winds (default=.false.)&lt;br /&gt;
topflows=.true.&lt;br /&gt;
&lt;br /&gt;
# DUST/WATERICE: Scavenging by CO2 condensation? (default=.false.)&lt;br /&gt;
scavco2cond = .true.&lt;br /&gt;
# DUST/WATERICE: Gravitationnal sedimentation ? (default=.true.)&lt;br /&gt;
sedimentation = .true.&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note''' that the PCM6 dust cycle has mainly been tested with the non-dust-related flags and parameters that are featured in ''callphys.def.GCM6'' and ''callphys.def.MCD6'' (cf https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/), and in general with the ''*.def'' files (''run.def'', ''traceur.def'', ''z2sig.def'') that are suffixed with ''.GCM6'' or ''.MCD6''. If you depart from these files, even for non-dust related processes, we do not ensure the good tuning of the dust cycle, nor to a lesser extent the good compilation/execution of the model. If this happens, please reach out to us !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Level 2 (developper) : Parametrizations and tunable parameters ==&lt;br /&gt;
The table below sums up all the parameters related to PCM6 Dust Cycle, a short description, their default value in PCM6, a reasonable range that can explored for tuning, and where to find/modify them in the code.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto&amp;quot;&lt;br /&gt;
|+ Caption text&lt;br /&gt;
|-&lt;br /&gt;
! Process !! Parameter !! Description !! Default value !! Reasonable range for tuning !! In the code (D: declaration ; A: assignment ; U: use)&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;7&amp;quot;|Injection &lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Dampening injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''ti_injection'''&amp;lt;/span&amp;gt; || Beginning local time for injection window [h] || style=&amp;quot;text-align:center;&amp;quot;| 0 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 18 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U) ; ''vdifc_mod.F'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''tf_injection'''&amp;lt;/span&amp;gt; || Ending local time for injection window [h] || style=&amp;quot;text-align:center;&amp;quot;| 24 || style=&amp;quot;text-align:center;&amp;quot;| 6 - 24 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U) ; ''vdifc_mod.F'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''reff_lift'''&amp;lt;/span&amp;gt; || Effective radius of injected dust [m] || style=&amp;quot;text-align:center;&amp;quot;| 3e-6 || style=&amp;quot;text-align:center;&amp;quot;| 0.5e-6 - 5e-6 || ''initracer.F'' (D,A,U) ; impacts ''vdifc_mod.F''&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''reff_storm'''&amp;lt;/span&amp;gt; || Effective radius of injected dust when &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;rdstorm&amp;lt;/span&amp;gt;=.true. [m] || style=&amp;quot;text-align:center;&amp;quot;| 3e-6 || style=&amp;quot;text-align:center;&amp;quot;| (should be equal to reff_lift) || ''initracer.F'' (D,A,U) ; impacts ''vdifc_mod.F''&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''nueff_lift'''&amp;lt;/span&amp;gt; || Effective variance of injected dust [no unit] ; is also the variance in the atmosphere &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;nueffdust&amp;lt;/span&amp;gt; || style=&amp;quot;text-align:center;&amp;quot;| 0.5 || style=&amp;quot;text-align:center;&amp;quot;| 0.1 - 0.6 || ''initracer.F'' (D,A,U) ; impacts ''aeroptproperties.F'', ''callsedim_mod.F''&lt;br /&gt;
|-&lt;br /&gt;
|| $$Q_{ext}$$ for &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''alpha_lift(igcm_[dust&amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt;stormdust]_mass)'''&amp;lt;/span&amp;gt; || Extinction coefficient [no unit] used for the lifted mass coefficient ; should depend on &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;reff_[lift&amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt;storm]&amp;lt;/span&amp;gt; and &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;nueff_lift&amp;lt;/span&amp;gt; || style=&amp;quot;text-align:center;&amp;quot;| 2.4 (hard-coded, no variable) || style=&amp;quot;text-align:center;&amp;quot;| (for $$\nu _{eff}$$=0.5)&lt;br /&gt;
$$r_{eff}$$=3µm -&amp;gt; $$Q_{ext}$$=2.46 ;&lt;br /&gt;
$$r_{eff}$$=2.5µm -&amp;gt; $$Q_{ext}$$=2.5 ;&lt;br /&gt;
$$r_{eff}$$=2µm -&amp;gt; $$Q_{ext}$$=2.6&lt;br /&gt;
|| ''initracer.F'' (A,U) ; impacts ''vdifc_mod.F''&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;|Rocket dust storm&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_detrainment'''&amp;lt;/span&amp;gt; || Detrainment coefficient $$C_{det}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.02 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''rocketduststorm_mod.F90'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Dampening injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;|Mountain top flows&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Dampening injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Dampening injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=&amp;quot;2&amp;quot;|Sedimentation&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Dampening injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U)&lt;br /&gt;
|-&lt;br /&gt;
|| &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;'''coeff_injection'''&amp;lt;/span&amp;gt; || Dampening injection coefficient $$C_{inj}$$ [no unit] || style=&amp;quot;text-align:center;&amp;quot;| 0.25 || style=&amp;quot;text-align:center;&amp;quot;| 0 - 1 || ''callkeys.h'' (D) ; ''conf_phys.F'' (A) ; ''compute_dtau_mod.F90'' (U)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reference technical notes :&lt;br /&gt;
&lt;br /&gt;
* https://www-mars.lmd.jussieu.fr/cnes/2019/LMD_CNES_EXM_gcm6.0.pdf&lt;br /&gt;
&lt;br /&gt;
* https://www-mars.lmd.jussieu.fr/cnes/2020/note_technique_GCM_dust.pdf (calibration of &lt;br /&gt;
&lt;br /&gt;
* https://www-mars.lmd.jussieu.fr/cnes/2021/note_technique_dust_cycle2021.pdf&lt;br /&gt;
&lt;br /&gt;
== What's going on for rocket dust storms and injection : a detailed example through the physics parametrizations ==&lt;br /&gt;
We detail below the successive steps and processes performed concerning the coupling between the rocket dust storms and the dust injection. We place ourselves in one column of the model, which will serve as an example. The Fortran subroutines that are involved at each step are referred as '''''subroutine'''''.&lt;br /&gt;
&lt;br /&gt;
0. as we reach 2pm in this column, we read and interpolate the value of the optical depth scenario for the next day ('''''compute_dtau'''''). Let's say the scenario features an opacity of 5 (big dusty event), while the current day's GCM column has an opacity of 1 (which has been computed before, in '''''aeropacity''''')&lt;br /&gt;
&lt;br /&gt;
1. ('''''compute_dtau''''') we calculate the optical depth difference dtau=5-1=4, then what this means in terms of dust mass to be added to the atmosphere, assuming an effective size reff_lift = 3µm by default (defined in '''''initracer'''''). We dampen this quantity of dust by a coefficient Cinj (=0.25 by default) to take into account that the jump in tau_pref_scenario from the current day to the next may not come from local injection but from transport from adjacent meshes. For the values considered in this example, this gives an injection of ~5e-8 kg/m²/s.&lt;br /&gt;
&lt;br /&gt;
2. all this dust is injected uniformly during the injection window, by default between 2 p.m. this day and 2 p.m. the next day (when we are supposed to reach the scenario target), in the form of stormdust into the 1st layer by '''''vdifc''''', which already mixes it a little on several layers. Then this stormdust undergoes processes like thermals ('''''calltherm_interface'''''), convective adjustment ('''''convadj''''') and sedimentation ('''''callsedim''''') that further mix it in the atmosphere. For the latter, stormdust is prevented from falling to the ground, and remains in the 1st layer instead. We need to do so, because the main process responsible for the stormdust rising, represented by the routine '''''rocketduststorm''''', only happens at the beginning of the next timestep (see point 5).&lt;br /&gt;
&lt;br /&gt;
3. the stormdust is further mixed by the dynamics, and may also be transported to adjacent meshes. The column may also receive stormdust from other meshes.&lt;br /&gt;
&lt;br /&gt;
4. once back to the next physical time step, we calculate a sub-mesh fraction that is representative of the size of the stormdust plume ('''''calcstormfract'''''). To do so, we use the maximum mass mixing ratio of stormdust in the entire column (apart from the 1st layer), and compute the sub-mesh fraction that is needed to reach a reference mixing ratio mmr_ref=5e-4kg/kg. This reference mmr is a value that we consider representative of an opacity of 10 that was measured in a local dust storm by OMEGA, given some assumptions like a vertical extent of $$\Delta P$$=200Pa for the dust plume (''see also Wang et al. 2018, JGRPlanets, doi:10.1002/2017JE005255'').&lt;br /&gt;
&lt;br /&gt;
5. finally, we enter the '''''rocketduststorm''''' routine, where we check whether anywhere in the column, the mmr of stormdust (not concentrated in the sub-mesh fraction, but expanded to the whole mesh) is greater than $$10^{-4}$$ times that of background dust. If so, we activate the scheme in the column, and calculate the heating difference between the sub-mesh fraction (where we have concentrated stormdust, and background dust) and the rest of the mesh (only background dust), the resulting vertical transport in the sub-mesh fraction, and the horizontal detrainment where the stormdust plume vertical velocity decreases. If there is not enough stormdust compared to background dust at any level, the stormdust is detrained into background dust at all levels of the column.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Mars-Model]]&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1797</id>
		<title>Dust Cycle in Mars PCM6</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1797"/>
				<updated>2024-01-05T11:31:21Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: /* Level 2 (developper) : Parametrizations and tunable parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details at different levels how to use and what is featured in the dust cycle in Mars PCM6. '''This is still work in progress for now !'''&lt;br /&gt;
&lt;br /&gt;
== Level 1 (user) : Flags for PCM6 dust cycle ==&lt;br /&gt;
To run a simulation with the PCM6 dust cycle, you need to set up several flags and parameters in your ''callphys.def'' (see an example here: https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/callphys.def.GCM6)&lt;br /&gt;
&lt;br /&gt;
We list below all the relevant flags and parameters directly related to PCM6 dust cycle :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line&amp;gt;&lt;br /&gt;
##General options&lt;br /&gt;
##~~~~~~~~~~~~~~~&lt;br /&gt;
#Directory where external input files are:&lt;br /&gt;
datadir=/path/to/datadir&lt;br /&gt;
&lt;br /&gt;
#Run with or without tracer transport ?&lt;br /&gt;
tracer=.true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
## Dust scenario. Used to prescribe the dust&lt;br /&gt;
## ~~~~~~~~~~~~~&lt;br /&gt;
#  =1 Dust opt.deph read in startfi; =2 Viking scenario; =3 MGS scenario [default],&lt;br /&gt;
#  =4 Mars Year 24 from TES assimilation (old version of MY24; dust_tes.nc file)&lt;br /&gt;
#  =6 &amp;quot;cold&amp;quot; (low dust) scenario ; =7 &amp;quot;warm&amp;quot; (high dust) scenario&lt;br /&gt;
#  =8 &amp;quot;climatology&amp;quot; (our best guess of a typical Mars year) scenario&lt;br /&gt;
#  =24 Mars Year 24 from TES assimilation (ie: MCD reference case)&lt;br /&gt;
#  =25 Mars Year 25 from TES assimilation (ie: a year with a global dust storm)&lt;br /&gt;
#  =26 Mars Year 26 from TES assimilation&lt;br /&gt;
#  ...&lt;br /&gt;
#  =35 Mars Year 35 from observers assimilation&lt;br /&gt;
iaervar = 8&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# Dust IR opacity ref. wavelength (for dso diagnostics only)&lt;br /&gt;
# &amp;quot;tes&amp;quot; (9.3 microns) [default] or &amp;quot;mcs&amp;quot; (21.6 microns)&lt;br /&gt;
dustiropacity = tes&lt;br /&gt;
# Use an IR to VIS scenario conversion coefficient that is&lt;br /&gt;
# dependent on the GCM dust effective radius,&lt;br /&gt;
# instead of a fixed 2.6 coefficient ?&lt;br /&gt;
#(only if dustiropacity = tes ; default = .false.)&lt;br /&gt;
reff_driven_IRtoVIS_scenario = .true.&lt;br /&gt;
&lt;br /&gt;
## Physical Parameterizations :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# call radiative transfer ? (default=.true.)&lt;br /&gt;
callrad   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
## Radiative transfer options :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# SCATTERERS: set number of scatterers.&lt;br /&gt;
# Must be compliant with other options: +1 if active, +1 if rdstorm, +1 if topflows, +1 if activice ; default=1)&lt;br /&gt;
naerkind = 4&lt;br /&gt;
&lt;br /&gt;
## Tracer (dust water, ice and/or chemical species) options (used if tracer=T):&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# DUST: Transported dust ? (if &amp;gt;0, use 'dustbin' dust bins ; default=0)&lt;br /&gt;
dustbin    = 2&lt;br /&gt;
# DUST: Radiatively active dust ? (matters if dustbin&amp;gt;0 ; default=.false.)&lt;br /&gt;
active  = .true.&lt;br /&gt;
# DUST: use mass and number mixing ratios to predict dust size ? (default=.false.)&lt;br /&gt;
doubleq   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: lifted by GCM surface winds ? (default=.false.)&lt;br /&gt;
lifting = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: Scavenging by H2O snowfall ? (default=.false.)&lt;br /&gt;
scavenging = .true.&lt;br /&gt;
&lt;br /&gt;
# DUST: freedust ? (default=.false.)&lt;br /&gt;
freedust=.true.&lt;br /&gt;
# DUST: dustscaling_mode?&lt;br /&gt;
#     =0 --&amp;gt; freedust, tauscaling=1&lt;br /&gt;
#     =1 --&amp;gt; GCM5.3-like, tauscaling&lt;br /&gt;
#     =2 --&amp;gt; tauscaling=1,dust_rad_adjust&lt;br /&gt;
dustscaling_mode=2&lt;br /&gt;
# DUST: dust injection scheme (if &amp;gt;0, use 'dustinjection' ; default=0)&lt;br /&gt;
dustinjection=1&lt;br /&gt;
# DUST: dust injection scheme coefficient (default=0.25)&lt;br /&gt;
coeff_injection=0.25&lt;br /&gt;
# DUST: dust injection scheme initial local time (default=0.)&lt;br /&gt;
ti_injection=0.&lt;br /&gt;
# DUST: dust injection scheme final local time (default=24.)&lt;br /&gt;
tf_injection=24.&lt;br /&gt;
# DUST: Rocket Dust Storm scheme (default=.false.)&lt;br /&gt;
rdstorm=.true.&lt;br /&gt;
# DUST: RDS detrainment coefficient (default=0.02)&lt;br /&gt;
coeff_detrainment=0.02&lt;br /&gt;
# DUST: Dust entrainment by subgrid-scale slope winds (default=.false.)&lt;br /&gt;
topflows=.true.&lt;br /&gt;
&lt;br /&gt;
# DUST/WATERICE: Scavenging by CO2 condensation? (default=.false.)&lt;br /&gt;
scavco2cond = .true.&lt;br /&gt;
# DUST/WATERICE: Gravitationnal sedimentation ? (default=.true.)&lt;br /&gt;
sedimentation = .true.&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note''' that the PCM6 dust cycle has mainly been tested with the non-dust-related flags and parameters that are featured in ''callphys.def.GCM6'' and ''callphys.def.MCD6'' (cf https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/), and in general with the ''*.def'' files (''run.def'', ''traceur.def'', ''z2sig.def'') that are suffixed with ''.GCM6'' or ''.MCD6''. If you depart from these files, even for non-dust related processes, we do not ensure the good tuning of the dust cycle, nor to a lesser extent the good compilation/execution of the model. If this happens, please reach out to us !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Level 2 (developper) : Parametrizations and tunable parameters ==&lt;br /&gt;
The table below sums up all the parameters related to PCM6 Dust Cycle, a short description, their default value in PCM6, a reasonable range that can explored for tuning, and where to find/modify them in the code.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto&amp;quot;&lt;br /&gt;
|+ Caption text&lt;br /&gt;
|-&lt;br /&gt;
! Header text !! Header text !! Header text&lt;br /&gt;
|-&lt;br /&gt;
| Example || Example || Example&lt;br /&gt;
|-&lt;br /&gt;
| Example || Example || Example&lt;br /&gt;
|-&lt;br /&gt;
| Example || Example || Example&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reference technical notes :&lt;br /&gt;
&lt;br /&gt;
* https://www-mars.lmd.jussieu.fr/cnes/2019/LMD_CNES_EXM_gcm6.0.pdf&lt;br /&gt;
&lt;br /&gt;
* https://www-mars.lmd.jussieu.fr/cnes/2020/note_technique_GCM_dust.pdf (calibration of &lt;br /&gt;
&lt;br /&gt;
* https://www-mars.lmd.jussieu.fr/cnes/2021/note_technique_dust_cycle2021.pdf&lt;br /&gt;
&lt;br /&gt;
== What's going on for rocket dust storms and injection : a detailed example through the physics parametrizations ==&lt;br /&gt;
We detail below the successive steps and processes performed concerning the coupling between the rocket dust storms and the dust injection. We place ourselves in one column of the model, which will serve as an example. The Fortran subroutines that are involved at each step are referred as '''''subroutine'''''.&lt;br /&gt;
&lt;br /&gt;
0. as we reach 2pm in this column, we read and interpolate the value of the optical depth scenario for the next day ('''''compute_dtau'''''). Let's say the scenario features an opacity of 5 (big dusty event), while the current day's GCM column has an opacity of 1 (which has been computed before, in '''''aeropacity''''')&lt;br /&gt;
&lt;br /&gt;
1. ('''''compute_dtau''''') we calculate the optical depth difference dtau=5-1=4, then what this means in terms of dust mass to be added to the atmosphere, assuming an effective size reff_lift = 3µm by default (defined in '''''initracer'''''). We dampen this quantity of dust by a coefficient Cinj (=0.25 by default) to take into account that the jump in tau_pref_scenario from the current day to the next may not come from local injection but from transport from adjacent meshes. For the values considered in this example, this gives an injection of ~5e-8 kg/m²/s.&lt;br /&gt;
&lt;br /&gt;
2. all this dust is injected uniformly during the injection window, by default between 2 p.m. this day and 2 p.m. the next day (when we are supposed to reach the scenario target), in the form of stormdust into the 1st layer by '''''vdifc''''', which already mixes it a little on several layers. Then this stormdust undergoes processes like thermals ('''''calltherm_interface'''''), convective adjustment ('''''convadj''''') and sedimentation ('''''callsedim''''') that further mix it in the atmosphere. For the latter, stormdust is prevented from falling to the ground, and remains in the 1st layer instead. We need to do so, because the main process responsible for the stormdust rising, represented by the routine '''''rocketduststorm''''', only happens at the beginning of the next timestep (see point 5).&lt;br /&gt;
&lt;br /&gt;
3. the stormdust is further mixed by the dynamics, and may also be transported to adjacent meshes. The column may also receive stormdust from other meshes.&lt;br /&gt;
&lt;br /&gt;
4. once back to the next physical time step, we calculate a sub-mesh fraction that is representative of the size of the stormdust plume ('''''calcstormfract'''''). To do so, we use the maximum mass mixing ratio of stormdust in the entire column (apart from the 1st layer), and compute the sub-mesh fraction that is needed to reach a reference mixing ratio mmr_ref=5e-4kg/kg. This reference mmr is a value that we consider representative of an opacity of 10 that was measured in a local dust storm by OMEGA, given some assumptions like a vertical extent of $$\Delta P$$=200Pa for the dust plume (''see also Wang et al. 2018, JGRPlanets, doi:10.1002/2017JE005255'').&lt;br /&gt;
&lt;br /&gt;
5. finally, we enter the '''''rocketduststorm''''' routine, where we check whether anywhere in the column, the mmr of stormdust (not concentrated in the sub-mesh fraction, but expanded to the whole mesh) is greater than $$10^{-4}$$ times that of background dust. If so, we activate the scheme in the column, and calculate the heating difference between the sub-mesh fraction (where we have concentrated stormdust, and background dust) and the rest of the mesh (only background dust), the resulting vertical transport in the sub-mesh fraction, and the horizontal detrainment where the stormdust plume vertical velocity decreases. If there is not enough stormdust compared to background dust at any level, the stormdust is detrained into background dust at all levels of the column.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Mars-Model]]&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1796</id>
		<title>Dust Cycle in Mars PCM6</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1796"/>
				<updated>2024-01-05T10:51:34Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: /* What's going on for rocket dust storms and injection : a detailed example through the physics parametrizations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details at different levels how to use and what is featured in the dust cycle in Mars PCM6. '''This is still work in progress for now !'''&lt;br /&gt;
&lt;br /&gt;
== Level 1 (user) : Flags for PCM6 dust cycle ==&lt;br /&gt;
To run a simulation with the PCM6 dust cycle, you need to set up several flags and parameters in your ''callphys.def'' (see an example here: https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/callphys.def.GCM6)&lt;br /&gt;
&lt;br /&gt;
We list below all the relevant flags and parameters directly related to PCM6 dust cycle :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line&amp;gt;&lt;br /&gt;
##General options&lt;br /&gt;
##~~~~~~~~~~~~~~~&lt;br /&gt;
#Directory where external input files are:&lt;br /&gt;
datadir=/path/to/datadir&lt;br /&gt;
&lt;br /&gt;
#Run with or without tracer transport ?&lt;br /&gt;
tracer=.true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
## Dust scenario. Used to prescribe the dust&lt;br /&gt;
## ~~~~~~~~~~~~~&lt;br /&gt;
#  =1 Dust opt.deph read in startfi; =2 Viking scenario; =3 MGS scenario [default],&lt;br /&gt;
#  =4 Mars Year 24 from TES assimilation (old version of MY24; dust_tes.nc file)&lt;br /&gt;
#  =6 &amp;quot;cold&amp;quot; (low dust) scenario ; =7 &amp;quot;warm&amp;quot; (high dust) scenario&lt;br /&gt;
#  =8 &amp;quot;climatology&amp;quot; (our best guess of a typical Mars year) scenario&lt;br /&gt;
#  =24 Mars Year 24 from TES assimilation (ie: MCD reference case)&lt;br /&gt;
#  =25 Mars Year 25 from TES assimilation (ie: a year with a global dust storm)&lt;br /&gt;
#  =26 Mars Year 26 from TES assimilation&lt;br /&gt;
#  ...&lt;br /&gt;
#  =35 Mars Year 35 from observers assimilation&lt;br /&gt;
iaervar = 8&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# Dust IR opacity ref. wavelength (for dso diagnostics only)&lt;br /&gt;
# &amp;quot;tes&amp;quot; (9.3 microns) [default] or &amp;quot;mcs&amp;quot; (21.6 microns)&lt;br /&gt;
dustiropacity = tes&lt;br /&gt;
# Use an IR to VIS scenario conversion coefficient that is&lt;br /&gt;
# dependent on the GCM dust effective radius,&lt;br /&gt;
# instead of a fixed 2.6 coefficient ?&lt;br /&gt;
#(only if dustiropacity = tes ; default = .false.)&lt;br /&gt;
reff_driven_IRtoVIS_scenario = .true.&lt;br /&gt;
&lt;br /&gt;
## Physical Parameterizations :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# call radiative transfer ? (default=.true.)&lt;br /&gt;
callrad   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
## Radiative transfer options :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# SCATTERERS: set number of scatterers.&lt;br /&gt;
# Must be compliant with other options: +1 if active, +1 if rdstorm, +1 if topflows, +1 if activice ; default=1)&lt;br /&gt;
naerkind = 4&lt;br /&gt;
&lt;br /&gt;
## Tracer (dust water, ice and/or chemical species) options (used if tracer=T):&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# DUST: Transported dust ? (if &amp;gt;0, use 'dustbin' dust bins ; default=0)&lt;br /&gt;
dustbin    = 2&lt;br /&gt;
# DUST: Radiatively active dust ? (matters if dustbin&amp;gt;0 ; default=.false.)&lt;br /&gt;
active  = .true.&lt;br /&gt;
# DUST: use mass and number mixing ratios to predict dust size ? (default=.false.)&lt;br /&gt;
doubleq   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: lifted by GCM surface winds ? (default=.false.)&lt;br /&gt;
lifting = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: Scavenging by H2O snowfall ? (default=.false.)&lt;br /&gt;
scavenging = .true.&lt;br /&gt;
&lt;br /&gt;
# DUST: freedust ? (default=.false.)&lt;br /&gt;
freedust=.true.&lt;br /&gt;
# DUST: dustscaling_mode?&lt;br /&gt;
#     =0 --&amp;gt; freedust, tauscaling=1&lt;br /&gt;
#     =1 --&amp;gt; GCM5.3-like, tauscaling&lt;br /&gt;
#     =2 --&amp;gt; tauscaling=1,dust_rad_adjust&lt;br /&gt;
dustscaling_mode=2&lt;br /&gt;
# DUST: dust injection scheme (if &amp;gt;0, use 'dustinjection' ; default=0)&lt;br /&gt;
dustinjection=1&lt;br /&gt;
# DUST: dust injection scheme coefficient (default=0.25)&lt;br /&gt;
coeff_injection=0.25&lt;br /&gt;
# DUST: dust injection scheme initial local time (default=0.)&lt;br /&gt;
ti_injection=0.&lt;br /&gt;
# DUST: dust injection scheme final local time (default=24.)&lt;br /&gt;
tf_injection=24.&lt;br /&gt;
# DUST: Rocket Dust Storm scheme (default=.false.)&lt;br /&gt;
rdstorm=.true.&lt;br /&gt;
# DUST: RDS detrainment coefficient (default=0.02)&lt;br /&gt;
coeff_detrainment=0.02&lt;br /&gt;
# DUST: Dust entrainment by subgrid-scale slope winds (default=.false.)&lt;br /&gt;
topflows=.true.&lt;br /&gt;
&lt;br /&gt;
# DUST/WATERICE: Scavenging by CO2 condensation? (default=.false.)&lt;br /&gt;
scavco2cond = .true.&lt;br /&gt;
# DUST/WATERICE: Gravitationnal sedimentation ? (default=.true.)&lt;br /&gt;
sedimentation = .true.&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note''' that the PCM6 dust cycle has mainly been tested with the non-dust-related flags and parameters that are featured in ''callphys.def.GCM6'' and ''callphys.def.MCD6'' (cf https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/), and in general with the ''*.def'' files (''run.def'', ''traceur.def'', ''z2sig.def'') that are suffixed with ''.GCM6'' or ''.MCD6''. If you depart from these files, even for non-dust related processes, we do not ensure the good tuning of the dust cycle, nor to a lesser extent the good compilation/execution of the model. If this happens, please reach out to us !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Level 2 (developper) : Parametrizations and tunable parameters ==&lt;br /&gt;
Reference technical notes :&lt;br /&gt;
&lt;br /&gt;
https://www-mars.lmd.jussieu.fr/cnes/2019/LMD_CNES_EXM_gcm6.0.pdf&lt;br /&gt;
&lt;br /&gt;
https://www-mars.lmd.jussieu.fr/cnes/2020/note_technique_GCM_dust.pdf&lt;br /&gt;
&lt;br /&gt;
https://www-mars.lmd.jussieu.fr/cnes/2021/note_technique_dust_cycle2021.pdf&lt;br /&gt;
&lt;br /&gt;
== What's going on for rocket dust storms and injection : a detailed example through the physics parametrizations ==&lt;br /&gt;
We detail below the successive steps and processes performed concerning the coupling between the rocket dust storms and the dust injection. We place ourselves in one column of the model, which will serve as an example. The Fortran subroutines that are involved at each step are referred as '''''subroutine'''''.&lt;br /&gt;
&lt;br /&gt;
0. as we reach 2pm in this column, we read and interpolate the value of the optical depth scenario for the next day ('''''compute_dtau'''''). Let's say the scenario features an opacity of 5 (big dusty event), while the current day's GCM column has an opacity of 1 (which has been computed before, in '''''aeropacity''''')&lt;br /&gt;
&lt;br /&gt;
1. ('''''compute_dtau''''') we calculate the optical depth difference dtau=5-1=4, then what this means in terms of dust mass to be added to the atmosphere, assuming an effective size reff_lift = 3µm by default (defined in '''''initracer'''''). We dampen this quantity of dust by a coefficient Cinj (=0.25 by default) to take into account that the jump in tau_pref_scenario from the current day to the next may not come from local injection but from transport from adjacent meshes. For the values considered in this example, this gives an injection of ~5e-8 kg/m²/s.&lt;br /&gt;
&lt;br /&gt;
2. all this dust is injected uniformly during the injection window, by default between 2 p.m. this day and 2 p.m. the next day (when we are supposed to reach the scenario target), in the form of stormdust into the 1st layer by '''''vdifc''''', which already mixes it a little on several layers. Then this stormdust undergoes processes like thermals ('''''calltherm_interface'''''), convective adjustment ('''''convadj''''') and sedimentation ('''''callsedim''''') that further mix it in the atmosphere. For the latter, stormdust is prevented from falling to the ground, and remains in the 1st layer instead. We need to do so, because the main process responsible for the stormdust rising, represented by the routine '''''rocketduststorm''''', only happens at the beginning of the next timestep (see point 5).&lt;br /&gt;
&lt;br /&gt;
3. the stormdust is further mixed by the dynamics, and may also be transported to adjacent meshes. The column may also receive stormdust from other meshes.&lt;br /&gt;
&lt;br /&gt;
4. once back to the next physical time step, we calculate a sub-mesh fraction that is representative of the size of the stormdust plume ('''''calcstormfract'''''). To do so, we use the maximum mass mixing ratio of stormdust in the entire column (apart from the 1st layer), and compute the sub-mesh fraction that is needed to reach a reference mixing ratio mmr_ref=5e-4kg/kg. This reference mmr is a value that we consider representative of an opacity of 10 that was measured in a local dust storm by OMEGA, given some assumptions like a vertical extent of $$\Delta P$$=200Pa for the dust plume (''see also Wang et al. 2018, JGRPlanets, doi:10.1002/2017JE005255'').&lt;br /&gt;
&lt;br /&gt;
5. finally, we enter the '''''rocketduststorm''''' routine, where we check whether anywhere in the column, the mmr of stormdust (not concentrated in the sub-mesh fraction, but expanded to the whole mesh) is greater than $$10^{-4}$$ times that of background dust. If so, we activate the scheme in the column, and calculate the heating difference between the sub-mesh fraction (where we have concentrated stormdust, and background dust) and the rest of the mesh (only background dust), the resulting vertical transport in the sub-mesh fraction, and the horizontal detrainment where the stormdust plume vertical velocity decreases. If there is not enough stormdust compared to background dust at any level, the stormdust is detrained into background dust at all levels of the column.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Mars-Model]]&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1795</id>
		<title>Dust Cycle in Mars PCM6</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1795"/>
				<updated>2024-01-05T10:48:30Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details at different levels how to use and what is featured in the dust cycle in Mars PCM6. '''This is still work in progress for now !'''&lt;br /&gt;
&lt;br /&gt;
== Level 1 (user) : Flags for PCM6 dust cycle ==&lt;br /&gt;
To run a simulation with the PCM6 dust cycle, you need to set up several flags and parameters in your ''callphys.def'' (see an example here: https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/callphys.def.GCM6)&lt;br /&gt;
&lt;br /&gt;
We list below all the relevant flags and parameters directly related to PCM6 dust cycle :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line&amp;gt;&lt;br /&gt;
##General options&lt;br /&gt;
##~~~~~~~~~~~~~~~&lt;br /&gt;
#Directory where external input files are:&lt;br /&gt;
datadir=/path/to/datadir&lt;br /&gt;
&lt;br /&gt;
#Run with or without tracer transport ?&lt;br /&gt;
tracer=.true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
## Dust scenario. Used to prescribe the dust&lt;br /&gt;
## ~~~~~~~~~~~~~&lt;br /&gt;
#  =1 Dust opt.deph read in startfi; =2 Viking scenario; =3 MGS scenario [default],&lt;br /&gt;
#  =4 Mars Year 24 from TES assimilation (old version of MY24; dust_tes.nc file)&lt;br /&gt;
#  =6 &amp;quot;cold&amp;quot; (low dust) scenario ; =7 &amp;quot;warm&amp;quot; (high dust) scenario&lt;br /&gt;
#  =8 &amp;quot;climatology&amp;quot; (our best guess of a typical Mars year) scenario&lt;br /&gt;
#  =24 Mars Year 24 from TES assimilation (ie: MCD reference case)&lt;br /&gt;
#  =25 Mars Year 25 from TES assimilation (ie: a year with a global dust storm)&lt;br /&gt;
#  =26 Mars Year 26 from TES assimilation&lt;br /&gt;
#  ...&lt;br /&gt;
#  =35 Mars Year 35 from observers assimilation&lt;br /&gt;
iaervar = 8&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# Dust IR opacity ref. wavelength (for dso diagnostics only)&lt;br /&gt;
# &amp;quot;tes&amp;quot; (9.3 microns) [default] or &amp;quot;mcs&amp;quot; (21.6 microns)&lt;br /&gt;
dustiropacity = tes&lt;br /&gt;
# Use an IR to VIS scenario conversion coefficient that is&lt;br /&gt;
# dependent on the GCM dust effective radius,&lt;br /&gt;
# instead of a fixed 2.6 coefficient ?&lt;br /&gt;
#(only if dustiropacity = tes ; default = .false.)&lt;br /&gt;
reff_driven_IRtoVIS_scenario = .true.&lt;br /&gt;
&lt;br /&gt;
## Physical Parameterizations :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# call radiative transfer ? (default=.true.)&lt;br /&gt;
callrad   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
## Radiative transfer options :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# SCATTERERS: set number of scatterers.&lt;br /&gt;
# Must be compliant with other options: +1 if active, +1 if rdstorm, +1 if topflows, +1 if activice ; default=1)&lt;br /&gt;
naerkind = 4&lt;br /&gt;
&lt;br /&gt;
## Tracer (dust water, ice and/or chemical species) options (used if tracer=T):&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# DUST: Transported dust ? (if &amp;gt;0, use 'dustbin' dust bins ; default=0)&lt;br /&gt;
dustbin    = 2&lt;br /&gt;
# DUST: Radiatively active dust ? (matters if dustbin&amp;gt;0 ; default=.false.)&lt;br /&gt;
active  = .true.&lt;br /&gt;
# DUST: use mass and number mixing ratios to predict dust size ? (default=.false.)&lt;br /&gt;
doubleq   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: lifted by GCM surface winds ? (default=.false.)&lt;br /&gt;
lifting = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: Scavenging by H2O snowfall ? (default=.false.)&lt;br /&gt;
scavenging = .true.&lt;br /&gt;
&lt;br /&gt;
# DUST: freedust ? (default=.false.)&lt;br /&gt;
freedust=.true.&lt;br /&gt;
# DUST: dustscaling_mode?&lt;br /&gt;
#     =0 --&amp;gt; freedust, tauscaling=1&lt;br /&gt;
#     =1 --&amp;gt; GCM5.3-like, tauscaling&lt;br /&gt;
#     =2 --&amp;gt; tauscaling=1,dust_rad_adjust&lt;br /&gt;
dustscaling_mode=2&lt;br /&gt;
# DUST: dust injection scheme (if &amp;gt;0, use 'dustinjection' ; default=0)&lt;br /&gt;
dustinjection=1&lt;br /&gt;
# DUST: dust injection scheme coefficient (default=0.25)&lt;br /&gt;
coeff_injection=0.25&lt;br /&gt;
# DUST: dust injection scheme initial local time (default=0.)&lt;br /&gt;
ti_injection=0.&lt;br /&gt;
# DUST: dust injection scheme final local time (default=24.)&lt;br /&gt;
tf_injection=24.&lt;br /&gt;
# DUST: Rocket Dust Storm scheme (default=.false.)&lt;br /&gt;
rdstorm=.true.&lt;br /&gt;
# DUST: RDS detrainment coefficient (default=0.02)&lt;br /&gt;
coeff_detrainment=0.02&lt;br /&gt;
# DUST: Dust entrainment by subgrid-scale slope winds (default=.false.)&lt;br /&gt;
topflows=.true.&lt;br /&gt;
&lt;br /&gt;
# DUST/WATERICE: Scavenging by CO2 condensation? (default=.false.)&lt;br /&gt;
scavco2cond = .true.&lt;br /&gt;
# DUST/WATERICE: Gravitationnal sedimentation ? (default=.true.)&lt;br /&gt;
sedimentation = .true.&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note''' that the PCM6 dust cycle has mainly been tested with the non-dust-related flags and parameters that are featured in ''callphys.def.GCM6'' and ''callphys.def.MCD6'' (cf https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/), and in general with the ''*.def'' files (''run.def'', ''traceur.def'', ''z2sig.def'') that are suffixed with ''.GCM6'' or ''.MCD6''. If you depart from these files, even for non-dust related processes, we do not ensure the good tuning of the dust cycle, nor to a lesser extent the good compilation/execution of the model. If this happens, please reach out to us !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Level 2 (developper) : Parametrizations and tunable parameters ==&lt;br /&gt;
Reference technical notes :&lt;br /&gt;
&lt;br /&gt;
https://www-mars.lmd.jussieu.fr/cnes/2019/LMD_CNES_EXM_gcm6.0.pdf&lt;br /&gt;
&lt;br /&gt;
https://www-mars.lmd.jussieu.fr/cnes/2020/note_technique_GCM_dust.pdf&lt;br /&gt;
&lt;br /&gt;
https://www-mars.lmd.jussieu.fr/cnes/2021/note_technique_dust_cycle2021.pdf&lt;br /&gt;
&lt;br /&gt;
== What's going on for rocket dust storms and injection : a detailed example through the physics parametrizations ==&lt;br /&gt;
À 14h, si le scénario du jour d'après donne une opacité de 5 alors que le jour actuel, le GCM a une opacité disons de 1 dans la colonne :&lt;br /&gt;
&lt;br /&gt;
1. on calcule le dtau=5-1=4, puis ce que ça ferait comme quantité de poussière à 3µm à ajouter dans l'atmosphère&lt;br /&gt;
&lt;br /&gt;
2. on injecte cette quantité de poussière nuancée par un coef Cinj pour prendre en compte que le saut de tau_scenario peut venir non pas d'injection locale mais de transports depuis les autres mailles. En pratique, Cinj=0.25, ce qui donne une injection de ~5e-8kg/m²/s&lt;br /&gt;
&lt;br /&gt;
3. toute cette poussière est injectée de manière uniforme entre le 14h actuel et 14h du jour d'après sous forme de stormdust dans la 1ère couche par vdifc, qui la mélange déjà un peu sur plusieurs couches, avant qu'elle ne passe par les thermiques/l'ajustement convectif, la sédimentation (mais on empêche la stormdust de tomber au sol, elle reste dans la 1ère couche à la place), et 5 pas de temps de dynamique&lt;br /&gt;
&lt;br /&gt;
4. une fois retourné au pas de temps physique suivant, on calcule la fraction sous-maille à partir du maximum de mass mixing ratio de stormdust dans toute la colonne (à part la 1ère couche (?) ), par rapport à un mixing ratio de référence mmr_ref=5e-4kg/kg que l'on considère représentatif d'une opacité de 10 (telle que mesurée dans une local dust storm par OMEGA)&lt;br /&gt;
&lt;br /&gt;
5. enfin, on rentre dans la routine rocketduststorm, où on regarde si qqpart dans la colonne, le mmr de stormdust (non-concentré dans la fraction sous-maille) est supérieur à 10^(-4) fois celui du background dust. Si c'est le cas, on active le schéma dans la colonne, et on calcule l'écart de chauffage entre la fraction sous-maille et la maille totale, le transport vertical qui en résulte dans la fraction sous-maille, et le détraînement. Si ce n'est pas le cas (pas assez de stormdust nulle part dans la colonne) on détraîne tout&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We detail below the successive steps and processes performed concerning the coupling between the rocket dust storms and the dust injection. We place ourselves in one column of the model, which will serve as an example. The Fortran subroutines that are involved at each step are referred as '''''subroutine'''''.&lt;br /&gt;
&lt;br /&gt;
0. as we reach 2pm in this column, we read and interpolate the value of the optical depth scenario for the next day ('''''compute_dtau'''''). Let's say the scenario features an opacity of 5 (big dusty event), while the current day's GCM column has an opacity of 1 (which has been computed before, in '''''aeropacity''''')&lt;br /&gt;
&lt;br /&gt;
1. ('''''compute_dtau''''') we calculate the optical depth difference dtau=5-1=4, then what this means in terms of dust mass to be added to the atmosphere, assuming an effective size reff_lift = 3µm by default (defined in '''''initracer'''''). We dampen this quantity of dust by a coefficient Cinj (=0.25 by default) to take into account that the jump in tau_pref_scenario from the current day to the next may not come from local injection but from transport from adjacent meshes. For the values considered in this example, this gives an injection of ~5e-8 kg/m²/s.&lt;br /&gt;
&lt;br /&gt;
2. all this dust is injected uniformly during the injection window, by default between 2 p.m. this day and 2 p.m. the next day (when we are supposed to reach the scenario target), in the form of stormdust into the 1st layer by '''''vdifc''''', which already mixes it a little on several layers. Then this stormdust undergoes processes like thermals ('''''calltherm_interface'''''), convective adjustment ('''''convadj''''') and sedimentation ('''''callsedim''''') that further mix it in the atmosphere. For the latter, stormdust is prevented from falling to the ground, and remains in the 1st layer instead. We need to do so, because the main process responsible for the stormdust rising, represented by the routine '''''rocketduststorm''''', only happens at the beginning of the next timestep (see point 5).&lt;br /&gt;
&lt;br /&gt;
3. the stormdust is further mixed by the dynamics, and may also be transported to adjacent meshes. The column may also receive stormdust from other meshes.&lt;br /&gt;
&lt;br /&gt;
4. once back to the next physical time step, we calculate a sub-mesh fraction that is representative of the size of the stormdust plume ('''''calcstormfract'''''). To do so, we use the maximum mass mixing ratio of stormdust in the entire column (apart from the 1st layer), and compute the sub-mesh fraction that is needed to reach a reference mixing ratio mmr_ref=5e-4kg/kg. This reference mmr is a value that we consider representative of an opacity of 10 that was measured in a local dust storm by OMEGA, given some assumptions like a vertical extent of $$\Delta P$$=200Pa for the dust plume (''see also Wang et al. 2018, JGRPlanets, doi:10.1002/2017JE005255'').&lt;br /&gt;
&lt;br /&gt;
5. finally, we enter the '''''rocketduststorm''''' routine, where we check whether anywhere in the column, the mmr of stormdust (not concentrated in the sub-mesh fraction, but expanded to the whole mesh) is greater than $$10^{-4}$$ times that of background dust. If so, we activate the scheme in the column, and calculate the heating difference between the sub-mesh fraction (where we have concentrated stormdust, and background dust) and the rest of the mesh (only background dust), the resulting vertical transport in the sub-mesh fraction, and the horizontal detrainment where the stormdust plume vertical velocity decreases. If there is not enough stormdust compared to background dust at any level, the stormdust is detrained into background dust at all levels of the column.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Mars-Model]]&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1794</id>
		<title>Dust Cycle in Mars PCM6</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1794"/>
				<updated>2024-01-05T10:44:54Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details at different levels how to use and what is featured in the dust cycle in Mars PCM6. '''This is still work in progress for now !'''&lt;br /&gt;
&lt;br /&gt;
== Level 1 (user) : Flags for PCM6 dust cycle ==&lt;br /&gt;
To run a simulation with the PCM6 dust cycle, you need to set up several flags and parameters in your ''callphys.def'' (see an example here: https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/callphys.def.GCM6)&lt;br /&gt;
&lt;br /&gt;
We list below all the relevant flags and parameters directly related to PCM6 dust cycle :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line&amp;gt;&lt;br /&gt;
##General options&lt;br /&gt;
##~~~~~~~~~~~~~~~&lt;br /&gt;
#Directory where external input files are:&lt;br /&gt;
datadir=/path/to/datadir&lt;br /&gt;
&lt;br /&gt;
#Run with or without tracer transport ?&lt;br /&gt;
tracer=.true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
## Dust scenario. Used to prescribe the dust&lt;br /&gt;
## ~~~~~~~~~~~~~&lt;br /&gt;
#  =1 Dust opt.deph read in startfi; =2 Viking scenario; =3 MGS scenario [default],&lt;br /&gt;
#  =4 Mars Year 24 from TES assimilation (old version of MY24; dust_tes.nc file)&lt;br /&gt;
#  =6 &amp;quot;cold&amp;quot; (low dust) scenario ; =7 &amp;quot;warm&amp;quot; (high dust) scenario&lt;br /&gt;
#  =8 &amp;quot;climatology&amp;quot; (our best guess of a typical Mars year) scenario&lt;br /&gt;
#  =24 Mars Year 24 from TES assimilation (ie: MCD reference case)&lt;br /&gt;
#  =25 Mars Year 25 from TES assimilation (ie: a year with a global dust storm)&lt;br /&gt;
#  =26 Mars Year 26 from TES assimilation&lt;br /&gt;
#  ...&lt;br /&gt;
#  =35 Mars Year 35 from observers assimilation&lt;br /&gt;
iaervar = 8&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# Dust IR opacity ref. wavelength (for dso diagnostics only)&lt;br /&gt;
# &amp;quot;tes&amp;quot; (9.3 microns) [default] or &amp;quot;mcs&amp;quot; (21.6 microns)&lt;br /&gt;
dustiropacity = tes&lt;br /&gt;
# Use an IR to VIS scenario conversion coefficient that is&lt;br /&gt;
# dependent on the GCM dust effective radius,&lt;br /&gt;
# instead of a fixed 2.6 coefficient ?&lt;br /&gt;
#(only if dustiropacity = tes ; default = .false.)&lt;br /&gt;
reff_driven_IRtoVIS_scenario = .true.&lt;br /&gt;
&lt;br /&gt;
## Physical Parameterizations :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# call radiative transfer ? (default=.true.)&lt;br /&gt;
callrad   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
## Radiative transfer options :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# SCATTERERS: set number of scatterers.&lt;br /&gt;
# Must be compliant with other options: +1 if active, +1 if rdstorm, +1 if topflows, +1 if activice ; default=1)&lt;br /&gt;
naerkind = 4&lt;br /&gt;
&lt;br /&gt;
## Tracer (dust water, ice and/or chemical species) options (used if tracer=T):&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# DUST: Transported dust ? (if &amp;gt;0, use 'dustbin' dust bins ; default=0)&lt;br /&gt;
dustbin    = 2&lt;br /&gt;
# DUST: Radiatively active dust ? (matters if dustbin&amp;gt;0 ; default=.false.)&lt;br /&gt;
active  = .true.&lt;br /&gt;
# DUST: use mass and number mixing ratios to predict dust size ? (default=.false.)&lt;br /&gt;
doubleq   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: lifted by GCM surface winds ? (default=.false.)&lt;br /&gt;
lifting = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: Scavenging by H2O snowfall ? (default=.false.)&lt;br /&gt;
scavenging = .true.&lt;br /&gt;
&lt;br /&gt;
# DUST: freedust ? (default=.false.)&lt;br /&gt;
freedust=.true.&lt;br /&gt;
# DUST: dustscaling_mode?&lt;br /&gt;
#     =0 --&amp;gt; freedust, tauscaling=1&lt;br /&gt;
#     =1 --&amp;gt; GCM5.3-like, tauscaling&lt;br /&gt;
#     =2 --&amp;gt; tauscaling=1,dust_rad_adjust&lt;br /&gt;
dustscaling_mode=2&lt;br /&gt;
# DUST: dust injection scheme (if &amp;gt;0, use 'dustinjection' ; default=0)&lt;br /&gt;
dustinjection=1&lt;br /&gt;
# DUST: dust injection scheme coefficient (default=0.25)&lt;br /&gt;
coeff_injection=0.25&lt;br /&gt;
# DUST: dust injection scheme initial local time (default=0.)&lt;br /&gt;
ti_injection=0.&lt;br /&gt;
# DUST: dust injection scheme final local time (default=24.)&lt;br /&gt;
tf_injection=24.&lt;br /&gt;
# DUST: Rocket Dust Storm scheme (default=.false.)&lt;br /&gt;
rdstorm=.true.&lt;br /&gt;
# DUST: RDS detrainment coefficient (default=0.02)&lt;br /&gt;
coeff_detrainment=0.02&lt;br /&gt;
# DUST: Dust entrainment by subgrid-scale slope winds (default=.false.)&lt;br /&gt;
topflows=.true.&lt;br /&gt;
&lt;br /&gt;
# DUST/WATERICE: Scavenging by CO2 condensation? (default=.false.)&lt;br /&gt;
scavco2cond = .true.&lt;br /&gt;
# DUST/WATERICE: Gravitationnal sedimentation ? (default=.true.)&lt;br /&gt;
sedimentation = .true.&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note''' that the PCM6 dust cycle has mainly been tested with the non-dust-related flags and parameters that are featured in ''callphys.def.GCM6'' and ''callphys.def.MCD6'' (cf https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/), and in general with the ''*.def'' files (''run.def'', ''traceur.def'', ''z2sig.def'') that are suffixed with ''.GCM6'' or ''.MCD6''. If you depart from these files, even for non-dust related processes, we do not ensure the good tuning of the dust cycle, nor to a lesser extent the good compilation/execution of the model. If this happens, please reach out to us !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Level 2 (developper) : Parametrizations and tunable parameters ==&lt;br /&gt;
Reference technical notes :&lt;br /&gt;
&lt;br /&gt;
https://www-mars.lmd.jussieu.fr/cnes/2019/LMD_CNES_EXM_gcm6.0.pdf&lt;br /&gt;
&lt;br /&gt;
https://www-mars.lmd.jussieu.fr/cnes/2020/note_technique_GCM_dust.pdf&lt;br /&gt;
&lt;br /&gt;
https://www-mars.lmd.jussieu.fr/cnes/2021/note_technique_dust_cycle2021.pdf&lt;br /&gt;
&lt;br /&gt;
== What's going on for rocket dust storms and injection : a detailed example through the physics parametrizations ==&lt;br /&gt;
À 14h, si le scénario du jour d'après donne une opacité de 5 alors que le jour actuel, le GCM a une opacité disons de 1 dans la colonne :&lt;br /&gt;
&lt;br /&gt;
1. on calcule le dtau=5-1=4, puis ce que ça ferait comme quantité de poussière à 3µm à ajouter dans l'atmosphère&lt;br /&gt;
&lt;br /&gt;
2. on injecte cette quantité de poussière nuancée par un coef Cinj pour prendre en compte que le saut de tau_scenario peut venir non pas d'injection locale mais de transports depuis les autres mailles. En pratique, Cinj=0.25, ce qui donne une injection de ~5e-8kg/m²/s&lt;br /&gt;
&lt;br /&gt;
3. toute cette poussière est injectée de manière uniforme entre le 14h actuel et 14h du jour d'après sous forme de stormdust dans la 1ère couche par vdifc, qui la mélange déjà un peu sur plusieurs couches, avant qu'elle ne passe par les thermiques/l'ajustement convectif, la sédimentation (mais on empêche la stormdust de tomber au sol, elle reste dans la 1ère couche à la place), et 5 pas de temps de dynamique&lt;br /&gt;
&lt;br /&gt;
4. une fois retourné au pas de temps physique suivant, on calcule la fraction sous-maille à partir du maximum de mass mixing ratio de stormdust dans toute la colonne (à part la 1ère couche (?) ), par rapport à un mixing ratio de référence mmr_ref=5e-4kg/kg que l'on considère représentatif d'une opacité de 10 (telle que mesurée dans une local dust storm par OMEGA)&lt;br /&gt;
&lt;br /&gt;
5. enfin, on rentre dans la routine rocketduststorm, où on regarde si qqpart dans la colonne, le mmr de stormdust (non-concentré dans la fraction sous-maille) est supérieur à 10^(-4) fois celui du background dust. Si c'est le cas, on active le schéma dans la colonne, et on calcule l'écart de chauffage entre la fraction sous-maille et la maille totale, le transport vertical qui en résulte dans la fraction sous-maille, et le détraînement. Si ce n'est pas le cas (pas assez de stormdust nulle part dans la colonne) on détraîne tout&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We detail below the successive steps and processes performed concerning the coupling between the rocket dust storms and the dust injection. We place ourselves in one column of the model, which will serve as an example. The Fortran subroutines that are involved at each step are referred as '''''subroutine'''''.&lt;br /&gt;
&lt;br /&gt;
0. as we reach 2pm in this column, we read and interpolate the value of the optical depth scenario for the next day ('''''compute_dtau'''''). Let's say the scenario features an opacity of 5 (big dusty event), while the current day's GCM column has an opacity of 1 (which has been computed before, in '''''aeropacity''''')&lt;br /&gt;
&lt;br /&gt;
1. ('''''compute_dtau''''') we calculate the optical depth difference dtau=5-1=4, then what this means in terms of dust mass to be added to the atmosphere, assuming a specific size reff_lift = 3µm by default (defined in '''''initracer'''''). We dampen this quantity of dust by a coefficient Cinj (=0.25 by default) to take into account that the jump in tau_pref_scenario from the current day to the next may not come from local injection but from transport from adjacent meshes. For the values considered in this example, this gives an injection of ~5e-8 kg/m²/s.&lt;br /&gt;
&lt;br /&gt;
2. all this dust is injected uniformly during the injection window, by default between 2 p.m. this day and 2 p.m. the next day (when we are supposed to reach the scenario target), in the form of stormdust into the 1st layer by '''''vdifc''''', which already mixes it a little on several layers. Then this stormdust undergoes processes like thermals ('''''calltherm_interface'''''), convective adjustment ('''''convadj''''') and sedimentation ('''''callsedim''''') that further mix it in the atmosphere. For the latter, stormdust is prevented from falling to the ground, and remains in the 1st layer instead. We need to do so, because the main process responsible for the stormdust rising, represented by the routine '''''rocketduststorm''''', only happens at the beginning of the next timestep (see point 5).&lt;br /&gt;
&lt;br /&gt;
3. the stormdust is further mixed by the dynamics, and may also be transported to adjacent meshes. The column may also receive stormdust from other meshes.&lt;br /&gt;
&lt;br /&gt;
4. once back to the next physical time step, we calculate a sub-mesh fraction that is representative of the size of the stormdust plume ('''''calcstormfract'''''). To do so, we use the maximum mass mixing ratio of stormdust in the entire column (apart from the 1st layer), and compute the sub-mesh fraction that is needed to reach a reference mixing ratio mmr_ref=5e-4kg/kg. This reference mmr is a value that we consider representative of an opacity of 10 that was measured in a local dust storm by OMEGA, given some assumptions like a vertical extent of $$\Delta P$$=200Pa for the dust plume (''see also Wang et al. 2018, JGRPlanets, doi:10.1002/2017JE005255'').&lt;br /&gt;
&lt;br /&gt;
5. finally, we enter the '''''rocketduststorm''''' routine, where we check whether anywhere in the column, the mmr of stormdust (not concentrated in the sub-mesh fraction, but expanded to the whole mesh) is greater than $$10^{-4}$$ times that of background dust. If so, we activate the scheme in the column, and calculate the heating difference between the sub-mesh fraction (where we have concentrated stormdust, and background dust) and the rest of the mesh (only background dust), the resulting vertical transport in the sub-mesh fraction, and the horizontal detrainment where the stormdust plume vertical velocity decreases. If there is not enough stormdust compared to background dust at any level, the stormdust is detrained into background dust at all levels of the column.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Mars-Model]]&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1793</id>
		<title>Dust Cycle in Mars PCM6</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1793"/>
				<updated>2024-01-04T17:14:14Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: /* What's going on for rocket dust storms and injection : a detailed example through the physics parametrizations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details at different levels how to use and what is featured in the dust cycle in Mars PCM6. '''This is still work in progress for now !'''&lt;br /&gt;
&lt;br /&gt;
== Level 1 (user) : Flags for PCM6 dust cycle ==&lt;br /&gt;
To run a simulation with the PCM6 dust cycle, you need to set up several flags and parameters in your ''callphys.def'' (see an example here: https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/callphys.def.GCM6)&lt;br /&gt;
&lt;br /&gt;
We list below all the relevant flags and parameters directly related to PCM6 dust cycle :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line&amp;gt;&lt;br /&gt;
##General options&lt;br /&gt;
##~~~~~~~~~~~~~~~&lt;br /&gt;
#Directory where external input files are:&lt;br /&gt;
datadir=/path/to/datadir&lt;br /&gt;
&lt;br /&gt;
#Run with or without tracer transport ?&lt;br /&gt;
tracer=.true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
## Dust scenario. Used to prescribe the dust&lt;br /&gt;
## ~~~~~~~~~~~~~&lt;br /&gt;
#  =1 Dust opt.deph read in startfi; =2 Viking scenario; =3 MGS scenario [default],&lt;br /&gt;
#  =4 Mars Year 24 from TES assimilation (old version of MY24; dust_tes.nc file)&lt;br /&gt;
#  =6 &amp;quot;cold&amp;quot; (low dust) scenario ; =7 &amp;quot;warm&amp;quot; (high dust) scenario&lt;br /&gt;
#  =8 &amp;quot;climatology&amp;quot; (our best guess of a typical Mars year) scenario&lt;br /&gt;
#  =24 Mars Year 24 from TES assimilation (ie: MCD reference case)&lt;br /&gt;
#  =25 Mars Year 25 from TES assimilation (ie: a year with a global dust storm)&lt;br /&gt;
#  =26 Mars Year 26 from TES assimilation&lt;br /&gt;
#  ...&lt;br /&gt;
#  =35 Mars Year 35 from observers assimilation&lt;br /&gt;
iaervar = 8&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# Dust IR opacity ref. wavelength (for dso diagnostics only)&lt;br /&gt;
# &amp;quot;tes&amp;quot; (9.3 microns) [default] or &amp;quot;mcs&amp;quot; (21.6 microns)&lt;br /&gt;
dustiropacity = tes&lt;br /&gt;
# Use an IR to VIS scenario conversion coefficient that is&lt;br /&gt;
# dependent on the GCM dust effective radius,&lt;br /&gt;
# instead of a fixed 2.6 coefficient ?&lt;br /&gt;
#(only if dustiropacity = tes ; default = .false.)&lt;br /&gt;
reff_driven_IRtoVIS_scenario = .true.&lt;br /&gt;
&lt;br /&gt;
## Physical Parameterizations :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# call radiative transfer ? (default=.true.)&lt;br /&gt;
callrad   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
## Radiative transfer options :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# SCATTERERS: set number of scatterers.&lt;br /&gt;
# Must be compliant with other options: +1 if active, +1 if rdstorm, +1 if topflows, +1 if activice ; default=1)&lt;br /&gt;
naerkind = 4&lt;br /&gt;
&lt;br /&gt;
## Tracer (dust water, ice and/or chemical species) options (used if tracer=T):&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# DUST: Transported dust ? (if &amp;gt;0, use 'dustbin' dust bins ; default=0)&lt;br /&gt;
dustbin    = 2&lt;br /&gt;
# DUST: Radiatively active dust ? (matters if dustbin&amp;gt;0 ; default=.false.)&lt;br /&gt;
active  = .true.&lt;br /&gt;
# DUST: use mass and number mixing ratios to predict dust size ? (default=.false.)&lt;br /&gt;
doubleq   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: lifted by GCM surface winds ? (default=.false.)&lt;br /&gt;
lifting = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: Scavenging by H2O snowfall ? (default=.false.)&lt;br /&gt;
scavenging = .true.&lt;br /&gt;
&lt;br /&gt;
# DUST: freedust ? (default=.false.)&lt;br /&gt;
freedust=.true.&lt;br /&gt;
# DUST: dustscaling_mode?&lt;br /&gt;
#     =0 --&amp;gt; freedust, tauscaling=1&lt;br /&gt;
#     =1 --&amp;gt; GCM5.3-like, tauscaling&lt;br /&gt;
#     =2 --&amp;gt; tauscaling=1,dust_rad_adjust&lt;br /&gt;
dustscaling_mode=2&lt;br /&gt;
# DUST: dust injection scheme (if &amp;gt;0, use 'dustinjection' ; default=0)&lt;br /&gt;
dustinjection=1&lt;br /&gt;
# DUST: dust injection scheme coefficient (default=0.25)&lt;br /&gt;
coeff_injection=0.25&lt;br /&gt;
# DUST: dust injection scheme initial local time (default=0.)&lt;br /&gt;
ti_injection=0.&lt;br /&gt;
# DUST: dust injection scheme final local time (default=24.)&lt;br /&gt;
tf_injection=24.&lt;br /&gt;
# DUST: Rocket Dust Storm scheme (default=.false.)&lt;br /&gt;
rdstorm=.true.&lt;br /&gt;
# DUST: RDS detrainment coefficient (default=0.02)&lt;br /&gt;
coeff_detrainment=0.02&lt;br /&gt;
# DUST: Dust entrainment by subgrid-scale slope winds (default=.false.)&lt;br /&gt;
topflows=.true.&lt;br /&gt;
&lt;br /&gt;
# DUST/WATERICE: Scavenging by CO2 condensation? (default=.false.)&lt;br /&gt;
scavco2cond = .true.&lt;br /&gt;
# DUST/WATERICE: Gravitationnal sedimentation ? (default=.true.)&lt;br /&gt;
sedimentation = .true.&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note''' that the PCM6 dust cycle has mainly been tested with the non-dust-related flags and parameters that are featured in ''callphys.def.GCM6'' and ''callphys.def.MCD6'' (cf https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/), and in general with the ''*.def'' files (''run.def'', ''traceur.def'', ''z2sig.def'') that are suffixed with ''.GCM6'' or ''.MCD6''. If you depart from these files, even for non-dust related processes, we do not ensure the good tuning of the dust cycle, nor to a lesser extent the good compilation/execution of the model. If this happens, please reach out to us !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Level 2 (developper) : Parametrizations and tunable parameters ==&lt;br /&gt;
Reference technical notes :&lt;br /&gt;
&lt;br /&gt;
https://www-mars.lmd.jussieu.fr/cnes/2019/LMD_CNES_EXM_gcm6.0.pdf&lt;br /&gt;
&lt;br /&gt;
https://www-mars.lmd.jussieu.fr/cnes/2020/note_technique_GCM_dust.pdf&lt;br /&gt;
&lt;br /&gt;
https://www-mars.lmd.jussieu.fr/cnes/2021/note_technique_dust_cycle2021.pdf&lt;br /&gt;
&lt;br /&gt;
== What's going on for rocket dust storms and injection : a detailed example through the physics parametrizations ==&lt;br /&gt;
À 14h, si le scénario du jour d'après donne une opacité de 5 alors que le jour actuel, le GCM a une opacité disons de 1 dans la colonne :&lt;br /&gt;
&lt;br /&gt;
1. on calcule le dtau=5-1=4, puis ce que ça ferait comme quantité de poussière à 3µm à ajouter dans l'atmosphère&lt;br /&gt;
&lt;br /&gt;
2. on injecte cette quantité de poussière nuancée par un coef Cinj pour prendre en compte que le saut de tau_scenario peut venir non pas d'injection locale mais de transports depuis les autres mailles. En pratique, Cinj=0.25, ce qui donne une injection de ~5e-8kg/m²/s&lt;br /&gt;
&lt;br /&gt;
3. toute cette poussière est injectée de manière uniforme entre le 14h actuel et 14h du jour d'après sous forme de stormdust dans la 1ère couche par vdifc, qui la mélange déjà un peu sur plusieurs couches, avant qu'elle ne passe par les thermiques/l'ajustement convectif, la sédimentation (mais on empêche la stormdust de tomber au sol, elle reste dans la 1ère couche à la place), et 5 pas de temps de dynamique&lt;br /&gt;
&lt;br /&gt;
4. une fois retourné au pas de temps physique suivant, on calcule la fraction sous-maille à partir du maximum de mass mixing ratio de stormdust dans toute la colonne (à part la 1ère couche (?) ), par rapport à un mixing ratio de référence mmr_ref=5e-4kg/kg que l'on considère représentatif d'une opacité de 10 (telle que mesurée dans une local dust storm par OMEGA)&lt;br /&gt;
&lt;br /&gt;
5. enfin, on rentre dans la routine rocketduststorm, où on regarde si qqpart dans la colonne, le mmr de stormdust (non-concentré dans la fraction sous-maille) est supérieur à 10^(-4) fois celui du background dust. Si c'est le cas, on active le schéma dans la colonne, et on calcule l'écart de chauffage entre la fraction sous-maille et la maille totale, le transport vertical qui en résulte dans la fraction sous-maille, et le détraînement. Si ce n'est pas le cas (pas assez de stormdust nulle part dans la colonne) on détraîne tout&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We detail below the successive steps and processes performed concerning the coupling between the rocket dust storms and the dust injection. We place ourselves in one column of the model, which will serve as an example. The Fortran subroutines that are involved at each step are referred as '''''subroutine'''''.&lt;br /&gt;
&lt;br /&gt;
0. as we reach 2pm in this column, we read and interpolate the value of the optical depth scenario for the next day ('''''compute_dtau'''''). Let's say the scenario features an opacity of 5 (big dusty event), while the current day's GCM column has an opacity of 1 (which has been computed before, in '''''aeropacity''''')&lt;br /&gt;
&lt;br /&gt;
1. ('''''compute_dtau''''') we calculate the optical depth difference dtau=5-1=4, then what this means in terms of dust mass to be added to the atmosphere, assuming a specific size reff_lift = 3µm by default (defined in '''''initracer'''''). We dampen this quantity of dust by a coefficient Cinj (=0.25 by default) to take into account that the jump in tau_pref_scenario from the current day to the next may not come from local injection but from transport from adjacent meshes. For the values considered in this example, this gives an injection of ~5e-8 kg/m²/s.&lt;br /&gt;
&lt;br /&gt;
2. all this dust is injected uniformly during the injection window, by default between 2 p.m. this day and 2 p.m. the next day (when we are supposed to reach the scenario target), in the form of stormdust into the 1st layer by '''''vdifc''''', which already mixes it a little on several layers. Then this stormdust undergoes processes like thermals ('''''calltherm_interface'''''), convective adjustment ('''''convadj''''') and sedimentation ('''''callsedim''''') that further mix it in the atmosphere. For the latter, stormdust is prevented from falling to the ground, and remains in the 1st layer instead. We need to do so, because the main process responsible for the stormdust rising, represented by the routine '''''rocketduststorm''''', only happens at the beginning of the next timestep (see point 5).&lt;br /&gt;
&lt;br /&gt;
3. the stormdust is further mixed by the dynamics, and may also be transported to adjacent meshes. The column may also receive stormdust from other meshes.&lt;br /&gt;
&lt;br /&gt;
4. once back to the next physical time step, we calculate a sub-mesh fraction that is representative of the size of the stormdust plume ('''''calcstormfract'''''). To do so, we use the maximum mass mixing ratio of stormdust in the entire column (apart from the 1st layer), compared with a reference mixing ratio mmr_ref=5e-4kg/kg that we consider representative of an opacity of 10 (as measured in a local dust storm by OMEGA), given some assumptions like a vertical extent of $$\Delta P$$=200Pa for the stormdust plume.&lt;br /&gt;
&lt;br /&gt;
5. finally, we enter the '''''rocketduststorm''''' routine, where we check whether anywhere in the column, the mmr of stormdust (not concentrated in the sub-mesh fraction, but expanded to the whole mesh) is greater than $$10^{-4}$$ times that of background dust. If so, we activate the scheme in the column, and calculate the heating difference between the submesh fraction and the total mesh, the resulting vertical transport in the submesh fraction, and the detrailing. If this is not the case (not enough stormdust anywhere in the column), we detrain the entire mesh.&lt;br /&gt;
[[Category:Mars-Model]]&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1771</id>
		<title>Dust Cycle in Mars PCM6</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1771"/>
				<updated>2023-12-01T18:15:29Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details at different levels how to use and what is featured in the dust cycle in Mars PCM6. '''This is still work in progress for now !'''&lt;br /&gt;
&lt;br /&gt;
== Level 1 (user) : Flags for PCM6 dust cycle ==&lt;br /&gt;
To run a simulation with the PCM6 dust cycle, you need to set up several flags and parameters in your ''callphys.def'' (see an example here: https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/callphys.def.GCM6)&lt;br /&gt;
&lt;br /&gt;
We list below all the relevant flags and parameters directly related to PCM6 dust cycle :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line&amp;gt;&lt;br /&gt;
##General options&lt;br /&gt;
##~~~~~~~~~~~~~~~&lt;br /&gt;
#Directory where external input files are:&lt;br /&gt;
datadir=/path/to/datadir&lt;br /&gt;
&lt;br /&gt;
#Run with or without tracer transport ?&lt;br /&gt;
tracer=.true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
## Dust scenario. Used to prescribe the dust&lt;br /&gt;
## ~~~~~~~~~~~~~&lt;br /&gt;
#  =1 Dust opt.deph read in startfi; =2 Viking scenario; =3 MGS scenario [default],&lt;br /&gt;
#  =4 Mars Year 24 from TES assimilation (old version of MY24; dust_tes.nc file)&lt;br /&gt;
#  =6 &amp;quot;cold&amp;quot; (low dust) scenario ; =7 &amp;quot;warm&amp;quot; (high dust) scenario&lt;br /&gt;
#  =8 &amp;quot;climatology&amp;quot; (our best guess of a typical Mars year) scenario&lt;br /&gt;
#  =24 Mars Year 24 from TES assimilation (ie: MCD reference case)&lt;br /&gt;
#  =25 Mars Year 25 from TES assimilation (ie: a year with a global dust storm)&lt;br /&gt;
#  =26 Mars Year 26 from TES assimilation&lt;br /&gt;
#  ...&lt;br /&gt;
#  =35 Mars Year 35 from observers assimilation&lt;br /&gt;
iaervar = 8&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# Dust IR opacity ref. wavelength (for dso diagnostics only)&lt;br /&gt;
# &amp;quot;tes&amp;quot; (9.3 microns) [default] or &amp;quot;mcs&amp;quot; (21.6 microns)&lt;br /&gt;
dustiropacity = tes&lt;br /&gt;
# Use an IR to VIS scenario conversion coefficient that is&lt;br /&gt;
# dependent on the GCM dust effective radius,&lt;br /&gt;
# instead of a fixed 2.6 coefficient ?&lt;br /&gt;
#(only if dustiropacity = tes ; default = .false.)&lt;br /&gt;
reff_driven_IRtoVIS_scenario = .true.&lt;br /&gt;
&lt;br /&gt;
## Physical Parameterizations :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# call radiative transfer ? (default=.true.)&lt;br /&gt;
callrad   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
## Radiative transfer options :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# SCATTERERS: set number of scatterers.&lt;br /&gt;
# Must be compliant with other options: +1 if active, +1 if rdstorm, +1 if topflows, +1 if activice ; default=1)&lt;br /&gt;
naerkind = 4&lt;br /&gt;
&lt;br /&gt;
## Tracer (dust water, ice and/or chemical species) options (used if tracer=T):&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# DUST: Transported dust ? (if &amp;gt;0, use 'dustbin' dust bins ; default=0)&lt;br /&gt;
dustbin    = 2&lt;br /&gt;
# DUST: Radiatively active dust ? (matters if dustbin&amp;gt;0 ; default=.false.)&lt;br /&gt;
active  = .true.&lt;br /&gt;
# DUST: use mass and number mixing ratios to predict dust size ? (default=.false.)&lt;br /&gt;
doubleq   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: lifted by GCM surface winds ? (default=.false.)&lt;br /&gt;
lifting = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: Scavenging by H2O snowfall ? (default=.false.)&lt;br /&gt;
scavenging = .true.&lt;br /&gt;
&lt;br /&gt;
# DUST: freedust ? (default=.false.)&lt;br /&gt;
freedust=.true.&lt;br /&gt;
# DUST: dustscaling_mode?&lt;br /&gt;
#     =0 --&amp;gt; freedust, tauscaling=1&lt;br /&gt;
#     =1 --&amp;gt; GCM5.3-like, tauscaling&lt;br /&gt;
#     =2 --&amp;gt; tauscaling=1,dust_rad_adjust&lt;br /&gt;
dustscaling_mode=2&lt;br /&gt;
# DUST: dust injection scheme (if &amp;gt;0, use 'dustinjection' ; default=0)&lt;br /&gt;
dustinjection=1&lt;br /&gt;
# DUST: dust injection scheme coefficient (default=0.25)&lt;br /&gt;
coeff_injection=0.25&lt;br /&gt;
# DUST: dust injection scheme initial local time (default=0.)&lt;br /&gt;
ti_injection=0.&lt;br /&gt;
# DUST: dust injection scheme final local time (default=24.)&lt;br /&gt;
tf_injection=24.&lt;br /&gt;
# DUST: Rocket Dust Storm scheme (default=.false.)&lt;br /&gt;
rdstorm=.true.&lt;br /&gt;
# DUST: RDS detrainment coefficient (default=0.02)&lt;br /&gt;
coeff_detrainment=0.02&lt;br /&gt;
# DUST: Dust entrainment by subgrid-scale slope winds (default=.false.)&lt;br /&gt;
topflows=.true.&lt;br /&gt;
&lt;br /&gt;
# DUST/WATERICE: Scavenging by CO2 condensation? (default=.false.)&lt;br /&gt;
scavco2cond = .true.&lt;br /&gt;
# DUST/WATERICE: Gravitationnal sedimentation ? (default=.true.)&lt;br /&gt;
sedimentation = .true.&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note''' that the PCM6 dust cycle has mainly been tested with the non-dust-related flags and parameters that are featured in ''callphys.def.GCM6'' and ''callphys.def.MCD6'' (cf https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/), and in general with the ''*.def'' files (''run.def'', ''traceur.def'', ''z2sig.def'') that are suffixed with ''.GCM6'' or ''.MCD6''. If you depart from these files, even for non-dust related processes, we do not ensure the good tuning of the dust cycle, nor to a lesser extent the good compilation/execution of the model. If this happens, please reach out to us !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Level 2 (developper) : Parametrizations and tunable parameters ==&lt;br /&gt;
Reference technical notes :&lt;br /&gt;
&lt;br /&gt;
https://www-mars.lmd.jussieu.fr/cnes/2019/LMD_CNES_EXM_gcm6.0.pdf&lt;br /&gt;
&lt;br /&gt;
https://www-mars.lmd.jussieu.fr/cnes/2020/note_technique_GCM_dust.pdf&lt;br /&gt;
&lt;br /&gt;
https://www-mars.lmd.jussieu.fr/cnes/2021/note_technique_dust_cycle2021.pdf&lt;br /&gt;
&lt;br /&gt;
== What's going on for rocket dust storms and injection : a detailed example through the physics parametrizations ==&lt;br /&gt;
À 14h, si le scénario du jour d'après donne une opacité de 5 alors que le jour actuel, le GCM a une opacité disons de 1 dans la colonne :&lt;br /&gt;
&lt;br /&gt;
1. on calcule le dtau=5-1=4, puis ce que ça ferait comme quantité de poussière à 3µm à ajouter dans l'atmosphère&lt;br /&gt;
&lt;br /&gt;
2. on injecte cette quantité de poussière nuancée par un coef Cinj pour prendre en compte que le saut de tau_scenario peut venir non pas d'injection locale mais de transports depuis les autres mailles. En pratique, Cinj=0.25, ce qui donne une injection de ~5e-8kg/m²/s&lt;br /&gt;
&lt;br /&gt;
3. toute cette poussière est injectée de manière uniforme entre le 14h actuel et 14h du jour d'après sous forme de stormdust dans la 1ère couche par vdifc, qui la mélange déjà un peu sur plusieurs couches, avant qu'elle ne passe par les thermiques/l'ajustement convectif, la sédimentation (mais on empêche la stormdust de tomber au sol, elle reste dans la 1ère couche à la place), et 5 pas de temps de dynamique&lt;br /&gt;
&lt;br /&gt;
4. une fois retourné au pas de temps physique suivant, on calcule la fraction sous-maille à partir du maximum de mass mixing ratio de stormdust dans toute la colonne (à part la 1ère couche (?) ), par rapport à un mixing ratio de référence mmr_ref=5e-4kg/kg que l'on considère représentatif d'une opacité de 10 (telle que mesurée dans une local dust storm par OMEGA)&lt;br /&gt;
&lt;br /&gt;
5. enfin, on rentre dans la routine rocketduststorm, où on regarde si qqpart dans la colonne, le mmr de stormdust (non-concentré dans la fraction sous-maille) est supérieur à 10^(-4) fois celui du background dust. Si c'est le cas, on active le schéma dans la colonne, et on calcule l'écart de chauffage entre la fraction sous-maille et la maille totale, le transport vertical qui en résulte dans la fraction sous-maille, et le détraînement. Si ce n'est pas le cas (pas assez de stormdust nulle part dans la colonne) on détraîne tout&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Mars-Model]]&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1770</id>
		<title>Dust Cycle in Mars PCM6</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1770"/>
				<updated>2023-11-23T10:42:02Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details at different levels how to use and what is featured in the dust cycle in Mars PCM6. '''This is still work in progress for now !'''&lt;br /&gt;
&lt;br /&gt;
== Level 1 (user) : Flags for PCM6 dust cycle ==&lt;br /&gt;
To run a simulation with the PCM6 dust cycle, you need to set up several flags and parameters in your ''callphys.def'' (see an example here: https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/callphys.def.GCM6)&lt;br /&gt;
&lt;br /&gt;
We list below all the relevant flags and parameters directly related to PCM6 dust cycle :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line&amp;gt;&lt;br /&gt;
##General options&lt;br /&gt;
##~~~~~~~~~~~~~~~&lt;br /&gt;
#Directory where external input files are:&lt;br /&gt;
datadir=/path/to/datadir&lt;br /&gt;
&lt;br /&gt;
#Run with or without tracer transport ?&lt;br /&gt;
tracer=.true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
## Dust scenario. Used to prescribe the dust&lt;br /&gt;
## ~~~~~~~~~~~~~&lt;br /&gt;
#  =1 Dust opt.deph read in startfi; =2 Viking scenario; =3 MGS scenario [default],&lt;br /&gt;
#  =4 Mars Year 24 from TES assimilation (old version of MY24; dust_tes.nc file)&lt;br /&gt;
#  =6 &amp;quot;cold&amp;quot; (low dust) scenario ; =7 &amp;quot;warm&amp;quot; (high dust) scenario&lt;br /&gt;
#  =8 &amp;quot;climatology&amp;quot; (our best guess of a typical Mars year) scenario&lt;br /&gt;
#  =24 Mars Year 24 from TES assimilation (ie: MCD reference case)&lt;br /&gt;
#  =25 Mars Year 25 from TES assimilation (ie: a year with a global dust storm)&lt;br /&gt;
#  =26 Mars Year 26 from TES assimilation&lt;br /&gt;
#  ...&lt;br /&gt;
#  =35 Mars Year 35 from observers assimilation&lt;br /&gt;
iaervar = 8&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# Dust IR opacity ref. wavelength (for dso diagnostics only)&lt;br /&gt;
# &amp;quot;tes&amp;quot; (9.3 microns) [default] or &amp;quot;mcs&amp;quot; (21.6 microns)&lt;br /&gt;
dustiropacity = tes&lt;br /&gt;
# Use an IR to VIS scenario conversion coefficient that is&lt;br /&gt;
# dependent on the GCM dust effective radius,&lt;br /&gt;
# instead of a fixed 2.6 coefficient ?&lt;br /&gt;
#(only if dustiropacity = tes ; default = .false.)&lt;br /&gt;
reff_driven_IRtoVIS_scenario = .true.&lt;br /&gt;
&lt;br /&gt;
## Physical Parameterizations :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# call radiative transfer ? (default=.true.)&lt;br /&gt;
callrad   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
## Radiative transfer options :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# SCATTERERS: set number of scatterers.&lt;br /&gt;
# Must be compliant with other options: +1 if active, +1 if rdstorm, +1 if topflows, +1 if activice ; default=1)&lt;br /&gt;
naerkind = 4&lt;br /&gt;
&lt;br /&gt;
## Tracer (dust water, ice and/or chemical species) options (used if tracer=T):&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# DUST: Transported dust ? (if &amp;gt;0, use 'dustbin' dust bins ; default=0)&lt;br /&gt;
dustbin    = 2&lt;br /&gt;
# DUST: Radiatively active dust ? (matters if dustbin&amp;gt;0 ; default=.false.)&lt;br /&gt;
active  = .true.&lt;br /&gt;
# DUST: use mass and number mixing ratios to predict dust size ? (default=.false.)&lt;br /&gt;
doubleq   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: lifted by GCM surface winds ? (default=.false.)&lt;br /&gt;
lifting = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: Scavenging by H2O snowfall ? (default=.false.)&lt;br /&gt;
scavenging = .true.&lt;br /&gt;
&lt;br /&gt;
# DUST: freedust ? (default=.false.)&lt;br /&gt;
freedust=.true.&lt;br /&gt;
# DUST: dustscaling_mode?&lt;br /&gt;
#     =0 --&amp;gt; freedust, tauscaling=1&lt;br /&gt;
#     =1 --&amp;gt; GCM5.3-like, tauscaling&lt;br /&gt;
#     =2 --&amp;gt; tauscaling=1,dust_rad_adjust&lt;br /&gt;
dustscaling_mode=2&lt;br /&gt;
# DUST: dust injection scheme (if &amp;gt;0, use 'dustinjection' ; default=0)&lt;br /&gt;
dustinjection=1&lt;br /&gt;
# DUST: dust injection scheme coefficient (default=0.25)&lt;br /&gt;
coeff_injection=0.25&lt;br /&gt;
# DUST: dust injection scheme initial local time (default=0.)&lt;br /&gt;
ti_injection=0.&lt;br /&gt;
# DUST: dust injection scheme final local time (default=24.)&lt;br /&gt;
tf_injection=24.&lt;br /&gt;
# DUST: Rocket Dust Storm scheme (default=.false.)&lt;br /&gt;
rdstorm=.true.&lt;br /&gt;
# DUST: RDS detrainment coefficient (default=0.02)&lt;br /&gt;
coeff_detrainment=0.02&lt;br /&gt;
# DUST: Dust entrainment by subgrid-scale slope winds (default=.false.)&lt;br /&gt;
topflows=.true.&lt;br /&gt;
&lt;br /&gt;
# DUST/WATERICE: Scavenging by CO2 condensation? (default=.false.)&lt;br /&gt;
scavco2cond = .true.&lt;br /&gt;
# DUST/WATERICE: Gravitationnal sedimentation ? (default=.true.)&lt;br /&gt;
sedimentation = .true.&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note''' that the PCM6 dust cycle has mainly been tested with the non-dust-related flags and parameters that are featured in ''callphys.def.GCM6'' and ''callphys.def.MCD6'' (cf https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/), and in general with the ''*.def'' files (''run.def'', ''traceur.def'', ''z2sig.def'') that are suffixed with ''.GCM6'' or ''.MCD6''. If you depart from these files, even for non-dust related processes, we do not ensure the good tuning of the dust cycle, nor to a lesser extent the good compilation/execution of the model. If this happens, please reach out to us !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Level 2 (developper) : Parametrizations and tunable parameters ==&lt;br /&gt;
&lt;br /&gt;
== What's going on for rocket dust storms and injection : a detailed example through the physics parametrizations ==&lt;br /&gt;
À 14h, si le scénario du jour d'après donne une opacité de 5 alors que le jour actuel, le GCM a une opacité disons de 1 dans la colonne :&lt;br /&gt;
&lt;br /&gt;
1. on calcule le dtau=5-1=4, puis ce que ça ferait comme quantité de poussière à 3µm à ajouter dans l'atmosphère&lt;br /&gt;
&lt;br /&gt;
2. on injecte cette quantité de poussière nuancée par un coef Cinj pour prendre en compte que le saut de tau_scenario peut venir non pas d'injection locale mais de transports depuis les autres mailles. En pratique, Cinj=0.25, ce qui donne une injection de ~5e-8kg/m²/s&lt;br /&gt;
&lt;br /&gt;
3. toute cette poussière est injectée de manière uniforme entre le 14h actuel et 14h du jour d'après sous forme de stormdust dans la 1ère couche par vdifc, qui la mélange déjà un peu sur plusieurs couches, avant qu'elle ne passe par les thermiques/l'ajustement convectif, la sédimentation (mais on empêche la stormdust de tomber au sol, elle reste dans la 1ère couche à la place), et 5 pas de temps de dynamique&lt;br /&gt;
&lt;br /&gt;
4. une fois retourné au pas de temps physique suivant, on calcule la fraction sous-maille à partir du maximum de mass mixing ratio de stormdust dans toute la colonne (à part la 1ère couche (?) ), par rapport à un mixing ratio de référence mmr_ref=5e-4kg/kg que l'on considère représentatif d'une opacité de 10 (telle que mesurée dans une local dust storm par OMEGA)&lt;br /&gt;
&lt;br /&gt;
5. enfin, on rentre dans la routine rocketduststorm, où on regarde si qqpart dans la colonne, le mmr de stormdust (non-concentré dans la fraction sous-maille) est supérieur à 10^(-4) fois celui du background dust. Si c'est le cas, on active le schéma dans la colonne, et on calcule l'écart de chauffage entre la fraction sous-maille et la maille totale, le transport vertical qui en résulte dans la fraction sous-maille, et le détraînement. Si ce n'est pas le cas (pas assez de stormdust nulle part dans la colonne) on détraîne tout&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Mars-Model]]&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1769</id>
		<title>Dust Cycle in Mars PCM6</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1769"/>
				<updated>2023-11-23T10:29:30Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page details at different levels how to use and what is featured in the dust cycle in Mars PCM6. '''This is still work in progress for now !'''&lt;br /&gt;
&lt;br /&gt;
== Level 1 (user) : Flags for PCM6 dust cycle ==&lt;br /&gt;
To run a simulation with the PCM6 dust cycle, you need to set up several flags and parameters in your ''callphys.def'' (see an example here: https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/callphys.def.GCM6)&lt;br /&gt;
&lt;br /&gt;
We list below all the relevant flags and parameters directly related to PCM6 dust cycle :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line&amp;gt;&lt;br /&gt;
##General options&lt;br /&gt;
##~~~~~~~~~~~~~~~&lt;br /&gt;
#Directory where external input files are:&lt;br /&gt;
datadir=/path/to/datadir&lt;br /&gt;
&lt;br /&gt;
#Run with or without tracer transport ?&lt;br /&gt;
tracer=.true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
## Dust scenario. Used to prescribe the dust&lt;br /&gt;
## ~~~~~~~~~~~~~&lt;br /&gt;
#  =1 Dust opt.deph read in startfi; =2 Viking scenario; =3 MGS scenario,&lt;br /&gt;
#  =4 Mars Year 24 from TES assimilation (old version of MY24; dust_tes.nc file)&lt;br /&gt;
#  =6 &amp;quot;cold&amp;quot; (low dust) scenario ; =7 &amp;quot;warm&amp;quot; (high dust) scenario&lt;br /&gt;
#  =8 &amp;quot;climatology&amp;quot; (our best guess of a typical Mars year) scenario&lt;br /&gt;
#  =24 Mars Year 24 from TES assimilation (ie: MCD reference case)&lt;br /&gt;
#  =25 Mars Year 25 from TES assimilation (ie: a year with a global dust storm)&lt;br /&gt;
#  =26 Mars Year 26 from TES assimilation&lt;br /&gt;
#  ...&lt;br /&gt;
#  =35 Mars Year 35 from observers assimilation&lt;br /&gt;
iaervar = 8&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# Dust IR opacity ref. wavelength (for dso diagnostics only)&lt;br /&gt;
# &amp;quot;tes&amp;quot; (9.3 microns) [default] or &amp;quot;mcs&amp;quot; (21.6 microns)&lt;br /&gt;
dustiropacity = tes&lt;br /&gt;
# Use an IR to VIS scenario conversion coefficient that is&lt;br /&gt;
# dependent on the GCM dust effective radius,&lt;br /&gt;
# instead of a fixed 2.6 coefficient ?&lt;br /&gt;
#(only if dustiropacity = tes ; default = .false.)&lt;br /&gt;
reff_driven_IRtoVIS_scenario = .true.&lt;br /&gt;
&lt;br /&gt;
## Physical Parameterizations :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# call radiative transfer ?&lt;br /&gt;
callrad   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
## Radiative transfer options :&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
# SCATTERERS: set number of scatterers. must be compliant with other options.&lt;br /&gt;
naerkind = 4&lt;br /&gt;
&lt;br /&gt;
## Tracer (dust water, ice and/or chemical species) options (used if tracer=T):&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# DUST: Transported dust ? (if &amp;gt;0, use 'dustbin' dust bins)&lt;br /&gt;
dustbin    = 2&lt;br /&gt;
# DUST: Radiatively active dust ? (matters if dustbin&amp;gt;0)&lt;br /&gt;
active  = .true.&lt;br /&gt;
# DUST: use mass and number mixing ratios to predict dust size ?&lt;br /&gt;
doubleq   = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: lifted by GCM surface winds ?&lt;br /&gt;
lifting = .true.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
# DUST: Scavenging by H2O snowfall ?&lt;br /&gt;
scavenging = .true.&lt;br /&gt;
&lt;br /&gt;
# DUST: freedust ?&lt;br /&gt;
freedust=.true.&lt;br /&gt;
# DUST: dustscaling_mode?&lt;br /&gt;
#     =0 --&amp;gt; freedust, tauscaling=1&lt;br /&gt;
#     =1 --&amp;gt; GCM5.3-like, tauscaling&lt;br /&gt;
#     =2 --&amp;gt; tauscaling=1,dust_rad_adjust&lt;br /&gt;
dustscaling_mode=2&lt;br /&gt;
# DUST: dust injection scheme (if &amp;gt;0, use 'dustinjection')&lt;br /&gt;
dustinjection=1&lt;br /&gt;
# DUST: dust injection scheme coefficient (default=0.25)&lt;br /&gt;
coeff_injection=0.25&lt;br /&gt;
# DUST: dust injection scheme initial local time (default=0.)&lt;br /&gt;
ti_injection=0.&lt;br /&gt;
# DUST: dust injection scheme final local time (default=24.)&lt;br /&gt;
tf_injection=24.&lt;br /&gt;
# DUST: Rocket Dust Storm scheme&lt;br /&gt;
rdstorm=.true.&lt;br /&gt;
# DUST: RDS detrainment coefficient (default=0.02)&lt;br /&gt;
coeff_detrainment=0.02&lt;br /&gt;
# DUST: Dust entrainment by subgrid-scale slope winds&lt;br /&gt;
topflows=.true.&lt;br /&gt;
&lt;br /&gt;
# DUST/WATERICE: Scavenging by CO2 condensation?&lt;br /&gt;
scavco2cond = .true.&lt;br /&gt;
# DUST/WATERICE: Gravitationnal sedimentation ?&lt;br /&gt;
sedimentation = .true.&lt;br /&gt;
&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Note''' that the PCM6 dust cycle has mainly been tested with the non-dust-related flags and parameters that are featured in ''callphys.def.GCM6'' and ''callphys.def.MCD6'' (cf https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/deftank/), and in general with the *.def files (''run.def'', ''traceur.def'', ''z2sig.def'') that are suffixed with ''.GCM6'' or ''.MCD6''. If you depart from these files, even for non-dust related processes, we do not ensure the good tuning of the dust cycle, nor to a lesser extent the good compilation/execution of the model. If this happens, please reach out to us !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Level 2 (developper) : Parametrizations and tunable parameters ==&lt;br /&gt;
&lt;br /&gt;
== What's going on for rocket dust storms and injection : a detailed example through the physics parametrizations ==&lt;br /&gt;
À 14h, si le scénario du jour d'après donne une opacité de 5 alors que le jour actuel, le GCM a une opacité disons de 1 dans la colonne :&lt;br /&gt;
&lt;br /&gt;
1. on calcule le dtau=5-1=4, puis ce que ça ferait comme quantité de poussière à 3µm à ajouter dans l'atmosphère&lt;br /&gt;
&lt;br /&gt;
2. on injecte cette quantité de poussière nuancée par un coef Cinj pour prendre en compte que le saut de tau_scenario peut venir non pas d'injection locale mais de transports depuis les autres mailles. En pratique, Cinj=0.25, ce qui donne une injection de ~5e-8kg/m²/s&lt;br /&gt;
&lt;br /&gt;
3. toute cette poussière est injectée de manière uniforme entre le 14h actuel et 14h du jour d'après sous forme de stormdust dans la 1ère couche par vdifc, qui la mélange déjà un peu sur plusieurs couches, avant qu'elle ne passe par les thermiques/l'ajustement convectif, la sédimentation (mais on empêche la stormdust de tomber au sol, elle reste dans la 1ère couche à la place), et 5 pas de temps de dynamique&lt;br /&gt;
&lt;br /&gt;
4. une fois retourné au pas de temps physique suivant, on calcule la fraction sous-maille à partir du maximum de mass mixing ratio de stormdust dans toute la colonne (à part la 1ère couche (?) ), par rapport à un mixing ratio de référence mmr_ref=5e-4kg/kg que l'on considère représentatif d'une opacité de 10 (telle que mesurée dans une local dust storm par OMEGA)&lt;br /&gt;
&lt;br /&gt;
5. enfin, on rentre dans la routine rocketduststorm, où on regarde si qqpart dans la colonne, le mmr de stormdust (non-concentré dans la fraction sous-maille) est supérieur à 10^(-4) fois celui du background dust. Si c'est le cas, on active le schéma dans la colonne, et on calcule l'écart de chauffage entre la fraction sous-maille et la maille totale, le transport vertical qui en résulte dans la fraction sous-maille, et le détraînement. Si ce n'est pas le cas (pas assez de stormdust nulle part dans la colonne) on détraîne tout&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Mars-Model]]&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

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

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1738</id>
		<title>Dust Cycle in Mars PCM6</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1738"/>
				<updated>2023-11-02T15:42:16Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Beginning a page on the dust cycle in Mars PCM6. '''This is still work in progress for now !'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
À 14h, si le scénario du jour d'après donne une opacité de 5 alors que le jour actuel, le GCM a une opacité disons de 1 dans la colonne :&lt;br /&gt;
&lt;br /&gt;
1. on calcule le dtau=5-1=4, puis ce que ça ferait comme quantité de poussière à 3µm à ajouter dans l'atmosphère&lt;br /&gt;
&lt;br /&gt;
2. on injecte cette quantité de poussière nuancée par un coef Cinj pour prendre en compte que le saut de tau_scenario peut venir non pas d'injection locale mais de transports depuis les autres mailles. En pratique, Cinj=0.25, ce qui donne une injection de ~5e-8kg/m²/s&lt;br /&gt;
&lt;br /&gt;
3. toute cette poussière est injectée de manière uniforme entre le 14h actuel et 14h du jour d'après sous forme de stormdust dans la 1ère couche par vdifc, qui la mélange déjà un peu sur plusieurs couches, avant qu'elle ne passe par les thermiques/l'ajustement convectif, la sédimentation (mais on empêche la stormdust de tomber au sol, elle reste dans la 1ère couche à la place), et 5 pas de temps de dynamique&lt;br /&gt;
&lt;br /&gt;
4. une fois retourné au pas de temps physique suivant, on calcule la fraction sous-maille à partir du maximum de mass mixing ratio de stormdust dans toute la colonne (à part la 1ère couche (?) ), par rapport à un mixing ratio de référence mmr_ref=5e-4kg/kg que l'on considère représentatif d'une opacité de 10 (telle que mesurée dans une local dust storm par OMEGA)&lt;br /&gt;
&lt;br /&gt;
5. enfin, on rentre dans la routine rocketduststorm, où on regarde si qqpart dans la colonne, le mmr de stormdust (non-concentré dans la fraction sous-maille) est supérieur à 10^(-4) fois celui du background dust. Si c'est le cas, on active le schéma dans la colonne, et on calcule l'écart de chauffage entre la fraction sous-maille et la maille totale, le transport vertical qui en résulte dans la fraction sous-maille, et le détraînement. Si ce n'est pas le cas (pas assez de stormdust nulle part dans la colonne) on détraîne tout&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Mars-Model]]&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1737</id>
		<title>Dust Cycle in Mars PCM6</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Dust_Cycle_in_Mars_PCM6&amp;diff=1737"/>
				<updated>2023-11-02T15:40:37Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: Created page with &amp;quot;Beginning a page on the dust cycle in Mars PCM6. '''This is still work in progress for now !'''   À 14h, si le scénario du jour d'après donne une opacité de 5 alors que le...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Beginning a page on the dust cycle in Mars PCM6. '''This is still work in progress for now !'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
À 14h, si le scénario du jour d'après donne une opacité de 5 alors que le jour actuel, le GCM a une opacité disons de 1 dans la colonne :&lt;br /&gt;
&lt;br /&gt;
1. on calcule le dtau=5-1=4, puis ce que ça ferait comme quantité de poussière à 3µm à ajouter dans l'atmosphère&lt;br /&gt;
&lt;br /&gt;
2. on injecte cette quantité de poussière nuancée par un coef Cinj pour prendre en compte que le saut de tau_scenario peut venir non pas d'injection locale mais de transports depuis les autres mailles. En pratique, Cinj=0.25, ce qui donne une injection de ~5e-8kg/m²/s&lt;br /&gt;
&lt;br /&gt;
3. toute cette poussière est injectée de manière uniforme entre le 14h actuel et 14h du jour d'après sous forme de stormdust dans la 1ère couche par vdifc, qui la mélange déjà un peu sur plusieurs couches, avant qu'elle ne passe par les thermiques/l'ajustement convectif, la sédimentation (mais on empêche la stormdust de tomber au sol, elle reste dans la 1ère couche à la place), et 5 pas de temps de dynamique&lt;br /&gt;
&lt;br /&gt;
4. une fois retourné au pas de temps physique suivant, on calcule la fraction sous-maille à partir du maximum de mass mixing ratio de stormdust dans toute la colonne (à part la 1ère couche (?) ), par rapport à un mixing ratio de référence mmr_ref=5e-4kg/kg que l'on considère représentatif d'une opacité de 10 (telle que mesurée dans une local dust storm par OMEGA)&lt;br /&gt;
&lt;br /&gt;
5. enfin, on rentre dans la routine rocketduststorm, où on regarde si qqpart dans la colonne, le mmr de stormdust (non-concentré dans la fraction sous-maille) est supérieur à 10^(-4) fois celui du background dust. Si c'est le cas, on active le schéma dans la colonne, et on calcule l'écart de chauffage entre la fraction sous-maille et la maille totale, le transport vertical qui en résulte dans la fraction sous-maille, et le détraînement. Si ce n'est pas le cas (pas assez de stormdust nulle part dans la colonne) on détraîne tout&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Overview_of_the_Mars_PCM&amp;diff=1735</id>
		<title>Overview of the Mars PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Overview_of_the_Mars_PCM&amp;diff=1735"/>
				<updated>2023-11-02T15:36:41Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== The Mars PCM ==&lt;br /&gt;
In a nutshell, the Mars Planetary Climate Model is a General Circulation Model (GCM) of the Martian atmosphere. It is in fact a suite of models which may be run in various configurations: with the historical lon-lat (LMDZ) dynamics, or the modern DYNAMICO (icosahedral grid) dynamics, or as a regional model using WRF (a limited area dynamical core), or even as a 1D (single column) model.&lt;br /&gt;
&lt;br /&gt;
== Reference Versions of the Mars PCM ==&lt;br /&gt;
In practice the model is most often run using the legacy LMDZ lon-lat global dynamics for 3D simulations. However within this setup there are various configurations or versions of the model that can be used.&lt;br /&gt;
 &lt;br /&gt;
=== GCM version 5 ===&lt;br /&gt;
This is the version of the model that was used to generate Mars Climate Database version 5.3. In practice, the main features of these simulations are:&lt;br /&gt;
* a horizontal grid (longitudexlatitude) resolution of 64x48, with 49 vertical layers (when including the thermosphere)&lt;br /&gt;
* a dust cycle where column dust opacity is imposed via input dust scenarios.&lt;br /&gt;
&lt;br /&gt;
=== GCM version 6 ===&lt;br /&gt;
This is the latest version of the model that was used to generate Mars Climate Database version 6.1. In practice, the main features of these simulations are:&lt;br /&gt;
* a horizontal grid (longitudexlatitude) resolution of 64x48, with 73 vertical layers (when including the thermosphere)&lt;br /&gt;
* a dust cycle where column dust opacity is not rescaled to but driven by dust scenarios, via injection of rocket dust storms and the use of mountain slope dust re-injection parametrization. A dedicated page on the dust cycle in version 6 can be found [[Dust_Cycle_in_Mars_PCM6|here]].&lt;br /&gt;
&lt;br /&gt;
== Getting started ==&lt;br /&gt;
Most likely you will want to install and run the model, then you should start [[Quick_Install_and_Run_Mars_PCM|with this page]]. You can also check the User Manual provided with the source code (in the LMDZ.MARS directory), a copy is available online https://trac.lmd.jussieu.fr/Planeto/browser/trunk/LMDZ.MARS/user_manual.pdf, and also the [[Help_Mars_PCM|&amp;quot;Getting Help&amp;quot;]] page on this wiki.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Mars-Model]]&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

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

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Using_Adastra&amp;diff=1559</id>
		<title>Using Adastra</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Using_Adastra&amp;diff=1559"/>
				<updated>2023-07-19T10:20:49Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a summary of examples and tools designed to help you get used with the Adastra environment.&lt;br /&gt;
&lt;br /&gt;
== Getting access to the cluster ==&lt;br /&gt;
For people on the &amp;quot;Atmosphères Planétaires&amp;quot; GENCI project who need to open an account on Adastra, here is the procedure:&lt;br /&gt;
&lt;br /&gt;
# Go to https://www.edari.fr/utilisateur and log in via Janus or create an account if you don't have a Janus login. If this doesn't work, you can create a new eDARI account. (Make sure your profile is fully up to date including nationality)&lt;br /&gt;
# Beware! If you are on 2 lab (LMD and LATMOS for example), you must register with your email address corresponding to your Janus account.&lt;br /&gt;
# Click on &amp;quot;se rattacher à un dossier ayant obtenu des resources&amp;quot; or &amp;quot;Attach yourself to an application file that has obtained resources&amp;quot;&lt;br /&gt;
# &amp;quot;Atmosphères Planétaires&amp;quot; project number to provide:  A0140110391&lt;br /&gt;
# Ehouarn then receives an email to allow you to join the project. Once he has validated it, you receive a confirmation mail.&lt;br /&gt;
# Once approved, you have to request for an account, click on &amp;quot;CINES: créer une demande d'ouverture de compte&amp;quot;&lt;br /&gt;
# fill in the forms: name, contract end date, CINES, your lab information (LMD is the default)&lt;br /&gt;
# Access IP address  134.157.47.46 , FQDN (Fully Qualified Domain Name): ssh-out.lmd.jussieu.fr &lt;br /&gt;
# Add a second address : 134.157.176.129 , FQDN: ciclad.ipsl.upmc.fr&lt;br /&gt;
# click on option to have access to CCFR (only important if you have access to other GENCI machines)&lt;br /&gt;
# Security officer is Julien Lenseigne for LMD (his informations are all pre-filled, except phone: +33169335172)&lt;br /&gt;
# YOU MUST THEN VALIDATE THE REQUEST: click on the &amp;quot;Valider la saisie des informations&amp;quot;&lt;br /&gt;
# You then receive an automatic mail, but it's only to tell you to go to the next step: You must now download the pre-filled form from e-dari: find &amp;quot;télécharger la demande&amp;quot; and download the pdf. Sign it, and upload it on e-dari &amp;quot;déposer la demande de création de compte&amp;quot;.&lt;br /&gt;
# Wait for your application to be preprocessed by the system...&lt;br /&gt;
&lt;br /&gt;
== A couple of pointers ==&lt;br /&gt;
&lt;br /&gt;
* Connecting to Adastra: For those who had an account on Occigen, we have retained group and login credentials from then; To connect to Adastra you need first go through the LMD gateway (hakim) or the IPSL (Ciclad/Spirit) gateway and then&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh your_cines_login@adastra.cines.fr&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
And then you will probably want to switch project using the myproject command, e.g. to switch to &amp;quot;lmd1167&amp;quot; (the old &amp;quot;Atmosphères Planétaires&amp;quot; GENCI project)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
myproject -a lmd1167&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
and to switch to &amp;quot;cin0391&amp;quot; (the 2023-2024 &amp;quot;Atmosphères Planétaires&amp;quot; GENCI project)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
myproject -a cin0391&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
WARNING: when you switch projects, you also switch HOME directory etc.&lt;br /&gt;
&lt;br /&gt;
To get all the info about dedicated environment variables (e.g. paths to SCRATCH, STORE, etc.) you can use&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
myproject -c&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To get all the information about project accounting (number of hours available and used by each member of the project) you need to connect to https://reser.cines.fr/ using your Adastra login and password&lt;br /&gt;
&lt;br /&gt;
* Changing the password of your CINES account&lt;br /&gt;
When your password is close to expiring, CINES asks you to change it on this website : https://rosetta.cines.fr&lt;br /&gt;
&lt;br /&gt;
Please note that you can access this website only if you are on a machine that you declared as a gateway for Adastra. At LMD, we have generally declared hakim.lmd.jussieu.fr (aka ssh-out) and ciclad.ipsl.jussieu.fr as gateway machines. Hakim doesn't have any browser installed, but you can launch &amp;lt;code&amp;gt;firefox&amp;lt;/code&amp;gt; on Ciclad and connect to the rosetta website.&lt;br /&gt;
If that doesn't work, check out the page on [[How to launch your local browser through a gateway machine]] or contact mail svp@cines.fr&lt;br /&gt;
&lt;br /&gt;
* Link to the Adastra technical documentation: https://dci.dci-gitlab.cines.fr/webextranet/&lt;br /&gt;
&lt;br /&gt;
== Submitting jobs ==&lt;br /&gt;
It's done using SLURM; you need to write up a job script and submit it using '''sbatch'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sbatch myjob&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You must specify in the header of the job which project ressources you are using (&amp;quot;cin0391&amp;quot; in our case):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#SBATCH --account=cin0391&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Example of an MPI job to launch a simulation ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=job_mpi&lt;br /&gt;
#SBATCH --account=cin0391&lt;br /&gt;
### GENOA nodes accommodate 96 cores &lt;br /&gt;
#SBATCH --constraint=GENOA&lt;br /&gt;
### Number of Nodes to use&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
### Number of MPI tasks per node&lt;br /&gt;
#SBATCH --ntasks-per-node=48 &lt;br /&gt;
### Number of OpenMP threads per MPI task&lt;br /&gt;
#SBATCH --cpus-per-task=1&lt;br /&gt;
#SBATCH --threads-per-core=1&lt;br /&gt;
###SBATCH --exclusive&lt;br /&gt;
#SBATCH --output=job_mpi_%A.out&lt;br /&gt;
#SBATCH --time=00:45:00 &lt;br /&gt;
&lt;br /&gt;
#source env modules:&lt;br /&gt;
source ../trunk/LMDZ.COMMON/arch.env &lt;br /&gt;
ulimit -s unlimited&lt;br /&gt;
&lt;br /&gt;
srun --cpu-bind=threads --label gcm_96x96x78_phyvenus_para.e &amp;gt; gcm.out 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Example of a mixed MPI/OpenMP job to launch a simulation ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#SBATCH --job-name=job_mpi_omp&lt;br /&gt;
#SBATCH --account=cin0391&lt;br /&gt;
### GENOA nodes accommodate 96 cores &lt;br /&gt;
#SBATCH --constraint=GENOA&lt;br /&gt;
### Number of Nodes to use&lt;br /&gt;
#SBATCH --nodes=1&lt;br /&gt;
### Number of MPI tasks per node&lt;br /&gt;
#SBATCH --ntasks-per-node=24 &lt;br /&gt;
### Number of OpenMP threads per MPI task&lt;br /&gt;
#SBATCH --cpus-per-task=4&lt;br /&gt;
#SBATCH --threads-per-core=1&lt;br /&gt;
###SBATCH --exclusive&lt;br /&gt;
#SBATCH --output=job_mpi_omp_%A.out&lt;br /&gt;
#SBATCH --time=00:30:00 &lt;br /&gt;
&lt;br /&gt;
#source env modules:&lt;br /&gt;
source ../trunk/LMDZ.COMMON/arch.env &lt;br /&gt;
ulimit -s unlimited&lt;br /&gt;
&lt;br /&gt;
### OMP_NUM_THREADS value must match &amp;quot;#SBATCH --cpus-per-task&amp;quot;&lt;br /&gt;
export OMP_NUM_THREADS=4&lt;br /&gt;
export OMP_STACKSIZE=400M&lt;br /&gt;
&lt;br /&gt;
srun --cpu-bind=threads --label gcm_64x48x54_phymars_para.e &amp;gt; gcm.out 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Are you being disconnected when inactive? ==&lt;br /&gt;
If you are regularly being disconnected when a bit inactive on the supercomputer, adding these few lines in a ''config'' file in the .ssh/ repository of your logging machine (ex: ssh-out/ciclad) may help :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
Host *&lt;br /&gt;
...&lt;br /&gt;
KeepAlive yes&lt;br /&gt;
TCPKeepAlive yes&lt;br /&gt;
ServerAliveInterval 15&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Using_Irene_Rome&amp;diff=1558</id>
		<title>Using Irene Rome</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Using_Irene_Rome&amp;diff=1558"/>
				<updated>2023-07-19T10:19:31Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a summary of examples and tools designed to help you get used with the Irene Rome environment. (as of July 2022)&lt;br /&gt;
&lt;br /&gt;
== How to access the cluster ==&lt;br /&gt;
&lt;br /&gt;
For people on the &amp;quot;Atmosphères Planétaires&amp;quot; GENCI project who need to open an account on Irene-Rome, here is the procedure:&lt;br /&gt;
&lt;br /&gt;
* Log on to https://www-dcc.extra.cea.fr/CCFR/ and provide various information about yourself &lt;br /&gt;
&lt;br /&gt;
A few tips:&lt;br /&gt;
&lt;br /&gt;
- chose TGCC&lt;br /&gt;
&lt;br /&gt;
- give your PROFESSIONAL phone number (and not your personal cell phone number)&lt;br /&gt;
&lt;br /&gt;
- name of the project: Atmosphères Planétaires  Numéro du Dossier: A0120110391&lt;br /&gt;
&lt;br /&gt;
- Responsable scientifique du projet: M. Ehouarn MILLOUR , ehouarn.millour@lmd.ipsl.fr, 0144275286, Nationalité: Fr&lt;br /&gt;
&lt;br /&gt;
- Responsable sécurité: M. Franck Guyon, franck.guyon@lmd.ipsl.fr, 0144275277, Nationalité: Fr. Note that this is assuming you have an account on LMD computers and/or the MESOIPSL cluster. Otherwise you must provide the information for the relevant person from your lab.&lt;br /&gt;
&lt;br /&gt;
- IPs &amp;amp; machine names to connect to Irene: 134.157.47.46 (ssh-out.lmd.jussieu.fr) and 134.157.176.129 (ciclad.ipsl.upmc.fr). Note that this is assuming you have an account on LMD computers and/or the MESOIPSL cluster. Otherwise you must provide name &amp;amp; IP of your institute's gateway machine. &lt;br /&gt;
&lt;br /&gt;
- Chose anything you want for the 8 character password&lt;br /&gt;
&lt;br /&gt;
* And then get Ehouarn to sign the form and forward it to Franck for him to sign as well.&lt;br /&gt;
&lt;br /&gt;
* Send the signed form to hotline.tgcc@cea.fr&lt;br /&gt;
&lt;br /&gt;
== Some useful commands ==&lt;br /&gt;
&lt;br /&gt;
* To access the disks of our project on Irene (&amp;quot;Atmosphères Planétaires&amp;quot; GENCI project), add the following line in your .bash_profile file:&lt;br /&gt;
(.bash_profile rather than .bashrc, because otherwise scp may not find your files when fetching them from $CCCWORKDIR on irene to your machine)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
module switch dfldatadir/gen10391&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To access your work directory (to run your simulations)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /ccc/work/cont003/gen10391/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
you can also access the work directory with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $CCCWORKDIR&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To access your store directory (to store big data files we are limited in inode number not in filesize! It is recommended to store files of at least 50M, preferably more, e.g. big tar files of 10G or more)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /ccc/work/cont003/gen10391/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
you can also access the store directory with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $CCCSTOREDIR&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To access the scratch directory&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $CCCSCRATCHDIR&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
IMPORTANT: the scratchdir is fast access, very big, BUT regularly automatically purged! If you use it do remember to backup stuff on the WORKDIR or STOREDIR.&lt;br /&gt;
&lt;br /&gt;
The scratch purge policy (from machine.info):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* Files not accessed for 60 days are automatically purged&lt;br /&gt;
* Symbolic links are not purged&lt;br /&gt;
* Directories that have been empty for more than 30 days are removed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
There is a dedicated command&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_will_purge&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
which should return information about upcoming purge on your scratch space. Note that the database this command queries is only refreshed on a nightly basis, so it will incorrectly reflect changes you just made this very day.&lt;br /&gt;
&lt;br /&gt;
One nice idea is to put this command in your .bashrc, so that it runs everytime you connect to Irene (you can add the ''-s'' option to avoid having long list of files displaying on your screen). If you do so, you have to encapsulate it in a conditional test to check if you're in interactive mode, otherwise it will prevent any rsync/scp between Irene and other machines (which are not in interactive and will thus block on the ccc_will_purge command) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
if [ -n &amp;quot;${PS1:-}&amp;quot; ]; then&lt;br /&gt;
    ccc_will_purge -s&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And a nice command (copyleft Antoine Martinez and Olivier from LATMOS) to update all the &amp;quot;Access&amp;quot; and &amp;quot;Change&amp;quot; stats of the files in your current directory (and sub-directories), without changing the &amp;quot;Modify&amp;quot; stat (so that you can still sort them by date of modification with 'ls -lt') :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $CCCSCRATCHDIR&lt;br /&gt;
find . -type f -exec touch -a {} \;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This will prevent your files on the scratchdir to be purged for another 60 days.&lt;br /&gt;
&lt;br /&gt;
* To access Irene Interactive Documentation:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
machine.info&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: you can also access the online documentation here: http://www-hpc.cea.fr/tgcc-public/en/html/toc/fulldoc/Introduction.html&lt;br /&gt;
&lt;br /&gt;
* To display infos about project accounting:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_myproject &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To know about user and group disk quota&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_quota -a&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To know about how long your passwd will be active:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_password_expiration&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To change passwd:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
passwd&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example of a job to run a GCM simulation ==&lt;br /&gt;
&lt;br /&gt;
=== Mixed openMP / MPI ===&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;
# Partition to run on:&lt;br /&gt;
#MSUB -q rome&lt;br /&gt;
# project to run on &lt;br /&gt;
#MSUB -A  gen10391&lt;br /&gt;
# disks to use&lt;br /&gt;
#MSUB -m  scratch,work,store&lt;br /&gt;
# Job name&lt;br /&gt;
#MSUB -r run_gcm&lt;br /&gt;
# Job standard output:&lt;br /&gt;
#MSUB -o run_gcm.%I&lt;br /&gt;
# Job standard error:&lt;br /&gt;
#MSUB -e run_gcm.%I&lt;br /&gt;
# number of OpenMP threads c&lt;br /&gt;
#MSUB -c 2&lt;br /&gt;
# number of MPI tasks n&lt;br /&gt;
#MSUB -n 16&lt;br /&gt;
# number of nodes to use N&lt;br /&gt;
#MSUB -N 1&lt;br /&gt;
# max job run time T (in seconds)&lt;br /&gt;
#MSUB -T 3600&lt;br /&gt;
# request exculsive use of the node (128 cores)&lt;br /&gt;
##MSUB -x&lt;br /&gt;
&lt;br /&gt;
source ../trunk/LMDZ.COMMON/arch.env&lt;br /&gt;
export OMP_STACKSIZE=400M&lt;br /&gt;
export OMP_NUM_THREADS=2&lt;br /&gt;
&lt;br /&gt;
ccc_mprun -l gcm_32x32x15_phystd_para.e &amp;gt; gcm.out 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pure MPI + long run ===&lt;br /&gt;
&lt;br /&gt;
The most important parameter for mpi-only runs is ''-n'' &lt;br /&gt;
providing the total number of CPUs &lt;br /&gt;
(ideally a multiple of 128, which is the number of CPUs per core).&lt;br /&gt;
&lt;br /&gt;
Runs longer than 1 day are not possible unless&lt;br /&gt;
selecting a quality-of-service (QoS) &amp;quot;long&amp;quot;&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;
# Partition to run on:&lt;br /&gt;
#MSUB -q rome&lt;br /&gt;
# project to run on &lt;br /&gt;
#MSUB -A  gen10391&lt;br /&gt;
# disks to use&lt;br /&gt;
#MSUB -m  scratch,work,store&lt;br /&gt;
# Job name&lt;br /&gt;
#MSUB -r run_wrf&lt;br /&gt;
# Job standard output:&lt;br /&gt;
#MSUB -o run_wrf.%I&lt;br /&gt;
# Job standard error:&lt;br /&gt;
#MSUB -e run_wrf.%I&lt;br /&gt;
# number of MPI tasks n (total)&lt;br /&gt;
#MSUB -n 256&lt;br /&gt;
# max job run time T (in seconds)&lt;br /&gt;
#MSUB -T 345600&lt;br /&gt;
# select quality-of-service&lt;br /&gt;
# - test &amp;lt; 30min&lt;br /&gt;
# - normal &amp;lt; 1d (default)&lt;br /&gt;
# - long &amp;lt; 3d &lt;br /&gt;
#MSUB -Q long&lt;br /&gt;
&lt;br /&gt;
#############################&lt;br /&gt;
&lt;br /&gt;
# load the modules used to compile&lt;br /&gt;
source arch.env&lt;br /&gt;
&lt;br /&gt;
# clean the logs&lt;br /&gt;
rm -rf rsl.*&lt;br /&gt;
&lt;br /&gt;
# create initial state&lt;br /&gt;
# -- this is done on a single proc&lt;br /&gt;
ideal.exe&lt;br /&gt;
mv rsl.error.0000 ideal_rsl.error.0000&lt;br /&gt;
mv rsl.out.0000 ideal_rsl.out.0000&lt;br /&gt;
&lt;br /&gt;
# main launch&lt;br /&gt;
ccc_mprun -l wrf.exe&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Priority Short Job ===&lt;br /&gt;
If you have a job that requires less than 30 minutes of user time (&amp;lt;code&amp;gt;#MSUB -T 1800&amp;lt;/code&amp;gt; or less) and no more than 2 nodes, you can launch your job with a &amp;quot;test&amp;quot; quality-of-service (QoS).&lt;br /&gt;
This will double the priority of your job in the queue compared to the &amp;quot;normal&amp;quot; or &amp;quot;long&amp;quot; QoS.&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;
# select quality-of-service&lt;br /&gt;
# - test &amp;lt; 30min&lt;br /&gt;
# - normal &amp;lt; 1d (default)&lt;br /&gt;
# - long &amp;lt; 3d&lt;br /&gt;
#MSUB -Q test&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Main submission commands ==&lt;br /&gt;
&lt;br /&gt;
* To launch the job script ''run_gcm.job'':&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_msub run_gcm.job&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To display information about your jobs:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_mpp -u $USER &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To kill job number ''jobid''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_mdel jobid&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To display infos about a job (works both while it is running or after it has finished):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_macct jobid&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To display infos about project accounting:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_myproject&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To display infos about limits (quality-of-service QoS):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_mqinfo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To display infos about partitions:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_mpinfo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== File transfert from Occigen ==&lt;br /&gt;
One should use ccfr:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
module load ccfr&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
A list of available machines is given by&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccfr_ssh -v&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
To log on to Occigen (from Irene):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccfr_ssh occigenlogin@cines&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To copy a file (typically a big tar file):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccfr_cp occigenlogin@cines:remote_dir local_dir &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This command will fail if you try copying over a directory, with a weird error message of the likes of:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rsync: write failed on &amp;quot;/ccc/work/....&amp;quot; Disk quota exceeded (122)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If copying over directories (via rsync) then you should modify the related rights (which must be &amp;quot;s&amp;quot; for the group on Irene) using dedicated options:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync --chmod=Dg+s --chown=:gen10391 source_on_distant_machine target_on_Irene  &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Worth knowing about ==&lt;br /&gt;
* The command wget is disabled on Irene, scripts using it will fail...&lt;br /&gt;
* Only &amp;quot;https&amp;quot; is allowed. This is important for instance when downloading code (via svn, git). Moreover for svn checkouts one has to provide their svn username and password.&lt;br /&gt;
*If you encounter a quota issue on Irene, first check if indeed you (or the group's) quota is exceeded:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_quota&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case you get an error message about your quota when copying data over to Irene, it might be because the rights on directories are not well set; please use the following command on your directory before sending the data to Irene:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod -R g+s NAME_OF_DIR&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Are you being disconnected when inactive? ==&lt;br /&gt;
If you are regularly being disconnected when a bit inactive on the supercomputer, adding these few lines in a ''config'' file in the .ssh/ repository of your logging machine (ex: ssh-out/ciclad) may help :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
Host *&lt;br /&gt;
...&lt;br /&gt;
KeepAlive yes&lt;br /&gt;
TCPKeepAlive yes&lt;br /&gt;
ServerAliveInterval 15&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Using_Irene_Rome&amp;diff=1477</id>
		<title>Using Irene Rome</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Using_Irene_Rome&amp;diff=1477"/>
				<updated>2023-05-24T15:53:10Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: /* Main submission commands */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a summary of examples and tools designed to help you get used with the Irene Rome environment. (as of July 2022)&lt;br /&gt;
&lt;br /&gt;
== How to access the cluster ==&lt;br /&gt;
&lt;br /&gt;
For people on the &amp;quot;Atmosphères Planétaires&amp;quot; GENCI project who need to open an account on Irene-Rome, here is the procedure:&lt;br /&gt;
&lt;br /&gt;
* Log on to https://www-dcc.extra.cea.fr/CCFR/ and provide various information about yourself &lt;br /&gt;
&lt;br /&gt;
A few tips:&lt;br /&gt;
&lt;br /&gt;
- chose TGCC&lt;br /&gt;
&lt;br /&gt;
- give your PROFESSIONAL phone number (and not your personal cell phone number)&lt;br /&gt;
&lt;br /&gt;
- name of the project: Atmosphères Planétaires  Numéro du Dossier: A0120110391&lt;br /&gt;
&lt;br /&gt;
- Responsable scientifique du projet: M. Ehouarn MILLOUR , ehouarn.millour@lmd.ipsl.fr, 0144275286, Nationalité: Fr&lt;br /&gt;
&lt;br /&gt;
- Responsable sécurité: M. Franck Guyon, franck.guyon@lmd.ipsl.fr, 0144275277, Nationalité: Fr. Note that this is assuming you have an account on LMD computers and/or the MESOIPSL cluster. Otherwise you must provide the information for the relevant person from your lab.&lt;br /&gt;
&lt;br /&gt;
- IPs &amp;amp; machine names to connect to Irene: 134.157.47.46 (ssh-out.lmd.jussieu.fr) and 134.157.176.129 (ciclad.ipsl.upmc.fr). Note that this is assuming you have an account on LMD computers and/or the MESOIPSL cluster. Otherwise you must provide name &amp;amp; IP of your institute's gateway machine. &lt;br /&gt;
&lt;br /&gt;
- Chose anything you want for the 8 character password&lt;br /&gt;
&lt;br /&gt;
* And then get Ehouarn to sign the form and forward it to Franck for him to sign as well.&lt;br /&gt;
&lt;br /&gt;
* Send the signed form to hotline.tgcc@cea.fr&lt;br /&gt;
&lt;br /&gt;
== Some useful commands ==&lt;br /&gt;
&lt;br /&gt;
* To access the disks of our project on Irene (&amp;quot;Atmosphères Planétaires&amp;quot; GENCI project), add the following line in your .bash_profile file:&lt;br /&gt;
(.bash_profile rather than .bashrc, because otherwise scp may not find your files when fetching them from $CCCWORKDIR on irene to your machine)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
module switch dfldatadir/gen10391&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To access your work directory (to run your simulations)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /ccc/work/cont003/gen10391/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
you can also access the work directory with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $CCCWORKDIR&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To access your store directory (to store big data files we are limited in inode number not in filesize! It is recommended to store files of at least 50M, preferably more, e.g. big tar files of 10G or more)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /ccc/work/cont003/gen10391/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
you can also access the store directory with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $CCCSTOREDIR&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To access the scratch directory&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $CCCSCRATCHDIR&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
IMPORTANT: the scratchdir is fast access, very big, BUT regularly automatically purged! If you use it do remember to backup stuff on the WORKDIR or STOREDIR.&lt;br /&gt;
&lt;br /&gt;
The scratch purge policy (from machine.info):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* Files not accessed for 60 days are automatically purged&lt;br /&gt;
* Symbolic links are not purged&lt;br /&gt;
* Directories that have been empty for more than 30 days are removed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
There is a dedicated command&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_will_purge&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
which should return information about upcoming purge on your scratch space. Note that the database this command queries is only refreshed on a nightly basis, so it will incorrectly reflect changes you just made this very day.&lt;br /&gt;
&lt;br /&gt;
One nice idea is to put this command in your .bashrc, so that it runs everytime you connect to Irene (you can add the ''-s'' option to avoid having long list of files displaying on your screen). If you do so, you have to encapsulate it in a conditional test to check if you're in interactive mode, otherwise it will prevent any rsync/scp between Irene and other machines (which are not in interactive and will thus block on the ccc_will_purge command) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
if [ -n &amp;quot;${PS1:-}&amp;quot; ]; then&lt;br /&gt;
    ccc_will_purge -s&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And a nice command (copyleft Antoine Martinez and Olivier from LATMOS) to update all the &amp;quot;Access&amp;quot; and &amp;quot;Change&amp;quot; stats of the files in your current directory (and sub-directories), without changing the &amp;quot;Modify&amp;quot; stat (so that you can still sort them by date of modification with 'ls -lt') :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $CCCSCRATCHDIR&lt;br /&gt;
find . -type f -exec touch -a {} \;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This will prevent your files on the scratchdir to be purged for another 60 days.&lt;br /&gt;
&lt;br /&gt;
* To access Irene Interactive Documentation:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
machine.info&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: you can also access the online documentation here: http://www-hpc.cea.fr/tgcc-public/en/html/toc/fulldoc/Introduction.html&lt;br /&gt;
&lt;br /&gt;
* To display infos about project accounting:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_myproject &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To know about user and group disk quota&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_quota -a&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To know about how long your passwd will be active:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_password_expiration&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To change passwd:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
passwd&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example of a job to run a GCM simulation ==&lt;br /&gt;
&lt;br /&gt;
=== Mixed openMP / MPI ===&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;
# Partition to run on:&lt;br /&gt;
#MSUB -q rome&lt;br /&gt;
# project to run on &lt;br /&gt;
#MSUB -A  gen10391&lt;br /&gt;
# disks to use&lt;br /&gt;
#MSUB -m  scratch,work,store&lt;br /&gt;
# Job name&lt;br /&gt;
#MSUB -r run_gcm&lt;br /&gt;
# Job standard output:&lt;br /&gt;
#MSUB -o run_gcm.%I&lt;br /&gt;
# Job standard error:&lt;br /&gt;
#MSUB -e run_gcm.%I&lt;br /&gt;
# number of OpenMP threads c&lt;br /&gt;
#MSUB -c 2&lt;br /&gt;
# number of MPI tasks n&lt;br /&gt;
#MSUB -n 16&lt;br /&gt;
# number of nodes to use N&lt;br /&gt;
#MSUB -N 1&lt;br /&gt;
# max job run time T (in seconds)&lt;br /&gt;
#MSUB -T 3600&lt;br /&gt;
# request exculsive use of the node (128 cores)&lt;br /&gt;
##MSUB -x&lt;br /&gt;
&lt;br /&gt;
source ../trunk/LMDZ.COMMON/arch.env&lt;br /&gt;
export OMP_STACKSIZE=400M&lt;br /&gt;
export OMP_NUM_THREADS=2&lt;br /&gt;
&lt;br /&gt;
ccc_mprun -l gcm_32x32x15_phystd_para.e &amp;gt; gcm.out 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pure MPI + long run ===&lt;br /&gt;
&lt;br /&gt;
The most important parameter for mpi-only runs is ''-n'' &lt;br /&gt;
providing the total number of CPUs &lt;br /&gt;
(ideally a multiple of 128, which is the number of CPUs per core).&lt;br /&gt;
&lt;br /&gt;
Runs longer than 1 day are not possible unless&lt;br /&gt;
selecting a quality-of-service (QoS) &amp;quot;long&amp;quot;&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;
# Partition to run on:&lt;br /&gt;
#MSUB -q rome&lt;br /&gt;
# project to run on &lt;br /&gt;
#MSUB -A  gen10391&lt;br /&gt;
# disks to use&lt;br /&gt;
#MSUB -m  scratch,work,store&lt;br /&gt;
# Job name&lt;br /&gt;
#MSUB -r run_wrf&lt;br /&gt;
# Job standard output:&lt;br /&gt;
#MSUB -o run_wrf.%I&lt;br /&gt;
# Job standard error:&lt;br /&gt;
#MSUB -e run_wrf.%I&lt;br /&gt;
# number of MPI tasks n (total)&lt;br /&gt;
#MSUB -n 256&lt;br /&gt;
# max job run time T (in seconds)&lt;br /&gt;
#MSUB -T 345600&lt;br /&gt;
# select quality-of-service&lt;br /&gt;
# - test &amp;lt; 30min&lt;br /&gt;
# - normal &amp;lt; 1d (default)&lt;br /&gt;
# - long &amp;lt; 3d &lt;br /&gt;
#MSUB -Q long&lt;br /&gt;
&lt;br /&gt;
#############################&lt;br /&gt;
&lt;br /&gt;
# load the modules used to compile&lt;br /&gt;
source arch.env&lt;br /&gt;
&lt;br /&gt;
# clean the logs&lt;br /&gt;
rm -rf rsl.*&lt;br /&gt;
&lt;br /&gt;
# create initial state&lt;br /&gt;
# -- this is done on a single proc&lt;br /&gt;
ideal.exe&lt;br /&gt;
mv rsl.error.0000 ideal_rsl.error.0000&lt;br /&gt;
mv rsl.out.0000 ideal_rsl.out.0000&lt;br /&gt;
&lt;br /&gt;
# main launch&lt;br /&gt;
ccc_mprun -l wrf.exe&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Priority Short Job ===&lt;br /&gt;
If you have a job that requires less than 30 minutes of user time (&amp;lt;code&amp;gt;#MSUB -T 1800&amp;lt;/code&amp;gt; or less) and no more than 2 nodes, you can launch your job with a &amp;quot;test&amp;quot; quality-of-service (QoS).&lt;br /&gt;
This will double the priority of your job in the queue compared to the &amp;quot;normal&amp;quot; or &amp;quot;long&amp;quot; QoS.&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;
# select quality-of-service&lt;br /&gt;
# - test &amp;lt; 30min&lt;br /&gt;
# - normal &amp;lt; 1d (default)&lt;br /&gt;
# - long &amp;lt; 3d&lt;br /&gt;
#MSUB -Q test&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Main submission commands ==&lt;br /&gt;
&lt;br /&gt;
* To launch the job script ''run_gcm.job'':&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_msub run_gcm.job&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To display information about your jobs:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_mpp -u $USER &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To kill job number ''jobid''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_mdel jobid&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To display infos about a job (works both while it is running or after it has finished):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_macct jobid&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To display infos about project accounting:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_myproject&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To display infos about limits (quality-of-service QoS):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_mqinfo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To display infos about partitions:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_mpinfo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== File transfert from Occigen ==&lt;br /&gt;
One should use ccfr:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
module load ccfr&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
A list of available machines is given by&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccfr_ssh -v&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
To log on to Occigen (from Irene):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccfr_ssh occigenlogin@cines&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To copy a file (typically a big tar file):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccfr_cp occigenlogin@cines:remote_dir local_dir &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This command will fail if you try copying over a directory, with a weird error message of the likes of:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rsync: write failed on &amp;quot;/ccc/work/....&amp;quot; Disk quota exceeded (122)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If copying over directories (via rsync) then you should modify the related rights (which must be &amp;quot;s&amp;quot; for the group on Irene) using dedicated options:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync --chmod=Dg+s --chown=:gen10391 source_on_distant_machine target_on_Irene  &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Worth knowing about ==&lt;br /&gt;
* The command wget is disabled on Irene, scripts using it will fail...&lt;br /&gt;
* Only &amp;quot;https&amp;quot; is allowed. This is important for instance when downloading code (via svn, git). Moreover for svn checkouts one has to provide their svn username and password.&lt;br /&gt;
*If you encounter a quota issue on Irene, first check if indeed you (or the group's) quota is exceeded:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_quota&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case you get an error message about your quota when copying data over to Irene, it might be because the rights on directories are not well set; please use the following command on your directory before sending the data to Irene:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod -R g+s NAME_OF_DIR&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Using_Irene_Rome&amp;diff=1476</id>
		<title>Using Irene Rome</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Using_Irene_Rome&amp;diff=1476"/>
				<updated>2023-05-24T15:43:05Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: /* Example of a job to run a GCM simulation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a summary of examples and tools designed to help you get used with the Irene Rome environment. (as of July 2022)&lt;br /&gt;
&lt;br /&gt;
== How to access the cluster ==&lt;br /&gt;
&lt;br /&gt;
For people on the &amp;quot;Atmosphères Planétaires&amp;quot; GENCI project who need to open an account on Irene-Rome, here is the procedure:&lt;br /&gt;
&lt;br /&gt;
* Log on to https://www-dcc.extra.cea.fr/CCFR/ and provide various information about yourself &lt;br /&gt;
&lt;br /&gt;
A few tips:&lt;br /&gt;
&lt;br /&gt;
- chose TGCC&lt;br /&gt;
&lt;br /&gt;
- give your PROFESSIONAL phone number (and not your personal cell phone number)&lt;br /&gt;
&lt;br /&gt;
- name of the project: Atmosphères Planétaires  Numéro du Dossier: A0120110391&lt;br /&gt;
&lt;br /&gt;
- Responsable scientifique du projet: M. Ehouarn MILLOUR , ehouarn.millour@lmd.ipsl.fr, 0144275286, Nationalité: Fr&lt;br /&gt;
&lt;br /&gt;
- Responsable sécurité: M. Franck Guyon, franck.guyon@lmd.ipsl.fr, 0144275277, Nationalité: Fr. Note that this is assuming you have an account on LMD computers and/or the MESOIPSL cluster. Otherwise you must provide the information for the relevant person from your lab.&lt;br /&gt;
&lt;br /&gt;
- IPs &amp;amp; machine names to connect to Irene: 134.157.47.46 (ssh-out.lmd.jussieu.fr) and 134.157.176.129 (ciclad.ipsl.upmc.fr). Note that this is assuming you have an account on LMD computers and/or the MESOIPSL cluster. Otherwise you must provide name &amp;amp; IP of your institute's gateway machine. &lt;br /&gt;
&lt;br /&gt;
- Chose anything you want for the 8 character password&lt;br /&gt;
&lt;br /&gt;
* And then get Ehouarn to sign the form and forward it to Franck for him to sign as well.&lt;br /&gt;
&lt;br /&gt;
* Send the signed form to hotline.tgcc@cea.fr&lt;br /&gt;
&lt;br /&gt;
== Some useful commands ==&lt;br /&gt;
&lt;br /&gt;
* To access the disks of our project on Irene (&amp;quot;Atmosphères Planétaires&amp;quot; GENCI project), add the following line in your .bash_profile file:&lt;br /&gt;
(.bash_profile rather than .bashrc, because otherwise scp may not find your files when fetching them from $CCCWORKDIR on irene to your machine)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
module switch dfldatadir/gen10391&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To access your work directory (to run your simulations)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /ccc/work/cont003/gen10391/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
you can also access the work directory with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $CCCWORKDIR&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To access your store directory (to store big data files we are limited in inode number not in filesize! It is recommended to store files of at least 50M, preferably more, e.g. big tar files of 10G or more)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /ccc/work/cont003/gen10391/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
you can also access the store directory with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $CCCSTOREDIR&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To access the scratch directory&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $CCCSCRATCHDIR&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
IMPORTANT: the scratchdir is fast access, very big, BUT regularly automatically purged! If you use it do remember to backup stuff on the WORKDIR or STOREDIR.&lt;br /&gt;
&lt;br /&gt;
The scratch purge policy (from machine.info):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* Files not accessed for 60 days are automatically purged&lt;br /&gt;
* Symbolic links are not purged&lt;br /&gt;
* Directories that have been empty for more than 30 days are removed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
There is a dedicated command&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_will_purge&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
which should return information about upcoming purge on your scratch space. Note that the database this command queries is only refreshed on a nightly basis, so it will incorrectly reflect changes you just made this very day.&lt;br /&gt;
&lt;br /&gt;
One nice idea is to put this command in your .bashrc, so that it runs everytime you connect to Irene (you can add the ''-s'' option to avoid having long list of files displaying on your screen). If you do so, you have to encapsulate it in a conditional test to check if you're in interactive mode, otherwise it will prevent any rsync/scp between Irene and other machines (which are not in interactive and will thus block on the ccc_will_purge command) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
if [ -n &amp;quot;${PS1:-}&amp;quot; ]; then&lt;br /&gt;
    ccc_will_purge -s&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And a nice command (copyleft Antoine Martinez and Olivier from LATMOS) to update all the &amp;quot;Access&amp;quot; and &amp;quot;Change&amp;quot; stats of the files in your current directory (and sub-directories), without changing the &amp;quot;Modify&amp;quot; stat (so that you can still sort them by date of modification with 'ls -lt') :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $CCCSCRATCHDIR&lt;br /&gt;
find . -type f -exec touch -a {} \;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This will prevent your files on the scratchdir to be purged for another 60 days.&lt;br /&gt;
&lt;br /&gt;
* To access Irene Interactive Documentation:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
machine.info&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: you can also access the online documentation here: http://www-hpc.cea.fr/tgcc-public/en/html/toc/fulldoc/Introduction.html&lt;br /&gt;
&lt;br /&gt;
* To display infos about project accounting:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_myproject &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To know about user and group disk quota&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_quota -a&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To know about how long your passwd will be active:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_password_expiration&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To change passwd:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
passwd&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example of a job to run a GCM simulation ==&lt;br /&gt;
&lt;br /&gt;
=== Mixed openMP / MPI ===&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;
# Partition to run on:&lt;br /&gt;
#MSUB -q rome&lt;br /&gt;
# project to run on &lt;br /&gt;
#MSUB -A  gen10391&lt;br /&gt;
# disks to use&lt;br /&gt;
#MSUB -m  scratch,work,store&lt;br /&gt;
# Job name&lt;br /&gt;
#MSUB -r run_gcm&lt;br /&gt;
# Job standard output:&lt;br /&gt;
#MSUB -o run_gcm.%I&lt;br /&gt;
# Job standard error:&lt;br /&gt;
#MSUB -e run_gcm.%I&lt;br /&gt;
# number of OpenMP threads c&lt;br /&gt;
#MSUB -c 2&lt;br /&gt;
# number of MPI tasks n&lt;br /&gt;
#MSUB -n 16&lt;br /&gt;
# number of nodes to use N&lt;br /&gt;
#MSUB -N 1&lt;br /&gt;
# max job run time T (in seconds)&lt;br /&gt;
#MSUB -T 3600&lt;br /&gt;
# request exculsive use of the node (128 cores)&lt;br /&gt;
##MSUB -x&lt;br /&gt;
&lt;br /&gt;
source ../trunk/LMDZ.COMMON/arch.env&lt;br /&gt;
export OMP_STACKSIZE=400M&lt;br /&gt;
export OMP_NUM_THREADS=2&lt;br /&gt;
&lt;br /&gt;
ccc_mprun -l gcm_32x32x15_phystd_para.e &amp;gt; gcm.out 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pure MPI + long run ===&lt;br /&gt;
&lt;br /&gt;
The most important parameter for mpi-only runs is ''-n'' &lt;br /&gt;
providing the total number of CPUs &lt;br /&gt;
(ideally a multiple of 128, which is the number of CPUs per core).&lt;br /&gt;
&lt;br /&gt;
Runs longer than 1 day are not possible unless&lt;br /&gt;
selecting a quality-of-service (QoS) &amp;quot;long&amp;quot;&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;
# Partition to run on:&lt;br /&gt;
#MSUB -q rome&lt;br /&gt;
# project to run on &lt;br /&gt;
#MSUB -A  gen10391&lt;br /&gt;
# disks to use&lt;br /&gt;
#MSUB -m  scratch,work,store&lt;br /&gt;
# Job name&lt;br /&gt;
#MSUB -r run_wrf&lt;br /&gt;
# Job standard output:&lt;br /&gt;
#MSUB -o run_wrf.%I&lt;br /&gt;
# Job standard error:&lt;br /&gt;
#MSUB -e run_wrf.%I&lt;br /&gt;
# number of MPI tasks n (total)&lt;br /&gt;
#MSUB -n 256&lt;br /&gt;
# max job run time T (in seconds)&lt;br /&gt;
#MSUB -T 345600&lt;br /&gt;
# select quality-of-service&lt;br /&gt;
# - test &amp;lt; 30min&lt;br /&gt;
# - normal &amp;lt; 1d (default)&lt;br /&gt;
# - long &amp;lt; 3d &lt;br /&gt;
#MSUB -Q long&lt;br /&gt;
&lt;br /&gt;
#############################&lt;br /&gt;
&lt;br /&gt;
# load the modules used to compile&lt;br /&gt;
source arch.env&lt;br /&gt;
&lt;br /&gt;
# clean the logs&lt;br /&gt;
rm -rf rsl.*&lt;br /&gt;
&lt;br /&gt;
# create initial state&lt;br /&gt;
# -- this is done on a single proc&lt;br /&gt;
ideal.exe&lt;br /&gt;
mv rsl.error.0000 ideal_rsl.error.0000&lt;br /&gt;
mv rsl.out.0000 ideal_rsl.out.0000&lt;br /&gt;
&lt;br /&gt;
# main launch&lt;br /&gt;
ccc_mprun -l wrf.exe&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Priority Short Job ===&lt;br /&gt;
If you have a job that requires less than 30 minutes of user time (&amp;lt;code&amp;gt;#MSUB -T 1800&amp;lt;/code&amp;gt; or less) and no more than 2 nodes, you can launch your job with a &amp;quot;test&amp;quot; quality-of-service (QoS).&lt;br /&gt;
This will double the priority of your job in the queue compared to the &amp;quot;normal&amp;quot; or &amp;quot;long&amp;quot; QoS.&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;
# select quality-of-service&lt;br /&gt;
# - test &amp;lt; 30min&lt;br /&gt;
# - normal &amp;lt; 1d (default)&lt;br /&gt;
# - long &amp;lt; 3d&lt;br /&gt;
#MSUB -Q test&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Main submission commands ==&lt;br /&gt;
&lt;br /&gt;
* To launch the job script ''run_gcm.job'':&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_msub run_gcm.job&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To display information about your jobs:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_mpp -u $USER &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To kill job number ''jobid''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_mdel jobid&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To display infos about a job (works both while it is running or after it has finished):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_macct jobid&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To display infos about project accounting:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_myproject&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To display infos about limits:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_mqinfo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To display infos about partitions:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_mpinfo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== File transfert from Occigen ==&lt;br /&gt;
One should use ccfr:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
module load ccfr&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
A list of available machines is given by&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccfr_ssh -v&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
To log on to Occigen (from Irene):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccfr_ssh occigenlogin@cines&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To copy a file (typically a big tar file):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccfr_cp occigenlogin@cines:remote_dir local_dir &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This command will fail if you try copying over a directory, with a weird error message of the likes of:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rsync: write failed on &amp;quot;/ccc/work/....&amp;quot; Disk quota exceeded (122)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If copying over directories (via rsync) then you should modify the related rights (which must be &amp;quot;s&amp;quot; for the group on Irene) using dedicated options:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync --chmod=Dg+s --chown=:gen10391 source_on_distant_machine target_on_Irene  &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Worth knowing about ==&lt;br /&gt;
* The command wget is disabled on Irene, scripts using it will fail...&lt;br /&gt;
* Only &amp;quot;https&amp;quot; is allowed. This is important for instance when downloading code (via svn, git). Moreover for svn checkouts one has to provide their svn username and password.&lt;br /&gt;
*If you encounter a quota issue on Irene, first check if indeed you (or the group's) quota is exceeded:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_quota&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case you get an error message about your quota when copying data over to Irene, it might be because the rights on directories are not well set; please use the following command on your directory before sending the data to Irene:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod -R g+s NAME_OF_DIR&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Using_Adastra&amp;diff=1459</id>
		<title>Using Adastra</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Using_Adastra&amp;diff=1459"/>
				<updated>2023-05-15T09:02:20Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: /* A couple of pointers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a summary of examples and tools designed to help you get used with the Adastra environment.&lt;br /&gt;
&lt;br /&gt;
== Warning ==&lt;br /&gt;
Access to Adastra is for now (at least until 01/05/2023) only for computations on the GPU (MI200) partition!&lt;br /&gt;
&lt;br /&gt;
Nevertheless it is also a way to have access to &amp;quot;old&amp;quot; files that we stored at CINES when using Occigen in the frame of the &amp;quot;Atmosphères Planétaires&amp;quot; GENCI project.&lt;br /&gt;
&lt;br /&gt;
== A couple of pointers ==&lt;br /&gt;
&lt;br /&gt;
* Connecting to Adastra: We have retained group and login credentials from our previous setup on Occigen ; To connect to Adastra you need first go through the LMD gateway (hakim) or the IPSL (Ciclad/Spirit) gateway and then&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh your_cines_login@adastra.cines.fr&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
And then you will probably want to switch project using the myproject command, e.g. to switch to &amp;quot;lmd1167&amp;quot; (the old &amp;quot;Atmosphères Planétaires&amp;quot; GENCI project)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
myproject -a lmd1167&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
and to switch to &amp;quot;cin0391&amp;quot; (the 2023-2024 &amp;quot;Atmosphères Planétaires&amp;quot; GENCI project)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
myproject -a cin0391&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
WARNING: when you switch projects, you also switch HOME directory etc.&lt;br /&gt;
&lt;br /&gt;
To get all the info about dedicated environment variables (e.g. paths to SCRATCH, STORE, etc.) you can use&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
myproject -c&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Changing the password of your CINES account&lt;br /&gt;
When your password is close to expiring, CINES asks you to change it on this website : https://rosetta.cines.fr&lt;br /&gt;
&lt;br /&gt;
Please note that you can access this website only if you are on a machine that you declared as a gateway for Adastra. At LMD, we have generally declared hakim.lmd.jussieu.fr (aka ssh-out) and ciclad.ipsl.jussieu.fr as gateway machines. Hakim doesn't have any browser installed, but you can launch &amp;lt;code&amp;gt;firefox&amp;lt;/code&amp;gt; on Ciclad and connect to the rosetta website.&lt;br /&gt;
If that doesn't work, you will have to mail svp@cines.fr&lt;br /&gt;
&lt;br /&gt;
* Link to the Adastra technical documentation: https://dci.dci-gitlab.cines.fr/webextranet/&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Guide_for_good_coding&amp;diff=1445</id>
		<title>Guide for good coding</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Guide_for_good_coding&amp;diff=1445"/>
				<updated>2023-05-10T11:46:55Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: /* To know when coding with a code parallelized with OpenMP */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to create a new module/subroutine ==&lt;br /&gt;
&lt;br /&gt;
Subroutines should be integrated inside a module.&lt;br /&gt;
A good writing habit is to add the line &amp;quot;IMPLICIT NONE&amp;quot;, in the beginning of the module and subroutine.&lt;br /&gt;
&lt;br /&gt;
First you can define all the variable that belongs to the module and could be used at another place.&lt;br /&gt;
A good thing is also to create a subroutine that allocate and initialise module variables.&lt;br /&gt;
If the variable is only modified inside the module it should be taged as protected.&lt;br /&gt;
If the variable belongs only to the module it can be specified to be private.&lt;br /&gt;
&lt;br /&gt;
You can now start the writing of the subroutine.&lt;br /&gt;
&lt;br /&gt;
- Start by importing variable and function from other module if necessary.&lt;br /&gt;
&lt;br /&gt;
- Comment the purpose of the subroutine directly.&lt;br /&gt;
&lt;br /&gt;
- Declare the variables, first the one pass in arguments.&lt;br /&gt;
Use the intent to specify the status of the variable inside the subroutine.&lt;br /&gt;
&lt;br /&gt;
- Continue with the local and saved variables.&lt;br /&gt;
&lt;br /&gt;
- Then you can define local variables.&lt;br /&gt;
&lt;br /&gt;
- Remember to comment all of them, you can specify the dimension if the variable is an allocatable variable as well as the units and everything that seems appropriate.&lt;br /&gt;
&lt;br /&gt;
You can finally write the code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot; line&amp;gt;&lt;br /&gt;
    MODULE aquarium_mod&lt;br /&gt;
&lt;br /&gt;
    IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
    INTEGER, protected :: water     ! Define what is the variable, the dimension, units (°) etc...&lt;br /&gt;
    ! ideally all module variables should be &amp;quot;protected&amp;quot; i.e. can only be set or modified&lt;br /&gt;
    ! by routines/functions in the same module but can be used outside of it (as &amp;quot;read-only&amp;quot;)&lt;br /&gt;
    REAL,SAVE,ALLOCATABLE,DIMENSION(:),PROTECTED :: kre1      ! Another comment &lt;br /&gt;
&lt;br /&gt;
    CONTAINS&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE aquarium(kre, grass, other_things&lt;br /&gt;
     &amp;amp;                    really_anything)&lt;br /&gt;
                                                         &lt;br /&gt;
      use another_module_mod, only: some_routine, some_variable&lt;br /&gt;
      &lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   subject:&lt;br /&gt;
!   --------&lt;br /&gt;
!   What is the subroutine doing&lt;br /&gt;
!&lt;br /&gt;
!   author: Someone smart &lt;br /&gt;
!   ------&lt;br /&gt;
!   update: Someone smarter, march 2012:&lt;br /&gt;
!         - I change something here&lt;br /&gt;
!   &lt;br /&gt;
!=======================================================================&lt;br /&gt;
      &lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
!-----------------------------------------------------------------------&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!    Declarations :&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!&lt;br /&gt;
!    Input/Output&lt;br /&gt;
!    ------------&lt;br /&gt;
      REAL, INTENT(IN)     ::  something(ngrid,nlayer) ! 2D tabular used as an input only  (W/m^2)&lt;br /&gt;
      REAL, INTENT(OUT)    ::  kre(ngrid)              ! 1D tabular output by the subroutine  &lt;br /&gt;
      REAL, INTENT(INOUT)  ::  grass(ngrid,nlayer)     ! Variable that is modified by the subroutine&lt;br /&gt;
                                                       ! it is an input and output&lt;br /&gt;
      LOGICAL, INTENT(IN)  ::  really_anything         ! Boolean variable  &lt;br /&gt;
&lt;br /&gt;
!    Local saved variables&lt;br /&gt;
!    ---------------------&lt;br /&gt;
      INTEGER, PARAMETER :: nb_kre = 4                ! Number of kre&lt;br /&gt;
      INTEGER, SAVE      :: rock                      ! Another variable&lt;br /&gt;
      LOGICAL, SAVE      :: firstcall=.true.          ! Another variable&lt;br /&gt;
&lt;br /&gt;
!    Local variables&lt;br /&gt;
!    ---------------&lt;br /&gt;
      REAL    tabular(ngrid)                          ! Local var&lt;br /&gt;
      INTEGER i                                       ! Loop var&lt;br /&gt;
&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   Beginning of the code&lt;br /&gt;
!=======================================================================&lt;br /&gt;
&lt;br /&gt;
      IF (firstcall) THEN&lt;br /&gt;
        ! initialize rock&lt;br /&gt;
        rock = 2&lt;br /&gt;
      ENDIF !end firstcall&lt;br /&gt;
&lt;br /&gt;
      ! identify where are the kre&lt;br /&gt;
      DO i=1,nb_kre&lt;br /&gt;
        kre(i)=i&lt;br /&gt;
        if (kre(i).gt.rock) then&lt;br /&gt;
          write(*,*) &amp;quot;the Kre &amp;quot;, i, &amp;quot;is behind the rock&amp;quot;&lt;br /&gt;
        else if (mod(kre(i),2).eq.0) then&lt;br /&gt;
          grass(:,nlayer-1)=grass(:,nlayer-1)-grass(:,nlayer) ! every two kre are eating grass in a very complex way&lt;br /&gt;
        endif !(kre(i).gt.rock)&lt;br /&gt;
      ENDDO !end of the loop nb_kre&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE aquarium&lt;br /&gt;
&lt;br /&gt;
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE ini_aquarium(ngrid)&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   Initialise module's variable&lt;br /&gt;
!=======================================================================&lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
      INTEGER, INTENT(IN) :: ngrid&lt;br /&gt;
&lt;br /&gt;
      allocate(kre1(ngrid+1))&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE ini_aquarium&lt;br /&gt;
&lt;br /&gt;
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE end_aquarium&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   Deallocate module's variable&lt;br /&gt;
!=======================================================================&lt;br /&gt;
&lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
      IF (allocated(kre1)) deallocate(kre1)&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE end_aquarium&lt;br /&gt;
      &lt;br /&gt;
    END MODULE aquarium_mod&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Naming subroutines convention ==&lt;br /&gt;
&lt;br /&gt;
Un peu plus pour le PEM peut-être&lt;br /&gt;
&lt;br /&gt;
== When to create subroutines instead of line of code ==&lt;br /&gt;
&lt;br /&gt;
Quand est ce qu'on décide que ca vaut le coup de faire une routine spécifique : exemple négativité des pdq dans physiq_mod&lt;br /&gt;
&lt;br /&gt;
== How to pass variable to subroutine (by argument or by using a module) ==&lt;br /&gt;
&lt;br /&gt;
Base rule: variables should be passed down to routines via arguments. It makes it much easier for readers to follow what's going on and/or do the reverse engineering...&lt;br /&gt;
&lt;br /&gt;
One should only use (import) a variable from a module if it used as &amp;quot;read-only&amp;quot; information. e.g. gravity constant, aerosol optical properties, etc.&lt;br /&gt;
&lt;br /&gt;
== Naming variables convention ==&lt;br /&gt;
&lt;br /&gt;
What is the naming convention.&lt;br /&gt;
In [[vdifc_mod]] for example.&lt;br /&gt;
&lt;br /&gt;
== Loop index convention ==&lt;br /&gt;
&lt;br /&gt;
Index name for loops over:&lt;br /&gt;
* '''physical grid''' : ig (max ngrid)&lt;br /&gt;
* ''' vertical levels''' : l (max nlayer)&lt;br /&gt;
* '''tracer''' : iq (max nq)&lt;br /&gt;
* '''subslopes''' : islope (max nslope)&lt;br /&gt;
* '''aerosol''' : iaer (max naerkind)&lt;br /&gt;
* '''longitude''' : &lt;br /&gt;
* '''latitude''' :&lt;br /&gt;
&lt;br /&gt;
== Efficient loop coding ==&lt;br /&gt;
&lt;br /&gt;
The outermost loop index should correspond to the last index of an array.&lt;br /&gt;
&lt;br /&gt;
Example: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot;&amp;gt;&lt;br /&gt;
      DO l=1,nlayer&lt;br /&gt;
        DO ig=1,ngrid&lt;br /&gt;
          array(ig,l)=l*ig&lt;br /&gt;
        ENDDO&lt;br /&gt;
      ENDDO&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to use the INTENT ==&lt;br /&gt;
&lt;br /&gt;
Argument of a function can come in 3 different way: IN, OUT, INOUT.&lt;br /&gt;
All arguments should be specified as :&lt;br /&gt;
* intent(in) : input only, i.e. not modified by the routine (or routines it passes the argument on to)&lt;br /&gt;
* intent(out) : output only, i.e. the value is set/computed in the routine (or via a routine it calls)&lt;br /&gt;
* intent(inout) : the combination of the two&lt;br /&gt;
&lt;br /&gt;
== How to comment code ==&lt;br /&gt;
&lt;br /&gt;
* '''In english'''&lt;br /&gt;
* '''As much as possible'''&lt;br /&gt;
* '''By using &amp;lt;code&amp;gt;!&amp;lt;/code&amp;gt;''' (also known as the &amp;quot;bang&amp;quot; character) rather than &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; (which is not interpreted as a comment by fortran90+ compilers)&lt;br /&gt;
* '''Variable definition''' : explain what it is, the dimension, the units etc...&lt;br /&gt;
* '''Subroutine''' : Explain what it does, who wrote it, who modify it and why if it is a big change&lt;br /&gt;
* '''Loops''' : if the enddo is far away you can comment to which index it correspond to.&lt;br /&gt;
* '''Chapter your code''' : you can add section to your code to make it clearer.&lt;br /&gt;
&lt;br /&gt;
== To know when coding with a code parallelized with OpenMP ==&lt;br /&gt;
In Fortran, any variable from a &amp;lt;code&amp;gt;module&amp;lt;/code&amp;gt;, written in a &amp;lt;code&amp;gt;COMMON&amp;lt;/code&amp;gt;, declared &amp;lt;code&amp;gt;SAVE&amp;lt;/code&amp;gt; or initialized at the declaration (using &amp;lt;code&amp;gt;DATA&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt;) is considered a ''static variable''.&lt;br /&gt;
When your code is parallelized using OpenMP, these static variables are SHARED by default. '''For the PCM physics, in 90% cases, you want each thread on which the code is parallelized to have its own private version of the variable''', so you should add, after the declaration of your variable, the following line:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot;&amp;gt;&lt;br /&gt;
!$OMP THREADPRIVATE(variable)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== General guide ==&lt;br /&gt;
&lt;br /&gt;
* Create .F90 instead of .F&lt;br /&gt;
* Delete unused argument in a function call if you see one&lt;br /&gt;
* Delete unused variables&lt;br /&gt;
* Choose meaningful names of variables&lt;br /&gt;
* Don't hesitate to comment as much as possible, a code is never too commented&lt;br /&gt;
* Delete unused commented code lines&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;br /&gt;
[[Category:Mars-Model]]&lt;br /&gt;
[[Category:Venus-Model]]&lt;br /&gt;
[[Category:Titan-Model]]&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Guide_for_good_coding&amp;diff=1444</id>
		<title>Guide for good coding</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Guide_for_good_coding&amp;diff=1444"/>
				<updated>2023-05-10T11:46:12Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: /* To know when coding with a code parallelized with OpenMP */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to create a new module/subroutine ==&lt;br /&gt;
&lt;br /&gt;
Subroutines should be integrated inside a module.&lt;br /&gt;
A good writing habit is to add the line &amp;quot;IMPLICIT NONE&amp;quot;, in the beginning of the module and subroutine.&lt;br /&gt;
&lt;br /&gt;
First you can define all the variable that belongs to the module and could be used at another place.&lt;br /&gt;
A good thing is also to create a subroutine that allocate and initialise module variables.&lt;br /&gt;
If the variable is only modified inside the module it should be taged as protected.&lt;br /&gt;
If the variable belongs only to the module it can be specified to be private.&lt;br /&gt;
&lt;br /&gt;
You can now start the writing of the subroutine.&lt;br /&gt;
&lt;br /&gt;
- Start by importing variable and function from other module if necessary.&lt;br /&gt;
&lt;br /&gt;
- Comment the purpose of the subroutine directly.&lt;br /&gt;
&lt;br /&gt;
- Declare the variables, first the one pass in arguments.&lt;br /&gt;
Use the intent to specify the status of the variable inside the subroutine.&lt;br /&gt;
&lt;br /&gt;
- Continue with the local and saved variables.&lt;br /&gt;
&lt;br /&gt;
- Then you can define local variables.&lt;br /&gt;
&lt;br /&gt;
- Remember to comment all of them, you can specify the dimension if the variable is an allocatable variable as well as the units and everything that seems appropriate.&lt;br /&gt;
&lt;br /&gt;
You can finally write the code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot; line&amp;gt;&lt;br /&gt;
    MODULE aquarium_mod&lt;br /&gt;
&lt;br /&gt;
    IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
    INTEGER, protected :: water     ! Define what is the variable, the dimension, units (°) etc...&lt;br /&gt;
    ! ideally all module variables should be &amp;quot;protected&amp;quot; i.e. can only be set or modified&lt;br /&gt;
    ! by routines/functions in the same module but can be used outside of it (as &amp;quot;read-only&amp;quot;)&lt;br /&gt;
    REAL,SAVE,ALLOCATABLE,DIMENSION(:),PROTECTED :: kre1      ! Another comment &lt;br /&gt;
&lt;br /&gt;
    CONTAINS&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE aquarium(kre, grass, other_things&lt;br /&gt;
     &amp;amp;                    really_anything)&lt;br /&gt;
                                                         &lt;br /&gt;
      use another_module_mod, only: some_routine, some_variable&lt;br /&gt;
      &lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   subject:&lt;br /&gt;
!   --------&lt;br /&gt;
!   What is the subroutine doing&lt;br /&gt;
!&lt;br /&gt;
!   author: Someone smart &lt;br /&gt;
!   ------&lt;br /&gt;
!   update: Someone smarter, march 2012:&lt;br /&gt;
!         - I change something here&lt;br /&gt;
!   &lt;br /&gt;
!=======================================================================&lt;br /&gt;
      &lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
!-----------------------------------------------------------------------&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!    Declarations :&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!&lt;br /&gt;
!    Input/Output&lt;br /&gt;
!    ------------&lt;br /&gt;
      REAL, INTENT(IN)     ::  something(ngrid,nlayer) ! 2D tabular used as an input only  (W/m^2)&lt;br /&gt;
      REAL, INTENT(OUT)    ::  kre(ngrid)              ! 1D tabular output by the subroutine  &lt;br /&gt;
      REAL, INTENT(INOUT)  ::  grass(ngrid,nlayer)     ! Variable that is modified by the subroutine&lt;br /&gt;
                                                       ! it is an input and output&lt;br /&gt;
      LOGICAL, INTENT(IN)  ::  really_anything         ! Boolean variable  &lt;br /&gt;
&lt;br /&gt;
!    Local saved variables&lt;br /&gt;
!    ---------------------&lt;br /&gt;
      INTEGER, PARAMETER :: nb_kre = 4                ! Number of kre&lt;br /&gt;
      INTEGER, SAVE      :: rock                      ! Another variable&lt;br /&gt;
      LOGICAL, SAVE      :: firstcall=.true.          ! Another variable&lt;br /&gt;
&lt;br /&gt;
!    Local variables&lt;br /&gt;
!    ---------------&lt;br /&gt;
      REAL    tabular(ngrid)                          ! Local var&lt;br /&gt;
      INTEGER i                                       ! Loop var&lt;br /&gt;
&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   Beginning of the code&lt;br /&gt;
!=======================================================================&lt;br /&gt;
&lt;br /&gt;
      IF (firstcall) THEN&lt;br /&gt;
        ! initialize rock&lt;br /&gt;
        rock = 2&lt;br /&gt;
      ENDIF !end firstcall&lt;br /&gt;
&lt;br /&gt;
      ! identify where are the kre&lt;br /&gt;
      DO i=1,nb_kre&lt;br /&gt;
        kre(i)=i&lt;br /&gt;
        if (kre(i).gt.rock) then&lt;br /&gt;
          write(*,*) &amp;quot;the Kre &amp;quot;, i, &amp;quot;is behind the rock&amp;quot;&lt;br /&gt;
        else if (mod(kre(i),2).eq.0) then&lt;br /&gt;
          grass(:,nlayer-1)=grass(:,nlayer-1)-grass(:,nlayer) ! every two kre are eating grass in a very complex way&lt;br /&gt;
        endif !(kre(i).gt.rock)&lt;br /&gt;
      ENDDO !end of the loop nb_kre&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE aquarium&lt;br /&gt;
&lt;br /&gt;
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE ini_aquarium(ngrid)&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   Initialise module's variable&lt;br /&gt;
!=======================================================================&lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
      INTEGER, INTENT(IN) :: ngrid&lt;br /&gt;
&lt;br /&gt;
      allocate(kre1(ngrid+1))&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE ini_aquarium&lt;br /&gt;
&lt;br /&gt;
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE end_aquarium&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   Deallocate module's variable&lt;br /&gt;
!=======================================================================&lt;br /&gt;
&lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
      IF (allocated(kre1)) deallocate(kre1)&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE end_aquarium&lt;br /&gt;
      &lt;br /&gt;
    END MODULE aquarium_mod&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Naming subroutines convention ==&lt;br /&gt;
&lt;br /&gt;
Un peu plus pour le PEM peut-être&lt;br /&gt;
&lt;br /&gt;
== When to create subroutines instead of line of code ==&lt;br /&gt;
&lt;br /&gt;
Quand est ce qu'on décide que ca vaut le coup de faire une routine spécifique : exemple négativité des pdq dans physiq_mod&lt;br /&gt;
&lt;br /&gt;
== How to pass variable to subroutine (by argument or by using a module) ==&lt;br /&gt;
&lt;br /&gt;
Base rule: variables should be passed down to routines via arguments. It makes it much easier for readers to follow what's going on and/or do the reverse engineering...&lt;br /&gt;
&lt;br /&gt;
One should only use (import) a variable from a module if it used as &amp;quot;read-only&amp;quot; information. e.g. gravity constant, aerosol optical properties, etc.&lt;br /&gt;
&lt;br /&gt;
== Naming variables convention ==&lt;br /&gt;
&lt;br /&gt;
What is the naming convention.&lt;br /&gt;
In [[vdifc_mod]] for example.&lt;br /&gt;
&lt;br /&gt;
== Loop index convention ==&lt;br /&gt;
&lt;br /&gt;
Index name for loops over:&lt;br /&gt;
* '''physical grid''' : ig (max ngrid)&lt;br /&gt;
* ''' vertical levels''' : l (max nlayer)&lt;br /&gt;
* '''tracer''' : iq (max nq)&lt;br /&gt;
* '''subslopes''' : islope (max nslope)&lt;br /&gt;
* '''aerosol''' : iaer (max naerkind)&lt;br /&gt;
* '''longitude''' : &lt;br /&gt;
* '''latitude''' :&lt;br /&gt;
&lt;br /&gt;
== Efficient loop coding ==&lt;br /&gt;
&lt;br /&gt;
The outermost loop index should correspond to the last index of an array.&lt;br /&gt;
&lt;br /&gt;
Example: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot;&amp;gt;&lt;br /&gt;
      DO l=1,nlayer&lt;br /&gt;
        DO ig=1,ngrid&lt;br /&gt;
          array(ig,l)=l*ig&lt;br /&gt;
        ENDDO&lt;br /&gt;
      ENDDO&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to use the INTENT ==&lt;br /&gt;
&lt;br /&gt;
Argument of a function can come in 3 different way: IN, OUT, INOUT.&lt;br /&gt;
All arguments should be specified as :&lt;br /&gt;
* intent(in) : input only, i.e. not modified by the routine (or routines it passes the argument on to)&lt;br /&gt;
* intent(out) : output only, i.e. the value is set/computed in the routine (or via a routine it calls)&lt;br /&gt;
* intent(inout) : the combination of the two&lt;br /&gt;
&lt;br /&gt;
== How to comment code ==&lt;br /&gt;
&lt;br /&gt;
* '''In english'''&lt;br /&gt;
* '''As much as possible'''&lt;br /&gt;
* '''By using &amp;lt;code&amp;gt;!&amp;lt;/code&amp;gt;''' (also known as the &amp;quot;bang&amp;quot; character) rather than &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; (which is not interpreted as a comment by fortran90+ compilers)&lt;br /&gt;
* '''Variable definition''' : explain what it is, the dimension, the units etc...&lt;br /&gt;
* '''Subroutine''' : Explain what it does, who wrote it, who modify it and why if it is a big change&lt;br /&gt;
* '''Loops''' : if the enddo is far away you can comment to which index it correspond to.&lt;br /&gt;
* '''Chapter your code''' : you can add section to your code to make it clearer.&lt;br /&gt;
&lt;br /&gt;
== To know when coding with a code parallelized with OpenMP ==&lt;br /&gt;
In Fortran, any variable from a &amp;lt;code&amp;gt;module&amp;lt;/code&amp;gt;, written in a &amp;lt;code&amp;gt;COMMON&amp;lt;/code&amp;gt;, declared &amp;lt;code&amp;gt;SAVE&amp;lt;/code&amp;gt; or initialized at the declaration (using &amp;lt;code&amp;gt;DATA&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt;) is considered a ''static variable''.&lt;br /&gt;
When your code is parallelized using OpenMP, these static variables are SHARED by default. '''For the PCM, in 90% cases, you want each thread on which the code is parallelized to have its own private version of the variable''', so you should add, after the declaration of your variable, the following line:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot;&amp;gt;&lt;br /&gt;
!$OMP THREADPRIVATE(variable)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== General guide ==&lt;br /&gt;
&lt;br /&gt;
* Create .F90 instead of .F&lt;br /&gt;
* Delete unused argument in a function call if you see one&lt;br /&gt;
* Delete unused variables&lt;br /&gt;
* Choose meaningful names of variables&lt;br /&gt;
* Don't hesitate to comment as much as possible, a code is never too commented&lt;br /&gt;
* Delete unused commented code lines&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;br /&gt;
[[Category:Mars-Model]]&lt;br /&gt;
[[Category:Venus-Model]]&lt;br /&gt;
[[Category:Titan-Model]]&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Guide_for_good_coding&amp;diff=1443</id>
		<title>Guide for good coding</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Guide_for_good_coding&amp;diff=1443"/>
				<updated>2023-05-10T09:21:03Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to create a new module/subroutine ==&lt;br /&gt;
&lt;br /&gt;
Subroutines should be integrated inside a module.&lt;br /&gt;
A good writing habit is to add the line &amp;quot;IMPLICIT NONE&amp;quot;, in the beginning of the module and subroutine.&lt;br /&gt;
&lt;br /&gt;
First you can define all the variable that belongs to the module and could be used at another place.&lt;br /&gt;
A good thing is also to create a subroutine that allocate and initialise module variables.&lt;br /&gt;
If the variable is only modified inside the module it should be taged as protected.&lt;br /&gt;
If the variable belongs only to the module it can be specified to be private.&lt;br /&gt;
&lt;br /&gt;
You can now start the writing of the subroutine.&lt;br /&gt;
&lt;br /&gt;
- Start by importing variable and function from other module if necessary.&lt;br /&gt;
&lt;br /&gt;
- Comment the purpose of the subroutine directly.&lt;br /&gt;
&lt;br /&gt;
- Declare the variables, first the one pass in arguments.&lt;br /&gt;
Use the intent to specify the status of the variable inside the subroutine.&lt;br /&gt;
&lt;br /&gt;
- Continue with the local and saved variables.&lt;br /&gt;
&lt;br /&gt;
- Then you can define local variables.&lt;br /&gt;
&lt;br /&gt;
- Remember to comment all of them, you can specify the dimension if the variable is an allocatable variable as well as the units and everything that seems appropriate.&lt;br /&gt;
&lt;br /&gt;
You can finally write the code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot; line&amp;gt;&lt;br /&gt;
    MODULE aquarium_mod&lt;br /&gt;
&lt;br /&gt;
    IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
    INTEGER, protected :: water     ! Define what is the variable, the dimension, units (°) etc...&lt;br /&gt;
    ! ideally all module variables should be &amp;quot;protected&amp;quot; i.e. can only be set or modified&lt;br /&gt;
    ! by routines/functions in the same module but can be used outside of it (as &amp;quot;read-only&amp;quot;)&lt;br /&gt;
    REAL,SAVE,ALLOCATABLE,DIMENSION(:),PROTECTED :: kre1      ! Another comment &lt;br /&gt;
&lt;br /&gt;
    CONTAINS&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE aquarium(kre, grass, other_things&lt;br /&gt;
     &amp;amp;                    really_anything)&lt;br /&gt;
                                                         &lt;br /&gt;
      use another_module_mod, only: some_routine, some_variable&lt;br /&gt;
      &lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   subject:&lt;br /&gt;
!   --------&lt;br /&gt;
!   What is the subroutine doing&lt;br /&gt;
!&lt;br /&gt;
!   author: Someone smart &lt;br /&gt;
!   ------&lt;br /&gt;
!   update: Someone smarter, march 2012:&lt;br /&gt;
!         - I change something here&lt;br /&gt;
!   &lt;br /&gt;
!=======================================================================&lt;br /&gt;
      &lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
!-----------------------------------------------------------------------&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!    Declarations :&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!&lt;br /&gt;
!    Input/Output&lt;br /&gt;
!    ------------&lt;br /&gt;
      REAL, INTENT(IN)     ::  something(ngrid,nlayer) ! 2D tabular used as an input only  (W/m^2)&lt;br /&gt;
      REAL, INTENT(OUT)    ::  kre(ngrid)              ! 1D tabular output by the subroutine  &lt;br /&gt;
      REAL, INTENT(INOUT)  ::  grass(ngrid,nlayer)     ! Variable that is modified by the subroutine&lt;br /&gt;
                                                       ! it is an input and output&lt;br /&gt;
      LOGICAL, INTENT(IN)  ::  really_anything         ! Boolean variable  &lt;br /&gt;
&lt;br /&gt;
!    Local saved variables&lt;br /&gt;
!    ---------------------&lt;br /&gt;
      INTEGER, PARAMETER :: nb_kre = 4                ! Number of kre&lt;br /&gt;
      INTEGER, SAVE      :: rock                      ! Another variable&lt;br /&gt;
      LOGICAL, SAVE      :: firstcall=.true.          ! Another variable&lt;br /&gt;
&lt;br /&gt;
!    Local variables&lt;br /&gt;
!    ---------------&lt;br /&gt;
      REAL    tabular(ngrid)                          ! Local var&lt;br /&gt;
      INTEGER i                                       ! Loop var&lt;br /&gt;
&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   Beginning of the code&lt;br /&gt;
!=======================================================================&lt;br /&gt;
&lt;br /&gt;
      IF (firstcall) THEN&lt;br /&gt;
        ! initialize rock&lt;br /&gt;
        rock = 2&lt;br /&gt;
      ENDIF !end firstcall&lt;br /&gt;
&lt;br /&gt;
      ! identify where are the kre&lt;br /&gt;
      DO i=1,nb_kre&lt;br /&gt;
        kre(i)=i&lt;br /&gt;
        if (kre(i).gt.rock) then&lt;br /&gt;
          write(*,*) &amp;quot;the Kre &amp;quot;, i, &amp;quot;is behind the rock&amp;quot;&lt;br /&gt;
        else if (mod(kre(i),2).eq.0) then&lt;br /&gt;
          grass(:,nlayer-1)=grass(:,nlayer-1)-grass(:,nlayer) ! every two kre are eating grass in a very complex way&lt;br /&gt;
        endif !(kre(i).gt.rock)&lt;br /&gt;
      ENDDO !end of the loop nb_kre&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE aquarium&lt;br /&gt;
&lt;br /&gt;
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE ini_aquarium(ngrid)&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   Initialise module's variable&lt;br /&gt;
!=======================================================================&lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
      INTEGER, INTENT(IN) :: ngrid&lt;br /&gt;
&lt;br /&gt;
      allocate(kre1(ngrid+1))&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE ini_aquarium&lt;br /&gt;
&lt;br /&gt;
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE end_aquarium&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   Deallocate module's variable&lt;br /&gt;
!=======================================================================&lt;br /&gt;
&lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
      IF (allocated(kre1)) deallocate(kre1)&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE end_aquarium&lt;br /&gt;
      &lt;br /&gt;
    END MODULE aquarium_mod&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Naming subroutines convention ==&lt;br /&gt;
&lt;br /&gt;
Un peu plus pour le PEM peut-être&lt;br /&gt;
&lt;br /&gt;
== When to create subroutines instead of line of code ==&lt;br /&gt;
&lt;br /&gt;
Quand est ce qu'on décide que ca vaut le coup de faire une routine spécifique : exemple négativité des pdq dans physiq_mod&lt;br /&gt;
&lt;br /&gt;
== How to pass variable to subroutine (by argument or by using a module) ==&lt;br /&gt;
&lt;br /&gt;
Base rule: variables should be passed down to routines via arguments. It makes it much easier for readers to follow what's going on and/or do the reverse engineering...&lt;br /&gt;
&lt;br /&gt;
One should only use (import) a variable from a module if it used as &amp;quot;read-only&amp;quot; information. e.g. gravity constant, aerosol optical properties, etc.&lt;br /&gt;
&lt;br /&gt;
== Naming variables convention ==&lt;br /&gt;
&lt;br /&gt;
What is the naming convention.&lt;br /&gt;
In [[vdifc_mod]] for example.&lt;br /&gt;
&lt;br /&gt;
== Loop index convention ==&lt;br /&gt;
&lt;br /&gt;
Index name for loops over:&lt;br /&gt;
* '''physical grid''' : ig (max ngrid)&lt;br /&gt;
* ''' vertical levels''' : l (max nlayer)&lt;br /&gt;
* '''tracer''' : iq (max nq)&lt;br /&gt;
* '''subslopes''' : islope (max nslope)&lt;br /&gt;
* '''aerosol''' : iaer (max naerkind)&lt;br /&gt;
* '''longitude''' : &lt;br /&gt;
* '''latitude''' :&lt;br /&gt;
&lt;br /&gt;
== Efficient loop coding ==&lt;br /&gt;
&lt;br /&gt;
The outermost loop index should correspond to the last index of an array.&lt;br /&gt;
&lt;br /&gt;
Example: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot;&amp;gt;&lt;br /&gt;
      DO l=1,nlayer&lt;br /&gt;
        DO ig=1,ngrid&lt;br /&gt;
          array(ig,l)=l*ig&lt;br /&gt;
        ENDDO&lt;br /&gt;
      ENDDO&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to use the INTENT ==&lt;br /&gt;
&lt;br /&gt;
Argument of a function can come in 3 different way: IN, OUT, INOUT.&lt;br /&gt;
All arguments should be specified as :&lt;br /&gt;
* intent(in) : input only, i.e. not modified by the routine (or routines it passes the argument on to)&lt;br /&gt;
* intent(out) : output only, i.e. the value is set/computed in the routine (or via a routine it calls)&lt;br /&gt;
* intent(inout) : the combination of the two&lt;br /&gt;
&lt;br /&gt;
== How to comment code ==&lt;br /&gt;
&lt;br /&gt;
* '''In english'''&lt;br /&gt;
* '''As much as possible'''&lt;br /&gt;
* '''By using &amp;lt;code&amp;gt;!&amp;lt;/code&amp;gt;''' (also known as the &amp;quot;bang&amp;quot; character) rather than &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; (which is not interpreted as a comment by fortran90+ compilers)&lt;br /&gt;
* '''Variable definition''' : explain what it is, the dimension, the units etc...&lt;br /&gt;
* '''Subroutine''' : Explain what it does, who wrote it, who modify it and why if it is a big change&lt;br /&gt;
* '''Loops''' : if the enddo is far away you can comment to which index it correspond to.&lt;br /&gt;
* '''Chapter your code''' : you can add section to your code to make it clearer.&lt;br /&gt;
&lt;br /&gt;
== To know when coding with a code parallelized with OpenMP ==&lt;br /&gt;
In Fortran, any variable from a &amp;lt;code&amp;gt;module&amp;lt;/code&amp;gt;, written in a &amp;lt;code&amp;gt;COMMON&amp;lt;/code&amp;gt;, declared &amp;lt;code&amp;gt;SAVE&amp;lt;/code&amp;gt; or initialized at the declaration (using &amp;lt;code&amp;gt;DATA&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;=&amp;lt;/code&amp;gt;) is considered a ''static variable''.&lt;br /&gt;
When your code is parallelized using OpenMP, these static variables are SHARED by default. '''In 90% cases, you want each thread on which the code is parallelized to have its own private version of the variable''', so you should add, after the declaration of your variable, the following line:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot;&amp;gt;&lt;br /&gt;
!$OMP THREADPRIVATE(variable)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== General guide ==&lt;br /&gt;
&lt;br /&gt;
* Create .F90 instead of .F&lt;br /&gt;
* Delete unused argument in a function call if you see one&lt;br /&gt;
* Delete unused variables&lt;br /&gt;
* Choose meaningful names of variables&lt;br /&gt;
* Don't hesitate to comment as much as possible, a code is never too commented&lt;br /&gt;
* Delete unused commented code lines&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;br /&gt;
[[Category:Mars-Model]]&lt;br /&gt;
[[Category:Venus-Model]]&lt;br /&gt;
[[Category:Titan-Model]]&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

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

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Guide_for_good_coding&amp;diff=1441</id>
		<title>Guide for good coding</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Guide_for_good_coding&amp;diff=1441"/>
				<updated>2023-05-10T08:58:16Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: /* How to comment code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to create a new module/subroutine ==&lt;br /&gt;
&lt;br /&gt;
Subroutines should be integrated inside a module.&lt;br /&gt;
A good writing habit is to add the line &amp;quot;IMPLICIT NONE&amp;quot;, in the beginning of the module and subroutine.&lt;br /&gt;
&lt;br /&gt;
First you can define all the variable that belongs to the module and could be used at another place.&lt;br /&gt;
A good thing is also to create a subroutine that allocate and initialise module variables.&lt;br /&gt;
If the variable is only modified inside the module it should be taged as protected.&lt;br /&gt;
If the variable belongs only to the module it can be specified to be private.&lt;br /&gt;
&lt;br /&gt;
You can now start the writing of the subroutine.&lt;br /&gt;
&lt;br /&gt;
- Start by importing variable and function from other module if necessary.&lt;br /&gt;
&lt;br /&gt;
- Comment the purpose of the subroutine directly.&lt;br /&gt;
&lt;br /&gt;
- Declare the variables, first the one pass in arguments.&lt;br /&gt;
Use the intent to specify the status of the variable inside the subroutine.&lt;br /&gt;
&lt;br /&gt;
- Continue with the local and saved variables.&lt;br /&gt;
&lt;br /&gt;
- Then you can define local variables.&lt;br /&gt;
&lt;br /&gt;
- Remember to comment all of them, you can specify the dimension if the variable is an allocatable variable as well as the units and everything that seems appropriate.&lt;br /&gt;
&lt;br /&gt;
You can finally write the code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot; line&amp;gt;&lt;br /&gt;
    MODULE aquarium_mod&lt;br /&gt;
&lt;br /&gt;
    IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
    INTEGER, protected :: water     ! Define what is the variable, the dimension, units (°) etc...&lt;br /&gt;
    ! ideally all module variables should be &amp;quot;protected&amp;quot; i.e. can only be set or modified&lt;br /&gt;
    ! by routines/functions in the same module but can be used outside of it (as &amp;quot;read-only&amp;quot;)&lt;br /&gt;
    REAL,SAVE,ALLOCATABLE,DIMENSION(:),PROTECTED :: kre1      ! Another comment &lt;br /&gt;
&lt;br /&gt;
    CONTAINS&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE aquarium(kre, grass, other_things&lt;br /&gt;
     &amp;amp;                    really_anything)&lt;br /&gt;
                                                         &lt;br /&gt;
      use another_module_mod, only: some_routine, some_variable&lt;br /&gt;
      &lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   subject:&lt;br /&gt;
!   --------&lt;br /&gt;
!   What is the subroutine doing&lt;br /&gt;
!&lt;br /&gt;
!   author: Someone smart &lt;br /&gt;
!   ------&lt;br /&gt;
!   update: Someone smarter, march 2012:&lt;br /&gt;
!         - I change something here&lt;br /&gt;
!   &lt;br /&gt;
!=======================================================================&lt;br /&gt;
      &lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
!-----------------------------------------------------------------------&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!    Declarations :&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!&lt;br /&gt;
!    Input/Output&lt;br /&gt;
!    ------------&lt;br /&gt;
      REAL, INTENT(IN)     ::  something(ngrid,nlayer) ! 2D tabular used as an input only  (W/m^2)&lt;br /&gt;
      REAL, INTENT(OUT)    ::  kre(ngrid)              ! 1D tabular output by the subroutine  &lt;br /&gt;
      REAL, INTENT(INOUT)  ::  grass(ngrid,nlayer)     ! Variable that is modified by the subroutine&lt;br /&gt;
                                                       ! it is an input and output&lt;br /&gt;
      LOGICAL, INTENT(IN)  ::  really_anything         ! Boolean variable  &lt;br /&gt;
&lt;br /&gt;
!    Local saved variables&lt;br /&gt;
!    ---------------------&lt;br /&gt;
      INTEGER, PARAMETER :: nb_kre = 4                ! Number of kre&lt;br /&gt;
      INTEGER, SAVE      :: rock                      ! Another variable&lt;br /&gt;
      LOGICAL, SAVE      :: firstcall=.true.          ! Another variable&lt;br /&gt;
&lt;br /&gt;
!    Local variables&lt;br /&gt;
!    ---------------&lt;br /&gt;
      REAL    tabular(ngrid)                          ! Local var&lt;br /&gt;
      INTEGER i                                       ! Loop var&lt;br /&gt;
&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   Beginning of the code&lt;br /&gt;
!=======================================================================&lt;br /&gt;
&lt;br /&gt;
      IF (firstcall) THEN&lt;br /&gt;
        ! initialize rock&lt;br /&gt;
        rock = 2&lt;br /&gt;
      ENDIF !end firstcall&lt;br /&gt;
&lt;br /&gt;
      ! identify where are the kre&lt;br /&gt;
      DO i=1,nb_kre&lt;br /&gt;
        kre(i)=i&lt;br /&gt;
        if (kre(i).gt.rock) then&lt;br /&gt;
          write(*,*) &amp;quot;the Kre &amp;quot;, i, &amp;quot;is behind the rock&amp;quot;&lt;br /&gt;
        else if (mod(kre(i),2).eq.0) then&lt;br /&gt;
          grass(:,nlayer-1)=grass(:,nlayer-1)-grass(:,nlayer) ! every two kre are eating grass in a very complex way&lt;br /&gt;
        endif !(kre(i).gt.rock)&lt;br /&gt;
      ENDDO !end of the loop nb_kre&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE aquarium&lt;br /&gt;
&lt;br /&gt;
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE ini_aquarium(ngrid)&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   Initialise module's variable&lt;br /&gt;
!=======================================================================&lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
      INTEGER, INTENT(IN) :: ngrid&lt;br /&gt;
&lt;br /&gt;
      allocate(kre1(ngrid+1))&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE ini_aquarium&lt;br /&gt;
&lt;br /&gt;
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE end_aquarium&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   Deallocate module's variable&lt;br /&gt;
!=======================================================================&lt;br /&gt;
&lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
      IF (allocated(kre1)) deallocate(kre1)&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE end_aquarium&lt;br /&gt;
      &lt;br /&gt;
    END MODULE aquarium_mod&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Naming subroutines convention ==&lt;br /&gt;
&lt;br /&gt;
Un peu plus pour le PEM peut-être&lt;br /&gt;
&lt;br /&gt;
== When to create subroutines instead of line of code ==&lt;br /&gt;
&lt;br /&gt;
Quand est ce qu'on décide que ca vaut le coup de faire une routine spécifique : exemple négativité des pdq dans physiq_mod&lt;br /&gt;
&lt;br /&gt;
== How to pass variable to subroutine (by argument or by using a module) ==&lt;br /&gt;
&lt;br /&gt;
Base rule: variables should be passed down to routines via arguments. It makes it much easier for readers to follow what's going on and/or do the reverse engineering...&lt;br /&gt;
&lt;br /&gt;
One should only use (import) a variable from a module if it used as &amp;quot;read-only&amp;quot; information. e.g. gravity constant, aerosol optical properties, etc.&lt;br /&gt;
&lt;br /&gt;
== Naming variables convention ==&lt;br /&gt;
&lt;br /&gt;
What is the naming convention.&lt;br /&gt;
In [[vdifc_mod]] for example.&lt;br /&gt;
&lt;br /&gt;
== Loop index convention ==&lt;br /&gt;
&lt;br /&gt;
Index name for loops over:&lt;br /&gt;
* '''physical grid''' : ig (max ngrid)&lt;br /&gt;
* ''' vertical levels''' : l (max nlayer)&lt;br /&gt;
* '''tracer''' : iq (max nq)&lt;br /&gt;
* '''subslopes''' : islope (max nslope)&lt;br /&gt;
* '''aerosol''' : iaer (max naerkind)&lt;br /&gt;
* '''longitude''' : &lt;br /&gt;
* '''latitude''' :&lt;br /&gt;
&lt;br /&gt;
== Efficient loop coding ==&lt;br /&gt;
&lt;br /&gt;
The outermost loop index should correspond to the last index of an array.&lt;br /&gt;
&lt;br /&gt;
Example: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot;&amp;gt;&lt;br /&gt;
      DO l=1,nlayer&lt;br /&gt;
        DO ig=1,ngrid&lt;br /&gt;
          array(ig,l)=l*ig&lt;br /&gt;
        ENDDO&lt;br /&gt;
      ENDDO&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to use the INTENT ==&lt;br /&gt;
&lt;br /&gt;
Argument of a function can come in 3 different way: IN, OUT, INOUT.&lt;br /&gt;
All arguments should be specified as :&lt;br /&gt;
* intent(in) : input only, i.e. not modified by the routine (or routines it passes the argument on to)&lt;br /&gt;
* intent(out) : output only, i.e. the value is set/computed in the routine (or via a routine it calls)&lt;br /&gt;
* intent(inout) : the combination of the two&lt;br /&gt;
&lt;br /&gt;
== How to comment code ==&lt;br /&gt;
&lt;br /&gt;
* '''In english'''&lt;br /&gt;
* '''As much as possible'''&lt;br /&gt;
* '''By using &amp;lt;code&amp;gt;!&amp;lt;/code&amp;gt;''' (also known as the &amp;quot;bang&amp;quot; character) rather than &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; (which is not interpreted as a comment by fortran90+ compilers)&lt;br /&gt;
* '''Variable definition''' : explain what it is, the dimension, the units etc...&lt;br /&gt;
* '''Subroutine''' : Explain what it does, who wrote it, who modify it and why if it is a big change&lt;br /&gt;
* '''Loops''' : if the enddo is far away you can comment to which index it correspond to.&lt;br /&gt;
* '''Chapter your code''' : you can add section to your code to make it clearer.&lt;br /&gt;
&lt;br /&gt;
== General guide ==&lt;br /&gt;
&lt;br /&gt;
* Create .F90 instead of .F&lt;br /&gt;
* Delete unused argument in a function call if you see one&lt;br /&gt;
* Delete unused variables&lt;br /&gt;
* Choose meaningful names of variables&lt;br /&gt;
* Don't hesitate to comment as much as possible, a code is never too commented&lt;br /&gt;
* Delete unused commented code lines&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;br /&gt;
[[Category:Mars-Model]]&lt;br /&gt;
[[Category:Venus-Model]]&lt;br /&gt;
[[Category:Titan-Model]]&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Using_Irene_Rome&amp;diff=1374</id>
		<title>Using Irene Rome</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Using_Irene_Rome&amp;diff=1374"/>
				<updated>2023-03-31T07:04:09Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: /* Some useful commands */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a summary of examples and tools designed to help you get used with the Irene Rome environment. (as of July 2022)&lt;br /&gt;
&lt;br /&gt;
== How to access the cluster ==&lt;br /&gt;
&lt;br /&gt;
For people on the &amp;quot;Atmosphères Planétaires&amp;quot; GENCI project who need to open an account on Irene-Rome, here is the procedure:&lt;br /&gt;
&lt;br /&gt;
* Log on to https://www-dcc.extra.cea.fr/CCFR/ and provide various information about yourself &lt;br /&gt;
&lt;br /&gt;
A few tips:&lt;br /&gt;
&lt;br /&gt;
- chose TGCC&lt;br /&gt;
&lt;br /&gt;
- give your PROFESSIONAL phone number (and not your personal cell phone number)&lt;br /&gt;
&lt;br /&gt;
- name of the project: Atmosphères Planétaires  Numéro du Dossier: A0120110391&lt;br /&gt;
&lt;br /&gt;
- Responsable scientifique du projet: M. Ehouarn MILLOUR , ehouarn.millour@lmd.ipsl.fr, 0144275286, Nationalité: Fr&lt;br /&gt;
&lt;br /&gt;
- Responsable sécurité: M. Franck Guyon, franck.guyon@lmd.ipsl.fr, 0144275277, Nationalité: Fr. Note that this is assuming you have an account on LMD computers and/or the MESOIPSL cluster. Otherwise you must provide the information for the relevant person from your lab.&lt;br /&gt;
&lt;br /&gt;
- IPs &amp;amp; machine names to connect to Irene: 134.157.47.46 (ssh-out.lmd.jussieu.fr) and 134.157.176.129 (ciclad.ipsl.upmc.fr). Note that this is assuming you have an account on LMD computers and/or the MESOIPSL cluster. Otherwise you must provide name &amp;amp; IP of your institute's gateway machine. &lt;br /&gt;
&lt;br /&gt;
- Chose anything you want for the 8 character password&lt;br /&gt;
&lt;br /&gt;
* And then get Ehouarn to sign the form and forward it to Franck for him to sign as well.&lt;br /&gt;
&lt;br /&gt;
* Send the signed form to hotline.tgcc@cea.fr&lt;br /&gt;
&lt;br /&gt;
== Some useful commands ==&lt;br /&gt;
&lt;br /&gt;
* To access the disks of our project on Irene (&amp;quot;Atmosphères Planétaires&amp;quot; GENCI project), add the following line in your .bash_profile file:&lt;br /&gt;
(.bash_profile rather than .bashrc, because otherwise scp may not find your files when fetching them from $CCCWORKDIR on irene to your machine)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
module switch dfldatadir/gen10391&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To access your work directory (to run your simulations)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /ccc/work/cont003/gen10391/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
you can also access the work directory with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $CCCWORKDIR&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To access your store directory (to store big data files we are limited in inode number not in filesize! It is recommended to store files of at least 50M, preferably more, e.g. big tar files of 10G or more)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /ccc/work/cont003/gen10391/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
you can also access the store directory with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $CCCSTOREDIR&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To access the scratch directory&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $CCCSCRATCHDIR&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
IMPORTANT: the scratchdir is fast access, very big, BUT regularly automatically purged! If you use it do remember to backup stuff on the WORKDIR or STOREDIR.&lt;br /&gt;
&lt;br /&gt;
The scratch purge policy (from machine.info):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* Files not accessed for 60 days are automatically purged&lt;br /&gt;
* Symbolic links are not purged&lt;br /&gt;
* Directories that have been empty for more than 30 days are removed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
There is a dedicated command&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_will_purge&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
which should return information about upcoming purge on your scratch space. Note that the database this command queries is only refreshed on a nightly basis, so it will incorrectly reflect changes you just made this very day.&lt;br /&gt;
&lt;br /&gt;
One nice idea is to put this command in your .bashrc, so that it runs everytime you connect to Irene (you can add the ''-s'' option to avoid having long list of files displaying on your screen). If you do so, you have to encapsulate it in a conditional test to check if you're in interactive mode, otherwise it will prevent any rsync/scp between Irene and other machines (which are not in interactive and will thus block on the ccc_will_purge command) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
if [ -n &amp;quot;${PS1:-}&amp;quot; ]; then&lt;br /&gt;
    ccc_will_purge -s&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And a nice command (copyleft Antoine Martinez and Olivier from LATMOS) to update all the &amp;quot;Access&amp;quot; and &amp;quot;Change&amp;quot; stats of the files in your current directory (and sub-directories), without changing the &amp;quot;Modify&amp;quot; stat (so that you can still sort them by date of modification with 'ls -lt') :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $CCCSCRATCHDIR&lt;br /&gt;
find . -type f -exec touch -a {} \;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This will prevent your files on the scratchdir to be purged for another 60 days.&lt;br /&gt;
&lt;br /&gt;
* To access Irene Interactive Documentation:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
machine.info&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: you can also access the online documentation here: http://www-hpc.cea.fr/tgcc-public/en/html/toc/fulldoc/Introduction.html&lt;br /&gt;
&lt;br /&gt;
* To display infos about project accounting:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_myproject &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To know about user and group disk quota&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_quota -a&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To know about how long your passwd will be active:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_password_expiration&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To change passwd:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
passwd&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example of a job to run a GCM simulation ==&lt;br /&gt;
&lt;br /&gt;
=== Mixed openMP / MPI ===&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;
# Partition to run on:&lt;br /&gt;
#MSUB -q rome&lt;br /&gt;
# project to run on &lt;br /&gt;
#MSUB -A  gen10391&lt;br /&gt;
# disks to use&lt;br /&gt;
#MSUB -m  scratch,work,store&lt;br /&gt;
# Job name&lt;br /&gt;
#MSUB -r run_gcm&lt;br /&gt;
# Job standard output:&lt;br /&gt;
#MSUB -o run_gcm.%I&lt;br /&gt;
# Job standard error:&lt;br /&gt;
#MSUB -e run_gcm.%I&lt;br /&gt;
# number of OpenMP threads c&lt;br /&gt;
#MSUB -c 2&lt;br /&gt;
# number of MPI tasks n&lt;br /&gt;
#MSUB -n 16&lt;br /&gt;
# number of nodes to use N&lt;br /&gt;
#MSUB -N 1&lt;br /&gt;
# max job run time T (in seconds)&lt;br /&gt;
#MSUB -T 3600&lt;br /&gt;
# request exculsive use of the node (128 cores)&lt;br /&gt;
##MSUB -x&lt;br /&gt;
&lt;br /&gt;
source ../trunk/LMDZ.COMMON/arch.env&lt;br /&gt;
export OMP_STACKSIZE=400M&lt;br /&gt;
export OMP_NUM_THREADS=2&lt;br /&gt;
&lt;br /&gt;
ccc_mprun -l gcm_32x32x15_phystd_para.e &amp;gt; gcm.out 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pure MPI + long run ===&lt;br /&gt;
&lt;br /&gt;
The most important parameter for mpi-only runs is ''-n'' &lt;br /&gt;
providing the total number of CPUs &lt;br /&gt;
(ideally a multiple of 128, which is the number of CPUs per core).&lt;br /&gt;
&lt;br /&gt;
Runs longer than 1 day are not possible unless&lt;br /&gt;
selecting a quality-of-service (QoS) &amp;quot;long&amp;quot;&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;
# Partition to run on:&lt;br /&gt;
#MSUB -q rome&lt;br /&gt;
# project to run on &lt;br /&gt;
#MSUB -A  gen10391&lt;br /&gt;
# disks to use&lt;br /&gt;
#MSUB -m  scratch,work,store&lt;br /&gt;
# Job name&lt;br /&gt;
#MSUB -r run_wrf&lt;br /&gt;
# Job standard output:&lt;br /&gt;
#MSUB -o run_wrf.%I&lt;br /&gt;
# Job standard error:&lt;br /&gt;
#MSUB -e run_wrf.%I&lt;br /&gt;
# number of MPI tasks n (total)&lt;br /&gt;
#MSUB -n 256&lt;br /&gt;
# max job run time T (in seconds)&lt;br /&gt;
#MSUB -T 345600&lt;br /&gt;
# select quality-of-service&lt;br /&gt;
# - test &amp;lt; 30min&lt;br /&gt;
# - normal &amp;lt; 1d (default)&lt;br /&gt;
# - long &amp;lt; 3d &lt;br /&gt;
#MSUB -Q long&lt;br /&gt;
&lt;br /&gt;
#############################&lt;br /&gt;
&lt;br /&gt;
# load the modules used to compile&lt;br /&gt;
source arch.env&lt;br /&gt;
&lt;br /&gt;
# clean the logs&lt;br /&gt;
rm -rf rsl.*&lt;br /&gt;
&lt;br /&gt;
# create initial state&lt;br /&gt;
# -- this is done on a single proc&lt;br /&gt;
ideal.exe&lt;br /&gt;
mv rsl.error.0000 ideal_rsl.error.0000&lt;br /&gt;
mv rsl.out.0000 ideal_rsl.out.0000&lt;br /&gt;
&lt;br /&gt;
# main launch&lt;br /&gt;
ccc_mprun -l wrf.exe&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Main submission commands ==&lt;br /&gt;
&lt;br /&gt;
* To launch the job script ''run_gcm.job'':&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_msub run_gcm.job&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To display information about your jobs:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_mpp -u $USER &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To kill job number ''jobid''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_mdel jobid&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To display infos about a job (works both while it is running or after it has finished):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_macct jobid&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To display infos about project accounting:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_myproject&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To display infos about limits:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_mqinfo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To display infos about partitions:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_mpinfo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== File transfert from Occigen ==&lt;br /&gt;
One should use ccfr:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
module load ccfr&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
A list of available machines is given by&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccfr_ssh -v&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
To log on to Occigen (from Irene):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccfr_ssh occigenlogin@cines&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To copy a file (typically a big tar file):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccfr_cp occigenlogin@cines:remote_dir local_dir &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This command will fail if you try copying over a directory, with a weird error message of the likes of:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rsync: write failed on &amp;quot;/ccc/work/....&amp;quot; Disk quota exceeded (122)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If copying over directories (via rsync) then you should modify the related rights (which must be &amp;quot;s&amp;quot; for the group on Irene) using dedicated options:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync --chmod=Dg+s --chown=:gen10391 source_on_distant_machine target_on_Irene  &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Worth knowing about ==&lt;br /&gt;
* The command wget is disabled on Irene, scripts using it will fail...&lt;br /&gt;
* Only &amp;quot;https&amp;quot; is allowed. This is important for instance when downloading code (via svn, git). Moreover for svn checkouts one has to provide their svn username and password.&lt;br /&gt;
*If you encounter a quota issue on Irene, first check if indeed you (or the group's) quota is exceeded:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_quota&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case you get an error message about your quota when copying data over to Irene, it might be because the rights on directories are not well set; please use the following command on your directory before sending the data to Irene:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod -R g+s NAME_OF_DIR&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Using_Irene_Rome&amp;diff=1373</id>
		<title>Using Irene Rome</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Using_Irene_Rome&amp;diff=1373"/>
				<updated>2023-03-31T07:03:06Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: /* Some useful commands */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a summary of examples and tools designed to help you get used with the Irene Rome environment. (as of July 2022)&lt;br /&gt;
&lt;br /&gt;
== How to access the cluster ==&lt;br /&gt;
&lt;br /&gt;
For people on the &amp;quot;Atmosphères Planétaires&amp;quot; GENCI project who need to open an account on Irene-Rome, here is the procedure:&lt;br /&gt;
&lt;br /&gt;
* Log on to https://www-dcc.extra.cea.fr/CCFR/ and provide various information about yourself &lt;br /&gt;
&lt;br /&gt;
A few tips:&lt;br /&gt;
&lt;br /&gt;
- chose TGCC&lt;br /&gt;
&lt;br /&gt;
- give your PROFESSIONAL phone number (and not your personal cell phone number)&lt;br /&gt;
&lt;br /&gt;
- name of the project: Atmosphères Planétaires  Numéro du Dossier: A0120110391&lt;br /&gt;
&lt;br /&gt;
- Responsable scientifique du projet: M. Ehouarn MILLOUR , ehouarn.millour@lmd.ipsl.fr, 0144275286, Nationalité: Fr&lt;br /&gt;
&lt;br /&gt;
- Responsable sécurité: M. Franck Guyon, franck.guyon@lmd.ipsl.fr, 0144275277, Nationalité: Fr. Note that this is assuming you have an account on LMD computers and/or the MESOIPSL cluster. Otherwise you must provide the information for the relevant person from your lab.&lt;br /&gt;
&lt;br /&gt;
- IPs &amp;amp; machine names to connect to Irene: 134.157.47.46 (ssh-out.lmd.jussieu.fr) and 134.157.176.129 (ciclad.ipsl.upmc.fr). Note that this is assuming you have an account on LMD computers and/or the MESOIPSL cluster. Otherwise you must provide name &amp;amp; IP of your institute's gateway machine. &lt;br /&gt;
&lt;br /&gt;
- Chose anything you want for the 8 character password&lt;br /&gt;
&lt;br /&gt;
* And then get Ehouarn to sign the form and forward it to Franck for him to sign as well.&lt;br /&gt;
&lt;br /&gt;
* Send the signed form to hotline.tgcc@cea.fr&lt;br /&gt;
&lt;br /&gt;
== Some useful commands ==&lt;br /&gt;
&lt;br /&gt;
* To access the disks of our project on Irene (&amp;quot;Atmosphères Planétaires&amp;quot; GENCI project), add the following line in your .bash_profile file:&lt;br /&gt;
(.bash_profile rather than .bashrc, because otherwise scp may not find your files when fetching them from $CCCWORKDIR on irene to your machine)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
module switch dfldatadir/gen10391&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To access your work directory (to run your simulations)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /ccc/work/cont003/gen10391/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
you can also access the work directory with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $CCCWORKDIR&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To access your store directory (to store big data files we are limited in inode number not in filesize! It is recommended to store files of at least 50M, preferably more, e.g. big tar files of 10G or more)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /ccc/work/cont003/gen10391/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
you can also access the store directory with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $CCCSTOREDIR&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To access the scratch directory&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $CCCSCRATCHDIR&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
IMPORTANT: the scratchdir is fast access, very big, BUT regularly automatically purged! If you use it do remember to backup stuff on the WORKDIR or STOREDIR.&lt;br /&gt;
&lt;br /&gt;
The scratch purge policy (from machine.info):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* Files not accessed for 60 days are automatically purged&lt;br /&gt;
* Symbolic links are not purged&lt;br /&gt;
* Directories that have been empty for more than 30 days are removed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
There is a dedicated command&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_will_purge&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
which should return information about upcoming purge on your scratch space. Note that the database this command queries is only refreshed on a nightly basis, so it will incorrectly reflect changes you just made this very day.&lt;br /&gt;
&lt;br /&gt;
One nice idea is to put this command in your .bashrc, so that it runs everytime you connect to Irene (you can add the -s option to avoid having long list of files displaying on your screen). If you do so, you have to encapsulate it in a conditional test to check if you're in interactive mode, otherwise it will prevent any rsync/scp between Irene and other machines (which are not in interactive and will thus block on the ccc_will_purge command) :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
if [ -n &amp;quot;${PS1:-}&amp;quot; ]; then&lt;br /&gt;
    ccc_will_purge -s&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And a nice command (copyleft Antoine Martinez and Olivier from LATMOS) to update all the &amp;quot;Access&amp;quot; and &amp;quot;Change&amp;quot; stats of the files in your current directory (and sub-directories), without changing the &amp;quot;Modify&amp;quot; stat (so that you can still sort them by date of modification with 'ls -lt') :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $CCCSCRATCHDIR&lt;br /&gt;
find . -type f -exec touch -a {} \;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This will prevent your files on the scratchdir to be purged for another 60 days.&lt;br /&gt;
&lt;br /&gt;
* To access Irene Interactive Documentation:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
machine.info&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: you can also access the online documentation here: http://www-hpc.cea.fr/tgcc-public/en/html/toc/fulldoc/Introduction.html&lt;br /&gt;
&lt;br /&gt;
* To display infos about project accounting:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_myproject &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To know about user and group disk quota&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_quota -a&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To know about how long your passwd will be active:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_password_expiration&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To change passwd:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
passwd&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example of a job to run a GCM simulation ==&lt;br /&gt;
&lt;br /&gt;
=== Mixed openMP / MPI ===&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;
# Partition to run on:&lt;br /&gt;
#MSUB -q rome&lt;br /&gt;
# project to run on &lt;br /&gt;
#MSUB -A  gen10391&lt;br /&gt;
# disks to use&lt;br /&gt;
#MSUB -m  scratch,work,store&lt;br /&gt;
# Job name&lt;br /&gt;
#MSUB -r run_gcm&lt;br /&gt;
# Job standard output:&lt;br /&gt;
#MSUB -o run_gcm.%I&lt;br /&gt;
# Job standard error:&lt;br /&gt;
#MSUB -e run_gcm.%I&lt;br /&gt;
# number of OpenMP threads c&lt;br /&gt;
#MSUB -c 2&lt;br /&gt;
# number of MPI tasks n&lt;br /&gt;
#MSUB -n 16&lt;br /&gt;
# number of nodes to use N&lt;br /&gt;
#MSUB -N 1&lt;br /&gt;
# max job run time T (in seconds)&lt;br /&gt;
#MSUB -T 3600&lt;br /&gt;
# request exculsive use of the node (128 cores)&lt;br /&gt;
##MSUB -x&lt;br /&gt;
&lt;br /&gt;
source ../trunk/LMDZ.COMMON/arch.env&lt;br /&gt;
export OMP_STACKSIZE=400M&lt;br /&gt;
export OMP_NUM_THREADS=2&lt;br /&gt;
&lt;br /&gt;
ccc_mprun -l gcm_32x32x15_phystd_para.e &amp;gt; gcm.out 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pure MPI + long run ===&lt;br /&gt;
&lt;br /&gt;
The most important parameter for mpi-only runs is ''-n'' &lt;br /&gt;
providing the total number of CPUs &lt;br /&gt;
(ideally a multiple of 128, which is the number of CPUs per core).&lt;br /&gt;
&lt;br /&gt;
Runs longer than 1 day are not possible unless&lt;br /&gt;
selecting a quality-of-service (QoS) &amp;quot;long&amp;quot;&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;
# Partition to run on:&lt;br /&gt;
#MSUB -q rome&lt;br /&gt;
# project to run on &lt;br /&gt;
#MSUB -A  gen10391&lt;br /&gt;
# disks to use&lt;br /&gt;
#MSUB -m  scratch,work,store&lt;br /&gt;
# Job name&lt;br /&gt;
#MSUB -r run_wrf&lt;br /&gt;
# Job standard output:&lt;br /&gt;
#MSUB -o run_wrf.%I&lt;br /&gt;
# Job standard error:&lt;br /&gt;
#MSUB -e run_wrf.%I&lt;br /&gt;
# number of MPI tasks n (total)&lt;br /&gt;
#MSUB -n 256&lt;br /&gt;
# max job run time T (in seconds)&lt;br /&gt;
#MSUB -T 345600&lt;br /&gt;
# select quality-of-service&lt;br /&gt;
# - test &amp;lt; 30min&lt;br /&gt;
# - normal &amp;lt; 1d (default)&lt;br /&gt;
# - long &amp;lt; 3d &lt;br /&gt;
#MSUB -Q long&lt;br /&gt;
&lt;br /&gt;
#############################&lt;br /&gt;
&lt;br /&gt;
# load the modules used to compile&lt;br /&gt;
source arch.env&lt;br /&gt;
&lt;br /&gt;
# clean the logs&lt;br /&gt;
rm -rf rsl.*&lt;br /&gt;
&lt;br /&gt;
# create initial state&lt;br /&gt;
# -- this is done on a single proc&lt;br /&gt;
ideal.exe&lt;br /&gt;
mv rsl.error.0000 ideal_rsl.error.0000&lt;br /&gt;
mv rsl.out.0000 ideal_rsl.out.0000&lt;br /&gt;
&lt;br /&gt;
# main launch&lt;br /&gt;
ccc_mprun -l wrf.exe&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Main submission commands ==&lt;br /&gt;
&lt;br /&gt;
* To launch the job script ''run_gcm.job'':&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_msub run_gcm.job&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To display information about your jobs:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_mpp -u $USER &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To kill job number ''jobid''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_mdel jobid&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To display infos about a job (works both while it is running or after it has finished):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_macct jobid&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To display infos about project accounting:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_myproject&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To display infos about limits:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_mqinfo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To display infos about partitions:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_mpinfo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== File transfert from Occigen ==&lt;br /&gt;
One should use ccfr:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
module load ccfr&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
A list of available machines is given by&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccfr_ssh -v&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
To log on to Occigen (from Irene):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccfr_ssh occigenlogin@cines&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To copy a file (typically a big tar file):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccfr_cp occigenlogin@cines:remote_dir local_dir &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This command will fail if you try copying over a directory, with a weird error message of the likes of:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rsync: write failed on &amp;quot;/ccc/work/....&amp;quot; Disk quota exceeded (122)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If copying over directories (via rsync) then you should modify the related rights (which must be &amp;quot;s&amp;quot; for the group on Irene) using dedicated options:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync --chmod=Dg+s --chown=:gen10391 source_on_distant_machine target_on_Irene  &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Worth knowing about ==&lt;br /&gt;
* The command wget is disabled on Irene, scripts using it will fail...&lt;br /&gt;
* Only &amp;quot;https&amp;quot; is allowed. This is important for instance when downloading code (via svn, git). Moreover for svn checkouts one has to provide their svn username and password.&lt;br /&gt;
*If you encounter a quota issue on Irene, first check if indeed you (or the group's) quota is exceeded:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_quota&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case you get an error message about your quota when copying data over to Irene, it might be because the rights on directories are not well set; please use the following command on your directory before sending the data to Irene:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod -R g+s NAME_OF_DIR&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Using_Irene_Rome&amp;diff=1177</id>
		<title>Using Irene Rome</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Using_Irene_Rome&amp;diff=1177"/>
				<updated>2023-01-26T10:16:49Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: /* Some useful commands */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a summary of examples and tools designed to help you get used with the Irene Rome environment. (as of July 2022)&lt;br /&gt;
&lt;br /&gt;
== How to access the cluster ==&lt;br /&gt;
&lt;br /&gt;
For people on the &amp;quot;Atmosphères Planétaires&amp;quot; GENCI project who need to open an account on Irene-Rome, here is the procedure:&lt;br /&gt;
&lt;br /&gt;
* Log on to https://www-dcc.extra.cea.fr/CCFR/ and provide various information about yourself &lt;br /&gt;
&lt;br /&gt;
A few tips:&lt;br /&gt;
&lt;br /&gt;
- chose TGCC&lt;br /&gt;
&lt;br /&gt;
- give your PROFESSIONAL phone number (and not your personal cell phone number)&lt;br /&gt;
&lt;br /&gt;
- name of the project: Atmosphères Planétaires  Numéro du Dossier: A0120110391&lt;br /&gt;
&lt;br /&gt;
- Responsable scientifique du projet: M. Ehouarn MILLOUR , ehouarn.millour@lmd.ipsl.fr, 0144275286, Nationalité: Fr&lt;br /&gt;
&lt;br /&gt;
- Responsable sécurité: M. Franck Guyon, franck.guyon@lmd.ipsl.fr, 0144275277, Nationalité: Fr. Note that this is assuming you have an account on LMD computers and/or the MESOIPSL cluster. Otherwise you must provide the information for the relevant person from your lab.&lt;br /&gt;
&lt;br /&gt;
- IPs &amp;amp; machine names to connect to Irene: 134.157.47.46 (ssh-out.lmd.jussieu.fr) and 134.157.176.129 (ciclad.ipsl.upmc.fr). Note that this is assuming you have an account on LMD computers and/or the MESOIPSL cluster. Otherwise you must provide name &amp;amp; IP of your institute's gateway machine. &lt;br /&gt;
&lt;br /&gt;
- Chose anything you want for the 8 character password&lt;br /&gt;
&lt;br /&gt;
* And then get Ehouarn to sign the form and forward it to Franck for him to sign as well.&lt;br /&gt;
&lt;br /&gt;
* Send the signed form to hotline.tgcc@cea.fr&lt;br /&gt;
&lt;br /&gt;
== Some useful commands ==&lt;br /&gt;
&lt;br /&gt;
* To access the disks of our project on Irene (&amp;quot;Atmosphères Planétaires&amp;quot; GENCI project), add the following line in your .bash_profile file:&lt;br /&gt;
(.bash_profile rather than .bashrc, because otherwise scp may not find your files when fetching them from $CCCWORKDIR on irene to your machine)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
module switch dfldatadir/gen10391&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To access your work directory (to run your simulations)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /ccc/work/cont003/gen10391/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
you can also access the work directory with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $CCCWORKDIR&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To access your store directory (to store big data files we are limited in inode number not in filesize! It is recommended to store files of at least 50M, preferably more, e.g. big tar files of 10G or more)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /ccc/work/cont003/gen10391/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
you can also access the store directory with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $CCCSTOREDIR&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To access the scratch directory&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $CCCSCRATCHDIR&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
IMPORTANT: the scratchdir is fast access, very big, BUT regularly automatically purged! If you use it do remember to backup stuff on the WORKDIR or STOREDIR.&lt;br /&gt;
&lt;br /&gt;
The scratch purge policy (from machine.info):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* Files not accessed for 60 days are automatically purged&lt;br /&gt;
* Symbolic links are not purged&lt;br /&gt;
* Directories that have been empty for more than 30 days are removed&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
There is a dedicated command&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_will_purge&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
which should return information about upcoming purge on your scratch space.&lt;br /&gt;
&lt;br /&gt;
And a nice command (copyleft Antoine Martinez and Olivier from LATMOS) to update all the &amp;quot;Access&amp;quot; and &amp;quot;Change&amp;quot; stats of the files in your current directory (and sub-directories), without changing the &amp;quot;Modify&amp;quot; stat (so that you can still sort them by date of modification with 'ls -lt') :&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $CCCSCRATCHDIR&lt;br /&gt;
find . -type f -exec touch -a {} \;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To access Irene Interactive Documentation:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
machine.info&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: you can also access the online documentation here: http://www-hpc.cea.fr/tgcc-public/en/html/toc/fulldoc/Introduction.html&lt;br /&gt;
&lt;br /&gt;
* To display infos about project accounting:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_myproject &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To know about user and group disk quota&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_quota -a&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To know about how long your passwd will be active:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_password_expiration&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To change passwd:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
passwd&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example of a job to run a GCM simulation ==&lt;br /&gt;
&lt;br /&gt;
=== Mixed openMP / MPI ===&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;
# Partition to run on:&lt;br /&gt;
#MSUB -q rome&lt;br /&gt;
# project to run on &lt;br /&gt;
#MSUB -A  gen10391&lt;br /&gt;
# disks to use&lt;br /&gt;
#MSUB -m  scratch,work,store&lt;br /&gt;
# Job name&lt;br /&gt;
#MSUB -r run_gcm&lt;br /&gt;
# Job standard output:&lt;br /&gt;
#MSUB -o run_gcm.%I&lt;br /&gt;
# Job standard error:&lt;br /&gt;
#MSUB -e run_gcm.%I&lt;br /&gt;
# number of OpenMP threads c&lt;br /&gt;
#MSUB -c 2&lt;br /&gt;
# number of MPI tasks n&lt;br /&gt;
#MSUB -n 16&lt;br /&gt;
# number of nodes to use N&lt;br /&gt;
#MSUB -N 1&lt;br /&gt;
# max job run time T (in seconds)&lt;br /&gt;
#MSUB -T 3600&lt;br /&gt;
# request exculsive use of the node (128 cores)&lt;br /&gt;
##MSUB -x&lt;br /&gt;
&lt;br /&gt;
source ../trunk/LMDZ.COMMON/arch.env&lt;br /&gt;
export OMP_STACKSIZE=400M&lt;br /&gt;
export OMP_NUM_THREADS=2&lt;br /&gt;
&lt;br /&gt;
ccc_mprun -l gcm_32x32x15_phystd_para.e &amp;gt; gcm.out 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pure MPI + long run ===&lt;br /&gt;
&lt;br /&gt;
The most important parameter for mpi-only runs is ''-n'' &lt;br /&gt;
providing the total number of CPUs &lt;br /&gt;
(ideally a multiple of 128, which is the number of CPUs per core).&lt;br /&gt;
&lt;br /&gt;
Runs longer than 1 day are not possible unless&lt;br /&gt;
selecting a quality-of-service (QoS) &amp;quot;long&amp;quot;&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;
# Partition to run on:&lt;br /&gt;
#MSUB -q rome&lt;br /&gt;
# project to run on &lt;br /&gt;
#MSUB -A  gen10391&lt;br /&gt;
# disks to use&lt;br /&gt;
#MSUB -m  scratch,work,store&lt;br /&gt;
# Job name&lt;br /&gt;
#MSUB -r run_wrf&lt;br /&gt;
# Job standard output:&lt;br /&gt;
#MSUB -o run_wrf.%I&lt;br /&gt;
# Job standard error:&lt;br /&gt;
#MSUB -e run_wrf.%I&lt;br /&gt;
# number of MPI tasks n (total)&lt;br /&gt;
#MSUB -n 256&lt;br /&gt;
# max job run time T (in seconds)&lt;br /&gt;
#MSUB -T 345600&lt;br /&gt;
# select quality-of-service&lt;br /&gt;
# - test &amp;lt; 30min&lt;br /&gt;
# - normal &amp;lt; 1d (default)&lt;br /&gt;
# - long &amp;lt; 3d &lt;br /&gt;
#MSUB -Q long&lt;br /&gt;
&lt;br /&gt;
#############################&lt;br /&gt;
&lt;br /&gt;
# load the modules used to compile&lt;br /&gt;
source arch.env&lt;br /&gt;
&lt;br /&gt;
# clean the logs&lt;br /&gt;
rm -rf rsl.*&lt;br /&gt;
&lt;br /&gt;
# create initial state&lt;br /&gt;
# -- this is done on a single proc&lt;br /&gt;
ideal.exe&lt;br /&gt;
mv rsl.error.0000 ideal_rsl.error.0000&lt;br /&gt;
mv rsl.out.0000 ideal_rsl.out.0000&lt;br /&gt;
&lt;br /&gt;
# main launch&lt;br /&gt;
ccc_mprun -l wrf.exe&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Main submission commands ==&lt;br /&gt;
&lt;br /&gt;
* To launch the job script ''run_gcm.job'':&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_msub run_gcm.job&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To display information about your jobs:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_mpp -u $USER &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To kill job number ''jobid''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_mdel jobid&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To display infos about a job (works both while it is running or after it has finished):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_macct jobid&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To display infos about project accounting:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_myproject&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To display infos about limits:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_mqinfo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To display infos about partitions:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_mpinfo&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== File transfert from Occigen ==&lt;br /&gt;
One should use ccfr:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
module load ccfr&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
A list of available machines is given by&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccfr_ssh -v&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
To log on to Occigen (from Irene):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccfr_ssh occigenlogin@cines&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To copy a file (typically a big tar file):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccfr_cp occigenlogin@cines:remote_dir local_dir &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This command will fail if you try copying over a directory, with a weird error message of the likes of:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rsync: write failed on &amp;quot;/ccc/work/....&amp;quot; Disk quota exceeded (122)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If copying over directories (via rsync) then you should modify the related rights (which must be &amp;quot;s&amp;quot; for the group on Irene) using dedicated options:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync --chmod=Dg+s --chown=:gen10391 source_on_distant_machine target_on_Irene  &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Worth knowing about ==&lt;br /&gt;
* The command wget is disabled on Irene, scripts using it will fail...&lt;br /&gt;
* Only &amp;quot;https&amp;quot; is allowed (for svn co, git, etc)&lt;br /&gt;
*If you encounter a quota issue on Irene, first check if indeed you (or the group's) quota is exceeded:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_quota&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In case you get an error message about your quota when copying data over to Irene, it might be because the rights on directories are not well set; please use the following command on your directory before sending the data to Irene:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod -R g+s NAME_OF_DIR&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Guide_for_good_coding&amp;diff=1127</id>
		<title>Guide for good coding</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Guide_for_good_coding&amp;diff=1127"/>
				<updated>2023-01-05T10:59:55Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: /* Efficient loop coding */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to create a new module/subroutine ==&lt;br /&gt;
&lt;br /&gt;
Subroutines should be integrated inside a module.&lt;br /&gt;
A good writing habit is to add the line &amp;quot;IMPLICIT NONE&amp;quot;, in the beginning of the module and subroutine.&lt;br /&gt;
&lt;br /&gt;
First you can define all the variable that belongs to the module and could be used at another place.&lt;br /&gt;
A good thing is also to create a subroutine that allocate and initialise module variables.&lt;br /&gt;
If the variable is only modified inside the module it should be taged as protected.&lt;br /&gt;
If the variable belongs only to the module it can be specified to be private.&lt;br /&gt;
&lt;br /&gt;
You can now start the definition of the subroutine.&lt;br /&gt;
Start by variable and function from other module if necessary.&lt;br /&gt;
Comment the purpose of the subroutine directly.&lt;br /&gt;
Declare the variables, first the one pass in arguments.&lt;br /&gt;
Use the intent to specify the status of the variable inside the subroutine.&lt;br /&gt;
Continue with the local and saved variables.&lt;br /&gt;
Then you can define local variables.&lt;br /&gt;
Remember to comment all of them, you can specify the dimension if the variable is an allocatable variable as well as the units and everything that seems appropriate.&lt;br /&gt;
&lt;br /&gt;
You can finally write the code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot; line&amp;gt;&lt;br /&gt;
    MODULE aquarium_mod&lt;br /&gt;
&lt;br /&gt;
    IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
    INTEGER :: water     ! Define what is the variable, the dimension, units (°) etc...&lt;br /&gt;
    REAL,SAVE,ALLOCATABLE,DIMENSION(:) :: kre1      ! Another comment &lt;br /&gt;
&lt;br /&gt;
    CONTAINS&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE aquarium(kre, grass, other_things&lt;br /&gt;
     &amp;amp;                    really_anything)&lt;br /&gt;
                                                         &lt;br /&gt;
      use another_module_mod, only: fct, variable&lt;br /&gt;
      &lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   subject:&lt;br /&gt;
!   --------&lt;br /&gt;
!   What is the subroutine doing&lt;br /&gt;
!&lt;br /&gt;
!   author: Someone smart &lt;br /&gt;
!   ------&lt;br /&gt;
!   update: Someone smarter, march 2012:&lt;br /&gt;
!         - I change something here&lt;br /&gt;
!   &lt;br /&gt;
!=======================================================================&lt;br /&gt;
      &lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
!-----------------------------------------------------------------------&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!    Declarations :&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!&lt;br /&gt;
!    Input/Output&lt;br /&gt;
!    ------------&lt;br /&gt;
      REAL, INTENT(IN)     ::  something(ngrid,nlayer) ! 2D tabular used as an input only  (W/m^2)&lt;br /&gt;
      REAL, INTENT(OUT)    ::  kre(ngrid)              ! 1D tabular output by the subroutine  &lt;br /&gt;
      REAL, INTENT(INOUT)  ::  grass(ngrid,nlayer)     ! Variable that is modified by the subroutine&lt;br /&gt;
                                                       ! it is an input and output&lt;br /&gt;
      LOGICAL, INTENT(IN)  ::  really_anything         ! Boolean variable  &lt;br /&gt;
&lt;br /&gt;
!    Local saved variables&lt;br /&gt;
!    ---------------------&lt;br /&gt;
      INTEGER, PARAMETER :: nb_kre = 4                ! Number of kre&lt;br /&gt;
      INTEGER, SAVE      :: rock                      ! Another variable&lt;br /&gt;
      LOGICAL, SAVE      :: firstcall=.true.          ! Another variable&lt;br /&gt;
&lt;br /&gt;
!    Local variables&lt;br /&gt;
!    ---------------&lt;br /&gt;
      REAL    tabular(ngrid)                          ! Local var&lt;br /&gt;
      INTEGER i                                       ! Loop var&lt;br /&gt;
&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   Beginning of the code&lt;br /&gt;
!=======================================================================&lt;br /&gt;
&lt;br /&gt;
      IF (firstcall) THEN&lt;br /&gt;
        ! initialize rock&lt;br /&gt;
        rock = 2&lt;br /&gt;
        ! identify where are the kre&lt;br /&gt;
        DO i=1,nb_kre&lt;br /&gt;
          kre(i)=i&lt;br /&gt;
          if (kre(i).gt.rock) then&lt;br /&gt;
            write(*,*) &amp;quot;the Kre &amp;quot;, i, &amp;quot;is behind the rock&amp;quot;&lt;br /&gt;
          else if (mod(kre(i),2).eq.0) then&lt;br /&gt;
            grass(:,nlayer-1)=grass(:,nlayer-1)-grass(:,nlayer) ! every two kre are eating grass in a very complex way&lt;br /&gt;
          endif !(kre(i).gt.rock)&lt;br /&gt;
&lt;br /&gt;
        ENDDO !end of the loop nb_kre&lt;br /&gt;
      ENDIF !end firstcall&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE aquarium&lt;br /&gt;
&lt;br /&gt;
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE ini_aquarium(ngrid)&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   Initialise module's variable&lt;br /&gt;
!=======================================================================&lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
      INTEGER, INTENT(IN) :: ngrid&lt;br /&gt;
&lt;br /&gt;
      allocate(kre1(ngrid+1))&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE ini_aquarium&lt;br /&gt;
&lt;br /&gt;
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE end_aquarium&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   Deallocate module's variable&lt;br /&gt;
!=======================================================================&lt;br /&gt;
&lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
      IF (allocated(kre1)) deallocate(kre1)&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE end_aquarium&lt;br /&gt;
      &lt;br /&gt;
    END MODULE aquarium_mod&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to pass variable to subroutine (by argument or by module) ==&lt;br /&gt;
&lt;br /&gt;
Define when we should use argument and when to use modules&lt;br /&gt;
&lt;br /&gt;
Proposition :&lt;br /&gt;
* if the variable is not going to change throughout the run (between two calls of the subroutine) =&amp;gt; module variable&lt;br /&gt;
* else =&amp;gt; subroutine argument&lt;br /&gt;
&lt;br /&gt;
== Naming variables convention ==&lt;br /&gt;
&lt;br /&gt;
What is the naming convention.&lt;br /&gt;
In vdifc_mod for example.&lt;br /&gt;
&lt;br /&gt;
== Loop index convention ==&lt;br /&gt;
&lt;br /&gt;
Index name for loops through:&lt;br /&gt;
* '''physical grid''' : ig (max ngrid)&lt;br /&gt;
* ''' vertical levels''' : l (max nlayer)&lt;br /&gt;
* '''tracer''' : iq (max nq)&lt;br /&gt;
* '''subslopes''' : islope (max nslope)&lt;br /&gt;
iaer=1,naerkind&lt;br /&gt;
&lt;br /&gt;
== Efficient loop coding ==&lt;br /&gt;
&lt;br /&gt;
'''The more outside loop should correspond to the last index of an array.'''&lt;br /&gt;
&lt;br /&gt;
Example: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot;&amp;gt;&lt;br /&gt;
      DO l=1,nlayer&lt;br /&gt;
        DO ig=1,ngrid&lt;br /&gt;
          array(ig,l)=l*ig&lt;br /&gt;
        ENDDO&lt;br /&gt;
      ENDDO&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to use the Intent ==&lt;br /&gt;
&lt;br /&gt;
Argument of a function can come in 3 different way: IN, OUT, INOUT. &lt;br /&gt;
&lt;br /&gt;
== How to comment code ==&lt;br /&gt;
&lt;br /&gt;
* '''In english'''&lt;br /&gt;
* '''As much as possible'''&lt;br /&gt;
* '''Variable definition''' : explain what it is, the dimension, the units etc...&lt;br /&gt;
* '''Subroutine''' : Explain what it does, who wrote it, who modify it and why if it is a big change&lt;br /&gt;
* '''Loops''' : if the enddo is far away you can comment to which index it correspond to.&lt;br /&gt;
* '''Chapter your code''' : you can add section to your code to make it clearer.&lt;br /&gt;
&lt;br /&gt;
== General guide ==&lt;br /&gt;
&lt;br /&gt;
* Create .F90 instead of .F&lt;br /&gt;
* Delete unused argument in a function call if you see one&lt;br /&gt;
* Delete unused variables&lt;br /&gt;
* Choose meaningful names of variables&lt;br /&gt;
* Don't hesitate to comment at much as possible, a code is never too commented&lt;br /&gt;
* Delete unused commented code lines&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Guide_for_good_coding&amp;diff=1126</id>
		<title>Guide for good coding</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Guide_for_good_coding&amp;diff=1126"/>
				<updated>2023-01-05T10:59:45Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: /* Efficient loop coding */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to create a new module/subroutine ==&lt;br /&gt;
&lt;br /&gt;
Subroutines should be integrated inside a module.&lt;br /&gt;
A good writing habit is to add the line &amp;quot;IMPLICIT NONE&amp;quot;, in the beginning of the module and subroutine.&lt;br /&gt;
&lt;br /&gt;
First you can define all the variable that belongs to the module and could be used at another place.&lt;br /&gt;
A good thing is also to create a subroutine that allocate and initialise module variables.&lt;br /&gt;
If the variable is only modified inside the module it should be taged as protected.&lt;br /&gt;
If the variable belongs only to the module it can be specified to be private.&lt;br /&gt;
&lt;br /&gt;
You can now start the definition of the subroutine.&lt;br /&gt;
Start by variable and function from other module if necessary.&lt;br /&gt;
Comment the purpose of the subroutine directly.&lt;br /&gt;
Declare the variables, first the one pass in arguments.&lt;br /&gt;
Use the intent to specify the status of the variable inside the subroutine.&lt;br /&gt;
Continue with the local and saved variables.&lt;br /&gt;
Then you can define local variables.&lt;br /&gt;
Remember to comment all of them, you can specify the dimension if the variable is an allocatable variable as well as the units and everything that seems appropriate.&lt;br /&gt;
&lt;br /&gt;
You can finally write the code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot; line&amp;gt;&lt;br /&gt;
    MODULE aquarium_mod&lt;br /&gt;
&lt;br /&gt;
    IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
    INTEGER :: water     ! Define what is the variable, the dimension, units (°) etc...&lt;br /&gt;
    REAL,SAVE,ALLOCATABLE,DIMENSION(:) :: kre1      ! Another comment &lt;br /&gt;
&lt;br /&gt;
    CONTAINS&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE aquarium(kre, grass, other_things&lt;br /&gt;
     &amp;amp;                    really_anything)&lt;br /&gt;
                                                         &lt;br /&gt;
      use another_module_mod, only: fct, variable&lt;br /&gt;
      &lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   subject:&lt;br /&gt;
!   --------&lt;br /&gt;
!   What is the subroutine doing&lt;br /&gt;
!&lt;br /&gt;
!   author: Someone smart &lt;br /&gt;
!   ------&lt;br /&gt;
!   update: Someone smarter, march 2012:&lt;br /&gt;
!         - I change something here&lt;br /&gt;
!   &lt;br /&gt;
!=======================================================================&lt;br /&gt;
      &lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
!-----------------------------------------------------------------------&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!    Declarations :&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!&lt;br /&gt;
!    Input/Output&lt;br /&gt;
!    ------------&lt;br /&gt;
      REAL, INTENT(IN)     ::  something(ngrid,nlayer) ! 2D tabular used as an input only  (W/m^2)&lt;br /&gt;
      REAL, INTENT(OUT)    ::  kre(ngrid)              ! 1D tabular output by the subroutine  &lt;br /&gt;
      REAL, INTENT(INOUT)  ::  grass(ngrid,nlayer)     ! Variable that is modified by the subroutine&lt;br /&gt;
                                                       ! it is an input and output&lt;br /&gt;
      LOGICAL, INTENT(IN)  ::  really_anything         ! Boolean variable  &lt;br /&gt;
&lt;br /&gt;
!    Local saved variables&lt;br /&gt;
!    ---------------------&lt;br /&gt;
      INTEGER, PARAMETER :: nb_kre = 4                ! Number of kre&lt;br /&gt;
      INTEGER, SAVE      :: rock                      ! Another variable&lt;br /&gt;
      LOGICAL, SAVE      :: firstcall=.true.          ! Another variable&lt;br /&gt;
&lt;br /&gt;
!    Local variables&lt;br /&gt;
!    ---------------&lt;br /&gt;
      REAL    tabular(ngrid)                          ! Local var&lt;br /&gt;
      INTEGER i                                       ! Loop var&lt;br /&gt;
&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   Beginning of the code&lt;br /&gt;
!=======================================================================&lt;br /&gt;
&lt;br /&gt;
      IF (firstcall) THEN&lt;br /&gt;
        ! initialize rock&lt;br /&gt;
        rock = 2&lt;br /&gt;
        ! identify where are the kre&lt;br /&gt;
        DO i=1,nb_kre&lt;br /&gt;
          kre(i)=i&lt;br /&gt;
          if (kre(i).gt.rock) then&lt;br /&gt;
            write(*,*) &amp;quot;the Kre &amp;quot;, i, &amp;quot;is behind the rock&amp;quot;&lt;br /&gt;
          else if (mod(kre(i),2).eq.0) then&lt;br /&gt;
            grass(:,nlayer-1)=grass(:,nlayer-1)-grass(:,nlayer) ! every two kre are eating grass in a very complex way&lt;br /&gt;
          endif !(kre(i).gt.rock)&lt;br /&gt;
&lt;br /&gt;
        ENDDO !end of the loop nb_kre&lt;br /&gt;
      ENDIF !end firstcall&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE aquarium&lt;br /&gt;
&lt;br /&gt;
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE ini_aquarium(ngrid)&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   Initialise module's variable&lt;br /&gt;
!=======================================================================&lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
      INTEGER, INTENT(IN) :: ngrid&lt;br /&gt;
&lt;br /&gt;
      allocate(kre1(ngrid+1))&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE ini_aquarium&lt;br /&gt;
&lt;br /&gt;
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE end_aquarium&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   Deallocate module's variable&lt;br /&gt;
!=======================================================================&lt;br /&gt;
&lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
      IF (allocated(kre1)) deallocate(kre1)&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE end_aquarium&lt;br /&gt;
      &lt;br /&gt;
    END MODULE aquarium_mod&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to pass variable to subroutine (by argument or by module) ==&lt;br /&gt;
&lt;br /&gt;
Define when we should use argument and when to use modules&lt;br /&gt;
&lt;br /&gt;
Proposition :&lt;br /&gt;
* if the variable is not going to change throughout the run (between two calls of the subroutine) =&amp;gt; module variable&lt;br /&gt;
* else =&amp;gt; subroutine argument&lt;br /&gt;
&lt;br /&gt;
== Naming variables convention ==&lt;br /&gt;
&lt;br /&gt;
What is the naming convention.&lt;br /&gt;
In vdifc_mod for example.&lt;br /&gt;
&lt;br /&gt;
== Loop index convention ==&lt;br /&gt;
&lt;br /&gt;
Index name for loops through:&lt;br /&gt;
* '''physical grid''' : ig (max ngrid)&lt;br /&gt;
* ''' vertical levels''' : l (max nlayer)&lt;br /&gt;
* '''tracer''' : iq (max nq)&lt;br /&gt;
* '''subslopes''' : islope (max nslope)&lt;br /&gt;
iaer=1,naerkind&lt;br /&gt;
&lt;br /&gt;
== Efficient loop coding ==&lt;br /&gt;
&lt;br /&gt;
'''The more outside loop should correcpond to the last index of an array.'''&lt;br /&gt;
&lt;br /&gt;
Example: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot;&amp;gt;&lt;br /&gt;
      DO l=1,nlayer&lt;br /&gt;
        DO ig=1,ngrid&lt;br /&gt;
          array(ig,l)=l*ig&lt;br /&gt;
        ENDDO&lt;br /&gt;
      ENDDO&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to use the Intent ==&lt;br /&gt;
&lt;br /&gt;
Argument of a function can come in 3 different way: IN, OUT, INOUT. &lt;br /&gt;
&lt;br /&gt;
== How to comment code ==&lt;br /&gt;
&lt;br /&gt;
* '''In english'''&lt;br /&gt;
* '''As much as possible'''&lt;br /&gt;
* '''Variable definition''' : explain what it is, the dimension, the units etc...&lt;br /&gt;
* '''Subroutine''' : Explain what it does, who wrote it, who modify it and why if it is a big change&lt;br /&gt;
* '''Loops''' : if the enddo is far away you can comment to which index it correspond to.&lt;br /&gt;
* '''Chapter your code''' : you can add section to your code to make it clearer.&lt;br /&gt;
&lt;br /&gt;
== General guide ==&lt;br /&gt;
&lt;br /&gt;
* Create .F90 instead of .F&lt;br /&gt;
* Delete unused argument in a function call if you see one&lt;br /&gt;
* Delete unused variables&lt;br /&gt;
* Choose meaningful names of variables&lt;br /&gt;
* Don't hesitate to comment at much as possible, a code is never too commented&lt;br /&gt;
* Delete unused commented code lines&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Guide_for_good_coding&amp;diff=1125</id>
		<title>Guide for good coding</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Guide_for_good_coding&amp;diff=1125"/>
				<updated>2023-01-05T10:59:00Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: /* Naming variables convention */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to create a new module/subroutine ==&lt;br /&gt;
&lt;br /&gt;
Subroutines should be integrated inside a module.&lt;br /&gt;
A good writing habit is to add the line &amp;quot;IMPLICIT NONE&amp;quot;, in the beginning of the module and subroutine.&lt;br /&gt;
&lt;br /&gt;
First you can define all the variable that belongs to the module and could be used at another place.&lt;br /&gt;
A good thing is also to create a subroutine that allocate and initialise module variables.&lt;br /&gt;
If the variable is only modified inside the module it should be taged as protected.&lt;br /&gt;
If the variable belongs only to the module it can be specified to be private.&lt;br /&gt;
&lt;br /&gt;
You can now start the definition of the subroutine.&lt;br /&gt;
Start by variable and function from other module if necessary.&lt;br /&gt;
Comment the purpose of the subroutine directly.&lt;br /&gt;
Declare the variables, first the one pass in arguments.&lt;br /&gt;
Use the intent to specify the status of the variable inside the subroutine.&lt;br /&gt;
Continue with the local and saved variables.&lt;br /&gt;
Then you can define local variables.&lt;br /&gt;
Remember to comment all of them, you can specify the dimension if the variable is an allocatable variable as well as the units and everything that seems appropriate.&lt;br /&gt;
&lt;br /&gt;
You can finally write the code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot; line&amp;gt;&lt;br /&gt;
    MODULE aquarium_mod&lt;br /&gt;
&lt;br /&gt;
    IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
    INTEGER :: water     ! Define what is the variable, the dimension, units (°) etc...&lt;br /&gt;
    REAL,SAVE,ALLOCATABLE,DIMENSION(:) :: kre1      ! Another comment &lt;br /&gt;
&lt;br /&gt;
    CONTAINS&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE aquarium(kre, grass, other_things&lt;br /&gt;
     &amp;amp;                    really_anything)&lt;br /&gt;
                                                         &lt;br /&gt;
      use another_module_mod, only: fct, variable&lt;br /&gt;
      &lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   subject:&lt;br /&gt;
!   --------&lt;br /&gt;
!   What is the subroutine doing&lt;br /&gt;
!&lt;br /&gt;
!   author: Someone smart &lt;br /&gt;
!   ------&lt;br /&gt;
!   update: Someone smarter, march 2012:&lt;br /&gt;
!         - I change something here&lt;br /&gt;
!   &lt;br /&gt;
!=======================================================================&lt;br /&gt;
      &lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
!-----------------------------------------------------------------------&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!    Declarations :&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!&lt;br /&gt;
!    Input/Output&lt;br /&gt;
!    ------------&lt;br /&gt;
      REAL, INTENT(IN)     ::  something(ngrid,nlayer) ! 2D tabular used as an input only  (W/m^2)&lt;br /&gt;
      REAL, INTENT(OUT)    ::  kre(ngrid)              ! 1D tabular output by the subroutine  &lt;br /&gt;
      REAL, INTENT(INOUT)  ::  grass(ngrid,nlayer)     ! Variable that is modified by the subroutine&lt;br /&gt;
                                                       ! it is an input and output&lt;br /&gt;
      LOGICAL, INTENT(IN)  ::  really_anything         ! Boolean variable  &lt;br /&gt;
&lt;br /&gt;
!    Local saved variables&lt;br /&gt;
!    ---------------------&lt;br /&gt;
      INTEGER, PARAMETER :: nb_kre = 4                ! Number of kre&lt;br /&gt;
      INTEGER, SAVE      :: rock                      ! Another variable&lt;br /&gt;
      LOGICAL, SAVE      :: firstcall=.true.          ! Another variable&lt;br /&gt;
&lt;br /&gt;
!    Local variables&lt;br /&gt;
!    ---------------&lt;br /&gt;
      REAL    tabular(ngrid)                          ! Local var&lt;br /&gt;
      INTEGER i                                       ! Loop var&lt;br /&gt;
&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   Beginning of the code&lt;br /&gt;
!=======================================================================&lt;br /&gt;
&lt;br /&gt;
      IF (firstcall) THEN&lt;br /&gt;
        ! initialize rock&lt;br /&gt;
        rock = 2&lt;br /&gt;
        ! identify where are the kre&lt;br /&gt;
        DO i=1,nb_kre&lt;br /&gt;
          kre(i)=i&lt;br /&gt;
          if (kre(i).gt.rock) then&lt;br /&gt;
            write(*,*) &amp;quot;the Kre &amp;quot;, i, &amp;quot;is behind the rock&amp;quot;&lt;br /&gt;
          else if (mod(kre(i),2).eq.0) then&lt;br /&gt;
            grass(:,nlayer-1)=grass(:,nlayer-1)-grass(:,nlayer) ! every two kre are eating grass in a very complex way&lt;br /&gt;
          endif !(kre(i).gt.rock)&lt;br /&gt;
&lt;br /&gt;
        ENDDO !end of the loop nb_kre&lt;br /&gt;
      ENDIF !end firstcall&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE aquarium&lt;br /&gt;
&lt;br /&gt;
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE ini_aquarium(ngrid)&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   Initialise module's variable&lt;br /&gt;
!=======================================================================&lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
      INTEGER, INTENT(IN) :: ngrid&lt;br /&gt;
&lt;br /&gt;
      allocate(kre1(ngrid+1))&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE ini_aquarium&lt;br /&gt;
&lt;br /&gt;
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE end_aquarium&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   Deallocate module's variable&lt;br /&gt;
!=======================================================================&lt;br /&gt;
&lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
      IF (allocated(kre1)) deallocate(kre1)&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE end_aquarium&lt;br /&gt;
      &lt;br /&gt;
    END MODULE aquarium_mod&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to pass variable to subroutine (by argument or by module) ==&lt;br /&gt;
&lt;br /&gt;
Define when we should use argument and when to use modules&lt;br /&gt;
&lt;br /&gt;
Proposition :&lt;br /&gt;
* if the variable is not going to change throughout the run (between two calls of the subroutine) =&amp;gt; module variable&lt;br /&gt;
* else =&amp;gt; subroutine argument&lt;br /&gt;
&lt;br /&gt;
== Naming variables convention ==&lt;br /&gt;
&lt;br /&gt;
What is the naming convention.&lt;br /&gt;
In vdifc_mod for example.&lt;br /&gt;
&lt;br /&gt;
== Loop index convention ==&lt;br /&gt;
&lt;br /&gt;
Index name for loops through:&lt;br /&gt;
* '''physical grid''' : ig (max ngrid)&lt;br /&gt;
* ''' vertical levels''' : l (max nlayer)&lt;br /&gt;
* '''tracer''' : iq (max nq)&lt;br /&gt;
* '''subslopes''' : islope (max nslope)&lt;br /&gt;
iaer=1,naerkind&lt;br /&gt;
&lt;br /&gt;
== Efficient loop coding ==&lt;br /&gt;
&lt;br /&gt;
The more outside loop should correcpond to the last index of an array.&lt;br /&gt;
&lt;br /&gt;
Example: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot;&amp;gt;&lt;br /&gt;
      DO l=1,nlayer&lt;br /&gt;
        DO ig=1,ngrid&lt;br /&gt;
          array(ig,l)=l*ig&lt;br /&gt;
        ENDDO&lt;br /&gt;
      ENDDO&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to use the Intent ==&lt;br /&gt;
&lt;br /&gt;
Argument of a function can come in 3 different way: IN, OUT, INOUT. &lt;br /&gt;
&lt;br /&gt;
== How to comment code ==&lt;br /&gt;
&lt;br /&gt;
* '''In english'''&lt;br /&gt;
* '''As much as possible'''&lt;br /&gt;
* '''Variable definition''' : explain what it is, the dimension, the units etc...&lt;br /&gt;
* '''Subroutine''' : Explain what it does, who wrote it, who modify it and why if it is a big change&lt;br /&gt;
* '''Loops''' : if the enddo is far away you can comment to which index it correspond to.&lt;br /&gt;
* '''Chapter your code''' : you can add section to your code to make it clearer.&lt;br /&gt;
&lt;br /&gt;
== General guide ==&lt;br /&gt;
&lt;br /&gt;
* Create .F90 instead of .F&lt;br /&gt;
* Delete unused argument in a function call if you see one&lt;br /&gt;
* Delete unused variables&lt;br /&gt;
* Choose meaningful names of variables&lt;br /&gt;
* Don't hesitate to comment at much as possible, a code is never too commented&lt;br /&gt;
* Delete unused commented code lines&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Guide_for_good_coding&amp;diff=1124</id>
		<title>Guide for good coding</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Guide_for_good_coding&amp;diff=1124"/>
				<updated>2023-01-05T10:58:48Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: /* How to pass variable to subroutine (by argument or by module) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to create a new module/subroutine ==&lt;br /&gt;
&lt;br /&gt;
Subroutines should be integrated inside a module.&lt;br /&gt;
A good writing habit is to add the line &amp;quot;IMPLICIT NONE&amp;quot;, in the beginning of the module and subroutine.&lt;br /&gt;
&lt;br /&gt;
First you can define all the variable that belongs to the module and could be used at another place.&lt;br /&gt;
A good thing is also to create a subroutine that allocate and initialise module variables.&lt;br /&gt;
If the variable is only modified inside the module it should be taged as protected.&lt;br /&gt;
If the variable belongs only to the module it can be specified to be private.&lt;br /&gt;
&lt;br /&gt;
You can now start the definition of the subroutine.&lt;br /&gt;
Start by variable and function from other module if necessary.&lt;br /&gt;
Comment the purpose of the subroutine directly.&lt;br /&gt;
Declare the variables, first the one pass in arguments.&lt;br /&gt;
Use the intent to specify the status of the variable inside the subroutine.&lt;br /&gt;
Continue with the local and saved variables.&lt;br /&gt;
Then you can define local variables.&lt;br /&gt;
Remember to comment all of them, you can specify the dimension if the variable is an allocatable variable as well as the units and everything that seems appropriate.&lt;br /&gt;
&lt;br /&gt;
You can finally write the code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot; line&amp;gt;&lt;br /&gt;
    MODULE aquarium_mod&lt;br /&gt;
&lt;br /&gt;
    IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
    INTEGER :: water     ! Define what is the variable, the dimension, units (°) etc...&lt;br /&gt;
    REAL,SAVE,ALLOCATABLE,DIMENSION(:) :: kre1      ! Another comment &lt;br /&gt;
&lt;br /&gt;
    CONTAINS&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE aquarium(kre, grass, other_things&lt;br /&gt;
     &amp;amp;                    really_anything)&lt;br /&gt;
                                                         &lt;br /&gt;
      use another_module_mod, only: fct, variable&lt;br /&gt;
      &lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   subject:&lt;br /&gt;
!   --------&lt;br /&gt;
!   What is the subroutine doing&lt;br /&gt;
!&lt;br /&gt;
!   author: Someone smart &lt;br /&gt;
!   ------&lt;br /&gt;
!   update: Someone smarter, march 2012:&lt;br /&gt;
!         - I change something here&lt;br /&gt;
!   &lt;br /&gt;
!=======================================================================&lt;br /&gt;
      &lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
!-----------------------------------------------------------------------&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!    Declarations :&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!&lt;br /&gt;
!    Input/Output&lt;br /&gt;
!    ------------&lt;br /&gt;
      REAL, INTENT(IN)     ::  something(ngrid,nlayer) ! 2D tabular used as an input only  (W/m^2)&lt;br /&gt;
      REAL, INTENT(OUT)    ::  kre(ngrid)              ! 1D tabular output by the subroutine  &lt;br /&gt;
      REAL, INTENT(INOUT)  ::  grass(ngrid,nlayer)     ! Variable that is modified by the subroutine&lt;br /&gt;
                                                       ! it is an input and output&lt;br /&gt;
      LOGICAL, INTENT(IN)  ::  really_anything         ! Boolean variable  &lt;br /&gt;
&lt;br /&gt;
!    Local saved variables&lt;br /&gt;
!    ---------------------&lt;br /&gt;
      INTEGER, PARAMETER :: nb_kre = 4                ! Number of kre&lt;br /&gt;
      INTEGER, SAVE      :: rock                      ! Another variable&lt;br /&gt;
      LOGICAL, SAVE      :: firstcall=.true.          ! Another variable&lt;br /&gt;
&lt;br /&gt;
!    Local variables&lt;br /&gt;
!    ---------------&lt;br /&gt;
      REAL    tabular(ngrid)                          ! Local var&lt;br /&gt;
      INTEGER i                                       ! Loop var&lt;br /&gt;
&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   Beginning of the code&lt;br /&gt;
!=======================================================================&lt;br /&gt;
&lt;br /&gt;
      IF (firstcall) THEN&lt;br /&gt;
        ! initialize rock&lt;br /&gt;
        rock = 2&lt;br /&gt;
        ! identify where are the kre&lt;br /&gt;
        DO i=1,nb_kre&lt;br /&gt;
          kre(i)=i&lt;br /&gt;
          if (kre(i).gt.rock) then&lt;br /&gt;
            write(*,*) &amp;quot;the Kre &amp;quot;, i, &amp;quot;is behind the rock&amp;quot;&lt;br /&gt;
          else if (mod(kre(i),2).eq.0) then&lt;br /&gt;
            grass(:,nlayer-1)=grass(:,nlayer-1)-grass(:,nlayer) ! every two kre are eating grass in a very complex way&lt;br /&gt;
          endif !(kre(i).gt.rock)&lt;br /&gt;
&lt;br /&gt;
        ENDDO !end of the loop nb_kre&lt;br /&gt;
      ENDIF !end firstcall&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE aquarium&lt;br /&gt;
&lt;br /&gt;
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE ini_aquarium(ngrid)&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   Initialise module's variable&lt;br /&gt;
!=======================================================================&lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
      INTEGER, INTENT(IN) :: ngrid&lt;br /&gt;
&lt;br /&gt;
      allocate(kre1(ngrid+1))&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE ini_aquarium&lt;br /&gt;
&lt;br /&gt;
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE end_aquarium&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   Deallocate module's variable&lt;br /&gt;
!=======================================================================&lt;br /&gt;
&lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
      IF (allocated(kre1)) deallocate(kre1)&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE end_aquarium&lt;br /&gt;
      &lt;br /&gt;
    END MODULE aquarium_mod&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to pass variable to subroutine (by argument or by module) ==&lt;br /&gt;
&lt;br /&gt;
Define when we should use argument and when to use modules&lt;br /&gt;
&lt;br /&gt;
Proposition :&lt;br /&gt;
* if the variable is not going to change throughout the run (between two calls of the subroutine) =&amp;gt; module variable&lt;br /&gt;
* else =&amp;gt; subroutine argument&lt;br /&gt;
&lt;br /&gt;
== Naming variables convention ==&lt;br /&gt;
&lt;br /&gt;
What is the naming convention.&lt;br /&gt;
In vdifc_mod for exemple.&lt;br /&gt;
&lt;br /&gt;
== Loop index convention ==&lt;br /&gt;
&lt;br /&gt;
Index name for loops through:&lt;br /&gt;
* '''physical grid''' : ig (max ngrid)&lt;br /&gt;
* ''' vertical levels''' : l (max nlayer)&lt;br /&gt;
* '''tracer''' : iq (max nq)&lt;br /&gt;
* '''subslopes''' : islope (max nslope)&lt;br /&gt;
iaer=1,naerkind&lt;br /&gt;
&lt;br /&gt;
== Efficient loop coding ==&lt;br /&gt;
&lt;br /&gt;
The more outside loop should correcpond to the last index of an array.&lt;br /&gt;
&lt;br /&gt;
Example: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot;&amp;gt;&lt;br /&gt;
      DO l=1,nlayer&lt;br /&gt;
        DO ig=1,ngrid&lt;br /&gt;
          array(ig,l)=l*ig&lt;br /&gt;
        ENDDO&lt;br /&gt;
      ENDDO&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to use the Intent ==&lt;br /&gt;
&lt;br /&gt;
Argument of a function can come in 3 different way: IN, OUT, INOUT. &lt;br /&gt;
&lt;br /&gt;
== How to comment code ==&lt;br /&gt;
&lt;br /&gt;
* '''In english'''&lt;br /&gt;
* '''As much as possible'''&lt;br /&gt;
* '''Variable definition''' : explain what it is, the dimension, the units etc...&lt;br /&gt;
* '''Subroutine''' : Explain what it does, who wrote it, who modify it and why if it is a big change&lt;br /&gt;
* '''Loops''' : if the enddo is far away you can comment to which index it correspond to.&lt;br /&gt;
* '''Chapter your code''' : you can add section to your code to make it clearer.&lt;br /&gt;
&lt;br /&gt;
== General guide ==&lt;br /&gt;
&lt;br /&gt;
* Create .F90 instead of .F&lt;br /&gt;
* Delete unused argument in a function call if you see one&lt;br /&gt;
* Delete unused variables&lt;br /&gt;
* Choose meaningful names of variables&lt;br /&gt;
* Don't hesitate to comment at much as possible, a code is never too commented&lt;br /&gt;
* Delete unused commented code lines&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Guide_for_good_coding&amp;diff=1123</id>
		<title>Guide for good coding</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Guide_for_good_coding&amp;diff=1123"/>
				<updated>2023-01-05T10:58:00Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to create a new module/subroutine ==&lt;br /&gt;
&lt;br /&gt;
Subroutines should be integrated inside a module.&lt;br /&gt;
A good writing habit is to add the line &amp;quot;IMPLICIT NONE&amp;quot;, in the beginning of the module and subroutine.&lt;br /&gt;
&lt;br /&gt;
First you can define all the variable that belongs to the module and could be used at another place.&lt;br /&gt;
A good thing is also to create a subroutine that allocate and initialise module variables.&lt;br /&gt;
If the variable is only modified inside the module it should be taged as protected.&lt;br /&gt;
If the variable belongs only to the module it can be specified to be private.&lt;br /&gt;
&lt;br /&gt;
You can now start the definition of the subroutine.&lt;br /&gt;
Start by variable and function from other module if necessary.&lt;br /&gt;
Comment the purpose of the subroutine directly.&lt;br /&gt;
Declare the variables, first the one pass in arguments.&lt;br /&gt;
Use the intent to specify the status of the variable inside the subroutine.&lt;br /&gt;
Continue with the local and saved variables.&lt;br /&gt;
Then you can define local variables.&lt;br /&gt;
Remember to comment all of them, you can specify the dimension if the variable is an allocatable variable as well as the units and everything that seems appropriate.&lt;br /&gt;
&lt;br /&gt;
You can finally write the code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot; line&amp;gt;&lt;br /&gt;
    MODULE aquarium_mod&lt;br /&gt;
&lt;br /&gt;
    IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
    INTEGER :: water     ! Define what is the variable, the dimension, units (°) etc...&lt;br /&gt;
    REAL,SAVE,ALLOCATABLE,DIMENSION(:) :: kre1      ! Another comment &lt;br /&gt;
&lt;br /&gt;
    CONTAINS&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE aquarium(kre, grass, other_things&lt;br /&gt;
     &amp;amp;                    really_anything)&lt;br /&gt;
                                                         &lt;br /&gt;
      use another_module_mod, only: fct, variable&lt;br /&gt;
      &lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   subject:&lt;br /&gt;
!   --------&lt;br /&gt;
!   What is the subroutine doing&lt;br /&gt;
!&lt;br /&gt;
!   author: Someone smart &lt;br /&gt;
!   ------&lt;br /&gt;
!   update: Someone smarter, march 2012:&lt;br /&gt;
!         - I change something here&lt;br /&gt;
!   &lt;br /&gt;
!=======================================================================&lt;br /&gt;
      &lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
!-----------------------------------------------------------------------&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!    Declarations :&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!&lt;br /&gt;
!    Input/Output&lt;br /&gt;
!    ------------&lt;br /&gt;
      REAL, INTENT(IN)     ::  something(ngrid,nlayer) ! 2D tabular used as an input only  (W/m^2)&lt;br /&gt;
      REAL, INTENT(OUT)    ::  kre(ngrid)              ! 1D tabular output by the subroutine  &lt;br /&gt;
      REAL, INTENT(INOUT)  ::  grass(ngrid,nlayer)     ! Variable that is modified by the subroutine&lt;br /&gt;
                                                       ! it is an input and output&lt;br /&gt;
      LOGICAL, INTENT(IN)  ::  really_anything         ! Boolean variable  &lt;br /&gt;
&lt;br /&gt;
!    Local saved variables&lt;br /&gt;
!    ---------------------&lt;br /&gt;
      INTEGER, PARAMETER :: nb_kre = 4                ! Number of kre&lt;br /&gt;
      INTEGER, SAVE      :: rock                      ! Another variable&lt;br /&gt;
      LOGICAL, SAVE      :: firstcall=.true.          ! Another variable&lt;br /&gt;
&lt;br /&gt;
!    Local variables&lt;br /&gt;
!    ---------------&lt;br /&gt;
      REAL    tabular(ngrid)                          ! Local var&lt;br /&gt;
      INTEGER i                                       ! Loop var&lt;br /&gt;
&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   Beginning of the code&lt;br /&gt;
!=======================================================================&lt;br /&gt;
&lt;br /&gt;
      IF (firstcall) THEN&lt;br /&gt;
        ! initialize rock&lt;br /&gt;
        rock = 2&lt;br /&gt;
        ! identify where are the kre&lt;br /&gt;
        DO i=1,nb_kre&lt;br /&gt;
          kre(i)=i&lt;br /&gt;
          if (kre(i).gt.rock) then&lt;br /&gt;
            write(*,*) &amp;quot;the Kre &amp;quot;, i, &amp;quot;is behind the rock&amp;quot;&lt;br /&gt;
          else if (mod(kre(i),2).eq.0) then&lt;br /&gt;
            grass(:,nlayer-1)=grass(:,nlayer-1)-grass(:,nlayer) ! every two kre are eating grass in a very complex way&lt;br /&gt;
          endif !(kre(i).gt.rock)&lt;br /&gt;
&lt;br /&gt;
        ENDDO !end of the loop nb_kre&lt;br /&gt;
      ENDIF !end firstcall&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE aquarium&lt;br /&gt;
&lt;br /&gt;
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE ini_aquarium(ngrid)&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   Initialise module's variable&lt;br /&gt;
!=======================================================================&lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
      INTEGER, INTENT(IN) :: ngrid&lt;br /&gt;
&lt;br /&gt;
      allocate(kre1(ngrid+1))&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE ini_aquarium&lt;br /&gt;
&lt;br /&gt;
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE end_aquarium&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   Deallocate module's variable&lt;br /&gt;
!=======================================================================&lt;br /&gt;
&lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
      IF (allocated(kre1)) deallocate(kre1)&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE end_aquarium&lt;br /&gt;
      &lt;br /&gt;
    END MODULE aquarium_mod&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to pass variable to subroutine (by argument or by module) ==&lt;br /&gt;
&lt;br /&gt;
Define when we should use argument and when to use modules&lt;br /&gt;
Proposition :&lt;br /&gt;
- if the variable is not going to change throughout the run (between two calls of the subroutine) =&amp;gt; module variable&lt;br /&gt;
- else =&amp;gt; subroutine argument&lt;br /&gt;
&lt;br /&gt;
== Naming variables convention ==&lt;br /&gt;
&lt;br /&gt;
What is the naming convention.&lt;br /&gt;
In vdifc_mod for exemple.&lt;br /&gt;
&lt;br /&gt;
== Loop index convention ==&lt;br /&gt;
&lt;br /&gt;
Index name for loops through:&lt;br /&gt;
* '''physical grid''' : ig (max ngrid)&lt;br /&gt;
* ''' vertical levels''' : l (max nlayer)&lt;br /&gt;
* '''tracer''' : iq (max nq)&lt;br /&gt;
* '''subslopes''' : islope (max nslope)&lt;br /&gt;
iaer=1,naerkind&lt;br /&gt;
&lt;br /&gt;
== Efficient loop coding ==&lt;br /&gt;
&lt;br /&gt;
The more outside loop should correcpond to the last index of an array.&lt;br /&gt;
&lt;br /&gt;
Example: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot;&amp;gt;&lt;br /&gt;
      DO l=1,nlayer&lt;br /&gt;
        DO ig=1,ngrid&lt;br /&gt;
          array(ig,l)=l*ig&lt;br /&gt;
        ENDDO&lt;br /&gt;
      ENDDO&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to use the Intent ==&lt;br /&gt;
&lt;br /&gt;
Argument of a function can come in 3 different way: IN, OUT, INOUT. &lt;br /&gt;
&lt;br /&gt;
== How to comment code ==&lt;br /&gt;
&lt;br /&gt;
* '''In english'''&lt;br /&gt;
* '''As much as possible'''&lt;br /&gt;
* '''Variable definition''' : explain what it is, the dimension, the units etc...&lt;br /&gt;
* '''Subroutine''' : Explain what it does, who wrote it, who modify it and why if it is a big change&lt;br /&gt;
* '''Loops''' : if the enddo is far away you can comment to which index it correspond to.&lt;br /&gt;
* '''Chapter your code''' : you can add section to your code to make it clearer.&lt;br /&gt;
&lt;br /&gt;
== General guide ==&lt;br /&gt;
&lt;br /&gt;
* Create .F90 instead of .F&lt;br /&gt;
* Delete unused argument in a function call if you see one&lt;br /&gt;
* Delete unused variables&lt;br /&gt;
* Choose meaningful names of variables&lt;br /&gt;
* Don't hesitate to comment at much as possible, a code is never too commented&lt;br /&gt;
* Delete unused commented code lines&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Guide_for_good_coding&amp;diff=1122</id>
		<title>Guide for good coding</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Guide_for_good_coding&amp;diff=1122"/>
				<updated>2023-01-05T10:55:27Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: /* How to create a new module/subroutine */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to create a new module/subroutine ==&lt;br /&gt;
&lt;br /&gt;
Subroutines should be integrated inside a module.&lt;br /&gt;
A good writing habit is to add the line &amp;quot;IMPLICIT NONE&amp;quot;, in the beginning of the module and subroutine.&lt;br /&gt;
&lt;br /&gt;
First you can define all the variable that belongs to the module and could be used at another place.&lt;br /&gt;
A good thing is also to create a subroutine that allocate and initialise module variables.&lt;br /&gt;
If the variable is only modified inside the module it should be taged as protected.&lt;br /&gt;
If the variable belongs only to the module it can be specified to be private.&lt;br /&gt;
&lt;br /&gt;
You can now start the definition of the subroutine.&lt;br /&gt;
Start by variable and function from other module if necessary.&lt;br /&gt;
Comment the purpose of the subroutine directly.&lt;br /&gt;
Declare the variables, first the one pass in arguments.&lt;br /&gt;
Use the intent to specify the status of the variable inside the subroutine.&lt;br /&gt;
Continue with the local and saved variables.&lt;br /&gt;
Then you can define local variables.&lt;br /&gt;
Remember to comment all of them, you can specify the dimension if the variable is an allocatable variable as well as the units and everything that seems appropriate.&lt;br /&gt;
&lt;br /&gt;
You can finally write the code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot; line&amp;gt;&lt;br /&gt;
    MODULE aquarium_mod&lt;br /&gt;
&lt;br /&gt;
    IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
    INTEGER :: water     ! Define what is the variable, the dimension, units (°) etc...&lt;br /&gt;
    REAL,SAVE,ALLOCATABLE,DIMENSION(:) :: kre1      ! Another comment &lt;br /&gt;
&lt;br /&gt;
    CONTAINS&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE aquarium(kre, grass, other_things&lt;br /&gt;
     &amp;amp;                    really_anything)&lt;br /&gt;
                                                         &lt;br /&gt;
      use another_module_mod, only: fct, variable&lt;br /&gt;
      &lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   subject:&lt;br /&gt;
!   --------&lt;br /&gt;
!   What is the subroutine doing&lt;br /&gt;
!&lt;br /&gt;
!   author: Someone smart &lt;br /&gt;
!   ------&lt;br /&gt;
!   update: Someone smarter, march 2012:&lt;br /&gt;
!         - I change something here&lt;br /&gt;
!   &lt;br /&gt;
!=======================================================================&lt;br /&gt;
      &lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
!-----------------------------------------------------------------------&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!    Declarations :&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!&lt;br /&gt;
!    Input/Output&lt;br /&gt;
!    ------------&lt;br /&gt;
      REAL, INTENT(IN)     ::  something(ngrid,nlayer) ! 2D tabular used as an input only  (W/m^2)&lt;br /&gt;
      REAL, INTENT(OUT)    ::  kre(ngrid)              ! 1D tabular output by the subroutine  &lt;br /&gt;
      REAL, INTENT(INOUT)  ::  grass(ngrid,nlayer)     ! Variable that is modified by the subroutine&lt;br /&gt;
                                                       ! it is an input and output&lt;br /&gt;
      LOGICAL, INTENT(IN)  ::  really_anything         ! Boolean variable  &lt;br /&gt;
&lt;br /&gt;
!    Local saved variables&lt;br /&gt;
!    ---------------------&lt;br /&gt;
      INTEGER, PARAMETER :: nb_kre = 4                ! Number of kre&lt;br /&gt;
      INTEGER, SAVE      :: rock                      ! Another variable&lt;br /&gt;
      LOGICAL, SAVE      :: firstcall=.true.          ! Another variable&lt;br /&gt;
&lt;br /&gt;
!    Local variables&lt;br /&gt;
!    ---------------&lt;br /&gt;
      REAL    tabular(ngrid)                          ! Local var&lt;br /&gt;
      INTEGER i                                       ! Loop var&lt;br /&gt;
&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   Beginning of the code&lt;br /&gt;
!=======================================================================&lt;br /&gt;
&lt;br /&gt;
      IF (firstcall) THEN&lt;br /&gt;
        ! initialize rock&lt;br /&gt;
        rock = 2&lt;br /&gt;
        ! identify where are the kre&lt;br /&gt;
        DO i=1,nb_kre&lt;br /&gt;
          kre(i)=i&lt;br /&gt;
          if (kre(i).gt.rock) then&lt;br /&gt;
            write(*,*) &amp;quot;the Kre &amp;quot;, i, &amp;quot;is behind the rock&amp;quot;&lt;br /&gt;
          else if (mod(kre(i),2).eq.0) then&lt;br /&gt;
            grass(:,nlayer-1)=grass(:,nlayer-1)-grass(:,nlayer) ! every two kre are eating grass in a very complex way&lt;br /&gt;
          endif !(kre(i).gt.rock)&lt;br /&gt;
&lt;br /&gt;
        ENDDO !end of the loop nb_kre&lt;br /&gt;
      ENDIF !end firstcall&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE aquarium&lt;br /&gt;
&lt;br /&gt;
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE ini_aquarium(ngrid)&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   Initialise module's variable&lt;br /&gt;
!=======================================================================&lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
      INTEGER, INTENT(IN) :: ngrid&lt;br /&gt;
&lt;br /&gt;
      allocate(kre1(ngrid+1))&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE ini_aquarium&lt;br /&gt;
&lt;br /&gt;
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE end_aquarium&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   Deallocate module's variable&lt;br /&gt;
!=======================================================================&lt;br /&gt;
&lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
      IF (allocated(kre1)) deallocate(kre1)&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE end_aquarium&lt;br /&gt;
      &lt;br /&gt;
    END MODULE aquarium_mod&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to pass variable to subroutine (by argument or by module) ==&lt;br /&gt;
&lt;br /&gt;
Define when we should use argument and when to use modules&lt;br /&gt;
&lt;br /&gt;
== Naming variables convention ==&lt;br /&gt;
&lt;br /&gt;
What is the naming convention.&lt;br /&gt;
In vdifc_mod for exemple.&lt;br /&gt;
&lt;br /&gt;
== Loop index convention ==&lt;br /&gt;
&lt;br /&gt;
Index name for loops through:&lt;br /&gt;
* '''physical grid''' : ig (max ngrid)&lt;br /&gt;
* ''' vertical levels''' : l (max nlayer)&lt;br /&gt;
* '''tracer''' : iq (max nq)&lt;br /&gt;
* '''subslopes''' : islope (max nslope)&lt;br /&gt;
iaer=1,naerkind&lt;br /&gt;
&lt;br /&gt;
== Efficient loop coding ==&lt;br /&gt;
&lt;br /&gt;
The more outside loop should correcpond to the last index of an array.&lt;br /&gt;
&lt;br /&gt;
Example: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot;&amp;gt;&lt;br /&gt;
      DO l=1,nlayer&lt;br /&gt;
        DO ig=1,ngrid&lt;br /&gt;
          array(ig,l)=l*ig&lt;br /&gt;
        ENDDO&lt;br /&gt;
      ENDDO&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to use the Intent ==&lt;br /&gt;
&lt;br /&gt;
Argument of a function can come in 3 different way: IN, OUT, INOUT. &lt;br /&gt;
&lt;br /&gt;
== How to comment code ==&lt;br /&gt;
&lt;br /&gt;
* '''In english'''&lt;br /&gt;
* '''As much as possible'''&lt;br /&gt;
* '''Variable definition''' : explain what it is, the dimension, the units etc...&lt;br /&gt;
* '''Subroutine''' : Explain what it does, who wrote it, who modify it and why if it is a big change&lt;br /&gt;
* '''Loops''' : if the enddo is far away you can comment to which index it correspond to.&lt;br /&gt;
* '''Chapter your code''' : you can add section to your code to make it clearer.&lt;br /&gt;
&lt;br /&gt;
== General guide ==&lt;br /&gt;
&lt;br /&gt;
* Create .F90 instead of .F&lt;br /&gt;
* Delete unused argument in a function call if you see one&lt;br /&gt;
* Delete unused variables&lt;br /&gt;
* Choose meaningful names of variables&lt;br /&gt;
* Don't hesitate to comment at much as possible, a code is never too commented&lt;br /&gt;
* Delete unused commented code lines&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Guide_for_good_coding&amp;diff=1121</id>
		<title>Guide for good coding</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Guide_for_good_coding&amp;diff=1121"/>
				<updated>2023-01-05T10:41:58Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: /* How to create a new module/subroutine */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to create a new module/subroutine ==&lt;br /&gt;
&lt;br /&gt;
Subroutines should be integrated inside a module.&lt;br /&gt;
A good writing habit is to add the line &amp;quot;IMPLICIT NONE&amp;quot;, in the beginning of the module and subroutine.&lt;br /&gt;
&lt;br /&gt;
First you can define all the variable that belongs to the module and could be used at another place.&lt;br /&gt;
A good thing is also to create a subroutine that allocate and initialise module variables.&lt;br /&gt;
If the variable is only modified inside the module it should be taged as protected.&lt;br /&gt;
If the variable belongs only to the module it can be specified to be private.&lt;br /&gt;
&lt;br /&gt;
You can now start the definition of the subroutine.&lt;br /&gt;
Start by variable and function from other module if necessary.&lt;br /&gt;
Comment the purpose of the subroutine directly.&lt;br /&gt;
Declare the variables, first the one pass in arguments.&lt;br /&gt;
Use the intent to specify the status of the variable inside the subroutine.&lt;br /&gt;
Continue with the local and saved variables.&lt;br /&gt;
Then you can define local variables.&lt;br /&gt;
Remember to comment all of them, you can specify the dimension if the variable is an allocatable variable as well as the units and everything that seems appropriate.&lt;br /&gt;
&lt;br /&gt;
You can finally write the code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot; line&amp;gt;&lt;br /&gt;
      MODULE aquarium_mod&lt;br /&gt;
&lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
      INTEGER :: water     ! Define what is the variable, the dimension, units (°) etc...&lt;br /&gt;
      REAL,SAVE,ALLOCATABLE,DIMENSION(:) :: kre1      ! Another comment &lt;br /&gt;
&lt;br /&gt;
      CONTAINS&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE aquarium(kre, grass, other_things&lt;br /&gt;
     &amp;amp;                    really_anything)&lt;br /&gt;
                                                         &lt;br /&gt;
      use another_module_mod, only: fct, variable&lt;br /&gt;
      &lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   subject:&lt;br /&gt;
!   --------&lt;br /&gt;
!   What is the subroutine doing&lt;br /&gt;
!&lt;br /&gt;
!   author: Someone smart &lt;br /&gt;
!   ------&lt;br /&gt;
!   update: Someone smarter, march 2012:&lt;br /&gt;
!         - I change something here&lt;br /&gt;
!   &lt;br /&gt;
!=======================================================================&lt;br /&gt;
      &lt;br /&gt;
       IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
!-----------------------------------------------------------------------&lt;br /&gt;
!&lt;br /&gt;
!    Declarations :&lt;br /&gt;
!    --------------&lt;br /&gt;
!&lt;br /&gt;
!    Input/Output&lt;br /&gt;
!    ------------&lt;br /&gt;
&lt;br /&gt;
      REAL, INTENT(IN)    ::  something(ngrid,nlayer) ! 2D tabular used as an input only  (W/m^2)&lt;br /&gt;
      REAL, INTENT(OUT)   ::  kre(ngrid)              ! 1D tabular output by the subroutine  &lt;br /&gt;
      REAL, INTENT(INOUT) ::  grass(ngrid,nlayer)     ! Variable that is modified by the subroutine&lt;br /&gt;
                                                      ! it is an input and output&lt;br /&gt;
      LOGICAL,INTENT(IN)  ::  really_anything         ! Boolean variable  &lt;br /&gt;
&lt;br /&gt;
!    Local saved variables :&lt;br /&gt;
!    -----------------&lt;br /&gt;
      INTEGER, PARAMETER :: nb_kre = 6                ! Number of kre&lt;br /&gt;
      INTEGER, SAVE      :: rock                      ! Another variable&lt;br /&gt;
      LOGICAL,SAVE :: firstcall=.true.                ! Another variable&lt;br /&gt;
&lt;br /&gt;
!    Local variables :&lt;br /&gt;
!    -----------------&lt;br /&gt;
      REAL tabular(ngrid)                             ! Local var&lt;br /&gt;
      INTEGER i                                       ! Loop var&lt;br /&gt;
&lt;br /&gt;
!    Beginning of the code :&lt;br /&gt;
!    ----------------- &lt;br /&gt;
&lt;br /&gt;
      IF (firstcall) THEN&lt;br /&gt;
        ! identify where are the kre&lt;br /&gt;
        DO i=1,nb_kre&lt;br /&gt;
          kre(i)=i&lt;br /&gt;
          write(*,*) &amp;quot;the Kre &amp;quot;, i, &amp;quot;is behind the rock&amp;quot;&lt;br /&gt;
        ENDDO !end of the loop nb_kre&lt;br /&gt;
      ENDIF   !end firstcall&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE aquarium&lt;br /&gt;
&lt;br /&gt;
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE ini_aquarium(ngrid)&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   Initialise module's variable&lt;br /&gt;
!=======================================================================&lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
      INTEGER, INTENT(IN) :: ngrid&lt;br /&gt;
&lt;br /&gt;
      allocate(kre1(ngrid+1))&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE ini_aquarium&lt;br /&gt;
&lt;br /&gt;
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE end_aquarium&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   Deallocate module's variable&lt;br /&gt;
!=======================================================================&lt;br /&gt;
&lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
      IF (allocated(kre1)) deallocate(kre1)&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE end_aquarium&lt;br /&gt;
      &lt;br /&gt;
      END MODULE aquarium_mod&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to pass variable to subroutine (by argument or by module) ==&lt;br /&gt;
&lt;br /&gt;
Define when we should use argument and when to use modules&lt;br /&gt;
&lt;br /&gt;
== Naming variables convention ==&lt;br /&gt;
&lt;br /&gt;
What is the naming convention.&lt;br /&gt;
In vdifc_mod for exemple.&lt;br /&gt;
&lt;br /&gt;
== Loop index convention ==&lt;br /&gt;
&lt;br /&gt;
Index name for loops through:&lt;br /&gt;
* '''physical grid''' : ig (max ngrid)&lt;br /&gt;
* ''' vertical levels''' : l (max nlayer)&lt;br /&gt;
* '''tracer''' : iq (max nq)&lt;br /&gt;
* '''subslopes''' : islope (max nslope)&lt;br /&gt;
iaer=1,naerkind&lt;br /&gt;
&lt;br /&gt;
== Efficient loop coding ==&lt;br /&gt;
&lt;br /&gt;
The more outside loop should correcpond to the last index of an array.&lt;br /&gt;
&lt;br /&gt;
Example: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot;&amp;gt;&lt;br /&gt;
      DO l=1,nlayer&lt;br /&gt;
        DO ig=1,ngrid&lt;br /&gt;
          array(ig,l)=l*ig&lt;br /&gt;
        ENDDO&lt;br /&gt;
      ENDDO&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to use the Intent ==&lt;br /&gt;
&lt;br /&gt;
Argument of a function can come in 3 different way: IN, OUT, INOUT. &lt;br /&gt;
&lt;br /&gt;
== How to comment code ==&lt;br /&gt;
&lt;br /&gt;
* '''In english'''&lt;br /&gt;
* '''As much as possible'''&lt;br /&gt;
* '''Variable definition''' : explain what it is, the dimension, the units etc...&lt;br /&gt;
* '''Subroutine''' : Explain what it does, who wrote it, who modify it and why if it is a big change&lt;br /&gt;
* '''Loops''' : if the enddo is far away you can comment to which index it correspond to.&lt;br /&gt;
* '''Chapter your code''' : you can add section to your code to make it clearer.&lt;br /&gt;
&lt;br /&gt;
== General guide ==&lt;br /&gt;
&lt;br /&gt;
* Create .F90 instead of .F&lt;br /&gt;
* Delete unused argument in a function call if you see one&lt;br /&gt;
* Delete unused variables&lt;br /&gt;
* Choose meaningful names of variables&lt;br /&gt;
* Don't hesitate to comment at much as possible, a code is never too commented&lt;br /&gt;
* Delete unused commented code lines&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Guide_for_good_coding&amp;diff=1120</id>
		<title>Guide for good coding</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Guide_for_good_coding&amp;diff=1120"/>
				<updated>2023-01-05T10:40:38Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: /* How to create a new module/subroutine */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to create a new module/subroutine ==&lt;br /&gt;
&lt;br /&gt;
Subroutines should be integrated inside a module.&lt;br /&gt;
A good writing habit is to add the line &amp;quot;IMPLICIT NONE&amp;quot;, in the beginning of the module and subroutine.&lt;br /&gt;
&lt;br /&gt;
First you can define all the variable that belongs to the module and could be used at another place.&lt;br /&gt;
A good thing is also to create a subroutine that allocate and initialise module variables.&lt;br /&gt;
If the variable is only modified inside the module it should be taged as protected.&lt;br /&gt;
If the variable belongs only to the module it can be specified to be private.&lt;br /&gt;
&lt;br /&gt;
You can now start the definition of the subroutine.&lt;br /&gt;
Start by variable and function from other module if necessary.&lt;br /&gt;
Comment the purpose of the subroutine directly.&lt;br /&gt;
Declare the variables, first the one pass in arguments.&lt;br /&gt;
Use the intent to specify the status of the variable inside the subroutine.&lt;br /&gt;
Continue with the local and saved variables.&lt;br /&gt;
Then you can define local variables.&lt;br /&gt;
Remember to comment all of them, you can specify the dimension if the variable is an allocatable variable as well as the units and everything that seems appropriate.&lt;br /&gt;
&lt;br /&gt;
You can finally write the code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot; line&amp;gt;&lt;br /&gt;
      MODULE aquarium_mod&lt;br /&gt;
&lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
      INTEGER :: water     ! Define what is the variable, the dimension, units (°) etc...&lt;br /&gt;
      REAL,SAVE,ALLOCATABLE,DIMENSION(:) :: kre1      ! Another comment &lt;br /&gt;
&lt;br /&gt;
      CONTAINS&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE aquarium(kre, grass, other_things&lt;br /&gt;
     &amp;amp;   really_anything)&lt;br /&gt;
                                                         &lt;br /&gt;
      use another_module_mod, only: fct, variable&lt;br /&gt;
      &lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   subject:&lt;br /&gt;
!   --------&lt;br /&gt;
!   What is the subroutine doing&lt;br /&gt;
!&lt;br /&gt;
!   author: Someone smart &lt;br /&gt;
!   ------&lt;br /&gt;
!   update: Someone smarter, march 2012:&lt;br /&gt;
!         - I change something here&lt;br /&gt;
!   &lt;br /&gt;
!=======================================================================&lt;br /&gt;
      &lt;br /&gt;
       IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
!-----------------------------------------------------------------------&lt;br /&gt;
!&lt;br /&gt;
!    Declarations :&lt;br /&gt;
!    --------------&lt;br /&gt;
!&lt;br /&gt;
!    Input/Output&lt;br /&gt;
!    ------------&lt;br /&gt;
&lt;br /&gt;
      REAL, INTENT(IN)    ::  something(ngrid,nlayer) ! 2D tabular used as an input only  (W/m^2)&lt;br /&gt;
      REAL, INTENT(OUT)   ::  kre(ngrid)              ! 1D tabular output by the subroutine  &lt;br /&gt;
      REAL, INTENT(INOUT) ::  grass(ngrid,nlayer)     ! Variable that is modified by the subroutine&lt;br /&gt;
                                                      ! it is an input and output&lt;br /&gt;
      LOGICAL,INTENT(IN)  ::  really_anything         ! Boolean variable  &lt;br /&gt;
&lt;br /&gt;
!    Local saved variables :&lt;br /&gt;
!    -----------------&lt;br /&gt;
      INTEGER, PARAMETER :: nb_kre = 6                ! Number of kre&lt;br /&gt;
      INTEGER, SAVE      :: rock                      ! Another variable&lt;br /&gt;
      LOGICAL,SAVE :: firstcall=.true.                ! Another variable&lt;br /&gt;
&lt;br /&gt;
!    Local variables :&lt;br /&gt;
!    -----------------&lt;br /&gt;
      REAL tabular(ngrid)                             ! Local var&lt;br /&gt;
      INTEGER i                                       ! Loop var&lt;br /&gt;
&lt;br /&gt;
!    Beginning of the code :&lt;br /&gt;
!    ----------------- &lt;br /&gt;
&lt;br /&gt;
      IF (firstcall) THEN&lt;br /&gt;
        ! identify where are the kre&lt;br /&gt;
        DO i=1,nb_kre&lt;br /&gt;
          kre(i)=i&lt;br /&gt;
          write(*,*) &amp;quot;the Kre &amp;quot;, i, &amp;quot;is behind the rock&amp;quot;&lt;br /&gt;
        ENDDO !end of the loop nb_kre&lt;br /&gt;
      ENDIF   !end firstcall&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE aquarium&lt;br /&gt;
&lt;br /&gt;
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE ini_aquarium(ngrid)&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   Initialise module's variable&lt;br /&gt;
!=======================================================================&lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
      INTEGER, INTENT(IN) :: ngrid&lt;br /&gt;
&lt;br /&gt;
      allocate(kre1(ngrid+1))&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE ini_aquarium&lt;br /&gt;
&lt;br /&gt;
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE end_aquarium&lt;br /&gt;
!=======================================================================&lt;br /&gt;
!   Deallocate module's variable&lt;br /&gt;
!=======================================================================&lt;br /&gt;
&lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
      IF (allocated(kre1)) deallocate(kre1)&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE end_aquarium&lt;br /&gt;
      &lt;br /&gt;
      END MODULE aquarium_mod&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to pass variable to subroutine (by argument or by module) ==&lt;br /&gt;
&lt;br /&gt;
Define when we should use argument and when to use modules&lt;br /&gt;
&lt;br /&gt;
== Naming variables convention ==&lt;br /&gt;
&lt;br /&gt;
What is the naming convention.&lt;br /&gt;
In vdifc_mod for exemple.&lt;br /&gt;
&lt;br /&gt;
== Loop index convention ==&lt;br /&gt;
&lt;br /&gt;
Index name for loops through:&lt;br /&gt;
* '''physical grid''' : ig (max ngrid)&lt;br /&gt;
* ''' vertical levels''' : l (max nlayer)&lt;br /&gt;
* '''tracer''' : iq (max nq)&lt;br /&gt;
* '''subslopes''' : islope (max nslope)&lt;br /&gt;
iaer=1,naerkind&lt;br /&gt;
&lt;br /&gt;
== Efficient loop coding ==&lt;br /&gt;
&lt;br /&gt;
The more outside loop should correcpond to the last index of an array.&lt;br /&gt;
&lt;br /&gt;
Example: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot;&amp;gt;&lt;br /&gt;
      DO l=1,nlayer&lt;br /&gt;
        DO ig=1,ngrid&lt;br /&gt;
          array(ig,l)=l*ig&lt;br /&gt;
        ENDDO&lt;br /&gt;
      ENDDO&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to use the Intent ==&lt;br /&gt;
&lt;br /&gt;
Argument of a function can come in 3 different way: IN, OUT, INOUT. &lt;br /&gt;
&lt;br /&gt;
== How to comment code ==&lt;br /&gt;
&lt;br /&gt;
* '''In english'''&lt;br /&gt;
* '''As much as possible'''&lt;br /&gt;
* '''Variable definition''' : explain what it is, the dimension, the units etc...&lt;br /&gt;
* '''Subroutine''' : Explain what it does, who wrote it, who modify it and why if it is a big change&lt;br /&gt;
* '''Loops''' : if the enddo is far away you can comment to which index it correspond to.&lt;br /&gt;
* '''Chapter your code''' : you can add section to your code to make it clearer.&lt;br /&gt;
&lt;br /&gt;
== General guide ==&lt;br /&gt;
&lt;br /&gt;
* Create .F90 instead of .F&lt;br /&gt;
* Delete unused argument in a function call if you see one&lt;br /&gt;
* Delete unused variables&lt;br /&gt;
* Choose meaningful names of variables&lt;br /&gt;
* Don't hesitate to comment at much as possible, a code is never too commented&lt;br /&gt;
* Delete unused commented code lines&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Guide_for_good_coding&amp;diff=1119</id>
		<title>Guide for good coding</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Guide_for_good_coding&amp;diff=1119"/>
				<updated>2023-01-05T10:38:52Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: /* How to create a new module/subroutine */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to create a new module/subroutine ==&lt;br /&gt;
&lt;br /&gt;
Subroutines should be integrated inside a module.&lt;br /&gt;
A good writing habit is to add the line &amp;quot;IMPLICIT NONE&amp;quot;, in the beginning of the module and subroutine.&lt;br /&gt;
&lt;br /&gt;
First you can define all the variable that belongs to the module and could be used at another place.&lt;br /&gt;
A good thing is also to create a subroutine that allocate and initialise module variables.&lt;br /&gt;
If the variable is only modified inside the module it should be taged as protected.&lt;br /&gt;
If the variable belongs only to the module it can be specified to be private.&lt;br /&gt;
&lt;br /&gt;
You can now start the definition of the subroutine.&lt;br /&gt;
Start by variable and function from other module if necessary.&lt;br /&gt;
Comment the purpose of the subroutine directly.&lt;br /&gt;
Declare the variables, first the one pass in arguments.&lt;br /&gt;
Use the intent to specify the status of the variable inside the subroutine.&lt;br /&gt;
Continue with the local and saved variables.&lt;br /&gt;
Then you can define local variables.&lt;br /&gt;
Remember to comment all of them, you can specify the dimension if the variable is an allocatable variable as well as the units and everything that seems appropriate.&lt;br /&gt;
&lt;br /&gt;
You can finally write the code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot; line&amp;gt;&lt;br /&gt;
      MODULE aquarium_mod&lt;br /&gt;
&lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
      INTEGER :: water     ! Define what is the variable, the dimension, units (°) etc...&lt;br /&gt;
      REAL,SAVE,ALLOCATABLE,DIMENSION(:) :: kre1      ! Another comment &lt;br /&gt;
&lt;br /&gt;
      CONTAINS&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE aquarium(kre, grass, other_things&lt;br /&gt;
     &amp;amp;   really_anything)&lt;br /&gt;
                                                         &lt;br /&gt;
      use another_module_mod, only: fct, variable&lt;br /&gt;
      &lt;br /&gt;
c=======================================================================&lt;br /&gt;
c   subject:&lt;br /&gt;
c   --------&lt;br /&gt;
c   What is the subroutine doing&lt;br /&gt;
c&lt;br /&gt;
c   author: Someone smart &lt;br /&gt;
c   ------&lt;br /&gt;
c   update: Someone smarter, march 2012:&lt;br /&gt;
c         - I change something here&lt;br /&gt;
c   &lt;br /&gt;
c=======================================================================&lt;br /&gt;
      &lt;br /&gt;
       IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
c-----------------------------------------------------------------------&lt;br /&gt;
c&lt;br /&gt;
c    Declarations :&lt;br /&gt;
c    --------------&lt;br /&gt;
c&lt;br /&gt;
c    Input/Output&lt;br /&gt;
c    ------------&lt;br /&gt;
&lt;br /&gt;
      REAL, INTENT(IN)    ::  something(ngrid,nlayer) ! 2D tabular used as an input only  (W/m^2)&lt;br /&gt;
      REAL, INTENT(OUT)   ::  kre(ngrid)              ! 1D tabular output by the subroutine  &lt;br /&gt;
      REAL, INTENT(INOUT) ::  grass(ngrid,nlayer)     ! Variable that is modified by the subroutine&lt;br /&gt;
                                                      ! it is an input and output&lt;br /&gt;
      LOGICAL,INTENT(IN)  ::  really_anything         ! Boolean variable  &lt;br /&gt;
&lt;br /&gt;
c    Local saved variables :&lt;br /&gt;
c    -----------------&lt;br /&gt;
      INTEGER, PARAMETER :: nb_kre = 6                ! Number of kre&lt;br /&gt;
      INTEGER, SAVE      :: rock                      ! Another variable&lt;br /&gt;
      LOGICAL,SAVE :: firstcall=.true.                ! Another variable&lt;br /&gt;
&lt;br /&gt;
c    Local variables :&lt;br /&gt;
c    -----------------&lt;br /&gt;
      REAL tabular(ngrid)                             ! Local var&lt;br /&gt;
      INTEGER i                                       ! Loop var&lt;br /&gt;
&lt;br /&gt;
c    Beginning of the code :&lt;br /&gt;
c    ----------------- &lt;br /&gt;
&lt;br /&gt;
      IF (firstcall) THEN&lt;br /&gt;
        ! identify where are the kre&lt;br /&gt;
        DO i=1,nb_kre&lt;br /&gt;
          kre(i)=i&lt;br /&gt;
          write(*,*) &amp;quot;the Kre &amp;quot;, i, &amp;quot;is behind the rock&amp;quot;&lt;br /&gt;
        ENDDO !end of the loop nb_kre&lt;br /&gt;
      ENDIF   !end firstcall&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE aquarium&lt;br /&gt;
&lt;br /&gt;
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE ini_aquarium(ngrid)&lt;br /&gt;
c=======================================================================&lt;br /&gt;
c   Initialise module's variable&lt;br /&gt;
c=======================================================================&lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
      INTEGER, INTENT(IN) :: ngrid&lt;br /&gt;
&lt;br /&gt;
      allocate(kre1(ngrid+1))&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE ini_aquarium&lt;br /&gt;
&lt;br /&gt;
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE end_aquarium&lt;br /&gt;
c=======================================================================&lt;br /&gt;
c   Deallocate module's variable&lt;br /&gt;
c=======================================================================&lt;br /&gt;
&lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
      IF (allocated(kre1)) deallocate(kre1)&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE end_aquarium&lt;br /&gt;
      &lt;br /&gt;
      END MODULE aquarium_mod&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to pass variable to subroutine (by argument or by module) ==&lt;br /&gt;
&lt;br /&gt;
Define when we should use argument and when to use modules&lt;br /&gt;
&lt;br /&gt;
== Naming variables convention ==&lt;br /&gt;
&lt;br /&gt;
What is the naming convention.&lt;br /&gt;
In vdifc_mod for exemple.&lt;br /&gt;
&lt;br /&gt;
== Loop index convention ==&lt;br /&gt;
&lt;br /&gt;
Index name for loops through:&lt;br /&gt;
* '''physical grid''' : ig (max ngrid)&lt;br /&gt;
* ''' vertical levels''' : l (max nlayer)&lt;br /&gt;
* '''tracer''' : iq (max nq)&lt;br /&gt;
* '''subslopes''' : islope (max nslope)&lt;br /&gt;
iaer=1,naerkind&lt;br /&gt;
&lt;br /&gt;
== Efficient loop coding ==&lt;br /&gt;
&lt;br /&gt;
The more outside loop should correcpond to the last index of an array.&lt;br /&gt;
&lt;br /&gt;
Example: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot;&amp;gt;&lt;br /&gt;
      DO l=1,nlayer&lt;br /&gt;
        DO ig=1,ngrid&lt;br /&gt;
          array(ig,l)=l*ig&lt;br /&gt;
        ENDDO&lt;br /&gt;
      ENDDO&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to use the Intent ==&lt;br /&gt;
&lt;br /&gt;
Argument of a function can come in 3 different way: IN, OUT, INOUT. &lt;br /&gt;
&lt;br /&gt;
== How to comment code ==&lt;br /&gt;
&lt;br /&gt;
* '''In english'''&lt;br /&gt;
* '''As much as possible'''&lt;br /&gt;
* '''Variable definition''' : explain what it is, the dimension, the units etc...&lt;br /&gt;
* '''Subroutine''' : Explain what it does, who wrote it, who modify it and why if it is a big change&lt;br /&gt;
* '''Loops''' : if the enddo is far away you can comment to which index it correspond to.&lt;br /&gt;
* '''Chapter your code''' : you can add section to your code to make it clearer.&lt;br /&gt;
&lt;br /&gt;
== General guide ==&lt;br /&gt;
&lt;br /&gt;
* Create .F90 instead of .F&lt;br /&gt;
* Delete unused argument in a function call if you see one&lt;br /&gt;
* Delete unused variables&lt;br /&gt;
* Choose meaningful names of variables&lt;br /&gt;
* Don't hesitate to comment at much as possible, a code is never too commented&lt;br /&gt;
* Delete unused commented code lines&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Guide_for_good_coding&amp;diff=1118</id>
		<title>Guide for good coding</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Guide_for_good_coding&amp;diff=1118"/>
				<updated>2023-01-05T10:38:26Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: /* How to create a new module/subroutine */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to create a new module/subroutine ==&lt;br /&gt;
&lt;br /&gt;
Subroutines should be integrated inside a module.&lt;br /&gt;
A good writing habit is to add the line &amp;quot;IMPLICIT NONE&amp;quot;, in the beginning of the module and subroutine.&lt;br /&gt;
&lt;br /&gt;
First you can define all the variable that belongs to the module and could be used at another place.&lt;br /&gt;
A good thing is also to create a subroutine that allocate and initialise module variables.&lt;br /&gt;
If the variable is only modified inside the module it should be taged as protected.&lt;br /&gt;
If the variable belongs only to the module it can be specified to be private.&lt;br /&gt;
&lt;br /&gt;
You can now start the definition of the subroutine.&lt;br /&gt;
Start by variable and function from other module if necessary.&lt;br /&gt;
Comment the purpose of the subroutine directly.&lt;br /&gt;
Declare the variables, first the one pass in arguments.&lt;br /&gt;
Use the intent to specify the status of the variable inside the subroutine.&lt;br /&gt;
Continue with the local and saved variables.&lt;br /&gt;
Then you can define local variables.&lt;br /&gt;
Remember to comment all of them, you can specify the dimension if the variable is an allocatable variable as well as the units and everything that seems appropriate.&lt;br /&gt;
&lt;br /&gt;
You can finally write the code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot; line&amp;gt;&lt;br /&gt;
      MODULE aquarium_mod&lt;br /&gt;
&lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
      INTEGER :: water     ! Define what is the variable, the dimension, units (°) etc...&lt;br /&gt;
      REAL,SAVE,ALLOCATABLE,DIMENSION(:) :: kre1      ! Another comment &lt;br /&gt;
&lt;br /&gt;
      CONTAINS&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE aquarium(kre, grass, other_things&lt;br /&gt;
     &amp;amp;   really_anything)&lt;br /&gt;
                                                         &lt;br /&gt;
      use another_module_mod, only: fct, variable&lt;br /&gt;
      &lt;br /&gt;
c=======================================================================&lt;br /&gt;
c   subject:&lt;br /&gt;
c   --------&lt;br /&gt;
c   What is the subroutine doing&lt;br /&gt;
c&lt;br /&gt;
c   author: Someone smart &lt;br /&gt;
c   ------&lt;br /&gt;
c   update: Someone smarter, march 2012:&lt;br /&gt;
c         - I change something here&lt;br /&gt;
c   &lt;br /&gt;
c=======================================================================&lt;br /&gt;
      &lt;br /&gt;
       IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
c-----------------------------------------------------------------------&lt;br /&gt;
c&lt;br /&gt;
c    Declarations :&lt;br /&gt;
c    --------------&lt;br /&gt;
c&lt;br /&gt;
c    Input/Output&lt;br /&gt;
c    ------------&lt;br /&gt;
&lt;br /&gt;
      REAL, INTENT(IN)    ::  something(ngrid,nlayer) ! 2D tabular used as an input only  (W/m^2)&lt;br /&gt;
      REAL, INTENT(OUT)   ::  kre(ngrid)              ! 1D tabular output by the subroutine  &lt;br /&gt;
      REAL, INTENT(INOUT) ::  grass(ngrid,nlayer)     ! Variable that is modified by the subroutine&lt;br /&gt;
                                                      ! it is an input and output&lt;br /&gt;
      LOGICAL,INTENT(IN)  ::  really_anything         ! Boolean variable  &lt;br /&gt;
&lt;br /&gt;
c    Local saved variables :&lt;br /&gt;
c    -----------------&lt;br /&gt;
      INTEGER, PARAMETER :: nb_kre = 6                ! Number of kre&lt;br /&gt;
      INTEGER, SAVE      :: rock                      ! Another variable&lt;br /&gt;
      LOGICAL,SAVE :: firstcall=.true.                ! Another variable&lt;br /&gt;
&lt;br /&gt;
c    Local variables :&lt;br /&gt;
c    -----------------&lt;br /&gt;
      REAL tabular(ngrid)                             ! Local var&lt;br /&gt;
      INTEGER i                                       ! Loop var&lt;br /&gt;
&lt;br /&gt;
c    Beginning of the code :&lt;br /&gt;
c    ----------------- &lt;br /&gt;
&lt;br /&gt;
      IF (firstcall) THEN&lt;br /&gt;
        ! identify where are the kre&lt;br /&gt;
        DO i=1,nb_kre&lt;br /&gt;
          kre(i)=i&lt;br /&gt;
          write(*,*) &amp;quot;the Kre &amp;quot;, i, &amp;quot;is behind the rock&amp;quot;&lt;br /&gt;
        ENDDO !end of the loop nb_kre&lt;br /&gt;
      ENDIF   !end firstcall&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE aquarium&lt;br /&gt;
&lt;br /&gt;
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE ini_aquarium(ngrid)&lt;br /&gt;
c=======================================================================&lt;br /&gt;
c   Initialise module's variable&lt;br /&gt;
c=======================================================================&lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
      INTEGER, INTENT(IN) :: ngrid&lt;br /&gt;
&lt;br /&gt;
      allocate(kre1(ngrid+1))&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE ini_aquarium&lt;br /&gt;
&lt;br /&gt;
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;br /&gt;
&lt;br /&gt;
      SUBROUTINE end_aquarium&lt;br /&gt;
c=======================================================================&lt;br /&gt;
c   Deallocate module s variable&lt;br /&gt;
c=======================================================================&lt;br /&gt;
&lt;br /&gt;
      IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
      IF (allocated(kre1)) deallocate(kre1)&lt;br /&gt;
&lt;br /&gt;
      END SUBROUTINE end_aquarium&lt;br /&gt;
      &lt;br /&gt;
      END MODULE aquarium_mod&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to pass variable to subroutine (by argument or by module) ==&lt;br /&gt;
&lt;br /&gt;
Define when we should use argument and when to use modules&lt;br /&gt;
&lt;br /&gt;
== Naming variables convention ==&lt;br /&gt;
&lt;br /&gt;
What is the naming convention.&lt;br /&gt;
In vdifc_mod for exemple.&lt;br /&gt;
&lt;br /&gt;
== Loop index convention ==&lt;br /&gt;
&lt;br /&gt;
Index name for loops through:&lt;br /&gt;
* '''physical grid''' : ig (max ngrid)&lt;br /&gt;
* ''' vertical levels''' : l (max nlayer)&lt;br /&gt;
* '''tracer''' : iq (max nq)&lt;br /&gt;
* '''subslopes''' : islope (max nslope)&lt;br /&gt;
iaer=1,naerkind&lt;br /&gt;
&lt;br /&gt;
== Efficient loop coding ==&lt;br /&gt;
&lt;br /&gt;
The more outside loop should correcpond to the last index of an array.&lt;br /&gt;
&lt;br /&gt;
Example: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot;&amp;gt;&lt;br /&gt;
      DO l=1,nlayer&lt;br /&gt;
        DO ig=1,ngrid&lt;br /&gt;
          array(ig,l)=l*ig&lt;br /&gt;
        ENDDO&lt;br /&gt;
      ENDDO&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to use the Intent ==&lt;br /&gt;
&lt;br /&gt;
Argument of a function can come in 3 different way: IN, OUT, INOUT. &lt;br /&gt;
&lt;br /&gt;
== How to comment code ==&lt;br /&gt;
&lt;br /&gt;
* '''In english'''&lt;br /&gt;
* '''As much as possible'''&lt;br /&gt;
* '''Variable definition''' : explain what it is, the dimension, the units etc...&lt;br /&gt;
* '''Subroutine''' : Explain what it does, who wrote it, who modify it and why if it is a big change&lt;br /&gt;
* '''Loops''' : if the enddo is far away you can comment to which index it correspond to.&lt;br /&gt;
* '''Chapter your code''' : you can add section to your code to make it clearer.&lt;br /&gt;
&lt;br /&gt;
== General guide ==&lt;br /&gt;
&lt;br /&gt;
* Create .F90 instead of .F&lt;br /&gt;
* Delete unused argument in a function call if you see one&lt;br /&gt;
* Delete unused variables&lt;br /&gt;
* Choose meaningful names of variables&lt;br /&gt;
* Don't hesitate to comment at much as possible, a code is never too commented&lt;br /&gt;
* Delete unused commented code lines&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Using_Irene_Rome&amp;diff=742</id>
		<title>Using Irene Rome</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Using_Irene_Rome&amp;diff=742"/>
				<updated>2022-09-02T09:43:30Z</updated>
		
		<summary type="html">&lt;p&gt;Abierjon: /* Some useful commands */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides a summary of examples and tools designed to help you get used with the Irene Rome environment. (as of July 2022)&lt;br /&gt;
&lt;br /&gt;
== How to access the cluster ==&lt;br /&gt;
&lt;br /&gt;
For people on the &amp;quot;Atmosphères Planétaires&amp;quot; GENCI project who need to open an account on Irene-Rome, here is the procedure:&lt;br /&gt;
&lt;br /&gt;
* Log on to https://www-dcc.extra.cea.fr/CCFR/ and provide various information about yourself &lt;br /&gt;
&lt;br /&gt;
A few tips:&lt;br /&gt;
&lt;br /&gt;
- chose TGCC&lt;br /&gt;
&lt;br /&gt;
- give your PROFESSIONAL phone number (and not your personal cell phone number)&lt;br /&gt;
&lt;br /&gt;
- name of the project: Atmosphères Planétaires  Numéro du Dossier: A0120110391&lt;br /&gt;
&lt;br /&gt;
- Responsable scientifique du projet: M. Ehouarn MILLOUR , ehouarn.millour@lmd.ipsl.fr, 0144275286, Nationalité: Fr&lt;br /&gt;
&lt;br /&gt;
- Responsable sécurité: M. Franck Guyon, franck.guyon@lmd.ipsl.fr, 0144275277, Nationalité: Fr&lt;br /&gt;
&lt;br /&gt;
- IPs &amp;amp; machine names to connect to Irene: 134.157.47.46 (hakim.lmd.jussieu.fr) and 134.157.176.129 (ciclad.ipsl.jussieu.fr)&lt;br /&gt;
&lt;br /&gt;
- Chose anything you want for the 8 character password&lt;br /&gt;
&lt;br /&gt;
* And then get Ehouarn to sign the form and forward it to Franck for him to sign as well.&lt;br /&gt;
&lt;br /&gt;
* Send the signed form to hotline.tgcc@cea.fr&lt;br /&gt;
&lt;br /&gt;
== Some useful commands ==&lt;br /&gt;
&lt;br /&gt;
* To access the disks of our project on Irene (&amp;quot;Atmosphères Planétaires&amp;quot; GENCI project), add the following line in your .bashrc file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
module switch dfldatadir/gen10391&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To access your work directory (to run your simulations)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /ccc/work/cont003/gen10391/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
you can also access the work directory with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $CCCWORKDIR&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To access your store directory (to store big data files)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /ccc/work/cont003/gen10391/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
you can also access the store directory with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd $CCCSTOREDIR&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To access Irene Interactive Documentation:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
machine.info&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: you can also access the online documentation here: http://www-hpc.cea.fr/tgcc-public/en/html/toc/fulldoc/Introduction.html&lt;br /&gt;
&lt;br /&gt;
* To display infos about project accounting:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_myproject &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To know about user and group disk quota&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_quota -a&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To know about how long your passwd will be active:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_password_expiration&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To change passwd:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
passwd&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example of a job to run a GCM simulation ==&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;
# Partition to run on:&lt;br /&gt;
#MSUB -q rome&lt;br /&gt;
# project to run on &lt;br /&gt;
#MSUB -A  gen10391&lt;br /&gt;
# disks to use&lt;br /&gt;
#MSUB -m  scratch,work,store&lt;br /&gt;
# Job name&lt;br /&gt;
#MSUB -r run_gcm&lt;br /&gt;
# Job standard output:&lt;br /&gt;
#MSUB -o run_gcm.%I&lt;br /&gt;
# Job standard error:&lt;br /&gt;
#MSUB -e run_gcm.%I&lt;br /&gt;
# number of OpenMP threads c&lt;br /&gt;
#MSUB -c 2&lt;br /&gt;
# number of MPI tasks n&lt;br /&gt;
#MSUB -n 16&lt;br /&gt;
# number of nodes to use N&lt;br /&gt;
#MSUB -N 1&lt;br /&gt;
# max job run time T (in seconds)&lt;br /&gt;
#MSUB -T 3600&lt;br /&gt;
# request exculsive use of the node (128 cores)&lt;br /&gt;
##MSUB -x&lt;br /&gt;
&lt;br /&gt;
source ../trunk/LMDZ.COMMON/arch.env&lt;br /&gt;
export OMP_STACKSIZE=400M&lt;br /&gt;
export OMP_NUM_THREADS=2&lt;br /&gt;
&lt;br /&gt;
ccc_mprun -l gcm_32x32x15_phystd_para.e &amp;gt; gcm.out 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* To launch the job script ''run_gcm.job'':&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_msub run_gcm.job&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To display information about your jobs:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_mpp -u $USER &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To kill job number ''jobid''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_mdel jobid&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* To display infos about project accounting:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_myproject&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Extra Tips ==&lt;br /&gt;
&lt;br /&gt;
*If you encounter a quota issue on Irene, first check:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccc_quota&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
if you have not reached your quota, this might be because your files/scripts do not have correct right access. To solve this,&lt;br /&gt;
use the following command on all your dirs:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod g+s NAME_OF_DIR&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== File transfert from Occigen ==&lt;br /&gt;
One should use ccfr:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
module load ccfr&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
A list of available machines is given by&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccfr_ssh -v&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
To log on to Occigen (from Irene):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccfr_ssh occigenlogin@cines&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To copy a file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccfr_cp occigenlogin@cines:remote_dir local_dir &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* How to transfer data from OCCIGEN to IRENE&lt;/div&gt;</summary>
		<author><name>Abierjon</name></author>	</entry>

	</feed>