NCL Website header
NCL Home> Application examples> Models || Data files for some examples

Example pages containing: tips | resources | functions/procedures


From the MPAS Home Page page:

The Model for Prediction Across Scales (MPAS) is a collaborative project for developing atmosphere, ocean and other earth-system simulation components for use in climate, regional climate and weather studies. The primary development partners are the climate modeling group at Los Alamos National Laboratory (COSIM) and the NCAR. Both primary partners are responsible for the MPAS framework, operators and tools common to the applications; LANL has primary responsibility for the ocean model, and NCAR has primary responsibility for the atmospheric model.

mpas_1.ncl: This example shows how to create a color-filled contour plot of surface pressure on an MPAS grid.

The lat/lon values on the file are in radians, so they need to be converted to degrees. Since they contain missing values, it is necessary to set trGridType to "TriangularMesh" to plot correctly.

cnFillMode is set to "RasterFill" to make the plotting go faster.

mpas_2.ncl / mpas_faster_2.ncl: This example shows how to draw the MPAS-O (ocean) grid edges on a cylindrical equidistant or polar stereographic map.

This map would be too busy if you drew the whole globe (there are 349,339 edges), so this example zooms in on arbitrarily selected areas.

With NCL Version 6.2.0, there's a much faster way of drawing the MPAS edges, using the new resource gsSegments. The "mpas_faster_2.ncl" script demonstrates the use of this resource.

Timing results on a Mac laptop:

mpas_2.ncl: 105.9 CPU seconds
mpas_faster_2.ncl: 0.58 CPU seconds

This example shows how to regrid unstructured MPAS data (163842 cells) to a 0.25 degree grid (719 x 440), using the default "bilinear" method with ESMF_regrid.

mpas_3.ncl / mpas_cell_3.ncl / mpas_polygon_3.ncl: This example shows how to draw contours of temperature on a 15 km MPAS grid (2,621,442 cells) using three different methods:

The second two methods will only work in NCL V6.2.0 and later. The first method (raster fill), works in previous versions, but has been significantly sped up in NCL V6.2.0.

The cell fill and polygon methods produce slightly nicer looking plots (the 2nd and 3rd images above); you won't see the white corners in the upper and lower left corners of the plot.

Here are some timing results on a Mac for the various scripts:

mpas_3.ncl (V6.1.2):       83.5 CPU seconds
mpas_3.ncl (V6.2.0):       14.5 CPU seconds
mpas_cell.ncl (V6.2.0):    95.6 CPU seconds
mpas_polygon.ncl (V6.2.0): 71.9 CPU seconds

The mpas_polygon_3.ncl example is the most complicated one to use, because you have to generate the labelbar yourself and call gsn_add_polygon to add the polygons after the map plot is created. It was written mainly to show how to use the gsSegments and gsColors resources. This example will give you the most control over the individual cells, should you need it.

mpas_4.ncl / mpas_cell_4.ncl: This example shows how to draw raster-filled contours of "ssh" on an MPAS-O (ocean) grid, using a cylindrical or polar steregraphic map.

The first image uses raster contours (res@cnFillMode = "RasterFill") over a global area, and the second image uses cell-filled contours (res@cnFillMode = "CellFill") over a zoomed area. Using "CellFill" allows you to turn on the cell edges with cnCellFillEdgeColor.