Index: /LMDZ6/branches/DYNAMICO-conv/libf/dyn3dmem/caladvtrac_mod.F90
===================================================================
--- /LMDZ6/branches/DYNAMICO-conv/libf/dyn3dmem/caladvtrac_mod.F90	(revision 3354)
+++ /LMDZ6/branches/DYNAMICO-conv/libf/dyn3dmem/caladvtrac_mod.F90	(revision 3355)
@@ -44,5 +44,7 @@
     CALL allocate_u(massem,llm,d)
     CALL allocate_u(pbaruc,llm,d)
+    pbaruc(:,:)=0
     CALL allocate_v(pbarvc,llm,d)
+    pbarvc(:,:)=0
     CALL allocate_u(pbarug,llm,d)
     CALL allocate_v(pbarvg,llm,d)
Index: /LMDZ6/branches/DYNAMICO-conv/libf/dyn3dmem/call_calfis_mod.F90
===================================================================
--- /LMDZ6/branches/DYNAMICO-conv/libf/dyn3dmem/call_calfis_mod.F90	(revision 3354)
+++ /LMDZ6/branches/DYNAMICO-conv/libf/dyn3dmem/call_calfis_mod.F90	(revision 3355)
@@ -52,5 +52,7 @@
     CALL allocate_u(p,llmp1,d)
     CALL allocate_u(pks,d)
+    pks(:)=0
     CALL allocate_u(pk,llm,d)
+    pk(:,:)=0
     CALL allocate_u(pkf,llm,d)
     CALL allocate_u(phi,llm,d)
Index: /LMDZ6/branches/DYNAMICO-conv/libf/dyn3dmem/call_dissip_mod.F90
===================================================================
--- /LMDZ6/branches/DYNAMICO-conv/libf/dyn3dmem/call_dissip_mod.F90	(revision 3354)
+++ /LMDZ6/branches/DYNAMICO-conv/libf/dyn3dmem/call_dissip_mod.F90	(revision 3355)
@@ -31,5 +31,7 @@
 
     CALL allocate_u(ucov,llm,d)
+    ucov(:,:)=0
     CALL allocate_v(vcov,llm,d)
+    vcov(:,:)=0
     CALL allocate_u(teta,llm,d)
     CALL allocate_u(p,llmp1,d)
Index: /LMDZ6/branches/DYNAMICO-conv/libf/dyn3dmem/integrd_mod.F90
===================================================================
--- /LMDZ6/branches/DYNAMICO-conv/libf/dyn3dmem/integrd_mod.F90	(revision 3354)
+++ /LMDZ6/branches/DYNAMICO-conv/libf/dyn3dmem/integrd_mod.F90	(revision 3355)
@@ -23,4 +23,5 @@
     CALL allocate_u(deltap,llm,d)
     CALL allocate_u(ps,d)
+    ps(:)=0
 
     
Index: /LMDZ6/branches/DYNAMICO-conv/libf/phylmd/coef_diff_turb_mod.F90
===================================================================
--- /LMDZ6/branches/DYNAMICO-conv/libf/phylmd/coef_diff_turb_mod.F90	(revision 3354)
+++ /LMDZ6/branches/DYNAMICO-conv/libf/phylmd/coef_diff_turb_mod.F90	(revision 3355)
@@ -65,4 +65,9 @@
 
 
+    ykmm = 0 !ym missing init
+    ykmn = 0 !ym missing init
+    ykmq = 0 !ym missing init
+    
+    
 !****************************************************************************************    
 ! Calcul de coefficients de diffusion turbulent de l'atmosphere : 
Index: /LMDZ6/branches/DYNAMICO-conv/libf/phylmd/cv3_routines.F90
===================================================================
--- /LMDZ6/branches/DYNAMICO-conv/libf/phylmd/cv3_routines.F90	(revision 3354)
+++ /LMDZ6/branches/DYNAMICO-conv/libf/phylmd/cv3_routines.F90	(revision 3355)
@@ -3747,12 +3747,25 @@
     END DO ! cld
 
+!ym BIG Warning : it seems that the k loop is missing !!!
+!ym Strong advice to check this
+!ym add a k loop temporary 
+
 ! (particular case: no detraining level is found)                              ! cld
-    DO il = 1, ncum                                                            ! cld
-      IF (i<=inb(il) .AND. nent(il,i)==0 .AND. iflag(il)<=1) THEN              ! cld
-        qcond(il, i) = qcond(il, i) + (1.-ep(il,i))*clw(il, i)                 ! cld
-        qtment(il, i) = qent(il,k,i) + qtment(il,i)                          ! cld
-        nqcond(il, i) = nqcond(il, i) + 1.                                     ! cld
-      END IF                                                                   ! cld
-    END DO                                                                     ! cld
+    DO k = i + 1, nl
+      DO il = 1, ncum        !ym k loop added                                                      ! cld
+        IF (i<=inb(il) .AND. nent(il,i)==0 .AND. iflag(il)<=1) THEN              ! cld
+          qcond(il, i) = qcond(il, i) + (1.-ep(il,i))*clw(il, i)                 ! cld
+!jyg<   Bug correction 20180620
+!      PROBLEM: Should not qent(il,i,i) be taken into account even if nent(il,i)/=0?
+!!        qtment(il, i) = qent(il,k,i) + qtment(il,i)
+! cld
+          qtment(il, i) = qent(il,i,i) + qtment(il,i)
+! cld
+!>jyg
+
+          nqcond(il, i) = nqcond(il, i) + 1.                                     ! cld
+        END IF                                                                   ! cld
+      END DO
+    ENDDO                                                                     ! cld
 
     DO il = 1, ncum                                                            ! cld
Index: /LMDZ6/branches/DYNAMICO-conv/libf/phylmd/cva_driver.F90
===================================================================
--- /LMDZ6/branches/DYNAMICO-conv/libf/phylmd/cva_driver.F90	(revision 3354)
+++ /LMDZ6/branches/DYNAMICO-conv/libf/phylmd/cva_driver.F90	(revision 3355)
@@ -613,4 +613,7 @@
   asupmaxmin1(:) = 0.
 
+  tvp(:, :) = 0. !ym missing init, need to have a look by developpers
+  tv(:, :) = 0. !ym missing init, need to have a look by developpers
+   
   DO il = 1, len
     cin1(il) = -100000.
Index: /LMDZ6/branches/DYNAMICO-conv/libf/phylmd/pbl_surface_mod.F90
===================================================================
--- /LMDZ6/branches/DYNAMICO-conv/libf/phylmd/pbl_surface_mod.F90	(revision 3354)
+++ /LMDZ6/branches/DYNAMICO-conv/libf/phylmd/pbl_surface_mod.F90	(revision 3355)
@@ -1895,5 +1895,5 @@
                ywindsp, rmu0, yfder, yts, &
                itap, dtime, jour, knon, ni, &
-               ypplay(:,1), zgeo1/RG, ycdragh, ycdragm, yrain_f, ysnow_f, yt(:,1), yq(:,1),&
+               ypplay(:,1), zgeo1(1:knon)/RG, ycdragh, ycdragm, yrain_f, ysnow_f, yt(:,1), yq(:,1),&    ! ym missing init
                AcoefH, AcoefQ, BcoefH, BcoefQ, &
                AcoefU, AcoefV, BcoefU, BcoefV, &
Index: /LMDZ6/branches/DYNAMICO-conv/libf/phylmd/phys_local_var_mod.F90
===================================================================
--- /LMDZ6/branches/DYNAMICO-conv/libf/phylmd/phys_local_var_mod.F90	(revision 3354)
+++ /LMDZ6/branches/DYNAMICO-conv/libf/phylmd/phys_local_var_mod.F90	(revision 3355)
@@ -573,4 +573,6 @@
       ALLOCATE(dv_gwd_rando(klon,klev),dv_gwd_front(klon,klev))
       ALLOCATE(east_gwstress(klon,klev),west_gwstress(klon,klev))
+      east_gwstress(:,:)=0 !ym missing init
+      west_gwstress(:,:)=0 !ym missing init
       ALLOCATE(d_t_hin(klon,klev))
       ALLOCATE(d_q_ch4(klon,klev))
@@ -688,5 +690,7 @@
 !>jyg
       ALLOCATE(dtvdf_x(klon,klev), dtvdf_w(klon,klev))
+      dtvdf_x = 0 ; dtvdf_w=0 ;   !ym missing init
       ALLOCATE(dqvdf_x(klon,klev), dqvdf_w(klon,klev))
+      dqvdf_x = 0 ; dqvdf_w=0 ;   !ym missing init
       ALLOCATE(pbl_tke_input(klon,klev+1,nbsrf))
       ALLOCATE(t_therm(klon,klev), q_therm(klon,klev),u_therm(klon,klev), v_therm(klon,klev))
Index: /LMDZ6/branches/DYNAMICO-conv/libf/phylmd/phys_output_write_mod.F90
===================================================================
--- /LMDZ6/branches/DYNAMICO-conv/libf/phylmd/phys_output_write_mod.F90	(revision 3354)
+++ /LMDZ6/branches/DYNAMICO-conv/libf/phylmd/phys_output_write_mod.F90	(revision 3355)
@@ -691,6 +691,15 @@
        CALL histwrite_phy(o_fsnow, zfra_o)
        CALL histwrite_phy(o_evap, evap)
-       CALL histwrite_phy(o_tops, topsw*swradcorr)
-       CALL histwrite_phy(o_tops0, topsw0*swradcorr)
+
+       IF (vars_defined) THEN
+         zx_tmp_fi2d = topsw*swradcorr
+       ENDIF
+       CALL histwrite_phy(o_tops, zx_tmp_fi2d)
+
+       IF (vars_defined) THEN
+         zx_tmp_fi2d = topsw0*swradcorr
+       ENDIF
+       CALL histwrite_phy(o_tops0, zx_tmp_fi2d)
+
        CALL histwrite_phy(o_topl, toplw)
        CALL histwrite_phy(o_topl0, toplw0)
@@ -720,14 +729,41 @@
        ENDIF
        CALL histwrite_phy(o_nettop, zx_tmp_fi2d)
