Index: src/interpol_rain.f90
===================================================================
--- src/interpol_rain.f90	(revision c7e771d7de021b45aeef132bb2857bf7e012e216)
+++ src/interpol_rain.f90	(revision 0ecc1fed9f7c7c07cef687094373915d51c69489)
@@ -56,5 +56,5 @@
   ! ix,jy                x,y coordinates of lower left subgrid point          *
   ! level                level at which interpolation shall be done           *
-  ! memind(3)            points to the places of the wind fields              *
+  ! iwftouse             points to the place of the wind field                *
   ! nx,ny                actual field dimensions in x,y and z direction       *
   ! nxmax,nymax,nzmax    maximum field dimensions in x,y and z direction      *
Index: src/interpol_rain_nests.f90
===================================================================
--- src/interpol_rain_nests.f90	(revision db712a8ffdd9c478928d0173162055a7c109b178)
+++ src/interpol_rain_nests.f90	(revision 0ecc1fed9f7c7c07cef687094373915d51c69489)
@@ -21,5 +21,5 @@
 
 subroutine interpol_rain_nests(yy1,yy2,yy3,nxmaxn,nymaxn,nzmax, &
-       maxnests,ngrid,nxn,nyn,memind,xt,yt,level,itime1,itime2,itime, &
+       maxnests,ngrid,nxn,nyn,iwftouse,xt,yt,level,itime1,itime2,itime, &
        yint1,yint2,yint3)
   !                                i   i   i    i      i      i
@@ -60,5 +60,5 @@
   ! ix,jy                x,y coordinates of lower left subgrid point          *
   ! level                level at which interpolation shall be done           *
-  ! memind(3)            points to the places of the wind fields              *
+  ! iwftouse             points to the place of the wind field                *
   ! nx,ny                actual field dimensions in x,y and z direction       *
   ! nxmax,nymax,nzmax    maximum field dimensions in x,y and z direction      *
@@ -75,5 +75,5 @@
 
   integer :: maxnests,ngrid
-  integer :: nxn(maxnests),nyn(maxnests),nxmaxn,nymaxn,nzmax,memind(numwfmem)
+  integer :: nxn(maxnests),nyn(maxnests),nxmaxn,nymaxn,nzmax,iwftouse
   integer :: m,ix,jy,ixp,jyp,itime,itime1,itime2,level,indexh
   real :: yy1(0:nxmaxn-1,0:nymaxn-1,nzmax,numwfmem,maxnests)
@@ -125,20 +125,21 @@
   !***********************
 
-  do m=1,2
-    indexh=memind(m)
+!  do m=1,2
+!    indexh=memind(m)
+    indexh=iwftouse
 
-    y1(m)=p1*yy1(ix ,jy ,level,indexh,ngrid) &
+    y1(1)=p1*yy1(ix ,jy ,level,indexh,ngrid) &
          + p2*yy1(ixp,jy ,level,indexh,ngrid) &
          + p3*yy1(ix ,jyp,level,indexh,ngrid) &
          + p4*yy1(ixp,jyp,level,indexh,ngrid)
-    y2(m)=p1*yy2(ix ,jy ,level,indexh,ngrid) &
+    y2(1)=p1*yy2(ix ,jy ,level,indexh,ngrid) &
          + p2*yy2(ixp,jy ,level,indexh,ngrid) &
          + p3*yy2(ix ,jyp,level,indexh,ngrid) &
          + p4*yy2(ixp,jyp,level,indexh,ngrid)
-    y3(m)=p1*yy3(ix ,jy ,level,indexh,ngrid) &
+    y3(1)=p1*yy3(ix ,jy ,level,indexh,ngrid) &
          + p2*yy3(ixp,jy ,level,indexh,ngrid) &
          + p3*yy3(ix ,jyp,level,indexh,ngrid) &
          + p4*yy3(ixp,jyp,level,indexh,ngrid)
-  end do
+!  end do
 
 
@@ -147,12 +148,15 @@
   !************************************
 
-  dt1=real(itime-itime1)
-  dt2=real(itime2-itime)
-  dt=dt1+dt2
+  ! dt1=real(itime-itime1)
+  ! dt2=real(itime2-itime)
+  ! dt=dt1+dt2
 
-  yint1=(y1(1)*dt2+y1(2)*dt1)/dt
-  yint2=(y2(1)*dt2+y2(2)*dt1)/dt
-  yint3=(y3(1)*dt2+y3(2)*dt1)/dt
+  ! yint1=(y1(1)*dt2+y1(2)*dt1)/dt
+  ! yint2=(y2(1)*dt2+y2(2)*dt1)/dt
+  ! yint3=(y3(1)*dt2+y3(2)*dt1)/dt
 
