Skip to content
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

new error trap if invalid "idmap" file is present in seq_maps.rc #1893

Merged
merged 4 commits into from
Sep 21, 2017

Conversation

mvertens
Copy link
Contributor

@mvertens mvertens commented Sep 15, 2017

New error trap if invalid "idmap" file is present in the driver input file seq_maps.rc

This PR will result in an error if a mapping file that should exist is instead set to "idmap".
The driver buildnml has been modularized to add this new check more clearly.
There are two hard-wired assumptions that need to be raised as issues.

  • This check is not done for the fields rof2ocn_fmapname or glc2ice_rmapname. (The rof2ocn_fmapname is used if the run time namelist variable flood_present is set to True).
  • This check is not done for rof2ocn_* if the ocn component is data ocean. (In this case, this would be triggered by a flood_present flag that should never be on for a data_ocean and is a run time namelist setting).

Test suite: scripts_regression_tests
also ran the prealpha tests on cheyenne with only the namelist compare and verified that
the changes did not change the namelists
Test baseline: cesm2_0_alpha07c
Test namelist changes: Yes
Test status: bit for bit, roundoff

Fixes #962
Fixes #1158
Fixes #1603
User interface changes?: None
Update gh-pages html (Y/N)?: N
Code review: jedwards4b

Copy link

@gold2718 gold2718 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of minor change requests, otherwise okay.

@@ -255,7 +303,7 @@ def _create_component_modelio_namelists(case, files):
if case.get_value("MULTI_DRIVER"):
maxinst = case.get_value("NINST_MAX")

for model in models:
for model in case.get_values("COMP_CLASSES"):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just use the models variable?
Or if models is no longer used (does not look used to me), delete it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, models is not needed as a separate variable any more.

component1 = name[0:3]
component2 = name[4:7]
if not ignore_component[component1] and not ignore_component[component2]:
if name == "rof2ocn_fmapname" or name == "glc2ice_rmapname":

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be a list of names which are currently ignored.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have done this and will be pushing this back soon - but I think we still will need to have the following explicit - since it is not a mapping file name - and it depends on if the model is "docn" - not sure how else to do it.
if "rof2ocn_" in name:
if case.get_value("COMP_OCN") == 'docn':
logger.warning(" NOTE: ignoring setting of {}=idmap in seq_maps.rc".format(name))

if name == "rof2ocn_fmapname" or name == "glc2ice_rmapname":
# TODO: for rof2ocn_fmapname -needs to be resolved since this is
# currently used in prep_ocn_mod.F90 if flood_present is True
logger.warning(" NOTE: ignoring setting of {}=idmap in seq_maps.rc".format(name))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An issue should be opened for this issue.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, in my mind, we'd have some data-driven list of mapping pairs that are optional (i.e., needed in some configuration but not in others). This can be deferred, though - just mentioning it for the new issue that should be opened.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have opened an issue on this.

Copy link
Member

@billsacks billsacks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor suggestions, none too important (so I'm okay with your leaving things as is if you disagree). Otherwise looks great - thanks for doing this!

if name == "rof2ocn_fmapname" or name == "glc2ice_rmapname":
# TODO: for rof2ocn_fmapname -needs to be resolved since this is
# currently used in prep_ocn_mod.F90 if flood_present is True
logger.warning(" NOTE: ignoring setting of {}=idmap in seq_maps.rc".format(name))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, in my mind, we'd have some data-driven list of mapping pairs that are optional (i.e., needed in some configuration but not in others). This can be deferred, though - just mentioning it for the new issue that should be opened.

gridvalue = {}
ignore_component = {}
exclude_list = ["CPL","ESP"]
for item in case.get_values("COMP_CLASSES"):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renaming 'item' to something like 'compclass' would make this code more self-describing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Thanks.

group_variables = nmlgen.get_group_variables("seq_maps")
for name in group_variables:
value = group_variables[name]
if "type" not in name:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels like this would be more intuitive and more robust under possible future additions of namelist variables if it were changed to:

if "mapname" in name:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.

@mvertens
Copy link
Contributor Author

I am re-running the scripts regression tests and will send an update when I am read for this to hopefully be merged.

@billsacks
Copy link
Member

Looks good now, thanks!

@mvertens
Copy link
Contributor Author

mvertens commented Sep 21, 2017 via email

@jedwards4b
Copy link
Contributor

There is a yellowstone problems on the master fixed in PR #1911 - is that the problem you are seeing?

@mvertens
Copy link
Contributor Author

@jedwards4b - I rebased to master and now all tests passed on yellowstone. I have pushed the latest rebase back - and I believe that this PR is now ready to merge.

@mvertens mvertens deleted the mvertens/trip_invalid_idmap branch October 18, 2017 02:29
jgfouca pushed a commit that referenced this pull request Dec 8, 2017
Enable performance data archiving on Theta
Added support for archiving performance data and associated provenance
of E3SM jobs on theta. If the user is a member of the OceanClimate
group then the data will be saved in performance_archive/ in
/projects/OceanClimate . Otherwise the performance data archiving
logic is disabled.

[BFB]
jgfouca pushed a commit that referenced this pull request Feb 23, 2018
Enable performance data archiving on Theta
Added support for archiving performance data and associated provenance
of E3SM jobs on theta. If the user is a member of the OceanClimate
group then the data will be saved in performance_archive/ in
/projects/OceanClimate . Otherwise the performance data archiving
logic is disabled.

[BFB]
jgfouca pushed a commit that referenced this pull request Mar 13, 2018
Enable performance data archiving on Theta
Added support for archiving performance data and associated provenance
of E3SM jobs on theta. If the user is a member of the OceanClimate
group then the data will be saved in performance_archive/ in
/projects/OceanClimate . Otherwise the performance data archiving
logic is disabled.

[BFB]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants