SUBROUTINE RESET

!**** SUBROUTINE RESET - RESET TABLES AND COUNTERS FOR LEVEL SELECTION

!          HEIKKI JARVINEN   ECMWF          15/MAR/1995

!*    METHOD
!     ------

!*    EXTERNALS
!     ---------

!        RESET IS CALLED BY SUBROUTINE LEVEL

!**   MODIFICATIONS
!     -------------

!     ------------------------------------------------------------------

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

USE YOMANCS  , ONLY : NMDI     ,RMDI
USE YOMLEVSE , ONLY : NSTDPL   ,NLLNVA   ,NLLNDA   ,NVCOUN   ,&
 & NVPOIN   ,GVDIST  

IMPLICIT NONE

INTEGER(KIND=JPIM) :: J1, J2, J3
REAL(KIND=JPRB) :: ZHOOK_HANDLE

!     ------------------------------------------------------------------

!        1.       INITIALIZE
!                 ----------

!           1.1       RESET VARIABLE COUNTERS

IF (LHOOK) CALL DR_HOOK('RESET',0,ZHOOK_HANDLE)
DO J1 = 1, NSTDPL
  DO J2 = 1, NLLNVA
    NVCOUN(J1,J2) = 0
  ENDDO
ENDDO

!           1.2       RESET REPORT/DATUM POINTER AND IF REJECTED (0/1)

DO J1 = 1, NSTDPL
  DO J2 = 1, NLLNVA
    DO J3 = 1, NLLNDA
      NVPOIN(J1,J2,J3,1) = NMDI
      NVPOIN(J1,J2,J3,2) = NMDI
      NVPOIN(J1,J2,J3,3) = 0
      NVPOIN(J1,J2,J3,4) = 0
    ENDDO
  ENDDO
ENDDO

!           1.3       RESET TABLE OF DISTANCES TO STD-LEVELS

DO J1 = 1, NSTDPL
  DO J2 = 1, NLLNVA
    DO J3 = 1, NLLNDA
      GVDIST(J1,J2,J3) = RMDI
    ENDDO
  ENDDO
ENDDO

!*
!     ------------------------------------------------------------------

!        2.       RETURN
!                 ------
IF (LHOOK) CALL DR_HOOK('RESET',1,ZHOOK_HANDLE)
END SUBROUTINE RESET
