source: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/diverg_gam_loc.f90 @ 5120

Last change on this file since 5120 was 5117, checked in by abarral, 2 months ago

rename modules properly lmdz_*
move some unused files to obsolete/
(lint) uppercase fortran keywords

  • 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
File size: 2.7 KB
Line 
1SUBROUTINE diverg_gam_loc(klevel,cuvscvgam,cvuscugam,unsairegam, &
2        unsapolnga,unsapolsga,  x, y,  div )
3  !
4  ! P. Le Van
5  !
6  !  *********************************************************************
7  !  ... calcule la divergence a tous les niveaux d'1 vecteur de compos.
8  ! x et y...
9  !          x et y  etant des composantes covariantes   ...
10  !  *********************************************************************
11  USE parallel_lmdz
12  IMPLICIT NONE
13  !
14  !  x  et  y  sont des arguments  d'entree pour le s-prog
15  !    div      est  un argument  de sortie pour le s-prog
16  !
17  !
18  !   ---------------------------------------------------------------------
19  !
20  !    ATTENTION : pendant ce s-pg , ne pas toucher au COMMON/scratch/  .
21  !
22  !   ---------------------------------------------------------------------
23  INCLUDE "dimensions.h"
24  INCLUDE "paramet.h"
25  INCLUDE "comgeom.h"
26  !
27  !    ..........          variables en arguments    ...................
28  !
29  INTEGER :: klevel
30  REAL :: x( ijb_u:ije_u,klevel ),y( ijb_v:ije_v,klevel )
31  REAL :: div( ijb_u:ije_u,klevel )
32  REAL :: cuvscvgam(ip1jm),cvuscugam(ip1jmp1),unsairegam(ip1jmp1)
33  REAL :: unsapolnga,unsapolsga
34  !
35  !    ...............     variables  locales   .........................
36
37  REAL :: aiy1( iip1 ) , aiy2( iip1 )
38  REAL :: sumypn,sumyps
39  INTEGER :: l,ij
40  !    ...................................................................
41  !
42  EXTERNAL  SSUM
43  REAL :: SSUM
44  INTEGER :: ijb,ije,jjb,jje
45  !
46  !
47  ijb=ij_begin
48  ije=ij_end
49  IF (pole_nord) ijb=ij_begin+iip1
50  IF(pole_sud)  ije=ij_end-iip1
51
52!$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
53  DO l = 1,klevel
54  !
55    DO  ij = ijb, ije - 1
56     div( ij + 1, l )     = ( &
57           cvuscugam( ij+1 ) * x( ij+1,l ) - cvuscugam( ij ) * x( ij , l) + &
58           cuvscvgam(ij-iim) * y(ij-iim,l) - cuvscvgam(ij+1) * y(ij+1,l) )* &
59           unsairegam( ij+1 )
60    ENDDO
61  !
62  ! ....  correction pour  div( 1,j,l)  ......
63  ! ....   div(1,j,l)= div(iip1,j,l) ....
64  !
65  !DIR$ IVDEP
66    DO  ij = ijb,ije,iip1
67     div( ij,l ) = div( ij + iim,l )
68    ENDDO
69  !
70  ! ....  calcul  aux poles  .....
71  !
72   IF (pole_nord) THEN
73      DO  ij  = 1,iim
74       aiy1(ij) =    cuvscvgam(    ij       ) * y(     ij     , l )
75      ENDDO
76      sumypn = SSUM ( iim,aiy1,1 ) * unsapolnga
77  !
78      DO  ij = 1,iip1
79       div(     ij    , l ) = - sumypn
80      ENDDO
81   endif
82
83    IF (pole_sud) THEN
84      DO  ij  = 1,iim
85       aiy2(ij) =    cuvscvgam( ij+ ip1jmi1 ) * y( ij+ ip1jmi1, l )
86      ENDDO
87      sumyps = SSUM ( iim,aiy2,1 ) * unsapolsga
88  !
89      DO  ij = 1,iip1
90       div( ij + ip1jm, l ) =   sumyps
91      ENDDO
92   endif
93  END DO
94!$OMP END DO NOWAIT
95  !
96
97
98END SUBROUTINE diverg_gam_loc
Note: See TracBrowser for help on using the repository browser.