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

Fixes tripolar metadata ouput #528

Merged
merged 2 commits into from
Aug 26, 2020
Merged

Conversation

bena-nasa
Copy link
Collaborator

Fixes #527
This will add 2D lons and lats if you are outputting on the native tripolar grid. (assuming the lons/lats in the grid are correct, but that is another issue being worked on, they should be good for at least MOM5, MOM6 maybe not until we do a little more work). This only addresses the requests in the issue Yuri opened.

In addition it restores the functionality that you can specify the vertical metadata even if not selecting a subset of levels or vertically regridding as the old History/CFIO could do.

This is bit a of a kluge, but then the behaivor in the old CFIO layer was just as klugy.
Basically when creating the file vertical information you pass the levels. It was assuming that if you passed levels, but no vertical variable for interpolation you wanted to select levels. Of course this breaks the cases they were using in the tripolar output of passing in a file that has the level metadata.
In the old CFIO layer the Kluge was, if the values were negative the level array, don't use that as an index to do level selection.
The new kluge is this. If you just pass levels assume at first we want to select levels, that is the existing behaivour. However after we parse the bundle and if we find that the number of levels in the bundle fields matches the input level variable, don't do try to do level subsetting with the passed in level variable because why would you be trying to select levels if the number of levels passed in matches the size of the variable, makes no sense. Since at this point the levels have been written to the metadata we can obliterate them and go back to the no special vertical handling behavior and output all the levels.

Related Issue

Motivation and Context

How Has This Been Tested?

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 change)
  • Trivial change (affects only documentation or cleanup)

Checklist:

  • I have tested this change with a run of GEOSgcm (if non-trivial)
  • I have added one of the required labels (0 diff, 0 diff trivial, 0 diff structural, non 0-diff)
  • I have updated the CHANGELOG.md accordingly following the style of Keep a Changelog

…th the veritcal metadata. Now vdata does a check, if you pass levels assume you are selecting them, but if the # of levels passed in matches the levels in the fields in the bundle, then assume you are not doing selection
@bena-nasa bena-nasa requested a review from a team August 26, 2020 15:57
@bena-nasa bena-nasa added 0 Diff The changes in this pull request have verified to be zero-diff with the target branch. 🎁 New Feature This is a new feature labels Aug 26, 2020
@bena-nasa bena-nasa changed the base branch from main to develop August 26, 2020 15:57
Copy link
Collaborator

@tclune tclune left a comment

Choose a reason for hiding this comment

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

@bena-nasa Not really part of this change, but ... as long as changes are being made in this file anyway ....

Could you update the netcdf calls to use the nf90 interfaces and switch the include netcdf.inc to use netcdf?

@bena-nasa
Copy link
Collaborator Author

bena-nasa commented Aug 26, 2020

@bena-nasa Not really part of this change, but ... as long as changes are being made in this file anyway ....

Could you update the netcdf calls to use the nf90 interfaces and switch the include netcdf.inc to use netcdf?

I'm not sure what those routines that had the include netcdf.inc were even for. They were were there is the initial commit but I can find no where they are ever call so I removed them.

@tclune
Copy link
Collaborator

tclune commented Aug 26, 2020

@bena-nasa Even better! I was assuming there was some reason that pFIO was insufficient.

@bena-nasa bena-nasa merged commit ed748a9 into develop Aug 26, 2020
@bena-nasa bena-nasa deleted the bmauer/feature/tripolar_ll_vertmeta branch August 26, 2020 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 Diff The changes in this pull request have verified to be zero-diff with the target branch. 🎁 New Feature This is a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing metadata in ocean history collections.
2 participants