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

Interpolation error traced to grid extension in SOSEGrid.__init__ #14

Open
DaniJonesOcean opened this issue Jun 10, 2021 · 2 comments
Open

Comments

@DaniJonesOcean
Copy link
Contributor

DaniJonesOcean commented Jun 10, 2021

Hi Kaitlin. I believe that I have traced my interpolation error (so-wise/so-wise-gyre#8) to the vertical grid extension in the SOSEGrid class. I thought I should note the issue here as well.

When the SOSE grid is first read in, which occurs in SOSEGrid.__init__, it looks fine:

In [11]: self.z[0:2]
Out[11]: array([ -5. , -15.5])

In [12]: self.z_edges[0:2]
Out[12]: array([  0., -10.])

which matches the values in RC and RF, as expected. Further down __init__, we see the model grid values:

z_shallow = model_grid.z[0]
z_deep = model_grid.z[-1]

which are

In [21]: z_shallow
Out[21]: -2.5

In [22]: z_deep
Out[22]: -6034.5500000000002

This is consistent with the first few vertical levels of the model_grid:

In [9]: model_grid.z[0:4]
Out[9]: array([ -2.5 ,  -7.6 , -12.85, -18.25])

In [10]: model_grid.z_edges[0:4]
Out[10]: array([  0. ,  -5. , -10.2, -15.5])

After the extension (lines 563-737 in the file grid.py, the sose_grid vertical levels are padded with extra zeros:

In [6]: sose_grid.z[0:4]
Out[6]: array([  0. ,  -5. , -15.5, -27. ])

In [7]: sose_grid.z_edges[0:4]
Out[7]: array([  0.,   0., -10., -21.])

Is this an error? It seems odd to have two zero values for the first two edges. That seems to have come from the zero padding to extend the grid.

As a test, I changed my topmost vertical level to match the SOSE grid (10 m thickness), and my error (so-wise/so-wise-gyre#8) went away. The command sose_ics does not crash if the model grid has the same top cell thickness as the SOSE grid. This is fine for now, but eventually I'd like to be able to add thinner vertical levels to the top cells.

As always, any advice/thoughts are appreciated. : )

@knaughten
Copy link
Owner

As I suggested in the other thread, try padding SOSE at the surface not with 0 but with something like +10, does that fix the issue?

@DaniJonesOcean
Copy link
Contributor Author

Hi @knaughten. Thanks again for the suggestions. Unfortunately, that didn't fix the issue. I tried +10 and +1. In both cases, the values of `Zl' were nonsensical, and the sea ice interpolation error happened just the same as before.

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

No branches or pull requests

2 participants