1 | subroutine massch4(ngrid,nlayer,pplev,pqch4,qsurf,ptimestep) |
---|
2 | |
---|
3 | use comgeomfi_h |
---|
4 | implicit none |
---|
5 | |
---|
6 | !================================================================== |
---|
7 | ! Purpose |
---|
8 | ! ------- |
---|
9 | ! Test conservation of ch4 mass pour nogcm |
---|
10 | ! |
---|
11 | ! Inputs |
---|
12 | ! ------ |
---|
13 | ! ngrid Number of vertical columns |
---|
14 | ! nlayer Number of layers |
---|
15 | ! pplev(ngrid,nlayer+1) Pressure levels |
---|
16 | ! surfmass |
---|
17 | ! |
---|
18 | ! Authors |
---|
19 | ! ------- |
---|
20 | ! Tanguy Bertrand 2015 |
---|
21 | ! |
---|
22 | !================================================================== |
---|
23 | |
---|
24 | #include "dimensions.h" |
---|
25 | #include "dimphys.h" |
---|
26 | #include "comcstfi.h" |
---|
27 | #include "surfdat.h" |
---|
28 | #include "comvert.h" |
---|
29 | #include "callkeys.h" |
---|
30 | #include "tracer.h" |
---|
31 | |
---|
32 | !----------------------------------------------------------------------- |
---|
33 | ! Arguments |
---|
34 | |
---|
35 | INTEGER ngrid, nlayer |
---|
36 | REAL pplev(ngrid,nlayer+1) |
---|
37 | REAL qsurf(ngrid) |
---|
38 | REAL pqch4(ngrid) |
---|
39 | REAL ptimestep |
---|
40 | |
---|
41 | ! LOCAL VARIABLES |
---|
42 | INTEGER l,ig,iq |
---|
43 | REAL atmmass |
---|
44 | REAL zps(ngrid) |
---|
45 | REAL zqsurf(ngrid) |
---|
46 | |
---|
47 | ! OUTPUT |
---|
48 | REAL atmmasstot |
---|
49 | REAL surfmasstot |
---|
50 | REAL totmass |
---|
51 | !----------------------------------------------------------------------- |
---|
52 | |
---|
53 | |
---|
54 | atmmass=0.0 |
---|
55 | atmmasstot=0.0 |
---|
56 | surfmasstot=0.0 |
---|
57 | zps(:)=0. |
---|
58 | zqsurf(:)=0. |
---|
59 | ! pour nogcm : pas de nuages |
---|
60 | do ig = 1, ngrid |
---|
61 | zps(ig)=pplev(ig,1) !+pdpsurf(ig)*ptimestep |
---|
62 | zqsurf(ig)=qsurf(ig) !+dqsurf(ig)*ptimestep |
---|
63 | |
---|
64 | atmmass = pqch4(ig)*zps(ig)/g |
---|
65 | |
---|
66 | atmmasstot= atmmasstot + atmmass*area(ig) |
---|
67 | surfmasstot= surfmasstot + zqsurf(ig)*area(ig) |
---|
68 | |
---|
69 | enddo |
---|
70 | |
---|
71 | atmmasstot= atmmasstot/totarea |
---|
72 | surfmasstot = surfmasstot/totarea |
---|
73 | totmass=surfmasstot+atmmasstot |
---|
74 | |
---|
75 | ! print*,'-------------------------------------------' |
---|
76 | print*,'Total mass surface : ',surfmasstot,' kg m-2' |
---|
77 | print*,'Total mass atmosphere :',atmmasstot,' kg m-2' |
---|
78 | print*,'Total mass : ',surfmasstot+atmmasstot,' kg m-2' |
---|
79 | |
---|
80 | |
---|
81 | end subroutine massch4 |
---|