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

Fix bug in comparebfb.csh when restart data is missing in both test and base directories #311

Merged
merged 1 commit into from
May 9, 2019

Conversation

phil-blain
Copy link
Member

If no restart files are present in neither base_dir nor test_dir, the script comparebfb.csh would simply exit with the error

foreach: No match.

with error code 1 (csh default I guess) and so the script cice.test would report

Regression baseline and test dataset are different

which is incorrect. I just added set nonomatch before the foreach so that if no restart files are present the script does not error but correctly reports :

base_data: $baseline_dir/$baseline_name/$test_name/restart/iced**
test_data: $baseline_dir/$baseline_name/$test_name/r/restart/iced**
missing data
Missing data

  • Developer(s): Philippe Blain

  • Please suggest code Pull Request reviewers in the column at right. @apcraig

  • Are the code changes bit for bit, different at roundoff level, or more substantial? BFB

  • Please include the link to test results or paste the summary block from the bottom of the testing output below.
    No tests

  • Does this PR create or have dependencies on Icepack or any other models?
    No

  • Is the documentation being updated with this PR? (Y/N) No
    If not, does the documentation need to be updated separately at a later time? (Y/N) No

Note: "Documentation" includes information on the wiki and .rst files in doc/source/,
which are used to create the online technical docs at https://readthedocs.org/projects/cice-consortium-cice/.

  • Other Relevant Details:

I stumbled upon that bug because I was running the model for just 3 time steps with a custom test suite and had forgotten to set the dump_last namelist variable to true, which caused no restart files to be written since I was running for less than a day.

Copy link
Contributor

@apcraig apcraig left a comment

Choose a reason for hiding this comment

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

Interesting. I had to google nonomatch. So, with that variable set, the foreach loop is entered with no arguments and then test_data=" "? Or is the foreach loop just skipped with no error? If the former, then I think we'll get a reasonable result (missing data). If the latter, then we won't get a reasonable result as far as I can tell. So it must be doing the former?

I think this is fine. In some ways, my preference is to check whether a valid file exists and to abort if it doesn't. But this is a reasonable workaround.

We can merge the PR.

@apcraig apcraig merged commit c4ea4de into CICE-Consortium:master May 9, 2019
@phil-blain
Copy link
Member Author

Sorry Tony for not responding earlier, I was on vacation last week. Before this PR, the foreach loop was simply skipped with the csh error "foreach: No match.". With my modifications the foreach loop is entered, the paths are correctly formed and "missing data" is reported as expected. Thanks for merging.

@phil-blain phil-blain deleted the bugfix-comparebfb branch August 30, 2019 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants