moist2dry/std moist2dry/std#

Description#

moist2dry transform: convert moist-air mixing ratios to dry-air number concentrations.

Applies the standard correction for water vapour using the specific humidity field q and converts from mixing ratio to number concentration (molecules cm⁻³) using the species molar mass:

\[C_{dry} = C_{moist} \cdot \left(1 - \beta \frac{q}{1-q}\right) \cdot \frac{R}{R_{dry}} \cdot \frac{1000 \times 10^9}{M}\]

where \(\beta = (R_{vapor} - R_{dry}) / R_{vapor}\), \(R = 8.314\,\text{J mol}^{-1}\text{K}^{-1}\), \(R_{dry} = 287.05\,\text{J kg}^{-1}\text{K}^{-1}\), and \(M\) is the species molar mass in g mol⁻¹ (molmass attribute).

The adjoint applies the same scalar factor to the adj_out field.

Note

The scale input argument is defined for API compatibility but is not used in the current implementation. The conversion factor is determined entirely by molmass and the q field.

YAML arguments#

The following arguments are used to configure the plugin. pyCIF will return an exception at the initialization if mandatory arguments are not specified, or if any argument does not fit accepted values or type:

Mandatory arguments#

molmass : float, mandatory

Molar mass of the species, in g mol-1. Used to convert the moist-air mixing ratio to a dry-air number concentration.

Optional arguments#

parameter : str, optional

Parameter name on which the transform works on

component : str, optional

Component name on which the transform works on

orig_parameter_plg : Plugin, optional

Plugin object on which the transform works on

orig_component_plg : Plugin, optional

Corresponding component object on which the transform works on

successor : str, optional

Name of the successor transform

precursor : str, optional

Name of the precursor transform

scale : float, optional, default 1.0

Scale factor used to convert the original data onto the output unit.

is_top : bool, optional, default False

Flag the input/output tracers as top-of-domain boundary condition data.

is_lbc : bool, optional, default False

Flag the input/output tracers as lateral boundary condition data.

YAML template#

Please find below a template for a YAML configuration:

 1transform:
 2  plugin:
 3    name: moist2dry
 4    version: std
 5    type: transform
 6
 7  # Mandatory arguments
 8  molmass: XXXXX  # float
 9
10  # Optional arguments
11  parameter: XXXXX  # str
12  component: XXXXX  # str
13  orig_parameter_plg: XXXXX  # Plugin
14  orig_component_plg: XXXXX  # Plugin
15  successor: XXXXX  # str
16  precursor: XXXXX  # str
17  scale: XXXXX  # float
18  is_top: XXXXX  # bool
19  is_lbc: XXXXX  # bool