easyclimate.core.waterflux

Water Flux

Functions

calc_horizontal_water_flux(→ xarray.Dataset)

Calculate horizontal water vapor flux at each vertical level.

calc_vertical_water_flux(→ xarray.DataArray)

Calculate vertical water vapor flux.

calc_water_flux_top2surface_integral(→ xarray.DataArray)

Calculate the water vapor flux across the vertical level.

calc_divergence_watervaporflux(→ xarray.DataArray)

Calculate water vapor flux divergence at each vertical level.

calc_divergence_watervaporflux_top2surface_integral(...)

Calculate water vapor flux divergence across the vertical level.

Module Contents

easyclimate.core.waterflux.calc_horizontal_water_flux(specific_humidity_data: xarray.DataArray, u_data: xarray.DataArray, v_data: xarray.DataArray, g: float = 9.8) xarray.Dataset

Calculate horizontal water vapor flux at each vertical level.

\[\frac{1}{g} q \mathbf{V} = \frac{1}{g} (u q\ \mathbf{i} + vq\ \mathbf{j})\]

Parameters

specific_humidity_data: xarray.DataArray.

The absolute humidity data.

u_data: xarray.DataArray.

The zonal wind data.

v_data: xarray.DataArray.

The meridional wind data.

g: float, default: 9.8.

The acceleration of gravity.

Returns

The water vapor flux. (xarray.Dataset).

  • \(qu\): zonal water vapor flux.

  • \(qv\): meridional water vapor flux.

easyclimate.core.waterflux.calc_vertical_water_flux(specific_humidity_data: xarray.DataArray, omega_data: xarray.DataArray, g: float = 9.8) xarray.DataArray

Calculate vertical water vapor flux.

\[-\omega \frac{q}{g}\]

Parameters

specific_humidity_data: xarray.DataArray.

The absolute humidity data.

omega_data: xarray.DataArray.

The vertical velocity data (\(\frac{\mathrm{d} p}{\mathrm{d} t}\)).

g: float, default: 9.8.

The acceleration of gravity.

Returns

The vertical water flux. (xarray.DataArray).

easyclimate.core.waterflux.calc_water_flux_top2surface_integral(specific_humidity_data: xarray.DataArray, u_data: xarray.DataArray, v_data: xarray.DataArray, surface_pressure_data: xarray.DataArray, surface_pressure_data_units: Literal['hPa', 'Pa', 'mbar'], specific_humidity_data_units: Literal['kg/kg', 'g/kg', 'g/g'], vertical_dim: str, vertical_dim_units: Literal['hPa', 'Pa', 'mbar'], method: Literal['ncl', 'rust', 'rust-block'] = 'rust-block', g: float = 9.8) xarray.DataArray

Calculate the water vapor flux across the vertical level.

\[\frac{1}{g} \int_0^{p_s} (q\mathbf{v}),dp\]

Parameters

specific_humidity: xarray.DataArray.

The absolute humidity data.

u_data: xarray.DataArray.

The zonal wind data.

v_data: xarray.DataArray.

The meridional wind data.

surface_pressure_data: xarray.DataArray.

Mean surface sea level pressure.

surface_pressure_data_units: str.

The unit corresponding to surface_pressure_data value. Optional values are hPa, Pa, mbar.

specific_humidity_data_units: str.

The unit corresponding to specific_humidity value. Optional values are kg/kg, g/kg and so on.

vertical_dim: str.

Vertical coordinate dimension name.

vertical_dim_units: str.

The unit corresponding to the vertical p-coordinate value. Optional values are hPa, Pa, mbar.

method: {“ncl”, “rust”, “rust-block”}, default: rust-block.

Vertical integration backend.

g: float, default: 9.8.

The acceleration of gravity.

Returns

The water vapor flux. (xarray.Dataset, \(\mathrm{kg \cdot m^-1 \cdot s^-1 }\)).

  • \(qu\): zonal water vapor flux.

  • \(qv\): meridional water vapor flux.

See also

calc_top2surface_integral

easyclimate.core.waterflux.calc_divergence_watervaporflux(specific_humidity_data: xarray.DataArray, qu_data: xarray.DataArray, qv_data: xarray.DataArray, specific_humidity_data_units: Literal['kg/kg', 'g/kg', 'g/g'], cyclic_boundary_setting: Literal['nan', 'cyclic', 'cyclic+diff', 'diff'] = 'nan', method: Literal['ncl', 'rust-batch', 'rust-raw'] = 'rust-batch', lon_dim: str = 'lon', lat_dim: str = 'lat', R: float = 6371220.0) xarray.DataArray

Calculate water vapor flux divergence at each vertical level.

\[\nabla \left( \frac{1}{g} q \mathbf{V} \right) = \frac{1}{g} \nabla \cdot \left( q \mathbf{V} \right)\]

Parameters

specific_humidity_data: xarray.DataArray.

The absolute humidity data.

qu_data: xarray.DataArray.

The zonal horizontal water flux (i.e., \(qu\)).

