Previous: consy Up: ../plot79_c.html Next: contfe


CONTCP

       SUBROUTINE  CONTCP (XD, YD, ZD, ND, C, NC, WK, MAXWK, IWK,
      X   MAXIWK, MODE, IERROR, PL2)
 C$    (ALG626 - Contour Plot)
 C$    Plot contours of  a function defined  on an irregular  grid
 C$    without actually generating a uniform grid.  The  arguments
 C$    are:
 C$
 C$    XD(*),YD(*),
 C$    ZD(*)..........Coordinates of data points.  XD and YD  must
 C$                   be given in world units for the current plot
 C$                   window.
 C$
 C$    ND.............Number of data points.
 C$
 C$    C(*)...........Contour levels.
 C$
 C$    NC.............Number of contour levels.
 C$
 C$    WK(*)..........REAL work array,  dimension 5*ND.  On  exit,
 C$                   WK(*)  contains   the  partial   derivatives
 C$                   (ZX(I), ZY(I), ZXX(I), ZXY(I), ZYY(I),  I=1,
 C$                   ND).
 C$
 C$    MAXWK..........Actual declared dimension of WK(*).
 C$
 C$    IWK(*).........INTEGER work  array.   For  MODE  =  0,  the
 C$                   dimension is  31*ND.  For  other modes,  see
 C$                   below.
 C$
 C$                   On exit, IWK(*) contains:
 C$
 C$                   (a) IWK(1) = NT = number of triangles
 C$
 C$                   (b) IWK(2...3*NT+1) point numbers for the
 C$                   triangles.  The  first 3  numbers  determine
 C$                   the vertices of the first triangle, the next
 C$                   3 for  the second  and so  on.  the  numbers
 C$                   correspond to  the  indices  of  the  XD(*),
 C$                   YD(*),  ZD(*)  arrays.   They  are  arranged
 C$                   counter-clockwise within a triangle.
 C$
 C$                   (c) IWK(3*NT+2  ...  3*NT+NCP*ND+1)
 C$                   A list of NCP*ND point numbers, representing
 C$                   NCP points for each data point that are  the
 C$                   closest to this point. The first NCP numbers
 C$                   are for the first  data point, the next  NCP
 C$                   for the second and so on. These numbers were
 C$                   used for  the  computation  of  the  partial
 C$                   derivatives.    NCP   is   an   installation
 C$                   parameter and will be set to 4.
 C$
 C$    MAXIWK.........Actual declared dimension of IWK(*).
 C$
 C$    MODE...........Mode of usage:
 C$                   0 - Normal mode, see above.
 C$                   1 - No triangulation requested.  IWK(*) must
 C$                       contain  the   information   about   the
 C$                       triangles as described under (a) and (b)
 C$                       on entry.   These  locations  of  IWK(*)
 C$                       will not be changed and in addition, the
 C$                       information described under (c) will  be
 C$                       available on exit.
 C$                   2 - No triangulation and no determination of
 C$                       the NCP  closest  points for  each  data
 C$                       point.    IWK(*)   must   contain    the
 C$                       information as described under (a), (b),
 C$                       and  (c)  as  input  information.    The
 C$                       contents of IWK(*) will not be  changed.
 C$                   3 - No triangulation and  no computation  of
 C$                       the  partial  derivatives.  IWK(*)  must
 C$                       contain the information (a) and (b)  and
 C$                       WK(*)   must    contain   the    partial
 C$                       derivatives   (ZX(I),   ZY(I),   ZXX(I),
 C$                       ZXY(I), ZYY(I), I=1, ND) on entry.   The
 C$                       contents of WK(*) and IWK(*) will not be
 C$                       changed.  This mode is especially useful
 C$                       when  TRICP  is  called  again  after  a
 C$                       previous call.  For  instance, only  the
 C$                       contour levels may  have changed.   When
 C$                       designing   a   surface,   it   may   be
 C$                       appropriate to  change  the XD,  YD,  ZD
 C$                       parameters and  the partial  derivatives
 C$                       interactively and  to call  TRICP  again
 C$                       using this mode.
 C$
 C$                   For modes  1,  2,  and 3  the  dimension  of
 C$                   IWK(*) can be reduced to 3*NT + NCP*ND +  1.
 C$
 C$    IERROR.........Error flag set on return.  IERROR = 0
 C$                   indicates success,  and  a  non-zero  value,
 C$                   failure in the triangulation.  In the latter
 C$                   case,  a  message  will  already  have  been
 C$                   printed.
 C$
 C$    PL2............2-D pen movement routine, usually PL2CA.
 C$
 C$    The fitting method  is a  slightly modified  version of  H.
 C$    Akima's ACM Algorithm 526 (routines FITVCM, FITVPD, FITVTA,
 C$    and  FITVXC),  and  corresponds  to  demonstration  program
 C$    TPDEM1 in Preusser's ACM Algorithm 626.  The references  to
 C$    these algorithms are as follows:
 C$
 C$    Hiroshi Akima, "A  Method for  Bivariate Interpolation  and
 C$    Smooth Surface  Fitting  for Irregularly  Distributed  Data
 C$    Points", ACM Trans. Math. Software 4, No. 2, 148-159  (June
 C$    1978).
 C$
 C$    Hiroshi Akima, "Algorithm 526: Bivariate Interpolation  and
 C$    Smooth Surface  Fitting  for Irregularly  Distributed  Data
 C$    Points (E1)", ACM Trans. Math.  Software 4, No. 2,  160-164
 C$    (June 1978).
 C$
 C$    Hiroshi Akima, "Remark on Algorithm 526", ACM Trans.  Math.
 C$    Software 5, No. 2, 242-243 (June 1979).
 C$
 C$    Albrecht Preusser, "Remark  on Algorithm  526", ACM  Trans.
 C$    Math.  Software 11, No. 2, 187-187 (June 1985).
 C$
 C$    Albrect Preusser, "ACM Algorithm  626.  TRICP -- A  Contour
 C$    Plot Program  for  Triangular Meshes",  ACM  Trans.   Math.
 C$    Software, Vol.  10, No. 4, 473-475, (December 1984).
 C$
 C$    Because all requested contours are  traced in order in  one
 C$    triangle at  a time,  discontinuities  in the  contours  at
 C$    triangle edges  may be  evident on  pen plotters,  or if  a
 C$    dashed linestyle is in effect.
 C$    (29-AUG-85)