Index: LMDZ6/branches/DYNAMICO-conv/libf/phylmd/phys_output_write_mod.F90
===================================================================
--- LMDZ6/branches/DYNAMICO-conv/libf/phylmd/phys_output_write_mod.F90	(revision 3356)
+++ LMDZ6/branches/DYNAMICO-conv/libf/phylmd/phys_output_write_mod.F90	(revision 3411)
@@ -14,5 +14,5 @@
 CONTAINS 
 
-  ! ug Routine pour définir (lors du premier passage) ET sortir les variables
+  ! ug Routine pour définir (los du premier passageà) ET sortir les variables
   SUBROUTINE phys_output_write(itap, pdtphys, paprs, pphis, &
        pplay, lmax_th, aerosol_couple,         &
@@ -31,5 +31,4 @@
     USE vertical_layers_mod, ONLY : ap, bp, aps, bps
     USE phys_output_ctrlout_mod, ONLY: o_phis, o_aire, is_ter, is_lic, is_oce, &
-         o_longitude, o_latitude, &
          o_Ahyb, o_Bhyb,o_Ahyb_inter, o_Bhyb_inter, & 
          is_ave, is_sic, o_contfracATM, o_contfracOR, &
@@ -40,8 +39,8 @@
          o_wind10m, o_wind10max, o_gusts, o_sicf, &
          o_psol, o_mass, o_qsurf, o_qsol, &
-         o_precip, o_rain_fall, o_rain_con, o_ndayrain, o_plul, o_pluc, o_plun, &
+         o_precip, o_ndayrain, o_plul, o_pluc, o_plun, &
          o_snow, o_msnow, o_fsnow, o_evap, o_ep,o_epmax_diag, & ! epmax_cape
          o_tops, o_tops0, o_topl, o_topl0, &
-         o_SWupTOA, o_SWupTOAclr, o_SWupTOAcleanclr, o_SWdnTOA, &
+         o_SWupTOA, o_SWupTOAclr, o_SWdnTOA, &
          o_SWdnTOAclr, o_nettop, o_SWup200, &
          o_SWup200clr, o_SWdn200, o_SWdn200clr, &
@@ -49,10 +48,10 @@
          o_LWdn200clr, o_sols, o_sols0, &
          o_soll, o_radsol, o_soll0, o_SWupSFC, &
-         o_SWupSFCclr, o_SWupSFCcleanclr, o_SWdnSFC, o_SWdnSFCclr, o_SWdnSFCcleanclr, &
+         o_SWupSFCclr, o_SWdnSFC, o_SWdnSFCclr, &
          o_LWupSFC, o_LWdnSFC, o_LWupSFCclr, &
-         o_LWdnSFCclr, o_LWupTOAcleanclr, o_LWdnSFCcleanclr, o_bils, o_bils_diss, &
+         o_LWdnSFCclr, o_bils, o_bils_diss, &
          o_bils_ec,o_bils_ech, o_bils_tke, o_bils_kinetic, &
          o_bils_latent, o_bils_enthalp, o_sens, &
-         o_fder, o_ffonte, o_fqcalving, o_fqfonte, o_mrroli, o_runofflic, &
+         o_fder, o_ffonte, o_fqcalving, o_fqfonte, o_runofflic, &
          o_taux, o_tauy, o_snowsrf, o_qsnow, &
          o_snowhgt, o_toice, o_sissnow, o_runoff, &
@@ -70,8 +69,7 @@
          o_cldhjn, o_cldtjn, o_cldq, o_lwp, o_iwp, &
          o_ue, o_ve, o_uq, o_vq, o_cape, o_pbase, &
-         o_uwat, o_vwat, &
          o_ptop, o_fbase, o_plcl, o_plfc, &
          o_wbeff, o_convoccur, o_cape_max, o_upwd, o_ep,o_epmax_diag, o_Ma, &
-         o_dnwd, o_dnwd0, o_ftime_deepcv, o_ftime_con, o_mc, &
+         o_dnwd, o_dnwd0, o_ftime_con, o_mc, &
          o_prw, o_prlw, o_prsw, o_s_pblh, o_s_pblt, o_s_lcl, &
          o_s_therm, o_uSTDlevs, o_vSTDlevs, &
@@ -84,5 +82,5 @@
          o_cdragh_x   , o_cdragh_w   , o_cdragm_x   , o_cdragm_w   , &
          o_kh         , o_kh_x       , o_kh_w       , &
-         o_ale, o_alp, o_cin, o_WAPE, o_wake_h, o_cv_gen, o_wake_dens, &
+         o_ale, o_alp, o_cin, o_WAPE, o_wake_h, &
          o_wake_s, o_wake_deltat, o_wake_deltaq, &
          o_wake_omg, o_dtwak, o_dqwak, o_dqwak2d, o_Vprecip, &
@@ -99,7 +97,7 @@
          o_cldemi, o_pr_con_l, o_pr_con_i, &
          o_pr_lsc_l, o_pr_lsc_i, o_re, o_fl, &
-         o_rh2m, &
+         o_rh2m, o_rh2m_min, o_rh2m_max, &
          o_qsat2m, o_tpot, o_tpote, o_SWnetOR, &
-         o_LWdownOR, o_snowl, &
+         o_SWdownOR, o_LWdownOR, o_snowl, &
          o_solldown, o_dtsvdfo, o_dtsvdft, &
          o_dtsvdfg, o_dtsvdfi, o_z0m, o_z0h,  o_od443aer, o_od550aer, &
@@ -121,8 +119,7 @@
          o_swtoacf_zero, o_swsrfcf_zero, &
          o_topswai, o_solswai, o_toplwai, o_sollwai, o_scdnc, &
-         o_cldncl, o_reffclws, o_reffclwc, o_solbnd, o_stratomask,&
+         o_cldncl, o_reffclws, o_reffclwc, o_stratomask,&
          o_cldnvi, o_lcc, o_lcc3d, o_lcc3dcon, &
-         o_lcc3dstra, o_icc3dcon, o_icc3dstra, &
-         o_cldicemxrat, o_cldwatmxrat, o_reffclwtop, o_ec550aer, &
+         o_lcc3dstra, o_reffclwtop, o_ec550aer, &
          o_lwcon, o_iwcon, o_temp, o_theta, &
          o_ovapinit, o_ovap, o_oliq, o_ocond, o_geop, &
@@ -156,5 +153,5 @@
          o_du_gwd_front, o_dv_gwd_front, &
          o_east_gwstress, o_west_gwstress, &
-         o_rsd, o_rlu, o_rld, o_rsucs, o_rsdcs, o_rsucsaf, o_rsdcsaf, &
+         o_rsd, o_rlu, o_rld, o_rsucs, o_rsdcs, &
          o_rlucs, o_rldcs, o_tnt, o_tntr, &
          o_tntscpbl, o_tnhus, o_tnhusscpbl, &
@@ -169,7 +166,4 @@
          o_uxv, o_vxq, o_vxT, o_wxq, o_vxphi, &
          o_wxT, o_uxu, o_vxv, o_TxT, o_trac, &
-#ifdef REPROBUS
-         o_nas, &
-#endif
          o_dtr_vdf, o_dtr_the, o_dtr_con, &
          o_dtr_lessi_impa, o_dtr_lessi_nucl, &
@@ -183,5 +177,4 @@
          o_lat_prec_liq_oce, o_lat_prec_liq_sic, &
          o_lat_prec_sol_oce, o_lat_prec_sol_sic, &
-         o_sza, &
 ! Marine
          o_map_prop_hc, o_map_prop_hist, o_map_emis_hc, o_map_iwp_hc, &
@@ -204,6 +197,4 @@
          o_budg_sed_part, o_R2SO4, o_OCS_lifetime, o_SO2_lifetime, &
          o_budg_3D_backgr_ocs, o_budg_3D_backgr_so2, & 
-         o_budg_dep_dry_ocs, o_budg_dep_wet_ocs, &
-         o_budg_dep_dry_so2, o_budg_dep_wet_so2, &
          o_budg_dep_dry_h2so4, o_budg_dep_wet_h2so4, &
          o_budg_dep_dry_part, o_budg_dep_wet_part, & 
@@ -218,21 +209,20 @@
          nday_rain, rain_con, snow_con, &
          topsw, toplw, toplw0, swup, swdn, &
-         topsw0, swupc0, swdnc0, swup0, swdn0, SWup200, SWup200clr, &
+         topsw0, swup0, swdn0, SWup200, SWup200clr, &
          SWdn200, SWdn200clr, LWup200, LWup200clr, &
          LWdn200, LWdn200clr, solsw, solsw0, sollw, &
          radsol, swradcorr, sollw0, sollwdown, sollw, gustiness, &
-         sollwdownclr, lwdnc0, lwdn0, ftsol, ustar, u10m, &
+         sollwdownclr, lwdn0, ftsol, ustar, u10m, &
          v10m, pbl_tke, wake_delta_pbl_TKE, &
          delta_tsurf, &
          wstar, cape, ema_pcb, ema_pct, &
          ema_cbmf, Ma, fm_therm, ale_bl, alp_bl, ale, &
-         alp, cin, wake_pe, wake_dens, wake_s, wake_deltat, &
+         alp, cin, wake_pe, wake_s, wake_deltat, &
          wake_deltaq, ftd, fqd, ale_bl_trig, albsol1, &
-         ale_wake, ale_bl_stat, &
          rnebcon, wo, falb1, albsol2, coefh, clwcon0, &
          ratqs, entr_therm, zqasc, detr_therm, f0, &
-         lwup, lwdn, lwupc0, lwup0, coefm, &
-         swupp, lwupp, swupc0p, swup0p, lwupc0p, lwup0p, swdnp, lwdnp, &
-         swdnc0p, swdn0p, lwdnc0p, lwdn0p, tnondef, O3sumSTD, uvsumSTD, &
+         lwup, lwdn, lwup0, coefm, &
+         swupp, lwupp, swup0p, lwup0p, swdnp, lwdnp, &
+         swdn0p, lwdn0p, tnondef, O3sumSTD, uvsumSTD, &
          vqsumSTD, vTsumSTD, O3daysumSTD, wqsumSTD, &
          vphisumSTD, wTsumSTD, u2sumSTD, v2sumSTD, &
@@ -255,18 +245,16 @@
          cldh, cldt, JrNt, cldljn, cldmjn, cldhjn, &
          cldtjn, cldq, flwp, fiwp, ue, ve, uq, vq, &
-         uwat, vwat, &
          plcl, plfc, wbeff, convoccur, upwd, dnwd, dnwd0, prw, prlw, prsw, &
          s_pblh, s_pblt, s_lcl, s_therm, uwriteSTD, &
          vwriteSTD, wwriteSTD, phiwriteSTD, qwriteSTD, &
-         twriteSTD, alp_wake, &
-!!         dtvdf_x    ,dtvdf_w    ,dqvdf_x    ,dqvdf_w    , &
-         d_t_vdf_x    ,d_t_vdf_w    ,d_q_vdf_x    ,d_q_vdf_w    , &
+         twriteSTD, ale_wake, alp_wake, &
+         dtvdf_x    ,dtvdf_w    ,dqvdf_x    ,dqvdf_w    , &
          sens_x     ,sens_w     ,zxfluxlat_x,zxfluxlat_w, &
          cdragh_x   ,cdragh_w   ,cdragm_x   ,cdragm_w   , &
          kh         ,kh_x       ,kh_w       , &
-         cv_gen, wake_h, &
+         wake_h, &
          wake_omg, d_t_wake, d_q_wake, Vprecip, &
          wdtrainA, wdtrainM, n2, s2, proba_notrig, &
-         random_notrig, &
+         random_notrig, ale_bl_stat, &
          alp_bl_det, alp_bl_fluct_m, alp_bl_conv, &
          alp_bl_stat, alp_bl_fluct_tke, slab_wfbils, &
@@ -285,6 +273,5 @@
          sollwad0_aero, toplwai_aero, sollwai_aero, &
          scdnc, cldncl, reffclws, reffclwc, cldnvi, stratomask,&
-         lcc, lcc3d, lcc3dcon, lcc3dstra, &
-         icc3dcon, icc3dstra, zfice, reffclwtop, &
+         lcc, lcc3d, lcc3dcon, lcc3dstra, reffclwtop, &
          ec550aer, flwc, fiwc, t_seri, theta, q_seri, &
          ql_seri, qs_seri, tr_seri, &
@@ -314,6 +301,4 @@
          budg_sed_part, R2SO4, OCS_lifetime, SO2_lifetime, &
          budg_3D_backgr_ocs, budg_3D_backgr_so2, & 
-         budg_dep_dry_ocs, budg_dep_wet_ocs, &
-         budg_dep_dry_so2, budg_dep_wet_so2, &
          budg_dep_dry_h2so4, budg_dep_wet_h2so4, &
          budg_dep_dry_part, budg_dep_wet_part, &
@@ -324,13 +309,9 @@
 #endif
 
-#ifdef REPROBUS
-    USE CHEM_REP, ONLY : nas, nbnas, tnamenas, ttextnas
-#endif
-
     USE phys_output_var_mod, ONLY: vars_defined, snow_o, zfra_o, bils_diss, &
          bils_ec,bils_ech, bils_tke, bils_kinetic, bils_latent, bils_enthalp, &
          itau_con, nfiles, clef_files, nid_files, dryaod_diag, &
          zustr_gwd_hines, zvstr_gwd_hines,zustr_gwd_rando, zvstr_gwd_rando, &
-         zustr_gwd_front, zvstr_gwd_front, sza_o,    &
+         zustr_gwd_front, zvstr_gwd_front,     &
          sens_prec_liq_o, sens_prec_sol_o, lat_prec_liq_o, lat_prec_sol_o, &
          cloudth_sth,cloudth_senv,cloudth_sigmath,cloudth_sigmaenv, &
@@ -355,5 +336,5 @@
     USE indice_sol_mod, ONLY: nbsrf
     USE infotrac_phy, ONLY: nqtot, nqo, type_trac, tname, niadv
-    USE geometry_mod, ONLY: cell_area, latitude_deg, longitude_deg
+    USE geometry_mod, ONLY: cell_area
     USE surface_data, ONLY: type_ocean, version_ocean, ok_veget, ok_snow
     USE aero_mod, ONLY: naero_tot, id_STRAT_phy
@@ -405,8 +386,7 @@
     INTEGER :: itau_w
     INTEGER :: i, iinit, iinitend=1, iff, iq, iiq, nsrf, k, ll, naero
-    REAL, DIMENSION (klon) :: zx_tmp_fi2d, zpt_conv2d
+    REAL, DIMENSION (klon) :: zx_tmp_fi2d
     REAL, DIMENSION (klon,klev) :: zx_tmp_fi3d, zpt_conv
     REAL, DIMENSION (klon,klev+1) :: zx_tmp_fi3d1
-    REAL, DIMENSION (klon,NSW) :: zx_tmp_fi3dsp
     CHARACTER (LEN=4)              :: bb2
     INTEGER, DIMENSION(nbp_lon*nbp_lat)  :: ndex2d
@@ -570,6 +550,4 @@
        CALL histwrite_phy(o_Ahyb_inter, Ahyb_bounds)
        CALL histwrite_phy(o_Bhyb_inter, Bhyb_bounds)
-       CALL histwrite_phy(o_longitude, longitude_deg)
-       CALL histwrite_phy(o_latitude, latitude_deg)
 !
 #ifdef CPP_RRTM
@@ -631,5 +609,4 @@
      ENDIF
 
-       CALL histwrite_phy(o_sza, sza_o)
        CALL histwrite_phy(o_flat, zxfluxlat)
        CALL histwrite_phy(o_ptstar, ptstar)
@@ -690,5 +667,4 @@
 
        CALL histwrite_phy(o_precip, zx_tmp_fi2d)
-       CALL histwrite_phy(o_rain_fall, rain_fall)
        CALL histwrite_phy(o_ndayrain, nday_rain)
 
@@ -711,5 +687,4 @@
        ENDIF
        CALL histwrite_phy(o_pluc, zx_tmp_fi2d)
-       CALL histwrite_phy(o_rain_con, rain_con)
        CALL histwrite_phy(o_snow, snow_fall)
        CALL histwrite_phy(o_msnow, zxsnow)
@@ -739,9 +714,4 @@
        ENDIF
        CALL histwrite_phy(o_SWupTOAclr, zx_tmp_fi2d)
-
-       IF (vars_defined) THEN
-          zx_tmp_fi2d(:) = swupc0(:,klevp1)*swradcorr(:)
-       ENDIF
-       CALL histwrite_phy(o_SWupTOAcleanclr, zx_tmp_fi2d)
 
        IF (vars_defined) THEN
@@ -811,9 +781,4 @@
 
        IF (vars_defined) THEN
-          zx_tmp_fi2d(:) = swupc0(:,1)*swradcorr(:)
-       ENDIF
-       CALL histwrite_phy(o_SWupSFCcleanclr, zx_tmp_fi2d)
-
-       IF (vars_defined) THEN
           zx_tmp_fi2d(:) = swdn(:,1)*swradcorr(:)
        ENDIF
@@ -824,9 +789,4 @@
        ENDIF
        CALL histwrite_phy(o_SWdnSFCclr, zx_tmp_fi2d)
-
-       IF (vars_defined) THEN
-          zx_tmp_fi2d(:) = swdnc0(:,1)*swradcorr(:)
-       ENDIF
-       CALL histwrite_phy(o_SWdnSFCcleanclr, zx_tmp_fi2d)
 
        IF (vars_defined) THEN
@@ -842,14 +802,4 @@
        CALL histwrite_phy(o_LWupSFCclr, zx_tmp_fi2d)
        CALL histwrite_phy(o_LWdnSFCclr, sollwdownclr)
-
-       IF (vars_defined) THEN
-          zx_tmp_fi2d(:) = lwupc0(:,klevp1)
-       ENDIF
-       CALL histwrite_phy(o_LWupTOAcleanclr, zx_tmp_fi2d)
-       IF (vars_defined) THEN
-          zx_tmp_fi2d(:) = -1.*lwdnc0(:,1)
-       ENDIF
-       CALL histwrite_phy(o_LWdnSFCcleanclr, zx_tmp_fi2d)
-
        CALL histwrite_phy(o_bils, bils)
        CALL histwrite_phy(o_bils_diss, bils_diss)
@@ -869,8 +819,4 @@
        CALL histwrite_phy(o_fqcalving, zxfqcalving)
        CALL histwrite_phy(o_fqfonte, zxfqfonte)
-       IF (vars_defined) THEN
-          zx_tmp_fi2d(1:klon)=(zxfqfonte(1:klon)+rain_fall(1:klon))*pctsrf(1:klon,is_lic)
-       ENDIF
-       CALL histwrite_phy(o_mrroli, zx_tmp_fi2d)
        CALL histwrite_phy(o_runofflic, zxrunofflic)
        IF (vars_defined) THEN
@@ -1012,6 +958,4 @@
        CALL histwrite_phy(o_uq, uq)
        CALL histwrite_phy(o_vq, vq)
-       CALL histwrite_phy(o_uwat, uwat)
-       CALL histwrite_phy(o_vwat, vwat)
        IF (iflag_con.GE.3) THEN ! sb
           CALL histwrite_phy(o_cape, cape)
@@ -1032,13 +976,11 @@
           CALL histwrite_phy(o_dnwd, dnwd)
           CALL histwrite_phy(o_dnwd0, dnwd0)
-          !! The part relative to the frequency of occurence of convection
-          !! is now grouped with the part relative to thermals and shallow
-          !! convection (output of the 3 fields: ftime_deepcv, ftime_th and
-          !!  ftime_con).
+          IF (vars_defined)         zx_tmp_fi2d=float(itau_con)/float(itap)
+          CALL histwrite_phy(o_ftime_con, zx_tmp_fi2d)
           IF (vars_defined) THEN
              IF (iflag_thermals>=1)THEN
-                zx_tmp_fi3d=-dnwd+dnwd0+upwd+fm_therm(:,1:klev)
+                zx_tmp_fi3d=dnwd+dnwd0+upwd+fm_therm(:,1:klev)
              ELSE
-                zx_tmp_fi3d=-dnwd+dnwd0+upwd
+                zx_tmp_fi3d=dnwd+dnwd0+upwd
              ENDIF
           ENDIF
@@ -1157,13 +1099,13 @@
              CALL histwrite_phy(o_alp_wk, alp_wake)
              IF (iflag_pbl_split>=1) THEN
-               IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_vdf_x(1:klon,1:klev)/pdtphys
-               CALL histwrite_phy(o_dtvdf_x    ,zx_tmp_fi3d)
-               IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_vdf_w(1:klon,1:klev)/pdtphys
-               CALL histwrite_phy(o_dtvdf_w    ,zx_tmp_fi3d)
-               IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_q_vdf_x(1:klon,1:klev)/pdtphys
-               CALL histwrite_phy(o_dqvdf_x    ,zx_tmp_fi3d)
-               IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_q_vdf_w(1:klon,1:klev)/pdtphys
-
-!
+               !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) 
+               IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=dtvdf_w(1:klon,1:klev)/pdtphys
+               CALL histwrite_phy(o_dtvdf_w    ,zx_tmp_fi3d) 
+               IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=dqvdf_x(1:klon,1:klev)/pdtphys
+               CALL histwrite_phy(o_dqvdf_x    ,zx_tmp_fi3d) 
+               IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=dqvdf_w(1:klon,1:klev)/pdtphys
                CALL histwrite_phy(o_dqvdf_w    ,zx_tmp_fi3d) 
                CALL histwrite_phy(o_sens_x     ,sens_x     ) 
@@ -1184,7 +1126,5 @@
              CALL histwrite_phy(o_cin, cin)
              CALL histwrite_phy(o_WAPE, wake_pe)
-             CALL histwrite_phy(o_cv_gen, cv_gen)
              CALL histwrite_phy(o_wake_h, wake_h)
-             CALL histwrite_phy(o_wake_dens, wake_dens)
              CALL histwrite_phy(o_wake_s, wake_s)
              CALL histwrite_phy(o_wake_deltat, wake_deltat)
@@ -1281,17 +1221,17 @@
        CALL histwrite_phy(o_rh2m, zx_tmp_fi2d)
 
-!       IF (vars_defined) THEN
-!          DO i=1, klon
-!             zx_tmp_fi2d(i)=MIN(100.,rh2m(i)*100.)
-!          ENDDO
-!       ENDIF
-!       CALL histwrite_phy(o_rh2m_min, zx_tmp_fi2d)
-
-!       IF (vars_defined) THEN
-!          DO i=1, klon
-!             zx_tmp_fi2d(i)=MIN(100.,rh2m(i)*100.)
-!          ENDDO
-!       ENDIF
-!       CALL histwrite_phy(o_rh2m_max, zx_tmp_fi2d)
+       IF (vars_defined) THEN
+          DO i=1, klon
+             zx_tmp_fi2d(i)=MIN(100.,rh2m(i)*100.)
+          ENDDO
+       ENDIF
+       CALL histwrite_phy(o_rh2m_min, zx_tmp_fi2d)
+
+       IF (vars_defined) THEN
+          DO i=1, klon
+             zx_tmp_fi2d(i)=MIN(100.,rh2m(i)*100.)
+          ENDDO
+       ENDIF
+       CALL histwrite_phy(o_rh2m_max, zx_tmp_fi2d)
 
        CALL histwrite_phy(o_qsat2m, qsat2m)
