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

Compressed state option for MITgcm_ocean NBLING #455

Closed
wants to merge 61 commits into from

Conversation

hkershaw-brown
Copy link
Member

@hkershaw-brown hkershaw-brown commented Feb 9, 2023

Description:

This pull request introduces an option to compress the land out out of MITgcm ocean files.
For the MITgcm ocean NBLING Red Sea experiment this is particularly effective in reducing the size of the state and enabling high resolution runs.

From work by Jiachen Liu which he presented at AMS 2023
The work was done as part of SIParCS 2022 under the Red Sea Initiative project

Fixes issue

Fixes #391

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Documentation changes needed?

  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.

Tests

Please describe any tests you ran to verify your changes.

Bitwise against the previous version of the code for the MITgcm test case we have.

Checklist for merging

  • Updated changelog entry
  • Documentation updated
  • Update conf.py

Checklist for release

  • Merge into main
  • Create release from the main branch with appropriate tag
  • Delete feature-branch

Testing Datasets

  • Dataset needed for testing available upon request
  • Dataset download instructions included
  • No dataset needed

You can grab MIT cases from here: /glade/scratch/hkershaw/DART/Squished
Hang tight for a nicely organized case.

Ed Liu and others added 30 commits June 6, 2022 15:33
todo: use dart modules rather than standalone, netcdf, kinds, etc
mit_to_dart, dart_to_mit seems like place to put the offline
squishing
used when uncompressing
integers for coord index
the caching was fixed in #368
hkershaw-brown and others added 14 commits September 23, 2022 09:46
note the get_compressed_dart_vector index needs checking for 2d variables.
Is the ZC(kloc)=1?
Currently hardcoded as *4. May be able to replace this with INQUIRE
to get correct recl
MITgcm-DART with compressed netcdf files is based on work by
Ed Liu as part of a 2022 SIParCS project
CHL is not updated, but may be helpful when testing code.
For example, perturbing uncompressed state to get an ensemble of
mit .data files to test bitwise between compressed and non-compressed.
@@ -2415,7 +2415,7 @@ function nc_create_file(filename, context)
character(len=*), parameter :: routine = 'nc_create_file'
integer :: ret, ncid, oldmode

ret = nf90_create(filename, NF90_CLOBBER, ncid)
ret = nf90_create(filename, ior(NF90_CLOBBER,NF90_64BIT_OFFSET), ncid)
Copy link
Member Author

Choose a reason for hiding this comment

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

Helen you probably don't want to leave this in, see #287 for netcdf notes

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe we need to leave this in if we want to be able to create DART files in the netCDF-4 format (with unlimited time dim), else it will throw the error message shown in #287.

But I'm not sure if including NF90_64BIT_OFFSET as an ior argument will cause DART files that are not in the netCDF-4 format to be created with incorrect formatting?

@hkershaw-brown
Copy link
Member Author

@hkershaw-brown
Copy link
Member Author

Feedback on this, 0 has been used as the masking value in the existing MITgcm-dart and this compressed version:

! MEG CAUTION: THE ABOVE STATEMENT IS INCORRECT
! trans_mitdart already looks for 0.0 and makes them FVAL
! So, in the condition below we don't need to check for zeros
! The only mask is FVAL

where (data_3d == 0.0_r4) data_3d = FVAL

There is actually mask information from MITgcm (0 is dry 1 is wet point) from hFacC.data, hFacW.data, and hFacS.data which we should use instead for masking out land.

@hkershaw-brown
Copy link
Member Author

closing for now, will reopen when needed.

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.

Feature request: mitgcm_ocean compressed netcdf files for dart
3 participants