FV3 Bundle
constants.F90
Go to the documentation of this file.
1 !***********************************************************************
2 !* GNU Lesser General Public License
3 !*
4 !* This file is part of the GFDL Flexible Modeling System (FMS).
5 !*
6 !* FMS is free software: you can redistribute it and/or modify it under
7 !* the terms of the GNU Lesser General Public License as published by
8 !* the Free Software Foundation, either version 3 of the License, or (at
9 !* your option) any later version.
10 !*
11 !* FMS is distributed in the hope that it will be useful, but WITHOUT
12 !* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 !* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 !* for more details.
15 !*
16 !* You should have received a copy of the GNU Lesser General Public
17 !* License along with FMS. If not, see <http://www.gnu.org/licenses/>.
18 !***********************************************************************
19 
20 !! \brief Defines useful constants for Earth. Constants are defined as real
21 !! parameters. Constants are accessed through the "use" statement.
22 !!
23 !! \author Bruce Wyman <Bruce.Wyman@noaa.gov>
25 
26 !---variable for strong typing grid parameters
27 use platform_mod, only: r8_kind
28 implicit none
29 private
30 
31 ! Include variable "version" to be written to log file.
32 #include<file_version.h>
33 !-----------------------------------------------------------------------
34 ! version is public so that write_version_number can be called for constants_mod
35 ! by fms_init
36 public :: version
37 
38 real :: realnumber !< dummy variable to use in HUGE initializations
39 
40 #ifdef GFS_PHYS
41 ! SJL: the following are from fv3_gfsphysics/gfs_physics/physics/physcons.f90
42 real, public, parameter :: radius = 6.3712e+6_r8_kind !< Radius of the Earth [m]
43 real(kind=r8_kind), public, parameter :: pi_8 = 3.1415926535897931_r8_kind !< Ratio of circle circumference to diameter [N/A]
44 real, public, parameter :: pi = 3.1415926535897931_r8_kind !< Ratio of circle circumference to diameter [N/A] (REAL(KIND=8))
45 real, public, parameter :: omega = 7.2921e-5_r8_kind !< Rotation rate of the Earth [1/s]
46 real, public, parameter :: grav = 9.80665_r8_kind !< Acceleration due to gravity [m/s^2]
47 real(kind=r8_kind), public, parameter :: grav_8 = 9.80665_r8_kind !< Acceleration due to gravity [m/s^2] (REAL(KIND=8))
48 real, public, parameter :: rdgas = 287.05_r8_kind !< Gas constant for dry air [J/kg/deg]
49 real, public, parameter :: rvgas = 461.50_r8_kind !< Gas constant for water vapor [J/kg/deg]
50 ! Extra:
51 real, public, parameter :: hlv = 2.5e6_r8_kind !< Latent heat of evaporation [J/kg]
52 real, public, parameter :: hlf = 3.3358e5_r8_kind !< Latent heat of fusion [J/kg]
53 real, public, parameter :: con_cliq = 4.1855e+3_r8_kind !< spec heat H2O liq [J/kg/K]
54 real, public, parameter :: con_csol = 2.1060e+3_r8_kind !< spec heat H2O ice [J/kg/K]
55 real, public, parameter :: cp_air = 1004.6_r8_kind !< Specific heat capacity of dry air at constant pressure [J/kg/deg]
56 real, public, parameter :: kappa = rdgas/cp_air !< RDGAS / CP_AIR [dimensionless]
57 real, public, parameter :: tfreeze = 273.15_r8_kind !< Freezing temperature of fresh water [K]
58 #else
59 
60 #ifdef SMALL_EARTH
61 #if defined(DCMIP) || (defined(HIWPP) && defined(SUPER_K))
62  real, private, parameter :: small_fac = 1._r8_kind / 120._r8_kind #only needed for supercell test
63 #elif defined(HIWPP)
64  real, private, parameter :: small_fac = 1._r8_kind / 166.7_r8_kind
65 #else
66  real, private, parameter :: small_fac = 1._r8_kind / 10._r8_kind
67 #endif
68 #else
69  real, private, parameter :: small_fac = 1._r8_kind
70 #endif
71 
72 real, public, parameter :: radius = 6371.0e+3_r8_kind * small_fac !< Radius of the Earth [m]
73 real(kind=8), public, parameter :: pi_8 = 3.14159265358979323846_r8_kind !< Ratio of circle circumference to diameter [N/A]
74 real, public, parameter :: pi = 3.14159265358979323846_r8_kind !< Ratio of circle circumference to diameter [N/A]
75 real, public, parameter :: omega = 7.292e-5_r8_kind / small_fac !< Rotation rate of the Earth [1/s]
76 real, public, parameter :: grav = 9.80_r8_kind !< Acceleration due to gravity [m/s^2]
77 real, public, parameter :: rdgas = 287.04_r8_kind !< Gas constant for dry air [J/kg/deg]
78 real, public, parameter :: rvgas = 461.50_r8_kind !< Gas constant for water vapor [J/kg/deg]
79 ! Extra:
80 real, public, parameter :: hlv = 2.500e6_r8_kind !< Latent heat of evaporation [J/kg]
81 real, public, parameter :: hlf = 3.34e5_r8_kind !< Latent heat of fusion [J/kg]
82 real, public, parameter :: kappa = 2.0_r8_kind/7.0_r8_kind !< RDGAS / CP_AIR [dimensionless]
83 real, public, parameter :: cp_air = rdgas/kappa !< Specific heat capacity of dry air at constant pressure [J/kg/deg]
84 real, public, parameter :: tfreeze = 273.16_r8_kind !< Freezing temperature of fresh water [K]
85 #endif
86 
87 real, public, parameter :: stefan = 5.6734e-8_r8_kind !< Stefan-Boltzmann constant [W/m^2/deg^4]
88 
89 real, public, parameter :: cp_vapor = 4.0_r8_kind*rvgas !< Specific heat capacity of water vapor at constant pressure [J/kg/deg]
90 real, public, parameter :: cp_ocean = 3989.24495292815_r8_kind !< Specific heat capacity taken from McDougall (2002)
91  !! "Potential Enthalpy ..." [J/kg/deg]
92 real, public, parameter :: rho0 = 1.035e3_r8_kind !< Average density of sea water [kg/m^3]
93 real, public, parameter :: rho0r = 1.0_r8_kind/rho0 !< Reciprocal of average density of sea water [m^3/kg]
94 real, public, parameter :: rho_cp = rho0*cp_ocean !< (kg/m^3)*(cal/kg/deg C)(joules/cal) = (joules/m^3/deg C) [J/m^3/deg]
95 
96 real, public, parameter :: es0 = 1.0_r8_kind !< Humidity factor. Controls the humidity content of the atmosphere through
97  !! the Saturation Vapour Pressure expression when using DO_SIMPLE. [dimensionless]
98 real, public, parameter :: dens_h2o = 1000._r8_kind !< Density of liquid water [kg/m^3]
99 real, public, parameter :: hls = hlv + hlf !< Latent heat of sublimation [J/kg]
100 
101 real, public, parameter :: wtmair = 2.896440e+01_r8_kind !< Molecular weight of air [AMU]
102 real, public, parameter :: wtmh2o = wtmair*(rdgas/rvgas) !< Molecular weight of water [AMU]
103 real, public, parameter :: wtmozone = 47.99820_r8_kind !< Molecular weight of ozone [AMU]
104 real, public, parameter :: wtmc = 12.00000_r8_kind !< Molecular weight of carbon [AMU]
105 real, public, parameter :: wtmco2 = 44.00995_r8_kind !< Molecular weight of carbon dioxide [AMU]
106 real, public, parameter :: wtmch4 = 16.0425_r8_kind !< Molecular weight of methane [AMU]
107 real, public, parameter :: wtmo2 = 31.9988_r8_kind !< Molecular weight of molecular oxygen [AMU]
108 real, public, parameter :: wtmcfc11 = 137.3681_r8_kind !< Molecular weight of CFC-11 (CCl3F) [AMU]
109 real, public, parameter :: wtmcfc12 = 120.9135_r8_kind !< Molecular weight of CFC-21 (CCl2F2) [AMU]
110 real, public, parameter :: wtmn = 14.0067_r8_kind !< Molecular weight of Nitrogen [AMU]
111 real, public, parameter :: diffac = 1.660000e+00_r8_kind !< Diffusivity factor [dimensionless]
112 real, public, parameter :: avogno = 6.023000e+23_r8_kind !< Avogadro's number [atoms/mole]
113 real, public, parameter :: pstd = 1.013250e+06_r8_kind !< Mean sea level pressure [dynes/cm^2]
114 real, public, parameter :: pstd_mks = 101325.0_r8_kind !< Mean sea level pressure [N/m^2]
115 
116 real, public, parameter :: seconds_per_day = 8.640000e+04_r8_kind !< Seconds in a day [s]
117 real, public, parameter :: seconds_per_hour = 3600._r8_kind !< Seconds in an hour [s]
118 real, public, parameter :: seconds_per_minute = 60._r8_kind !< Seconds in a minute [s]
119 real, public, parameter :: rad_to_deg = 180._r8_kind/pi !< Degrees per radian [deg/rad]
120 real, public, parameter :: deg_to_rad = pi/180._r8_kind !< Radians per degree [rad/deg]
121 real, public, parameter :: radian = rad_to_deg !< Equal to RAD_TO_DEG for backward compatability. [rad/deg]
122 real, public, parameter :: alogmin = -50.0_r8_kind !< Minimum value allowed as argument to log function [N/A]
123 real, public, parameter :: epsln = 1.0e-40_r8_kind !< A small number to prevent divide by zero exceptions [N/A]
124 
125 real, public, parameter :: radcon = ((1.0e+02*grav)/(1.0e+04*cp_air))*seconds_per_day !< Factor used to convert flux divergence to
126  !! heating rate in degrees per day [deg sec/(cm day)]
127 real, public, parameter :: radcon_mks = (grav/cp_air)*seconds_per_day !< Factor used to convert flux divergence to
128  !! heating rate in degrees per day [deg sec/(m day)]
129 real, public, parameter :: o2mixrat = 2.0953e-01_r8_kind !< Mixing ratio of molecular oxygen in air [dimensionless]
130 real, public, parameter :: rhoair = 1.292269_r8_kind !< Reference atmospheric density [kg/m^3]
131 real, public, parameter :: vonkarm = 0.40_r8_kind !< Von Karman constant [dimensionless]
132 real, public, parameter :: c2dbars = 1.e-4_r8_kind !< Converts rho*g*z (in mks) to dbars: 1dbar = 10^4 (kg/m^3)(m/s^2)m [dbars]
133 real, public, parameter :: kelvin = 273.15_r8_kind !< Degrees Kelvin at zero Celsius [K]
134 
135 public :: constants_init
136 
137 contains
138 
139 !> \brief dummy routine.
140 subroutine constants_init
142 end subroutine constants_init
143 
144 end module constants_mod
145 
146 ! <FUTURE>
147 ! 1. Renaming of constants.
148 ! </FUTURE>
149 ! <FUTURE>
150 ! 2. Additional constants.
151 ! </FUTURE>
152 ! <NOTE>
153 ! Constants have been declared as type REAL, PARAMETER.
154 !
155 ! The value a constant can not be changed in a users program.
156 ! New constants can be defined in terms of values from the
157 ! constants module using a parameter statement.<br><br>
158 !
159 ! The name given to a particular constant may be changed.<br><br>
160 !
161 ! Constants can be used on the right side on an assignment statement
162 ! (their value can not be reassigned).
163 !
164 !
165 !<TESTPROGRAM NAME="EXAMPLE">
166 !<PRE>
167 ! use constants_mod, only: TFREEZE, grav_new => GRAV
168 ! real, parameter :: grav_inv = 1.0 / grav_new
169 ! tempc(:,:,:) = tempk(:,:,:) - TFREEZE
170 ! geopotential(:,:) = height(:,:) * grav_new
171 !</PRE>
172 !</TESTPROGRAM>
173 ! </NOTE>
real, parameter, public c2dbars
Converts rho*g*z (in mks) to dbars: 1dbar = 10^4 (kg/m^3)(m/s^2)m [dbars].
Definition: constants.F90:132
real, parameter, public rho0r
Reciprocal of average density of sea water [m^3/kg].
Definition: constants.F90:93
real, parameter, public radius
Radius of the Earth [m].
Definition: constants.F90:72
real, parameter, public kelvin
Degrees Kelvin at zero Celsius [K].
Definition: constants.F90:133
real, parameter, public pstd_mks
Mean sea level pressure [N/m^2].
Definition: constants.F90:114
real, parameter, public vonkarm
Von Karman constant [dimensionless].
Definition: constants.F90:131
real, parameter, public cp_ocean
Specific heat capacity taken from McDougall (2002) "Potential Enthalpy ..." [J/kg/deg].
Definition: constants.F90:90
real, parameter, public omega
Rotation rate of the Earth [1/s].
Definition: constants.F90:75
real, parameter, public rad_to_deg
Degrees per radian [deg/rad].
Definition: constants.F90:119
real, parameter, public avogno
Avogadro&#39;s number [atoms/mole].
Definition: constants.F90:112
real(kind=8), parameter, public pi_8
Ratio of circle circumference to diameter [N/A].
Definition: constants.F90:73
real, parameter, public wtmair
Molecular weight of air [AMU].
Definition: constants.F90:101
real, parameter, public wtmozone
Molecular weight of ozone [AMU].
Definition: constants.F90:103
real, parameter, public hlv
Latent heat of evaporation [J/kg].
Definition: constants.F90:80
real, parameter, public hls
Latent heat of sublimation [J/kg].
Definition: constants.F90:99
real, parameter, public seconds_per_minute
Seconds in a minute [s].
Definition: constants.F90:118
real, parameter, public radcon
Factor used to convert flux divergence to heating rate in degrees per day [deg sec/(cm day)]...
Definition: constants.F90:125
real, parameter, public rdgas
Gas constant for dry air [J/kg/deg].
Definition: constants.F90:77
real, parameter, public wtmcfc12
Molecular weight of CFC-21 (CCl2F2) [AMU].
Definition: constants.F90:109
real, parameter, public rhoair
Reference atmospheric density [kg/m^3].
Definition: constants.F90:130
real realnumber
dummy variable to use in HUGE initializations
Definition: constants.F90:38
real, parameter, public cp_vapor
Specific heat capacity of water vapor at constant pressure [J/kg/deg].
Definition: constants.F90:89
real, parameter, public alogmin
Minimum value allowed as argument to log function [N/A].
Definition: constants.F90:122
real, parameter, public wtmcfc11
Molecular weight of CFC-11 (CCl3F) [AMU].
Definition: constants.F90:108
real, parameter, public pstd
Mean sea level pressure [dynes/cm^2].
Definition: constants.F90:113
real, parameter, public pi
Ratio of circle circumference to diameter [N/A].
Definition: constants.F90:74
real, parameter, public radian
Equal to RAD_TO_DEG for backward compatability. [rad/deg].
Definition: constants.F90:121
real, parameter, public o2mixrat
Mixing ratio of molecular oxygen in air [dimensionless].
Definition: constants.F90:129
real, parameter, public rvgas
Gas constant for water vapor [J/kg/deg].
Definition: constants.F90:78
real, parameter, public seconds_per_hour
Seconds in an hour [s].
Definition: constants.F90:117
real, parameter, public epsln
A small number to prevent divide by zero exceptions [N/A].
Definition: constants.F90:123
real, parameter, public cp_air
Specific heat capacity of dry air at constant pressure [J/kg/deg].
Definition: constants.F90:83
real, parameter, public tfreeze
Freezing temperature of fresh water [K].
Definition: constants.F90:84
real, parameter, public stefan
Stefan-Boltzmann constant [W/m^2/deg^4].
Definition: constants.F90:87
real, parameter, public rho_cp
(kg/m^3)*(cal/kg/deg C)(joules/cal) = (joules/m^3/deg C) [J/m^3/deg]
Definition: constants.F90:94
real, parameter, public wtmc
Molecular weight of carbon [AMU].
Definition: constants.F90:104
real, parameter, private small_fac
Definition: constants.F90:69
real, parameter, public wtmch4
Molecular weight of methane [AMU].
Definition: constants.F90:106
real, parameter, public diffac
Diffusivity factor [dimensionless].
Definition: constants.F90:111
real, parameter, public wtmh2o
Molecular weight of water [AMU].
Definition: constants.F90:102
real, parameter, public hlf
Latent heat of fusion [J/kg].
Definition: constants.F90:81
real, parameter, public es0
Humidity factor. Controls the humidity content of the atmosphere through the Saturation Vapour Pressu...
Definition: constants.F90:96
integer, parameter r8_kind
Definition: platform.F90:24
real, parameter, public grav
Acceleration due to gravity [m/s^2].
Definition: constants.F90:76
real, parameter, public wtmo2
Molecular weight of molecular oxygen [AMU].
Definition: constants.F90:107
real, parameter, public dens_h2o
Density of liquid water [kg/m^3].
Definition: constants.F90:98
real, parameter, public deg_to_rad
Radians per degree [rad/deg].
Definition: constants.F90:120
real, parameter, public radcon_mks
Factor used to convert flux divergence to heating rate in degrees per day [deg sec/(m day)]...
Definition: constants.F90:127
real, parameter, public seconds_per_day
Seconds in a day [s].
Definition: constants.F90:116
real, parameter, public wtmco2
Molecular weight of carbon dioxide [AMU].
Definition: constants.F90:105
real, parameter, public rho0
Average density of sea water [kg/m^3].
Definition: constants.F90:92
real, parameter, public kappa
RDGAS / CP_AIR [dimensionless].
Definition: constants.F90:82
subroutine, public constants_init
dummy routine.
Definition: constants.F90:141
real, parameter, public wtmn
Molecular weight of Nitrogen [AMU].
Definition: constants.F90:110