Commit 77778f8d authored by pesei's avatar pesei
Browse files

Introduce changelog.txt, update version string, make makefile more useful for...

Introduce changelog.txt, update version string, make makefile more useful for use outside NILU, improve error msg in readcomma$
parent 505a96e3
......@@ -85,7 +85,7 @@ program flexpart
! 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
! Read the pathnames where input/output files are stored
......
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
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
#
# Dependencies are resolved in this makefile, so parallel make is
# 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
# gributils were included to detect format of meteo data
......@@ -22,17 +30,22 @@ SHELL = /bin/bash
#
# 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
# 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
#
# NETCDF OUTPUT
# To add support for output in netCDF format, append `ncf=yes` to the
# `make` command
# 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
#
################################################################################
......@@ -49,9 +62,17 @@ FLEXPART-MPI-DBG = DBG_FLEXPART_MPI
# Serial processing executable
FLEXPART-SERIAL = FLEXPART
ifneq ($(gcc), 4.9)
# make sure that all paths correspond to your system
F90 = gfortran
MPIF90 = mpifort
ifeq ($(gcc), 4.9)
# Compiled libraries under user ~flexpart, gfortran v4.9
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/
F90 = ${ROOT_DIR}/gcc-4.9.1/bin/gfortran
......@@ -60,16 +81,6 @@ ifeq ($(gcc), 4.9)
INCPATH1 = ${ROOT_DIR}/gcc-4.9.1/include
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
......@@ -82,7 +93,7 @@ endif
# path to gributils used to detect meteodata format
#add path to gributils to default searchpath of make
VPATH = gributils/
......@@ -91,12 +102,16 @@ O_LEV = 2 # [0,1,2,3,g,s,fast]
O_LEV_DBG = g # [0,g]
## 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
#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 -Warray-bounds -fcheck=all
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)
LDDEBUG = $(DBGFLAGS) -L$(LIBPATH1) $(LIBS) #-L$(LIBPATH2)
......
......@@ -28,8 +28,10 @@ subroutine readcommand
! Author: A. Stohl *
! *
! 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 *
! *
!*****************************************************************************
! *
......@@ -152,7 +154,8 @@ subroutine readcommand
! Open the command file and read user options
! 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)
read(unitcommand,command,iostat=readerror)
......@@ -247,7 +250,7 @@ subroutine readcommand
! 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)
endif
......@@ -634,20 +637,19 @@ subroutine readcommand
edate=juldate(ibdate,ibtime)
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
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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment