84       subroutine gscond (im,ix,km,dt,dtf,prsl,ps,q,cwm,t                &
 
   85      &,                  tp, qp, psp, tp1, qp1, psp1, u, lprnt, ipr)
 
  102       use machine 
, only : kind_phys
 
  103       use funcphys 
, only : fpvs
 
  106      &,             cp => 
con_cp, eps => con_eps, epsm1 => con_epsm1
 
  111       real (kind=kind_phys) h1
 
  115       parameter(h1=1.e0,       d00=0.e0
 
  116      &,          elwv=hvap,     eliv=hvap+hfus
 
  118      &,          cpr=cp*r,      rcp=h1/cp)
 
  120       real(kind=kind_phys), 
parameter :: cons_0=0.0, cons_m15=-15.0
 
  122       integer im, ix, km, ipr
 
  123       real (kind=kind_phys) q(ix,km),    t(ix,km),    cwm(ix,km)        &
 
  124      &,                     prsl(ix,km), ps(im), dt,  dtf               &
 
  125      &,                     tp(ix,km),   qp(ix,km),   psp(im)           &
 
  126      &,                     tp1(ix,km),  qp1(ix,km),  psp1(im)
 
  128       real (kind=kind_phys)  qi(im), qint(im), u(im,km), ccrik, e0
 
  129      &,                      cond,   rdt, us, cclimit, climit
 
  130      &,                      tmt0, tmt15, qik, cwmik
 
  131      &,                      ai, qw, u00ik, tik, pres, pp0, fi 
 
  132      &,                      at, aq, ap, fiw, elv, qc, rqik
 
  133      &,                      rqikk, tx1, tx2, tx3, es, qs
 
  134      &,                      tsq, delq, condi, cone0, us00, ccrik1
 
  135      &,                      aa, ab, ac, ad, ae, af, ag
 
  138       integer iw(im,km), i, k, iwik
 
  143       el2orc = hvap*hvap / (rv*cp)
 
  185           tmt15 = min(tmt0,cons_m15)
 
  186           qik   = max(q(i,k),epsq)
 
  187           cwmik = max(cwm(i,k),climit)
 
  200           qw      = min(pres, fpvs(t(i,k)))
 
  202           qw      = eps * qw / (pres + epsm1 * qw)
 
  226           if(tmt0.lt.-15.0) 
then 
  228             fi    = qik - u00ik*qi(i)    
 
  229             if(fi > d00.or.cwmik > climit) 
then                     
  240           if (tmt0 < 0.0 .and. tmt0 >= -15.0) 
then 
  243             if (iw(i,k+1)  == 1 .and. cwmik > climit) iw(i,k) = 1
 
  263           qik   = max(q(i,k),epsq)
 
  264           cwmik = max(cwm(i,k),climit)
 
  269           pp0   = (pres / ps(i)) * psp(i)
 
  270           at    = (tik-tp(i,k)) * rdt
 
  271           aq    = (qik-qp(i,k)) * rdt
 
  272           ap    = (pres-pp0)    * rdt
 
  277           elv   = (h1-fiw)*elwv    + fiw*eliv
 
  278           qc    = (h1-fiw)*qint(i) + fiw*qi(i)
 
  281           if(qc.le.1.0e-10) 
then 
  370           if (rqik .lt. u00ik) 
then 
  372           elseif(rqik.ge.us) 
then 
  376              ccrik = h1-sqrt((us-rqikk)/(us-u00ik))
 
  387           if (ccrik <= cclimit.and. cwmik > climit)  
then  
  394             es   = min(pres, fpvs(tx1))
 
  395             qs   = u00ik * eps * es / (pres + epsm1*es)
 
  397             delq = 0.5 * (qs - tx3) * tsq / (tsq + el2orc * qs)
 
  400             tx1   = tx1 - delq * albycp
 
  405             es   = min(pres, fpvs(tx1))
 
  406             qs   = u00ik * eps * es / (pres + epsm1*es)
 
  408             delq = (qs - tx3) * tsq / (tsq + el2orc * qs)
 
  411             tx1  = tx1 - delq * albycp
 
  416             es   = min(pres, fpvs(tx1))
 
  417             qs   = u00ik * eps * es / (pres + epsm1*es)
 
  419             delq = (qs - tx3) * tsq / (tsq + el2orc * qs)
 
  422             e0   = max(tx2*rdt, cons_0)
 
  428             e0 = min(cwmik*rdt,   e0)
 
  435           if (ccrik .gt. cclimit .and. qc .gt. epsq) 
then 
  438              aa     = eps*elv*pres*qik
 
  439              ab     = ccrik*ccrik1*qc*us00
 
  446              cond   = (ac-ad)*(af*aq-ai*at+ae*qik*ap)/(ac*(af+ag))
 
  448              condi  = (qik   -u00ik   *qc*1.0)*rdt
 
  449              cond   = min(cond, condi)
 
  461              cond = max(cond, d00)
 
  464           cone0    = (cond-e0) * dt
 
  465           cwm(i,k) = cwm(i,k) + cone0
 
  469           t(i,k)   = t(i,k)   + elv*rcp*cone0
 
  470           q(i,k)   = q(i,k)   - cone0
 
  481       if (dt > dtf+0.001) 
then      
  488             qp1(i,k) = max(q(i,k),epsq)
 
  501             qp(i,k)  = max(q(i,k),epsq)
 
real(kind=kind_phys), parameter con_g
gravity ( ) 
 
real(kind=kind_phys), parameter con_rv
gas constant H2O ( ) 
 
real(kind=kind_phys), parameter con_hfus
lat heat H2O fusion ( ) 
 
real(kind=kind_phys), parameter con_cp
spec heat air at p ( ) 
 
real(kind=kind_phys), parameter con_hvap
lat heat H2O cond ( ) 
 
subroutine gscond(im, ix, km, dt, dtf, prsl, ps, q, cwm, t                                                       ,                                                               tp, qp, psp, tp1, qp1, psp1, u, lprnt, ipr)
 
real(kind=kind_phys), parameter con_ttp
temp at H2O 3pt (K) 
 
real(kind=kind_phys), parameter con_rd
gas constant air ( ) 
 
real(kind=kind_phys), parameter con_psat
pres at H2O 3pt (Pa)