Common Community Physics Package (CCPP) Scientific Documentation  Version 2.0
GFS Physics Function Module

This module provides API for computing basic thermodynamic physics functions. More...

Detailed Description

Modules

module  funcphys
 This module provides an Application Program Interface (API) for computing basic thermodynamic physics functions, in particular:

  1. saturation vapor pressure as a function of temperature;
  2. dewpoint temperature as a function of vapor pressure;
  3. equivalent potential temperature as a function of temperature and scaled pressure to the kappa power;
  4. temperature and specific humidity along a moist adiabat as functions of equivalent potential temperature and scaled pressure to the kappa power;
  5. scaled pressure to the kappa power as a function of pressure, and
  6. temperature at the lifting condensation level as a function of temperature and dewpoint depression.

 

Functions/Subroutines

subroutine, public funcphys::gpvsl
 This subroutine computes saturation vapor pressure table as a function of temperature for the table lookup function fpval. Exact saturation vapor pressures are calculated in subprogram fpvslx(). The current implementation computes a table with a length of 7501 for temperature ranging from 180. to. More...
 
elemental real(krealfp) function, public funcphys::fpvsl (t)
 This funtion computes saturation vapor pressure from the temperature. A linear interpolation is done between values in a lookup table computed in gpvsl(). See documentation for fpvslx() for details. Input values outside table range are reset to table extrema. More...
 
elemental real(krealfp) function, public funcphys::fpvslq (t)
 This function computes saturation vapor pressure from the temperature. A quadratic interpolation is done between values in a lookup table computed in gpvsl(). See documentaion for fpvslx() for details. Input values outside table range are reset to table extrema. More...
 
elemental real(krealfp) function, public funcphys::fpvslx (t)
 This function exactly computes saturation vapor pressure from temperature. The water model assumes a perfect gas, constant specific heats for gas and liquid, and neglects the volume of the liquid. The model does account for the variation of the latent heat of condensation with temperature. The ice option is not included. The Clausius-Clapeyron equation is integrated from the triple point to get the formula:
pvsl=con_psat*(tr**xa)*exp(xb*(1.-tr))
where tr is ttp/t and other values are physical constants. This function should be expanded inline in the calling routine. More...
 
subroutine, public funcphys::gpvsi
 This subroutine computes saturation vapor pressure table as a function of temperature for the table lookup function fpvsi(). Exact saturation vapor pressures are calculated in subprogram fpvsix(). The current implementation computes a table with a length of 7501 for temperatures ranging from 180. to 330. Kelvin. More...
 
elemental real(krealfp) function, public funcphys::fpvsi (t)
 This function computes saturation vapor pressure from the temperature. A linear interpolation is done between values in a lookup table computed in gpvsi(). See documentation for fpvsix() for details. Input values outside table range are reset to table extrema. More...
 
elemental real(krealfp) function, public funcphys::fpvsiq (t)
 This function computes saturation vapor pressure from the temperature. A quadratic interpolation is done between values in a lookup table computed in gpvsi(). See documentation for fpvsix() for details. Input values outside table range are reset to table extrema. More...
 
elemental real(krealfp) function, public funcphys::fpvsix (t)
 This funtion exactly computes saturation vapor pressure from temperature. The water model assumes a perfect gas, constant specific heats for gas and ice, and neglects the volume of the ice. The model does account for the variation of the latent heat of condensation with temperature. The liquid option is not included. The Clausius- Clapeyron equation is integrated from the triple point to get the formula:
pvsi=con_psat*(tr**xa)*exp(xb*(1.-tr))
where tr is ttp/t and other values are physical constants. This function should be expanded inline in the calling routine. More...
 
subroutine, public funcphys::gpvs
 This subroutine computes saturation vapor pressure table as a function of temperature for the table lookup function fpvs(). Exact saturation vapor pressures are calculated in subprogram fpvsx(). The current implementation computes a table with a length of 7501 for temperatures ranging from 180. to 330. Kelvin. More...
 
elemental real(krealfp) function, public funcphys::fpvs (t)
 This function computes saturation vapor pressure from the temperature. A linear interpolation is done between values in a lookup table computed in gpvs(). See documentation for fpvsx() for details. Input values outside table range are reset to table extrema. More...
 
