SUBROUTINE GSTATS_OUTPUT_IFS

!**** *GSTATS_OUTPUT_IFS* - print timing statistics

!     PURPOSE.
!     --------
!       To print out timings gathered by GSTATS

!**   INTERFACE.
!     ----------
!       *CALL* *GSTATS_OUTPUT_IFS*

!        EXPLICIT ARGUMENTS     None
!        --------------------

!        IMPLICIT ARGUMENTS
!        --------------------

!     METHOD.
!     -------

!     EXTERNALS.   
!     ----------   

!     REFERENCE.
!     ----------
!        ECMWF Research Department documentation of the IFS

!     AUTHOR.
!     -------
!        Mats Hamrud ECMWF

!     MODIFICATIONS.
!     --------------
!        ORIGINAL : 98-11-15
!        D.Salmond: 99-09-21 : Timer for SLCOMM2
!        M.Hamrud      01-Oct-2003 CY28 Cleaning
!        M.Hamrud      01-Dec-2003 CY28R1 Cleaning
!        M.Drusch      18-Jan-2007 introduce nconf 302
!        R. El Khatib  26-Feb-2008 Bugfix
!     ------------------------------------------------------------------
USE PARKIND1  ,ONLY : JPRB
USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK
USE YOMLUN   , ONLY : NULOUT
USE YOMCT0   , ONLY : NPROC    ,NCONF   ,NSTOP
USE YOMDYN   , ONLY : TSTEP
USE YOMGSTATS, ONLY : LSTATS

IMPLICIT NONE

REAL(KIND=JPRB) :: ZAVEAVE(0:100),ZMEAN,ZFDPD
REAL(KIND=JPRB) :: ZHOOK_HANDLE

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

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

IF (LSTATS) THEN
  CALL GSTATS_PRINT(NULOUT,ZAVEAVE,100)
  ZMEAN = ZAVEAVE(1)/(1000._JPRB*NPROC)
  IF( (NCONF == 1.OR.NCONF == 302) .AND. ZMEAN > 0.0_JPRB )THEN
    ZFDPD=REAL(NSTOP)*TSTEP/ZMEAN
    WRITE(NULOUT,'(A,F10.1)')'FORECAST DAYS PER DAY ',ZFDPD
  ENDIF
ENDIF

IF (LHOOK) CALL DR_HOOK('GSTATS_OUTPUT_IFS',1,ZHOOK_HANDLE)

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

END SUBROUTINE GSTATS_OUTPUT_IFS
