source: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/massbar_loc.F90 @ 5153

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

Put comgeom.h, comgeom2.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.6 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 parallel_lmdz
9  USE lmdz_comgeom
10
11  IMPLICIT NONE
12  INCLUDE "dimensions.h"
13  INCLUDE "paramet.h"
14!===============================================================================
15! Arguments:
16  REAL, INTENT(IN)  :: masse  (ijb_u:ije_u,llm)
17  REAL, INTENT(OUT) :: massebx(ijb_u:ije_u,llm)
18  REAL, INTENT(OUT) :: masseby(ijb_v:ije_v,llm)
19!-------------------------------------------------------------------------------
20! Method used. Each scalar point is associated to 4 area coefficients:
21!    * alpha1(i,j) at point ( i+1/4,j-1/4 )
22!    * alpha2(i,j) at point ( i+1/4,j+1/4 )
23!    * alpha3(i,j) at point ( i-1/4,j+1/4 )
24!    * alpha4(i,j) at point ( i-1/4,j-1/4 )
25! where alpha1(i,j) = aire(i+1/4,j-1/4)/ aire(i,j)
26
27!   alpha4 .         . alpha1    . alpha4
28!    (i,j)             (i,j)       (i+1,j)
29
30!             P .        U .          . P
31!           (i,j)       (i,j)         (i+1,j)
32
33!   alpha3 .         . alpha2    .alpha3
34!    (i,j)              (i,j)     (i+1,j)
35
36!             V .        Z .          . V
37!           (i,j)
38
39!   alpha4 .         . alpha1    .alpha4
40!   (i,j+1)            (i,j+1)   (i+1,j+1)
41
42!             P .        U .          . P
43!          (i,j+1)                    (i+1,j+1)
44
45
46!    massebx(i,j) = masse(i  ,j) * ( alpha1(i  ,j) + alpha2(i,j))   +
47!                   masse(i+1,j) * ( alpha3(i+1,j) + alpha4(i+1,j) )
48!     localized at point  ... U (i,j) ...
49
50!    masseby(i,j) = masse(i,j  ) * ( alpha2(i,j  ) + alpha3(i,j  )  +
51!                   masse(i,j+1) * ( alpha1(i,j+1) + alpha4(i,j+1) 
52!     localized at point  ... V (i,j) ...
53!===============================================================================
54! Local variables:
55  INTEGER :: ij, l, ijb, ije
56!===============================================================================
57!$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 
58  DO l=1,llm
59    ijb=ij_begin
60    ije=ij_end+iip1
61    IF(pole_sud) ije=ije-iip1
62    DO ij=ijb,ije-1
63      massebx(ij,l)=masse(ij,l)*alpha1p2(ij)+masse(ij+1   ,l)*alpha3p4(ij+1)
64    END DO
65    DO ij=ijb+iim,ije+iim,iip1; massebx(ij,l)=massebx(ij-iim,l); END DO
66    ijb=ij_begin-iip1
67    ije=ij_end+iip1
68    IF(pole_nord) ijb=ij_begin
69    IF(pole_sud) ije=ij_end-iip1
70    DO ij=ijb,ije
71      masseby(ij,l)=masse(ij,l)*alpha2p3(ij)+masse(ij+iip1,l)*alpha1p4(ij+iip1)
72    END DO
73  END DO
74!$OMP END DO NOWAIT
75
76END SUBROUTINE massbar_loc
77
Note: See TracBrowser for help on using the repository browser.