[2336] | 1 | SUBROUTINE massbar(masse,massebx,masseby) |
---|
[5099] | 2 | |
---|
[2336] | 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. |
---|
[5136] | 8 | USE lmdz_comgeom |
---|
| 9 | |
---|
[5159] | 10 | USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm |
---|
| 11 | USE lmdz_paramet |
---|
[2336] | 12 | IMPLICIT NONE |
---|
[5159] | 13 | |
---|
| 14 | |
---|
[2336] | 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) |
---|
[5099] | 27 | |
---|
[2336] | 28 | ! alpha4 . . alpha1 . alpha4 |
---|
| 29 | ! (i,j) (i,j) (i+1,j) |
---|
[5099] | 30 | |
---|
[2336] | 31 | ! P . U . . P |
---|
| 32 | ! (i,j) (i,j) (i+1,j) |
---|
[5099] | 33 | |
---|
[2336] | 34 | ! alpha3 . . alpha2 .alpha3 |
---|
| 35 | ! (i,j) (i,j) (i+1,j) |
---|
[5099] | 36 | |
---|
[2336] | 37 | ! V . Z . . V |
---|
| 38 | ! (i,j) |
---|
[5099] | 39 | |
---|
[2336] | 40 | ! alpha4 . . alpha1 .alpha4 |
---|
| 41 | ! (i,j+1) (i,j+1) (i+1,j+1) |
---|
[5099] | 42 | |
---|
[2336] | 43 | ! P . U . . P |
---|
| 44 | ! (i,j+1) (i+1,j+1) |
---|
[5099] | 45 | |
---|
| 46 | |
---|
[2336] | 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) ... |
---|
[5099] | 50 | |
---|
[2336] | 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 |
---|
[524] | 67 | |
---|
[2336] | 68 | END SUBROUTINE massbar |
---|
[524] | 69 | |
---|