CNTRPLT plots a contour plot of a uniformly sampled 2-d input array. The input consists of a 2 dimensional grid of y values. For each contour level the array is scanned cell by cell. A contour segment is determined by linearily interpolating the edges of the square formed by 4 adjacent points (a cell). For example, if the current contour value is 1, and y(1,1)=0, y(1,2)=2, y(2,2)=3, and y(1,2)=4, a contour line is assumed to exist for this cell as shown:
y(1,2) y(2,2) * * + \ * + * y(1,1) y(1,2)The contour values are uniformly spaced between the input starting and end values or automatically selected values. Other than color, the sequence of plotting (min to max), and line typing of various contour lines, no contour line identification scheme is provided. Log axes are available but data points are plotted using linear positioning. (Note: common block scale factors will be log values if the log axes are selected.)
The pathological case of two contour lines within a cell may case the routine to incorrectly trace the contour through that cell.
CALL CNTRPLT(v,ndx,ndy,nx,ny,nl,as,ae,iflag,xl,yl,xt,nxt,yt,nyt, t,nt,xm,xx,ym,yx<<,ic>,l>) v (R): 2-d array dimensioned v(ndx,ndy) ndx,ndy (I): dimensions of v data array nx,ny (I): number of points in each array dimension nl (I): number of uniformly spaced contour levels, < 0 : max and min of v are used for as, ae (j)th contour is (j-1)*(ae-as)/(nl-1)+as = 0 : int(ae) specifies the number of contour values where as is an array of the contour values > 0 : number of uniformly space contour levels, (j)th contour is (j-1)*(ae-as)/(nl-1)+as as (R): first contour level (nl > 0) array of contour levels (nl=0) dimensioned as(int(ae)) ae (R): last contour level (nl > 0) number of contour levels in as (nl=0) ae>0 iflag (I): option flag < 0 : do not close LONGLIB after plotting = 0 : close LONGLIB--no plot produced > 0 : close LONGLIB after plotting (magnitude) >10000: do not initialize LONGLIB before plotting (1's digit) = 1 : plot x linear, y logarithmic (base 10) = 2 : plot x logarithmic, y linear = 3 : plot x logarithmic, y logarithmic = 4 : plot x linear, y linear (10's digit) = 0 : no axes or title plotted = 1 : plot box with axis tick marks on top and sides = 2 : plot solid cartesian grid = 3 : plot ticked cartesian grid without box = 4 : plot ticked cartesian grid with box = 5 : plot ticked cartesian grid, box w/axis ticks = 6 : plot without box or cartesian grid = 7 : plot solid logarithmic grid = 8 : plot dotted logarithmic grid = 9 : plot ticked logarithmic grid (100's digit) = 0 : Ask which screen device to use <> 0 : Screen Device Number (see FRAME) xl (R): x axis length in inches (integer-valued) > 0 : use input scaling in xm,xx for axis < 0 : use smoothed input scaling in xm,xx for axis yl (R): y axis length in inches (integer valued) > 0 : use input scaling in ym,yx for axis < 0 : use smoothed input scaling in ym,yx for axis xt (C): x axis title string nxt (I): number of characters in xt < 0 : axis ticks on top of x axis = 0 : no axis > 0 : axis ticks on bottom of x axis (normal) yt (C): y axis title string nyt (I): number of characters in yt < 0 : axis ticks on right of y axis = 0 : no axis > 0 : axis ticks on left of y axis (normal) t (C): plot title string nt (I): number of characters in t (limited to 99 characters) < 0 : use color array = 0 : no title > 0 : do not use color array if |nt|/100 > 0 : use line type list xm (R): minimum value of x axis (will be smoothed for xl < 0) xx (R): maximum value of x axis (will be smoothed for xl < 0) ym (R): minimum value of y axis (will be smoothed for yl < 0) yx (R): maximum value of y axis (will be smoothed for yl < 0) (NOTE: color array accessed if nt < 0 or |nt|/100 >0) ic (I): color array ic(1) : color for grid ic(2) : color for axis lines ic(3) : color for axis numbers ic(4) : color for axis titles ic(5) : color for axis exponent ic(6) : color for title (return) ic(7) : color for contour line 1 ic(8) : color for contour line 2 ic(9) : etc. ... l (I): line type list for contours (accessed only if |nt|/100>0) common /ccntrplt/xmr,dxr,ymr,dyr xmr (R): returned value of xmin dxr (R): returned value of scale factor (xmax-xmin)/xlen ymr (R): returned value of ymin dyr (R): returned value of scale factor (ymax-ymin)/ylen