subroutine massch4(ngrid,nlayer,pplev,pqch4,qsurf,ptimestep) use comgeomfi_h implicit none !================================================================== ! Purpose ! ------- ! Test conservation of ch4 mass pour nogcm ! ! Inputs ! ------ ! ngrid Number of vertical columns ! nlayer Number of layers ! pplev(ngrid,nlayer+1) Pressure levels ! surfmass ! ! Authors ! ------- ! Tanguy Bertrand 2015 ! !================================================================== #include "dimensions.h" #include "dimphys.h" #include "comcstfi.h" #include "surfdat.h" #include "comvert.h" #include "callkeys.h" #include "tracer.h" !----------------------------------------------------------------------- ! Arguments INTEGER ngrid, nlayer REAL pplev(ngrid,nlayer+1) REAL qsurf(ngrid) REAL pqch4(ngrid) REAL ptimestep ! LOCAL VARIABLES INTEGER l,ig,iq REAL atmmass REAL zps(ngrid) REAL zqsurf(ngrid) ! OUTPUT REAL atmmasstot REAL surfmasstot REAL totmass !----------------------------------------------------------------------- atmmass=0.0 atmmasstot=0.0 surfmasstot=0.0 zps(:)=0. zqsurf(:)=0. ! pour nogcm : pas de nuages do ig = 1, ngrid zps(ig)=pplev(ig,1) !+pdpsurf(ig)*ptimestep zqsurf(ig)=qsurf(ig) !+dqsurf(ig)*ptimestep atmmass = pqch4(ig)*zps(ig)/g atmmasstot= atmmasstot + atmmass*area(ig) surfmasstot= surfmasstot + zqsurf(ig)*area(ig) enddo atmmasstot= atmmasstot/totarea surfmasstot = surfmasstot/totarea totmass=surfmasstot+atmmasstot ! print*,'-------------------------------------------' print*,'Total mass surface : ',surfmasstot,' kg m-2' print*,'Total mass atmosphere :',atmmasstot,' kg m-2' print*,'Total mass : ',surfmasstot+atmmasstot,' kg m-2' end subroutine massch4