Geopotential Subprograms
GEOPOTENTIAL_HEIGHT
NAME:
Geopotential_Height
PURPOSE:
Function to calculate geopotential height using the hypsometric
equation.
CALLING SEQUENCE:
Error_Statusz = Geopotential_Height( Pressure, & ! Input
Temperature, & ! Input
Water_Vapor_Pressure, & ! Input
Height, & ! Output
Surface_Height =Surface_Height, & ! Optional input
Gravity_Correction =Gravity_Correction, & ! Optional input
Latitude =Latitude, & ! Optional input
Zonal_Wind_Velocity =Zonal_Wind_Velocity, & ! Optional input
Meridional_Wind_Velocity=Meridional_Wind_Velocity, & ! Optional input
RCS_Id =RCS_Id, & ! Revision control
Message_Log =Message_Log ) ! Error messaging
INPUT ARGUMENTS:
Pressure: Pressure of the atmospheric levels.
UNITS: hectoPascals, hPa
TYPE: REAL(fp)
DIMENSION: Rank-1 (K x 1)
ATTRIBUTES: INTENT(IN)
Temperature: Temperature of the atmospheric levels.
UNITS: Kelvin, K
TYPE: REAL(fp)
DIMENSION: Same as Pressure
ATTRIBUTES: INTENT(IN)
Water_Vapor_Pressure: Water vapor partial pressure at the atmospheric levels
UNITS: hectoPascals, hPa
TYPE: REAL(fp)
DIMENSION: Same as Pressure
ATTRIBUTES: INTENT(IN)
OPTIONAL INPUT ARGUMENTS:
Surface_Height: Height corresponding to the first element of the
input arrays. If not specified, the default value
is 0.0m.
UNITS: metres, m.
TYPE: REAL(fp)
DIMENSION: Scalar
ATTRIBUTES: OPTIONAL, INTENT(IN)
Gravity_Correction: Set this argument to use a gravity profile rather
than standard reference gravity in calculating
the geopotential Heights. If PRESENT then,
if = 0, standard gravity used,
= 1, gravity profile is calculated and used.
UNITS: N/A.
TYPE: INTEGER
DIMENSION: Scalar
ATTRIBUTES: OPTIONAL, INTENT(IN)
Latitude: Set this argument to the Latitude corresponding
to the input profile location. This argument is
ignored if the Gravity_Correction argument is
NOT set. If not defined and required, the default
value is zero.
UNITS: Degrees (no N or S hemisphere dep.).
TYPE: REAL(fp)
DIMENSION: Scalar
ATTRIBUTES: OPTIONAL, INTENT(IN)
Zonal_Wind_Velocity: Set this argument to the zonal wind velocities
at the input profile levels. This argument is
ignored if the Gravity_Correction argument is
not set. If not specified, the default value
is zero.
UNITS: m.s^-1, +ve W'ly, -ve E'ly
TYPE: REAL(fp)
DIMENSION: Same as Pressure
ATTRIBUTES: OPTIONAL, INTENT(IN)
Meridional_Wind_Velocity: Set this argument to the meridional wind velocities
at the input profile levels. This argument is
ignored if the Gravity_Correction argument is
not set. If not specified, the default value
is zero.
UNITS: m.s^-1, +ve S'ly, -ve N'ly
TYPE: REAL(fp)
DIMENSION: Same as Pressure
ATTRIBUTES: OPTIONAL, INTENT(IN)
Message_Log: Character string specifying a filename in which any
Messages will be logged. If not specified, or if an
error occurs opening the log file, the default action
is to output Messages to standard output.
UNITS: N/A
TYPE: CHARACTER(*)
DIMENSION: Scalar
ATTRIBUTES: OPTIONAL, INTENT(IN)
OUTPUT ARGUMENTS:
Height: Geopotential Heights of the input Pressure levels.
UNITS: metres, m
TYPE: REAL(fp)
DIMENSION: Same as input Pressure
ATTRIBUTES: INTENT(OUT)
OPTIONAL OUTPUT ARGUMENTS:
RCS_Id: Character string containing the Revision Control
System Id field for the module.
UNITS: N/A
TYPE: CHARACTER(*)
DIMENSION: Scalar
ATTRIBUTES: OPTIONAL, INTENT(OUT)
FUNCTION RESULT:
Error_Status: The return value is an integer defining the
error status. The error codes are defined
in the ERROR_HANDLER module.
If == SUCCESS the geopotential calculation was
successful
== FAILURE an unrecoverable error occurred
UNITS: N/A
TYPE: INTEGER
DIMENSION: Scalar
PROCEDURE:
Geopotential heights are calculated using the hypsometric equation:
_ [ p1 ]
z2 - z1 = H.ln[ ---- ] .....(1)
[ p2 ]
_
where H = scale height,
p1,p2 = layer boundary pressures, and
z1,z2 = layer boundary heights.
and
_ R_air * T
H = ----------- .....(2)
g
where R_air = gas constant for moist air
T = average temperature for an atmospheric layer,
g = acceleration due to gravity
The gas constant for air is given by:
1000 * R
R_air = ---------- .....(3)
MW_air
where R0 = Molar gas constant
MW_air = Water vapor weighted molecular weight of air
and the factor of 1000 is for conversion of the molecular
weight from g.mol^-1 to kg.mol^-1.
Layer values for both R_air and T are determined from a density
weighted average of adjacent level values:
X(k)*rho(k) + X(k-1)*rho(k-1)
layer_X = -------------------------------
rho(k) + rho(k-1)
The use of an optional gravity profile was introduced to make
this code parallel that of the UMBC KLAYERS altitude calculation
code.
Units analysis:
---------------
Typical units of the quantities are,
units(T) = K
units(g) = m.s^-2
units(R0) = J.K^-1.mol^-1 = kg.m^2.s^-2.K^-1.mol^-1
units(MW_air) = g.mol^-1
From eqn(3),
kg.m^2.s^-2.K^-1.mol^-1
units(R_air) = -------------------------
g.mol^-1
1000 kg.m^2.s^-2.K^-1.mol^-1
= ------------------------------
kg.mol^-1
= 1000 m^2.s^-2.K^-1
From eqn.(2),
_ 1000 m^2.s^-2.K^-1 . K
units(H) = ------------------------
m.s^-2
= 1000 m
So the final heights must be multiplied by 1000 to get units of metres.
If you're wondering why I don't use the virtual temperature rather
than calculate MW_air and R_air, the reasons are two-fold:
1) To calculate a density using the ideal gas law, you need to
know either of these quantities, and
2) Eventually, the effect due to ozone will also be included.
CREATION HISTORY:
Written by: Paul van Delst, CIMSS/SSEC 21-Feb-1999
paul.vandelst@ssec.wisc.edu