Index: src/FLEXPART_MPI.f90
===================================================================
--- src/FLEXPART_MPI.f90	(revision a9cf4b1e763458eb1d7f20f9d55d1f5bd8a87da6)
+++ src/FLEXPART_MPI.f90	(revision 20963b15051b22eeb381dcf4e824a9104d92717b)
@@ -67,5 +67,6 @@
   integer :: metdata_format = GRIBFILE_CENTRE_UNKNOWN
   integer :: detectformat
-
+  integer(selected_int_kind(16)), dimension(maxspec) :: tot_b=0, &
+       & tot_i=0
 
 
@@ -206,9 +207,9 @@
 
   if (metdata_format.eq.GRIBFILE_CENTRE_ECMWF) then
-    print *,'ECMWF metdata detected'
+    if (lroot) print *,'ECMWF metdata detected'
   elseif (metdata_format.eq.GRIBFILE_CENTRE_NCEP) then
-    print *,'NCEP metdata detected'
+    if (lroot) print *,'NCEP metdata detected'
   else
-    print *,'Unknown metdata format'
+    if (lroot) print *,'Unknown metdata format'
     stop
   endif
@@ -483,17 +484,11 @@
 
 ! NIK 16.02.2005 
-  if (lroot) then
-    call MPI_Reduce(MPI_IN_PLACE, tot_blc_count, nspec, MPI_INTEGER8, MPI_SUM, id_root, &
+  if (mp_partgroup_pid.ge.0) then ! Skip for readwind process 
+    call MPI_Reduce(tot_blc_count, tot_b, nspec, MPI_INTEGER8, MPI_SUM, id_root, &
          & mp_comm_used, mp_ierr)
-    call MPI_Reduce(MPI_IN_PLACE, tot_inc_count, nspec, MPI_INTEGER8, MPI_SUM, id_root, &
+    call MPI_Reduce(tot_inc_count, tot_i, nspec, MPI_INTEGER8, 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, 0, nspec, MPI_INTEGER8, MPI_SUM, id_root, &
-           & mp_comm_used, mp_ierr)
-      call MPI_Reduce(tot_inc_count, 0, nspec, MPI_INTEGER8, MPI_SUM, id_root, &
-           & mp_comm_used, mp_ierr)
-    end if
   end if
+  
 
   if (lroot) then
@@ -502,7 +497,9 @@
       write(*,*) 'Scavenging statistics for species ', species(i), ':'
       write(*,*) 'Total number of occurences of below-cloud scavenging', &
-           & tot_blc_count(i)
+           & tot_b(i)
+!           & tot_blc_count(i)
       write(*,*) 'Total number of occurences of in-cloud    scavenging', &
-           & tot_inc_count(i)
+           & tot_i(i)
+!           & tot_inc_count(i)
       write(*,*) '**********************************************'
     end do
Index: src/concoutput.f90
===================================================================
--- src/concoutput.f90	(revision 08a38b55d3749abb3d1df461e12c98d18b329a51)
+++ src/concoutput.f90	(revision 20963b15051b22eeb381dcf4e824a9104d92717b)
@@ -140,4 +140,6 @@
   close(unitdates)  
 
+  ! Overwrite existing dates file on first call, later append to it
+  ! This fixes a bug where the dates file kept growing across multiple runs
   IF (init) THEN
     file_stat='OLD'
@@ -313,5 +315,5 @@
                    drygridsigma(ix,jy)* &
                    sqrt(real(nclassunc))
-125           drygridsigmatotal=drygridsigmatotal+ &
+              drygridsigmatotal=drygridsigmatotal+ &
                    drygridsigma(ix,jy)
             endif
Index: src/concoutput_mpi.f90
===================================================================
--- src/concoutput_mpi.f90	(revision b1e0742119e850a6661e6803fa50a653d506e564)
+++ src/concoutput_mpi.f90	(revision 20963b15051b22eeb381dcf4e824a9104d92717b)
@@ -104,5 +104,5 @@
   real,parameter :: weightair=28.97
   logical :: sp_zer
-  LOGICAL,save :: init=.true.
+  logical,save :: init=.true.
   character :: adate*8,atime*6
   character(len=3) :: anspec
@@ -128,5 +128,5 @@
 ! This fixes a bug where the dates file kept growing across multiple runs
 
-! If 'dates' file exists, make a backup
+! If 'dates' file exists in output directory, make a backup
   inquire(file=path(2)(1:length(2))//'dates', exist=ldates_file)
   if (ldates_file.and.init) then
@@ -257,21 +257,32 @@
 
     write(anspec,'(i3.3)') ks
-    if ((iout.eq.1).or.(iout.eq.3).or.(iout.eq.5)) then
-      if (ldirect.eq.1) then
-        open(unitoutgrid,file=path(2)(1:length(2))//'grid_conc_'//adate// &
+
+    if (DRYBKDEP.or.WETBKDEP) then !scavdep output
+      if (DRYBKDEP) & 
+      open(unitoutgrid,file=path(2)(1:length(2))//'grid_drydep_'//adate// &
+           atime//'_'//anspec,form='unformatted')
+      if (WETBKDEP) & 
+      open(unitoutgrid,file=path(2)(1:length(2))//'grid_wetdep_'//adate// &
+           atime//'_'//anspec,form='unformatted')
+      write(unitoutgrid) itime
+    else
+      if ((iout.eq.1).or.(iout.eq.3).or.(iout.eq.5)) then
+        if (ldirect.eq.1) then
+          open(unitoutgrid,file=path(2)(1:length(2))//'grid_conc_'//adate// &
+               atime//'_'//anspec,form='unformatted')
+        else
+          open(unitoutgrid,file=path(2)(1:length(2))//'grid_time_'//adate// &
+               atime//'_'//anspec,form='unformatted')
+        endif
+        write(unitoutgrid) itime
+      endif
+
+      if ((iout.eq.2).or.(iout.eq.3)) then      ! mixing ratio
+        open(unitoutgridppt,file=path(2)(1:length(2))//'grid_pptv_'//adate// &
              atime//'_'//anspec,form='unformatted')
-      else
-        open(unitoutgrid,file=path(2)(1:length(2))//'grid_time_'//adate// &
-             atime//'_'//anspec,form='unformatted')
+
+        write(unitoutgridppt) itime
       endif
-      write(unitoutgrid) itime
-    endif
-
-    if ((iout.eq.2).or.(iout.eq.3)) then      ! mixing ratio
-      open(unitoutgridppt,file=path(2)(1:length(2))//'grid_pptv_'//adate// &
-           atime//'_'//anspec,form='unformatted')
-
-      write(unitoutgridppt) itime
-    endif
+    endif ! if deposition output
 
     do kp=1,maxpointspec_act
@@ -353,5 +364,5 @@
 ! Concentration output
 !*********************
-        if ((iout.eq.1).or.(iout.eq.3).or.(iout.eq.5)) then
+        if ((iout.eq.1).or.(iout.eq.3).or.(iout.eq.5).or.(iout.eq.6)) then
 
 ! Wet deposition
@@ -448,8 +459,16 @@
                   endif
                   sp_count_r=sp_count_r+1
+                  if (lparticlecountoutput) then
+                    sparse_dump_r(sp_count_r)= &
+                         sp_fact* &
+                         grid(ix,jy,kz)
+                  else
                   sparse_dump_r(sp_count_r)= &
                        sp_fact* &
                        grid(ix,jy,kz)* &
                        factor3d(ix,jy,kz)/tot_mu(ks,kp)
+                  end if
+
+
 !                 if ((factor(ix,jy,kz)/tot_mu(ks,kp)).eq.0)
 !    +              write (*,*) factor(ix,jy,kz),tot_mu(ks,kp),ks,kp
@@ -637,22 +656,6 @@
 !*************************
 
-  do ks=1,nspec
-    do kp=1,maxpointspec_act
-      do i=1,numreceptor
-        creceptor(i,ks)=0.
-      end do
-      do jy=0,numygrid-1
-        do ix=0,numxgrid-1
-          do l=1,nclassunc
-            do nage=1,nageclass
-              do kz=1,numzgrid
-                gridunc(ix,jy,kz,ks,kp,l,nage)=0.
-              end do
-            end do
-          end do
-        end do
-      end do
-    end do
-  end do
+  creceptor(:,:)=0.
+  gridunc(:,:,:,:,:,:,:)=0.
 
   if (mp_measure_time) call mpif_mtime('rootonly',1)
Index: src/getfields_mpi.f90
===================================================================
--- src/getfields_mpi.f90	(revision 6ecb30a41fb8a07e153abadc712699a09c15f90c)
+++ src/getfields_mpi.f90	(revision 20963b15051b22eeb381dcf4e824a9104d92717b)
@@ -233,4 +233,8 @@
 40  indmin=indj
 
+   if (WETBKDEP.and.(lmpreader.or.(.not.lmp_use_reader.and.lroot))) then
+        call writeprecip(itime,memind(1))
+      endif
+
   else
 
@@ -287,5 +291,8 @@
 60  indmin=indj
 
-    mind3=memstat
+!   if (WETBKDEP.and.lroot) then
+    if (WETBKDEP.and.(lmpreader.or.(.not.lmp_use_reader.and.lroot))) then
+      call writeprecip(itime,memind(1))
+    endif
 
   endif
Index: src/readcommand.f90
===================================================================
--- src/readcommand.f90	(revision a9cf4b1e763458eb1d7f20f9d55d1f5bd8a87da6)
+++ src/readcommand.f90	(revision 20963b15051b22eeb381dcf4e824a9104d92717b)
@@ -332,14 +332,18 @@
      case (3)  ! 3 .. wet deposition in outputfield 
         ind_rel = 3
-         write(*,*) ' #### FLEXPART WET DEPOSITION BACKWARD MODE    #### '
-         write(*,*) ' #### Releaseheight is forced to 0 - 20km      #### '
-         write(*,*) ' #### Release is performed above ground lev    #### '
+        if (lroot) then
+          write(*,*) ' #### FLEXPART WET DEPOSITION BACKWARD MODE    #### '
+          write(*,*) ' #### Releaseheight is forced to 0 - 20km      #### '
+          write(*,*) ' #### Release is performed above ground lev    #### '
+        end if
          WETBKDEP=.true.
          allocate(xscav_frac1(maxpart,maxspec))
      case (4)  ! 4 .. dry deposition in outputfield
          ind_rel = 4
-         write(*,*) ' #### FLEXPART DRY DEPOSITION BACKWARD MODE    #### '
-         write(*,*) ' #### Releaseheight is forced to 0 - 2*href    #### '
-         write(*,*) ' #### Release is performed above ground lev    #### '
+         if (lroot) then
+           write(*,*) ' #### FLEXPART DRY DEPOSITION BACKWARD MODE    #### '
+           write(*,*) ' #### Releaseheight is forced to 0 - 2*href    #### '
+           write(*,*) ' #### Release is performed above ground lev    #### '
+         end if
          DRYBKDEP=.true.
          allocate(xscav_frac1(maxpart,maxspec))
Index: src/readwind_ecmwf_mpi.f90
===================================================================
--- src/readwind_ecmwf_mpi.f90	(revision 61e07bac31955a83b2f343eb477aac0514ec1b8d)
+++ src/readwind_ecmwf_mpi.f90	(revision 20963b15051b22eeb381dcf4e824a9104d92717b)
@@ -103,10 +103,10 @@
 
   integer :: isec1(56),isec2(22+nxmax+nymax)
-  real(kind=4) :: zsec4(jpunp)
-  real(kind=4) :: xaux,yaux
-  real(kind=8) :: xauxin,yauxin
-  real,parameter :: eps=1.e-4
-  real(kind=4) :: nsss(0:nxmax-1,0:nymax-1),ewss(0:nxmax-1,0:nymax-1)
-  real :: plev1,pmean,tv,fu,hlev1,ff10m,fflev1,conversion_factor
+  real(sp) :: zsec4(jpunp)
+  real(sp) :: xaux,yaux
+  real(dp) :: xauxin,yauxin
+  real(sp),parameter :: eps=1.e-4
+  real(sp) :: nsss(0:nxmax-1,0:nymax-1),ewss(0:nxmax-1,0:nymax-1)
+  real(sp) :: plev1,pmean,tv,fu,hlev1,ff10m,fflev1,conversion_factor
 
   logical :: hflswitch,strswitch !,readcloud
@@ -123,5 +123,5 @@
 !ZHG test the grib fields that have lcwc without using them
 !  readcloud=.false.
-!hg end
+
   levdiff2=nlev_ec-nwz+1
   iumax=0
Index: src/releaseparticles_mpi.f90
===================================================================
--- src/releaseparticles_mpi.f90	(revision 16b61a5e2d3b1020be1cff080e479ba26f3f7063)
+++ src/releaseparticles_mpi.f90	(revision 20963b15051b22eeb381dcf4e824a9104d92717b)
@@ -216,5 +216,10 @@
               xmass1(ipart,k)=xmass(i,k)/real(npart(i)) &
                    *timecorrect(k)/average_timecorrect
-!             write (*,*) 'xmass1: ',xmass1(ipart,k),ipart,k
+              if (DRYBKDEP.or.WETBKDEP) then ! if there is no scavenging in wetdepo it will be set to 0
+!              if ( henry(k).gt.0 .or. &
+!                   crain_aero(k).gt.0. .or. csnow_aero(k).gt.0. .or. &
+!                   ccn_aero(k).gt.0. .or. in_aero(k).gt.0. )  then
+                xscav_frac1(ipart,k)=-1.
+               endif
 ! Assign certain properties to particle
 !**************************************
@@ -366,5 +371,5 @@
 !Af ind_rel is defined in readcommand.f
 
-            if (ind_rel .eq. 1) then
+            if ((ind_rel .eq. 1).or.(ind_rel .eq. 3).or.(ind_rel .eq. 4)) then
 
 ! Interpolate the air density
Index: src/timemanager_mpi.f90
===================================================================
--- src/timemanager_mpi.f90	(revision a9cf4b1e763458eb1d7f20f9d55d1f5bd8a87da6)
+++ src/timemanager_mpi.f90	(revision 20963b15051b22eeb381dcf4e824a9104d92717b)
@@ -115,9 +115,8 @@
   integer :: ip
   integer :: loutnext,loutstart,loutend
-  integer :: ix,jy,ldeltat,itage,nage
+  integer :: ix,jy,ldeltat,itage,nage,idummy
   integer :: i_nan=0,ii_nan,total_nan_intl=0  !added by mc to check instability in CBL scheme 
   integer :: numpart_tot_mpi ! for summing particles on all processes
-  real :: outnum,weight,prob(maxspec)
-  real :: decfact
+  real :: outnum,weight,prob(maxspec), prob_rec(maxspec), decfact,wetscav
 
   real(sp) :: gridtotalunc
@@ -125,4 +124,5 @@
        & drydeposit(maxspec)=0_dep_prec
   real :: xold,yold,zold,xmassfract
+  real :: grfraction(3)
   real, parameter :: e_inv = 1.0/exp(1.0)
 
@@ -159,4 +159,6 @@
 !CGZ-lifetime: set lifetime to 0
 
+  if (.not.lusekerneloutput) write(*,*) 'Not using the kernel'
+  if (turboff) write(*,*) 'Turbulence switched off'
 
 
@@ -708,4 +710,40 @@
         zold=ztra1(j)
 
+   
+  ! RECEPTOR: dry/wet depovel
+  !****************************
+  ! Before the particle is moved 
+  ! the calculation of the scavenged mass shall only be done once after release
+  ! xscav_frac1 was initialised with a negative value
+
+      if  (DRYBKDEP) then
+       do ks=1,nspec
+         if  ((xscav_frac1(j,ks).lt.0)) then
+            call get_vdep_prob(itime,xtra1(j),ytra1(j),ztra1(j),prob_rec)
+            if (DRYDEPSPEC(ks)) then        ! dry deposition
+               xscav_frac1(j,ks)=prob_rec(ks)
+             else
+                xmass1(j,ks)=0.
+                xscav_frac1(j,ks)=0.
+             endif
+         endif
+        enddo
+       endif
+
+       if (WETBKDEP) then 
+       do ks=1,nspec
+         if  ((xscav_frac1(j,ks).lt.0)) then
+            call get_wetscav(itime,lsynctime,loutnext,j,ks,grfraction,idummy,idummy,wetscav)
+            if (wetscav.gt.0) then
+                xscav_frac1(j,ks)=wetscav* &
+                       (zpoint2(npoint(j))-zpoint1(npoint(j)))*grfraction(1)
+            else
+                xmass1(j,ks)=0.
+                xscav_frac1(j,ks)=0.
+            endif
+         endif
+        enddo
+       endif
+
 ! Integrate Lagevin equation for lsynctime seconds
 !*************************************************
