Csagrid Examples


Overview

This module contains source codes for Csagrid examples.

The following list summarizes the examples:

The plotting subroutines used by the Fortran examples to plot surfaces and isosurfaces are TDEZ2D and TDEZ3D from the Tdpack package of NCAR Graphics. TDEZ2D is a simplified procedure for drawing a surface and TDEZ3D is a simplified procedure for drawing an isosurface. The C examples use the C functions, c_tdez2d.c and c_tdez3d.c from Tdpack - these are equivalent to the Fortran procedures. The NCL examples use the built-in functions tdez2d and tdez3d.

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.

Creating your own executable

If you have access to NCAR Graphics, you can create executables for all of the Fortran and C 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.

If you are using NCAR Graphics and the C interface to Csagrid and you are compiling using ncargcc, then function prototypes for all Csagrid 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 are using NCAR Graphics, you can run all of the NCL examples for Csagrid using the ng4ex utility. The NCL examples utilize GSUN> functions.

Example 1 -- a one-dimensional example varying the number of knots

Example 2 -- a one-dimensional example illustrating input data weighting

Example 3 -- a one-dimensional example illustrating extrapolation into data sparse regions

Example 4 -- a two-dimensional example illustrating taking partial derivatives

Example 5 -- a three-dimensional example (sphere)

Example 6 -- a three-dimensional example (tube)

Example 7 -- a two-dimensional example using list output


home | contents | defs | procedures | examples | errors