The code modules described and referenced here are utilities used in processing atmospheric profile data.
| Specific amount <-> mixing ratio | |
|---|---|
| SA_to_MR | Function to convert gas concentrations from specific amount to mixing ratio. |
| MR_to_SA | Function to convert gas concentrations from mixing ratio to specific amount |
| Relative humidity <-> mixing ratio | |
| RH_to_MR | Function to convert water vapor amounts from relative humidity to mixing ratio. |
| MR_to_RH | Function to convert water vapor amounts from mixing ratio to relative humidity. |
| Mixing ratio <-> ppmv | |
| MR_to_PPMV | Function to convert gas concentrations from mixing ratio to parts-per-million by volume. |
| PPMV_to_MR | Function to convert gas concentrations from parts-per-million by volume to mixing ratio. |
| Partial pressure <-> ppmv | |
| PPMV_to_PP | Function to convert gas concentrations from parts-per-million by volume to partial pressure. |
| PP_to_PPMV | Function to convert gas concentrations from partial pressure to parts-per-million by volume. |
| Partial pressure <-> mixing ratio | |
| MR_to_PP | Function to convert gas concentrations from mixing ratio to partial pressure in hectoPascals |
| PP_to_MR | Function to convert gas concentrations from partial pressure in hectoPascals to mixing ratio in g/kg. |
| Partial pressure <-> mass density | |
| PP_to_MD | Function to convert gas concentrations in pressure units to mass density. |
| MD_to_PP | Function to convert gas concentration mass density to partial pressure. |
| Partial pressure <-> number density | |
| PP_to_ND | Function to convert gas concentrations from (partial) pressures in hectoPascals to molecules/m^3. |
| ND_to_PP | Function to convert gas concentrations from number densities in molecules/m^3 to (partial) pressures in hectoPascals. |
| Number density <-> ppmv | |
| PPMV_to_ND | Function to convert gas concentrations from parts-per-million by volume to molecules/m^3. |
| ND_to_PPMV | Function to convert gas concentrations from number densities in molecules/m^3 to parts-per-million by volume. |
| Column density <-> ppmv | |
| PPMV_to_KMOL | Function to convert gas concentrations from parts-per- million by volume to kilomoles per cm^2. |
| KMOL_to_PPMV | Function to convert gas concentrations from kilomoles per cm^2 to parts-per-million by volume. |
The most significant contributor to the change in MWair is water vapor, mostly in the lower troposphere. The effect of the other absorbers (O3, CO2, etc.) can be considered negligible. To offset the displacement of "air molecules" by water vapor, the molecular weight of air is given by,
where
where
where
where
where
There is also an "inverse" capability to compute the temperature given the virtual temperature and the water vapor mixing ratio.
For the subprogram interface details, see the Atmospheric_Properties Virtual_Temperature documentation.
The conversion is given by Poisson's equation,
where
where
There is also an "inverse" capability to compute the temperature given the potential temperature and pressure.
For the subprogram interface details, see the Atmospheric_Properties Potential_Temperature documentation.
where
and H is the scale height given by,
and this will allow for the effect of other gases, such as O3, eventually to be included in the calcuation of the effective molecular weight of air, MWAir.
Layer values for both RAir and T are determined from a density weighted average of adjacent level values,
where
For the subprogram interface details, see the Geopotential Geopotential_Height documentation.
Gallery et al (1983) indicates that for determining atmospheric absorption line halfwidths, intensities and blackbody emission, effective layer pressures and temperatures are used. The definition supplied (one of many) is the density weighted average,
and
where ds = the element of length along a path.
If we assume that the integration is always done over one layer (between two levels, k and k-1 where zk-1 > zk) then the above equations become,
and
The comparison between the average and effective layer pressure is shown in figure 1. The same for the average and effective layer temperatures is shown in figure 2.
Note that the gas constant used in the effective temperature equation is for air, not dry air. If the gas constant for dry air is used, the difference between effective and average layer temperatures differs considerably when the atmosphere is sufficiently moist -- as is shown in figure 3.
For the subprogram interface details, see the Level_Layer_Conversion Effective_Layer_TP documentation.


The assumption is made that temperature and absorber amount vary linearly with ln(P). To improve the quadrature in integrating level amounts to a layer value, each input layer, k, is split into N(k) sublayers equally spaced in ln(P) as shown in figure 4

given the pressures, P0 - PK of the input levels where P0 corresponds to the highest altitude (lowest pressure) level and PK corresponds to the surface pressure. Note that the level count starts at 0 and a layer k or sublayer n is between levels k-1 and k, and n-1 and n respectively. Also, the zeroth sublevel corresponds to the k-1 level.
Once the sublevels are defined, the level temperatures and absorber amounts are linearly interpolated at the specific number of sublevels and those interpolates associated with the sublevel pressures.
For the subprogram interface details, see the Level_Layer_Conversion Create_Sublevels documentation.
Once the sublevel arrays have been created using Create_Sublevels, they are passed to the Integrate_Sublevels function. This function determines the average layer k temperature from the N(k) sublayers temperature-density product by simple summation,
where Δzn is the sublayer thickness, and the average sublayer n pressures and temperatures are given by,
respectively.
Similarly to the layer temperature, the integrated layer absorber column density for molecule j is determined by summing the sublayer values,
where c is a scaling constant, and the average sublayer n absorber volume mixing ratio is a simple sublevel average,
An explanation of the conversion of layer volume mixing ratios into column density (in kmol/cm2) can be found in the Units_Conversion PPMV_to_KMOL documentation.
For the subprogram interface details, see the Level_Layer_Conversion Integrate_Sublevels documentation.