Index: /LMDZ6/trunk/libf/phylmd/lmdz_lscp.f90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/lmdz_lscp.f90	(revision 5395)
+++ /LMDZ6/trunk/libf/phylmd/lmdz_lscp.f90	(revision 5396)
@@ -7,5 +7,6 @@
 !++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 SUBROUTINE lscp(klon,klev,dtime,missing_val,            &
-     paprs,pplay,omega,temp,qt,ptconv,ratqs,sigma_qtherm, &
+     paprs, pplay, omega, temp, qt, ql_seri, qi_seri,   &
+     ptconv, ratqs, sigma_qtherm,                       &
      d_t, d_q, d_ql, d_qi, rneb, rneblsvol,             &
      pfraclr, pfracld,                                  &
@@ -20,5 +21,5 @@
      cf_seri, rvc_seri, u_seri, v_seri,                 &
      qsub, qissr, qcld, subfra, issrfra, gamma_cond,    &
-     ratio_qi_qtot, dcf_sub, dcf_con, dcf_mix,          &
+     dcf_sub, dcf_con, dcf_mix,          &
      dqi_adj, dqi_sub, dqi_con, dqi_mix, dqvc_adj,      &
      dqvc_sub, dqvc_con, dqvc_mix, qsatl, qsati,        &
@@ -139,4 +140,6 @@
   REAL, DIMENSION(klon,klev),      INTENT(IN)   :: omega           ! vertical velocity [Pa/s]
   REAL, DIMENSION(klon,klev),      INTENT(IN)   :: qt              ! total specific humidity (in vapor phase in input) [kg/kg] 
+  REAL, DIMENSION(klon,klev),      INTENT(IN)   :: ql_seri         ! liquid specific content [kg/kg]
+  REAL, DIMENSION(klon,klev),      INTENT(IN)   :: qi_seri         ! ice specific content [kg/kg]
   INTEGER,                         INTENT(IN)   :: iflag_cld_th    ! flag that determines the distribution of convective clouds
   INTEGER,                         INTENT(IN)   :: iflag_ice_thermo! flag to activate the ice thermodynamics
@@ -164,5 +167,4 @@
   !--------------------------------------------------
   REAL, DIMENSION(klon,klev),      INTENT(INOUT):: cf_seri          ! cloud fraction [-]
-  REAL, DIMENSION(klon,klev),      INTENT(INOUT):: ratio_qi_qtot    ! solid specific water to total specific water ratio [-]
   REAL, DIMENSION(klon,klev),      INTENT(INOUT):: rvc_seri         ! cloudy water vapor to total water vapor ratio [-]
   REAL, DIMENSION(klon,klev),      INTENT(IN)   :: u_seri           ! eastward wind [m/s]
@@ -569,5 +571,5 @@
     ENDIF
 
-    qice_ini = zq(:)*ratio_qi_qtot(:,k)
+    qice_ini = qi_seri(:,k)
     ! --------------------------------------------------------------------
     ! P2> Precipitation evaporation/sublimation/melting
@@ -962,5 +964,5 @@
                         klon, dtime, missing_val, &
                         pplay(:,k), paprs(:,k), paprs(:,k+1), &
-                        cf_seri(:,k), rvc_seri(:,k), ratio_qi_qtot(:,k), &
+                        cf_seri(:,k), rvc_seri(:,k), ql_seri(:,k), qi_seri(:,k), &
                         shear(:), tke_dissip(:,k), cell_area(:), &
                         Tbef(:), zq(:), zqs(:), gammasat(:), ratqs(:,k), keepgoing(:), &
Index: /LMDZ6/trunk/libf/phylmd/lmdz_lscp_condensation.f90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/lmdz_lscp_condensation.f90	(revision 5395)
+++ /LMDZ6/trunk/libf/phylmd/lmdz_lscp_condensation.f90	(revision 5396)
@@ -96,5 +96,5 @@
 SUBROUTINE condensation_ice_supersat( &
       klon, dtime, missing_val, pplay, paprsdn, paprsup, &
-      cf_seri, rvc_seri, ratio_qi_qtot, shear, pbl_eps, cell_area, &
+      cf_seri, rvc_seri, ql_seri, qi_seri, shear, pbl_eps, cell_area, &
       temp, qtot, qsat, gamma_cond, ratqs, keepgoing, &
       cldfra, qincld, qvc, issrfra, qissr, dcf_sub, dcf_con, dcf_mix, &
@@ -142,5 +142,6 @@
 REAL,     INTENT(IN)   , DIMENSION(klon) :: cf_seri       ! cloud fraction [-]
 REAL,     INTENT(IN)   , DIMENSION(klon) :: rvc_seri      ! gridbox-mean water vapor in cloud [kg/kg]
-REAL,     INTENT(IN)   , DIMENSION(klon) :: ratio_qi_qtot ! specific ice water content to total specific water ratio [-]
+REAL,     INTENT(IN)   , DIMENSION(klon) :: ql_seri       ! specific liquid water content [kg/kg]
+REAL,     INTENT(IN)   , DIMENSION(klon) :: qi_seri       ! specific ice water content [kg/kg]
 REAL,     INTENT(IN)   , DIMENSION(klon) :: shear         ! vertical shear [s-1]
 REAL,     INTENT(IN)   , DIMENSION(klon) :: pbl_eps       ! 
@@ -350,5 +351,5 @@
         !--can be greater than the total water in the gridbox
         cldfra(i) = MAX(0., MIN(1., cf_seri(i)))
-        qcld(i)   = MAX(0., MIN(qtot(i), ( ratio_qi_qtot(i) + rvc_seri(i) ) * qtot(i))) 
+        qcld(i)   = MAX(0., MIN(qtot(i), rvc_seri(i) * qtot(i) + qi_seri(i)))
         qvc(i)    = MAX(0., MIN(qcld(i), rvc_seri(i) * qtot(i)))
         ok_warm_cloud = .FALSE.
Index: /LMDZ6/trunk/libf/phylmd/phys_local_var_mod.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/phys_local_var_mod.F90	(revision 5395)
+++ /LMDZ6/trunk/libf/phylmd/phys_local_var_mod.F90	(revision 5396)
@@ -647,4 +647,10 @@
       REAL, SAVE, ALLOCATABLE :: gamma_cond(:,:)
       !$OMP THREADPRIVATE(gamma_cond)
+      REAL, SAVE, ALLOCATABLE :: ql_seri_lscp(:,:)
+      !$OMP THREADPRIVATE(ql_seri_lscp)
+      REAL, SAVE, ALLOCATABLE :: ratio_ql_qtot(:,:)
+      !$OMP THREADPRIVATE(ratio_ql_qtot)
+      REAL, SAVE, ALLOCATABLE :: qi_seri_lscp(:,:)
+      !$OMP THREADPRIVATE(qi_seri_lscp)
       REAL, SAVE, ALLOCATABLE :: ratio_qi_qtot(:,:)
       !$OMP THREADPRIVATE(ratio_qi_qtot)
@@ -1199,5 +1205,6 @@
       ALLOCATE(qsub(klon,klev), qissr(klon,klev), qcld(klon,klev))
       ALLOCATE(subfra(klon,klev), issrfra(klon,klev))
-      ALLOCATE(gamma_cond(klon,klev), ratio_qi_qtot(klon,klev))
+      ALLOCATE(gamma_cond(klon,klev), ql_seri_lscp(klon,klev), ratio_ql_qtot(klon,klev))
+      ALLOCATE(qi_seri_lscp(klon,klev), ratio_qi_qtot(klon,klev))
       ALLOCATE(dcf_sub(klon,klev), dcf_con(klon,klev), dcf_mix(klon,klev))
       ALLOCATE(dqi_adj(klon,klev), dqi_sub(klon,klev), dqi_con(klon,klev), dqi_mix(klon,klev))
@@ -1604,5 +1611,5 @@
       DEALLOCATE(qsub, qissr, qcld)
       DEALLOCATE(subfra, issrfra)
-      DEALLOCATE(gamma_cond, ratio_qi_qtot)
+      DEALLOCATE(gamma_cond, ql_seri_lscp, ratio_ql_qtot, qi_seri_lscp, ratio_qi_qtot)
       DEALLOCATE(dcf_sub, dcf_con, dcf_mix)
       DEALLOCATE(dqi_adj, dqi_sub, dqi_con, dqi_mix)
Index: /LMDZ6/trunk/libf/phylmd/physiq_mod.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/physiq_mod.F90	(revision 5395)
+++ /LMDZ6/trunk/libf/phylmd/physiq_mod.F90	(revision 5396)
@@ -320,5 +320,6 @@
        distcltop, temp_cltop,  &
        !-- LSCP - condensation and ice supersaturation variables
-       qsub, qissr, qcld, subfra, issrfra, gamma_cond, ratio_qi_qtot, &
+       qsub, qissr, qcld, subfra, issrfra, gamma_cond, &
+       ql_seri_lscp, ratio_ql_qtot, qi_seri_lscp, ratio_qi_qtot, &
        dcf_sub, dcf_con, dcf_mix, dqi_adj, dqi_sub, dqi_con, dqi_mix, &
        dqvc_adj, dqvc_sub, dqvc_con, dqvc_mix, qsatliq, qsatice, &
@@ -2313,4 +2314,5 @@
 
       !--Init for LSCP - condensation
+      ratio_ql_qtot(:,:) = 0.
       ratio_qi_qtot(:,:) = 0.
 
@@ -2644,7 +2646,9 @@
         DO i = 1, klon
           IF ( ( q_seri(i,k) + ql_seri(i,k) + qs_seri(i,k) ) .GT. 0. ) THEN
+            ratio_ql_qtot(i,k) = ql_seri(i,k) / ( q_seri(i,k) + ql_seri(i,k) + qs_seri(i,k) )
             ratio_qi_qtot(i,k) = qs_seri(i,k) / ( q_seri(i,k) + ql_seri(i,k) + qs_seri(i,k) )
             rvc_seri(i,k) = rvc_seri(i,k) * q_seri(i,k) / ( q_seri(i,k) + ql_seri(i,k) + qs_seri(i,k) )
           ELSE
+            ratio_ql_qtot(i,k) = 0.
             ratio_qi_qtot(i,k) = 0.
             rvc_seri(i,k) = 0.
@@ -2656,6 +2660,8 @@
         DO i = 1, klon
           IF ( ( q_seri(i,k) + ql_seri(i,k) + qs_seri(i,k) ) .GT. 0. ) THEN
+            ratio_ql_qtot(i,k) = ql_seri(i,k) / ( q_seri(i,k) + ql_seri(i,k) + qs_seri(i,k) )
             ratio_qi_qtot(i,k) = qs_seri(i,k) / ( q_seri(i,k) + ql_seri(i,k) + qs_seri(i,k) )
           ELSE
+            ratio_ql_qtot(i,k) = 0.
             ratio_qi_qtot(i,k) = 0.
           ENDIF
@@ -3832,4 +3838,13 @@
     IF (ok_new_lscp) THEN
 
+ 
+    DO k = 1, klev
+      DO i = 1, klon
+        ql_seri_lscp(i,k) = ratio_ql_qtot(i,k) * q_seri(i,k)
+        qi_seri_lscp(i,k) = ratio_qi_qtot(i,k) * q_seri(i,k)
+      ENDDO
+    ENDDO
+
+
     !--mise à jour de flight_m et flight_h2o dans leur module
     !IF (ok_plane_h2o .OR. ok_plane_contrail) THEN
@@ -3838,5 +3853,5 @@
 
     CALL lscp(klon,klev,phys_tstep,missing_val,paprs,pplay,omega, &
-         t_seri, q_seri, ptconv, ratqs, sigma_qtherm, &
+         t_seri, q_seri, ql_seri_lscp, qi_seri_lscp, ptconv, ratqs, sigma_qtherm, &
          d_t_lsc, d_q_lsc, d_ql_lsc, d_qi_lsc, rneb, rneblsvol, &
          pfraclr, pfracld, cldfraliq, sigma2_icefracturb, mean_icefracturb,  &
@@ -3849,5 +3864,5 @@
          cell_area, &
          cf_seri, rvc_seri, u_seri, v_seri, &
-         qsub, qissr, qcld, subfra, issrfra, gamma_cond, ratio_qi_qtot, &
+         qsub, qissr, qcld, subfra, issrfra, gamma_cond,  &
          dcf_sub, dcf_con, dcf_mix, dqi_adj, dqi_sub, dqi_con, dqi_mix, &
          dqvc_adj, dqvc_sub, dqvc_con, dqvc_mix, qsatliq, qsatice, &
Index: /LMDZ6/trunk/libf/phylmdiso/physiq_mod.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmdiso/physiq_mod.F90	(revision 5395)
+++ /LMDZ6/trunk/libf/phylmdiso/physiq_mod.F90	(revision 5396)
@@ -365,5 +365,6 @@
        distcltop, temp_cltop,  &
        !-- LSCP - condensation and ice supersaturation variables
-       qsub, qissr, qcld, subfra, issrfra, gamma_cond, ratio_qi_qtot, &
+       qsub, qissr, qcld, subfra, issrfra, gamma_cond, &
+       ql_seri_lscp, ratio_ql_qtot, qi_seri_lscp, ratio_qi_qtot, &
        dcf_sub, dcf_con, dcf_mix, dqi_adj, dqi_sub, dqi_con, dqi_mix, &
        dqvc_adj, dqvc_sub, dqvc_con, dqvc_mix, qsatliq, qsatice, &
@@ -2480,4 +2481,5 @@
 
       !--Init for LSCP - condensation
+      ratio_ql_qtot(:,:) = 0.
       ratio_qi_qtot(:,:) = 0.
 
@@ -3010,9 +3012,23 @@
         DO i = 1, klon
           IF ( ( q_seri(i,k) + ql_seri(i,k) + qs_seri(i,k) ) .GT. 0. ) THEN
+            ratio_ql_qtot(i,k) = ql_seri(i,k) / ( q_seri(i,k) + ql_seri(i,k) + qs_seri(i,k) )
             ratio_qi_qtot(i,k) = qs_seri(i,k) / ( q_seri(i,k) + ql_seri(i,k) + qs_seri(i,k) )
             rvc_seri(i,k) = rvc_seri(i,k) * q_seri(i,k) / ( q_seri(i,k) + ql_seri(i,k) + qs_seri(i,k) )
           ELSE
+            ratio_ql_qtot(i,k) = 0.
             ratio_qi_qtot(i,k) = 0.
             rvc_seri(i,k) = 0.
+          ENDIF
+        ENDDO
+      ENDDO
+    ELSE
+      DO k = 1, klev
+        DO i = 1, klon
+          IF ( ( q_seri(i,k) + ql_seri(i,k) + qs_seri(i,k) ) .GT. 0. ) THEN
+            ratio_ql_qtot(i,k) = ql_seri(i,k) / ( q_seri(i,k) + ql_seri(i,k) + qs_seri(i,k) )
+            ratio_qi_qtot(i,k) = qs_seri(i,k) / ( q_seri(i,k) + ql_seri(i,k) + qs_seri(i,k) )
+          ELSE
+            ratio_ql_qtot(i,k) = 0.
+            ratio_qi_qtot(i,k) = 0.
           ENDIF
         ENDDO
@@ -5060,4 +5076,13 @@
     IF (ok_new_lscp) THEN
 
+ 
+    DO k = 1, klev
+      DO i = 1, klon
+        ql_seri_lscp(i,k) = ratio_ql_qtot(i,k) * q_seri(i,k)
+        qi_seri_lscp(i,k) = ratio_qi_qtot(i,k) * q_seri(i,k)
+      ENDDO
+    ENDDO
+
+
     !--mise à jour de flight_m et flight_h2o dans leur module
     !IF (ok_plane_h2o .OR. ok_plane_contrail) THEN
@@ -5066,5 +5091,5 @@
 
     CALL lscp(klon,klev,phys_tstep,missing_val,paprs,pplay,omega, &
-         t_seri, q_seri, ptconv, ratqs, sigma_qtherm, &
+         t_seri, q_seri, ql_seri_lscp, qi_seri_lscp, ptconv, ratqs, sigma_qtherm, &
          d_t_lsc, d_q_lsc, d_ql_lsc, d_qi_lsc, rneb, rneblsvol, &
          pfraclr, pfracld, cldfraliq, sigma2_icefracturb, mean_icefracturb,  &
@@ -5077,5 +5102,5 @@
          cell_area, &
          cf_seri, rvc_seri, u_seri, v_seri, &
-         qsub, qissr, qcld, subfra, issrfra, gamma_cond, ratio_qi_qtot, &
+         qsub, qissr, qcld, subfra, issrfra, gamma_cond,  &
          dcf_sub, dcf_con, dcf_mix, dqi_adj, dqi_sub, dqi_con, dqi_mix, &
          dqvc_adj, dqvc_sub, dqvc_con, dqvc_mix, qsatliq, qsatice, &
