Skip to content

Transposed fields in FieldSet from NetCDF #1239

Answered by VeckoTheGecko
MiriamSterl asked this question in Q&A
Discussion options

You must be logged in to vote

Its a bit difficult to diagnose the problem without having the file output_layer1.nc to look at. From my understanding, the transpose=True flag is mainly to do with the internal ordering of the dataset (ie. how the NetCDF file appears on disk). Parcels is sensitive to this ordering in that it needs to be ["time", "y", "x"] as mentioned here in the documentation. Normally incorrect ordering is picked up by parcels on read-in, spitting back an informative error message, but your domain could be perfectly square and hence snuck through.

If you plot by loading the dataset in xarray, do you get the same problem?

import xarray as xr
ds = xr.load_dataset('test.nc')
ds.u.plot(x='LON', y='LAT') # …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@MiriamSterl
Comment options

MiriamSterl Sep 21, 2022
Collaborator Author

Answer selected by MiriamSterl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants