Index: src/FLEXPART_MPI.f90
===================================================================
--- src/FLEXPART_MPI.f90	(revision db712a8ffdd9c478928d0173162055a7c109b178)
+++ src/FLEXPART_MPI.f90	(revision 32b49c31198ae7800bda9ceb9125f98584d75077)
@@ -317,5 +317,6 @@
       print*,'call readpartpositions'
     endif
-    call readpartpositions
+    ! readwind process skips this step
+    if (lmp_use_reader.and..not.lmpreader) call readpartpositions
   else
     if (verbosity.gt.0 .and. lroot) then
Index: src/makefile
===================================================================
--- src/makefile	(revision 1c3c778753e98ff51a55ffe7f8586318c7768f64)
+++ src/makefile	(revision 32b49c31198ae7800bda9ceb9125f98584d75077)
@@ -14,5 +14,5 @@
 # 
 #  USAGE
-#    Compile serial FLEXPART (ECMWF)a
+#    Compile serial FLEXPART (ECMWF)
 #      make [-j] ecmwf
 #
Index: src/mpi_mod.f90
===================================================================
--- src/mpi_mod.f90	(revision ec7fc72438c14086c97319dbcbf75d1e0463ed5f)
+++ src/mpi_mod.f90	(revision 32b49c31198ae7800bda9ceb9125f98584d75077)
@@ -165,5 +165,5 @@
 !***********************************************************************
     use par_mod, only: maxpart, numwfmem, dep_prec
-    use com_mod, only: mpi_mode
+    use com_mod, only: mpi_mode, verbosity
 
     implicit none
@@ -386,4 +386,7 @@
 ! Dynamic allocation of arrays (in serial code these have size maxpart)
 !
+! Not in use anymore, moved to com_mod for interoperability with serial version
+! 
+! TODO: remove 
 !*******************************************************************************
     use com_mod
@@ -1043,5 +1046,5 @@
 !***********************************************************************
     use com_mod
-    use par_mod, only: numwfmem
+    use par_mod,only: numwfmem
 
     implicit none
@@ -1226,5 +1229,5 @@
     integer :: d2s1 = nxmax*nymax
     integer :: d2s2 = nxmax*nymax*maxspec
-    integer :: d1s1 = maxwf
+!    integer :: d1s1 = maxwf
 
 !*******************************************************************************
@@ -1430,4 +1433,8 @@
 ! last read was asynchronous to index 2, 3 is free
       mind=3
+    else
+! illegal state
+      write(*,*) 'mpi_mod> FLEXPART ERROR: Illegal memstat value. Exiting.'
+      stop
     end if
 
@@ -1602,11 +1609,10 @@
 !
 !*******************************************************************************
-    use com_mod, only: readclouds
+!    use com_mod,only: readclouds
 
     implicit none
 
 
-    integer :: n_req
-    integer :: i
+    integer :: n_req !,i
 
 !***********************************************************************
@@ -1958,5 +1964,5 @@
     implicit none
 
-    integer :: ip,j,r
+    integer :: ip !,j,r
 
 !***********************************************************************
Index: src/par_mod.f90
===================================================================
--- src/par_mod.f90	(revision 8ed5f118d620a3361e5c818ce005de62c24d72d9)
+++ src/par_mod.f90	(revision 32b49c31198ae7800bda9ceb9125f98584d75077)
@@ -186,5 +186,5 @@
   !**************************************************
 
-  integer,parameter :: maxpart=10000
+  integer,parameter :: maxpart=4000000
   integer,parameter :: maxspec=1
   real,parameter :: minmass=0.0001
@@ -229,7 +229,6 @@
   !*********************************
 
-!  integer,parameter :: maxrand=120000000
   integer,parameter :: maxrand=200000000
-!
+
   ! maxrand                 number of random numbers used
   
