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

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Physics_of_the_Generic_PCM&amp;diff=2629</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=2629"/>
				<updated>2025-03-05T12:51:07Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* Subsurface thermal */&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;
Convective mixing in an atmosphere column involves non-resolved, sub-grid processes. These processes are parameterized using the following routines:&lt;br /&gt;
&lt;br /&gt;
==Thermal plume==&lt;br /&gt;
This module implements a more accurate and sophisticated parametrization of convection. More info [[Thermal_plume_model_Generic_PCM|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 [[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|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;
=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>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2628</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2628"/>
				<updated>2025-03-05T12:48:20Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* Inhomogeneity of the subsurface */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h.F90'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The subroutine ''soil_settings.F90'' which reads/initializes the soil depths and properties.&lt;br /&gt;
* The routine ''soil.F'' which computes soil temperatures and the flux from the ground to the surface.&lt;br /&gt;
&lt;br /&gt;
To compute the subsurface temperatures, one must set ''callsoil'' to .true. in the ''callphys.def''&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to ''nsoilmx''. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t)&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete description of the heat equation discretization can be found in Lange (2024) - pages 59 to 61 -.&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes separately. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time $$t+\delta t$$, the value of surface temperature $$T_s (t+\delta t)$$  is already known. In short, the algorithm works as follows: the surface temperature at $$t+\delta t$$ is computed with a radiative balance, knowing $$ F_C (t+\delta t)$$ . Then soil temperatures are updated. $$F_C (t+2\delta t)$$ is finally computed and used as an input to compute $$T_s (t+2\delta t)$$.&lt;br /&gt;
&lt;br /&gt;
== Description of the soil subroutines ==&lt;br /&gt;
==== comsoil_h ====&lt;br /&gt;
This module defines the parameters for the vertical grid discretization, and the default values:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nsoilmx = 18   ! The number of points in the subsurface.&lt;br /&gt;
real :: lay1_soil = 2.e-4 ! The depth (m) of first full soil layer &lt;br /&gt;
real :: alpha_soil = 2    ! The geometric factor for the soi layer thickness &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The vertical discretization is defined in two arrays:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: layer(nsoilmx)      ! Full soil layer depths&lt;br /&gt;
real :: mlayer(0:nsoilmx-1) ! Mid soil layer depths&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The soil thermal properties are defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: volcapa                   ! soil volumetric heat capacity, C&lt;br /&gt;
real :: inertiedat(ngrid,nsoilmx) ! Soil thermal inertia&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== soil_settings ====&lt;br /&gt;
&lt;br /&gt;
This subroutine reads from a NetCDF file (opened by the caller) of &amp;quot;startfi.nc&amp;quot; format the soil properties (number of grid points, soil temperature, thermal inertia), and eventually process to interpolation if needed.&lt;br /&gt;
&lt;br /&gt;
* 1. The number of soil layers is read in the NetCDF file. If the number of soil layer (''dimlen'') read is not equal to ''nsoilmx'', then the soil temperature and thermal inertia will be interpolated to the grid from the PCM defined in comsoil_h.&lt;br /&gt;
* 2. The vertical grid is read in the NetCDF file, or created if it does not exist, or if ''dimlen'' $$\neq$$ ''nsoilmx''.&lt;br /&gt;
* 3. The volumetric specific heat ''volcapa'' is read in the controle array (''controle(35)'') of the NetCDF file. If it does not exist, then ''volcapa'' is set to $$10^6$$.&lt;br /&gt;
* 4. The Thermal inertia is read in the NetCDF file. If it does not exist, the subroutines crashes.&lt;br /&gt;
* 5. The Soil Temperature is read in the NetCDF file. If it does not exist, the subroutines crashes.&lt;br /&gt;
* 6. Interpolation of soil temperature and thermal inertia is done if ''dimlen'' $$\neq$$ ''nsoilmx''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Inputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nid            ! Name of the NetCDF file&lt;br /&gt;
integer :: ngrid          ! Number of surface grid points.&lt;br /&gt;
integer :: nsoil          ! Number of soil vertical grid points.&lt;br /&gt;
integer :: indextime      ! position of the first time point in the netCDF file.&lt;br /&gt;
real    :: tsurf(ngrid)   ! Surface temperatures (used for the interpolation)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Outputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: tsoil(ngrid,nsoil) ! Soil Temperature&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the soil thermal inertia are modified within the function but not are not output.&lt;br /&gt;
&lt;br /&gt;
==== soil ====&lt;br /&gt;
This subroutine computes the soil temperatures from surface temperatures and heat fluxes from the ground. The code works as follow:&lt;br /&gt;
* 1. During the first call, local variables (soil thickness, soil conductivity at the interface, etc.) are defined.&lt;br /&gt;
* 2. The first grid-point soil temperature is computed from the surface temperature and ground heat flux. &lt;br /&gt;
* 3. Other soil temperatures are then computed based on a recurrence relation&lt;br /&gt;
* 4. Ground heat flux for next time step is computed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Inputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: ngrid                ! Number of surface grid points.&lt;br /&gt;
integer :: nsoil                ! Number of soil vertical grid points.&lt;br /&gt;
logical :: firstcall            ! Boolean checking if it is the first call to this subroutine.&lt;br /&gt;
logical :: lastcall             ! Boolean checking if it is the last call to this subroutine (not used actually).&lt;br /&gt;
real    :: tsurf(ngrid)         ! Surface temperatures (used for the interpolation)&lt;br /&gt;
real    :: therm_i(ngrid,nsoil) ! Soil thermal inertia &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Outputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: tsoil(ngrid,nsoil) ! Soil Temperature&lt;br /&gt;
real :: fluxgrd(ngrid)     ! Soil heat flux&lt;br /&gt;
real :: capcal(ngrid)      ! surface specific heat capacity &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Useful Tricks ==&lt;br /&gt;
==== Changing the vertical grid ====&lt;br /&gt;
To change the vertical grid, one can changes these parameters in the run.def:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
## Number of grid points in the subsurface&lt;br /&gt;
nsoilmx = ...&lt;br /&gt;
## Thickness of topmost soil layer (m)&lt;br /&gt;
lay1_soil = ...&lt;br /&gt;
## Coefficient for soil layer thickness distribution&lt;br /&gt;
soil_thickness = ...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A word of caution: the soil grid must be adapted to catch the diurnal/seasonal heat propagation in the ground. In the code (''soil.F''), the first layer must be shallower than 0.5 x the diurnal skin depth, and larger than 2 times the seasonal skin depth. The skin depth $$\delta_P$$ (m) is calculated with:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    \delta_P = \sqrt{\frac{P \lambda}{\pi C}}&lt;br /&gt;
    \label{eq:skindepth}&lt;br /&gt;
\end{equation}&lt;br /&gt;
where $$P$$ is the diurnal/seasonal period (in seconds).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Inhomogeneity of the subsurface ====&lt;br /&gt;
&lt;br /&gt;
The scheme developed by E. Millour allows to have varying thermal properties with depth. When a layer of soil is not homogeneous, but instead composed of 2 separate sub-layers (e.g., dry regolith above massive subsurface ice), the layer's equivalent physical properties, i.e. values specified at node $$z_{k+1/2}$$, should be adjusted accordingly.&lt;br /&gt;
&lt;br /&gt;
The equivalent thermal conductivity of a composite layer is derived from the steady-state composite wall analogy. The thermal conductivity $$\lambda_{k+1/2}$$ of a composite layer consisting of a layer (extending from depths $$$z_k$$ to $$z_{k+1}$$) of thermal conductivity $$\lambda_k$$ above a layer (extending from depths $$z$$ to $$z_{k+1}$$) of thermal conductivity $$\lambda_{k+1}$$ is set to:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\lambda_{k+1/2} = \frac{z_{k+1}-z_k}{\frac{z-z_k}{\lambda_k} + \frac{z_{k+1}-z}{\lambda_{k+1}}}&lt;br /&gt;
    \label{eq:conductivitycomposite}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
The equivalent volumetric specific heat $$C_{k+1/2}$$ of a mixed layer must be such that the overall ability of the volume to store internal energy is equal to the sum of the individual sub-layers. $$C_{k+1/2}$$ is thus simply obtained as:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
C_{k+1/2} = C_k + \frac{z_{k+1}-z}{z-z_k}(C_{k+1}-C_k)&lt;br /&gt;
    \label{eq:heatcomposite}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
From the expressions of equivalent thermal conductivity and volumetric specific heat and the fact that thermal inertia $$I$$ is the square root of the product of $$\lambda$$ and $$C$$, one can also derive a relation between equivalent thermal inertia and those of the sub-layers:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    \frac{I_{k+1/2}^2}{C_{k+1/2}} = \frac{z_{k+1}-z_k}{(z-z_k)\frac{C_k}{I_k^2} + (z_{k+1}-z )\frac{C_{k+1}}{I_{k+1}^2}}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
The PCM assumes a constant value for $$C_k = C$$ for each layer, set to $$C = 10^6 $$ J m$$^{-3}$$ K$$^{-1}$$. The equivalent thermal inertia is thus:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    I_{k+1/2}= \sqrt{\frac{z_{k+1}-z_k}{\frac{z-z_k}{I_k^2} + \frac{z_{k+1}-z }{I_{k+1}^2}}}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
Lange, L. (2024). Studying and modeling the dynamics of water and CO$$_2$$ ice on Mars. PhD dissertation. [https://theses.hal.science/tel-04824230 Link to the manuscript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2627</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2627"/>
				<updated>2025-03-05T12:43:57Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* Useful Tricks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h.F90'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The subroutine ''soil_settings.F90'' which reads/initializes the soil depths and properties.&lt;br /&gt;
* The routine ''soil.F'' which computes soil temperatures and the flux from the ground to the surface.&lt;br /&gt;
&lt;br /&gt;
To compute the subsurface temperatures, one must set ''callsoil'' to .true. in the ''callphys.def''&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to ''nsoilmx''. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t)&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete description of the heat equation discretization can be found in Lange (2024) - pages 59 to 61 -.&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes separately. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time $$t+\delta t$$, the value of surface temperature $$T_s (t+\delta t)$$  is already known. In short, the algorithm works as follows: the surface temperature at $$t+\delta t$$ is computed with a radiative balance, knowing $$ F_C (t+\delta t)$$ . Then soil temperatures are updated. $$F_C (t+2\delta t)$$ is finally computed and used as an input to compute $$T_s (t+2\delta t)$$.&lt;br /&gt;
&lt;br /&gt;
== Description of the soil subroutines ==&lt;br /&gt;
==== comsoil_h ====&lt;br /&gt;
This module defines the parameters for the vertical grid discretization, and the default values:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nsoilmx = 18   ! The number of points in the subsurface.&lt;br /&gt;
real :: lay1_soil = 2.e-4 ! The depth (m) of first full soil layer &lt;br /&gt;
real :: alpha_soil = 2    ! The geometric factor for the soi layer thickness &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The vertical discretization is defined in two arrays:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: layer(nsoilmx)      ! Full soil layer depths&lt;br /&gt;
real :: mlayer(0:nsoilmx-1) ! Mid soil layer depths&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The soil thermal properties are defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: volcapa                   ! soil volumetric heat capacity, C&lt;br /&gt;
real :: inertiedat(ngrid,nsoilmx) ! Soil thermal inertia&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== soil_settings ====&lt;br /&gt;
&lt;br /&gt;
This subroutine reads from a NetCDF file (opened by the caller) of &amp;quot;startfi.nc&amp;quot; format the soil properties (number of grid points, soil temperature, thermal inertia), and eventually process to interpolation if needed.&lt;br /&gt;
&lt;br /&gt;
* 1. The number of soil layers is read in the NetCDF file. If the number of soil layer (''dimlen'') read is not equal to ''nsoilmx'', then the soil temperature and thermal inertia will be interpolated to the grid from the PCM defined in comsoil_h.&lt;br /&gt;
* 2. The vertical grid is read in the NetCDF file, or created if it does not exist, or if ''dimlen'' $$\neq$$ ''nsoilmx''.&lt;br /&gt;
* 3. The volumetric specific heat ''volcapa'' is read in the controle array (''controle(35)'') of the NetCDF file. If it does not exist, then ''volcapa'' is set to $$10^6$$.&lt;br /&gt;
* 4. The Thermal inertia is read in the NetCDF file. If it does not exist, the subroutines crashes.&lt;br /&gt;
* 5. The Soil Temperature is read in the NetCDF file. If it does not exist, the subroutines crashes.&lt;br /&gt;
* 6. Interpolation of soil temperature and thermal inertia is done if ''dimlen'' $$\neq$$ ''nsoilmx''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Inputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nid            ! Name of the NetCDF file&lt;br /&gt;
integer :: ngrid          ! Number of surface grid points.&lt;br /&gt;
integer :: nsoil          ! Number of soil vertical grid points.&lt;br /&gt;
integer :: indextime      ! position of the first time point in the netCDF file.&lt;br /&gt;
real    :: tsurf(ngrid)   ! Surface temperatures (used for the interpolation)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Outputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: tsoil(ngrid,nsoil) ! Soil Temperature&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the soil thermal inertia are modified within the function but not are not output.&lt;br /&gt;
&lt;br /&gt;
==== soil ====&lt;br /&gt;
This subroutine computes the soil temperatures from surface temperatures and heat fluxes from the ground. The code works as follow:&lt;br /&gt;
* 1. During the first call, local variables (soil thickness, soil conductivity at the interface, etc.) are defined.&lt;br /&gt;
* 2. The first grid-point soil temperature is computed from the surface temperature and ground heat flux. &lt;br /&gt;
* 3. Other soil temperatures are then computed based on a recurrence relation&lt;br /&gt;
* 4. Ground heat flux for next time step is computed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Inputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: ngrid                ! Number of surface grid points.&lt;br /&gt;
integer :: nsoil                ! Number of soil vertical grid points.&lt;br /&gt;
logical :: firstcall            ! Boolean checking if it is the first call to this subroutine.&lt;br /&gt;
logical :: lastcall             ! Boolean checking if it is the last call to this subroutine (not used actually).&lt;br /&gt;
real    :: tsurf(ngrid)         ! Surface temperatures (used for the interpolation)&lt;br /&gt;
real    :: therm_i(ngrid,nsoil) ! Soil thermal inertia &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Outputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: tsoil(ngrid,nsoil) ! Soil Temperature&lt;br /&gt;
real :: fluxgrd(ngrid)     ! Soil heat flux&lt;br /&gt;
real :: capcal(ngrid)      ! surface specific heat capacity &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Useful Tricks ==&lt;br /&gt;
==== Changing the vertical grid ====&lt;br /&gt;
To change the vertical grid, one can changes these parameters in the run.def:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
## Number of grid points in the subsurface&lt;br /&gt;
nsoilmx = ...&lt;br /&gt;
## Thickness of topmost soil layer (m)&lt;br /&gt;
lay1_soil = ...&lt;br /&gt;
## Coefficient for soil layer thickness distribution&lt;br /&gt;
soil_thickness = ...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A word of caution: the soil grid must be adapted to catch the diurnal/seasonal heat propagation in the ground. In the code (''soil.F''), the first layer must be shallower than 0.5 x the diurnal skin depth, and larger than 2 times the seasonal skin depth. The skin depth $$\delta_P$$ (m) is calculated with:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    \delta_P = \sqrt{\frac{P \lambda}{\pi C}}&lt;br /&gt;
    \label{eq:skindepth}&lt;br /&gt;
\end{equation}&lt;br /&gt;
where $$P$$ is the diurnal/seasonal period (in seconds).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Inhomogeneity of the subsurface ====&lt;br /&gt;
&lt;br /&gt;
The scheme developed by E. Millour allows to have varying thermal properties with depth. When a layer of soil is not homogeneous, but instead composed of 2 separate sub-layers (e.g., dry regolith above massive subsurface ice), the layer's equivalent physical properties, i.e. values specified at node $z_{k+1/2}$, should be adjusted accordingly.&lt;br /&gt;
&lt;br /&gt;
The equivalent thermal conductivity of a composite layer is derived from the steady-state composite wall analogy. The thermal conductivity $\lambda_{k+1/2}$ of a composite layer consisting of a layer (extending from depths $z_k$ to $z_{k+1}$) of thermal conductivity $\lambda_k$ above a layer (extending from depths $z$ to $z_{k+1}$) of thermal conductivity $\lambda_{k+1}$ is set to:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\lambda_{k+1/2} = \frac{z_{k+1}-z_k}{\frac{z-z_k}{\lambda_k} + \frac{z_{k+1}-z}{\lambda_{k+1}}}&lt;br /&gt;
    \label{eq:conductivitycomposite}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
The equivalent volumetric specific heat $C_{k+1/2}$ of a mixed layer must be such that the overall ability of the volume to store internal energy is equal to the sum of the individual sub-layers. $C_{k+1/2}$ is thus simply obtained as:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
C_{k+1/2} = C_k + \frac{z_{k+1}-z}{z-z_k}(C_{k+1}-C_k)&lt;br /&gt;
    \label{eq:heatcomposite}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
From the expressions of equivalent thermal conductivity and volumetric specific heat and the fact that thermal inertia $I$ is the square root of the product of $\lambda$ and $C$, one can also derive a relation between equivalent thermal inertia and those of the sub-layers:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    \frac{I_{k+1/2}^2}{C_{k+1/2}} = \frac{z_{k+1}-z_k}{(z-z_k)\frac{C_k}{I_k^2} + (z_{k+1}-z )\frac{C_{k+1}}{I_{k+1}^2}}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
The PCM assumes a constant value for $C_k = C$ for each layer, set to $C = 10^6 $~J~m$^{-3}$~K$^{-1}$. The equivalent thermal inertia is thus:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    I_{k+1/2}= \sqrt{\frac{z_{k+1}-z_k}{\frac{z-z_k}{I_k^2} + \frac{z_{k+1}-z }{I_{k+1}^2}}}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
Lange, L. (2024). Studying and modeling the dynamics of water and CO$$_2$$ ice on Mars. PhD dissertation. [https://theses.hal.science/tel-04824230 Link to the manuscript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2626</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2626"/>
				<updated>2025-03-05T12:42:36Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* Changing the vertical grid */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h.F90'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The subroutine ''soil_settings.F90'' which reads/initializes the soil depths and properties.&lt;br /&gt;
* The routine ''soil.F'' which computes soil temperatures and the flux from the ground to the surface.&lt;br /&gt;
&lt;br /&gt;
To compute the subsurface temperatures, one must set ''callsoil'' to .true. in the ''callphys.def''&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to ''nsoilmx''. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t)&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete description of the heat equation discretization can be found in Lange (2024) - pages 59 to 61 -.&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes separately. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time $$t+\delta t$$, the value of surface temperature $$T_s (t+\delta t)$$  is already known. In short, the algorithm works as follows: the surface temperature at $$t+\delta t$$ is computed with a radiative balance, knowing $$ F_C (t+\delta t)$$ . Then soil temperatures are updated. $$F_C (t+2\delta t)$$ is finally computed and used as an input to compute $$T_s (t+2\delta t)$$.&lt;br /&gt;
&lt;br /&gt;
== Description of the soil subroutines ==&lt;br /&gt;
==== comsoil_h ====&lt;br /&gt;
This module defines the parameters for the vertical grid discretization, and the default values:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nsoilmx = 18   ! The number of points in the subsurface.&lt;br /&gt;
real :: lay1_soil = 2.e-4 ! The depth (m) of first full soil layer &lt;br /&gt;
real :: alpha_soil = 2    ! The geometric factor for the soi layer thickness &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The vertical discretization is defined in two arrays:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: layer(nsoilmx)      ! Full soil layer depths&lt;br /&gt;
real :: mlayer(0:nsoilmx-1) ! Mid soil layer depths&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The soil thermal properties are defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: volcapa                   ! soil volumetric heat capacity, C&lt;br /&gt;
real :: inertiedat(ngrid,nsoilmx) ! Soil thermal inertia&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== soil_settings ====&lt;br /&gt;
&lt;br /&gt;
This subroutine reads from a NetCDF file (opened by the caller) of &amp;quot;startfi.nc&amp;quot; format the soil properties (number of grid points, soil temperature, thermal inertia), and eventually process to interpolation if needed.&lt;br /&gt;
&lt;br /&gt;
* 1. The number of soil layers is read in the NetCDF file. If the number of soil layer (''dimlen'') read is not equal to ''nsoilmx'', then the soil temperature and thermal inertia will be interpolated to the grid from the PCM defined in comsoil_h.&lt;br /&gt;
* 2. The vertical grid is read in the NetCDF file, or created if it does not exist, or if ''dimlen'' $$\neq$$ ''nsoilmx''.&lt;br /&gt;
* 3. The volumetric specific heat ''volcapa'' is read in the controle array (''controle(35)'') of the NetCDF file. If it does not exist, then ''volcapa'' is set to $$10^6$$.&lt;br /&gt;
* 4. The Thermal inertia is read in the NetCDF file. If it does not exist, the subroutines crashes.&lt;br /&gt;
* 5. The Soil Temperature is read in the NetCDF file. If it does not exist, the subroutines crashes.&lt;br /&gt;
* 6. Interpolation of soil temperature and thermal inertia is done if ''dimlen'' $$\neq$$ ''nsoilmx''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Inputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nid            ! Name of the NetCDF file&lt;br /&gt;
integer :: ngrid          ! Number of surface grid points.&lt;br /&gt;
integer :: nsoil          ! Number of soil vertical grid points.&lt;br /&gt;
integer :: indextime      ! position of the first time point in the netCDF file.&lt;br /&gt;
real    :: tsurf(ngrid)   ! Surface temperatures (used for the interpolation)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Outputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: tsoil(ngrid,nsoil) ! Soil Temperature&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the soil thermal inertia are modified within the function but not are not output.&lt;br /&gt;
&lt;br /&gt;
==== soil ====&lt;br /&gt;
This subroutine computes the soil temperatures from surface temperatures and heat fluxes from the ground. The code works as follow:&lt;br /&gt;
* 1. During the first call, local variables (soil thickness, soil conductivity at the interface, etc.) are defined.&lt;br /&gt;
* 2. The first grid-point soil temperature is computed from the surface temperature and ground heat flux. &lt;br /&gt;
* 3. Other soil temperatures are then computed based on a recurrence relation&lt;br /&gt;
* 4. Ground heat flux for next time step is computed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Inputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: ngrid                ! Number of surface grid points.&lt;br /&gt;
integer :: nsoil                ! Number of soil vertical grid points.&lt;br /&gt;
logical :: firstcall            ! Boolean checking if it is the first call to this subroutine.&lt;br /&gt;
logical :: lastcall             ! Boolean checking if it is the last call to this subroutine (not used actually).&lt;br /&gt;
real    :: tsurf(ngrid)         ! Surface temperatures (used for the interpolation)&lt;br /&gt;
real    :: therm_i(ngrid,nsoil) ! Soil thermal inertia &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Outputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: tsoil(ngrid,nsoil) ! Soil Temperature&lt;br /&gt;
real :: fluxgrd(ngrid)     ! Soil heat flux&lt;br /&gt;
real :: capcal(ngrid)      ! surface specific heat capacity &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Useful Tricks ==&lt;br /&gt;
==== Changing the vertical grid ====&lt;br /&gt;
To change the vertical grid, one can changes these parameters in the run.def:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
## Number of grid points in the subsurface&lt;br /&gt;
nsoilmx = ...&lt;br /&gt;
## Thickness of topmost soil layer (m)&lt;br /&gt;
lay1_soil = ...&lt;br /&gt;
## Coefficient for soil layer thickness distribution&lt;br /&gt;
soil_thickness = ...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A word of caution: the soil grid must be adapted to catch the diurnal/seasonal heat propagation in the ground. In the code (''soil.F''), the first layer must be shallower than 0.5 x the diurnal skin depth, and larger than 2 times the seasonal skin depth. The skin depth $$\delta_P$$ (m) is calculated with:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    \delta_P = \sqrt{\frac{P \lambda}{\pi C}}&lt;br /&gt;
    \label{eq:skindepth}&lt;br /&gt;
\end{equation}&lt;br /&gt;
where $$P$$ is the diurnal/seasonal period (in seconds).&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
Lange, L. (2024). Studying and modeling the dynamics of water and CO$$_2$$ ice on Mars. PhD dissertation. [https://theses.hal.science/tel-04824230 Link to the manuscript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2625</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2625"/>
				<updated>2025-03-05T12:36:02Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* Changing the vertical grid */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h.F90'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The subroutine ''soil_settings.F90'' which reads/initializes the soil depths and properties.&lt;br /&gt;
* The routine ''soil.F'' which computes soil temperatures and the flux from the ground to the surface.&lt;br /&gt;
&lt;br /&gt;
To compute the subsurface temperatures, one must set ''callsoil'' to .true. in the ''callphys.def''&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to ''nsoilmx''. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t)&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete description of the heat equation discretization can be found in Lange (2024) - pages 59 to 61 -.&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes separately. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time $$t+\delta t$$, the value of surface temperature $$T_s (t+\delta t)$$  is already known. In short, the algorithm works as follows: the surface temperature at $$t+\delta t$$ is computed with a radiative balance, knowing $$ F_C (t+\delta t)$$ . Then soil temperatures are updated. $$F_C (t+2\delta t)$$ is finally computed and used as an input to compute $$T_s (t+2\delta t)$$.&lt;br /&gt;
&lt;br /&gt;
== Description of the soil subroutines ==&lt;br /&gt;
==== comsoil_h ====&lt;br /&gt;
This module defines the parameters for the vertical grid discretization, and the default values:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nsoilmx = 18   ! The number of points in the subsurface.&lt;br /&gt;
real :: lay1_soil = 2.e-4 ! The depth (m) of first full soil layer &lt;br /&gt;
real :: alpha_soil = 2    ! The geometric factor for the soi layer thickness &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The vertical discretization is defined in two arrays:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: layer(nsoilmx)      ! Full soil layer depths&lt;br /&gt;
real :: mlayer(0:nsoilmx-1) ! Mid soil layer depths&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The soil thermal properties are defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: volcapa                   ! soil volumetric heat capacity, C&lt;br /&gt;
real :: inertiedat(ngrid,nsoilmx) ! Soil thermal inertia&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== soil_settings ====&lt;br /&gt;
&lt;br /&gt;
This subroutine reads from a NetCDF file (opened by the caller) of &amp;quot;startfi.nc&amp;quot; format the soil properties (number of grid points, soil temperature, thermal inertia), and eventually process to interpolation if needed.&lt;br /&gt;
&lt;br /&gt;
* 1. The number of soil layers is read in the NetCDF file. If the number of soil layer (''dimlen'') read is not equal to ''nsoilmx'', then the soil temperature and thermal inertia will be interpolated to the grid from the PCM defined in comsoil_h.&lt;br /&gt;
* 2. The vertical grid is read in the NetCDF file, or created if it does not exist, or if ''dimlen'' $$\neq$$ ''nsoilmx''.&lt;br /&gt;
* 3. The volumetric specific heat ''volcapa'' is read in the controle array (''controle(35)'') of the NetCDF file. If it does not exist, then ''volcapa'' is set to $$10^6$$.&lt;br /&gt;
* 4. The Thermal inertia is read in the NetCDF file. If it does not exist, the subroutines crashes.&lt;br /&gt;
* 5. The Soil Temperature is read in the NetCDF file. If it does not exist, the subroutines crashes.&lt;br /&gt;
* 6. Interpolation of soil temperature and thermal inertia is done if ''dimlen'' $$\neq$$ ''nsoilmx''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Inputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nid            ! Name of the NetCDF file&lt;br /&gt;
integer :: ngrid          ! Number of surface grid points.&lt;br /&gt;
integer :: nsoil          ! Number of soil vertical grid points.&lt;br /&gt;
integer :: indextime      ! position of the first time point in the netCDF file.&lt;br /&gt;
real    :: tsurf(ngrid)   ! Surface temperatures (used for the interpolation)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Outputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: tsoil(ngrid,nsoil) ! Soil Temperature&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the soil thermal inertia are modified within the function but not are not output.&lt;br /&gt;
&lt;br /&gt;
==== soil ====&lt;br /&gt;
This subroutine computes the soil temperatures from surface temperatures and heat fluxes from the ground. The code works as follow:&lt;br /&gt;
* 1. During the first call, local variables (soil thickness, soil conductivity at the interface, etc.) are defined.&lt;br /&gt;
* 2. The first grid-point soil temperature is computed from the surface temperature and ground heat flux. &lt;br /&gt;
* 3. Other soil temperatures are then computed based on a recurrence relation&lt;br /&gt;
* 4. Ground heat flux for next time step is computed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Inputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: ngrid                ! Number of surface grid points.&lt;br /&gt;
integer :: nsoil                ! Number of soil vertical grid points.&lt;br /&gt;
logical :: firstcall            ! Boolean checking if it is the first call to this subroutine.&lt;br /&gt;
logical :: lastcall             ! Boolean checking if it is the last call to this subroutine (not used actually).&lt;br /&gt;
real    :: tsurf(ngrid)         ! Surface temperatures (used for the interpolation)&lt;br /&gt;
real    :: therm_i(ngrid,nsoil) ! Soil thermal inertia &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Outputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: tsoil(ngrid,nsoil) ! Soil Temperature&lt;br /&gt;
real :: fluxgrd(ngrid)     ! Soil heat flux&lt;br /&gt;
real :: capcal(ngrid)      ! surface specific heat capacity &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Useful Tricks ==&lt;br /&gt;
==== Changing the vertical grid ====&lt;br /&gt;
To change the vertical grid, one can changes these parameters in the run.def:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
## Number of grid points in the subsurface&lt;br /&gt;
nsoilmx = ...&lt;br /&gt;
## Thickness of topmost soil layer (m)&lt;br /&gt;
lay1_soil = ...&lt;br /&gt;
## Coefficient for soil layer thickness distribution&lt;br /&gt;
soil_thickness = ...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
Lange, L. (2024). Studying and modeling the dynamics of water and CO$$_2$$ ice on Mars. PhD dissertation. [https://theses.hal.science/tel-04824230 Link to the manuscript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2624</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2624"/>
				<updated>2025-03-05T12:35:45Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h.F90'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The subroutine ''soil_settings.F90'' which reads/initializes the soil depths and properties.&lt;br /&gt;
* The routine ''soil.F'' which computes soil temperatures and the flux from the ground to the surface.&lt;br /&gt;
&lt;br /&gt;
To compute the subsurface temperatures, one must set ''callsoil'' to .true. in the ''callphys.def''&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to ''nsoilmx''. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t)&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete description of the heat equation discretization can be found in Lange (2024) - pages 59 to 61 -.&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes separately. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time $$t+\delta t$$, the value of surface temperature $$T_s (t+\delta t)$$  is already known. In short, the algorithm works as follows: the surface temperature at $$t+\delta t$$ is computed with a radiative balance, knowing $$ F_C (t+\delta t)$$ . Then soil temperatures are updated. $$F_C (t+2\delta t)$$ is finally computed and used as an input to compute $$T_s (t+2\delta t)$$.&lt;br /&gt;
&lt;br /&gt;
== Description of the soil subroutines ==&lt;br /&gt;
==== comsoil_h ====&lt;br /&gt;
This module defines the parameters for the vertical grid discretization, and the default values:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nsoilmx = 18   ! The number of points in the subsurface.&lt;br /&gt;
real :: lay1_soil = 2.e-4 ! The depth (m) of first full soil layer &lt;br /&gt;
real :: alpha_soil = 2    ! The geometric factor for the soi layer thickness &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The vertical discretization is defined in two arrays:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: layer(nsoilmx)      ! Full soil layer depths&lt;br /&gt;
real :: mlayer(0:nsoilmx-1) ! Mid soil layer depths&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The soil thermal properties are defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: volcapa                   ! soil volumetric heat capacity, C&lt;br /&gt;
real :: inertiedat(ngrid,nsoilmx) ! Soil thermal inertia&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== soil_settings ====&lt;br /&gt;
&lt;br /&gt;
This subroutine reads from a NetCDF file (opened by the caller) of &amp;quot;startfi.nc&amp;quot; format the soil properties (number of grid points, soil temperature, thermal inertia), and eventually process to interpolation if needed.&lt;br /&gt;
&lt;br /&gt;
* 1. The number of soil layers is read in the NetCDF file. If the number of soil layer (''dimlen'') read is not equal to ''nsoilmx'', then the soil temperature and thermal inertia will be interpolated to the grid from the PCM defined in comsoil_h.&lt;br /&gt;
* 2. The vertical grid is read in the NetCDF file, or created if it does not exist, or if ''dimlen'' $$\neq$$ ''nsoilmx''.&lt;br /&gt;
* 3. The volumetric specific heat ''volcapa'' is read in the controle array (''controle(35)'') of the NetCDF file. If it does not exist, then ''volcapa'' is set to $$10^6$$.&lt;br /&gt;
* 4. The Thermal inertia is read in the NetCDF file. If it does not exist, the subroutines crashes.&lt;br /&gt;
* 5. The Soil Temperature is read in the NetCDF file. If it does not exist, the subroutines crashes.&lt;br /&gt;
* 6. Interpolation of soil temperature and thermal inertia is done if ''dimlen'' $$\neq$$ ''nsoilmx''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Inputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nid            ! Name of the NetCDF file&lt;br /&gt;
integer :: ngrid          ! Number of surface grid points.&lt;br /&gt;
integer :: nsoil          ! Number of soil vertical grid points.&lt;br /&gt;
integer :: indextime      ! position of the first time point in the netCDF file.&lt;br /&gt;
real    :: tsurf(ngrid)   ! Surface temperatures (used for the interpolation)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Outputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: tsoil(ngrid,nsoil) ! Soil Temperature&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the soil thermal inertia are modified within the function but not are not output.&lt;br /&gt;
&lt;br /&gt;
==== soil ====&lt;br /&gt;
This subroutine computes the soil temperatures from surface temperatures and heat fluxes from the ground. The code works as follow:&lt;br /&gt;
* 1. During the first call, local variables (soil thickness, soil conductivity at the interface, etc.) are defined.&lt;br /&gt;
* 2. The first grid-point soil temperature is computed from the surface temperature and ground heat flux. &lt;br /&gt;
* 3. Other soil temperatures are then computed based on a recurrence relation&lt;br /&gt;
* 4. Ground heat flux for next time step is computed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Inputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: ngrid                ! Number of surface grid points.&lt;br /&gt;
integer :: nsoil                ! Number of soil vertical grid points.&lt;br /&gt;
logical :: firstcall            ! Boolean checking if it is the first call to this subroutine.&lt;br /&gt;
logical :: lastcall             ! Boolean checking if it is the last call to this subroutine (not used actually).&lt;br /&gt;
real    :: tsurf(ngrid)         ! Surface temperatures (used for the interpolation)&lt;br /&gt;
real    :: therm_i(ngrid,nsoil) ! Soil thermal inertia &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Outputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: tsoil(ngrid,nsoil) ! Soil Temperature&lt;br /&gt;
real :: fluxgrd(ngrid)     ! Soil heat flux&lt;br /&gt;
real :: capcal(ngrid)      ! surface specific heat capacity &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Useful Tricks ==&lt;br /&gt;
==== Changing the vertical grid ====&lt;br /&gt;
To change the vertical grid, one can changes these parameters in the run.def:&lt;br /&gt;
## Number of grid points in the subsurface&lt;br /&gt;
nsoilmx = ...&lt;br /&gt;
## Thickness of topmost soil layer (m)&lt;br /&gt;
lay1_soil = ...&lt;br /&gt;
## Coefficient for soil layer thickness distribution&lt;br /&gt;
soil_thickness = ...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
Lange, L. (2024). Studying and modeling the dynamics of water and CO$$_2$$ ice on Mars. PhD dissertation. [https://theses.hal.science/tel-04824230 Link to the manuscript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2623</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2623"/>
				<updated>2025-03-05T12:32:58Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h.F90'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The subroutine ''soil_settings.F90'' which reads/initializes the soil depths and properties.&lt;br /&gt;
* The routine ''soil.F'' which computes soil temperatures and the flux from the ground to the surface.&lt;br /&gt;
&lt;br /&gt;
To compute the subsurface temperatures, one must set ''callsoil'' to .true. in the ''callphys.def''&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to ''nsoilmx''. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t)&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete description of the heat equation discretization can be found in Lange (2024) - pages 59 to 61 -.&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes separately. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time $$t+\delta t$$, the value of surface temperature $$T_s (t+\delta t)$$  is already known. In short, the algorithm works as follows: the surface temperature at $$t+\delta t$$ is computed with a radiative balance, knowing $$ F_C (t+\delta t)$$ . Then soil temperatures are updated. $$F_C (t+2\delta t)$$ is finally computed and used as an input to compute $$T_s (t+2\delta t)$$.&lt;br /&gt;
&lt;br /&gt;
== Description of the soil subroutines ==&lt;br /&gt;
==== comsoil_h ====&lt;br /&gt;
This module defines the parameters for the vertical grid discretization, and the default values:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nsoilmx = 18   ! The number of points in the subsurface.&lt;br /&gt;
real :: lay1_soil = 2.e-4 ! The depth (m) of first full soil layer &lt;br /&gt;
real :: alpha_soil = 2    ! The geometric factor for the soi layer thickness &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The vertical discretization is defined in two arrays:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: layer(nsoilmx)      ! Full soil layer depths&lt;br /&gt;
real :: mlayer(0:nsoilmx-1) ! Mid soil layer depths&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The soil thermal properties are defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: volcapa                   ! soil volumetric heat capacity, C&lt;br /&gt;
real :: inertiedat(ngrid,nsoilmx) ! Soil thermal inertia&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== soil_settings ====&lt;br /&gt;
&lt;br /&gt;
This subroutine reads from a NetCDF file (opened by the caller) of &amp;quot;startfi.nc&amp;quot; format the soil properties (number of grid points, soil temperature, thermal inertia), and eventually process to interpolation if needed.&lt;br /&gt;
&lt;br /&gt;
* 1. The number of soil layers is read in the NetCDF file. If the number of soil layer (''dimlen'') read is not equal to ''nsoilmx'', then the soil temperature and thermal inertia will be interpolated to the grid from the PCM defined in comsoil_h.&lt;br /&gt;
* 2. The vertical grid is read in the NetCDF file, or created if it does not exist, or if ''dimlen'' $$\neq$$ ''nsoilmx''.&lt;br /&gt;
* 3. The volumetric specific heat ''volcapa'' is read in the controle array (''controle(35)'') of the NetCDF file. If it does not exist, then ''volcapa'' is set to $$10^6$$.&lt;br /&gt;
* 4. The Thermal inertia is read in the NetCDF file. If it does not exist, the subroutines crashes.&lt;br /&gt;
* 5. The Soil Temperature is read in the NetCDF file. If it does not exist, the subroutines crashes.&lt;br /&gt;
* 6. Interpolation of soil temperature and thermal inertia is done if ''dimlen'' $$\neq$$ ''nsoilmx''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Inputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nid            ! Name of the NetCDF file&lt;br /&gt;
integer :: ngrid          ! Number of surface grid points.&lt;br /&gt;
integer :: nsoil          ! Number of soil vertical grid points.&lt;br /&gt;
integer :: indextime      ! position of the first time point in the netCDF file.&lt;br /&gt;
real    :: tsurf(ngrid)   ! Surface temperatures (used for the interpolation)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Outputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: tsoil(ngrid,nsoil) ! Soil Temperature&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the soil thermal inertia are modified within the function but not are not output.&lt;br /&gt;
&lt;br /&gt;
==== soil ====&lt;br /&gt;
This subroutine computes the soil temperatures from surface temperatures and heat fluxes from the ground. The code works as follow:&lt;br /&gt;
* 1. During the first call, local variables (soil thickness, soil conductivity at the interface, etc.) are defined.&lt;br /&gt;
* 2. The first grid-point soil temperature is computed from the surface temperature and ground heat flux. &lt;br /&gt;
* 3. Other soil temperatures are then computed based on a recurrence relation&lt;br /&gt;
* 4. Ground heat flux for next time step is computed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Inputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: ngrid                ! Number of surface grid points.&lt;br /&gt;
integer :: nsoil                ! Number of soil vertical grid points.&lt;br /&gt;
logical :: firstcall            ! Boolean checking if it is the first call to this subroutine.&lt;br /&gt;
logical :: lastcall             ! Boolean checking if it is the last call to this subroutine (not used actually).&lt;br /&gt;
real    :: tsurf(ngrid)         ! Surface temperatures (used for the interpolation)&lt;br /&gt;
real    :: therm_i(ngrid,nsoil) ! Soil thermal inertia &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Outputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: tsoil(ngrid,nsoil) ! Soil Temperature&lt;br /&gt;
real :: fluxgrd(ngrid)     ! Soil heat flux&lt;br /&gt;
real :: capcal(ngrid)      ! surface specific heat capacity &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Useful Tricks ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
Lange, L. (2024). Studying and modeling the dynamics of water and CO$$_2$$ ice on Mars. PhD dissertation. [https://theses.hal.science/tel-04824230 Link to the manuscript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2622</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2622"/>
				<updated>2025-03-05T11:16:52Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* Numerical approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h.F90'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The subroutine ''soil_settings.F90'' which reads/initializes the soil depths and properties.&lt;br /&gt;
* The routine ''soil.F'' which computes soil temperatures and the flux from the ground to the surface.&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to ''nsoilmx''. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t)&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete description of the heat equation discretization can be found in Lange (2024) - pages 59 to 61 -.&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes separately. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time $$t+\delta t$$, the value of surface temperature $$T_s (t+\delta t)$$  is already known. In short, the algorithm works as follows: the surface temperature at $$t+\delta t$$ is computed with a radiative balance, knowing $$ F_C (t+\delta t)$$ . Then soil temperatures are updated. $$F_C (t+2\delta t)$$ is finally computed and used as an input to compute $$T_s (t+2\delta t)$$.&lt;br /&gt;
&lt;br /&gt;
== Description of the soil subroutines ==&lt;br /&gt;
==== comsoil_h ====&lt;br /&gt;
This module defines the parameters for the vertical grid discretization, and the default values:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nsoilmx = 18   ! The number of points in the subsurface.&lt;br /&gt;
real :: lay1_soil = 2.e-4 ! The depth (m) of first full soil layer &lt;br /&gt;
real :: alpha_soil = 2    ! The geometric factor for the soi layer thickness &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The vertical discretization is defined in two arrays:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: layer(nsoilmx)      ! Full soil layer depths&lt;br /&gt;
real :: mlayer(0:nsoilmx-1) ! Mid soil layer depths&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The soil thermal properties are defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: volcapa                   ! soil volumetric heat capacity, C&lt;br /&gt;
real :: inertiedat(ngrid,nsoilmx) ! Soil thermal inertia&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== soil_settings ====&lt;br /&gt;
&lt;br /&gt;
This subroutine reads from a NetCDF file (opened by the caller) of &amp;quot;startfi.nc&amp;quot; format the soil properties (number of grid points, soil temperature, thermal inertia), and eventually process to interpolation if needed.&lt;br /&gt;
&lt;br /&gt;
* 1. The number of soil layers is read in the NetCDF file. If the number of soil layer (''dimlen'') read is not equal to ''nsoilmx'', then the soil temperature and thermal inertia will be interpolated to the grid from the PCM defined in comsoil_h.&lt;br /&gt;
* 2. The vertical grid is read in the NetCDF file, or created if it does not exist, or if ''dimlen'' $$\neq$$ ''nsoilmx''.&lt;br /&gt;
* 3. The volumetric specific heat ''volcapa'' is read in the controle array (''controle(35)'') of the NetCDF file. If it does not exist, then ''volcapa'' is set to $$10^6$$.&lt;br /&gt;
* 4. The Thermal inertia is read in the NetCDF file. If it does not exist, the subroutines crashes.&lt;br /&gt;
* 5. The Soil Temperature is read in the NetCDF file. If it does not exist, the subroutines crashes.&lt;br /&gt;
* 6. Interpolation of soil temperature and thermal inertia is done if ''dimlen'' $$\neq$$ ''nsoilmx''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Inputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nid            ! Name of the NetCDF file&lt;br /&gt;
integer :: ngrid          ! Number of surface grid points.&lt;br /&gt;
integer :: nsoil          ! Number of soil vertical grid points.&lt;br /&gt;
integer :: indextime      ! position of the first time point in the netCDF file.&lt;br /&gt;
real    :: tsurf(ngrid)   ! Surface temperatures (used for the interpolation)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Outputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: tsoil(ngrid,nsoil) ! Soil Temperature&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the soil thermal inertia are modified within the function but not are not output.&lt;br /&gt;
&lt;br /&gt;
==== soil ====&lt;br /&gt;
This subroutine computes the soil temperatures from surface temperatures and heat fluxes from the ground. The code works as follow:&lt;br /&gt;
* 1. During the first call, local variables (soil thickness, soil conductivity at the interface, etc.) are defined.&lt;br /&gt;
* 2. The first grid-point soil temperature is computed from the surface temperature and ground heat flux. &lt;br /&gt;
* 3. Other soil temperatures are then computed based on a recurrence relation&lt;br /&gt;
* 4. Ground heat flux for next time step is computed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Inputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: ngrid                ! Number of surface grid points.&lt;br /&gt;
integer :: nsoil                ! Number of soil vertical grid points.&lt;br /&gt;
logical :: firstcall            ! Boolean checking if it is the first call to this subroutine.&lt;br /&gt;
logical :: lastcall             ! Boolean checking if it is the last call to this subroutine (not used actually).&lt;br /&gt;
real    :: tsurf(ngrid)         ! Surface temperatures (used for the interpolation)&lt;br /&gt;
real    :: therm_i(ngrid,nsoil) ! Soil thermal inertia &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Outputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: tsoil(ngrid,nsoil) ! Soil Temperature&lt;br /&gt;
real :: fluxgrd(ngrid)     ! Soil heat flux&lt;br /&gt;
real :: capcal(ngrid)      ! surface specific heat capacity &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Useful Tricks ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
Lange, L. (2024). Studying and modeling the dynamics of water and CO$$_2$$ ice on Mars. PhD dissertation. [https://theses.hal.science/tel-04824230 Link to the manuscript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2615</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2615"/>
				<updated>2025-03-05T11:10:11Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h.F90'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The subroutine ''soil_settings.F90'' which reads/initializes the soil depths and properties.&lt;br /&gt;
* The routine ''soil.F'' which computes soil temperatures and the flux from the ground to the surface.&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to ''nsoilmx''. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete description of the heat equation discretization can be found in Lange (2024) - pages 59 to 61 -.&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes separately. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time $$t+\delta t$$, the value of surface temperature $$T_s (t+\delta t)$$  is already known. In short, the algorithm works as follows: the surface temperature at $$t+\delta t$$ is computed with a radiative balance, knowing $$ F_C (t+\delta t)$$ . Then soil temperatures are updated. $$F_C (t+2\delta t)$$ is finally computed and used as an input to compute $$T_s (t+2\delta t)$$.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Description of the soil subroutines ==&lt;br /&gt;
==== comsoil_h ====&lt;br /&gt;
This module defines the parameters for the vertical grid discretization, and the default values:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nsoilmx = 18   ! The number of points in the subsurface.&lt;br /&gt;
real :: lay1_soil = 2.e-4 ! The depth (m) of first full soil layer &lt;br /&gt;
real :: alpha_soil = 2    ! The geometric factor for the soi layer thickness &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The vertical discretization is defined in two arrays:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: layer(nsoilmx)      ! Full soil layer depths&lt;br /&gt;
real :: mlayer(0:nsoilmx-1) ! Mid soil layer depths&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The soil thermal properties are defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: volcapa                   ! soil volumetric heat capacity, C&lt;br /&gt;
real :: inertiedat(ngrid,nsoilmx) ! Soil thermal inertia&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== soil_settings ====&lt;br /&gt;
&lt;br /&gt;
This subroutine reads from a NetCDF file (opened by the caller) of &amp;quot;startfi.nc&amp;quot; format the soil properties (number of grid points, soil temperature, thermal inertia), and eventually process to interpolation if needed.&lt;br /&gt;
&lt;br /&gt;
* 1. The number of soil layers is read in the NetCDF file. If the number of soil layer (''dimlen'') read is not equal to ''nsoilmx'', then the soil temperature and thermal inertia will be interpolated to the grid from the PCM defined in comsoil_h.&lt;br /&gt;
* 2. The vertical grid is read in the NetCDF file, or created if it does not exist, or if ''dimlen'' $$\neq$$ ''nsoilmx''.&lt;br /&gt;
* 3. The volumetric specific heat ''volcapa'' is read in the controle array (''controle(35)'') of the NetCDF file. If it does not exist, then ''volcapa'' is set to $$10^6$$.&lt;br /&gt;
* 4. The Thermal inertia is read in the NetCDF file. If it does not exist, the subroutines crashes.&lt;br /&gt;
* 5. The Soil Temperature is read in the NetCDF file. If it does not exist, the subroutines crashes.&lt;br /&gt;
* 6. Interpolation of soil temperature and thermal inertia is done if ''dimlen'' $$\neq$$ ''nsoilmx''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Inputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nid            ! Name of the NetCDF file&lt;br /&gt;
integer :: ngrid          ! Number of surface grid points.&lt;br /&gt;
integer :: nsoil          ! Number of soil vertical grid points.&lt;br /&gt;
integer :: indextime      ! position of the first time point in the netCDF file.&lt;br /&gt;
real    :: tsurf(ngrid)   ! Surface temperatures (used for the interpolation)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Outputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: tsoil(ngrid,nsoil) ! Soil Temperature&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the soil thermal inertia are modified within the function but not are not output.&lt;br /&gt;
&lt;br /&gt;
==== soil ====&lt;br /&gt;
This subroutine computes the soil temperatures from surface temperatures and heat fluxes from the ground. The code works as follow:&lt;br /&gt;
* 1. During the first call, local variables (soil thickness, soil conductivity at the interface, etc.) are defined.&lt;br /&gt;
* 2. The first grid-point soil temperature is computed from the surface temperature and ground heat flux. &lt;br /&gt;
* 3. Other soil temperatures are then computed based on a recurrence relation&lt;br /&gt;
* 4. Ground heat flux for next time step is computed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Inputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: ngrid                ! Number of surface grid points.&lt;br /&gt;
integer :: nsoil                ! Number of soil vertical grid points.&lt;br /&gt;
logical :: firstcall            ! Boolean checking if it is the first call to this subroutine.&lt;br /&gt;
logical :: lastcall             ! Boolean checking if it is the last call to this subroutine (not used actually).&lt;br /&gt;
real    :: tsurf(ngrid)         ! Surface temperatures (used for the interpolation)&lt;br /&gt;
real    :: therm_i(ngrid,nsoil) ! Soil thermal inertia &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Outputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: tsoil(ngrid,nsoil) ! Soil Temperature&lt;br /&gt;
real :: fluxgrd(ngrid)     ! Soil heat flux&lt;br /&gt;
real :: capcal(ngrid)      ! surface specific heat capacity &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Useful Tricks ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
Lange, L. (2024). Studying and modeling the dynamics of water and CO$$_2$$ ice on Mars. PhD dissertation. [https://theses.hal.science/tel-04824230 Link to the manuscript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2614</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2614"/>
				<updated>2025-03-05T11:09:31Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* soil_settings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h.F90'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The subroutine ''soil_settings.F90'' which reads/initializes the soil depths and properties.&lt;br /&gt;
* The routine ''soil.F'' which computes soil temperatures and the flux from the ground to the surface.&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to ''nsoilmx''. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete description of the heat equation discretization can be found in Lange (2024) - pages 59 to 61 -.&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes separately. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time $$t+\delta t$$, the value of surface temperature $$T_s (t+\delta t)$$  is already known. In short, the algorithm works as follows: the surface temperature at $$t+\delta t$$ is computed with a radiative balance, knowing $$ F_C (t+\delta t)$$ . Then soil temperatures are updated. $$F_C (t+2\delta t)$$ is finally computed and used as an input to compute $$T_s (t+2\delta t)$$.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Description of the soil subroutines ==&lt;br /&gt;
==== comsoil_h ====&lt;br /&gt;
This module defines the parameters for the vertical grid discretization, and the default values:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nsoilmx = 18   ! The number of points in the subsurface.&lt;br /&gt;
real :: lay1_soil = 2.e-4 ! The depth (m) of first full soil layer &lt;br /&gt;
real :: alpha_soil = 2    ! The geometric factor for the soi layer thickness &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The vertical discretization is defined in two arrays:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: layer(nsoilmx)      ! Full soil layer depths&lt;br /&gt;
real :: mlayer(0:nsoilmx-1) ! Mid soil layer depths&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The soil thermal properties are defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: volcapa                   ! soil volumetric heat capacity, C&lt;br /&gt;
real :: inertiedat(ngrid,nsoilmx) ! Soil thermal inertia&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== soil_settings ====&lt;br /&gt;
&lt;br /&gt;
This subroutine reads from a NetCDF file (opened by the caller) of &amp;quot;startfi.nc&amp;quot; format the soil properties (number of grid points, soil temperature, thermal inertia), and eventually process to interpolation if needed.&lt;br /&gt;
&lt;br /&gt;
* 1. The number of soil layers is read in the NetCDF file. If the number of soil layer (''dimlen'') read is not equal to ''nsoilmx'', then the soil temperature and thermal inertia will be interpolated to the grid from the PCM defined in comsoil_h.&lt;br /&gt;
* 2. The vertical grid is read in the NetCDF file, or created if it does not exist, or if ''dimlen'' $$\neq$$ ''nsoilmx''.&lt;br /&gt;
* 3. The volumetric specific heat ''volcapa'' is read in the controle array (''controle(35)'') of the NetCDF file. If it does not exist, then ''volcapa'' is set to $$10^6$$.&lt;br /&gt;
* 4. The Thermal inertia is read in the NetCDF file. If it does not exist, the subroutines crashes.&lt;br /&gt;
* 5. The Soil Temperature is read in the NetCDF file. If it does not exist, the subroutines crashes.&lt;br /&gt;
* 6. Interpolation of soil temperature and thermal inertia is done if ''dimlen'' $$\neq$$ ''nsoilmx''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Inputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nid            ! Name of the NetCDF file&lt;br /&gt;
integer :: ngrid          ! Number of surface grid points.&lt;br /&gt;
integer :: nsoil          ! Number of soil vertical grid points.&lt;br /&gt;
integer :: indextime      ! position of the first time point in the netCDF file.&lt;br /&gt;
real    :: tsurf(ngrid)   ! Surface temperatures (used for the interpolation)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Outputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: tsoil(ngrid,nsoil) ! Soil Temperature&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the soil thermal inertia are modified within the function but not are not output.&lt;br /&gt;
&lt;br /&gt;
==== soil ====&lt;br /&gt;
This subroutine computes the soil temperatures from surface temperatures and heat fluxes from the ground. The code works as follow:&lt;br /&gt;
* 1. During the first call, local variables (soil thickness, soil conductivity at the interface, etc.) are defined.&lt;br /&gt;
* 2. The first grid-point soil temperature is computed from the surface temperature and ground heat flux. &lt;br /&gt;
* 3. Other soil temperatures are then computed based on a recurrence relation&lt;br /&gt;
* 4. Ground heat flux for next time step is computed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Inputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: ngrid                ! Number of surface grid points.&lt;br /&gt;
integer :: nsoil                ! Number of soil vertical grid points.&lt;br /&gt;
logical :: firstcall            ! Boolean checking if it is the first call to this subroutine.&lt;br /&gt;
logical :: lastcall             ! Boolean checking if it is the last call to this subroutine (not used actually).&lt;br /&gt;
real    :: tsurf(ngrid)         ! Surface temperatures (used for the interpolation)&lt;br /&gt;
real    :: therm_i(ngrid,nsoil) ! Soil thermal inertia &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Outputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: tsoil(ngrid,nsoil) ! Soil Temperature&lt;br /&gt;
real :: fluxgrd(ngrid)     ! Soil heat flux&lt;br /&gt;
real :: capcal(ngrid)      ! surface specific heat capacity &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
Lange, L. (2024). Studying and modeling the dynamics of water and CO$$_2$$ ice on Mars. PhD dissertation. [https://theses.hal.science/tel-04824230 Link to the manuscript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2613</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2613"/>
				<updated>2025-03-05T11:09:14Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* soil */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h.F90'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The subroutine ''soil_settings.F90'' which reads/initializes the soil depths and properties.&lt;br /&gt;
* The routine ''soil.F'' which computes soil temperatures and the flux from the ground to the surface.&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to ''nsoilmx''. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete description of the heat equation discretization can be found in Lange (2024) - pages 59 to 61 -.&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes separately. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time $$t+\delta t$$, the value of surface temperature $$T_s (t+\delta t)$$  is already known. In short, the algorithm works as follows: the surface temperature at $$t+\delta t$$ is computed with a radiative balance, knowing $$ F_C (t+\delta t)$$ . Then soil temperatures are updated. $$F_C (t+2\delta t)$$ is finally computed and used as an input to compute $$T_s (t+2\delta t)$$.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Description of the soil subroutines ==&lt;br /&gt;
==== comsoil_h ====&lt;br /&gt;
This module defines the parameters for the vertical grid discretization, and the default values:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nsoilmx = 18   ! The number of points in the subsurface.&lt;br /&gt;
real :: lay1_soil = 2.e-4 ! The depth (m) of first full soil layer &lt;br /&gt;
real :: alpha_soil = 2    ! The geometric factor for the soi layer thickness &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The vertical discretization is defined in two arrays:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: layer(nsoilmx)      ! Full soil layer depths&lt;br /&gt;
real :: mlayer(0:nsoilmx-1) ! Mid soil layer depths&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The soil thermal properties are defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: volcapa                   ! soil volumetric heat capacity, C&lt;br /&gt;
real :: inertiedat(ngrid,nsoilmx) ! Soil thermal inertia&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== soil_settings ====&lt;br /&gt;
&lt;br /&gt;
This subroutine reads from a NetCDF file (opened by the caller) of &amp;quot;startfi.nc&amp;quot; format the soil properties (number of grid points, soil temperature, thermal inertia), and eventually process to interpolation if needed.&lt;br /&gt;
&lt;br /&gt;
* 1. The number of soil layers is read in the NetCDF file. If the number of soil layer (''dimlen'') read is not equal to ''nsoilmx'', then the soil temperature and thermal inertia will be interpolated to the grid from the PCM defined in comsoil_h.&lt;br /&gt;
* 2. The vertical grid is read in the NetCDF file, or created if it does not exist, or if ''dimlen'' $$\neq$$ ''nsoilmx''.&lt;br /&gt;
* 3. The volumetric specific heat ''volcapa'' is read in the controle array (''controle(35)'') of the NetCDF file. If it does not exist, then ''volcapa'' is set to $$10^6$$.&lt;br /&gt;
* 4. The Thermal inertia is read in the NetCDF file. If it does not exist, the subroutines crashes.&lt;br /&gt;
* 5. The Soil Temperature is read in the NetCDF file. If it does not exist, the subroutines crashes.&lt;br /&gt;
* 6. Interpolation of soil temperature and thermal inertia is done if ''dimlen'' $$\neq$$ ''nsoilmx''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Inputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nid            ! Name of the NetCDF file&lt;br /&gt;
integer :: ngrid          ! Number of surface grid points.&lt;br /&gt;
integer :: nsoil          ! Number of soil vertical grid points.&lt;br /&gt;
integer :: indextime      ! position of the first time point in the netCDF file.&lt;br /&gt;
real    :: tsurf(ngrid)   ! Surface temperatures (used for the interpolation)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Outputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: tsoil(ngrid,nsoil) ! Soil Temperature&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the soil thermal inertia are modified within the function but not are not output.&lt;br /&gt;
&lt;br /&gt;
==== soil ====&lt;br /&gt;
This subroutine computes the soil temperatures from surface temperatures and heat fluxes from the ground. The code works as follow:&lt;br /&gt;
* 1. During the first call, local variables (soil thickness, soil conductivity at the interface, etc.) are defined.&lt;br /&gt;
* 2. The first grid-point soil temperature is computed from the surface temperature and ground heat flux. &lt;br /&gt;
* 3. Other soil temperatures are then computed based on a recurrence relation&lt;br /&gt;
* 4. Ground heat flux for next time step is computed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Inputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: ngrid                ! Number of surface grid points.&lt;br /&gt;
integer :: nsoil                ! Number of soil vertical grid points.&lt;br /&gt;
logical :: firstcall            ! Boolean checking if it is the first call to this subroutine.&lt;br /&gt;
logical :: lastcall             ! Boolean checking if it is the last call to this subroutine (not used actually).&lt;br /&gt;
real    :: tsurf(ngrid)         ! Surface temperatures (used for the interpolation)&lt;br /&gt;
real    :: therm_i(ngrid,nsoil) ! Soil thermal inertia &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Outputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: tsoil(ngrid,nsoil) ! Soil Temperature&lt;br /&gt;
real :: fluxgrd(ngrid)     ! Soil heat flux&lt;br /&gt;
real :: capcal(ngrid)      ! surface specific heat capacity &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
Lange, L. (2024). Studying and modeling the dynamics of water and CO$$_2$$ ice on Mars. PhD dissertation. [https://theses.hal.science/tel-04824230 Link to the manuscript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2606</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2606"/>
				<updated>2025-03-05T11:03:44Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* soil */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h.F90'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The subroutine ''soil_settings.F90'' which reads/initializes the soil depths and properties.&lt;br /&gt;
* The routine ''soil.F'' which computes soil temperatures and the flux from the ground to the surface.&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to ''nsoilmx''. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete description of the heat equation discretization can be found in Lange (2024) - pages 59 to 61 -.&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes separately. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time $$t+\delta t$$, the value of surface temperature $$T_s (t+\delta t)$$  is already known. In short, the algorithm works as follows: the surface temperature at $$t+\delta t$$ is computed with a radiative balance, knowing $$ F_C (t+\delta t)$$ . Then soil temperatures are updated. $$F_C (t+2\delta t)$$ is finally computed and used as an input to compute $$T_s (t+2\delta t)$$.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Description of the soil subroutines ==&lt;br /&gt;
==== comsoil_h ====&lt;br /&gt;
This module defines the parameters for the vertical grid discretization, and the default values:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nsoilmx = 18   ! The number of points in the subsurface.&lt;br /&gt;
real :: lay1_soil = 2.e-4 ! The depth (m) of first full soil layer &lt;br /&gt;
real :: alpha_soil = 2    ! The geometric factor for the soi layer thickness &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The vertical discretization is defined in two arrays:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: layer(nsoilmx)      ! Full soil layer depths&lt;br /&gt;
real :: mlayer(0:nsoilmx-1) ! Mid soil layer depths&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The soil thermal properties are defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: volcapa                   ! soil volumetric heat capacity, C&lt;br /&gt;
real :: inertiedat(ngrid,nsoilmx) ! Soil thermal inertia&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== soil_settings ====&lt;br /&gt;
&lt;br /&gt;
This subroutine reads from a NetCDF file (opened by the caller) of &amp;quot;startfi.nc&amp;quot; format the soil properties (number of grid points, soil temperature, thermal inertia), and eventually process to interpolation if needed.&lt;br /&gt;
&lt;br /&gt;
* 1. The number of soil layers is read in the NetCDF file. If the number of soil layer (''dimlen'') read is not equal to ''nsoilmx'', then the soil temperature and thermal inertia will be interpolated to the grid from the PCM defined in comsoil_h.&lt;br /&gt;
* 2. The vertical grid is read in the NetCDF file, or created if it does not exist, or if ''dimlen'' $$\neq$$ ''nsoilmx''.&lt;br /&gt;
* 3. The volumetric specific heat ''volcapa'' is read in the controle array (''controle(35)'') of the NetCDF file. If it does not exist, then ''volcapa'' is set to $$10^6$$.&lt;br /&gt;
* 4. The Thermal inertia is read in the NetCDF file. If it does not exist, the subroutines crashes.&lt;br /&gt;
* 5. The Soil Temperature is read in the NetCDF file. If it does not exist, the subroutines crashes.&lt;br /&gt;
* 6. Interpolation of soil temperature and thermal inertia is done if ''dimlen'' $$\neq$$ ''nsoilmx''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Inputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nid            ! Name of the NetCDF file&lt;br /&gt;
integer :: ngrid          ! Number of surface grid points.&lt;br /&gt;
integer :: nsoil          ! Number of soil vertical grid points.&lt;br /&gt;
integer :: indextime      ! position of the first time point in the netCDF file.&lt;br /&gt;
real    :: tsurf(ngrid)   ! Surface temperatures (used for the interpolation)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Outputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: tsoil(ngrid,nsoil) ! Soil Temperature&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the soil thermal inertia are modified within the function but not are not output.&lt;br /&gt;
&lt;br /&gt;
==== soil ====&lt;br /&gt;
This subroutine computes the soil temperatures from surface temperatures and heat fluxes from the ground. The code works as follow:&lt;br /&gt;
* 1. During the first call, local variables (soil thickness, soil conductivity at the interface, etc.) are defined.&lt;br /&gt;
* 2. The first grid-point soil temperature is computed from the surface temperature and ground heat flux. &lt;br /&gt;
* 3. Other soil temperatures are then computed based on a recurrence relation&lt;br /&gt;
* 4. Ground heat flux for next time step is computed.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
Lange, L. (2024). Studying and modeling the dynamics of water and CO$$_2$$ ice on Mars. PhD dissertation. [https://theses.hal.science/tel-04824230 Link to the manuscript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2592</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2592"/>
				<updated>2025-03-05T10:50:11Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* Description of the soil subroutines */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h.F90'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The subroutine ''soil_settings.F90'' which reads/initializes the soil depths and properties.&lt;br /&gt;
* The routine ''soil.F'' which computes soil temperatures and the flux from the ground to the surface.&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to ''nsoilmx''. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete description of the heat equation discretization can be found in Lange (2024) - pages 59 to 61 -.&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes separately. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time $$t+\delta t$$, the value of surface temperature $$T_s (t+\delta t)$$  is already known. In short, the algorithm works as follows: the surface temperature at $$t+\delta t$$ is computed with a radiative balance, knowing $$ F_C (t+\delta t)$$ . Then soil temperatures are updated. $$F_C (t+2\delta t)$$ is finally computed and used as an input to compute $$T_s (t+2\delta t)$$.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Description of the soil subroutines ==&lt;br /&gt;
==== comsoil_h ====&lt;br /&gt;
This module defines the parameters for the vertical grid discretization, and the default values:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nsoilmx = 18   ! The number of points in the subsurface.&lt;br /&gt;
real :: lay1_soil = 2.e-4 ! The depth (m) of first full soil layer &lt;br /&gt;
real :: alpha_soil = 2    ! The geometric factor for the soi layer thickness &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The vertical discretization is defined in two arrays:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: layer(nsoilmx)      ! Full soil layer depths&lt;br /&gt;
real :: mlayer(0:nsoilmx-1) ! Mid soil layer depths&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The soil thermal properties are defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: volcapa                   ! soil volumetric heat capacity, C&lt;br /&gt;
real :: inertiedat(ngrid,nsoilmx) ! Soil thermal inertia&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== soil_settings ====&lt;br /&gt;
&lt;br /&gt;
This subroutine reads from a NetCDF file (opened by the caller) of &amp;quot;startfi.nc&amp;quot; format the soil properties (number of grid points, soil temperature, thermal inertia), and eventually process to interpolation if needed.&lt;br /&gt;
&lt;br /&gt;
* 1. The number of soil layers is read in the NetCDF file. If the number of soil layer (''dimlen'') read is not equal to ''nsoilmx'', then the soil temperature and thermal inertia will be interpolated to the grid from the PCM defined in comsoil_h.&lt;br /&gt;
* 2. The vertical grid is read in the NetCDF file, or created if it does not exist, or if ''dimlen'' $$\neq$$ ''nsoilmx''.&lt;br /&gt;
* 3. The volumetric specific heat ''volcapa'' is read in the controle array (''controle(35)'') of the NetCDF file. If it does not exist, then ''volcapa'' is set to $$10^6$$.&lt;br /&gt;
* 4. The Thermal inertia is read in the NetCDF file. If it does not exist, the subroutines crashes.&lt;br /&gt;
* 5. The Soil Temperature is read in the NetCDF file. If it does not exist, the subroutines crashes.&lt;br /&gt;
* 6. Interpolation of soil temperature and thermal inertia is done if ''dimlen'' $$\neq$$ ''nsoilmx''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Inputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nid            ! Name of the NetCDF file&lt;br /&gt;
integer :: ngrid          ! Number of surface grid points.&lt;br /&gt;
integer :: nsoil          ! Number of soil vertical grid points.&lt;br /&gt;
integer :: indextime      ! position of the first time point in the netCDF file.&lt;br /&gt;
real    :: tsurf(ngrid)   ! Surface temperatures (used for the interpolation)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Outputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: tsoil(ngrid,nsoil) ! Soil Temperature&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the soil thermal inertia are modified within the function but not are not output.&lt;br /&gt;
&lt;br /&gt;
==== soil ====&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
Lange, L. (2024). Studying and modeling the dynamics of water and CO$$_2$$ ice on Mars. PhD dissertation. [https://theses.hal.science/tel-04824230 Link to the manuscript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2590</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2590"/>
				<updated>2025-03-05T10:48:48Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* soil_settings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h.F90'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The subroutine ''soil_settings.F90'' which reads/initializes the soil depths and properties.&lt;br /&gt;
* The routine ''soil.F'' which computes soil temperatures and the flux from the ground to the surface.&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to ''nsoilmx''. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete description of the heat equation discretization can be found in Lange (2024) - pages 59 to 61 -.&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes separately. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time $$t+\delta t$$, the value of surface temperature $$T_s (t+\delta t)$$  is already known. In short, the algorithm works as follows: the surface temperature at $$t+\delta t$$ is computed with a radiative balance, knowing $$ F_C (t+\delta t)$$ . Then soil temperatures are updated. $$F_C (t+2\delta t)$$ is finally computed and used as an input to compute $$T_s (t+2\delta t)$$.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Description of the soil subroutines ==&lt;br /&gt;
==== comsoil_h ====&lt;br /&gt;
This module defines the parameters for the vertical grid discretization, and the default values:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nsoilmx = 18   ! The number of points in the subsurface.&lt;br /&gt;
real :: lay1_soil = 2.e-4 ! The depth (m) of first full soil layer &lt;br /&gt;
real :: alpha_soil = 2    ! The geometric factor for the soi layer thickness &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The vertical discretization is defined in two arrays:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: layer(nsoilmx)      ! Full soil layer depths&lt;br /&gt;
real :: mlayer(0:nsoilmx-1) ! Mid soil layer depths&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The soil thermal properties are defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: volcapa                   ! soil volumetric heat capacity, C&lt;br /&gt;
real :: inertiedat(ngrid,nsoilmx) ! Soil thermal inertia&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== soil_settings ====&lt;br /&gt;
&lt;br /&gt;
This subroutine reads from a NetCDF file (opened by the caller) of &amp;quot;startfi.nc&amp;quot; format the soil properties (number of grid points, soil temperature, thermal inertia), and eventually process to interpolation if needed.&lt;br /&gt;
&lt;br /&gt;
* 1. The number of soil layers is read in the NetCDF file. If the number of soil layer (''dimlen'') read is not equal to ''nsoilmx'', then the soil temperature and thermal inertia will be interpolated to the grid from the PCM defined in comsoil_h.&lt;br /&gt;
* 2. The vertical grid is read in the NetCDF file, or created if it does not exist, or if ''dimlen'' $$\neq$$ ''nsoilmx''.&lt;br /&gt;
* 3. The volumetric specific heat ''volcapa'' is read in the controle array (''controle(35)'') of the NetCDF file. If it does not exist, then ''volcapa'' is set to $$10^6$$.&lt;br /&gt;
* 4. The Thermal inertia is read in the NetCDF file. If it does not exist, the subroutines crashes.&lt;br /&gt;
* 5. The Soil Temperature is read in the NetCDF file. If it does not exist, the subroutines crashes.&lt;br /&gt;
* 6. Interpolation of soil temperature and thermal inertia is done if ''dimlen'' $$\neq$$ ''nsoilmx''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Inputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nid            ! Name of the NetCDF file&lt;br /&gt;
integer :: ngrid          ! Number of surface grid points.&lt;br /&gt;
integer :: nsoil          ! Number of soil vertical grid points.&lt;br /&gt;
integer :: indextime      ! position of the first time point in the netCDF file.&lt;br /&gt;
real    :: tsurf(ngrid)   ! Surface temperatures (used for the interpolation)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Outputs of the subroutine:'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: tsoil(ngrid,nsoil) ! Soil Temperature&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the soil thermal inertia are modified within the function but not are not output.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
Lange, L. (2024). Studying and modeling the dynamics of water and CO$$_2$$ ice on Mars. PhD dissertation. [https://theses.hal.science/tel-04824230 Link to the manuscript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2589</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2589"/>
				<updated>2025-03-05T10:48:27Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* soil_settings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h.F90'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The subroutine ''soil_settings.F90'' which reads/initializes the soil depths and properties.&lt;br /&gt;
* The routine ''soil.F'' which computes soil temperatures and the flux from the ground to the surface.&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to ''nsoilmx''. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete description of the heat equation discretization can be found in Lange (2024) - pages 59 to 61 -.&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes separately. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time $$t+\delta t$$, the value of surface temperature $$T_s (t+\delta t)$$  is already known. In short, the algorithm works as follows: the surface temperature at $$t+\delta t$$ is computed with a radiative balance, knowing $$ F_C (t+\delta t)$$ . Then soil temperatures are updated. $$F_C (t+2\delta t)$$ is finally computed and used as an input to compute $$T_s (t+2\delta t)$$.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Description of the soil subroutines ==&lt;br /&gt;
==== comsoil_h ====&lt;br /&gt;
This module defines the parameters for the vertical grid discretization, and the default values:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nsoilmx = 18   ! The number of points in the subsurface.&lt;br /&gt;
real :: lay1_soil = 2.e-4 ! The depth (m) of first full soil layer &lt;br /&gt;
real :: alpha_soil = 2    ! The geometric factor for the soi layer thickness &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The vertical discretization is defined in two arrays:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: layer(nsoilmx)      ! Full soil layer depths&lt;br /&gt;
real :: mlayer(0:nsoilmx-1) ! Mid soil layer depths&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The soil thermal properties are defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: volcapa                   ! soil volumetric heat capacity, C&lt;br /&gt;
real :: inertiedat(ngrid,nsoilmx) ! Soil thermal inertia&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== soil_settings ====&lt;br /&gt;
&lt;br /&gt;
This subroutine reads from a NetCDF file (opened by the caller) of &amp;quot;startfi.nc&amp;quot; format the soil properties (number of grid points, soil temperature, thermal inertia), and eventually process to interpolation if needed.&lt;br /&gt;
&lt;br /&gt;
* 1. The number of soil layers is read in the NetCDF file. If the number of soil layer (''dimlen'') read is not equal to ''nsoilmx'', then the soil temperature and thermal inertia will be interpolated to the grid from the PCM defined in comsoil_h.&lt;br /&gt;
* 2. The vertical grid is read in the NetCDF file, or created if it does not exist, or if ''dimlen'' $$\neq$$ ''nsoilmx''.&lt;br /&gt;
* 3. The volumetric specific heat ''volcapa'' is read in the controle array (''controle(35)'') of the NetCDF file. If it does not exist, then ''volcapa'' is set to $$10^6$$.&lt;br /&gt;
* 4. The Thermal inertia is read in the NetCDF file. If it does not exist, the subroutines crashes.&lt;br /&gt;
* 5. The Soil Temperature is read in the NetCDF file. If it does not exist, the subroutines crashes.&lt;br /&gt;
* 6. Interpolation of soil temperature and thermal inertia is done if ''dimlen'' $$\neq$$ ''nsoilmx''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Inputs of the subroutine:'''&lt;br /&gt;
v&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nid            ! Name of the NetCDF file&lt;br /&gt;
integer :: ngrid          ! Number of surface grid points.&lt;br /&gt;
integer :: nsoil          ! Number of soil vertical grid points.&lt;br /&gt;
integer :: indextime      ! position of the first time point in the netCDF file.&lt;br /&gt;
real    :: tsurf(ngrid)   ! Surface temperatures (used for the interpolation)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Inputs of the subroutine:'''&lt;br /&gt;
v&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: tsoil(ngrid,nsoil) ! Soil Temperature&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the soil thermal inertia are modified within the function but not are not output.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
Lange, L. (2024). Studying and modeling the dynamics of water and CO$$_2$$ ice on Mars. PhD dissertation. [https://theses.hal.science/tel-04824230 Link to the manuscript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2581</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2581"/>
				<updated>2025-03-05T10:38:04Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* soil_settings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h.F90'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The subroutine ''soil_settings.F90'' which reads/initializes the soil depths and properties.&lt;br /&gt;
* The routine ''soil.F'' which computes soil temperatures and the flux from the ground to the surface.&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to ''nsoilmx''. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete description of the heat equation discretization can be found in Lange (2024) - pages 59 to 61 -.&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes separately. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time $$t+\delta t$$, the value of surface temperature $$T_s (t+\delta t)$$  is already known. In short, the algorithm works as follows: the surface temperature at $$t+\delta t$$ is computed with a radiative balance, knowing $$ F_C (t+\delta t)$$ . Then soil temperatures are updated. $$F_C (t+2\delta t)$$ is finally computed and used as an input to compute $$T_s (t+2\delta t)$$.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Description of the soil subroutines ==&lt;br /&gt;
==== comsoil_h ====&lt;br /&gt;
This module defines the parameters for the vertical grid discretization, and the default values:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nsoilmx = 18   ! The number of points in the subsurface.&lt;br /&gt;
real :: lay1_soil = 2.e-4 ! The depth (m) of first full soil layer &lt;br /&gt;
real :: alpha_soil = 2    ! The geometric factor for the soi layer thickness &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The vertical discretization is defined in two arrays:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: layer(nsoilmx)      ! Full soil layer depths&lt;br /&gt;
real :: mlayer(0:nsoilmx-1) ! Mid soil layer depths&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The soil thermal properties are defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: volcapa                   ! soil volumetric heat capacity, C&lt;br /&gt;
real :: inertiedat(ngrid,nsoilmx) ! Soil thermal inertia&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== soil_settings ====&lt;br /&gt;
&lt;br /&gt;
This subroutine reads from a NetCDF file (opened by the caller) of &amp;quot;startfi.nc&amp;quot; format the soil properties (number of grid points, soil temperature, thermal inertia), and eventually process to interpolation if needed.&lt;br /&gt;
&lt;br /&gt;
* 1. The number of soil layers is read in the NetCDF file. If the number of soil layer (''dimlen'') read is not equal to ''nsoilmx'', then the soil temperature and thermal inertia will be interpolated to the grid from the PCM defined in comsoil_h.&lt;br /&gt;
* 2. The vertical grid is read in the NetCDF file, or created if it does not exist, or if ''dimlen'' $$\neq$$ ''nsoilmx''.&lt;br /&gt;
* 3. The volumetric specific heat ''volcapa'' is read in the controle array (''controle(35)'') of the NetCDF file. If it does not exist, then ''volcapa'' is set to $$10^6$$.&lt;br /&gt;
* 4. The Thermal inertia is read in the NetCDF file. If it does not exist, the subroutines crashes.&lt;br /&gt;
* 5. The Soil Temperature is read in the NetCDF file. If it does not exist, the subroutines crashes.&lt;br /&gt;
* 6. Interpolation of soil temperature and thermal inertia is done if ''dimlen'' $$\neq$$ ''nsoilmx''.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
Lange, L. (2024). Studying and modeling the dynamics of water and CO$$_2$$ ice on Mars. PhD dissertation. [https://theses.hal.science/tel-04824230 Link to the manuscript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2576</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2576"/>
				<updated>2025-03-05T10:32:22Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* soil_settings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h.F90'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The subroutine ''soil_settings.F90'' which reads/initializes the soil depths and properties.&lt;br /&gt;
* The routine ''soil.F'' which computes soil temperatures and the flux from the ground to the surface.&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to ''nsoilmx''. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete description of the heat equation discretization can be found in Lange (2024) - pages 59 to 61 -.&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes separately. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time $$t+\delta t$$, the value of surface temperature $$T_s (t+\delta t)$$  is already known. In short, the algorithm works as follows: the surface temperature at $$t+\delta t$$ is computed with a radiative balance, knowing $$ F_C (t+\delta t)$$ . Then soil temperatures are updated. $$F_C (t+2\delta t)$$ is finally computed and used as an input to compute $$T_s (t+2\delta t)$$.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Description of the soil subroutines ==&lt;br /&gt;
==== comsoil_h ====&lt;br /&gt;
This module defines the parameters for the vertical grid discretization, and the default values:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nsoilmx = 18   ! The number of points in the subsurface.&lt;br /&gt;
real :: lay1_soil = 2.e-4 ! The depth (m) of first full soil layer &lt;br /&gt;
real :: alpha_soil = 2    ! The geometric factor for the soi layer thickness &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The vertical discretization is defined in two arrays:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: layer(nsoilmx)      ! Full soil layer depths&lt;br /&gt;
real :: mlayer(0:nsoilmx-1) ! Mid soil layer depths&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The soil thermal properties are defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: volcapa                   ! soil volumetric heat capacity, C&lt;br /&gt;
real :: inertiedat(ngrid,nsoilmx) ! Soil thermal inertia&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== soil_settings ====&lt;br /&gt;
&lt;br /&gt;
This subroutine reads from a NetCDF file (opened by the caller) of &amp;quot;startfi.nc&amp;quot; format the soil properties (number of grid points, soil temperature, thermal inertia), and eventually process to interpolation if needed.&lt;br /&gt;
&lt;br /&gt;
* 1. The number of soil layers is read in the NetCDF file. If the number of soil layer (''dimlen'') read is not equal to ''nsoilmx'', then the soil temperature and thermal inertia will be interpolated to the grid from the PCM defined in comsoil_h.&lt;br /&gt;
* 2. The vertical grid is read in the NetCDF file, or created if it does not exist, or if ''dimlen'' $$\neq$$ ''nsoilmx''.&lt;br /&gt;
* 3. The volumetric specific heat ''volcapa'' is read in the controle array (''controle(35)'') of the NetCDF file. If it does not exist, then ''volcapa'' is set to $$10^6$$.&lt;br /&gt;
!  3. Read Thermal inertia&lt;br /&gt;
!  4. Read soil temperatures&lt;br /&gt;
!  5. Interpolate thermal inertia and temperature on the new grid, if&lt;br /&gt;
!     necessary&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
Lange, L. (2024). Studying and modeling the dynamics of water and CO$$_2$$ ice on Mars. PhD dissertation. [https://theses.hal.science/tel-04824230 Link to the manuscript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2575</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2575"/>
				<updated>2025-03-05T10:31:41Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* soil_settings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h.F90'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The subroutine ''soil_settings.F90'' which reads/initializes the soil depths and properties.&lt;br /&gt;
* The routine ''soil.F'' which computes soil temperatures and the flux from the ground to the surface.&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to ''nsoilmx''. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete description of the heat equation discretization can be found in Lange (2024) - pages 59 to 61 -.&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes separately. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time $$t+\delta t$$, the value of surface temperature $$T_s (t+\delta t)$$  is already known. In short, the algorithm works as follows: the surface temperature at $$t+\delta t$$ is computed with a radiative balance, knowing $$ F_C (t+\delta t)$$ . Then soil temperatures are updated. $$F_C (t+2\delta t)$$ is finally computed and used as an input to compute $$T_s (t+2\delta t)$$.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Description of the soil subroutines ==&lt;br /&gt;
==== comsoil_h ====&lt;br /&gt;
This module defines the parameters for the vertical grid discretization, and the default values:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nsoilmx = 18   ! The number of points in the subsurface.&lt;br /&gt;
real :: lay1_soil = 2.e-4 ! The depth (m) of first full soil layer &lt;br /&gt;
real :: alpha_soil = 2    ! The geometric factor for the soi layer thickness &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The vertical discretization is defined in two arrays:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: layer(nsoilmx)      ! Full soil layer depths&lt;br /&gt;
real :: mlayer(0:nsoilmx-1) ! Mid soil layer depths&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The soil thermal properties are defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: volcapa                   ! soil volumetric heat capacity, C&lt;br /&gt;
real :: inertiedat(ngrid,nsoilmx) ! Soil thermal inertia&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== soil_settings ====&lt;br /&gt;
&lt;br /&gt;
This subroutine reads from a NetCDF file (opened by the caller) of &amp;quot;startfi.nc&amp;quot; format the soil properties (number of grid points, soil temperature, thermal inertia), and eventually process to interpolation if needed.&lt;br /&gt;
&lt;br /&gt;
* 1. The number of soil layers is read in the NetCDF file. If the number of soil layer (''dimlen'') read is not equal to ''nsoilmx'', then the soil temperature and thermal inertia will be interpolated to the grid from the PCM defined in comsoil_h.&lt;br /&gt;
* 2. The vertical grid is read in the NetCDF file, or created if it does not exist, or if ''dimlen'' $$\neq$$ ''nsoilmx''.&lt;br /&gt;
* 3. The volumetric specific heat ''volcapa'' is read in the controle array of the NetCDF file. If it does not exist, then ''volcapa'' is set to $$10^6$$.&lt;br /&gt;
!  3. Read Thermal inertia&lt;br /&gt;
!  4. Read soil temperatures&lt;br /&gt;
!  5. Interpolate thermal inertia and temperature on the new grid, if&lt;br /&gt;
!     necessary&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
Lange, L. (2024). Studying and modeling the dynamics of water and CO$$_2$$ ice on Mars. PhD dissertation. [https://theses.hal.science/tel-04824230 Link to the manuscript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2568</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2568"/>
				<updated>2025-03-05T10:26:11Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* Description of the soil subroutines */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h.F90'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The subroutine ''soil_settings.F90'' which reads/initializes the soil depths and properties.&lt;br /&gt;
* The routine ''soil.F'' which computes soil temperatures and the flux from the ground to the surface.&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to ''nsoilmx''. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete description of the heat equation discretization can be found in Lange (2024) - pages 59 to 61 -.&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes separately. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time $$t+\delta t$$, the value of surface temperature $$T_s (t+\delta t)$$  is already known. In short, the algorithm works as follows: the surface temperature at $$t+\delta t$$ is computed with a radiative balance, knowing $$ F_C (t+\delta t)$$ . Then soil temperatures are updated. $$F_C (t+2\delta t)$$ is finally computed and used as an input to compute $$T_s (t+2\delta t)$$.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Description of the soil subroutines ==&lt;br /&gt;
==== comsoil_h ====&lt;br /&gt;
This module defines the parameters for the vertical grid discretization, and the default values:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nsoilmx = 18   ! The number of points in the subsurface.&lt;br /&gt;
real :: lay1_soil = 2.e-4 ! The depth (m) of first full soil layer &lt;br /&gt;
real :: alpha_soil = 2    ! The geometric factor for the soi layer thickness &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The vertical discretization is defined in two arrays:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: layer(nsoilmx)      ! Full soil layer depths&lt;br /&gt;
real :: mlayer(0:nsoilmx-1) ! Mid soil layer depths&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The soil thermal properties are defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: volcapa                   ! soil volumetric heat capacity, C&lt;br /&gt;
real :: inertiedat(ngrid,nsoilmx) ! Soil thermal inertia&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== soil_settings ====&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
Lange, L. (2024). Studying and modeling the dynamics of water and CO$$_2$$ ice on Mars. PhD dissertation. [https://theses.hal.science/tel-04824230 Link to the manuscript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2567</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2567"/>
				<updated>2025-03-05T10:24:21Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* Description of the soil subroutines */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h.F90'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The subroutine ''soil_settings.F90'' which reads/initializes the soil depths and properties.&lt;br /&gt;
* The routine ''soil.F'' which computes soil temperatures and the flux from the ground to the surface.&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to ''nsoilmx''. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete description of the heat equation discretization can be found in Lange (2024) - pages 59 to 61 -.&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes separately. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time $$t+\delta t$$, the value of surface temperature $$T_s (t+\delta t)$$  is already known. In short, the algorithm works as follows: the surface temperature at $$t+\delta t$$ is computed with a radiative balance, knowing $$ F_C (t+\delta t)$$ . Then soil temperatures are updated. $$F_C (t+2\delta t)$$ is finally computed and used as an input to compute $$T_s (t+2\delta t)$$.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Description of the soil subroutines ==&lt;br /&gt;
==== comsoil_h ====&lt;br /&gt;
This module defines the parameters for the vertical grid discretization, and the default values:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nsoilmx = 18   ! The number of points in the subsurface.&lt;br /&gt;
real :: lay1_soil = 2.e-4 ! The depth (m) of first full soil layer &lt;br /&gt;
real :: alpha_soil = 2    ! The geometric factor for the soi layer thickness &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The vertical discretization is defined in two arrays:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: layer(nsoilmx)      ! Full soil layer depths&lt;br /&gt;
real :: mlayer(0:nsoilmx-1) ! Mid soil layer depths&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The soil thermal properties are defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: volcapa                   ! soil volumetric heat capacity, C&lt;br /&gt;
real :: inertiedat(ngrid,nsoilmx) ! Soil thermal inertia&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
Lange, L. (2024). Studying and modeling the dynamics of water and CO$$_2$$ ice on Mars. PhD dissertation. [https://theses.hal.science/tel-04824230 Link to the manuscript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2566</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2566"/>
				<updated>2025-03-05T10:24:04Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* comsoil_h */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h.F90'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The subroutine ''soil_settings.F90'' which reads/initializes the soil depths and properties.&lt;br /&gt;
* The routine ''soil.F'' which computes soil temperatures and the flux from the ground to the surface.&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to ''nsoilmx''. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete description of the heat equation discretization can be found in Lange (2024) - pages 59 to 61 -.&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes separately. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time $$t+\delta t$$, the value of surface temperature $$T_s (t+\delta t)$$  is already known. In short, the algorithm works as follows: the surface temperature at $$t+\delta t$$ is computed with a radiative balance, knowing $$ F_C (t+\delta t)$$ . Then soil temperatures are updated. $$F_C (t+2\delta t)$$ is finally computed and used as an input to compute $$T_s (t+2\delta t)$$.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Description of the soil subroutines ==&lt;br /&gt;
==== comsoil_h ====&lt;br /&gt;
This module defines the parameters for the vertical grid discretization, and the default values:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nsoilmx = 18   ! The number of points in the subsurface.&lt;br /&gt;
real :: lay1_soil = 2.e-4 ! The depth (m) of first full soil layer &lt;br /&gt;
real :: alpha_soil = 2    ! The geometric factor for the soi layer thickness &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The vertical discretization is defined in two arrays:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: layer(nsoilmx)      ! Full soil layer depths&lt;br /&gt;
real :: mlayer(0:nsoilmx-1) ! Mid soil layer depths&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The soil thermal properties are defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: volcapa                   ! soil volumetric heat capacity, $$defined by \rho c$$&lt;br /&gt;
real :: inertiedat(ngrid,nsoilmx) ! Soil thermal inertia&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
Lange, L. (2024). Studying and modeling the dynamics of water and CO$$_2$$ ice on Mars. PhD dissertation. [https://theses.hal.science/tel-04824230 Link to the manuscript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2564</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2564"/>
				<updated>2025-03-05T10:23:40Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* Description of the soil subroutines */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h.F90'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The subroutine ''soil_settings.F90'' which reads/initializes the soil depths and properties.&lt;br /&gt;
* The routine ''soil.F'' which computes soil temperatures and the flux from the ground to the surface.&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to ''nsoilmx''. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete description of the heat equation discretization can be found in Lange (2024) - pages 59 to 61 -.&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes separately. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time $$t+\delta t$$, the value of surface temperature $$T_s (t+\delta t)$$  is already known. In short, the algorithm works as follows: the surface temperature at $$t+\delta t$$ is computed with a radiative balance, knowing $$ F_C (t+\delta t)$$ . Then soil temperatures are updated. $$F_C (t+2\delta t)$$ is finally computed and used as an input to compute $$T_s (t+2\delta t)$$.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Description of the soil subroutines ==&lt;br /&gt;
==== comsoil_h ====&lt;br /&gt;
This module defines the parameters for the vertical grid discretization, and the default values:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nsoilmx = 18   ! The number of points in the subsurface.&lt;br /&gt;
real :: lay1_soil = 2.e-4 ! The depth (m) of first full soil layer &lt;br /&gt;
real :: alpha_soil = 2    ! The geometric factor for the soi layer thickness &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The vertical discretization is defined in two arrays:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: layer(nsoilmx)      ! Full soil layer depths&lt;br /&gt;
real :: mlayer(0:nsoilmx-1) ! Mid soil layer depths&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The soil thermal properties are defined by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
real :: volcapa                   ! soil volumetric heat capacity&lt;br /&gt;
real :: inertiedat(ngrid,nsoilmx) ! Soil thermal inertia&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
Lange, L. (2024). Studying and modeling the dynamics of water and CO$$_2$$ ice on Mars. PhD dissertation. [https://theses.hal.science/tel-04824230 Link to the manuscript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2559</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2559"/>
				<updated>2025-03-05T10:20:08Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* comsoil_h */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h.F90'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The subroutine ''soil_settings.F90'' which reads/initializes the soil depths and properties.&lt;br /&gt;
* The routine ''soil.F'' which computes soil temperatures and the flux from the ground to the surface.&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to ''nsoilmx''. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete description of the heat equation discretization can be found in Lange (2024) - pages 59 to 61 -.&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes separately. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time $$t+\delta t$$, the value of surface temperature $$T_s (t+\delta t)$$  is already known. In short, the algorithm works as follows: the surface temperature at $$t+\delta t$$ is computed with a radiative balance, knowing $$ F_C (t+\delta t)$$ . Then soil temperatures are updated. $$F_C (t+2\delta t)$$ is finally computed and used as an input to compute $$T_s (t+2\delta t)$$.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Description of the soil subroutines ==&lt;br /&gt;
==== comsoil_h ====&lt;br /&gt;
This module defines the parameters for the vertical grid discretization, and the default values:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
integer :: nsoilmx = 18 ! The number of points in the subsurface.&lt;br /&gt;
real :: lay1_soil = 2.e-4 ! The depth (m) of first full soil layer &lt;br /&gt;
real :: alpha_soil = 2 ! The geometric factor for the soi layer thickness &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
Lange, L. (2024). Studying and modeling the dynamics of water and CO$$_2$$ ice on Mars. PhD dissertation. [https://theses.hal.science/tel-04824230 Link to the manuscript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2558</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2558"/>
				<updated>2025-03-05T10:19:29Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* Description of the soil subroutines */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h.F90'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The subroutine ''soil_settings.F90'' which reads/initializes the soil depths and properties.&lt;br /&gt;
* The routine ''soil.F'' which computes soil temperatures and the flux from the ground to the surface.&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to ''nsoilmx''. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete description of the heat equation discretization can be found in Lange (2024) - pages 59 to 61 -.&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes separately. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time $$t+\delta t$$, the value of surface temperature $$T_s (t+\delta t)$$  is already known. In short, the algorithm works as follows: the surface temperature at $$t+\delta t$$ is computed with a radiative balance, knowing $$ F_C (t+\delta t)$$ . Then soil temperatures are updated. $$F_C (t+2\delta t)$$ is finally computed and used as an input to compute $$T_s (t+2\delta t)$$.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Description of the soil subroutines ==&lt;br /&gt;
==== comsoil_h ====&lt;br /&gt;
This module defines the parameters for the vertical grid discretization, and the default values:&lt;br /&gt;
&lt;br /&gt;
integer :: nsoilmx = 18 ! The number of points in the subsurface.&lt;br /&gt;
real :: lay1_soil = 2.e-4 ! The depth (m) of first full soil layer &lt;br /&gt;
real :: alpha_soil = 2 ! The geometric factor for the soi layer thickness &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 (''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$). &lt;br /&gt;
! Mid soil layer depths are set as: mlayer(k)=lay1_soil*alpha_soil**(k-1/2) , k=0,nsoil-1&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
Lange, L. (2024). Studying and modeling the dynamics of water and CO$$_2$$ ice on Mars. PhD dissertation. [https://theses.hal.science/tel-04824230 Link to the manuscript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2556</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2556"/>
				<updated>2025-03-05T10:16:38Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* comsoil_h */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h.F90'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The subroutine ''soil_settings.F90'' which reads/initializes the soil depths and properties.&lt;br /&gt;
* The routine ''soil.F'' which computes soil temperatures and the flux from the ground to the surface.&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to ''nsoilmx''. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete description of the heat equation discretization can be found in Lange (2024) - pages 59 to 61 -.&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes separately. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time $$t+\delta t$$, the value of surface temperature $$T_s (t+\delta t)$$  is already known. In short, the algorithm works as follows: the surface temperature at $$t+\delta t$$ is computed with a radiative balance, knowing $$ F_C (t+\delta t)$$ . Then soil temperatures are updated. $$F_C (t+2\delta t)$$ is finally computed and used as an input to compute $$T_s (t+2\delta t)$$.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Description of the soil subroutines ==&lt;br /&gt;
==== comsoil_h ====&lt;br /&gt;
This module defines the parameters for the soil discretization&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
Lange, L. (2024). Studying and modeling the dynamics of water and CO$$_2$$ ice on Mars. PhD dissertation. [https://theses.hal.science/tel-04824230 Link to the manuscript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2555</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2555"/>
				<updated>2025-03-05T10:15:51Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* Purpose */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h.F90'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The subroutine ''soil_settings.F90'' which reads/initializes the soil depths and properties.&lt;br /&gt;
* The routine ''soil.F'' which computes soil temperatures and the flux from the ground to the surface.&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to ''nsoilmx''. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete description of the heat equation discretization can be found in Lange (2024) - pages 59 to 61 -.&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes separately. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time $$t+\delta t$$, the value of surface temperature $$T_s (t+\delta t)$$  is already known. In short, the algorithm works as follows: the surface temperature at $$t+\delta t$$ is computed with a radiative balance, knowing $$ F_C (t+\delta t)$$ . Then soil temperatures are updated. $$F_C (t+2\delta t)$$ is finally computed and used as an input to compute $$T_s (t+2\delta t)$$.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Description of the soil subroutines ==&lt;br /&gt;
==== comsoil_h ====&lt;br /&gt;
This subroutine&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
Lange, L. (2024). Studying and modeling the dynamics of water and CO$$_2$$ ice on Mars. PhD dissertation. [https://theses.hal.science/tel-04824230 Link to the manuscript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2553</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2553"/>
				<updated>2025-03-05T10:15:34Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* comsoil_h */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The subroutine ''soil_settings.F90'' which reads/initializes the soil depths and properties.&lt;br /&gt;
* The routine ''soil.F'' which computes soil temperatures and the flux from the ground to the surface.&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to ''nsoilmx''. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete description of the heat equation discretization can be found in Lange (2024) - pages 59 to 61 -.&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes separately. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time $$t+\delta t$$, the value of surface temperature $$T_s (t+\delta t)$$  is already known. In short, the algorithm works as follows: the surface temperature at $$t+\delta t$$ is computed with a radiative balance, knowing $$ F_C (t+\delta t)$$ . Then soil temperatures are updated. $$F_C (t+2\delta t)$$ is finally computed and used as an input to compute $$T_s (t+2\delta t)$$.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Description of the soil subroutines ==&lt;br /&gt;
==== comsoil_h ====&lt;br /&gt;
This subroutine&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
Lange, L. (2024). Studying and modeling the dynamics of water and CO$$_2$$ ice on Mars. PhD dissertation. [https://theses.hal.science/tel-04824230 Link to the manuscript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2551</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2551"/>
				<updated>2025-03-05T10:15:05Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The subroutine ''soil_settings.F90'' which reads/initializes the soil depths and properties.&lt;br /&gt;
* The routine ''soil.F'' which computes soil temperatures and the flux from the ground to the surface.&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to ''nsoilmx''. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete description of the heat equation discretization can be found in Lange (2024) - pages 59 to 61 -.&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes separately. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time $$t+\delta t$$, the value of surface temperature $$T_s (t+\delta t)$$  is already known. In short, the algorithm works as follows: the surface temperature at $$t+\delta t$$ is computed with a radiative balance, knowing $$ F_C (t+\delta t)$$ . Then soil temperatures are updated. $$F_C (t+2\delta t)$$ is finally computed and used as an input to compute $$T_s (t+2\delta t)$$.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Description of the soil subroutines ==&lt;br /&gt;
==== comsoil_h ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
Lange, L. (2024). Studying and modeling the dynamics of water and CO$$_2$$ ice on Mars. PhD dissertation. [https://theses.hal.science/tel-04824230 Link to the manuscript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2548</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2548"/>
				<updated>2025-03-05T10:14:28Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* Description of the soil subroutines */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The subroutine ''soil_settings.F90'' which reads/initializes the soil depths and properties.&lt;br /&gt;
* The routine ''soil.F'' which computes soil temperatures and the flux from the ground to the surface.&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to ''nsoilmx''. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete description of the heat equation discretization can be found in Lange (2024) - pages 59 to 61 -.&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes separately. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time $$t+\delta t$$, the value of surface temperature $$T_s (t+\delta t)$$  is already known. In short, the algorithm works as follows: the surface temperature at $$t+\delta t$$ is computed with a radiative balance, knowing $$ F_C (t+\delta t)$$ . Then soil temperatures are updated. $$F_C (t+2\delta t)$$ is finally computed and used as an input to compute $$T_s (t+2\delta t)$$.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Description of the soil subroutines ==&lt;br /&gt;
&lt;br /&gt;
== comsoil_h==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
Lange, L. (2024). Studying and modeling the dynamics of water and CO$$_2$$ ice on Mars. PhD dissertation. [https://theses.hal.science/tel-04824230 Link to the manuscript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2547</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2547"/>
				<updated>2025-03-05T10:14:11Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The subroutine ''soil_settings.F90'' which reads/initializes the soil depths and properties.&lt;br /&gt;
* The routine ''soil.F'' which computes soil temperatures and the flux from the ground to the surface.&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to ''nsoilmx''. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete description of the heat equation discretization can be found in Lange (2024) - pages 59 to 61 -.&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes separately. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time $$t+\delta t$$, the value of surface temperature $$T_s (t+\delta t)$$  is already known. In short, the algorithm works as follows: the surface temperature at $$t+\delta t$$ is computed with a radiative balance, knowing $$ F_C (t+\delta t)$$ . Then soil temperatures are updated. $$F_C (t+2\delta t)$$ is finally computed and used as an input to compute $$T_s (t+2\delta t)$$.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Description of the soil subroutines == &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
Lange, L. (2024). Studying and modeling the dynamics of water and CO$$_2$$ ice on Mars. PhD dissertation. [https://theses.hal.science/tel-04824230 Link to the manuscript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2546</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2546"/>
				<updated>2025-03-05T10:13:45Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* Numerical approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The subroutine ''soil_settings.F90'' which reads/initializes the soil depths and properties.&lt;br /&gt;
* The routine ''soil.F'' which computes soil temperatures and the flux from the ground to the surface.&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to ''nsoilmx''. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The complete description of the heat equation discretization can be found in Lange (2024) - pages 59 to 61 -.&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes separately. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time $$t+\delta t$$, the value of surface temperature $$T_s (t+\delta t)$$  is already known. In short, the algorithm works as follows: the surface temperature at $$t+\delta t$$ is computed with a radiative balance, knowing $$ F_C (t+\delta t)$$ . Then soil temperatures are updated. $$F_C (t+2\delta t)$$ is finally computed and used as an input to compute $$T_s (t+2\delta t)$$.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
Lange, L. (2024). Studying and modeling the dynamics of water and CO$$_2$$ ice on Mars. PhD dissertation. [https://theses.hal.science/tel-04824230 Link to the manuscript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2543</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2543"/>
				<updated>2025-03-05T10:12:55Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* Numerical approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The subroutine ''soil_settings.F90'' which reads/initializes the soil depths and properties.&lt;br /&gt;
* The routine ''soil.F'' which computes soil temperatures and the flux from the ground to the surface.&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to ''nsoilmx''. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes separately. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time $$t+\delta t$$, the value of surface temperature $$T_s (t+\delta t)$$  is already known. In short, the algorithm works as follows: the surface temperature at $$t+\delta t$$ is computed with a radiative balance, knowing $$ F_C (t+\delta t)$$ . Then soil temperatures are updated. $$F_C (t+2\delta t)$$ is finally computed and used as an input to compute $$T_s (t+2\delta t)$$.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
Lange, L. (2024). Studying and modeling the dynamics of water and CO$$_2$$ ice on Mars. PhD dissertation. [https://theses.hal.science/tel-04824230 Link to the manuscript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2541</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2541"/>
				<updated>2025-03-05T10:12:32Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* Numerical approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The subroutine ''soil_settings.F90'' which reads/initializes the soil depths and properties.&lt;br /&gt;
* The routine ''soil.F'' which computes soil temperatures and the flux from the ground to the surface.&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to ''nsoilmx''. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes seperatly. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time $$t+\delta t$$, the value of surface temperature $$T_S (t+\delta t)$$  is already known. In short, hte algorithm works as follows: the surface temperature at $$t+\delta t$$ is computed with a radiative balance, knowing $$ F_C (t+\delta t)$$ . Then soil temperatures are updated. $$F_C (t+2\delta t)$$ is finally computed and used as an input to compute $$T_S (t+2\delta t)$$.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
Lange, L. (2024). Studying and modeling the dynamics of water and CO$$_2$$ ice on Mars. PhD dissertation. [https://theses.hal.science/tel-04824230 Link to the manuscript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2535</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2535"/>
				<updated>2025-03-05T10:10:54Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The subroutine ''soil_settings.F90'' which reads/initializes the soil depths and properties.&lt;br /&gt;
* The routine ''soil.F'' which computes soil temperatures and the flux from the ground to the surface.&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to $$nsoilmx$$. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes seperatly. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time t(i+1), the value of surface temperature T (i+1)S is already known. In short, hte algorithm works as follows: the surface temperature at i + 1 is computed with a radiative balance, knowing F (i+1)S . Then soil temperatures and coefficients β are updated. F (i+2) S is finally computed and used as an input to compute T (i+2&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
Lange, L. (2024). Studying and modeling the dynamics of water and CO$$_2$$ ice on Mars. PhD dissertation. [https://theses.hal.science/tel-04824230 Link to the manuscript]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2532</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2532"/>
				<updated>2025-03-05T10:08:59Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* Purpose */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The subroutine ''soil_settings.F90'' which reads/initializes the soil depths and properties.&lt;br /&gt;
* The routine ''soil.F'' which computes soil temperatures and the flux from the ground to the surface.&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to $$nsoilmx$$. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes seperatly. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time t(i+1), the value of surface temperature T (i+1)S is already known. In short, hte algorithm works as follows: the surface temperature at i + 1 is computed with a radiative balance, knowing F (i+1)S . Then soil temperatures and coefficients β are updated. F (i+2) S is finally computed and used as an input to compute T (i+2&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2530</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2530"/>
				<updated>2025-03-05T10:07:49Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* Purpose */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM. Three subroutines are used for that:&lt;br /&gt;
* The 'module' ''comsoil_h'' which contains the parameters to define the subsurface grid.&lt;br /&gt;
* The module&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to $$nsoilmx$$. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes seperatly. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time t(i+1), the value of surface temperature T (i+1)S is already known. In short, hte algorithm works as follows: the surface temperature at i + 1 is computed with a radiative balance, knowing F (i+1)S . Then soil temperatures and coefficients β are updated. F (i+2) S is finally computed and used as an input to compute T (i+2&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2520</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2520"/>
				<updated>2025-03-05T10:02:09Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* Numerical approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM.&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to $$nsoilmx$$. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes seperatly. The essential feature of the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time t(i+1), the value of surface temperature T (i+1)S is already known. In short, hte algorithm works as follows: the surface temperature at i + 1 is computed with a radiative balance, knowing F (i+1)S . Then soil temperatures and coefficients β are updated. F (i+2) S is finally computed and used as an input to compute T (i+2&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2518</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2518"/>
				<updated>2025-03-05T09:59:52Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* Theoretical Considerations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM.&lt;br /&gt;
&lt;br /&gt;
== Theoretical considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to $$nsoilmx$$. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes seperatly. The essential feature of&lt;br /&gt;
the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time t(i+1), the value of surface temperature T (i+1)S is already known. In short, hte algorithm works as follows: the surface temperature at i + 1 is computed with a radiative balance, knowing F (i+1)S . Then soil temperatures and coefficients β are updated. F (i+2) S is finally computed and used as an input to compute T (i+2&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2516</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2516"/>
				<updated>2025-03-05T09:57:03Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* Numerical approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM.&lt;br /&gt;
&lt;br /&gt;
== Theoretical Considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to $$nsoilmx$$. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (Eq. 3) is included as such in the solver, but the upper boundary condition (Eq. 4) is not. Surface temperature is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a way that allows one to solve atmospheric and ground processes seperatly. The essential feature of&lt;br /&gt;
the artificial uncoupling is that, when solving the heat diffusion equation in the soil at time t(i+1), the value of surface temperature T (i+1)S is already known. In short, hte algorithm works as follows: the surface temperature at i + 1 is computed with a radiative balance, knowing F (i+1)S . Then soil temperatures and coefficients β are updated. F (i+2) S is finally computed and used as an input to compute T (i+2&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2512</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2512"/>
				<updated>2025-03-05T09:55:34Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* Numerical approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM.&lt;br /&gt;
&lt;br /&gt;
== Theoretical Considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to $$nsoilmx$$. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
The lower boundary condition (eq. 3) is included as such in the solver,&lt;br /&gt;
but the upper boundary condition (eq. 4) is not. Surface temperature&lt;br /&gt;
is technically linked to atmospheric and ground processes which are&lt;br /&gt;
coupled. Rather than solving the coupled problem, it is uncoupled in a&lt;br /&gt;
way that allows one to solve atmospheric and ground processes seper-&lt;br /&gt;
atly, as will be described in the next sections. The essential feature of&lt;br /&gt;
the artificial uncoupling is that, when solving the heat diffusion equa-&lt;br /&gt;
tion in the soil at time t(i+1), the value of surface temperature T (i+1)&lt;br /&gt;
S&lt;br /&gt;
is already known.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2509</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2509"/>
				<updated>2025-03-05T09:54:49Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM.&lt;br /&gt;
&lt;br /&gt;
== Theoretical Considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to $$nsoilmx$$. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2494</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2494"/>
				<updated>2025-03-05T09:51:09Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM.&lt;br /&gt;
&lt;br /&gt;
== Theoretical Considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to $$nsoilmx$$. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2492</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2492"/>
				<updated>2025-03-05T09:50:37Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* Numerical approach */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM.&lt;br /&gt;
&lt;br /&gt;
== Theoretical Considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The computation of the heat conduction, and the updates of soil temperatures, are done in the routine ''soil.F''.&lt;br /&gt;
&lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach. The vertical domain is divided into ''nsoilmx'' discrete layers; $$z_k$$ denote interlayer depths, and $$z_{k-1/2}$$ ($$k = 1, . . . ,$$ ''nsoilmx'' - 1) are the computational nodes representative of the $$k^{th}$$ layer. The computational grid is obtained by imposing a geometrically stretched distribution of layers:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    z_{k-1/2} = lay1_{soil} \times 10^{-4} \times \alpha_{soil}^{k-1/2}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$k$$ varies from 1 to $$nsoilmx$$. By default, the variables  ''nsoilmx'', $$lay1_{soil}$$, and $$\alpha_{soil}$$ are set respectively to 18, 2 $$ \times 10^{-4}$$, and 2 in the routine ''comsoil_h''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The time integration is done via an implicit (first order) Euler scheme which approximates the differential equation $$du(t)/dt = F (u, t)$$ as:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
\frac{u(t+\delta t) - u(t)}{\delta t} =  F (u(t+\delta t), t+\delta t))&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2477</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2477"/>
				<updated>2025-03-05T09:37:07Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* Theoretical Considerations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM.&lt;br /&gt;
&lt;br /&gt;
== Theoretical Considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
The PCM solves the  time-dependent diffusion equation:&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = - \overrightarrow{\nabla} \cdot \overrightarrow{F}_c&lt;br /&gt;
    \label{Eq:EqChaleur}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
where $$C$$ is the volumetric specific heat (J m$$^{-3}$$ K$$^{-1}$$) such that $$C = \rho C_p$$ ($$\rho$$ is the material's density, in kg m$$^{-3}$$ and $$C_p$$ is its specific heat, in J kg$$^{-1}$$ K$$^{-1}$$), and $$F_c$$ is the conductive heat flux: $$\overrightarrow{F}_c = - \lambda \overrightarrow{\nabla}T$$ according to Fourrier's law ($$\lambda$$  is the solid’s heat conductivity, in J s$$^{-1}$$ m$$^{-1}$$ K$$^{-1}$$).&lt;br /&gt;
&lt;br /&gt;
Thermal conduction is here considered as a one-dimensional (1D) process, lateral conduction is neglected (a reasonable assumption considering typical grid size in the Generic PCM). Temperature $$T$$ of the soil is thus a function of time $$t$$ and depth $$z$$, which must satisfy the following equation:&lt;br /&gt;
&lt;br /&gt;
\begin{equation}&lt;br /&gt;
    C \frac{\partial T}{\partial t} = \frac{\partial}{\partial z}\left[ \lambda(z) \frac{\partial T}{\partial z} \right]&lt;br /&gt;
    \label{Eq:Chaleur1D}&lt;br /&gt;
\end{equation}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The Mars PCM  used to have the following boundary conditions:&lt;br /&gt;
* At the bottom (e.g.: $$z = H$$) of the layer of soil: No outgoing (or incoming) heat flux. This boundary condition is then simply: \begin{equation} \frac{\partial T}{\partial z}    _{z= H} = 0 \end{equation}&lt;br /&gt;
* At the surface ($$z$$ = 0): Surface temperature $$T_S (t) = T (z = 0, t)$$ can be computed from the balance of heat fluxes through the surface and cooling thereof, which leads to:&lt;br /&gt;
\begin{equation} F_c + \sum F^\downarrow = \epsilon \sigma T_s^4 \end{equation} where $$F_c$$ is the flux of heat conduction given by Fourier's law, $$\sum F^\downarrow$$ is the sum of fluxes reaching  the surface, $$\epsilon$$ is the emissivity of the ground and $$\sigma$$ the Stephan-Boltzman constant. In the case of condensation/sublimation, a latent heat term is added to this last equation.&lt;br /&gt;
&lt;br /&gt;
== Numerical approach == &lt;br /&gt;
The spatial discretization of the unsteady-heat equation is based on a finite volume approach.&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2453</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2453"/>
				<updated>2025-03-05T08:55:36Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* Theoretical Considerations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM.&lt;br /&gt;
&lt;br /&gt;
== Theoretical Considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by Hourdin et al. (2013). Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties with depth.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References == &lt;br /&gt;
&lt;br /&gt;
Hourdin, F., Van, P. L., Forget, F., and Talagrand, O. (1993). Meteorological variability and the annual surface pressure cycle on Mars. Journal of Atmospheric Sciences, 50(21):3625 – 3640.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2451</id>
		<title>Soil Thermal Conduction in the Generic PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Soil_Thermal_Conduction_in_the_Generic_PCM&amp;diff=2451"/>
				<updated>2025-03-05T08:53:54Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: Created page with &amp;quot;== Purpose ==  The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM.  == Theoret...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
The goal of this page is to summarize key aspects, both theoretical and practical, of the computation of subsurface temperatures in the generic PCM.&lt;br /&gt;
&lt;br /&gt;
== Theoretical Considerations == &lt;br /&gt;
&lt;br /&gt;
The computation of the heat conduction in the soil was based on the  1D layer soil model originally described by \cite{Hourdin1993}. Since that, E. Millour  modified this scheme to include the possibility of varying the thermal properties to include the effect of subsurface water ice. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Generic-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Subgrid_Slopes_in_the_Mars_PCM&amp;diff=1637</id>
		<title>Subgrid Slopes in the Mars PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Subgrid_Slopes_in_the_Mars_PCM&amp;diff=1637"/>
				<updated>2023-10-19T09:04:25Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
In order to study surface processes in the Mars Planetary Climate Model (e.g., gully formation, glacier evolution, ...), a representation of the sub-grid slopes has been introduced in the Mars PCM. This parametrization is detailed in Lange et al., 2023, &amp;quot;Modelling Slope Microclimates in the Mars Planetary Climate Model&amp;quot; https://arxiv.org/pdf/2306.12449.pdf. Contact: lucas.lange@lmd.ipsl.fr&lt;br /&gt;
&lt;br /&gt;
For each GCM mesh, we decompose the cell as a distribution of sloped terrains (defined by characteristic slopes) and a flat terrain. On each sub-grid terrain, we let the microclimates evolve so that the slope-specific features (e.g., condensation of volatiles, formation of glaciers, migration of subsurface ice, etc.) can be simulated. The portion of the atmosphere above the ground within the cell sees an average of these surface microclimates, and all sub-grid terrains see the same ”shared atmosphere”.&lt;br /&gt;
&lt;br /&gt;
== Practical Implementation ==&lt;br /&gt;
The practical implementation is detailed in section 3. of Lange et al., 2023. In short:&lt;br /&gt;
&lt;br /&gt;
* The mesh can be divided in 1, 5, or 7 sub-grid slopes that are North - South facing. Then, using MOLA data (resolution: 64 pixel per degree), the distribution of sub-slope within the mesh is computed.&lt;br /&gt;
&lt;br /&gt;
* All the surface quantities have now a dimension nslope: qsurf, watercap, tsurf, tsoil, albedo, emis, inertiesoil&lt;br /&gt;
&lt;br /&gt;
* The radiative transfer is computed with grid-box albedo, emissivity, temperature. Then, the values are adapted for-each sub-grid slopes following Spiga &amp;amp; Forget 2008 (section 2. of ''physiq_mod'', ''param_slope'').&lt;br /&gt;
&lt;br /&gt;
* The turbulent exchanges (''vdifc_mod'') are solved with the predominant sub-grid surface (i.e., the sub-grid surface which has the largest cover within the grid box). &lt;br /&gt;
&lt;br /&gt;
* Water and CO2 ice condensation are computed for each sub-grid slopes (''vdifc_mod'', ''co2_condens'')&lt;br /&gt;
&lt;br /&gt;
* Grid box averaged values are then computed using the specific computation detailed in the dedicated section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to run with sub-grid slopes ? ==&lt;br /&gt;
&lt;br /&gt;
By default, the model runs with only 1 sub-slope (i.e., a flat surface). If one wants to use this sub-grid parameterization, then one must use ''newstart'' and choose the option to add sub-slopes. FYI: The CPU time is increased by ~20% with 7 sub-slopes (64x48x26 grid).&lt;br /&gt;
&lt;br /&gt;
== Post Processing == &lt;br /&gt;
&lt;br /&gt;
In order to go from the sub-grid surface quantity to the grid-box value, the following computations are done:&lt;br /&gt;
* For albedo and emissivity:&lt;br /&gt;
\begin{align}&lt;br /&gt;
     X = \sum_{i=1}^7 X_i \delta_i&lt;br /&gt;
     \label{eq:opticalproperties}&lt;br /&gt;
\end{align}&lt;br /&gt;
where $$X$$ refers to the grid parameter, $$X_i$$ the sub-grid parameter of slope $$i$$, $$\delta_i$$ the cover fraction (''subslope_dist'' in the code).&lt;br /&gt;
&lt;br /&gt;
* For surface tracers, to ensure mass conservation:&lt;br /&gt;
\begin{align}&lt;br /&gt;
 X = \sum_{i=1}^7 X_i \frac{\delta_i}{\cos(\mu_i)} &lt;br /&gt;
     \label{eq:traceurs}&lt;br /&gt;
\end{align}&lt;br /&gt;
where $$\mu_i$$ is the slope angle of the sub-grid slope (''def_slope_mean'' in the code)&lt;br /&gt;
&lt;br /&gt;
* For surface temperature, we average the surface flux:&lt;br /&gt;
\begin{align}&lt;br /&gt;
    \epsilon T_{\rm{surf,grid}} = \sum_{i=1}^7 \epsilon_i T_{\rm{surf,i}}^4 \delta_i&lt;br /&gt;
    \label{eq:Tsurf}&lt;br /&gt;
\end{align}&lt;br /&gt;
where $$\epsilon$$ (1) is the grid emissivity, $$T_{\rm{surf,grid}}$$ (K) the grid surface temperature&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* This new parameterization enable, for each grid point, to determine the surface fields for the seven types of slopes modeled here. The question is now: for any point on the Martian surface, knowing the characteristics of the terrain (slope and azimuth), can we determine the values of the surface quantities using the GCM outputs that are discretized in space and slopes (i.e., build high resolution map of surface quantities)?&lt;br /&gt;
&lt;br /&gt;
I (LL) propose to use the following method, inspired from the MCD. &lt;br /&gt;
Let us consider a point (noted $M$) of the surface of Mars, placed on a surface of slope angle $$\theta$$ and azimuth $$\psi$$. We  compute $\mu$ and find the index $$i,i+1$$ of the two sub-grid slopes such that:&lt;br /&gt;
\begin{align}&lt;br /&gt;
    \mu_i  \leq \mu &amp;lt; \mu_{i+1}&lt;br /&gt;
\end{align}&lt;br /&gt;
&lt;br /&gt;
The point $$M$$ is surrounded by four GCM meshes. We can interpolate the values obtained at the GCM points for the sub-grid slope  $$\mu_i$$ and  $$\mu_{i+1}$$ at point $$M$$. This is performed by using a bilinear interpolation in space. After that, the value for slope $$\mu$$  at $$M$$ is obtained with linear interpolation between the fields obtained after the bilinear interpolation for  $$\mu_i$$ and $$\mu_i+1$$. If $$\mu &amp;lt; \mu_0$$ or $$\mu &amp;gt; \mu_7$$,  an extrapolation is computed.  Thus, we have virtually access to any surface for any kind of slopped surface on Mars using this complete climate model. WARNING: 1) we assume linear interpolation on processes that are not necessarily linear (although we interpolate neighbouring points); 2) we neglect the time-shift (generally lower than 1-2~hours) for slopes oriented East-West that are not well represented by this parameterization. &lt;br /&gt;
&lt;br /&gt;
I (LL) have a python algorithm to do that, feel free to ask me!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Mars-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Mars_PCM_physics:_CO2_cycle&amp;diff=1636</id>
		<title>Mars PCM physics: CO2 cycle</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Mars_PCM_physics:_CO2_cycle&amp;diff=1636"/>
				<updated>2023-10-19T09:03:41Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* Surface properties */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The goal of this page is to summarize key aspects, but theoretical and practical, of the parametrizations in the Mars physics package that enable modeling the Martian CO2 cycle&lt;br /&gt;
&lt;br /&gt;
== The key processes ==&lt;br /&gt;
* CO2 condensation: atmospheric condensation. surface condensation&lt;br /&gt;
* polar sub-surface ice tables as high thermal inertia &amp;quot;heat reservoirs&amp;quot;&lt;br /&gt;
* surface properties (albedo of the surface)&lt;br /&gt;
&lt;br /&gt;
== Parametrizations and key parameters in the model ==&lt;br /&gt;
&lt;br /&gt;
=== CO2 condensation in the atmosphere ===&lt;br /&gt;
* CO2 ice clouds. These are implemented, but not used in standard simulations.&lt;br /&gt;
* CO2 condensation. See routine co2condens.&lt;br /&gt;
&lt;br /&gt;
=== Polar sub-surface ice tables of high thermal inertia ===&lt;br /&gt;
These are set via the newstart utility. The information itself is stored in the startfi file. For now, the subsurface ice depth and thermal inertia values are set to fit the CO2 cycle thought an inversion of MONS spectrometer data (see Diez et al., 2008) by the routine ''xvik''. One can also use the Planetary Evolution Model to compute the position of the ice table.&lt;br /&gt;
&lt;br /&gt;
=== Surface properties ===&lt;br /&gt;
In callphys.def one may specify ( by setting flag ''TESicealbedo'' to ''.true.'' ; recommended) that a climatology based on TES observations be used to drive (nudge) the evolution of CO2 polar caps.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Impose polar cap surface albedos as observed by TES?&lt;br /&gt;
TESicealbedo = .true.&lt;br /&gt;
## Coefficient for Northern cap albedoes&lt;br /&gt;
TESice_Ncoef=1.6&lt;br /&gt;
## Coefficient for Southern cap albedoes&lt;br /&gt;
TESice_Scoef=1.6&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The sub-options ''TESice_Ncoef'' and ''TESice_Scoef'' are multiplying factors applied to the TES values, meant to account for non Lambertian effects.&lt;br /&gt;
In practice this is coded in ...&lt;br /&gt;
&lt;br /&gt;
If a alternative setup with &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Impose polar cap surface albedos as observed by TES?&lt;br /&gt;
TESicealbedo = .false.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then the surface albedo is based on the presence or absence of CO2 ice on the surface. Without CO2 ice the albedo is that of bare ground and if CO2 ice is present it is set to 0.6 (variable ''albedice'' in surfdat_h.F90 which stores 2 values one for north and south). In this case, the perennial CO2 ice at the South Pole is represented throught a different albedo set in the ''callphys.def'':&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
## Albedo of the perenial CO2 ice at the South Pole&lt;br /&gt;
albedo_perenialco2 = 0.85&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[Category:Mars-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Mars_PCM_physics:_CO2_cycle&amp;diff=1635</id>
		<title>Mars PCM physics: CO2 cycle</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Mars_PCM_physics:_CO2_cycle&amp;diff=1635"/>
				<updated>2023-10-19T08:58:39Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* Polar sub-surface ice tables of high thermal inertia */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The goal of this page is to summarize key aspects, but theoretical and practical, of the parametrizations in the Mars physics package that enable modeling the Martian CO2 cycle&lt;br /&gt;
&lt;br /&gt;
== The key processes ==&lt;br /&gt;
* CO2 condensation: atmospheric condensation. surface condensation&lt;br /&gt;
* polar sub-surface ice tables as high thermal inertia &amp;quot;heat reservoirs&amp;quot;&lt;br /&gt;
* surface properties (albedo of the surface)&lt;br /&gt;
&lt;br /&gt;
== Parametrizations and key parameters in the model ==&lt;br /&gt;
&lt;br /&gt;
=== CO2 condensation in the atmosphere ===&lt;br /&gt;
* CO2 ice clouds. These are implemented, but not used in standard simulations.&lt;br /&gt;
* CO2 condensation. See routine co2condens.&lt;br /&gt;
&lt;br /&gt;
=== Polar sub-surface ice tables of high thermal inertia ===&lt;br /&gt;
These are set via the newstart utility. The information itself is stored in the startfi file. For now, the subsurface ice depth and thermal inertia values are set to fit the CO2 cycle thought an inversion of MONS spectrometer data (see Diez et al., 2008) by the routine ''xvik''. One can also use the Planetary Evolution Model to compute the position of the ice table.&lt;br /&gt;
&lt;br /&gt;
=== Surface properties ===&lt;br /&gt;
In callphys.def one may specify ( by setting flag ''TESicealbedo'' to ''.true.'' ; recommended) that a climatology based on TES observations be used to drive (nudge) the evolution of CO2 polar caps.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Impose polar cap surface albedos as observed by TES?&lt;br /&gt;
TESicealbedo = .true.&lt;br /&gt;
## Coefficient for Northern cap albedoes&lt;br /&gt;
TESice_Ncoef=1.6&lt;br /&gt;
## Coefficient for Southern cap albedoes&lt;br /&gt;
TESice_Scoef=1.6&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The sub-options ''TESice_Ncoef'' and ''TESice_Scoef'' are multiplying factors applied to the TES values, meant to account for non Lambertian effects.&lt;br /&gt;
In practice this is coded in ...&lt;br /&gt;
&lt;br /&gt;
If a alternative setup with &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Impose polar cap surface albedos as observed by TES?&lt;br /&gt;
TESicealbedo = .false.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Then the surface albedo is based on the presence or absence of CO2 ice on the surface. Without CO2 ice the albedo is that of bare ground and if CO2 ice is present it is set to 0.6 (variable ''albedice'' in surfdat_h.F90 which stores 2 values one for north and south)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Mars-Model]]&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Subgrid_Slopes_in_the_Mars_PCM&amp;diff=1634</id>
		<title>Subgrid Slopes in the Mars PCM</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/Planets/index.php?title=Subgrid_Slopes_in_the_Mars_PCM&amp;diff=1634"/>
				<updated>2023-10-19T08:57:09Z</updated>
		
		<summary type="html">&lt;p&gt;LucasLange: /* Purpose */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Purpose == &lt;br /&gt;
In order to study surface processes in the Mars Planetary Climate Model (e.g., gully formation, glacier evolution, ...), a representation of the sub-grid slopes has been introduced in the Mars PCM. This parametrization is detailed in Lange et al., 2023, &amp;quot;Modelling Slope Microclimates in the Mars Planetary Climate Model&amp;quot; https://arxiv.org/pdf/2306.12449.pdf. Contact: lucas.lange@lmd.ipsl.fr&lt;br /&gt;
&lt;br /&gt;
For each GCM mesh, we decompose the cell as a distribution of sloped terrains (defined by characteristic slopes) and a flat terrain. On each sub-grid terrain, we let the microclimates evolve so that the slope-specific features (e.g., condensation of volatiles, formation of glaciers, migration of subsurface ice, etc.) can be simulated. The portion of the atmosphere above the ground within the cell sees an average of these surface microclimates, and all sub-grid terrains see the same ”shared atmosphere”.&lt;br /&gt;
&lt;br /&gt;
== Practical Implementation ==&lt;br /&gt;
The practical implementation is detailed in section 3. of Lange et al., 2023. In short:&lt;br /&gt;
&lt;br /&gt;
* The mesh can be divided in 1, 5, or 7 sub-grid slopes that are North - South facing. Then, using MOLA data (resolution: 64 pixel per degree), the distribution of sub-slope within the mesh is computed.&lt;br /&gt;
&lt;br /&gt;
* All the surface quantities have now a dimension nslope: qsurf, watercap, tsurf, tsoil, albedo, emis, inertiesoil&lt;br /&gt;
&lt;br /&gt;
* The radiative transfer is computed with grid-box albedo, emissivity, temperature. Then, the values are adapted for-each sub-grid slopes following Spiga &amp;amp; Forget 2008 (section 2. of ''physiq_mod'', ''param_slope'').&lt;br /&gt;
&lt;br /&gt;
* The turbulent exchanges (''vdifc_mod'') are solved with the predominant sub-grid surface (i.e., the sub-grid surface which has the largest cover within the grid box). &lt;br /&gt;
&lt;br /&gt;
* Water and CO2 ice condensation are computed for each sub-grid slopes (''vdifc_mod'', ''co2_condens'')&lt;br /&gt;
&lt;br /&gt;
* Grid box averaged values are then computed using the specific computation detailed in the dedicated section.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to run with sub-grid slopes ? ==&lt;br /&gt;
&lt;br /&gt;
By default, the model runs with only 1 sub-slope (i.e., a flat surface). If one wants to use this sub-grid parameterization, then one must use ''newstart'' and choose the option to add sub-slopes. FYI: The CPU time is increased by ~20% with 7 sub-slopes (64x48x26 grid).&lt;br /&gt;
&lt;br /&gt;
== Post Processing == &lt;br /&gt;
&lt;br /&gt;
In order to go from the sub-grid surface quantity to the grid-box value, the following computations are done:&lt;br /&gt;
* For albedo and emissivity:&lt;br /&gt;
\begin{align}&lt;br /&gt;
     X = \sum_{i=1}^7 X_i \delta_i&lt;br /&gt;
     \label{eq:opticalproperties}&lt;br /&gt;
\end{align}&lt;br /&gt;
where $$X$$ refers to the grid parameter, $$X_i$$ the sub-grid parameter of slope $$i$$, $$\delta_i$$ the cover fraction (''subslope_dist'' in the code).&lt;br /&gt;
&lt;br /&gt;
* For surface tracers, to ensure mass conservation:&lt;br /&gt;
\begin{align}&lt;br /&gt;
 X = \sum_{i=1}^7 X_i \frac{\delta_i}{\cos(\mu_i)} &lt;br /&gt;
     \label{eq:traceurs}&lt;br /&gt;
\end{align}&lt;br /&gt;
where $$\mu_i$$ is the slope angle of the sub-grid slope (''def_slope_mean'' in the code)&lt;br /&gt;
&lt;br /&gt;
* For surface temperature, we average the surface flux:&lt;br /&gt;
\begin{align}&lt;br /&gt;
    \epsilon T_{\rm{surf,grid}} = \sum_{i=1}^7 \epsilon_i T_{\rm{surf,i}}^4 \delta_i&lt;br /&gt;
    \label{eq:Tsurf}&lt;br /&gt;
\end{align}&lt;br /&gt;
where $$\epsilon$$ (1) is the grid emissivity, $$T_{\rm{surf,grid}}$$ (K) the grid surface temperature&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* This new parameterization enable, for each grid point, to determine the surface fields for the seven types of slopes modeled here. The question is now: for any point on the Martian surface, knowing the characteristics of the terrain (slope and azimuth), can we determine the values of the surface quantities using the GCM outputs that are discretized in space and slopes (i.e., build high resolution map of surface quantities)?&lt;br /&gt;
&lt;br /&gt;
I (LL) propose to use the following method, inspired from the MCD. &lt;br /&gt;
Let us consider a point (noted $M$) of the surface of Mars, placed on a surface of slope angle $$\theta$$ and azimuth $$\psi$$. We  compute $\mu$ and find the index $$i,i+1$$ of the two sub-grid slopes such that:&lt;br /&gt;
\begin{align}&lt;br /&gt;
    \mu_i  \leq \mu &amp;lt; \mu_{i+1}&lt;br /&gt;
\end{align}&lt;br /&gt;
&lt;br /&gt;
The point $$M$$ is surrounded by four GCM meshes. We can interpolate the values obtained at the GCM points for the sub-grid slope  $$\mu_i$$ and  $$\mu_{i+1}$$ at point $$M$$. This is performed by using a bilinear interpolation in space. After that, the value for slope $$\mu$$  at $$M$$ is obtained with linear interpolation between the fields obtained after the bilinear interpolation for  $$\mu_i$$ and $$\mu_i+1$$. If $$\mu &amp;lt; \mu_0$$ or $$\mu &amp;gt; \mu_7$$,  an extrapolation is computed.  Thus, we have virtually access to any surface for any kind of slopped surface on Mars using this complete climate model. WARNING: 1) we assume linear interpolation on processes that are not necessarily linear (although we interpolate neighbouring points); 2) we neglect the time-shift (generally lower than 1-2~hours) for slopes oriented East-West that are not well represented by this parameterization. &lt;br /&gt;
&lt;br /&gt;
I (LL) have a python algorithm to do that, feel free to ask me!&lt;/div&gt;</summary>
		<author><name>LucasLange</name></author>	</entry>

	</feed>