-
Notifications
You must be signed in to change notification settings - Fork 159
Replace quad_bilinear_interp with inverse distance weighting in quad_utils. #887
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
base: main
Are you sure you want to change the base?
Conversation
build everything action: https://github.com/NCAR/DART/actions/runs/15426138267 caveat GEOS (Helen are you ever going to fix this? no). edit Yes! #918 |
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.
Pull Request Overview
This pull request replaces the quad_bilinear_interp interpolation method with an inverse distance weighting (IDW) approach to avoid out-of-bounds issues in quadrilateral interpolation. Key changes include the removal of the bilinear interpolation subroutine, addition of a new quad_idw_interp subroutine with error checking on interpolated values, and updates to build scripts to conditionally include the quad_utils_mod file for the "threed_sphere" location.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
models/utilities/quad_utils_mod.f90 | Removed quad_bilinear_interp and added quad_idw_interp implementing IDW interpolation with additional error handling. |
build_templates/buildfunctions.sh | Updated source file list to conditionally include quad_utils_mod.f90 for the threed_sphere location. |
build_templates/buildconvfunctions.sh | Similar conditional inclusion of quad_utils_mod.f90 in the source list for threed_sphere. |
Comments suppressed due to low confidence (1)
models/utilities/quad_utils_mod.f90:2149
- The error handling block uses the variables 'string1', 'string2', and 'source' without any visible declarations or initializations. Please ensure these variables are declared and initialized before they are used to report the error.
if(expected_obs < minval(p) .or. expected_obs > maxval(p)) then
…n quad_utils_mod fixes #860 Same fix as #833 #848 that was for cice model_mod only. Removed the rotation code - see #453 - does not fix the out-of-bounds and is also rotating in the oppostite direction. Not used in IDW. removed svn detritus. Using VERTISUNDEF to get horizontal only distances. I am not sure if this will need to be modififed for other location_mods
The converters in the repo all build succesfully without this change, because they all use threed_sphere location_mod. However maybe there are some converters in the wild that do not use threed_sphere.
6e40a5d
to
3c309e8
Compare
I think you're talking about the endless svn junk DART/models/utilities/quad_utils_mod.f90 Lines 85 to 89 in 3c309e8
|
Model_mods currently using quad_utils: MOM6/model_mod.f90 |
Description:
The current quad_utils_mod interpolation method (bilinear) can give out-of-bounds values for some quads.
This problem was originally reported by Nuo Chen in CICE #833 when using the QCEFF.
The CICE bilinear interpolation was replaced by inverse distance weighting in #848. This is the same code as quad utils. Note, replacing the CICE interpolation with quad utils is not done in this pull request.
There is a notebook to call dart from python in https://github.com/hkershaw-brown/DART-probe/blob/main/ice-interp.ipynb if you want to reproduce the interpolation plots (see README for dart library build).
Fixes issue
Fixes #860
Fixes #453 since no rotation needed in the IDW. See #833 for plots of rotations
Types of changes
Documentation changes needed?
There is no documentation for quad utils at the moment.
Tests
This is a draft at the moment.
Questions to answer:
bitwise differences for which models - who cares, it is a bug fix vs. loads of people care.
Checklist for merging
Checklist for release
Testing Datasets