SUBROUTINE ZEROACU(PSPA3,PSPD2D,PSPA1)

!**** *ZEROACU*  - Sets back accumulating arrays to zero

!     Purpose.
!     --------

!**   Interface.
!     ----------
!        *CALL* ZEROACU
!        Explicit arguments :
!        --------------------

!        Implicit arguments :
!        --------------------
!        None

!     Method.
!     -------

!     Externals.
!     ----------
!          PSPA3...: spectral state vectors

!     Reference.
!     ----------

!     ARPEGE/ALADIN DOCUMENTATION

!     Author.
!     -------

!       Gabor Radnoti GMAP/MICECO

!     Modifications.
!     --------------
!        Original : 92-12-24
!        D. Giard : 93-07-28 PHSUM suppressed
!        D. Giard : 93-08-27 recursive filter -> NCHECK
!        D. Giard : 93-10-15 simplification of recursive filter
!        L. Isaksen : 95-06-06 reordering of spectral arrays
!        M.Hamrud      01-Oct-2003 CY28 Cleaning
!     ------------------------------------------------------------------

USE PARKIND1  ,ONLY : JPIM     ,JPRB
USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK

USE YOMDIM   , ONLY : NFLEVL   ,NFD2D    ,NFLSUR   ,NSPEC2   ,NS3D
USE YOMMP    , ONLY : MYSETV   ,NBSETSP

IMPLICIT NONE

REAL(KIND=JPRB)   ,INTENT(OUT)   :: PSPA3(NFLSUR,NSPEC2,NS3D) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PSPD2D(NSPEC2,NFD2D) 
REAL(KIND=JPRB)   ,INTENT(OUT)   :: PSPA1(NFLEVL,2) 
INTEGER(KIND=JPIM) :: JFD2, JFLS, JFRE, JLEV, JS3
REAL(KIND=JPRB) :: ZHOOK_HANDLE


!  Set arrays to zero
IF (LHOOK) CALL DR_HOOK('ZEROACU',0,ZHOOK_HANDLE)

DO JLEV=1,NFLEVL
  PSPA1(JLEV,1)= 0.0_JPRB
  PSPA1(JLEV,2)= 0.0_JPRB
ENDDO

IF(MYSETV  ==  NBSETSP) THEN

  DO JFD2=1,NFD2D
    DO JFRE=1,NSPEC2
      PSPD2D(JFRE,JFD2)= 0.0_JPRB
    ENDDO
  ENDDO

ENDIF

DO JS3=1,NS3D
  DO JFRE=1,NSPEC2
    DO JFLS=1,NFLEVL
      PSPA3(JFLS,JFRE,JS3)= 0.0_JPRB
    ENDDO
  ENDDO
ENDDO

IF (LHOOK) CALL DR_HOOK('ZEROACU',1,ZHOOK_HANDLE)
END SUBROUTINE ZEROACU
