<?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=Maxime+Maurice</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=Maxime+Maurice"/>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/Special:Contributions/Maxime_Maurice"/>
		<updated>2026-06-10T22:17:55Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.7</generator>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Radioactive_tracers&amp;diff=2880</id>
		<title>Radioactive tracers</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Radioactive_tracers&amp;diff=2880"/>
				<updated>2025-09-17T14:01:04Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page shows how to use radioactive tracers in the Generic PCM to tune the eddy mixing coefficient of 1D simulations in order to reproduce 3D dynamical mixing.&lt;br /&gt;
= Motivation =&lt;br /&gt;
The Generic PCM has both a 3D and a 1D version. While the 3D self-consistently solves for dynamical mixing of advected quantities (like temperature or tracers), this process can only be parametrized in 1D. This is done by approximating dynamical mixing by a diffusive process:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\partial q}{\partial t}=-K_{zz}\frac{\partial^2 q}{\partial z^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt; the tracer's mass mixing ratio, &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; time, &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; altitude, and &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt; &amp;lt;math&amp;lt;K_{zz}&amp;lt;/math&amp;gt; the vertical diffusion coefficient (in m/s²), also called &amp;quot;eddy mixing coefficient&amp;quot;. Notice that &amp;lt;math&amp;lt;K_{zz}&amp;lt;/math&amp;gt; is often given in CGS units (cm/s²) in the astrophysical community. This coefficient's value (or vertical profile) is tuned so that 1D abundance profiles match 3D averaged ones.&lt;br /&gt;
&lt;br /&gt;
Depending on the planetary setup, the value (or vertical profile) of &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt; that can best reproduce 3D mixing varies. If you want to tune the vertical eddy mixing coefficient to one of your 3D cases, you can run a simulation with radioactively decreasing abstract tracers in both 1D and 3D and compare the vertical distribution of these tracers once a steady-state is reached. In 3D, this distribution is the result of a competition between dynamical mixing which tends to homogenize the atmosphere, and radioactive decay which destroys the tracers with increasing probability with time after their injection. Injection is done from the surface or the top of the atmosphere. Depending on the location of injection, half-life of the tracers, and atmosphere dynamics, the steady-state profile vary.&lt;br /&gt;
&lt;br /&gt;
= Use =&lt;br /&gt;
In order to use radioactive tracers, you simply need to add them to the traceur.def file, and define their half-life as well as injection flux at each location. This is done by setting the flags corresponding to these values in the modern version of the traceur.def. In the Generic PCM deftank, the file '''traceur.def.radioactive''' gives an illustration of it, which 6 different tracers, each having half life of 1 day, 1 week or 1 month (normalized by the time of a Martian sol), injected by the surface or the top of the atmosphere:&lt;br /&gt;
&lt;br /&gt;
 r1   half_life=8.64e4    bot_prod=8e-6&lt;br /&gt;
 r2   half_life=6.048e5   bot_prod=1.15e-6&lt;br /&gt;
 r3   half_life=2.592e6   bot_prod=2.7e-7&lt;br /&gt;
 r4   half_life=8.64e4    top_prod=8e-6&lt;br /&gt;
 r5   half_life=6.048e5   top_prod=1.15e-6&lt;br /&gt;
 r6   half_life=2.592e6   top_prod=2.7e-7&lt;br /&gt;
&lt;br /&gt;
The tracers '''r1''' to '''r3''' are injected from the surface and tracers '''r4''' to '''r6''' are injected from the top of the atmosphere. The flux multiplied by the half-life is kept constant across tracers to keep the profiles comparable. Notice that if no other process affect these tracers (as it should be since these tracers are merely numerical tools and their decay does not aim at modelling any real physical process), the value of their abundance is arbitrary and only the shape of the profile matters.&lt;br /&gt;
&lt;br /&gt;
Below is an illustration of the steady-state distribution of these tracers in the early Mars atmosphere of the benchmark in 3D, and in 1D for three different values of &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt;. One sees that large &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt; overestimate vertical mixing and thus atmosphere homogenization, while low values underestimate it.&lt;br /&gt;
&lt;br /&gt;
[[File:Radioactive tracers.png|center|frame|Comparison of the vertical mixing between a 3D case and 3 1D simulations of early Mars atmosphere using different values of the eddy mixing coefficient.]]&lt;/div&gt;</summary>
		<author><name>Maxime Maurice</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Radioactive_tracers&amp;diff=2879</id>
		<title>Radioactive tracers</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Radioactive_tracers&amp;diff=2879"/>
				<updated>2025-09-17T14:00:27Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page shows how to use radioactive tracers in the Generic PCM to tune the eddy mixing coefficient of 1D simulations in order to reproduce 3D dynamical mixing.&lt;br /&gt;
= Motivation =&lt;br /&gt;
The Generic PCM has both a 3D and a 1D version. While the 3D self-consistently solves for dynamical mixing of advected quantities (like temperature or tracers), this process can only be parametrized in 1D. This is done by approximating dynamical mixing by a diffusive process:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\partial q}{\partial t}=-K_{zz}\frac{\partial^2 q}{\partial z^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt; the tracer's mass mixing ratio, &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; time, &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; altitude, and &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt; &amp;lt;math&amp;lt;K_{zz}&amp;lt;/math&amp;gt; the vertical diffusion coefficient (in m/s²), also called &amp;quot;eddy mixing coefficient&amp;quot;. Notice that &amp;lt;math&amp;lt;K_{zz}&amp;lt;/math&amp;gt; is often given in CGS units (cm/s²) in the astrophysical community. This coefficient's value (or vertical profile) is tuned so that 1D abundance profiles match 3D averaged ones.&lt;br /&gt;
&lt;br /&gt;
Depending on the planetary setup, the value (or vertical profile) of &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt; that can best reproduce 3D mixing varies. If you want to tune the vertical eddy mixing coefficient to one of your 3D cases, you can run a simulation with radioactively decreasing abstract tracers in both 1D and 3D and compare the vertical distribution of these tracers once a steady-state is reached. In 3D, this distribution is the result of a competition between dynamical mixing which tends to homogenize the atmosphere, and radioactive decay which destroys the tracers with increasing probability with time after their injection. Injection is done from the surface or the top of the atmosphere. Depending on the location of injection, half-life of the tracers, and atmosphere dynamics, the steady-state profile vary.&lt;br /&gt;
&lt;br /&gt;
= Use =&lt;br /&gt;
In order to use radioactive tracers, you simply need to add them to the traceur.def file, and define their half-life as well as injection flux at each location. This is done by setting the flags corresponding to these values in the modern version of the traceur.def. In the Generic PCM deftank, the file '''traceur.def.radioactive''' gives an illustration of it, which 6 different tracers, each having half life of 1 day, 1 week or 1 month (normalized by the time of a Martian sol), injected by the surface or the top of the atmosphere:&lt;br /&gt;
&lt;br /&gt;
 r1   half_life=8.64e4    bot_prod=8e-6&lt;br /&gt;
 r2   half_life=6.048e5   bot_prod=1.15e-6&lt;br /&gt;
 r3   half_life=2.592e6   bot_prod=2.7e-7&lt;br /&gt;
 r4   half_life=8.64e4    top_prod=8e-6&lt;br /&gt;
 r5   half_life=6.048e5   top_prod=1.15e-6&lt;br /&gt;
 r6   half_life=2.592e6   top_prod=2.7e-7&lt;br /&gt;
&lt;br /&gt;
The tracers '''r1''' to '''r3''' are injected from the surface and tracers '''r4''' to '''r6''' are injected from the top of the atmosphere. The flux multiplied by the half-life is kept constant across tracers to keep the profiles comparable. Notice that if no other process affect these tracers (as it should be since these tracers are merely numerical tools and their decay does not aim at modelling any real physical process), the value of their abundance is arbitrary and only the shape of the profile matters.&lt;br /&gt;
&lt;br /&gt;
Below is an illustration of the steady-state distribution of these tracers in the early Mars atmosphere of the benchmark in 3D, and in 1D for three different values of &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt;. One sees that large &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt; overestimate vertical mixing and thus atmosphere homogenization, while low values underestimate it.&lt;/div&gt;</summary>
		<author><name>Maxime Maurice</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=File:Radioactive_tracers.png&amp;diff=2878</id>
		<title>File:Radioactive tracers.png</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=File:Radioactive_tracers.png&amp;diff=2878"/>
				<updated>2025-09-17T13:59:21Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: Maxime Maurice uploaded a new version of File:Radioactive tracers.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Comparison of vertical mixing between a 3D case and 3 1D simulations of early Mars using different eddy mixing coefficients.&lt;/div&gt;</summary>
		<author><name>Maxime Maurice</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Radioactive_tracers&amp;diff=2877</id>
		<title>Radioactive tracers</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Radioactive_tracers&amp;diff=2877"/>
				<updated>2025-09-17T13:58:30Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page shows how to use radioactive tracers in the Generic PCM to tune the eddy mixing coefficient of 1D simulations in order to reproduce 3D dynamical mixing.&lt;br /&gt;
= Motivation =&lt;br /&gt;
The Generic PCM has both a 3D and a 1D version. While the 3D self-consistently solves for dynamical mixing of advected quantities (like temperature or tracers), this process can only be parametrized in 1D. This is done by approximating dynamical mixing by a diffusive process:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\partial q}{\partial t}=-K_{zz}\frac{\partial^2 q}{\partial z^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt; the tracer's mass mixing ratio, &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; time, &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; altitude, and &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt; &amp;lt;math&amp;lt;K_{zz}&amp;lt;/math&amp;gt; the vertical diffusion coefficient (in m/s²), also called &amp;quot;eddy mixing coefficient&amp;quot;. Notice that &amp;lt;math&amp;lt;K_{zz}&amp;lt;/math&amp;gt; is often given in CGS units (cm/s²) in the astrophysical community. This coefficient's value (or vertical profile) is tuned so that 1D abundance profiles match 3D averaged ones.&lt;br /&gt;
&lt;br /&gt;
Depending on the planetary setup, the value (or vertical profile) of &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt; that can best reproduce 3D mixing varies. If you want to tune the vertical eddy mixing coefficient to one of your 3D cases, you can run a simulation with radioactively decreasing abstract tracers in both 1D and 3D and compare the vertical distribution of these tracers once a steady-state is reached. In 3D, this distribution is the result of a competition between dynamical mixing which tends to homogenize the atmosphere, and radioactive decay which destroys the tracers with increasing probability with time after their injection. Injection is done from the surface or the top of the atmosphere. Depending on the location of injection, half-life of the tracers, and atmosphere dynamics, the steady-state profile vary.&lt;br /&gt;
&lt;br /&gt;
= Use =&lt;br /&gt;
In order to use radioactive tracers, you simply need to add them to the traceur.def file, and define their half-life as well as injection flux at each location. This is done by setting the flags corresponding to these values in the modern version of the traceur.def. In the Generic PCM deftank, the file '''traceur.def.radioactive''' gives an illustration of it, which 6 different tracers, each having half life of 1 day, 1 week or 1 month (normalized by the time of a Martian sol), injected by the surface or the top of the atmosphere:&lt;br /&gt;
&lt;br /&gt;
 r1   half_life=8.64e4    bot_prod=8e-6&lt;br /&gt;
 r2   half_life=6.048e5   bot_prod=1.15e-6&lt;br /&gt;
 r3   half_life=2.592e6   bot_prod=2.7e-7&lt;br /&gt;
 r4   half_life=8.64e4    top_prod=8e-6&lt;br /&gt;
 r5   half_life=6.048e5   top_prod=1.15e-6&lt;br /&gt;
 r6   half_life=2.592e6   top_prod=2.7e-7&lt;br /&gt;
&lt;br /&gt;
The tracers '''r1''' to '''r3''' are injected from the surface and tracers '''r4''' to '''r6''' are injected from the top of the atmosphere. The flux multiplied by the half-life is kept constant across tracers to keep the profiles comparable. Notice that if no other process affect these tracers (as it should be since these tracers are merely numerical tools and their decay does not aim at modelling any real physical process), the value of their abundance is arbitrary and only the shape of the profile matters.&lt;br /&gt;
&lt;br /&gt;
Below is an illustration of the steady-state distribution of these tracers in the early Mars atmosphere of the benchmark in 3D, and in 1D for three different values of &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt;. One sees that large &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt; overestimate vertical mixing and thus atmosphere homogenization, while low values underestimate it.&lt;br /&gt;
&lt;br /&gt;
[[File:Radioactive tracers.png|center|frame|Comparison of the vertical mixing between a 3D case and 3 1D simulations of early Mars atmosphere using different values of the eddy mixing coefficient.]]&lt;/div&gt;</summary>
		<author><name>Maxime Maurice</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Radioactive_tracers&amp;diff=2876</id>
		<title>Radioactive tracers</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Radioactive_tracers&amp;diff=2876"/>
				<updated>2025-09-17T13:58:06Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page shows how to use radioactive tracers in the Generic PCM to tune the eddy mixing coefficient of 1D simulations in order to reproduce 3D dynamical mixing.&lt;br /&gt;
= Motivation =&lt;br /&gt;
The Generic PCM has both a 3D and a 1D version. While the 3D self-consistently solves for dynamical mixing of advected quantities (like temperature or tracers), this process can only be parametrized in 1D. This is done by approximating dynamical mixing by a diffusive process:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\partial q}{\partial t}=-K_{zz}\frac{\partial^2 q}{\partial z^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt; the tracer's mass mixing ratio, &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; time, &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; altitude, and &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt; &amp;lt;math&amp;lt;K_{zz}&amp;lt;/math&amp;gt; the vertical diffusion coefficient (in m/s²), also called &amp;quot;eddy mixing coefficient&amp;quot;. Notice that &amp;lt;math&amp;lt;K_{zz}&amp;lt;/math&amp;gt; is often given in CGS units (cm/s²) in the astrophysical community. This coefficient's value (or vertical profile) is tuned so that 1D abundance profiles match 3D averaged ones.&lt;br /&gt;
&lt;br /&gt;
Depending on the planetary setup, the value (or vertical profile) of &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt; that can best reproduce 3D mixing varies. If you want to tune the vertical eddy mixing coefficient to one of your 3D cases, you can run a simulation with radioactively decreasing abstract tracers in both 1D and 3D and compare the vertical distribution of these tracers once a steady-state is reached. In 3D, this distribution is the result of a competition between dynamical mixing which tends to homogenize the atmosphere, and radioactive decay which destroys the tracers with increasing probability with time after their injection. Injection is done from the surface or the top of the atmosphere. Depending on the location of injection, half-life of the tracers, and atmosphere dynamics, the steady-state profile vary.&lt;br /&gt;
&lt;br /&gt;
= Use =&lt;br /&gt;
In order to use radioactive tracers, you simply need to add them to the traceur.def file, and define their half-life as well as injection flux at each location. This is done by setting the flags corresponding to these values in the modern version of the traceur.def. In the Generic PCM deftank, the file '''traceur.def.radioactive''' gives an illustration of it, which 6 different tracers, each having half life of 1 day, 1 week or 1 month (normalized by the time of a Martian sol), injected by the surface or the top of the atmosphere:&lt;br /&gt;
&lt;br /&gt;
 r1   half_life=8.64e4    bot_prod=8e-6&lt;br /&gt;
 r2   half_life=6.048e5   bot_prod=1.15e-6&lt;br /&gt;
 r3   half_life=2.592e6   bot_prod=2.7e-7&lt;br /&gt;
 r4   half_life=8.64e4    top_prod=8e-6&lt;br /&gt;
 r5   half_life=6.048e5   top_prod=1.15e-6&lt;br /&gt;
 r6   half_life=2.592e6   top_prod=2.7e-7&lt;br /&gt;
&lt;br /&gt;
The tracers '''r1''' to '''r3''' are injected from the surface and tracers '''r4''' to '''r6''' are injected from the top of the atmosphere. The flux multiplied by the half-life is kept constant across tracers to keep the profiles comparable. Notice that if no other process affect these tracers (as it should be since these tracers are merely numerical tools and their decay does not aim at modelling any real physical process), the value of their abundance is arbitrary and only the shape of the profile matters.&lt;br /&gt;
&lt;br /&gt;
Below is an illustration of the steady-state distribution of these tracers in the early Mars atmosphere of the benchmark in 3D, and in 1D for three different values of &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt;. One sees that large &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt; overestimate vertical mixing and thus atmosphere homogenization, while low values underestimate it.&lt;/div&gt;</summary>
		<author><name>Maxime Maurice</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Radioactive_tracers&amp;diff=2875</id>
		<title>Radioactive tracers</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Radioactive_tracers&amp;diff=2875"/>
				<updated>2025-09-17T13:55:16Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page shows how to use radioactive tracers in the Generic PCM to tune the eddy mixing coefficient of 1D simulations in order to reproduce 3D dynamical mixing.&lt;br /&gt;
= Motivation =&lt;br /&gt;
The Generic PCM has both a 3D and a 1D version. While the 3D self-consistently solves for dynamical mixing of advected quantities (like temperature or tracers), this process can only be parametrized in 1D. This is done by approximating dynamical mixing by a diffusive process:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\partial q}{\partial t}=-K_{zz}\frac{\partial^2 q}{\partial z^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt; the tracer's mass mixing ratio, &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; time, &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; altitude, and &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt; &amp;lt;math&amp;lt;K_{zz}&amp;lt;/math&amp;gt; the vertical diffusion coefficient (in m/s²), also called &amp;quot;eddy mixing coefficient&amp;quot;. Notice that &amp;lt;math&amp;lt;K_{zz}&amp;lt;/math&amp;gt; is often given in CGS units (cm/s²) in the astrophysical community. This coefficient's value (or vertical profile) is tuned so that 1D abundance profiles match 3D averaged ones.&lt;br /&gt;
&lt;br /&gt;
Depending on the planetary setup, the value (or vertical profile) of &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt; that can best reproduce 3D mixing varies. If you want to tune the vertical eddy mixing coefficient to one of your 3D cases, you can run a simulation with radioactively decreasing abstract tracers in both 1D and 3D and compare the vertical distribution of these tracers once a steady-state is reached. In 3D, this distribution is the result of a competition between dynamical mixing which tends to homogenize the atmosphere, and radioactive decay which destroys the tracers with increasing probability with time after their injection. Injection is done from the surface or the top of the atmosphere. Depending on the location of injection, half-life of the tracers, and atmosphere dynamics, the steady-state profile vary.&lt;br /&gt;
&lt;br /&gt;
= Use =&lt;br /&gt;
In order to use radioactive tracers, you simply need to add them to the traceur.def file, and define their half-life as well as injection flux at each location. This is done by setting the flags corresponding to these values in the modern version of the traceur.def. In the Generic PCM deftank, the file '''traceur.def.radioactive''' gives an illustration of it, which 6 different tracers, each having half life of 1 day, 1 week or 1 month (normalized by the time of a Martian sol), injected by the surface or the top of the atmosphere:&lt;br /&gt;
&lt;br /&gt;
 r1   half_life=8.64e4    bot_prod=8e-6&lt;br /&gt;
 r2   half_life=6.048e5   bot_prod=1.15e-6&lt;br /&gt;
 r3   half_life=2.592e6   bot_prod=2.7e-7&lt;br /&gt;
 r4   half_life=8.64e4    top_prod=8e-6&lt;br /&gt;
 r5   half_life=6.048e5   top_prod=1.15e-6&lt;br /&gt;
 r6   half_life=2.592e6   top_prod=2.7e-7&lt;br /&gt;
&lt;br /&gt;
The tracers '''r1''' to '''r3''' are injected from the surface and tracers '''r4''' to '''r6''' are injected from the top of the atmosphere. The flux multiplied by the half-life is kept constant across tracers to keep the profiles comparable. Notice that if no other process affect these tracers (as it should be since these tracers are merely numerical tools and their decay does not aim at modelling any real physical process), the value of their abundance is arbitrary and only the shape of the profile matters.&lt;br /&gt;
&lt;br /&gt;
Below is an illustration of the steady-state distribution of these tracers in the early Mars atmosphere of the benchmark in 3D, and in 1D for three different values of &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt;. One sees that large &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt; overestimate vertical mixing and thus atmosphere homogenization, while low values underestimate it.&lt;br /&gt;
&lt;br /&gt;
[[File:Radioactive tracers.png|center|frame|Comparison of the vertical mixing between a 3D case and 3 1D simulations of early Mars atmosphere using different values of the eddy mixing coefficient.]]&lt;/div&gt;</summary>
		<author><name>Maxime Maurice</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=File:Radioactive_tracers.png&amp;diff=2874</id>
		<title>File:Radioactive tracers.png</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=File:Radioactive_tracers.png&amp;diff=2874"/>
				<updated>2025-09-17T13:54:22Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: Maxime Maurice uploaded a new version of File:Radioactive tracers.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Comparison of vertical mixing between a 3D case and 3 1D simulations of early Mars using different eddy mixing coefficients.&lt;/div&gt;</summary>
		<author><name>Maxime Maurice</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Radioactive_tracers&amp;diff=2873</id>
		<title>Radioactive tracers</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Radioactive_tracers&amp;diff=2873"/>
				<updated>2025-09-17T13:52:45Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page shows how to use radioactive tracers in the Generic PCM to tune the eddy mixing coefficient of 1D simulations in order to reproduce 3D dynamical mixing.&lt;br /&gt;
= Motivation =&lt;br /&gt;
The Generic PCM has both a 3D and a 1D version. While the 3D self-consistently solves for dynamical mixing of advected quantities (like temperature or tracers), this process can only be parametrized in 1D. This is done by approximating dynamical mixing by a diffusive process:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\partial q}{\partial t}=-K_{zz}\frac{\partial^2 q}{\partial z^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt; the tracer's mass mixing ratio, &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; time, &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; altitude, and &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt; &amp;lt;math&amp;lt;K_{zz}&amp;lt;/math&amp;gt; the vertical diffusion coefficient (in m/s²), also called &amp;quot;eddy mixing coefficient&amp;quot;. Notice that &amp;lt;math&amp;lt;K_{zz}&amp;lt;/math&amp;gt; is often given in CGS units (cm/s²) in the astrophysical community. This coefficient's value (or vertical profile) is tuned so that 1D abundance profiles match 3D averaged ones.&lt;br /&gt;
&lt;br /&gt;
Depending on the planetary setup, the value (or vertical profile) of &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt; that can best reproduce 3D mixing varies. If you want to tune the vertical eddy mixing coefficient to one of your 3D cases, you can run a simulation with radioactively decreasing abstract tracers in both 1D and 3D and compare the vertical distribution of these tracers once a steady-state is reached. In 3D, this distribution is the result of a competition between dynamical mixing which tends to homogenize the atmosphere, and radioactive decay which destroys the tracers with increasing probability with time after their injection. Injection is done from the surface or the top of the atmosphere. Depending on the location of injection, half-life of the tracers, and atmosphere dynamics, the steady-state profile vary.&lt;br /&gt;
&lt;br /&gt;
= Use =&lt;br /&gt;
In order to use radioactive tracers, you simply need to add them to the traceur.def file, and define their half-life as well as injection flux at each location. This is done by setting the flags corresponding to these values in the modern version of the traceur.def. In the Generic PCM deftank, the file '''traceur.def.radioactive''' gives an illustration of it, which 6 different tracers, each having half life of 1 day, 1 week or 1 month (normalized by the time of a Martian sol), injected by the surface or the top of the atmosphere:&lt;br /&gt;
&lt;br /&gt;
 r1   half_life=8.64e4    bot_prod=8e-6&lt;br /&gt;
 r2   half_life=6.048e5   bot_prod=1.15e-6&lt;br /&gt;
 r3   half_life=2.592e6   bot_prod=2.7e-7&lt;br /&gt;
 r4   half_life=8.64e4    top_prod=8e-6&lt;br /&gt;
 r5   half_life=6.048e5   top_prod=1.15e-6&lt;br /&gt;
 r6   half_life=2.592e6   top_prod=2.7e-7&lt;br /&gt;
&lt;br /&gt;
The tracers '''r1''' to '''r3''' are injected from the surface and tracers '''r4''' to '''r6''' are injected from the top of the atmosphere. The flux multiplied by the half-life is kept constant across tracers to keep the profiles comparable. Notice that if no other process affect these tracers (as it should be since these tracers are merely numerical tools and their decay does not aim at modelling any real physical process), the value of their abundance is arbitrary and only the shape of the profile matters.&lt;br /&gt;
&lt;br /&gt;
Below is an illustration of the steady-state distribution of these tracers in the early Mars atmosphere of the benchmark in 3D, and in 1D for three different values of &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt;. One sees that large &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt; overestimate vertical mixing and thus atmosphere homogenization, while low values underestimate it.&lt;br /&gt;
&lt;br /&gt;
[[File:radioactive_tracers.png|center|frame|Comparison of the vertical mixing between a 3D case and 3 1D simulations of early Mars atmosphere using different values of the eddy mixing coefficient.]]&lt;/div&gt;</summary>
		<author><name>Maxime Maurice</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=File:Radioactive_tracers.png&amp;diff=2872</id>
		<title>File:Radioactive tracers.png</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=File:Radioactive_tracers.png&amp;diff=2872"/>
				<updated>2025-09-17T13:50:33Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: Maxime Maurice uploaded a new version of File:Radioactive tracers.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Comparison of vertical mixing between a 3D case and 3 1D simulations of early Mars using different eddy mixing coefficients.&lt;/div&gt;</summary>
		<author><name>Maxime Maurice</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Physics_of_the_Generic_PCM&amp;diff=2739</id>
		<title>Physics of the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Physics_of_the_Generic_PCM&amp;diff=2739"/>
				<updated>2025-05-02T06:34:54Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: /* CO2 condensation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the various physical parametrizations of the Generic PCM and the chronology of their call through the physical iteration. This chronology is important because some variables need to be updated by certain processes before others (examples).   &lt;br /&gt;
During one physical iteration, the code passes through multiple sub-routines each encapsulating a parametrization. The sub-routines usually take as arguments:&lt;br /&gt;
*the dynamical values of the state variables&lt;br /&gt;
*the dynamical tendencies of the state variables&lt;br /&gt;
*any additional relevant variable&lt;br /&gt;
*any additional relevant tendency&lt;br /&gt;
and it returns in general tendencies (of the state variables as well as of any other relevant variable).&lt;br /&gt;
&lt;br /&gt;
Work in progress. Need to add links.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Initialization=&lt;br /&gt;
==First call==&lt;br /&gt;
Some initializations only need to be done at the very first iteration (e.g. examples).&lt;br /&gt;
==Each call==&lt;br /&gt;
Some other initializations need to be done at each iteration (e.g. examples).&lt;br /&gt;
&lt;br /&gt;
=Radiative transfer=&lt;br /&gt;
==Correlated-k==&lt;br /&gt;
The main radiative transfer solver of the Generic PCM implements the correlated-k method, which provides a flexible and quick way to solve radiative transfer equations, particularly suited for GCMs. More informations here.&lt;br /&gt;
==Newtonian relaxation==&lt;br /&gt;
Newton was a very relaxed physicist, still inspiring us today.&lt;br /&gt;
==No atmosphere==&lt;br /&gt;
If you have no atmosphere, why do you need a GCM?&lt;br /&gt;
&lt;br /&gt;
=Vertical diffusion=&lt;br /&gt;
Compute the vertical diffusion due to turbulence in the planetary boundary layer&lt;br /&gt;
==vdifc==&lt;br /&gt;
The &amp;quot;old&amp;quot; vertical diffusion routine.&lt;br /&gt;
==turbdiff==&lt;br /&gt;
The new (and improved!) vertical diffusion routine&lt;br /&gt;
&lt;br /&gt;
=Convection=&lt;br /&gt;
&lt;br /&gt;
Convective mixing in an atmosphere column involves non-resolved, sub-grid processes. To treat convectively unstable regions, there are two mutually exclusive options (convadj.F90 and thermcell_mod.F90). These processes are parameterized using the following routines:&lt;br /&gt;
&lt;br /&gt;
==Dry convection (convadj.F90)==&lt;br /&gt;
&lt;br /&gt;
This is the simplest and most robust parametrization for dry convective adjustment without free parameters. More info [[Convective_adjustment_scheme_in_the_generic_PCM|here]].&lt;br /&gt;
&lt;br /&gt;
==Thermal plume (thermcell_mod.F90)==&lt;br /&gt;
This module implements a more accurate and sophisticated parametrization of convection, although it involves several free parameters that need to be tuned for each planet. More info [[Thermal_plume_model_Generic_PCM|here]].&lt;br /&gt;
&lt;br /&gt;
==Non-orographic gravity waves:  (''nonoro_gwd_ran_mod.F90'') ==&lt;br /&gt;
&lt;br /&gt;
Parametrization of the momentum flux deposition due to a discrete number of gravity waves randomly generated by setting their waves characteristics (set as Gaussian distribution).  &lt;br /&gt;
&lt;br /&gt;
More info [[Non orographic gravity waves drag|here]].&lt;br /&gt;
&lt;br /&gt;
=CO2 condensation (condense_co2.F90)=&lt;br /&gt;
Inheriting from the Mars PCM where it is the background species, CO2 condensation is treated as a dedicated step in the Generic PCM's physics. Notice that it only concerns CO2 as a background gas. More info [[CO2_Condensation_(Generic_PCM)|here]].&lt;br /&gt;
&lt;br /&gt;
=Tracers=&lt;br /&gt;
Many things can be advected by tracers in the Generic PCM, like chemical species or aerosols. Physical processes involving tracers are parameterized using the following routines:&lt;br /&gt;
&lt;br /&gt;
==Volcano==&lt;br /&gt;
This routine parameterizes a source of tracers corresponding to volcanic eruption. More information here.&lt;br /&gt;
&lt;br /&gt;
==Water/ice==&lt;br /&gt;
Water aerosols (liquid or solid) are created (resp. consumed) by condensation (resp. vaporization or sublimation), consuming (resp. releasing) latent heat in the atmosphere. In the Generic PCM, the (atmospheric part of the) water cycle is handled by various routines, as explained here.&lt;br /&gt;
&lt;br /&gt;
==Photochemistry==&lt;br /&gt;
Chemistry can turn molecules into other molecules, by the action of temperature (thermochemistry) or UV light (photochemistry). This is handled by the photochemistry routine, described [[Photochemistry_of_the_Generic_PCM|here]].&lt;br /&gt;
&lt;br /&gt;
==Generic condensation==&lt;br /&gt;
On Earth, only water condenses in the atmosphere, but on other planets (which the Generic PCM aims at simulating), many other chemicals can undergo state change. To take that into account, the Generic PCM has a flexible scheme to deal with any arbitrary species, as desbribed [[Radiative_Generic_Condensable_Specie|here]].&lt;br /&gt;
&lt;br /&gt;
==Sedimentation==&lt;br /&gt;
What goes up must come down, as explained [[Sedimentation_of_tracers_in_the_generic_PCM|here]].&lt;br /&gt;
&lt;br /&gt;
==Updates==&lt;br /&gt;
This section essentially takes care that the condensation of a major species (e.g. water vapor in steam-rich atmospheres) affects other species, as described here.&lt;br /&gt;
&lt;br /&gt;
==Slab ocean==&lt;br /&gt;
This routine solves for big fish eating small fish, as described [[Slab_ocean_model|here]].&lt;br /&gt;
&lt;br /&gt;
==Surface==&lt;br /&gt;
The surface part of the water cycle is handled here, as the hydrology page describes.&lt;br /&gt;
&lt;br /&gt;
=Heat Conduction in the Subsurface=&lt;br /&gt;
The conduction of heat in the subsurface is solved as described [[Soil_Thermal_Conduction_in_the_Generic_PCM|here]].&lt;br /&gt;
&lt;br /&gt;
=Diagnostics/write outputs=&lt;br /&gt;
Nothing very physical here, just writting the outputs! By the way, if you want to know how to output new variables in the [[diagfi.nc]] or [[XIOS]] file, check out [[Outputs|this page]].&lt;/div&gt;</summary>
		<author><name>Maxime Maurice</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Physics_of_the_Generic_PCM&amp;diff=2737</id>
		<title>Physics of the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Physics_of_the_Generic_PCM&amp;diff=2737"/>
				<updated>2025-04-30T16:29:47Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: /* CO2 condensation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the various physical parametrizations of the Generic PCM and the chronology of their call through the physical iteration. This chronology is important because some variables need to be updated by certain processes before others (examples).   &lt;br /&gt;
During one physical iteration, the code passes through multiple sub-routines each encapsulating a parametrization. The sub-routines usually take as arguments:&lt;br /&gt;
*the dynamical values of the state variables&lt;br /&gt;
*the dynamical tendencies of the state variables&lt;br /&gt;
*any additional relevant variable&lt;br /&gt;
*any additional relevant tendency&lt;br /&gt;
and it returns in general tendencies (of the state variables as well as of any other relevant variable).&lt;br /&gt;
&lt;br /&gt;
Work in progress. Need to add links.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Initialization=&lt;br /&gt;
==First call==&lt;br /&gt;
Some initializations only need to be done at the very first iteration (e.g. examples).&lt;br /&gt;
==Each call==&lt;br /&gt;
Some other initializations need to be done at each iteration (e.g. examples).&lt;br /&gt;
&lt;br /&gt;
=Radiative transfer=&lt;br /&gt;
==Correlated-k==&lt;br /&gt;
The main radiative transfer solver of the Generic PCM implements the correlated-k method, which provides a flexible and quick way to solve radiative transfer equations, particularly suited for GCMs. More informations here.&lt;br /&gt;
==Newtonian relaxation==&lt;br /&gt;
Newton was a very relaxed physicist, still inspiring us today.&lt;br /&gt;
==No atmosphere==&lt;br /&gt;
If you have no atmosphere, why do you need a GCM?&lt;br /&gt;
&lt;br /&gt;
=Vertical diffusion=&lt;br /&gt;
Compute the vertical diffusion due to turbulence in the planetary boundary layer&lt;br /&gt;
==vdifc==&lt;br /&gt;
The &amp;quot;old&amp;quot; vertical diffusion routine.&lt;br /&gt;
==turbdiff==&lt;br /&gt;
The new (and improved!) vertical diffusion routine&lt;br /&gt;
&lt;br /&gt;
=Convection=&lt;br /&gt;
&lt;br /&gt;
Convective mixing in an atmosphere column involves non-resolved, sub-grid processes. To treat convectively unstable regions, there are two mutually exclusive options (convadj.F90 and thermcell_mod.F90). These processes are parameterized using the following routines:&lt;br /&gt;
&lt;br /&gt;
==Dry convection (convadj.F90)==&lt;br /&gt;
&lt;br /&gt;
This is the simplest and most robust parametrization for dry convective adjustment without free parameters. More info [[Convective_adjustment_scheme_in_the_generic_PCM|here]].&lt;br /&gt;
&lt;br /&gt;
==Thermal plume (thermcell_mod.F90)==&lt;br /&gt;
This module implements a more accurate and sophisticated parametrization of convection, although it involves several free parameters that need to be tuned for each planet. More info [[Thermal_plume_model_Generic_PCM|here]].&lt;br /&gt;
&lt;br /&gt;
==Non-orographic gravity waves:  (''nonoro_gwd_ran_mod.F90'') ==&lt;br /&gt;
&lt;br /&gt;
Parametrization of the momentum flux deposition due to a discrete number of gravity waves randomly generated by setting their waves characteristics (set as Gaussian distribution).  &lt;br /&gt;
&lt;br /&gt;
More info [[Non orographic gravity waves drag|here]].&lt;br /&gt;
&lt;br /&gt;
=CO2 condensation=&lt;br /&gt;
Inheriting from the Mars PCM where it is the background species, CO2 condensation is treated as a dedicated step in the Generic PCM's physics. Notice that it only concerns CO2 as a background gas. More info [[CO2_Condensation_(Generic_PCM)|here]].&lt;br /&gt;
&lt;br /&gt;
=Tracers=&lt;br /&gt;
Many things can be advected by tracers in the Generic PCM, like chemical species or aerosols. Physical processes involving tracers are parameterized using the following routines:&lt;br /&gt;
&lt;br /&gt;
==Volcano==&lt;br /&gt;
This routine parameterizes a source of tracers corresponding to volcanic eruption. More information here.&lt;br /&gt;
&lt;br /&gt;
==Water/ice==&lt;br /&gt;
Water aerosols (liquid or solid) are created (resp. consumed) by condensation (resp. vaporization or sublimation), consuming (resp. releasing) latent heat in the atmosphere. In the Generic PCM, the (atmospheric part of the) water cycle is handled by various routines, as explained here.&lt;br /&gt;
&lt;br /&gt;
==Photochemistry==&lt;br /&gt;
Chemistry can turn molecules into other molecules, by the action of temperature (thermochemistry) or UV light (photochemistry). This is handled by the photochemistry routine, described [[Photochemistry_of_the_Generic_PCM|here]].&lt;br /&gt;
&lt;br /&gt;
==Generic condensation==&lt;br /&gt;
On Earth, only water condenses in the atmosphere, but on other planets (which the Generic PCM aims at simulating), many other chemicals can undergo state change. To take that into account, the Generic PCM has a flexible scheme to deal with any arbitrary species, as desbribed [[Radiative_Generic_Condensable_Specie|here]].&lt;br /&gt;
&lt;br /&gt;
==Sedimentation==&lt;br /&gt;
What goes up must come down, as explained [[Sedimentation_of_tracers_in_the_generic_PCM|here]].&lt;br /&gt;
&lt;br /&gt;
==Updates==&lt;br /&gt;
This section essentially takes care that the condensation of a major species (e.g. water vapor in steam-rich atmospheres) affects other species, as described here.&lt;br /&gt;
&lt;br /&gt;
==Slab ocean==&lt;br /&gt;
This routine solves for big fish eating small fish, as described [[Slab_ocean_model|here]].&lt;br /&gt;
&lt;br /&gt;
==Surface==&lt;br /&gt;
The surface part of the water cycle is handled here, as the hydrology page describes.&lt;br /&gt;
&lt;br /&gt;
=Heat Conduction in the Subsurface=&lt;br /&gt;
The conduction of heat in the subsurface is solved as described [[Soil_Thermal_Conduction_in_the_Generic_PCM|here]].&lt;br /&gt;
&lt;br /&gt;
=Diagnostics/write outputs=&lt;br /&gt;
Nothing very physical here, just writting the outputs! By the way, if you want to know how to output new variables in the [[diagfi.nc]] or [[XIOS]] file, check out [[Outputs|this page]].&lt;/div&gt;</summary>
		<author><name>Maxime Maurice</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=CO2_Condensation_(Generic_PCM)&amp;diff=2736</id>
		<title>CO2 Condensation (Generic PCM)</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=CO2_Condensation_(Generic_PCM)&amp;diff=2736"/>
				<updated>2025-04-30T16:28:09Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: Created page with &amp;quot;This page describes the condense_co2 routine of the Generic PCM. This routine, inherited from the Mars PCM, only works for atmosphere where CO2 is the background, dominant gas...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the condense_co2 routine of the Generic PCM. This routine, inherited from the Mars PCM, only works for atmosphere where CO2 is the background, dominant gas. If CO2 is a trace, variable gas, you should use the [[Radiative_Generic_Condensable_Specie|generic condensation scheme]].&lt;br /&gt;
&lt;br /&gt;
= Nucleation and Condensation of CO2 =&lt;br /&gt;
The condensation and nucleation temperature are calculated using Fanale's formula (subroutines '''get_tcond_co2''' and '''get_tnuc_co2'''):&lt;br /&gt;
\begin{equation}&lt;br /&gt;
	T_{\rm cond}=&lt;br /&gt;
        \begin{cases}&lt;br /&gt;
                     \frac{-3167.8}{\log(0.01\times P)-23.23}    &amp;amp; {\rm if }P&amp;lt;P_{\rm triple}=518000~{\rm Pa}\\&lt;br /&gt;
                     684.2-92.3\times\log(P)+4.32\times\log(P)^2 &amp;amp; {\rm otherwise}&lt;br /&gt;
        \end{cases}&lt;br /&gt;
\end{equation}&lt;br /&gt;
At the moment, we consider $$T_{\rm nuc}=T_{\rm cond}$$.&lt;br /&gt;
&lt;br /&gt;
= In the atmosphere =&lt;br /&gt;
&lt;br /&gt;
The routine iterates condensation and sedimentation in the atmosphere column over 20 subtimesteps. It computes:&lt;br /&gt;
&lt;br /&gt;
== Sedimentation of CO2 aerosols ==&lt;br /&gt;
&lt;br /&gt;
Using the subroutines '''co2_reffrad''' for the aerosols particles radius, the Stokes velocity is calculated with subroutine '''stokes''' and the tracers are updated using subroutine '''vlz_fi'''.&lt;br /&gt;
&lt;br /&gt;
== Condensation and sublimation of CO2 in the atmosphere ==&lt;br /&gt;
If the local temperature is below the nucleation temperature or CO2 ice is present, condensation / sublimation tendencies for CO2 tracers (ice and gas) as well as temperature (via latent heat effect) are calculated.&lt;br /&gt;
&lt;br /&gt;
= On the ground =&lt;br /&gt;
&lt;br /&gt;
== Condensation and sublimation on the ground ==&lt;br /&gt;
Surface tracer and temperature tendencies due to condensation or sublimation at the surface as well as CO2 ice accumulation on the ground due to icefall are then calculated. Importantly, surface pressure is adjusted to account for variations in CO2 ice cover.&lt;br /&gt;
&lt;br /&gt;
== Albedo and emissivity ==&lt;br /&gt;
Finally, albedo and emissivity are re-calculated as a function of the amount of CO2 ice deposited.&lt;/div&gt;</summary>
		<author><name>Maxime Maurice</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Physics_of_the_Generic_PCM&amp;diff=2735</id>
		<title>Physics of the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Physics_of_the_Generic_PCM&amp;diff=2735"/>
				<updated>2025-04-30T15:00:27Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: /* Photochemistry */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the various physical parametrizations of the Generic PCM and the chronology of their call through the physical iteration. This chronology is important because some variables need to be updated by certain processes before others (examples).   &lt;br /&gt;
During one physical iteration, the code passes through multiple sub-routines each encapsulating a parametrization. The sub-routines usually take as arguments:&lt;br /&gt;
*the dynamical values of the state variables&lt;br /&gt;
*the dynamical tendencies of the state variables&lt;br /&gt;
*any additional relevant variable&lt;br /&gt;
*any additional relevant tendency&lt;br /&gt;
and it returns in general tendencies (of the state variables as well as of any other relevant variable).&lt;br /&gt;
&lt;br /&gt;
Work in progress. Need to add links.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Initialization=&lt;br /&gt;
==First call==&lt;br /&gt;
Some initializations only need to be done at the very first iteration (e.g. examples).&lt;br /&gt;
==Each call==&lt;br /&gt;
Some other initializations need to be done at each iteration (e.g. examples).&lt;br /&gt;
&lt;br /&gt;
=Radiative transfer=&lt;br /&gt;
==Correlated-k==&lt;br /&gt;
The main radiative transfer solver of the Generic PCM implements the correlated-k method, which provides a flexible and quick way to solve radiative transfer equations, particularly suited for GCMs. More informations here.&lt;br /&gt;
==Newtonian relaxation==&lt;br /&gt;
Newton was a very relaxed physicist, still inspiring us today.&lt;br /&gt;
==No atmosphere==&lt;br /&gt;
If you have no atmosphere, why do you need a GCM?&lt;br /&gt;
&lt;br /&gt;
=Vertical diffusion=&lt;br /&gt;
Compute the vertical diffusion due to turbulence in the planetary boundary layer&lt;br /&gt;
==vdifc==&lt;br /&gt;
The &amp;quot;old&amp;quot; vertical diffusion routine.&lt;br /&gt;
==turbdiff==&lt;br /&gt;
The new (and improved!) vertical diffusion routine&lt;br /&gt;
&lt;br /&gt;
=Convection=&lt;br /&gt;
&lt;br /&gt;
Convective mixing in an atmosphere column involves non-resolved, sub-grid processes. To treat convectively unstable regions, there are two mutually exclusive options (convadj.F90 and thermcell_mod.F90). These processes are parameterized using the following routines:&lt;br /&gt;
&lt;br /&gt;
==Dry convection (convadj.F90)==&lt;br /&gt;
&lt;br /&gt;
This is the simplest and most robust parametrization for dry convective adjustment without free parameters. More info [[Convective_adjustment_scheme_in_the_generic_PCM|here]].&lt;br /&gt;
&lt;br /&gt;
==Thermal plume (thermcell_mod.F90)==&lt;br /&gt;
This module implements a more accurate and sophisticated parametrization of convection, although it involves several free parameters that need to be tuned for each planet. More info [[Thermal_plume_model_Generic_PCM|here]].&lt;br /&gt;
&lt;br /&gt;
==Non-orographic gravity waves:  (''nonoro_gwd_ran_mod.F90'') ==&lt;br /&gt;
&lt;br /&gt;
Parametrization of the momentum flux deposition due to a discrete number of gravity waves randomly generated by setting their waves characteristics (set as Gaussian distribution).  &lt;br /&gt;
&lt;br /&gt;
More info [[Non orographic gravity waves drag|here]].&lt;br /&gt;
&lt;br /&gt;
=CO2 condensation=&lt;br /&gt;
Inheriting from the Mars PCM where it is the background species, CO2 condensation is treated as a dedicated step in the Generic PCM's physics. Does that only concern CO2 as a background gas? Or does it work also if CO2 is a non-background variable gas? In any case more info here.&lt;br /&gt;
&lt;br /&gt;
=Tracers=&lt;br /&gt;
Many things can be advected by tracers in the Generic PCM, like chemical species or aerosols. Physical processes involving tracers are parameterized using the following routines:&lt;br /&gt;
&lt;br /&gt;
==Volcano==&lt;br /&gt;
This routine parameterizes a source of tracers corresponding to volcanic eruption. More information here.&lt;br /&gt;
&lt;br /&gt;
==Water/ice==&lt;br /&gt;
Water aerosols (liquid or solid) are created (resp. consumed) by condensation (resp. vaporization or sublimation), consuming (resp. releasing) latent heat in the atmosphere. In the Generic PCM, the (atmospheric part of the) water cycle is handled by various routines, as explained here.&lt;br /&gt;
&lt;br /&gt;
==Photochemistry==&lt;br /&gt;
Chemistry can turn molecules into other molecules, by the action of temperature (thermochemistry) or UV light (photochemistry). This is handled by the photochemistry routine, described [[Photochemistry_of_the_Generic_PCM|here]].&lt;br /&gt;
&lt;br /&gt;
==Generic condensation==&lt;br /&gt;
On Earth, only water condenses in the atmosphere, but on other planets (which the Generic PCM aims at simulating), many other chemicals can undergo state change. To take that into account, the Generic PCM has a flexible scheme to deal with any arbitrary species, as desbribed [[Radiative_Generic_Condensable_Specie|here]].&lt;br /&gt;
&lt;br /&gt;
==Sedimentation==&lt;br /&gt;
What goes up must come down, as explained [[Sedimentation_of_tracers_in_the_generic_PCM|here]].&lt;br /&gt;
&lt;br /&gt;
==Updates==&lt;br /&gt;
This section essentially takes care that the condensation of a major species (e.g. water vapor in steam-rich atmospheres) affects other species, as described here.&lt;br /&gt;
&lt;br /&gt;
==Slab ocean==&lt;br /&gt;
This routine solves for big fish eating small fish, as described [[Slab_ocean_model|here]].&lt;br /&gt;
&lt;br /&gt;
==Surface==&lt;br /&gt;
The surface part of the water cycle is handled here, as the hydrology page describes.&lt;br /&gt;
&lt;br /&gt;
=Heat Conduction in the Subsurface=&lt;br /&gt;
The conduction of heat in the subsurface is solved as described [[Soil_Thermal_Conduction_in_the_Generic_PCM|here]].&lt;br /&gt;
&lt;br /&gt;
=Diagnostics/write outputs=&lt;br /&gt;
Nothing very physical here, just writting the outputs! By the way, if you want to know how to output new variables in the [[diagfi.nc]] or [[XIOS]] file, check out [[Outputs|this page]].&lt;/div&gt;</summary>
		<author><name>Maxime Maurice</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Radioactive_tracers&amp;diff=2679</id>
		<title>Radioactive tracers</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Radioactive_tracers&amp;diff=2679"/>
				<updated>2025-04-15T09:12:08Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page shows how to use radioactive tracers in the Generic PCM to tune the eddy mixing coefficient of 1D simulations in order to reproduce 3D dynamical mixing.&lt;br /&gt;
= Motivation =&lt;br /&gt;
The Generic PCM has both a 3D and a 1D version. While the 3D self-consistently solves for dynamical mixing of advected quantities (like temperature or tracers), this process can only be parametrized in 1D. This is done by approximating dynamical mixing by a diffusive process:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\partial q}{\partial t}=-K_{zz}\frac{\partial^2 q}{\partial z^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt; the tracer's mass mixing ratio, &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; time, &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; altitude, and &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt; &amp;lt;math&amp;lt;K_{zz}&amp;lt;/math&amp;gt; the vertical diffusion coefficient (in m/s²), also called &amp;quot;eddy mixing coefficient&amp;quot;. Notice that &amp;lt;math&amp;lt;K_{zz}&amp;lt;/math&amp;gt; is often given in CGS units (cm/s²) in the astrophysical community. This coefficient's value (or vertical profile) is tuned so that 1D abundance profiles match 3D averaged ones.&lt;br /&gt;
&lt;br /&gt;
Depending on the planetary setup, the value (or vertical profile) of &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt; that can best reproduce 3D mixing varies. If you want to tune the vertical eddy mixing coefficient to one of your 3D cases, you can run a simulation with radioactively decreasing abstract tracers in both 1D and 3D and compare the vertical distribution of these tracers once a steady-state is reached. In 3D, this distribution is the result of a competition between dynamical mixing which tends to homogenize the atmosphere, and radioactive decay which destroys the tracers with increasing probability with time after their injection. Injection is done from the surface or the top of the atmosphere. Depending on the location of injection, half-life of the tracers, and atmosphere dynamics, the steady-state profile vary.&lt;br /&gt;
&lt;br /&gt;
= Use =&lt;br /&gt;
In order to use radioactive tracers, you simply need to add them to the traceur.def file, and define their half-life as well as injection flux at each location. This is done by setting the flags corresponding to these values in the modern version of the traceur.def. In the Generic PCM deftank, the file '''traceur.def.radioactive''' gives an illustration of it, which 6 different tracers, each having half life of 1 day, 1 week or 1 month (normalized by the time of a Martian sol), injected by the surface or the top of the atmosphere:&lt;br /&gt;
&lt;br /&gt;
 r1   half_life=8.64e4    bot_prod=8e-6&lt;br /&gt;
 r2   half_life=6.048e5   bot_prod=1.15e-6&lt;br /&gt;
 r3   half_life=2.592e6   bot_prod=2.7e-7&lt;br /&gt;
 r4   half_life=8.64e4    top_prod=8e-6&lt;br /&gt;
 r5   half_life=6.048e5   top_prod=1.15e-6&lt;br /&gt;
 r6   half_life=2.592e6   top_prod=2.7e-7&lt;br /&gt;
&lt;br /&gt;
The tracers '''r1''' to '''r3''' are injected from the surface and tracers '''r4''' to '''r6''' are injected from the top of the atmosphere. The flux multiplied by the half-life is kept constant across tracers to keep the profiles comparable. Notice that if no other process affect these tracers (as it should be since these tracers are merely numerical tools and their decay does not aim at modelling any real physical process), the value of their abundance is arbitrary and only the shape of the profile matters.&lt;br /&gt;
&lt;br /&gt;
Below is an illustration of the steady-state distribution of these tracers in the early Mars atmosphere of the benchmark in 3D, and in 1D for three different values of &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt;. One sees that large &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt; overestimate vertical mixing and thus atmosphere homogenization, while low values underestimate it.&lt;br /&gt;
&lt;br /&gt;
[[File:Radioactive tracers.png|center|frame|Comparison of the vertical mixing between a 3D case and 3 1D simulations of early Mars atmosphere using different values of the eddy mixing coefficient.]]&lt;/div&gt;</summary>
		<author><name>Maxime Maurice</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Radioactive_tracers&amp;diff=2678</id>
		<title>Radioactive tracers</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Radioactive_tracers&amp;diff=2678"/>
				<updated>2025-04-15T09:08:45Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Motivation =&lt;br /&gt;
The Generic PCM has both a 3D and a 1D version. While the 3D self-consistently solves for dynamical mixing of advected quantities (like temperature or tracers), this process can only be parametrized in 1D. This is done by approximating dynamical mixing by a diffusive process:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\partial q}{\partial t}=-K_{zz}\frac{\partial^2 q}{\partial z^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt; the tracer's mass mixing ratio, &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt; time, &amp;lt;math&amp;gt;z&amp;lt;/math&amp;gt; altitude, and &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt; &amp;lt;math&amp;lt;K_{zz}&amp;lt;/math&amp;gt; the vertical diffusion coefficient (in m/s²), also called &amp;quot;eddy mixing coefficient&amp;quot;. Notice that &amp;lt;math&amp;lt;K_{zz}&amp;lt;/math&amp;gt; is often given in CGS units (cm/s²) in the astrophysical community. This coefficient's value (or vertical profile) is tuned so that 1D abundance profiles match 3D averaged ones.&lt;br /&gt;
&lt;br /&gt;
Depending on the planetary setup, the value (or vertical profile) of &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt; that can best reproduce 3D mixing varies. If you want to tune the vertical eddy mixing coefficient to one of your 3D cases, you can run a simulation with radioactively decreasing abstract tracers in both 1D and 3D and compare the vertical distribution of these tracers once a steady-state is reached. In 3D, this distribution is the result of a competition between dynamical mixing which tends to homogenize the atmosphere, and radioactive decay which destroys the tracers with increasing probability with time after their injection. Injection is done from the surface or the top of the atmosphere. Depending on the location of injection, half-life of the tracers, and atmosphere dynamics, the steady-state profile vary.&lt;br /&gt;
&lt;br /&gt;
= Use =&lt;br /&gt;
In order to use radioactive tracers, you simply need to add them to the traceur.def file, and define their half-life as well as injection flux at each location. This is done by setting the flags corresponding to these values in the modern version of the traceur.def. In the Generic PCM deftank, the file '''traceur.def.radioactive''' gives an illustration of it, which 6 different tracers, each having half life of 1 day, 1 week or 1 month (normalized by the time of a Martian sol), injected by the surface or the top of the atmosphere:&lt;br /&gt;
&lt;br /&gt;
 r1   half_life=8.64e4    bot_prod=8e-6&lt;br /&gt;
 r2   half_life=6.048e5   bot_prod=1.15e-6&lt;br /&gt;
 r3   half_life=2.592e6   bot_prod=2.7e-7&lt;br /&gt;
 r4   half_life=8.64e4    top_prod=8e-6&lt;br /&gt;
 r5   half_life=6.048e5   top_prod=1.15e-6&lt;br /&gt;
 r6   half_life=2.592e6   top_prod=2.7e-7&lt;br /&gt;
&lt;br /&gt;
The tracers '''r1''' to '''r3''' are injected from the surface and tracers '''r4''' to '''r6''' are injected from the top of the atmosphere. The flux multiplied by the half-life is kept constant across tracers to keep the profiles comparable. Notice that if no other process affect these tracers (as it should be since these tracers are merely numerical tools and their decay does not aim at modelling any real physical process), the value of their abundance is arbitrary and only the shape of the profile matters.&lt;br /&gt;
&lt;br /&gt;
Below is an illustration of the steady-state distribution of these tracers in the early Mars atmosphere of the benchmark in 3D, and in 1D for three different values of &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt;. One sees that large &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt; overestimate vertical mixing and thus atmosphere homogenization, while low values underestimate it.&lt;br /&gt;
&lt;br /&gt;
[[File:Radioactive tracers.png|center|frame|Comparison of the vertical mixing between a 3D case and 3 1D simulations of early Mars atmosphere using different values of the eddy mixing coefficient.]]&lt;/div&gt;</summary>
		<author><name>Maxime Maurice</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Radioactive_tracers&amp;diff=2677</id>
		<title>Radioactive tracers</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Radioactive_tracers&amp;diff=2677"/>
				<updated>2025-04-14T15:35:34Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Motivation =&lt;br /&gt;
The Generic PCM has both a 3D and a 1D version. While the 3D self-consistently solves for dynamical mixing of advected quantities (like temperature or tracers), this process can only be parametrized in 1D. This is done by approximating dynamical mixing by a diffusive process, and tuning a value for the effective vertical diffusion, often referred to as the eddy mixing coefficient, &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Depending on the planetary setup, the value (or vertical profile) of &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt; that can best reproduce 3D mixing varies. If you want to tune the vertical eddy mixing coefficient to one of your 3D cases, you can run a simulation with radioactively decreasing abstract tracers in both 1D and 3D and compare the vertical distribution of these tracers once a steady-state is reached. In 3D, this distribution is the result of a competition between dynamical mixing which tends to homogenize the atmosphere, and radioactive decay which destroys the tracers with increasing probability with time after their injection. Injection is done by the surface or the top of the atmosphere. Depending on the location of injection, half-life of the tracers, and atmosphere dynamics, the steady-state profile vary.&lt;br /&gt;
&lt;br /&gt;
= Use =&lt;br /&gt;
In order to use radioactive tracers, you simply need to add them to the traceur.def file, and define their half-life as well as injection flux at each location. This is done by setting the flags corresponding to these values in the modern version of the traceur.def. In the Generic PCM deftank, the file traceur.def.radioactive gives an illustration of it, which 6 different tracers, each having half life of 1 second, 1 minutes or 1 hour (normalized by the time of a Martian sol), injected by the surface or the top of the atmosphere.&lt;br /&gt;
&lt;br /&gt;
Below is an illustration of the steady-state distribution of these tracers in the early Mars atmosphere of the benchmark in 3D, and in 1D for three differrent values of &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt;. One sees that large &amp;lt;math&amp;gt;K_{zz}&amp;lt;/math&amp;gt; overestimate vertical mixing and thus atmosphere homogenization, while low values underestimate it.&lt;br /&gt;
&lt;br /&gt;
[[File:Radioactive tracers.png|center|frame|Comparison of the vertical mixing between a 3D case and 3 1D simulations of early Mars atmosphere using different values of the eddy mixing coefficient.]]&lt;/div&gt;</summary>
		<author><name>Maxime Maurice</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Radioactive_tracers&amp;diff=2676</id>
		<title>Radioactive tracers</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Radioactive_tracers&amp;diff=2676"/>
				<updated>2025-04-14T15:33:48Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Motivation =&lt;br /&gt;
The Generic PCM has both a 3D and a 1D version. While the 3D self-consistently solves for dynamical mixing of advected quantities (like temperature or tracers), this process can only be parametrized in 1D. This is done by approximating dynamical mixing by a diffusive process, and tuning a value for the effective vertical diffusion, often referred to as the eddy mixing coefficient, K_zz.&lt;br /&gt;
&lt;br /&gt;
Depending on the planetary setup, the value (or vertical profile) of K_zz that can best reproduce 3D mixing varies. If you want to tune the vertical eddy mixing coefficient to one of your 3D cases, you can run a simulation with radioactively decreasing abstract tracers in both 1D and 3D and compare the vertical distribution of these tracers once a steady-state is reached. In 3D, this distribution is the result of a competition between dynamical mixing which tends to homogenize the atmosphere, and radioactive decay which destroys the tracers with increasing probability with time after their injection. Injection is done by the surface or the top of the atmosphere. Depending on the location of injection, half-life of the tracers, and atmosphere dynamics, the steady-state profile vary.&lt;br /&gt;
&lt;br /&gt;
= Use =&lt;br /&gt;
In order to use radioactive tracers, you simply need to add them to the traceur.def file, and define their half-life as well as injection flux at each location. This is done by setting the flags corresponding to these values in the modern version of the traceur.def. In the Generic PCM deftank, the file traceur.def.radioactive gives an illustration of it, which 6 different tracers, each having half life of 1 second, 1 minutes or 1 hour (normalized by the time of a Martian sol), injected by the surface or the top of the atmosphere.&lt;br /&gt;
&lt;br /&gt;
Below is an illustration of the steady-state distribution of these tracers in the early Mars atmosphere of the benchmark in 3D, and in 1D for three differrent values of K_zz. One sees that large K_zz overestimate vertical mixing and thus atmosphere homogenization, while low values underestimate it.&lt;br /&gt;
&lt;br /&gt;
[[File:Radioactive tracers.png|center|frame|Comparison of the vertical mixing between a 3D case and 3 1D simulations of early Mars atmosphere using different values of the eddy mixing coefficient.]]&lt;/div&gt;</summary>
		<author><name>Maxime Maurice</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Radioactive_tracers&amp;diff=2675</id>
		<title>Radioactive tracers</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Radioactive_tracers&amp;diff=2675"/>
				<updated>2025-04-14T15:33:26Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Radioactive tracer =&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
The Generic PCM has both a 3D and a 1D version. While the 3D self-consistently solves for dynamical mixing of advected quantities (like temperature or tracers), this process can only be parametrized in 1D. This is done by approximating dynamical mixing by a diffusive process, and tuning a value for the effective vertical diffusion, often referred to as the eddy mixing coefficient, K_zz.&lt;br /&gt;
&lt;br /&gt;
Depending on the planetary setup, the value (or vertical profile) of K_zz that can best reproduce 3D mixing varies. If you want to tune the vertical eddy mixing coefficient to one of your 3D cases, you can run a simulation with radioactively decreasing abstract tracers in both 1D and 3D and compare the vertical distribution of these tracers once a steady-state is reached. In 3D, this distribution is the result of a competition between dynamical mixing which tends to homogenize the atmosphere, and radioactive decay which destroys the tracers with increasing probability with time after their injection. Injection is done by the surface or the top of the atmosphere. Depending on the location of injection, half-life of the tracers, and atmosphere dynamics, the steady-state profile vary.&lt;br /&gt;
&lt;br /&gt;
== Use ==&lt;br /&gt;
In order to use radioactive tracers, you simply need to add them to the traceur.def file, and define their half-life as well as injection flux at each location. This is done by setting the flags corresponding to these values in the modern version of the traceur.def. In the Generic PCM deftank, the file traceur.def.radioactive gives an illustration of it, which 6 different tracers, each having half life of 1 second, 1 minutes or 1 hour (normalized by the time of a Martian sol), injected by the surface or the top of the atmosphere.&lt;br /&gt;
&lt;br /&gt;
Below is an illustration of the steady-state distribution of these tracers in the early Mars atmosphere of the benchmark in 3D, and in 1D for three differrent values of K_zz. One sees that large K_zz overestimate vertical mixing and thus atmosphere homogenization, while low values underestimate it.&lt;br /&gt;
&lt;br /&gt;
[[File:Radioactive tracers.png|center|frame|Comparison of the vertical mixing between a 3D case and 3 1D simulations of early Mars atmosphere using different values of the eddy mixing coefficient.]]&lt;/div&gt;</summary>
		<author><name>Maxime Maurice</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=File:Radioactive_tracers.png&amp;diff=2674</id>
		<title>File:Radioactive tracers.png</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=File:Radioactive_tracers.png&amp;diff=2674"/>
				<updated>2025-04-14T15:28:57Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: Comparison of vertical mixing between a 3D case and 3 1D simulations of early Mars using different eddy mixing coefficients.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Comparison of vertical mixing between a 3D case and 3 1D simulations of early Mars using different eddy mixing coefficients.&lt;/div&gt;</summary>
		<author><name>Maxime Maurice</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Radioactive_tracers&amp;diff=2673</id>
		<title>Radioactive tracers</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Radioactive_tracers&amp;diff=2673"/>
				<updated>2025-04-14T15:03:06Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: Created page with &amp;quot;= Radioactive tracer =  == Motivation == The Generic PCM has both a 3D and a 1D version. While the 3D self-consistently solves for dynamical mixing of advected quantities (lik...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Radioactive tracer =&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
The Generic PCM has both a 3D and a 1D version. While the 3D self-consistently solves for dynamical mixing of advected quantities (like temperature or tracers), this process can only be parametrized in 1D. This is done by approximating dynamical mixing by a diffusive process, and tuning a value for the effective vertical diffusion, often referred to as the eddy mixing coefficient, K_zz.&lt;br /&gt;
&lt;br /&gt;
Depending on the planetary setup, the value (or vertical profile) of K_zz that can best reproduce 3D mixing varies. If you want to tune the vertical eddy mixing coefficient to one of your 3D cases, you can run a simulation with radioactively decreasing abstract tracers in both 1D and 3D and compare the vertical distribution of these tracers once a steady-state is reached. In 3D, this distribution is the result of a competition between dynamical mixing which tends to homogenize the atmosphere, and radioactive decay which destroys the tracers with increasing probability with time after their injection. Injection is done by the surface or the top of the atmosphere. Depending on the location of injection, half-life of the tracers, and atmosphere dynamics, the steady-state profile vary.&lt;br /&gt;
&lt;br /&gt;
== Use ==&lt;br /&gt;
In order to use radioactive tracers, you simply need to add them to the traceur.def file, and define their half-life as well as injection flux at each location. This is done by setting the flags corresponding to these values in the modern version of the traceur.def. In the Generic PCM deftank, the file traceur.def.radioactive gives an illustration of it, which 6 different tracers, each having half life of 1 second, 1 minutes or 1 hour (normalized by the time of a Martian sol), injected by the surface or the top of the atmosphere.&lt;br /&gt;
&lt;br /&gt;
Below is an illustration of the steady-state distribution of these tracers in the early Mars atmosphere of the benchmark in 3D, and in 1D for three differrent values of K_zz. One sees that large K_zz overestimate vertical mixing and thus atmosphere homogenization, while low values underestimate it.&lt;/div&gt;</summary>
		<author><name>Maxime Maurice</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Photochemistry_of_the_Generic_PCM&amp;diff=2517</id>
		<title>Photochemistry of the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Photochemistry_of_the_Generic_PCM&amp;diff=2517"/>
				<updated>2025-03-05T09:57:08Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: /* Boundary conditions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= General Use =&lt;br /&gt;
&lt;br /&gt;
== Compilation ==&lt;br /&gt;
Photochemistry in the generic model is largely independent of the and does not require to recompile it (just make sure that you have linked the ''LAPACK'' and ''BLAS'' libraries).&lt;br /&gt;
&lt;br /&gt;
== callphys.def ==&lt;br /&gt;
In order to use photochemistry, you simply need to have the following line in '''callphys.def''':&lt;br /&gt;
 photochem  = .true.&lt;br /&gt;
Other flags related to photochemistry are:&lt;br /&gt;
* '''photoheat''': turn on or off heating by UV absorption.&lt;br /&gt;
* '''jonline''': turn on or off online photolysis.&lt;br /&gt;
* '''stellarflux''': name of the stellar flux file.&lt;br /&gt;
* '''depos''': turn on or off deposition.&lt;br /&gt;
&lt;br /&gt;
== traceur.def ==&lt;br /&gt;
All chemical species must be listed in [[The_traceur.def_Input_File|'''traceurs.def''']] ('''which needs to follow the modern layout''').&lt;br /&gt;
&lt;br /&gt;
== Reaction network ==&lt;br /&gt;
Besides the species- and reaction-specific data files ([[#Photolysis reaction|see below]]), you need one file: '''reactfile''' (located in the '''chemnetwork''' folder) for the reaction network. The first line of the file is ignored, then for each line, the syntax of the '''reactfile''' is as follows:  &lt;br /&gt;
* Columns 1-50 are reserved for reactants. Their names must match those given [[The_traceur.def_Input_File|'''traceurs.def''']], in particular, if you have both water vapour and water ice as tracers, named h2o_vap and h2o_ice respectively, the name to use for water vapour in chemical reaction is h2o_vap. Reactant species must be separated by any number of blank spaces.&lt;br /&gt;
* Columns 51-100 are reserved for products, with the same rules applying. Notice that in the case of a third body reaction, the third body appears only with the reactants and is omitted on the products side. &lt;br /&gt;
* Column 101 is an integer designating the type of reaction: 0 for photolysis, 1, 2 or 3 for other reactions, depending on their reaction rate formula. The four next spaces are blank.&lt;br /&gt;
* Column 106 and after are dedicated to parameters specific to each reaction type.&lt;br /&gt;
Note that lines can be commented out by starting them with the character &amp;quot;!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Photolysis ==&lt;br /&gt;
=== Online photolysis ===&lt;br /&gt;
In the baseline use of the photochemistry model, photolysis are computed at the runtime (online), by solving the UV radiative transfer using the TUV solver, considering species-specific UV cross section. o do so, first make sure that the apropriate flag is set to true in the '''callphys.def''':&lt;br /&gt;
 jonline = .true.&lt;br /&gt;
Photolysis reactions are identified by a 0 at column 101 of the '''reactfile'''. They need two types of files (which need to be placed in '''datadir/cross_sections/'''): &lt;br /&gt;
# cross sections (syntax: first line: wavelength in nm, second line cross section in cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;, first line is ignored)&lt;br /&gt;
# yield rates (syntax: first line: wavelength in nm, second line: photodissociation yield, first line is ignored)&lt;br /&gt;
These data can be found in benchmark cases for common species (e.g. water), or on the following pages for more exotic ones: [https://www.uv-vis-spectral-atlas-mainz.org/uvvis/ Mainz spectral atlas], [https://phidrates.space.swri.edu/ phidrates], [https://home.strw.leidenuniv.nl/~moldata/ Leiden University].  &lt;br /&gt;
The parameters for photolysis reaction in the '''reactfile''' are given as follows, from column 106: an identifier character string starting with &amp;quot;j&amp;quot;, an integer corresponding to the number of cross section files (one for each temperature range), the lower bound of each temperature range, the name of each cross section file, the name of the yield rate file. For example, the following line describes the photolysis of O&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; into two O atoms in the ground state:&lt;br /&gt;
 o2              hv                                o               o                                 0    jo2_o               4    150  200  250  300  O2_150.abs O2_200.abs O2_250.abs O2_300.abs o2_o.yld&lt;br /&gt;
In this case, 4 different cross section files exist, corresponding to the temperature range 150 K-200 K, 200 K-250 K, 250 K-300 K, &amp;gt;300 K.&lt;br /&gt;
=== Offline photolysis ===&lt;br /&gt;
=== Stellar flux ===&lt;br /&gt;
In order to compute photolysis (is it also the case for offline photolysis?), you need to provide a UV stellar spectrum. This file must be located in datadir/stellar_spectra/photochem_stellar_spectra, an is composed of a 2-lines header and 2 columns, the left one indicating wavelength (in nm) and the right one indicating the flux (in photons/cm²/s/nm).&lt;br /&gt;
=== Constant photodissociation rates ===&lt;br /&gt;
Sometimes photodissociation rates are simply given as a constant throughout the atmosphere. One way to reproduce that is to treat these reactions as type 1 reaction (see below).&lt;br /&gt;
&lt;br /&gt;
== Reaction rate formulae ==&lt;br /&gt;
Many reaction rate parametrizations can be found in [https://jpldataeval.jpl.nasa.gov/pdf/NASA-JPL%20Evaluation%2019-5.pdf here]. The model currently accounts for three different formula for the reaction rate (more exotic ones can be hard-coded in the '''chimiedata_h.F90''' file, as indicated in [https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/Other_GCM_Configurations_worth_knowing_about#Compiling_a_test_case_.28TRAPPIST-1e.29 the TRAPPIST-1e example]). The chosen formula is by 1, 2, or 3 at column 51 or the '''reactfile'''.They read respectively:&lt;br /&gt;
# The simple form of the reaction rate is &amp;lt;p&amp;gt;:&amp;lt;math&amp;gt;k=a\left(\frac{T}{T_0}\right)^ce^{\frac{-b}{T} }[M]^d&amp;lt;/math&amp;gt;Its parameters (to give in the '''reactfile''' in the same order, starting from column 106) are &amp;lt;math&amp;gt;a, b, c, T_0, d&amp;lt;/math&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
# Termolecular reactions have low- and high-pressure-limiting rate constant (&amp;lt;math&amp;gt;k_0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_\infty&amp;lt;/math&amp;gt;, respectively). Their effective rate constant is then given by &amp;lt;p&amp;gt;:&amp;lt;math&amp;gt;k=ge^{-\frac{h}{T} }+\frac{k_0\left(\frac{T}{T_0}\right)^ne^{\frac{-a_0}{T} }[M]^{d_{\text up} } }{1+\frac{k_0\left(\frac{T}{T_0}\right)^ne^{\frac{-a_0}{T} } }{k_\infty\left(\frac{T}{T_0}\right)^me^{\frac{-b_0}{T} } }[M]^{d_{\text down} } }fc^{\frac{1}{1+\left[\log_{10}\left(\frac{k_0\left(\frac{T}{T_0}\right)^ne^{\frac{-a_0}{T} } }{k_\infty\left(\frac{T}{T_0}\right)^me^{\frac{-b_0}{T} } }[M] \right) \right]^2 } }&amp;lt;/math&amp;gt;Its parameters (to give in the '''reactfile''' in the same order, starting from column 106) are &amp;lt;math&amp;gt;k_0, n, a_0, k_\infty, m, b_0, T_0, f_c, g, h, d_{\text up}, d_{\text down}&amp;lt;/math&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
# Finally, a last form of the reaction rate is &amp;lt;p&amp;gt;:&amp;lt;math&amp;gt;\frac{k_0\left(\frac{T}{T_0}\right)^ne^{\frac{-a_0}{T} }[M]^{d_{\text up} } }{1+\frac{k_0\left(\frac{T}{T_0}\right)^ne^{\frac{-a_0}{T} } }{k_\infty\left(\frac{T}{T_0}\right)^me^{\frac{-b_0}{T} } }[M]^{d_{\text down} } }[F_{\text cent}]^X,&amp;lt;/math&amp;gt;with &amp;lt;math&amp;gt;F_{\text cent}=1-ae^{-\frac{T}{T^{***} } }+ae^{-\frac{T}{T^* } }+ae^{-\frac{T^{**}}{T } }&amp;lt;/math&amp;gt;, and :&amp;lt;math&amp;gt;X=\left[1+\left[\frac{\log_{10}\left(\frac{k_0\left(\frac{T}{T_0}\right)^ne^{\frac{-a_0}{T} } }{k_\infty\left(\frac{T}{T_0}\right)^me^{\frac{-b_0}{T} } }[M] \right)+c }{N-d\left(\log_{10}\left(\frac{k_0\left(\frac{T}{T_0}\right)^ne^{\frac{-a_0}{T} } }{k_\infty\left(\frac{T}{T_0}\right)^me^{\frac{-b_0}{T} } }[M] \right) \right)+c } \right]^2 \right]^{-1},&amp;lt;/math&amp;gt;with &amp;lt;math&amp;gt;c=-0.4-0.67\log_{10}(F_{\text cent})&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N=0.75-1.27\log_{10}(F_{\text cent})&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;d=0.14&amp;lt;/math&amp;gt;.&lt;br /&gt;
::Its parameters (to give in the '''reactfile''' in the same order, starting from column 106) are &amp;lt;math&amp;gt;k_0, n, a_0, k_\infty, m, b_0, T_0, a, T^{***}, T^*, T^{**}, d_{\text up}, d_{\text down}&amp;lt;/math&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
For example, the following line describes the 3-body reaction CO + O + M = CO&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + M, whose reaction rate is &amp;lt;math&amp;gt;k=2.2\times10^{-33}e^{-\frac{1780}{T} }[M]&amp;lt;/math&amp;gt; (be careful, here &amp;lt;math&amp;gt;[M]&amp;lt;/math&amp;gt; corresponds to the molecular density of the atmosphere, not that of the third body):&lt;br /&gt;
 co              o               M                 co2                                               1    2.2e-33     -1780.0     0.0         1           1.0&lt;br /&gt;
&lt;br /&gt;
= Boundary conditions =&lt;br /&gt;
All processes described in this section are implemented in the '''deposition_source.F90''' file in LMDZ.GENERIC/libf/aeronostd.  &lt;br /&gt;
For each chemical species, two types of surface boundary conditions can be enforced in the chemistry, specified by the '''SF_mode''' in the [[The_traceur.def_Input_File|traceur.def]] file. If none of the flags mentioned below is given, the default boundary conditions are no flux.&lt;br /&gt;
&lt;br /&gt;
== Fixed mixing ratio ==&lt;br /&gt;
&lt;br /&gt;
This boundary condition is enforced by setting SF_mode=1. The value of the surface VMR is then passed to the flag SF_value.&lt;br /&gt;
&lt;br /&gt;
== Deposition velocity and surface production ==&lt;br /&gt;
&lt;br /&gt;
This boundary condition is enforced by setting SF_mode=2. It enforces a surface deposition $$v_{\rm dep}$$ inducing an outflux $$F=-v_{\rm dep}\times[X]$$ with v_dep the surface deposition velocity and [X] the VMR of the tracer in the first atmosphere layer, as well as a fixed production rate (added to each cell of the first atmosphere layer). The value of the deposition velocity (in cm/s) is passed to the flag '''SF_value''' and the production rate (in molecules/m$$^2$$/s) is passed to the flag '''prod_rate'''&lt;br /&gt;
&lt;br /&gt;
In case of surface deposition/production, a production rate can also be specified for each tracer using the flag '''prod_rate''' (value in molecules/m$$^2$$/s). Below is an example of a chunk of a traceur.def file specifying a fixed CO$$_2$$ volume mixing ratio and a surface deposition of CO of 10$$^{-8}$$ cm/s along with a production rate of 10$$^5$$ molecules/m$$^2$$/s:&lt;br /&gt;
&lt;br /&gt;
 co2 mmol=44 is_chim=1 SF_mode=1&lt;br /&gt;
 co  mmol=28 is_chim=1 SF_mode=1 SF_value=1e-8 prod_rate=1e5&lt;br /&gt;
&lt;br /&gt;
== Escape ==&lt;br /&gt;
Whatever the prescribed boundary condition, an escape rate can also be given at the top of the atmosphere. A parametrization of H escape from H$$_2$$, CH$$_4$$ and H$$_2$$O is currently implemented and commented out.&lt;br /&gt;
&lt;br /&gt;
= Using hard-coded rate constants =&lt;br /&gt;
&lt;br /&gt;
You might sometimes want to track a reaction whose rate constant is not capture by either of the three above parametrizations. In this case you'll need to get your hands dirty and hard-code the rate constant parametrization in the code. Notice that the reaction should not be included in the reactfile in this case (it is however a good practice to indicate it as a commented line and write &amp;quot;hard-coded', both to keep track of your network and because the post-processing tools will notify it by reading the reactfile). Here is how to proceed:&lt;br /&gt;
&lt;br /&gt;
First, identify the type of your reaction: currently, the model distinguishes between 1) bimolecular reactions (A + B -&amp;gt; C (+ D)), 2) quadratic reactions (A + A -&amp;gt; B (+C)), 3) quenching reactions (A + C -&amp;gt; B + C), and 4) heterogeneous reactions (e.g. A + ice -&amp;gt; B + C). Bimolecular reactions are given type '''v4''', quadratic reactions are given type '''v3''', and both quenching an heterogeneous reactions are given type '''vphot''' (the same as photodissociation reactions).     &lt;br /&gt;
&lt;br /&gt;
Then, open the file '''LMDZ.GENERIC/libf/aeronostd/chimiedata_h.F90'''. This file has a dedicated section for hard-coded reactions. Some of them are already there, commented out. We'll use one of them (the reaction CO + OH -&amp;gt; CO2 + H) as a example on how to proceed. This is a bimolecular reaction, so we first need to increment the counter of hard-coded reactions of type '''v_4''':&lt;br /&gt;
 integer, parameter :: n4_hard_coding    = 1&lt;br /&gt;
In the master branch version of the code, the variable ''n4_hard_coding'' is set to 0. If you're version of the code already has hard-coded reactions, then simply add one to the current value of ''n4_hard_coding''.     &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the same file, you will find a subroutine called ''indice_HC'' for registering hard-coded reactions. You can create a space for your reaction, taking example of what's already there. For instance our example reaction is already there:&lt;br /&gt;
 !===========================================================&lt;br /&gt;
 !      e001 : CO + OH -&amp;gt; CO2 + H &lt;br /&gt;
 !===========================================================&lt;br /&gt;
 ! nb_reaction_4 = nb_reaction_4 + 1&lt;br /&gt;
 ! indice_4(nb_reaction_4) = z4spec(1.0, indexchim('co'), 1.0, indexchim('oh'), 1.0, indexchim('co2'), 1.0, indexchim('h'))&lt;br /&gt;
To use it, you must uncomment the two last lines. The top one increments the number of reactions of type ''v4'', and the second one registers the reacting species for your new reaction.&lt;br /&gt;
&lt;br /&gt;
Then go to the subroutine ''reactionrates_HC''. This is where you will write down the parametrization formula into the reaction rates table (the variable '''v_4''' for bimolecular reactions, '''v_3''' for quadratic reactions, or '''v_phot''' for all others). Again, you can take example of what's already there. If you want to use our example reaction, find the dedicated space, opening with the line:&lt;br /&gt;
 !---  e001: oh + co -&amp;gt; co2 + h&lt;br /&gt;
and simply uncomment the following lines:&lt;br /&gt;
 !nb_reaction_4 = nb_reaction_4 + 1&lt;br /&gt;
to update the index at which the rate is written in table '''v_4''', and then (for instance):&lt;br /&gt;
 !     jpl 2015&lt;br /&gt;
 &lt;br /&gt;
 !do ilev = 1,nlayer&lt;br /&gt;
 !!oh + co -&amp;gt; h + co2&lt;br /&gt;
 !   rate1 = 1.5e-13*(t(ilev)/300.)**(0.0)&lt;br /&gt;
 !!oh + co + m -&amp;gt; hoco&lt;br /&gt;
 !   ak0 = 5.9e-33*(t(ilev)/300.)**(-1.0)&lt;br /&gt;
 !   ak1 = 1.1e-12*(t(ilev)/300.)**(1.3)&lt;br /&gt;
 !   rate2 = (ak0*dens(ilev))/(1. + ak0*dens(ilev)/ak1)&lt;br /&gt;
 !   xpo2 = 1./(1. + alog10((ak0*dens(ilev))/ak1)**2)&lt;br /&gt;
 !      &lt;br /&gt;
 !   v_4(ilev,nb_reaction_4) = rate1 + rate2*0.6**xpo2&lt;br /&gt;
 !end do&lt;br /&gt;
(except the first one) to use the parametrization from the JPL 2015 collection (linked above). Notice that several parametrizations are implemented; to use another one simply uncomment another block, or write your own.&lt;br /&gt;
&lt;br /&gt;
== Hard-coding reactions with 3 products ==&lt;br /&gt;
The model does not natively handle reactions with 3 products. The trick is to instead split it into 2 &amp;quot;semi-reactions&amp;quot;, for instance instead of HNO3 + OH -&amp;gt; H2O + O + NO2, add 0.5 HNO3 + 0.5 OH -&amp;gt; H2O + 0.5 NO2 and 0.5 HNO3 + 0.5 OH -&amp;gt; O + 0.5 NO2 (or any stoichiometrically-equivalent couple). Each semi-reaction then has the same constant rate as the total reaction. Don't forget to count them as two distinct reactions.&lt;br /&gt;
&lt;br /&gt;
= Python post-processing tools for photochemistry =&lt;br /&gt;
A mini python library is available in the '''util''' directory of the Generic model (LMDZ.GENERIC/utils), along with a demonstration jupyter notebook.&lt;/div&gt;</summary>
		<author><name>Maxime Maurice</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Photochemistry_of_the_Generic_PCM&amp;diff=2452</id>
		<title>Photochemistry of the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Photochemistry_of_the_Generic_PCM&amp;diff=2452"/>
				<updated>2025-03-05T08:55:30Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: Created page with &amp;quot;= General Use =  == Compilation == Photochemistry in the generic model is largely independent of the and does not require to recompile it (just make sure that you have linked...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= General Use =&lt;br /&gt;
&lt;br /&gt;
== Compilation ==&lt;br /&gt;
Photochemistry in the generic model is largely independent of the and does not require to recompile it (just make sure that you have linked the ''LAPACK'' and ''BLAS'' libraries).&lt;br /&gt;
&lt;br /&gt;
== callphys.def ==&lt;br /&gt;
In order to use photochemistry, you simply need to have the following line in '''callphys.def''':&lt;br /&gt;
 photochem  = .true.&lt;br /&gt;
Other flags related to photochemistry are:&lt;br /&gt;
* '''photoheat''': turn on or off heating by UV absorption.&lt;br /&gt;
* '''jonline''': turn on or off online photolysis.&lt;br /&gt;
* '''stellarflux''': name of the stellar flux file.&lt;br /&gt;
* '''depos''': turn on or off deposition.&lt;br /&gt;
&lt;br /&gt;
== traceur.def ==&lt;br /&gt;
All chemical species must be listed in [[The_traceur.def_Input_File|'''traceurs.def''']] ('''which needs to follow the modern layout''').&lt;br /&gt;
&lt;br /&gt;
== Reaction network ==&lt;br /&gt;
Besides the species- and reaction-specific data files ([[#Photolysis reaction|see below]]), you need one file: '''reactfile''' (located in the '''chemnetwork''' folder) for the reaction network. The first line of the file is ignored, then for each line, the syntax of the '''reactfile''' is as follows:  &lt;br /&gt;
* Columns 1-50 are reserved for reactants. Their names must match those given [[The_traceur.def_Input_File|'''traceurs.def''']], in particular, if you have both water vapour and water ice as tracers, named h2o_vap and h2o_ice respectively, the name to use for water vapour in chemical reaction is h2o_vap. Reactant species must be separated by any number of blank spaces.&lt;br /&gt;
* Columns 51-100 are reserved for products, with the same rules applying. Notice that in the case of a third body reaction, the third body appears only with the reactants and is omitted on the products side. &lt;br /&gt;
* Column 101 is an integer designating the type of reaction: 0 for photolysis, 1, 2 or 3 for other reactions, depending on their reaction rate formula. The four next spaces are blank.&lt;br /&gt;
* Column 106 and after are dedicated to parameters specific to each reaction type.&lt;br /&gt;
Note that lines can be commented out by starting them with the character &amp;quot;!&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Photolysis ==&lt;br /&gt;
=== Online photolysis ===&lt;br /&gt;
In the baseline use of the photochemistry model, photolysis are computed at the runtime (online), by solving the UV radiative transfer using the TUV solver, considering species-specific UV cross section. o do so, first make sure that the apropriate flag is set to true in the '''callphys.def''':&lt;br /&gt;
 jonline = .true.&lt;br /&gt;
Photolysis reactions are identified by a 0 at column 101 of the '''reactfile'''. They need two types of files (which need to be placed in '''datadir/cross_sections/'''): &lt;br /&gt;
# cross sections (syntax: first line: wavelength in nm, second line cross section in cm&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;, first line is ignored)&lt;br /&gt;
# yield rates (syntax: first line: wavelength in nm, second line: photodissociation yield, first line is ignored)&lt;br /&gt;
These data can be found in benchmark cases for common species (e.g. water), or on the following pages for more exotic ones: [https://www.uv-vis-spectral-atlas-mainz.org/uvvis/ Mainz spectral atlas], [https://phidrates.space.swri.edu/ phidrates], [https://home.strw.leidenuniv.nl/~moldata/ Leiden University].  &lt;br /&gt;
The parameters for photolysis reaction in the '''reactfile''' are given as follows, from column 106: an identifier character string starting with &amp;quot;j&amp;quot;, an integer corresponding to the number of cross section files (one for each temperature range), the lower bound of each temperature range, the name of each cross section file, the name of the yield rate file. For example, the following line describes the photolysis of O&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; into two O atoms in the ground state:&lt;br /&gt;
 o2              hv                                o               o                                 0    jo2_o               4    150  200  250  300  O2_150.abs O2_200.abs O2_250.abs O2_300.abs o2_o.yld&lt;br /&gt;
In this case, 4 different cross section files exist, corresponding to the temperature range 150 K-200 K, 200 K-250 K, 250 K-300 K, &amp;gt;300 K.&lt;br /&gt;
=== Offline photolysis ===&lt;br /&gt;
=== Stellar flux ===&lt;br /&gt;
In order to compute photolysis (is it also the case for offline photolysis?), you need to provide a UV stellar spectrum. This file must be located in datadir/stellar_spectra/photochem_stellar_spectra, an is composed of a 2-lines header and 2 columns, the left one indicating wavelength (in nm) and the right one indicating the flux (in photons/cm²/s/nm).&lt;br /&gt;
=== Constant photodissociation rates ===&lt;br /&gt;
Sometimes photodissociation rates are simply given as a constant throughout the atmosphere. One way to reproduce that is to treat these reactions as type 1 reaction (see below).&lt;br /&gt;
&lt;br /&gt;
== Reaction rate formulae ==&lt;br /&gt;
Many reaction rate parametrizations can be found in [https://jpldataeval.jpl.nasa.gov/pdf/NASA-JPL%20Evaluation%2019-5.pdf here]. The model currently accounts for three different formula for the reaction rate (more exotic ones can be hard-coded in the '''chimiedata_h.F90''' file, as indicated in [https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/Other_GCM_Configurations_worth_knowing_about#Compiling_a_test_case_.28TRAPPIST-1e.29 the TRAPPIST-1e example]). The chosen formula is by 1, 2, or 3 at column 51 or the '''reactfile'''.They read respectively:&lt;br /&gt;
# The simple form of the reaction rate is &amp;lt;p&amp;gt;:&amp;lt;math&amp;gt;k=a\left(\frac{T}{T_0}\right)^ce^{\frac{-b}{T} }[M]^d&amp;lt;/math&amp;gt;Its parameters (to give in the '''reactfile''' in the same order, starting from column 106) are &amp;lt;math&amp;gt;a, b, c, T_0, d&amp;lt;/math&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
# Termolecular reactions have low- and high-pressure-limiting rate constant (&amp;lt;math&amp;gt;k_0&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;k_\infty&amp;lt;/math&amp;gt;, respectively). Their effective rate constant is then given by &amp;lt;p&amp;gt;:&amp;lt;math&amp;gt;k=ge^{-\frac{h}{T} }+\frac{k_0\left(\frac{T}{T_0}\right)^ne^{\frac{-a_0}{T} }[M]^{d_{\text up} } }{1+\frac{k_0\left(\frac{T}{T_0}\right)^ne^{\frac{-a_0}{T} } }{k_\infty\left(\frac{T}{T_0}\right)^me^{\frac{-b_0}{T} } }[M]^{d_{\text down} } }fc^{\frac{1}{1+\left[\log_{10}\left(\frac{k_0\left(\frac{T}{T_0}\right)^ne^{\frac{-a_0}{T} } }{k_\infty\left(\frac{T}{T_0}\right)^me^{\frac{-b_0}{T} } }[M] \right) \right]^2 } }&amp;lt;/math&amp;gt;Its parameters (to give in the '''reactfile''' in the same order, starting from column 106) are &amp;lt;math&amp;gt;k_0, n, a_0, k_\infty, m, b_0, T_0, f_c, g, h, d_{\text up}, d_{\text down}&amp;lt;/math&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
# Finally, a last form of the reaction rate is &amp;lt;p&amp;gt;:&amp;lt;math&amp;gt;\frac{k_0\left(\frac{T}{T_0}\right)^ne^{\frac{-a_0}{T} }[M]^{d_{\text up} } }{1+\frac{k_0\left(\frac{T}{T_0}\right)^ne^{\frac{-a_0}{T} } }{k_\infty\left(\frac{T}{T_0}\right)^me^{\frac{-b_0}{T} } }[M]^{d_{\text down} } }[F_{\text cent}]^X,&amp;lt;/math&amp;gt;with &amp;lt;math&amp;gt;F_{\text cent}=1-ae^{-\frac{T}{T^{***} } }+ae^{-\frac{T}{T^* } }+ae^{-\frac{T^{**}}{T } }&amp;lt;/math&amp;gt;, and :&amp;lt;math&amp;gt;X=\left[1+\left[\frac{\log_{10}\left(\frac{k_0\left(\frac{T}{T_0}\right)^ne^{\frac{-a_0}{T} } }{k_\infty\left(\frac{T}{T_0}\right)^me^{\frac{-b_0}{T} } }[M] \right)+c }{N-d\left(\log_{10}\left(\frac{k_0\left(\frac{T}{T_0}\right)^ne^{\frac{-a_0}{T} } }{k_\infty\left(\frac{T}{T_0}\right)^me^{\frac{-b_0}{T} } }[M] \right) \right)+c } \right]^2 \right]^{-1},&amp;lt;/math&amp;gt;with &amp;lt;math&amp;gt;c=-0.4-0.67\log_{10}(F_{\text cent})&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N=0.75-1.27\log_{10}(F_{\text cent})&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;d=0.14&amp;lt;/math&amp;gt;.&lt;br /&gt;
::Its parameters (to give in the '''reactfile''' in the same order, starting from column 106) are &amp;lt;math&amp;gt;k_0, n, a_0, k_\infty, m, b_0, T_0, a, T^{***}, T^*, T^{**}, d_{\text up}, d_{\text down}&amp;lt;/math&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
For example, the following line describes the 3-body reaction CO + O + M = CO&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt; + M, whose reaction rate is &amp;lt;math&amp;gt;k=2.2\times10^{-33}e^{-\frac{1780}{T} }[M]&amp;lt;/math&amp;gt; (be careful, here &amp;lt;math&amp;gt;[M]&amp;lt;/math&amp;gt; corresponds to the molecular density of the atmosphere, not that of the third body):&lt;br /&gt;
 co              o               M                 co2                                               1    2.2e-33     -1780.0     0.0         1           1.0&lt;br /&gt;
&lt;br /&gt;
= Boundary conditions =&lt;br /&gt;
== Deposition velocity ==&lt;br /&gt;
== Production rate ==&lt;br /&gt;
== Escape ==&lt;br /&gt;
&lt;br /&gt;
= Using hard-coded rate constants =&lt;br /&gt;
&lt;br /&gt;
You might sometimes want to track a reaction whose rate constant is not capture by either of the three above parametrizations. In this case you'll need to get your hands dirty and hard-code the rate constant parametrization in the code. Notice that the reaction should not be included in the reactfile in this case (it is however a good practice to indicate it as a commented line and write &amp;quot;hard-coded', both to keep track of your network and because the post-processing tools will notify it by reading the reactfile). Here is how to proceed:&lt;br /&gt;
&lt;br /&gt;
First, identify the type of your reaction: currently, the model distinguishes between 1) bimolecular reactions (A + B -&amp;gt; C (+ D)), 2) quadratic reactions (A + A -&amp;gt; B (+C)), 3) quenching reactions (A + C -&amp;gt; B + C), and 4) heterogeneous reactions (e.g. A + ice -&amp;gt; B + C). Bimolecular reactions are given type '''v4''', quadratic reactions are given type '''v3''', and both quenching an heterogeneous reactions are given type '''vphot''' (the same as photodissociation reactions).     &lt;br /&gt;
&lt;br /&gt;
Then, open the file '''LMDZ.GENERIC/libf/aeronostd/chimiedata_h.F90'''. This file has a dedicated section for hard-coded reactions. Some of them are already there, commented out. We'll use one of them (the reaction CO + OH -&amp;gt; CO2 + H) as a example on how to proceed. This is a bimolecular reaction, so we first need to increment the counter of hard-coded reactions of type '''v_4''':&lt;br /&gt;
 integer, parameter :: n4_hard_coding    = 1&lt;br /&gt;
In the master branch version of the code, the variable ''n4_hard_coding'' is set to 0. If you're version of the code already has hard-coded reactions, then simply add one to the current value of ''n4_hard_coding''.     &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the same file, you will find a subroutine called ''indice_HC'' for registering hard-coded reactions. You can create a space for your reaction, taking example of what's already there. For instance our example reaction is already there:&lt;br /&gt;
 !===========================================================&lt;br /&gt;
 !      e001 : CO + OH -&amp;gt; CO2 + H &lt;br /&gt;
 !===========================================================&lt;br /&gt;
 ! nb_reaction_4 = nb_reaction_4 + 1&lt;br /&gt;
 ! indice_4(nb_reaction_4) = z4spec(1.0, indexchim('co'), 1.0, indexchim('oh'), 1.0, indexchim('co2'), 1.0, indexchim('h'))&lt;br /&gt;
To use it, you must uncomment the two last lines. The top one increments the number of reactions of type ''v4'', and the second one registers the reacting species for your new reaction.&lt;br /&gt;
&lt;br /&gt;
Then go to the subroutine ''reactionrates_HC''. This is where you will write down the parametrization formula into the reaction rates table (the variable '''v_4''' for bimolecular reactions, '''v_3''' for quadratic reactions, or '''v_phot''' for all others). Again, you can take example of what's already there. If you want to use our example reaction, find the dedicated space, opening with the line:&lt;br /&gt;
 !---  e001: oh + co -&amp;gt; co2 + h&lt;br /&gt;
and simply uncomment the following lines:&lt;br /&gt;
 !nb_reaction_4 = nb_reaction_4 + 1&lt;br /&gt;
to update the index at which the rate is written in table '''v_4''', and then (for instance):&lt;br /&gt;
 !     jpl 2015&lt;br /&gt;
 &lt;br /&gt;
 !do ilev = 1,nlayer&lt;br /&gt;
 !!oh + co -&amp;gt; h + co2&lt;br /&gt;
 !   rate1 = 1.5e-13*(t(ilev)/300.)**(0.0)&lt;br /&gt;
 !!oh + co + m -&amp;gt; hoco&lt;br /&gt;
 !   ak0 = 5.9e-33*(t(ilev)/300.)**(-1.0)&lt;br /&gt;
 !   ak1 = 1.1e-12*(t(ilev)/300.)**(1.3)&lt;br /&gt;
 !   rate2 = (ak0*dens(ilev))/(1. + ak0*dens(ilev)/ak1)&lt;br /&gt;
 !   xpo2 = 1./(1. + alog10((ak0*dens(ilev))/ak1)**2)&lt;br /&gt;
 !      &lt;br /&gt;
 !   v_4(ilev,nb_reaction_4) = rate1 + rate2*0.6**xpo2&lt;br /&gt;
 !end do&lt;br /&gt;
(except the first one) to use the parametrization from the JPL 2015 collection (linked above). Notice that several parametrizations are implemented; to use another one simply uncomment another block, or write your own.&lt;br /&gt;
&lt;br /&gt;
== Hard-coding reactions with 3 products ==&lt;br /&gt;
The model does not natively handle reactions with 3 products. The trick is to instead split it into 2 &amp;quot;semi-reactions&amp;quot;, for instance instead of HNO3 + OH -&amp;gt; H2O + O + NO2, add 0.5 HNO3 + 0.5 OH -&amp;gt; H2O + 0.5 NO2 and 0.5 HNO3 + 0.5 OH -&amp;gt; O + 0.5 NO2 (or any stoichiometrically-equivalent couple). Each semi-reaction then has the same constant rate as the total reaction. Don't forget to count them as two distinct reactions.&lt;br /&gt;
&lt;br /&gt;
= Python post-processing tools for photochemistry =&lt;br /&gt;
A mini python library is available in the '''util''' directory of the Generic model (LMDZ.GENERIC/utils), along with a demonstration jupyter notebook.&lt;/div&gt;</summary>
		<author><name>Maxime Maurice</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Physics_of_the_Generic_PCM&amp;diff=2448</id>
		<title>Physics of the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Physics_of_the_Generic_PCM&amp;diff=2448"/>
				<updated>2025-03-04T11:05:37Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: /* CO2 condensation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the various physical parametrizations of the Generic PCM and the chronology of their call through the physical iteration. This chronology is important because some variables need to be updated by certain processes before others (examples).   &lt;br /&gt;
During one physical iteration, the code passes through multiple sub-routines each encapsulating a parametrization. The sub-routines usually take as arguments:&lt;br /&gt;
*the dynamical values of the state variables&lt;br /&gt;
*the dynamical tendencies of the state variables&lt;br /&gt;
*any additional relevant variable&lt;br /&gt;
*any additional relevant tendency&lt;br /&gt;
and it returns in general tendencies (of the state variables as well as of any other relevant variable).&lt;br /&gt;
&lt;br /&gt;
Work in progress. Need to add links.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Initialization=&lt;br /&gt;
==First call==&lt;br /&gt;
Some initializations only need to be done at the very first iteration (e.g. examples).&lt;br /&gt;
==Each call==&lt;br /&gt;
Some other initializations need to be done at each iteration (e.g. examples).&lt;br /&gt;
&lt;br /&gt;
=Radiative transfer=&lt;br /&gt;
==Correlated-k==&lt;br /&gt;
The main radiative transfer solver of the Generic PCM implements the correlated-k method, which provides a flexible and quick way to solve radiative transfer equations, particularly suited for GCMs. More informations here.&lt;br /&gt;
==Newtonian relaxation==&lt;br /&gt;
Newton was a very relaxed physicist, still inspiring us today.&lt;br /&gt;
==No atmosphere==&lt;br /&gt;
If you have no atmosphere, why do you need a GCM?&lt;br /&gt;
&lt;br /&gt;
=Vertical diffusion=&lt;br /&gt;
==vdifc==&lt;br /&gt;
More info [[Vdifc_mod|here]].&lt;br /&gt;
==turbdiff==&lt;br /&gt;
&lt;br /&gt;
=Convection=&lt;br /&gt;
Convective mixing in an atmosphere column involves non-resolved, sub-grid processes. These processes are parameterized using the following routines:&lt;br /&gt;
==Thermal plume==&lt;br /&gt;
This module implements a more accurate and sophisticated parametrization of convection. More info here.&lt;br /&gt;
&lt;br /&gt;
==Dry convection==&lt;br /&gt;
More info [[Convective_adjustment_scheme_in_the_generic_PCM|here]].&lt;br /&gt;
==Non-orographic gravity waves==&lt;br /&gt;
More info here.&lt;br /&gt;
&lt;br /&gt;
=CO2 condensation=&lt;br /&gt;
Inheriting from the Mars PCM where it is the background species, CO2 condensation is treated as a dedicated step in the Generic PCM's physics. Does that only concern CO2 as a background gas? Or does it work also if CO2 is a non-background variable gas? In any case more info here.&lt;br /&gt;
&lt;br /&gt;
=Tracers=&lt;br /&gt;
Many things can be advected by tracers in the Generic PCM, like chemical species or aerosols. Physical processes involving tracers are parameterized using the following routines:&lt;br /&gt;
&lt;br /&gt;
==Volcano==&lt;br /&gt;
This routine parameterizes a source of tracers corresponding to volcanic eruption. More information here.&lt;br /&gt;
&lt;br /&gt;
==Water/ice==&lt;br /&gt;
Water aerosols (liquid or solid) are created (resp. consumed) by condensation (resp. vaporization or sublimation), consuming (resp. releasing) latent heat in the atmosphere. In the Generic PCM, the (atmospheric part of the) water cycle is handled by various routines, as explained here.&lt;br /&gt;
&lt;br /&gt;
==Photochemistry==&lt;br /&gt;
Chemistry can turn molecules into other molecules, by the action of temperature (thermochemistry) or UV light (photochemistry). This is handled by the photochemistry routine, described [[Photochemistry|here]].&lt;br /&gt;
&lt;br /&gt;
==Generic condensation==&lt;br /&gt;
On Earth, only water condenses in the atmosphere, but on other planets (which the Generic PCM aims at simulating), many other chemicals can undergo state change. To take that into account, the Generic PCM has a flexible scheme to deal with any arbitrary species, as desbribed [[Radiative_Generic_Condensable_Specie|here]].&lt;br /&gt;
&lt;br /&gt;
==Sedimentation==&lt;br /&gt;
What goes up must come down, as explained [[Sedimentation_of_tracers_in_the_generic_PCM|here]].&lt;br /&gt;
&lt;br /&gt;
==Updates==&lt;br /&gt;
This section essentially takes care that the condensation of a major species (e.g. water vapor in steam-rich atmospheres) affects other species, as described here.&lt;br /&gt;
&lt;br /&gt;
==Slab ocean==&lt;br /&gt;
This routine solves for big fish eating small fish, as desbried [[Slab_ocean_model|here]].&lt;br /&gt;
&lt;br /&gt;
==Surface==&lt;br /&gt;
The surface part of the water cycle is handled here, as the hydrology page describes.&lt;br /&gt;
&lt;br /&gt;
=Subsurface thermal=&lt;br /&gt;
Thermal diffusion in the subsurface is solved here, as described there.&lt;br /&gt;
&lt;br /&gt;
=Diagnostics/write outputs=&lt;br /&gt;
Nothing very physical here, just writting the outputs! By the way, if you want to know how to output new variables in the diagfi.nc file, check out [[Guide_for_good_coding#Export_variables_in_the_diagfi.nc_file|this]] page.&lt;/div&gt;</summary>
		<author><name>Maxime Maurice</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Physics_of_the_Generic_PCM&amp;diff=2447</id>
		<title>Physics of the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Physics_of_the_Generic_PCM&amp;diff=2447"/>
				<updated>2025-03-04T11:03:28Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: /* Non-orographic gravity waves */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the various physical parametrizations of the Generic PCM and the chronology of their call through the physical iteration. This chronology is important because some variables need to be updated by certain processes before others (examples).   &lt;br /&gt;
During one physical iteration, the code passes through multiple sub-routines each encapsulating a parametrization. The sub-routines usually take as arguments:&lt;br /&gt;
*the dynamical values of the state variables&lt;br /&gt;
*the dynamical tendencies of the state variables&lt;br /&gt;
*any additional relevant variable&lt;br /&gt;
*any additional relevant tendency&lt;br /&gt;
and it returns in general tendencies (of the state variables as well as of any other relevant variable).&lt;br /&gt;
&lt;br /&gt;
Work in progress. Need to add links.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Initialization=&lt;br /&gt;
==First call==&lt;br /&gt;
Some initializations only need to be done at the very first iteration (e.g. examples).&lt;br /&gt;
==Each call==&lt;br /&gt;
Some other initializations need to be done at each iteration (e.g. examples).&lt;br /&gt;
&lt;br /&gt;
=Radiative transfer=&lt;br /&gt;
==Correlated-k==&lt;br /&gt;
The main radiative transfer solver of the Generic PCM implements the correlated-k method, which provides a flexible and quick way to solve radiative transfer equations, particularly suited for GCMs. More informations here.&lt;br /&gt;
==Newtonian relaxation==&lt;br /&gt;
Newton was a very relaxed physicist, still inspiring us today.&lt;br /&gt;
==No atmosphere==&lt;br /&gt;
If you have no atmosphere, why do you need a GCM?&lt;br /&gt;
&lt;br /&gt;
=Vertical diffusion=&lt;br /&gt;
==vdifc==&lt;br /&gt;
More info [[Vdifc_mod|here]].&lt;br /&gt;
==turbdiff==&lt;br /&gt;
&lt;br /&gt;
=Convection=&lt;br /&gt;
Convective mixing in an atmosphere column involves non-resolved, sub-grid processes. These processes are parameterized using the following routines:&lt;br /&gt;
==Thermal plume==&lt;br /&gt;
This module implements a more accurate and sophisticated parametrization of convection. More info here.&lt;br /&gt;
&lt;br /&gt;
==Dry convection==&lt;br /&gt;
More info [[Convective_adjustment_scheme_in_the_generic_PCM|here]].&lt;br /&gt;
==Non-orographic gravity waves==&lt;br /&gt;
More info here.&lt;br /&gt;
&lt;br /&gt;
=CO2 condensation=&lt;br /&gt;
&lt;br /&gt;
=Tracers=&lt;br /&gt;
Many things can be advected by tracers in the Generic PCM, like chemical species or aerosols. Physical processes involving tracers are parameterized using the following routines:&lt;br /&gt;
&lt;br /&gt;
==Volcano==&lt;br /&gt;
This routine parameterizes a source of tracers corresponding to volcanic eruption. More information here.&lt;br /&gt;
&lt;br /&gt;
==Water/ice==&lt;br /&gt;
Water aerosols (liquid or solid) are created (resp. consumed) by condensation (resp. vaporization or sublimation), consuming (resp. releasing) latent heat in the atmosphere. In the Generic PCM, the (atmospheric part of the) water cycle is handled by various routines, as explained here.&lt;br /&gt;
&lt;br /&gt;
==Photochemistry==&lt;br /&gt;
Chemistry can turn molecules into other molecules, by the action of temperature (thermochemistry) or UV light (photochemistry). This is handled by the photochemistry routine, described [[Photochemistry|here]].&lt;br /&gt;
&lt;br /&gt;
==Generic condensation==&lt;br /&gt;
On Earth, only water condenses in the atmosphere, but on other planets (which the Generic PCM aims at simulating), many other chemicals can undergo state change. To take that into account, the Generic PCM has a flexible scheme to deal with any arbitrary species, as desbribed [[Radiative_Generic_Condensable_Specie|here]].&lt;br /&gt;
&lt;br /&gt;
==Sedimentation==&lt;br /&gt;
What goes up must come down, as explained [[Sedimentation_of_tracers_in_the_generic_PCM|here]].&lt;br /&gt;
&lt;br /&gt;
==Updates==&lt;br /&gt;
This section essentially takes care that the condensation of a major species (e.g. water vapor in steam-rich atmospheres) affects other species, as described here.&lt;br /&gt;
&lt;br /&gt;
==Slab ocean==&lt;br /&gt;
This routine solves for big fish eating small fish, as desbried [[Slab_ocean_model|here]].&lt;br /&gt;
&lt;br /&gt;
==Surface==&lt;br /&gt;
The surface part of the water cycle is handled here, as the hydrology page describes.&lt;br /&gt;
&lt;br /&gt;
=Subsurface thermal=&lt;br /&gt;
Thermal diffusion in the subsurface is solved here, as described there.&lt;br /&gt;
&lt;br /&gt;
=Diagnostics/write outputs=&lt;br /&gt;
Nothing very physical here, just writting the outputs! By the way, if you want to know how to output new variables in the diagfi.nc file, check out [[Guide_for_good_coding#Export_variables_in_the_diagfi.nc_file|this]] page.&lt;/div&gt;</summary>
		<author><name>Maxime Maurice</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Physics_of_the_Generic_PCM&amp;diff=2446</id>
		<title>Physics of the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Physics_of_the_Generic_PCM&amp;diff=2446"/>
				<updated>2025-03-04T11:02:30Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: /* Thermal plume */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the various physical parametrizations of the Generic PCM and the chronology of their call through the physical iteration. This chronology is important because some variables need to be updated by certain processes before others (examples).   &lt;br /&gt;
During one physical iteration, the code passes through multiple sub-routines each encapsulating a parametrization. The sub-routines usually take as arguments:&lt;br /&gt;
*the dynamical values of the state variables&lt;br /&gt;
*the dynamical tendencies of the state variables&lt;br /&gt;
*any additional relevant variable&lt;br /&gt;
*any additional relevant tendency&lt;br /&gt;
and it returns in general tendencies (of the state variables as well as of any other relevant variable).&lt;br /&gt;
&lt;br /&gt;
Work in progress. Need to add links.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Initialization=&lt;br /&gt;
==First call==&lt;br /&gt;
Some initializations only need to be done at the very first iteration (e.g. examples).&lt;br /&gt;
==Each call==&lt;br /&gt;
Some other initializations need to be done at each iteration (e.g. examples).&lt;br /&gt;
&lt;br /&gt;
=Radiative transfer=&lt;br /&gt;
==Correlated-k==&lt;br /&gt;
The main radiative transfer solver of the Generic PCM implements the correlated-k method, which provides a flexible and quick way to solve radiative transfer equations, particularly suited for GCMs. More informations here.&lt;br /&gt;
==Newtonian relaxation==&lt;br /&gt;
Newton was a very relaxed physicist, still inspiring us today.&lt;br /&gt;
==No atmosphere==&lt;br /&gt;
If you have no atmosphere, why do you need a GCM?&lt;br /&gt;
&lt;br /&gt;
=Vertical diffusion=&lt;br /&gt;
==vdifc==&lt;br /&gt;
More info [[Vdifc_mod|here]].&lt;br /&gt;
==turbdiff==&lt;br /&gt;
&lt;br /&gt;
=Convection=&lt;br /&gt;
Convective mixing in an atmosphere column involves non-resolved, sub-grid processes. These processes are parameterized using the following routines:&lt;br /&gt;
==Thermal plume==&lt;br /&gt;
This module implements a more accurate and sophisticated parametrization of convection. More info here.&lt;br /&gt;
&lt;br /&gt;
==Dry convection==&lt;br /&gt;
More info [[Convective_adjustment_scheme_in_the_generic_PCM|here]].&lt;br /&gt;
==Non-orographic gravity waves==&lt;br /&gt;
&lt;br /&gt;
=CO2 condensation=&lt;br /&gt;
&lt;br /&gt;
=Tracers=&lt;br /&gt;
Many things can be advected by tracers in the Generic PCM, like chemical species or aerosols. Physical processes involving tracers are parameterized using the following routines:&lt;br /&gt;
&lt;br /&gt;
==Volcano==&lt;br /&gt;
This routine parameterizes a source of tracers corresponding to volcanic eruption. More information here.&lt;br /&gt;
&lt;br /&gt;
==Water/ice==&lt;br /&gt;
Water aerosols (liquid or solid) are created (resp. consumed) by condensation (resp. vaporization or sublimation), consuming (resp. releasing) latent heat in the atmosphere. In the Generic PCM, the (atmospheric part of the) water cycle is handled by various routines, as explained here.&lt;br /&gt;
&lt;br /&gt;
==Photochemistry==&lt;br /&gt;
Chemistry can turn molecules into other molecules, by the action of temperature (thermochemistry) or UV light (photochemistry). This is handled by the photochemistry routine, described [[Photochemistry|here]].&lt;br /&gt;
&lt;br /&gt;
==Generic condensation==&lt;br /&gt;
On Earth, only water condenses in the atmosphere, but on other planets (which the Generic PCM aims at simulating), many other chemicals can undergo state change. To take that into account, the Generic PCM has a flexible scheme to deal with any arbitrary species, as desbribed [[Radiative_Generic_Condensable_Specie|here]].&lt;br /&gt;
&lt;br /&gt;
==Sedimentation==&lt;br /&gt;
What goes up must come down, as explained [[Sedimentation_of_tracers_in_the_generic_PCM|here]].&lt;br /&gt;
&lt;br /&gt;
==Updates==&lt;br /&gt;
This section essentially takes care that the condensation of a major species (e.g. water vapor in steam-rich atmospheres) affects other species, as described here.&lt;br /&gt;
&lt;br /&gt;
==Slab ocean==&lt;br /&gt;
This routine solves for big fish eating small fish, as desbried [[Slab_ocean_model|here]].&lt;br /&gt;
&lt;br /&gt;
==Surface==&lt;br /&gt;
The surface part of the water cycle is handled here, as the hydrology page describes.&lt;br /&gt;
&lt;br /&gt;
=Subsurface thermal=&lt;br /&gt;
Thermal diffusion in the subsurface is solved here, as described there.&lt;br /&gt;
&lt;br /&gt;
=Diagnostics/write outputs=&lt;br /&gt;
Nothing very physical here, just writting the outputs! By the way, if you want to know how to output new variables in the diagfi.nc file, check out [[Guide_for_good_coding#Export_variables_in_the_diagfi.nc_file|this]] page.&lt;/div&gt;</summary>
		<author><name>Maxime Maurice</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Physics_of_the_Generic_PCM&amp;diff=2445</id>
		<title>Physics of the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Physics_of_the_Generic_PCM&amp;diff=2445"/>
				<updated>2025-03-04T10:49:14Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: /* Diagnostics/write outputs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the various physical parametrizations of the Generic PCM and the chronology of their call through the physical iteration. This chronology is important because some variables need to be updated by certain processes before others (examples).   &lt;br /&gt;
During one physical iteration, the code passes through multiple sub-routines each encapsulating a parametrization. The sub-routines usually take as arguments:&lt;br /&gt;
*the dynamical values of the state variables&lt;br /&gt;
*the dynamical tendencies of the state variables&lt;br /&gt;
*any additional relevant variable&lt;br /&gt;
*any additional relevant tendency&lt;br /&gt;
and it returns in general tendencies (of the state variables as well as of any other relevant variable).&lt;br /&gt;
&lt;br /&gt;
Work in progress. Need to add links.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Initialization=&lt;br /&gt;
==First call==&lt;br /&gt;
Some initializations only need to be done at the very first iteration (e.g. examples).&lt;br /&gt;
==Each call==&lt;br /&gt;
Some other initializations need to be done at each iteration (e.g. examples).&lt;br /&gt;
&lt;br /&gt;
=Radiative transfer=&lt;br /&gt;
==Correlated-k==&lt;br /&gt;
The main radiative transfer solver of the Generic PCM implements the correlated-k method, which provides a flexible and quick way to solve radiative transfer equations, particularly suited for GCMs. More informations here.&lt;br /&gt;
==Newtonian relaxation==&lt;br /&gt;
Newton was a very relaxed physicist, still inspiring us today.&lt;br /&gt;
==No atmosphere==&lt;br /&gt;
If you have no atmosphere, why do you need a GCM?&lt;br /&gt;
&lt;br /&gt;
=Vertical diffusion=&lt;br /&gt;
==vdifc==&lt;br /&gt;
More info [[Vdifc_mod|here]].&lt;br /&gt;
==turbdiff==&lt;br /&gt;
&lt;br /&gt;
=Convection=&lt;br /&gt;
Convective mixing in an atmosphere column involves non-resolved, sub-grid processes. These processes are parameterized using the following routines:&lt;br /&gt;
==Thermal plume==&lt;br /&gt;
==Dry convection==&lt;br /&gt;
More info [[Convective_adjustment_scheme_in_the_generic_PCM|here]].&lt;br /&gt;
==Non-orographic gravity waves==&lt;br /&gt;
&lt;br /&gt;
=CO2 condensation=&lt;br /&gt;
&lt;br /&gt;
=Tracers=&lt;br /&gt;
Many things can be advected by tracers in the Generic PCM, like chemical species or aerosols. Physical processes involving tracers are parameterized using the following routines:&lt;br /&gt;
&lt;br /&gt;
==Volcano==&lt;br /&gt;
This routine parameterizes a source of tracers corresponding to volcanic eruption. More information here.&lt;br /&gt;
&lt;br /&gt;
==Water/ice==&lt;br /&gt;
Water aerosols (liquid or solid) are created (resp. consumed) by condensation (resp. vaporization or sublimation), consuming (resp. releasing) latent heat in the atmosphere. In the Generic PCM, the (atmospheric part of the) water cycle is handled by various routines, as explained here.&lt;br /&gt;
&lt;br /&gt;
==Photochemistry==&lt;br /&gt;
Chemistry can turn molecules into other molecules, by the action of temperature (thermochemistry) or UV light (photochemistry). This is handled by the photochemistry routine, described [[Photochemistry|here]].&lt;br /&gt;
&lt;br /&gt;
==Generic condensation==&lt;br /&gt;
On Earth, only water condenses in the atmosphere, but on other planets (which the Generic PCM aims at simulating), many other chemicals can undergo state change. To take that into account, the Generic PCM has a flexible scheme to deal with any arbitrary species, as desbribed [[Radiative_Generic_Condensable_Specie|here]].&lt;br /&gt;
&lt;br /&gt;
==Sedimentation==&lt;br /&gt;
What goes up must come down, as explained [[Sedimentation_of_tracers_in_the_generic_PCM|here]].&lt;br /&gt;
&lt;br /&gt;
==Updates==&lt;br /&gt;
This section essentially takes care that the condensation of a major species (e.g. water vapor in steam-rich atmospheres) affects other species, as described here.&lt;br /&gt;
&lt;br /&gt;
==Slab ocean==&lt;br /&gt;
This routine solves for big fish eating small fish, as desbried [[Slab_ocean_model|here]].&lt;br /&gt;
&lt;br /&gt;
==Surface==&lt;br /&gt;
The surface part of the water cycle is handled here, as the hydrology page describes.&lt;br /&gt;
&lt;br /&gt;
=Subsurface thermal=&lt;br /&gt;
Thermal diffusion in the subsurface is solved here, as described there.&lt;br /&gt;
&lt;br /&gt;
=Diagnostics/write outputs=&lt;br /&gt;
Nothing very physical here, just writting the outputs! By the way, if you want to know how to output new variables in the diagfi.nc file, check out [[Guide_for_good_coding#Export_variables_in_the_diagfi.nc_file|this]] page.&lt;/div&gt;</summary>
		<author><name>Maxime Maurice</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Guide_for_good_coding&amp;diff=2444</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=2444"/>
				<updated>2025-02-28T09:06:16Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: /* Add a new user-input variable in physics modules */&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 tagged 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;
== Add a new user-input variable in physics modules ==&lt;br /&gt;
&lt;br /&gt;
How to properly add a new variable read from callphys.def&lt;br /&gt;
&lt;br /&gt;
* Declare your variable in the callkeys module:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real,save :: myvariable&lt;br /&gt;
!$OMP THREADPRIVATE(myvariable)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Import it from the callkeys module into your module:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot; line&amp;gt;&lt;br /&gt;
use callkeys_mod, only myvariable&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Look for the flag in callphys.def ('myvariableflag' in the example below) during physics' initialization, or give it a default value if not found (666 in the example below) (in module inifis_mod.F90 for the Generic, Pluto and Titan PCMs, conf_phys for Mars and Venus PCMs):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot; line&amp;gt;&lt;br /&gt;
if (is_master) write(*,*)trim(rname)//&amp;quot;: Variable description&amp;quot;&lt;br /&gt;
myvariable=666.         ! default value&lt;br /&gt;
call getin_p(&amp;quot;myvariableflag&amp;quot;,myvariable)&lt;br /&gt;
if (is_master) write(*,*)trim(rname)//&amp;quot;: myvariable = &amp;quot;,myvariable&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
notice that you don't need to import your variable specifically into inifis_mod / conf_phys because all variables from callkeys_mod are imported.&lt;br /&gt;
&lt;br /&gt;
== Export variables in the diagfi.nc file ==&lt;br /&gt;
Simply use the writediagfi routine:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot; line&amp;gt;&lt;br /&gt;
call writediagfi(ngrid,&amp;quot;name_in_netcdf_file&amp;quot;,&amp;quot;description_in_netcdf_file&amp;quot;,&amp;quot;units&amp;quot;,dimensions,myvariable)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&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 routine/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 if in free form, e.g. .F90 files)&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;
* Always check your modifications and additions by compiling and running in &amp;quot;debug&amp;quot; mode!&lt;br /&gt;
* Create .F90 (i.e. free form) instead of .F (i.e. fixed form); but this doesn't mean you should make lines too long!&lt;br /&gt;
* Delete unused argument in a function/routine call if you see one&lt;br /&gt;
* Delete unused variables&lt;br /&gt;
* Choose meaningful names for variables and mention physical unit where they are declared&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;
== External resources ==&lt;br /&gt;
&lt;br /&gt;
You can check these pages for some guidelines and advice:&lt;br /&gt;
* https://www.fortran90.org/src/best-practices.html&lt;br /&gt;
* https://fortran-lang.org/en/learn/best_practices/&lt;br /&gt;
* https://wvuhpc.github.io/Modern-Fortran/11-Best-Practices/index.html&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>Maxime Maurice</name></author>	</entry>

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

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Guide_for_good_coding&amp;diff=2318</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=2318"/>
				<updated>2025-01-23T09:51:44Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: &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 tagged 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;
== Add a new user-input variable in physics modules ==&lt;br /&gt;
&lt;br /&gt;
How to properly add a new variable read from callphys.def&lt;br /&gt;
&lt;br /&gt;
=== Generic PCM's physics ===&lt;br /&gt;
* Declare your variable in the callkeys module:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real,save :: myvariable&lt;br /&gt;
!$OMP THREADPRIVATE(myvariable)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Import it your module:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot; line&amp;gt;&lt;br /&gt;
use callkeys_mod, only myvariable&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Look for the flag in callphys.def ('myvariableflag' in the example below) during physics' initialization, or give it a default value if not found (666 in the example below) (in module inifis_mod.F90):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot; line&amp;gt;&lt;br /&gt;
if (is_master) write(*,*)trim(rname)//&amp;quot;: Variable description&amp;quot;&lt;br /&gt;
myvariable=666.         ! default value&lt;br /&gt;
call getin_p(&amp;quot;myvariableflag&amp;quot;,myvariable)&lt;br /&gt;
if (is_master) write(*,*)trim(rname)//&amp;quot;: myvariable = &amp;quot;,myvariable&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
notice that you don't need to import your variable specifically in inifis_mod because all variables from callkeys_mod are imported.&lt;br /&gt;
&lt;br /&gt;
== Export variables in the diagfi.nc file ==&lt;br /&gt;
Simply use the writediagfi routine:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;Fortran&amp;quot; line&amp;gt;&lt;br /&gt;
call writediagfi(ngrid,&amp;quot;name_in_netcdf_file&amp;quot;,&amp;quot;description_in_netcdf_file&amp;quot;,&amp;quot;units&amp;quot;,dimensions,myvariable)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&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 routine/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 if in free form, e.g. .F90 files)&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;
* Always check your modifications and additions by compiling and running in &amp;quot;debug&amp;quot; mode!&lt;br /&gt;
* Create .F90 (i.e. free form) instead of .F (i.e. fixed form); but this doesn't mean you should make lines too long!&lt;br /&gt;
* Delete unused argument in a function/routine call if you see one&lt;br /&gt;
* Delete unused variables&lt;br /&gt;
* Choose meaningful names for variables and mention physical unit where they are declared&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;
== External resources ==&lt;br /&gt;
&lt;br /&gt;
You can check these pages for some guidelines and advice:&lt;br /&gt;
* https://www.fortran90.org/src/best-practices.html&lt;br /&gt;
* https://fortran-lang.org/en/learn/best_practices/&lt;br /&gt;
* https://wvuhpc.github.io/Modern-Fortran/11-Best-Practices/index.html&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>Maxime Maurice</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Physics_of_the_Generic_PCM&amp;diff=2314</id>
		<title>Physics of the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Physics_of_the_Generic_PCM&amp;diff=2314"/>
				<updated>2025-01-20T13:03:25Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the various physical parametrizations of the Generic PCM and the chronology of their call through the physical iteration. This chronology is important because some variables need to be updated by certain processes before others (examples).   &lt;br /&gt;
During one physical iteration, the code passes through multiple sub-routines each encapsulating a parametrization. The sub-routines usually take as arguments:&lt;br /&gt;
*the dynamical values of the state variables&lt;br /&gt;
*the dynamical tendencies of the state variables&lt;br /&gt;
*any additional relevant variable&lt;br /&gt;
*any additional relevant tendency&lt;br /&gt;
and it returns in general tendencies (of the state variables as well as of any other relevant variable).&lt;br /&gt;
&lt;br /&gt;
Work in progress. Need to add links.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Initialization=&lt;br /&gt;
==First call==&lt;br /&gt;
Some initializations only need to be done at the very first iteration (e.g. examples).&lt;br /&gt;
==Each call==&lt;br /&gt;
Some other initializations need to be done at each iteration (e.g. examples).&lt;br /&gt;
&lt;br /&gt;
=Radiative transfer=&lt;br /&gt;
==Correlated-k==&lt;br /&gt;
The main radiative transfer solver of the Generic PCM implements the correlated-k method, which provides a flexible and quick way to solve radiative transfer equations, particularly suited for GCMs. More informations here.&lt;br /&gt;
==Newtonian relaxation==&lt;br /&gt;
Newton was a very relaxed physicist, still inspiring us today.&lt;br /&gt;
==No atmosphere==&lt;br /&gt;
If you have no atmosphere, why do you need a GCM?&lt;br /&gt;
&lt;br /&gt;
=Vertical diffusion=&lt;br /&gt;
==vdifc==&lt;br /&gt;
More info [[Vdifc_mod|here]].&lt;br /&gt;
==turbdiff==&lt;br /&gt;
&lt;br /&gt;
=Convection=&lt;br /&gt;
Convective mixing in an atmosphere column involves non-resolved, sub-grid processes. These processes are parameterized using the following routines:&lt;br /&gt;
==Thermal plume==&lt;br /&gt;
==Dry convection==&lt;br /&gt;
More info [[Convective_adjustment_scheme_in_the_generic_PCM|here]].&lt;br /&gt;
==Non-orographic gravity waves==&lt;br /&gt;
&lt;br /&gt;
=CO2 condensation=&lt;br /&gt;
&lt;br /&gt;
=Tracers=&lt;br /&gt;
Many things can be advected by tracers in the Generic PCM, like chemical species or aerosols. Physical processes involving tracers are parameterized using the following routines:&lt;br /&gt;
&lt;br /&gt;
==Volcano==&lt;br /&gt;
This routine parameterizes a source of tracers corresponding to volcanic eruption. More information here.&lt;br /&gt;
&lt;br /&gt;
==Water/ice==&lt;br /&gt;
Water aerosols (liquid or solid) are created (resp. consumed) by condensation (resp. vaporization or sublimation), consuming (resp. releasing) latent heat in the atmosphere. In the Generic PCM, the (atmospheric part of the) water cycle is handled by various routines, as explained here.&lt;br /&gt;
&lt;br /&gt;
==Photochemistry==&lt;br /&gt;
Chemistry can turn molecules into other molecules, by the action of temperature (thermochemistry) or UV light (photochemistry). This is handled by the photochemistry routine, described [[Photochemistry|here]].&lt;br /&gt;
&lt;br /&gt;
==Generic condensation==&lt;br /&gt;
On Earth, only water condenses in the atmosphere, but on other planets (which the Generic PCM aims at simulating), many other chemicals can undergo state change. To take that into account, the Generic PCM has a flexible scheme to deal with any arbitrary species, as desbribed [[Radiative_Generic_Condensable_Specie|here]].&lt;br /&gt;
&lt;br /&gt;
==Sedimentation==&lt;br /&gt;
What goes up must come down, as explained [[Sedimentation_of_tracers_in_the_generic_PCM|here]].&lt;br /&gt;
&lt;br /&gt;
==Updates==&lt;br /&gt;
This section essentially takes care that the condensation of a major species (e.g. water vapor in steam-rich atmospheres) affects other species, as described here.&lt;br /&gt;
&lt;br /&gt;
==Slab ocean==&lt;br /&gt;
This routine solves for big fish eating small fish, as desbried [[Slab_ocean_model|here]].&lt;br /&gt;
&lt;br /&gt;
==Surface==&lt;br /&gt;
The surface part of the water cycle is handled here, as the hydrology page describes.&lt;br /&gt;
&lt;br /&gt;
=Subsurface thermal=&lt;br /&gt;
Thermal diffusion in the subsurface is solved here, as described there.&lt;br /&gt;
&lt;br /&gt;
=Diagnostics/write outputs=&lt;br /&gt;
Nothing very physical here, just writting the outputs!&lt;/div&gt;</summary>
		<author><name>Maxime Maurice</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Physics_of_the_Generic_PCM&amp;diff=2307</id>
		<title>Physics of the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Physics_of_the_Generic_PCM&amp;diff=2307"/>
				<updated>2025-01-13T16:50:43Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the various physical parametrizations of the Generic PCM and the chronology of their call through the physical iteration. This chronology is important because some variables need to be updated by certain processes before others (examples).   &lt;br /&gt;
During one physical iteration, the code passes through multiple sub-routines each encapsulating a parametrization. The sub-routines usually take as arguments:&lt;br /&gt;
*the dynamical values of the state variables&lt;br /&gt;
*the dynamical tendencies of the state variables&lt;br /&gt;
*any additional relevant variable&lt;br /&gt;
*any additional relevant tendency&lt;br /&gt;
and it returns in general tendencies (of the state variables as well as of any other relevant variable).&lt;br /&gt;
&lt;br /&gt;
Work in progress. Need to add links.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Initialization=&lt;br /&gt;
==First call==&lt;br /&gt;
Some initializations only need to be done at the very first iteration (e.g. examples).&lt;br /&gt;
==Each call==&lt;br /&gt;
Some other initializations need to be done at each iteration (e.g. examples).&lt;br /&gt;
&lt;br /&gt;
=Radiative transfer=&lt;br /&gt;
==Correlated-k==&lt;br /&gt;
The main radiative transfer solver of the Generic PCM implements the correlated-k method, which provides a flexible and quick way to solve radiative transfer equations, particularly suited for GCMs. More informations here.&lt;br /&gt;
==Newtonian relaxation==&lt;br /&gt;
Newton was a very relaxed physicist, still inspiring us today.&lt;br /&gt;
==No atmosphere==&lt;br /&gt;
If you have no atmosphere, why do you need a GCM?&lt;br /&gt;
&lt;br /&gt;
=Vertical diffusion=&lt;br /&gt;
==vdifc==&lt;br /&gt;
==turbdiff==&lt;br /&gt;
&lt;br /&gt;
=Convection=&lt;br /&gt;
Convective mixing in an atmosphere column involves non-resolved, sub-grid processes. These processes are parameterized using the following routines:&lt;br /&gt;
==Thermal plume==&lt;br /&gt;
==Dry convection==&lt;br /&gt;
==Non-orographic gravity waves==&lt;br /&gt;
&lt;br /&gt;
=CO2 condensation=&lt;br /&gt;
&lt;br /&gt;
=Tracers=&lt;br /&gt;
Many things can be advected by tracers in the Generic PCM, like chemical species or aerosols. Physical processes involving tracers are parameterized using the following routines:&lt;br /&gt;
&lt;br /&gt;
==Volcano==&lt;br /&gt;
This routine parameterizes a source of tracers corresponding to volcanic eruption. More information here.&lt;br /&gt;
&lt;br /&gt;
==Water/ice==&lt;br /&gt;
Water aerosols (liquid or solid) are created (resp. consumed) by condensation (resp. vaporization or sublimation), consuming (resp. releasing) latent heat in the atmosphere. In the Generic PCM, the (atmospheric part of the) water cycle is handled by various routines, as explained here.&lt;br /&gt;
&lt;br /&gt;
==Photochemistry==&lt;br /&gt;
Chemistry can turn molecules into other molecules, by the action of temperature (thermochemistry) or UV light (photochemistry). This is handled by the photochemistry routine, described here.&lt;br /&gt;
&lt;br /&gt;
==Generic condensation==&lt;br /&gt;
On Earth, only water condenses in the atmosphere, but on other planets (which the Generic PCM aims at simulating), many other chemicals can undergo state change. To take that into account, the Generic PCM has a flexible scheme to deal with any arbitrary species, as desbribed here.&lt;br /&gt;
&lt;br /&gt;
==Sedimentation==&lt;br /&gt;
What goes up must come down, as explained here.&lt;br /&gt;
&lt;br /&gt;
==Updates==&lt;br /&gt;
This section essentially takes care that the condensation of a major species (e.g. water vapor in steam-rich atmospheres) affects other species, as described here.&lt;br /&gt;
&lt;br /&gt;
==Slab ocean==&lt;br /&gt;
This routine solves for big fish eating small fish, as desbried here.&lt;br /&gt;
&lt;br /&gt;
==Surface==&lt;br /&gt;
The surface part of the water cycle is handled here, as the hydrology page describes.&lt;br /&gt;
&lt;br /&gt;
=Subsurface thermal=&lt;br /&gt;
Thermal diffusion in the subsurface is solved here, as described there.&lt;br /&gt;
&lt;br /&gt;
=Diagnostics/write outputs=&lt;br /&gt;
Nothing very physical here, just writting the outputs!&lt;/div&gt;</summary>
		<author><name>Maxime Maurice</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Overview_of_the_Generic_PCM&amp;diff=2306</id>
		<title>Overview of the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Overview_of_the_Generic_PCM&amp;diff=2306"/>
				<updated>2025-01-13T16:46:30Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is a GCM ==&lt;br /&gt;
&lt;br /&gt;
A Global Climate Model (GCM) like the Generic PCM calculates the temporal evolution of the different variables (temperature, pressure, mass, mixing ratio of tracers/gas/clouds, winds, etc.) that control or describe the planetary meteorology and climate at different points of a 3D “grid” that covers the entire atmosphere.&lt;br /&gt;
&lt;br /&gt;
To do that, the model solves 3D hydrodynamic equations that describe how atmospheric winds are created by various physical forcings (radiative heating/cooling, etc.) and how these winds transport and redistribute the various atmospheric fields (temperature, tracers, etc.). However, it can be shown that to a good level of approximation, the various forcings can be computed using only local conditions in a column of atmosphere, whereas long-range couplings between various points of the planet are mediated through atmospheric transport. &lt;br /&gt;
&lt;br /&gt;
[[File:Didi-eps-converted-to-1.png|thumb|Physics / Dynamics interface ; credit: Emmanuel Marcq]]&lt;br /&gt;
&lt;br /&gt;
For these reasons, the 3D model is split in two components:&lt;br /&gt;
&lt;br /&gt;
* '''a 3D dynamical core''' abble to integrate in time the general equations for atmospheric circulation when the various local forcings are known. This component (including source code) is common to all terrestrial-type atmospheres, and applicable in certain cases to the upper atmospheres of gas giant planets.&lt;br /&gt;
* [[Physics_of_the_Generic_PCM|'''a physical package''']] that is specific to the planet in question (as it takes into account dedicated parametrizations representative of ongoing physical processes) and which computes atmospheric processes in each atmospheric column (which are sub-grid-scale from the point of view of the dynamical core).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In practice, we have several '''dynamical cores''' available with the model: LMDZ (global longitude/latitude grid), DYNAMICO (icosaedric grid), and WRF (rectangular box for local/regional studies)&lt;br /&gt;
&lt;br /&gt;
From an initial state, the model calculates the temporal evolution of these variables, one timestep after another:&lt;br /&gt;
* At instant t, variables X&amp;lt;sub&amp;gt;t&amp;lt;/sub&amp;gt; (temperature for example) are known at every grid point of the atmosphere.&lt;br /&gt;
* The physical model calculates the local time derivatives of the various variables -- called the tendencies -- ((δX/δt)&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;, (δX/δt)&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;, etc.) due to each physical phenomenon: for example, heating due to absorption of solar radiation and infrared cooling, mixing due to turbulence in the planetary boundary layer, condensation/evaporation of water vapor, etc. These tendencies are calculated via parameterization of the processes involved that try to capture the physical behavior of the atmopshere at the subgrid scale. &lt;br /&gt;
* These tendencies are passed to the dynamical core that integrates the model forward in time to the next time step, t + δt, by solving the hydrodynamical equations. &lt;br /&gt;
* This new state can be used to recompute the tendencies for the next time step and so on.&lt;br /&gt;
&lt;br /&gt;
== Philosophy of the Generic PCM ==&lt;br /&gt;
&lt;br /&gt;
The accuracy and predictive power of any GCM is often dictated by the choice made for the physical phenomena that are included and for the way they are parametrized. To be accurate, many Earth-centric climate models use very complex parametrizations that are heavily tuned on Earth observations. Such parametrizations can, however, behave very poorly far from the parameter space where they have been validated, thus reducing their predictive power for exotic atmospheres. &lt;br /&gt;
&lt;br /&gt;
As the goal of the Generic PCM is to model the climate of very different planets with the same model, a particular emphasis has been put on using simple parametrizations based as much as possible on ab-initio physical equations and conservation principles to avoid unphysical behaviors in extreme regimes. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== GCM inputs and outputs ==&lt;br /&gt;
&lt;br /&gt;
[[File:Inout-eps-converted-to-1.png|thumb|input/output data]]&lt;br /&gt;
&lt;br /&gt;
The input files are the files needed to initialize the model (state of the atmosphere at instant t0 as well as a dataset of boundary conditions). The output files are “historical files”, archives of the atmospheric flow history as simulated by the model: the “diagfi files”, the “stats files”, the daily averages, and so on. The &amp;quot;parameter files&amp;quot; are the files describing the physical parameters of the planet, as well as the physical parameterizations used in the model. The figure (on the right) shows the main architecture of the Generic PCM.&lt;br /&gt;
&lt;br /&gt;
==== start and startfi files ====&lt;br /&gt;
&lt;br /&gt;
GCM simulations needs a list of initial conditions/parameters to be run. This includes, for example, the initial temperature field, wind field, cloud field, position of water reservoirs on the surface, etc.&lt;br /&gt;
&lt;br /&gt;
In the Generic PCM, initial conditions/parameters are stored [[The_start.nc_and_startfi.nc_input_files|in two files named &amp;quot;start.nc&amp;quot; and &amp;quot;startfi.nc&amp;quot;]]. At each new run, the GCM reads these two files to set up the proper set of initial conditions.&lt;br /&gt;
&lt;br /&gt;
==== start vs restart files ====&lt;br /&gt;
&lt;br /&gt;
At the end of each GCM simulation, the Generic PCM produces several output files, and notably two files named &amp;quot;restart.nc&amp;quot; and &amp;quot;restartfi.nc&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
These two files store all the final conditions of the model, which includes, for example, the initial temperature field, wind field, cloud field, position of water reservoirs on the surface, etc.&lt;br /&gt;
&lt;br /&gt;
These &amp;quot;restart.nc&amp;quot; and &amp;quot;restartfi.nc&amp;quot; have the exact same architecture than the &amp;quot;start.nc&amp;quot; and &amp;quot;startfi.nc&amp;quot; files, and can thus be used as initial conditions for a new Generic PCM simulation.&lt;br /&gt;
&lt;br /&gt;
==== parameter (.def) files ====&lt;br /&gt;
&lt;br /&gt;
The parameter files (listed below) are files required by the Generic PCM to run.&lt;br /&gt;
&lt;br /&gt;
List of needed .def files:&lt;br /&gt;
 &amp;lt;ul&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; [https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/The_callphys.def_Input_File ''callphys.def'']: Physical parameters used in the simulation&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; [https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/The_run.def_Input_File ''run.def'']: Numerical parameters used in the simulation&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; [https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/The_gases.def_Input_File ''gases.def'']: List of gases in the simulations&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; [https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/The_traceur.def_Input_File ''traceur.def'']: Numerical tracers in the simulations&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; [https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/The_z2sig.def_Input_File ''z2sig.def'']: Pseudo-altitudes (in km) at which the user wants to set the vertical levels&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt; [https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/The_diagfi.def_Input_File ''diagfi.def''] (optional): List of wanted outputs&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== input data ====&lt;br /&gt;
&lt;br /&gt;
The Generic PCM requires several inputs in order to run. This includes, for instance:&lt;br /&gt;
* opacity tables&lt;br /&gt;
* aerosols optical properties&lt;br /&gt;
* stellar spectrum&lt;br /&gt;
&lt;br /&gt;
These data can be modified/adapted by the users depending on the planet to be simulated.&lt;br /&gt;
&lt;br /&gt;
==== output files ====&lt;br /&gt;
&lt;br /&gt;
At the end of each GCM simulation, the Generic PCM produces several output files, and notably a file named &amp;quot;diagfi.nc&amp;quot;. This file is an archive of the atmospheric/surface fields (temperatures, winds, clouds, etc.) along the GCM simulation. This is the file that contains most of the information needed to analyze/understand the content of a GCM simulation.&lt;br /&gt;
&lt;br /&gt;
nb: The Generic PCM can also produce extra output files, such as the &amp;quot;diagspec.nc&amp;quot; files (that keep track of the spectral radiative fluxes in the GCM), the &amp;quot;stats.nc&amp;quot; (that keep track of statistical information along the GCM simulation), etc.&lt;br /&gt;
&lt;br /&gt;
== Our team of developers (by alphabetical order) ==&lt;br /&gt;
&lt;br /&gt;
'''Active contributors'''&lt;br /&gt;
&lt;br /&gt;
*Deborah Bardet&lt;br /&gt;
*Siddharth Bhatnagar&lt;br /&gt;
*Benjamin Charnay (permanent, LESIA)&lt;br /&gt;
*Guillaume Chaverot&lt;br /&gt;
*Noé Clément&lt;br /&gt;
*Aurélien Falco&lt;br /&gt;
*François Forget (permanent, LMD)&lt;br /&gt;
*Gabriella Gilli&lt;br /&gt;
*Sandrine Guerlet (permanent, LMD)&lt;br /&gt;
*Mathilde Houelle&lt;br /&gt;
*Yassin Jaziri&lt;br /&gt;
*Sébastien Lebonnois (permanent, LMD)&lt;br /&gt;
*Jeremy Leconte (permanent, LAB)&lt;br /&gt;
*Maxence Lefèvre&lt;br /&gt;
*Arthur Le Saux&lt;br /&gt;
*Alice Maurel&lt;br /&gt;
*Maxime Maurice&lt;br /&gt;
*Gwenael Milcareck&lt;br /&gt;
*Ehouarn Millour (permanent, LMD)&lt;br /&gt;
*Aymeric Spiga (permanent, LMD)&lt;br /&gt;
*Keigo Taniguchi&lt;br /&gt;
*Lucas Teinturier&lt;br /&gt;
*Martin Turbet (permanent, LMD)&lt;br /&gt;
&lt;br /&gt;
'''Collaborators and previous contributors'''&lt;br /&gt;
&lt;br /&gt;
*Tanguy Bertrand&lt;br /&gt;
*Antoine Bierjon&lt;br /&gt;
*Alexandre Boissinot&lt;br /&gt;
*Emeline Bolmont&lt;br /&gt;
*Francis Codron&lt;br /&gt;
*Antony Delavois&lt;br /&gt;
*Thomas Dubos&lt;br /&gt;
*Vincent Eymet&lt;br /&gt;
*Frédéric Hourdin&lt;br /&gt;
*Franck Lefèvre&lt;br /&gt;
*Laura Kerber&lt;br /&gt;
*Jean-Baptiste Madeleine&lt;br /&gt;
*Emmanuel Marcq&lt;br /&gt;
*Diogo Quirino&lt;br /&gt;
*Franck Selsis&lt;br /&gt;
*Jan Vatant d'Olonne&lt;br /&gt;
*Margaux Vals&lt;br /&gt;
*Romain Vandemeulebrouck&lt;br /&gt;
*Robin Wordsworth&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>Maxime Maurice</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Physics_of_the_Generic_PCM&amp;diff=2305</id>
		<title>Physics of the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Physics_of_the_Generic_PCM&amp;diff=2305"/>
				<updated>2025-01-09T17:03:09Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: Created page with &amp;quot;This page describes the chronology of the physical iteration of the Generic PCM.  This chronology is important because some variables need to be updated by certain processes b...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the chronology of the physical iteration of the Generic PCM.  This chronology is important because some variables need to be updated by certain processes before others within the physical iteration (examples).    &lt;br /&gt;
During one physical iteration, the code passes through multiple sub-routines each encapsulating a parameterization. The sub-routines are passed as arguments:&lt;br /&gt;
- the dynamical values of the state variables&lt;br /&gt;
- the dynamical tendencies of the state variables&lt;br /&gt;
- any additional relevant variable&lt;br /&gt;
- any additional relevant tendency&lt;br /&gt;
and it returns in general tendencies (of the state variables as well as of any other relevant variable).&lt;br /&gt;
&lt;br /&gt;
Work in progress. Need to add links.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Initialization=&lt;br /&gt;
==First call==&lt;br /&gt;
Some initializations only need to be done at the very first iteration (e.g. examples).&lt;br /&gt;
==Each call==&lt;br /&gt;
Some other initializations need to be done at each iteration (e.g. examples).&lt;br /&gt;
&lt;br /&gt;
=Radiative transfer=&lt;br /&gt;
==Correlated-k==&lt;br /&gt;
The main radiative transfer solver of the Generic PCM implements the correlated-k method, which provides a flexible and quick way to solve radiative transfer equations, particularly suited for GCMs. More informations here.&lt;br /&gt;
==Newtonian relaxation==&lt;br /&gt;
Newton was a very relaxed physicist, still inspiring us today.&lt;br /&gt;
==No atmosphere==&lt;br /&gt;
If you have no atmosphere, why do you need a GCM?&lt;br /&gt;
&lt;br /&gt;
=Vertical diffusion=&lt;br /&gt;
==vdifc==&lt;br /&gt;
==turbdiff==&lt;br /&gt;
&lt;br /&gt;
=Convection=&lt;br /&gt;
Convective mixing in an atmosphere column involves non-resolved, sub-grid processes. These processes are parameterized using the following routines:&lt;br /&gt;
==Thermal plume==&lt;br /&gt;
==Dry convection==&lt;br /&gt;
==Non-orographic gravity waves==&lt;br /&gt;
&lt;br /&gt;
=CO2 condensation=&lt;br /&gt;
&lt;br /&gt;
=Tracers=&lt;br /&gt;
Many things can be advected by tracers in the Generic PCM, like chemical species or aerosols. Physical processes involving tracers are parameterized using the following routines:&lt;br /&gt;
&lt;br /&gt;
==Volcano==&lt;br /&gt;
This routine parameterizes a source of tracers corresponding to volcanic eruption. More information here.&lt;br /&gt;
&lt;br /&gt;
==Water/ice==&lt;br /&gt;
Water aerosols (liquid or solid) are created (resp. consumed) by condensation (resp. vaporization or sublimation), consuming (resp. releasing) latent heat in the atmosphere. In the Generic PCM, the (atmospheric part of the) water cycle is handled by various routines, as explained here.&lt;br /&gt;
&lt;br /&gt;
==Photochemistry==&lt;br /&gt;
Chemistry can turn molecules into other molecules, by the action of temperature (thermochemistry) or UV light (photochemistry). This is handled by the photochemistry routine, described here.&lt;br /&gt;
&lt;br /&gt;
==Generic condensation==&lt;br /&gt;
On Earth, only water condenses in the atmosphere, but on other planets (which the Generic PCM aims at simulating), many other chemicals can undergo state change. To take that into account, the Generic PCM has a flexible scheme to deal with any arbitrary species, as desbribed here.&lt;br /&gt;
&lt;br /&gt;
==Sedimentation==&lt;br /&gt;
What goes up must come down, as explained here.&lt;br /&gt;
&lt;br /&gt;
==Updates==&lt;br /&gt;
This section essentially takes care that the condensation of a major species (e.g. water vapor in steam-rich atmospheres) affects other species, as described here.&lt;br /&gt;
&lt;br /&gt;
==Slab ocean==&lt;br /&gt;
This routine solves for big fish eating small fish, as desbried here.&lt;br /&gt;
&lt;br /&gt;
==Surface==&lt;br /&gt;
The surface part of the water cycle is handled here, as the hydrology page describes.&lt;br /&gt;
&lt;br /&gt;
=Subsurface thermal=&lt;br /&gt;
Thermal diffusion in the subsurface is solved here, as described there.&lt;br /&gt;
&lt;br /&gt;
=Diagnostics/write outputs=&lt;br /&gt;
Nothing very physical here, just writting the outputs!&lt;/div&gt;</summary>
		<author><name>Maxime Maurice</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Early_Mars_benchmark_-_DYNAMICO&amp;diff=2201</id>
		<title>Early Mars benchmark - DYNAMICO</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Early_Mars_benchmark_-_DYNAMICO&amp;diff=2201"/>
				<updated>2024-10-23T08:03:16Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: Created page with &amp;quot;== Prerequisites ==  First make sure you can run the early Mars benchmark with the LMDZ dynamical core. Then install dynamico and XIOS (preferentially in the same trunk direct...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
First make sure you can run the early Mars benchmark with the LMDZ dynamical core.&lt;br /&gt;
Then install dynamico and XIOS (preferentially in the same trunk directory).&lt;br /&gt;
Now that everything is working separately, let's put everything together.&lt;br /&gt;
&lt;br /&gt;
== Compiling dynamico with the generic PCM physics package ==&lt;br /&gt;
&lt;br /&gt;
First we need to compile dynamico with the physics package of the generic PCM. Go to the ICOSA_LMDZ folder. To compile, we will use the '''make_icosa_lmdz''' file which is a wrapper for the compilation scripts of IOIPSL, XIOS, the generic PCM's physics (called by '''makelmdz_fcm -libphy''') and dynamico ('''make_icosa'''). Some compilation command line examples are provded in the ascii files '''make_irene_lmdz''' and '''compile_adastra-gnu'''. For our purpose, let's go with the following command:&lt;br /&gt;
&lt;br /&gt;
 make_icosa_lmdz -p std -p_opt &amp;quot;-b 32x36&amp;quot; -parallel mpi_omp -arch {your_arch} -arch_path ../ARCH -job 8&lt;br /&gt;
&lt;br /&gt;
Make sure that you have been using the same architecture for installing all the pieces. If the compilation worked, the last lines of the prompt look something like:&lt;br /&gt;
&lt;br /&gt;
 -&amp;gt;Make               : 6 seconds&lt;br /&gt;
 -&amp;gt;TOTAL              : 7 seconds&lt;br /&gt;
 Build command finished on Mon Oct 21 15:05:13 2024.&lt;br /&gt;
&lt;br /&gt;
Notice that it will probably take a bit longer, in particular if XIOS needs to be compiled. The bin folder now contains an executable called '''icosa_lmdz.exe'''.&lt;br /&gt;
&lt;br /&gt;
== Adapting the early Mars benchmark ==&lt;br /&gt;
&lt;br /&gt;
Now go to the folder of the early Mars benchmark sources, and create a subfolder called &amp;quot;dynamico&amp;quot;. Copy and paste all the .def files from the benchmark into this folder, as well as your executable '''icosa_lmdz.exe'''.&lt;br /&gt;
&lt;br /&gt;
=== planetary_const.def ===&lt;br /&gt;
&lt;br /&gt;
We'll need additional .def files for the planetary constants and run informations. You can simply copy and paste the '''const_earth.def''' for Earth used in the Held and Suarez test of dynamico into the local folder as '''const_mars.def''', and adapt it appropriately.&lt;br /&gt;
&lt;br /&gt;
=== run_icosa.def ===&lt;br /&gt;
&lt;br /&gt;
We'll also use a '''run_icosa.def''' file, for which you can find inforrmation here. You can modify it to have 40 triangles subdivisions and n_spliti and n_splitj equal to 4, and llm=15 (15 vertical levels, as in the benchmark). You also need to set disvert=plugin, meaning that the vertical discretization will be handled by the appropriate plugin from the generic model. Set day_step=480, nqtot=3 (given by traceur.def). Deactivate Rayleigh friction (rayleigh_friction_type=none). Finally, make sure you have physics = phys_external. Now that all the run info is in the '''run_icosa.def''' file, '''run.def''' is simply calling this file:&lt;br /&gt;
 ###########################################################################&lt;br /&gt;
 ### INCLUDE OTHER DEF FILES (physics, specific settings, etc...)&lt;br /&gt;
 ###########################################################################&lt;br /&gt;
 INCLUDEDEF=run_icosa.def&lt;br /&gt;
 &lt;br /&gt;
 INCLUDEDEF=mars_const.def&lt;br /&gt;
 &lt;br /&gt;
 INCLUDEDEF=callphys.def&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 prt_level=0&lt;br /&gt;
 &lt;br /&gt;
 ## iphysiq must be same as itau_physics&lt;br /&gt;
 iphysiq=5&lt;br /&gt;
 #iphysiq=10&lt;br /&gt;
&lt;br /&gt;
Make sure the '''tracer.def''' (the tracer file for dynamico) is consistant with traceur.def (the tracer file for the physics).&lt;br /&gt;
&lt;br /&gt;
Contrarily to the native benchmark, we'll need to use XIOS to run with dynamico. That involves a few more input files. You will find out which xml files you need and where to look for them in the trunk, in the README.xml file which is located in the xml subfolder of the ICOSA_LMDZ folder of the trunk.&lt;br /&gt;
&lt;br /&gt;
The '''context_physics_lmdz.xml''' file contains information relative to the physics grid. The original file creates a grid larger than we need. For the benchmark we will reduce the resolution to 32x32. To do so, add the following block taking example on the already existing ones:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;domain id=&amp;quot;dom_32_32&amp;quot; type=&amp;quot;rectilinear&amp;quot; ni_glo=&amp;quot;32&amp;quot; nj_glo=&amp;quot;32&amp;quot;   &amp;gt;&lt;br /&gt;
   &amp;lt;generate_rectilinear_domain/&amp;gt;&lt;br /&gt;
   &amp;lt;interpolate_domain order=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/domain&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and indicate that we want to use this new grid as the output grid. To do so, modify the existing line defining variable '''dom_out''' as:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;domain id=&amp;quot;dom_out&amp;quot; domain_ref=&amp;quot;dom_32_32&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Contrarily to the LMDZ dynamical core, a dynamico run usually does not start from a start.nc initial state. Instead, an initial state is generated, from which the simulation really starts. Let's thus make two subfolders: one called &amp;quot;init&amp;quot; where we will generate the initial state, and one called &amp;quot;run&amp;quot; where the simulation will run.&lt;br /&gt;
&lt;br /&gt;
=== iodef.xml ===&lt;br /&gt;
Here simply change the line:&lt;br /&gt;
 &amp;lt;context id=&amp;quot;LMDZ&amp;quot; src=&amp;quot;./context_lmdz_physics.xml&amp;quot; /&amp;gt;&lt;br /&gt;
to:&lt;br /&gt;
 &amp;lt;context id=&amp;quot;LMDZ&amp;quot; src=&amp;quot;./context_pcm_physics.xml&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Generating the initial state ==&lt;br /&gt;
In the run_icosa.def, comment out the following lines:&lt;br /&gt;
 #etat0=start_file&lt;br /&gt;
 #etat0_start_file_colocated=true&lt;br /&gt;
and uncomment instead:&lt;br /&gt;
 etat0=isothermal&lt;br /&gt;
 etat0_isothermal_temp=200&lt;br /&gt;
and&lt;br /&gt;
 etat0_ps_white_noise=0.01&lt;br /&gt;
 etat0_theta_rhodz_white_noise=0.01&lt;br /&gt;
&lt;br /&gt;
== Running the simulation ==&lt;/div&gt;</summary>
		<author><name>Maxime Maurice</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=The_traceur.def_Input_File&amp;diff=1978</id>
		<title>The traceur.def Input File</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=The_traceur.def_Input_File&amp;diff=1978"/>
				<updated>2024-03-13T17:42:42Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is it for? ==&lt;br /&gt;
&lt;br /&gt;
Tracers need to be listed in ''traceur.def''.&lt;br /&gt;
&lt;br /&gt;
Characteristics of the tracers can be also specified in ''traceur.def''.&lt;br /&gt;
&lt;br /&gt;
== What is a tracer? ==&lt;br /&gt;
&lt;br /&gt;
Tracers are elements which will be defined at each grid point and tracked in the model. They may interact with the atmosphere in different ways.&lt;br /&gt;
&lt;br /&gt;
The model may include different types of tracers:&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;condensed species (e.g., CO2, H2O, dust)&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;chemically active species&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;li&amp;gt;radiatively active gases (e.g., water vapor)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
In the code, all tracers are stored in one three-dimensional array q, the third index of&lt;br /&gt;
which corresponds to each individual tracer. In input &lt;br /&gt;
([https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/The_start.nc_and_startfi.nc_input_files ''start.nc'', ''startfi.nc''])&lt;br /&gt;
and output files tracers are stored separately using their individual names. Loading specific&lt;br /&gt;
tracers requires that the approriate tracer names are set in the ''traceur.def'' file, &lt;br /&gt;
and specific computations for given tracers (e.g. computing the water or CO2&lt;br /&gt;
cycles) is controlled by setting the corresponding options in the &lt;br /&gt;
[https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/The_callphys.def_Input_File ''callphys.def''] file.&lt;br /&gt;
&lt;br /&gt;
== File structure ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Old&amp;quot; version ===&lt;br /&gt;
&lt;br /&gt;
Number of tracers need to be specified, followed by tracers names. The following example will set up water tracers to compute water cloud and water cycle in general.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
2&lt;br /&gt;
h2o_vap&lt;br /&gt;
h2o_ice&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Modern&amp;quot; version ===&lt;br /&gt;
&lt;br /&gt;
An update version named '''ModernTrac-v1''' need to be used with chemistry in order to set up properly the chemical tracers. This gives also the opportunity to specify for each tracers specific characteristics.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#ModernTrac-v1&lt;br /&gt;
#&lt;br /&gt;
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# !! README !!&lt;br /&gt;
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
#  Welcome, this is the modern traceur.def !&lt;br /&gt;
# &lt;br /&gt;
#         ---&amp;gt; DON'T TOUCH/REMOVE THE FIRST LINE OF HEADER #ModernTrac-v1 &amp;lt;---&lt;br /&gt;
#&lt;br /&gt;
# * You can use this area to write as many comments as you want starting lines with #.&lt;br /&gt;
# * You cannot have comment lines in the middle nor at the end, only at the top.&lt;br /&gt;
#&lt;br /&gt;
#&lt;br /&gt;
# 0. Philosophy  This modern version of traceur.def gather in a single file what was&lt;br /&gt;
# ~~~~~~~~~~~~~  previously in traceur.def AND gases.def plus some hard-coded things.&lt;br /&gt;
#&lt;br /&gt;
# 1. Structure  After the header, first line is the total number of modern tracers in&lt;br /&gt;
# ~~~~~~~~~~~~  your file, ie not only tracers sent to dynamics, but also species that&lt;br /&gt;
#               takes part in the composition, radiative transfer, chemistry, etc.&lt;br /&gt;
#&lt;br /&gt;
#               Then, each line needs to start with the specie name ... and that's the&lt;br /&gt;
#               only mandatory information ! But you can specify all the options you&lt;br /&gt;
#               want in separate blocks following 'option=value', assuming this option&lt;br /&gt;
#               is defined in traceur_h.F90 &amp;amp; initracer.F for physics, infotrac.F90 &lt;br /&gt;
#               for dynamics or chimiedata_h.F90 &amp;amp; calchim_asis.F90 for chemistry.&lt;br /&gt;
#               Indeed this file is read once by dynamics, once by physics and once by&lt;br /&gt;
#               chemistry who keep only the information needed.&lt;br /&gt;
#&lt;br /&gt;
#               Note that by default a tracer listed below will be sent to dynamics&lt;br /&gt;
#               except if you specify is_dyn=0. If nothing is given, then is_dyn=1.&lt;br /&gt;
#               Not yet fully implemented.&lt;br /&gt;
#&lt;br /&gt;
# 3. Options.   Implemented options listed below.&lt;br /&gt;
# ~~~~~~~~~~~~  For dynamic see &amp;quot;infotrac.F90&amp;quot;.&lt;br /&gt;
#               For physic see &amp;quot;initracer.F90&amp;quot;.&lt;br /&gt;
#               For chemistry see &amp;quot;calchim_asis.F90&amp;quot;.&lt;br /&gt;
#                        init see &amp;quot;inichim_1D.F90&amp;quot; and &amp;quot;inichim_newstart.F90&amp;quot;&lt;br /&gt;
#&lt;br /&gt;
# Dynamic:      vadv           ! index of vertical trasport schema&lt;br /&gt;
#               hadv           ! index of horizontal trasport schema&lt;br /&gt;
#               tnom_transp    ! transporting fluid short name: CRisi&lt;br /&gt;
#&lt;br /&gt;
# Physic:       mmol           ! mole mass of tracer [g.mol-1]&lt;br /&gt;
#               aki            ! coefficient of thermal concduction&lt;br /&gt;
#               cpi            ! heat capacity [J.kg-1.K-1]&lt;br /&gt;
#               is_chim        ! 1 if tracer used in chemistry, else 0&lt;br /&gt;
#               is_rad         ! 1 if tracer used in radiative transfer, else 0&lt;br /&gt;
#               is_recomb      ! 1 if tracer used in recombining scheme, else 0&lt;br /&gt;
#                                (if 1, must have is_rad=1)&lt;br /&gt;
#               is_recomb_qset ! 1 if tracer k-corr assume predefined vmr, else 0&lt;br /&gt;
#                                (if 1, must have is_recomb=1)&lt;br /&gt;
#               is_recomb_qotf ! 1 if tracer recombination is done on-the-fly, else 0&lt;br /&gt;
#                                (if 1, must have is_recomb_qset=0)&lt;br /&gt;
#&lt;br /&gt;
# Chemistry:    SF_mode        ! 1 if surface set up value, else 2 sedimentation velocity&lt;br /&gt;
#               SF_value       ! [vmr] if SF_mode=1, else [cm.s-1]&lt;br /&gt;
#               prod_rate      ! if SF_mode=2 production flux [molecules.m-2.s-1]&lt;br /&gt;
#&lt;br /&gt;
#      init:    qx             ! value that initialize constant profile [vmr]&lt;br /&gt;
#               qxf            ! file that initialize profile [Pa,vmr] (1 line header)&lt;br /&gt;
#&lt;br /&gt;
#&lt;br /&gt;
#&lt;br /&gt;
# Random Ex :&lt;br /&gt;
#               4&lt;br /&gt;
#               n2 is_dyn=0&lt;br /&gt;
#               co2 cpi=450.0 is_dyn=1 mmol=44.&lt;br /&gt;
#               hdo hadv=14 vadv=10 tnom_transp=air&lt;br /&gt;
#               h2s&lt;br /&gt;
#&lt;br /&gt;
# Insert your tracers list and options below !&lt;br /&gt;
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
29&lt;br /&gt;
h2o_ice                 mmol=18   &lt;br /&gt;
co2                     mmol=44   is_chim=1    SF_mode=1    SF_value=4.0e-4    is_rad=1&lt;br /&gt;
co                      mmol=28   is_chim=1&lt;br /&gt;
o                       mmol=16   is_chim=1&lt;br /&gt;
o1d                     mmol=16   is_chim=1&lt;br /&gt;
o2                      mmol=32   is_chim=1    SF_mode=1    SF_value=2.1e-1&lt;br /&gt;
o3                      mmol=48   is_chim=1    is_rad=1 is_recomb=1 is_recomb_qotf=1&lt;br /&gt;
h                       mmol=1    is_chim=1&lt;br /&gt;
h2                      mmol=2    is_chim=1&lt;br /&gt;
oh                      mmol=17   is_chim=1&lt;br /&gt;
ho2                     mmol=33   is_chim=1&lt;br /&gt;
h2o2                    mmol=34   is_chim=1&lt;br /&gt;
h2o_vap                 mmol=18   is_chim=1    is_rad=1&lt;br /&gt;
ch4                     mmol=16   is_chim=1    SF_mode=1    SF_value=1.8e-6    is_rad=1&lt;br /&gt;
ch3                     mmol=15   is_chim=1&lt;br /&gt;
cho                     mmol=29   is_chim=1&lt;br /&gt;
ch2o                    mmol=30   is_chim=1&lt;br /&gt;
ch3o                    mmol=31   is_chim=1&lt;br /&gt;
ch3o2                   mmol=47   is_chim=1&lt;br /&gt;
ch3o2h                  mmol=48   is_chim=1&lt;br /&gt;
n                       mmol=14   is_chim=1&lt;br /&gt;
no                      mmol=30   is_chim=1&lt;br /&gt;
no2                     mmol=46   is_chim=1&lt;br /&gt;
n2                      mmol=28   is_chim=1    is_rad=1&lt;br /&gt;
hno3                    mmol=63   is_chim=1&lt;br /&gt;
hno4                    mmol=79   is_chim=1&lt;br /&gt;
n2o                     mmol=44   is_chim=1    SF_mode=1    SF_value=3.3e-7&lt;br /&gt;
no3                     mmol=62   is_chim=1&lt;br /&gt;
n2o5                    mmol=108  is_chim=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Initialisation ==&lt;br /&gt;
&lt;br /&gt;
=== In 3D ===&lt;br /&gt;
&lt;br /&gt;
In 3D, the initial distribution of tracers is in the '''start.def''' file. In order to change it, you have to modify the '''start.def''', for example using newstart.&lt;br /&gt;
&lt;br /&gt;
=== In 1D ===&lt;br /&gt;
&lt;br /&gt;
In 1D, the initial distribution of each tracer can be read from a file named &amp;quot;'''profile_&amp;lt;tracer name&amp;gt;'''&amp;quot; (e.g. '''profile_h2o_vap''' for the water vapour initial profile), located in the run directory. This file has Nlayer + 1 lines (with Nlayer the number of horizontal layers): its first line is the surface value (in kg/m^2), and then each line is the value at the corresponding level (in kg/kg).&lt;br /&gt;
&lt;br /&gt;
=== Using photochemistry ===&lt;br /&gt;
&lt;br /&gt;
When you use photochemistry (both in 3D and 1D), the initial distribution of tracers can be given as options in the '''traceur.def''' file, as explained above.&lt;br /&gt;
&lt;br /&gt;
[[Category:Inputs]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>Maxime Maurice</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Other_GCM_Configurations_worth_knowing_about&amp;diff=1457</id>
		<title>Other GCM Configurations worth knowing about</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Other_GCM_Configurations_worth_knowing_about&amp;diff=1457"/>
				<updated>2023-05-12T15:57:49Z</updated>
		
		<summary type="html">&lt;p&gt;Maxime Maurice: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= 3D lon-lat LMDZ setup =&lt;br /&gt;
&lt;br /&gt;
== early Mars ==&lt;br /&gt;
&lt;br /&gt;
It is already described in the [https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/Quick_Install_and_Run ''Quick Install and Run''] section.&lt;br /&gt;
&lt;br /&gt;
== Earth with slab ocean ==&lt;br /&gt;
&lt;br /&gt;
TBD by Martin (I will update this case as soon as Siddharth has committed changes)&lt;br /&gt;
&lt;br /&gt;
== TRAPPIST-1e with photochemistry ==&lt;br /&gt;
&lt;br /&gt;
A temperate rocky planet in synchronous rotation around a low mass star.&lt;br /&gt;
&lt;br /&gt;
Here is an example to simulate the planet TRAPPIST-1e with an Earth atmosphere using the photochemical module of the GCM.&lt;br /&gt;
&lt;br /&gt;
To install the model and run it, follow [https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php/Quick_Install_and_Run ''Quick Install and Run''] but with the following changes:&lt;br /&gt;
&lt;br /&gt;
=== GCM Input Datafiles and Datasets ===&lt;br /&gt;
Section [https://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Quick_Install_and_Run&amp;amp;action=edit&amp;amp;section=9 ''GCM Input Datafiles and Datasets''] download the TRAPPIST-1e files (instead of the early Mars files):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget -nv --no-check-certificate http://www.lmd.jussieu.fr/~lmdz/planets/generic/bench_trappist1e_photochemistry_64x48x30_b38x36.tar.gz&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can find the same type of file with the additional folder containing the chemical network file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
callphys.def  gases.def  startfi.nc  traceur.def&lt;br /&gt;
datadir/      run.def    start.nc    z2sig.def&lt;br /&gt;
chemnetwork/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compiling the GCM ===&lt;br /&gt;
==== Prior to a first compilation: setting up the target architecture files ====&lt;br /&gt;
The chemical solver require the libraries BLAS and LAPACK which need to be specified in the '''arch*.fcm''' file:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
%COMPILER            gfortran&lt;br /&gt;
%LINK                gfortran&lt;br /&gt;
%AR                  ar&lt;br /&gt;
%MAKE                make&lt;br /&gt;
%FPP_FLAGS           -P -traditional&lt;br /&gt;
%FPP_DEF             NC_DOUBLE LAPACK BLAS SGEMV=DGEMV SGEMM=DGEMM&lt;br /&gt;
%BASE_FFLAGS         -c -fdefault-real-8 -fdefault-double-8 -ffree-line-length-none -fno-align-commons&lt;br /&gt;
%PROD_FFLAGS         -O3&lt;br /&gt;
%DEV_FFLAGS          -O&lt;br /&gt;
%DEBUG_FFLAGS        -ffpe-trap=invalid,zero,overflow -fbounds-check -g3 -O0 -fstack-protector-all -finit-real=snan -fbacktrace&lt;br /&gt;
%MPI_FFLAGS&lt;br /&gt;
%OMP_FFLAGS         &lt;br /&gt;
%BASE_LD             -llapack -lblas&lt;br /&gt;
%MPI_LD&lt;br /&gt;
%OMP_LD              &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Specific to photochemistry: set hard coded reactions ====&lt;br /&gt;
In '''/LMDZ.GENERIC/libf/aeronostd/chimiedata_h.F90''' you can hard code reaction if needed, for instance because the reaction rate is very specific and out of the generic formula or your photochemical reaction does not use a regular cross section.&lt;br /&gt;
&lt;br /&gt;
The TRAPPIST-1e test case use 3 hard coded reactions.&lt;br /&gt;
&lt;br /&gt;
*Uncomment the following lines to fill reaction species indexes:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
!===========================================================&lt;br /&gt;
!      r001 : HNO3 + rain -&amp;gt; H2O&lt;br /&gt;
!===========================================================&lt;br /&gt;
nb_phot = nb_phot + 1&lt;br /&gt;
indice_phot(nb_phot) = z3spec(1.0, indexchim('hno3'), 1.0, indexchim('h2o_vap'), 0.0, 1)&lt;br /&gt;
&lt;br /&gt;
!===========================================================&lt;br /&gt;
!      e001 : CO + OH -&amp;gt; CO2 + H &lt;br /&gt;
!===========================================================&lt;br /&gt;
nb_reaction_4 = nb_reaction_4 + 1&lt;br /&gt;
indice_4(nb_reaction_4) = z4spec(1.0, indexchim('co'), 1.0, indexchim('oh'), 1.0, indexchim('co2'), 1.0, indexchim('h'))&lt;br /&gt;
&lt;br /&gt;
!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&lt;br /&gt;
!     photodissociation of NO : NO + hv -&amp;gt; N + O&lt;br /&gt;
!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&lt;br /&gt;
nb_phot = nb_phot + 1&lt;br /&gt;
indice_phot(nb_phot) = z3spec(1.0, indexchim('no'), 1.0, indexchim('n'), 1.0, indexchim('o'))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Uncomment the following lines to fill reaction rates:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
!----------------------------------------------------------------------&lt;br /&gt;
!     carbon reactions&lt;br /&gt;
!----------------------------------------------------------------------&lt;br /&gt;
     &lt;br /&gt;
!---  e001: oh + co -&amp;gt; co2 + h&lt;br /&gt;
&lt;br /&gt;
      nb_reaction_4 = nb_reaction_4 + 1&lt;br /&gt;
&lt;br /&gt;
!     joshi et al., 2006&lt;br /&gt;
&lt;br /&gt;
      do ilev = 1,nlayer&lt;br /&gt;
         k1a0 = 1.34*2.5*dens(ilev)                                  &amp;amp;&lt;br /&gt;
               *1/(1/(3.62e-26*t(ilev)**(-2.739)*exp(-20./t(ilev)))  &amp;amp;&lt;br /&gt;
               + 1/(6.48e-33*t(ilev)**(0.14)*exp(-57./t(ilev))))     ! typo in paper corrected&lt;br /&gt;
         k1b0 = 1.17e-19*t(ilev)**(2.053)*exp(139./t(ilev))          &amp;amp;&lt;br /&gt;
              + 9.56e-12*t(ilev)**(-0.664)*exp(-167./t(ilev))&lt;br /&gt;
         k1ainf = 1.52e-17*t(ilev)**(1.858)*exp(28.8/t(ilev))        &amp;amp;&lt;br /&gt;
                + 4.78e-8*t(ilev)**(-1.851)*exp(-318./t(ilev))&lt;br /&gt;
         x = k1a0/(k1ainf - k1b0)&lt;br /&gt;
         y = k1b0/(k1ainf - k1b0)&lt;br /&gt;
         fc = 0.628*exp(-1223./t(ilev)) + (1. - 0.628)*exp(-39./t(ilev))  &amp;amp;&lt;br /&gt;
            + exp(-t(ilev)/255.)&lt;br /&gt;
         fx = fc**(1./(1. + (alog(x))**2))                           ! typo in paper corrected&lt;br /&gt;
         k1a = k1a0*((1. + y)/(1. + x))*fx&lt;br /&gt;
         k1b = k1b0*(1./(1.+x))*fx&lt;br /&gt;
            &lt;br /&gt;
         v_4(ilev,nb_reaction_4) = k1a + k1b&lt;br /&gt;
      end do&lt;br /&gt;
&lt;br /&gt;
!----------------------------------------------------------------------&lt;br /&gt;
!     washout r001 : HNO3 + rain -&amp;gt; H2O&lt;br /&gt;
!----------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
nb_phot = nb_phot + 1&lt;br /&gt;
      &lt;br /&gt;
rain_h2o  = 100.e-6&lt;br /&gt;
!rain_rate = 1.e-6  ! 10 days&lt;br /&gt;
rain_rate = 1.e-8&lt;br /&gt;
      &lt;br /&gt;
do ilev = 1,nlayer&lt;br /&gt;
   if (c(ilev,indexchim('h2o_vap'))/dens(ilev) &amp;gt;= rain_h2o) then&lt;br /&gt;
      v_phot(ilev,nb_phot) = rain_rate&lt;br /&gt;
   else&lt;br /&gt;
      v_phot(ilev,nb_phot) = 0.&lt;br /&gt;
   end if&lt;br /&gt;
end do&lt;br /&gt;
&lt;br /&gt;
!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&lt;br /&gt;
!     photodissociation of NO&lt;br /&gt;
!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc&lt;br /&gt;
      &lt;br /&gt;
nb_phot = nb_phot + 1&lt;br /&gt;
      &lt;br /&gt;
colo3(nlayer) = 0.&lt;br /&gt;
!     ozone columns for other levels (molecule.cm-2)&lt;br /&gt;
do ilev = nlayer-1,1,-1&lt;br /&gt;
   colo3(ilev) = colo3(ilev+1) + (c(ilev+1,indexchim('o3')) + c(ilev,indexchim('o3')))*0.5*avocado*1e-4*((press(ilev) - press(ilev+1))*100.)/(1.e-3*zmmean(ilev)*g*dens(ilev))&lt;br /&gt;
end do&lt;br /&gt;
call jno(nlayer, c(nlayer:1:-1,indexchim('no')), c(nlayer:1:-1,indexchim('o2')), colo3(nlayer:1:-1), dens(nlayer:1:-1), press(nlayer:1:-1), sza, v_phot(nlayer:1:-1,nb_phot))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Change the following lines to set the number of hard coded reactions:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
integer, parameter :: nphot_hard_coding = 2&lt;br /&gt;
integer, parameter :: n4_hard_coding    = 1&lt;br /&gt;
integer, parameter :: n3_hard_coding    = 0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compiling a test case (TRAPPIST-1e) ===&lt;br /&gt;
Change the following compiling option:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
-d 64x48x30 -b 38x36&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB: option -b is mandatory to change while option -d will still run with lower or higher resolution (if '''z2sig.def''' remains coherent with the number of altitude levels, meaning at least as many altitude levels defined as the number of levels wanted).&lt;br /&gt;
&lt;br /&gt;
== TRAPPIST-1c in Venus-like conditions ==&lt;br /&gt;
&lt;br /&gt;
A warm rocky planet in synchronous rotation around a low mass star. Here we provide an '''example''' to simulate the atmosphere of Trappist-1c, assuming it evolved to a modern Venus-like atmosphere.&lt;br /&gt;
&lt;br /&gt;
The planetary parameters are taken from  [https://arxiv.org/abs/2010.01074 Algol et al. 2021] and can be found in this table [[Media:Planetary_parameters_Trappist1c.png]]&lt;br /&gt;
&lt;br /&gt;
First, install the model and run it, following [[Quick Install and Run]]  but instead of  ''Early Mars files'', please download ''bench_trappist1c_64x48x50_b32x36'' using this command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget -nv --no-check-certificate http://www.lmd.jussieu.fr/~lmdz/planets/generic/bench_trappist1c_64x48x50_b32x36&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can find the same type of  ASCII *def files than in the case of ''Early Mars'',  but adapted to the planet's characteristics and orbital parameters of Trappist 1c.&lt;br /&gt;
In particular ''callphys.def'' contains the following changes:&lt;br /&gt;
&lt;br /&gt;
* The planet is assumed to be in 1:1 spin-orbit resonance, therefore&lt;br /&gt;
   Diurnal = .false. &lt;br /&gt;
   Tlocked = .true.&lt;br /&gt;
* The planet equilibrium temperature is about 342 K&lt;br /&gt;
   tplanet    = 341.9&lt;br /&gt;
* The host star is a late spectral type M8V, with a stellar flux at 1 AU of 0.7527 [W m-2]&lt;br /&gt;
   startype = 9&lt;br /&gt;
   Fat1AU = 0.7527&lt;br /&gt;
* Fixed aerosol distribution, no radiative active tracers (no evaporation/condensation of H2O and CO2):&lt;br /&gt;
   aerofixed     = .true.&lt;br /&gt;
   aeroco2       = .false.&lt;br /&gt;
   aeroh2o       = .false.&lt;br /&gt;
* No water cycle model, no water cloud formation or water precipitation, no CO2 condensation:&lt;br /&gt;
   water         = .false.&lt;br /&gt;
   watercond     = .false.&lt;br /&gt;
   waterrain     = .false.&lt;br /&gt;
   hydrology     = .false.&lt;br /&gt;
   nonideal      = .true.&lt;br /&gt;
   co2cond       = .false.&lt;br /&gt;
* Following [https://www.sciencedirect.com/science/article/pii/S0032063313002596?via%3Dihub Haus et al. 2015] a prescribed radiatively active cloud model is included. &lt;br /&gt;
It can be activated/deactivated with the flag ''aerovenus''.&lt;br /&gt;
   aerovenus = .true.&lt;br /&gt;
* Mode 1, 2, 2p, 3 and the &amp;quot;unknown&amp;quot; UV absorber can be included/excluded by setting to true/false the following keywords. The characteristics of each mode (e.g. effect radius, effective variance) are based on Venus Express/ESA observations and can be found in this table [[Media:Table1 aerosolVenus trappist1c.png]]&lt;br /&gt;
   aerovenus1    = .true.&lt;br /&gt;
   aerovenus2    = .true.&lt;br /&gt;
   aerovenus2p   = .true.&lt;br /&gt;
   aerovenus3    = .true.&lt;br /&gt;
   aerovenusUV   = .true.&lt;br /&gt;
&lt;br /&gt;
The cloud model is prescribed from 1 to 0.037 ''bar'' pressure layers. For each mode, the top/bottom pressure can be modified by hard-coding model routine ''aeropacity.F90''.&lt;br /&gt;
Here below an example for mode 1 particles, where the top pressure layer and bottom pressure layer are prescribed at 0.1 bar and 1 bar, respectively:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
!       1. Initialization&lt;br /&gt;
          aerosol(1:ngrid,1:nlayer,iaer)=0.0&lt;br /&gt;
          p_bot = 1.e5 ! bottom pressure [Pa]&lt;br /&gt;
          p_top = 1.e4&lt;br /&gt;
          h_bot = 1.0e3 ! bottom scale height [m]&lt;br /&gt;
          h_top = 5.0e3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
'''TO BE COMPLETED BY GABRIELLA'''&lt;br /&gt;
&lt;br /&gt;
== mini-Neptune GJ1214b ==&lt;br /&gt;
&lt;br /&gt;
A warm mini-Neptune&lt;br /&gt;
&lt;br /&gt;
'''TO BE COMPLETED BY BENJAMIN'''&lt;br /&gt;
&lt;br /&gt;
= 3D DYNAMICO setup =&lt;br /&gt;
&lt;br /&gt;
Due to the rich dynamical activities in their atmospheres (banded zonal jets, eddies, vortices, storms, equatorial oscillations,...) resulting from multi-scale dynamic interactions, the Global Climate Modelling of the giant planet requires to resolve eddies arising from hydrodynamical instabilities to correctly establish the planetary-scaled jets regime. To this purpose, their Rossby radius deformation $$L_D$$, which is the length scale at which rotational effects become as important as buoyancy or gravity wave effects in the evolution of the flow about some disturbance, is calculated to determine the most suitable horizontal grid resolution. At mid-latitude range, for the giant planets, $$L_D$$ is of the same order of magnitude as that of the Earth. As the giant planets have a size of roughly 10 times the Earth size (i.e., Jupiter and Saturn), the modelling grid must be of a horizontal resolution of 0.5$$^{\circ}$$ over longitude and latitude (vs 5$$^{\circ}$$ for the Earth), considering 3 grid points to resolved $$L_D$$. &lt;br /&gt;
Moreover, to have a chance to model the equatorial oscillation, meridional cell circulations and/or a seasonal inter-hemispheric circulation, a giant planet GCM must also include a high vertical resolution. Indeed, these climate phenomena have been studied for decades for the Earth's atmosphere, and result from small- and large-scale interactions between the troposphere and stratosphere. This implies that the propagation of dynamic instabilities, waves and turbulence should be resolved as far as possible along the vertical. Contrary to horizontal resolution, it doesn't really exist a criterion (similar to $$L_D$$) to determine the most suitable vertical grid resolution and still an adjustable parameter according to the processes to be represented. However, we advise the user to set a vertical resolution of at least 5 grid points per scale height as first stage.    &lt;br /&gt;
Finally, these atmospheres are cold, with long radiative response time which needs radiative transfer computations over decade-long years of Jupiter (given that a Jupiter year $$\approx$$ 12 Earth years), Saturn ( a Saturn year $$\approx$$ 30 Earth years), Uranus (a Uranus year $$\approx$$ 84 earth years) or Neptune (a Neptune year $$\approx$$ 169 Earth years), depending on the chosen planet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To be able to deal with these three -- and non-exhaustive -- requirements to build a giant planet GCM, we need massive computational ressources. For this, we use a dynamical core suitable and numerically stable for massive parallel ressource computations: [[The_DYNAMICO_dynamical_core | DYNAMICO]] [Dubos et al,. 2015].  &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
In these two following subsections, we purpose an example of installation for Jupiter and a Hot Jupiter. All the install, compiling, setting and parameters files for each giant planets could be found on: https://gitlab.in2p3.fr/aymeric.spiga/dynamico-giant (the old repo is archived as read-only https://github.com/aymeric-spiga/dynamico-giant)&lt;br /&gt;
&lt;br /&gt;
The [[Dynamico-giant | DYNAMICO-giant wiki is here]]&lt;br /&gt;
&lt;br /&gt;
If you have already downloaded '''LMDZ.COMMON''', '''LMDZ.GENERIC''', '''IOIPSL''', '''ARCH''', you only have to download:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''ICOSAGCM''': the DYNAMICO dynamical core&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone https://gitlab.in2p3.fr/ipsl/projets/dynamico/dynamico.git ICOSAGCM&lt;br /&gt;
cd ICOSAGCM&lt;br /&gt;
git checkout 90f7138a60ebd3644fbbc42bc9dfa22923386385&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''ICOSA_LMDZ''': the interface using to link LMDZ.GENERIC physical packages and ICOSAGCM&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
svn update -r 2655 -q ICOSA_LMDZ&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''XIOS (XML Input Output Server)''': the library to interpolate input/output fields between the icosahedral and longitude/latitude regular grids on fly&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
svn co -r 2319 -q http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/trunk XIOS&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you haven't already download '''LMDZ.COMMON''', '''LMDZ.GENERIC''', '''IOIPSL''', '''ARCH''', you can use the '''install.sh''' script provided by the GitLab repository. &lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
Once each part of the GCM is downloaded, you are able to compile it. &lt;br /&gt;
Firstly, you have to define your [[The_Target_Architecture_(&amp;quot;arch&amp;quot;)_Files | target architecture file ]] (hereafter named YOUR_ARCH_FILE) where you will fill in all the necessary information about the local environment, where libraries are located, which compiler, and compiler options will be used, etc.&lt;br /&gt;
Some architecture files related to specific machines are provided in the '''ARCH''' directory, which are referenced in the following lines without the prefix 'arch-' (i.e., arch-X64_IRENE-AMD.env will be referenced as X64_IRENE-AMD).  &lt;br /&gt;
&lt;br /&gt;
The main specificity of DYNAMICO-giant is that every main parts of the model ('''ICOSAGCM''', '''LMDZ.COMMON''' and '''LMDZ.GENERIC''') are compiled as libraries, and settings and running configuration are managed by the '''ICOSA_LMDZ''' interface.&lt;br /&gt;
&lt;br /&gt;
First, you have to compile '''IOIPSL''',&lt;br /&gt;
 &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd LMDZ.COMMON/ioipsl/                                                                                                             &lt;br /&gt;
    ./install_ioipsl_YOUR-MACHINE.bash&lt;br /&gt;
cd ../../&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
then '''XIOS''' library, &lt;br /&gt;
 &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd XIOS/                                                                                                               &lt;br /&gt;
    ./make_xios --prod --arch YOUR_ARCH_FILE --arch_path ../ARCH --job 8 --full&lt;br /&gt;
cd -&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
the physics packaging,&lt;br /&gt;
 &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd LMDZ.COMMON/                                                                                                        &lt;br /&gt;
    ./makelmdz_fcm -p std -p_opt &amp;quot;-b 20x25 -s 2&amp;quot; -prod -parallel mpi -libphy -io xios -arch YOUR_ARCH_FILE -arch_path ../ARCH -j 8 -full&lt;br /&gt;
cd -&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
the dynamical core '''DYNAMICO''' (located in '''ICOSAGCM''' directory, named from the icosahedral shape of the horizontal mesh),&lt;br /&gt;
 &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ICOSAGCM/&lt;br /&gt;
    ./make_icosa -prod -parallel mpi -external_ioipsl -with_xios -arch YOUR_ARCH_FILE -arch_path ../ARCH -job 8 -full&lt;br /&gt;
cd -&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
and finally the '''ICOSA_LMDZ''' interface&lt;br /&gt;
 &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ICOSA_LMDZ/&lt;br /&gt;
    ./make_icosa_lmdz -p std -p_opt &amp;quot;-b 20x25 -s 2&amp;quot; -parallel mpi -arch YOUR_ARCH_FILE -arch_path ../ARCH -job 8 -nodeps&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This last step is a bit redundant with the two previous one, hence ''make_icosa_lmdz'' will execute ''./make_icosa'' (in the '''ICOSAGCM''' directory) and ''./makelmdz_fcm'' (in the '''LMDZ.COMMON''' directory) to create and source the architecture files shared between all parts of the model, as well as create the intermediate file ''config.fcm''. As you have already compiled these two elements, ''make_icosa_lmdz'' should only create the linked architecture files, ''config.fcm'' and compile the interface. Here, ''-nodeps'' option prevents the checking of XIOS and IOIPSL compilation, which saves you from recompiling these two elements again.&lt;br /&gt;
      &lt;br /&gt;
Finally, your executable programs should appeared in '''ICOSA_LMDZ/bin''' subdirectory, as '''icosa_lmdz.exe''' and in '''XIOS/bin''' subdirectory, as '''xios_server.exe''' &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
All these compiling steps are summed up in ''make_isoca_lmdz'' program that should be adapted to your own computational settings (i.e., through you target architecture file).&lt;br /&gt;
 &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./make_icosa_lmdz -p std -p_opt &amp;quot;-b 20x25 -s 2&amp;quot; -parallel mpi -arch YOUR_ARCH_FILE -arch_path ../ARCH -job 8 -full&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
Here, ''-full'' option assure the compilation of each part ('''IOIPSL''', '''XIOS''', '''LMDZ.COMMON''', '''ICOSAGCM''' and '''ICOSA_LMDZ''') of the model.  &lt;br /&gt;
&lt;br /&gt;
Now you can move your two executable files to your working directory and start to run your own simulation of Jupiter or a Hot Jupiter, as what follows.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: If you are using the GitLab file architecture (https://gitlab.in2p3.fr/aymeric.spiga/dynamico-giant), you should be able to compile the model directly from your working directory (for instance ''dynamico-giant/jupiter/'') by using the ''compile_occigen.sh'' program, which has to be adapted to your machine/cluster. &lt;br /&gt;
&lt;br /&gt;
== Jupiter with DYNAMICO ==&lt;br /&gt;
Using a new dynamical core implies new setting files, in addition or as a replacement of those relevant to '''LMDZ.COMMON''' dynamical core using. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are two kind of setting files:&lt;br /&gt;
&lt;br /&gt;
'''A first group relevant to DYNAMICO:'''&lt;br /&gt;
&lt;br /&gt;
- [[The ''context_dynamico.xml'' Input File|''context_dynamico.xml'']]: Configuration file for '''DYNAMICO''' for reading and writing  files using '''XIOS''', mainly used when you want to check the installation of '''ICOSAGCM''' with [[The_DYNAMICO_dynamical_core | an ''Held and Suarez'' test case]]. When your installation, compilation and run environment is fully functional, the dynamic core output files will not (necessarily) be useful and you can disable their writing. &lt;br /&gt;
&lt;br /&gt;
- [[The context_input_dynamico.xml Input File|''context_input_dynamico.xml'']]:&lt;br /&gt;
&lt;br /&gt;
- [[The file_def_dynamico.xml Input File|''file_def_dynamico.xml'']]: Definition of output diagnostic files which will be written into the output files only related to '''ICOSAGCM'''. &lt;br /&gt;
&lt;br /&gt;
- [[The field_def_dynamico.xml Input File|''field_def_dynamico.xml'']]: Definition of all existing variables that can be output from DYNAMICO.&lt;br /&gt;
&lt;br /&gt;
- [[The tracer.def Input File|''tracer.def'']]: Definition of the name and physico-chemical properties of the tracers which will be advected by the dynamical core. For now, there is two files related to tracers, we are working to harmonise it.  &lt;br /&gt;
&lt;br /&gt;
''' A second group relevant to LMDZ.GENERIC physical packages: '''&lt;br /&gt;
&lt;br /&gt;
- [[The context_lmdz_physics.xml Input File|''context_lmdz_physics.xml'']]: File in which are defined the horizontal grid, vertical coordinate, output file(s) definition, with the setting of frequency output writing, time unit, geophysical variables to be written, etc. Each new geophysical variables added here have to be defined in the ''field_def_physics.xml'' file.&lt;br /&gt;
&lt;br /&gt;
- [[The field_def_physics.xml Input File|''field_def_physics.xml'']]: Definition of all existing variables that can be output from the physical packages interfaced with '''DYNAMICO'''. This is where you will add each geophysical fields that you want to appear in the ''Xhistins.nc'' output files. For instance, related to the ''thermal plume scheme'' using for Jupiter's tropospheric dynamics, we have added the following variables: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot; line&amp;gt;&lt;br /&gt;
             &amp;lt;field id=&amp;quot;h2o_vap&amp;quot; &lt;br /&gt;
                   long_name=&amp;quot;Vapor mass mixing ratio&amp;quot; &lt;br /&gt;
                   unit=&amp;quot;kg/kg&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;field id=&amp;quot;h2o_ice&amp;quot; &lt;br /&gt;
                   long_name=&amp;quot;Vapor mass mixing ratio&amp;quot; &lt;br /&gt;
                   unit=&amp;quot;kg/kg&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;field id=&amp;quot;detr&amp;quot; &lt;br /&gt;
                   long_name=&amp;quot;Detrainment&amp;quot; &lt;br /&gt;
                   unit=&amp;quot;kg/m2/s&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;field id=&amp;quot;entr&amp;quot; &lt;br /&gt;
                   long_name=&amp;quot;Entrainment&amp;quot; &lt;br /&gt;
                   unit=&amp;quot;kg/m2/s&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;field id=&amp;quot;w_plm&amp;quot; &lt;br /&gt;
                   long_name=&amp;quot;Plume vertical velocity&amp;quot; &lt;br /&gt;
                   unit=&amp;quot;m/s&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- [[The_callphys.def_Input_File|''callphys.def'']]: This setting file is used either with '''DYNAMICO''' or '''LMDZ.COMMON''' and allows the user to choose the physical parametrisation schemes and their appropriate main parameter values relevant to the planet being simulated. In our case of Jupiter, there are some specific parametrisations that should be added or modified from the example given as link at the beginning of this line: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line&amp;gt;&lt;br /&gt;
# Diurnal cycle ?  if diurnal=false, diurnally averaged solar heating&lt;br /&gt;
diurnal      = .false. #.true.&lt;br /&gt;
# Seasonal cycle ? if season=false, Ls stays constant, to value set in &amp;quot;start&amp;quot;&lt;br /&gt;
season       = .true. &lt;br /&gt;
# Tidally resonant orbit ? must have diurnal=false, correct rotation rate in newstart&lt;br /&gt;
tlocked      = .false.&lt;br /&gt;
# Tidal resonance ratio ? ratio T_orbit to T_rotation&lt;br /&gt;
nres         = 1&lt;br /&gt;
# Planet with rings?&lt;br /&gt;
rings_shadow = .false.&lt;br /&gt;
# Compute latitude-dependent gravity field??&lt;br /&gt;
oblate       = .true.&lt;br /&gt;
# Include non-zero flattening (a-b)/a?&lt;br /&gt;
flatten      = 0.06487&lt;br /&gt;
# Needed if oblate=.true.: J2&lt;br /&gt;
J2           = 0.01470&lt;br /&gt;
# Needed if oblate=.true.: Planet mean radius (m)&lt;br /&gt;
Rmean        = 69911000.&lt;br /&gt;
# Needed if oblate=.true.: Mass of the planet (*1e24 kg)&lt;br /&gt;
MassPlanet   = 1898.3&lt;br /&gt;
# use (read/write) a startfi.nc file? (default=.true.)&lt;br /&gt;
startphy_file = .false.&lt;br /&gt;
# constant value for surface albedo (if startphy_file = .false.)&lt;br /&gt;
surfalbedo   = 0.0&lt;br /&gt;
# constant value for surface emissivity (if startphy_file = .false.)&lt;br /&gt;
surfemis     = 1.0&lt;br /&gt;
&lt;br /&gt;
# the rad. transfer is computed every &amp;quot;iradia&amp;quot; physical timestep&lt;br /&gt;
iradia           = 160&lt;br /&gt;
# folder in which correlated-k data is stored ?&lt;br /&gt;
corrkdir         = Jupiter_HITRAN2012_REY_ISO_NoKarko_T460K_article2019_gauss8p8_095&lt;br /&gt;
# Uniform absorption coefficient in radiative transfer?&lt;br /&gt;
graybody         = .false.&lt;br /&gt;
# Characteristic planetary equilibrium (black body) temperature&lt;br /&gt;
# This is used only in the aerosol radiative transfer setup. (see aerave.F)&lt;br /&gt;
tplanet          = 100.&lt;br /&gt;
# Output global radiative balance in file 'rad_bal.out' - slow for 1D!!&lt;br /&gt;
meanOLR          = .false.&lt;br /&gt;
# Variable gas species: Radiatively active ?&lt;br /&gt;
varactive        = .false.&lt;br /&gt;
# Computes atmospheric specific heat capacity and&lt;br /&gt;
# could calculated by the dynamics, set in callphys.def or calculeted from gases.def.&lt;br /&gt;
# You have to choose: 0 for dynamics (3d), 1 for forced in callfis (1d) or 2: computed from gases.def (1d)&lt;br /&gt;
# Force_cpp and check_cpp_match are now deprecated.  &lt;br /&gt;
cpp_mugaz_mode = 0&lt;br /&gt;
# Specific heat capacity in J K-1 kg-1 [only used if cpp_mugaz_mode = 1]&lt;br /&gt;
cpp              = 11500.&lt;br /&gt;
# Molecular mass in g mol-1 [only used if cpp_mugaz_mode = 1]&lt;br /&gt;
mugaz            = 2.30&lt;br /&gt;
### DEBUG&lt;br /&gt;
# To not call abort when temperature is outside boundaries:&lt;br /&gt;
strictboundcorrk = .false.&lt;br /&gt;
# To not stop run when temperature is greater than 400 K for H2-H2 CIA dataset:   &lt;br /&gt;
strictboundcia = .false.&lt;br /&gt;
# Add temperature sponge effect after radiative transfer?&lt;br /&gt;
callradsponge    = .false.&lt;br /&gt;
&lt;br /&gt;
Fat1AU = 1366.0&lt;br /&gt;
&lt;br /&gt;
## Other physics options&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# call turbulent vertical diffusion ?&lt;br /&gt;
calldifv    = .false.&lt;br /&gt;
# use turbdiff instead of vdifc ?&lt;br /&gt;
UseTurbDiff = .true.&lt;br /&gt;
# call convective adjustment ?&lt;br /&gt;
calladj     = .true.&lt;br /&gt;
# call thermal plume model ?&lt;br /&gt;
calltherm   = .true.&lt;br /&gt;
# call thermal conduction in the soil ?&lt;br /&gt;
callsoil    = .false.&lt;br /&gt;
# Internal heat flux (matters only if callsoil=F)&lt;br /&gt;
intheat     = 7.48&lt;br /&gt;
# Remove lower boundary (e.g. for gas giant sims)&lt;br /&gt;
nosurf      = .true.&lt;br /&gt;
#########################################################################&lt;br /&gt;
## extra non-standard definitions for Earth&lt;br /&gt;
#########################################################################&lt;br /&gt;
&lt;br /&gt;
## Thermal plume model options&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
dvimpl               = .true.&lt;br /&gt;
r_aspect_thermals    = 2.0&lt;br /&gt;
tau_thermals         = 0.0&lt;br /&gt;
betalpha             = 0.9&lt;br /&gt;
afact                = 0.7&lt;br /&gt;
fact_epsilon         = 2.e-4&lt;br /&gt;
alpha_max            = 0.7&lt;br /&gt;
fomass_max           = 0.5&lt;br /&gt;
pres_limit           = 2.e5&lt;br /&gt;
&lt;br /&gt;
## Tracer and aerosol options&lt;br /&gt;
## ~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;
# Ammonia cloud (Saturn/Jupiter)?&lt;br /&gt;
aeronh3             = .true.&lt;br /&gt;
size_nh3_cloud      = 10.D-6&lt;br /&gt;
pres_nh3_cloud      = 1.1D5                        # old: 9.D4&lt;br /&gt;
tau_nh3_cloud       = 10.                          # old: 15.&lt;br /&gt;
# Radiatively active aerosol (Saturn/Jupiter)?&lt;br /&gt;
aeroback2lay         = .true.&lt;br /&gt;
optprop_back2lay_vis = optprop_jupiter_vis_n20.dat&lt;br /&gt;
optprop_back2lay_ir  = optprop_jupiter_ir_n20.dat&lt;br /&gt;
obs_tau_col_tropo    = 4.0&lt;br /&gt;
size_tropo           = 5.e-7&lt;br /&gt;
pres_bottom_tropo    = 8.0D4&lt;br /&gt;
pres_top_tropo       = 1.8D4&lt;br /&gt;
obs_tau_col_strato   = 0.1D0&lt;br /&gt;
# Auroral aerosols (Saturn/Jupiter)?&lt;br /&gt;
aeroaurora         = .false.&lt;br /&gt;
size_aurora        = 3.e-7&lt;br /&gt;
obs_tau_col_aurora = 2.0&lt;br /&gt;
&lt;br /&gt;
# Radiatively active CO2 aerosol?&lt;br /&gt;
aeroco2            = .false.&lt;br /&gt;
# Fixed CO2 aerosol distribution?&lt;br /&gt;
aerofixco2     = .false.&lt;br /&gt;
# Radiatively active water aerosol?&lt;br /&gt;
aeroh2o        = .false.&lt;br /&gt;
# Fixed water aerosol distribution?&lt;br /&gt;
aerofixh2o     = .false.&lt;br /&gt;
# basic dust opacity&lt;br /&gt;
dusttau        = 0.0&lt;br /&gt;
# Varying H2O cloud fraction?&lt;br /&gt;
CLFvarying     = .false.&lt;br /&gt;
# H2O cloud fraction if fixed?&lt;br /&gt;
CLFfixval      = 0.0&lt;br /&gt;
# fixed radii for cloud particles?&lt;br /&gt;
radfixed       = .false.&lt;br /&gt;
# number mixing ratio of CO2 ice particles&lt;br /&gt;
Nmix_co2       = 100000.&lt;br /&gt;
# number mixing ratio of water particles (for rafixed=.false.)&lt;br /&gt;
Nmix_h2o       = 1.e7&lt;br /&gt;
# number mixing ratio of water ice particles (for rafixed=.false.)&lt;br /&gt;
Nmix_h2o_ice   = 5.e5&lt;br /&gt;
# radius of H2O water particles (for rafixed=.true.):&lt;br /&gt;
rad_h2o        = 10.e-6&lt;br /&gt;
# radius of H2O ice particles (for rafixed=.true.):&lt;br /&gt;
rad_h2o_ice    = 35.e-6&lt;br /&gt;
# atm mass update due to tracer evaporation/condensation?&lt;br /&gt;
mass_redistrib = .false.&lt;br /&gt;
&lt;br /&gt;
## Water options &lt;br /&gt;
## ~~~~~~~~~~~~~&lt;br /&gt;
# Model water cycle&lt;br /&gt;
water         = .true.&lt;br /&gt;
# Model water cloud formation&lt;br /&gt;
watercond     = .true.&lt;br /&gt;
# Model water precipitation (including coagulation etc.)&lt;br /&gt;
waterrain     = .true.&lt;br /&gt;
# Use simple precipitation scheme?&lt;br /&gt;
precip_scheme = 1&lt;br /&gt;
# Evaporate precipitation?&lt;br /&gt;
evap_prec     = .true.&lt;br /&gt;
# multiplicative constant in Boucher 95 precip scheme&lt;br /&gt;
Cboucher      = 1.&lt;br /&gt;
# Include hydrology ?&lt;br /&gt;
hydrology     = .false.&lt;br /&gt;
# H2O snow (and ice) albedo ?&lt;br /&gt;
albedosnow    = 0.6&lt;br /&gt;
# Maximum sea ice thickness ?&lt;br /&gt;
maxicethick   = 10.&lt;br /&gt;
# Freezing point of seawater (degrees C) ?&lt;br /&gt;
Tsaldiff      = 0.0&lt;br /&gt;
# Evolve surface water sources ?&lt;br /&gt;
sourceevol    = .false.&lt;br /&gt;
&lt;br /&gt;
## CO2 options &lt;br /&gt;
## ~~~~~~~~~~~&lt;br /&gt;
# call CO2 condensation ?&lt;br /&gt;
co2cond       = .false.&lt;br /&gt;
# Set initial temperature profile to 1 K above CO2 condensation everywhere?&lt;br /&gt;
nearco2cond   = .false.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- [[The_gases.def_Input_file|''gases.def'']]: File containing the gas composition of the atmosphere you want to model, with their molar mixing ratios. &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line&amp;gt;&lt;br /&gt;
# gases&lt;br /&gt;
5&lt;br /&gt;
H2_&lt;br /&gt;
He_&lt;br /&gt;
CH4&lt;br /&gt;
C2H2&lt;br /&gt;
C2H6&lt;br /&gt;
0.863&lt;br /&gt;
0.134&lt;br /&gt;
0.0018&lt;br /&gt;
1.e-7&lt;br /&gt;
1.e-5&lt;br /&gt;
# First line is number of gases&lt;br /&gt;
# Followed by gas names (always 3 characters)&lt;br /&gt;
# and then molar mixing ratios.&lt;br /&gt;
# mixing ratio -1 means the gas is variable.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
- [[The jupiter_const.def Input File|''jupiter_const.def'']]: Files that gather all orbital and physical parameters of Jupiter.&lt;br /&gt;
&lt;br /&gt;
- [[The_traceur.def_Input_File|''traceur.def'']]: At this time, only two tracers are used for modelling Jupiter atmosphere, so the ''traceur.def'' file is summed up as follow&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line&amp;gt;&lt;br /&gt;
2&lt;br /&gt;
h2o_vap&lt;br /&gt;
h2o_ice&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''' Two additional files are used to set the running parameter of the simulation itself:'''&lt;br /&gt;
&lt;br /&gt;
- [[The run_icosa.def Input File | ''run_icosa.def'']]: file containing parameters for '''ICOSAGCM''' to execute the simulation, use to determine the [[Advanced Use of the GCM | horizontal and vertical resolutions]], the number of processors, the number of subdivisions, the duration of the simulation, etc.&lt;br /&gt;
&lt;br /&gt;
- ''run.def'': file which brings together all the setting files and will be reading by the interface '''ICOSA_LMDZ''' to link each part of the model ('''ICOSAGCM''', '''LMDZ.GENERIC''') with its particular setting file(s) when the library '''XIOS''' does not take action (through the ''.xml'' files).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line&amp;gt;&lt;br /&gt;
###########################################################################&lt;br /&gt;
### INCLUDE OTHER DEF FILES (physics, specific settings, etc...)&lt;br /&gt;
###########################################################################&lt;br /&gt;
INCLUDEDEF=run_icosa.def&lt;br /&gt;
&lt;br /&gt;
INCLUDEDEF=jupiter_const.def&lt;br /&gt;
&lt;br /&gt;
INCLUDEDEF=callphys.def&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
prt_level=0&lt;br /&gt;
&lt;br /&gt;
## iphysiq must be same as itau_physics&lt;br /&gt;
iphysiq=40&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Hot Jupiter with DYNAMICO ==&lt;br /&gt;
&lt;br /&gt;
Modelling the atmosphere of Hot Jupiter is challenging because of the extreme temperature conditions, and the fact that these planets are gas giants. Therefore, using a dynamical core such as Dynamico is strongly recommended. Here, we discuss how to perform a cloudless simulation of the Hot Jupiter WASP-43 b, using Dynamico.&lt;br /&gt;
&lt;br /&gt;
'''1st step''': You need to go to the github mentionned previously for Dynamico: https://github.com/aymeric-spiga/dynamico-giant. ''Git clone'' this repo on your favorite cluster, and ''checkout'' to the &amp;quot;hot_jupiter&amp;quot; branch.&lt;br /&gt;
&lt;br /&gt;
'''2nd step''': Now, run the install.sh script. This script will install '''all''' the required models ('''LMDZ.COMMON''', '''LMDZ.GENERIC''','''ICOSA_LMDZ''','''XIOS''','''FCM''','''ICOSAGCM'''). At this point, you only miss '''IOIPSL'''. To install it, go to &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt; &lt;br /&gt;
dynamico-giant/code/LMDZ.COMMON/ioipsl/ &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There, you will find some examples of installations script. You need to create one that will work on your cluster, with your own arch files.&lt;br /&gt;
During the installation of '''IOIPSL''', you might be asked for a login/password. Contact TGCC computing center to get access.&lt;br /&gt;
&lt;br /&gt;
'''3rd step''': Great, now we have all we need to get started. Navigate to the ''hot_jupiter'' folder. You will find a ''compile_mesopsl.sh'' and a ''compile_occigen.sh'' script. Use them as examples to create the compile script adapted to your own cluster, then run it. &lt;br /&gt;
While running, I suggest that you take a look at the ''log_compile'' file. The compilation can take a while (~ 10minutes, especially because of XIOS). On quick trick to make sure that everything went right is to check the number of ''Build command finished'' messages in ''log_compile''. If everything worked out, there should be 6 of them.&lt;br /&gt;
&lt;br /&gt;
'''4th step''': Okay, the model compiled, good job ! Now we need to create the initial condition for our run. In the hot_jupiter1d folder, you already have a ''temp_profile.txt'' computed with the 1D version of the LMDZ.GENERIC (see rcm1d on this page). Thus, no need to recompute a 1D model but it will be needed if you want to model another Hot Jupiter.&lt;br /&gt;
Navigate to the 'makestart' folder, located at &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt; &lt;br /&gt;
dynamico-giant/hot_jupiter/makestart/&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
To generate the initial conditions for the 3D run, we're gonna start the model using the temperature profile from the 1D run. to do that, you will find a &amp;quot;job_mpi&amp;quot; script. Open it, and adapt it to your cluster and launch the job. This job is using 20 procs, and it runs 5 days of simulations. &lt;br /&gt;
If everything goes well, you should see few netcdf files appear. The important ones are '''start_icosa0.nc''', '''startfi0.nc''' and '''Xhistins.nc'''. &lt;br /&gt;
If you see these files, you're all set to launch a real simulation !&lt;br /&gt;
&lt;br /&gt;
'''5th step''': Go back to ''hot_jupiter'' folder. There are a bunch of script to launch your simulation. Take a look at the ''astro_fat_mpi'' script, and adapt it to your cluster. Then you can launch your simulation by doing &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt; &lt;br /&gt;
./run_astro_fat&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This will start the simulation, using 90 procs. In the same folder, check if the icosa_lmdz.out file is created. This is the logfile of the simulation, while it is running. You can check there that everything is going well.&lt;br /&gt;
&lt;br /&gt;
'''Important side note''': When using the ''run_astro_fat'' script to run a simulation, it will run a chained simulation, restarting the simulation from the previous state after 100 days of simulations and generating ''Xhistins.nc'' files. This is your results file, where you will find all the variables that controls your atmosphere (temperature field, wind fields, etc..). &lt;br /&gt;
&lt;br /&gt;
Good luck and enjoy the generic PCM Dynamico for Hot Jupiter !&lt;br /&gt;
&lt;br /&gt;
'''2nd important side note''': These 5 steps are the basic needed steps to run a simulation. If you want to tune simulations to another planet, or change other stuff, you need to take a look at '''*.def''' and '''*.xml''' files. If you're lost in all of this, take a look at the different pages of this website and/or contact us !&lt;br /&gt;
Also, you might want to check the wiki on the [https://github.com/aymeric-spiga/dynamico-giant ''Github''], that explains a lot of settings for Dynamico&lt;br /&gt;
&lt;br /&gt;
= 3D LES setup =&lt;br /&gt;
&lt;br /&gt;
== Proxima b with LES ==&lt;br /&gt;
&lt;br /&gt;
To model the subgrid atmospheric turbulence, the WRF dynamical core coupled with the LMD Generic physics package is used. The first studied conducted was to resolve the convective activity of the substellar point of Proxami-b (Lefevre et al 2021). The impact of the stellar insolation and rotation period were studied. The files for the reference case, with a stellar flux of 880 W/m2 and an 11 days rotation period, are presented&lt;br /&gt;
&lt;br /&gt;
The input_* file are the used to initialize the temperature, pressure, winds and moisture of the domain. &lt;br /&gt;
input_souding : altitude (km), potential temperature, water vapour (kg/kg), u, v&lt;br /&gt;
input_therm : normalized gas constant, isobaric heat capacity, pressure, density, temperature&lt;br /&gt;
input_hr : SW heating, LW heating, Large-scale heating extracted from the GCM. Only the last one is used in this configuration.&lt;br /&gt;
&lt;br /&gt;
The file namelist.input is used to set up the domain parameters (resolution, grid points, etc). The file levels specifies the eta-levels of the vertical domain.&lt;br /&gt;
&lt;br /&gt;
Planet is used set up the atmospheric parameters, in order : gravity (m/s2), isobaric heat capacity (J/kg/K), molecular mass (g/mol), reference temperature (K), surface pressure (Pa), planet radius (m) and planet rotation rate (s-1).&lt;br /&gt;
&lt;br /&gt;
The files *.def are the parameter for the physics. Compared to GCM runs, the convective adjustment in callphys.def is turned off&lt;br /&gt;
&lt;br /&gt;
The file controle.txt, equivalent of the field controle in GCM start.nc, needed to initialize some physics constants.&lt;br /&gt;
&lt;br /&gt;
TBC ML&lt;br /&gt;
&lt;br /&gt;
= 1D setup =&lt;br /&gt;
&lt;br /&gt;
== rcm1d test case ==&lt;br /&gt;
&lt;br /&gt;
Running the model in 1D (i.e. considering simply a column of atmosphere) is a common first step to test a new setup. To do so, you first have to compile the 1D version of the model. The command line is very similar to [[Quick_Install_and_Run#Compiling a test case (early Mars)|the one for the 3D]], except for 2 changes:&lt;br /&gt;
# put just the vertical resolution after the -b option (instead of ''LON''x''LAT''x''VERT'' for the 3D case)&lt;br /&gt;
# at the end of the line, replace &amp;quot;gcm&amp;quot; with &amp;quot;rcm1d&amp;quot;&lt;br /&gt;
It will generate a file called '''rcm1d_XX_phyxxx_seq.e''', where ''XX'' and ''phyxxx'' are the vertical resolution and the physics package, respectively.&lt;br /&gt;
&lt;br /&gt;
Then, copy the executable in your working directory. Notice that the '''.def''' files differ a bit from the 3D case: [[The_run.def_Input_File|'''run.def''']] is replaced with '''rcm1d.def''', which contains more general information. Indeed, the 1D mmodel does not use [[The_start.nc_and_startfi.nc_input_files|'''start.nc''']] or [[The_start.nc_and_startfi.nc_input_files|'''startfi.nc''']] files to initialize. Instead it reads everything from the '''.def''' files. You can find examples of 1D configuration in ''LMDZ.GENERIC/deftank'' (e.g. '''rcm1d.def.earlymars''', '''rcm1d.def.earth'''), the best thing is to have a look at them.&lt;br /&gt;
&lt;br /&gt;
== kcm1d test case ==&lt;br /&gt;
&lt;br /&gt;
Our 1-D inverse model&lt;br /&gt;
&lt;br /&gt;
TBD by Guillaume or Martin&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;br /&gt;
[[Category:Generic-LMDz]]&lt;br /&gt;
[[Category:Generic-DYNAMICO]]&lt;br /&gt;
[[Category:Generic-WRF]]&lt;br /&gt;
[[Category:Generic-1D]]&lt;/div&gt;</summary>
		<author><name>Maxime Maurice</name></author>	</entry>

	</feed>