Index: src/com_mod.f90
===================================================================
--- src/com_mod.f90	(revision f75967de0b4a6b0adcfa329374aefe0f1e5d3d70)
+++ src/com_mod.f90	(revision 41d8574bea1b0f91e61dffd5dd1d17882407f826)
@@ -351,7 +351,7 @@
   real :: qv(0:nxmax-1,0:nymax-1,nzmax,numwfmem)
 !ZHG adding cloud water 
-  real :: clwc(0:nxmax-1,0:nymax-1,nzmax,numwfmem) !liquid   [kg/kg]
-  real :: ciwc(0:nxmax-1,0:nymax-1,nzmax,numwfmem) !ice      [kg/kg]
-  real :: clw(0:nxmax-1,0:nymax-1,nzmax,numwfmem)  !combined [m3/m3]
+  real :: clwc(0:nxmax-1,0:nymax-1,nzmax,numwfmem)=0.0 !liquid   [kg/kg]
+  real :: ciwc(0:nxmax-1,0:nymax-1,nzmax,numwfmem)=0.0 !ice      [kg/kg]
+  real :: clw(0:nxmax-1,0:nymax-1,nzmax,numwfmem)=0.0  !combined [m3/m3]
 
   real :: pv(0:nxmax-1,0:nymax-1,nzmax,numwfmem)
@@ -360,6 +360,6 @@
   real :: tth(0:nxmax-1,0:nymax-1,nuvzmax,numwfmem)
   real :: qvh(0:nxmax-1,0:nymax-1,nuvzmax,numwfmem)
-  real :: clwch(0:nxmax-1,0:nymax-1,nuvzmax,numwfmem)
-  real :: ciwch(0:nxmax-1,0:nymax-1,nuvzmax,numwfmem)
+  real :: clwch(0:nxmax-1,0:nymax-1,nuvzmax,numwfmem)=0.0
+  real :: ciwch(0:nxmax-1,0:nymax-1,nuvzmax,numwfmem)=0.0
 
   real :: pplev(0:nxmax-1,0:nymax-1,nuvzmax,numwfmem)
@@ -371,4 +371,5 @@
    real :: icloud_stats(0:nxmax-1,0:nymax-1,5,numwfmem)
    real :: clh(0:nxmax-1,0:nymax-1,nuvzmax,numwfmem)
+   real :: clw4(0:nxmax-1,0:nymax-1,numwfmem) ! eso: =icloud_stats(:,:,4,:)
 
 
Index: src/mpi_mod.f90
===================================================================
--- src/mpi_mod.f90	(revision d6a09777de02ba48864df5a70d9160b51767c086)
+++ src/mpi_mod.f90	(revision 41d8574bea1b0f91e61dffd5dd1d17882407f826)
@@ -119,5 +119,5 @@
   logical, parameter :: mp_dbg_out = .false.
   logical, parameter :: mp_time_barrier=.true.
-  logical, parameter :: mp_measure_time=.false.
+  logical, parameter :: mp_measure_time=.true.
   logical, parameter :: mp_exact_numpart=.true.
 
@@ -907,5 +907,5 @@
 !**********************************************************************
 
-! The non-reader processes need to know if clouds were read.
+! The non-reader processes need to know if cloud water were read.
 ! TODO: only at first step or always?
     call MPI_Bcast(readclouds,1,MPI_LOGICAL,id_read,MPI_COMM_WORLD,mp_ierr)
@@ -963,7 +963,8 @@
 ! cloud water/ice:
     if (readclouds) then
-      call MPI_Bcast(icloud_stats(:,:,:,li:ui),d2_size1*5,mp_pp,id_read,MPI_COMM_WORLD,mp_ierr)
-      if (mp_ierr /= 0) goto 600
-
+      ! call MPI_Bcast(icloud_stats(:,:,:,li:ui),d2s1*5,mp_pp,id_read,MPI_COMM_WORLD,mp_ierr)
+      ! if (mp_ierr /= 0) goto 600
+      call MPI_Bcast(clw4(:,:,li:ui),d2s1,mp_pp,id_read,MPI_COMM_WORLD,mp_ierr)
+      if (mp_ierr /= 0) goto 600
       ! call MPI_Bcast(clwc(:,:,:,li:ui),d3s1,mp_pp,id_read,MPI_COMM_WORLD,mp_ierr)
       ! if (mp_ierr /= 0) goto 600
@@ -1336,6 +1337,9 @@
       if (readclouds) then
         i=i+1
-        call MPI_Isend(icloud_stats(:,:,:,mind),d2s1*5,mp_pp,dest,tm1,&
+        ! call MPI_Isend(icloud_stats(:,:,:,mind),d2s1*5,mp_pp,dest,tm1,&
+        !      &MPI_COMM_WORLD,reqs(i),mp_ierr)
+        call MPI_Isend(clw4(:,:,mind),d2s1,mp_pp,dest,tm1,&
              &MPI_COMM_WORLD,reqs(i),mp_ierr)
+
         if (mp_ierr /= 0) goto 600
 
@@ -1543,5 +1547,7 @@
       j=j+1
 
-      call MPI_Irecv(icloud_stats(:,:,:,mind),d2s1*5,mp_pp,id_read,MPI_ANY_TAG,&
+      ! call MPI_Irecv(icloud_stats(:,:,:,mind),d2s1*5,mp_pp,id_read,MPI_ANY_TAG,&
+      !      &MPI_COMM_WORLD,reqs(j),mp_ierr)
+      call MPI_Irecv(clw4(:,:,mind),d2s1*5,mp_pp,id_read,MPI_ANY_TAG,&
            &MPI_COMM_WORLD,reqs(j),mp_ierr)
       if (mp_ierr /= 0) goto 600
Index: src/par_mod.f90
===================================================================
--- src/par_mod.f90	(revision d6a09777de02ba48864df5a70d9160b51767c086)
+++ src/par_mod.f90	(revision 41d8574bea1b0f91e61dffd5dd1d17882407f826)
@@ -211,11 +211,10 @@
 
   integer,parameter :: maxpart=40000000
-!  integer,parameter :: maxpart=60000000
-!  integer,parameter :: maxpart=120000000
   integer,parameter :: maxspec=6
+  integer,parameter :: minmass=0.0 !0.0001
 
   ! maxpart                 Maximum number of particles
   ! maxspec                 Maximum number of chemical species per release
-
+  ! minmass                 Terminate particles carrying less mass
 
   ! maxpoint is also set dynamically during runtime
Index: src/readwind.f90
===================================================================
--- src/readwind.f90	(revision d6a09777de02ba48864df5a70d9160b51767c086)
+++ src/readwind.f90	(revision 41d8574bea1b0f91e61dffd5dd1d17882407f826)
@@ -190,11 +190,12 @@
     elseif ((parCat.eq.1).and.(parNum.eq.0).and.(typSurf.eq.105)) then ! Q
       isec1(6)=133         ! indicatorOfParameter
-!ZHG ! READ CLOUD FIELD : assume these to be added together to one variable
+! ESO Cloud water is in a) fields CLWC and CIWC, *or* b) field qc 
     elseif ((parCat.eq.1).and.(parNum.eq.83).and.(typSurf.eq.105)) then ! clwc
       isec1(6)=246         ! indicatorOfParameter
-! ICE AND WATER IS ADDED TOGETHER IN NEW WINDFIELDS
-!    elseif ((parCat.eq.1).and.(parNum.eq.84).and.(typSurf.eq.105)) then ! ciwc
-!      isec1(6)=247         ! indicatorOfParameter
-!ZHG end
+    elseif ((parCat.eq.1).and.(parNum.eq.84).and.(typSurf.eq.105)) then ! ciwc
+      isec1(6)=247         ! indicatorOfParameter
+! ESO qc(=clwc+ciwc):
+    elseif ((parCat.eq.201).and.(parNum.eq.31).and.(typSurf.eq.105)) then ! qc
+      isec1(6)=201031         ! indicatorOfParameter
     elseif ((parCat.eq.3).and.(parNum.eq.0).and.(typSurf.eq.1)) then !SP
       isec1(6)=134         ! indicatorOfParameter
