Index: src/FLEXPART.f90
===================================================================
--- src/FLEXPART.f90	(revision a9cf4b1e763458eb1d7f20f9d55d1f5bd8a87da6)
+++ src/FLEXPART.f90	(revision 77778f8da97550749c019c9f1fc9634c072c42f4)
@@ -86,5 +86,5 @@
   ! FLEXPART version string
   flexversion_major = '10' ! Major version number, also used for species file names
-  flexversion='Version '//trim(flexversion_major)//'.2beta (2017-08-01)'
+  flexversion='Version '//trim(flexversion_major)//'.3beta (2018-06-08)'
   verbosity=0
 
Index: src/changelog.txt
===================================================================
--- src/changelog.txt	(revision 77778f8da97550749c019c9f1fc9634c072c42f4)
+++ src/changelog.txt	(revision 77778f8da97550749c019c9f1fc9634c072c42f4)
@@ -0,0 +1,37 @@
+This is a changelog for the dev branch of FLEXPART (see flexpart.eu)
+Created by Petra Seibert, 8 June 2018 to document and explain in detail why I changed what.
+
+makefile, 2018-06-08
+========
+
+1) Add a GPL3+ License statement, author statement, version information. Prudent to do that, not harmful.
+
+2) There are already two sections, one for gfortran4 and one for gfortran5.
+Both have NILU-specific paths. So let us have at least one generic and put that in front.
+
+2) Compiler options. 
+2.1) For the regular compile, we don't want -g (debug symols)
+2.2) We don't need -m64, on a 64bit platform this is default
+2.3) Remove $(USER) as it is never defined
+2.4) Remove -Warray-bounds, this is default.
+2.5) Add -fbacktrace in the commented-out part, it is important for debugging
+2.6) Change comment for VPATH, explain what this directive does
+2.7) Added some explanation of options as comment.  Maybe expand later.
+
+Notes and questions:
+1. Would be nice to have a debug version also for serial code.
+2. Would be nice to have "as fast as possible" option (thought it might be machine-dependent ...)
+3. What is the purpose of -Warray-bounds ? Is it relevant for Fortran? I think if there is a compile-time array-bound violation this would be a hard error?
+
+FLEXPART.f90
+========
+
+Update version string!
+
+readcommand.f90
+===========
+
+Correct misleading error message (replace "open" by "write to")
+Improve error messages: combine pathname+filename, remove unaligned closing ###
+Let STOP say in which subroutine we are stopping
+Some minor changes
Index: src/makefile
===================================================================
--- src/makefile	(revision a9cf4b1e763458eb1d7f20f9d55d1f5bd8a87da6)
+++ src/makefile	(revision 77778f8da97550749c019c9f1fc9634c072c42f4)
@@ -1,4 +1,9 @@
 SHELL = /bin/bash
 ################################################################################
+#   
+#  LICENSE
+#   Valid-License-Identifier:  	GPL-3.0-or-later
+#   License text: https://spdx.org/licenses/GPL-3.0-or-later.html#licenseText
+#
 #  DESCRIPTION
 #    Makefile for FLEXPART. Standard (serial) and parallel (MPI) version
@@ -7,9 +12,12 @@
 #    possible ("make -j")
 #
-#    At NILU we have installed gcc-4.9.1 and libraries under user /homevip/flexpart
-#    ("ROOT_DIR")
-#    To use gfortran version 4.9, add "gcc=4.9" to the make command, e.g.
+#    
+#    The makefile is prepared for the environment at NILU.
+#    There, gcc-4.9.1 and libraries are installed under user /homevip/flexpart
+#    NILU users can compile with gfortran version 4.9 by addin "gcc=4.9" to the make command, e.g.
 #       'make -j ecmwf gcc=4.9',
