Previous: fitrg Up: ../plot79_f.html Next: fitsm


FITSF

       SUBROUTINE  FITSF (LX, LY, X, Y, Z, NROWZ, MX, MY, NU, NV, U,
      X                   V, W, NROWW, IERROR)
 C$    (Smooth Surface Fitting)
 C$    This subroutine fits  a smooth surface  of a  single-valued
 C$    bivariate function Z = Z(X,Y) to a set of input data points
 C$    given at input grid points in an X-Y plane.  It generates a
 C$    set of output grid points by  equally dividing the X and  Y
 C$    coordinates in each interval between  a pair of input  grid
 C$    points, interpolates the Z value for the X and Y values  of
 C$    each output  grid  point, and  generates  a set  of  output
 C$    points consisting of input data points and the interpolated
 C$    points.
 C$
 C$    This subroutine generates a full  surface of points.  If  a
 C$    single point, or a single curve, is to be interpolated, use
 C$    SUBROUTINE FITBV.   The method  is  based on  a  piece-wise
 C$    function composed of a set of bicubic polynomials in X  and
 C$    Y.  Each polynomial  is applicable  to a  rectangle of  the
 C$    input grid in the X-Y plane.  Each polynomial is determined
 C$    locally.
 C$
 C$    The input arguments are:
 C$
 C$    LX  = Number of input grid points in the X coordinate
 C$          (must be 2 or greater)
 C$    LY  = Number of input grid points in the Y coordinate
 C$          (must be 2 or greater)
 C$    X   = Array of dimension LX storing the X coordinates
 C$          of input grid points (in ascending or descending
 C$          order)
 C$    Y   = Array of dimension LY storing the Y coordinates
 C$          of input grid points (in ascending or descending
 C$          order)
 C$    Z   = Doubly-dimensioned array of dimension (NROWZ,LY)
 C$          storing the values of the function at input
 C$          grid points
 C$    NROWZ = Row dimension of Z(*,*).   Must be .GE. LX.
 C$    MX  = Number of subintervals between each pair of
 C$          input grid points in the X coordinate
 C$          (must be 2 or greater)
 C$    MY  = Number of subintervals between each pair of
 C$          input grid points in the Y coordinate
 C$          (must be 2 or greater)
 C$    NU  = Number of output grid points in the X coordinate
 C$        = (LX-1)*MX+1
 C$    NV  = Number of output grid points in the Y coordinate
 C$        = (LY-1)*MY+1
 C$    NROWW = Row dimension of W(*,*).  Must be .GE. NU.
 C$
 C$    The output arguments are:
 C$
 C$    U   = Array of dimension NU where the X coordinates of
 C$          output points are to be displayed
 C$    V   = array of dimension NV where the Y coordinates of
 C$          output points are to be displayed
 C$    W   = Doubly-dimensioned array of dimension (NROWW,NV)
 C$          where the Z coordinates of output points are to
 C$          be displayed
 C$    IERROR = 0  (Normal return)
 C$           .GT. 0 (Abnormal return.  A message will be printed
 C$                 giving all  the  arguments, and  nothing  more
 C$                 will be done)
 C$
 C$    Some variables internally used are
 C$    ZA  = Divided difference of Z with respect to X
 C$    ZB  = Divided difference of Z with respect to Y
 C$    ZAB = Second order divided difference of Z with
 C$          respect to X and Y
 C$    ZX  = Partial derivative of Z with respect to X
 C$    ZY  = Partial derivative of Z with respect to Y
 C$    ZXY = Second order partial derivative of Z with
 C$          respect to X and Y
 C$
 C$    Author:  Hiroshi Akima, "Bivariate Interpolation and Smooth
 C$             Surface  Fitting  Based   on  Local   Procedures",
 C$             Algorithm 474, Comm. A.C.M. 17, 18-20 (1974).
 C$
 C$    (03-NOV-79)