Repository navigation
Support for time varying z coordinates - #2933
wyatt-fluidnumerics wants to merge 21 commits into
Conversation
for more information, see https://pre-commit.ci
|
Very cool, @wyatt-fluidnumerics! I love the final animation in the tutorial! Amazing that we can get time-varying depth grid support in v4! Let me know when you want a full review |
|
@wyatt-fluidnumerics - this looks awesome. One thing I noticed is that the z interpolation in time does not do any blending between Alternatively, I could be convinced to treat this as POC and work on pairing interpolators with coordinates, much like we do with |
…/Parcels into sigma-vertical-grid-support
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…/Parcels into sigma-vertical-grid-support
for more information, see https://pre-commit.ci
…/Parcels into sigma-vertical-grid-support
Description
The goal for this PR is to provide support for sigma coordinate models.
In nearly all sigma coordinate models, it is possible to output the z value of each node or cell face, this is fairly essential for analysis that uses a z coordinate unless the modeler chooses to plot entirely in sigma space, or reconstruct z themself. In this case, z has dimensions of (time, zf, n_node) for unstructured horizontal grids, and (time, z, y, x) for structured grids. We can utilize this field to advect particles in z coordinates for which the native model is in sigma coordinates (I believe this approach would work for ALE as well as long as a user has z coordinate output file, though I have not looked into this at all).
The primary change here is to optionally propagate
tiandtaufrom the time search into thesearch(..., ti=None, tau=None)function itself, which allows for time and vertical column indexing of the z grid during the vertical grid search (i.e. at every time step each vertical column has unique z levels). On each of these columns the vertical search runs exactly the same as before. This allows_get_positionsto return barycentric coordinates back to interpolators in the exact same format as parcels does currently. Nothing changes for classic z grids that are 1D.Current Assumptions and Interpolations:
The changes to each file are the following:
depthwith dims(time, depth, YC, XC). For a 4Ddepth, the new_search_time_varying_depthtakes the column at the centre of each particle's cell, interpolates it linearly in time withti/tau, and then searches it's columns_get_positionspasses the time index intogrid.searchti=NoneThere is also a new tutorial
tutorial_sigma_coordinates.ipynbwhich demonstrates the utility for both structured and unstructured grids. Hopefully we will be able to replace the synthetic dataset with a model dataset (I am hoping to put together a schism run for this).This PR is just an initial stab at the implementation for the sake of initiating discussion, @fluidnumericsJoe and I have a whiteboard with ideas to polish things and improve the scalability, we'll have an issue open soon but the biggest thing is the following:
Gridobjects, and z would also somehow need to be a part of the grid. We think it could be a good idea to give vertical coordinates their own class. This would likely be very field like, and could even implement a system similar toto_windowed_array/'to_cached_chunked_array` so that the memory foot print is reduced.searchfor both XGrids and UxGrids respectively.Checklist
mainfor normal development,v3-supportfor v3 support)AI Disclosure