Index: /LMDZ5/trunk/libf/phylmd/cv3_routines.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/cv3_routines.F90	(revision 2637)
+++ /LMDZ5/trunk/libf/phylmd/cv3_routines.F90	(revision 2638)
@@ -1060,4 +1060,5 @@
                          p, ph, h, tv, lv, lf, pbase, buoybase, plcl, &
                          inb, tp, tvp, clw, hp, ep, sigp, buoy, frac)
+  USE print_control_mod, ONLY: prt_level
   IMPLICIT NONE
 
@@ -1118,4 +1119,9 @@
   REAL fracg
   REAL deltap
+
+  IF (prt_level >= 10) THEN
+    print *,'cv3_undilute2.0. t(1,k), q(1,k), qs(1,k) ', &
+                        (k, t(1,k), q(1,k), qs(1,k), k = 1,nl)
+  ENDIF
 
 ! =====================================================================
@@ -1304,4 +1310,9 @@
     END DO
   END DO
+
+  IF (prt_level >= 10) THEN
+    print *,'cv3_undilute2.1. tp(1,k), tvp(1,k) ', &
+                          (k, tp(1,k), tvp(1,k), k = 1,nl)
+  ENDIF
 
 ! =====================================================================
Index: /LMDZ5/trunk/libf/phylmd/cva_driver.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/cva_driver.F90	(revision 2637)
+++ /LMDZ5/trunk/libf/phylmd/cva_driver.F90	(revision 2638)
@@ -675,8 +675,12 @@
     END IF
 ! print*,'t1, q1 ',t1,q1
+        if (prt_level >= 9) &
+             PRINT *, 'cva_driver -> cv3_prelim'
     CALL cv3_prelim(len, nd, ndp1, t1, q1, p1, ph1, &           ! nd->na
                     lv1, lf1, cpn1, tv1, gz1, h1, hm1, th1)
 
 
