<HTML> <BODY BGCOLOR=#ccccdd LINK=#0000aa VLINK=#0000ff ALINK=#ff0000 ><BASE TARGET="bottom_target"><PRE>
<A NAME='MODULE_ICAO'><A href='../../html_code/obsproc/module_icao.F90.html#MODULE_ICAO' TARGET='top_target'><IMG SRC="../../gif/bar_purple.gif" border=0></A>

MODULE MODULE_ICAO 2

!------------------------------------------------------------------------------!
! Collection of functions to compute h, p and t using standard atmosphere
! t is the temperaure in K,
! h is the height in m (h=0 at 1013.25hPa)
! P is pressure in Pa
!
! References:
! ----------
!  Vasiljevic et al. 1992: ECMWF 3D Variational data assimilation 
!                          of conventional observations
!  In proceedings of the ECMWF Workshop on Variational assimilation, with
!  special emphasis on three dimensional aspects. 9-12 November 1992, pp 389-435
!
!  F. VANDENBERGHE, March 2001
!------------------------------------------------------------------------------!

  include 'constants.inc'
  include 'missing.inc'

  REAL, PARAMETER :: p_0    = 101325.,  &amp; ! ICAO reference pressure Pa
                     t_0    = 288.,     &amp; ! ICAO reference temperature K
                     lambda = 0.0065,   &amp; ! ICAO temperature lapse rate K/m
                     alpha  = lambda * gasr / g ! ICAO constant (no unit)

  REAL            :: height_max_icao

CONTAINS

!------------------------------------------------------------------------------!
<A NAME='T_FROM_H_ICAO'><A href='../../html_code/obsproc/module_icao.F90.html#T_FROM_H_ICAO' TARGET='top_target'><IMG SRC="../../gif/bar_green.gif" border=0></A>

 FUNCTION t_from_h_icao (h) RESULT (t)

 IMPLICIT NONE
 REAL :: h, t

 t = t_0 - lambda * h

 END FUNCTION t_from_h_icao
!------------------------------------------------------------------------------!
<A NAME='T_FROM_P_ICAO'><A href='../../html_code/obsproc/module_icao.F90.html#T_FROM_P_ICAO' TARGET='top_target'><IMG SRC="../../gif/bar_green.gif" border=0></A>

 FUNCTION t_from_p_icao (p) RESULT (t)

 IMPLICIT NONE
 REAL :: p, t

 t = t_0 *(p / p_0) ** alpha

 END FUNCTION t_from_p_icao
!------------------------------------------------------------------------------!
<A NAME='H_FROM_P_ICAO'><A href='../../html_code/obsproc/module_icao.F90.html#H_FROM_P_ICAO' TARGET='top_target'><IMG SRC="../../gif/bar_green.gif" border=0></A>

 FUNCTION h_from_p_icao (p) RESULT (h)

 IMPLICIT NONE
 REAL :: p, h

 h = t_0 / lambda * (1. - (p / p_0) ** alpha)

 END FUNCTION h_from_p_icao
!------------------------------------------------------------------------------!
<A NAME='P_FROM_H_ICAO'><A href='../../html_code/obsproc/module_icao.F90.html#P_FROM_H_ICAO' TARGET='top_target'><IMG SRC="../../gif/bar_green.gif" border=0></A>

 FUNCTION p_from_h_icao (h) RESULT (p)

 IMPLICIT NONE
 REAL :: p, h, one_over_alpha

 one_over_alpha = 1. /alpha

   p = p_0 * (1. - lambda * h / t_0)** one_over_alpha

 END FUNCTION p_from_h_icao
!------------------------------------------------------------------------------!
END MODULE MODULE_ICAO