|
MI - Fimex
|
#include "fimex/mifi_constants.h"Go to the source code of this file.
Functions | |
| int | mifi_atmosphere_ln_pressure (size_t n, double p0, const double *lev, double *pressure) |
| int | mifi_atmosphere_sigma_pressure (size_t n, double ptop, double ps, const double *level, double *pressure) |
| int | mifi_atmosphere_pressure_sigma (size_t n, double ptop, double ps, const double *pressure, double *level) |
| int | mifi_atmosphere_hybrid_sigma_pressure (size_t n, double p0, double ps, const double *a, const double *b, double *pressure) |
| int | mifi_atmosphere_hybrid_sigma_ap_pressure (size_t n, double ps, const double *ap, const double *b, double *pressure) |
| int | mifi_barometric_pressure (size_t n, double P_b, const double *h, double T_b, double *pressure) |
| int | mifi_barometric_standard_pressure (size_t n, const double *h, double *pressure) |
| int | mifi_barometric_height (size_t n, double P_b, const double *p, double T_b, double *height) |
| int | mifi_barometric_standard_altitude (size_t n, const double *p, double *altitude) |
| float | mifi_virtual_temperature (float spec_humidity, float t) |
| float | mifi_relative_to_specific_humidity (float rh, float t, float p) |
| float | mifi_specific_to_relative_humidity (float sh, float t, float p) |
| float | mifi_dewpoint_to_relative_humidity (float dew, float t) |
| float | mifi_barometric_layer_thickness (float p_low_alti, float p_high_alti, float T) |
| int | mifi_ocean_s_g1_z (size_t n, double h, double h_c, double zeta, const double *s, const double *C, double *z) |
| int | mifi_ocean_s_g2_z (size_t n, double h, double h_c, double zeta, const double *s, const double *C, double *z) |
| int | mifi_omega_to_vertical_wind (size_t n, const double *omega, const double *p, const double *t, double *w) |
| int | mifi_vertical_wind_to_omega (size_t n, const double *w, const double *p, const double *t, double *omega) |
| int mifi_atmosphere_hybrid_sigma_ap_pressure | ( | size_t | n, |
| double | ps, | ||
| const double * | ap, | ||
| const double * | b, | ||
| double * | pressure | ||
| ) |
convert a standard_name="atmosphere_hybrid_sigma_pressure_coordinate" to pressure using the formula p(k) = ap(k) + b(k)*ps
This is the same as mifi_atmosphere_hybrid_sigma_pressure(), but with the reference pressure and a joined already. Choice depends on the model, i.e. available input values.
| n | size of arrays ap, b and pressure |
| ps | surface pressure - usually varying in time,x,y |
| ap | pressure level values |
| b | dimensionless level values |
| pressure | output values in the same unit as p0 and ps and at the same place as ps |
| int mifi_atmosphere_hybrid_sigma_pressure | ( | size_t | n, |
| double | p0, | ||
| double | ps, | ||
| const double * | a, | ||
| const double * | b, | ||
| double * | pressure | ||
| ) |
convert a standard_name="atmosphere_hybrid_sigma_pressure_coordinate" to pressure using the formula p(k) = a(k)*p0 + b(k)*ps
| n | size of arrays a, b and pressure |
| p0 | reference pressure |
| ps | surface pressure - usually varying in time,x,y |
| a | dimensionless level values |
| b | dimensionless level values |
| pressure | output values in the same unit as p0 and ps and at the same place as ps |
| int mifi_atmosphere_ln_pressure | ( | size_t | n, |
| double | p0, | ||
| const double * | lev, | ||
| double * | pressure | ||
| ) |
convert a standard_name="atmosphere_ln_pressure_coordinate" to pressure using the formula p(k) = p0 * exp(-lev(k))
| n | size of arrays lev and pressure |
| p0 | base pressure |
| lev | level values |
| pressure | output values in the same unit as p0 |
| int mifi_atmosphere_pressure_sigma | ( | size_t | n, |
| double | ptop, | ||
| double | ps, | ||
| const double * | pressure, | ||
| double * | level | ||
| ) |
convert a pressure to standard_name="atmosphere_sigma_coordinate" using the formula p(k) = ptop + sigma(k)*(ps-ptop) -> sigma(k) = (p(k) - ptop)/(ps-ptop)
| n | size of arrays sigma and pressure |
| ptop | pressure on model top layer (constant for a model) |
| ps | surface pressure - usually varying in time,x,y |
| pressure | pressure level values in the same unit as ptop and ps |
| level | sigma output values at the same place as ps |
| int mifi_atmosphere_sigma_pressure | ( | size_t | n, |
| double | ptop, | ||
| double | ps, | ||
| const double * | level, | ||
| double * | pressure | ||
| ) |
convert a standard_name="atmosphere_sigma_coordinate" to pressure using the formula p(k) = ptop + sigma(k)*(ps-ptop)
| n | size of arrays sigma and pressure |
| ptop | pressure on model top layer (constant for a model) |
| ps | surface pressure - usually varying in time,x,y |
| level | sigma level values |
| pressure | output values in the same unit as ptop and ps and at the same place as ps |
| int mifi_barometric_height | ( | size_t | n, |
| double | P_b, | ||
| const double * | p, | ||
| double | T_b, | ||
| double * | height | ||
| ) |
convert pressure to height using the inverse formula http://en.wikipedia.org/wiki/Barometric_formula
h(k) = -R*T_b/g*M * log(p(k)/P_b);
with P_b and T_b pressure and temperature at the layer b (i.e. surface)
g = 9.80665 m/s2 M = Molar mass of Earth's air (0.0289644 kg/mol) R = Universal gas constant (8.31432 N·m /(mol·K) )
| n | size of array h and pressure |
| P_b | pressure at base-layer (i.e. surface, or means-sea-level) - usually varying in time,x,y |
| p | pressure at level |
| T_b | temperature at base layer in K - usually varying in time,x,y |
| height | output values, height above base_layer in m |
| float mifi_barometric_layer_thickness | ( | float | p_low_alti, |
| float | p_high_alti, | ||
| float | T | ||
| ) |
convert pressure difference to layer thickness using the hyspometric equation http://en.wikipedia.org/wiki/Hypsometric_equation
| p_low_alti | pressure at lower altitude in hPa |
| p_high_alti | pressure at higher altitude in hPa |
| T | temperature in K |
| int mifi_barometric_pressure | ( | size_t | n, |
| double | P_b, | ||
| const double * | h, | ||
| double | T_b, | ||
| double * | pressure | ||
| ) |
convert height above base-layer (usually altitude, i.e. height above MSL) to pressure using the formula http://en.wikipedia.org/wiki/Barometric_formula
P(h) = P_b exp[ -gM/R * h/T_b ]
with P_b and T_b pressure and temperature at the layer b (i.e. surface) and h_b the height above the layer b
g = 9.80665 m/s2 M = Molar mass of Earth's air (0.0289644 kg/mol) R = Universal gas constant (8.31432 N·m /(mol·K) )
| n | size of array h and pressure |
| P_b | pressure at base-layer (e.g. means-sea-level) - usually varying in time,x,y |
| h | height in m above base-layer |
| T_b | temperature at base layer in K - usually varying in time,x,y |
| pressure | output values in the same unit as p_b and at the same place as ps |
| int mifi_barometric_standard_altitude | ( | size_t | n, |
| const double * | p, | ||
| double * | altitude | ||
| ) |
convert pressure to height using the formula http://en.wikipedia.org/wiki/Barometric_formula and using the international standard atmosphere http://en.wikimedia.org/wiki/International_Standard_Atmosphere
| altitude | output values, i.e. height above mean sea level in m |
| int mifi_barometric_standard_pressure | ( | size_t | n, |
| const double * | h, | ||
| double * | pressure | ||
| ) |
convert altitude to pressure using the formula http://en.wikipedia.org/wiki/Barometric_formula and using the international standard atmosphere http://en.wikipedia.org/wiki/International_Standard_Atmosphere
| float mifi_dewpoint_to_relative_humidity | ( | float | dew, |
| float | t | ||
| ) |
Calculate relative humidity from dewpoint temperature and temperature. Derived from Bolton, 1980: http://www.eol.ucar.edu/projects/ceop/dm/documents/refdata_report/eqns.html
| dew | dewpoint temperature in K |
| t | temperature in K |
| int mifi_ocean_s_g1_z | ( | size_t | n, |
| double | h, | ||
| double | h_c, | ||
| double | zeta, | ||
| const double * | s, | ||
| const double * | C, | ||
| double * | z | ||
| ) |
convert a standard_name="ocean_s_coordinate_g1" to z using the formula z(k) = h_c*sigma(k) + C(k)*(h - h_c) + zeta*(1+(h_c*sigma(k)+C(k)*(h-h_c)/h))
| n | size of arrays s and C pressure |
| h | unperturbed water column thickness - varying in x,y (might be varying in time for sediment applications) |
| h_c | critical depth, usually min(h(x,y)) |
| zeta | time-varying free surface - varying in time,x,y |
| s | s(k) dimensionless s coordinate |
| C | zeta(k) streching function |
| z | output values in the same unit as h and h_c and at the same place as h |
| int mifi_ocean_s_g2_z | ( | size_t | n, |
| double | h, | ||
| double | h_c, | ||
| double | zeta, | ||
| const double * | s, | ||
| const double * | C, | ||
| double * | z | ||
| ) |
convert a standard_name="ocean_s_coordinate_g1" to z using the formula z(k) = zeta + (zeta +h)*(h_c*sigma + h*C(k))/(h_c+h)
| n | size of arrays s and C pressure |
| h | unperturbed water column thickness - varying in x,y (might be varying in time for sediment applications) |
| h_c | critical depth, usually min(h(x,y)) |
| zeta | time-varying free surface - varying in time,x,y |
| s | s(k) dimensionless s coordinate |
| C | zeta(k) streching function |
| z | output values in the same unit as h and h_c and at the same place as h |
| int mifi_omega_to_vertical_wind | ( | size_t | n, |
| const double * | omega, | ||
| const double * | p, | ||
| const double * | t, | ||
| double * | w | ||
| ) |
convert the vertical pressure change omega to vertical wind-speed using omega = - rho * g * w
| n | size of the array omega, p, t, w |
| omega | vertical flow in Pa/s |
| p | pressure in Pa |
| t | temperature in K |
| w | output-array for vertical wind speed in m/s |
| float mifi_relative_to_specific_humidity | ( | float | rh, |
| float | t, | ||
| float | p | ||
| ) |
Calculate specific humidity from relative humidity and temperature. Derived from HIRLAM version 2.6.0, by G. Cats
| rh | relative humidity in % |
| temperature | in K |
| p | pressure in hPa |
| float mifi_specific_to_relative_humidity | ( | float | sh, |
| float | t, | ||
| float | p | ||
| ) |
Calculate specific humidity from relative humidity and temperature. Derived from HIRLAM version 2.6.0, by G. Cats
| sh | specific humidity in kg/kg |
| temperature | in K |
| p | pressure in hPa |
| int mifi_vertical_wind_to_omega | ( | size_t | n, |
| const double * | w, | ||
| const double * | p, | ||
| const double * | t, | ||
| double * | omega | ||
| ) |
convert the vertical wind-speed in m/s to vertical pressure change omega using omega = - rho * g * w
| n | size of the array omega, p, t, w |
| w | vertical wind speed in m/s |
| p | pressure in Pa |
| t | temperature in K |
| omega | output-array of vertical flow in Pa/s |
| float mifi_virtual_temperature | ( | float | spec_humidity, |
| float | t | ||
| ) |
calculate virtual temperature from specific humidity and temperature
| spec_humidity | specific humidity in kg/kg |
| temperature | in K |
1.8.11