Index: /LMDZ6/trunk/DefLists/gcm.def
===================================================================
--- /LMDZ6/trunk/DefLists/gcm.def	(revision 4995)
+++ /LMDZ6/trunk/DefLists/gcm.def	(revision 4996)
@@ -33,4 +33,6 @@
 ##  dans la dynamique)
 read_start=y
+## choix du qsat pour le test sur l humidite pour l advection de q: q advecte< qsat aval
+adv_qsat_liq=n
 ## periode de la physique (en pas dynamiques, n'a de sens que si iflag_phys=1)                                       
 iphysiq=10
Index: /LMDZ6/trunk/DefLists/gcm.def_144x142
===================================================================
--- /LMDZ6/trunk/DefLists/gcm.def_144x142	(revision 4995)
+++ /LMDZ6/trunk/DefLists/gcm.def_144x142	(revision 4996)
@@ -23,4 +23,6 @@
 ## choix du shema d'integration temporelle (Matsuno:y ou Matsuno-leapfrog:n) 
 purmats=n
+## choix du qsat pour le test sur l humidite pour l advection de q: q advecte< qsat aval
+adv_qsat_liq=n
 ## avec ou sans physique
 ## 0: pas de physique (e.g. en mode Shallow Water)
Index: /LMDZ6/trunk/libf/dyn3d/conf_gcm.F90
===================================================================
--- /LMDZ6/trunk/libf/dyn3d/conf_gcm.F90	(revision 4995)
+++ /LMDZ6/trunk/libf/dyn3d/conf_gcm.F90	(revision 4996)
@@ -18,5 +18,5 @@
   USE logic_mod, ONLY: fxyhypb, iflag_phys, ok_etat0, ok_gradsfile, &
                        ok_guide, ok_limit, ok_strato, purmats, read_start, &
-                       ysinus, read_orop
+                       ysinus, read_orop, adv_qsat_liq
   USE serre_mod, ONLY: clon,clat,grossismx,grossismy,dzoomx,dzoomy, &
                        alphax,alphay,taux,tauy
@@ -606,4 +606,13 @@
      type_trac = 'lmdz'
      CALL getin('type_trac',type_trac)
+
+
+     !Config  Key  = adv_qsat_liq
+     !Config  Desc = option for qsat calculation in the dynamics
+     !Config  Def  = n 
+     !Config  Help = controls which phase is considered for qsat calculation 
+     !Config          
+     adv_qsat_liq = .FALSE.
+     CALL getin('adv_qsat_liq',adv_qsat_liq)
 
      !Config  Key  = ok_dynzon 
@@ -672,4 +681,5 @@
      write(lunout,*)' ok_dyn_ins = ', ok_dyn_ins 
      write(lunout,*)' ok_dyn_ave = ', ok_dyn_ave 
+     write(lunout,*)' adv_qsat_liq = ', adv_qsat_liq
   ELSE
      !Config  Key  = clon
Index: /LMDZ6/trunk/libf/dyn3d/logic_mod.F90
===================================================================
--- /LMDZ6/trunk/libf/dyn3d/logic_mod.F90	(revision 4995)
+++ /LMDZ6/trunk/libf/dyn3d/logic_mod.F90	(revision 4996)
@@ -30,4 +30,6 @@
   LOGICAL hybrid ! vertical coordinate is hybrid if true (sigma otherwise)
                  ! (only used if disvert_type==2)
+  LOGICAL adv_qsat_liq ! true if qsat is calculated alwats wrt liquid for
+                       ! adapted Van Leer advection scheme
   INTEGER iflag_phys ! type of physics to call: 0 none, 1: phy*** package,
                      ! 2: Held & Suarez, 101-200: aquaplanets & terraplanets
Index: /LMDZ6/trunk/libf/dyn3d/vlspltqs.F
===================================================================
--- /LMDZ6/trunk/libf/dyn3d/vlspltqs.F	(revision 4995)
+++ /LMDZ6/trunk/libf/dyn3d/vlspltqs.F	(revision 4996)
@@ -25,5 +25,5 @@
       
       USE comconst_mod, ONLY: cpp
-      
+      USE logic_mod, ONLY: adv_qsat_liq 
       IMPLICIT NONE
 c
@@ -92,5 +92,9 @@
          ENDDO
          DO ij = 1, ip1jmp1
-          zdelta = MAX( 0., SIGN(1., rtt - tempe(ij)) )
+          IF (adv_qsat_liq) THEN
+             zdelta = 0.
+          ELSE
+             zdelta = MAX( 0., SIGN(1., rtt - tempe(ij)) )
+          ENDIF
           play   = 0.5*(p(ij,l)+p(ij,l+1))
           qsat(ij,l) = MIN(0.5, r2es* FOEEW(tempe(ij),zdelta) / play )
