!======================= INTEGER*4 =========================:
!      BLOCK DATA INTEGERS4
!     INTEGER(KIND=JPIM) :: adi4buf(512), adi4lbuf(512)
!     INTEGER(KIND=JPIM) :: adi4ibuf,adi4ilbuf
!     LOGICAL :: adi4inlbuf
!      COMMON /adi4fbuf/adi4buf,adi4lbuf,
!    +       adi4ibuf,adi4ilbuf,adi4inlbuf
!     DATA adi4ibuf/1/
!     DATA adi4ilbuf/-1/
!     DATA adi4inlbuf/.FALSE./
!     END

     SUBROUTINE PUSHINTEGER4(km)

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

      USE YOEADBUFFER

      IMPLICIT NONE

      INTEGER(KIND=JPIM), INTENT(IN) :: km

      INTEGER(KIND=JPIM) :: i_adi4ilbuf
      LOGICAL :: ll_adi4inlbuf

      REAL(KIND=JPRB) :: ZHOOK_HANDLE

      IF (LHOOK) CALL DR_HOOK('PUSHINTEGER4',0,ZHOOK_HANDLE)

      IF (i_adi4ilbuf /= -1) THEN
         i_adi4ilbuf = -1
         ll_adi4inlbuf = .FALSE.
      ENDIF
      IF (adi4ibuf >= 512) THEN
         adi4buf(512) = km
         CALL PUSHINTEGER4ARRAY(adi4buf, 512)
         adi4ibuf = 1
      ELSE
         adi4buf(adi4ibuf) = km
         adi4ibuf = adi4ibuf+1
      ENDIF

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