This page's content applies to older versions of PATMO. Please wait for updates.
This page's content applies to older versions of PATMO. Please wait for updates.
This page describes the Fortran FUNCTIONs and SUBROUTINEs that can be directly accessed by users within the PATMO framework (e.g., through the provided test.f90 example file). Before using any of these functions, you must include the following module statement — otherwise, PATMO will not compile properly:
use patmo
Computes the entropy production flux within a single timestep dt.
This subroutine accumulates the fluxes of all chemical reactions over dt, but does not directly calculate the entropy production itself (to avoid division by zero). Use patmo_getEntropyProduction() after the loop to obtain the total value.
Pseudocode example:
do while (time < tend)
  call patmo
  time = time + dt
  call patmo_computeEntropyProductionFlux(dt)
end do
print *, "Entropy production:", patmo_getEntropyProduction(time)
For more details, see the related documentation section.
Returns the average entropy production over the specified time interval. Should be called after running patmo_computeEntropyProductionFlux().
Defines a blackbody radiation source from a star with:
• starTbb: temperature (K)
• starRadius: radius (in solar radii)
• starDistance: distance from the planet (in AU)
Defaults correspond to the Sun–Earth system (5777 K, 1 Rsun, 1 AU). The subroutine scales the flux geometrically (and by opacity if present). The resulting stellar flux includes an additional π factor accounting for hemispherical emission from stellar surface elements:
Prints the top bestFluxesNumber reaction fluxes for the atmospheric layer icell.
Dump the opacity to the file fname, using given unit for radiation energy. Argument unitEnergy is optional, default is eV, other options are micron. File columns are energy, height (km), opacity.
Compute hydrostatic equilibrium using the pressure at ground pground with units unitP. Argument unitP is optional, default is dyne/cm2, options are atm, mbar. File columns are alt/km p/mbar Tgas/K.
Load an atmosphere profile from the file fname. The columns of the file are determined by the last header line starting with #, e.g.
Headers can be index (a integer number), alt (altitude in unitH, optional, default cm), dummy (skip this column), Tgas (temperature in K). The 4 3 line represents the number of data (from index to Tgas), and the number of non-zero species, so if you have 10 species in your network only 3 (H2CO, CO, H2O) will be initialized to a non-defaultDensity value (indicated in the file). Note that density are loaded in unit of unitX (optional, default 1/cm3). If you set unit to ppbv they will be summed and normalized to 1 (i.e. like indicating a number density fraction).
NOTE: for now layers MUST BE EQUALLY SPACED. If your file is not using the tools/unigrid.py to produce a uniform interpolated file.
Get the total mass in g/cm3.
Get the total mass of the * nuclei, where * is one of the networks atom, e.g. patmo_getTotalMassNuclei_C or patmo_getTotalMassNuclei_O. It returns g/cm3.
Set the same grid spacing dz for all the layers, in cm. No default.
Set thermal diffusion to alpha, default is zero. This value doesn't change with the height.
Set Eddy diffusion to value Kzz in cm2/s, for the layer with index icell (ground=1).
As above, but set the same for all the layers.
Set molecular diffusion to value Dzz in cm2/s, for the layer with index icell (ground=1).
As above, but set the same for all layers.
Dump density to file number ifile (append). Time is the independent variable (you can put whatever you want), idx is the species index. You can for example get the index for CH4 by using the variable patmo_idx_CH4. File columns are time, layer, number_density, where layer is the index number of the layer (ground=1).
Dump the current mixing ratios to the file number ifile (append). Time is the independent variable (can be any), idx is the index of the species. You can for example get the index for CH4 by using the variable patmo_idx_CH4. File columns are time, layer, mixing_ratio, where layer is the index number of the layer (ground=1).
Dump all the mixing ratios to the file fname. File columns are layer, mixing_ratio(:), where layer is the index number of the layer (ground=1). Every column after layer contains the mixing ratios, the order is in the header.
Set the gravity to g in cm/s2. For now, same value for all the layers.
Set the chemistry in the layer with index icell (ground=1), using the number density abundances n(:) in 1/cm3, where n(:) is a double (real*8) array (one value per species).
As above but for all the layers.
Set the gas temperature Tgas (in K) for the layer with index icell (ground=1).
As above but for all the layers.
Get the density (1/cm3) of the species with index idx_species in the cell with index icell (ground=1). You can for example get the index for CH4 by using the variable patmo_idx_CH4.
Get the temperature in K for the layer with index icell (ground=1).
Experimental, forget it.