-
Notifications
You must be signed in to change notification settings - Fork 28
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
Supergrids from internal FV3 grids. #118
Conversation
… two angles as the midpoint on the great circle vs simple half of angular sum. Needed for FV3 internal grids.
…use of braces in fixed code section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. As far as I can tell the big changes are to simply add the revised midpoint calculation and move the older algorithm to be an option.
This is a very nice improvement to this tool. Thanks for making this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ngs333 - I know you've tested the updates with the Cubed-Sphere. Have you also checked a regular lat-lon grid from file?
@bensonr |
@ngs333 - short of finding some CM2.1 or ESM2 datasets and mosaics, that's probably the easiest way to do it. |
Still working on testing alternate branch as @bensonr suggest, but I've been able to verify that
is a list of 61 supergrid longitudes in [0,30] incrementing by 0.5; and also 21 latitudes in [50,60]. It is used as input (
|
@bensonr |
The PR modifies make_hgrid to correctly make supergrids from internal FV3 grids. Make_hgrid already contained a procedure to
read NetCDF files that contained the four fields grid_lon, grid_lont, grid_lat, and grid_latt. These fileds would be read, the points (lat and lon coordiantes) would be used as supergrid cell verticies and centroids, and the supergrid cell face midpoints would be calculated from them.
To correctly make this work, these changes were made to make_hgrid :
a) create_grid_from_file() function was modified so that the angular midpoints (lat and lon) between two points on the sphere (actually, two neighboring cell vertices) are the angles corresponding to the spatial midpoint on the great circle. The old method calculated the mid latitude as a simple 0.5 * (angular sum of neighbor latitudes); and similarly for the longitudes .
b) make_hgrid() function was modified to correcly allocate space for the supergrid when more than one tile is specified (in this case where the grid_type is "from_file").
Finally, a legacy flag was added as an "already deprecated" feature (to be removed in a future PR) to temporarily allow the use of the old/legacy method for calculating midpoints. (the new method is the default method)