Index: src/com_mod.f90
===================================================================
--- src/com_mod.f90	(revision 43225d1710d944723a5d9f0d0d27ea2cd9d5d0f0)
+++ src/com_mod.f90	(revision 6b22af900a57ac3fc1a984db76f4ef2cb0436af0)
@@ -732,5 +732,5 @@
   integer :: count_clock, count_clock0,  count_rate, count_max
   real    :: tins
-  logical, parameter :: nmlout=.false.
+  logical, parameter :: nmlout=.true.
 
   ! These variables are used to avoid having separate versions of
Index: src/concoutput.f90
===================================================================
--- src/concoutput.f90	(revision b069789750d732a1423ad6d9725c05a10cfd55c5)
+++ src/concoutput.f90	(revision 6b22af900a57ac3fc1a984db76f4ef2cb0436af0)
@@ -118,5 +118,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
@@ -129,5 +129,4 @@
       if (ierr.ne.0) exit
       write(unit=unittmp, fmt='(a)', iostat=ierr, advance='yes') trim(dates_char)
-!      if (ierr.ne.0) write(*,*) "Write error, ", ierr
     end do
     close(unit=unitdates)
Index: src/makefile
===================================================================
--- src/makefile	(revision adf46aef78fd55bafe1d788207a46de7fc428d1d)
+++ src/makefile	(revision 6b22af900a57ac3fc1a984db76f4ef2cb0436af0)
@@ -39,5 +39,5 @@
 
 ifeq ($(gcc), 4.9)
-# Compiled libraries under user user ~flexpart, gfortran v4.9
+# Compiled libraries under users ~flexpart (or ~espen), gfortran v4.9
 	ROOT_DIR = /homevip/flexpart/
 #	ROOT_DIR = /homevip/espen/
@@ -70,5 +70,5 @@
 LIBS = -lgrib_api_f90 -lgrib_api -lm -ljasper -lnetcdff -llapack  # -fopenmp # -llapack
 
-FFLAGS   = -I$(INCPATH1) -I$(INCPATH2) -O$(O_LEV) -g -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -fmessage-length=0 -flto=jobserver -O$(O_LEV) -mtune=native $(FUSER) # -march=native
+FFLAGS   = -I$(INCPATH1) -I$(INCPATH2) -O$(O_LEV) -g -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -fmessage-length=0 -flto=jobserver -O$(O_LEV) $(FUSER) # -march=native
 
 DBGFLAGS = -I$(INCPATH1) -I$(INCPATH2) -O$(O_LEV_DBG) -g3 -ggdb3 -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -fmessage-length=0 -flto=jobserver -O$(O_LEV_DBG) -fbacktrace -Warray-bounds  -Wall -fcheck=all $(FUSER)  #  -ffpe-trap=invalid,overflow,denormal,underflow,zero -fdump-core
@@ -420,5 +420,5 @@
 timemanager_mpi.o: com_mod.o flux_mod.o mpi_mod.o oh_mod.o outg_mod.o \
 	par_mod.o point_mod.o unc_mod.o xmass_mod.o
-verttransform.o: cmapf_mod.o com_mod.o par_mod.o
+verttransform.o: cmapf_mod.o com_mod.o par_mod.o 
 verttransform_gfs.o: cmapf_mod.o com_mod.o par_mod.o
 verttransform_nests.o: com_mod.o par_mod.o
Index: src/mpi_mod.f90
===================================================================
--- src/mpi_mod.f90	(revision f55fdcec0773672ab433a3444e31ed64d4599885)
+++ src/mpi_mod.f90	(revision 6b22af900a57ac3fc1a984db76f4ef2cb0436af0)
@@ -105,5 +105,5 @@
 ! If setting this to .false., numwfmem must be set to 3
 !===============================================================================
-  logical :: lmp_sync=.true. 
+  logical :: lmp_sync=.false. 
 !===============================================================================
 
@@ -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.
 
@@ -214,5 +214,6 @@
       lmp_sync=.true. ! :DBG: eso fix this...
     end if
-! TODO: Add warnings for unimplemented flexpart features
+
+! TODO: Add more warnings for unimplemented flexpart features
 
 ! Set ID of process that calls getfield/readwind. 
@@ -434,5 +435,5 @@
 ! Distribute particle variables from pid0 to all processes.
 ! Called from timemanager
-!
+! *NOT IN USE* at the moment, but can be useful for debugging
 !
 !***********************************************************************
@@ -588,6 +589,6 @@
 ! concentrations/writing output grids.                                         *
 !                                                                              *
