From 60140569a714ad85c14d7742e086e85cf01fef0a Mon Sep 17 00:00:00 2001 From: Oliver Elbert Date: Wed, 19 Feb 2025 16:55:01 -0500 Subject: [PATCH 1/4] add namelist option --- ndsl/namelist.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ndsl/namelist.py b/ndsl/namelist.py index 304d9160..a0f1a193 100644 --- a/ndsl/namelist.py +++ b/ndsl/namelist.py @@ -490,6 +490,7 @@ class Namelist: nf_omega: int = NamelistDefaults.nf_omega fv_sg_adj: int = NamelistDefaults.fv_sg_adj n_sponge: int = NamelistDefaults.n_sponge + daily_mean: bool = False # flag to replace cosz with daily mean value in physics @classmethod def from_f90nml(cls, namelist: f90nml.Namelist): From 5bd9700b71cb1a19d6909f5ef63a7827e5a24828 Mon Sep 17 00:00:00 2001 From: Oliver Elbert Date: Mon, 24 Feb 2025 10:56:57 -0500 Subject: [PATCH 2/4] add stephan boltzmann constant --- ndsl/constants.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ndsl/constants.py b/ndsl/constants.py index b7e91b18..a5a41db3 100644 --- a/ndsl/constants.py +++ b/ndsl/constants.py @@ -126,6 +126,7 @@ class ConstantVersions(Enum): raise RuntimeError("Constant selector failed, bad code.") SECONDS_PER_DAY = Float(86400.0) +SBC = 5.670400e-8 # Stefan-Boltzmann constant (W/m^2/K^4) DZ_MIN = Float(2.0) CV_AIR = CP_AIR - RDGAS # Heat capacity of dry air at constant volume RDG = -RDGAS / GRAV From a41023f91f02f0034347dfeba6c715015ab74c90 Mon Sep 17 00:00:00 2001 From: Oliver Elbert Date: Wed, 26 Feb 2025 16:24:59 -0500 Subject: [PATCH 3/4] lint --- ndsl/namelist.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndsl/namelist.py b/ndsl/namelist.py index a0f1a193..0b33b52e 100644 --- a/ndsl/namelist.py +++ b/ndsl/namelist.py @@ -490,7 +490,7 @@ class Namelist: nf_omega: int = NamelistDefaults.nf_omega fv_sg_adj: int = NamelistDefaults.fv_sg_adj n_sponge: int = NamelistDefaults.n_sponge - daily_mean: bool = False # flag to replace cosz with daily mean value in physics + daily_mean: bool = False # flag to replace cosz with daily mean value in physics @classmethod def from_f90nml(cls, namelist: f90nml.Namelist): From c6b8808a8bd317e86a3a639d64f0dea2ea93d3e3 Mon Sep 17 00:00:00 2001 From: Oliver Elbert Date: Thu, 27 Feb 2025 10:48:27 -0500 Subject: [PATCH 4/4] Apply suggestions from code review Change comments to docstring style Co-authored-by: Florian Deconinck --- ndsl/constants.py | 3 ++- ndsl/namelist.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ndsl/constants.py b/ndsl/constants.py index a5a41db3..946502df 100644 --- a/ndsl/constants.py +++ b/ndsl/constants.py @@ -126,7 +126,8 @@ class ConstantVersions(Enum): raise RuntimeError("Constant selector failed, bad code.") SECONDS_PER_DAY = Float(86400.0) -SBC = 5.670400e-8 # Stefan-Boltzmann constant (W/m^2/K^4) +SBC = 5.670400e-8 +"""Stefan-Boltzmann constant (W/m^2/K^4)""" DZ_MIN = Float(2.0) CV_AIR = CP_AIR - RDGAS # Heat capacity of dry air at constant volume RDG = -RDGAS / GRAV diff --git a/ndsl/namelist.py b/ndsl/namelist.py index 0b33b52e..8df5c207 100644 --- a/ndsl/namelist.py +++ b/ndsl/namelist.py @@ -490,7 +490,8 @@ class Namelist: nf_omega: int = NamelistDefaults.nf_omega fv_sg_adj: int = NamelistDefaults.fv_sg_adj n_sponge: int = NamelistDefaults.n_sponge - daily_mean: bool = False # flag to replace cosz with daily mean value in physics + daily_mean: bool = False + """Flag to replace cosz with daily mean value in physics""" @classmethod def from_f90nml(cls, namelist: f90nml.Namelist):