moist2dry/std moist2dry/std

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 (which must be provided as a transform attribute, e.g. via the datavect YAML) 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:

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.

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  # Optional arguments
 8  parameter: XXXXX  # str
 9  component: XXXXX  # str
10  orig_parameter_plg: XXXXX  # Plugin
11  orig_component_plg: XXXXX  # Plugin
12  successor: XXXXX  # str
13  precursor: XXXXX  # str
14  scale: XXXXX  # float