qv_data: xarray.DataArray.

The meridional horizontal water flux (i.e., \(qv\)).

specific_humidity_data_units: str.

The unit corresponding to specific_humidity value. Optional values are kg/kg, g/kg and so on.

cyclic_boundary_setting: {“nan”, “cyclic”, “cyclic+diff”, “diff”}, default: nan.

A scalar integer equal to the boundary condition option:

  • nan: Boundary points are set to the missing value.

  • cyclic: The u and v arrays are cyclic in longitude. (The arrays should NOT include the cyclic point.) The upper and lower boundaries will be set to missing.

  • cyclic+diff: Boundary points are estimated using one-sided difference schemes normal to the boundary.

  • diff: The u and v arrays are cyclic in longitude. (The arrays should NOT include the cyclic points.) The upper and lower boundaries are estimated using a one-sided difference scheme normal to the boundary.

method: {“ncl”, “rust-batch”, “rust-raw”}, default: rust-batch.

The method to calculate horizontal divergence term. Optional values are ncl, rust-batch, or rust-raw.

lon_dim: str, default: lon.

Longitude coordinate dimension name. By default extracting is applied over the lon dimension.

lat_dim: str, default: lat.

Latitude coordinate dimension name. By default extracting is applied over the lat dimension.

R: float, default: 6.37122e6.

Radius of the Earth.

Note

The parameter is applicable only when method = "rust-batch" or method = "rust-raw".

Returns

xarray.DataArray

The water vapor flux divergence (i.e., \(q\mathbf{V}\)).

easyclimate.core.waterflux.calc_divergence_watervaporflux_top2surface_integral(specific_humidity_data: xarray.DataArray, u_data: xarray.DataArray, v_data: xarray.DataArray, surface_pressure_data: xarray.DataArray, vertical_dim: str, specific_humidity_data_units: Literal['kg/kg', 'g/kg', 'g/g'], surface_pressure_data_units: Literal['hPa', 'Pa', 'mbar'], vertical_dim_units: Literal['hPa', 'Pa', 'mbar'], cyclic_boundary_setting: Literal['nan', 'cyclic', 'cyclic+diff', 'diff'] = 'nan', lon_dim: str = 'lon', lat_dim: str = 'lat', integral_method: Literal['ncl', 'rust', 'rust-block'] = 'rust-block', div_method: Literal['raw', 'ncl', 'rust-batch', 'rust-raw'] = 'rust-batch', g: float = 9.8, R: float = 6371220.0) xarray.DataArray

Calculate water vapor flux divergence across the vertical level.

\[\nabla \cdot \frac{1}{g} \int_0^{p_s} (q\mathbf{v}),dp\]

Parameters

specific_humidity_data: xarray.DataArray.

The absolute humidity data.

u_data: xarray.DataArray.

The zonal wind data.

v_data: xarray.DataArray.

The meridional wind data.

surface_pressure_data: xarray.DataArray.

Mean surface sea level pressure.

vertical_dim: str.

Vertical coordinate dimension name.

specific_humidity_data_units: str.

The unit corresponding to specific_humidity value. Optional values are kg/kg, g/kg and so on.

surface_pressure_data_units: str.

The unit corresponding to surface_pressure_data value. Optional values are hPa, Pa, mbar.

vertical_dim_units: str.

The unit corresponding to the vertical p-coordinate value. Optional values are hPa, Pa, mbar.

cyclic_boundary_setting: {“nan”, “cyclic”, “cyclic+diff”, “diff”}, default: nan.

A scalar integer equal to the boundary condition option:

  • nan: Boundary points are set to the missing value.

  • cyclic: The u and v arrays are cyclic in longitude. (The arrays should NOT include the cyclic point.) The upper and lower boundaries will be set to missing.

  • cyclic+diff: Boundary points are estimated using one-sided difference schemes normal to the boundary.

  • diff: The u and v arrays are cyclic in longitude. (The arrays should NOT include the cyclic points.) The upper and lower boundaries are estimated using a one-sided difference scheme normal to the boundary.

Note

The parameter is applicable only when div_method = ncl or div_method = rust-batch or div_method = rust-raw.

lon_dim: str, default: lon.

Longitude coordinate dimension name. By default extracting is applied over the lon dimension.

lat_dim: str, default: lat.

Latitude coordinate dimension name. By default extracting is applied over the lat dimension.

integral_method: {“ncl”, “rust”, “rust-block”}, default: rust-block.

The vertical integration backend.

div_method: {“raw”, “ncl”, “rust-batch”, “rust-raw”}, default: rust-batch.

The method to calculate horizontal divergence term. Optional values are ncl, rust-batch, or rust-raw.

g: float, default: 9.8.

The acceleration of gravity.

R: float, default: 6.37122e6.

Radius of the Earth.

Note

The parameter is applicable only when div_method = "rust-batch" or div_method = "rust-raw".

Returns

The water vapor flux divergence. (xarray.DataArray, \(\mathrm{kg \cdot m^-2 \cdot s^-1 }\)).