source: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/massbar.F90 @ 5209

Last change on this file since 5209 was 5159, checked in by abarral, 3 months ago

Put dimensions.h and paramet.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.4 KB
Line 
1SUBROUTINE massbar(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 lmdz_comgeom
9
10USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm
11  USE lmdz_paramet
12  IMPLICIT NONE
13
14
15!===============================================================================
16! Arguments:
17  REAL, INTENT(IN)  :: masse  (ip1jmp1,llm)
18  REAL, INTENT(OUT) :: massebx(ip1jmp1,llm)
19  REAL, INTENT(OUT) :: masseby(ip1jm  ,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
57!===============================================================================
58  DO l=1,llm
59    DO ij=1,ip1jmp1-1
60      massebx(ij,l)=masse(ij,l)*alpha1p2(ij)+masse(ij+1   ,l)*alpha3p4(ij+1)
61    END DO
62    DO ij=iip1,ip1jmp1,iip1; massebx(ij,l)=massebx(ij-iim,l); END DO
63    DO ij=1,ip1jm
64      masseby(ij,l)=masse(ij,l)*alpha2p3(ij)+masse(ij+iip1,l)*alpha1p4(ij+iip1)
65    END DO
66  END DO
67
68END SUBROUTINE massbar
69
Note: See TracBrowser for help on using the repository browser.