+   yint1=y1(1)
+   yint2=y2(1)
+   yint3=y3(1)
 
 end subroutine interpol_rain_nests
Index: src/mpi_mod.f90
===================================================================
--- src/mpi_mod.f90	(revision c2bd55ea39cbd0be88e7e8329b1c9c4e01754957)
+++ src/mpi_mod.f90	(revision 0ecc1fed9f7c7c07cef687094373915d51c69489)
@@ -2536,4 +2536,5 @@
 ! if (mp_ierr /= 0) goto 600
 
+#ifdef USE_MPIINPLACE
 ! Using in-place reduction
     if (lroot) then
@@ -2544,5 +2545,14 @@
       call MPI_Reduce(griduncn, 0, grid_size3d, mp_sp, MPI_SUM, id_root, &
            & mp_comm_used, mp_ierr)
-    end if
+      if (mp_ierr /= 0) goto 600
+    end if
+
+#else
+    call MPI_Reduce(griduncn, griduncn0, grid_size3d, mp_sp, MPI_SUM, id_root, &
+         & mp_comm_used, mp_ierr)
+    if (mp_ierr /= 0) goto 600
+    if (lroot) griduncn = griduncn0
+
+#endif
 
     if ((WETDEP).and.(ldirect.gt.0)) then
Index: src/netcdf_output_mod.f90
===================================================================
--- src/netcdf_output_mod.f90	(revision c2bd55ea39cbd0be88e7e8329b1c9c4e01754957)
+++ src/netcdf_output_mod.f90	(revision 0ecc1fed9f7c7c07cef687094373915d51c69489)
@@ -273,5 +273,4 @@
   character(len=3)            :: anspec
   CHARACTER                   :: adate*8,atime*6,timeunit*32
-  ! ESO DBG: WHY IS THIS HARDCODED TO 1000?
   !REAL, DIMENSION(1000)       :: coord
   real, allocatable, dimension(:) :: coord
Index: src/outgrid_init.f90
===================================================================
--- src/outgrid_init.f90	(revision 6ecb30a41fb8a07e153abadc712699a09c15f90c)
+++ src/outgrid_init.f90	(revision 0ecc1fed9f7c7c07cef687094373915d51c69489)
@@ -210,33 +210,37 @@
   allocate(gridunc(0:numxgrid-1,0:numygrid-1,numzgrid,maxspec, &
        maxpointspec_act,nclassunc,maxageclass),stat=stat)
-    if (stat.ne.0) write(*,*)'ERROR: could not allocate gridunc'
+  if (stat.ne.0) write(*,*)'ERROR: could not allocate gridunc'
   if (ldirect.gt.0) then
     allocate(wetgridunc(0:numxgrid-1,0:numygrid-1,maxspec, &
-       maxpointspec_act,nclassunc,maxageclass),stat=stat)
+         maxpointspec_act,nclassunc,maxageclass),stat=stat)
     if (stat.ne.0) write(*,*)'ERROR: could not allocate wetgridunc'
-  allocate(drygridunc(0:numxgrid-1,0:numygrid-1,maxspec, &
-       maxpointspec_act,nclassunc,maxageclass),stat=stat)
+    allocate(drygridunc(0:numxgrid-1,0:numygrid-1,maxspec, &
+         maxpointspec_act,nclassunc,maxageclass),stat=stat)
     if (stat.ne.0) write(*,*)'ERROR: could not allocate drygridunc'
   endif
 
+#ifdef USE_MPIINPLACE
+#else
 ! Extra field for totals at MPI root process
   if (lroot.and.mpi_mode.gt.0) then
-
-#ifdef USE_MPIINPLACE
-#else
-    ! If MPI_IN_PLACE option is not used in mpi_mod.f90::mpif_tm_reduce_grid(),
-    ! then an aux array is needed for parallel grid reduction
+! If MPI_IN_PLACE option is not used in mpi_mod.f90::mpif_tm_reduce_grid(),
+! then an aux array is needed for parallel grid reduction
     allocate(gridunc0(0:numxgrid-1,0:numygrid-1,numzgrid,maxspec, &
          maxpointspec_act,nclassunc,maxageclass),stat=stat)
     if (stat.ne.0) write(*,*)'ERROR: could not allocate gridunc0'
+  else if (.not.lroot.and.mpi_mode.gt.0) then
+    allocate(gridunc0(1,1,1,1,1,1,1),stat=stat)
+    if (stat.ne.0) write(*,*)'ERROR: could not allocate gridunc0'
+  end if
 #endif
