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