      SUBROUTINE FOURPT (MC,MR,R,Z,INNER,IMIN,IMAX,IGIVEN,N1)
C     - - - - - - - - - - - - - - - - - - - - - - - - - - - -
C        FOUR POINT BI-LINEAR INTERPOLATION
C     - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      DIMENSION  R(MC,MR), Z(MC,MR), INNER(MC,MR), IMIN(MR),
     1           IMAX(MR), IGIVEN(MC)
      COMMON /IOUNIT/ NCRD, NPRT, NPUN, NPLT
      JLESS = MR - 1
      N1 = 1
      IF ( JLESS .LE. 1 )  RETURN
      DO 80  J = 2,JLESS
C        COUNT GIVEN POINTS IN ROW
      NG = 0
      I1 = IMIN(J)
      I2 = IMAX(J)
      DO 10 I = I1,I2
      IF ( INNER(I,J) .NE. 1 )  GO TO 10
      NG = NG + 1
      IGIVEN(NG) = I
   10 CONTINUE
C        SKIP TO NEXT ROW IF ALL POINTS ARE GIVEN
      IF ( NG .EQ. (I2-I1+1) )  GO TO 80
      NGLESS = NG - 1
      DO 70 IG = 1,NGLESS
      IGPLUS = IG + 1
C        FIND LIMITING I POINTS
      IF ( (IGIVEN(IGPLUS)-IGIVEN(IG)) .EQ. 1 )  GO TO 70
      IBACK = IGIVEN(IG)
      IFRONT = IGIVEN(IGPLUS)
      I1 = IBACK + 1
      I2 = IFRONT - 1
      DO 60  I = I1,I2
C        FIND LIMITING J POINTS
      J1 = J + 1
      DO 20  JJ = J1,MR
      IF ( INNER(I,JJ) .EQ. 1 )  GO TO 30
   20 CONTINUE
   30 JTOP = JJ
      J2 = J - 1
      DO 40  JJ = 1, J2
      JJJ = J - JJ
C        CALCULATE COORDINATES
      IF ( INNER(I,JJJ) .EQ. 1 )  GO TO 50
   40 CONTINUE
   50 JBOT = JJJ
      A = IFRONT - I
      B = JTOP - J
      C = I - IBACK
      D = J - JBOT
C        CALCULATE R COORDINATE OF POINT I,J
      R(I,J) = ( R(IFRONT,J)/(A*(A+C)) + R(I,JTOP)/(B*(B+D))
     1 + R(IBACK,J)/(C*(C+A)) + R(I,JBOT)/(D*(D+B)))*A*B*C*D/(A*C+B*D)
C        CALCULATE Z COORDINATE OF POINT I,J
      Z(I,J) = ( Z(IFRONT,J)/(A*(A+C)) + Z(I,JTOP)/(B*(B+D))
     1 + Z(IBACK,J)/(C*(C+A)) + Z(I,JBOT)/(D*(D+B)))*A*B*C*D/(A*C+B*D)
   60 CONTINUE
   70 CONTINUE
   80 CONTINUE
      RETURN
      END
