1 | SUBROUTINE flumass(massebx,masseby, vcont, ucont, pbaru, pbarv ) |
---|
2 | |
---|
3 | !------------------------------------------------------------------------------- |
---|
4 | ! Authors: P. Le Van , Fr. Hourdin. |
---|
5 | !------------------------------------------------------------------------------- |
---|
6 | ! Purpose: Compute mass flux at s levels. |
---|
7 | USE lmdz_comgeom |
---|
8 | |
---|
9 | IMPLICIT NONE |
---|
10 | INCLUDE "dimensions.h" |
---|
11 | INCLUDE "paramet.h" |
---|
12 | !=============================================================================== |
---|
13 | ! Arguments: |
---|
14 | REAL, INTENT(IN) :: massebx(ip1jmp1,llm) |
---|
15 | REAL, INTENT(IN) :: masseby(ip1jm ,llm) |
---|
16 | REAL, INTENT(IN) :: vcont (ip1jm ,llm) |
---|
17 | REAL, INTENT(IN) :: ucont (ip1jmp1,llm) |
---|
18 | REAL, INTENT(OUT) :: pbaru (ip1jmp1,llm) |
---|
19 | REAL, INTENT(OUT) :: pbarv (ip1jm ,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(iip1) |
---|
31 | REAL :: saires, saireus, cts, cts0, apbarus(iip1) |
---|
32 | INTEGER :: l, i |
---|
33 | !=============================================================================== |
---|
34 | DO l=1,llm |
---|
35 | pbaru(iip2:ip1jm,l)=massebx(iip2:ip1jm,l)*ucont(iip2:ip1jm,l) |
---|
36 | pbarv( 1:ip1jm,l)=masseby( 1:ip1jm,l)*vcont( 1:ip1jm,l) |
---|
37 | END DO |
---|
38 | |
---|
39 | !--- NORTH POLE |
---|
40 | sairen =SUM(aire (1:iim)) |
---|
41 | saireun=SUM(aireu(1:iim)) |
---|
42 | DO l = 1,llm |
---|
43 | ctn=SUM(pbarv(1:iim,l))/sairen |
---|
44 | pbaru(1,l)= pbarv(1,l)-ctn*aire(1) |
---|
45 | DO i=2,iim |
---|
46 | pbaru(i,l)=pbaru(i-1,l)+pbarv(i,l)-ctn*aire(i) |
---|
47 | END DO |
---|
48 | DO i=1,iim |
---|
49 | apbarun(i)=aireu(i)*pbaru(i,l) |
---|
50 | END DO |
---|
51 | ctn0 = -SUM(apbarun(1:iim))/saireun |
---|
52 | DO i = 1,iim |
---|
53 | pbaru(i,l)=2.*(pbaru(i,l)+ctn0) |
---|
54 | END DO |
---|
55 | pbaru(iip1,l)=pbaru(1,l) |
---|
56 | END DO |
---|
57 | |
---|
58 | !--- SOUTH POLE |
---|
59 | saires =SUM(aire (ip1jm+1:ip1jmp1-1)) |
---|
60 | saireus=SUM(aireu(ip1jm+1:ip1jmp1-1)) |
---|
61 | DO l = 1,llm |
---|
62 | cts=SUM(pbarv(ip1jmi1+1:ip1jm-1,l))/saires |
---|
63 | pbaru(1+ip1jm,l)=-pbarv(1+ip1jmi1,l)+cts*aire(1+ip1jm) |
---|
64 | DO i=2,iim |
---|
65 | pbaru(i+ip1jm,l)=pbaru(i-1+ip1jm,l)-pbarv(i+ip1jmi1,l)+cts*aire(i+ip1jm) |
---|
66 | END DO |
---|
67 | DO i=1,iim |
---|
68 | apbarus(i)=aireu(i+ip1jm)*pbaru(i+ip1jm,l) |
---|
69 | END DO |
---|
70 | cts0 = -SUM(apbarus(1:iim))/saireus |
---|
71 | DO i = 1,iim |
---|
72 | pbaru(i+ip1jm,l)=2.*(pbaru(i+ip1jm,l)+cts0) |
---|
73 | END DO |
---|
74 | pbaru(ip1jmp1,l)=pbaru(1+ip1jm,l) |
---|
75 | END DO |
---|
76 | |
---|
77 | END SUBROUTINE flumass |
---|