Index: src/FLEXPART.f90
===================================================================
--- src/FLEXPART.f90	(revision 6ecb30a41fb8a07e153abadc712699a09c15f90c)
+++ src/FLEXPART.f90	(revision d8eed026ebec594e9a91de6c6fbc45b354a0e4b2)
@@ -82,5 +82,5 @@
   ! FLEXPART version string
   flexversion_major = '10' ! Major version number, also used for species file names
-  flexversion='Version '//trim(flexversion_major)//'.1beta (2016-11-02)'
+  flexversion='Version '//trim(flexversion_major)//'.2beta (2017-08-01)'
   verbosity=0
 
Index: src/FLEXPART_MPI.f90
===================================================================
--- src/FLEXPART_MPI.f90	(revision 6ecb30a41fb8a07e153abadc712699a09c15f90c)
+++ src/FLEXPART_MPI.f90	(revision d8eed026ebec594e9a91de6c6fbc45b354a0e4b2)
@@ -92,5 +92,5 @@
   ! FLEXPART version string
   flexversion_major = '10' ! Major version number, also used for species file names
-  flexversion='Ver. '//trim(flexversion_major)//'.1beta MPI (2016-11-02)'
+  flexversion='Ver. '//trim(flexversion_major)//'.2beta MPI (2017-08-01)'
   verbosity=0
 
Index: src/calcmatrix.f90
===================================================================
--- src/calcmatrix.f90	(revision 6ecb30a41fb8a07e153abadc712699a09c15f90c)
+++ src/calcmatrix.f90	(revision d8eed026ebec594e9a91de6c6fbc45b354a0e4b2)
@@ -100,6 +100,6 @@
     do kk=1,nconvlev
       fmassfrac(k,kk)=0.
-    enddo
-  enddo
+    end do
+  end do
 
 
Index: src/gridcheck_gfs.f90
===================================================================
--- src/gridcheck_gfs.f90	(revision 6ecb30a41fb8a07e153abadc712699a09c15f90c)
+++ src/gridcheck_gfs.f90	(revision d8eed026ebec594e9a91de6c6fbc45b354a0e4b2)
@@ -231,4 +231,7 @@
        yaux2in,iret)
   call grib_check(iret,gribFunction,gribErrorMsg)
+
+  ! Fix for flexpart.eu ticket #48
+  if (xaux2in.lt.0) xaux2in = 359.0
 
   xaux1=xaux1in
Index: src/makefile
===================================================================
--- src/makefile	(revision 6ecb30a41fb8a07e153abadc712699a09c15f90c)
+++ src/makefile	(revision d8eed026ebec594e9a91de6c6fbc45b354a0e4b2)
@@ -81,9 +81,9 @@
 LIBS = -lgrib_api_f90 -lgrib_api -lm -ljasper -lnetcdff # -fopenmp
 
-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)  #-Warray-bounds -fcheck=all # -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   -Wall  -fdump-core $(FUSER)  #  -ffpe-trap=invalid,overflow,denormal,underflow,zero  -Warray-bounds -fcheck=all
-
-LDFLAGS  = $(FFLAGS) -L$(LIBPATH1) $(LIBS) #-L$(LIBPATH2)
+FFLAGS   = -I$(INCPATH1) -I$(INCPATH2) -O$(O_LEV) -g -cpp -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -fmessage-length=0 -flto=jobserver -O$(O_LEV) $(FUSER)  #-Warray-bounds -fcheck=all # -march=native
+
+DBGFLAGS = -I$(INCPATH1) -I$(INCPATH2) -O$(O_LEV_DBG) -g3 -ggdb3 -cpp -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -fmessage-length=0 -flto=jobserver -O$(O_LEV_DBG) -fbacktrace   -Wall  -fdump-core $(FUSER)  #  -ffpe-trap=invalid,overflow,denormal,underflow,zero  -Warray-bounds -fcheck=all
+
+LDFLAGS  = $(FFLAGS) -L$(LIBPATH1) -Wl,-rpath,$(LIBPATH1) $(LIBS) #-L$(LIBPATH2)
 LDDEBUG  = $(DBGFLAGS) -L$(LIBPATH1) $(LIBS) #-L$(LIBPATH2)
 
Index: src/par_mod.f90
===================================================================
--- src/par_mod.f90	(revision 6ecb30a41fb8a07e153abadc712699a09c15f90c)
+++ src/par_mod.f90	(revision d8eed026ebec594e9a91de6c6fbc45b354a0e4b2)
@@ -142,13 +142,10 @@
   
 !  integer,parameter :: nxmax=361,nymax=181,nuvzmax=92,nwzmax=92,nzmax=92 !ECMWF new 
-!  integer,parameter :: nxmax=361,nymax=181,nuvzmax=138,nwzmax=138,nzmax=138 !ECMWF new 
-
-  integer,parameter :: nxmax=181,nymax=91,nuvzmax=138,nwzmax=138,nzmax=138 !ECMWF new 
+  integer,parameter :: nxmax=361,nymax=181,nuvzmax=138,nwzmax=138,nzmax=138 !ECMWF new 
+
+!  integer,parameter :: nxmax=181,nymax=91,nuvzmax=138,nwzmax=138,nzmax=138 !ECMWF new 
 
 !  INTEGER,PARAMETER :: nxmax=361,nymax=181,nuvzmax=138,nwzmax=138,nzmax=138 !NCEP data
 
-!  !integer,parameter :: nxshift=359  ! for ECMWF
-!  integer,parameter :: nxshift=0     ! for GFS
-!  integer,parameter :: nxmax=15,nymax=15,nuvzmax=140,nwzmax=140,nzmax=140
 !  integer,parameter :: nxshift=359  ! for ECMWF
   integer,parameter :: nxshift=0     ! for GFS
@@ -158,5 +155,5 @@
   !*********************************************
 
-  integer,parameter :: maxnests=0,nxmaxn=451,nymaxn=226
+  integer,parameter :: maxnests=1,nxmaxn=451,nymaxn=226
 
   ! nxmax,nymax        maximum dimension of wind fields in x and y
@@ -293,7 +290,4 @@
   integer,parameter ::  icmv=-9999
 
-! Parameters for testing
-!*******************************************
-!  integer :: verbosity=0
 
 end module par_mod
Index: src/timemanager_mpi.f90
===================================================================
--- src/timemanager_mpi.f90	(revision 6ecb30a41fb8a07e153abadc712699a09c15f90c)
+++ src/timemanager_mpi.f90	(revision d8eed026ebec594e9a91de6c6fbc45b354a0e4b2)
@@ -86,4 +86,5 @@
 ! xtra1(maxpart), ytra1(maxpart), ztra1(maxpart) =                           *
 !                    spatial positions of trajectories                       *
+! metdata_format     format of metdata (ecmwf/gfs)                           *
 !                                                                            *
 ! Constants:                                                                 *
@@ -106,4 +107,5 @@
   implicit none
 
+  integer :: metdata_format
   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
@@ -349,5 +351,5 @@
         write (*,*) 'timemanager> call convmix -- forward'
       endif
-      call convmix(itime)
+      call convmix(itime,metdata_format)
     endif
 
