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

Feature request: configurable lev positive attribute for History files #914

Closed
lizziel opened this issue Jul 7, 2021 · 9 comments
Closed
Labels
🎁 New Feature This is a new feature

Comments

@lizziel
Copy link
Contributor

lizziel commented Jul 7, 2021

All output files generated by MAPL History have lev attribute positive set to down by default. This is incorrect for the GEOS-Chem model which outputs most collections using vertical direction of positive up. I could custom edit the GEOS-Chem MAPL fork to change the default to up but it would be better if it were configurable per collection. Right now our Emissions collection is down while all others are up. While it would admittedly be best to use the same convention for all collections, having the ability to set per collection would be most convenient.

See also geoschem/GCHP#112.

@atrayano, @bena-nasa, @tclune

@lizziel lizziel added the 🎁 New Feature This is a new feature label Jul 7, 2021
@tclune
Copy link
Collaborator

tclune commented Jul 7, 2021

Agreed. If nothing else, even a global parameter that specifies up/down would be better than what we have now.

@lizziel
Copy link
Contributor Author

lizziel commented Jul 16, 2021

I made custom updates to our fork of MAPL to achieve what we need for GCHP. It is in no way the best solution and would not work for you, but it fixes the problem for us until a more elegant solution comes along. See geoschem#10 for the changes I made.

@mathomp4
Copy link
Member

@lizziel Did you make a PR here as well? Or only on your fork?

@lizziel
Copy link
Contributor Author

lizziel commented Jul 20, 2021

I did not make a PR here since I don't think my update is something you would want. It is definitely a kludge, and not even what we want long-term.

I think what we actually want is an option in HISTORY.rc to specify positive direction per collection, and have the array data flipped based on it in addition to setting the lev:positive attribute. Default would be status quo in GEOS, so down if nothing specified. If specified as up then the vertical dim of the export array would be flipped and positive attribute set accordingly. Lev values would remain 1,2,...,72 as they are now.

An implementation that does this would require some more work on our side. Right now I copy our data arrays into the MAPL exports with the opposite convention that MAPL assumes (surface is index 1). Ideally we would just stick with MAPL convention, so I'd vertically flip when copying into MAPL exports, but specify how they should be stored in the output file via HISTORY.rc settings. This would allow users to get output arrays matching what they see in the GEOS-Chem grid comp in terms of vertical dimension.

Does that make sense, and is it a feature you would be willing to have? Pinging @sdeastham on this since we've discussed it in the past (see geoschem/GCHP#21). I want to make sure we all agree this is best way to proceed, at least for History exports. Checkpoints and imports are another conversation.

@bena-nasa
Copy link
Collaborator

I'm fine with what we discussed at the meeting today. For now assume that all 3D fields coming to History are following the GEOS convention (index 1 is the top of the atmosphere), but then give the user the ability to invert this. I'll take a look and make sure there are no issues but I can't foresee any.

@bena-nasa
Copy link
Collaborator

@lizziel This was fairly straightforward. I've made a PR to implement this as noted in the conversation. See that for details.

tclune added a commit that referenced this issue Jul 30, 2021
@bena-nasa
Copy link
Collaborator

@lizziel this already got merged in so this would in the next release (presumably 2.8.3)

@lizziel
Copy link
Contributor Author

lizziel commented Aug 2, 2021

Excellent, thank you! As mentioned earlier we'd also like this functionality for imports and checkpoints. Would you like me to make separate feature requests for these?

@bena-nasa
Copy link
Collaborator

Could you make it a separate request. I'm a little less clear how I would do this in that how would the component know that this should be. This is probably best discussed as a new issue so please open a new one and I'll close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎁 New Feature This is a new feature
Projects
None yet
Development

No branches or pull requests

4 participants