Assigning non-constant longitude/latitude to a mesh

Hello,

I want to display the mesh used in a numerical simulation (Nemo ocean model). The model has 803*803 cells with coordinates defined by longitude and latitude. Each cell has a specific size, which means that the grid is not constant. This data is coming from a netcdf file whith the following structure:
image

According the configuration of the mesh, longitude and latitude are not defined as dimensions in the netcdf file. I understood that praview can’t recognize them as coordinates. So, It took the cells indices as coordinates. I can’t find a Paraview’s solution to modify the mesh and assign the longitude/latitude coordinates to the corresponding cells. Is there any solution to this in Paraview or do I have to pre-process the file first ?

Any suggestions will be welcome.

jb

Hi.

I came across a similar problem. I used xesmf regridding package. Then, using xarray (assign_coords()) I reassigned the new coordinates and it now works.

The links:
https://xesmf.readthedocs.io/en/latest/notebooks/Curvilinear_grid.html

Happy coding.
Marco

1 Like

Hi Marco,
Thanks for your reply.
Since then, I also check the compatibilty of my netcdf file with the NetCDF Climate and Forecast (CF) Metadata Conventions. In my case, it appears that the lon/lat dimensions were not correctly defined with respect to the convention. I managed the modifications of the header using NCO tools (ncatted).

Great. The data I am working with (WRF model) are not CF compliant at all, so I had to do some twitching. If you happen working with the same data, another great, open source, visualization tool is VAPOR developed by NCAR.

Bye Bye

1 Like