@@ -1300,4 +1240,6 @@
        IF (vars_defined) zx_tmp_fi2d(1 : klon) = fsolsw( 1 : klon, is_ter)
        CALL histwrite_phy(o_SWnetOR,  zx_tmp_fi2d)
+       IF (vars_defined) zx_tmp_fi2d(1:klon) = solsw(1:klon)/(1.-albsol1(1:klon))
+       CALL histwrite_phy(o_SWdownOR,  zx_tmp_fi2d)
        CALL histwrite_phy(o_LWdownOR, sollwdown)
        CALL histwrite_phy(o_snowl, snow_lsc)
@@ -1388,8 +1330,4 @@
           CALL histwrite_phy(o_budg_3D_nucl,         budg_3D_nucl)
           CALL histwrite_phy(o_budg_3D_cond_evap,    budg_3D_cond_evap)
-          CALL histwrite_phy(o_budg_dep_dry_ocs,     budg_dep_dry_ocs)
-          CALL histwrite_phy(o_budg_dep_wet_ocs,     budg_dep_wet_ocs)
-          CALL histwrite_phy(o_budg_dep_dry_so2,     budg_dep_dry_so2)
-          CALL histwrite_phy(o_budg_dep_wet_so2,     budg_dep_wet_so2)
           CALL histwrite_phy(o_budg_dep_dry_h2so4,   budg_dep_dry_h2so4)
           CALL histwrite_phy(o_budg_dep_wet_h2so4,   budg_dep_wet_h2so4)
@@ -1497,9 +1435,4 @@
           CALL histwrite_phy(o_lcc3dcon, lcc3dcon)
           CALL histwrite_phy(o_lcc3dstra, lcc3dstra)
-          CALL histwrite_phy(o_icc3dcon, icc3dcon)
-          CALL histwrite_phy(o_icc3dstra, icc3dstra)
-          CALL histwrite_phy(o_cldicemxrat, zfice)
-          zx_tmp_fi3d(:,:)=1-zfice(:,:)
-          CALL histwrite_phy(o_cldwatmxrat, zx_tmp_fi3d)
           CALL histwrite_phy(o_reffclwtop, reffclwtop)
        ENDIF
@@ -1529,19 +1462,4 @@
        CALL histwrite_phy(o_zfull,zx_tmp_fi3d)
 
-#ifdef CPP_XIOS
-!solbnd begin
-#ifdef CPP_RRTM
-      IF (iflag_rrtm.EQ.1) THEN
-       IF (vars_defined) THEN
-        DO ISW=1, NSW
-          zx_tmp_fi3dsp(:,ISW) = swdn(:,klevp1)*swradcorr(:)*RSUN(ISW)
-        ENDDO
-        CALL histwrite_phy(o_solbnd, zx_tmp_fi3dsp)
-       ENDIF
-      ENDIF
-#endif
-!solbnd end
-#endif
-
        IF (flag_aerosol_strat.EQ.2) THEN
          CALL histwrite_phy(o_stratomask, stratomask)
@@ -1552,7 +1470,7 @@
         DO k = 2, klev
          DO i = 1, klon
-            zx_tmp_fi3d(i,k) = zphi(i,k-1)/RG + &
+            zx_tmp_fi3d(i,k) = zphi(i,k)/RG + &
                           (zphi(i,k)-zphi(i,k-1))/RG * &
-                          (paprs(i,k)-pplay(i,k-1))/(pplay(i,k)-pplay(i,k-1))
+                          (paprs(i,k)-pplay(i,k))/(pplay(i,k)-pplay(i,k-1))
          ENDDO
         ENDDO
@@ -1724,10 +1642,4 @@
           CALL histwrite_phy(o_plulst, plul_st)
           IF (vars_defined) THEN
-             do i=1,klon
-                zx_tmp_fi2d(1:klon)=lmax_th(:)
-             enddo
-          ENDIF
-          CALL histwrite_phy(o_lmaxth, zx_tmp_fi2d)
-          IF (vars_defined) THEN
              DO k=1,klev
                 DO i=1,klon
@@ -1741,29 +1653,11 @@
           ENDIF
           CALL histwrite_phy(o_ptconvth, zx_tmp_fi3d)
+          IF (vars_defined) THEN
+             do i=1,klon
+                zx_tmp_fi2d(1:klon)=lmax_th(:)
+             enddo
+          ENDIF
+          CALL histwrite_phy(o_lmaxth, zx_tmp_fi2d)
        ENDIF ! iflag_thermals>=1
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-       zpt_conv = 0.
-       WHERE (ptconv) zpt_conv = 1.
-       CALL histwrite_phy(o_ptconv, zpt_conv)
-!!       IF (vars_defined)         zx_tmp_fi2d=float(itau_con)/float(itap)
-!!       CALL histwrite_phy(o_ftime_con, zx_tmp_fi2d)
-       IF (vars_defined) THEN
-          zpt_conv2d(:) = 0.
-          DO k=1,klev
-            WHERE (ptconv(:,k)) zpt_conv2d(:) = 1.
-          ENDDO
-       ENDIF
-       CALL histwrite_phy(o_ftime_deepcv, zpt_conv2d)
-       IF (vars_defined) THEN
-          zx_tmp_fi2d(:) = 0.
-          DO k=1,klev
-            WHERE (ptconvth(:,k)) zx_tmp_fi2d(:) = 1.
-          ENDDO
-       ENDIF
-       CALL histwrite_phy(o_ftime_th, zx_tmp_fi2d)
-       IF (vars_defined) THEN
-           zx_tmp_fi2d(:) = max(zx_tmp_fi2d(:),zpt_conv2d(:))
-       ENDIF
-       CALL histwrite_phy(o_ftime_con, zx_tmp_fi2d)
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_vdf(1:klon,1:klev)/pdtphys
@@ -1781,4 +1675,7 @@
        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.
+       WHERE (ptconv) zpt_conv = 1.
+       CALL histwrite_phy(o_ptconv, zpt_conv)
        CALL histwrite_phy(o_ratqs, ratqs)
        IF (vars_defined) THEN
@@ -1798,7 +1695,6 @@
        IF (iflag_thermals>=1) THEN
           ! Pour l instant 0 a y reflichir pour les thermiques
-          ! regroupe avec ftime_deepcv et ftime_con
-          !!zx_tmp_fi2d=0. 
-          !!CALL histwrite_phy(o_ftime_th, zx_tmp_fi2d)
+          zx_tmp_fi2d=0. 
+          CALL histwrite_phy(o_ftime_th, zx_tmp_fi2d)
           CALL histwrite_phy(o_f_th, fm_therm)
           CALL histwrite_phy(o_e_th, entr_therm)
@@ -1932,8 +1828,4 @@
        ENDIF
        CALL histwrite_phy(o_rsdcs, zx_tmp_fi3d1)
-       DO k=1, klevp1
-         zx_tmp_fi3d1(:,k)=swdnc0(:,k)*swradcorr(:)
-       ENDDO
-       CALL histwrite_phy(o_rsdcsaf, zx_tmp_fi3d1)
 
        CALL histwrite_phy(o_rlu, lwup)
@@ -2170,20 +2062,20 @@
             IF (type_trac == 'lmdz' .OR. type_trac == 'repr' .OR. type_trac == 'coag') THEN
              !--3D fields
-             CALL histwrite_phy(o_trac(iq-nqo), tr_seri(:,:,iq-nqo))
-             CALL histwrite_phy(o_dtr_vdf(iq-nqo),d_tr_cl(:,:,iq-nqo))
-             CALL histwrite_phy(o_dtr_the(iq-nqo),d_tr_th(:,:,iq-nqo))
-             CALL histwrite_phy(o_dtr_con(iq-nqo),d_tr_cv(:,:,iq-nqo))
-             CALL histwrite_phy(o_dtr_lessi_impa(iq-nqo),d_tr_lessi_impa(:,:,iq-nqo))
-             CALL histwrite_phy(o_dtr_lessi_nucl(iq-nqo),d_tr_lessi_nucl(:,:,iq-nqo))
-             CALL histwrite_phy(o_dtr_insc(iq-nqo),d_tr_insc(:,:,iq-nqo))
-             CALL histwrite_phy(o_dtr_bcscav(iq-nqo),d_tr_bcscav(:,:,iq-nqo))
-             CALL histwrite_phy(o_dtr_evapls(iq-nqo),d_tr_evapls(:,:,iq-nqo))
-             CALL histwrite_phy(o_dtr_ls(iq-nqo),d_tr_ls(:,:,iq-nqo))
-             CALL histwrite_phy(o_dtr_trsp(iq-nqo),d_tr_trsp(:,:,iq-nqo))
-             CALL histwrite_phy(o_dtr_sscav(iq-nqo),d_tr_sscav(:,:,iq-nqo))
-             CALL histwrite_phy(o_dtr_sat(iq-nqo),d_tr_sat(:,:,iq-nqo))
-             CALL histwrite_phy(o_dtr_uscav(iq-nqo),d_tr_uscav(:,:,iq-nqo))
+!             CALL histwrite_phy(o_trac(iq-nqo), tr_seri(:,:,iq-nqo))
+!             CALL histwrite_phy(o_dtr_vdf(iq-nqo),d_tr_cl(:,:,iq-nqo))
+!             CALL histwrite_phy(o_dtr_the(iq-nqo),d_tr_th(:,:,iq-nqo))
+!             CALL histwrite_phy(o_dtr_con(iq-nqo),d_tr_cv(:,:,iq-nqo))
+!             CALL histwrite_phy(o_dtr_lessi_impa(iq-nqo),d_tr_lessi_impa(:,:,iq-nqo))
+!             CALL histwrite_phy(o_dtr_lessi_nucl(iq-nqo),d_tr_lessi_nucl(:,:,iq-nqo))
+!             CALL histwrite_phy(o_dtr_insc(iq-nqo),d_tr_insc(:,:,iq-nqo))
+!             CALL histwrite_phy(o_dtr_bcscav(iq-nqo),d_tr_bcscav(:,:,iq-nqo))
+!             CALL histwrite_phy(o_dtr_evapls(iq-nqo),d_tr_evapls(:,:,iq-nqo))
+!             CALL histwrite_phy(o_dtr_ls(iq-nqo),d_tr_ls(:,:,iq-nqo))
+!             CALL histwrite_phy(o_dtr_trsp(iq-nqo),d_tr_trsp(:,:,iq-nqo))
+!             CALL histwrite_phy(o_dtr_sscav(iq-nqo),d_tr_sscav(:,:,iq-nqo))
+!             CALL histwrite_phy(o_dtr_sat(iq-nqo),d_tr_sat(:,:,iq-nqo))
+!             CALL histwrite_phy(o_dtr_uscav(iq-nqo),d_tr_uscav(:,:,iq-nqo))
              !--2D fields
-             CALL histwrite_phy(o_dtr_dry(iq-nqo), flux_tr_dry(:,iq-nqo))
+!             CALL histwrite_phy(o_dtr_dry(iq-nqo), flux_tr_dry(:,iq-nqo))
              zx_tmp_fi2d=0.
              IF (vars_defined) THEN
@@ -2192,19 +2084,8 @@
                 ENDDO
              ENDIF
-#ifndef REPROBUS
-             CALL histwrite_phy(o_trac_cum(iq-nqo), zx_tmp_fi2d)
-#endif
+!             CALL histwrite_phy(o_trac_cum(iq-nqo), zx_tmp_fi2d)
             ENDIF
           ENDDO
        ENDIF
-
-       IF (type_trac == 'repr') THEN
-#ifdef REPROBUS
-           DO iq=1,nbnas
-             CALL histwrite_phy(o_nas(iq), nas(:,:,iq))
-           ENDDO
-#endif
-       ENDIF
-
        ENDIF   !(iflag_phytrac==1)
 
