Natgrid examples


Overview

This module contains source codes for all of the examples referenced by the other modules in the documentation. Links to all of the example plots are provided.

The following list summarizes the examples:

All of the example codes isolate the drawing of graphics into single calls to procedures for drawing surface plots, vector plots, or contour plots. The supporting plotting procedures themselves are collected into a single file and use NCAR Graphics to draw the plots. If you are not using NCAR Graphics and want to draw the plots, you will have to substitute appropriate calls from the graphics package you are using.

Both C and Fortran versions of the plotting procedures are provided that are used by the examples. These are listed in the modules:

Creating your own executable

If you have access to NCAR Graphics, you can create executables for all of the examples in one of two ways. The easiest is to use the ncargex utility which is documented with a man page. The other way is to use either ncargf77 (for Fortran) or ncargcc (for C) to compile and execute the source codes. Use the source codes for the examples together with nnplotf or nnplotc.

If you are using NCAR Graphics and the C interface to Natgrid and you are compiling using ncargcc, then function prototypes for all Natgrid C functions are contained in a C header file. This can be accessed by inserting the line:

#include <ncarg/ngmath.h>
into your code.

If you do not have access to NCAR Graphics, replace the calls for drawing the plots with calls to the appropriate procedures at your site.

Example 1 -- linear interpolation

Example 2 -- nonlinear interpolation

Example 3 -- computing aspects and slopes

Example 4 -- extrapolation

Example 5 -- negative values disallowed

Example 6 -- single-point mode

Example 7 -- outlying point

Example 8 -- using the algorithmic display tool

Example 9 -- displaying first and second order natural neighbors


home | contents | defs | params | procedures | exmpls | index