Index: LMDZ5/trunk/libf/phylmd/cosp/cosp_output_mod.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/cosp/cosp_output_mod.F90	(revision 2434)
+++ LMDZ5/trunk/libf/phylmd/cosp/cosp_output_mod.F90	(revision 2447)
@@ -16,7 +16,8 @@
       INTEGER, DIMENSION(3), SAVE  :: cosp_nidfiles
 !$OMP THREADPRIVATE(cosp_outfilekeys, cosp_nidfiles)
-      INTEGER, DIMENSION(3), SAVE  :: nhoricosp,nvert,nvertmcosp,nvertcol,nvertisccp,nvertp,nverttemp,nvertmisr
+      INTEGER, DIMENSION(3), SAVE  :: nhoricosp,nvert,nvertmcosp,nvertcol,nvertbze, &
+                                      nvertsratio,nvertisccp,nvertp,nverttemp,nvertmisr
       REAL, DIMENSION(3), SAVE                :: zoutm_cosp
-!$OMP THREADPRIVATE(nhoricosp, nvert, nvertmcosp, nvertcol, nvertisccp, nvertp, zoutm_cosp, nverttemp, nvertmisr)
+!$OMP THREADPRIVATE(nhoricosp, nvert,nvertmcosp,nvertcol,nvertsratio,nvertbze,nvertisccp,nvertp,zoutm_cosp,nverttemp,nvertmisr)
       REAL, SAVE                   :: zdtimemoy_cosp
 !$OMP THREADPRIVATE(zdtimemoy_cosp) 
@@ -107,5 +108,7 @@
   TYPE(ctrl_outcosp), SAVE :: o_clcalipso2 = ctrl_outcosp((/ .TRUE., .TRUE., .TRUE. /), &
          "clcalipso2", "CALIPSO Cloud Fraction Undetected by CloudSat", "1", (/ ('', i=1, 3) /))
-
+  TYPE(ctrl_outcosp), SAVE :: o_cltlidarradar = ctrl_outcosp((/ .TRUE., .TRUE.,.TRUE. /), &          
+         "cltlidarradar", "Lidar and Radar Total Cloud Fraction", "%", (/ ('', i=1, 3) /))
+     
 ! ISCCP vars
   TYPE(ctrl_outcosp), SAVE :: o_sunlit = ctrl_outcosp((/ .TRUE., .TRUE., .TRUE. /), &
@@ -220,7 +223,9 @@
 
 !!! Variables locales
-  integer                  :: idayref, iff, ii
-  real                     :: zjulian,zjulian_start
-  real,dimension(Ncolumns) :: column_ax
+  integer                   :: idayref, iff, ii
+  real                      :: zjulian,zjulian_start
+  real,dimension(Ncolumns)  :: column_ax
+  real,dimension(2,SR_BINS) :: sratio_bounds
+  real,dimension(SR_BINS)   ::  sratio_ax
   CHARACTER(LEN=20), DIMENSION(3)  :: chfreq = (/ '1day', '1d', '3h' /)            
 
@@ -239,8 +244,23 @@
     ! Initialisations (Valeurs par defaut)
 
+!! Definition valeurs axes
     do ii=1,Ncolumns
       column_ax(ii) = real(ii)
     enddo
 
+!    do ii=1,DBZE_BINS
+!     dbze_ax(i) = CFAD_ZE_MIN + CFAD_ZE_WIDTH*(ii - 0.5)
+!    enddo
+
+!   sratio_bounds(2,:)=stlidar%srbval(:) ! srbval contains the upper
+!                                         limits from lmd_ipsl_stats.f90
+!   sratio_bounds(1,2:SR_BINS) = stlidar%srbval(1:SR_BINS-1)
+!   sratio_bounds(1,1)         = 0.0
+!   sratio_bounds(2,SR_BINS)   = 1.e5 ! This matches with Chepfer et al., JGR,
+!                                    ! 2009. However, it is not consistent 
+                                     ! with the upper limit in
+                                     ! lmd_ipsl_stats.f90, which is
+                                     ! LIDAR_UNDEF-1=998.999
+!    sratio_ax(:) = (sratio_bounds(1,:)+sratio_bounds(2,:))/2.0 
 
     cosp_outfilenames(1) = 'histmthCOSP'
@@ -303,4 +323,6 @@
    CALL wxios_add_vaxis("temp", LIDAR_NTEMP, LIDAR_PHASE_TEMP)
    CALL wxios_add_vaxis("cth16", MISR_N_CTH, MISR_CTH)
+!   CALL wxios_add_vaxis("dbze", DBZE_BINS, dbze_ax) 
+!   CALL wxios_add_vaxis("scatratio", SR_BINS, sratio_ax)
 #endif
    
@@ -343,4 +365,8 @@
       CALL histvert(cosp_nidfiles(iff),"temp","temperature","C",LIDAR_NTEMP,LIDAR_PHASE_TEMP,nverttemp(iff))                                       
       CALL histvert(cosp_nidfiles(iff),"cth16","altitude","m",MISR_N_CTH,MISR_CTH,nvertmisr(iff))                                                                                                  
+!      CALL histvert(cosp_nidfiles(iff),"dbze","equivalent_reflectivity_factor","dBZ",DBZE_BINS,dbze_ax,nvertbze(iff))
+     
+!      CALL histvert(cosp_nidfiles(iff),"scatratio","backscattering_ratio","1",SR_BINS,sratio_ax,nvertsratio(iff))
+     
 !!! Valeur indefinie en cas IOIPSL
      Cosp_fill_value=0.
Index: LMDZ5/trunk/libf/phylmd/cosp/cosp_output_write_mod.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/cosp/cosp_output_write_mod.F90	(revision 2434)
+++ LMDZ5/trunk/libf/phylmd/cosp/cosp_output_write_mod.F90	(revision 2447)
@@ -209,4 +209,7 @@
                            stradar%lidar_only_freq_cloud = 0.0
    CALL histwrite3d_cosp(o_clcalipso2,stradar%lidar_only_freq_cloud,nvert)
+   where(stradar%radar_lidar_tcc == R_UNDEF) &
+                           stradar%radar_lidar_tcc = 0.0 
+   CALL histwrite2d_cosp(o_cltlidarradar,stradar%radar_lidar_tcc)
  endif
 
