convert from regular grid to unstructured grid

Questions, issues, or suggestions related to post-processing of model output.
Post Reply
Posts: 12
Joined: Wed Jul 10, 2019 5:56 am

convert from regular grid to unstructured grid

Post by mmaoyi » Sun Dec 01, 2019 6:13 pm

Hi MPAS Community

I would like to know if there is a tool available to convert a structured grid nc file to unstructured grid that MPAS uses.
The reason is that I would like to convert the SST update file to a structured grid, perturb it and then convert it back into an unstructured grid
to be used by MPAS.

Kind Regards

Posts: 468
Joined: Mon Feb 26, 2018 7:35 pm

Re: convert from regular grid to unstructured grid

Post by mgduda » Tue Dec 03, 2019 10:14 pm

Besides the code in the init_atmosphere core for interpolating from intermediate files to the MPAS mesh, I don't think we have any tools for interpolation of general gridded data to the MPAS mesh. Would it be possible to adapt the method you're using to perturb the SST field to work directly on the MPAS unstructured mesh? This may be more challenging if, e.g., you are applying spatial filters to the SST field, but if the perturbations are simply adjustments based on, say, latitude, then this might be easy to do.

If you are comfortable working with Python, it might not be difficult to use SciPy's interp2d to interpolate from something like a structured, latitude-longitude grid to the (longitude,latitude) coordinates at the center of each MPAS cell. Using the netCDF4 module, you could even write the interpolated result directly back to an MPAS netCDF file.

Post Reply

Return to “Post-processing”