@@ -360,14 +361,22 @@
       if(isec1(6).eq.135) iwmax=max(iwmax,nlev_ec-k+1)
 !ZHG READING CLOUD FIELDS ASWELL
+! ESO TODO: add check for if one of clwc/ciwc missing (error),
+! also if all 3 cw fields present, use qc and disregard the others
       if(isec1(6).eq.246) then  !! CLWC  Cloud liquid water content [kg/kg]
         clwch(i,j,nlev_ec-k+2,n)=zsec4(nxfield*(ny-j-1)+i+1)
-        readclouds = .true.
+        readclouds=.true.
+        sumclouds=.false.
+      endif
+      if(isec1(6).eq.247) then  !! CIWC  Cloud ice water content
+        ciwch(i,j,nlev_ec-k+2,n)=zsec4(nxfield*(ny-j-1)+i+1)
+      endif
+!ZHG end
+!ESO read qc (=clwc+ciwc)
+      if(isec1(6).eq.201031) then  !! QC  Cloud liquid water content [kg/kg]
+        clwch(i,j,nlev_ec-k+2,n)=zsec4(nxfield*(ny-j-1)+i+1)
+        readclouds=.true.
+        sumclouds=.true.
 !if (clwch(i,j,nlev_ec-k+2,n) .gt. 0)        write(*,*) 'readwind: found water!', clwch(i,j,nlev_ec-k+2,n)
       endif
-!      if(isec1(6).eq.247) then  !! CIWC  Cloud ice water content
-!        ciwch(i,j,nlev_ec-k+2,n)=zsec4(nxfield*(ny-j-1)+i+1)
-        !write(*,*) 'found ice!'
-!      endif
-!ZHG end
 
     end do
@@ -427,5 +436,5 @@
 !ZHG
     call shift_field(clwch,nxfield,ny,nuvzmax,nuvz,2,n)
-    call shift_field(ciwch,nxfield,ny,nuvzmax,nuvz,2,n)
+    if (.not.sumclouds) call shift_field(ciwch,nxfield,ny,nuvzmax,nuvz,2,n)
 !ZHG end
 
Index: src/readwind_mpi.f90
===================================================================
--- src/readwind_mpi.f90	(revision d6a09777de02ba48864df5a70d9160b51767c086)
+++ src/readwind_mpi.f90	(revision 41d8574bea1b0f91e61dffd5dd1d17882407f826)
@@ -83,7 +83,7 @@
 !HSO  end
 
-  real(kind=4), intent(inout) :: uuh(0:nxmax-1,0:nymax-1,nuvzmax)
-  real(kind=4), intent(inout) :: vvh(0:nxmax-1,0:nymax-1,nuvzmax)
-  real(kind=4), intent(inout) :: wwh(0:nxmax-1,0:nymax-1,nwzmax)
+  real(sp), intent(inout) :: uuh(0:nxmax-1,0:nymax-1,nuvzmax)
+  real(sp), intent(inout) :: vvh(0:nxmax-1,0:nymax-1,nuvzmax)
+  real(sp), intent(inout) :: wwh(0:nxmax-1,0:nymax-1,nwzmax)
   integer, intent(in) :: indj,n
   integer :: i,j,k,levdiff2,ifield,iumax,iwmax
@@ -116,5 +116,5 @@
   hflswitch=.false.
   strswitch=.false.
-!hg
+!ZHG test the grib fields that have lcwc without using them
 !  readcloud=.false.
 !hg end
@@ -200,11 +200,12 @@
     elseif ((parCat.eq.1).and.(parNum.eq.0).and.(typSurf.eq.105)) then ! Q
       isec1(6)=133         ! indicatorOfParameter
-!ZHG ! READ CLOUD FIELD : assume these to be added together to one variable
+! ESO Cloud water is in a) fields CLWC and CIWC, *or* b) field qc 
     elseif ((parCat.eq.1).and.(parNum.eq.83).and.(typSurf.eq.105)) then ! clwc
       isec1(6)=246         ! indicatorOfParameter
-! ICE AND WATER IS ADDED TOGETHER IN NEW WINDFIELDS
-!    elseif ((parCat.eq.1).and.(parNum.eq.84).and.(typSurf.eq.105)) then ! ciwc
-!      isec1(6)=247         ! indicatorOfParameter
-!ZHG end
+    elseif ((parCat.eq.1).and.(parNum.eq.84).and.(typSurf.eq.105)) then ! ciwc
+      isec1(6)=247         ! indicatorOfParameter
+! ESO qc(=clwc+ciwc):
+    elseif ((parCat.eq.201).and.(parNum.eq.31).and.(typSurf.eq.105)) then ! qc
+      isec1(6)=201031         ! indicatorOfParameter
     elseif ((parCat.eq.3).and.(parNum.eq.0).and.(typSurf.eq.1)) then !SP
       isec1(6)=134         ! indicatorOfParameter
@@ -373,11 +374,16 @@
         clwch(i,j,nlev_ec-k+2,n)=zsec4(nxfield*(ny-j-1)+i+1)
         readclouds = .true.
-!if (clwch(i,j,nlev_ec-k+2,n) .gt. 0)        write(*,*) 'readwind: found water!', clwch(i,j,nlev_ec-k+2,n)
-      endif
-!      if(isec1(6).eq.247) then  !! CIWC  Cloud ice water content
-!        ciwch(i,j,nlev_ec-k+2,n)=zsec4(nxfield*(ny-j-1)+i+1)
-        !write(*,*) 'found ice!'
-!      endif
+        sumclouds=.false.
+      endif
+      if(isec1(6).eq.247) then  !! CIWC  Cloud ice water content
+        ciwch(i,j,nlev_ec-k+2,n)=zsec4(nxfield*(ny-j-1)+i+1)
+      endif
 !ZHG end
+!ESO read qc (=clwc+ciwc)
+      if(isec1(6).eq.201031) then  !! QC  Cloud liquid water content [kg/kg]
+        clwch(i,j,nlev_ec-k+2,n)=zsec4(nxfield*(ny-j-1)+i+1)
+        readclouds=.true.
+        sumclouds=.true.
+      endif
 
     end do
Index: src/timemanager.f90
===================================================================
--- src/timemanager.f90	(revision f75967de0b4a6b0adcfa329374aefe0f1e5d3d70)
+++ src/timemanager.f90	(revision 41d8574bea1b0f91e61dffd5dd1d17882407f826)
@@ -607,5 +607,5 @@
           end do
 
-          if (xmassfract.lt.0.0001) then   ! terminate all particles carrying less mass
+          if (xmassfract.lt.minmass) then   ! terminate all particles carrying less mass
             itra1(j)=-999999999
             if (verbosity.gt.0) then
@@ -644,30 +644,15 @@
   !***************************************************************
     
-          total_nan_intl=0
-          i_nan=i_nan+1 ! added by mc to count nan during a time of maxtl (i.e. maximum tl fixed here to 20 minutes, see com_mod)
-          sum_nan_count(i_nan)=nan_count
-          if (i_nan > maxtl/lsynctime) i_nan=1 !lsynctime must be <= maxtl
-          do ii_nan=1, (maxtl/lsynctime) 
-              total_nan_intl=total_nan_intl+sum_nan_count(ii_nan)
-          end do
+    total_nan_intl=0
+    i_nan=i_nan+1 ! added by mc to count nan during a time of maxtl (i.e. maximum tl fixed here to 20 minutes, see com_mod)
+    sum_nan_count(i_nan)=nan_count
+    if (i_nan > maxtl/lsynctime) i_nan=1 !lsynctime must be <= maxtl
+    do ii_nan=1, (maxtl/lsynctime) 
+      total_nan_intl=total_nan_intl+sum_nan_count(ii_nan)
+    end do
   ! Output to keep track of the numerical instabilities in CBL simulation and if
   ! they are compromising the final result (or not)
-          if (cblflag.eq.1) print *,j,itime,'nan_synctime',nan_count,'nan_tl',total_nan_intl  
+    if (cblflag.eq.1) print *,j,itime,'nan_synctime',nan_count,'nan_tl',total_nan_intl  
           
-!!------------------------------------------------------------------------------
-! these lines below to test the well-mixed condition, modified by  mc, not to be
-! included in final release:
-    ! if (itime.eq.0) then
-    ! open(551,file='/home/mc/test_cbl/out/WELLMIXEDTEST_CBL_lonlat_9_33_100_3hours_3htp_cd.DAT')
-    ! open(552,file='/home/mc/test_cbl/out/avg_ol_h_wst_lonlat_9_33_100_3hours_3htp_cd.DAT')
-    ! end if
-    ! write(552,'(5F16.7)')itime*1./3600.,avg_wst/well_mixed_norm,avg_ol/well_mixed_norm,avg_h/well_mixed_norm
-    ! do j=1,25
-    !      !write(551,*))itime*1.,h_well/50.*j,well_mixed_vector(j)/well_mixed_norm*50.
-    !     avg_air_dens(j)=avg_air_dens(j)/well_mixed_vector(j)
-    !     write(551,'(5F16.7)')itime*1.,h_well/25.*j,well_mixed_vector(j)/well_mixed_norm*25.,avg_air_dens(j),0.04*j
-    ! end do 
-!!------------------------------------------------------------------------------
-
   end do
 
Index: src/timemanager_mpi.f90
===================================================================
--- src/timemanager_mpi.f90	(revision f75967de0b4a6b0adcfa329374aefe0f1e5d3d70)
+++ src/timemanager_mpi.f90	(revision 41d8574bea1b0f91e61dffd5dd1d17882407f826)
@@ -103,5 +103,4 @@
   implicit none
 
-  logical :: fc_mp=.true., fc_sync=.true.
   logical :: reqv_state=.false. ! .true. if waiting for a MPI_Irecv to complete
   integer :: j,ks,kp,l,n,itime=0,nstop,nstop1,memstat=0,mind
@@ -352,5 +351,5 @@
       do ks=1,nspec
         do kp=1,maxpointspec_act
-          if (decay(ks).gt.0.) then
+          if (decay(ks).gt.0.) then ! TODO move this statement up 2 levels
             do nage=1,nageclass
               do l=1,nclassunc
@@ -485,5 +484,4 @@
             if (lroot) then
               if (lnetcdfout.eq.1) then
-
                 call concoutput_surf_netcdf(itime,outnum,gridtotalunc,wetgridtotalunc,&
                      &drygridtotalunc)
@@ -772,5 +770,5 @@
           end do
 
-          if (xmassfract.lt.0.00005 .and. sum(real(npart(npoint(j)))*xmass1(j,:)).lt.1.0) then   ! terminate all particles carrying less mass
+          if (xmassfract.lt.minmass) then ! .and. sum(real(npart(npoint(j)))*xmass1(j,:)).lt.1.0) then   ! terminate all particles carrying less mass
           !            print*,'terminated particle ',j,' for small mass (', sum(real(npart(npoint(j)))* &
           !         xmass1(j,:)), ' of ', sum(xmass(npoint(j),:)),')'
Index: src/verttransform.f90
===================================================================
--- src/verttransform.f90	(revision f75967de0b4a6b0adcfa329374aefe0f1e5d3d70)
+++ src/verttransform.f90	(revision 41d8574bea1b0f91e61dffd5dd1d17882407f826)
@@ -251,5 +251,5 @@
 !hg adding the cloud water 
   clwc(:,:,1,n)=clwch(:,:,1,n)
