source: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/diverg.f90 @ 5140

Last change on this file since 5140 was 5140, checked in by abarral, 8 weeks ago

Put comsoil.h, conema3.h, cvflag.h into modules

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.0 KB
Line 
1
2! $Header$
3
4SUBROUTINE diverg(klevel,x,y,div)
5  !
6  ! P. Le Van
7  !
8  !  *********************************************************************
9  !  ... calcule la divergence a tous les niveaux d'1 vecteur de compos.
10  ! x et y...
11  !          x et y  etant des composantes covariantes   ...
12  !  *********************************************************************
13  USE lmdz_ssum_scopy, ONLY: ssum
14  USE lmdz_comgeom
15
16  IMPLICIT NONE
17  !
18  !  x  et  y  sont des arguments  d'entree pour le s-prog
19  !    div      est  un argument  de sortie pour le s-prog
20  !
21
22  INCLUDE "dimensions.h"
23  INCLUDE "paramet.h"
24  !
25  !    ..........          variables en arguments    ...................
26  !
27  INTEGER :: klevel
28  REAL :: x( ip1jmp1,klevel ),y( ip1jm,klevel ),div( ip1jmp1,klevel )
29  INTEGER :: l,ij
30  !
31  !    ...............     variables  locales   .........................
32
33  REAL :: aiy1( iip1 ) , aiy2( iip1 )
34  REAL :: sumypn,sumyps
35  !    ...................................................................
36
37  DO l = 1,klevel
38  !
39    DO  ij = iip2, ip1jm - 1
40     div( ij + 1, l )     = &
41           cvusurcu( ij+1 ) * x( ij+1,l ) - cvusurcu( ij ) * x( ij , l) + &
42           cuvsurcv(ij-iim) * y(ij-iim,l) - cuvsurcv(ij+1) * y(ij+1,l)
43    ENDDO
44  !
45  ! ....  correction pour  div( 1,j,l)  ......
46  ! ....   div(1,j,l)= div(iip1,j,l) ....
47  !
48  !DIR$ IVDEP
49    DO  ij = iip2,ip1jm,iip1
50     div( ij,l ) = div( ij + iim,l )
51    ENDDO
52  !
53  ! ....  calcul  aux poles  .....
54  !
55    DO  ij  = 1,iim
56     aiy1(ij) =    cuvsurcv(    ij       ) * y(     ij     , l )
57     aiy2(ij) =    cuvsurcv( ij+ ip1jmi1 ) * y( ij+ ip1jmi1, l )
58    ENDDO
59    sumypn = SSUM ( iim,aiy1,1 ) / apoln
60    sumyps = SSUM ( iim,aiy2,1 ) / apols
61  !
62    DO  ij = 1,iip1
63     div(     ij    , l ) = - sumypn
64     div( ij + ip1jm, l ) =   sumyps
65    ENDDO
66  END DO
67  !
68
69  !cc        CALL filtreg( div, jjp1, klevel, 2, 2, .TRUE., 1 )
70
71  !
72    DO l = 1, klevel
73       DO ij = iip2,ip1jm
74        div(ij,l) = div(ij,l) * unsaire(ij)
75      ENDDO
76    ENDDO
77  !
78   RETURN
79END SUBROUTINE diverg
Note: See TracBrowser for help on using the repository browser.