SUBROUTINE JCCOMP

!**** *JCCOMP*  - JC CONTRIBUTION OF THE COST FUNCTION IN SPECTRAL SPACE

!     Purpose.
!     --------
!     EVALUATE THE TERM JC AND ITS GRADIENT.

!**   Interface.
!     ----------
!        *CALL* *JCCOMP

!        Explicit arguments :
!        --------------------
!        None

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

!     Method.
!     -------
!        See documentation

!     Externals.
!     ----------

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

!     Author.
!     -------
!        Jean-Noel Thepaut  *ECMWF*

!     Modifications.
!     --------------
!        Original : 91-02-15
!      J.N. Thepaut (Meteo-France):97-09-19 - remove call to NMDIAG
!        M.Hamrud      01-Oct-2003 CY28 Cleaning
!        M.Hamrud      01-Dec-2003 CY28R1 Cleaning
!     ------------------------------------------------------------------

USE PARKIND1  ,ONLY : JPRB
USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK
USE YOMVAR   , ONLY : LJCNMI   ,LJCNMTL

IMPLICIT NONE

REAL(KIND=JPRB) :: ZHOOK_HANDLE

#include "nmijc.intfb.h"
#include "nmijctl.intfb.h"
!    -------------------------------------------------------------

!*       1.    CONSTRAINT |dG/dt|2 IN JC.
!              --------------------------

IF (LHOOK) CALL DR_HOOK('JCCOMP',0,ZHOOK_HANDLE)
IF(LJCNMI) THEN
  CALL NMIJC
ELSEIF(LJCNMTL) THEN
  CALL NMIJCTL
ENDIF

!*       2.    ADDITIONAL CONSTRAINT (FOR INSTANCE CAPTAIN'S AGE).
!              ---------------------------------------------------

!   ---  NOT YET IMPLEMENTED  ----

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

