!OCL  NOEVAL
SUBROUTINE GNH_TNDLAGADIAB_GW( &
 ! --- INPUT -----------------------------------------------------------------
 & KFLEV,KPROMA,KSTART,KPROF, &
 ! --- OPTIONAL INPUT --------------------------------------------------------
 & POROGL,POROGM,POROGLM,POROGLL,POROGMM, &
 & PUS,PVS,PTNDUS,PTNDVS, &
 & PDEP,PREF,PREH,PDELP,PRDELP,PDELNHPRE,PEVEL,PMUSH,PMUSF,PRDLR, &
 ! --- OPTIONAL OUTPUT -------------------------------------------------------
 & PTNDGWH_LAP,PTNDGWH_OTH, &
 & PTNDGWF_LAP,PTNDGWF_OTH,PDBBC &
 & )  

!**** *GNH_TNDLAGADIAB_GW* - Computation of the adiabatic contribution of
!                            [D (gw) / Dt] in the NH model.

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

!     Computation of the adiabatic contribution of [D (gw) / Dt] in the NH model.
!     Upper air and surface [D (gw) / Dt] are computed.

!     Upper air [D (gw) / Dt] for thin layer equations:
!      [D (gw) / Dt]_adiab = g**2 ( (d pre/ d prehyd) - 1 )

!     Surface [D (gw) / Dt] for thin layer equations:
!      a temporal derivation of the lower boundary condition
!      [gw]_surf = V_surf grad[Phi_surf]
!      is done; that yields:
!      [D [gw]_surf / Dt]_adiab = [D V_surf / Dt] grad[Phi_surf]
!                                 + V_surf . [V_surf . grad[grad[Phi_surf]]]
!     Calculations at the surface are useless for LGWADV=T.

!     Deep-layer additional contributions:
!      * DLW contribution in the RHS of [D (gw) / Dt]: - g**2 mu_s
!      * additional modifications if LRWSDLR=T.

!     For the finite difference vertical discretisation, the upper air
!      [D (gw) / Dt] is computed at half levels.

!     For the finite element vertical discretisation, the upper air
!      [D (gw) / Dt] is computed at full levels.

!     There is a separate treatment for the Laplacian part and the non-Laplacian
!     part (the non-Laplacian part is generally zero in the thin layer system
!     of eqns).

!**   Interface.
!     ----------
!        *CALL* *GNH_TNDLAGADIAB_GW(...)

!        Explicit arguments :
!        --------------------
!         * INPUT:
!           KFLEV     : number of levels.
!           KPROMA    : horizontal dimension.
!           KSTART    : start of work.
!           KPROF     : working length.

!         * OPTIONAL INPUT:
!           POROGL    : zonal comp. of grad(surf orography).
!           POROGM    : merid comp. of grad(surf orography).
!           POROGLM   : -I
!           POROGLL   :  I- second order derivatives of "surf orography".
!           POROGMM   : -I
!           PUS       : surface U wind.
!           PVS       : surface V wind.
!           PTNDUS    : [DU/Dt]_surf.
!           PTNDVS    : [DV/Dt]_surf.
!           PDEP      : (pre - prehyd) at full levels.
!           PREF      : "prehyd" at full levels.
!           PREH      : "prehyd" at half levels.
!           PDELP     : "Delta prehyd" at full levels.
!           PRDELP    : 1/[Delta prehyd] at full levels.
!           PDELNHPRE : "Delta pre" at full levels.
!           PEVEL     : "etadot dprehyd/deta".
!           PMUSH     : "mu_s" at half levels (see routine GPVCMUS).
!           PMUSF     : "mu_s" at full levels (see routine GPVCMUS).
!           PRDLR     : array containing "r/a", "a/r", "grad(r/a)".

!         * OPTIONAL OUTPUT:
!           Partial contributions are kept separate to allow individual VFE/FD
!           treatment for each term (when possible).
!           PTNDGWH_LAP: [D (gw) / Dt]_adiab at half levels (Laplacian part).
!           PTNDGWH_OTH: [D (gw) / Dt]_adiab at half levels (other contribs).
!           PTNDGWF_LAP: [D (gw) / Dt]_adiab at full levels (Laplacian part).
!           PTNDGWF_OTH: [D (gw) / Dt]_adiab at full levels (other contribs).
!           PDBBC      : [D (gw)_surf / Dt]_adiab.

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

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

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