-       CALL histwrite_phy(o_SWup200, SWup200*swradcorr)
-       CALL histwrite_phy(o_SWup200clr, SWup200clr*swradcorr)
-       CALL histwrite_phy(o_SWdn200, SWdn200*swradcorr)
-       CALL histwrite_phy(o_SWdn200clr, SWdn200clr*swradcorr)
+       
+       IF (vars_defined) THEN
+          zx_tmp_fi2d = SWup200*swradcorr
+       ENDIF
+       CALL histwrite_phy(o_SWup200, zx_tmp_fi2d)
+       
+       IF (vars_defined) THEN
+          zx_tmp_fi2d = SWup200clr*swradcorr
+       ENDIF
+       CALL histwrite_phy(o_SWup200clr, zx_tmp_fi2d)
+       
+       IF (vars_defined) THEN
+          zx_tmp_fi2d = SWdn200*swradcorr
+       ENDIF
+       CALL histwrite_phy(o_SWdn200, zx_tmp_fi2d)
+       
+       
+       IF (vars_defined) THEN
+          zx_tmp_fi2d = SWdn200clr*swradcorr
+       ENDIF
+       CALL histwrite_phy(o_SWdn200clr, zx_tmp_fi2d)
+       
        CALL histwrite_phy(o_LWup200, LWup200)
        CALL histwrite_phy(o_LWup200clr, LWup200clr)
        CALL histwrite_phy(o_LWdn200, LWdn200)
        CALL histwrite_phy(o_LWdn200clr, LWdn200clr)
-       CALL histwrite_phy(o_sols, solsw*swradcorr)
-       CALL histwrite_phy(o_sols0, solsw0*swradcorr)
+       
+       IF (vars_defined) THEN
+          zx_tmp_fi2d = solsw*swradcorr
+       ENDIF
+       CALL histwrite_phy(o_sols, zx_tmp_fi2d)
+       
+       
+       IF (vars_defined) THEN
+          zx_tmp_fi2d = solsw0*swradcorr
+       ENDIF
+       CALL histwrite_phy(o_sols0, zx_tmp_fi2d)
        CALL histwrite_phy(o_soll, sollw)
        CALL histwrite_phy(o_soll0, sollw0)
@@ -900,8 +936,17 @@
        CALL histwrite_phy(o_cldt, cldt)
        CALL histwrite_phy(o_JrNt, JrNt)
-       CALL histwrite_phy(o_cldljn, cldl*JrNt)
-       CALL histwrite_phy(o_cldmjn, cldm*JrNt)
-       CALL histwrite_phy(o_cldhjn, cldh*JrNt)
-       CALL histwrite_phy(o_cldtjn, cldt*JrNt)
+       
+       IF (vars_defined)  zx_tmp_fi2d=cldl*JrNt      
+       CALL histwrite_phy(o_cldljn, zx_tmp_fi2d)
+       
+       IF (vars_defined)  zx_tmp_fi2d=cldm*JrNt      
+       CALL histwrite_phy(o_cldmjn, zx_tmp_fi2d)
+       
+       IF (vars_defined)  zx_tmp_fi2d=cldh*JrNt
+       CALL histwrite_phy(o_cldhjn, zx_tmp_fi2d)
+       
+       IF (vars_defined)  zx_tmp_fi2d=cldt*JrNt
+       CALL histwrite_phy(o_cldtjn, zx_tmp_fi2d)
+       
        CALL histwrite_phy(o_cldq, cldq)
        IF (vars_defined)       zx_tmp_fi2d(1:klon) = flwp(1:klon)
@@ -1054,4 +1099,6 @@
              CALL histwrite_phy(o_alp_wk, alp_wake)
              IF (iflag_pbl_split>=1) THEN
+               !ym warning : dtvdf_x, dtvdf_w, dqvdf_x, dqvdf_w are not defined by model
+               !ym => init to 0 in phys_local_var_mod
                IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=dtvdf_x(1:klon,1:klev)/pdtphys
                CALL histwrite_phy(o_dtvdf_x    ,zx_tmp_fi3d) 
@@ -1089,5 +1136,5 @@
              IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_q_wake(1:klon,1:klev)/pdtphys
              CALL histwrite_phy(o_dqwak, zx_tmp_fi3d)
-             CALL water_int(klon,klev,zx_tmp_fi3d,zmasse,zx_tmp_fi2d)
+             IF (vars_defined) CALL water_int(klon,klev,zx_tmp_fi3d,zmasse,zx_tmp_fi2d)
              CALL histwrite_phy(o_dqwak2d, zx_tmp_fi2d)
           ENDIF ! iflag_wake>=1
@@ -1255,13 +1302,18 @@
 
 ! ThL -- In the following, we assume read_climoz == 1
-       zx_tmp_fi2d = 0.0    ! Computation for strato, added ThL
-       DO k=1, klev
-          zx_tmp_fi2d(:) = zx_tmp_fi2d(:) + wo(:,k,1) * stratomask(:,k) * 1.e3
-       END DO
+       IF (vars_defined) THEN
+         zx_tmp_fi2d = 0.0    ! Computation for strato, added ThL
+         DO k=1, klev
+            zx_tmp_fi2d(:) = zx_tmp_fi2d(:) + wo(:,k,1) * stratomask(:,k) * 1.e3
+         END DO
+       ENDIF
        CALL histwrite_phy(o_col_O3_strato, zx_tmp_fi2d) ! Added ThL
-       zx_tmp_fi2d = 0.0    ! Computation for tropo, added ThL
-       DO k=1, klev
-          zx_tmp_fi2d(:) = zx_tmp_fi2d(:) + wo(:,k,1) * (1.0-stratomask(:,k)) * 1.e3
-       END DO
+
+       IF (vars_defined) THEN
+         zx_tmp_fi2d = 0.0    ! Computation for tropo, added ThL
+         DO k=1, klev
+            zx_tmp_fi2d(:) = zx_tmp_fi2d(:) + wo(:,k,1) * (1.0-stratomask(:,k)) * 1.e3
+         END DO
+       ENDIF
        CALL histwrite_phy(o_col_O3_tropo, zx_tmp_fi2d)   ! Added ThL
 ! end add ThL
@@ -1300,8 +1352,16 @@
 #endif
        IF (ok_ade) THEN
-          CALL histwrite_phy(o_topswad, topswad_aero*swradcorr)
-          CALL histwrite_phy(o_topswad0, topswad0_aero*swradcorr)
-          CALL histwrite_phy(o_solswad, solswad_aero*swradcorr)
-          CALL histwrite_phy(o_solswad0, solswad0_aero*swradcorr)
+          IF (vars_defined) zx_tmp_fi2d(:)=topswad_aero*swradcorr
+          CALL histwrite_phy(o_topswad, zx_tmp_fi2d)
+          
+          IF (vars_defined) zx_tmp_fi2d(:)=topswad0_aero*swradcorr
+          CALL histwrite_phy(o_topswad0, zx_tmp_fi2d)
+                    
+          IF (vars_defined) zx_tmp_fi2d(:)=solswad_aero*swradcorr
+          CALL histwrite_phy(o_solswad, zx_tmp_fi2d)
+                    
+          IF (vars_defined) zx_tmp_fi2d(:)=solswad0_aero*swradcorr
+          CALL histwrite_phy(o_solswad0, zx_tmp_fi2d)
+          
           IF (type_trac .ne. 'inca') THEN 
              IF (config_inca .ne. 'aeNP') THEN 
@@ -1314,34 +1374,37 @@
           !====MS forcing diagnostics
           IF (new_aod) THEN
-             zx_tmp_fi2d(:)=topsw_aero(:,1)*swradcorr(:)
+          !ym warning : topsw_aero, solsw_aero, topsw0_aero, solsw0_aero are not defined by model
+          !ym => init to 0 in radlwsw_m.F90 ztopsw_aero, zsolsw_aero, ztopsw0_aero, zsolsw0_aero
+
+             IF (vars_defined) zx_tmp_fi2d(:)=topsw_aero(:,1)*swradcorr(:)
              CALL histwrite_phy(o_swtoaas_nat,zx_tmp_fi2d)
-             zx_tmp_fi2d(:)=solsw_aero(:,1)*swradcorr(:)
+             IF (vars_defined) zx_tmp_fi2d(:)=solsw_aero(:,1)*swradcorr(:)
              CALL histwrite_phy(o_swsrfas_nat,zx_tmp_fi2d)
-             zx_tmp_fi2d(:)=topsw0_aero(:,1)*swradcorr(:)
+             IF (vars_defined) zx_tmp_fi2d(:)=topsw0_aero(:,1)*swradcorr(:)
              CALL histwrite_phy(o_swtoacs_nat,zx_tmp_fi2d)
-             zx_tmp_fi2d(:)=solsw0_aero(:,1)*swradcorr(:)
+             IF (vars_defined) zx_tmp_fi2d(:)=solsw0_aero(:,1)*swradcorr(:)
              CALL histwrite_phy(o_swsrfcs_nat,zx_tmp_fi2d)
              !ant
-             zx_tmp_fi2d(:)=topsw_aero(:,2)*swradcorr(:)
+             IF (vars_defined) zx_tmp_fi2d(:)=topsw_aero(:,2)*swradcorr(:)
              CALL histwrite_phy(o_swtoaas_ant,zx_tmp_fi2d)
-             zx_tmp_fi2d(:)=solsw_aero(:,2)*swradcorr(:)
+             IF (vars_defined) zx_tmp_fi2d(:)=solsw_aero(:,2)*swradcorr(:)
              CALL histwrite_phy(o_swsrfas_ant,zx_tmp_fi2d)
-             zx_tmp_fi2d(:)=topsw0_aero(:,2)*swradcorr(:)
+             IF (vars_defined) zx_tmp_fi2d(:)=topsw0_aero(:,2)*swradcorr(:)
              CALL histwrite_phy(o_swtoacs_ant,zx_tmp_fi2d)
-             zx_tmp_fi2d(:)=solsw0_aero(:,2)*swradcorr(:)
+             IF (vars_defined) zx_tmp_fi2d(:)=solsw0_aero(:,2)*swradcorr(:)
              CALL histwrite_phy(o_swsrfcs_ant,zx_tmp_fi2d)
              !cf
              IF (.not. aerosol_couple) THEN
-                zx_tmp_fi2d(:)=topswcf_aero(:,1)*swradcorr(:)
+                IF (vars_defined) zx_tmp_fi2d(:)=topswcf_aero(:,1)*swradcorr(:)
                 CALL histwrite_phy(o_swtoacf_nat,zx_tmp_fi2d)
-                zx_tmp_fi2d(:)=solswcf_aero(:,1)*swradcorr(:)
+                IF (vars_defined) zx_tmp_fi2d(:)=solswcf_aero(:,1)*swradcorr(:)
                 CALL histwrite_phy(o_swsrfcf_nat,zx_tmp_fi2d)
-                zx_tmp_fi2d(:)=topswcf_aero(:,2)*swradcorr(:)
+                IF (vars_defined) zx_tmp_fi2d(:)=topswcf_aero(:,2)*swradcorr(:)
                 CALL histwrite_phy(o_swtoacf_ant,zx_tmp_fi2d)
-                zx_tmp_fi2d(:)=solswcf_aero(:,2)*swradcorr(:)
+                IF (vars_defined) zx_tmp_fi2d(:)=solswcf_aero(:,2)*swradcorr(:)
                 CALL histwrite_phy(o_swsrfcf_ant,zx_tmp_fi2d)
-                zx_tmp_fi2d(:)=topswcf_aero(:,3)*swradcorr(:)
+                IF (vars_defined) zx_tmp_fi2d(:)=topswcf_aero(:,3)*swradcorr(:)
                 CALL histwrite_phy(o_swtoacf_zero,zx_tmp_fi2d)
-                zx_tmp_fi2d(:)=solswcf_aero(:,3)*swradcorr(:)
+                IF (vars_defined) zx_tmp_fi2d(:)=solswcf_aero(:,3)*swradcorr(:)
                 CALL histwrite_phy(o_swsrfcf_zero,zx_tmp_fi2d)
              ENDIF
@@ -1350,8 +1413,15 @@
        ENDIF
        IF (ok_aie) THEN
-          CALL histwrite_phy(o_topswai, topswai_aero*swradcorr)
-          CALL histwrite_phy(o_toplwai, toplwai_aero*swradcorr)
-          CALL histwrite_phy(o_solswai, solswai_aero*swradcorr)
-          CALL histwrite_phy(o_sollwai, sollwai_aero*swradcorr)
+          IF (vars_defined) zx_tmp_fi2d(:)= topswai_aero*swradcorr
+          CALL histwrite_phy(o_topswai, zx_tmp_fi2d)
+          
+          IF (vars_defined) zx_tmp_fi2d(:)=toplwai_aero*swradcorr
+          CALL histwrite_phy(o_toplwai, zx_tmp_fi2d)
+          
+          IF (vars_defined) zx_tmp_fi2d(:)=solswai_aero*swradcorr
+          CALL histwrite_phy(o_solswai, zx_tmp_fi2d)
+          
+          IF (vars_defined) zx_tmp_fi2d(:)=sollwai_aero*swradcorr
+          CALL histwrite_phy(o_sollwai, zx_tmp_fi2d)
        ENDIF
        IF (flag_aerosol.GT.0.AND.ok_cdnc) THEN
@@ -1378,5 +1448,8 @@
        CALL histwrite_phy(o_ovap, q_seri)
        CALL histwrite_phy(o_oliq, ql_seri)
-       CALL histwrite_phy(o_ocond, ql_seri+qs_seri)
+
+       IF (vars_defined) zx_tmp_fi3d = ql_seri+qs_seri
+       CALL histwrite_phy(o_ocond, zx_tmp_fi3d)
+
        CALL histwrite_phy(o_geop, zphi)
        CALL histwrite_phy(o_vitu, u_seri)
@@ -1385,5 +1458,7 @@
        CALL histwrite_phy(o_pres, pplay)
        CALL histwrite_phy(o_paprs, paprs(:,1:klev))
-       CALL histwrite_phy(o_zfull,zphi/RG)
+       
+       IF (vars_defined) zx_tmp_fi3d = zphi/RG
+       CALL histwrite_phy(o_zfull,zx_tmp_fi3d)
 
        IF (flag_aerosol_strat.EQ.2) THEN
@@ -1415,10 +1490,11 @@
        CALL histwrite_phy(o_rnebjn, zx_tmp_fi3d)
        CALL histwrite_phy(o_rhum, zx_rh)
-       CALL histwrite_phy(o_ozone, &
-            wo(:, :, 1) * dobson_u * 1e3 / zmasse / rmo3 * rmd)
+       
+       IF (vars_defined) zx_tmp_fi3d = wo(:, :, 1) * dobson_u * 1e3 / zmasse / rmo3 * rmd
+       CALL histwrite_phy(o_ozone, zx_tmp_fi3d)
 
        IF (read_climoz == 2) THEN
-          CALL histwrite_phy(o_ozone_light, &
-               wo(:, :, 2) * dobson_u * 1e3 / zmasse / rmo3 * rmd)
+         IF (vars_defined) zx_tmp_fi3d = wo(:, :, 2) * dobson_u * 1e3 / zmasse / rmo3 * rmd 
+         CALL histwrite_phy(o_ozone_light, zx_tmp_fi3d)
        ENDIF
 
@@ -1428,14 +1504,14 @@
 
        CALL histwrite_phy(o_dqphy,  d_qx(:,:,ivap))
-       CALL water_int(klon,klev,d_qx(:,:,ivap),zmasse,zx_tmp_fi2d)
+       IF (vars_defined) CALL water_int(klon,klev,d_qx(:,:,ivap),zmasse,zx_tmp_fi2d)
        CALL histwrite_phy(o_dqphy2d,  zx_tmp_fi2d)
 
        CALL histwrite_phy(o_dqlphy,  d_qx(:,:,iliq))
-       CALL water_int(klon,klev,d_qx(:,:,iliq),zmasse,zx_tmp_fi2d)
+       IF (vars_defined) CALL water_int(klon,klev,d_qx(:,:,iliq),zmasse,zx_tmp_fi2d)
        CALL histwrite_phy(o_dqlphy2d,  zx_tmp_fi2d)
 
        IF (nqo.EQ.3) THEN
        CALL histwrite_phy(o_dqsphy,  d_qx(:,:,isol))
-       CALL water_int(klon,klev,d_qx(:,:,isol),zmasse,zx_tmp_fi2d)
+       IF (vars_defined) CALL water_int(klon,klev,d_qx(:,:,isol),zmasse,zx_tmp_fi2d)
        CALL histwrite_phy(o_dqsphy2d,  zx_tmp_fi2d)
        ELSE 
@@ -1522,5 +1598,5 @@
        IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_q_con(1:klon,1:klev)/pdtphys
        CALL histwrite_phy(o_dqcon, zx_tmp_fi3d)
-       CALL water_int(klon,klev,zx_tmp_fi3d,zmasse,zx_tmp_fi2d)
+       IF (vars_defined) CALL water_int(klon,klev,zx_tmp_fi3d,zmasse,zx_tmp_fi2d)
        CALL histwrite_phy(o_dqcon2d, zx_tmp_fi2d)
 
@@ -1544,5 +1620,5 @@
        IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_q_lsc(1:klon,1:klev)/pdtphys
        CALL histwrite_phy(o_dqlsc, zx_tmp_fi3d)
-       CALL water_int(klon,klev,zx_tmp_fi3d,zmasse,zx_tmp_fi2d)
+       IF (vars_defined) CALL water_int(klon,klev,zx_tmp_fi3d,zmasse,zx_tmp_fi2d)
        CALL histwrite_phy(o_dqlsc2d, zx_tmp_fi2d)
        IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=beta_prec(1:klon,1:klev)
@@ -1557,9 +1633,9 @@
           IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_q_lscth(1:klon,1:klev)/pdtphys
           CALL histwrite_phy(o_dqlscth, zx_tmp_fi3d)
-          CALL water_int(klon,klev,zx_tmp_fi3d,zmasse,zx_tmp_fi2d)
+          IF (vars_defined) CALL water_int(klon,klev,zx_tmp_fi3d,zmasse,zx_tmp_fi2d)
           CALL histwrite_phy(o_dqlscth2d, zx_tmp_fi2d)
           IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_q_lscst(1:klon,1:klev)/pdtphys
           CALL histwrite_phy(o_dqlscst, zx_tmp_fi3d)
-          CALL water_int(klon,klev,zx_tmp_fi3d,zmasse,zx_tmp_fi2d)
+          IF (vars_defined) CALL water_int(klon,klev,zx_tmp_fi3d,zmasse,zx_tmp_fi2d)
           CALL histwrite_phy(o_dqlscst2d, zx_tmp_fi2d)
           CALL histwrite_phy(o_plulth, plul_th)
@@ -1591,5 +1667,5 @@
        IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_q_vdf(1:klon,1:klev)/pdtphys
        CALL histwrite_phy(o_dqvdf, zx_tmp_fi3d)
-       CALL water_int(klon,klev,zx_tmp_fi3d,zmasse,zx_tmp_fi2d)
+       IF (vars_defined) CALL water_int(klon,klev,zx_tmp_fi3d,zmasse,zx_tmp_fi2d)
        CALL histwrite_phy(o_dqvdf2d, zx_tmp_fi2d)
        IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_eva(1:klon,1:klev)/pdtphys
@@ -1597,5 +1673,5 @@
        IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_q_eva(1:klon,1:klev)/pdtphys
        CALL histwrite_phy(o_dqeva, zx_tmp_fi3d)
-       CALL water_int(klon,klev,zx_tmp_fi3d,zmasse,zx_tmp_fi2d)
+       IF (vars_defined) CALL water_int(klon,klev,zx_tmp_fi3d,zmasse,zx_tmp_fi2d)
        CALL histwrite_phy(o_dqeva2d, zx_tmp_fi2d)
        zpt_conv = 0.
@@ -1638,5 +1714,5 @@
           ENDIF
           CALL histwrite_phy(o_dqthe, zx_tmp_fi3d)
