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