!     Reference.
!     ----------
!        See documentations Arpege about the NH model.

!     Author.
!     -------
!        K. YESSAD (after routine GNHPDVD).

!     Modifications.
!     --------------
!   Original : 08-Dec-2004
!   J. Vivoda and K. Yessad (Oct 2007): VFE implementation
!   N. Wedi and K. Yessad (Jan 2008): different dev for NH model and PC scheme
!     ------------------------------------------------------------------

USE YOMCST   , ONLY : RG
USE YOMDYNA  , ONLY : LGWADV   ,LNH_PDVD ,LNH_GEOGW,NVDVAR  ,LRWSDLW  ,&
 & LRWSDLR  ,LRWSDLG
USE YOMCVER  , ONLY : LVERTFE  ,LVFE_GW  ,LVFE_LAPL,LVFE_LAPL_BC
USE YOMGEM   , ONLY : VDELB    ,VBF
USE PAR_RDLR , ONLY : JP_RSAF  ,JP_RSAH  ,JP_ASRF  ,JP_ASRH  ,JP_DIMR
USE PARKIND1 , ONLY : JPIM     ,JPRB
USE YOMHOOK  , ONLY : LHOOK    ,DR_HOOK

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

IMPLICIT NONE

INTEGER(KIND=JPIM),INTENT(IN)          :: KFLEV
INTEGER(KIND=JPIM),INTENT(IN)          :: KPROMA 
INTEGER(KIND=JPIM),INTENT(IN)          :: KSTART 
INTEGER(KIND=JPIM),INTENT(IN)          :: KPROF 
REAL(KIND=JPRB),OPTIONAL,INTENT(IN)    :: POROGL(KPROMA)
REAL(KIND=JPRB),OPTIONAL,INTENT(IN)    :: POROGM(KPROMA)
REAL(KIND=JPRB),OPTIONAL,INTENT(IN)    :: POROGLM(KPROMA)
REAL(KIND=JPRB),OPTIONAL,INTENT(IN)    :: POROGLL(KPROMA)
REAL(KIND=JPRB),OPTIONAL,INTENT(IN)    :: POROGMM(KPROMA)
REAL(KIND=JPRB),OPTIONAL,INTENT(IN)    :: PUS(KPROMA)
REAL(KIND=JPRB),OPTIONAL,INTENT(IN)    :: PVS(KPROMA)
REAL(KIND=JPRB),OPTIONAL,INTENT(IN)    :: PTNDUS(KPROMA)
REAL(KIND=JPRB),OPTIONAL,INTENT(IN)    :: PTNDVS(KPROMA)
REAL(KIND=JPRB),OPTIONAL,INTENT(IN)    :: PDEP(KPROMA,KFLEV)
REAL(KIND=JPRB),OPTIONAL,INTENT(IN)    :: PREF(KPROMA,KFLEV)
REAL(KIND=JPRB),OPTIONAL,INTENT(IN)    :: PREH(KPROMA,0:KFLEV)
REAL(KIND=JPRB),OPTIONAL,INTENT(IN)    :: PDELP(KPROMA,KFLEV)
REAL(KIND=JPRB),OPTIONAL,INTENT(IN)    :: PRDELP(KPROMA,KFLEV)
REAL(KIND=JPRB),OPTIONAL,INTENT(IN)    :: PDELNHPRE(KPROMA,KFLEV)
REAL(KIND=JPRB),OPTIONAL,INTENT(IN)    :: PEVEL(KPROMA,0:KFLEV)
REAL(KIND=JPRB),OPTIONAL,INTENT(IN)    :: PMUSH(KPROMA,0:KFLEV)
REAL(KIND=JPRB),OPTIONAL,INTENT(IN)    :: PMUSF(KPROMA,KFLEV)
REAL(KIND=JPRB),OPTIONAL,INTENT(IN)    :: PRDLR(KPROMA,0:KFLEV,JP_DIMR) 
REAL(KIND=JPRB),OPTIONAL,INTENT(OUT)   :: PTNDGWH_LAP(KPROMA,0:KFLEV)
REAL(KIND=JPRB),OPTIONAL,INTENT(OUT)   :: PTNDGWH_OTH(KPROMA,0:KFLEV)
REAL(KIND=JPRB),OPTIONAL,INTENT(OUT)   :: PTNDGWF_LAP(KPROMA,KFLEV)
REAL(KIND=JPRB),OPTIONAL,INTENT(OUT)   :: PTNDGWF_OTH(KPROMA,KFLEV)
REAL(KIND=JPRB),OPTIONAL,INTENT(OUT)   :: PDBBC(KPROMA)

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