Index: src/readpartpositions_mpi.f90
===================================================================
--- src/readpartpositions_mpi.f90	(revision 5f9d14aa526df192efa539f87fc409fdeeeee06c)
+++ src/readpartpositions_mpi.f90	(revision 32b49c31198ae7800bda9ceb9125f98584d75077)
@@ -45,10 +45,11 @@
   use com_mod
   use random_mod, only: ran1
-  use mpi_mod, only: mp_seed
+  use mpi_mod !, only: mp_seed
 
   implicit none
 
-  integer :: ibdatein,ibtimein,nspecin,itimein,numpointin,i,j,ix
+  integer :: ibdatein,ibtimein,nspecin,itimein,numpointin,i,j,ix,ip
   integer :: id1,id2,it1,it2
+  integer :: addone,numparticlecount_all,numpart_all,lbnd,ubnd
   real :: xlonin,ylatin,topo,hmixi,pvi,qvi,rhoi,tri,tti
   character :: specin*7
@@ -57,77 +58,138 @@
   integer :: idummy = -8
 
+  ! These variables are allocated at the root process for all particles in file.
+  real,dimension(maxpart) :: xtra1_all,ytra1_all,ztra1_all
+  real,dimension(maxpart,maxspec) :: xmass1_all
+  integer,dimension(maxpart) :: npoint_all,itramem_all
+
   ! Different seed for each process
   idummy=idummy+mp_seed
 
   numparticlecount=0
+  numparticlecount_all=0
+  numpart_all=0
 
   ! Open header file of dumped particle data
-  !*****************************************
-
-  open(unitpartin,file=path(2)(1:length(2))//'header', &
-       form='unformatted',err=998)
-
-  read(unitpartin) ibdatein,ibtimein
-  read(unitpartin)
-  read(unitpartin)
-
-  read(unitpartin)
-  read(unitpartin)
-  read(unitpartin) nspecin
-  nspecin=nspecin/3
-  if ((ldirect.eq.1).and.(nspec.ne.nspecin)) goto 997
-
-  do i=1,nspecin
-    read(unitpartin)
-    read(unitpartin)
-    read(unitpartin) j,specin
-    if ((ldirect.eq.1).and.(species(i)(1:7).ne.specin)) goto 996
+  ! Each MPI process sequentially access file (just in case)
+  !*********************************************************
+
+  do ip=0, mp_partgroup_np-1
+    call mpif_mpi_barrier
+    open(unitpartin,file=path(2)(1:length(2))//'header', &
+         form='unformatted',err=998)
+
+    read(unitpartin) ibdatein,ibtimein
+    read(unitpartin)
+    read(unitpartin)
+
+    read(unitpartin)
+    read(unitpartin)
+    read(unitpartin) nspecin
+    nspecin=nspecin/3
+    if ((ldirect.eq.1).and.(nspec.ne.nspecin)) goto 997
+
+    do i=1,nspecin
+      read(unitpartin)
+      read(unitpartin)
+      read(unitpartin) j,specin
+      if ((ldirect.eq.1).and.(species(i)(1:7).ne.specin)) goto 996
+    end do
+    
+    read(unitpartin) numpointin
+    if (numpointin.ne.numpoint) then ! goto 995
+
+! eso 2016: moved this warning here to avoid out-of-block goto
+!995   write(*,*) ' #### FLEXPART MODEL WARNING IN READPARTPOSITIONS#### '
+      write(*,*) ' #### FLEXPART MODEL WARNING IN READPARTPOSITIONS#### '
+      write(*,*) ' #### NUMBER OF RELEASE LOCATIONS DOES NOT     #### '
+      write(*,*) ' #### AGREE WITH CURRENT SETTINGS!             #### '
+!  stop
+      goto 999 
+    end if
+
+999 continue 
+    do i=1,numpointin
+      read(unitpartin)
+      read(unitpartin)
+      read(unitpartin)
+      read(unitpartin)
+      do j=1,nspec
+        read(unitpartin)
+        read(unitpartin)
+        read(unitpartin)
+      end do
+    end do
+    read(unitpartin)
+    read(unitpartin)
+
+    do ix=0,numxgrid-1
+      read(unitpartin)
+    end do
+    close(unitpartin)
+
+
+  ! Open data file of dumped particle data
+  ! All processes read the whole file
+  !***************************************
+
+  open(unitpartin,file=path(2)(1:length(2))//'partposit_end', &
+         form='unformatted',err=998)
+    
+100 read(unitpartin,end=99) itimein
+    i=0
+200 i=i+1
+    read(unitpartin) npoint_all(i),xlonin,ylatin,ztra1_all(i),itramem_all(i), &
+         topo,pvi,qvi,rhoi,hmixi,tri,tti,(xmass1_all(i,j),j=1,nspec)
+    
+    if (xlonin.eq.-9999.9) goto 100
+    xtra1_all(i)=(xlonin-xlon0)/dx
+    ytra1_all(i)=(ylatin-ylat0)/dy
+    numparticlecount_all=max(numparticlecount_all,npoint(i))
+    goto 200
+
+99  numpart_all=i-1
+    
+    close(unitpartin)
+
   end do
 
