!copyright (C) 2001  MSC-RPN COMM  %%%RPNPHY%%%
***S/P ABSDVDZ3
*

      SUBROUTINE ABSDVDZ3(DUDZ2,U,V,TVE,SE,DSGDZ,SIGMA,N,M,NK) 1
#include "impnone.cdk"
      INTEGER N,M,NK
      REAL DUDZ2(N,NK),U(M,NK),V(M,NK),TVE(N,NK)
      real SE(n,NK),DSGDZ(n,NK),SIGMA(N,NK)
*
*Author
*          J. Cote (RPN 1983)
*
*Revision
* 001      J. Cote RPN(Nov 1984)SEF version documentation
* 002      M. Lepine  -  RFE model code revision project (Feb 87)
* 003      R. Benoit  -  'E' Levels intervals option (Mar 89)
*                      -  To pass in parameter the workspace
*                         WORK to DVRTEF
* 004      N. Brunet  (May90)
*                Standardization of thermodynamic functions
* 005      C. Girard  (Mar93) Cleanup
* 006      B. Bilodeau (May 94) - New physics interface
* 007      C. Girard  (Jan96) - added DUDZ2 in computation 
*
*Object
*          to calculate the vertical shear of the wind
*          DUDZ2 = module (Dwind/DZ) **2
*
*Arguments
*
*          - Output -
* DUDZ2    vertical shear of the wind squared (N,NK)
*
*          - Input -
* U        east-west component of the wind
* V        north-south component of the wind
* TVE      virtual temperature on 'E' level
* SIGMA    sigma levels
* DSGDZ    distance between the sigma levels
* W        W
* N        horizontal dimension
* M        1st dimension of U,V,TVE
* NK       vertical dimension
*
*Notes
*   U and V are wind images
*   S and U can share the same space if U is not required
*   W and V can share the same space if V is not required
*
*IMPLICITES
*
#include "clefcon.cdk"
*
#include "consphy.cdk"
*
*
**
*
      REAL DUDSG, DVDSG
      INTEGER j,k
*
      DO k=1,NK-1
         DO j=1,N
*
            DUDSG = (U(j,k+1)-U(j,k))/(SIGMA(j,k+1)-SIGMA(j,k))
            DVDSG = (V(j,k+1)-V(j,k))/(SIGMA(j,k+1)-SIGMA(j,k))
*
            DSGDZ(j,k) = (GRAV/RGASD)*SE(j,k)/TVE(j,k)
*
            DUDZ2(j,k) = (DUDSG**2 + DVDSG**2) * DSGDZ(j,k) ** 2
*
         END DO
      END DO
*
      DO j=1,N
         DSGDZ(j,NK) = (GRAV/RGASD)*SE(j,NK)/TVE(j,NK)
         DUDZ2(j,NK)=0.
      END DO
*
      RETURN
      END