You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's becoming increasingly apparent that mask-aware interpolations will be helpful to land model development in multiple ways, including the following.
Parameter values are not guaranteed to be physical over the ocean, and may even be NaN. We need to make sure we don't include those values when interpolating parameters/inputs to our model grid.
Using parameter/input maps with different resolutions
Similar to the previous point - Different resolutions will lead to mismatch at the coastlines. We need a general solution that allows us to handle input maps with a variety of land/ocean masks.
Plotting
Right now, our global plots use regular interpolation everywhere, even at the coastlines. This produces chunks of NaN along all coasts, which inhibits our ability to visually inspect our outputs and determine regions of stability, and also lowers the quality of our output plots. See this build for examples.
Proposed solution
We want to have a function interpolate with an interface like this:
The first 2 argument specify a point P on our simulation grid that we want to interpolate to.
The next 3 arguments provide information about the data to be regridded (e.g. a parameter map), and its grid
The next 3 arguments provide information about the land/ocean mask to be used in the interpolation, and its grid
Algorithm outline
For each of the 4 closest source data points to P, determine if ocean or land
Find 4 closest mask points, check if they're ocean or land
If >= 2 are land, label source data point as land; otherwise ocean
If all 4 points land -> bilinear interpolation
If 3 points land -> ?
If 2 points land -> linear interpolation between these two points (simplification, loses second dimension)
If 1 point land -> use this value
Alternative solution
Temporarily enlarge the land areas of the mask, use this larger mask to interpolate inputs/parameters to the model grid. Then, use the normal mask again to only select input values within the real land.
Q: what if input values are 0 over ocean and this just becomes enlarged land area? Not sure I understand this approach
The text was updated successfully, but these errors were encountered:
It's becoming increasingly apparent that mask-aware interpolations will be helpful to land model development in multiple ways, including the following.
Related to #488, but doesn't solve that issue
Interpolating parameters/inputs to model grid
Parameter values are not guaranteed to be physical over the ocean, and may even be NaN. We need to make sure we don't include those values when interpolating parameters/inputs to our model grid.
Using parameter/input maps with different resolutions
Similar to the previous point - Different resolutions will lead to mismatch at the coastlines. We need a general solution that allows us to handle input maps with a variety of land/ocean masks.
Plotting
Right now, our global plots use regular interpolation everywhere, even at the coastlines. This produces chunks of NaN along all coasts, which inhibits our ability to visually inspect our outputs and determine regions of stability, and also lowers the quality of our output plots. See this build for examples.
Proposed solution
We want to have a function
interpolate
with an interface like this:The first 2 argument specify a point P on our simulation grid that we want to interpolate to.
The next 3 arguments provide information about the data to be regridded (e.g. a parameter map), and its grid
The next 3 arguments provide information about the land/ocean mask to be used in the interpolation, and its grid
Algorithm outline
Alternative solution
Temporarily enlarge the land areas of the mask, use this larger mask to interpolate inputs/parameters to the model grid. Then, use the normal mask again to only select input values within the real land.
The text was updated successfully, but these errors were encountered: