Index: src/FLEXPART_MPI.f90
===================================================================
--- src/FLEXPART_MPI.f90	(revision d6a09777de02ba48864df5a70d9160b51767c086)
+++ src/FLEXPART_MPI.f90	(revision f75967de0b4a6b0adcfa329374aefe0f1e5d3d70)
@@ -436,20 +436,20 @@
     stop
   endif
-    
 
 
   call timemanager
+
 
 ! NIK 16.02.2005 
   if (lroot) then
-    call MPI_Reduce(MPI_IN_PLACE, tot_blc_count, 1, mp_pp, MPI_SUM, id_root, &
+    call MPI_Reduce(MPI_IN_PLACE, tot_blc_count, 1, MPI_INTEGER, MPI_SUM, id_root, &
          & mp_comm_used, mp_ierr)
-    call MPI_Reduce(MPI_IN_PLACE, tot_inc_count, 1, mp_pp, MPI_SUM, id_root, &
+    call MPI_Reduce(MPI_IN_PLACE, tot_inc_count, 1, MPI_INTEGER, MPI_SUM, id_root, &
          & mp_comm_used, mp_ierr)
   else
     if (mp_partgroup_pid.ge.0) then ! Skip for readwind process 
-      call MPI_Reduce(tot_blc_count, tot_blc_count, 1, mp_pp, MPI_SUM, id_root, &
+      call MPI_Reduce(tot_blc_count, tot_blc_count, 1, MPI_INTEGER, MPI_SUM, id_root, &
            & mp_comm_used, mp_ierr)
-      call MPI_Reduce(tot_inc_count, tot_inc_count, 1, mp_pp, MPI_SUM, id_root, &
+      call MPI_Reduce(tot_inc_count, tot_inc_count, 1, MPI_INTEGER, MPI_SUM, id_root, &
            & mp_comm_used, mp_ierr)
     end if
Index: src/com_mod.f90
===================================================================
--- src/com_mod.f90	(revision d6a09777de02ba48864df5a70d9160b51767c086)
+++ src/com_mod.f90	(revision f75967de0b4a6b0adcfa329374aefe0f1e5d3d70)
@@ -132,7 +132,10 @@
 !ZHG SEP 2015 wheather or not to read clouds from GRIB
   logical :: readclouds
+!ESO DEC 2015 whether or not both clwc and ciwc are present (if so they are summed)
+  logical :: sumclouds 
+  
 
 !NIK 16.02.2015
-  integer :: tot_blc_count, tot_inc_count
+  integer :: tot_blc_count=0, tot_inc_count=0
 
 
@@ -746,5 +749,5 @@
   !*****************************************************************
   integer :: mpi_mode=0 ! .gt. 0 if running MPI version
-  logical :: lroot=.true. ! true if serial version, or if MPI and root process
+  logical :: lroot=.true. ! true if serial version, or if MPI .and. root process
 
   contains
Index: src/timemanager.f90
===================================================================
--- src/timemanager.f90	(revision d6a09777de02ba48864df5a70d9160b51767c086)
+++ src/timemanager.f90	(revision f75967de0b4a6b0adcfa329374aefe0f1e5d3d70)
@@ -138,7 +138,7 @@
 !ZHG 2015
 !CGZ-lifetime: set lifetime to 0
-  checklifetime(:,:)=0
-  species_lifetime(:,:)=0
-  print*, 'Initialized lifetime'
+  ! checklifetime(:,:)=0
+  ! species_lifetime(:,:)=0
+  ! print*, 'Initialized lifetime'
 !CGZ-lifetime: set lifetime to 0
   
@@ -422,7 +422,7 @@
         !CGZ-lifetime: output species lifetime
 !ZHG
-        write(*,*) 'Overview species lifetime in days', &
-             real((species_lifetime(:,1)/species_lifetime(:,2))/real(3600.0*24.0))
-        write(*,*) 'all info:',species_lifetime
+        ! write(*,*) 'Overview species lifetime in days', &
+        !      real((species_lifetime(:,1)/species_lifetime(:,2))/real(3600.0*24.0))
+        ! write(*,*) 'all info:',species_lifetime
 !ZHG
         !CGZ-lifetime: output species lifetime
@@ -594,10 +594,10 @@
 !ZHG 2015
                   !CGZ-lifetime: Check mass fraction left/save lifetime
-                   if(real(npart(npoint(j)))*xmass1(j,ks)/xmass(npoint(j),ks).lt.0.01.and.checklifetime(j,ks).eq.0.)then
+                   ! if(real(npart(npoint(j)))*xmass1(j,ks)/xmass(npoint(j),ks).lt.0.01.and.checklifetime(j,ks).eq.0.)then
                        !Mass below 1% of initial >register lifetime
-                       checklifetime(j,ks)=abs(itra1(j)-itramem(j))
-                       species_lifetime(ks,1)=species_lifetime(ks,1)+abs(itra1(j)-itramem(j))
-                       species_lifetime(ks,2)= species_lifetime(ks,2)+1
-                   endif
+                       ! checklifetime(j,ks)=abs(itra1(j)-itramem(j))
+                       ! species_lifetime(ks,1)=species_lifetime(ks,1)+abs(itra1(j)-itramem(j))
+                       ! species_lifetime(ks,2)= species_lifetime(ks,2)+1
+                   ! endif
                    !CGZ-lifetime: Check mass fraction left/save lifetime
 !ZHG 2015
Index: src/timemanager_mpi.f90
===================================================================
--- src/timemanager_mpi.f90	(revision d6a09777de02ba48864df5a70d9160b51767c086)
+++ src/timemanager_mpi.f90	(revision f75967de0b4a6b0adcfa329374aefe0f1e5d3d70)
@@ -151,7 +151,7 @@
 
 !CGZ-lifetime: set lifetime to 0
-  checklifetime(:,:)=0
-  species_lifetime(:,:)=0
-  print*, 'Initialized lifetime'
+  ! checklifetime(:,:)=0
+  ! species_lifetime(:,:)=0
+  ! print*, 'Initialized lifetime'
 !CGZ-lifetime: set lifetime to 0
 
@@ -564,5 +564,5 @@
         
         !CGZ-lifetime: output species lifetime
-        ! if (lroot) then
+        if (lroot) then
         !   write(*,*) 'Overview species lifetime in days', &
         !        real((species_lifetime(:,1)/species_lifetime(:,2))/real(3600.0*24.0))
@@ -573,5 +573,5 @@
         !     write (*,*) 'timemanager> starting simulation'
         !   end if
-        ! end if
+        end if
 
 45      format(i13,' SECONDS SIMULATED: ',i13, ' PARTICLES:    Uncertainty: ',3f7.3)
@@ -757,11 +757,11 @@
                    
                    !CGZ-lifetime: Check mass fraction left/save lifetime
-                   if(lroot.and.real(npart(npoint(j)))*xmass1(j,ks)/xmass(npoint(j),ks).lt.0.01.and.checklifetime(j,ks).eq.0.)then
+                   ! if(lroot.and.real(npart(npoint(j)))*xmass1(j,ks)/xmass(npoint(j),ks).lt.0.01.and.checklifetime(j,ks).eq.0.)then
                        !Mass below 1% of initial >register lifetime
-                       checklifetime(j,ks)=abs(itra1(j)-itramem(j))
-
-                       species_lifetime(ks,1)=species_lifetime(ks,1)+abs(itra1(j)-itramem(j))
-                       species_lifetime(ks,2)= species_lifetime(ks,2)+1
-                   endif
+                   !     checklifetime(j,ks)=abs(itra1(j)-itramem(j))
+
+                   !     species_lifetime(ks,1)=species_lifetime(ks,1)+abs(itra1(j)-itramem(j))
+                   !     species_lifetime(ks,2)= species_lifetime(ks,2)+1
+                   ! endif
                    !CGZ-lifetime: Check mass fraction left/save lifetime
                    
Index: src/verttransform.f90
===================================================================
--- src/verttransform.f90	(revision d6a09777de02ba48864df5a70d9160b51767c086)
+++ src/verttransform.f90	(revision f75967de0b4a6b0adcfa329374aefe0f1e5d3d70)
@@ -568,5 +568,5 @@
 
 !***********************************************************************************  
-if (readclouds) then !HG METHOD
+  if (readclouds) then !HG METHOD
 ! The method is loops all grids vertically and constructs the 3D matrix for clouds
 ! Cloud top and cloud bottom gid cells are assigned as well as the total column 
@@ -577,102 +577,103 @@
 ! to include future cloud processing by non-precipitating-clouds. 
 !***********************************************************************************
-  if (readclouds) write(*,*) 'using cloud water from ECMWF'
-  clw(:,:,:,n)=0
-  icloud_stats(:,:,:,n)=0
-  clouds(:,:,:,n)=0
-  do jy=0,nymin1
-   do ix=0,nxmin1
-    lsp=lsprec(ix,jy,1,n)
-    convp=convprec(ix,jy,1,n)
-    prec=lsp+convp
-    tot_cloud_h=0
-    ! Find clouds in the vertical
-    do kz=1, nz-1 !go from top to bottom
-     if (clwc(ix,jy,kz,n).gt.0) then      
-      ! assuming rho is in kg/m3 and hz in m gives: kg/kg * kg/m3 *m3/kg /m = m2/m3 
-      clw(ix,jy,kz,n)=(clwc(ix,jy,kz,n)*rho(ix,jy,kz,n))*(height(kz+1)-height(kz))
-      tot_cloud_h=tot_cloud_h+(height(kz+1)-height(kz)) 
-      icloud_stats(ix,jy,4,n)= icloud_stats(ix,jy,4,n)+clw(ix,jy,kz,n)          ! Column cloud water [m3/m3]
-      icloud_stats(ix,jy,3,n)= min(height(kz+1),height(kz))                     ! Cloud BOT height stats      [m]
+    write(*,*) 'using cloud water from ECMWF'
+    clw(:,:,:,n)=0
+    icloud_stats(:,:,:,n)=0
+    clouds(:,:,:,n)=0
+    do jy=0,nymin1
+      do ix=0,nxmin1
+        lsp=lsprec(ix,jy,1,n)
+        convp=convprec(ix,jy,1,n)
+        prec=lsp+convp
+        tot_cloud_h=0
+! Find clouds in the vertical
+        do kz=1, nz-1 !go from top to bottom
+          if (clwc(ix,jy,kz,n).gt.0) then      
+! assuming rho is in kg/m3 and hz in m gives: kg/kg * kg/m3 *m3/kg /m = m2/m3 
+            clw(ix,jy,kz,n)=(clwc(ix,jy,kz,n)*rho(ix,jy,kz,n))*(height(kz+1)-height(kz))
+            tot_cloud_h=tot_cloud_h+(height(kz+1)-height(kz)) 
+            icloud_stats(ix,jy,4,n)= icloud_stats(ix,jy,4,n)+clw(ix,jy,kz,n)          ! Column cloud water [m3/m3]
+            icloud_stats(ix,jy,3,n)= min(height(kz+1),height(kz))                     ! Cloud BOT height stats      [m]
 !ZHG 2015 extra for testing
-      clh(ix,jy,kz,n)=height(kz+1)-height(kz)
-      icloud_stats(ix,jy,1,n)=icloud_stats(ix,jy,1,n)+(height(kz+1)-height(kz)) ! Cloud total vertical extent [m]
-      icloud_stats(ix,jy,2,n)= max(icloud_stats(ix,jy,2,n),height(kz))          ! Cloud TOP height            [m]
+            clh(ix,jy,kz,n)=height(kz+1)-height(kz)
+            icloud_stats(ix,jy,1,n)=icloud_stats(ix,jy,1,n)+(height(kz+1)-height(kz)) ! Cloud total vertical extent [m]
+            icloud_stats(ix,jy,2,n)= max(icloud_stats(ix,jy,2,n),height(kz))          ! Cloud TOP height            [m]
 !ZHG
-    endif
-    end do
-
-   ! If Precipitation. Define removal type in the vertical
-  if ((lsp.gt.0.01).or.(convp.gt.0.01)) then ! cloud and precipitation
-
-    do kz=nz,1,-1 !go Bottom up!
-     if (clw(ix,jy,kz,n).gt. 0) then ! is in cloud
-        cloudsh(ix,jy,n)=cloudsh(ix,jy,n)+height(kz)-height(kz-1) 
-        clouds(ix,jy,kz,n)=1                               ! is a cloud
-        if (lsp.ge.convp) then
-           clouds(ix,jy,kz,n)=3                            ! lsp in-cloud
-        else
-          clouds(ix,jy,kz,n)=2                             ! convp in-cloud
-        endif                                              ! convective or large scale
-     elseif((clw(ix,jy,kz,n).le.0) .and. (icloud_stats(ix,jy,3,n).ge.height(kz)) ) then ! is below cloud
-        if (lsp.ge.convp) then
-          clouds(ix,jy,kz,n)=5                             ! lsp dominated washout
-        else
-          clouds(ix,jy,kz,n)=4                             ! convp dominated washout
-        endif                                              ! convective or large scale 
-     endif
-
-     if (height(kz).ge. 19000) then                        ! set a max height for removal
-        clouds(ix,jy,kz,n)=0
-     endif !clw>0
-    end do !nz
-   endif ! precipitation
-  end do
- end do
+          endif
+        end do
+
+! If Precipitation. Define removal type in the vertical
+        if ((lsp.gt.0.01).or.(convp.gt.0.01)) then ! cloud and precipitation
+
+          do kz=nz,1,-1 !go Bottom up!
+            if (clw(ix,jy,kz,n).gt. 0) then ! is in cloud
+              cloudsh(ix,jy,n)=cloudsh(ix,jy,n)+height(kz)-height(kz-1) 
+              clouds(ix,jy,kz,n)=1                               ! is a cloud
+              if (lsp.ge.convp) then
+                clouds(ix,jy,kz,n)=3                            ! lsp in-cloud
+              else
+                clouds(ix,jy,kz,n)=2                             ! convp in-cloud
+              endif                                              ! convective or large scale
+            elseif((clw(ix,jy,kz,n).le.0) .and. (icloud_stats(ix,jy,3,n).ge.height(kz)) ) then ! is below cloud
+              if (lsp.ge.convp) then
+                clouds(ix,jy,kz,n)=5                             ! lsp dominated washout
+              else
+                clouds(ix,jy,kz,n)=4                             ! convp dominated washout
+              endif                                              ! convective or large scale 
+            endif
+
+            if (height(kz).ge. 19000) then                        ! set a max height for removal
+              clouds(ix,jy,kz,n)=0
+            endif !clw>0
+          end do !nz
+        endif ! precipitation
+      end do
+    end do
 !**************************************************************************
- else       ! use old definitions
+  else       ! use old definitions
 !**************************************************************************
 !   create a cloud and rainout/washout field, clouds occur where rh>80%
 !   total cloudheight is stored at level 0
- if (.not.readclouds) write(*,*) 'using cloud water from Parameterization'
-  do jy=0,nymin1
-    do ix=0,nxmin1
+! if (.not.readclouds) write(*,*) 'using cloud water from Parameterization'
+    write(*,*) 'using cloud water from Parameterization'
+    do jy=0,nymin1
+      do ix=0,nxmin1
 ! OLD METHOD
-      rain_cloud_above(ix,jy)=0
-      lsp=lsprec(ix,jy,1,n)
-      convp=convprec(ix,jy,1,n)
-      cloudsh(ix,jy,n)=0
-      do kz_inv=1,nz-1
-        kz=nz-kz_inv+1
-        pressure=rho(ix,jy,kz,n)*r_air*tt(ix,jy,kz,n)
-        rh=qv(ix,jy,kz,n)/f_qvsat(pressure,tt(ix,jy,kz,n))
-        clouds(ix,jy,kz,n)=0
-        if (rh.gt.0.8) then ! in cloud
-          if ((lsp.gt.0.01).or.(convp.gt.0.01)) then ! cloud and precipitation
-            rain_cloud_above(ix,jy)=1
-            cloudsh(ix,jy,n)=cloudsh(ix,jy,n)+ &
-                 height(kz)-height(kz-1)
-            if (lsp.ge.convp) then
-              clouds(ix,jy,kz,n)=3 ! lsp dominated rainout
-            else
-              clouds(ix,jy,kz,n)=2 ! convp dominated rainout
+        rain_cloud_above(ix,jy)=0
+        lsp=lsprec(ix,jy,1,n)
+        convp=convprec(ix,jy,1,n)
+        cloudsh(ix,jy,n)=0
+        do kz_inv=1,nz-1
+          kz=nz-kz_inv+1
+          pressure=rho(ix,jy,kz,n)*r_air*tt(ix,jy,kz,n)
+          rh=qv(ix,jy,kz,n)/f_qvsat(pressure,tt(ix,jy,kz,n))
+          clouds(ix,jy,kz,n)=0
+          if (rh.gt.0.8) then ! in cloud
+            if ((lsp.gt.0.01).or.(convp.gt.0.01)) then ! cloud and precipitation
+              rain_cloud_above(ix,jy)=1
+              cloudsh(ix,jy,n)=cloudsh(ix,jy,n)+ &
+                   height(kz)-height(kz-1)
+              if (lsp.ge.convp) then
+                clouds(ix,jy,kz,n)=3 ! lsp dominated rainout
+              else
+                clouds(ix,jy,kz,n)=2 ! convp dominated rainout
+              endif
+            else ! no precipitation
+              clouds(ix,jy,kz,n)=1 ! cloud
             endif
-          else ! no precipitation
-            clouds(ix,jy,kz,n)=1 ! cloud
-          endif
-        else ! no cloud
-          if (rain_cloud_above(ix,jy).eq.1) then ! scavenging
-            if (lsp.ge.convp) then
-              clouds(ix,jy,kz,n)=5 ! lsp dominated washout
-            else
-              clouds(ix,jy,kz,n)=4 ! convp dominated washout
+          else ! no cloud
+            if (rain_cloud_above(ix,jy).eq.1) then ! scavenging
+              if (lsp.ge.convp) then
+                clouds(ix,jy,kz,n)=5 ! lsp dominated washout
+              else
+                clouds(ix,jy,kz,n)=4 ! convp dominated washout
+              endif
             endif
           endif
-        endif
-      end do
+        end do
 !END OLD METHOD
       end do
-     end do
-endif !readclouds
+    end do
+  endif !readclouds
 
      !********* TEST ***************
@@ -838,4 +839,4 @@
     !      sum(ww(:,:,:,n)*ww(:,:,:,n)), &
     !      sum(clouds(:,:,:,n)), sum(cloudsh(:,:,n)),sum(idx),sum(pinmconv)
-  end subroutine verttransform
-
+end subroutine verttransform
+
Index: src/wetdepo.f90
===================================================================
--- src/wetdepo.f90	(revision d6a09777de02ba48864df5a70d9160b51767c086)
+++ src/wetdepo.f90	(revision f75967de0b4a6b0adcfa329374aefe0f1e5d3d70)
@@ -73,5 +73,5 @@
   integer :: ngrid,itage,nage,hz,il,interp_time, n, clouds_v
   integer :: ks, kp
-  integer :: n1,n2, icbot,ictop, indcloud !TEST
+!  integer :: n1,n2, icbot,ictop, indcloud !TEST
   real :: S_i, act_temp, cl, cle ! in cloud scavenging
   real :: clouds_h ! cloud height for the specific grid point
@@ -105,5 +105,4 @@
   ! Loop over all particles
   !************************
-
 
   blc_count=0
@@ -185,5 +184,5 @@
     n=memind(2)
     if (abs(memtime(1)-interp_time).lt.abs(memtime(2)-interp_time)) &
-    n=memind(1)
+         n=memind(1)
 
     if (ngrid.eq.0) then
@@ -199,5 +198,5 @@
   ! scavenging is done
 
-     if (clouds_v.le.1) goto 20
+    if (clouds_v.le.1) goto 20
   
   ! 1) Parameterization of the the area fraction of the grid cell where the
@@ -311,4 +310,5 @@
 ! NIK 13 may 2015: only do incloud if positive in-cloud scavenging parameters are given in species file
         if (weta_in(ks).gt.0. .or. wetb_in(ks).gt.0.) then 
+          inc_count=inc_count+1
 ! if negative coefficients (turned off) set to zero for use in equation
           if (weta_in(ks).lt.0.) weta_in(ks)=0.
@@ -355,7 +355,7 @@
            !OLD 
           if (readclouds) then
-           wetscav=S_i*(prec(1)/3.6E6)
+            wetscav=S_i*(prec(1)/3.6E6)
           else
-          wetscav=S_i*(prec(1)/3.6E6)/clouds_h
+            wetscav=S_i*(prec(1)/3.6E6)/clouds_h
           endif
 
