-
Notifications
You must be signed in to change notification settings - Fork 70
Fix Earth radius in jigsaw_to_netcdf #347
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
Fix Earth radius in jigsaw_to_netcdf #347
Conversation
|
I noticed this error in my testing of MPAS-Dev/MPAS-Model#668. |
|
Further work toward addressing MPAS-Dev/MPAS-Model#549 |
|
@mark-petersen and @dengwirda, I'm just looking for a review by inspection here and wanted to make sure you're aware of this change just in case there is code outside of MPAS-Tools and MPAS-Model that will be affected. This will be part of the next |
mark-petersen
left a comment
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.
Yes, this looks good. Obviously sphere_radius = 6371000 is the offending line. As long as you've tested with a global case and see the expected radius, then this is working.
Finding that out is a bit involved. I have to make a new test version of |
|
@xylar based on a quick review it looks to me like the flow is right here: Is there possibly a If this seems right to you, perhaps I can also do a full build and double-check I have the right understanding here... |
|
@dengwirda, I agree, it would be cleaner if everything were in meters, rather than sometimes in I think we should do a separate PR if we want to convert the units that JIGSAW gets to meters instead of km. |
|
I will double check, though, to see if the Update: I don't have an easy test of this branch but before the change here, |
|
I agree, though, that I can't find anywhere where x, y and z from JIGSAW, which surely must be in km, get converted back to meters. Mysterious! @sbrus89, any insight? Were you involved in writing this code or was in Phil Wolfram? |
|
On a side note, I need to fix the command-line tool. It needs a new flag for the Earth radius. |
|
Oh, dear! I was looking at So definitely in km. It's getting converted to m via renormalizaiton that happens in the MPAS mesh converter. Hopefully, that's using the supplied So, @dengwirda, you're completely right. We should be multiplying x, y and z by 1000 here and we might as well fix it in this PR. |
d336f6a to
2d95f55
Compare
|
@dengwirda, thanks for your comments. They should now be addressed. |
|
@proteanplanet, would you be willing to review this as well. I believe this is the last of these darn hard-coded Earth radii on the MPAS-Tools and COMPASS side of things. But you may have a keener eye for something I missed. |
I verified that this is the case -- there's no hard-coded Earth radius in the mesh converter. |
|
@xylar thanks for following up on all of this. To multiply out the I think the |
|
Oh, shoot, you're right. I'll fix that. |
It was getting hard coded but should be provided from CIME constants. Add a missing converions from km (units used in the JIGSAW mesh) to meters (MPAS units). Add a command-line flag for the spehre radius.
2d95f55 to
5cbd9c4
Compare
|
@matthewhoffman isn't yet using this workflow for any of his test case as far as I'm aware but could certainly do so in the future. There may be some ocean test cases using JIGSAW in a planar configuration, not sure about that. In any case, it should work, so thanks for catching that. Let me know if it looks right now. |
|
Looks good I think @xylar! |
proteanplanet
left a comment
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 fine to me. Thanks for knocking this on the head.
|
I ran the QU240 and QU240wISC test cases from COMPASS ocean. I can verify that:
I will merge this PR and it will make it into the next release, which will happen shortly. |
|
@dengwirda , @xylar , landice is using this jigsaw interface for mesh generation in COMPASS (we refer to the ocean dir within COMPASS to access these scripts, which seemed easier than asking the ocean to generalize this and put it in a common folder), so thanks for keeping an eye out for the planar workflow. |
|
Ah, @matthewhoffman, I didn’t realize this. I probably need to make a PR so you can use the latest compass instead of jigsaw to MPAS. I’ll do that tomorrow if possible. All the more reason that the move to this repo was a good call. |
Update to version 0.1.11 of the compass environment #688 This brings in several changes from MPAS-Tools: * Changes to make sure the Earth radius is consistent throughout COMPASS and `mpas_tools.ocean` by using the CIME value (MPAS-Dev/MPAS-Tools#347 and MPAS-Dev/MPAS-Tools#341) * Improved performance for interpolation of meshDensity and bathymetry (MPAS-Dev/MPAS-Tools#344) * Reorganization of `mpas_tools.mesh.creation` (MPAS-Dev/MPAS-Tools#314)
Update to version 0.1.11 of the compass environment #688 This brings in several changes from MPAS-Tools: * Changes to make sure the Earth radius is consistent throughout COMPASS and `mpas_tools.ocean` by using the CIME value (MPAS-Dev/MPAS-Tools#347 and MPAS-Dev/MPAS-Tools#341) * Improved performance for interpolation of meshDensity and bathymetry (MPAS-Dev/MPAS-Tools#344) * Reorganization of `mpas_tools.mesh.creation` (MPAS-Dev/MPAS-Tools#314)
It was getting hard coded but should be provided from CIME constants.
Add a missing conversions from km (units used in the JIGSAW mesh) to meters (MPAS units).
Add a command-line flag for the sphere radius.