INTEGER(KIND=JPIM) :: JROF,JLEV
REAL(KIND=JPRB) :: ZRG2,ZJACOB,ZACUGF,ZACVGF,ZGWS,ZDPRESDPREHYD

REAL(KIND=JPRB) :: ZHOOK_HANDLE

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

#include "abor1.intfb.h"

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

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

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

!*       1.    COMPUTATION OF [D [gw]_surf / Dt]_adiab
!              ---------------------------------------

IF ( (LNH_PDVD.AND.(.NOT.LGWADV)) .OR. (LNH_GEOGW.AND.NVDVAR==5) ) THEN

  IF (.NOT.(PRESENT(POROGL).AND.PRESENT(POROGM).AND.PRESENT(POROGLL) &
   & .AND.PRESENT(POROGMM).AND.PRESENT(POROGLM).AND.PRESENT(PUS) &
   & .AND.PRESENT(PVS).AND.PRESENT(PTNDUS).AND.PRESENT(PTNDVS))) &
   & CALL ABOR1(' GNH_TNDLAGADIAB_GW 1a: missing optional input arguments!')
  IF (.NOT.(PRESENT(PDBBC))) &
   & CALL ABOR1(' GNH_TNDLAGADIAB_GW 1b: missing optional output arguments!')

  DO JROF=KSTART,KPROF
    ZJACOB=POROGLL(JROF)*PUS(JROF)*PUS(JROF) &
     & + POROGMM(JROF)*PVS(JROF)*PVS(JROF) &
     & + 2.0_JPRB*POROGLM(JROF)*PUS(JROF)*PVS(JROF)
    ZACUGF=PTNDUS(JROF)*POROGL(JROF)
    ZACVGF=PTNDVS(JROF)*POROGM(JROF)
    PDBBC(JROF)=-ZACUGF-ZACVGF-ZJACOB
  ENDDO
ENDIF

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

!*       2.    COMPUTATION OF UPPER AIR [D (gw) / Dt]_adiab
!              --------------------------------------------

ZRG2=RG*RG