-    if (ldirect.gt.0) then
-      allocate(wetgridunc0(0:numxgrid-1,0:numygrid-1,maxspec, &
-           maxpointspec_act,nclassunc,maxageclass),stat=stat)
-      if (stat.ne.0) write(*,*)'ERROR: could not allocate wetgridunc0'
-      allocate(drygridunc0(0:numxgrid-1,0:numygrid-1,maxspec, &
-           maxpointspec_act,nclassunc,maxageclass),stat=stat)
-      if (stat.ne.0) write(*,*)'ERROR: could not allocate drygridunc0'
-    endif
+!  if (ldirect.gt.0) then
+  if (lroot.and.mpi_mode.gt.0) then
+    allocate(wetgridunc0(0:numxgrid-1,0:numygrid-1,maxspec, &
+         maxpointspec_act,nclassunc,maxageclass),stat=stat)
+    if (stat.ne.0) write(*,*)'ERROR: could not allocate wetgridunc0'
+    allocate(drygridunc0(0:numxgrid-1,0:numygrid-1,maxspec, &
+         maxpointspec_act,nclassunc,maxageclass),stat=stat)
+    if (stat.ne.0) write(*,*)'ERROR: could not allocate drygridunc0'
+  
 ! allocate a dummy to avoid compilator complaints
   else if (.not.lroot.and.mpi_mode.gt.0) then
Index: src/outgrid_init_nest.f90
===================================================================
--- src/outgrid_init_nest.f90	(revision 8a65cb0801b09eb0ae933a1afabbe10361a9021b)
+++ src/outgrid_init_nest.f90	(revision 0ecc1fed9f7c7c07cef687094373915d51c69489)
@@ -69,18 +69,27 @@
   endif
 
+#ifdef USE_MPIINPLACE
+#else
 ! Extra field for totals at MPI root process
   if (lroot.and.mpi_mode.gt.0) then
-    ! allocate(griduncn0(0:numxgridn-1,0:numygridn-1,numzgrid,maxspec, &
-    !      maxpointspec_act,nclassunc,maxageclass),stat=stat)
-    ! if (stat.ne.0) write(*,*)'ERROR:could not allocate nested gridunc'
-
-    if (ldirect.gt.0) then
-      allocate(wetgriduncn0(0:numxgridn-1,0:numygridn-1,maxspec, &
-           maxpointspec_act,nclassunc,maxageclass),stat=stat)
-      if (stat.ne.0) write(*,*)'ERROR:could not allocate nested gridunc'
-      allocate(drygriduncn0(0:numxgridn-1,0:numygridn-1,maxspec, &
-           maxpointspec_act,nclassunc,maxageclass),stat=stat)
-      if (stat.ne.0) write(*,*)'ERROR:could not allocate nested gridunc'
-    endif
+! If MPI_IN_PLACE option is not used in mpi_mod.f90::mpif_tm_reduce_grid_nest(),
+! then an aux array is needed for parallel grid reduction
+    allocate(griduncn0(0:numxgridn-1,0:numygridn-1,numzgrid,maxspec, &
+         maxpointspec_act,nclassunc,maxageclass),stat=stat)
+    if (stat.ne.0) write(*,*)'ERROR:could not allocate nested gridunc'
+! allocate a dummy to avoid compilator complaints
+  else if (.not.lroot.and.mpi_mode.gt.0) then
+    allocate(griduncn0(1,1,1,1,1,1,1),stat=stat)
+  end if
+#endif
+!    if (ldirect.gt.0) then
+  if (lroot.and.mpi_mode.gt.0) then
+    allocate(wetgriduncn0(0:numxgridn-1,0:numygridn-1,maxspec, &
+         maxpointspec_act,nclassunc,maxageclass),stat=stat)
+    if (stat.ne.0) write(*,*)'ERROR:could not allocate nested gridunc'
+    allocate(drygriduncn0(0:numxgridn-1,0:numygridn-1,maxspec, &
+         maxpointspec_act,nclassunc,maxageclass),stat=stat)
+    if (stat.ne.0) write(*,*)'ERROR:could not allocate nested gridunc'
+!  endif
 ! allocate a dummy to avoid compilator complaints
   else if (.not.lroot.and.mpi_mode.gt.0) then
Index: src/unc_mod.f90
===================================================================
--- src/unc_mod.f90	(revision 6ecb30a41fb8a07e153abadc712699a09c15f90c)
+++ src/unc_mod.f90	(revision 0ecc1fed9f7c7c07cef687094373915d51c69489)
@@ -38,4 +38,5 @@
   ! then an aux array is needed for parallel grid reduction
   real,allocatable, dimension (:,:,:,:,:,:,:) :: gridunc0
+  real,allocatable, dimension (:,:,:,:,:,:,:) :: griduncn0
 #endif
   real,allocatable, dimension (:,:,:,:,:,:,:) :: griduncn