-#    also set environment variable LD_LIBRARY_PATH to point to compiler libraries
+#    You also set environment variable LD_LIBRARY_PATH to point to compiler libraries
+#
+#    Other users will have to edit the 
 #
 #    Makefile was modified to produce unified executable for both ECMWF and GFS meteo data formats
@@ -23,15 +31,20 @@
 #  USAGE
 #    Compile serial FLEXPART 
-#      make [-j] serial
+#      make [-j] [serial] [ncf=yes}
 #
 #    Compile parallel FLEXPART 
-#      make [-j] mpi
+#      make [-j] mpi [ncf=yes}
 #     
 #    Compile for debugging parallel FLEXPART
-#      make [-j] mpi-dbg
-#
-#  NETCDF OUTPUT
-#    To add support for output in netCDF format, append `ncf=yes` to the
-#    `make` command
+#      make [-j] mpi-dbg [ncf=yes}
+#
+#    ncf=yes adds support for output in netCDF format. Requires netCDF libs to be installed.
+#
+#  AUTHORS
+#    NILU people, Petra Seibert (PS), 2018
+#
+#  VERSION and CHANGES
+#    v1.0 as found in git branch dev on flexpart.eu, 2018-06-08
+#    v1.1 PS, make the file more useful for non-NILU users
 # 
 ################################################################################
@@ -50,7 +63,15 @@
 FLEXPART-SERIAL = FLEXPART
 
-
-ifeq ($(gcc), 4.9)
-# Compiled libraries under user ~flexpart, gfortran v4.9
+ifneq ($(gcc), 4.9)
+# make sure that all paths correspond to your system
+	F90	  = gfortran
+	MPIF90    = mpifort
+
+	INCPATH1  = /usr/include	
+	INCPATH2  = /usr/include
+	LIBPATH1  = /usr/lib
+else 
+# NILU: Compiled libraries under user ~flexpart, gfortran v4.9
+	ROOT_DIR = /homevip/flexpart/
 	ROOT_DIR = /homevip/flexpart/
 
@@ -61,14 +82,4 @@
 	INCPATH2  = ${ROOT_DIR}/include
 	LIBPATH1 = ${ROOT_DIR}/lib
-else 
-# Compiled libraries under user ~flexpart, gfortran v5.4
-	ROOT_DIR = /homevip/flexpart/
-
-	F90	  = /usr/bin/gfortran
-	MPIF90    = /usr/bin/mpifort
-
-	INCPATH1  = ${ROOT_DIR}/gcc-5.4.0/include	
-	INCPATH2  = /usr/include
-	LIBPATH1 = ${ROOT_DIR}/gcc-5.4.0/lib
 endif
 
@@ -83,5 +94,5 @@
 
 
-# path to gributils used to detect meteodata format
+#add path to gributils to default searchpath of make
 VPATH = gributils/
 
@@ -92,10 +103,14 @@
 
 ## LIBRARIES
-#LIBS = -lgrib_api_f90 -lgrib_api -lm -ljasper -lnetcdff
 LIBS = -lgrib_api_f90 -lgrib_api -lm -ljasper $(NCOPT)
 
-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) $(NCOPT) $(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) $(NCOPT) -fbacktrace   -Wall  -fdump-core $(FUSER)  #  -ffpe-trap=invalid,overflow,denormal,underflow,zero  -Warray-bounds -fcheck=all
+#FFLAGS   = -I$(INCPATH1) -I$(INCPATH2) -O$(O_LEV) -cpp -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -fmessage-length=0 -flto=jobserver -O$(O_LEV) $(NCOPT) $(FUSER)  #-Warray-bounds -fcheck=all # -march=native
+FFLAGS   = -I$(INCPATH1) -I$(INCPATH2) -O$(O_LEV) -cpp -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -fmessage-length=0 -flto=jobserver -O$(O_LEV) $(NCOPT) $(FUSER)  # -fcheck=all -fbacktrace -march=native
+
+# Explanation of unusual gfortran options
+# -fmessage-length=0: do not wrap around compiler messages at col 72
+# -flto=jobserver: use GNU make's job server mode to determine the number of parallel jobs. This is useful when the Makefile calling GCC is already executing in parallel. (+ in front of $(FC) further down also needed for parallel compiling).
+
+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) $(NCOPT) -fbacktrace   -Wall  -fdump-core $(FUSER)  #  -ffpe-trap=invalid,overflow,denormal,underflow,zero   -fcheck=all
 
 LDFLAGS  = $(FFLAGS) -L$(LIBPATH1) -Wl,-rpath,$(LIBPATH1) $(LIBS) #-L$(LIBPATH2)
Index: src/readcommand.f90
===================================================================
--- src/readcommand.f90	(revision 20963b15051b22eeb381dcf4e824a9104d92717b)
+++ src/readcommand.f90	(revision 77778f8da97550749c019c9f1fc9634c072c42f4)
@@ -29,6 +29,8 @@
   !                                                                            *
   !     18 May 1996                                                            *
-  !     HSO, 1 July 2014                                                       *
-  !     Added optional namelist input                                          *
+  !     Unknown, unknown: various                                              *
+  !     HSO, 1 July 2014: Added optional namelist input                        *
+  !     Unknown, unknown: various                                              *
+  !     Petra Seibert, 2018-06-08: improve error msgs                          *
   !                                                                            *
   !*****************************************************************************
@@ -153,5 +155,6 @@
   ! Namelist input first: try to read as namelist file
   !**************************************************************************
-  open(unitcommand,file=path(1)(1:length(1))//'COMMAND',status='old',form='formatted',err=999)
+  open(unitcommand,file=path(1)(1:length(1))//'COMMAND',status='old', &
+    form='formatted',err=999)
 
   ! try namelist input (default)
@@ -248,5 +251,5 @@
   ! write command file in namelist format to output directory if requested
   if (nmlout.and.lroot) then
-    open(unitcommand,file=path(2)(1:length(2))//'COMMAND.namelist',err=1000)
+    open(unitcommand,file=path(2)(1:length(2))//'COMMAND.namelist',err=998)
     write(unitcommand,nml=command)
     close(unitcommand)
@@ -635,6 +638,6 @@
     ideltas=nint((edate-bdate)*86400.)
   else
-    write(*,*) ' #### FLEXPART MODEL ERROR! DIRECTION IN      #### '
-    write(*,*) ' #### FILE "COMMAND" MUST BE EITHER -1 OR 1.  #### '
+    write(*,*) ' #### FLEXPART MODEL ERROR! DIRECTION IN'
+    write(*,*) ' #### FILE "COMMAND" MUST BE EITHER -1 OR 1.'
     stop
   endif
@@ -642,12 +645,11 @@
   return
 
-999   write(*,*) ' #### FLEXPART MODEL ERROR! FILE "COMMAND"    #### '
-  write(*,*) ' #### CANNOT BE OPENED IN THE DIRECTORY       #### '
-  write(*,'(a)') path(1)(1:length(1))
-  stop
-
-1000   write(*,*) ' #### FLEXPART MODEL ERROR! FILE "COMMAND"    #### '
-  write(*,*) ' #### CANNOT BE OPENED IN THE DIRECTORY       #### '
-  write(*,'(a)') path(2)(1:length(2))
-  stop
+998 write(*,900) ' #### FLEXPART MODEL ERROR! FILE "COMMAND.namelist"'
+  write(*,900)   ' #### CANNOT WRITE TO '// &
+    path(2)(1:length(2))//'COMMAND.namelist'
+  stop 'stopped in readcommand'
+999 write(*,900) ' #### FLEXPART MODEL ERROR! FILE "COMMAND"'
+  write(*,900)   ' #### CANNOT OPEN '//path(1)(1:length(1))//'COMMAND'
+  stop 'stopped in readcommand'
+900 format (a)
 end subroutine readcommand
