C*********************************************************************
C*********************************************************************
C
      SUBROUTINE SETGRD
     O   ( ZGRID, FDZ, FDZM, DX,
     D     NZ, NZB                )
C
C*********************************************************************
      IMPLICIT REAL*8 ( A-H, O-Z )
C*********************************************************************
C
      DIMENSION ZGN(-10:1000)
C
      DIMENSION ZGRID(-2:NZB), FDZ(-2:NZB), FDZM(-2:NZB)
C
C---------------------------------------------------------------------
C
C
      DX = 100.0D0
c      DX = 1000.0D0
C
C
      DO 11 IZ = 0, NZ
         ZGN ( IZ ) = 500.0D0 * IZ
   11 CONTINUE

!      DO IZ = 201, NZ
!         ZGN ( IZ ) = ZGN( 200 ) + 500 * ( IZ - 200 )
!      END DO

      ZGN(NZ+1) = 2.0D0 * ZGN(NZ) - ZGN(NZ-1)
      ZGN(NZ+2) = 2.0D0 * ZGN(NZ) - ZGN(NZ-2)
      ZGN(NZ+3) = 2.0D0 * ZGN(NZ) - ZGN(NZ-3)
      ZGN(  -1) = - ZGN(   1)
      ZGN(  -2) = - ZGN(   2)
C
      DO 12 IZ = 0, NZ+2
         ZGRID(IZ) = ( ZGN(IZ) + ZGN(IZ+1) ) / 2.0D0
   12 CONTINUE
C
      ZGRID(-1) = - ZGRID(0)
      ZGRID(-2) = - ZGRID(1)
C
      DO 21 IZ = 0, NZ-1
         FDZ(IZ) = ( ZGN(IZ+1) - ZGN(IZ) )  / DX
   21 CONTINUE
C
      FDZ(-1)   = FDZ(0)
      FDZ(-2)   = FDZ(1)
      FDZ(NZ)   = FDZ(NZ-1)
      FDZ(NZ+1) = FDZ(NZ-2)
      FDZ(NZ+2) = FDZ(NZ-3)
C
C
      DO 22 IZ = 0, NZ
         FDZM(IZ) = ( FDZ(IZ-1) + FDZ(IZ) ) / 2.0D0
   22 CONTINUE
C
      FDZM(-2)   = FDZM(2)
      FDZM(-1)   = FDZM(1)
      FDZM(NZ+1) = FDZM(NZ-1)
      FDZM(NZ+2) = FDZM(NZ-2)
C
C=====================================================================
C
      RETURN
      E N D
