Index: /LMDZ6/branches/IPSLCM6.0.15/libf/phylmd/cosp/cosp_output_mod.F90
===================================================================
--- /LMDZ6/branches/IPSLCM6.0.15/libf/phylmd/cosp/cosp_output_mod.F90	(revision 3305)
+++ /LMDZ6/branches/IPSLCM6.0.15/libf/phylmd/cosp/cosp_output_mod.F90	(revision 3306)
@@ -342,5 +342,5 @@
 ! AI nov 2015
    CALL wxios_add_vaxis("temp", LIDAR_NTEMP, LIDAR_PHASE_TEMP)
-   CALL wxios_add_vaxis("cth16", MISR_N_CTH, MISR_CTH)
+   CALL wxios_add_vaxis("cth", MISR_N_CTH, MISR_CTH)
    CALL wxios_add_vaxis("dbze", DBZE_BINS, dbze_ax) 
    CALL wxios_add_vaxis("scatratio", SR_BINS, sratio_ax)
@@ -390,5 +390,5 @@
       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),"cth","altitude","m",MISR_N_CTH,MISR_CTH,nvertmisr(iff))
   
       CALL histvert(cosp_nidfiles(iff),"ReffIce","Effective_particle_size_Ice","microns",numMODISReffIceBins, reffICE_binCenters, &
Index: /LMDZ6/branches/IPSLCM6.0.15/libf/phylmd/cosp/cosp_output_write_mod.F90
===================================================================
--- /LMDZ6/branches/IPSLCM6.0.15/libf/phylmd/cosp/cosp_output_write_mod.F90	(revision 3305)
+++ /LMDZ6/branches/IPSLCM6.0.15/libf/phylmd/cosp/cosp_output_write_mod.F90	(revision 3306)
@@ -51,4 +51,10 @@
   integer               :: itau_wcosp, iff
   real, dimension(Npoints,PARASOL_NREFL) :: parasolcrefl, Ncref
+
+! Variables locals intermidiaires pour inverser les axes des champs 4D
+! Compatibilite avec sorties CMIP
+  real, dimension(Npoints,Nlevout,SR_BINS) :: tmp_fi4da_cfadL
+  real, dimension(Npoints,Nlevout,DBZE_BINS) :: tmp_fi4da_cfadR
+  real, dimension(Npoints,MISR_N_CTH,7) :: tmp_fi4da_misr
 
 #ifdef CPP_XIOS
@@ -158,5 +164,9 @@
 
 #ifdef CPP_XIOS
-   if (cfg%LcfadLidarsr532) CALL histwrite4d_cosp(o_cfad_lidarsr532,stlidar%cfad_sr)
+   do icl=1,SR_BINS
+      tmp_fi4da_cfadL(:,:,icl)=stlidar%cfad_sr(:,icl,:)
+   enddo
+!   if (cfg%LcfadLidarsr532) CALL histwrite4d_cosp(o_cfad_lidarsr532,stlidar%cfad_sr)
+   if (cfg%LcfadLidarsr532) CALL histwrite4d_cosp(o_cfad_lidarsr532,tmp_fi4da_cfadL)
    if (cfg%LprofSR) CALL histwrite4d_cosp(o_profSR,stlidar%profSR)                              !TIBO
 #else
@@ -210,6 +220,10 @@
    where(stradar%cfad_ze == R_UNDEF) stradar%cfad_ze = missing_val
 #ifdef CPP_XIOS
+   do icl=1,DBZE_BINS
+     tmp_fi4da_cfadR(:,:,icl)=stradar%cfad_ze(:,icl,:)
+   enddo
    if (cfg%Ldbze94) CALL histwrite4d_cosp(o_dbze94,sgradar%Ze_tot)
-   if (cfg%LcfadDbze94) CALL histwrite4d_cosp(o_cfadDbze94,stradar%cfad_ze)
+!   if (cfg%LcfadDbze94) CALL histwrite4d_cosp(o_cfadDbze94,stradar%cfad_ze)
+   if (cfg%LcfadDbze94) CALL histwrite4d_cosp(o_cfadDbze94,tmp_fi4da_cfadR)
 #else
    if (cfg%Ldbze94) then
@@ -275,5 +289,9 @@
 
 #ifdef CPP_XIOS
-   if (cfg%LclMISR) CALL histwrite4d_cosp(o_clMISR,misr%fq_MISR)
+   do icl=1,MISR_N_CTH
+      tmp_fi4da_misr(:,icl,:)=misr%fq_MISR(:,:,icl)
+   enddo
+!   if (cfg%LclMISR) CALL histwrite4d_cosp(o_clMISR,misr%fq_MISR)
+   if (cfg%LclMISR) CALL histwrite4d_cosp(o_clMISR,tmp_fi4da_misr)
 #else
    if (cfg%LclMISR) then
Index: /LMDZ6/branches/IPSLCM6.0.15/libf/phylmd/cosp/phys_cosp.F90
===================================================================
--- /LMDZ6/branches/IPSLCM6.0.15/libf/phylmd/cosp/phys_cosp.F90	(revision 3305)
+++ /LMDZ6/branches/IPSLCM6.0.15/libf/phylmd/cosp/phys_cosp.F90	(revision 3306)
@@ -343,5 +343,5 @@
 
 !+++++++++++++ Open output files and define output files axis !+++++++++++++
-    if (debut_cosp) then
+!    if (debut_cosp) then
 
       !$OMP MASTER
@@ -354,5 +354,5 @@
         debut_cosp=.false.
 !      endif ! debut_cosp
-    else
+!    else
 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
         ! Call simulator
@@ -375,5 +375,5 @@
                                cfg, gbx, vgrid, sglidar, sgradar, stlidar, stradar, & 
                                isccp, misr, modis)
-    endif !debut_cosp
+!    endif !debut_cosp
 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
         ! Deallocate memory in derived types
