MPAS_DRAW
Display MPAS Grids and Solution Data
MPAS_DRAW
is a C++ program which
reads information from a NETCDF file written by the MPAS program,
containing the grid information
and computed solution values, some of which may be time dependent,
or organized in vertical atmospheric levels, and then displays
graphic images of data using OpenGL.
The program is interactive, and allows the user to select the
underlying mesh structure (cells, dual triangles, or edges)
and the associated physical quantities to view.
A set of keyboard commands allow the user to rotate or translate
the view, to move through time steps or vertical levels, and so on.
Usage:
mpas_draw filename.nc
where
-
filename.nc is the name of the MPAS NETCDF grid file;
Keyboard Control:
-
Arrow keys: rotate the image, to allow for viewing
at different angles.
-
s, d, f, e: (translation)
s/f keys move left and right; d/e move up and down.
-
, .: (translation)
The , and . keys control the depth of the image. That is,
they appear to move the image toward or away from the viewer.
-
c: (connectivity)
cycles between the kind of cells that are drawn:
-
the Delaunay triangles;
-
the Voronoi cells;
-
the edges, drawn as rectangles made up of two cell centers, and two
cell vertices.
The kind of cells chosen also determines the kind of variables
that can be plotted.
-
w: (wireframe)
toggles the wireframe (cell boundaries) on and off.
-
r: (reset)
resets the plot to the default parameters (for color, timestep, vertical level, position, and rotation).
-
v: (variables)
lists available variables that can be chosen
to color the current mesh with. After pressing v, the variables are listed in the terminal.
The variable id (given as a number in the leftmost column) can be entered to
change the color of the current plot.
-
l: (level)
cycles through available vertical levels.
-
t: (time)
cycles through available time steps.
-
ESC: (terminate) closes the program.
Licensing:
The computer code and data files described and made available on this web page
are distributed under
the GNU LGPL license.
Languages:
MPAS_DRAW is available in
a C++ version.
Related Programs:
MPAS_GRID_DISPLAY,
MATLAB programs which
can read an MPAS NETCDF grid file and display the primary polygonal
mesh or the dual triangular mesh.
MPAS_GRID_DISPLAY_OPENGL,
C++ programs which
can read an MPAS NETCDF grid file and display the primary polygonal
mesh or the dual triangular mesh, using OpenGL.
NETCDF,
a data directory which
contains examples of NETCDF files,
a format for the interchange of scientific data.
NETCDF_MPAS,
a data directory which
contains examples of MPAS grid data stored as NETCDF files.
NETCDF_MPAS,
a C++ library which
reads MPAS grid data stored as NETCDF files.
Author:
Doug Jacobsen, John Burkardt, Geoff Womeldorff.
Reference:
-
The MPAS home page,
http://mpas-dev.github.io .
-
Russ Rew, Glenn Davis, Steve Emmerson, Harvey Davies, Ed Hartne,
The NetCDF User's Guide,
Unidata Program Center, March 2009.
-
Todd Ringler, John Thuburn, Joseph Klemp, William Skamarock,
A unified approach to energy conservation and potential
vorticity dynamics for arbitrarily-structured C-grids,
Journal of Computational Physics,
Volume 229, Number 9, 1 May 2010, pages 3065-3090.
Source Code:
Examples and Tests:
-
channel.nc,
an MPAS grid file for a mesh restricted to a channel on
the sphere, between a pair of latitude lines,
using 2660 cells, 5545 vertices, 8205 edges.
-
greenland_5km.nc,
an MPAS grid file for a 301 x 561 mesh of Greenland.
-
x1.642.grid.nc,
an MPAS grid file for a mesh on the sphere,
using 642 nodes, 1280 vertices, 1920 edges.
-
x1.2562.grid.nc,
an MPAS grid file for a mesh on the sphere,
using 2562 nodes, 5120 vertices, 7680 edges.
-
x16.2562.grid.nc,
an MPAS grid file for a mesh on the sphere,
using 2562 nodes, 5120 vertices, 7680 edges.
A variable mesh density was used.
You can go up one level to
the MATLAB source codes.
Last revised on 18 January 2011.