Comments (8)
This issue has been solved in #1509 !
from parcels.
Thanks for raising this @eavellashaw. I'm surprised that this doesn't work; so far it has always worked on C-grids. See e.g. the homepage animation tutorial, where particles move happily through the Arctic in curvilinear NEMO simulation (see also the Curvilinear Grid tutorial.
Can you show what is wrong with your particles?
from parcels.
Thanks so much for your fast reply @erikvansebille! A fellow student used Parcels in a NEMO configuration and it worked, that is why I am confused too ...
Here are two figures I made showing the advection of the particles, colors corresponding to the depth the particles were at at time = 0
. The first one is the result when run with xu_ocean
and yu_ocean
, and the second one when run with geolon_c
and geolat_c
.
The particles are generally supposed to circulate along the slope (black arrow), not go straight toward the North Pole (1st figure). In the second one, it is also acting weirdly as the particles seem to be "blocked", but they are not that deep and the bathymetry should not be a problem at their depths.
I was thinking that when interpolating, Parcels may get the wrong indices due to the fact that the dimensions of the velocity fields are x and y, not geolon and geolat. I am fairly new to all of this so I might be completely wrong...
If there is any kind of unclarity don't hesitate to let me know!
from parcels.
Dear @eavellashaw, I must say that the stop at exactly 80N in the right figure looks conspicuous. But I have no idea why this would go wrong. As you say, there is no problem with NEMO's C-Grid, so it might have to do something with MOM5's B-grid?
I'm sorry, but I can't help you much more. I don't have access to B-grid models (we don't use them in my team) and thus also no time to dig much deeper into this. Perhaps other MOM5/Parcels users might have solutions?
from parcels.
I think it definitely has something to do with MOM5's B-grid, I am now reaching out to people having worked with MOM5 B-grid velocities (typically the ones mentioned in #860), I'll let you know if a solution pops out!
Thanks for your help!
from parcels.
Hi @erikvansebille, as I have a bit more insight on the situation, I have a follow-up question.
So, I ran two same simulations but creating the fieldset with from_mom5()
in the first one and with from_nemo()
in the second one. I chose to do so to be sure that the error lied elsewhere than in the curvilinearity and tripolarity of my grid.
I don't know if you are familiar with the surface circulation in the Arctic, but the results in the second figure are way more convincing than in the first one.
My question is the following: Do you know what is the main difference when indexing the latitude and longitude coordinates of the particles between from_nemo()
and from_mom5()
when performing the interpolation? I think the error might come from parcels looking at the wrong coordinates.
As said earlier, here are the dimensions of my velocity fields:
u (st_ocean, yu_ocean, xu_ocean)
v (st_ocean, yu_ocean, xu_ocean)
w (sw_ocean, yt_ocean, xt_ocean)
These are 1-D arrays and when indexing, parcels might be searching for indices in these arrays and not in geolat_c
and geolon_c
.
This is of course an hypothesis, tell me if it makes sense and if you know where I should look into the parcels code for testing it! I already looked into the code but I am not sure where to look specifically and what to change.
Cheers,
from parcels.
Thanks for diving into this, @eavellashaw. I agree with you that the second plot (with from_nemo()
) looks more realistic.
The biggest difference between from_mom5
and from_nemo
is that the first expects an Arakawa B-grid, whereas from_nemo
interprets the data as on a C-grid.
So if your data is indeed on a C-grid, it makes much more sense to use from_nemo
(or from_mitgcm
, which has slightly different conventions on where the grid corners are)
Anyways, the specific calls for the MOM5 interpolation are at every instance where MOM5
is used in the code here
parcels/parcels/include/parcels.h
Lines 437 to 551 in dad04e3
and also
parcels/parcels/include/index_search.h
Lines 101 to 105 in dad04e3
But note that the code above is the C/JIT version, which may be complicated to read. If you prefer to look at the scripy version, that is here
Lines 1076 to 1080 in dad04e3
and
Lines 698 to 703 in dad04e3
from parcels.
Thank you for this fast reply, I'll dive into the code and let you know if I make an interesting discovery!
I am working on an Arakawa B-grid with mom5 velocity fields (CM2-O models suite), that is why I used from_mom5()
. But I thought about using from_nemo()
as the biggest difference between these two are the interpolation methods and the locations of the points in the vertical. This was to check if something was wrong with my datasets, or if the problem might lie in Parcels, handling in the wrong way the coordinates of my velocity fields.
Anyway, I'll let you know!
from parcels.
Related Issues (20)
- Investigate integrating AI for Parcels documentation HOT 6
- Raise a Warning or Error when lon/lat in grids are not monotonically increasing
- Overlapping time values while creating a FieldSet HOT 2
- Field entry gives error when time-array has np.datetime64 entries HOT 1
- Fieldset.from_data() sets "time_origin" to 0 by default HOT 1
- Simulation gets stuck on first timestep since I installed Parcels v3.0 HOT 10
- Cell indices can not be found when grid has a non-linear mapping HOT 1
- recovery option diseapperaed HOT 3
- Time-Varying Depths From Nemo HOT 2
- `NaN` padding in zarr files with delayed start times HOT 2
- RunTimeErrorWarning in output files HOT 1
- Delayed particles does not repeat the set initial locations HOT 2
- Field[time, depth, lat, lon] indexing not working correctly in JIT mode. HOT 1
- FieldSet.from_mom does not consider grid rotation HOT 2
- Rename FieldSet.from_mom to FieldSet.from_mom5 and create new FieldSet.from_mom6 HOT 2
- Add tutorial information about `indices` keyword when creating FieldSet
- Confusing compilation error message when variable in Kernel has same name as FieldSet constant HOT 1
- RK45 not working HOT 1
- Fieldset.from_zarr? HOT 1
- How to Output or Check Interpolation Results of u_uss and v_uss in Parcels Custom Kernel? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from parcels.