Skip to content
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

Bugfix for regridding where coarse and fine resolution bounds do not match #31

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

BramDr
Copy link
Contributor

@BramDr BramDr commented Feb 14, 2024

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.

…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)
@BramDr BramDr requested a review from edwinkost February 14, 2024 15:40
@BramDr BramDr added the bug Bug report label Feb 14, 2024
Bram Doppers added 4 commits February 27, 2024 20:30
…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.
@BramDr
Copy link
Contributor Author

BramDr commented Feb 29, 2024

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.

@BramDr
Copy link
Contributor Author

BramDr commented Mar 4, 2024

Error messages added

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug report
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants