@@ -48,7 +48,7 @@ module constants_mod
4848real , public , parameter :: RDGAS = 287.05_r8_kind ! < Gas constant for dry air [J/kg/deg]
4949real , public , parameter :: RVGAS = 461.50_r8_kind ! < Gas constant for water vapor [J/kg/deg]
5050! Extra:
51- real , public , parameter :: HLV = 2.501e6_r8_kind ! < Latent heat of evaporation [J/kg] try CICE/UM value for esm1.6
51+ real , public :: HLV = 2.500e6_r8_kind ! < Latent heat of evaporation [J/kg]
5252real , public , parameter :: HLF = 3.3358e5_r8_kind ! < Latent heat of fusion [J/kg]
5353real , public , parameter :: con_cliq = 4.1855e+3_r8_kind ! < spec heat H2O liq [J/kg/K]
5454real , public , parameter :: con_csol = 2.1060e+3_r8_kind ! < spec heat H2O ice [J/kg/K]
@@ -77,7 +77,7 @@ module constants_mod
7777real , public , parameter :: RDGAS = 287.04_r8_kind ! < Gas constant for dry air [J/kg/deg]
7878real , public , parameter :: RVGAS = 461.50_r8_kind ! < Gas constant for water vapor [J/kg/deg]
7979! Extra:
80- real , public , parameter :: HLV = 2.500e6_r8_kind ! < Latent heat of evaporation [J/kg]
80+ real , public :: HLV = 2.500e6_r8_kind ! < Latent heat of evaporation [J/kg]
8181real , public , parameter :: HLF = 3.34e5_r8_kind ! < Latent heat of fusion [J/kg]
8282real , public , parameter :: KAPPA = 2.0_r8_kind / 7.0_r8_kind ! < RDGAS / CP_AIR [dimensionless]
8383real , public , parameter :: CP_AIR = RDGAS/ KAPPA ! < Specific heat capacity of dry air at constant pressure [J/kg/deg]
@@ -132,7 +132,7 @@ module constants_mod
132132real , 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]
133133real , public , parameter :: KELVIN = 273.15_r8_kind ! < Degrees Kelvin at zero Celsius [K]
134134
135- public :: constants_init
135+ public :: constants_init, read_fms_constants
136136
137137contains
138138
@@ -141,6 +141,56 @@ subroutine constants_init
141141
142142end subroutine constants_init
143143
144+ ! <SUBROUTINE NAME="read_fms_constants">
145+ ! <OVERVIEW>
146+ ! Read runtime configurable constants from the fms_constants_nml namelist.
147+ ! </OVERVIEW>
148+ ! <TEMPLATE>
149+ ! call read_fms_constants ()
150+ ! </TEMPLATE>
151+ ! <DESCRIPTION>
152+ ! Some constants can be configured in the fms_constants_nml namelist. Read the namelist
153+ ! and overwrite the default values.
154+ ! </DESCRIPTION>
155+ ! <INOUT NAME="output_field" TYPE="TYPE(output_field_type)">Output field that needs the cell_measures</INOUT>
156+ ! <IN NAME="area" TYPE="INTEGER, OPTIONAL">Field ID for area</IN>
157+ ! <IN NAME="volume" TYPE="INTEGER, OPTIONAL">Field ID for volume</IN>
158+ ! <OUT NAME="err_msg" TYPE="CHARACTER(len=*), OPTIONAL"> </OUT>
159+ subroutine read_fms_constants
160+
161+ USE fms_mod, ONLY: check_nml_error, stdlog
162+ USE mpp_mod, ONLY: mpp_pe, mpp_root_pe
163+ #ifdef INTERNAL_FILE_NML
164+ USE mpp_mod, ONLY: input_nml_file
165+ #else
166+ USE fms_mod, ONLY: open_namelist_file, close_file
167+ INTEGER :: nml_unit
168+ #endif
169+ integer :: mystat, ierr, stdlog_unit
170+
171+ NAMELIST / fms_constants_nml/ hlv
172+
173+ #ifdef INTERNAL_FILE_NML
174+ READ (input_nml_file, NML= fms_constants_nml, IOSTAT= mystat)
175+ #else
176+ if ( file_exist(' input.nml' ) ) then
177+ nml_unit = open_namelist_file ( )
178+ ierr= 1
179+ do while (ierr > 0 )
180+ read (nml_unit, nml= fms_constants_nml, iostat= mystat)
181+ ierr = check_nml_error(mystat,' fms_constants_nml' )
182+ enddo
183+ call close_file (nml_unit)
184+ endif
185+ #endif
186+
187+ stdlog_unit = stdlog()
188+ IF ( mpp_pe() == mpp_root_pe() ) THEN
189+ WRITE (stdlog_unit, fms_constants_nml)
190+ END IF
191+
192+ end subroutine read_fms_constants
193+
144194end module constants_mod
145195
146196! <FUTURE>
0 commit comments