Line data Source code
1 : ! This code is part of RRTM for GCM Applications - Parallel (RRTMGP) 2 : ! 3 : ! Contacts: Robert Pincus and Eli Mlawer 4 : ! email: rrtmgp@aer.com 5 : ! 6 : ! Copyright 2015-, Atmospheric and Environmental Research, 7 : ! Regents of the University of Colorado, Trustees of Columbia University. All right reserved. 8 : ! 9 : ! Use and duplication is permitted under the terms of the 10 : ! BSD 3-clause license, see http://opensource.org/licenses/BSD-3-Clause 11 : ! ------------------------------------------------------------------------------------------------- 12 : !> ## Physical and mathematical constants used in RRTMGP gas optics calculation 13 : !> 14 : !> If the host model in which RRTGMP is embedded has defined these constants elsewhere 15 : !> the model definitions can be used instead by renaming. For example, 16 : !> ```use mo_model_constants, only k_boltz => boltzman_k, ...``` 17 : !> where the syntax is local_name => original_name 18 : !> and all the local names need to be defined 19 : ! 20 : !> "Constants" specific to the earth's atmosphere should also be made consistent with the 21 : !> host model but may be changed in a call to init_constants(), normally at initialization 22 : ! ------------------------------------------------------------------------------------------------- 23 : module mo_gas_optics_constants 24 : use mo_rte_kind, only: wp 25 : public 26 : 27 : ! ----------------------------------------- 28 : ! Physical constants, 2018 SI defintion of metric system 29 : ! doi:10.1088/1681-7575/aa950a (see also https://www.nist.gov/si-redefinition/meet-constants) 30 : ! Boltzmann constant [J/K] = [(kg m^2)/(K s^2)] 31 : real(wp), parameter :: k_boltz = 1.380649e-23_wp 32 : 33 : ! molecular weight of water [kg/mol] 34 : real(wp), parameter :: m_h2o = 0.018016_wp 35 : 36 : ! Avogadro's number [molec/mol] 37 : real(wp), parameter :: avogad = 6.02214076e23_wp 38 : 39 : ! Universal gas constant [J/(mol K)] 40 : real(wp), parameter :: R_univ_gconst = avogad * k_boltz 41 : 42 : ! ----------------------------------------- 43 : ! 44 : ! Constants specific to the earth's atmosphere -- changeable in init() because they 45 : ! might be different on e.g. other planets 46 : 47 : ! molecular weight of dry air [kg/mol] 48 : real(wp), protected :: m_dry = 0.028964_wp 49 : 50 : ! Gravity at Earth's surface [m/s2] 51 : real(wp), protected :: grav = 9.80665_wp 52 : 53 : ! Specific heat at constant pressure for dry air [J/(K kg)] 54 : real(wp), protected :: cp_dry = 1004.64_wp 55 : 56 : contains 57 : ! ----------------------------------------- 58 0 : subroutine init_constants(gravity, mol_weight_dry_air, heat_capacity_dry_air) 59 : real(wp), optional, intent(in) :: gravity, mol_weight_dry_air, heat_capacity_dry_air 60 : !! Planetary and atmospheric values used by RRTMGP in computing gas optical properties 61 : !! Default values reflect modern Earth but these can be changed using this routine 62 : 63 0 : if(present(gravity)) grav = gravity 64 0 : if(present(mol_weight_dry_air)) m_dry = mol_weight_dry_air 65 0 : if(present(heat_capacity_dry_air)) cp_dry = heat_capacity_dry_air 66 : 67 0 : end subroutine init_constants 68 : ! ----------------------------------------- 69 : end module mo_gas_optics_constants