elemental real(krealfp) function, public funcphys::fpvsq (t)
 This function computes saturation vapor pressure from the temperature. A quadratic interpolation is done between values in a lookup table computed in gpvs(). See documentation for fpvsx() for details. Input values outside table range are reset to table extrema. More...
 
elemental real(krealfp) function, public funcphys::fpvsx (t)
 This function exactly computes saturation vapor pressure from temperature. The saturation vapor pressure over either liquid and ice is computed over liquid for temperatures above the triple point, over ice for temperatures 20 degress below the triple point, and a linear combination of the two for temperatures in between. The water model assumes a perfect gas, constant specific heats for gas, liquid and ice, and neglects the volume of the condensate. The model does account for the variation of the latent heat of condensation and sublimation with temperature. The Clausius-Clapeyron equation is integrated from the triple point to get the formula:
pvsl=con_psat*(tr**xa)*exp(xb*(1.-tr))
where tr is ttp/t and other values are physical constants. The reference for this computation is Emanuel(1994), pages 116-117. This function should be expanded inline in the calling routine. More...
 
subroutine, public funcphys::gtdpl
 This subroutine computes dewpoint temperature table as a function of vapor pressure for inlinable function ftdpl(). Exact dewpoint temperatures are calculated in subprogram ftdplxg(). The current implementation computes a table with a length of 5001 for vapor pressures ranging from 1 to 10001 Pascals giving a dewpoint temperature range of 208 to 319 Kelvin. More...
 
elemental real(krealfp) function, public funcphys::ftdpl (pv)
 This function Compute dewpoint temperature from vapor pressure. A linear interpolation is done between values in a lookup table computed in gtdpl(). See documentation for ftdplxg() for details. Input values outside table range are reset to table extrema. More...
 
elemental real(krealfp) function, public funcphys::ftdplq (pv)
 This function computes dewpoint temperature from vapor pressure. A quadratic interpolation is done between values in a lookup table computed in gtdpl(). See documentation for ftdplxg() for details. Input values outside table range are reset to table extrema. More...
 
elemental real(krealfp) function, public funcphys::ftdplx (pv)
 This function exactly compute dewpoint temperature from vapor pressure. An approximate dewpoint temperature for function ftdplxg() is obtained using ftdpl() so gtdpl() must be already called. See documentation for ftdplxg() for details. More...
 
elemental real(krealfp) function, public funcphys::ftdplxg (tg, pv)
 This function exactly computes dewpoint temperature from vapor pressure. A guess dewpoint temperature must be provided. The water model assumes a perfect gas, constant specific heats for gas and liquid, and neglects the volume of the liquid. The model does account for the variation of the latent heat of condensation with temperature. The ice option is not included. The Clausius-Clapeyron equation is integrated from the triple point to get the formula:
pvs=con_psat*(tr**xa)*exp(xb*(1.-tr))
where tr is ttp/t and other values are physical constants.
The formula is inverted by iterating Newtonian approximations for each pvs until t is found to within 1.e-6 Kelvin. This function can be expanded inline in the calling routine. More...
 
subroutine, public funcphys::gtdpi
 This subroutine computes dewpoint temperature table as a function of vapor pressure for inlinable function ftdpi(). Exact dewpoint temperatures are calculated in subprogram ftdpixg(). The current implementation computes a table with a length of 5001 for vapor pressures ranging from 0.1 to 1000.1 Pascals giving a dewpoint temperature range of 197 to 279 Kelvin. More...
 
elemental real(krealfp) function, public funcphys::ftdpi (pv)
 This subroutine computes dewpoint temperature from vapor pressure. A linear interpolation is done between values in a lookup table computed in gtdpi(). See documentation for ftdpixg for details. Input values outside table range are reset to table extrema. More...
 
elemental real(krealfp) function, public funcphys::ftdpiq (pv)
 This function computes dewpoint temperature from vapor pressure. A quadratic interpolation is done between values in a lookup table computed in gtdpi(). see documentation for ftdpixg() for details. Input values outside table range are reset to table extrema. More...
 
