Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

how to visualize the regional meshes

Feng Liu

Member
Hi,
After successfully creating the regional mesh as below, I obtained two files: 3km.region.grid.nc and 3km.region.grid.info. However, these are not PNG files as mentioned in the MPAS tutorial. Does anyone have suggestions on how to generate an image file to visualize the mesh?
------------------------------------------------------------------------
./create_region --plot region.pts ./3km.regiong.global.grid.nc
Creating a regional mesh of 3km.region.global.grid.nc
Marking boundary 1 ...
Filling region ...
Creating boundary layer: 1 ... 2 ... 3 ... 4 ... 5 ... 6 ... 7 ... 8 ... DONE!
Marking region edges ...
Marking region vertices...
Subsetting mesh fields into the specified region mesh...
Copying variable indexToCellID... reindexing field ... Done!
Copying variable latCell...
Copying variable lonCell...
Copying variable xCell...
Copying variable yCell...
Copying variable zCell...
Copying variable indexToVertexID... reindexing field ... Done!
Copying variable latVertex...
Copying variable lonVertex...
Copying variable xVertex...
Copying variable yVertex...
Copying variable zVertex...
Copying variable indexToEdgeID... reindexing field ... Done!
Copying variable latEdge...
Copying variable lonEdge...
Copying variable xEdge...
Copying variable yEdge...
Copying variable zEdge...
Copying variable nEdgesOnCell...
Copying variable cellsOnCell... reindexing field ... Done!
Copying variable verticesOnCell... reindexing field ... Done!
Copying variable edgesOnCell... reindexing field ... Done!
Copying variable cellsOnVertex... reindexing field ... Done!
Copying variable edgesOnVertex... reindexing field ... Done!
Copying variable cellsOnEdge... reindexing field ... Done!
Copying variable verticesOnEdge... reindexing field ... Done!
Copying variable nEdgesOnEdge...
Copying variable edgesOnEdge... reindexing field ... Done!
Copying variable areaCell...
Copying variable areaTriangle...
Copying variable kiteAreasOnVertex...
Copying variable dvEdge...
Copying variable dcEdge...
Copying variable angleEdge...
Copying variable weightsOnEdge...
Copying variable meshDensity...
Copying variable nominalMinDc...
Copying variable densityFunctionCode...
Copying global attributes...
Created a regional mesh: 3km.region.grid.nc
Creating graph partition file... 3km.region.graph.info
 
Hi Liu:

You can use ncl or python uxarray to plot the regional MPAS mesh. Here is a ncl script for example, by changing filename to "3km.region.grid.nc" you're able to view the mesh. If you want to view high quality figure, please change the output format from "png" to "pdf".

Jason
 
You need to run NCL or Python or some other graphic package to create the .png file that shows the mesh.

Please see the website that provides a sample NCL script to plot MPAS mesh.

You can find more samples here.
 
Hi Liu:

You can use ncl or python uxarray to plot the regional MPAS mesh. Here is a ncl script for example, by changing filename to "3km.region.grid.nc" you're able to view the mesh. If you want to view high quality figure, please change the output format from "png" to "pdf".

Jason
Hi Jason,

Thank you for your response. I tried running the script, but I encountered the following error message. I'm not sure how to resolve it. Could you please take a look and offer any suggestions for fixing it?

-------------
Copyright (C) 1995-2019 - All Rights Reserved
University Corporation for Atmospheric Research
NCAR Command Language Version 6.6.2
The use of this software is governed by a License Agreement.
See NCAR Command Language (NCL) for more details.
(0) Number of edges = 418791
fatal:Subscript out of range, error in subscript #0
fatal:An error occurred reading ecx
fatal:["Execute.c":8637]:Execute: Error occurred at or near line 100 in file mpas_faster_2.ncl
 
You need to run NCL or Python or some other graphic package to create the .png file that shows the mesh.

Please see the website that provides a sample NCL script to plot MPAS mesh.

You can find more samples here.
Thank you for your response, Ming. Whether I use NCL or Python scripts, neither is producing the expected results and both are generating errors. I’ll need to revisit my process for creating the regional mesh file to make sure everything is set up correctly.
 
I have attached a standard NCL script that can be used to plot mpas mesh. Would you please try and let me know whether it works?
 

Attachments

  • mesh.txt
    2 KB · Views: 4
I have attached a standard NCL script that can be used to plot mpas mesh. Would you please try and let me know whether it works?
Hi Ming,
I successfully generated the mesh in the PDF file using the script you sent me (please see the attached screenshot ). Thank you so much!
 

Attachments

  • mesh.png.png
    mesh.png.png
    456.5 KB · Views: 1
Top