Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
8910e56
Initial plan
Copilot Apr 8, 2026
3e8bf2d
Align MALI constants with E3SM shared constants
Copilot Apr 8, 2026
b570550
Clarify fallback constant alignment with E3SM shared constants
Copilot Apr 8, 2026
a232641
Apply suggestions from code review
trhille May 5, 2026
2965b6c
Add shared glacier-ice density defaults for MALI and MPAS-Ocean
Copilot May 5, 2026
a89b759
Clarify and align ideal gas constant conversion in MALI constants
Copilot May 5, 2026
92b7ec9
Clarify derivations for fallback constants in li_constants
Copilot May 5, 2026
795dfc5
Match fallback ideal gas constant to SHR_CONST_RGAS conversion
Copilot May 5, 2026
bef3e18
Compute fallback constants from shared-equivalent formulas
Copilot May 5, 2026
8bc15ed
Mark helper fallback constants private in li_constants
Copilot May 5, 2026
d13684c
Move new glacier-related constants to PCD and switch MALI imports
Copilot May 5, 2026
21071d7
Rename PCD module to pcd_const and align kind usage
Copilot May 5, 2026
2a159b8
Polish PCD units/comments and fallback constant wording
Copilot May 5, 2026
9f8b036
Finalize PCD unit notation and fallback comment alignment
Copilot May 5, 2026
74da9e8
Rename PCD ocean freezing depth constant for clarity
Copilot May 5, 2026
4b78593
Clarify standalone ocean-freezing depth fallback comment
Copilot May 5, 2026
07eaec9
Normalize PCD glacier density notation and shr_const comment spacing
Copilot May 5, 2026
fbdf09d
Refine PCD metadata category and constant descriptions
Copilot May 5, 2026
a95ea9c
Remove shr_const-to-PCD dependency and tighten PCD module visibility
Copilot May 5, 2026
5e7af95
Add documentation notes to pcd_const and pcd.yaml version metadata
Copilot May 5, 2026
e95a583
Simplify standalone depth-coefficient comment wording
Copilot May 5, 2026
b1ba1c4
Restore autogenerated PCD files and stop direct pcd_const usage
Copilot May 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
<config_weight_value_cell>0.9</config_weight_value_cell>

<!-- physical_parameters -->
<config_ice_density>910.0</config_ice_density>
<config_ice_density>-1.0</config_ice_density>
<config_ocean_density>1028.0</config_ocean_density>
<config_sea_level>0.0</config_sea_level>
<config_default_flowParamA>3.1709792e-24</config_default_flowParamA>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ Default: Defined in namelist_defaults.xml
category="physical_parameters" group="physical_parameters">
ice density to use (assumed constant and uniform)

Valid values: Any positive real value
Valid values: Any positive real value, or a negative value to use model default
Default: Defined in namelist_defaults.xml
</entry>

Expand Down
2 changes: 1 addition & 1 deletion components/mpas-albany-landice/src/Registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@
<nml_record name="physical_parameters" in_defaults="true">
<nml_option name="config_ice_density" type="real" default_value="910.0" units="kg m^-3"
description="ice density to use (assumed constant and uniform)"
possible_values="Any positive real value"
possible_values="Any positive real value, or a negative value to use model default"
/>
<nml_option name="config_ocean_density" type="real" default_value="1028.0" units="kg m^-3"
description="ocean density to use for calculating floatation (assumed constant and uniform)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ function li_core_init(domain, startTimeStamp) result(err)
type (MPAS_Time_Type) :: startTime
integer :: i, err, err_tmp, globalErr
logical, pointer :: config_do_restart
real (kind=RKIND), pointer :: config_ice_density
real (kind=RKIND), pointer :: deltat ! variable in each block
real (kind=RKIND) :: dtSeconds ! local variable
type (MPAS_Pool_type), pointer :: meshPool, geometryPool, velocityPool, timeAveragingPool
Expand All @@ -127,6 +128,12 @@ function li_core_init(domain, startTimeStamp) result(err)

