-
Notifications
You must be signed in to change notification settings - Fork 127
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
Support for CROCO 3D velocities #1641
Draft
erikvansebille
wants to merge
44
commits into
master
Choose a base branch
from
croco_3D_velocities
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
+649
−42
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Also added idealised unit test
for more information, see https://pre-commit.ci
As of commit 40b76ac, this test has been failing. Not at all clear why, so temporarily silencing them
…w covered by xfail
…olving depth layers?
Improving calculation of local w velocity
…w that in tutorial overview
4 tasks
Codecov ReportAttention: Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1641 +/- ##
==========================================
- Coverage 81.18% 80.93% -0.26%
==========================================
Files 72 74 +2
Lines 13256 13435 +179
Branches 127 128 +1
==========================================
+ Hits 10762 10873 +111
- Misses 2457 2524 +67
- Partials 37 38 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
This was referenced Aug 28, 2024
Fixing mypy error
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements support for 3D velocities in CROCO (and potentially also ROMS, but not tested). Users can simply call
FieldSet.from_croco()
and provide thew
field from CROCO output in theirvariables
list and call theAdvectionRK4_3D
kernel. Under the hood, Parcels will then replace the kernel withAdvectionRK4_3D_CROCO
, which works slightly different from the normal 3D advection kernel because it converts the vertical velocity in sigma-units.In particular, the following algorithm is used (note that the RK4 version is slightly more complex than this Euler-Forward version, but the idea is identical)
We have tested this algorithm on an idealised setup (created by @vesnaber) of a purely zonal flow over a sloping bottom. Particles indeed stay on their depth levels (so cross sigma-levels) as expected, with this algorithm. So we think this is an appropriate scheme.
To make this work under the hood, we had to adapt Parcels to convert from particle depth (in m) to sigma-coordinates in Field interpolations. In a call such as
fieldset.U[time, particle.depth, particle.lat, particle.lon]
, theparticle.depth
will thus under-the-hood be converted tosigma
(= particle.depth / fieldset.H[time, particle.depth, particle.lat, particle.lon]
).Todo before this PR can be merged
FieldSet.from_croco()
for seamless usew
field)RectilinearSGrid
andCurvilinearSGrid
classes, as this new approach to sigma-grids seems to be more robust