Deprecating curvilnear halo support#1811
Conversation
|
I get that for a lot of simulations with curvilinear grids (especially arbitrary curvilinear ones) the approach is buggy/there is no way to sensibly implement periodicity in this case. However, what about people running global simulations? |
Well, this is described at the start of the Periodic Boundaries tutorial: In case you have a global model on a C-grid, then there is typically not much that needs to be done. The only thing you have to be aware of, is that there is no ‘gap’ between the longitude values on the right side of the grid and on the left side of the grid (modulo 360). In other words, that fieldset.U.lon[:, 0] >= fieldset.U.lon[:, -1]This is the case for most curvilinear NEMO model outputs on a C-grid, so that periodic boundary conditions work out of the box, without any special code required. For Hycom models, we have found that it can help to add an extra column of longitudes at the end of the longitude array: lon_c = np.expand_dims(fieldset.U.grid.lon[:, 0], axis=1)
fieldset.U.grid.lon = np.hstack((fieldset.U.grid.lon, lon_c)) |
VeckoTheGecko
left a comment
There was a problem hiding this comment.
I see. Thanks for the clarification
Co-authored-by: Vecko <36369090+VeckoTheGecko@users.noreply.github.com>
for more information, see https://pre-commit.ci
As reported in #1685, the
Field.add_periodic_halo()method was quite buggy for Fields on Curvilinear Grids. In order to avoid users using broken code, perhaps better to deprecate the method?