Bugfix for regridding where coarse and fine resolution bounds do not match#31
Open
Bugfix for regridding where coarse and fine resolution bounds do not match#31
Conversation
…resolution bounds do not match the fine resolution bounds, the function would fail; now the regridded data is cropped to the fine resolution bounds after regridding (only if nessecary)
added 4 commits
February 27, 2024 20:30
… for coarser resoltuions
…lculated for coarser resoltuions" This reverts commit b991e2b.
… coarse resolution bounds do not match the fine resolution bounds, the function would fail; now the regridded data is cropped to the fine resolution bounds after regridding (only if nessecary)" This reverts commit e8c3efc.
…nformation for the unaligned regrid
Contributor
Author
|
After discussion with @edwinkost it was decided not to implement these changes as they are still untested. Rather, the model should exit and provide an error when unaligned regridding is detected. |
… with input lat/lon grid
Contributor
Author
|
Error messages added |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When regridding a course resolution (netCDF) array, a factor is applied and the array is uniformly downscaled based on this factor. However, for cases where the fine resolution bounds to not match up with the coarse resolution bounds, this will not work. Rather the regridded coarse resolution array will be too large.
This branch fixes this issue by, if necessary, cropping the regridded data to the fine resolution bounds. Note that this fix is only applied to the default netcdf loading functions 'singleTryNetcdf2PCRobjCloneWithoutTime' and 'singleTryNetcdf2PCRobjClone'. In the future it would be better to reorganize the code so that this is done in a single function.