*=*=*=*= dh1.html =*=*=*=*
SUBROUTINE dh1

SUBROUTINE dh1


      SUBROUTINE dh1 ( h, pbaru, pbarv, dh)
      IMPLICIT NONE

c=======================================================================
c
c   Auteur:  P. Le Van
c   -------
c Modif F.Forget 03/94 (on retire q et dq de dhdq1 pour construire dh1)
c
c   ********************************************************************
c   .... calcul du terme de convergence horizontale du flux d'enthalpie
c        potentielle   ......
c   ********************************************************************
c     h,pbaru et pbarv sont des arguments d'entree  pour le s-pg ....
c     dh 	       sont des arguments de sortie pour le s-pg ....
c
c=======================================================================


#include "dimensions.h"
#include "paramet.h"
#include "logic.h"

      REAL h( ip1jmp1,llm ),pbaru( ip1jmp1,llm ),pbarv( ip1jm,llm)
      REAL dh( ip1jmp1,llm )
      INTEGER   l,ij

      REAL hbyv( ip1jm,llm ), hbxu( ip1jmp1,llm )

      EXTERNAL     convflu
      EXTERNAL     filtreg
c

      DO 5 l = 1,llm

      DO 1  ij = iip2, ip1jm - 1
      hbxu(ij,l) = pbaru(ij,l) * 0.5 * ( h(ij,l) + h(ij+1,l) )
   1  CONTINUE

c    .... correction pour  hbxu(iip1,j,l)  .....
c    ....   hbxu(iip1,j,l)= hbxu(1,j,l) ....

CDIR$ IVDEP
      DO 2 ij = iip1+ iip1, ip1jm, iip1
      hbxu( ij, l ) = hbxu( ij - iim, l )
   2  CONTINUE


      DO 3 ij = 1,ip1jm
      hbyv( ij, l ) = pbarv(ij, l) * 0.5 * ( h(ij, l) + h(ij +iip1, l) )
   3  CONTINUE

   5  CONTINUE


        CALL  convflu ( hbxu, hbyv, llm, dh )


c    stockage dans  dh de la convergence horizont. filtree' du  flux
c                  ....                           ...........
c           d'enthalpie potentielle .

      CALL filtreg( dh, jjp1, llm, 2,2, .true., 1)

c
      RETURN
      END