PUBLIC INTERFACE ~ PUBLIC DATA ~ PUBLIC ROUTINES ~ NAMELIST ~ DIAGNOSTIC FIELDS ~ ERROR MESSAGES ~ REFERENCES ~ NOTES

## Module constants_mod

Contact: Bruce Wyman
Reviewers:
Change History: WebCVS Log

#### OVERVIEW

Defines useful constants for Earth.

Constants are defined as real parameters, except for PI and RADIAN, which are calculated in constants_init to promote consistency and accuracy among various compilers.
Constants are accessed through the "use" statement.

#### OTHER MODULES USED

    fms_mod

#### PUBLIC INTERFACE

constants_init:
  Initialization routine. The purpose of this routine is initialize the value of PI and RADIAN, and to write the version and tag name information to the log file.

#### PUBLIC DATA

Name | Type | Value | Units | Description
--- | --- | --- | --- | ---
RADIUS | real | 6371.e3 | m | radius of the earth
OMEGA | real | 7.292e-5 | 1/s | rotation rate of the planet (earth)
GRAV | real | 9.80 | m/s^2 | acceleration due to gravity
RDGAS | real | 287.04 | J/kg/deg | gas constant for dry air
KAPPA | real | 2./7. | --- | RDGAS / CP_AIR
CP_AIR | real | RDGAS/KAPPA | J/kg/deg | specific heat capacity of dry air at constant pressure
CP_OCEAN | real | 3989.24495292815 | J/kg/deg | specific heat capacity taken from McDougall (2002) "Potential Enthalpy ..."
RHO0 | real | 1.035e3 | kg/m^3 | average density of sea water
RHO0R | real | 1.0/RHO0 | m^3/kg | reciprocal of average density of sea water
RHO_CP | real | RHO0*CP_OCEAN | J/m^3/deg | (kg/m^3)*(cal/kg/deg C)(joules/cal) = (joules/m^3/deg C)
RVGAS | real | 461.50 | J/kg/deg | gas constant for water vapor
DENS_H2O | real | 1000. | kg/m^3 | density of liquid water
HLV | real | 2.500e6 | J/kg | latent heat of evaporation
HLF | real | 3.34e5 | J/kg | latent heat of fusion
HLS | real | 2.834e6 | J/kg | latent heat of sublimation
TFREEZE | real | 273.16 | degK | temp where fresh water freezes
WTMAIR | real | 2.896440E+01 | AMU | molecular weight of air
WTMH2O | real | 1.801534E+01 | AMU | molecular weight of water
WTMO3 | real | 47.99820E+01 | AMU | molecular weight of ozone
DIFFAC | real | 1.660000E+00 | --- | diffusivity factor
SECONDS_PER_DAY | real | 8.640000E+04 | seconds | seconds in a day
AVOGNO | real | 6.023000E+23 | atoms/mole | Avogadro's number
PSTD | real | 1.013250E+06 | dynes/cm^2 | mean sea level pressure
PSTD_MKS | real | 101325.0 | Newtons/m^2 | mean sea level pressure
REARTH | real | 6.356766E+08 | cm | radius of the earth
RADCON | real | ((1.0E+02*GRAV)/(1.0E+04*CP_AIR))*SECONDS_PER_DAY | deg sec/(cm day) | factor used to convert flux divergence to heating rate in degrees per day
RADCON_MKS | real | (GRAV/CP_AIR)*SECONDS_PER_DAY | deg sec/(m day) | factor used to convert flux divergence to heating rate in degrees per day
O2MIXRAT | real | 2.0953E-01 | --- | mixing ratio of molecular oxygen in air
RHOAIR | real | 1.292269 | kg/m^3 | reference atmospheric density
ALOGMIN | real | -50.0 | --- | minimum value allowed as argument to log function
FREZDK | real | 273.16 | deg K | melting point of water
STEFAN | real | 5.6734e-8 | W/m^2/deg^4 | Stefan-Boltzmann constant
VONKARM | real | 0.40 | --- | Von Karman constant
PI | real | 4.0*ATAN(1.0) | --- | ratio of circle circumference to diameter
RADIAN | real | 180.0/PI | --- | degrees per radian
C2DBARS | real | 1.e-4 | dbars | converts rho*g*z (in mks) to dbars: 1dbar = 10^4 (kg/m^3)(m/s^2)m
KELVIN | real | 273.15 | --- | degrees Kelvin at zero Celsius
EPSLN | real | 1.0e-40 | --- | a small number to prevent divide by zero exceptions

#### PUBLIC ROUTINES

1. #### constants_init

       call constants_init

   DESCRIPTION
     If this routine is called more than once or called from other than the root PE it will return silently. There are no arguments.

#### DATA SETS

None.

#### ERROR MESSAGES

None.

#### REFERENCES

None.

#### COMPILER SPECIFICS

None.

#### PRECOMPILER OPTIONS

None.

#### LOADER OPTIONS

None.

#### TEST PROGRAM

None.

#### KNOWN BUGS

None.

#### NOTES

Constants have been declared as type REAL, PARAMETER.
The value a constant can not be changed in a users program. New constants can be defined in terms of values from the constants module using a parameter statement.<br><br>
The name given to a particular constant may be changed.<br><br>
Constants can be used on the right side on an assignment statement (their value can not be reassigned).
As PI is calculated, it cannot be a parameter variable. Do not assign a new value to PI.

EXAMPLE

          use constants_mod, only:  TFREEZE, grav_new => GRAV
          real, parameter :: grav_inv = 1.0 / grav_new
          tempc(:,:,:) = tempk(:,:,:) - TFREEZE
          geopotential(:,:) = height(:,:) * grav_new

#### FUTURE PLANS

1. Renaming of constants.

2. Additional constants.

top