[2336] | 1 | SUBROUTINE flumass_loc(massebx,masseby, vcont, ucont, pbaru, pbarv ) |
---|
[5099] | 2 | |
---|
[2336] | 3 | !------------------------------------------------------------------------------- |
---|
| 4 | ! Authors: P. Le Van , Fr. Hourdin. |
---|
| 5 | !------------------------------------------------------------------------------- |
---|
| 6 | ! Purpose: Compute mass flux at s levels. |
---|
| 7 | USE parallel_lmdz |
---|
| 8 | IMPLICIT NONE |
---|
[5134] | 9 | INCLUDE "dimensions.h" |
---|
| 10 | INCLUDE "paramet.h" |
---|
| 11 | INCLUDE "comgeom.h" |
---|
[2336] | 12 | !=============================================================================== |
---|
| 13 | ! Arguments: |
---|
| 14 | REAL, INTENT(IN) :: massebx(ijb_u:ije_u,llm) |
---|
| 15 | REAL, INTENT(IN) :: masseby(ijb_v:ije_v,llm) |
---|
| 16 | REAL, INTENT(IN) :: vcont (ijb_v:ije_v,llm) |
---|
| 17 | REAL, INTENT(IN) :: ucont (ijb_u:ije_u,llm) |
---|
| 18 | REAL, INTENT(OUT) :: pbaru (ijb_u:ije_u,llm) |
---|
| 19 | REAL, INTENT(OUT) :: pbarv (ijb_v:ije_v,llm) |
---|
| 20 | !=============================================================================== |
---|
| 21 | ! Method used: A 2 equations system is solved. |
---|
| 22 | ! * 1st one describes divergence computation at pole point nr. i (i=1 to im): |
---|
| 23 | ! (0.5*(pbaru(i)-pbaru(i-1))-pbarv(i))/aire(i) = - SUM(pbarv(n))/aire pole |
---|
| 24 | ! * 2nd one specifies that mean mass flux at pole is equal to 0: |
---|
| 25 | ! SUM(pbaru(n)*local_area(n))=0 |
---|
| 26 | ! This way, we determine additive constant common to pbary elements representing |
---|
| 27 | ! pbaru(0,j,l) in divergence computation equation for point i=1. (i=1 to im) |
---|
| 28 | !=============================================================================== |
---|
| 29 | ! Local variables: |
---|
| 30 | REAL :: sairen, saireun, ctn, ctn0, apbarun(iim) |
---|
| 31 | REAL :: saires, saireus, cts, cts0, apbarus(iim) |
---|
| 32 | INTEGER :: l, i, ij, ijb, ije |
---|
| 33 | !=============================================================================== |
---|
| 34 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 35 | DO l=1,llm |
---|
[1632] | 36 | |
---|
[2336] | 37 | ijb=ij_begin |
---|
| 38 | ije=ij_end+iip1 |
---|
| 39 | IF(pole_nord) ijb=ij_begin+iip1 |
---|
| 40 | IF(pole_sud) ije=ij_end-iip1 |
---|
| 41 | pbaru(ijb:ije,l)=massebx(ijb:ije,l)*ucont(ijb:ije,l) |
---|
[1632] | 42 | |
---|
[2336] | 43 | ijb=ij_begin-iip1 |
---|
| 44 | ije=ij_end+iip1 |
---|
| 45 | IF(pole_nord) ijb=ij_begin |
---|
| 46 | IF(pole_sud) ije=ij_end-iip1 |
---|
| 47 | pbarv(ijb:ije,l)=masseby(ijb:ije,l)*vcont(ijb:ije,l) |
---|
[1632] | 48 | |
---|
[2336] | 49 | END DO |
---|
| 50 | !$OMP END DO NOWAIT |
---|
[1632] | 51 | |
---|
[2336] | 52 | !--- North pole |
---|
| 53 | IF(pole_nord) THEN |
---|
| 54 | sairen =SUM(aire (1:iim)) |
---|
| 55 | saireun=SUM(aireu(1:iim)) |
---|
| 56 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 57 | DO l=1,llm |
---|
| 58 | ctn=SUM(pbarv(1:iim,l))/sairen |
---|
| 59 | pbaru(1,l)= pbarv(1,l)-ctn*aire(1) |
---|
| 60 | DO i=2,iim |
---|
| 61 | pbaru(i,l)=pbaru(i-1,l)+pbarv(i,l)-ctn*aire(i) |
---|
| 62 | END DO |
---|
| 63 | apbarun(:)=aireu(1:iim)*pbaru(1:iim,l) |
---|
| 64 | ctn0 = -SUM(apbarun)/saireun |
---|
| 65 | pbaru(1:iim,l)=2.*(pbaru(1:iim,l)+ctn0) |
---|
| 66 | pbaru(iip1,l)=pbaru(1,l) |
---|
| 67 | END DO |
---|
| 68 | !$OMP END DO NOWAIT |
---|
| 69 | END IF |
---|
[1632] | 70 | |
---|
[2336] | 71 | !--- South pole |
---|
| 72 | IF(pole_sud) THEN |
---|
| 73 | saires =SUM(aire (ip1jm+1:ip1jmp1-1)) |
---|
| 74 | saireus=SUM(aireu(ip1jm+1:ip1jmp1-1)) |
---|
| 75 | !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) |
---|
| 76 | DO l=1,llm |
---|
| 77 | cts=SUM(pbarv(1+ip1jmi1:ip1jm-1,l))/saires |
---|
| 78 | pbaru(1+ip1jm,l)=-pbarv(1+ip1jmi1,l)+cts*aire(1+ip1jm) |
---|
| 79 | DO i=2,iim |
---|
| 80 | pbaru(i+ip1jm,l)=pbaru(i-1+ip1jm,l)-pbarv(i+ip1jmi1,l)+cts*aire(i+ip1jm) |
---|
| 81 | END DO |
---|
| 82 | apbarus(:)=aireu(1+ip1jm:ip1jmp1-1)*pbaru(1+ip1jm:ip1jmp1-1,l) |
---|
| 83 | cts0 = -SUM(apbarus)/saireus |
---|
| 84 | pbaru(1+ip1jm:ip1jmp1-1,l)=2.*(pbaru(1+ip1jm:ip1jmp1-1,l)+cts0) |
---|
| 85 | pbaru(ip1jmp1,l)=pbaru(1+ip1jm,l) |
---|
| 86 | END DO |
---|
| 87 | !$OMP END DO NOWAIT |
---|
| 88 | END IF |
---|
[1632] | 89 | |
---|
[2336] | 90 | END SUBROUTINE flumass_loc |
---|
[1632] | 91 | |
---|