source: LMDZ6/trunk/libf/dyn3dmem/massbar_loc.f90 @ 5322

Last change on this file since 5322 was 5285, checked in by abarral, 3 weeks ago

As discussed internally, remove generic ONLY: ... for new _mod_h 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.7 KB
Line 
1SUBROUTINE massbar_loc(masse,massebx,masseby)
2!
3!-------------------------------------------------------------------------------
4! Authors: P. Le Van , Fr. Hourdin.
5!-------------------------------------------------------------------------------
6! Purpose: Compute air mass mean along X and Y in each cell.
7! See iniconst for more details.
8  USE comgeom_mod_h
9  USE parallel_lmdz
10  USE dimensions_mod, ONLY: iim, jjm, llm, ndm
11USE paramet_mod_h
12IMPLICIT NONE
13
14
15!===============================================================================
16! Arguments:
17  REAL, INTENT(IN)  :: masse  (ijb_u:ije_u,llm)
18  REAL, INTENT(OUT) :: massebx(ijb_u:ije_u,llm)
19  REAL, INTENT(OUT) :: masseby(ijb_v:ije_v,llm)
20!-------------------------------------------------------------------------------
21! Method used. Each scalar point is associated to 4 area coefficients:
22!    * alpha1(i,j) at point ( i+1/4,j-1/4 )
23!    * alpha2(i,j) at point ( i+1/4,j+1/4 )
24!    * alpha3(i,j) at point ( i-1/4,j+1/4 )
25!    * alpha4(i,j) at point ( i-1/4,j-1/4 )
26! where alpha1(i,j) = aire(i+1/4,j-1/4)/ aire(i,j)
27!
28!   alpha4 .         . alpha1    . alpha4
29!    (i,j)             (i,j)       (i+1,j)
30!
31!             P .        U .          . P
32!           (i,j)       (i,j)         (i+1,j)
33!
34!   alpha3 .         . alpha2    .alpha3
35!    (i,j)              (i,j)     (i+1,j)
36!
37!             V .        Z .          . V
38!           (i,j)
39!
40!   alpha4 .         . alpha1    .alpha4
41!   (i,j+1)            (i,j+1)   (i+1,j+1)
42!
43!             P .        U .          . P
44!          (i,j+1)                    (i+1,j+1)
45!
46!
47!    massebx(i,j) = masse(i  ,j) * ( alpha1(i  ,j) + alpha2(i,j))   +
48!                   masse(i+1,j) * ( alpha3(i+1,j) + alpha4(i+1,j) )
49!     localized at point  ... U (i,j) ...
50!
51!    masseby(i,j) = masse(i,j  ) * ( alpha2(i,j  ) + alpha3(i,j  )  +
52!                   masse(i,j+1) * ( alpha1(i,j+1) + alpha4(i,j+1) 
53!     localized at point  ... V (i,j) ...
54!===============================================================================
55! Local variables:
56  INTEGER :: ij, l, ijb, ije
57!===============================================================================
58!$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 
59  DO l=1,llm
60    ijb=ij_begin
61    ije=ij_end+iip1
62    IF(pole_sud) ije=ije-iip1
63    DO ij=ijb,ije-1
64      massebx(ij,l)=masse(ij,l)*alpha1p2(ij)+masse(ij+1   ,l)*alpha3p4(ij+1)
65    END DO
66    DO ij=ijb+iim,ije+iim,iip1; massebx(ij,l)=massebx(ij-iim,l); END DO
67    ijb=ij_begin-iip1
68    ije=ij_end+iip1
69    IF(pole_nord) ijb=ij_begin
70    IF(pole_sud) ije=ij_end-iip1
71    DO ij=ijb,ije
72      masseby(ij,l)=masse(ij,l)*alpha2p3(ij)+masse(ij+iip1,l)*alpha1p4(ij+iip1)
73    END DO
74  END DO
75!$OMP END DO NOWAIT
76
77END SUBROUTINE massbar_loc
78
Note: See TracBrowser for help on using the repository browser.