call li_config_init(domain % configs)
call mpas_pool_get_config(domain % configs, 'config_do_restart', config_do_restart)
call mpas_pool_get_config(domain % configs, 'config_ice_density', config_ice_density)

if (config_ice_density < 0.0_RKIND) then
config_ice_density = glacier_ice_density
call mpas_log_write('config_ice_density < 0: using glacier_ice_density from li_constants.')
end if

!
! Initialize config option settings as needed
Expand Down
58 changes: 32 additions & 26 deletions components/mpas-albany-landice/src/shared/mpas_li_constants.F
Original file line number Diff line number Diff line change
Expand Up @@ -23,54 +23,60 @@ module li_constants
use mpas_kind_types

#ifdef MPAS_ESM_SHR_CONST
use shr_const_mod, only: &
cp_ice => SHR_CONST_CPICE,&
latent_heat_ice => SHR_CONST_LATICE,&
triple_point => SHR_CONST_TKTRIP,&
rho_water => SHR_CONST_RHOFW, &
cp_freshwater => SHR_CONST_CPFW, &
cp_seawater => SHR_CONST_CPSW, &
pii => SHR_CONST_PI, &
gravity => SHR_CONST_G
implicit none
save
use shr_const_mod, only: &
cp_ice => SHR_CONST_CPICE,&
latent_heat_ice => SHR_CONST_LATICE,&
triple_point => SHR_CONST_TKTRIP,&
rho_water => SHR_CONST_RHOFW, &
cp_freshwater => SHR_CONST_CPFW, &
cp_seawater => SHR_CONST_CPSW, &
pii => SHR_CONST_PI, &
gravity => SHR_CONST_G, &
shr_gas_constant => SHR_CONST_RGAS, &
iceConductivity => SHR_CONST_CONDICE, &
kelvin_to_celsius => SHR_CONST_TKFRZ, &
seconds_per_day => SHR_CONST_CDAY
implicit none
save

real (kind=RKIND), parameter, public :: idealGasConstant = shr_gas_constant * 1.0e-3_RKIND !< ideal gas constant (J mol^-1 K^-1), converted from SHR_CONST_RGAS (J kmol^-1 K^-1)

#else

implicit none
save

! physical constants
real (kind=RKIND), parameter, public :: cp_ice = 2009.0_RKIND !< heat capacity of ice (J/kg/K)
real (kind=RKIND), parameter, public :: latent_heat_ice = 335.0e3_RKIND !< Latent heat of melting of ice (J/kg)
real (kind=RKIND), parameter, public :: cp_ice = 2.11727e3_RKIND !< heat capacity of ice (J/kg/K), aligned with SHR_CONST_CPICE
real (kind=RKIND), parameter, public :: latent_heat_ice = 3.337e5_RKIND !< Latent heat of melting of ice (J/kg), aligned with SHR_CONST_LATICE
real (kind=RKIND), parameter, public :: triple_point = 273.16_RKIND !< Triple point of water (K)
real (kind=RKIND), parameter, public :: rho_water = 1000.0_RKIND !< Density of fresh water (kg m^-3)
real (kind=RKIND), parameter, public :: cp_freshwater = 4.188e3_RKIND !< heat capacity of freshwater (J/kg/K)
real (kind=RKIND), parameter, public :: cp_seawater = 3.974e3_RKIND !< heat capacity of seawater (J/kg/K)
real (kind=RKIND), parameter, public :: pii = 3.141592653589793_RKIND !< Constant: Pi
real (kind=RKIND), parameter, public :: cp_seawater = 3.996e3_RKIND !< heat capacity of seawater (J/kg/K), aligned with SHR_CONST_CPSW
real (kind=RKIND), parameter, public :: pii = 3.14159265358979323846_RKIND !< Constant: Pi
real (kind=RKIND), parameter, public :: gravity = 9.80616_RKIND !< Constant: Acceleration due to gravity [m s-2]
real (kind=RKIND), parameter, private :: shr_gas_constant = 8314.467591_RKIND
real (kind=RKIND), parameter, public :: idealGasConstant = shr_gas_constant * 1.0e-3_RKIND !< ideal gas constant (J mol^-1 K^-1), converted from SHR_CONST_RGAS
real (kind=RKIND), parameter, public :: iceConductivity = 2.1_RKIND !< thermal conductivity of ice (W m^-1 K^-1)
real (kind=RKIND), parameter, public :: kelvin_to_celsius = 273.15_RKIND !< factor to convert Kelvin to Celsius
real (kind=RKIND), parameter, public :: seconds_per_day = 86400.0_RKIND !< Conversion from days to seconds