-  ciwc(:,:,1,n)=ciwch(:,:,1,n)   
+  if (.not.sumclouds) ciwc(:,:,1,n)=ciwch(:,:,1,n)   
 !hg 
   pv(:,:,1,n)=pvh(:,:,1)
@@ -262,5 +262,5 @@
 !hg adding the cloud water
   clwc(:,:,nz,n)=clwch(:,:,nuvz,n)
-  ciwc(:,:,nz,n)=ciwch(:,:,nuvz,n)
+  if (.not.sumclouds) ciwc(:,:,nz,n)=ciwch(:,:,nuvz,n)
 !hg
   pv(:,:,nz,n)=pvh(:,:,nuvz)
@@ -280,5 +280,5 @@
 !hg adding the cloud water
           clwc(ix,jy,iz,n)=clwc(ix,jy,nz,n)
-          ciwc(ix,jy,iz,n)=ciwc(ix,jy,nz,n)
+          if (.not.sumclouds) ciwc(ix,jy,iz,n)=ciwc(ix,jy,nz,n)
 !hg
           pv(ix,jy,iz,n)=pv(ix,jy,nz,n)
@@ -310,5 +310,6 @@
 !hg adding the cloud water
           clwc(ix,jy,iz,n)=(clwch(ix,jy,kz-1,n)*dz2+clwch(ix,jy,kz,n)*dz1)/dz
-          ciwc(ix,jy,iz,n)=(ciwch(ix,jy,kz-1,n)*dz2+ciwch(ix,jy,kz,n)*dz1)/dz
+          if (.not.sumclouds) &
+               &ciwc(ix,jy,iz,n)=(ciwch(ix,jy,kz-1,n)*dz2+ciwch(ix,jy,kz,n)*dz1)/dz
 !hg
           pv(ix,jy,iz,n)=(pvh(ix,jy,kz-1)*dz2+pvh(ix,jy,kz)*dz1)/dz
@@ -578,7 +579,11 @@
 !***********************************************************************************
     write(*,*) 'using cloud water from ECMWF'
-    clw(:,:,:,n)=0
-    icloud_stats(:,:,:,n)=0
+    clw(:,:,:,n)=0.0
+    icloud_stats(:,:,:,n)=0.0
     clouds(:,:,:,n)=0
+! If water/ice are read separately into clwc and ciwc, store sum in clwc
+    if (.not.sumclouds) then 
+      clwc(:,:,:,n) = clwc(:,:,:,n) + ciwc(:,:,:,n)
+    end if
     do jy=0,nymin1
       do ix=0,nxmin1
@@ -635,5 +640,4 @@
 !   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'
     write(*,*) 'using cloud water from Parameterization'
     do jy=0,nymin1
@@ -676,4 +680,7 @@
     end do
   endif !readclouds
+
+! eso: copy the relevant data to clw4 to reduce amount of communicated data for MPI
+  clw4(:,:,n) = icloud_stats(:,:,4,n)
 
      !********* TEST ***************
Index: src/wetdepo.f90
===================================================================
--- src/wetdepo.f90	(revision f75967de0b4a6b0adcfa329374aefe0f1e5d3d70)
+++ src/wetdepo.f90	(revision 41d8574bea1b0f91e61dffd5dd1d17882407f826)
@@ -317,5 +317,7 @@
           !ZHG 2015 Cloud liquid & ice water (CLWC+CIWC) from ECMWF
           if (readclouds) then                  !icloud_stats(ix,jy,4,n) has units kg/m2
-            cl =icloud_stats(ix,jy,4,n)*(grfraction(1)/cc)
+!            cl =icloud_stats(ix,jy,4,n)*(grfraction(1)/cc)
+! ESO: stop using icloud_stats
+            cl =clw4(ix,jy,n)*(grfraction(1)/cc)
           else                                  !parameterize cloudwater m2/m3
             !ZHG updated parameterization of cloud water to better reproduce the values coming from ECMWF
