4        SUBROUTINE vlspltgen_p( q,iadv,pente_max,masse,w,pbaru,pbarv,pdt,
 
    7 c     auteurs:   p.le van, f.hourdin, f.forget, f.codron 
 
    9 c    ********************************************************************
 
   10 c          shema  d
'advection " pseudo amont " . 
   11 c      + test sur humidite specifique: Q advecte< Qsat aval 
   13 c    ******************************************************************** 
   14 c     q,pbaru,pbarv,w sont des arguments d'entree  pour le s-pg ....
 
   16 c     pente_max facteur 
de limitation des pentes: 2 en general
 
   17 c                                                0 pour un schema amont
 
   18 c     pbaru,pbarv,w flux 
de masse en 
u ,v ,w
 
   21 c     teta temperature potentielle, p 
pression aux interfaces,
 
   22 c     pk exner au milieu des couches necessaire pour calculer 
qsat 
   23 c   --------------------------------------------------------------------
 
   32 #include "dimensions.h" 
   54       REAL,
DIMENSION(:,:,:),
ALLOCATABLE,
SAVE :: zm
 
   58       REAL,
DIMENSION(:,:,:),
ALLOCATABLE,
SAVE :: zq
 
   62       DATA qmin,qmax/0.,1.e33/
 
   64 c--pour rapport 
de melange saturant--
 
   66       REAL rtt,retv,r2es,r3les,r3ies,r4les,r4ies,play
 
   67       REAL ptarg,pdelarg,foeew,zdelta
 
   70       LOGICAL, 
SAVE :: firstcall=.
true.
 
   77        foeew( ptarg,pdelarg ) = exp(
 
   78      *          (r3les*(1.-pdelarg)+r3ies*pdelarg) * (ptarg-rtt)
 
   79      * / (ptarg-(r4les*(1.-pdelarg)+r4ies*pdelarg)) )
 
   89 c 
Allocate variables depending on dynamic variable 
nqtot 
   99 c-- calcul 
de qsat en chaque point
 
  100 c-- approximation: au milieu des couches play(l)=(p(l)+p(l+1))/2
 
  101 c   pour eviter une exponentielle.
 
  103       call settag(myrequest1,100)
 
  104       call settag(myrequest2,101)
 
  115           tempe(ij) = teta(ij,l) * pk(ij,l) /
cpp 
  118           zdelta = max( 0., sign(1., rtt - tempe(ij)) )
 
  119           play   = 0.5*(p(ij,l)+p(ij,l+1))
 
  120           qsat(ij,l) = min(0.5, r2es* foeew(tempe(ij),zdelta) / play )
 
  121           qsat(ij,l) = qsat(ij,l) / ( 1. - retv * qsat(ij,l) )
 
  125 c      print*,
'Debut vlsplt version debug sans vlyqs' 
  138             mu(ij,l)=pbaru(ij,l) * zzpbar
 
  151             mv(ij,l)=pbarv(ij,l) * zzpbar
 
  162             mw(ij,l)=w(ij,l) * zzw
 
  173 c      
CALL scopy(ijp1llm,q,1,zq,1)
 
  174 c      
CALL scopy(ijp1llm,masse,1,zm,1)
 
  182           zq(ijb:ije,l,iq)=q(ijb:ije,l,iq)
 
  183           zm(ijb:ije,l,iq)=masse(ijb:ije,l)
 
  192         if(iadv(iq) == 0) 
then 
  196                 else if (iadv(iq)==10) 
then 
  199                   call vlx_p(zq(1,1,iq),pente_max,zm(1,1,iq),mu,
 
  201           call vlx_p(zq(1,1,iq),pente_max,zm(1,1,iq),mu,
 
  204                   call vlx_p(zq(1,1,iq),pente_max,zm(1,1,iq),mu,
 
  217                 else if (iadv(iq)==14) 
then 
  220           call vlxqs_p(zq(1,1,iq),pente_max,zm(1,1,iq),mu,qsat,
 
  222           call vlxqs_p(zq(1,1,iq),pente_max,zm(1,1,iq),mu,qsat,
 
  226           call vlxqs_p(zq(1,1,iq),pente_max,zm(1,1,iq),mu,qsat,
 
  242                   stop 
'vlspltgen_p : schema non parallelise' 
  262         if(iadv(iq) == 0) 
then 
  266                 else if (iadv(iq)==10) 
then 
  269           call vlx_p(zq(1,1,iq),pente_max,zm(1,1,iq),mu,
 
  272                 else if (iadv(iq)==14) 
then 
  274           call vlxqs_p(zq(1,1,iq),pente_max,zm(1,1,iq),mu,qsat,
 
  279                   stop 
'vlspltgen_p : schema non parallelise' 
  302         if(iadv(iq) == 0) 
then 
  306                 else if (iadv(iq)==10) 
then 
  308           call vly_p(zq(1,1,iq),pente_max,zm(1,1,iq),mv)
 
  310                 else if (iadv(iq)==14) 
then 
  312           call vlyqs_p(zq(1,1,iq),pente_max,zm(1,1,iq),mv,qsat)
 
  316                   stop 
'vlspltgen_p : schema non parallelise' 
  325         if(iadv(iq) == 0) 
then  
  329                 else if (iadv(iq)==10 .or. iadv(iq)==14 ) 
then 
  333           call vlz_p(zq(1,1,iq),pente_max,zm(1,1,iq),mw,
 
  335           call vlz_p(zq(1,1,iq),pente_max,zm(1,1,iq),mw,
 
  338           call vlz_p(zq(1,1,iq),pente_max,zm(1,1,iq),mw,
 
  356                   stop 
'vlspltgen_p : schema non parallelise' 
  376         if(iadv(iq) == 0) 
then 
  380                 else if (iadv(iq)==10 .or. iadv(iq)==14 ) 
then 
  384           call vlz_p(zq(1,1,iq),pente_max,zm(1,1,iq),mw,
 
  391                   stop 
'vlspltgen_p : schema non parallelise' 
  415         if(iadv(iq) == 0) 
then 
  419                 else if (iadv(iq)==10) 
then 
  421           call vly_p(zq(1,1,iq),pente_max,zm(1,1,iq),mv)
 
  423                 else if (iadv(iq)==14) 
then 
  425           call vlyqs_p(zq(1,1,iq),pente_max,zm(1,1,iq),mv,qsat)
 
  429                   stop 
'vlspltgen_p : schema non parallelise' 
  437         if(iadv(iq) == 0) 
then  
  441                 else if (iadv(iq)==10) 
then 
  443           call vlx_p(zq(1,1,iq),pente_max,zm(1,1,iq),mu,
 
  446                 else if (iadv(iq)==14) 
then 
  448           call vlxqs_p(zq(1,1,iq),pente_max,zm(1,1,iq),mu,qsat,
 
  453           stop 
'vlspltgen_p : schema non parallelise' 
  470 c             print *,
'zq-->',ij,l,iq,zq(ij,l,iq)
 
  471 c                    print *,
'q-->',ij,l,iq,q(ij,l,iq)
 
  472                      q(ij,l,iq)=zq(ij,l,iq)
 
  479            DO ij=ijb,ije-iip1+1,iip1
 
  480               q(ij+
iim,l,iq)=q(ij,l,iq)
 
!$Header llmm1 INTEGER ip1jmp1
 
subroutine register_hallo(Field, ij, ll, RUp, Rdown, SUp, SDown, a_request)
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm day day1 day day1 *dt_dice endif!time annee_ref dt_dice swup_dice vg_dice omega_dice tg_prof vg_profd w_profd omega_profd!do llm!print llm l llm
 
subroutine vlspltgen_p(q, iadv, pente_max, masse, w, pbaru, pbarv, pdt,
 
subroutine scopy(n, sx, incx, sy, incy)
 
!$Header llmm1 INTEGER ip1jm
 
subroutine vlxqs_p(q, pente_max, masse, u_m, qsat, ijb_x, ije_x)
 
subroutine pression(ngrid, ap, bp, ps, p)
 
!$Id itapm1 ENDIF!IM on interpole les champs sur les niveaux STD de pression!IM a chaque pas de temps de la physique c!positionnement de l argument logique a false c!pour ne pas recalculer deux fois la meme chose!c!a cet effet un appel a plevel_new a ete deplace c!a la fin de la serie d appels c!la boucle DO nlevSTD a ete internalisee c!dans d ou la creation de cette routine c c!CALL false
 
!$Id mode_top_bound COMMON comconstr cpp
 
integer, parameter vthallo
 
subroutine vlyqs_p(q, pente_max, masse, masse_adv_v, qsat)
 
subroutine qsat(dq, q, e, p, t, r)
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm u(l)
 
subroutine sendrequest(a_Request)
 
!$Id itapm1 ENDIF!IM on interpole les champs sur les niveaux STD de pression!IM a chaque pas de temps de la physique c!positionnement de l argument logique a false c!pour ne pas recalculer deux fois la meme chose!c!a cet effet un appel a plevel_new a ete deplace c!a la fin de la serie d appels c!la boucle DO nlevSTD a ete internalisee c!dans d ou la creation de cette routine c c!CALL ulevSTD CALL &zphi philevSTD CALL &zx_rh rhlevSTD!DO klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon du jour ou toutes les read_climoz CALL true
 
subroutine vlz_p(q, pente_max, masse, w, ijb_x, ije_x)
 
subroutine vly_p(q, pente_max, masse, masse_adv_v)
 
subroutine waitsendrequest(a_Request)
 
c c zjulian c cym CALL iim cym klev iim
 
subroutine vlx_p(q, pente_max, masse, u_m, ijb_x, ije_x)
 
subroutine settag(a_request, tag)
 
subroutine waitrequest(a_Request)