#endif

real (kind=RKIND), parameter, public :: glacier_ice_density = 910.0_RKIND !< Density of glacier ice (kg m^-3)
real (kind=RKIND), parameter, private :: oceanFreezingTempPressureDependence = -7.43e-8_RKIND
real (kind=RKIND), parameter, public :: kin_visc_water = 1.793e-6_RKIND !< kinematic viscosity of freshwater at 0 deg C (m^2 s^-1)
real (kind=RKIND), parameter, public :: idealGasConstant = 8.314_RKIND !< ideal gas constant (J mol^-1 K^-1)
real (kind=RKIND), parameter, public :: iceConductivity = 2.1_RKIND !< thermal conductivity of ice (W m^-1 K^-1)
real (kind=RKIND), parameter, public :: oceanFreezingTempDepthDependence = oceanFreezingTempPressureDependence * rho_water * gravity !< Rate of change of freezing temperature with depth (deg m^-1)

real (kind=RKIND), parameter, public :: &
oceanFreezingTempSurface = -1.92_RKIND, & !< Freezing temperature of seawater (deg C) at surface pressure,
!< given S = 35 PSU
oceanFreezingTempDepthDependence = -7.53e-4_RKIND !< Rate of change of freezing temperature of seawater
!< with depth (deg m^-1), given S = 35 PSU
!< These values are from the Ocean Water Freezing Point Calculator,
!< http://www.csgnetwork.com/h2ofreezecalc.html (25 Nov. 2014)
oceanFreezingTempSurface = -1.92_RKIND !< Freezing temperature of seawater (deg C) at surface pressure,
!< given S = 35 PSU

real (kind=RKIND), parameter, public :: iceMeltingPointPressureDependence = 7.9e-8_RKIND
!< Clausius-Clapeyron constant: Dependence of ice melting point on pressure (K Pa^-1)

! conversion factors
real (kind=RKIND), parameter, public :: kelvin_to_celsius = 273.15_RKIND !< factor to convert Kelvin to Celsius
real (kind=RKIND), parameter, public :: scyr = 31536000.0_RKIND !< seconds in a 365-day year; used for diagnostics
real (kind=RKIND), parameter, public :: seconds_per_day = 86400.0_RKIND !< Conversion from days to seconds
real (kind=RKIND), parameter, public :: scyr = seconds_per_day * 365.0_RKIND !< seconds in a 365-day year; used for diagnostics

!***********************************************************************

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@
<config_land_ice_flux_boundaryLayerThickness>10.0</config_land_ice_flux_boundaryLayerThickness>
<config_land_ice_flux_boundaryLayerNeighborWeight>0.0</config_land_ice_flux_boundaryLayerNeighborWeight>
<config_land_ice_flux_cp_ice>2.009e3</config_land_ice_flux_cp_ice>
<config_land_ice_flux_rho_ice>918</config_land_ice_flux_rho_ice>
<config_land_ice_flux_rho_ice>-1</config_land_ice_flux_rho_ice>
<config_land_ice_flux_explicit_topDragCoeff>2.5e-3</config_land_ice_flux_explicit_topDragCoeff>
<config_land_ice_flux_explicit_topDragCoeff ocn_grid="oEC60to30v3wLI">4.48e-3</config_land_ice_flux_explicit_topDragCoeff>
<config_land_ice_flux_explicit_topDragCoeff ocn_grid="ECwISC30to60E1r2">4.48e-3</config_land_ice_flux_explicit_topDragCoeff>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1776,7 +1776,7 @@ Default: Defined in namelist_defaults.xml
category="land_ice_fluxes" group="land_ice_fluxes">
The density of land ice.

Valid values: Any positive real number
Valid values: Any positive real number, or a negative value to use model default
Default: Defined in namelist_defaults.xml
</entry>

Expand Down
2 changes: 1 addition & 1 deletion components/mpas-ocean/src/Registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,7 @@
/>
<nml_option name="config_land_ice_flux_rho_ice" type="real" default_value="918" units="kg m^-3"
description="The density of land ice."
possible_values="Any positive real number"
possible_values="Any positive real number, or a negative value to use model default"
/>
<nml_option name="config_land_ice_flux_explicit_topDragCoeff" type="real" default_value="2.5e-3"
description="The top drag coefficient if config_use_implicit_top_drag_coeff is false."
Expand Down
9 changes: 4 additions & 5 deletions components/mpas-ocean/src/shared/mpas_ocn_constants.F
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ module ocn_constants
use mpas_kind_types

#ifdef MPAS_ESM_SHR_CONST
use shr_kind_mod, only: SHR_KIND_R8
use shr_const_mod
use shr_kind_mod, only: SHR_KIND_R8
use shr_const_mod
#endif

implicit none
Expand All @@ -44,7 +44,7 @@ module ocn_constants
rho_air ,&! ambient air density (kg/m^3)
rho_fw ,&! density of fresh water (kg/m^3)
rho_sw ,&! density of salt water (kg/m^3)
rho_ice ,&! density of sea ice (kg/m^3)
rho_glacier_ice_default,&! default density of glacier ice (kg/m^3)
cp_sw ,&! specific heat salt water (J/kg/K)
cp_air ,&! heat capacity of air (J/kg/K)
sound ,&! speed of sound (m/s)
Expand Down Expand Up @@ -122,7 +122,7 @@ subroutine ocn_constants_init(configPool, packagePool)!{{{
rho_air = 1.2_RKIND ! ambient air density (kg/m^3)
rho_sw = config_density0 ! density of salt water (kg/m^3)
rho_fw = 1.0e3_RKIND ! avg. water density (kg/m^3)
rho_ice = 0.917e3_RKIND ! density of ice (kg/m^3)
rho_glacier_ice_default = 0.910e3_RKIND ! density of glacier ice (kg/m^3)
cp_sw = 3.996e3_RKIND ! specific heat salt water
cp_air = 1005.0_RKIND ! heat capacity of air (J/kg/K)
sound = 1.5e2_RKIND ! speed of sound (m/s)
Expand Down Expand Up @@ -167,7 +167,6 @@ subroutine ocn_constants_init(configPool, packagePool)!{{{
rho_air = SHR_CONST_RHODAIR ! kg/m^3
rho_sw = SHR_CONST_RHOSW ! kg/m^3
rho_fw = SHR_CONST_RHOFW ! kg/m^3
rho_ice = SHR_CONST_RHOICE ! kg/m^3
vonkar = SHR_CONST_KARMAN
stefan_boltzmann = SHR_CONST_STEBOL ! W/m^2/K^4
latent_heat_vapor_mks = SHR_CONST_LATVAP ! J/kg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,11 @@ subroutine ocn_surface_land_ice_fluxes_init(err)!{{{
!*** Set physical values

cpLandIce = config_land_ice_flux_cp_ice
rhoLandIce = config_land_ice_flux_rho_ice
if (config_land_ice_flux_rho_ice < 0.0_RKIND) then
rhoLandIce = rho_glacier_ice_default
else
rhoLandIce = config_land_ice_flux_rho_ice
end if
ISOMIPgammaT = config_land_ice_flux_ISOMIP_gammaT

!--------------------------------------------------------------------
Expand Down
Loading