subroutine forceWCfn(pplev,pt,dq,dqs) implicit none !================================================================== ! ! Purpose ! ------- ! Force tracer conservation in a column for a given pair of ! delta q, delta q_s ! ! Authors ! ------- ! R. Wordsworth ! !================================================================== #include "dimensions.h" #include "dimphys.h" #include "comcstfi.h" #include "tracer.h" real masse, Wtot, Wdiff real pplev(ngridmx,nlayermx+1) real pt(ngridmx) real dqs(ngridmx,nqmx) real dq(ngridmx,nlayermx,nqmx) integer iq, ig, ilay do iq=1,nqmx do ig=1,ngridmx Wtot = 0.0 do ilay=1,nlayermx masse = (pplev(ig,ilay) - pplev(ig,ilay+1))/g Wtot = Wtot + masse*dq(ig,ilay,iq) enddo Wdiff = Wtot + dqs(ig,iq) dqs(ig,iq) = dqs(ig,iq) - Wdiff enddo enddo end