-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds a vector of default values to get_param_real_array() #760
Adds a vector of default values to get_param_real_array() #760
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev/gfdl #760 +/- ##
============================================
+ Coverage 36.67% 36.69% +0.01%
============================================
Files 278 278
Lines 84269 84306 +37
Branches 15869 15877 +8
============================================
+ Hits 30908 30935 +27
- Misses 47532 47537 +5
- Partials 5829 5834 +5 ☔ View full report in Codecov by Sentry. |
I see that tc2.target failed, but that's because the new parameter value isn't available with the target executable. @marshallward shouldn't we be running the target executable in the target's |
I think regression uses everthing in its own (Edit: We build You are probably right and it should run its own tests. I am a bit worried that we are starting to put too much distance between the two codebases, but I can't see any specific problem here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change looks like it will be a valuable new addition, but before this is accepted, I am requesting one minor change to keep this new commit in line with the overall MOM6 code style guide.
FWIW, dropping the new
I'll ask a the dev call if we prefer this version... |
9eec351
to
8f7dd3e
Compare
Removed two instances of `fail_if_missing=.true., default=0.` which are contradictory: a default value is meaningless if the parameter must be specified. I encountered this when adding the `defaults=` option to `get_param_real_array()`.
9f15344
to
f8dda20
Compare
The `default=` optional argument to get_param() only provides a uniform value to initialize an array of reals. This commit adds the optional `defaults=` argument that must have the same length as the `values` argument. I've also added a few instances of this optional argument: - by adding the `initialize_thickness_param()` procedure, selected by `THICKNESS_CONFIG = "param"`. The procedure was based on the "uniform" method, and uses the parameter `THICKNESS_INIT_VALUES` which defaults to uniform values derived from `MAXIMUM_DEPTH` - the setting of MLD_EN_VALS in MOM_diabatic_driver.F90 which was previously using a work around to set defaults to 25, 2500, 250000 J/m2. - two vectors of 4 values in user/user_change_diffusivity.F90 There will be some doc file changes, but no answer changes.
I tried assumed-rank arrays for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes now all look good to me.
We probably should add the analogous new defaults
optional argument to get_param_integer_array()
, but that could wait for a subsequent PR.
The
default=
optional argument to get_param() only provides a uniform value to initialize an array of reals. This commit adds the optionaldefaults=
argument that must have the same length as thevalues
argument.I've also added a few instances of this optional argument:
initialize_thickness_param()
procedure, selected byTHICKNESS_CONFIG = "param"
. The procedure was based on the "uniform" method, and uses the parameterTHICKNESS_INIT_VALUES
which defaults to uniform values derived fromMAXIMUM_DEPTH
For super repos there will be some doc file changes, but no answer changes.
This PR was inspired after realizing
get_param_real_array()
could not be used in PR #737 where 16 run-time non-dimensional parameters are being added.