elemental real(krealfp) function, public funcphys::ftdpix (pv)
 This function exactly computes dewpoint temperature from vapor pressure. An approximate dewpoint temperature for function ftdpixg() is obtained using ftdpi() so gtdpi() must be already called. See documentation for ftdpixg() for details. More...
 
elemental real(krealfp) function, public funcphys::ftdpixg (tg, pv)
 This function exactly computes dewpoint temperature from vapor pressure. A guess dewpoint temperature must be provided. The water model assumes a perfect gas, constant specific heats for gas and ice, and neglects the volume of the ice. The model does account for the variation of the latent heat of sublimation with temperature. The liquid option is not included. The Clausius-Clapeyron equation is integrated from the triple point to get the formula:
pvs=con_psat*(tr**xa)*exp(xb*(1.-tr))
where tr is ttp/t and other values are physical constants. The formula is inverted by iterating Newtonian approximations for each pvs until t is found to within 1.e-6 Kelvin. This function can be expanded inline in the calling routine. More...
 
subroutine, public funcphys::gtdp
 This subroutine computes dewpoint temperature table as a function of vapor pressure for inlinable function ftdp(). Exact dewpoint temperatures are calculated in subprogram ftdpxg(). The current implementation computes a table with a length of 5001 for vapor pressures ranging from 0.5 to 1000.5 Pascals giving a dewpoint temperature range of 208 to 319 Kelvin. More...
 
elemental real(krealfp) function, public funcphys::ftdp (pv)
 This function computes dewpoint temperature from vapor pressure. A linear interpolation is done between values in a lookup table computed in gtdp(). See documentation for ftdpxg() for details. Input values outside table range are reset to table extrema. More...
 
elemental real(krealfp) function, public funcphys::ftdpq (pv)
 This function computes dewpoint temperature from vapor pressure. A quadratic interpolation is done between values in a lookup table computed in gtdp(). See documentation for ftdpxg() for details. Input values outside table range are reset to table extrema. More...
 
elemental real(krealfp) function, public funcphys::ftdpx (pv)
 This function exactly computes dewpoint temperature from vapor pressure. An approximate dewpoint temperature for function ftdpxg() is obtained using ftdp() so gtdp() must be already called. See documentation for ftdpxg() for details. More...
 
elemental real(krealfp) function, public funcphys::ftdpxg (tg, pv)
 This function exactly computes dewpoint temperature from vapor pressure. A guess dewpoint temperature must be provided. The saturation vapor pressure over either liquid and ice is computed over liquid for temperatures above the triple point, over ice for temperatures 20 degress below the triple point, and a linear combination of the two for temperatures in between. The water model assumes a perfect gas, constant specific heats for gas, liquid and ice, and neglects the volume of the condensate. The model does account for the variation of the latent heat of condensation and sublimation with temperature. The Clausius-Clapeyron equation is integrated from the triple point to get the formula:
pvsl=con_psat*(tr**xa)*exp(xb*(1.-tr))
where tr is ttp/t and other values are physical constants.
The reference for this decision is Emanuel(1994), pages 116-117. The formula is inverted by iterating Newtonian approximations for each pvs until t is found to within 1.e-6 Kelvin. This function can be expanded inline in the calling routine. More...
 
subroutine, public funcphys::gthe
 This subroutine computes equivalent potential temperature table as a function of LCL temperature and pressure over 1e5 Pa to the kappa power for function fthe(). Equivalent potential temperatures are calculated in subprogram fthex() the current implementation computes a table with a first dimension of 241 for temperatures ranging from 183.16 to 303.16 Kelvin and a second dimension of 151 for pressure over 1e5 Pa to the kappa power ranging from \(0.04^{rocp}\) to \(1.10^{rocp}\). More...
 
elemental real(krealfp) function, public funcphys::fthe (t, pk)
 This function computes equivalent potential temperature at the LCL from temperature and pressure over 1e5 Pa to the kappa power. A bilinear interpolation is done between values in a lookup table computed in gthe(). see documentation for fthex() for details. Input values outside table range are reset to table extrema, except zero is returned for too cold or high LCLs. More...
 
