! ! $Id: cv3p1_closure.F 1299 2010-01-20 14:27:21Z fhourdin $ ! SUBROUTINE cv3p1_closure(nloc,ncum,nd,icb,inb : ,pbase,plcl,p,ph,tv,tvp,buoy : ,Supmax,ok_inhib,Ale,Alp o ,sig,w0,ptop2,cape,cin,m,iflag,coef : ,Plim1,Plim2,asupmax,supmax0 : ,asupmaxmin,cbmf) * *************************************************************** * * * CV3P1_CLOSURE * * Ale & Alp Closure of Convect3 * * * * written by : Kerry Emanuel * * vectorization: S. Bony * * modified by : Jean-Yves Grandpeix, 18/06/2003, 19.32.10 * * Julie Frohwirth, 14/10/2005 17.44.22 * *************************************************************** * implicit none #include "cvthermo.h" #include "cv3param.h" #include "YOMCST2.h" #include "YOMCST.h" #include "conema3.h" #include "iniprint.h" c input: integer ncum, nd, nloc integer icb(nloc), inb(nloc) real pbase(nloc),plcl(nloc) real p(nloc,nd), ph(nloc,nd+1) real tv(nloc,nd),tvp(nloc,nd), buoy(nloc,nd) real Supmax(nloc,nd) logical ok_inhib ! enable convection inhibition by dryness real Ale(nloc),Alp(nloc) c input/output: real sig(nloc,nd), w0(nloc,nd), ptop2(nloc) c output: real cape(nloc),cin(nloc) real m(nloc,nd) real Plim1(nloc),Plim2(nloc) real asupmax(nloc,nd),supmax0(nloc) real asupmaxmin(nloc) integer iflag(nloc) c c local variables: integer il, i, j, k, icbmax, i0(nloc) real deltap, fac, w, amu real rhodp real Pbmxup real dtmin(nloc,nd), sigold(nloc,nd) real coefmix(nloc,nd) real pzero(nloc),ptop2old(nloc) real cina(nloc),cinb(nloc) integer ibeg(nloc) integer nsupmax(nloc) real supcrit,temp(nloc,nd) real P1(nloc),Pmin(nloc) real asupmax0(nloc) logical ok(nloc) real siglim(nloc,nd),wlim(nloc,nd),mlim(nloc,nd) real wb2(nloc) real cbmflim(nloc),cbmf1(nloc),cbmfmax(nloc),cbmf(nloc) real cbmflast(nloc) real coef(nloc) real xp(nloc),xq(nloc),xr(nloc),discr(nloc),b3(nloc),b4(nloc) real theta(nloc),bb(nloc) real term1,term2,term3 real alp2(nloc) ! Alp with offset real wb,sigmax data wb /2./, sigmax /0.1/ CHARACTER (LEN=20) :: modname='cv3p1_closure' CHARACTER (LEN=80) :: abort_message c c print *,' -> cv3p1_closure, Ale ',ale(1) c c ------------------------------------------------------- c -- Initialization c ------------------------------------------------------- c c do il = 1,ncum alp2(il) = max(alp(il),1.e-5) cIM alp2(il) = max(alp(il),1.e-12) enddo c PBMXUP=50. ! PBMXUP+PBCRIT = cloud depth above which mixed updraughts c exist (if any) if(prt_level.GE.20) . print*,'cv3p1_param nloc ncum nd icb inb nl',nloc,ncum,nd, . icb(nloc),inb(nloc),nl do k=1,nl do il=1,ncum m(il,k)=0.0 enddo enddo c ------------------------------------------------------- c -- Reset sig(i) and w0(i) for i>inb and i