      SUBROUTINE CLRBUF(BUFFER, XDIM, YDIM, ZDIM)
      IMPLICIT NONE
C
C***********************************************************************
C
C   NAME- CLRBUF
C
C   LANGUAGE- FORTRAN 77      TYPE- SUBROUTINE   COMPUTER- CRAY    
C
C   VERSION- 1.0      DATE- 01/25/91    PROGRAMMER- CARLA NEIGH (SMSRC)
C   VERSION- 2.0      DATE- 05/09/96    PROGRAMMER- ALEX POZDNYAK (FDC)
C      MODIFIED TO RUN ON THE CRAY.  REPLACED I*4 WITH INT AND
C      R*4 WITH REAL IN CALLING ARGUMENTS.
C 
C   FUNCTION-  THIS SUBROUTINE SETS ALL ELEMENTS OF A THREE DIMENSIONAL
C              REAL*4 ARRAY TO THE SPECIAL VALUE R4SPV.
C
C   CALLING SEQUENCES-
C      VARIABLE     TYPE    DESCRIPTION
C      --------     ----    -----------
C      BUFFER       REAL    3-D BUFFER (XDIM BY YDIM BY ZDIM)
C      XDIM         INT     X DIMENSION OF BUFFER
C      YDIM         INT     Y DIMENSION OF BUFFER
C      ZDIM         INT     Z DIMENSION OF BUFFER
C
C   LOCAL VARIABLES-
C      VARIABLE     TYPE    DESCRIPTION
C      --------     ----    -----------
C        I,J,K      INT     DO LOOP COUNTERS
C
C***********************************************************************
C
      INTEGER   XDIM, YDIM, ZDIM
      REAL      BUFFER(XDIM,YDIM,ZDIM)
      INTEGER   I,J,K
C
      INCLUDE 'SPVAL'
C
      DO 30 I = 1, XDIM
        DO 20 J = 1, YDIM
          DO 10 K = 1, ZDIM
             BUFFER(I,J,K) = R4SPV
   10     CONTINUE
   20   CONTINUE
   30 CONTINUE
C
      RETURN
      END