IF (LNH_PDVD.AND.(.NOT.LGWADV)) THEN

  ! * Treatment of the Laplacian term.

  IF (LVERTFE.AND.LVFE_LAPL.AND.LVFE_LAPL_BC) THEN

    IF (.NOT.(PRESENT(PTNDGWF_OTH))) &
     & CALL ABOR1(' GNH_TNDLAGADIAB_GW 2Aa: missing optional output arguments!')

    ! * PTNDGWH_LAP is not computed; compute only PTNDGWF_OTH
    !   (k.y.: this quantity will be non-zero in the deep-layer system)
    PTNDGWF_OTH(KSTART:KPROF,1:KFLEV)=0.0_JPRB

  ELSEIF (LVERTFE.AND.LVFE_LAPL.AND.(.NOT.LVFE_LAPL_BC)) THEN

    IF (.NOT.(PRESENT(PDEP).AND.PRESENT(PREF).AND.PRESENT(PREH))) &
     & CALL ABOR1(' GNH_TNDLAGADIAB_GW 2Ab: missing optional input arguments!')
    IF (.NOT.(PRESENT(PTNDGWF_OTH).AND.PRESENT(PTNDGWH_LAP) &
     & .AND.PRESENT(PTNDGWH_OTH))) &
     & CALL ABOR1(' GNH_TNDLAGADIAB_GW 2Ac: missing optional output arguments!')

    ! * PTNDGWH_LAP is not computed (excepted at half levels 0 and 1);
    !   compute only PTNDGWF_OTH
    !   (k.y.: this quantity will be non-zero in the deep-layer system)
    PTNDGWF_OTH(KSTART:KPROF,1:KFLEV)=0.0_JPRB

    ! * Half levels 1 and KFLEV-1.
    DO JLEV=1,KFLEV-1,KFLEV-2
      DO JROF=KSTART,KPROF
        PTNDGWH_LAP(JROF,JLEV)=ZRG2*(PDEP(JROF,JLEV+1)-PDEP(JROF,JLEV)) &
         & /(PREF(JROF,JLEV+1)-PREF(JROF,JLEV))
        PTNDGWH_OTH(JROF,JLEV)=0.0_JPRB
      ENDDO
    ENDDO

    ! * Top of the model.
    !   [d (pre-prehyd) / d prehyd]_[l=1] is computed by
    !   [ (pre-prehyd)_[l=1] ]/[prehyd_[l=1] - prehyd_[top]]
    !   and (pre-prehyd)_[top] is assumed to be equal to zero.
    DO JROF=KSTART,KPROF
      PTNDGWH_LAP(JROF,0)=ZRG2*PDEP(JROF,1)/(PREF(JROF,1)-PREH(JROF,0))
      PTNDGWH_OTH(JROF,0)=0.0_JPRB
    ENDDO

    ! * Surface.
    DO JROF=KSTART,KPROF
      PTNDGWH_LAP(JROF,KFLEV)=-PDBBC(JROF)
      PTNDGWH_OTH(JROF,KFLEV)=0.0_JPRB
    ENDDO

  ELSE

    IF (.NOT.(PRESENT(PDEP).AND.PRESENT(PREF).AND.PRESENT(PREH))) &
     & CALL ABOR1(' GNH_TNDLAGADIAB_GW 2Ad: missing optional input arguments!')
    IF (.NOT.(PRESENT(PTNDGWH_LAP).AND.PRESENT(PTNDGWH_OTH))) &
     & CALL ABOR1(' GNH_TNDLAGADIAB_GW 2Ae: missing optional output arguments!')

    ! * Half levels 1 to nflevg-1.
    DO JLEV=1,KFLEV-1
      DO JROF=KSTART,KPROF
        PTNDGWH_LAP(JROF,JLEV)=ZRG2*(PDEP(JROF,JLEV+1)-PDEP(JROF,JLEV)) &
         & /(PREF(JROF,JLEV+1)-PREF(JROF,JLEV))
        PTNDGWH_OTH(JROF,JLEV)=0.0_JPRB
      ENDDO
    ENDDO

    ! * Top of the model.
    !   [d (pre-prehyd) / d prehyd]_[l=1] is computed by
    !   [ (pre-prehyd)_[l=1] ]/[prehyd_[l=1] - prehyd_[top]]
    !   and (pre-prehyd)_[top] is assumed to be equal to zero.
    DO JROF=KSTART,KPROF
      PTNDGWH_LAP(JROF,0)=ZRG2*PDEP(JROF,1)/(PREF(JROF,1)-PREH(JROF,0))
      PTNDGWH_OTH(JROF,0)=0.0_JPRB
    ENDDO

    ! * Surface.
    DO JROF=KSTART,KPROF
      PTNDGWH_LAP(JROF,KFLEV)=-PDBBC(JROF)
      PTNDGWH_OTH(JROF,KFLEV)=0.0_JPRB
    ENDDO

  ENDIF

  ! * Treatment of the DLW term.
  IF (LRWSDLW) THEN
    CALL ABOR1(' GNH_TNDLAGADIAB_GW 2Af: LRWSDLW not coded in this case!')
  ENDIF

  ! * Treatment of the DLR term.
  IF (LRWSDLR) THEN
    CALL ABOR1(' GNH_TNDLAGADIAB_GW 2Ag: LRWSDLR not coded in this case!')
  ENDIF

