| 1 | subroutine testconservmass(ngrid,nlayer, & |
|---|
| 2 | ps,surfmass) |
|---|
| 3 | |
|---|
| 4 | use comcstfi_mod, only: g |
|---|
| 5 | use geometry_mod, only: cell_area |
|---|
| 6 | USE comgeomfi_h, only: totarea,totarea_planet |
|---|
| 7 | implicit none |
|---|
| 8 | |
|---|
| 9 | !================================================================== |
|---|
| 10 | ! Purpose |
|---|
| 11 | ! ------- |
|---|
| 12 | ! Test conservation of n2 mass |
|---|
| 13 | ! |
|---|
| 14 | ! Inputs |
|---|
| 15 | ! ------ |
|---|
| 16 | ! ngrid Number of vertical columns |
|---|
| 17 | ! nlayer Number of layers |
|---|
| 18 | ! pplev(ngrid,nlayer+1) Pressure levels |
|---|
| 19 | ! surfmass |
|---|
| 20 | ! |
|---|
| 21 | ! Authors |
|---|
| 22 | ! ------- |
|---|
| 23 | ! Tanguy Bertrand 2015 |
|---|
| 24 | ! |
|---|
| 25 | !================================================================== |
|---|
| 26 | |
|---|
| 27 | #include "dimensions.h" |
|---|
| 28 | |
|---|
| 29 | !----------------------------------------------------------------------- |
|---|
| 30 | ! Arguments |
|---|
| 31 | INTEGER ngrid, nlayer |
|---|
| 32 | REAL ps(ngrid) |
|---|
| 33 | REAL surfmass(ngrid) |
|---|
| 34 | |
|---|
| 35 | ! LOCAL VARIABLES |
|---|
| 36 | INTEGER l,ig,iq |
|---|
| 37 | REAL atmmass |
|---|
| 38 | REAL pstot |
|---|
| 39 | |
|---|
| 40 | ! OUTPUT |
|---|
| 41 | REAL atmmasstot |
|---|
| 42 | REAL surfmasstot |
|---|
| 43 | REAL totmass |
|---|
| 44 | !----------------------------------------------------------------------- |
|---|
| 45 | |
|---|
| 46 | atmmass=0.0 |
|---|
| 47 | atmmasstot=0.0 |
|---|
| 48 | surfmasstot=0.0 |
|---|
| 49 | pstot=0.0 |
|---|
| 50 | |
|---|
| 51 | do ig = 1, ngrid |
|---|
| 52 | |
|---|
| 53 | ! mass atm kg/m2 |
|---|
| 54 | atmmass = ps(ig)/g |
|---|
| 55 | |
|---|
| 56 | pstot = pstot+ps(ig)*cell_area(ig) |
|---|
| 57 | |
|---|
| 58 | ! mass atm kg |
|---|
| 59 | atmmasstot= atmmasstot + atmmass*cell_area(ig) |
|---|
| 60 | |
|---|
| 61 | surfmasstot= surfmasstot + surfmass(ig)*cell_area(ig) |
|---|
| 62 | |
|---|
| 63 | enddo |
|---|
| 64 | |
|---|
| 65 | atmmasstot= atmmasstot/totarea_planet |
|---|
| 66 | pstot= pstot/totarea_planet |
|---|
| 67 | surfmasstot = surfmasstot/totarea_planet |
|---|
| 68 | |
|---|
| 69 | totmass=surfmasstot+atmmasstot |
|---|
| 70 | |
|---|
| 71 | ! print*,'-------------------------------------------' |
|---|
| 72 | ! print*,'Total mass surface : ',surfmasstot,' kg m-2' |
|---|
| 73 | ! print*,'Total mass atmosphere :',atmmasstot,' kg m-2' |
|---|
| 74 | ! print*,'Total mean pressure:',pstot,' Pa' |
|---|
| 75 | print*,'Total mass : ',surfmasstot+atmmasstot,' kg m-2' |
|---|
| 76 | |
|---|
| 77 | |
|---|
| 78 | end subroutine testconservmass |
|---|
| 79 | |
|---|