From 8910e566ba6569f9dce3b60408d444dc022b7e41 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 8 Apr 2026 15:58:48 +0000 Subject: [PATCH 01/22] Initial plan From 3e8bf2dde7c6f7748b4e3997b827f677211f0c15 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 8 Apr 2026 16:03:09 +0000 Subject: [PATCH 02/22] Align MALI constants with E3SM shared constants Agent-Logs-Url: https://github.com/MALI-Dev/E3SM/sessions/3d8f95f7-8b68-42cc-8c3b-19e1b8bfb47c Co-authored-by: trhille <17446278+trhille@users.noreply.github.com> --- .../src/shared/mpas_li_constants.F | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/components/mpas-albany-landice/src/shared/mpas_li_constants.F b/components/mpas-albany-landice/src/shared/mpas_li_constants.F index ffbb183747cd..cb38e6350b85 100644 --- a/components/mpas-albany-landice/src/shared/mpas_li_constants.F +++ b/components/mpas-albany-landice/src/shared/mpas_li_constants.F @@ -31,7 +31,10 @@ module li_constants cp_freshwater => SHR_CONST_CPFW, & cp_seawater => SHR_CONST_CPSW, & pii => SHR_CONST_PI, & - gravity => SHR_CONST_G + gravity => SHR_CONST_G, & + iceConductivity => SHR_CONST_CONDICE, & + kelvin_to_celsius => SHR_CONST_TKFRZ, & + seconds_per_day => SHR_CONST_CDAY implicit none save @@ -41,20 +44,22 @@ module li_constants 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) + real (kind=RKIND), parameter, public :: latent_heat_ice = 3.337e5_RKIND !< Latent heat of melting of ice (J/kg) 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 :: cp_seawater = 3.996e3_RKIND !< heat capacity of seawater (J/kg/K) real (kind=RKIND), parameter, public :: pii = 3.141592653589793_RKIND !< Constant: Pi real (kind=RKIND), parameter, public :: gravity = 9.80616_RKIND !< Constant: Acceleration due to gravity [m s-2] + 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 :: 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 :: & oceanFreezingTempSurface = -1.92_RKIND, & !< Freezing temperature of seawater (deg C) at surface pressure, @@ -68,9 +73,7 @@ module li_constants !< 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 !*********************************************************************** From b570550998b2b0f4f651c804dad1027c0a7a2ce1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 8 Apr 2026 16:03:44 +0000 Subject: [PATCH 03/22] Clarify fallback constant alignment with E3SM shared constants Agent-Logs-Url: https://github.com/MALI-Dev/E3SM/sessions/3d8f95f7-8b68-42cc-8c3b-19e1b8bfb47c Co-authored-by: trhille <17446278+trhille@users.noreply.github.com> --- .../mpas-albany-landice/src/shared/mpas_li_constants.F | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/mpas-albany-landice/src/shared/mpas_li_constants.F b/components/mpas-albany-landice/src/shared/mpas_li_constants.F index cb38e6350b85..b57bbc2627a5 100644 --- a/components/mpas-albany-landice/src/shared/mpas_li_constants.F +++ b/components/mpas-albany-landice/src/shared/mpas_li_constants.F @@ -44,12 +44,12 @@ module li_constants save ! physical constants - real (kind=RKIND), parameter, public :: cp_ice = 2.11727e3_RKIND !< heat capacity of ice (J/kg/K) - real (kind=RKIND), parameter, public :: latent_heat_ice = 3.337e5_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.996e3_RKIND !< heat capacity of seawater (J/kg/K) + 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.141592653589793_RKIND !< Constant: Pi real (kind=RKIND), parameter, public :: gravity = 9.80616_RKIND !< Constant: Acceleration due to gravity [m s-2] real (kind=RKIND), parameter, public :: iceConductivity = 2.1_RKIND !< thermal conductivity of ice (W m^-1 K^-1) From a232641365d1bfc1612e5411ce67401aaa313196 Mon Sep 17 00:00:00 2001 From: Trevor Hillebrand Date: Tue, 5 May 2026 15:17:15 -0600 Subject: [PATCH 04/22] Apply suggestions from code review Align pi with SHR_CONST_PI and express scyr in terms of seconds_per_day. Co-authored-by: Matt Hoffman --- components/mpas-albany-landice/src/shared/mpas_li_constants.F | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/mpas-albany-landice/src/shared/mpas_li_constants.F b/components/mpas-albany-landice/src/shared/mpas_li_constants.F index b57bbc2627a5..a7dc86cb6721 100644 --- a/components/mpas-albany-landice/src/shared/mpas_li_constants.F +++ b/components/mpas-albany-landice/src/shared/mpas_li_constants.F @@ -50,7 +50,7 @@ module li_constants 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.996e3_RKIND !< heat capacity of seawater (J/kg/K), aligned with SHR_CONST_CPSW - real (kind=RKIND), parameter, public :: pii = 3.141592653589793_RKIND !< Constant: Pi + 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, 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 @@ -73,7 +73,7 @@ module li_constants !< Clausius-Clapeyron constant: Dependence of ice melting point on pressure (K Pa^-1) ! conversion factors - real (kind=RKIND), parameter, public :: scyr = 31536000.0_RKIND !< seconds in a 365-day year; used for diagnostics + real (kind=RKIND), parameter, public :: scyr = seconds_per_day * 365.0_RKIND !< seconds in a 365-day year; used for diagnostics !*********************************************************************** From 2965b6c24a78d5aa53c91445b9968704e7ab95df Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 5 May 2026 21:31:55 +0000 Subject: [PATCH 05/22] Add shared glacier-ice density defaults for MALI and MPAS-Ocean Agent-Logs-Url: https://github.com/MALI-Dev/E3SM/sessions/74693bcd-9e18-4d93-87b5-a1f4bdd572f4 Co-authored-by: trhille <17446278+trhille@users.noreply.github.com> --- .../namelist_files/namelist_defaults_mali.xml | 2 +- .../namelist_definition_mali.xml | 2 +- .../mpas-albany-landice/src/Registry.xml | 2 +- .../src/mode_forward/mpas_li_core.F | 7 ++++++ .../src/shared/mpas_li_constants.F | 25 +++++++++++-------- .../namelist_defaults_mpaso.xml | 2 +- .../namelist_definition_mpaso.xml | 2 +- components/mpas-ocean/src/Registry.xml | 2 +- .../src/shared/mpas_ocn_constants.F | 6 ++--- .../shared/mpas_ocn_surface_land_ice_fluxes.F | 6 ++++- share/util/shr_const_mod.F90 | 3 +++ 11 files changed, 38 insertions(+), 21 deletions(-) diff --git a/components/mpas-albany-landice/bld/namelist_files/namelist_defaults_mali.xml b/components/mpas-albany-landice/bld/namelist_files/namelist_defaults_mali.xml index ebf0744c64ba..b52dc0eb28a5 100644 --- a/components/mpas-albany-landice/bld/namelist_files/namelist_defaults_mali.xml +++ b/components/mpas-albany-landice/bld/namelist_files/namelist_defaults_mali.xml @@ -113,7 +113,7 @@ 0.9 -910.0 +-1.0 1028.0 0.0 3.1709792e-24 diff --git a/components/mpas-albany-landice/bld/namelist_files/namelist_definition_mali.xml b/components/mpas-albany-landice/bld/namelist_files/namelist_definition_mali.xml index da5e3dca8b61..42329bde441f 100644 --- a/components/mpas-albany-landice/bld/namelist_files/namelist_definition_mali.xml +++ b/components/mpas-albany-landice/bld/namelist_files/namelist_definition_mali.xml @@ -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 diff --git a/components/mpas-albany-landice/src/Registry.xml b/components/mpas-albany-landice/src/Registry.xml index a6bf14cc9664..430d8b24ca7b 100644 --- a/components/mpas-albany-landice/src/Registry.xml +++ b/components/mpas-albany-landice/src/Registry.xml @@ -524,7 +524,7 @@ SHR_CONST_LATICE,& triple_point => SHR_CONST_TKTRIP,& rho_water => SHR_CONST_RHOFW, & + glacier_ice_density => SHR_CONST_RHOGLACIERICE, & cp_freshwater => SHR_CONST_CPFW, & cp_seawater => SHR_CONST_CPSW, & pii => SHR_CONST_PI, & gravity => SHR_CONST_G, & + kin_visc_water => SHR_CONST_KINVISCFW, & + shr_gas_constant => SHR_CONST_RGAS, & + oceanFreezingTempDepthDependence => SHR_CONST_DTF_DZ, & iceConductivity => SHR_CONST_CONDICE, & kelvin_to_celsius => SHR_CONST_TKFRZ, & seconds_per_day => SHR_CONST_CDAY - implicit none - save + implicit none + save + + real (kind=RKIND), parameter, public :: idealGasConstant = shr_gas_constant * 1.0e-3_RKIND !< ideal gas constant (J mol^-1 K^-1), aligned with SHR_CONST_RGAS #else @@ -48,26 +54,23 @@ module li_constants 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 :: glacier_ice_density = 910.0_RKIND !< Density of glacier ice (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.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, 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.31446261815324_RKIND !< ideal gas constant (J mol^-1 K^-1) + real (kind=RKIND), parameter, public :: oceanFreezingTempDepthDependence = -7.28617688e-4_RKIND !< Rate of change of freezing temperature with depth (deg m^-1), from SHR_CONST_DTF_DZ 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 :: 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 :: & - 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) diff --git a/components/mpas-ocean/bld/namelist_files/namelist_defaults_mpaso.xml b/components/mpas-ocean/bld/namelist_files/namelist_defaults_mpaso.xml index 47fc7eacb6ec..2691a9d4c0c2 100644 --- a/components/mpas-ocean/bld/namelist_files/namelist_defaults_mpaso.xml +++ b/components/mpas-ocean/bld/namelist_files/namelist_defaults_mpaso.xml @@ -473,7 +473,7 @@ 10.0 0.0 2.009e3 -918 +-1 2.5e-3 4.48e-3 4.48e-3 diff --git a/components/mpas-ocean/bld/namelist_files/namelist_definition_mpaso.xml b/components/mpas-ocean/bld/namelist_files/namelist_definition_mpaso.xml index 0419719ffaa3..9de3cbe0d9fb 100644 --- a/components/mpas-ocean/bld/namelist_files/namelist_definition_mpaso.xml +++ b/components/mpas-ocean/bld/namelist_files/namelist_definition_mpaso.xml @@ -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 diff --git a/components/mpas-ocean/src/Registry.xml b/components/mpas-ocean/src/Registry.xml index dd218f789e4f..3859702781d9 100644 --- a/components/mpas-ocean/src/Registry.xml +++ b/components/mpas-ocean/src/Registry.xml @@ -1117,7 +1117,7 @@ /> Date: Tue, 5 May 2026 21:32:45 +0000 Subject: [PATCH 06/22] Clarify and align ideal gas constant conversion in MALI constants Agent-Logs-Url: https://github.com/MALI-Dev/E3SM/sessions/74693bcd-9e18-4d93-87b5-a1f4bdd572f4 Co-authored-by: trhille <17446278+trhille@users.noreply.github.com> --- components/mpas-albany-landice/src/shared/mpas_li_constants.F | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/mpas-albany-landice/src/shared/mpas_li_constants.F b/components/mpas-albany-landice/src/shared/mpas_li_constants.F index b797d651f83d..8e51084db156 100644 --- a/components/mpas-albany-landice/src/shared/mpas_li_constants.F +++ b/components/mpas-albany-landice/src/shared/mpas_li_constants.F @@ -42,7 +42,7 @@ module li_constants implicit none save - real (kind=RKIND), parameter, public :: idealGasConstant = shr_gas_constant * 1.0e-3_RKIND !< ideal gas constant (J mol^-1 K^-1), aligned with SHR_CONST_RGAS + 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 @@ -60,7 +60,7 @@ module li_constants 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, 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.31446261815324_RKIND !< ideal gas constant (J mol^-1 K^-1) + real (kind=RKIND), parameter, public :: idealGasConstant = 8.31445891_RKIND !< ideal gas constant (J mol^-1 K^-1), consistent with SHR_CONST_RGAS conversion real (kind=RKIND), parameter, public :: oceanFreezingTempDepthDependence = -7.28617688e-4_RKIND !< Rate of change of freezing temperature with depth (deg m^-1), from SHR_CONST_DTF_DZ 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 From 92b7ec9b32cb5da618fdac888dc7f54f728c4503 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 5 May 2026 21:33:27 +0000 Subject: [PATCH 07/22] Clarify derivations for fallback constants in li_constants Agent-Logs-Url: https://github.com/MALI-Dev/E3SM/sessions/74693bcd-9e18-4d93-87b5-a1f4bdd572f4 Co-authored-by: trhille <17446278+trhille@users.noreply.github.com> --- components/mpas-albany-landice/src/shared/mpas_li_constants.F | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/mpas-albany-landice/src/shared/mpas_li_constants.F b/components/mpas-albany-landice/src/shared/mpas_li_constants.F index 8e51084db156..8dafae879cb1 100644 --- a/components/mpas-albany-landice/src/shared/mpas_li_constants.F +++ b/components/mpas-albany-landice/src/shared/mpas_li_constants.F @@ -60,8 +60,8 @@ module li_constants 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, 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.31445891_RKIND !< ideal gas constant (J mol^-1 K^-1), consistent with SHR_CONST_RGAS conversion - real (kind=RKIND), parameter, public :: oceanFreezingTempDepthDependence = -7.28617688e-4_RKIND !< Rate of change of freezing temperature with depth (deg m^-1), from SHR_CONST_DTF_DZ + real (kind=RKIND), parameter, public :: idealGasConstant = 8.31445891_RKIND !< ideal gas constant (J mol^-1 K^-1), converted from SHR_CONST_RGAS = 8314.45891 (J kmol^-1 K^-1) + real (kind=RKIND), parameter, public :: oceanFreezingTempDepthDependence = -7.28617688e-4_RKIND !< Rate of change of freezing temperature with depth (deg m^-1), from SHR_CONST_DTF_DZ = SHR_CONST_DTF_DP*SHR_CONST_RHOFW*SHR_CONST_G 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 From 795dfc549af33dba2c27d6da34fbd237a74827fd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 5 May 2026 21:34:24 +0000 Subject: [PATCH 08/22] Match fallback ideal gas constant to SHR_CONST_RGAS conversion Agent-Logs-Url: https://github.com/MALI-Dev/E3SM/sessions/74693bcd-9e18-4d93-87b5-a1f4bdd572f4 Co-authored-by: trhille <17446278+trhille@users.noreply.github.com> --- components/mpas-albany-landice/src/shared/mpas_li_constants.F | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/mpas-albany-landice/src/shared/mpas_li_constants.F b/components/mpas-albany-landice/src/shared/mpas_li_constants.F index 8dafae879cb1..b7f4de9f84ab 100644 --- a/components/mpas-albany-landice/src/shared/mpas_li_constants.F +++ b/components/mpas-albany-landice/src/shared/mpas_li_constants.F @@ -60,8 +60,8 @@ module li_constants 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, 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.31445891_RKIND !< ideal gas constant (J mol^-1 K^-1), converted from SHR_CONST_RGAS = 8314.45891 (J kmol^-1 K^-1) - real (kind=RKIND), parameter, public :: oceanFreezingTempDepthDependence = -7.28617688e-4_RKIND !< Rate of change of freezing temperature with depth (deg m^-1), from SHR_CONST_DTF_DZ = SHR_CONST_DTF_DP*SHR_CONST_RHOFW*SHR_CONST_G + real (kind=RKIND), parameter, public :: idealGasConstant = 8.314467591_RKIND !< ideal gas constant (J mol^-1 K^-1), converted from SHR_CONST_RGAS + real (kind=RKIND), parameter, public :: oceanFreezingTempDepthDependence = -7.28617688e-4_RKIND !< Rate of change of freezing temperature with depth (deg m^-1), from SHR_CONST_DTF_DZ 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 From bef3e18439ca86d05825359d8ed290e7f5a013b1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 5 May 2026 21:35:10 +0000 Subject: [PATCH 09/22] Compute fallback constants from shared-equivalent formulas Agent-Logs-Url: https://github.com/MALI-Dev/E3SM/sessions/74693bcd-9e18-4d93-87b5-a1f4bdd572f4 Co-authored-by: trhille <17446278+trhille@users.noreply.github.com> --- .../mpas-albany-landice/src/shared/mpas_li_constants.F | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/mpas-albany-landice/src/shared/mpas_li_constants.F b/components/mpas-albany-landice/src/shared/mpas_li_constants.F index b7f4de9f84ab..833adc9ec0d5 100644 --- a/components/mpas-albany-landice/src/shared/mpas_li_constants.F +++ b/components/mpas-albany-landice/src/shared/mpas_li_constants.F @@ -59,9 +59,11 @@ module li_constants 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 :: shr_gas_constant = 8314.467591_RKIND + real (kind=RKIND), parameter :: 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.314467591_RKIND !< ideal gas constant (J mol^-1 K^-1), converted from SHR_CONST_RGAS - real (kind=RKIND), parameter, public :: oceanFreezingTempDepthDependence = -7.28617688e-4_RKIND !< Rate of change of freezing temperature with depth (deg m^-1), from SHR_CONST_DTF_DZ + 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 :: oceanFreezingTempDepthDependence = oceanFreezingTempPressureDependence * rho_water * gravity !< Rate of change of freezing temperature with depth (deg m^-1), from SHR_CONST_DTF_DZ 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 From 8bc15edd4c1091d62f1af13e6649aa324ab96e4b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 5 May 2026 21:35:45 +0000 Subject: [PATCH 10/22] Mark helper fallback constants private in li_constants Agent-Logs-Url: https://github.com/MALI-Dev/E3SM/sessions/74693bcd-9e18-4d93-87b5-a1f4bdd572f4 Co-authored-by: trhille <17446278+trhille@users.noreply.github.com> --- components/mpas-albany-landice/src/shared/mpas_li_constants.F | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/mpas-albany-landice/src/shared/mpas_li_constants.F b/components/mpas-albany-landice/src/shared/mpas_li_constants.F index 833adc9ec0d5..373c0676b3d8 100644 --- a/components/mpas-albany-landice/src/shared/mpas_li_constants.F +++ b/components/mpas-albany-landice/src/shared/mpas_li_constants.F @@ -59,8 +59,8 @@ module li_constants 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 :: shr_gas_constant = 8314.467591_RKIND - real (kind=RKIND), parameter :: oceanFreezingTempPressureDependence = -7.43e-8_RKIND + real (kind=RKIND), parameter, private :: shr_gas_constant = 8314.467591_RKIND + 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 = 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 :: oceanFreezingTempDepthDependence = oceanFreezingTempPressureDependence * rho_water * gravity !< Rate of change of freezing temperature with depth (deg m^-1), from SHR_CONST_DTF_DZ From d13684c56cdc7612a8d1834681f5b237d5120302 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 5 May 2026 21:48:13 +0000 Subject: [PATCH 11/22] Move new glacier-related constants to PCD and switch MALI imports Agent-Logs-Url: https://github.com/MALI-Dev/E3SM/sessions/a5a1e2e0-9606-4ef4-a46d-4466f200b763 Co-authored-by: trhille <17446278+trhille@users.noreply.github.com> --- .../src/shared/mpas_li_constants.F | 35 ++++++++++--------- share/pcd.yaml | 18 ++++++++++ share/util/CMakeLists.txt | 1 + share/util/pcd_const.F90 | 9 +++++ share/util/shr_const_mod.F90 | 5 ++- 5 files changed, 48 insertions(+), 20 deletions(-) create mode 100644 share/pcd.yaml create mode 100644 share/util/pcd_const.F90 diff --git a/components/mpas-albany-landice/src/shared/mpas_li_constants.F b/components/mpas-albany-landice/src/shared/mpas_li_constants.F index 373c0676b3d8..d4e4addf880c 100644 --- a/components/mpas-albany-landice/src/shared/mpas_li_constants.F +++ b/components/mpas-albany-landice/src/shared/mpas_li_constants.F @@ -23,22 +23,23 @@ 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, & - glacier_ice_density => SHR_CONST_RHOGLACIERICE, & - cp_freshwater => SHR_CONST_CPFW, & - cp_seawater => SHR_CONST_CPSW, & - pii => SHR_CONST_PI, & - gravity => SHR_CONST_G, & - kin_visc_water => SHR_CONST_KINVISCFW, & - shr_gas_constant => SHR_CONST_RGAS, & - oceanFreezingTempDepthDependence => SHR_CONST_DTF_DZ, & - iceConductivity => SHR_CONST_CONDICE, & - kelvin_to_celsius => SHR_CONST_TKFRZ, & - seconds_per_day => SHR_CONST_CDAY + 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 + use pcd, only: & + glacier_ice_density => glacier_ice_density_reference, & + kin_visc_water => freshwater_kinematic_viscosity_at_freezing_reference, & + oceanFreezingTempDepthDependence => ocean_freezing_temperature_pressure_depth_dependence_reference implicit none save @@ -63,7 +64,7 @@ module li_constants 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 = 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 :: oceanFreezingTempDepthDependence = oceanFreezingTempPressureDependence * rho_water * gravity !< Rate of change of freezing temperature with depth (deg m^-1), from SHR_CONST_DTF_DZ + real (kind=RKIND), parameter, public :: oceanFreezingTempDepthDependence = oceanFreezingTempPressureDependence * rho_water * gravity !< Rate of change of freezing temperature with depth (deg m^-1), aligned with shared depth coefficient 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 diff --git a/share/pcd.yaml b/share/pcd.yaml new file mode 100644 index 000000000000..4450d378e7ba --- /dev/null +++ b/share/pcd.yaml @@ -0,0 +1,18 @@ +physical_constants_dictionary: + version_number: 0.1.0 + institution: E3SM Project + description: Minimal PCD constants used by MALI/MPAS-Ocean shared-constant wiring + + earth_seawater: + glacier_ice_density_reference: + value: 910.0 + units: kg m-3 + description: Reference density for glacier ice + freshwater_kinematic_viscosity_at_freezing_reference: + value: 1.793e-6 + units: m2 s-1 + description: Kinematic viscosity of freshwater at 0 C + ocean_freezing_temperature_pressure_depth_dependence_reference: + value: -7.28617688e-4 + units: C m-1 + description: Depth coefficient for pressure-driven ocean freezing temperature diff --git a/share/util/CMakeLists.txt b/share/util/CMakeLists.txt index f68be557c212..9ddec5a31467 100644 --- a/share/util/CMakeLists.txt +++ b/share/util/CMakeLists.txt @@ -10,6 +10,7 @@ list(APPEND share_sources "${share_genf90_sources}") list(APPEND share_sources shr_file_mod.F90 shr_kind_mod.F90 + pcd_const.F90 shr_const_mod.F90 shr_sys_mod.F90 shr_log_mod.F90 diff --git a/share/util/pcd_const.F90 b/share/util/pcd_const.F90 new file mode 100644 index 000000000000..5b48913417d6 --- /dev/null +++ b/share/util/pcd_const.F90 @@ -0,0 +1,9 @@ +module pcd + implicit none + + integer, parameter :: dp = selected_real_kind(12) + + real(dp), parameter :: glacier_ice_density_reference = 910.0_dp + real(dp), parameter :: freshwater_kinematic_viscosity_at_freezing_reference = 1.793e-6_dp + real(dp), parameter :: ocean_freezing_temperature_pressure_depth_dependence_reference = -7.28617688e-4_dp +end module pcd diff --git a/share/util/shr_const_mod.F90 b/share/util/shr_const_mod.F90 index 9964ee6ab871..4bbfdcc690d5 100644 --- a/share/util/shr_const_mod.F90 +++ b/share/util/shr_const_mod.F90 @@ -6,6 +6,7 @@ MODULE shr_const_mod use shr_kind_mod, only : R8 => shr_kind_r8 + use pcd, only : glacier_ice_density_reference !---------------------------------------------------------------------------- ! physical constants (all data public) @@ -46,7 +47,7 @@ MODULE shr_const_mod real(R8),parameter :: SHR_CONST_RHOFW = 1.000e3_R8 ! density of fresh water ~ kg/m^3 real(R8),parameter :: SHR_CONST_RHOSW = 1.026e3_R8 ! density of sea water ~ kg/m^3 real(R8),parameter :: SHR_CONST_RHOICE = 0.917e3_R8 ! density of ice ~ kg/m^3 - real(R8),parameter :: SHR_CONST_RHOGLACIERICE = 0.910e3_R8 ! density of glacier ice ~ kg/m^3 + real(R8),parameter :: SHR_CONST_RHOGLACIERICE = glacier_ice_density_reference ! density of glacier ice ~ kg/m^3 real(R8),parameter :: SHR_CONST_CPDAIR = 1.00464e3_R8 ! specific heat of dry air ~ J/kg/K real(R8),parameter :: SHR_CONST_CPWV = 1.810e3_R8 ! specific heat of water vap ~ J/kg/K real(R8),parameter :: SHR_CONST_CPVIR = (SHR_CONST_CPWV/SHR_CONST_CPDAIR)-1.0_R8 ! CPWV/CPDAIR - 1.0 @@ -57,7 +58,6 @@ MODULE shr_const_mod real(R8),parameter :: SHR_CONST_LATVAP = 2.501e6_R8 ! latent heat of evaporation ~ J/kg real(R8),parameter :: SHR_CONST_LATSUB = & ! latent heat of sublimation ~ J/kg SHR_CONST_LATICE + SHR_CONST_LATVAP - real(R8),parameter :: SHR_CONST_KINVISCFW = 1.793e-6_R8 ! kinematic viscosity of freshwater at 0 C ~ m^2/s real(R8),parameter :: SHR_CONST_CONDICE = 2.1_R8 ! thermal conductivity of ice ~ W/m/K real(R8),parameter :: SHR_CONST_KAPPA_LAND_ICE = & ! Diffusivity of heat in land ice ~ SHR_CONST_CONDICE / (SHR_CONST_RHOICE*SHR_CONST_CPICE) @@ -69,7 +69,6 @@ MODULE shr_const_mod ! the freezing temperature in sub-ice-ice ocean cavities ~ C PSU^{-1} real(R8),parameter :: SHR_CONST_DTF_DPDS = -1.74e-10_R8 ! The coefficient for the term proportional to salinity times ! pressure in the freezing temperature in sub-ice-shelf ocean cavities ~ C PSU^{-1} Pa^{-1} - real(R8),parameter :: SHR_CONST_DTF_DZ = SHR_CONST_DTF_DP*SHR_CONST_RHOFW*SHR_CONST_G ! coefficient for pressure-driven cavity Tf with depth ~ C m^{-1} real(R8),parameter :: SHR_CONST_OCN_REF_SAL = 34.7_R8 ! ocn ref salinity (psu) real(R8),parameter :: SHR_CONST_ICE_REF_SAL = 4.0_R8 ! ice ref salinity (psu) From 21071d72eb0bb59074f086341d0d8b7e8625c397 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 5 May 2026 21:48:52 +0000 Subject: [PATCH 12/22] Rename PCD module to pcd_const and align kind usage Agent-Logs-Url: https://github.com/MALI-Dev/E3SM/sessions/a5a1e2e0-9606-4ef4-a46d-4466f200b763 Co-authored-by: trhille <17446278+trhille@users.noreply.github.com> --- .../src/shared/mpas_li_constants.F | 2 +- share/util/pcd_const.F90 | 14 +++++++------- share/util/shr_const_mod.F90 | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/components/mpas-albany-landice/src/shared/mpas_li_constants.F b/components/mpas-albany-landice/src/shared/mpas_li_constants.F index d4e4addf880c..491ace964833 100644 --- a/components/mpas-albany-landice/src/shared/mpas_li_constants.F +++ b/components/mpas-albany-landice/src/shared/mpas_li_constants.F @@ -36,7 +36,7 @@ module li_constants iceConductivity => SHR_CONST_CONDICE, & kelvin_to_celsius => SHR_CONST_TKFRZ, & seconds_per_day => SHR_CONST_CDAY - use pcd, only: & + use pcd_const, only: & glacier_ice_density => glacier_ice_density_reference, & kin_visc_water => freshwater_kinematic_viscosity_at_freezing_reference, & oceanFreezingTempDepthDependence => ocean_freezing_temperature_pressure_depth_dependence_reference diff --git a/share/util/pcd_const.F90 b/share/util/pcd_const.F90 index 5b48913417d6..f7099eeebc07 100644 --- a/share/util/pcd_const.F90 +++ b/share/util/pcd_const.F90 @@ -1,9 +1,9 @@ -module pcd - implicit none +module pcd_const + use shr_kind_mod, only : R8 => shr_kind_r8 - integer, parameter :: dp = selected_real_kind(12) + implicit none - real(dp), parameter :: glacier_ice_density_reference = 910.0_dp - real(dp), parameter :: freshwater_kinematic_viscosity_at_freezing_reference = 1.793e-6_dp - real(dp), parameter :: ocean_freezing_temperature_pressure_depth_dependence_reference = -7.28617688e-4_dp -end module pcd + real(R8), parameter :: glacier_ice_density_reference = 910.0_R8 + real(R8), parameter :: freshwater_kinematic_viscosity_at_freezing_reference = 1.793e-6_R8 + real(R8), parameter :: ocean_freezing_temperature_pressure_depth_dependence_reference = -7.28617688e-4_R8 +end module pcd_const diff --git a/share/util/shr_const_mod.F90 b/share/util/shr_const_mod.F90 index 4bbfdcc690d5..e170e371c7ef 100644 --- a/share/util/shr_const_mod.F90 +++ b/share/util/shr_const_mod.F90 @@ -6,7 +6,7 @@ MODULE shr_const_mod use shr_kind_mod, only : R8 => shr_kind_r8 - use pcd, only : glacier_ice_density_reference + use pcd_const, only : glacier_ice_density_reference !---------------------------------------------------------------------------- ! physical constants (all data public) From 2a159b8a52185358e10762a1b9a50d3a061ca297 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 5 May 2026 21:49:36 +0000 Subject: [PATCH 13/22] Polish PCD units/comments and fallback constant wording Agent-Logs-Url: https://github.com/MALI-Dev/E3SM/sessions/a5a1e2e0-9606-4ef4-a46d-4466f200b763 Co-authored-by: trhille <17446278+trhille@users.noreply.github.com> --- .../mpas-albany-landice/src/shared/mpas_li_constants.F | 2 +- share/pcd.yaml | 4 ++-- share/util/pcd_const.F90 | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/mpas-albany-landice/src/shared/mpas_li_constants.F b/components/mpas-albany-landice/src/shared/mpas_li_constants.F index 491ace964833..8a95d3dc15cb 100644 --- a/components/mpas-albany-landice/src/shared/mpas_li_constants.F +++ b/components/mpas-albany-landice/src/shared/mpas_li_constants.F @@ -64,7 +64,7 @@ module li_constants 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 = 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 :: oceanFreezingTempDepthDependence = oceanFreezingTempPressureDependence * rho_water * gravity !< Rate of change of freezing temperature with depth (deg m^-1), aligned with shared depth coefficient + real (kind=RKIND), parameter, public :: oceanFreezingTempDepthDependence = oceanFreezingTempPressureDependence * rho_water * gravity !< Rate of change of freezing temperature with depth (deg m^-1), fallback equivalent to shared coefficient 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 diff --git a/share/pcd.yaml b/share/pcd.yaml index 4450d378e7ba..b5b2755bc25a 100644 --- a/share/pcd.yaml +++ b/share/pcd.yaml @@ -6,11 +6,11 @@ physical_constants_dictionary: earth_seawater: glacier_ice_density_reference: value: 910.0 - units: kg m-3 + units: kg m^-3 description: Reference density for glacier ice freshwater_kinematic_viscosity_at_freezing_reference: value: 1.793e-6 - units: m2 s-1 + units: m^2 s^-1 description: Kinematic viscosity of freshwater at 0 C ocean_freezing_temperature_pressure_depth_dependence_reference: value: -7.28617688e-4 diff --git a/share/util/pcd_const.F90 b/share/util/pcd_const.F90 index f7099eeebc07..ebf077bbac92 100644 --- a/share/util/pcd_const.F90 +++ b/share/util/pcd_const.F90 @@ -3,7 +3,7 @@ module pcd_const implicit none - real(R8), parameter :: glacier_ice_density_reference = 910.0_R8 - real(R8), parameter :: freshwater_kinematic_viscosity_at_freezing_reference = 1.793e-6_R8 - real(R8), parameter :: ocean_freezing_temperature_pressure_depth_dependence_reference = -7.28617688e-4_R8 + real(R8), parameter :: glacier_ice_density_reference = 910.0_R8 ! [kg m^-3] + real(R8), parameter :: freshwater_kinematic_viscosity_at_freezing_reference = 1.793e-6_R8 ! [m^2 s^-1] + real(R8), parameter :: ocean_freezing_temperature_pressure_depth_dependence_reference = -7.28617688e-4_R8 ! [C m^-1] end module pcd_const From 9f8b036334284a861db928a462145ca24095ed6c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 5 May 2026 21:50:14 +0000 Subject: [PATCH 14/22] Finalize PCD unit notation and fallback comment alignment Agent-Logs-Url: https://github.com/MALI-Dev/E3SM/sessions/a5a1e2e0-9606-4ef4-a46d-4466f200b763 Co-authored-by: trhille <17446278+trhille@users.noreply.github.com> --- components/mpas-albany-landice/src/shared/mpas_li_constants.F | 2 +- share/pcd.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/mpas-albany-landice/src/shared/mpas_li_constants.F b/components/mpas-albany-landice/src/shared/mpas_li_constants.F index 8a95d3dc15cb..abaf51a4994d 100644 --- a/components/mpas-albany-landice/src/shared/mpas_li_constants.F +++ b/components/mpas-albany-landice/src/shared/mpas_li_constants.F @@ -64,7 +64,7 @@ module li_constants 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 = 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 :: oceanFreezingTempDepthDependence = oceanFreezingTempPressureDependence * rho_water * gravity !< Rate of change of freezing temperature with depth (deg m^-1), fallback equivalent to shared coefficient + real (kind=RKIND), parameter, public :: oceanFreezingTempDepthDependence = oceanFreezingTempPressureDependence * rho_water * gravity !< Rate of change of freezing temperature with depth (deg m^-1), fallback equivalent to ocean_freezing_temperature_pressure_depth_dependence_reference 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 diff --git a/share/pcd.yaml b/share/pcd.yaml index b5b2755bc25a..8c4a17205be1 100644 --- a/share/pcd.yaml +++ b/share/pcd.yaml @@ -14,5 +14,5 @@ physical_constants_dictionary: description: Kinematic viscosity of freshwater at 0 C ocean_freezing_temperature_pressure_depth_dependence_reference: value: -7.28617688e-4 - units: C m-1 + units: C m^-1 description: Depth coefficient for pressure-driven ocean freezing temperature From 74da9e891e9a91f10a1e94d49bac9a499c3f7936 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 5 May 2026 21:50:59 +0000 Subject: [PATCH 15/22] Rename PCD ocean freezing depth constant for clarity Agent-Logs-Url: https://github.com/MALI-Dev/E3SM/sessions/a5a1e2e0-9606-4ef4-a46d-4466f200b763 Co-authored-by: trhille <17446278+trhille@users.noreply.github.com> --- components/mpas-albany-landice/src/shared/mpas_li_constants.F | 4 ++-- share/pcd.yaml | 2 +- share/util/pcd_const.F90 | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/mpas-albany-landice/src/shared/mpas_li_constants.F b/components/mpas-albany-landice/src/shared/mpas_li_constants.F index abaf51a4994d..1dae92693564 100644 --- a/components/mpas-albany-landice/src/shared/mpas_li_constants.F +++ b/components/mpas-albany-landice/src/shared/mpas_li_constants.F @@ -39,7 +39,7 @@ module li_constants use pcd_const, only: & glacier_ice_density => glacier_ice_density_reference, & kin_visc_water => freshwater_kinematic_viscosity_at_freezing_reference, & - oceanFreezingTempDepthDependence => ocean_freezing_temperature_pressure_depth_dependence_reference + oceanFreezingTempDepthDependence => ocean_freezing_temperature_depth_dependence_reference implicit none save @@ -64,7 +64,7 @@ module li_constants 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 = 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 :: oceanFreezingTempDepthDependence = oceanFreezingTempPressureDependence * rho_water * gravity !< Rate of change of freezing temperature with depth (deg m^-1), fallback equivalent to ocean_freezing_temperature_pressure_depth_dependence_reference + real (kind=RKIND), parameter, public :: oceanFreezingTempDepthDependence = oceanFreezingTempPressureDependence * rho_water * gravity !< Rate of change of freezing temperature with depth (deg m^-1), fallback equivalent to ocean_freezing_temperature_depth_dependence_reference 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 diff --git a/share/pcd.yaml b/share/pcd.yaml index 8c4a17205be1..0928374ee838 100644 --- a/share/pcd.yaml +++ b/share/pcd.yaml @@ -12,7 +12,7 @@ physical_constants_dictionary: value: 1.793e-6 units: m^2 s^-1 description: Kinematic viscosity of freshwater at 0 C - ocean_freezing_temperature_pressure_depth_dependence_reference: + ocean_freezing_temperature_depth_dependence_reference: value: -7.28617688e-4 units: C m^-1 description: Depth coefficient for pressure-driven ocean freezing temperature diff --git a/share/util/pcd_const.F90 b/share/util/pcd_const.F90 index ebf077bbac92..29a27dce16f0 100644 --- a/share/util/pcd_const.F90 +++ b/share/util/pcd_const.F90 @@ -5,5 +5,5 @@ module pcd_const real(R8), parameter :: glacier_ice_density_reference = 910.0_R8 ! [kg m^-3] real(R8), parameter :: freshwater_kinematic_viscosity_at_freezing_reference = 1.793e-6_R8 ! [m^2 s^-1] - real(R8), parameter :: ocean_freezing_temperature_pressure_depth_dependence_reference = -7.28617688e-4_R8 ! [C m^-1] + real(R8), parameter :: ocean_freezing_temperature_depth_dependence_reference = -7.28617688e-4_R8 ! [C m^-1] end module pcd_const From 4b7859351e101c571c8b3db56516abe8ac77ddcb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 5 May 2026 21:51:39 +0000 Subject: [PATCH 16/22] Clarify standalone ocean-freezing depth fallback comment Agent-Logs-Url: https://github.com/MALI-Dev/E3SM/sessions/a5a1e2e0-9606-4ef4-a46d-4466f200b763 Co-authored-by: trhille <17446278+trhille@users.noreply.github.com> --- components/mpas-albany-landice/src/shared/mpas_li_constants.F | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/mpas-albany-landice/src/shared/mpas_li_constants.F b/components/mpas-albany-landice/src/shared/mpas_li_constants.F index 1dae92693564..3336dbb5f9ba 100644 --- a/components/mpas-albany-landice/src/shared/mpas_li_constants.F +++ b/components/mpas-albany-landice/src/shared/mpas_li_constants.F @@ -64,7 +64,7 @@ module li_constants 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 = 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 :: oceanFreezingTempDepthDependence = oceanFreezingTempPressureDependence * rho_water * gravity !< Rate of change of freezing temperature with depth (deg m^-1), fallback equivalent to ocean_freezing_temperature_depth_dependence_reference + real (kind=RKIND), parameter, public :: oceanFreezingTempDepthDependence = oceanFreezingTempPressureDependence * rho_water * gravity !< Rate of change of freezing temperature with depth (deg m^-1), standalone equivalent to ocean_freezing_temperature_depth_dependence_reference 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 From 07eaec97687d493672181baf10770f34873796e4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 5 May 2026 21:52:16 +0000 Subject: [PATCH 17/22] Normalize PCD glacier density notation and shr_const comment spacing Agent-Logs-Url: https://github.com/MALI-Dev/E3SM/sessions/a5a1e2e0-9606-4ef4-a46d-4466f200b763 Co-authored-by: trhille <17446278+trhille@users.noreply.github.com> --- share/util/pcd_const.F90 | 2 +- share/util/shr_const_mod.F90 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/share/util/pcd_const.F90 b/share/util/pcd_const.F90 index 29a27dce16f0..5f8c024aab71 100644 --- a/share/util/pcd_const.F90 +++ b/share/util/pcd_const.F90 @@ -3,7 +3,7 @@ module pcd_const implicit none - real(R8), parameter :: glacier_ice_density_reference = 910.0_R8 ! [kg m^-3] + real(R8), parameter :: glacier_ice_density_reference = 0.910e3_R8 ! [kg m^-3] real(R8), parameter :: freshwater_kinematic_viscosity_at_freezing_reference = 1.793e-6_R8 ! [m^2 s^-1] real(R8), parameter :: ocean_freezing_temperature_depth_dependence_reference = -7.28617688e-4_R8 ! [C m^-1] end module pcd_const diff --git a/share/util/shr_const_mod.F90 b/share/util/shr_const_mod.F90 index e170e371c7ef..c1abbb022f0b 100644 --- a/share/util/shr_const_mod.F90 +++ b/share/util/shr_const_mod.F90 @@ -47,7 +47,7 @@ MODULE shr_const_mod real(R8),parameter :: SHR_CONST_RHOFW = 1.000e3_R8 ! density of fresh water ~ kg/m^3 real(R8),parameter :: SHR_CONST_RHOSW = 1.026e3_R8 ! density of sea water ~ kg/m^3 real(R8),parameter :: SHR_CONST_RHOICE = 0.917e3_R8 ! density of ice ~ kg/m^3 - real(R8),parameter :: SHR_CONST_RHOGLACIERICE = glacier_ice_density_reference ! density of glacier ice ~ kg/m^3 + real(R8),parameter :: SHR_CONST_RHOGLACIERICE = glacier_ice_density_reference ! density of glacier ice ~ kg/m^3 real(R8),parameter :: SHR_CONST_CPDAIR = 1.00464e3_R8 ! specific heat of dry air ~ J/kg/K real(R8),parameter :: SHR_CONST_CPWV = 1.810e3_R8 ! specific heat of water vap ~ J/kg/K real(R8),parameter :: SHR_CONST_CPVIR = (SHR_CONST_CPWV/SHR_CONST_CPDAIR)-1.0_R8 ! CPWV/CPDAIR - 1.0 From fbdf09d8f814d7950da5929babcf0c5b5282e804 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 5 May 2026 21:52:54 +0000 Subject: [PATCH 18/22] Refine PCD metadata category and constant descriptions Agent-Logs-Url: https://github.com/MALI-Dev/E3SM/sessions/a5a1e2e0-9606-4ef4-a46d-4466f200b763 Co-authored-by: trhille <17446278+trhille@users.noreply.github.com> --- share/pcd.yaml | 2 +- share/util/pcd_const.F90 | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/share/pcd.yaml b/share/pcd.yaml index 0928374ee838..31a7511ed2ea 100644 --- a/share/pcd.yaml +++ b/share/pcd.yaml @@ -3,7 +3,7 @@ physical_constants_dictionary: institution: E3SM Project description: Minimal PCD constants used by MALI/MPAS-Ocean shared-constant wiring - earth_seawater: + ice_ocean_properties: glacier_ice_density_reference: value: 910.0 units: kg m^-3 diff --git a/share/util/pcd_const.F90 b/share/util/pcd_const.F90 index 5f8c024aab71..d4bc7ef9446e 100644 --- a/share/util/pcd_const.F90 +++ b/share/util/pcd_const.F90 @@ -3,7 +3,7 @@ module pcd_const implicit none - real(R8), parameter :: glacier_ice_density_reference = 0.910e3_R8 ! [kg m^-3] - real(R8), parameter :: freshwater_kinematic_viscosity_at_freezing_reference = 1.793e-6_R8 ! [m^2 s^-1] - real(R8), parameter :: ocean_freezing_temperature_depth_dependence_reference = -7.28617688e-4_R8 ! [C m^-1] + real(R8), parameter :: glacier_ice_density_reference = 0.910e3_R8 ! reference glacier-ice density ~ kg/m^3 + real(R8), parameter :: freshwater_kinematic_viscosity_at_freezing_reference = 1.793e-6_R8 ! kinematic viscosity of freshwater at 0 C ~ m^2/s + real(R8), parameter :: ocean_freezing_temperature_depth_dependence_reference = -7.28617688e-4_R8 ! pressure-driven ocean freezing temperature depth coefficient ~ C/m end module pcd_const From a95ea9cab5465c63d19f041890a6cb0179f81171 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 5 May 2026 21:53:57 +0000 Subject: [PATCH 19/22] Remove shr_const-to-PCD dependency and tighten PCD module visibility Agent-Logs-Url: https://github.com/MALI-Dev/E3SM/sessions/a5a1e2e0-9606-4ef4-a46d-4466f200b763 Co-authored-by: trhille <17446278+trhille@users.noreply.github.com> --- .../mpas-albany-landice/src/shared/mpas_li_constants.F | 2 +- components/mpas-ocean/src/shared/mpas_ocn_constants.F | 7 ++++--- share/util/pcd_const.F90 | 5 +++++ share/util/shr_const_mod.F90 | 2 -- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/components/mpas-albany-landice/src/shared/mpas_li_constants.F b/components/mpas-albany-landice/src/shared/mpas_li_constants.F index 3336dbb5f9ba..1243e3f3a9c2 100644 --- a/components/mpas-albany-landice/src/shared/mpas_li_constants.F +++ b/components/mpas-albany-landice/src/shared/mpas_li_constants.F @@ -64,7 +64,7 @@ module li_constants 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 = 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 :: oceanFreezingTempDepthDependence = oceanFreezingTempPressureDependence * rho_water * gravity !< Rate of change of freezing temperature with depth (deg m^-1), standalone equivalent to ocean_freezing_temperature_depth_dependence_reference + real (kind=RKIND), parameter, public :: oceanFreezingTempDepthDependence = oceanFreezingTempPressureDependence * rho_water * gravity !< Rate of change of freezing temperature with depth (deg m^-1), used in standalone (#else) and intended to match ocean_freezing_temperature_depth_dependence_reference 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 diff --git a/components/mpas-ocean/src/shared/mpas_ocn_constants.F b/components/mpas-ocean/src/shared/mpas_ocn_constants.F index 42321febee74..6388e1bc0de4 100644 --- a/components/mpas-ocean/src/shared/mpas_ocn_constants.F +++ b/components/mpas-ocean/src/shared/mpas_ocn_constants.F @@ -24,8 +24,9 @@ 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 + use pcd_const, only: glacier_ice_density_reference #endif implicit none @@ -167,7 +168,7 @@ 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_glacier_ice_default = SHR_CONST_RHOGLACIERICE ! kg/m^3 + rho_glacier_ice_default = glacier_ice_density_reference ! 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 diff --git a/share/util/pcd_const.F90 b/share/util/pcd_const.F90 index d4bc7ef9446e..3eadfb32bc61 100644 --- a/share/util/pcd_const.F90 +++ b/share/util/pcd_const.F90 @@ -2,6 +2,11 @@ module pcd_const use shr_kind_mod, only : R8 => shr_kind_r8 implicit none + private + + public :: glacier_ice_density_reference + public :: freshwater_kinematic_viscosity_at_freezing_reference + public :: ocean_freezing_temperature_depth_dependence_reference real(R8), parameter :: glacier_ice_density_reference = 0.910e3_R8 ! reference glacier-ice density ~ kg/m^3 real(R8), parameter :: freshwater_kinematic_viscosity_at_freezing_reference = 1.793e-6_R8 ! kinematic viscosity of freshwater at 0 C ~ m^2/s diff --git a/share/util/shr_const_mod.F90 b/share/util/shr_const_mod.F90 index c1abbb022f0b..fe8a4bb08286 100644 --- a/share/util/shr_const_mod.F90 +++ b/share/util/shr_const_mod.F90 @@ -6,7 +6,6 @@ MODULE shr_const_mod use shr_kind_mod, only : R8 => shr_kind_r8 - use pcd_const, only : glacier_ice_density_reference !---------------------------------------------------------------------------- ! physical constants (all data public) @@ -47,7 +46,6 @@ MODULE shr_const_mod real(R8),parameter :: SHR_CONST_RHOFW = 1.000e3_R8 ! density of fresh water ~ kg/m^3 real(R8),parameter :: SHR_CONST_RHOSW = 1.026e3_R8 ! density of sea water ~ kg/m^3 real(R8),parameter :: SHR_CONST_RHOICE = 0.917e3_R8 ! density of ice ~ kg/m^3 - real(R8),parameter :: SHR_CONST_RHOGLACIERICE = glacier_ice_density_reference ! density of glacier ice ~ kg/m^3 real(R8),parameter :: SHR_CONST_CPDAIR = 1.00464e3_R8 ! specific heat of dry air ~ J/kg/K real(R8),parameter :: SHR_CONST_CPWV = 1.810e3_R8 ! specific heat of water vap ~ J/kg/K real(R8),parameter :: SHR_CONST_CPVIR = (SHR_CONST_CPWV/SHR_CONST_CPDAIR)-1.0_R8 ! CPWV/CPDAIR - 1.0 From 5e7af955292d3491bdbe6728d2e89a16d12e243d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 5 May 2026 21:54:33 +0000 Subject: [PATCH 20/22] Add documentation notes to pcd_const and pcd.yaml version metadata Agent-Logs-Url: https://github.com/MALI-Dev/E3SM/sessions/a5a1e2e0-9606-4ef4-a46d-4466f200b763 Co-authored-by: trhille <17446278+trhille@users.noreply.github.com> --- share/pcd.yaml | 1 + share/util/pcd_const.F90 | 2 ++ 2 files changed, 3 insertions(+) diff --git a/share/pcd.yaml b/share/pcd.yaml index 31a7511ed2ea..153d7e57e904 100644 --- a/share/pcd.yaml +++ b/share/pcd.yaml @@ -1,5 +1,6 @@ physical_constants_dictionary: version_number: 0.1.0 + version_note: Initial in-repo PCD constants for MALI/MPAS-Ocean shared-default alignment; increment when values or names change. institution: E3SM Project description: Minimal PCD constants used by MALI/MPAS-Ocean shared-constant wiring diff --git a/share/util/pcd_const.F90 b/share/util/pcd_const.F90 index 3eadfb32bc61..b19f131a8d80 100644 --- a/share/util/pcd_const.F90 +++ b/share/util/pcd_const.F90 @@ -8,6 +8,8 @@ module pcd_const public :: freshwater_kinematic_viscosity_at_freezing_reference public :: ocean_freezing_temperature_depth_dependence_reference + ! Constants in this module are sourced from share/pcd.yaml and intended for + ! cross-component consistency where MALI/MPAS-Ocean need aligned defaults. real(R8), parameter :: glacier_ice_density_reference = 0.910e3_R8 ! reference glacier-ice density ~ kg/m^3 real(R8), parameter :: freshwater_kinematic_viscosity_at_freezing_reference = 1.793e-6_R8 ! kinematic viscosity of freshwater at 0 C ~ m^2/s real(R8), parameter :: ocean_freezing_temperature_depth_dependence_reference = -7.28617688e-4_R8 ! pressure-driven ocean freezing temperature depth coefficient ~ C/m From e95a5833b132e31ef2676e429d3b239149f0d83b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 5 May 2026 21:55:13 +0000 Subject: [PATCH 21/22] Simplify standalone depth-coefficient comment wording Agent-Logs-Url: https://github.com/MALI-Dev/E3SM/sessions/a5a1e2e0-9606-4ef4-a46d-4466f200b763 Co-authored-by: trhille <17446278+trhille@users.noreply.github.com> --- components/mpas-albany-landice/src/shared/mpas_li_constants.F | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/mpas-albany-landice/src/shared/mpas_li_constants.F b/components/mpas-albany-landice/src/shared/mpas_li_constants.F index 1243e3f3a9c2..50898b17f659 100644 --- a/components/mpas-albany-landice/src/shared/mpas_li_constants.F +++ b/components/mpas-albany-landice/src/shared/mpas_li_constants.F @@ -64,7 +64,7 @@ module li_constants 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 = 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 :: oceanFreezingTempDepthDependence = oceanFreezingTempPressureDependence * rho_water * gravity !< Rate of change of freezing temperature with depth (deg m^-1), used in standalone (#else) and intended to match ocean_freezing_temperature_depth_dependence_reference + real (kind=RKIND), parameter, public :: oceanFreezingTempDepthDependence = oceanFreezingTempPressureDependence * rho_water * gravity !< Rate of change of freezing temperature with depth (deg m^-1), standalone computation intended to match ocean_freezing_temperature_depth_dependence_reference 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 From b1ba1c4a89bbff73bf58558353e01ddbb99784bb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 5 May 2026 22:04:09 +0000 Subject: [PATCH 22/22] Restore autogenerated PCD files and stop direct pcd_const usage Agent-Logs-Url: https://github.com/MALI-Dev/E3SM/sessions/dfd195c1-4eeb-4b8e-9d97-572d8c024e74 Co-authored-by: trhille <17446278+trhille@users.noreply.github.com> --- .../src/shared/mpas_li_constants.F | 13 +- .../src/shared/mpas_ocn_constants.F | 2 - share/pcd.yaml | 866 +++++++++++++++++- share/util/CMakeLists.txt | 2 +- share/util/pcd_const.F90 | 111 ++- 5 files changed, 954 insertions(+), 40 deletions(-) diff --git a/components/mpas-albany-landice/src/shared/mpas_li_constants.F b/components/mpas-albany-landice/src/shared/mpas_li_constants.F index 50898b17f659..c9a4a4b133a3 100644 --- a/components/mpas-albany-landice/src/shared/mpas_li_constants.F +++ b/components/mpas-albany-landice/src/shared/mpas_li_constants.F @@ -36,10 +36,6 @@ module li_constants iceConductivity => SHR_CONST_CONDICE, & kelvin_to_celsius => SHR_CONST_TKFRZ, & seconds_per_day => SHR_CONST_CDAY - use pcd_const, only: & - glacier_ice_density => glacier_ice_density_reference, & - kin_visc_water => freshwater_kinematic_viscosity_at_freezing_reference, & - oceanFreezingTempDepthDependence => ocean_freezing_temperature_depth_dependence_reference implicit none save @@ -55,22 +51,23 @@ module li_constants 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 :: glacier_ice_density = 910.0_RKIND !< Density of glacier ice (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.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, 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 = 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 :: oceanFreezingTempDepthDependence = oceanFreezingTempPressureDependence * rho_water * gravity !< Rate of change of freezing temperature with depth (deg m^-1), standalone computation intended to match ocean_freezing_temperature_depth_dependence_reference 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 :: 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 diff --git a/components/mpas-ocean/src/shared/mpas_ocn_constants.F b/components/mpas-ocean/src/shared/mpas_ocn_constants.F index 6388e1bc0de4..b4172536eb90 100644 --- a/components/mpas-ocean/src/shared/mpas_ocn_constants.F +++ b/components/mpas-ocean/src/shared/mpas_ocn_constants.F @@ -26,7 +26,6 @@ module ocn_constants #ifdef MPAS_ESM_SHR_CONST use shr_kind_mod, only: SHR_KIND_R8 use shr_const_mod - use pcd_const, only: glacier_ice_density_reference #endif implicit none @@ -168,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_glacier_ice_default = glacier_ice_density_reference ! 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 diff --git a/share/pcd.yaml b/share/pcd.yaml index 153d7e57e904..fac294d58977 100644 --- a/share/pcd.yaml +++ b/share/pcd.yaml @@ -1,19 +1,855 @@ +# Physical Constants Dictionary (PCD) +# +# This YAML file contains a dictionary of physical constants. The constants are grouped +# in categories, such as mathematical (like pi), universal physical constants (such as +# the Boltzman constant), water properties, and more. Each constant in these groups +# provides important data and metadata, such as name, units, uncertainty, a reference, +# and more. More details can be found in the upstream project github documentation: +# +# https://icams-us.github.io/PhysicalConstantsDictionary/ +# + physical_constants_dictionary: version_number: 0.1.0 - version_note: Initial in-repo PCD constants for MALI/MPAS-Ocean shared-default alignment; increment when values or names change. institution: E3SM Project - description: Minimal PCD constants used by MALI/MPAS-Ocean shared-constant wiring + description: Community-based dictionary for consistent physical constant sets + contact: E3SM Project + + references: + ASHandbook1964: + description: "Standard reference for mathematical functions and constants" + citation: " + Abramowitz, A., and Stegun, I.A., Handbook of Mathematical Functions + With Formulas, Graphs, and Mathematical Tables, DOC/National Bureau of Standards, + Applied Mathematics Series, 55, June 1964. + " + NIST_CODATA2022: + description: "CODATA 2022 recommended values of fundamental physical constants" + citation: " + Mohr, P.J., Newell, D.B., Taylor, B.N. and Tiesinga, E., Rev. Mod. Phys., 97, + 025002 (2025); doi: 10.1103/RevModPhys.97.025002 + " + GRS80: + description: "Geodetic Reference System 1980 for Earth's physical parameters" + citation: " + Moritz, H, Geodetic Reference System 1980. J. Geodesy, 74 128-133, 2000. + " + TIM_SORCE_2005: + description: "Total solar irradiance measurements from SORCE TIM instrument" + citation: " + Kopp, G., Lawrence, G., and Rottman, G., The Total Irradiance Monitor (TIM): + Science results, Sol. Phys., 230, 129-139, 2005. doi:10.1007/s11207-005-7433-9. + " + IAPWS_95: + description: "IAPWS_95 formulation for thermodynamic properties of water" + citation: " + Wagner, W., and Pruss, A., The IAPWS Formulation 1995 for the Thermodynamic + Properties of Ordinary Water Substance for General and Scientific Use, + J. Phys. Chem. Ref. Data, 31, 387-535, 2002. + " + SI2019: + description: "SI brochure defining units and accepted non-SI units" + citation: " + Bureau International des Poids et Mesures (BIPM), The International + System of Units (SI), 9th edition, 2019. + " + CGPM1948_1954: + description: "CGPM resolutions linking the triple point and the 0.01 degree offset" + citation: " + 9th CGPM (1948), Resolution 3, stating that the zero of the centesimal + thermodynamic scale is 0.0100 degree below the triple point of water + (DOI: 10.59161/CGPM1948RES3E); + and 10th CGPM (1954), Resolution 3, assigning the triple point of water + the exact temperature 273.16 kelvin + (DOI: 10.59161/CGPM1954RES3E). + " + US_StdAtm_1976: + description: "U.S. Standard Atmosphere reference state values" + citation: " + NOAA, NASA, and USAF, U.S. Standard Atmosphere, 1976, + U.S. Government Printing Office, Washington, D.C., 1976. + " + CRC2018: + description: "CRC handbook tabulations for thermophysical properties" + citation: " + Rumble, J. R. (ed.), CRC Handbook of Chemistry and Physics, + 99th Edition, CRC Press, 2018. + " + Smithsonian1951: + description: "Smithsonian meteorological tables with latent-heat tabulations" + citation: " + List, R. J., Smithsonian Meteorological Tables, + Smithsonian Institution, Washington, D.C., 1951. + " + Gill_1982: + description: "Atmosphere-Ocean Dynamics textbook with canonical Boussinesq scaling" + citation: " + Gill, A. E., Atmosphere-Ocean Dynamics, + International Geophysics Series, Vol. 30, + Academic Press, 1982. + " + Levitus1982: + description: "Climatological atlas source for world-ocean salinity fields" + citation: " + Levitus, S., Climatological Atlas of the World Ocean, + NOAA Professional Paper 13, U.S. Department of Commerce, 1982. + " + IUPAC1997: + description: "IUPAC Commission on Atomic Weights and Isotopic Abundances, 1997 table" + citation: " + IUPAC Commission on Atomic Weights and Isotopic Abundances, + Atomic Weights of the Elements 1997, + Pure Appl. Chem., 71(8), 1593-1607, 1999. + doi:10.1351/pac199971081593. + " + Untersteiner1961: + description: "Arctic sea-ice mass and heat budget study" + citation: " + Untersteiner, N., On the Mass and Heat Budget of Arctic Sea Ice, + Archiv für Meteorologie, Geophysik und Bioklimatologie, Serie A, 1961. + " + MaykutUntersteiner1971: + description: "Time-dependent thermodynamic sea-ice model results" + citation: " + Maykut, G. A., and N. Untersteiner, Some results from a time-dependent + thermodynamic model of sea ice, Journal of Geophysical Research, + 76(6), 1550-1575, 1971. + " + CuffeyPaterson2010: + description: "Glaciology textbook reference for ice physical properties" + citation: " + Cuffey, K. M., and W. S. B. Paterson, The Physics of Glaciers, + 4th ed., Butterworth-Heinemann, 2010. + " + IAEA1995: + description: "IAEA reference materials for stable isotopes of light elements" + citation: " + IAEA, Reference and intercomparison materials for stable isotopes of + light elements, IAEA-TECDOC-825, Vienna, 1995. + " + Craig1957: + description: "Isotopic standards for carbon and oxygen" + citation: " + Craig, H., Isotopic standards for carbon and oxygen and correction + factors for mass-spectrometric analysis of carbon dioxide, + Geochimica et Cosmochimica Acta, 12(1-2), 133-149, 1957. + " + + set: + - mathematical: + description: " + Common mathematical constants. + " + entries: + - name: pi + value: 3.141592653589793238462643 + units: none + prec: double + type: strict + uncertainty: exact + reference: ASHandbook1964 + description: " + Ratio of a circle's circumference to its diameter. + " + - name: e + value: 2.718281828459045235360287 + units: none + prec: double + type: strict + uncertainty: exact + reference: ASHandbook1964 + description: " + Base of natural logarithms. + " + - name: em_gamma + value: 0.577215664901532860606512 + units: none + prec: double + type: strict + uncertainty: exact + reference: ASHandbook1964 + description: " + Euler-Mascheroni constant. + " + - name: radian + value: 57.295779513082320876798155 + units: degree + prec: double + type: strict + uncertainty: exact + reference: ASHandbook1964 + description: " + Radian to degrees conversion factor. + " + - name: degree + value: 0.017453292519943295769237 + units: rad + prec: double + type: strict + uncertainty: exact + reference: ASHandbook1964 + description: " + Degree to radiant conversion factor. + " + - name: square_root_of_2 + value: 1.4142135623730950488 + units: rad + prec: double + type: strict + uncertainty: exact + reference: ASHandbook1964 + description: " + Square root of 2. + " + - name: square_root_of_3 + value: 1.7320508075688772935 + units: rad + prec: double + type: strict + uncertainty: exact + reference: ASHandbook1964 + description: " + Square root of 3. + " + - universal_physical: + description: " + Fundamental Physical Constants + " + entries: + - name: speed_of_light_in_vacuum + value: 299792458 + units: m s-1 + prec: double + type: strict + uncertainty: exact + reference: NIST_CODATA2022 + description: " + The speed at which light propagates in vacuum. + Albert Einstein postulated that the speed of light with respect to + an inertial frame is independent of the motion of the light source. + " + - name: newtonian_gravitation_constant + value: 6.67430E-11 + units: m3 kg-1 s-2 + prec: double + type: strict + relative_uncertainty: 2.2E-05 + reference: NIST_CODATA2022 + description: " + Empirical constant used to calculate the attractive force between + two bodies according to Newton's law of universal gravitation. + " + - name: standard_acceleration_of_gravity + value: 9.80665 + units: m s-2 + prec: double + type: strict + uncertainty: exact + reference: NIST_CODATA2022 + description: " + Nominal acceleration of an object in a vacuum at sea level at a + geodetic latitude of 45 degrees. + " + - name: standard_atmosphere + value: 101325 + units: Pa + prec: double + type: strict + uncertainty: exact + reference: NIST_CODATA2022 + description: " + Unit of pressure equivalent to 760 mmHg (torr), 29.92 inches Hg and 14.696 psi. + " + - name: avogadro_constant + value: 6.02214076E+23 + units: mol-1 + prec: double + type: strict + uncertainty: exact + reference: NIST_CODATA2022 + description: " + Number of particles (atoms, molecules) in one mole. + " + - name: boltzmann_constant + value: 1.380649E-23 + units: J K-1 + prec: double + type: strict + uncertainty: exact + reference: NIST_CODATA2022 + description: " + Proportionality constant between the average kinetic energy + of particles in a gas and its temperature. + " + - name: stefan_boltzmann_constant + value: 5.670374419E-08 + units: W m-2 K-4 + prec: double + type: strict + uncertainty: exact + reference: NIST_CODATA2022 + description: " + Proportionality constant between the power emitted by + a black body and the fourth power of its temperature, + according to Stefan-Boltzmann's law. + " + + - name: planck_constant + value: 6.62607015E-34 + units: J Hz-1 + prec: double + type: strict + uncertainty: exact + reference: NIST_CODATA2022 + description: " + Proportionality constant between the wavelength of + a photon and its energy. + " - ice_ocean_properties: - glacier_ice_density_reference: - value: 910.0 - units: kg m^-3 - description: Reference density for glacier ice - freshwater_kinematic_viscosity_at_freezing_reference: - value: 1.793e-6 - units: m^2 s^-1 - description: Kinematic viscosity of freshwater at 0 C - ocean_freezing_temperature_depth_dependence_reference: - value: -7.28617688e-4 - units: C m^-1 - description: Depth coefficient for pressure-driven ocean freezing temperature + - name: molar_gas_constant + value: 8.314462618 + units: J mol-1 K-1 + prec: double + type: strict + uncertainty: exact + reference: NIST_CODATA2022 + description: " + Gas constant used in the ideal gas law. It is equivalent to + Boltzmann's constant espressed in J mol-1 K-1. + " + - name: molar_volume_of_ideal_gas + value: 22.71095464E-03 + units: m3 mol-1 + prec: double + type: strict + uncertainty: exact + reference: NIST_CODATA2022 + description: " + Ideal gas molar volume as computed by the ideal gas law (RT/p) + at Standard Temperature and Pressure (STP: 273.15K, 100 kPa). + " + - chemical_molar_masses: + description: " + Reference molar masses for chemical elements and compounds used + across model components. + " + entries: + - name: carbon_molar_mass_reference + value: 0.0120107 + units: kg mol-1 + prec: double + type: strict + reference: IUPAC1997 + description: " + Reference molar mass of elemental carbon. + " + - name: oxygen_molar_mass_reference + value: 0.0159994 + units: kg mol-1 + prec: double + type: strict + reference: IUPAC1997 + description: " + Reference molar mass of elemental oxygen. + " + - name: carbon_dioxide_molar_mass_reference + value: 0.0440095 + units: kg mol-1 + prec: double + type: strict + reference: IUPAC1997 + description: " + Derived from IUPAC standard atomic weights as + carbon_molar_mass_reference + 2*oxygen_molar_mass_reference. + " + - earth_physical: + description: " + Properties of the planet Earth + " + entries: + - name: geocentric_gravitational_constant + value: 3986005E+08 + units: m3 s-2 + prec: double + type: strict + uncertainty: exact + reference: GRS80 + description: " + Product (GM) of the mass of the Earth (M) and the universal gravitational + constant (G). + " + - name: semimajor_axis + value: 6378137 + units: m + prec: double + type: strict + uncertainty: exact + reference: GRS80 + description: " + The semi-major axis of Earth's reference ellipsoid. + " + - name: dynamic_form_factor + value: 108263E-08 + units: none + prec: double + type: strict + uncertainty: exact + reference: GRS80 + description: " + Mechanical ellipticity of Earth. + " + - name: angular_velocity + value: 7292115E-11 + units: rad s-1 + prec: double + type: strict + uncertainty: exact + reference: GRS80 + description: " + Angular velocity of Earth's rotation. + " + - name: semiminor_axis + value: 6356752.3141 + units: m + prec: double + type: strict + uncertainty: exact + reference: GRS80 + description: " + The semi-major axis of Earth's reference ellipsoid. + Derived constant. + " + - name: flattening + value: 0.00335281068118 + units: none + prec: double + type: strict + uncertainty: exact + reference: GRS80 + description: " + Defined as f = (semimajor_axis - semiminor_axis) / semimajor_axis. + Derived constant. + " + - name: reciprocal_flattening + value: 298.257222101 + units: none + prec: double + type: strict + uncertainty: exact + reference: GRS80 + description: " + Defined as 1/f. Derived constant. + " + - name: mean_radius + value: 6371008.7714 + units: m + prec: double + type: strict + uncertainty: exact + reference: GRS80 + description: " + Derived constant. Equal to (2 semimajor_axis + semiminor_axis) / 3. + " + - name: radius_of_sphere_of_same_surface + value: 6371007.1810 + units: m + prec: double + type: strict + uncertainty: exact + reference: GRS80 + description: " + Radius of Earth's reference sphere with same surface as ellipsoid's. + Derived constant. + " + - name: radius_of_sphere_of_same_volume + value: 6371000.7900 + units: m + prec: double + type: strict + uncertainty: exact + reference: GRS80 + description: " + Radius of Earth's reference sphere with same volume as ellipsoid's. + Derived constant. + " + - solar: + description: " + Properties of the Sun + " + entries: + - name: total_solar_irradiance + value: 1360.8 + units: W m-2 + prec: double + type: strict + uncertainty: 0.5 + reference: TIM_SORCE_2005 + description: " + Most probable value of total solar irradiance representative of + solar minimum (aka solar constant). + " + - water: + description: " + Properties of pure water + " + entries: + - name: water_molar_mass + value: 0.018015268 + units: kg mol-1 + prec: double + type: strict + uncertainty: exact + reference: IAPWS_95 + description: " + Molar mass of H2O. + " + - name: water_specific_gas_constant + value: 0.46151805 + units: kJ kg-1 K-1 + prec: double + type: strict + uncertainty: exact + reference: IAPWS_95 + description: " + Specific gas constant for water vapor. + " + - name: water_triple_point_temperature + value: 273.16 + units: K + prec: double + type: strict + uncertainty: exact + reference: IAPWS_95 + description: " + Triple point temperature of H2O. + " + - name: water_triple_point_pressure + value: 611.655 + units: Pa + prec: double + type: strict + uncertainty: exact + reference: IAPWS_95 + description: " + Triple point pressure of H2O. + Calculated from Eq. (6.4). + " + - name: liquid_water_triple_point_density + value: 999.793 + units: kg m-3 + prec: double + type: strict + uncertainty: exact + reference: IAPWS_95 + description: " + Triple point density of liquid H2O. + Calculated from Eq. (6.4). + " + - name: vapor_water_triple_point_density + value: 0.00485458 + units: kg m-3 + prec: double + type: strict + uncertainty: exact + reference: IAPWS_95 + description: " + Triple point density of vapor H2O. + Calculated from Eq. (6.4). + " + - name: pure_water_freezing_temperature_reference + value: 273.15 + units: K + prec: double + type: strict + reference: CGPM1948_1954 + description: " + Conventional 0 C reference temperature in kelvin (273.15 K), + linked historically to the water-triple-point definition and the + 0.01 degree centesimal offset. + " + - name: pure_water_density_reference + value: 1000.0 + units: kg m-3 + prec: double + type: strict + reference: Gill_1982 + description: " + Conventional reference density of pure water used in coupled + modeling; this is an approximation and not an exact + thermodynamic density at a specific state point. + " + - name: pure_water_specific_heat_capacity_reference + value: 4188.0 + units: J kg-1 K-1 + prec: double + type: strict + reference: Smithsonian1951 + description: " + Conventional reference specific heat capacity of pure water. + " + - name: latent_heat_of_fusion_reference + value: 333700.0 + units: J kg-1 + prec: double + type: strict + reference: CRC2018 + description: " + Reference latent heat released during freezing or absorbed during + melting of water. + " + - name: latent_heat_of_vaporization_reference + value: 2501000.0 + units: J kg-1 + prec: double + type: strict + reference: Smithsonian1951 + description: " + Reference latent heat required to convert liquid water to vapor. + " + - name: latent_heat_of_sublimation_reference + value: 2834700.0 + units: J kg-1 + prec: double + type: strict + reference: Smithsonian1951 + description: " + Derived constant. Defined as latent_heat_of_fusion_reference + + latent_heat_of_vaporization_reference. + " + - earth_atmosphere: + description: " + Thermophysical reference constants primarily associated with + Earth's atmospheric processes, and used across coupled components + " + entries: + - name: dry_air_molar_mass_reference + value: 0.028966 + units: kg mol-1 + prec: double + type: strict + reference: Smithsonian1951 + description: " + Reference molar mass of dry air used in atmospheric + thermodynamic parameterizations. + " + - name: water_vapor_molar_mass_reference + value: 0.018016 + units: kg mol-1 + prec: double + type: strict + reference: Smithsonian1951 + description: " + Reference molar mass of water vapor used in atmospheric + thermodynamic parameterizations. + " + - name: dry_air_specific_gas_constant_reference + value: 287.04213968100532 + units: J kg-1 K-1 + prec: double + type: strict + reference: US_StdAtm_1976 + description: " + Derived constant. Defined as molar_gas_constant / + dry_air_molar_mass_reference. + " + - name: water_vapor_specific_gas_constant_reference + value: 461.50436378774424 + units: J kg-1 K-1 + prec: double + type: strict + reference: US_StdAtm_1976 + description: " + Derived constant. Defined as molar_gas_constant / + water_vapor_molar_mass_reference. + " + - name: dry_air_density_at_standard_temperature_and_pressure + value: 1.2923190576466714 + units: kg m-3 + prec: double + type: strict + reference: US_StdAtm_1976 + description: " + Derived constant. Defined as standard_atmosphere / + (dry_air_specific_gas_constant_reference * + pure_water_freezing_temperature). + " + - name: dry_air_specific_heat_capacity_reference + value: 1004.64 + units: J kg-1 K-1 + prec: double + type: strict + reference: Smithsonian1951 + description: " + Reference specific heat capacity of dry air at constant pressure. + " + - name: water_vapor_specific_heat_capacity_reference + value: 1810.0 + units: J kg-1 K-1 + prec: double + type: strict + reference: Smithsonian1951 + description: " + Reference specific heat capacity of water vapor used in + atmospheric thermodynamic parameterizations. + " + - earth_seawater: + description: " + Thermophysical reference constants associated with seawater (both + liquid and solid) on Earth + " + entries: + - name: seawater_density_reference + value: 1026.0 + units: kg m-3 + prec: double + type: strict + reference: Gill_1982 + description: " + Canonical reference-scale seawater density; model adopts + 1026 kg m-3. + " + - name: seawater_specific_heat_capacity_reference + value: 3996.0 + units: J kg-1 K-1 + prec: double + type: strict + reference: Gill_1982 + description: " + Reference seawater specific heat capacity. + " + - name: ocean_reference_salinity + value: 34.7 + units: g kg-1 + prec: double + type: strict + reference: Levitus1982 + description: " + Reference ocean salinity. + " + - name: speed_of_sound_in_seawater_reference + value: 1500.0 + units: m s-1 + prec: double + type: strict + reference: Gill_1982 + description: " + Typical reference speed of sound in seawater. + " + - name: vsmow_ratio_18o_to_16o + value: 2005.2E-6 + units: none + prec: double + type: strict + reference: IAEA1995 + description: " + Isotopic ratio 18O/16O in Vienna Standard Mean Ocean Water (VSMOW). + " + - name: vsmow_ratio_17o_to_16o + value: 379.0E-6 + units: none + prec: double + type: strict + reference: IAEA1995 + description: " + Isotopic ratio 17O/16O in Vienna Standard Mean Ocean Water (VSMOW). + " + - name: vsmow_fraction_16o_of_total_oxygen + value: 0.997628 + units: none + prec: double + type: strict + reference: IAEA1995 + description: " + Isotopic fraction of 16O in total oxygen for Vienna Standard Mean + Ocean Water (VSMOW). + " + - name: vsmow_ratio_2h_to_1h + value: 155.76E-6 + units: none + prec: double + type: strict + reference: IAEA1995 + description: " + Isotopic ratio 2H/1H in Vienna Standard Mean Ocean Water (VSMOW). + " + - name: vsmow_ratio_3h_to_1h + value: 1.85E-6 + units: none + prec: double + type: strict + reference: IAEA1995 + description: " + Isotopic ratio 3H/1H in Vienna Standard Mean Ocean Water (VSMOW). + " + - name: vsmow_fraction_1h_of_total_hydrogen + value: 0.99984426 + units: none + prec: double + type: strict + reference: IAEA1995 + description: " + Isotopic fraction of 1H in total hydrogen for Vienna Standard Mean + Ocean Water (VSMOW). + " + - name: sea_ice_density_reference + value: 917.0 + units: kg m-3 + prec: double + type: strict + reference: Smithsonian1951 + description: " + Reference density of sea ice. + " + - name: sea_ice_specific_heat_capacity_reference + value: 2117.27 + units: J kg-1 K-1 + prec: double + type: strict + reference: Smithsonian1951 + description: " + Reference specific heat capacity of sea ice. + " + - name: sea_ice_thermal_conductivity_reference + value: 2.1 + units: W m-1 K-1 + prec: double + type: strict + reference: MaykutUntersteiner1971 + description: " + Reference thermal conductivity of sea ice. + " + - name: sea_ice_reference_salinity + value: 4.0 + units: g kg-1 + prec: double + type: strict + reference: Untersteiner1961 + description: " + Reference sea-ice salinity. + " + - name: sea_ice_thermal_diffusivity_reference + value: 1.0863739733765951E-06 + units: m2 s-1 + prec: double + type: strict + reference: CuffeyPaterson2010 + description: " + Derived constant. Defined as + sea_ice_thermal_conductivity_reference / + (sea_ice_density_reference * sea_ice_specific_heat_capacity_reference). + " + - isotopic_standards: + description: " + Isotopic ratio and fraction standards used across Earth system components + " + entries: + - name: pee_dee_belemnite_ratio_13c_to_12c + value: 0.0112372 + units: none + prec: double + type: strict + reference: Craig1957 + description: " + Reference isotopic ratio 13C/12C for the Pee Dee Belemnite carbon + isotope standard. + " diff --git a/share/util/CMakeLists.txt b/share/util/CMakeLists.txt index 9ddec5a31467..b6a7284d2539 100644 --- a/share/util/CMakeLists.txt +++ b/share/util/CMakeLists.txt @@ -8,9 +8,9 @@ sourcelist_to_parent(share_genf90_sources) list(APPEND share_sources "${share_genf90_sources}") list(APPEND share_sources + pcd_const.F90 shr_file_mod.F90 shr_kind_mod.F90 - pcd_const.F90 shr_const_mod.F90 shr_sys_mod.F90 shr_log_mod.F90 diff --git a/share/util/pcd_const.F90 b/share/util/pcd_const.F90 index b19f131a8d80..17b075349050 100644 --- a/share/util/pcd_const.F90 +++ b/share/util/pcd_const.F90 @@ -1,16 +1,99 @@ -module pcd_const - use shr_kind_mod, only : R8 => shr_kind_r8 +! WARNING! DO NOT EDIT THIS FILE! +! This file was generated automatically from pcd.yaml +! For more information, visit https://github.com/e3sm-project/PhysicalConstantsDictionary +module pcd implicit none - private - - public :: glacier_ice_density_reference - public :: freshwater_kinematic_viscosity_at_freezing_reference - public :: ocean_freezing_temperature_depth_dependence_reference - - ! Constants in this module are sourced from share/pcd.yaml and intended for - ! cross-component consistency where MALI/MPAS-Ocean need aligned defaults. - real(R8), parameter :: glacier_ice_density_reference = 0.910e3_R8 ! reference glacier-ice density ~ kg/m^3 - real(R8), parameter :: freshwater_kinematic_viscosity_at_freezing_reference = 1.793e-6_R8 ! kinematic viscosity of freshwater at 0 C ~ m^2/s - real(R8), parameter :: ocean_freezing_temperature_depth_dependence_reference = -7.28617688e-4_R8 ! pressure-driven ocean freezing temperature depth coefficient ~ C/m -end module pcd_const + + !define double precision kind + integer, parameter :: dp = selected_real_kind(12) + + ! pcd.yaml version and institution information + character(len=*), parameter :: pcdversion = "0.1.0" + character(len=*), parameter :: pcdinstitution = "E3SM Project" + + !mathematical constants + real(dp), parameter :: pi = 3.141592653589793_dp ! ASHandbook1964 + real(dp), parameter :: e = 2.718281828459045_dp ! ASHandbook1964 + real(dp), parameter :: em_gamma = 0.5772156649015329_dp ! ASHandbook1964 + real(dp), parameter :: radian = 57.29577951308232_dp ! [degree] ASHandbook1964 + real(dp), parameter :: degree = 0.017453292519943295_dp ! [rad] ASHandbook1964 + real(dp), parameter :: square_root_of_2 = 1.4142135623730951_dp ! [rad] ASHandbook1964 + real(dp), parameter :: square_root_of_3 = 1.7320508075688772_dp ! [rad] ASHandbook1964 + + !universal_physical constants + real(dp), parameter :: speed_of_light_in_vacuum = 299792458_dp ! [m s-1] NIST_CODATA2022 + real(dp), parameter :: newtonian_gravitation_constant = 6.6743e-11_dp ! [m3 kg-1 s-2] NIST_CODATA2022 + real(dp), parameter :: standard_acceleration_of_gravity = 9.80665_dp ! [m s-2] NIST_CODATA2022 + real(dp), parameter :: standard_atmosphere = 101325_dp ! [Pa] NIST_CODATA2022 + real(dp), parameter :: avogadro_constant = 6.02214076e+23_dp ! [mol-1] NIST_CODATA2022 + real(dp), parameter :: boltzmann_constant = 1.380649e-23_dp ! [J K-1] NIST_CODATA2022 + real(dp), parameter :: stefan_boltzmann_constant = 5.670374419e-08_dp ! [W m-2 K-4] NIST_CODATA2022 + real(dp), parameter :: planck_constant = 6.62607015e-34_dp ! [J Hz-1] NIST_CODATA2022 + real(dp), parameter :: molar_gas_constant = 8.314462618_dp ! [J mol-1 K-1] NIST_CODATA2022 + real(dp), parameter :: molar_volume_of_ideal_gas = 0.02271095464_dp ! [m3 mol-1] NIST_CODATA2022 + + !chemical_molar_masses constants + real(dp), parameter :: carbon_molar_mass_reference = 0.0120107_dp ! [kg mol-1] IUPAC1997 + real(dp), parameter :: oxygen_molar_mass_reference = 0.0159994_dp ! [kg mol-1] IUPAC1997 + real(dp), parameter :: carbon_dioxide_molar_mass_reference = 0.0440095_dp ! [kg mol-1] IUPAC1997 + + !earth_physical constants + real(dp), parameter :: geocentric_gravitational_constant = 3986005E+08_dp ! [m3 s-2] GRS80 + real(dp), parameter :: semimajor_axis = 6378137_dp ! [m] GRS80 + real(dp), parameter :: dynamic_form_factor = 108263E-08_dp ! GRS80 + real(dp), parameter :: angular_velocity = 7292115E-11_dp ! [rad s-1] GRS80 + real(dp), parameter :: semiminor_axis = 6356752.3141_dp ! [m] GRS80 + real(dp), parameter :: flattening = 0.00335281068118_dp ! GRS80 + real(dp), parameter :: reciprocal_flattening = 298.257222101_dp ! GRS80 + real(dp), parameter :: mean_radius = 6371008.7714_dp ! [m] GRS80 + real(dp), parameter :: radius_of_sphere_of_same_surface = 6371007.181_dp ! [m] GRS80 + real(dp), parameter :: radius_of_sphere_of_same_volume = 6371000.79_dp ! [m] GRS80 + + !solar constants + real(dp), parameter :: total_solar_irradiance = 1360.8_dp ! [W m-2] TIM_SORCE_2005 + + !water constants + real(dp), parameter :: water_molar_mass = 0.018015268_dp ! [kg mol-1] IAPWS_95 + real(dp), parameter :: water_specific_gas_constant = 0.46151805_dp ! [kJ kg-1 K-1] IAPWS_95 + real(dp), parameter :: water_triple_point_temperature = 273.16_dp ! [K] IAPWS_95 + real(dp), parameter :: water_triple_point_pressure = 611.655_dp ! [Pa] IAPWS_95 + real(dp), parameter :: liquid_water_triple_point_density = 999.793_dp ! [kg m-3] IAPWS_95 + real(dp), parameter :: vapor_water_triple_point_density = 0.00485458_dp ! [kg m-3] IAPWS_95 + real(dp), parameter :: pure_water_freezing_temperature_reference = 273.15_dp ! [K] CGPM1948_1954 + real(dp), parameter :: pure_water_density_reference = 1000.0_dp ! [kg m-3] Gill_1982 + real(dp), parameter :: pure_water_specific_heat_capacity_reference = 4188.0_dp ! [J kg-1 K-1] Smithsonian1951 + real(dp), parameter :: latent_heat_of_fusion_reference = 333700.0_dp ! [J kg-1] CRC2018 + real(dp), parameter :: latent_heat_of_vaporization_reference = 2501000.0_dp ! [J kg-1] Smithsonian1951 + real(dp), parameter :: latent_heat_of_sublimation_reference = 2834700.0_dp ! [J kg-1] Smithsonian1951 + + !earth_atmosphere constants + real(dp), parameter :: dry_air_molar_mass_reference = 0.028966_dp ! [kg mol-1] Smithsonian1951 + real(dp), parameter :: water_vapor_molar_mass_reference = 0.018016_dp ! [kg mol-1] Smithsonian1951 + real(dp), parameter :: dry_air_specific_gas_constant_reference = 287.0421396810053_dp ! [J kg-1 K-1] US_StdAtm_1976 + real(dp), parameter :: water_vapor_specific_gas_constant_reference = 461.50436378774424_dp ! [J kg-1 K-1] US_StdAtm_1976 + real(dp), parameter :: dry_air_density_at_standard_temperature_and_pressure = 1.2923190576466714_dp ! [kg m-3] US_StdAtm_1976 + real(dp), parameter :: dry_air_specific_heat_capacity_reference = 1004.64_dp ! [J kg-1 K-1] Smithsonian1951 + real(dp), parameter :: water_vapor_specific_heat_capacity_reference = 1810.0_dp ! [J kg-1 K-1] Smithsonian1951 + + !earth_seawater constants + real(dp), parameter :: seawater_density_reference = 1026.0_dp ! [kg m-3] Gill_1982 + real(dp), parameter :: seawater_specific_heat_capacity_reference = 3996.0_dp ! [J kg-1 K-1] Gill_1982 + real(dp), parameter :: ocean_reference_salinity = 34.7_dp ! [g kg-1] Levitus1982 + real(dp), parameter :: speed_of_sound_in_seawater_reference = 1500.0_dp ! [m s-1] Gill_1982 + real(dp), parameter :: vsmow_ratio_18o_to_16o = 0.0020052_dp ! IAEA1995 + real(dp), parameter :: vsmow_ratio_17o_to_16o = 0.000379_dp ! IAEA1995 + real(dp), parameter :: vsmow_fraction_16o_of_total_oxygen = 0.997628_dp ! IAEA1995 + real(dp), parameter :: vsmow_ratio_2h_to_1h = 0.00015576_dp ! IAEA1995 + real(dp), parameter :: vsmow_ratio_3h_to_1h = 1.85e-06_dp ! IAEA1995 + real(dp), parameter :: vsmow_fraction_1h_of_total_hydrogen = 0.99984426_dp ! IAEA1995 + real(dp), parameter :: sea_ice_density_reference = 917.0_dp ! [kg m-3] Smithsonian1951 + real(dp), parameter :: sea_ice_specific_heat_capacity_reference = 2117.27_dp ! [J kg-1 K-1] Smithsonian1951 + real(dp), parameter :: sea_ice_thermal_conductivity_reference = 2.1_dp ! [W m-1 K-1] MaykutUntersteiner1971 + real(dp), parameter :: sea_ice_reference_salinity = 4.0_dp ! [g kg-1] Untersteiner1961 + real(dp), parameter :: sea_ice_thermal_diffusivity_reference = 1.086373973376595e-06_dp ! [m2 s-1] CuffeyPaterson2010 + + !isotopic_standards constants + real(dp), parameter :: pee_dee_belemnite_ratio_13c_to_12c = 0.0112372_dp ! Craig1957 + +end module pcd