-  read(unitpartin) numpointin
-  if (numpointin.ne.numpoint) goto 995
-999 continue 
-  do i=1,numpointin
-    read(unitpartin)
-    read(unitpartin)
-    read(unitpartin)
-    read(unitpartin)
-    do j=1,nspec
-      read(unitpartin)
-      read(unitpartin)
-      read(unitpartin)
-    end do
+
+  ! Distribute particles among processes
+  !**************************************
+  lbnd=1
+  ubnd=0
+
+  do ip=0, mp_partgroup_np-1
+    
+! Extra particle distributed in case remainder in the division
+    if (ip.lt.mod(numpart_all,mp_partgroup_np)) then
+      addone=1
+    else
+      addone=0
+    end if
+
+    if (ip==0) then 
+      ubnd=ubnd + numpart_all/mp_partgroup_np + addone
+    else 
+      ubnd=lbnd + numpart_all/mp_partgroup_np + addone - 1
+    end if
+    
+    if (ip==mp_pid) then
+      
+      numparticlecount=numparticlecount_all/mp_partgroup_np+addone
+      numpart=numpart_all/mp_partgroup_np+addone
+
+      xtra1(1:numpart) = xtra1_all(lbnd:ubnd)
+      ytra1(1:numpart) = ytra1_all(lbnd:ubnd)
+      ztra1(1:numpart) = ztra1_all(lbnd:ubnd)
+      xmass1(1:numpart,:) = xmass1_all(lbnd:ubnd,:)
+      npoint(1:numpart) = npoint_all(lbnd:ubnd)
+      itramem(1:numpart) = itramem_all(lbnd:ubnd)
+
+    end if
+
+    lbnd=ubnd+1
+
   end do
-  read(unitpartin)
-  read(unitpartin)
-
-  do ix=0,numxgrid-1
-    read(unitpartin)
-  end do
-
-
-  ! Open data file of dumped particle data
-  !***************************************
-
-  close(unitpartin)
-  open(unitpartin,file=path(2)(1:length(2))//'partposit_end', &
-       form='unformatted',err=998)
-
-
-100   read(unitpartin,end=99) itimein
-    i=0
-200   i=i+1
-    read(unitpartin) npoint(i),xlonin,ylatin,ztra1(i),itramem(i), &
-         topo,pvi,qvi,rhoi,hmixi,tri,tti,(xmass1(i,j),j=1,nspec)
-
-    if (xlonin.eq.-9999.9) goto 100
-    xtra1(i)=(xlonin-xlon0)/dx
-    ytra1(i)=(ylatin-ylat0)/dy
-    numparticlecount=max(numparticlecount,npoint(i))
-    goto 200
-
-99   numpart=i-1
-
-  close(unitpartin)
 
   julin=juldate(ibdatein,ibtimein)+real(itimein,kind=dp)/86400._dp
