Correct sampling of constant 2D-field in time-varying 3D-run #1186
Replies: 4 comments 8 replies
-
Hi @RomanIMMSP, thanks for reporting. It could indeed very well be that you run into this problem because you use |
Beta Was this translation helpful? Give feedback.
-
I have solved the problem by adding the dimension
After that, I have the same array Thanks for the support. |
Beta Was this translation helpful? Give feedback.
-
Dear @erikvansebille, all, I am sorry but I am also struggling quite a bit with the sampling of a constant field such as a bathymetry field. Maybe I have done stupid mistakes (see enclosed my notebook and data for better reproducibility: https://we.tl/t-PnmssqFQO5). The script "works" but the sampling field somehow is not consistent with the sampling field. I already ran into the documentation and this forum, tried almost everything (getting rid of other kernels, disallow time extrapolation, etc) but I arrive at a point where I would need a little help. That would be lovely (I would like to avoid a time-varying transformation of the bathymetric data as much as possible as proposed by Roman). Let me describe my workflow.
Then I create the sampling Kernel:
And finally, I derive:
As you can see below, the bathymetry and the depth sampled along the trajectory are not matching: |
Beta Was this translation helpful? Give feedback.
-
Hello, thank again for the support ! I have tried For a short advection such as in this example (30days) this is quite straightforward indeed to work out with Roman 's solution combined with However, I do 5 to 6 years advection experiments, with daily time steps. I found it easier to keep working "from netcdf" in this case. So I just created new source netcdf files that include the velocities together with a repeated (in time) bathymetry, and the same date time index. In this way, although it wastes some storage, it works very nicely. This is the only successful work around I have found in my case. So if I understand well, there is two solutions for now:
|
Beta Was this translation helpful? Give feedback.
-
Dear Parcels community,
I met a problem, which probably has a simple solution.
I want to track the 2D-field (ocean depth in my case) along the particle trajectory.
I define the
H
(depth) variable asSo
H
does not change in time.How correctly can I sample the
H
along the particle trajectory? I try to do this in a such a wayBut the model gives an error
time origins of different grids must be have the same time
As I understand, this is because dimensions of
H
do not includetime
.I don't know if it is important, but this error appears when
time_periodic
option is ON.In this case one more issue.
The example in the
Field sampling tutorial
givesparticle.temperature = fieldset.T[time, particle.depth, particle.lat, particle.lon]
The example in the
Tutorial on Parcels tracer interpolation methods
gives thatparticle.p = fieldset.P[time+particle.dt, particle.depth, particle.lat, particle.lon]
As I understand, example with
time+particle.dt
is more correct.Thanks in advance to everyone who will react to this message.
Beta Was this translation helpful? Give feedback.
All reactions