-          CALL water_int(klon,klev,zx_tmp_fi3d,zmasse,zx_tmp_fi2d)
+          IF (vars_defined) CALL water_int(klon,klev,zx_tmp_fi3d,zmasse,zx_tmp_fi2d)
           CALL histwrite_phy(o_dqthe2d, zx_tmp_fi2d)
        ENDIF !iflag_thermals
@@ -1645,5 +1721,5 @@
        IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_q_ajsb(1:klon,1:klev)/pdtphys
        CALL histwrite_phy(o_dqajs, zx_tmp_fi3d)
-       CALL water_int(klon,klev,zx_tmp_fi3d,zmasse,zx_tmp_fi2d)
+       IF (vars_defined) CALL water_int(klon,klev,zx_tmp_fi3d,zmasse,zx_tmp_fi2d)
        CALL histwrite_phy(o_dqajs2d, zx_tmp_fi2d)
        IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_swr(1:klon,1:klev)/pdtphys
@@ -1681,6 +1757,10 @@
 
        IF (ok_hines) THEN
-          CALL histwrite_phy(o_du_gwd_hines, du_gwd_hines/pdtphys)
-          CALL histwrite_phy(o_dv_gwd_hines, dv_gwd_hines/pdtphys)
+          IF (vars_defined) zx_tmp_fi3d=du_gwd_hines/pdtphys
+          CALL histwrite_phy(o_du_gwd_hines, zx_tmp_fi3d)
+
+          IF (vars_defined) zx_tmp_fi3d= dv_gwd_hines/pdtphys          
+          CALL histwrite_phy(o_dv_gwd_hines, zx_tmp_fi3d)
+          
           IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_hin(1:klon,1:klev)/pdtphys
           CALL histwrite_phy(o_dthin, zx_tmp_fi3d)
@@ -1690,6 +1770,10 @@
 
        IF (.not. ok_hines .and. ok_gwd_rando) THEN
-          CALL histwrite_phy(o_du_gwd_front, du_gwd_front / pdtphys)
-          CALL histwrite_phy(o_dv_gwd_front, dv_gwd_front / pdtphys)
+          IF (vars_defined)  zx_tmp_fi3d=du_gwd_front / pdtphys
+          CALL histwrite_phy(o_du_gwd_front, zx_tmp_fi3d)
+          
+          IF (vars_defined)  zx_tmp_fi3d=dv_gwd_front / pdtphys
+          CALL histwrite_phy(o_dv_gwd_front, zx_tmp_fi3d)
+          
           CALL histwrite_phy(o_ustr_gwd_front, zustr_gwd_front)
           CALL histwrite_phy(o_vstr_gwd_front, zvstr_gwd_front)
@@ -1697,6 +1781,9 @@
 
        IF (ok_gwd_rando) THEN
-          CALL histwrite_phy(o_du_gwd_rando, du_gwd_rando / pdtphys)
-          CALL histwrite_phy(o_dv_gwd_rando, dv_gwd_rando / pdtphys)
+          IF (vars_defined)  zx_tmp_fi3d=du_gwd_rando / pdtphys
+          CALL histwrite_phy(o_du_gwd_rando, zx_tmp_fi3d)
+          
+          IF (vars_defined)  zx_tmp_fi3d=dv_gwd_rando / pdtphys
+          CALL histwrite_phy(o_dv_gwd_rando, zx_tmp_fi3d)
           CALL histwrite_phy(o_ustr_gwd_rando, zustr_gwd_rando)
           CALL histwrite_phy(o_vstr_gwd_rando, zvstr_gwd_rando)
@@ -1706,22 +1793,38 @@
 
        IF (ok_qch4) THEN
-          CALL histwrite_phy(o_dqch4, d_q_ch4 / pdtphys)
-       ENDIF
-
-       DO k=1, klevp1
-         zx_tmp_fi3d1(:,k)=swup(:,k)*swradcorr(:)
-       ENDDO
+          IF (vars_defined) zx_tmp_fi3d=d_q_ch4 / pdtphys
+          CALL histwrite_phy(o_dqch4, zx_tmp_fi3d)
+       ENDIF
+       
+       IF (vars_defined) THEN
+         DO k=1, klevp1
+           zx_tmp_fi3d1(:,k)=swup(:,k)*swradcorr(:)
+         ENDDO
+       ENDIF
+       
        CALL histwrite_phy(o_rsu, zx_tmp_fi3d1)
-       DO k=1, klevp1
-         zx_tmp_fi3d1(:,k)=swdn(:,k)*swradcorr(:)
-       ENDDO
+
+
+       IF (vars_defined) THEN
+         DO k=1, klevp1
+           zx_tmp_fi3d1(:,k)=swdn(:,k)*swradcorr(:)
+         ENDDO
+       ENDIF
+       
        CALL histwrite_phy(o_rsd, zx_tmp_fi3d1)
-       DO k=1, klevp1
-         zx_tmp_fi3d1(:,k)=swup0(:,k)*swradcorr(:)
-       ENDDO
+
+       IF (vars_defined) THEN
+         DO k=1, klevp1
+           zx_tmp_fi3d1(:,k)=swup0(:,k)*swradcorr(:)
+         ENDDO
+       ENDIF
+       
        CALL histwrite_phy(o_rsucs, zx_tmp_fi3d1)
