Closed dustinswales closed 6 months ago
Last week: "meet with us and share how you would have approached it" This week: PR Did I miss something?
Last week: "meet with us and share how you would have approached it" This week: PR Did I miss something?
Fair point. This is a draft on how we approached it, which may or may not be inline with your thinking on how to use the VarAction class for unit conversions. Hopefully this makes our upcoming conversation more focused.
@DomHeinzeller @gold2718 @peverwhee As we discussed, I jettisoned what I was doing w/ the VarAction class and added the unit-conversions to the compatibility object. This works for unit conversions, but may need some changes to flip the vertical orientation. A related question, how do we recognize when a variable needs to be flipped in the vertical? (New attributes in host and suite for convention?)
@DomHeinzeller @gold2718 @peverwhee As we discussed, I jettisoned what I was doing w/ the VarAction class and added the unit-conversions to the compatibility object.
It looks like you added a VarCompatObject
to what the unit conversion work. Is that what you meant?
This works for unit conversions, but may need some changes to flip the vertical orientation. A related question, how do we recognize when a variable needs to be flipped in the vertical? (New attributes in host and suite for convention?)
This has been recognized for quite a while. I know there was a discussion in a Google doc many years ago but I no longer have access to that (if I could even remember where it was).
However @grantfirl started this back up in August and I would like to see some progress on this so please refer to the Discussion related to vertical coordinate interoperabilty. I have added a bit of history to that.
Hey @gold2718 @DomHeinzeller @peverwhee I think this is at a point where I'd like to get some feedback from the team.
Questions/Comments/ToDo:
@dustinswales Can you please merge in feature/capgen (need to resolve conflicts) before I review? Thanks!
In general, it would be nice to have more inline documentation in form of comments and/or docstrings, especially for newly added code. capgen
is a pretty complicated piece of python code, any documentation will be greatly appreciated.
@DomHeinzeller I added some more inline documentation and addressed your comments. Since you reviewed, I refactored a bit to be more closely aligned with #512. @gold2718 @peverwhee @mkavulich This is ready for review.
@peverwhee Comments addressed. Thanks! I went ahead and renamed the test var_compatability.
@mwaxmonsky @gold2718 When you have time, can you please review this PR? Thanks very much in advance.
Pinging all remaining reviewers. This PR has sufficient approvals and we are planning to merge this PR on Friday, January 12 2024.
This PR adds automatic conversions for supported unit and type transforms. Also, included is a new ccpp variable property to indicate a scheme variables vertical orientation vertical, top_at_one. As default, top_at_one is set to .false.(GFS ordering convention). Adding top_at_one = .true. to a variable in a schemes metadata file will trigger automatic array flipping:
The var_aciton_test was modified to test these new functionalities:![image](https://github.com/NCAR/ccpp-framework/assets/13949033/e748fb5a-1315-4e1f-bc22-4ba19e04855d)
Addresses https://github.com/NCAR/ccpp-framework/issues/329 and https://github.com/NCAR/ccpp-framework/issues/403
Conversions supported: https://github.com/NCAR/ccpp-framework/blob/main/scripts/conversion_tools/unit_conversion.py