source: LMDZ6/trunk/libf/dyn3d_common/massbar.f90 @ 5274

Last change on this file since 5274 was 5272, checked in by abarral, 8 days ago

Turn paramet.h into a module

  • 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.5 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 dimensions_mod, ONLY: iim, jjm, llm, ndm
9USE paramet_mod_h, ONLY: iip1, iip2, iip3, jjp1, llmp1, llmp2, llmm1, kftd, ip1jm, ip1jmp1, &
10          ip1jmi1, ijp1llm, ijmllm, mvar, jcfil, jcfllm
11IMPLICIT NONE
12
13
14  include "comgeom.h"
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.