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

Last change on this file since 5153 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
File size: 2.4 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  USE lmdz_ssum_scopy, ONLY: ssum
13  USE lmdz_comgeom
14
15  IMPLICIT NONE
16  !
17  !  x  et  y  sont des arguments  d'entree pour le s-prog
18  !    div      est  un argument  de sortie pour le s-prog
19
20  INCLUDE "dimensions.h"
21  INCLUDE "paramet.h"
22  !
23  !    ..........          variables en arguments    ...................
24  !
25  INTEGER :: klevel
26  REAL :: x( ijb_u:ije_u,klevel ),y( ijb_v:ije_v,klevel )
27  REAL :: div( ijb_u:ije_u,klevel )
28  REAL :: cuvscvgam(ip1jm),cvuscugam(ip1jmp1),unsairegam(ip1jmp1)
29  REAL :: unsapolnga,unsapolsga
30  !
31  !    ...............     variables  locales   .........................
32
33  REAL :: aiy1( iip1 ) , aiy2( iip1 )
34  REAL :: sumypn,sumyps
35  INTEGER :: l,ij
36  !    ...................................................................
37  INTEGER :: ijb,ije,jjb,jje
38  !
39  !
40  ijb=ij_begin
41  ije=ij_end
42  IF (pole_nord) ijb=ij_begin+iip1
43  IF(pole_sud)  ije=ij_end-iip1
44
45!$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
46  DO l = 1,klevel
47  !
48    DO  ij = ijb, ije - 1
49     div( ij + 1, l )     = ( &
50           cvuscugam( ij+1 ) * x( ij+1,l ) - cvuscugam( ij ) * x( ij , l) + &
51           cuvscvgam(ij-iim) * y(ij-iim,l) - cuvscvgam(ij+1) * y(ij+1,l) )* &
52           unsairegam( ij+1 )
53    ENDDO
54  !
55  ! ....  correction pour  div( 1,j,l)  ......
56  ! ....   div(1,j,l)= div(iip1,j,l) ....
57  !
58  !DIR$ IVDEP
59    DO  ij = ijb,ije,iip1
60     div( ij,l ) = div( ij + iim,l )
61    ENDDO
62  !
63  ! ....  calcul  aux poles  .....
64  !
65   IF (pole_nord) THEN
66      DO  ij  = 1,iim
67       aiy1(ij) =    cuvscvgam(    ij       ) * y(     ij     , l )
68      ENDDO
69      sumypn = SSUM ( iim,aiy1,1 ) * unsapolnga
70  !
71      DO  ij = 1,iip1
72       div(     ij    , l ) = - sumypn
73      ENDDO
74   endif
75
76    IF (pole_sud) THEN
77      DO  ij  = 1,iim
78       aiy2(ij) =    cuvscvgam( ij+ ip1jmi1 ) * y( ij+ ip1jmi1, l )
79      ENDDO
80      sumyps = SSUM ( iim,aiy2,1 ) * unsapolsga
81  !
82      DO  ij = 1,iip1
83       div( ij + ip1jm, l ) =   sumyps
84      ENDDO
85   endif
86  END DO
87!$OMP END DO NOWAIT
88  !
89
90
91END SUBROUTINE diverg_gam_loc
Note: See TracBrowser for help on using the repository browser.