Skip to content

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

Open
@DaniJonesOcean

Description

@DaniJonesOcean

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. : )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions