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

Add allocation checks for accumulating history variables. #631

Merged
merged 1 commit into from
Sep 10, 2021

Conversation

dabail10
Copy link
Contributor

@dabail10 dabail10 commented Sep 9, 2021

For detailed information about submitting Pull Requests (PRs) to the CICE-Consortium,
please refer to: https://github.com/CICE-Consortium/About-Us/wiki/Resource-Index#information-for-developers

PR checklist

  • Short (1 sentence) summary of your PR:
    Add allocated checks for accumulation of history variables.
  • Developer(s):
    D. Bailey (dabail10)
  • Suggest PR reviewers from list in the column to the right.
  • Please copy the PR test results link or provide a summary of testing completed below.
    I have run this for a month with daily and monthly output on cheyenne_intel.
  • How much do the PR code changes differ from the unmodified code?
    • bit for bit
    • different at roundoff level
    • more substantial
  • Does this PR create or have dependencies on Icepack or any other models?
    • Yes
    • No
  • Does this PR add any new test cases?
    • Yes
    • No
  • Is the documentation being updated? ("Documentation" includes information on the wiki or in the .rst files from doc/source/, which are used to create the online technical docs at https://readthedocs.org/projects/cice-consortium-cice/. A test build of the technical docs will be performed as part of the PR testing.)
    • Yes
    • No, does the documentation need to be updated at a later time?
      • Yes
      • No
  • Please provide any additional information or relevant details below:
    This is a fix for issue Unelegant crash writing initial condition when 'histfreq' is more frequent then any 'f_*' output variable #521 raised by @phil-blain . The fix is to check that the a2D, a3Dc, etc. arrays are allocated before doing the accumulation. Also, print a warning if there are no fields going to the history. Also added some spaces in ice_history_bgc.F90. Some the lines did not start in column 6.

Copy link
Contributor

@eclare108213 eclare108213 left a comment

Choose a reason for hiding this comment

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

Looks good to me. I wouldn't have worried about the column-6 alignment but this is fine.

@apcraig
Copy link
Contributor

apcraig commented Sep 10, 2021

This looks fine to me. Maybe @phil-blain could test this modification?

The review button isn't working at the moment for some reason, it looks like they changed a few things around on github and maybe there is a bug. I'll check to see if it works for me later.

Copy link
Member

@phil-blain phil-blain left a comment

Choose a reason for hiding this comment

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

Thanks @dabail10. I tested this with the same ice_in as in #521 and it does not crash, and "WARNING: NO HISTORY FIELDS WILL BE WRITTEN" is written to the log file as expected.

The fix is simple and effective.

@dabail10 dabail10 merged commit 554a302 into CICE-Consortium:master Sep 10, 2021
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.

Unelegant crash writing initial condition when 'histfreq' is more frequent then any 'f_*' output variable
4 participants