-       DO k=1, klevp1
-         zx_tmp_fi3d1(:,k)=swdn0(:,k)*swradcorr(:)
-       ENDDO
+
+       IF (vars_defined) THEN
+         DO k=1, klevp1
+           zx_tmp_fi3d1(:,k)=swdn0(:,k)*swradcorr(:)
+         ENDDO
+       ENDIF
        CALL histwrite_phy(o_rsdcs, zx_tmp_fi3d1)
 
@@ -1777,5 +1880,6 @@
        ELSE IF (iflag_con == 2) THEN
           CALL histwrite_phy(o_mcd,  pmfd)
-          CALL histwrite_phy(o_dmc,  pmfu + pmfd)
+          IF (vars_defined) zx_tmp_fi3d = pmfu + pmfd
+          CALL histwrite_phy(o_dmc,  zx_tmp_fi3d)
        ENDIF
        CALL histwrite_phy(o_ref_liq, ref_liq)
Index: /LMDZ6/branches/DYNAMICO-conv/libf/phylmd/physiq_mod.F90
===================================================================
--- /LMDZ6/branches/DYNAMICO-conv/libf/phylmd/physiq_mod.F90	(revision 3354)
+++ /LMDZ6/branches/DYNAMICO-conv/libf/phylmd/physiq_mod.F90	(revision 3355)
@@ -1517,4 +1517,6 @@
             ENDDO
           ENDDO
+        ELSE
+          pbl_tke(:,:,is_ave) = 0. !ym missing init : maybe must be initialized in the same way that for klon_glo==1 ??
 !>jyg
        ENDIF
@@ -2238,4 +2240,7 @@
        !
        !-------gustiness calculation-------!
+       !ym : Warning gustiness non inialized for iflag_gusts=2 & iflag_gusts=3
+       gustiness=0  !ym missing init
+       
        IF (iflag_gusts==0) THEN
           gustiness(1:klon)=0
@@ -4065,4 +4070,5 @@
 
     IF (.not. ok_hines .and. ok_gwd_rando) then
+       ! ym missing init for east_gwstress & west_gwstress -> added in phys_local_var_mod
        CALL acama_GWD_rando(PHYS_TSTEP, pplay, latitude_deg, t_seri, u_seri, &
             v_seri, rot, zustr_gwd_front, zvstr_gwd_front, du_gwd_front, &
@@ -4727,5 +4733,5 @@
        !         write(97) u_seri,v_seri,t_seri,q_seri
        !         close(97)
-       !$OMP MASTER
+!       !$OMP MASTER
        IF (read_climoz >= 1) THEN
           IF (is_mpi_root) THEN
@@ -4735,5 +4741,5 @@
           DEALLOCATE(press_cen_climoz) ! pointer
        ENDIF
-       !$OMP END MASTER
+!       !$OMP END MASTER
 #ifdef CPP_XIOS
        IF (is_omp_master) CALL xios_context_finalize
Index: /LMDZ6/branches/DYNAMICO-conv/libf/phylmd/radlwsw_m.F90
===================================================================
--- /LMDZ6/branches/DYNAMICO-conv/libf/phylmd/radlwsw_m.F90	(revision 3354)
+++ /LMDZ6/branches/DYNAMICO-conv/libf/phylmd/radlwsw_m.F90	(revision 3355)
@@ -384,4 +384,5 @@
   cgaero(:,:,:,:)=0.
   lldebug=.FALSE.
+
   
   !
@@ -596,4 +597,8 @@
       ztopswaiaero(i)=0.
       zsolswaiaero(i)=0.
+      ztopsw_aero(i,:)  = 0. !ym missing init : warning : not initialized in SW_AEROAR4
+      ztopsw0_aero(i,:) = 0. !ym missing init : warning : not initialized in SW_AEROAR4
+      zsolsw_aero(i,:)  = 0. !ym missing init : warning : not initialized in SW_AEROAR4
+      zsolsw0_aero(i,:) = 0. !ym missing init : warning : not initialized in SW_AEROAR4
       ENDDO
 !     print *,'Avant SW_LMDAR4: PSCT zrmu0 zfract',PSCT, zrmu0, zfract
Index: /LMDZ6/branches/DYNAMICO-conv/libf/phylmd/rrtm/suinit.F90
===================================================================
--- /LMDZ6/branches/DYNAMICO-conv/libf/phylmd/rrtm/suinit.F90	(revision 3354)
+++ /LMDZ6/branches/DYNAMICO-conv/libf/phylmd/rrtm/suinit.F90	(revision 3355)
@@ -126,5 +126,7 @@
 ALLOCATE(VDELA  (MAX(JPMXLE,NFLEVG)))
 ALLOCATE(VDELB  (MAX(JPMXLE,NFLEVG)))
+VDELB = 0  !ym missing init
 ALLOCATE( VC      (NFLEVG) )
+VC = 0    !ym missing init
 ALLOCATE( NLOEN   (NPROMA) )
 ALLOCATE( NLOENG   (NPROMA) )
