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