ELSEIF (LNH_PDVD.AND.LGWADV) THEN

  ! * Treatment of the Laplacian term.

  IF (LVERTFE.AND.LVFE_GW) THEN

    IF (.NOT.(PRESENT(PDELNHPRE).AND.PRESENT(PDELP))) &
     & CALL ABOR1(' GNH_TNDLAGADIAB_GW 2Ba: missing optional input arguments!')
    IF (.NOT.(PRESENT(PTNDGWF_LAP).AND.PRESENT(PTNDGWF_OTH))) &
     & CALL ABOR1(' GNH_TNDLAGADIAB_GW 2Bb: missing optional output arguments!')

    IF (LRWSDLR) THEN
      IF (.NOT.(PRESENT(PRDLR))) & 
       & CALL ABOR1(' GNH_TNDLAGADIAB_GW 2Bc: missing optional input arg!')
      DO JLEV=1,KFLEV
        DO JROF=KSTART,KPROF
          PTNDGWF_LAP(JROF,JLEV)=ZRG2* &
           & (PRDLR(JROF,JLEV,JP_RSAF)*PRDLR(JROF,JLEV,JP_RSAF) &
           & *PDELNHPRE(JROF,JLEV)/PDELP(JROF,JLEV) - 1.0_JPRB)
        ENDDO
      ENDDO
    ELSE
      DO JLEV=1,KFLEV
        DO JROF=KSTART,KPROF
          PTNDGWF_LAP(JROF,JLEV)=ZRG2* &
           & (PDELNHPRE(JROF,JLEV)/PDELP(JROF,JLEV) - 1.0_JPRB)
        ENDDO
      ENDDO
    ENDIF
    PTNDGWF_OTH(KSTART:KPROF,1:KFLEV)=0.0_JPRB

  ELSE

    IF (.NOT.(PRESENT(PDEP).AND.PRESENT(PREF).AND.PRESENT(PREH))) &
     & CALL ABOR1(' GNH_TNDLAGADIAB_GW 2Bd: missing optional input arguments!')
    IF (.NOT.(PRESENT(PTNDGWH_LAP).AND.PRESENT(PTNDGWH_OTH))) &
     & CALL ABOR1(' GNH_TNDLAGADIAB_GW 2Be: missing optional output arguments!')

    ! * Half levels 1 to nflevg-1.
    IF (LRWSDLR) THEN
      IF (.NOT.(PRESENT(PRDLR))) & 
       & CALL ABOR1(' GNH_TNDLAGADIAB_GW 2Bf: missing optional input arg!')
      DO JLEV=1,KFLEV-1
        DO JROF=KSTART,KPROF
          ZDPRESDPREHYD=(PDEP(JROF,JLEV+1)+PREF(JROF,JLEV+1)-PDEP(JROF,JLEV) &
           & -PREF(JROF,JLEV))/(PREF(JROF,JLEV+1)-PREF(JROF,JLEV))
          PTNDGWH_LAP(JROF,JLEV)=ZRG2* &
           & (PRDLR(JROF,JLEV,JP_RSAH)*PRDLR(JROF,JLEV,JP_RSAH) &
           & *ZDPRESDPREHYD - 1.0_JPRB)
        ENDDO
      ENDDO
    ELSE
      DO JLEV=1,KFLEV-1
        DO JROF=KSTART,KPROF
          PTNDGWH_LAP(JROF,JLEV)=ZRG2*(PDEP(JROF,JLEV+1)-PDEP(JROF,JLEV)) &
           & /(PREF(JROF,JLEV+1)-PREF(JROF,JLEV))
        ENDDO
      ENDDO
    ENDIF
    PTNDGWH_OTH(KSTART:KPROF,1:KFLEV-1)=0.0_JPRB

    ! * Top of the model.
    !   [d (pre-prehyd) / d prehyd]_[l=1] is computed by
    !   [ (pre-prehyd)_[l=1] ]/[prehyd_[l=1] - prehyd_[top]]
    !   and (pre-prehyd)_[top] is assumed to be equal to zero.
    IF (LRWSDLR) THEN
      DO JROF=KSTART,KPROF
        ZDPRESDPREHYD=(PDEP(JROF,1)+PREF(JROF,1)-PREH(JROF,0)) &
         & /(PREF(JROF,1)-PREH(JROF,0))
        PTNDGWH_LAP(JROF,0)=ZRG2* &
         & (PRDLR(JROF,0,JP_RSAH)*PRDLR(JROF,0,JP_RSAH) &
         & *ZDPRESDPREHYD - 1.0_JPRB)
      ENDDO
    ELSE
      DO JROF=KSTART,KPROF
        PTNDGWH_LAP(JROF,0)=ZRG2*PDEP(JROF,1)/(PREF(JROF,1)-PREH(JROF,0))
      ENDDO
    ENDIF
    PTNDGWH_OTH(KSTART:KPROF,0)=0.0_JPRB

  ENDIF

  ! * Treatment of the DLW term, according to LVFE_GW.
  !   (VFE vs FD treatment should be done according to LVFE_GW).

  IF (LRWSDLW) THEN
    IF (LVERTFE.AND.LVFE_GW) THEN
      IF (.NOT.(PRESENT(PMUSF))) &
       & CALL ABOR1(' GNH_TNDLAGADIAB_GW 2Bg: missing optional input arg!')
      PTNDGWF_OTH(KSTART:KPROF,1:KFLEV)=PTNDGWF_OTH(KSTART:KPROF,1:KFLEV) &
       & -ZRG2*PMUSF(KSTART:KPROF,1:KFLEV)
    ELSE
      IF (.NOT.(PRESENT(PMUSH))) &
       & CALL ABOR1(' GNH_TNDLAGADIAB_GW 2Bh: missing optional input arg!')
      PTNDGWH_OTH(KSTART:KPROF,0:KFLEV-1)=PTNDGWH_OTH(KSTART:KPROF,0:KFLEV-1) &
       & -ZRG2*PMUSH(KSTART:KPROF,0:KFLEV-1)
    ENDIF
  ENDIF

  ! * Treatment of the (g-G) term if LRWSDLG=T, according to LVFE_GW. 
  !   (add -G*(g-G)=-G**2 * (a**2/r**2 -1) to the RHS of D(Gw)/Dt).

  IF (LRWSDLG) THEN
    IF (.NOT.(PRESENT(PRDLR))) & 
     & CALL ABOR1(' GNH_TNDLAGADIAB_GW 2Bi: missing optional input arg!')
    IF (LVERTFE.AND.LVFE_GW) THEN
      DO JLEV=1,KFLEV
        DO JROF=KSTART,KPROF
          PTNDGWF_OTH(JROF,JLEV)=PTNDGWF_OTH(JROF,JLEV)-ZRG2* &
           & (PRDLR(JROF,JLEV,JP_ASRF)*PRDLR(JROF,JLEV,JP_ASRF)-1.0_JPRB)
        ENDDO
      ENDDO
    ELSE
      DO JLEV=0,KFLEV-1
        DO JROF=KSTART,KPROF
          PTNDGWH_OTH(JROF,JLEV)=PTNDGWH_OTH(JROF,JLEV)-ZRG2* &
           & (PRDLR(JROF,JLEV,JP_ASRH)*PRDLR(JROF,JLEV,JP_ASRH)-1.0_JPRB)
        ENDDO
      ENDDO
    ENDIF
  ENDIF