-! Currently not in use, as each process calculates concentrations              *
-! separately.                                                                  *
+! Currently *not in use*, as each process calculates concentrations            *
+! separately, but can be useful for debugging                                  *
 !                                                                              *
 ! To use this routine (together with mpif_tm_send_vars) to transfer data       *
@@ -595,5 +596,5 @@
 ! (in timemanager_mpi.f90)                                                     *
 !                                                                              *
-!      if (lroot) tot_numpart=numpart ! root stores total numpart            *
+!      if (lroot) tot_numpart=numpart ! root stores total numpart              *
 !      call mpif_tm_send_dims                                                  *
 !      if (numpart>1) then                                                     *
@@ -605,10 +606,10 @@
 !                                                                              *
 !      if (numpart>0) then                                                     *
-!          if (lroot) numpart = tot_numpart                                  *
+!          if (lroot) numpart = tot_numpart                                    *
 !       call mpif_tm_collect_vars                                              *
 !      end if                                                                  *
 !                                                                              *
-!    Then a section that begins with "if (lroot) ..." will behave like       *
-!    serial flexpart                                                           *
+! Then a section that begins with "if (lroot) ..." will behave like            *
+! serial flexpart                                                              *
 !                                                                              *
 !*******************************************************************************
@@ -2066,3 +2067,77 @@
 
 
+  subroutine set_fields_synthetic()
+!*******************************************************************************
+! DESCRIPTION
+!   Set all meteorological fields to synthetic (usually constant/homogeneous)
+!   values.
+!   Used for validation and error-checking
+!
+! NOTE
+!   This version uses asynchronious communications.
+!
+! VARIABLES
+!   
+!
+! TODO
+!
+!*******************************************************************************
+    use com_mod
+
+    implicit none
+
+    integer, parameter :: li=1, ui=3 ! wfmem indices (i.e, operate on entire field)
+
+
+! Variables transferred at initialization only
+!*********************************************
+!    readclouds=readclouds_
+    oro(:,:)=0.0
+    excessoro(:,:)=0.0
+    lsm(:,:)=0.0
+    xlanduse(:,:,:)=0.0
+!    wftime
+!    numbwf
+!    nmixz
+!    height
+
+! Time-varying fields:
+    uu(:,:,:,li:ui) = 10.0
+    vv(:,:,:,li:ui) = 0.0
+    uupol(:,:,:,li:ui) = 10.0 ! TODO check if ok
+    vvpol(:,:,:,li:ui)=0.0
+    ww(:,:,:,li:ui)=0.
+    tt(:,:,:,li:ui)=300.
+    rho(:,:,:,li:ui)=1.3
+    drhodz(:,:,:,li:ui)=.0
+    tth(:,:,:,li:ui)=0.0
+    qvh(:,:,:,li:ui)=1.0
+    qv(:,:,:,li:ui)=1.0
+
+    pv(:,:,:,li:ui)=1.0
+    clouds(:,:,:,li:ui)=0.0
+
+    clwc(:,:,:,li:ui)=0.0
+    ciwc(:,:,:,li:ui)=0.0
+  
+! 2D fields
+
+    cloudsh(:,:,li:ui)=0.0
+    vdep(:,:,:,li:ui)=0.0
+    ps(:,:,:,li:ui)=1.0e5
+    sd(:,:,:,li:ui)=0.0
+    tcc(:,:,:,li:ui)=0.0
+    tt2(:,:,:,li:ui)=300.
+    td2(:,:,:,li:ui)=250.
+    lsprec(:,:,:,li:ui)=0.0
+    convprec(:,:,:,li:ui)=0.0
+    ustar(:,:,:,li:ui)=1.0
+    wstar(:,:,:,li:ui)=1.0
+    hmix(:,:,:,li:ui)=10000.
+    tropopause(:,:,:,li:ui)=10000.
+    oli(:,:,:,li:ui)=0.01
+    z0=1.0
+ 
+  end subroutine set_fields_synthetic
+
 end module mpi_mod
Index: src/outgrid_init.f90
===================================================================
--- src/outgrid_init.f90	(revision 8a65cb0801b09eb0ae933a1afabbe10361a9021b)
+++ src/outgrid_init.f90	(revision 6b22af900a57ac3fc1a984db76f4ef2cb0436af0)
@@ -205,10 +205,10 @@
     if (stat.ne.0) write(*,*)'ERROR: could not allocate gridunc'
   if (ldirect.gt.0) then