Index: /LMDZ6/trunk/libf/dyn3dmem/conf_gcm.F90
===================================================================
--- /LMDZ6/trunk/libf/dyn3dmem/conf_gcm.F90	(revision 4995)
+++ /LMDZ6/trunk/libf/dyn3dmem/conf_gcm.F90	(revision 4996)
@@ -22,5 +22,5 @@
   USE logic_mod, ONLY: fxyhypb, iflag_phys, ok_etat0, ok_gradsfile, &
                        ok_guide, ok_limit, ok_strato, purmats, read_start, &
-                       ysinus, read_orop
+                       ysinus, read_orop, adv_qsat_liq
   USE serre_mod, ONLY: clon,clat,grossismx,grossismy,dzoomx,dzoomy, &
                        alphax,alphay,taux,tauy
@@ -660,4 +660,13 @@
      type_trac = 'lmdz'
      CALL getin('type_trac',type_trac)
+
+
+     !Config  Key  = adv_qsat_liq
+     !Config  Desc = option for qsat calculation in the dynamics
+     !Config  Def  = n 
+     !Config  Help = controls which phase is considered for qsat calculation 
+     !Config          
+     adv_qsat_liq = .FALSE.
+     CALL getin('adv_qsat_liq',adv_qsat_liq)
 
      !Config  Key  = ok_dynzon 
@@ -736,4 +745,5 @@
      write(lunout,*)' ok_dyn_ave = ', ok_dyn_ave 
      write(lunout,*)' ok_dyn_xios = ', ok_dyn_xios 
+     write(lunout,*)' adv_qsat_liq = ', adv_qsat_liq
   else
      !Config  Key  = clon
Index: /LMDZ6/trunk/libf/dyn3dmem/gcm.F90
===================================================================
--- /LMDZ6/trunk/libf/dyn3dmem/gcm.F90	(revision 4995)
+++ /LMDZ6/trunk/libf/dyn3dmem/gcm.F90	(revision 4996)
@@ -480,5 +480,5 @@
   !$OMP COPYIN(saison,ecripar,fxyhypb,ysinus,read_start,ok_guide) &
   !$OMP COPYIN(ok_strato,ok_gradsfile,ok_limit,ok_etat0) &
-  !$OMP COPYIN(iflag_phys,iflag_trac)
+  !$OMP COPYIN(iflag_phys,iflag_trac,adv_qsat_liq)
   CALL leapfrog_loc(ucov,vcov,teta,ps,masse,phis,q,time_0)
   !$OMP END PARALLEL
Index: /LMDZ6/trunk/libf/dyn3dmem/logic_mod.F90
===================================================================
--- /LMDZ6/trunk/libf/dyn3dmem/logic_mod.F90	(revision 4995)
+++ /LMDZ6/trunk/libf/dyn3dmem/logic_mod.F90	(revision 4996)
@@ -30,4 +30,6 @@
   LOGICAL hybrid ! vertical coordinate is hybrid if true (sigma otherwise)
                  ! (only used if disvert_type==2)
+  LOGICAL adv_qsat_liq ! true if qsat is calculated alwats wrt liquid for
+                       ! adapted Van Leer advection scheme
   INTEGER iflag_phys ! type of physics to call: 0 none, 1: phy*** package,
                      ! 2: Held & Suarez, 101-200: aquaplanets & terraplanets
@@ -37,5 +39,5 @@
 !$OMP     apdiss,apdelq,saison,ecripar,fxyhypb,ysinus, &
 !$OMP     read_start,ok_guide,ok_strato,ok_gradsfile, &
-!$OMP     ok_limit,ok_etat0,hybrid)
+!$OMP     ok_limit,ok_etat0,hybrid, adv_qsat_liq)
 !$OMP THREADPRIVATE(iflag_phys,iflag_trac)
 
Index: /LMDZ6/trunk/libf/dyn3dmem/vlspltgen_loc.F
===================================================================
--- /LMDZ6/trunk/libf/dyn3dmem/vlspltgen_loc.F	(revision 4995)
+++ /LMDZ6/trunk/libf/dyn3dmem/vlspltgen_loc.F	(revision 4996)
@@ -10,5 +10,5 @@
 c
 c    ********************************************************************
-c          Shema  d'advection " pseudo amont " .
+c          Schema  d'advection " pseudo amont " .
 c      + test sur humidite specifique: Q advecte< Qsat aval
 c                   (F. Codron, 10/99)
@@ -32,4 +32,5 @@
       USE vlspltgen_mod
       USE comconst_mod, ONLY: cpp
+      USE logic_mod, ONLY: adv_qsat_liq
       IMPLICIT NONE
 
@@ -108,5 +109,9 @@
          ENDDO
          DO ij = ijb, ije
-          zdelta = MAX( 0., SIGN(1., rtt - tempe(ij)) )
+          IF (adv_qsat_liq) THEN
+             zdelta = 0.
+          ELSE
+             zdelta = MAX( 0., SIGN(1., rtt - tempe(ij)) )
+          ENDIF
           play   = 0.5*(p(ij,l)+p(ij,l+1))
           qsat(ij,l) = MIN(0.5, r2es* FOEEW(tempe(ij),zdelta) / play )