ELSEIF (LNH_GEOGW) THEN

  IF (LVERTFE) THEN

    ! * Treatment of the Laplacian term (and of the 'B gw_s' term).

    IF (.NOT.(PRESENT(PDELNHPRE).AND.PRESENT(PDELP))) &
     & CALL ABOR1(' GNH_TNDLAGADIAB_GW 2Ca: missing optional input arguments!')
    IF (.NOT.(PRESENT(PTNDGWF_LAP).AND.PRESENT(PTNDGWF_OTH))) &
     & CALL ABOR1(' GNH_TNDLAGADIAB_GW 2Cb: missing optional output arguments!')

    DO JLEV=1,KFLEV
      DO JROF=KSTART,KPROF
        PTNDGWF_LAP(JROF,JLEV)=ZRG2* &
         & (PDELNHPRE(JROF,JLEV)/PDELP(JROF,JLEV) - 1.0_JPRB)
      ENDDO
    ENDDO

    IF (NVDVAR == 5) THEN
      IF (.NOT.(PRESENT(PRDELP).AND.PRESENT(PEVEL))) &
       & CALL ABOR1(' GNH_TNDLAGADIAB_GW 2Cc: missing optional input arguments!')
      DO JLEV=1,KFLEV
        DO JROF=KSTART,KPROF
          ! ( - B [D [gw]_surf / Dt]_adiab - gw_s etadot DB/Deta )
          ZGWS=PUS(JROF)*POROGL(JROF)+PVS(JROF)*POROGM(JROF)
          PTNDGWF_OTH(JROF,JLEV)= - VBF(JLEV)*PDBBC(JROF) &
           & - VDELB(JLEV)*PEVEL(JROF,JLEV)*PRDELP(JROF,JLEV)*ZGWS
        ENDDO
      ENDDO
    ELSEIF (NVDVAR == 6) THEN
      PTNDGWF_OTH(KSTART:KPROF,1:KFLEV)=0.0_JPRB
    ENDIF

    ! * Treatment of the DLW term.
    IF (LRWSDLW) THEN
      CALL ABOR1(' GNH_TNDLAGADIAB_GW 2Cf: LRWSDLW not coded in this case!')
    ENDIF

    ! * Treatment of the DLR term.
    IF (LRWSDLR) THEN
      CALL ABOR1(' GNH_TNDLAGADIAB_GW 2Cg: LRWSDLR not coded in this case!')
    ENDIF

  ELSE
    CALL ABOR1('GNH_TNDLAGADIAB_GW 2Cz: LVERTFE=F in Phi-gw NH model not coded')
  ENDIF

ENDIF

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

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