-  allocate(wetgridunc(0:numxgrid-1,0:numygrid-1,maxspec, &
+    allocate(wetgridunc(0:numxgrid-1,0:numygrid-1,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 wetgridunc'
   allocate(drygridunc(0:numxgrid-1,0:numygrid-1,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 drygridunc'
   endif
 
Index: src/par_mod.f90
===================================================================
--- src/par_mod.f90	(revision adf46aef78fd55bafe1d788207a46de7fc428d1d)
+++ src/par_mod.f90	(revision 6b22af900a57ac3fc1a984db76f4ef2cb0436af0)
@@ -210,8 +210,8 @@
   !**************************************************
 
-  integer,parameter :: maxpart=60000000
+  integer,parameter :: maxpart=40000000
 !  integer,parameter :: maxpart=60000000
 !  integer,parameter :: maxpart=120000000
-  integer,parameter :: maxspec=6
+  integer,parameter :: maxspec=1
 
   ! maxpart                 Maximum number of particles
@@ -226,6 +226,6 @@
   ! ---------
   integer,parameter :: maxwf=50000, maxtable=1000, numclass=13, ni=11
-  integer,parameter :: numwfmem=2 ! Serial version/MPI with 2 fields
-  !integer,parameter :: numwfmem=3 ! MPI with 3 fields
+  !integer,parameter :: numwfmem=2 ! Serial version/MPI with 2 fields
+  integer,parameter :: numwfmem=3 ! MPI with 3 fields
 
   ! maxwf                   maximum number of wind fields to be used for simulation
@@ -254,8 +254,7 @@
   !*********************************
 
-  integer,parameter :: maxrand=120000000
-!  integer,parameter :: maxrand=2000000
-!  integer,parameter :: maxrand=20
-
+!  integer,parameter :: maxrand=120000000
+  integer,parameter :: maxrand=200000000
+!
   ! maxrand                 number of random numbers used
   
Index: src/pathnames
===================================================================
--- src/pathnames	(revision 5f9d14aa526df192efa539f87fc409fdeeeee06c)
+++ src/pathnames	(revision 6b22af900a57ac3fc1a984db76f4ef2cb0436af0)
@@ -1,6 +1,12 @@
 ../options/
-../output/
+../out_clwc_leo/
 /
-/xnilu_wrk/flex_wrk/WIND_FIELDS/AVAILABLE_ECMWF_OPER_fields_global
+/xnilu_wrk/flex_wrk/zhg/ECMWF_CLWC/Availables
 ============================================
 
+../options_nikos_backwards/
+/xnilu_wrk/flex_wrk/WIND_FIELDS/AVAILABLE_ECMWF_OPER_fields_global
+/xnilu_wrk/flex_wrk/WIND_FIELDS/NCEP/2010_data_05/AVAILABLE
+
+
+ 
Index: src/timemanager_mpi.f90
===================================================================
--- src/timemanager_mpi.f90	(revision f55fdcec0773672ab433a3444e31ed64d4599885)
+++ src/timemanager_mpi.f90	(revision 6b22af900a57ac3fc1a984db76f4ef2cb0436af0)
@@ -218,6 +218,6 @@
       call mpif_gf_send_vars(memstat)
       call mpif_gf_send_vars_nest(memstat)
-! Version 2  (lmp_sync=.false.) is also used whenever 2 new fields are read (in which
-! case async send/recv is impossible.
+! Version 2  (lmp_sync=.false., see below) is also used whenever 2 new fields are
+! read (as at first time step), in which case async send/recv is impossible.
     else if (.not.lmp_sync.and.lmp_use_reader.and.memstat.ge.32) then
       call mpif_gf_send_vars(memstat)
@@ -233,4 +233,5 @@
 ! READER PROCESS:
       if (memstat.gt.0..and.memstat.lt.32.and.lmp_use_reader.and.lmpreader) then
+        if (mp_dev_mode) write(*,*) 'Reader process: calling mpif_gf_send_vars_async' 
         call mpif_gf_send_vars_async(memstat)
       end if
@@ -249,4 +250,5 @@
       ! at next time step. Issue receive request anyway, cancel at mpif_gf_request
       if (memstat.gt.0.and.lmp_use_reader.and..not.lmpreader) then
+        if (mp_dev_mode) write(*,*) 'Receiving process: calling mpif_gf_send_vars_async. PID: ', mp_pid
         call mpif_gf_recv_vars_async(memstat)
       end if
@@ -256,4 +258,7 @@
     if (mp_measure_time.and..not.(lmpreader.and.lmp_use_reader)) call mpif_mtime('getfields',1)
 
+! For validation and tests: call the function below to set all fields to simple
+! homogeneous values
+    if (mp_dev_mode) call set_fields_synthetic
 
 !*******************************************************************************
