-
Notifications
You must be signed in to change notification settings - Fork 24
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
Feature #1943 gridstat_seeps: Load SEEPS climo only if SEEPS is enabled #2368
Conversation
for(int j=0; j < n_mask; j++){ | ||
for(int k=0; k < n_interp; k++){ | ||
pd[i][j][k].load_seeps_climo(); | ||
loaded = true; |
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.
@hsoh-u, I think PairDataPoint::load_seeps_climo() is just setting a pointer to a single instance of the SEEPS climo info. But that pointer should be set for each PairDataPoint object. So I don't think you should be breaking out of the loop based on the "loaded". You could just remove all the "loaded" stuff, as I've recommended here.
loaded = true; |
@@ -1470,6 +1478,23 @@ void VxPairDataPoint::set_obs_perc_value(int percentile) { | |||
|
|||
//////////////////////////////////////////////////////////////////////// | |||
|
|||
void VxPairDataPoint::load_seeps_climo() { | |||
bool loaded = false; |
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.
bool loaded = false; |
loaded = true; | ||
break; | ||
} | ||
if (loaded) break; |
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.
if (loaded) break; |
} | ||
if (loaded) break; | ||
} | ||
if (loaded) break; |
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.
if (loaded) break; |
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.
You are right. The singleton is implemented at vx_seeps/seeps.cc
… MET_SEEPS_GRID_CLIMO_NAME or MET_SEEPS_POINT_CLIMO_NAME environment variables.
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.
I approve of these changes.
- I see that all the GHA tests ran without error and produced no diffs.
- I inspected the code changes and see that load_seeps_climo() is only called when the SEEPS or SEEPS_MPR output line types are requested.
- I ran Point-Stat at verbosity 10 WITHOUT seeps requested and see no seeps log messages.
- Rerunning WITH
seeps = BOTH;
logs:
DEBUG 7: SeepsClimo::get_seeps_climo_filename() -> SEEPS climo name="/Volumes/d1/projects/MET/MET_development/MET-develop/share/met/climo/seeps/PPT24_seepsweights.nc"
DEBUG 6: SeepsClimo::read_records() -> dimensions nstn = 5293
DEBUG 6: SeepsClimo::read_records() -> took 0.074679 seconds
- Running Grid-Stat with
seeps = NONE;
produces no seeps log messages. - Running Grid-Stat with
seeps = STAT;
only produces seeps log messages when actually processing precip data.
Note that with this commit, I updated seeps-related error messages to tell users exactly what environment variables they can set.
Expected Differences
The SEEPS climo file should not be loaded if thre SEESP is not enabled.
Do these changes introduce new tools, command line arguments, or configuration file options? [No]
If yes, please describe:
Do these changes modify the structure of existing or add new output data types (e.g. statistic line types or NetCDF variables)? [No]
If yes, please describe:
Pull Request Testing
Manually modified unittest commands and check if SEESP climo file loaded with debug level 7
grid_stat: Checking the log message:
from the commands (with/without SEEPS)
point_stat:
from the commands (with/without SEEPS)
Recommend testing for the reviewer(s) to perform, including the location of input datasets, and any additional instructions:
Do these changes include sufficient documentation updates, ensuring that no errors or warnings exist in the build of the documentation? [No]
Do these changes include sufficient testing updates? [No]
Will this PR result in changes to the test suite? [No]
If yes, describe the new output and/or changes to the existing output:
Please complete this pull request review by [Fill in date].
Pull Request Checklist
See the METplus Workflow for details.
Select: Reviewer(s)
Select: Organization level software support Project or Repository level development cycle Project
Select: Milestone as the version that will include these changes