Closed mgduda closed 1 year ago
Code looks good and (correctly setup) tests did what I expected.
My only note is that in the PR description the following line isn't clear to me:
Additionally, if
config_len_disp
andnominalMinDc
differ by more than 1 part in 10e6, a warning is printed ...It might be clearer to say:
Additionally, if the difference between
config_len_disp
andnominalMinDc
is greater than 1E-6, a warning is printed ...
Thanks for the suggestion. I've updated the PR description. The tolerance is actually 1e-6 scaled by config_len_disp
, which I've tried to convey in the updated text.
This PR eliminates the need for users to specify
config_len_disp
in theirnamelist.atmosphere
files by introducing a new scalar variable,nominalMinDc
, which specifies the nominal minimum grid distance where meshDensity == 1.0. ThenominalMinDc
variable is read from the "input" stream by the init_atmosphere core and scaled along with other mesh fields likedcEdge
anddvEdge
; thenominalMinDc
variable is then written to the "output" stream by the init_atmosphere core, making it available to the atmoshere core.At start-up, the atmosphere core attempts to read both the
config_len_disp
namelist variable and thenominalMinDc
variable, both of which default to 0.0.1) If both
config_len_disp
andnominalMinDc
are provided (in the namelist and input file, respectively) as positive values, theconfig_len_disp
value is used as the horizontal length scale for horizontal diffusion and 3-d divergence damping;nominalMinDc
is set to this value as well. Additionally, ifconfig_len_disp
andnominalMinDc
differ (by more than ~1.0e-6 relative difference), a warning is printed to the log file; e.g.:2) If only one of
config_len_disp
andnominalMinDc
is provided as a positive value, that positive value is used in the model (and in any case,nominalMinDc
takes that value when written to model restart files).3) If neither
config_len_disp
nornominalMinDc
are provided, the atmosphere core stops with an error:The changes in this PR are backwards-compatible, in the sense that old mesh files that lack the
nominalMinDc
variable can still be used, in which case the user must supply theconfig_len_disp
option in theirnamelist.atmosphere
file.