@@ -156,11 +218,4 @@
   stop
 
-!995   write(*,*) ' #### FLEXPART MODEL ERROR IN READPARTPOSITIONS#### '
-995   write(*,*) ' #### FLEXPART MODEL WARNING IN READPARTPOSITIONS#### '
-  write(*,*) ' #### NUMBER OF RELEASE LOCATIONS DOES NOT     #### '
-  write(*,*) ' #### AGREE WITH CURRENT SETTINGS!             #### '
-!  stop
-  goto 999 
-
 996   write(*,*) ' #### FLEXPART MODEL ERROR IN READPARTPOSITIONS#### '
   write(*,*) ' #### SPECIES NAMES TO BE READ IN DO NOT       #### '
Index: src/readspecies.f90
===================================================================
--- src/readspecies.f90	(revision ec7fc72438c14086c97319dbcbf75d1e0463ed5f)
+++ src/readspecies.f90	(revision 32b49c31198ae7800bda9ceb9125f98584d75077)
@@ -151,5 +151,5 @@
 !  write(*,*) density(pos_spec)
     read(unitspecies,'(e18.1)',end=22) dquer(pos_spec)
-    write(*,*) 'dquer(pos_spec):', dquer(pos_spec)
+!    write(*,*) 'dquer(pos_spec):', dquer(pos_spec)
     read(unitspecies,'(e18.1)',end=22) dsigma(pos_spec)
 !  write(*,*) dsigma(pos_spec)
Index: src/timemanager_mpi.f90
===================================================================
--- src/timemanager_mpi.f90	(revision ec7fc72438c14086c97319dbcbf75d1e0463ed5f)
+++ src/timemanager_mpi.f90	(revision 32b49c31198ae7800bda9ceb9125f98584d75077)
@@ -104,5 +104,5 @@
 
   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
+  integer :: j,ks,kp,l,n,itime=0,nstop,nstop1,memstat=0 !,mind
 ! integer :: ksp
   integer :: ip
@@ -115,5 +115,6 @@
 
   real(sp) :: gridtotalunc
-  real(dep_prec) :: drygridtotalunc,wetgridtotalunc,drydeposit(maxspec)
+  real(dep_prec) :: drygridtotalunc=0_dep_prec,wetgridtotalunc=0_dep_prec,&
+       & drydeposit(maxspec)=0_dep_prec
   real :: xold,yold,zold,xmassfract
   real, parameter :: e_inv = 1.0/exp(1.0)
@@ -137,7 +138,7 @@
 
 !  itime=0
-  if (lroot) then
-  !  write(*,45) itime,numpart*mp_partgroup_np,gridtotalunc,wetgridtotalunc,drygridtotalunc
-    write(*,46) float(itime)/3600,itime,numpart*mp_partgroup_np
+  if (lroot.or.mp_dev_mode) then
+    write(*,45) itime,numpart*mp_partgroup_np,gridtotalunc,wetgridtotalunc,drygridtotalunc
+  !  write(*,46) float(itime)/3600,itime,numpart*mp_partgroup_np
     
     if (verbosity.gt.0) then
@@ -275,5 +276,5 @@
 ! For validation and tests: call the function below to set all fields to simple
 ! homogeneous values
-    if (mp_dev_mode) call set_fields_synthetic
+!    if (mp_dev_mode) call set_fields_synthetic
 
 !*******************************************************************************
@@ -554,5 +555,5 @@
         
         !CGZ-lifetime: output species lifetime
-        if (lroot) then
+        if (lroot.or.mp_dev_mode) then
         !   write(*,*) 'Overview species lifetime in days', &
         !        real((species_lifetime(:,1)/species_lifetime(:,2))/real(3600.0*24.0))