+        if (prt_level >= 9) &
+             PRINT *, 'cva_driver -> cv3_prelim'
     CALL cv3_prelim(len, nd, ndp1, t1_wake, q1_wake, p1, ph1, & ! nd->na
                     lv1_wake, lf1_wake, cpn1_wake, tv1_wake, gz1_wake, &
@@ -687,4 +691,6 @@
   IF (iflag_con==4) THEN
     PRINT *, 'Emanuel version 4 '
+        if (prt_level >= 9) &
+             PRINT *, 'cva_driver -> cv_prelim'
     CALL cv_prelim(len, nd, ndp1, t1, q1, p1, ph1, &
                    lv1, cpn1, tv1, gz1, h1, hm1)
@@ -730,4 +736,6 @@
 ! write(*,'(64i1)') iflag1(2:klon-1)
 
+        if (prt_level >= 9) &
+             PRINT *, 'cva_driver -> cv3_feed'
     CALL cv3_feed(len, nd, ok_conserv_q, &                 ! nd->na
                   t1, q1, u1, v1, p1, ph1, hm1, gz1, & 
@@ -742,4 +750,6 @@
 
   IF (iflag_con==4) THEN
+        if (prt_level >= 9) &
+             PRINT *, 'cva_driver -> cv_feed'
     CALL cv_feed(len, nd, t1, q1, qs1, p1, hm1, gz1, &
                  nk1, icb1, icbmax, iflag1, tnk1, qnk1, gznk1, plcl1)
@@ -757,4 +767,6 @@
   IF (iflag_con==3) THEN
 
+        if (prt_level >= 9) &
+             PRINT *, 'cva_driver -> cv3_undilute1'
     CALL cv3_undilute1(len, nd, t1, qs1, gz1, plcl1, p1, icb1, tnk1, qnk1, & ! nd->na
                        gznk1, tp1, tvp1, clw1, icbs1)
@@ -763,4 +775,6 @@
 
   IF (iflag_con==4) THEN
+        if (prt_level >= 9) &
+             PRINT *, 'cva_driver -> cv_undilute1'
     CALL cv_undilute1(len, nd, t1, q1, qs1, gz1, p1, nk1, icb1, icbmax, &
                       tp1, tvp1, clw1)
@@ -775,4 +789,6 @@
   IF (iflag_con==3) THEN
 
+        if (prt_level >= 9) &
+             PRINT *, 'cva_driver -> cv3_trigger'
     CALL cv3_trigger(len, nd, icb1, plcl1, p1, th1, tv1, tvp1, thnk1, & ! nd->na
                       pbase1, buoybase1, iflag1, sig1, w01)
@@ -787,4 +803,6 @@
 
   IF (iflag_con==4) THEN
+        if (prt_level >= 9) &
+             PRINT *, 'cva_driver -> cv_trigger'
     CALL cv_trigger(len, nd, icb1, cbmf1, tv1, tvp1, iflag1)
   END IF
@@ -833,4 +851,6 @@
 !
 !>jyg
+        if (prt_level >= 9) &
+             PRINT *, 'cva_driver -> cv3a_compress'
       CALL cv3a_compress(len, nloc, ncum, nd, ntra, compress, &
                          iflag1, nk1, icb1, icbs1, &
@@ -861,4 +881,6 @@
 
     IF (iflag_con==4) THEN
+        if (prt_level >= 9) &
+             PRINT *, 'cva_driver -> cv_compress'
       CALL cv_compress(len, nloc, ncum, nd, &
                        iflag1, nk1, icb1, &
@@ -883,4 +905,6 @@
 
     IF (iflag_con==3) THEN
+        if (prt_level >= 9) &
+             PRINT *, 'cva_driver -> cv3_undilute2'
       CALL cv3_undilute2(nloc, ncum, nd, icb, icbs, nk, &              !na->nd
                          tnk, qnk, gznk, hnk, t, q, qs, gz, &
@@ -891,4 +915,6 @@
 
     IF (iflag_con==4) THEN
+        if (prt_level >= 9) &
+             PRINT *, 'cva_driver -> cv_undilute2'
       CALL cv_undilute2(nloc, ncum, nd, icb, nk, &
                         tnk, qnk, gznk, t, q, qs, gz, &
@@ -899,4 +925,6 @@
     ! epmax_cape
     ! on recalcule ep et hp    
+        if (prt_level >= 9) &
+             PRINT *, 'cva_driver -> cv3_epmax_cape'
     call cv3_epmax_fn_cape(nloc,ncum,nd &
                 , ep,hp,icb,inb,clw,nk,t,h,hnk,lv,lf,frac &
@@ -915,4 +943,6 @@
       IF (iflag_mix>=1) THEN
         CALL zilch(supmax, nloc*klev)
+        if (prt_level >= 9) &
+             PRINT *, 'cva_driver -> cv3p_mixing'
         CALL cv3p_mixing(nloc, ncum, nd, nd, ntra, icb, nk, inb, &           ! na->nd
                          ph, t, q, qs, u, v, tra, h, lv, lf, frac, qnk, &
@@ -933,4 +963,6 @@
     IF (iflag_con==3) THEN
       IF (iflag_clos==0) THEN
+        if (prt_level >= 9) &
+             PRINT *, 'cva_driver -> cv3_closure'
         CALL cv3_closure(nloc, ncum, nd, icb, inb, &           ! na->nd
                          pbase, p, ph, tv, buoy, &
@@ -949,4 +981,6 @@
 
       IF (iflag_clos==2) THEN
+        if (prt_level >= 9) &
+             PRINT *, 'cva_driver -> cv3p1_closure'
         CALL cv3p1_closure(nloc, ncum, nd, icb, inb, &         ! na->nd
                            pbase, plcl, p, ph, tv, tvp, buoy, &
@@ -960,4 +994,6 @@
 
       IF (iflag_clos==3) THEN
+        if (prt_level >= 9) &
+             PRINT *, 'cva_driver -> cv3p2_closure'
         CALL cv3p2_closure(nloc, ncum, nd, icb, inb, &         ! na->nd
                            pbase, plcl, p, ph, tv, tvp, buoy, &
@@ -972,4 +1008,6 @@
 
     IF (iflag_con==4) THEN
+        if (prt_level >= 9) &
+             PRINT *, 'cva_driver -> cv_closure'
       CALL cv_closure(nloc, ncum, nd, nk, icb, &
                          tv, tvp, p, ph, dph, plcl, cpn, &
@@ -985,4 +1023,6 @@
     IF (iflag_con==3) THEN
       IF (iflag_mix==0) THEN
+        if (prt_level >= 9) &
+             PRINT *, 'cva_driver -> cv3_mixing'
         CALL cv3_mixing(nloc, ncum, nd, nd, ntra, icb, nk, inb, &             ! na->nd
                         ph, t, q, qs, u, v, tra, h, lv, lf, frac, qnk, &
@@ -999,4 +1039,6 @@
 
     IF (iflag_con==4) THEN
+        if (prt_level >= 9) &
+             PRINT *, 'cva_driver -> cv_mixing'
       CALL cv_mixing(nloc, ncum, nd, icb, nk, inb, inbis, &
                      ph, t, q, qs, u, v, h, lv, qnk, &
@@ -1020,4 +1062,6 @@
       END IF !(debut) THEN
 
+        if (prt_level >= 9) &
+             PRINT *, 'cva_driver -> cv3_unsat'
       CALL cv3_unsat(nloc, ncum, nd, nd, ntra, icb, inb, iflag, &              ! na->nd
                      t_wake, q_wake, qs_wake, gz, u, v, tra, p, ph, &
@@ -1046,4 +1090,6 @@
 
     IF (iflag_con==4) THEN
+        if (prt_level >= 9) &
+             PRINT *, 'cva_driver -> cv_unsat'
       CALL cv_unsat(nloc, ncum, nd, inb, t, q, qs, gz, u, v, p, ph, &
                      h, lv, ep, sigp, clw, m, ment, elij, &
@@ -1065,4 +1111,6 @@
     IF (iflag_con==3) THEN
 
+        if (prt_level >= 9) &
+             PRINT *, 'cva_driver -> cv3_yield'
       CALL cv3_yield(nloc, ncum, nd, nd, ntra, ok_conserv_q, &                      ! na->nd
                      icb, inb, delt, &
@@ -1094,4 +1142,6 @@
 
     IF (iflag_con==4) THEN
+        if (prt_level >= 9) &
+             PRINT *, 'cva_driver -> cv_yield'
       CALL cv_yield(nloc, ncum, nd, nk, icb, inb, delt, &
                      t, q, u, v, &
@@ -1112,4 +1162,6 @@
     IF (iflag_con==3) THEN
 !RomP >>>
+        if (prt_level >= 9) &
+             PRINT *, 'cva_driver -> cv3_tracer'
       CALL cv3_tracer(nloc, len, ncum, nd, nd, &
                      ment, sigij, da, phi, phi2, d1a, dam, &
@@ -1127,4 +1179,6 @@
 
     IF (iflag_con==3) THEN
+        if (prt_level >= 9) &
+             PRINT *, 'cva_driver -> cv3a_uncompress'
       CALL cv3a_uncompress(nloc, len, ncum, nd, ntra, idcum, compress, &
                            iflag, icb, inb, &
@@ -1157,4 +1211,6 @@
 
     IF (iflag_con==4) THEN
+        if (prt_level >= 9) &
+             PRINT *, 'cva_driver -> cv_uncompress'
       CALL cv_uncompress(nloc, len, ncum, nd, idcum, &
                            iflag, &
Index: /LMDZ5/trunk/libf/phylmd/physiq_mod.F90
===================================================================
--- /LMDZ5/trunk/libf/phylmd/physiq_mod.F90	(revision 2637)
+++ /LMDZ5/trunk/libf/phylmd/physiq_mod.F90	(revision 2638)
@@ -1124,4 +1124,6 @@
     if (first) then 
 
+     CALL iophys_ini
+
        !CR:nvelles variables convection/poches froides
 
@@ -1401,4 +1403,19 @@
              ! 11/09/06 rajout initialisation ALE et ALP du wake et PBL(YU)
              !        print*,'apres ini_wake iflag_cld_th=', iflag_cld_th
+             !
+             ! Initialize tendencies of wake state variables (for some flag values
+             ! they are not computed).
+             d_deltat_wk(:,:) = 0.
+             d_deltaq_wk(:,:) = 0.
+             d_deltat_wk_gw(:,:) = 0.
+             d_deltaq_wk_gw(:,:) = 0.
+             d_deltat_vdf(:,:) = 0.
+             d_deltaq_vdf(:,:) = 0.
+             d_deltat_the(:,:) = 0.
+             d_deltaq_the(:,:) = 0.
+             d_deltat_ajs_cv(:,:) = 0.
+             d_deltaq_ajs_cv(:,:) = 0.
+             d_s_wk(:) = 0.
+             d_dens_wk(:) = 0.
           endif
 
@@ -2420,24 +2437,28 @@
              CALL ajsec(paprs, pplay, t_w, q_w, limbas, &
                   d_t_adjwk, d_q_adjwk)
-          ENDIF
-          !
-          DO k=1,klev
-             DO i=1,klon
-                IF (wake_s(i) .GT. 1.e-3) THEN
-                   t_w(i,k) = t_w(i,k) + d_t_adjwk(i,k)
-                   q_w(i,k) = q_w(i,k) + d_q_adjwk(i,k)
-                   d_deltat_ajs_cv(i,k) = d_t_adjwk(i,k)
-                   d_deltaq_ajs_cv(i,k) = d_q_adjwk(i,k)
-                ELSE
-                   d_deltat_ajs_cv(i,k) = 0.
-                   d_deltaq_ajs_cv(i,k) = 0.
-                ENDIF
+             !
+             DO k=1,klev
+                DO i=1,klon
+                   IF (wake_s(i) .GT. 1.e-3) THEN
+                      t_w(i,k) = t_w(i,k) + d_t_adjwk(i,k)
+                      q_w(i,k) = q_w(i,k) + d_q_adjwk(i,k)
+                      d_deltat_ajs_cv(i,k) = d_t_adjwk(i,k)
+                      d_deltaq_ajs_cv(i,k) = d_q_adjwk(i,k)
+                   ELSE
+                      d_deltat_ajs_cv(i,k) = 0.
+                      d_deltaq_ajs_cv(i,k) = 0.
+                   ENDIF
+                ENDDO
              ENDDO
-          ENDDO
-          CALL add_wake_tend &
-              (d_deltat_ajs_cv, d_deltaq_ajs_cv, dsig0, ddens0, wkoccur1, 'ajs_cv', abortphy) 
+             CALL add_wake_tend &
+                 (d_deltat_ajs_cv, d_deltaq_ajs_cv, dsig0, ddens0, wkoccur1, 'ajs_cv', abortphy) 
+          ENDIF  ! (ok_adjwk)
        ENDIF ! (iflag_wake>=1)
        !>jyg
        !
+        
+!!      print *,'physiq. q_w(1,k), q_x(1,k) ', &
+!!             (k, q_w(1,k), q_x(1,k),k=1,25)
+
 !jyg<
        CALL alpale( debut, itap, dtime, paprs, omega, t_seri,   &
@@ -2885,9 +2906,9 @@
                 ENDDO
              ENDDO
-          ENDIF
-!
-          CALL add_wake_tend &
-              (d_deltat_the, d_deltaq_the, dsig0, ddens0, wkoccur1, 'the', abortphy) 
-!
+          !
+             CALL add_wake_tend &
+                 (d_deltat_the, d_deltaq_the, dsig0, ddens0, wkoccur1, 'the', abortphy) 
+          !
+          ENDIF  ! (mod(iflag_pbl_split/2,2) .EQ. 1)
           !
           CALL add_phys_tend(d_u_ajs,d_v_ajs,d_t_ajs,d_q_ajs,  &
