subroutine mhuaesgd2(pesg,phug,pttg,ppresg,kni,knj,knk,lswph) 3 #if defined (DOC) *** S/R mhuaesgd2 - CALCULATE ES=T-TD FROM T AND Q. Grid-point version. * ICE PHASE/No ICE PHASE controlled by switch * *Author * C. Charette -ARMA/SMC - Sep. 2004 *Note Modified version of mhuaesgd.ftn * *Revision * Y.J. Rochon and Cecilien Charette - SMC - Sept 2004 * - Use of new function FOTW8 (in fintern8.cdk) * - Choice between FO* between FO*CMAM dependent upon cvcord * *Arguments: * - Output - * pesg : Grid-point analysis of (T-Td) * * - Input - * phug : Grid-point specific-humidity. (Kg/Kg) * pttg : Grid-point Temperature (K) * ppresg: Grid-point pressure(PA) * kni : X-dimension of input grid-point fields. * knj : Y-dimension of input grid-point fields. * knk : Vertical-dimension of input grid-point fields. * lswph : .TRUE. to consider water and ice phase * .FALSE. to consider water phase only * * ------------------- * *Object: For postprocessing in variational analysis: * calculate the dew point depression from specific * humidity, temperature and pressure. Water/ice phase * is controlled by switch LSWPH. Reset negative values to zero. * #endif IMPLICIT NONE integer kni,knj,knk real*8 pesg(kni,knj,knk),phug(kni,knj,knk),pttg(kni,knj,knk) real*8 ppresg(kni,knj,knk) logical lswph * *IMPLICITS #include "comlun.cdk"
#include "pardim.cdk"
#include "comdim.cdk"
#include "comgd0.cdk"
#include "comgem.cdk"
* INTEGER ji,jj,jlev REAL*8 ZE, ZCTE, ZTD C * #include "comphy.cdk"
#include "dinternv.cdk"
#include "dintern8.cdk"
#include "fintern8.cdk"
#include "finternv.cdk"
* ** do jlev=1,knk do ji=1,kni do jj=1,knj c c Get the saturated vapor pressure from q (specific humidity) c ZE = FOEFQ8(phug(ji,jj,jlev),ppresg(ji,jj,jlev)) c c Now the dewpoint temperature c IF (CVCORD(1:3).NE.'MAM') THEN ZTD=FOTW8(ZE) IF(ZTD.LT.TRPL.AND.LSWPH) ZTD = FOTI8(ZE) ELSE ZTD =FOTW8_CMAM(ZE) IF(ZTD.LT.TRPL.AND.LSWPH) THEN ZCTE=FOTI8_CMAM(ZE) ZTD=FOTWI8_CMAM(ZCTE,ZE) ENDIF END IF c c Finally the dewpoint depression c c print warning message if TD is too large w.r.t. TT c if(int(pttg(ji,jj,jlev)*1.0D2) .lt. int(ztd*1.0D2) ) then write(nulout,*)'mhuaesgd2:Attn Td > TT:i,j,k,pp,tt,td,hu= ' & ,ji,jj,jlev,ppresg(ji,jj,jlev),pttg(ji,jj,jlev),ZTD & ,phug(ji,jj,jlev) endif pesg(ji,jj,jlev) = max(pttg(ji,jj,jlev)-ZTD,0.0D0) enddo enddo enddo c return end