elemental real(krealfp) function, public funcphys::ftheq (t, pk)
 This function computes equivalent potential temperature at the LCL from temperature and pressure over 1e5 Pa to the kappa power. A biquadratic interpolation is done between values in a lookup table computed in gthe(). see documentation for fthex() for details. Input values outside table range are reset to table extrema, except zero is returned for too cold or high LCLs. More...
 
real(krealfp) function, public funcphys::fthex (t, pk)
 This function exactly computes equivalent potential temperature at the LCL from temperature and pressure over 1e5 Pa to the kappa power. Equivalent potential temperature is constant for a saturated parcel rising adiabatically up a moist adiabat when the heat and mass of the condensed water are neglected. Ice is also neglected. The formula for equivalent potential temperature (Holton) is
the=t*(pd**(-rocp))*exp(el*eps*pv/(cp*t*pd))
where t is the temperature, pv is the saturated vapor pressure, pd is the dry pressure p-pv, el is the temperature dependent latent heat of condensation hvap+dldt*(t-ttp), and other values are physical constants defined in parameter statements in the code. Zero is returned if the input values make saturation impossible. This function should be expanded inline in the calling routine. More...
 
subroutine, public funcphys::gtma
 This subroutine computes temperature and specific humidity tables as a function of equivalent potential temperature and pressure over 1e5 Pa to the kappa power for subprogram stma(). Exact parcel temperatures are calculated in subprogram stmaxg(). The current implementation computes a table with a first dimension of 151 for equivalent potential temperatures ranging from 200 to 500 Kelvin and a second dimension of 121 for pressure over 1e5 Pa to the kappa power ranging from \(0.01^{rocp}\) to \(1.10^{rocp}\). More...
 
elemental subroutine, public funcphys::stma (the, pk, tma, qma)
 This subroutine computes temperature and specific humidity of a parcel lifted up a moist adiabat from equivalent potential temperature at the LCL and pressure over 1e5 Pa to the kappa power. Bilinear interpolations are done between values in a lookup table computed in gtma(). See documentation for stmaxg() for details. Input values outside table range are reset to table extrema. More...
 
elemental subroutine, public funcphys::stmaq (the, pk, tma, qma)
 This subroutine computes temperature and specific humidity of a parcel lifted up a moist adiabat from equivalent potential temperature at the LCL and pressure over 1e5 Pa to the kappa power. Biquadratic interpolations are done between values in a lookup table computed in gtma(). See documentation for stmaxg() for details. Input values outside table range are reset to table extrema. More...
 
elemental subroutine, public funcphys::stmax (the, pk, tma, qma)
 This subroutine exactly computes temperature and humidity of a parcel lifted up a moist adiabat from equivalent potential temperature at the LCL and pressure over 1e5 Pa to the kappa power. An approximate parcel temperature for subprogram stmaxg() is obtained using stma() so gtma() must be already called. See documentation for stmaxg() for details. More...
 
elemental subroutine, public funcphys::stmaxg (tg, the, pk, tma, qma)
 This subroutine exactly computes temperature and humidity of a parcel lifted up a moist adiabat from equivalent potential temperature at the LCL and pressure over 1e5 Pa to the kappa power. A guess parcel temperature must be provided. Equivalent potential temperature is constant for a saturated parcel rising adiabatically up a moist adiabat when the heat and mass of the condensed water are neglected. Ice is also neglected. The formula for equivalent potential temperature (Holton) is
the=t*(pd**(-rocp))*exp(el*eps*pv/(cp*t*pd))
where t is the temperature, pv is the saturated vapor pressure, pd is the dry pressure p-pv, el is the temperature dependent latent heat of condensation hvap+dldt*(t-ttp), and other values are physical constants defined in parameter statements in the code. The formula is inverted by iterating Newtonian approximations for each the and p until t is found to within 1.e-4 Kelvin. The specific humidity is then computed from pv and pd. This subprogram can be expanded inline in the calling routine. More...
 
subroutine, public funcphys::gpkap
 This subroutine computes pressure to the kappa table as a function of pressure for the table lookup function fpkap(). Exact pressure to the kappa values are calculated in subprogram fpkapx(). The current implementation computes a table with a length of 5501 for pressures ranging up to 110000 Pascals. More...
 
elemental real(krealfp) function, public funcphys::fpkap (p)
 This subroutine raises pressure over 1e5 Pa to the kappa power. A linear interpolation is done between values in a lookup table computed in gpkap(). See documentation for fpkapx() for details. Input values outside table range are reset to table extrema. More...
 
elemental real(krealfp) function, public funcphys::fpkapq (p)
 This function raises pressure over 1e5 Pa to the kappa power. A quadratic interpolation is done between values in a lookup table computed in gpkap(). see documentation for fpkapx() for details. Input values outside table range are reset to table extrema. More...
 
real(krealfp) function, public funcphys::fpkapo (p)
 This function raises surface pressure over 1e5 Pa to the kappa power using a rational weighted chebyshev approximation. The numerator is of order 2 and the denominator is of order 4. The pressure range is 40000-110000 Pa and kappa is defined in fpkapx(). More...
 
elemental real(krealfp) function, public funcphys::fpkapx (p)
 This function raises pressure over 1e5 Pa to the kappa power. Kappa is equal to rd/cp where rd and cp are physical constants. More...
 
subroutine, public funcphys::grkap
 This subroutine computes pressure to the 1/kappa table as a function of pressure for the table lookup function frkap(). Exact pressure to the 1/kappa values are calculated in subprogram frkapx(). The current implementation computes a table with a length of 5501 for pressures ranging up to 110000 Pascals. More...
 
elemental real(krealfp) function, public funcphys::frkap (pkap)
 This subroutine raises pressure over 1e5 Pa to the 1/kappa power. A linear interpolation is done between values in a lookup table computed in grkap(). See documentation for frkapx() for details. Input values outside table range are reset to table extrema. More...
 
elemental real(krealfp) function, public funcphys::frkapq (pkap)
 This function raises pressure over 1e5 Pa to the 1/kappa power. A quadratic interpolation is done between values in a lookup table computed in grkap(). see documentation for frkapx() for details. Input values outside table range are reset to table extrema. More...
 
elemental real(krealfp) function, public funcphys::frkapx (pkap)
 This function raise pressure over 1e5 Pa to the 1/kappa power. Kappa is equal to rd/cp where rd and cp are physical constants. More...
 
subroutine, public funcphys::gtlcl
 This subroutine computes lifting condensation level temperature table as a function of temperature and dewpoint depression for function ftlcl(). Lifting condensation level temperature is calculated in subprogram ftlclx() The current implementation computes a table with a first dimension of 151 for temperatures ranging from 180.0 to 330.0 Kelvin and a second dimension of 61 for dewpoint depression ranging from 0 to 60 Kelvin. More...
 
elemental real(krealfp) function, public funcphys::ftlcl (t, tdpd)
 This function computes temperature at the lifting condensation level from temperature and dewpoint depression. A bilinear interpolation is done between values in a lookup table computed in gtlcl(). See documentation for ftlclx() for details. Input values outside table range are reset to table extrema. More...
 
elemental real(krealfp) function, public funcphys::ftlclq (t, tdpd)
 This function computes temperature at the lifting condensation level from temperature and dewpoint depression. A biquadratic interpolation is done between values in a lookup table computed in gtlcl(). see documentation for ftlclx() for details. Input values outside table range are reset to table extrema. More...
 
real(krealfp) function, public funcphys::ftlclo (t, tdpd)
 This function computes temperature at the lifting condensation level from temperature and dewpoint depression. the formula used is a polynomial taken from Phillips mstadb routine which empirically approximates the original exact implicit relationship. More...
 
elemental real(krealfp) function, public funcphys::ftlclx (t, tdpd)
 This function computes temperature at the lifting condensation level from temperature and dewpoint depression. A parcel lifted adiabatically becomes saturated at the lifting condensation level. The water model assumes a perfect gas, constant specific heats for gas and liquid, and neglects the volume of the liquid. The model does account for the variation of the latent heat of condensation with temperature. The ice option is not included. The Clausius-Clapeyron equation is integrated from the triple point to get the formulas:
pvlcl=con_psat*(trlcl**xa)*exp(xb*(1.-trlcl))
pvdew=con_psat*(trdew**xa)*exp(xb*(1.-trdew))
where pvlcl is the saturated parcel vapor pressure at the LCL, pvdew is the unsaturated parcel vapor pressure initially, trlcl is ttp/tlcl and trdew is ttp/tdew. The adiabatic lifting of the parcel is represented by the following formula
pvdew=pvlcl*(t/tlcl)**(1/kappa)
This formula is inverted by iterating Newtonian approximations until tlcl is found to within 1.e-6 Kelvin. Note that the minimum returned temperature is 180 Kelvin. More...
 
subroutine, public funcphys::gfuncphys
 This subroutine computes all physics function tables. Lookup tables are set up for computing saturation vapor pressure, dewpoint temperature, equivalent potential temperature, moist adiabatic temperature and humidity, pressure to the kappa, and lifting condensation level temperature. More...
 

Variables

real(krealfp), parameter funcphys::psatb =con_psat*1.e-5
 
integer, parameter funcphys::nxpvsl =7501
 
real(krealfp) funcphys::c1xpvsl
 
real(krealfp) funcphys::c2xpvsl
 
real(krealfp), dimension(nxpvsl) funcphys::tbpvsl
 
integer, parameter funcphys::nxpvsi =7501
 
real(krealfp) funcphys::c1xpvsi
 
real(krealfp) funcphys::c2xpvsi
 
real(krealfp), dimension(nxpvsi) funcphys::tbpvsi
 
integer, parameter funcphys::nxpvs =7501
 
real(krealfp) funcphys::c1xpvs
 
real(krealfp) funcphys::c2xpvs
 
real(krealfp), dimension(nxpvs) funcphys::tbpvs
 
integer, parameter funcphys::nxtdpl =5001
 
real(krealfp) funcphys::c1xtdpl
 
real(krealfp) funcphys::c2xtdpl
 
real(krealfp), dimension(nxtdpl) funcphys::tbtdpl
 
integer, parameter funcphys::nxtdpi =5001
 
real(krealfp) funcphys::c1xtdpi
 
real(krealfp) funcphys::c2xtdpi
 
real(krealfp), dimension(nxtdpi) funcphys::tbtdpi
 
integer, parameter funcphys::nxtdp =5001
 
real(krealfp) funcphys::c1xtdp
 
real(krealfp) funcphys::c2xtdp
 
real(krealfp), dimension(nxtdp) funcphys::tbtdp
 
integer, parameter funcphys::nxthe =241
 
integer, parameter funcphys::nythe =151
 
real(krealfp) funcphys::c1xthe
 
real(krealfp) funcphys::c2xthe
 
real(krealfp) funcphys::c1ythe
 
real(krealfp) funcphys::c2ythe
 
real(krealfp), dimension(nxthe, nythe) funcphys::tbthe
 
integer, parameter funcphys::nxma =151
 
integer, parameter funcphys::nyma =121
 
real(krealfp) funcphys::c1xma
 
real(krealfp) funcphys::c2xma
 
real(krealfp) funcphys::c1yma
 
real(krealfp) funcphys::c2yma
 
real(krealfp), dimension(nxma, nyma) funcphys::tbtma
 
real(krealfp), dimension(nxma, nyma) funcphys::tbqma
 
integer, parameter funcphys::nxpkap =11001
 
real(krealfp) funcphys::c1xpkap
 
real(krealfp) funcphys::c2xpkap
 
real(krealfp), dimension(nxpkap) funcphys::tbpkap
 
integer, parameter funcphys::nxrkap =5501
 
real(krealfp) funcphys::c1xrkap
 
real(krealfp) funcphys::c2xrkap
 
real(krealfp), dimension(nxrkap) funcphys::tbrkap
 
integer, parameter funcphys::nxtlcl =151
 
integer, parameter funcphys::nytlcl =61
 
real(krealfp) funcphys::c1xtlcl
 
real(krealfp) funcphys::c2xtlcl
 
real(krealfp) funcphys::c1ytlcl
 
real(krealfp) funcphys::c2ytlcl
 
real(krealfp), dimension(nxtlcl, nytlcl) funcphys::tbtlcl