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

Iceopen #410

Merged
merged 15 commits into from
Feb 28, 2020
Merged

Iceopen #410

merged 15 commits into from
Feb 28, 2020

Conversation

daveh150
Copy link
Contributor

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

  • [x ] Short (1 sentence) summary of your PR:
    Update ice_open to use 8 byte integers for large global grids.

  • [x ] Developer(s):
    David Hebert, Naval Research Lab, Stennis Space Center, MS

  • [x ] Suggest PR reviewers from list in the column to the right.
    none shown

  • [x ] Please copy the PR test results link or provide a summary of testing completed below.
    results.log

  • How much do the PR code changes differ from the unmodified code?

    • [x ] bit for bit
    • different at roundoff level
    • more substantial
  • Does this PR create or have dependencies on Icepack or any other models?

    • Yes
    • [x ] No
  • Does this PR add any new test cases?

    • Yes
    • [ x] 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
    • [x ] No, does the documentation need to be updated at a later time?
      • Yes
      • [x ] No
  • Please provide any additional information or relevant details below:

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.

This raises a number of questions in my mind. First, looking up the recl argument, it seems it's integer4 and cannot be larger than 2^31-1. That means at some point, we might not be able to continue to do this for very large grids. But I think we still have some room. But the only problem really is in the RecSize computation. Algn, RecSize, Remnant are fine as integer4 in general in this implementation. And it's probably better if they remain that way.

I also worry that some of the compilers are going to complain with algn being promted to integer8 in the interface. I would be a little more careful about that and keep everything integer4 until promotion is needed.

I suggest leaving everything as integer*4 as it was. Then just adding

integer (kind=int8_kind) :: RecSizeI8
integer (kind=int_kind),parameter :: bits_per_byte = 8 ! this can be module data or even added to ice_constants

then later

RecSizeI8 = int(nx,int8_kind) * int(ny,int8_kind) * int(nbits,int8_kind) / int(bits_per_byte,int8_kind)
RecSize = int(RecSizeI8, int_kind)

and then everything stays integer*4. I know the RecSizeI8 statement is a little messy, but it keeps the rest of the code very clean. As you suggested earlier, this can also be fixed by changing the order of operations, and that could work too although increases the chances of changing the results.

I am still open a bit about the best way to implement this. Let me know what you think.

@daveh150
Copy link
Contributor Author

daveh150 commented Feb 28, 2020 via email

@daveh150
Copy link
Contributor Author

daveh150 commented Feb 28, 2020 via email

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.

I defer to the software experts to determine what the best approach is for this kind of thing. What happens if ice_open is called for a file with short integers?

!
! update: David Hebert, NRLSSC, Feb 2020
! added nx8, ny8, RecSize defined as 8 byte integers
! to allow for large, high resolution gloabl grids.
Copy link
Contributor

Choose a reason for hiding this comment

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

spell global

@daveh150
Copy link
Contributor Author

I just committed the method by computing nbytes first, then RecSize = nxnynbytes. To me, typecasting the 8 byte integers and then converting back to 4 byte seemed too complicated at this stage, and didn't really do anything extra since we don't use the RecSizeI8 variable after the data is computed. Please let me know if it is preferred to go back to the using RecSizeI8.

Thank you!
David

@apcraig
Copy link
Contributor

apcraig commented Feb 28, 2020

I'm fine with this @daveh150. But how about making the bits_per_byte module data for now. We also need to retrigger the PR because readthedocs gagged, so a quick push should do that. Have you run any tests with this update? Thanks!

@daveh150
Copy link
Contributor Author

Attached is the results.log with the 'nbytes' method. So far all passed, I'm waiting for 2 in the queue.

I moved the bits_per_byte to a module level variables. Those tests are underway now. I will send log when complete.
results.log

@apcraig
Copy link
Contributor

apcraig commented Feb 28, 2020

This looks good. I think we can merge it when testing is done. I would like to merge this today after the JRA55 PR. My only final comment is that if nbits/bits_per_byte does not divide evenly, the new computation could produce a different result. That is partly why I was suggesting integer*8, but I don't think we'll run into that issue.

Keep us posted on test results. I hope to include this in the weekend testing.

@apcraig apcraig self-assigned this Feb 28, 2020
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.

Sorry @apcraig I won't have time to review this one.

@daveh150
Copy link
Contributor Author

daveh150 commented Feb 28, 2020 via email

@apcraig apcraig merged commit abc7b5a into CICE-Consortium:master Feb 28, 2020
@phil-blain
Copy link
Member

@apcraig for this PR it would have been useful in my opinion to edit the commit message generated by the "Squash and Merge" button, because now the commit message mentions several commits that were not the subject of this PR, but were included because the branch iceopen had merge commits coming from merging the consortium master (and probably Dave's master also ? )...

@daveh150 daveh150 deleted the iceopen branch February 2, 2021 22:17
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