UFO
ufo_utils_mod Module Reference

Fortran module with various useful routines. More...

Functions/Subroutines

subroutine, public ops_qsat (QS, T, P, npnts)
 Calculate the Saturation Specific Humidity Scheme (Qsat): Vapour to Liquid/Ice. More...
 
subroutine, public ops_qsatwat (QS, T, P, npnts)
 Saturation Specific Humidity Scheme: Vapour to Liquid. More...
 
subroutine, public ops_satrad_qsplit (output_type, p, t, qtotal, q, ql, qi, UseQtSplitRain)
 Split the humidity into water vapour, liquid water and ice. More...
 
subroutine, public ops_cholesky (U, V, N, Q, ErrorCode)
 Do cholesky decomposition. More...
 
integer function, public ufo_utils_iogetfreeunit ()
 Find a free file unit. More...
 
subroutine, public invertmatrix (n, m, a, status, matrix)
 
logical function, public cmp_strings (str1, str2)
 
logical function cmp_ordered_strings (shorter_str, longer_str)
 

Detailed Description

Fortran module with various useful routines.

Function/Subroutine Documentation

◆ cmp_ordered_strings()

logical function ufo_utils_mod::cmp_ordered_strings ( character(len=*)  shorter_str,
character(len=*)  longer_str 
)
private

Definition at line 1378 of file ufo_utils_mod.F90.

Here is the caller graph for this function:

◆ cmp_strings()

logical function, public ufo_utils_mod::cmp_strings ( character(len=*)  str1,
character(len=*)  str2 
)

Definition at line 1349 of file ufo_utils_mod.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ invertmatrix()

subroutine, public ufo_utils_mod::invertmatrix ( integer, intent(in)  n,
integer, intent(in)  m,
real(kind=kind_real), dimension(n,n), intent(inout)  a,
integer, intent(out)  status,
real(kind=kind_real), dimension(n,m), intent(inout), optional  matrix 
)
Parameters
[in]norder of a
[in]morder of optional matrix, if required
[in,out]asquare mx, overwritten by its inverse
[out]status0 if all ok 1 if matrix is not positive definite
[in,out]matrixreplaced by (matrix).a^-1 on exit

Definition at line 1233 of file ufo_utils_mod.F90.

Here is the caller graph for this function:

◆ ops_cholesky()

subroutine, public ufo_utils_mod::ops_cholesky ( real(kind_real), dimension(n,n), intent(in)  U,
real(kind_real), dimension(n), intent(in)  V,
integer, intent(in)  N,
real(kind_real), dimension(n), intent(out)  Q,
integer, intent(out)  ErrorCode 
)

Do cholesky decomposition.

Heritage: Ops_Cholesky.inc

Solves the Linear equation UQ=V for Q where U is a symmetric positive definite matrix and U and Q are vectors of length N. The method follows that in Golub and Van Loan although this is pretty standard.

if U is not positive definite this will be detected by the program and flagged as an error. U is assumed to be symmetric as only the upper triangle is in fact used.

Author
Met Office
Date
09/06/2020: Created

Definition at line 1105 of file ufo_utils_mod.F90.

Here is the caller graph for this function:

◆ ops_qsat()

subroutine, public ufo_utils_mod::ops_qsat ( real(kind=kind_real), dimension(npnts), intent(inout)  QS,
real(kind=kind_real), dimension(npnts), intent(in)  T,
real(kind=kind_real), dimension(npnts), intent(in)  P,
integer, intent(in)  npnts 
)

Calculate the Saturation Specific Humidity Scheme (Qsat): Vapour to Liquid/Ice.

Heritage: Ops_Qsat.inc

Returns a saturation mixing ratio given a temperature and pressure using saturation vapour pressures caluclated using the Goff-Gratch formulae, adopted by the WMO as taken from Landolt-Bornstein, 1987 Numerical data and Functional relationships in Science and Technology. Group V/Vol 4B Meteorology. Physical and Chemical properties of Air, P35.

Value in the lookup table are over water above 0 degrees C and over ice below this temperatures.

Method:
uses lookup tables to find eSAT, calculates qSAT directly from that.

Author
Met Office
Date
09/06/2020: Created
Parameters
[in]npntsPoints being processed by qSAT scheme.
[in]tTemperature (K)
[in]pPressure (Pa).
[in,out]qsSaturation mixing ratio (KG/KG)

Definition at line 53 of file ufo_utils_mod.F90.

Here is the caller graph for this function:

◆ ops_qsatwat()

subroutine, public ufo_utils_mod::ops_qsatwat ( real(kind=kind_real), dimension(npnts)  QS,
real(kind=kind_real), dimension(npnts)  T,
real(kind=kind_real), dimension(npnts)  P,
integer  npnts 
)

Saturation Specific Humidity Scheme: Vapour to Liquid.

Heritage: Ops_QsatWat.inc

Returns a saturation mixing ratio given a temperature and pressure using saturation vapour pressure calculated using the Goff-Gratch Formulaie, adopted by the WMO as taken from Landolt-Bornstein, 1987 Numerical Data and Functional Relationships in Science and Technology. Group V/Vol 4B Meteorology. Physical and Chemical Properties of Air, P35

Values in the lookup table are over water above and below 0 degrees C.

Note: For vapour pressure oever water this formula is valid for temperatures between 373K and 223K. The values for saturated vapour over water in the lookup table below are out of the lower end of this range. However it is standard WMO practice to use the formula below its accepted range for use with the calculation of dew points in the upper atmosphere

Method:
uses lookup tables to find eSAT, calculates qSAT directly from that.

Author
Met Office
Date
09/06/2020: Created

Definition at line 482 of file ufo_utils_mod.F90.

Here is the caller graph for this function:

◆ ops_satrad_qsplit()

subroutine, public ufo_utils_mod::ops_satrad_qsplit ( integer, intent(in)  output_type,
real(kind_real), dimension(:), intent(in)  p,
real(kind_real), dimension(:), intent(in)  t,
real(kind_real), dimension(:), intent(in)  qtotal,
real(kind_real), dimension(size(qtotal)), intent(out)  q,
real(kind_real), dimension(size(qtotal)), intent(out)  ql,
real(kind_real), dimension(size(qtotal)), intent(out)  qi,
logical, intent(in)  UseQtSplitRain 
)

Split the humidity into water vapour, liquid water and ice.

Heritage: Ops_SatRad_Qsplit.f90

if output_type=1 : Split total water content (qtotal) into
water vapor content (q) and
cloud liquid water content (ql) and
cloud ice water content (qi)

if output_type ne 1 : Compute derivatives: (q) =dq/dqtotal
(ql)=dql/dqtotal
(qi)=dqi/dqtotal

Warning
The derivatives are not valid if LtemperatureVar=.true. since qsaturated depends on temperature.

The partitioning of the excess moisture between ice and clw uses a temperature based parametrization based on aircraft data Ref: Jones DC Reading phdthesis p126

Author
Met Office
Date
09/06/2020: Created

Definition at line 908 of file ufo_utils_mod.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ufo_utils_iogetfreeunit()

integer function, public ufo_utils_mod::ufo_utils_iogetfreeunit

Find a free file unit.

Author
Met Office
Date
09/06/2020: Created

Definition at line 1176 of file ufo_utils_mod.F90.

Here is the caller graph for this function: