Index: LMDZ4/trunk/libf/cosp/cosp.F90
===================================================================
--- LMDZ4/trunk/libf/cosp/cosp.F90	(revision 1327)
+++ LMDZ4/trunk/libf/cosp/cosp.F90	(revision 1414)
@@ -23,4 +23,5 @@
 ! OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+!!#include "cosp_defs.h"
 MODULE MOD_COSP
   USE MOD_COSP_TYPES
@@ -128,12 +129,12 @@
       !     and reff_zero    == .false.  Reff use in lidar and set to 0 for radar
   endif
-  if ((gbx%use_reff) .and. (reff_zero)) then ! Inconsistent choice. Want to use Reff but not inputs passed
-        print *, '---------- COSP ERROR ------------'
-        print *, ''
-        print *, 'use_reff==.true. but Reff is always zero'
-        print *, ''
-        print *, '----------------------------------'
-        stop
-  endif
+!  if ((gbx%use_reff) .and. (reff_zero)) then ! Inconsistent choice. Want to use Reff but not inputs passed
+!        print *, '---------- COSP ERROR ------------'
+!        print *, ''
+!        print *, 'use_reff==.true. but Reff is always zero'
+!        print *, ''
+!        print *, '----------------------------------'
+!        stop
+!  endif
   if ((.not. gbx%use_reff) .and. (reff_zero)) then ! No Reff in radar. Default in lidar
         gbx%Reff = DEFAULT_LIDAR_REFF
@@ -322,4 +323,5 @@
   integer :: Niter     ! Number of calls to cosp_simulator
   integer :: i,j,k
+  integer :: I_HYDRO
   real,dimension(:,:),pointer :: column_frac_out ! Array with one column of frac_out
   integer,parameter :: scops_debug=0    !  set to non-zero value to print out inputs for debugging in SCOPS
@@ -330,4 +332,5 @@
   real,dimension(:,:),allocatable :: frac_ls,prec_ls,frac_cv,prec_cv ! Cloud/Precipitation fraction in each model level
                                                                      ! Levels are from SURFACE to TOA
+  real,dimension(:,:),allocatable :: rho ! (Npoints, Nlevels). Atmospheric dens
   type(cosp_sghydro) :: sghydro   ! Subgrid info for hydrometeors en each iteration
 
@@ -378,6 +381,6 @@
         do k=1,Nlevels,1
             do i=1,Ncolumns,1
-                if (sgx%frac_out (j,i,Nlevels+1-k) .eq. 1) frac_ls(j,k)=frac_ls(j,k)+1.
-                if (sgx%frac_out (j,i,Nlevels+1-k) .eq. 2) frac_cv(j,k)=frac_cv(j,k)+1.
+                if (sgx%frac_out (j,i,Nlevels+1-k) == I_LSC) frac_ls(j,k)=frac_ls(j,k)+1.
+                if (sgx%frac_out (j,i,Nlevels+1-k) == I_CVC) frac_cv(j,k)=frac_cv(j,k)+1.
                 if (sgx%prec_frac(j,i,Nlevels+1-k) .eq. 1) prec_ls(j,k)=prec_ls(j,k)+1.
                 if (sgx%prec_frac(j,i,Nlevels+1-k) .eq. 2) prec_cv(j,k)=prec_cv(j,k)+1.
@@ -414,5 +417,5 @@
             !--------- Mixing ratios for clouds and Reff for Clouds and precip -------
             column_frac_out => sgx%frac_out(:,k,:)
-            where (column_frac_out == 1)     !+++++++++++ LS clouds ++++++++
+            where (column_frac_out == I_LSC)     !+++++++++++ LS clouds ++++++++
                 sghydro%mr_hydro(:,k,:,I_LSCLIQ) = gbx%mr_hydro(:,:,I_LSCLIQ)
                 sghydro%mr_hydro(:,k,:,I_LSCICE) = gbx%mr_hydro(:,:,I_LSCICE)
@@ -423,5 +426,5 @@
                 sghydro%Reff(:,k,:,I_LSSNOW)     = gbx%Reff(:,:,I_LSSNOW)
                 sghydro%Reff(:,k,:,I_LSGRPL)     = gbx%Reff(:,:,I_LSGRPL)
-            elsewhere (column_frac_out == 2) !+++++++++++ CONV clouds ++++++++
+            elsewhere (column_frac_out == I_CVC) !+++++++++++ CONV clouds ++++++++
                 sghydro%mr_hydro(:,k,:,I_CVCLIQ) = gbx%mr_hydro(:,:,I_CVCLIQ) 
                 sghydro%mr_hydro(:,k,:,I_CVCICE) = gbx%mr_hydro(:,:,I_CVCICE) 
@@ -434,9 +437,9 @@
             !--------- Precip -------
             if (.not. gbx%use_precipitation_fluxes) then
-                where (column_frac_out == 1)  !+++++++++++ LS Precipitation ++++++++
+                where (column_frac_out == I_LSC)  !+++++++++++ LS Precipitation ++++++++
                     sghydro%mr_hydro(:,k,:,I_LSRAIN) = gbx%mr_hydro(:,:,I_LSRAIN)
                     sghydro%mr_hydro(:,k,:,I_LSSNOW) = gbx%mr_hydro(:,:,I_LSSNOW)
                     sghydro%mr_hydro(:,k,:,I_LSGRPL) = gbx%mr_hydro(:,:,I_LSGRPL)
-                elsewhere (column_frac_out == 2) !+++++++++++ CONV Precipitation ++++++++
+                elsewhere (column_frac_out == I_CVC) !+++++++++++ CONV Precipitation ++++++++
                     sghydro%mr_hydro(:,k,:,I_CVRAIN) = gbx%mr_hydro(:,:,I_CVRAIN) 
                     sghydro%mr_hydro(:,k,:,I_CVSNOW) = gbx%mr_hydro(:,:,I_CVSNOW) 
@@ -488,5 +491,5 @@
                         sghydro%mr_hydro(:,:,:,I_LSRAIN),sghydro%mr_hydro(:,:,:,I_LSSNOW),sghydro%mr_hydro(:,:,:,I_LSGRPL), &
                         sghydro%mr_hydro(:,:,:,I_CVRAIN),sghydro%mr_hydro(:,:,:,I_CVSNOW))
-        endif
+       endif
    !++++++++++ CRM mode ++++++++++
    else
