[magics] 01/01: upstream 2.29.0

Alastair McKinstry mckinstry at moszumanska.debian.org
Sat Oct 29 17:17:42 UTC 2016


This is an automated email from the git hooks/post-receive script.

mckinstry pushed a commit to tag upstream/2.29.0
in repository magics.

commit 7b00d015151d2adf1c01e0e120d664a827dd1c89
Author: Alastair McKinstry <mckinstry at debian.org>
Date:   Thu Jul 7 20:40:14 2016 +0100

    upstream 2.29.0
---
 CMakeFiles/cmake.check_cache                       |   1 +
 CMakeLists.txt                                     |  15 +-
 ChangeLog                                          |  11 +
 Testing/Temporary/CTestCostData.txt                |   1 +
 VERSION.cmake                                      |   4 +-
 bin/CMakeLists.txt                                 |   3 +
 bin/ecbuild                                        |  32 +-
 cmake/CMakeLists.txt                               |   5 +
 cmake/FindADSM.cmake                               |   2 +-
 cmake/FindAEC.cmake                                |   2 +-
 cmake/FindAIO.cmake                                |   2 +-
 cmake/FindArmadillo.cmake                          |   2 +-
 cmake/FindCMath.cmake                              |   2 +-
 cmake/FindDl.cmake                                 |   2 +-
 cmake/FindEMOS.cmake                               |   2 +-
 cmake/FindFDB.cmake                                |   2 +-
 cmake/FindHPSS.cmake                               |   2 +-
 cmake/FindLEX.cmake                                |   2 +-
 cmake/FindLegacyFDB.cmake                          |   2 +-
 cmake/FindLibGFortran.cmake                        |  16 +-
 cmake/FindLibIFort.cmake                           |   2 +-
 cmake/FindMKL.cmake                                |   2 +-
 cmake/FindNDBM.cmake                               |   2 +-
 cmake/FindNetCDF.cmake                             |  46 +--
 cmake/FindNetCDF3.cmake                            |   2 +-
 cmake/FindODB.cmake                                |   2 +-
 cmake/FindOpenCL.cmake                             |   2 +-
 cmake/FindOpenJPEG.cmake                           |   2 +-
 cmake/FindPGIFortran.cmake                         |   2 +-
 cmake/FindPango.cmake                              |  16 +-
 cmake/FindPangoCairo.cmake                         |  14 +-
 cmake/FindProj4.cmake                              |  10 +-
 cmake/FindREADLINE.cmake                           |   6 +-
 cmake/FindRPCGEN.cmake                             |   2 +-
 cmake/FindRealtime.cmake                           |   2 +-
 cmake/FindSZip.cmake                               |   2 +-
 cmake/FindTrilinos.cmake                           |   2 +-
 cmake/FindViennaCL.cmake                           |   2 +-
 cmake/FindXLFortranLibs.cmake                      |   2 +-
 cmake/FindYACC.cmake                               |   2 +-
 cmake/Findgrib_api.cmake                           |  44 +--
 cmake/Findodb_api.cmake                            |   2 +-
 cmake/Findspot.cmake                               |   2 +-
 cmake/VERSION.cmake                                |   6 +-
 cmake/compiler_flags/Clang_C.cmake                 |  13 -
 cmake/compiler_flags/Clang_CXX.cmake               |  13 -
 cmake/compiler_flags/Cray_C.cmake                  |  14 -
 cmake/compiler_flags/Cray_CXX.cmake                |  14 -
 cmake/compiler_flags/Cray_Fortran.cmake            |  15 -
 cmake/compiler_flags/GNU_C.cmake                   |  18 -
 cmake/compiler_flags/GNU_CXX.cmake                 |  18 -
 cmake/compiler_flags/GNU_Fortran.cmake             |  21 --
 cmake/compiler_flags/Intel_C.cmake                 |  13 -
 cmake/compiler_flags/Intel_CXX.cmake               |  13 -
 cmake/compiler_flags/Intel_Fortran.cmake           |  14 -
 cmake/compiler_flags/PGI_C.cmake                   |  11 -
 cmake/compiler_flags/PGI_CXX.cmake                 |  11 -
 cmake/compiler_flags/PGI_Fortran.cmake             |  11 -
 cmake/contrib/FindFFTW.cmake                       | 193 ++++-------
 cmake/contrib/FindNetCDF4.cmake                    |  14 +-
 cmake/contrib/GetGitRevisionDescription.cmake.in   |   6 +-
 .../contrib/GreatCMakeCookOff/tests/CMakeLists.txt |  12 +
 .../GreatCMakeCookOff/tests/cpp11/CMakeLists.txt   |   3 +
 cmake/ecbuild-config-version.cmake                 |  12 -
 cmake/ecbuild-config.cmake                         |  97 ------
 cmake/ecbuild_add_c_flags.cmake                    |  60 ++--
 cmake/ecbuild_add_cxx11_flags.cmake                |   2 +-
 cmake/ecbuild_add_cxx_flags.cmake                  |  60 ++--
 cmake/ecbuild_add_executable.cmake                 | 164 +++------
 cmake/ecbuild_add_extra_search_paths.cmake         |  12 +-
 cmake/ecbuild_add_fortran_flags.cmake              |  62 ++--
 cmake/ecbuild_add_library.cmake                    | 145 ++------
 cmake/ecbuild_add_option.cmake                     |  55 +---
 cmake/ecbuild_add_persistent.cmake                 |  14 +-
 cmake/ecbuild_add_resources.cmake                  |   2 +-
 cmake/ecbuild_add_test.cmake                       |  31 +-
 cmake/ecbuild_append_to_rpath.cmake                |   2 +-
 cmake/ecbuild_bundle.cmake                         |  38 +--
 cmake/ecbuild_cache.cmake                          |   2 +-
 cmake/ecbuild_check_c_source_return.cmake          |   2 +-
 cmake/ecbuild_check_compiler.cmake                 |   9 +-
 cmake/ecbuild_check_cxx11.cmake                    |   2 +-
 cmake/ecbuild_check_cxx_source_return.cmake        |  42 +--
 cmake/ecbuild_check_fortran_source_return.cmake    |   2 +-
 cmake/ecbuild_check_functions.cmake                |  16 +-
 cmake/ecbuild_check_os.cmake                       |  45 +--
 cmake/ecbuild_compiler_flags.cmake                 |  97 ------
 cmake/ecbuild_config.h.in                          |   2 +-
 cmake/ecbuild_debug_var.cmake                      |  47 +++
 cmake/ecbuild_declare_project.cmake                |  24 +-
 cmake/ecbuild_define_build_types.cmake             |  80 ++++-
 cmake/ecbuild_define_libs_and_execs_target.cmake   |  29 --
 cmake/ecbuild_define_options.cmake                 |  12 +-
 cmake/ecbuild_define_paths.cmake                   |   2 +-
 cmake/ecbuild_dont_pack.cmake                      |   2 +-
 cmake/ecbuild_download_resource.cmake              |   2 +-
 cmake/ecbuild_echo_targets.cmake                   |   8 +-
 cmake/ecbuild_enable_fortran.cmake                 |  11 +-
 cmake/ecbuild_features.cmake                       |  53 ++-
 cmake/ecbuild_find_fortranlibs.cmake               |   2 +-
 cmake/ecbuild_find_lexyacc.cmake                   |  20 +-
 cmake/ecbuild_find_mpi.cmake                       |   2 +-
 cmake/ecbuild_find_omp.cmake                       |   9 +-
 cmake/ecbuild_find_package.cmake                   |   8 +-
 cmake/ecbuild_find_perl.cmake                      |   2 +-
 cmake/ecbuild_find_python.cmake                    | 134 +++-----
 cmake/ecbuild_generate_config_headers.cmake        |   2 +-
 cmake/ecbuild_generate_fortran_interfaces.cmake    | 115 -------
 cmake/ecbuild_generate_rpc.cmake                   |   2 +-
 cmake/ecbuild_generate_yy.cmake                    |  30 +-
 cmake/ecbuild_get_cxx11_flags.cmake                |   2 +-
 cmake/ecbuild_get_date.cmake                       |   2 +-
 cmake/ecbuild_get_resources.cmake                  |  16 +-
 cmake/ecbuild_get_test_data.cmake                  |  26 +-
 cmake/ecbuild_git.cmake                            |  10 +-
 cmake/ecbuild_install_project.cmake                |  81 +----
 ...nks_target.cmake => ecbuild_links_target.cmake} |  10 +-
 cmake/ecbuild_list_add_pattern.cmake               | 102 ------
 cmake/ecbuild_list_exclude_pattern.cmake           |  88 -----
 cmake/ecbuild_list_extra_search_paths.cmake        |  12 +-
 cmake/ecbuild_list_macros.cmake                    |  40 ++-
 cmake/ecbuild_log.cmake                            |  92 +-----
 cmake/ecbuild_pkgconfig.cmake                      |   2 +-
 cmake/ecbuild_policies.cmake                       |  10 +-
 cmake/ecbuild_print_summary.cmake                  |   8 +-
 cmake/ecbuild_project_files.cmake                  |  10 +-
 cmake/ecbuild_remove_fortran_flags.cmake           |  61 ----
 cmake/ecbuild_requires_macro_version.cmake         |   2 +-
 cmake/ecbuild_separate_sources.cmake               |  10 +-
 cmake/ecbuild_setup_test_framework.cmake           |   6 +-
 cmake/ecbuild_source_flags.cmake                   |  30 --
 cmake/ecbuild_system.cmake                         |  66 ++--
 cmake/ecbuild_use_package.cmake                    |  25 +-
 cmake/ecbuild_version.h.in                         |   2 +-
 cmake/ecbuild_warn_unused_files.cmake              |   2 +-
 cmake/gen_source_flags.py                          |  84 -----
 cmake/include/ecbuild/boost_test_framework.h       |   2 +-
 cmake/project-config.cmake.in                      |  49 ++-
 cmake/sg.pl                                        |   2 +-
 fc_type.grib                                       | Bin 0 -> 4284160 bytes
 python/Magics/CMakeLists.txt                       |   4 +-
 share/ecbuild/toolchains/ecmwf-XC30-Cray.cmake     |  56 +++-
 share/ecbuild/toolchains/ecmwf-XC30-GNU.cmake      |  50 ++-
 share/ecbuild/toolchains/ecmwf-XC30-Intel.cmake    |  44 ++-
 share/magics/symbols.svg                           |  23 ++
 share/magics/table_260.xml                         |  10 +
 src/basic/BasicSceneObject.h                       |   4 +-
 src/common/CustomisedPoint.h                       |   7 +-
 src/common/GeoRectangularProjection.cc             |   4 +-
 src/common/Matrix.cc                               | 240 +++++++++++++-
 src/common/Matrix.h                                |  37 ++-
 src/common/PaperPoint.h                            |   9 +-
 src/common/PolarStereographicProjection.cc         |   2 +-
 src/common/Polyline.cc                             |   3 +-
 src/common/Proj4Projection.cc                      |   2 +-
 src/common/Symbol.cc                               |   6 +-
 src/common/Symbol.h                                |   7 +-
 src/common/Transformation.cc                       |  52 ++-
 src/common/Transformation.h                        |   2 +-
 src/common/UserPoint.h                             |  10 +-
 src/decoders/EpsgramDecoder.cc                     |  28 --
 src/decoders/GribDecoder.cc                        | 100 +++---
 src/decoders/GribDecoder.h                         |  18 +-
 src/decoders/GribInterpretor.h                     |   2 +-
 src/decoders/GribRegularInterpretor.cc             | 300 +++++++++--------
 src/decoders/GribRegularInterpretor.h              |  14 +-
 src/decoders/ShapeDecoder.cc                       |  26 +-
 src/decoders/ShapeDecoder.h                        |   4 +-
 src/drivers/BaseDriver.cc                          |  28 +-
 src/drivers/BaseDriverSymbols.h                    |   2 +
 src/drivers/BinaryDriver.cc                        |  24 +-
 src/drivers/CairoDriver.cc                         |  12 +-
 src/drivers/PostScriptDriver.cc                    |   3 +-
 src/drivers/SVGDriver.cc                           |  55 +---
 src/params/CMakeLists.txt                          |   2 +-
 src/params/CellShading.xml                         |  12 +-
 src/params/GeoJSon.xml                             |   3 +
 src/params/MetgramBar.xml                          |  17 +
 src/params/MetgramCurve.xml                        |   8 +
 src/params/MetgramFlags.xml                        |   9 +
 src/params/SimplePolyline.xml                      |  87 ++++-
 src/visualisers/CellShading.cc                     |  66 +++-
 src/visualisers/CellShading.h                      |  14 +-
 src/visualisers/CoastPlotting.cc                   |  71 +++-
 src/visualisers/CoastPlotting.h                    |   8 +-
 src/visualisers/IsoPlot.cc                         |  20 +-
 src/visualisers/IsoPlot.h                          |   4 +-
 src/visualisers/IsoShading.h                       |  12 +-
 src/visualisers/MarkerShadingTechnique.cc          |   2 +-
 src/visualisers/MarkerShadingTechnique.h           |   3 +-
 src/visualisers/MetgramStyle.cc                    |  42 +--
 src/visualisers/MetgramStyle.h                     |  15 +-
 src/visualisers/ObsPlotting.cc                     |   2 +-
 src/visualisers/PolyShadingTechnique.cc            |   5 +
 src/visualisers/ShadingTechnique.h                 |   3 +-
 src/visualisers/SimplePolylineVisualiser.cc        | 325 ++++++++++++++++--
 src/visualisers/SimplePolylineVisualiser.h         |  21 +-
 src/visualisers/Streamlines.cc                     |  12 +-
 src/visualisers/SymbolAdvancedTableMode.cc         |   7 +-
 src/visualisers/SymbolMode.cc                      |  73 ++--
 src/visualisers/SymbolPlotting.cc                  |  12 +-
 src/visualisers/Wind.cc                            |   9 +-
 src/visualisers/WindPlotting.h                     |   2 +-
 src/web/GeoJSon.cc                                 | 366 +++++++++++++++++++--
 src/web/GeoJSon.h                                  |  18 +-
 src/web/WrepJSon.cc                                |   9 +-
 utils/bufrgram.py                                  |   6 +-
 utils/input/37.00_35.32_10u.json                   | 223 +++++++++++++
 utils/input/37.00_35.32_10uv.json                  | 223 +++++++++++++
 utils/input/37.00_35.32_10v.json                   | 156 +++++++++
 utils/input/37.00_35.32_2t.json                    | 156 +++++++++
 utils/input/37.00_35.32_cp.json                    | 156 +++++++++
 utils/input/37.00_35.32_msl.json                   | 156 +++++++++
 utils/input/37.00_35.32_r.json                     | 156 +++++++++
 utils/input/37.00_35.32_t.json                     | 156 +++++++++
 utils/input/37.00_35.32_tcc.json                   | 156 +++++++++
 utils/input/41.30_10.50_10u.json                   | 225 +++++++++++++
 utils/input/41.30_10.50_10v.json                   | 156 +++++++++
 utils/input/41.30_10.50_2t.json                    | 156 +++++++++
 utils/input/41.30_10.50_cp.json                    | 156 +++++++++
 utils/input/41.30_10.50_msl.json                   | 156 +++++++++
 utils/input/41.30_10.50_r.json                     | 156 +++++++++
 utils/input/41.30_10.50_t.json                     | 156 +++++++++
 utils/input/41.30_10.50_tcc.json                   | 156 +++++++++
 utils/input/43.30_-8.50_10u.json                   | 156 +++++++++
 utils/input/43.30_-8.50_10v.json                   | 156 +++++++++
 utils/input/43.30_-8.50_2t.json                    | 156 +++++++++
 utils/input/43.30_-8.50_cp.json                    | 156 +++++++++
 utils/input/43.30_-8.50_msl.json                   | 156 +++++++++
 utils/input/43.30_-8.50_r.json                     | 156 +++++++++
 utils/input/43.30_-8.50_t.json                     | 156 +++++++++
 utils/input/43.30_-8.50_tcc.json                   | 156 +++++++++
 utils/input/GRA04190000042900001                   | Bin 0 -> 26400 bytes
 utils/input/adana.json                             |  12 +
 utils/input/stations_classic.json                  |  19 ++
 utils/input/tempe.json                             | 156 +++++++++
 utils/{bufrgram.py => metgram.py}                  | 158 ++++-----
 237 files changed, 7161 insertions(+), 2876 deletions(-)

diff --git a/CMakeFiles/cmake.check_cache b/CMakeFiles/cmake.check_cache
new file mode 100644
index 0000000..3dccd73
--- /dev/null
+++ b/CMakeFiles/cmake.check_cache
@@ -0,0 +1 @@
+# This file is generated by cmake for dependency checking of the CMakeCache.txt file
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5bce9a5..f26bd92 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -40,7 +40,7 @@ ecbuild_requires_macro_version( 1.9 )
 ###############################################################################
 # some variables of this project
 
-ecbuild_use_package(PROJECT grib_api VERSION 1.12.3 REQUIRED)
+ecbuild_use_package(PROJECT grib_api VERSION 1.14.6 REQUIRED)
 # grib_api is required for now
 set( HAVE_GRIB 1 )
 
@@ -53,7 +53,7 @@ ecbuild_add_option( FEATURE ODB
                     DEFAULT ON
                     DESCRIPTION "ODB support"
                     REQUIRED_PACKAGES 
-						"PROJECT odb_api VERSION 0.10.2"
+            "PROJECT odb_api VERSION 0.10.2"
 						"PROJECT eckit   VERSION 0.9.0" )
 
 ecbuild_add_option( FEATURE CAIRO
@@ -125,8 +125,7 @@ set( MAGICS_EXCEPTION     "ON" )
 set( MAGICS_SITE          "ecmwf" )
 set( MAGICS_INSTALL_PATH  ${CMAKE_INSTALL_PREFIX} )
 
-# Regression definitions
-set( MAGICS_REFERENCE_VERSIONS            "2.26.2" )
+set( MAGICS_REFERENCE_VERSIONS            "2.28.0" )
 set( MAGICS_HTML_ROOT        "${CMAKE_BINARY_DIR}/regression/html")
 file(MAKE_DIRECTORY ${MAGICS_HTML_ROOT} )
 
@@ -137,8 +136,8 @@ set( MAG_PYTHON_PATH ${CMAKE_BINARY_DIR}/python )
 
 # ecbuild_use_package( PROJECT eckit VERSION 0.3 REQUIRED )
 
-#cmake_add_cxx_flags("-gdwarf-2")
-cmake_add_c_flags("-std=c99")
+#ecbuild_add_cxx_flags("-gdwarf-2")
+ecbuild_add_c_flags("-std=c99")
 
 ### Metview and Qt
 
@@ -192,11 +191,11 @@ find_package( Threads )
 # set(Boost_USE_STATIC_LIBS        ON)
 # set(Boost_NO_SYSTEM_PATHS        ON)
 # set(Boost_USE_MULTITHREADED      ON)
-ecbuild_add_extra_search_paths( boost )
+#ecbuild_add_extra_search_paths( boost )
 
 find_package( Boost 1.49.0 REQUIRED)
 find_package( Proj4 REQUIRED )
-find_package( EXPAT  REQUIRED )
+find_package( EXPAT REQUIRED )
 
 ###############################################################################
 # contents
diff --git a/ChangeLog b/ChangeLog
index 3f309f0..193aeca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,17 @@
 Changes in Magics++ (for developers - users should read 'NEWS')
 ===============================================================
 
+
+These are the changes as recorded under Perforce. In 2013 the Magics code was 
+moved under Git. 
+The detailed history of changes can either be seen in Git or more user friendly 
+change list at
+
+  https://software.ecmwf.int/wiki/display/MAGP/Latest+News  
+
+
+============================================
+
 Change 83492 on 2013/03/02 by cgs at cgs
 
 	Add CSV decoder in the python interface
diff --git a/Testing/Temporary/CTestCostData.txt b/Testing/Temporary/CTestCostData.txt
new file mode 100644
index 0000000..ed97d53
--- /dev/null
+++ b/Testing/Temporary/CTestCostData.txt
@@ -0,0 +1 @@
+---
diff --git a/VERSION.cmake b/VERSION.cmake
index fb3f9a7..f3b09a2 100644
--- a/VERSION.cmake
+++ b/VERSION.cmake
@@ -1,6 +1,6 @@
 
-set ( metabuilder_version 2.28.0 )
-set ( _version 2.28.0 )
+set ( metabuilder_version 2.29.0 )
+set ( _version 2.29.0 )
 if ( MAGICS_BUILD )
     set( ${PROJECT_NAME}_VERSION_STR  "${_version}-${MAGICS_BUILD}" )   
 else ()
diff --git a/bin/CMakeLists.txt b/bin/CMakeLists.txt
new file mode 100644
index 0000000..24a12cf
--- /dev/null
+++ b/bin/CMakeLists.txt
@@ -0,0 +1,3 @@
+if( ENABLE_INSTALL )
+	install( PROGRAMS ecbuild DESTINATION ${INSTALL_BIN_DIR} )
+endif()
diff --git a/bin/ecbuild b/bin/ecbuild
index d1ffff4..b327cde 100755
--- a/bin/ecbuild
+++ b/bin/ecbuild
@@ -3,7 +3,7 @@
 set -eua
 
 CMAKE_MIN_REQUIRED=2.8.10
-CMAKE_BUILD_VERSION=3.4.1
+CMAKE_BUILD_VERSION=3.2.3
 
 usage()
 {
@@ -70,13 +70,13 @@ Available values for "option":
           Build static libraries.
           Equivalent to "-DBUILD_SHARED_LIBS=OFF"
 
-    --dynamic, --shared
+    --dynamic
           Build dynamic libraries (usually the default).
           Equivalent to "-DBUILD_SHARED_LIBS=ON"
 
-    --config=<config>
-          Configuration file using CMake syntax that gets included
-          Equivalent to cmake argument "-DECBUILD_CONFIG=<config-file>"
+    --shared     (same option as --dynamic)
+          Build dynamic libraries (usually the default).
+          Equivalent to "-DBUILD_SHARED_LIBS=ON"
 
     --toolchain=<toolchain>
           Use a platform specific toolchain, containing settings such
@@ -188,7 +188,7 @@ version()
 
 log()
 {
-  log_level=$(tr "[a-z]" "[A-Z]" <<< "$1")
+  log_level=$(sed 's/.*/\U&/' <<< "$1")
   ADD_ECBUILD_OPTIONS="$ADD_ECBUILD_OPTIONS -DECBUILD_LOG_LEVEL=${log_level}"
 }
 
@@ -213,20 +213,6 @@ prefix()
   ADD_ECBUILD_OPTIONS="$ADD_ECBUILD_OPTIONS -DCMAKE_INSTALL_PREFIX=${1/#\~\//$HOME/}"
 }
 
-config()
-{
-  arg=${1/#\~\//$HOME/}
-  if [ -f $arg ]; then
-    config_file=$arg
-    config_file="$( cd $( dirname "${config_file}" ) && pwd -P )/$( basename ${config_file} )"
-  else
-    echo "Error:"
-    echo "   Config file [$arg] is not found or is not a file."
-    exit 1
-  fi
-  ADD_ECBUILD_OPTIONS="$ADD_ECBUILD_OPTIONS -DECBUILD_CONFIG=${config_file}"
-}
-
 toolchain()
 {
   arg=${1/#\~\//$HOME/}
@@ -251,8 +237,7 @@ cache()
 {
   arg=$1
   if [ -f $arg ]; then
-    cache_file=$arg
-    cache_file="$( cd $( dirname "${cache_file}" ) && pwd -P )/$( basename ${cache_file} )"
+    cache_file=$( cd "$arg" && pwd -P )
   else
     echo "Error:"
     echo "   Cache file [$arg] is not found or is not a file."
@@ -328,9 +313,6 @@ while test $# -gt 0; do
       --toolchain)
         toolchain $val
         ;;
-      --config)
-        config $val
-        ;;
       --cache)
         cache $val
         ;;
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
new file mode 100644
index 0000000..d42a153
--- /dev/null
+++ b/cmake/CMakeLists.txt
@@ -0,0 +1,5 @@
+file( GLOB_RECURSE ecbuild_support_files  RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*" )
+
+ecbuild_add_resources(  TARGET ${PROJECT_NAME}_ecbuild_support_files
+						SOURCES_PACK
+							${ecbuild_support_files} )
diff --git a/cmake/FindADSM.cmake b/cmake/FindADSM.cmake
index b46e798..7af6723 100644
--- a/cmake/FindADSM.cmake
+++ b/cmake/FindADSM.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 # 
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
diff --git a/cmake/FindAEC.cmake b/cmake/FindAEC.cmake
index 767544f..8a59037 100644
--- a/cmake/FindAEC.cmake
+++ b/cmake/FindAEC.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
diff --git a/cmake/FindAIO.cmake b/cmake/FindAIO.cmake
index 76e357a..c27b795 100644
--- a/cmake/FindAIO.cmake
+++ b/cmake/FindAIO.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 # 
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
diff --git a/cmake/FindArmadillo.cmake b/cmake/FindArmadillo.cmake
index 5fdf2a6..a3628a5 100644
--- a/cmake/FindArmadillo.cmake
+++ b/cmake/FindArmadillo.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 # 
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
diff --git a/cmake/FindCMath.cmake b/cmake/FindCMath.cmake
index 0c18b52..cf80f85 100644
--- a/cmake/FindCMath.cmake
+++ b/cmake/FindCMath.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 # 
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
diff --git a/cmake/FindDl.cmake b/cmake/FindDl.cmake
index 3fb3cc8..30db9c6 100644
--- a/cmake/FindDl.cmake
+++ b/cmake/FindDl.cmake
@@ -1,4 +1,4 @@
-# © Copyright 1996-2016 ECMWF.
+# © Copyright 1996-2015 ECMWF.
 # 
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
diff --git a/cmake/FindEMOS.cmake b/cmake/FindEMOS.cmake
index c549fc2..70028ca 100644
--- a/cmake/FindEMOS.cmake
+++ b/cmake/FindEMOS.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 # 
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
diff --git a/cmake/FindFDB.cmake b/cmake/FindFDB.cmake
index 4bcbdf3..9608a54 100644
--- a/cmake/FindFDB.cmake
+++ b/cmake/FindFDB.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 # 
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
diff --git a/cmake/FindHPSS.cmake b/cmake/FindHPSS.cmake
index b2b662b..a96b8d4 100644
--- a/cmake/FindHPSS.cmake
+++ b/cmake/FindHPSS.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 # 
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
diff --git a/cmake/FindLEX.cmake b/cmake/FindLEX.cmake
index 221868f..00335c2 100644
--- a/cmake/FindLEX.cmake
+++ b/cmake/FindLEX.cmake
@@ -44,7 +44,7 @@
 # This file is based on the FindFLEX CMake macro, and adapted by ECMWF
 
 #=============================================================================
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
diff --git a/cmake/FindLegacyFDB.cmake b/cmake/FindLegacyFDB.cmake
index f92be59..f461a0e 100644
--- a/cmake/FindLegacyFDB.cmake
+++ b/cmake/FindLegacyFDB.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 # 
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
diff --git a/cmake/FindLibGFortran.cmake b/cmake/FindLibGFortran.cmake
index f1150e8..200ffcb 100644
--- a/cmake/FindLibGFortran.cmake
+++ b/cmake/FindLibGFortran.cmake
@@ -1,8 +1,8 @@
-# © Copyright 1996-2016 ECMWF.
-#
+# © Copyright 1996-2015 ECMWF.
+# 
 # This software is licensed under the terms of the Apache Licence Version 2.0
-# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-# In applying this licence, ECMWF does not waive the privileges and immunities
+# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
+# In applying this licence, ECMWF does not waive the privileges and immunities 
 # granted to it by virtue of its status as an intergovernmental organisation nor
 # does it submit to any jurisdiction.
 
@@ -23,16 +23,16 @@ if( GFORTRAN_EXECUTABLE )
 		ERROR_VARIABLE _GFORTRAN_ERROR_VALUE
 		OUTPUT_STRIP_TRAILING_WHITESPACE)
 
-#	ecbuild_debug_var(_GFORTRAN_SEARCH_SUCCESS)
-#	ecbuild_debug_var(_GFORTRAN_VALUES_OUTPUT)
-#	ecbuild_debug_var(_GFORTRAN_ERROR_VALUE)
+#	debug_var(_GFORTRAN_SEARCH_SUCCESS)
+#	debug_var(_GFORTRAN_VALUES_OUTPUT)
+#	debug_var(_GFORTRAN_ERROR_VALUE)
 
 	if(_GFORTRAN_SEARCH_SUCCESS MATCHES 0)
 		string(REGEX REPLACE ".*libraries: =(.*)" "\\1" _result  ${_GFORTRAN_VALUES_OUTPUT})
 		string(REGEX REPLACE ":" ";" _gfortran_hints ${_result} )
 	endif()
 
-	ecbuild_debug_var( _gfortran_hints )
+	debug_var( _gfortran_hints )
 
 endif()
 
diff --git a/cmake/FindLibIFort.cmake b/cmake/FindLibIFort.cmake
index 8e12ad8..e1d82ee 100644
--- a/cmake/FindLibIFort.cmake
+++ b/cmake/FindLibIFort.cmake
@@ -1,4 +1,4 @@
-# © Copyright 1996-2016 ECMWF.
+# © Copyright 1996-2015 ECMWF.
 # 
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
diff --git a/cmake/FindMKL.cmake b/cmake/FindMKL.cmake
index 1123234..fe182a4 100644
--- a/cmake/FindMKL.cmake
+++ b/cmake/FindMKL.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
diff --git a/cmake/FindNDBM.cmake b/cmake/FindNDBM.cmake
index 869223f..5203ee9 100644
--- a/cmake/FindNDBM.cmake
+++ b/cmake/FindNDBM.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 # 
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
diff --git a/cmake/FindNetCDF.cmake b/cmake/FindNetCDF.cmake
index 9084549..89af114 100644
--- a/cmake/FindNetCDF.cmake
+++ b/cmake/FindNetCDF.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -76,7 +76,7 @@ if( PREFER_NETCDF4 )
 
   ## hdf5
 
-  # Note: Only the HDF5 C-library is required for NetCDF
+  # Note: Only the HDF5 C-library is required for NetCDF 
   #       ( even for Fortan and CXX bindings)
   find_package( HDF5 COMPONENTS C QUIET )
 
@@ -87,24 +87,24 @@ if( PREFER_NETCDF4 )
   # Find NetCDF4
 
   # message( "NETCDF CMAKE_PREFIX_PATH = [${CMAKE_PREFIX_PATH}]")
-  # ecbuild_debug_var( NETCDF_ROOT )
-  # ecbuild_debug_var( NETCDF_FIND_COMPONENTS )
-  # ecbuild_debug_var( NETCDF_FIND_QUIETLY )
-  # ecbuild_debug_var( NETCDF_FIND_REQUIRED )
+  # debug_var( NETCDF_ROOT )
+  # debug_var( NETCDF_FIND_COMPONENTS )
+  # debug_var( NETCDF_FIND_QUIETLY )
+  # debug_var( NETCDF_FIND_REQUIRED )
   find_package( NetCDF4 COMPONENTS ${NETCDF_FIND_COMPONENTS} )
-  # ecbuild_debug_var( NETCDF4_FOUND )
-  # ecbuild_debug_var( NETCDF_FOUND )
-  # ecbuild_debug_var( NETCDF_LIBRARIES )
-  # ecbuild_debug_var( NETCDF_INCLUDE_DIRS )
+  # debug_var( NETCDF4_FOUND )
+  # debug_var( NETCDF_FOUND )
+  # debug_var( NETCDF_LIBRARIES )
+  # debug_var( NETCDF_INCLUDE_DIRS )
 
   list( APPEND NETCDF_Fortran_LIBRARIES ${NETCDF_FORTRAN_LIBRARIES} ${NETCDF_F90_LIBRARIES} )
   if( NETCDF_Fortran_LIBRARIES )
     list( REMOVE_DUPLICATES NETCDF_Fortran_LIBRARIES )
   endif()
 
-  # ecbuild_debug_var( NETCDF_Fortran_LIBRARIES )
-  # ecbuild_debug_var( NETCDF_C_LIBRARIES )
-  # ecbuild_debug_var( NETCDF_CXX_LIBRARIES )
+  # debug_var( NETCDF_Fortran_LIBRARIES )
+  # debug_var( NETCDF_C_LIBRARIES )
+  # debug_var( NETCDF_CXX_LIBRARIES )
 
 
   set_package_properties( NetCDF4 PROPERTIES TYPE RECOMMENDED PURPOSE "support for NetCDF4 file format" )
@@ -115,13 +115,13 @@ if( PREFER_NETCDF4 )
     list( APPEND NETCDF_INCLUDE_DIRS ${HDF5_INCLUDE_DIRS} )
   endif()
 
-  #ecbuild_debug_var( NETCDF_FOUND )
-  #ecbuild_debug_var( NETCDF_LIBRARIES )
-  #ecbuild_debug_var( NETCDF_INCLUDE_DIRS )
-  #ecbuild_debug_var( HDF5_FOUND )
-  #ecbuild_debug_var( HDF5_INCLUDE_DIRS )
-  #ecbuild_debug_var( HDF5_HL_LIBRARIES )
-  #ecbuild_debug_var( HDF5_LIBRARIES )
+  #debug_var( NETCDF_FOUND )
+  #debug_var( NETCDF_LIBRARIES )
+  #debug_var( NETCDF_INCLUDE_DIRS )
+  #debug_var( HDF5_FOUND )
+  #debug_var( HDF5_INCLUDE_DIRS )
+  #debug_var( HDF5_HL_LIBRARIES )
+  #debug_var( HDF5_LIBRARIES )
 
 endif()
 
@@ -131,9 +131,9 @@ if( PREFER_NETCDF3 )
 
   ecbuild_debug( "FindNetCDF: looking for NetCDF3" )
 
-  # ecbuild_debug_var( NetCDF_FIND_COMPONENTS )
-  # ecbuild_debug_var( NetCDF_FIND_QUIETLY )
-  # ecbuild_debug_var( NetCDF_FIND_REQUIRED )
+  # debug_var( NetCDF_FIND_COMPONENTS )
+  # debug_var( NetCDF_FIND_QUIETLY )
+  # debug_var( NetCDF_FIND_REQUIRED )
 
   list(FIND NetCDF_FIND_COMPONENTS "CXX" _index)
   if(${_index} GREATER -1)
diff --git a/cmake/FindNetCDF3.cmake b/cmake/FindNetCDF3.cmake
index 1fe9a74..40e6bc0 100644
--- a/cmake/FindNetCDF3.cmake
+++ b/cmake/FindNetCDF3.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 # 
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
diff --git a/cmake/FindODB.cmake b/cmake/FindODB.cmake
index 1beb5c8..3a1fa12 100644
--- a/cmake/FindODB.cmake
+++ b/cmake/FindODB.cmake
@@ -1,4 +1,4 @@
-# © Copyright 1996-2016 ECMWF.
+# © Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
diff --git a/cmake/FindOpenCL.cmake b/cmake/FindOpenCL.cmake
index 4995d92..e4e9556 100644
--- a/cmake/FindOpenCL.cmake
+++ b/cmake/FindOpenCL.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
diff --git a/cmake/FindOpenJPEG.cmake b/cmake/FindOpenJPEG.cmake
index 805f091..82d19fb 100644
--- a/cmake/FindOpenJPEG.cmake
+++ b/cmake/FindOpenJPEG.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 # 
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
diff --git a/cmake/FindPGIFortran.cmake b/cmake/FindPGIFortran.cmake
index 58956fe..7308e49 100644
--- a/cmake/FindPGIFortran.cmake
+++ b/cmake/FindPGIFortran.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 # 
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
diff --git a/cmake/FindPango.cmake b/cmake/FindPango.cmake
index fc1f879..811cdf9 100644
--- a/cmake/FindPango.cmake
+++ b/cmake/FindPango.cmake
@@ -1,8 +1,8 @@
-# (C) Copyright 1996-2016 ECMWF.
-#
+# (C) Copyright 1996-2015 ECMWF.
+# 
 # This software is licensed under the terms of the Apache Licence Version 2.0
-# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-# In applying this licence, ECMWF does not waive the privileges and immunities
+# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
+# In applying this licence, ECMWF does not waive the privileges and immunities 
 # granted to it by virtue of its status as an intergovernmental organisation nor
 # does it submit to any jurisdiction.
 
@@ -17,10 +17,10 @@ find_package(PkgConfig)
 
 pkg_check_modules(PC_LIBPANGO QUIET pango)
 
-ecbuild_debug_var( PC_LIBPANGO_FOUND )
-ecbuild_debug_var( PC_LIBPANGO_VERSION )
-ecbuild_debug_var( PC_LIBPANGO_LIBRARIES )
-ecbuild_debug_var( PC_LIBPANGO_INCLUDE_DIRS )
+debug_var( PC_LIBPANGO_FOUND )
+debug_var( PC_LIBPANGO_VERSION )
+debug_var( PC_LIBPANGO_LIBRARIES )
+debug_var( PC_LIBPANGO_INCLUDE_DIRS )
 
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args( pango DEFAULT_MSG PC_LIBPANGO_LIBRARIES PC_LIBPANGO_INCLUDE_DIRS )
diff --git a/cmake/FindPangoCairo.cmake b/cmake/FindPangoCairo.cmake
index a852e65..7445754 100644
--- a/cmake/FindPangoCairo.cmake
+++ b/cmake/FindPangoCairo.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -18,12 +18,12 @@ find_package(PkgConfig)
 
 pkg_check_modules(PC_LIBPANGOCAIRO QUIET pangocairo)
 
-#ecbuild_debug_var( PC_LIBPANGOCAIRO_FOUND )
-#ecbuild_debug_var( PC_LIBPANGOCAIRO_VERSION )
-#ecbuild_debug_var( PC_LIBPANGOCAIRO_LIBRARIES )
-#ecbuild_debug_var( PC_LIBPANGOCAIRO_LDFLAGS )
-#ecbuild_debug_var( PC_LIBPANGOCAIRO_LDFLAGS_OTHER )
-#ecbuild_debug_var( PC_LIBPANGOCAIRO_INCLUDE_DIRS )
+#debug_var( PC_LIBPANGOCAIRO_FOUND )
+#debug_var( PC_LIBPANGOCAIRO_VERSION )
+#debug_var( PC_LIBPANGOCAIRO_LIBRARIES )
+#debug_var( PC_LIBPANGOCAIRO_LDFLAGS )
+#debug_var( PC_LIBPANGOCAIRO_LDFLAGS_OTHER )
+#debug_var( PC_LIBPANGOCAIRO_INCLUDE_DIRS )
 
 if(PC_LIBPANGOCAIRO_FOUND)
 
diff --git a/cmake/FindProj4.cmake b/cmake/FindProj4.cmake
index 64eab79..6774b6e 100644
--- a/cmake/FindProj4.cmake
+++ b/cmake/FindProj4.cmake
@@ -38,9 +38,9 @@ if( NOT PROJ4_PATH )
 
     endif()
 
-#    ecbuild_debug_var( PKG_CONFIG_FOUND )
-#    ecbuild_debug_var( PKPROJ4_FOUND )
-#    ecbuild_debug_var( PROJ4_MIN_VERSION )
+#    debug_var( PKG_CONFIG_FOUND )
+#    debug_var( PKPROJ4_FOUND )
+#    debug_var( PROJ4_MIN_VERSION )
 
 endif()
 
@@ -55,8 +55,8 @@ find_path(PROJ4_INCLUDE_DIR NAMES proj_api.h PATHS PATH_SUFFIXES proj4 )
 find_library( PROJ4_LIBRARY NAMES proj       PATHS PATH_SUFFIXES proj4 )
 
 
-# ecbuild_debug_var( PROJ4_INCLUDE_DIR )
-# ecbuild_debug_var( PROJ4_LIBRARY )
+# debug_var( PROJ4_INCLUDE_DIR )
+# debug_var( PROJ4_LIBRARY )
 
 # handle the QUIETLY and REQUIRED arguments and set GRIBAPI_FOUND
 include(FindPackageHandleStandardArgs)
diff --git a/cmake/FindREADLINE.cmake b/cmake/FindREADLINE.cmake
index 2ba08b4..bbabe15 100644
--- a/cmake/FindREADLINE.cmake
+++ b/cmake/FindREADLINE.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -47,8 +47,8 @@ cmake_push_check_state()
 
 cmake_pop_check_state()
 
-# ecbuild_debug_var( readline_version )
-# ecbuild_debug_var( __readline_version_out )
+# debug_var( readline_version )
+# debug_var( __readline_version_out )
 
 set( __readline_fail 0 )
 if( __readline_version_out )
diff --git a/cmake/FindRPCGEN.cmake b/cmake/FindRPCGEN.cmake
index fd42e9f..3e25daf 100644
--- a/cmake/FindRPCGEN.cmake
+++ b/cmake/FindRPCGEN.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 # 
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
diff --git a/cmake/FindRealtime.cmake b/cmake/FindRealtime.cmake
index 8fd65b1..2c2a7b2 100644
--- a/cmake/FindRealtime.cmake
+++ b/cmake/FindRealtime.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 # 
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
diff --git a/cmake/FindSZip.cmake b/cmake/FindSZip.cmake
index 925348c..6e9b1a2 100644
--- a/cmake/FindSZip.cmake
+++ b/cmake/FindSZip.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
diff --git a/cmake/FindTrilinos.cmake b/cmake/FindTrilinos.cmake
index 0d99b54..a1cabce 100644
--- a/cmake/FindTrilinos.cmake
+++ b/cmake/FindTrilinos.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 # 
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
diff --git a/cmake/FindViennaCL.cmake b/cmake/FindViennaCL.cmake
index af7469d..a1b1eb9 100644
--- a/cmake/FindViennaCL.cmake
+++ b/cmake/FindViennaCL.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
diff --git a/cmake/FindXLFortranLibs.cmake b/cmake/FindXLFortranLibs.cmake
index ff93481..10a68aa 100644
--- a/cmake/FindXLFortranLibs.cmake
+++ b/cmake/FindXLFortranLibs.cmake
@@ -1,4 +1,4 @@
-# © Copyright 1996-2016 ECMWF.
+# © Copyright 1996-2015 ECMWF.
 # 
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
diff --git a/cmake/FindYACC.cmake b/cmake/FindYACC.cmake
index 7b15bfe..a410c6f 100644
--- a/cmake/FindYACC.cmake
+++ b/cmake/FindYACC.cmake
@@ -41,7 +41,7 @@
 # This file is based on the FindFLEX CMake macro, and adapted by ECMWF
 
 #=============================================================================
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
diff --git a/cmake/Findgrib_api.cmake b/cmake/Findgrib_api.cmake
index ab6fc0b..8b6cb43 100644
--- a/cmake/Findgrib_api.cmake
+++ b/cmake/Findgrib_api.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -20,16 +20,16 @@ option( GRIB_API_JPG "use jpg with grib_api" ON )
 if( NOT grib_api_FOUND AND NOT NO_GRIB_API_BINARIES )
 
     if( GRIB_API_JPG ) # jpeg support
-
+        
         find_package( JPEG     QUIET ) # grib_api might be a static .a library in which
-
+    
         if( NOT "$ENV{JASPER_PATH}" STREQUAL "" )
             list( APPEND CMAKE_PREFIX_PATH "$ENV{JASPER_PATH}" )
         endif()
         find_package( Jasper   QUIET ) # case we don't know if which jpeg library was used
-
-        find_package( OpenJPEG QUIET ) # so we try to find all jpeg libs and link to them
-
+    
+        find_package( OpenJPEG QUIET ) # so we try to find all jpeg libs and link to them 
+        
         if(JPEG_FOUND)
             list( APPEND _grib_api_jpg_incs ${JPEG_INCLUDE_DIR} )
             list( APPEND _grib_api_jpg_libs ${JPEG_LIBRARIES} )
@@ -44,18 +44,18 @@ if( NOT grib_api_FOUND AND NOT NO_GRIB_API_BINARIES )
         endif()
 
     endif()
-
+    
     if( GRIB_API_PNG ) # png support
-
+    
         find_package(PNG)
-
+    
         if( DEFINED PNG_PNG_INCLUDE_DIR AND NOT DEFINED PNG_INCLUDE_DIRS )
           set( PNG_INCLUDE_DIRS ${PNG_PNG_INCLUDE_DIR}  CACHE INTERNAL "PNG include dirs" )
         endif()
         if( DEFINED PNG_LIBRARY AND NOT DEFINED PNG_LIBRARIES )
           set( PNG_LIBRARIES ${PNG_LIBRARY} CACHE INTERNAL "PNG libraries" )
         endif()
-
+        
         if(PNG_FOUND)
             list( APPEND _grib_api_png_defs ${PNG_DEFINITIONS} )
             list( APPEND _grib_api_png_incs ${PNG_INCLUDE_DIRS} )
@@ -85,22 +85,22 @@ if( NOT grib_api_FOUND AND NOT NO_GRIB_API_BINARIES )
         find_library(GRIB_API_LIB_F77  NAMES grib_api_f77 PATHS ${GRIB_API_PATH} ${GRIB_API_PATH}/lib     PATH_SUFFIXES grib_api  NO_DEFAULT_PATH)
         find_program(GRIB_API_INFO     NAMES grib_info  PATHS ${GRIB_API_PATH} ${GRIB_API_PATH}/bin     PATH_SUFFIXES grib_api  NO_DEFAULT_PATH)
     endif()
-
+    
     find_path(GRIB_API_INCLUDE_DIR NAMES grib_api.h PATHS PATH_SUFFIXES grib_api )
     find_library( GRIB_API_LIBRARY NAMES grib_api   PATHS PATH_SUFFIXES grib_api )
     find_library( GRIB_API_LIB_F90 NAMES grib_api_f90 PATHS PATH_SUFFIXES grib_api )
     find_library( GRIB_API_LIB_F77 NAMES grib_api_f77 PATHS PATH_SUFFIXES grib_api )
     find_program(GRIB_API_INFO     NAMES grib_info  PATHS PATH_SUFFIXES grib_api )
-
+    
     list( APPEND GRIB_API_LIBRARIES    ${GRIB_API_LIBRARY} ${GRIB_API_LIB_F90} ${GRIB_API_LIB_F77} )
     set( GRIB_API_INCLUDE_DIRS ${GRIB_API_INCLUDE_DIR} )
 
     if( GRIB_API_INFO )
-
+        
         execute_process( COMMAND ${GRIB_API_INFO} -v  OUTPUT_VARIABLE _grib_info_out ERROR_VARIABLE _grib_info_err OUTPUT_STRIP_TRAILING_WHITESPACE )
-
-        # ecbuild_debug_var( _grib_info_out )
-
+        
+        # debug_var( _grib_info_out )
+    
         string( REPLACE "." " " _version_list ${_grib_info_out} ) # dots to spaces
         separate_arguments( _version_list )
 
@@ -108,22 +108,22 @@ if( NOT grib_api_FOUND AND NOT NO_GRIB_API_BINARIES )
         list( GET _version_list 1 GRIB_API_MINOR_VERSION )
         list( GET _version_list 2 GRIB_API_PATCH_VERSION )
 
-        set( GRIB_API_VERSION     "${GRIB_API_MAJOR_VERSION}.${GRIB_API_MINOR_VERSION}.${GRIB_API_PATCH_VERSION}" )
+        set( GRIB_API_VERSION     "${GRIB_API_MAJOR_VERSION}.${GRIB_API_MINOR_VERSION}.${GRIB_API_PATCH_VERSION}" ) 
         set( GRIB_API_VERSION_STR "${_grib_info_out}" )
 
-        set( grib_api_VERSION     "${GRIB_API_VERSION}" )
+        set( grib_api_VERSION     "${GRIB_API_VERSION}" ) 
         set( grib_api_VERSION_STR "${GRIB_API_VERSION_STR}" )
 
     endif()
-
+    
     include(FindPackageHandleStandardArgs)
-
+    
     # handle the QUIETLY and REQUIRED arguments and set GRIB_API_FOUND to TRUE
     find_package_handle_standard_args( grib_api DEFAULT_MSG
                                        GRIB_API_LIBRARY GRIB_API_INCLUDE_DIR GRIB_API_INFO )
-
+    
     mark_as_advanced( GRIB_API_INCLUDE_DIR GRIB_API_LIBRARY GRIB_API_INFO )
-
+    
     list( APPEND GRIB_API_DEFINITIONS  ${_grib_api_jpg_defs} ${_grib_api_png_defs} )
     list( APPEND GRIB_API_INCLUDE_DIRS ${_grib_api_jpg_incs} ${_grib_api_png_incs} )
 	list( APPEND GRIB_API_LIBRARIES    ${_grib_api_jpg_libs} ${_grib_api_png_libs} )
diff --git a/cmake/Findodb_api.cmake b/cmake/Findodb_api.cmake
index 0058fbe..2b8e800 100644
--- a/cmake/Findodb_api.cmake
+++ b/cmake/Findodb_api.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
diff --git a/cmake/Findspot.cmake b/cmake/Findspot.cmake
index 52e0fb5..cad0e33 100644
--- a/cmake/Findspot.cmake
+++ b/cmake/Findspot.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
diff --git a/cmake/VERSION.cmake b/cmake/VERSION.cmake
index e7ac9ad..a07bd4a 100644
--- a/cmake/VERSION.cmake
+++ b/cmake/VERSION.cmake
@@ -1,7 +1,7 @@
-set( ECBUILD_MAJOR_VERSION "2" )
-set( ECBUILD_MINOR_VERSION "0" )
+set( ECBUILD_MAJOR_VERSION "1" )
+set( ECBUILD_MINOR_VERSION "9" )
 set( ECBUILD_PATCH_VERSION "0" )
 
-set( ECBUILD_VERSION_STR  "2.0.0" )
+set( ECBUILD_VERSION_STR  "1.9.0" )
 
 set( ECBUILD_MACRO_VERSION "${ECBUILD_MAJOR_VERSION}.${ECBUILD_MINOR_VERSION}" )
diff --git a/cmake/compiler_flags/Clang_C.cmake b/cmake/compiler_flags/Clang_C.cmake
deleted file mode 100644
index bc73c69..0000000
--- a/cmake/compiler_flags/Clang_C.cmake
+++ /dev/null
@@ -1,13 +0,0 @@
-# (C) Copyright 1996-2016 ECMWF.
-#
-# This software is licensed under the terms of the Apache Licence Version 2.0
-# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-# In applying this licence, ECMWF does not waive the privileges and immunities
-# granted to it by virtue of its status as an intergovernmental organisation
-# nor does it submit to any jurisdiction.
-
-set( CMAKE_C_FLAGS_RELEASE        "-O3 -DNDEBUG"   CACHE STRING "C compiler flags for Release builds"          FORCE )
-set( CMAKE_C_FLAGS_BIT            "-O2 -DNDEBUG"   CACHE STRING "C compiler flags for Bit-reproducible builds" FORCE )
-set( CMAKE_C_FLAGS_DEBUG          "-O0 -g -ftrapv" CACHE STRING "C compiler flags for Debug builds"            FORCE )
-set( CMAKE_C_FLAGS_PRODUCTION     "-O3 -g"         CACHE STRING "C compiler flags for Production builds."      FORCE )
-set( CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g"         CACHE STRING "C compiler flags for RelWithDebInfo builds."  FORCE )
diff --git a/cmake/compiler_flags/Clang_CXX.cmake b/cmake/compiler_flags/Clang_CXX.cmake
deleted file mode 100644
index 53f0f21..0000000
--- a/cmake/compiler_flags/Clang_CXX.cmake
+++ /dev/null
@@ -1,13 +0,0 @@
-# (C) Copyright 1996-2016 ECMWF.
-#
-# This software is licensed under the terms of the Apache Licence Version 2.0
-# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-# In applying this licence, ECMWF does not waive the privileges and immunities
-# granted to it by virtue of its status as an intergovernmental organisation
-# nor does it submit to any jurisdiction.
-
-set( CMAKE_CXX_FLAGS_RELEASE        "-O3 -DNDEBUG"   CACHE STRING "C++ compiler flags for Release builds"          FORCE )
-set( CMAKE_CXX_FLAGS_BIT            "-O2 -DNDEBUG"   CACHE STRING "C++ compiler flags for Bit-reproducible builds" FORCE )
-set( CMAKE_CXX_FLAGS_DEBUG          "-O0 -g -ftrapv" CACHE STRING "C++ compiler flags for Debug builds"            FORCE )
-set( CMAKE_CXX_FLAGS_PRODUCTION     "-O3 -g"         CACHE STRING "C++ compiler flags for Production builds."      FORCE )
-set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g"         CACHE STRING "C++ compiler flags for RelWithDebInfo builds."  FORCE )
diff --git a/cmake/compiler_flags/Cray_C.cmake b/cmake/compiler_flags/Cray_C.cmake
deleted file mode 100644
index 76779f9..0000000
--- a/cmake/compiler_flags/Cray_C.cmake
+++ /dev/null
@@ -1,14 +0,0 @@
-# (C) Copyright 1996-2016 ECMWF.
-#
-# This software is licensed under the terms of the Apache Licence Version 2.0
-# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-# In applying this licence, ECMWF does not waive the privileges and immunities
-# granted to it by virtue of its status as an intergovernmental organisation
-# nor does it submit to any jurisdiction.
-
-set( CMAKE_C_FLAGS_ALL            "-hlist=amid"                                                                    CACHE STRING "Common flags for all build-types" FORCE )
-set( CMAKE_C_FLAGS_RELEASE        "${CMAKE_C_FLAGS_ALL} -O3 -hfp3 -hscalar3 -hvector3 -DNDEBUG"                    CACHE STRING "Release C flags"                  FORCE )
-set( CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_ALL} -O2 -hfp1 -Gfast -DNDEBUG"                                 CACHE STRING "Release-with-debug-info C flags"  FORCE )
-set( CMAKE_C_FLAGS_PRODUCTION     "${CMAKE_C_FLAGS_ALL} -O2 -hfp1 -G2"                                             CACHE STRING "Production C flags"               FORCE )
-set( CMAKE_C_FLAGS_BIT            "${CMAKE_C_FLAGS_ALL} -O2 -hfp1 -G2 -hflex_mp=conservative -hadd_paren -DNDEBUG" CACHE STRING "Bit-reproducible C flags"         FORCE )
-set( CMAKE_C_FLAGS_DEBUG          "${CMAKE_C_FLAGS_ALL} -O0 -G0"                                                   CACHE STRING "Debug Cflags"                     FORCE )
diff --git a/cmake/compiler_flags/Cray_CXX.cmake b/cmake/compiler_flags/Cray_CXX.cmake
deleted file mode 100644
index d599bff..0000000
--- a/cmake/compiler_flags/Cray_CXX.cmake
+++ /dev/null
@@ -1,14 +0,0 @@
-# (C) Copyright 1996-2016 ECMWF.
-#
-# This software is licensed under the terms of the Apache Licence Version 2.0
-# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-# In applying this licence, ECMWF does not waive the privileges and immunities
-# granted to it by virtue of its status as an intergovernmental organisation
-# nor does it submit to any jurisdiction.
-
-set( CMAKE_CXX_FLAGS_ALL            "-hlist=amid"                                                                      CACHE STRING "Common flags for all build-types"  FORCE )
-set( CMAKE_CXX_FLAGS_RELEASE        "${CMAKE_CXX_FLAGS_ALL} -O3 -hfp3 -hscalar3 -hvector3 -DNDEBUG"                    CACHE STRING "Release C++ flags"                 FORCE )
-set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_ALL} -O2 -hfp1 -Gfast -DNDEBUG"                                 CACHE STRING "Release-with-debug-info C++ flags" FORCE )
-set( CMAKE_CXX_FLAGS_PRODUCTION     "${CMAKE_CXX_FLAGS_ALL} -O2 -hfp1 -G2"                                             CACHE STRING "Production C++ flags"              FORCE )
-set( CMAKE_CXX_FLAGS_BIT            "${CMAKE_CXX_FLAGS_ALL} -O2 -hfp1 -G2 -hflex_mp=conservative -hadd_paren -DNDEBUG" CACHE STRING "Bit-reproducible C++ flags"        FORCE )
-set( CMAKE_CXX_FLAGS_DEBUG          "${CMAKE_CXX_FLAGS_ALL} -O0 -G0"                                                   CACHE STRING "Debug CXX flags"                   FORCE )
diff --git a/cmake/compiler_flags/Cray_Fortran.cmake b/cmake/compiler_flags/Cray_Fortran.cmake
deleted file mode 100644
index b2c23de..0000000
--- a/cmake/compiler_flags/Cray_Fortran.cmake
+++ /dev/null
@@ -1,15 +0,0 @@
-# (C) Copyright 1996-2016 ECMWF.
-#
-# This software is licensed under the terms of the Apache Licence Version 2.0
-# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-# In applying this licence, ECMWF does not waive the privileges and immunities
-# granted to it by virtue of its status as an intergovernmental organisation
-# nor does it submit to any jurisdiction.
-
-# -emf activates .mods and uses lower case
-set( CMAKE_Fortran_FLAGS_ALL            "-emf"                                                                                 CACHE STRING "Common flags for all build-types"      FORCE )
-set( CMAKE_Fortran_FLAGS_RELEASE        "${CMAKE_Fortran_FLAGS_ALL} -O3 -hfp3 -hscalar3 -hvector3 -DNDEBUG"                    CACHE STRING "Release Fortran flags"                 FORCE )
-set( CMAKE_Fortran_FLAGS_RELWITHDEBINFO "${CMAKE_Fortran_FLAGS_ALL} -O2 -hfp1 -Gfast -DNDEBUG"                                 CACHE STRING "Release-with-debug-info Fortran flags" FORCE )
-set( CMAKE_Fortran_FLAGS_PRODUCTION     "${CMAKE_Fortran_FLAGS_ALL} -O2 -hfp1 -G2"                                             CACHE STRING "Production Fortran flags"              FORCE )
-set( CMAKE_Fortran_FLAGS_BIT            "${CMAKE_Fortran_FLAGS_ALL} -O2 -hfp1 -G2 -hflex_mp=conservative -hadd_paren -DNDEBUG" CACHE STRING "Bit-reproducible Fortran flags"        FORCE )
-set( CMAKE_Fortran_FLAGS_DEBUG          "${CMAKE_Fortran_FLAGS_ALL} -O0 -G0"                                                   CACHE STRING "Debug Fortran flags"                   FORCE )
diff --git a/cmake/compiler_flags/GNU_C.cmake b/cmake/compiler_flags/GNU_C.cmake
deleted file mode 100644
index 955f527..0000000
--- a/cmake/compiler_flags/GNU_C.cmake
+++ /dev/null
@@ -1,18 +0,0 @@
-# (C) Copyright 1996-2016 ECMWF.
-#
-# This software is licensed under the terms of the Apache Licence Version 2.0
-# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-# In applying this licence, ECMWF does not waive the privileges and immunities
-# granted to it by virtue of its status as an intergovernmental organisation
-# nor does it submit to any jurisdiction.
-
-set( CMAKE_C_FLAGS_RELEASE        "-O3 -DNDEBUG"                       CACHE STRING "C compiler flags for Release builds"          FORCE )
-set( CMAKE_C_FLAGS_BIT            "-g -O2 -m64 -march=native -DNDEBUG" CACHE STRING "C compiler flags for Bit-reproducible builds" FORCE )
-set( CMAKE_C_FLAGS_DEBUG          "-O0 -g"                             CACHE STRING "C compiler flags for Debug builds"            FORCE )
-set( CMAKE_C_FLAGS_PRODUCTION     "-O2 -g"                             CACHE STRING "C compiler flags for Production builds."      FORCE )
-set( CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g"                             CACHE STRING "C compiler flags for RelWithDebInfo builds."  FORCE )
-
-# NOTE: gcc does not guarrante that -O3 performs better than -O2
-#       -- it can perform worse due to assembly code bloating.
-#   Moreover for gcc 4.1.2 we found that -O3 remove the parser code generated from Lex/Yacc
-#   and therefore in production mode we downgrade to -O2 if the compiler is GCC (for all versions).
diff --git a/cmake/compiler_flags/GNU_CXX.cmake b/cmake/compiler_flags/GNU_CXX.cmake
deleted file mode 100644
index 0ab8c3a..0000000
--- a/cmake/compiler_flags/GNU_CXX.cmake
+++ /dev/null
@@ -1,18 +0,0 @@
-# (C) Copyright 1996-2016 ECMWF.
-#
-# This software is licensed under the terms of the Apache Licence Version 2.0
-# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-# In applying this licence, ECMWF does not waive the privileges and immunities
-# granted to it by virtue of its status as an intergovernmental organisation
-# nor does it submit to any jurisdiction.
-
-set( CMAKE_CXX_FLAGS_RELEASE        "-O3 -DNDEBUG"                       CACHE STRING "C++ compiler flags for Release builds"          FORCE )
-set( CMAKE_CXX_FLAGS_BIT            "-g -O2 -m64 -march=native -DNDEBUG" CACHE STRING "C++ compiler flags for Bit-reproducible builds" FORCE )
-set( CMAKE_CXX_FLAGS_DEBUG          "-O0 -g"                             CACHE STRING "C++ compiler flags for Debug builds"            FORCE )
-set( CMAKE_CXX_FLAGS_PRODUCTION     "-O2 -g"                             CACHE STRING "C++ compiler flags for Production builds."      FORCE )
-set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g"                             CACHE STRING "C++ compiler flags for RelWithDebInfo builds."  FORCE )
-
-# NOTE: gcc does not guarrante that -O3 performs better than -O2
-#       -- it can perform worse due to assembly code bloating.
-#   Moreover for gcc 4.1.2 we found that -O3 remove the parser code generated from Lex/Yacc
-#   and therefore in production mode we downgrade to -O2 if the compiler is GCC (for all versions).
diff --git a/cmake/compiler_flags/GNU_Fortran.cmake b/cmake/compiler_flags/GNU_Fortran.cmake
deleted file mode 100644
index a12abec..0000000
--- a/cmake/compiler_flags/GNU_Fortran.cmake
+++ /dev/null
@@ -1,21 +0,0 @@
-# (C) Copyright 1996-2016 ECMWF.
-#
-# This software is licensed under the terms of the Apache Licence Version 2.0
-# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-# In applying this licence, ECMWF does not waive the privileges and immunities
-# granted to it by virtue of its status as an intergovernmental organisation
-# nor does it submit to any jurisdiction.
-
-set( CMAKE_Fortran_FLAGS_RELEASE        "-O3 -funroll-all-loops -finline-functions"                                CACHE STRING "Fortran compiler flags for Release builds"          FORCE )
-set( CMAKE_Fortran_FLAGS_BIT            "-g -O2 -m64 -march=native -DNDEBUG -fno-range-check -fconvert=big-endian" CACHE STRING "Fortran compiler flags for Bit-reproducible builds" FORCE )
-set( CMAKE_Fortran_FLAGS_DEBUG          "-O0 -g -fcheck=bounds -fbacktrace -finit-real=snan"                       CACHE STRING "Fortran compiler flags for Debug builds"            FORCE )
-set( CMAKE_Fortran_FLAGS_PRODUCTION     "-O2 -g"                                                                   CACHE STRING "Fortran compiler flags for Production builds."      FORCE )
-set( CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-O2 -g"                                                                   CACHE STRING "Fortran compiler flags for RelWithDebInfo builds."  FORCE )
-
-####################################################################
-
-# Meaning of flags
-# ----------------
-# -fstack-arrays     : Allocate automatic arrays on the stack (needs large stacksize!!!)
-# -funroll-all-loops : Unroll all loops
-# -fcheck=bounds     : Bounds checking
diff --git a/cmake/compiler_flags/Intel_C.cmake b/cmake/compiler_flags/Intel_C.cmake
deleted file mode 100644
index dbea59f..0000000
--- a/cmake/compiler_flags/Intel_C.cmake
+++ /dev/null
@@ -1,13 +0,0 @@
-# (C) Copyright 1996-2016 ECMWF.
-#
-# This software is licensed under the terms of the Apache Licence Version 2.0
-# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-# In applying this licence, ECMWF does not waive the privileges and immunities
-# granted to it by virtue of its status as an intergovernmental organisation
-# nor does it submit to any jurisdiction.
-
-set( CMAKE_C_FLAGS_RELEASE        "-O3 -DNDEBUG"      CACHE STRING "Release C compiler flags"                  FORCE )
-set( CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g"            CACHE STRING "Release-with-debug-info C compiler flags"  FORCE )
-set( CMAKE_C_FLAGS_BIT            "-O2 -DNDEBUG"      CACHE STRING "Bit-reproducible C compiler flags"         FORCE )
-set( CMAKE_C_FLAGS_DEBUG          "-O0 -g -traceback" CACHE STRING "Debug C compiler flags"                    FORCE )
-set( CMAKE_C_FLAGS_PRODUCTION     "-O3 -g"            CACHE STRING "Production C compiler flags"               FORCE )
diff --git a/cmake/compiler_flags/Intel_CXX.cmake b/cmake/compiler_flags/Intel_CXX.cmake
deleted file mode 100644
index 5b8dc78..0000000
--- a/cmake/compiler_flags/Intel_CXX.cmake
+++ /dev/null
@@ -1,13 +0,0 @@
-# (C) Copyright 1996-2016 ECMWF.
-#
-# This software is licensed under the terms of the Apache Licence Version 2.0
-# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-# In applying this licence, ECMWF does not waive the privileges and immunities
-# granted to it by virtue of its status as an intergovernmental organisation
-# nor does it submit to any jurisdiction.
-
-set( CMAKE_CXX_FLAGS_RELEASE        "-O3 -DNDEBUG"      CACHE STRING "Release C++ compiler flags"                 FORCE )
-set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g"            CACHE STRING "Release-with-debug-info C++ compiler flags" FORCE )
-set( CMAKE_CXX_FLAGS_BIT            "-O2 -DNDEBUG"      CACHE STRING "Bit-reproducible C++ compiler flags"        FORCE )
-set( CMAKE_CXX_FLAGS_DEBUG          "-O0 -g -traceback" CACHE STRING "Debug C++ compiler flags"                   FORCE )
-set( CMAKE_CXX_FLAGS_PRODUCTION     "-O3 -g"            CACHE STRING "Production C++ compiler flags"              FORCE )
diff --git a/cmake/compiler_flags/Intel_Fortran.cmake b/cmake/compiler_flags/Intel_Fortran.cmake
deleted file mode 100644
index 86b69dc..0000000
--- a/cmake/compiler_flags/Intel_Fortran.cmake
+++ /dev/null
@@ -1,14 +0,0 @@
-# (C) Copyright 1996-2016 ECMWF.
-#
-# This software is licensed under the terms of the Apache Licence Version 2.0
-# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-# In applying this licence, ECMWF does not waive the privileges and immunities
-# granted to it by virtue of its status as an intergovernmental organisation
-# nor does it submit to any jurisdiction.
-
-set( CMAKE_Fortran_FLAGS_RELEASE        "-O3 -unroll -inline -heap-arrays"          CACHE STRING "Release Fortran flags"                 FORCE )
-set( CMAKE_Fortran_FLAGS_RELWITHDEBINFO "-O2 -g"                                    CACHE STRING "Release-with-debug-info Fortran flags" FORCE )
-set( CMAKE_Fortran_FLAGS_BIT            "-O2 -unroll -inline -heap-arrays"          CACHE STRING "Bit-reproducible Fortran flags"        FORCE )
-# -check all implies -check bounds
-set( CMAKE_Fortran_FLAGS_DEBUG          "-O0 -g -traceback -heap-arrays -check all" CACHE STRING "Debug Fortran flags"                   FORCE )
-set( CMAKE_Fortran_FLAGS_PRODUCTION     "-O3 -g"                                    CACHE STRING "Production Fortran compiler flags"     FORCE )
diff --git a/cmake/compiler_flags/PGI_C.cmake b/cmake/compiler_flags/PGI_C.cmake
deleted file mode 100644
index 6784a14..0000000
--- a/cmake/compiler_flags/PGI_C.cmake
+++ /dev/null
@@ -1,11 +0,0 @@
-# (C) Copyright 1996-2016 ECMWF.
-#
-# This software is licensed under the terms of the Apache Licence Version 2.0
-# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-# In applying this licence, ECMWF does not waive the privileges and immunities
-# granted to it by virtue of its status as an intergovernmental organisation nor
-# does it submit to any jurisdiction.
-
-set( CMAKE_C_FLAGS_RELEASE "-fast -O3 -DNDEBUG" CACHE STRING "Release C compiler flags" FORCE )
-
-set( CMAKE_C_LINK_FLAGS "" CACHE STRING "" )
diff --git a/cmake/compiler_flags/PGI_CXX.cmake b/cmake/compiler_flags/PGI_CXX.cmake
deleted file mode 100644
index 877ef3f..0000000
--- a/cmake/compiler_flags/PGI_CXX.cmake
+++ /dev/null
@@ -1,11 +0,0 @@
-# (C) Copyright 1996-2016 ECMWF.
-#
-# This software is licensed under the terms of the Apache Licence Version 2.0
-# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-# In applying this licence, ECMWF does not waive the privileges and immunities
-# granted to it by virtue of its status as an intergovernmental organisation nor
-# does it submit to any jurisdiction.
-
-set( CMAKE_CXX_FLAGS_RELEASE "-fast -O3 -DNDEBUG" CACHE STRING "Release C++ compiler flags" FORCE )
-
-set( CMAKE_CXX_LINK_FLAGS "" CACHE STRING "" )
diff --git a/cmake/compiler_flags/PGI_Fortran.cmake b/cmake/compiler_flags/PGI_Fortran.cmake
deleted file mode 100644
index a268cc9..0000000
--- a/cmake/compiler_flags/PGI_Fortran.cmake
+++ /dev/null
@@ -1,11 +0,0 @@
-# (C) Copyright 1996-2016 ECMWF.
-#
-# This software is licensed under the terms of the Apache Licence Version 2.0
-# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-# In applying this licence, ECMWF does not waive the privileges and immunities
-# granted to it by virtue of its status as an intergovernmental organisation nor
-# does it submit to any jurisdiction.
-
-set( CMAKE_Fortran_FLAGS_RELEASE "-fast -O3" CACHE STRING "Release Fortran compiler flags" FORCE )
-
-set( CMAKE_Fortran_LINK_FLAGS "" CACHE STRING "" )
diff --git a/cmake/contrib/FindFFTW.cmake b/cmake/contrib/FindFFTW.cmake
index 5ef46df..d76767b 100644
--- a/cmake/contrib/FindFFTW.cmake
+++ b/cmake/contrib/FindFFTW.cmake
@@ -1,60 +1,22 @@
-# (C) Copyright 1996-2016 ECMWF.
+# - Find the FFTW library
+#
+# Usage:
+#   find_package(FFTW [REQUIRED] [QUIET] )
+#     
+# It sets the following variables:
+#   FFTW_FOUND               ... true if fftw is found on the system
+#   FFTW_LIBRARIES           ... full path to fftw library
+#   FFTW_INCLUDES            ... fftw include directory
+#
+# The following variables will be checked by the function
+#   FFTW_USE_STATIC_LIBS    ... if true, only static libraries are found
+#   FFTW_ROOT               ... if set, the libraries are exclusively searched
+#                               under this path
+#   FFTW_DIR                ... equivalent to FFTW_ROOT
+#   FFTW_PATH               ... equivalent to FFTW_ROOT
+#   FFTW_LIBRARY            ... fftw library to use
+#   FFTW_INCLUDE_DIR        ... fftw include directory
 #
-# This software is licensed under the terms of the Apache Licence Version 2.0
-# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-# In applying this licence, ECMWF does not waive the privileges and immunities
-# granted to it by virtue of its status as an intergovernmental organisation nor
-# does it submit to any jurisdiction.
-
-##############################################################################
-#.rst:
-#
-# FindFFTW
-# ========
-#
-# Find the FFTW library. ::
-#
-#   find_package(FFTW [REQUIRED] [QUIET]
-#                [COMPONENTS [single] [double] [long_double] [quad]])
-#
-# By default, search for the double precision library ``fftw3``
-#
-# Components
-# ----------
-#
-# If a different version or multiple versions of the library are required,
-# these need to be specified as ``COMPONENTS``. Note that double must be given
-# explicitly if any ``COMPONENTS`` are specified.
-#
-# The libraries corresponding to each of the ``COMPONENTS`` are:
-#
-# :single:      ``fftw3f``
-# :double:      ``fftw3``
-# :long_double: ``fftw3l``
-# :quad:        ``fftw3q``
-#
-# Output variables
-# ----------------
-#
-# The following CMake variables are set on completion:
-#
-# :FFTW_FOUND:      true if FFTW is found on the system
-# :FFTW_LIBRARIES:  full paths to requested FFTW libraries
-# :FFTW_INCLUDES:   FFTW include directory
-#
-# Input variables
-# ---------------
-#
-# The following CMake variables are checked by the function:
-#
-# :FFTW_USE_STATIC_LIBS:  if true, only static libraries are found
-# :FFTW_ROOT:             if set, this path is exclusively searched
-# :FFTW_DIR:              equivalent to FFTW_ROOT
-# :FFTW_PATH:             equivalent to FFTW_ROOT
-# :FFTW_LIBRARY:          FFTW library to use
-# :FFTW_INCLUDE_DIR:      FFTW include directory
-#
-##############################################################################
 
 #============================================#
 #                                            #
@@ -110,103 +72,76 @@ else()
   set( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX} )
 endif()
 
-if( FFTW_FIND_COMPONENTS )
-  ecbuild_debug( "FindFFTW: looking for components: ${FFTW_FIND_COMPONENTS}" )
-  foreach( _component ${FFTW_FIND_COMPONENTS} )
-    if( _component MATCHES "single" )
-      ecbuild_debug( "FindFFTW: looking for single precision (fftw3f)" )
-      set( _require_sp TRUE )
-    elseif( _component MATCHES "double" )
-      ecbuild_debug( "FindFFTW: looking for double precision (fftw3)" )
-      set( _require_dp TRUE )
-    elseif( _component MATCHES "long_double" )
-      ecbuild_debug( "FindFFTW: looking for long double precision (fftw3l)" )
-      set( _require_lp TRUE )
-    elseif( _component MATCHES "quad" )
-      ecbuild_debug( "FindFFTW: looking for quad precision (fftw3q)" )
-      set( _require_qp TRUE )
-    else()
-    endif()
-  endforeach()
-else()
-  ecbuild_debug( "FindFFTW: no components specified, looking for double precision (fftw3)" )
-  set( _require_dp TRUE )
-endif()
-
 if( FFTW_ROOT )
-  set( _default_paths NO_DEFAULT_PATH )
-  set( _lib_paths ${FFTW_ROOT} )
-  set( _include_paths ${FFTW_ROOT} )
-else()
-  set( _lib_paths ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR} )
-  set( _include_paths ${PKG_FFTW_INCLUDE_DIRS} ${INCLUDE_INSTALL_DIR} )
-endif()
-
-#find libs
 
-if( _require_dp )
+  #find libs
   find_library(
     FFTW_LIB
     NAMES "fftw3"
-    PATHS ${_lib_paths}
+    PATHS ${FFTW_ROOT}
     PATH_SUFFIXES "lib" "lib64"
-    ${_default_paths}
+    NO_DEFAULT_PATH
   )
-  if( NOT FFTW_LIB )
-    ecbuild_warn("FindFFTW: double precision required, but fftw3 was not found")
-  endif()
-endif()
 
-if( _require_sp )
   find_library(
     FFTWF_LIB
     NAMES "fftw3f"
-    PATHS ${_lib_paths}
+    PATHS ${FFTW_ROOT}
     PATH_SUFFIXES "lib" "lib64"
-    ${_default_paths}
+    NO_DEFAULT_PATH
   )
-  if( NOT FFTWF_LIB )
-    ecbuild_warn("FindFFTW: single precision required, but fftw3f was not found")
-  endif()
-endif()
 
-if( _require_lp )
   find_library(
     FFTWL_LIB
     NAMES "fftw3l"
-    PATHS ${_lib_paths}
+    PATHS ${FFTW_ROOT}
     PATH_SUFFIXES "lib" "lib64"
-    ${_default_paths}
+    NO_DEFAULT_PATH
+  )
+
+  #find includes
+  find_path(
+    FFTW_INCLUDES
+    NAMES "fftw3.h"
+    PATHS ${FFTW_ROOT}
+    PATH_SUFFIXES "include"
+    NO_DEFAULT_PATH
   )
-  if( NOT FFTWL_LIB )
-    ecbuild_warn("FindFFTW: long double precision required, but fftw3l was not found")
-  endif()
-endif()
 
-if( _require_qp )
+else()
+
   find_library(
-    FFTWQ_LIB
-    NAMES "fftw3q"
-    PATHS ${_lib_paths}
-    PATH_SUFFIXES "lib" "lib64"
-    ${_default_paths}
+    FFTW_LIB
+    NAMES "fftw3"
+    PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
   )
-  if( NOT FFTWQ_LIB )
-    ecbuild_warn("FindFFTW: quad precision required, but fftw3q was not found")
-  endif()
-endif()
 
-#find includes
+  find_library(
+    FFTWF_LIB
+    NAMES "fftw3f"
+    PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
+  )
+
+
+  find_library(
+    FFTWL_LIB
+    NAMES "fftw3l"
+    PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
+  )
+
+  find_path(
+    FFTW_INCLUDES
+    NAMES "fftw3.h"
+    PATHS ${PKG_FFTW_INCLUDE_DIRS} ${INCLUDE_INSTALL_DIR}
+  )
+
+endif( FFTW_ROOT )
 
-find_path(
-  FFTW_INCLUDES
-  NAMES "fftw3.h"
-  PATHS ${_include_paths}
-  PATH_SUFFIXES "include"
-  ${_default_paths}
-)
+set(FFTW_LIBRARIES ${FFTW_LIB} ${FFTWF_LIB})
 
-set(FFTW_LIBRARIES ${FFTW_LIB} ${FFTWF_LIB} ${FFTWL_LIB} ${FFTWQ_LIB})
+if(FFTWL_LIB)
+  set(FFTW_LIBRARIES ${FFTW_LIBRARIES} ${FFTWL_LIB})
+endif()
 
 set( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SAV} )
 
@@ -214,4 +149,4 @@ include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(FFTW DEFAULT_MSG
                                   FFTW_INCLUDES FFTW_LIBRARIES)
 
-mark_as_advanced(FFTW_INCLUDES FFTW_LIBRARIES FFTW_LIB FFTWF_LIB FFTWL_LIB)
+mark_as_advanced(FFTW_INCLUDES FFTW_LIBRARIES FFTW_LIB FFTWF_LIB FFTWL_LIB)
\ No newline at end of file
diff --git a/cmake/contrib/FindNetCDF4.cmake b/cmake/contrib/FindNetCDF4.cmake
index 2afff21..89b0337 100644
--- a/cmake/contrib/FindNetCDF4.cmake
+++ b/cmake/contrib/FindNetCDF4.cmake
@@ -158,7 +158,7 @@ else()
     foreach( LANGUAGE ${NETCDF_LANGUAGE_BINDINGS} )
         ecbuild_debug("FindNetCDF4: looking for ${LANGUAGE} language bindings")
         set( NETCDF_${LANGUAGE}_FOUND 1 ) # disable this in following if necessary
-
+      
         # find the NETCDF includes
         foreach( INC ${NETCDF_${LANGUAGE}_INCLUDE_NAMES} )
           find_path( NETCDF_${INC}_INCLUDE_DIR ${INC}
@@ -170,7 +170,7 @@ else()
                   Include
           )
           mark_as_advanced( NETCDF_${INC}_INCLUDE_DIR )
-          # ecbuild_debug_var( NETCDF_${INC}_INCLUDE_DIR)
+          # debug_var( NETCDF_${INC}_INCLUDE_DIR)
           if (NETCDF_${INC}_INCLUDE_DIR)
             list( APPEND NETCDF_INCLUDE_DIRS ${NETCDF_${INC}_INCLUDE_DIR} )
           else()
@@ -249,19 +249,19 @@ else()
 
         # Append the libraries for this language binding to the list of all
         # required libraries.
-
+        
         if( NETCDF_${LANGUAGE}_FOUND )
             ecbuild_debug( "FindNetCDF4: ${LANGUAGE} language bindings found" )
             if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
-                list( APPEND NETCDF_${LANGUAGE}_LIBRARIES
+                list( APPEND NETCDF_${LANGUAGE}_LIBRARIES 
                     debug ${NETCDF_${LANGUAGE}_LIBRARIES_DEBUG}
                     optimized ${NETCDF_${LANGUAGE}_LIBRARIES_RELEASE} )
             else()
-                list( APPEND NETCDF_${LANGUAGE}_LIBRARIES
-                    ${NETCDF_${LANGUAGE}_LIBRARIES_RELEASE} )
+                list( APPEND NETCDF_${LANGUAGE}_LIBRARIES 
+                    ${NETCDF_${LANGUAGE}_LIBRARIES_RELEASE} )                  
             endif()
         endif()
-        # ecbuild_debug_var( NETCDF_${LANGUAGE}_LIBRARIES )
+        # debug_var( NETCDF_${LANGUAGE}_LIBRARIES )
         list( APPEND NETCDF_FOUND_REQUIRED_VARS NETCDF_${LANGUAGE}_FOUND )
     endforeach()
 
diff --git a/cmake/contrib/GetGitRevisionDescription.cmake.in b/cmake/contrib/GetGitRevisionDescription.cmake.in
index 9fd3e64..7a3e42f 100644
--- a/cmake/contrib/GetGitRevisionDescription.cmake.in
+++ b/cmake/contrib/GetGitRevisionDescription.cmake.in
@@ -33,10 +33,6 @@ else()
 endif()
 
 if(NOT HEAD_HASH)
-  if(EXISTS "@GIT_DATA@/head-ref")
     file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024)
     string(STRIP "${HEAD_HASH}" HEAD_HASH)
-  else()
-    set(HEAD_HASH "unknown")
-  endif()
-endif()
+endif()
\ No newline at end of file
diff --git a/cmake/contrib/GreatCMakeCookOff/tests/CMakeLists.txt b/cmake/contrib/GreatCMakeCookOff/tests/CMakeLists.txt
new file mode 100644
index 0000000..f2eb4d0
--- /dev/null
+++ b/cmake/contrib/GreatCMakeCookOff/tests/CMakeLists.txt
@@ -0,0 +1,12 @@
+cmake_minimum_required(VERSION 2.8.3 FATAL_ERROR)
+project(COOKOFF_TEST)
+
+enable_testing()
+
+include(${PROJECT_SOURCE_DIR}/../TestCMake.cmake)
+
+cmake_test(checkisnan SOURCE)
+cmake_test(checkcpp11flags)
+cmake_test(addgtest NOEXEC SOURCE --test-command ${CMAKE_MAKE_PROGRAM} test)
+
+add_subdirectory(cpp11)
diff --git a/cmake/contrib/GreatCMakeCookOff/tests/cpp11/CMakeLists.txt b/cmake/contrib/GreatCMakeCookOff/tests/cpp11/CMakeLists.txt
new file mode 100644
index 0000000..45d20a5
--- /dev/null
+++ b/cmake/contrib/GreatCMakeCookOff/tests/cpp11/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_test(allfeatures)
+cmake_test(parse_input_features)
+cmake_test(check_features)
diff --git a/cmake/ecbuild-config-version.cmake b/cmake/ecbuild-config-version.cmake
deleted file mode 100644
index df30489..0000000
--- a/cmake/ecbuild-config-version.cmake
+++ /dev/null
@@ -1,12 +0,0 @@
-set(PACKAGE_VERSION "2.0.0")
-
-# check whether the requested PACKAGE_FIND_VERSION is compatible
-
-if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
-  set(PACKAGE_VERSION_COMPATIBLE FALSE)
-else()
-  set(PACKAGE_VERSION_COMPATIBLE TRUE)
-  if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}")
-    set(PACKAGE_VERSION_EXACT TRUE)
-  endif()
-endif()
diff --git a/cmake/ecbuild-config.cmake b/cmake/ecbuild-config.cmake
deleted file mode 100644
index c446743..0000000
--- a/cmake/ecbuild-config.cmake
+++ /dev/null
@@ -1,97 +0,0 @@
-# Config file for the ecbuild package
-# Defines the following variables:
-#
-#  ECBUILD_INCLUDE_DIRS   - include directories
-#  ECBUILD_DEFINITIONS    - preprocessor definitions
-#  ECBUILD_LIBRARIES      - libraries to link against
-#  ECBUILD_FEATURES       - list of enabled features
-#  ECBUILD_VERSION        - version of the package
-#  ECBUILD_GIT_SHA1       - Git revision of the package
-#  ECBUILD_GIT_SHA1_SHORT - short Git revision of the package
-#
-# Also defines ecbuild third-party library dependencies:
-#  ECBUILD_TPLS             - package names of  third-party library dependencies
-#  ECBUILD_TPL_INCLUDE_DIRS - include directories
-#  ECBUILD_TPL_DEFINITIONS  - preprocessor definitions
-#  ECBUILD_TPL_LIBRARIES    - libraries to link against
-
-### compute paths
-
-get_filename_component(ECBUILD_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
-
-set( ECBUILD_SELF_INCLUDE_DIRS "${ECBUILD_CMAKE_DIR}/../../../include" )
-set( ECBUILD_SELF_DEFINITIONS  "" )
-set( ECBUILD_SELF_LIBRARIES    "" )
-
-set( ECBUILD_TPLS              "" )
-set( ECBUILD_TPL_INCLUDE_DIRS  "" )
-set( ECBUILD_TPL_DEFINITIONS   "" )
-set( ECBUILD_TPL_LIBRARIES     "" )
-
-set( ECBUILD_VERSION           "2.0.0" )
-set( ECBUILD_GIT_SHA1          "0ef4781340b9bc18fb771255dad92be78e049a51" )
-set( ECBUILD_GIT_SHA1_SHORT    "0ef4781" )
-
-### export include paths as absolute paths
-
-set( ECBUILD_INCLUDE_DIRS "" )
-foreach( path ${ECBUILD_SELF_INCLUDE_DIRS} )
-  get_filename_component( abspath ${path} ABSOLUTE )
-  list( APPEND ECBUILD_INCLUDE_DIRS ${abspath} )
-endforeach()
-list( APPEND ECBUILD_INCLUDE_DIRS ${ECBUILD_TPL_INCLUDE_DIRS} )
-
-### export definitions
-
-set( ECBUILD_DEFINITIONS      ${ECBUILD_SELF_DEFINITIONS} ${ECBUILD_TPL_DEFINITIONS} )
-
-### export list of all libraries
-
-set( ECBUILD_LIBRARIES        ${ECBUILD_SELF_LIBRARIES}   ${ECBUILD_TPL_LIBRARIES}   )
-
-### export the features provided by the package
-
-set( ECBUILD_FEATURES    "TESTS;INSTALL" )
-foreach( _f ${ECBUILD_FEATURES} )
-  set( ECBUILD_HAVE_${_f} 1 )
-endforeach()
-
-# Has this configuration been exported from a build tree?
-set( ECBUILD_IS_BUILD_DIR_EXPORT OFF )
-
-if( EXISTS ${ECBUILD_CMAKE_DIR}/ecbuild-import.cmake )
-  set( ECBUILD_IMPORT_FILE "${ECBUILD_CMAKE_DIR}/ecbuild-import.cmake" )
-  include( ${ECBUILD_IMPORT_FILE} )
-endif()
-
-# here goes the imports of the TPL's
-
-include( ${CMAKE_CURRENT_LIST_FILE}.tpls OPTIONAL )
-
-# insert definitions for IMPORTED targets
-
-if( NOT ecbuild_BINARY_DIR )
-
-  if( ECBUILD_IS_BUILD_DIR_EXPORT )
-    include( "/tmp/metabuilds/ecflow-metab_5062/opensuse131/ecbuild/builds/ecbuild-targets.cmake" OPTIONAL )
-  else()
-    include( "${ECBUILD_CMAKE_DIR}/ecbuild-targets.cmake" )
-  endif()
-
-endif()
-
-# publish this file as imported
-
-set( ECBUILD_IMPORT_FILE ${CMAKE_CURRENT_LIST_FILE} )
-mark_as_advanced( ECBUILD_IMPORT_FILE )
-
-# set ecbuild_BASE_DIR for final installations or build directories
-
-if( NOT ecbuild )
-  if( ECBUILD_IS_BUILD_DIR_EXPORT )
-    set( ecbuild_BASE_DIR /tmp/metabuilds/ecflow-metab_5062/opensuse131/ecbuild/builds )
-  else()
-    get_filename_component( abspath ${CMAKE_CURRENT_LIST_DIR}/../../.. ABSOLUTE )
-    set( ecbuild_BASE_DIR ${abspath} )
-  endif()
-endif()
diff --git a/cmake/ecbuild_add_c_flags.cmake b/cmake/ecbuild_add_c_flags.cmake
index bef45f3..bef1d34 100644
--- a/cmake/ecbuild_add_c_flags.cmake
+++ b/cmake/ecbuild_add_c_flags.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -40,53 +40,41 @@ macro( ecbuild_add_c_flags m_c_flags )
 
     cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}"  ${_FIRST_ARG} ${ARGN} )
 
-    set( _try_add_flag TRUE )
-    if( _PAR_BUILD )
-      string( TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_CAPS )
-      string( TOUPPER ${_PAR_BUILD}  _PAR_BUILD_CAPS )
-      if( NOT CMAKE_BUILD_TYPE_CAPS MATCHES "${_PAR_BUILD_CAPS}" )
-        set( _try_add_flag FALSE )
-      endif()
+    if( NOT DEFINED N_CFLAG )
+      set( N_CFLAG 0 )
     endif()
-    if( _try_add_flag )
-      if( NOT DEFINED N_CFLAG )
-        set( N_CFLAG 0 )
-      endif()
 
-      math( EXPR N_CFLAG '${N_CFLAG}+1' )
+    math( EXPR N_CFLAG '${N_CFLAG}+1' )
 
-      if( NOT ECBUILD_TRUST_FLAGS )
-        if( DEFINED _PAR_NAME )
-          check_c_compiler_flag( ${_flags} ${_PAR_NAME} )
-          set( _flag_ok ${${_PAR_NAME}} )
-        else()
-          check_c_compiler_flag( ${_flags} C_FLAG_TEST_${N_CFLAG} )
-          set( _flag_ok ${C_FLAG_TEST_${N_CFLAG}} )
-        endif()
+    if( NOT ECBUILD_TRUST_FLAGS )
+      if( DEFINED _PAR_NAME )
+        check_c_compiler_flag( ${_flags} ${_PAR_NAME} )
+        set( _flag_ok ${${_PAR_NAME}} )
       else()
-        set( _flag_ok 1 )
+        check_c_compiler_flag( ${_flags} C_FLAG_TEST_${N_CFLAG} )
+        set( _flag_ok ${C_FLAG_TEST_${N_CFLAG}} )
       endif()
+    else()
+      set( _flag_ok 1 )
+    endif()
 
-      if( _flag_ok )
-        if( _PAR_BUILD )
-          set( CMAKE_C_FLAGS_${_PAR_BUILD} "${CMAKE_C_FLAGS_${_PAR_BUILD}} ${_flags}" )
-          ecbuild_debug( "C FLAG [${_flags}] added for build type ${_PAR_BUILD}" )
-        else()
-          set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_flags}" )
-          ecbuild_debug( "C FLAG [${_flags}] added" )
-        endif()
+    if( _flag_ok )
+      if( _PAR_BUILD )
+        set( CMAKE_C_FLAGS_${_PAR_BUILD} "${CMAKE_C_FLAGS_${_PAR_BUILD}} ${_flags}" )
+        ecbuild_debug( "C FLAG [${_flags}] added for build type ${_PAR_BUILD}" )
       else()
-        message( WARNING "Unrecognised C flag [${_flags}] -- skipping" )
+        set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_flags}" )
+        ecbuild_debug( "C FLAG [${_flags}] added" )
       endif()
+    else()
+      message( WARNING "Unrecognised C flag [${_flags}] -- skipping" )
     endif()
-    unset( _flags )
-    unset( _flag_ok )
-    unset( _try_add_flag )
   endif()
-
+  unset( _flags )
+  unset( _flag_ok )
 endmacro()
 
 macro( cmake_add_c_flags m_c_flags )
-  ecbuild_deprecate( " cmake_add_c_flags is deprecated, use ecbuild_add_c_flags instead." )
+  message( DEPRECATION " cmake_add_c_flags is deprecated, use ecbuild_add_c_flags instead." )
   ecbuild_add_c_flags( ${m_c_flags} )
 endmacro()
diff --git a/cmake/ecbuild_add_cxx11_flags.cmake b/cmake/ecbuild_add_cxx11_flags.cmake
index df8cde5..a4cce91 100644
--- a/cmake/ecbuild_add_cxx11_flags.cmake
+++ b/cmake/ecbuild_add_cxx11_flags.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
diff --git a/cmake/ecbuild_add_cxx_flags.cmake b/cmake/ecbuild_add_cxx_flags.cmake
index 9e59305..8393572 100644
--- a/cmake/ecbuild_add_cxx_flags.cmake
+++ b/cmake/ecbuild_add_cxx_flags.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -39,54 +39,42 @@ macro( ecbuild_add_cxx_flags m_cxx_flags )
 
     cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}"  ${_FIRST_ARG} ${ARGN} )
 
-    set( _try_add_flag TRUE )
-    if( _PAR_BUILD )
-      string( TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_CAPS )
-      string( TOUPPER ${_PAR_BUILD}  _PAR_BUILD_CAPS )
-      if( NOT CMAKE_BUILD_TYPE_CAPS MATCHES "${_PAR_BUILD_CAPS}" )
-        set( _try_add_flag FALSE )
-      endif()
+    if( NOT DEFINED N_CXXFLAG )
+      set( N_CXXFLAG 0 )
     endif()
-    if( _try_add_flag )
-
-      if( NOT DEFINED N_CXXFLAG )
-        set( N_CXXFLAG 0 )
-      endif()
 
-      math( EXPR N_CXXFLAG '${N_CXXFLAG}+1' )
+    math( EXPR N_CXXFLAG '${N_CXXFLAG}+1' )
 
-      if( NOT ECBUILD_TRUST_FLAGS )
-        if( DEFINED _PAR_NAME )
-          check_cxx_compiler_flag( ${_flags} ${_PAR_NAME} )
-          set( _flag_ok ${${_PAR_NAME}} )
-        else()
-          check_cxx_compiler_flag( ${_flags} CXX_FLAG_TEST_${N_CXXFLAG} )
-          set( _flag_ok CXX_FLAG_TEST_${N_CXXFLAG} )
-        endif()
+    if( NOT ECBUILD_TRUST_FLAGS )
+      if( DEFINED _PAR_NAME )
+        check_cxx_compiler_flag( ${_flags} ${_PAR_NAME} )
+        set( _flag_ok ${${_PAR_NAME}} )
       else()
-        set( _flag_ok 1 )
+        check_cxx_compiler_flag( ${_flags} CXX_FLAG_TEST_${N_CXXFLAG} )
+        set( _flag_ok CXX_FLAG_TEST_${N_CXXFLAG} )
       endif()
+    else()
+      set( _flag_ok 1 )
+    endif()
 
-      if( _flag_ok )
-        if( _PAR_BUILD )
-          set( CMAKE_CXX_FLAGS_${_PAR_BUILD} "${CMAKE_CXX_FLAGS_${_PAR_BUILD}} ${_flags}" )
-          ecbuild_debug( "C++ FLAG [${_flags}] added for build type ${_PAR_BUILD}" )
-        else()
-          set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flags}" )
-          ecbuild_debug( "C++ FLAG [${_flags}] added" )
-        endif()
+    if( _flag_ok )
+      if( _PAR_BUILD )
+        set( CMAKE_CXX_FLAGS_${_PAR_BUILD} "${CMAKE_CXX_FLAGS_${_PAR_BUILD}} ${_flags}" )
+        ecbuild_debug( "C++ FLAG [${_flags}] added for build type ${_PAR_BUILD}" )
       else()
-        message( STATUS "Unrecognised CXX flag [${_flags}] -- skipping" )
+        set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flags}" )
+        ecbuild_debug( "C++ FLAG [${_flags}] added" )
       endif()
+    else()
+      message( STATUS "Unrecognised CXX flag [${_flags}] -- skipping" )
     endif()
-    unset( _flags )
-    unset( _flag_ok )
-    unset( _try_add_flag )
   endif()
+  unset( _flags )
+  unset( _flag_ok )
 
 endmacro()
 
 macro( cmake_add_cxx_flags m_cxx_flags )
-  ecbuild_deprecate( " cmake_add_cxx_flags is deprecated, use ecbuild_add_cxx_flags instead." )
+  message( DEPRECATION " cmake_add_cxx_flags is deprecated, use ecbuild_add_cxx_flags instead." )
   ecbuild_add_cxx_flags( ${m_cxx_flags} )
 endmacro()
diff --git a/cmake/ecbuild_add_executable.cmake b/cmake/ecbuild_add_executable.cmake
index d2e3f4c..e4e39a1 100644
--- a/cmake/ecbuild_add_executable.cmake
+++ b/cmake/ecbuild_add_executable.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -16,9 +16,6 @@
 #
 #   ecbuild_add_executable( TARGET <name>
 #                           SOURCES <source1> [<source2> ...]
-#                           [ SOURCES_GLOB <glob1> [<glob2> ...] ]
-#                           [ SOURCES_EXCLUDE_REGEX <regex1> [<regex2> ...] ]
-#                           [ OBJECTS <obj1> [<obj2> ...] ]
 #                           [ TEMPLATES <template1> [<template2> ...] ]
 #                           [ LIBS <library1> [<library2> ...] ]
 #                           [ INCLUDES <path1> [<path2> ...] ]
@@ -44,16 +41,6 @@
 # SOURCES : required
 #   list of source files
 #
-# SOURCES_GLOB : optional
-#   search pattern to find source files to compile (note: not recommend according to CMake guidelines)
-#   it is usually better to explicitly list the source files in the CMakeList.txt
-#
-# SOURCES_EXCLUDE_REGEX : optional
-#   search pattern to exclude source files from compilation, applies o the results of SOURCES_GLOB
-#
-# OBJECTS : optional
-#   list of object libraries to add to this target
-#
 # TEMPLATES : optional
 #   list of files specified as SOURCES which are not to be compiled separately
 #   (these are commonly template implementation files included in a header)
@@ -82,7 +69,7 @@
 #
 # NOINSTALL : optional
 #   do not install the executable
-#
+# 
 # VERSION : optional, AUTO_VERSION or LIBS_VERSION is used if not specified
 #   version to use as executable version
 #
@@ -98,6 +85,7 @@
 # FFLAGS : optional
 #   list of Fortran compiler flags to use for all Fortran source files
 #
+#
 # LINKER_LANGUAGE : optional
 #   sets the LINKER_LANGUAGE property on the target
 #
@@ -110,7 +98,7 @@ macro( ecbuild_add_executable )
 
   set( options NOINSTALL AUTO_VERSION )
   set( single_value_args TARGET COMPONENT LINKER_LANGUAGE VERSION OUTPUT_NAME )
-  set( multi_value_args  SOURCES SOURCES_GLOB SOURCES_EXCLUDE_REGEX OBJECTS TEMPLATES LIBS INCLUDES DEPENDS PERSISTENT DEFINITIONS CFLAGS CXXFLAGS FFLAGS GENERATED CONDITION )
+  set( multi_value_args  SOURCES TEMPLATES LIBS INCLUDES DEPENDS PERSISTENT DEFINITIONS CFLAGS CXXFLAGS FFLAGS GENERATED CONDITION )
 
   cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}"  ${_FIRST_ARG} ${ARGN} )
 
@@ -122,8 +110,8 @@ macro( ecbuild_add_executable )
     message(FATAL_ERROR "The call to ecbuild_add_executable() doesn't specify the TARGET.")
   endif()
 
-  if( NOT _PAR_SOURCES AND NOT _PAR_OBJECTS AND NOT _PAR_SOURCES_GLOB )
-    message(FATAL_ERROR "The call to ecbuild_add_executable() specifies neither SOURCES nor OBJECTS nor SOURCES_GLOB.")
+  if( NOT _PAR_SOURCES )
+    message(FATAL_ERROR "The call to ecbuild_add_executable() doesn't specify the SOURCES.")
   endif()
 
   ### conditional build
@@ -142,6 +130,19 @@ macro( ecbuild_add_executable )
 
   if( _${_PAR_TARGET}_condition )
 
+    # add include dirs if defined
+    if( DEFINED _PAR_INCLUDES )
+      list(REMOVE_DUPLICATES _PAR_INCLUDES )
+      foreach( path ${_PAR_INCLUDES} ) # skip NOTFOUND
+        if( path )
+          ecbuild_debug("ecbuild_add_executable(${_PAR_TARGET}): add ${path} to include_directories")
+          include_directories( ${path} )
+        else()
+          ecbuild_debug("ecbuild_add_executable(${_PAR_TARGET}): ${path} not found - not adding to include_directories")
+        endif()
+      endforeach()
+    endif()
+
     # add persistent layer files
     if( DEFINED _PAR_PERSISTENT )
       if( DEFINED PERSISTENT_NAMESPACE )
@@ -158,44 +159,8 @@ macro( ecbuild_add_executable )
       add_custom_target( ${_PAR_TARGET}_templates SOURCES ${_PAR_TEMPLATES} )
     endif()
 
-    # glob sources
-    unset( _glob_srcs )
-    foreach( pattern ${_PAR_SOURCES_GLOB} )
-        ecbuild_list_add_pattern( LIST _glob_srcs GLOB "${pattern}" )
-    endforeach()
-
-    foreach( pattern ${_PAR_SOURCES_EXCLUDE_REGEX} )
-        ecbuild_list_exclude_pattern( LIST _glob_srcs REGEX "${pattern}" )
-    endforeach()
-
-    # insert already compiled objects (from OBJECT libraries)
-    unset( _all_objects )
-    foreach( _obj ${_PAR_OBJECTS} )
-      list( APPEND _all_objects $<TARGET_OBJECTS:${_obj}> )
-    endforeach()
-
-    list( APPEND _PAR_SOURCES ${_glob_srcs} )
-
-    if( ECBUILD_LIST_SOURCES )
-      ecbuild_debug("ecbuild_add_library(${_PAR_TARGET}): sources ${_PAR_SOURCES}")
-    endif()
-
-    add_executable( ${_PAR_TARGET} ${_PAR_SOURCES} ${_all_objects} )
-
-    # ecbuild_echo_target( ${_PAR_TARGET} )
-
-    # add include dirs if defined
-    if( DEFINED _PAR_INCLUDES )
-      list(REMOVE_DUPLICATES _PAR_INCLUDES )
-      foreach( path ${_PAR_INCLUDES} ) # skip NOTFOUND
-        if( path )
-          ecbuild_debug("ecbuild_add_executable(${_PAR_TARGET}): add ${path} to include_directories")
-          target_include_directories( ${_PAR_TARGET} PRIVATE ${path} )
-        else()
-          ecbuild_debug("ecbuild_add_executable(${_PAR_TARGET}): ${path} not found - not adding to include_directories")
-        endif()
-      endforeach()
-    endif()
+    # add the executable target
+    add_executable( ${_PAR_TARGET} ${_PAR_SOURCES} )
 
     # set OUTPUT_NAME
 
@@ -226,71 +191,24 @@ macro( ecbuild_add_executable )
     endif()
 
     # filter sources
-
     ecbuild_separate_sources( TARGET ${_PAR_TARGET} SOURCES ${_PAR_SOURCES} )
 
-    #   ecbuild_debug_var( ${_PAR_TARGET}_h_srcs )
-    #   ecbuild_debug_var( ${_PAR_TARGET}_c_srcs )
-    #   ecbuild_debug_var( ${_PAR_TARGET}_cxx_srcs )
-    #   ecbuild_debug_var( ${_PAR_TARGET}_f_srcs )
-
     # add local flags
-
-    if( ${_PAR_TARGET}_c_srcs )
-
-      if( ECBUILD_SOURCE_FLAGS )
-        ecbuild_source_flags( ${_PAR_TARGET}_C_SOURCE_FLAGS
-                              ${_PAR_TARGET}_c
-                              "${_PAR_CFLAGS}"
-                              "${${_PAR_TARGET}_c_srcs}" )
-
-        ecbuild_debug("ecbuild_add_executable(${_PAR_TARGET}): setting source file C flags from ${${_PAR_TARGET}_C_SOURCE_FLAGS}")
-        include( ${${_PAR_TARGET}_C_SOURCE_FLAGS} )
-
-      elseif( DEFINED _PAR_CFLAGS )
-
-        ecbuild_debug("ecbuild_add_executable(${_PAR_TARGET}): use C flags ${_PAR_CFLAGS}")
-        set_source_files_properties( ${${_PAR_TARGET}_c_srcs}   PROPERTIES COMPILE_FLAGS "${_PAR_CFLAGS}" )
-
-      endif()
+    if( DEFINED _PAR_CFLAGS )
+      ecbuild_debug("ecbuild_add_executable(${_PAR_TARGET}): use C flags ${_PAR_CFLAGS}")
+      set_source_files_properties( ${${_PAR_TARGET}_c_srcs}   PROPERTIES COMPILE_FLAGS "${_PAR_CFLAGS}" )
     endif()
-
-    if( ${_PAR_TARGET}_cxx_srcs )
-
-      if( ECBUILD_SOURCE_FLAGS )
-        ecbuild_source_flags( ${_PAR_TARGET}_CXX_SOURCE_FLAGS
-                              ${_PAR_TARGET}_cxx
-                              "${_PAR_CXXFLAGS}"
-                              "${${_PAR_TARGET}_cxx_srcs}" )
-
-        ecbuild_debug("ecbuild_add_executable(${_PAR_TARGET}): setting source file CXX flags from ${${_PAR_TARGET}_CXX_SOURCE_FLAGS}")
-        include( ${${_PAR_TARGET}_CXX_SOURCE_FLAGS} )
-
-      elseif( DEFINED _PAR_CXXFLAGS )
-
-        ecbuild_debug("ecbuild_add_executable(${_PAR_TARGET}): use C++ flags ${_PAR_CFLAGS}")
-        set_source_files_properties( ${${_PAR_TARGET}_cxx_srcs} PROPERTIES COMPILE_FLAGS "${_PAR_CXXFLAGS}" )
-
-      endif()
+    if( DEFINED _PAR_CXXFLAGS )
+      ecbuild_debug("ecbuild_add_executable(${_PAR_TARGET}): use C++ flags ${_PAR_CFLAGS}")
+      set_source_files_properties( ${${_PAR_TARGET}_cxx_srcs} PROPERTIES COMPILE_FLAGS "${_PAR_CXXFLAGS}" )
     endif()
-
-    if( ${_PAR_TARGET}_f_srcs )
-
-      if( ECBUILD_SOURCE_FLAGS )
-        ecbuild_source_flags( ${_PAR_TARGET}_Fortran_SOURCE_FLAGS
-                              ${_PAR_TARGET}_f
-                              "${_PAR_FFLAGS}"
-                              "${${_PAR_TARGET}_f_srcs}" )
-
-        ecbuild_debug("ecbuild_add_executable(${_PAR_TARGET}): setting source file Fortran flags from ${${_PAR_TARGET}_Fortran_SOURCE_FLAGS}")
-        include( ${${_PAR_TARGET}_Fortran_SOURCE_FLAGS} )
-
-      elseif( DEFINED _PAR_FFLAGS )
-
-        ecbuild_debug("ecbuild_add_executable(${_PAR_TARGET}): use Fortran flags ${_PAR_CFLAGS}")
-        set_source_files_properties( ${${_PAR_TARGET}_f_srcs}  PROPERTIES COMPILE_FLAGS "${_PAR_FFLAGS}" )
-
-      endif()
+    if( DEFINED _PAR_FFLAGS )
+      ecbuild_debug("ecbuild_add_executable(${_PAR_TARGET}): use Fortran flags ${_PAR_CFLAGS}")
+      set_source_files_properties( ${${_PAR_TARGET}_f_srcs}   PROPERTIES COMPILE_FLAGS "${_PAR_FFLAGS}" )
+    endif()
+    if( DEFINED _PAR_GENERATED )
+      ecbuild_debug("ecbuild_add_executable(${_PAR_TARGET}): mark as generated ${_PAR_GENERATED}")
+      set_source_files_properties( ${_PAR_GENERATED} PROPERTIES GENERATED 1 )
     endif()
 
     # define VERSION if requested
@@ -304,6 +222,11 @@ macro( ecbuild_add_executable )
       endif()
     endif()
 
+    #    debug_var( ${_PAR_TARGET}_h_srcs )
+    #    debug_var( ${_PAR_TARGET}_c_srcs )
+    #    debug_var( ${_PAR_TARGET}_cxx_srcs )
+    #    debug_var( ${_PAR_TARGET}_f_srcs )
+
     # installation
 
     if( NOT _PAR_NOINSTALL )
@@ -317,7 +240,7 @@ macro( ecbuild_add_executable )
       #            endif()
 
       install( TARGETS ${_PAR_TARGET}
-               EXPORT  ${PROJECT_NAME}-targets
+               EXPORT  ${CMAKE_PROJECT_NAME}-targets
                RUNTIME DESTINATION ${INSTALL_BIN_DIR}
                LIBRARY DESTINATION ${INSTALL_LIB_DIR}
                ARCHIVE DESTINATION ${INSTALL_LIB_DIR} )
@@ -350,13 +273,6 @@ macro( ecbuild_add_executable )
     if( DEFINED _PAR_LINKER_LANGUAGE )
       ecbuild_debug("ecbuild_add_executable(${_PAR_TARGET}): using linker language ${_PAR_LINKER_LANGUAGE}")
       set_property( TARGET ${_PAR_TARGET} PROPERTY LINKER_LANGUAGE ${_PAR_LINKER_LANGUAGE} )
-      if( ECBUILD_${_PAR_LINKER_LANGUAGE}_IMPLICIT_LINK_LIBRARIES )
-        target_link_libraries( ${_PAR_TARGET} ${ECBUILD_${_PAR_LINKER_LANGUAGE}_IMPLICIT_LINK_LIBRARIES} )
-      endif()
-    endif()
-
-    if( ECBUILD_IMPLICIT_LINK_LIBRARIES )
-      target_link_libraries( ${_PAR_TARGET} ${ECBUILD_IMPLICIT_LINK_LIBRARIES} )
     endif()
 
     # make sure target is removed before - some problems with AIX
diff --git a/cmake/ecbuild_add_extra_search_paths.cmake b/cmake/ecbuild_add_extra_search_paths.cmake
index 94ac85b..fac96ba 100644
--- a/cmake/ecbuild_add_extra_search_paths.cmake
+++ b/cmake/ecbuild_add_extra_search_paths.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -15,10 +15,10 @@
 
 function( ecbuild_add_extra_search_paths pkg )
 
-  ecbuild_deprecate( " ecbuild_add_extra_search_paths modifies CMAKE_PREFIX_PATH,"
-                     " which can affect future package discovery if not undone by the caller."
-                     " The current CMAKE_PREFIX_PATH is being backed up as _CMAKE_PREFIX_PATH"
-                     " so it can later be restored." )
+  message( DEPRECATION " ecbuild_add_extra_search_paths modifies CMAKE_PREFIX_PATH,"
+           " which can affect future package discovery if not undone by the caller."
+           " The current CMAKE_PREFIX_PATH is being backed up as _CMAKE_PREFIX_PATH"
+           " so it can later be restored." )
 
   # Back up current CMAKE_PREFIX_PATH so the caller can reset it
   set( _CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} PARENT_SCOPE )
@@ -28,6 +28,6 @@ function( ecbuild_add_extra_search_paths pkg )
   ecbuild_list_extra_search_paths( ${pkg} CMAKE_PREFIX_PATH )
 
   set( CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} PARENT_SCOPE )
-  # ecbuild_debug_var( CMAKE_PREFIX_PATH )
+  # debug_var( CMAKE_PREFIX_PATH )
 
 endfunction()
diff --git a/cmake/ecbuild_add_fortran_flags.cmake b/cmake/ecbuild_add_fortran_flags.cmake
index cf61a0a..f0da53f 100644
--- a/cmake/ecbuild_add_fortran_flags.cmake
+++ b/cmake/ecbuild_add_fortran_flags.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -44,55 +44,43 @@ macro( ecbuild_add_fortran_flags m_fortran_flags )
 
     cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}"  ${_FIRST_ARG} ${ARGN} )
 
-    set( _try_add_flag TRUE )
-    if( _PAR_BUILD )
-      string( TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_CAPS )
-      string( TOUPPER ${_PAR_BUILD}  _PAR_BUILD_CAPS )
-      if( NOT CMAKE_BUILD_TYPE_CAPS MATCHES "${_PAR_BUILD_CAPS}" )
-        set( _try_add_flag FALSE )
-      endif()
+    if( NOT DEFINED N_FortranFLAG )
+      set( N_FortranFLAG 0 )
     endif()
 
-    if( _try_add_flag )
-      if( NOT DEFINED N_FortranFLAG )
-        set( N_FortranFLAG 0 )
-      endif()
-
-      math( EXPR N_FortranFLAG '${N_FortranFLAG}+1' )
+    math( EXPR N_FortranFLAG '${N_FortranFLAG}+1' )
 
-      if( NOT ECBUILD_TRUST_FLAGS )
-        if( DEFINED _PAR_NAME )
-          check_fortran_compiler_flag( ${_flags} ${_PAR_NAME} )
-          set( _flag_ok ${${_PAR_NAME}} )
-        else()
-          check_fortran_compiler_flag( ${_flags} Fortran_FLAG_TEST_${N_FortranFLAG} )
-          set( _flag_ok ${Fortran_FLAG_TEST_${N_FortranFLAG}} )
-        endif()
+    if( NOT ECBUILD_TRUST_FLAGS )
+      if( DEFINED _PAR_NAME )
+        check_fortran_compiler_flag( ${_flags} ${_PAR_NAME} )
+        set( _flag_ok ${${_PAR_NAME}} )
       else()
-        set( _flag_ok 1 )
+        check_fortran_compiler_flag( ${_flags} Fortran_FLAG_TEST_${N_FortranFLAG} )
+        set( _flag_ok ${Fortran_FLAG_TEST_${N_FortranFLAG}} )
       endif()
+    else()
+      set( _flag_ok 1 )
+    endif()
 
-      if( _flag_ok )
-        if( _PAR_BUILD )
-          set( CMAKE_Fortran_FLAGS_${_PAR_BUILD} "${CMAKE_Fortran_FLAGS_${_PAR_BUILD}} ${_flags}" )
-          ecbuild_debug( "Fortran FLAG [${_flags}] added for build type ${_PAR_BUILD}" )
-        else()
-          set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${_flags}" )
-          ecbuild_debug( "Fortran FLAG [${_flags}] added" )
-        endif()
+    if( _flag_ok )
+      if( _PAR_BUILD )
+        set( CMAKE_Fortran_FLAGS_${_PAR_BUILD} "${CMAKE_Fortran_FLAGS_${_PAR_BUILD}} ${_flags}" )
+        ecbuild_debug( "Fortran FLAG [${_flags}] added for build type ${_PAR_BUILD}" )
       else()
-        message( STATUS "Unrecognised Fortran flag [${_flags}] -- skipping" )
+        set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${_flags}" )
+        ecbuild_debug( "Fortran FLAG [${_flags}] added" )
       endif()
+    else()
+      message( STATUS "Unrecognised Fortran flag [${_flags}] -- skipping" )
     endif()
-
-    unset( _flags )
-    unset( _flag_ok )
-    unset( _try_add_flag )
   endif()
 
+  unset( _flags )
+  unset( _flag_ok )
+
 endmacro()
 
 macro( cmake_add_fortran_flags m_fortran_flags )
-  ecbuild_deprecate( " cmake_add_fortran_flags is deprecated, use ecbuild_add_fortran_flags instead." )
+  message( DEPRECATION " cmake_add_fortran_flags is deprecated, use ecbuild_add_fortran_flags instead." )
   ecbuild_add_fortran_flags( ${m_fortran_flags} )
 endmacro()
diff --git a/cmake/ecbuild_add_library.cmake b/cmake/ecbuild_add_library.cmake
index bcd9a98..dc47956 100644
--- a/cmake/ecbuild_add_library.cmake
+++ b/cmake/ecbuild_add_library.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -16,10 +16,7 @@
 #
 #   ecbuild_add_library( TARGET <name>
 #                        SOURCES <source1> [<source2> ...]
-#                        [ SOURCES_GLOB <glob1> [<glob2> ...] ]
-#                        [ SOURCES_EXCLUDE_REGEX <regex1> [<regex2> ...] ]
-#                        [ TYPE SHARED|STATIC|MODULE|OBJECT ]
-#                        [ OBJECTS <obj1> [<obj2> ...] ]
+#                        [ TYPE SHARED|STATIC|MODULE ]
 #                        [ TEMPLATES <template1> [<template2> ...] ]
 #                        [ LIBS <library1> [<library2> ...] ]
 #                        [ INCLUDES <path1> [<path2> ...] ]
@@ -58,17 +55,6 @@
 #   :STATIC: archives of object files for use when linking other targets.
 #   :MODULE: plugins that are not linked into other targets but may be loaded
 #            dynamically at runtime using dlopen-like functionality
-#   :OBJECT: files are just compiled into objects
-#
-# SOURCES_GLOB : optional
-#   search pattern to find source files to compile (note: not recommend according to CMake guidelines)
-#   it is usually better to explicitly list the source files in the CMakeList.txt
-#
-# SOURCES_EXCLUDE_REGEX : optional
-#   search pattern to exclude source files from compilation, applies o the results of SOURCES_GLOB
-#
-# OBJECTS : optional
-#   list of object libraries to add to this target
 #
 # TEMPLATES : optional
 #   list of files specified as SOURCES which are not to be compiled separately
@@ -149,7 +135,7 @@ function( ecbuild_add_library_impl )
 
   set( options NOINSTALL AUTO_VERSION )
   set( single_value_args TARGET TYPE COMPONENT INSTALL_HEADERS INSTALL_HEADERS_REGEX LINKER_LANGUAGE HEADER_DESTINATION VERSION OUTPUT_NAME )
-  set( multi_value_args  SOURCES SOURCES_GLOB SOURCES_EXCLUDE_REGEX OBJECTS TEMPLATES LIBS INCLUDES PRIVATE_INCLUDES PUBLIC_INCLUDES DEPENDS PERSISTENT DEFINITIONS INSTALL_HEADERS_LIST CFLAGS CXXFLAGS FFLAGS GENERATED CONDITION )
+  set( multi_value_args  SOURCES TEMPLATES LIBS INCLUDES PRIVATE_INCLUDES PUBLIC_INCLUDES DEPENDS PERSISTENT DEFINITIONS INSTALL_HEADERS_LIST CFLAGS CXXFLAGS FFLAGS GENERATED CONDITION )
 
   cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}"  ${_FIRST_ARG} ${ARGN} )
 
@@ -161,8 +147,8 @@ function( ecbuild_add_library_impl )
     message(FATAL_ERROR "The call to ecbuild_add_library() doesn't specify the TARGET.")
   endif()
 
-  if( NOT _PAR_SOURCES AND NOT _PAR_OBJECTS AND NOT _PAR_SOURCES_GLOB )
-    message(FATAL_ERROR "The call to ecbuild_add_library() specifies neither SOURCES nor OBJECTS nor SOURCES_GLOB")
+  if( NOT _PAR_SOURCES )
+    message(FATAL_ERROR "The call to ecbuild_add_library() doesn't specify the SOURCES.")
   endif()
 
   ### conditional build
@@ -186,9 +172,8 @@ function( ecbuild_add_library_impl )
       # checks that is either SHARED or STATIC or MODULE
       if( NOT _PAR_TYPE MATCHES "STATIC" AND
           NOT _PAR_TYPE MATCHES "SHARED" AND
-          NOT _PAR_TYPE MATCHES "OBJECT" AND
           NOT _PAR_TYPE MATCHES "MODULE" )
-        message( FATAL_ERROR "library type must be one of [ STATIC | SHARED | MODULE | OBJECT ]" )
+        message( FATAL_ERROR "library type must be one of [ STATIC | SHARED | MODULE ]" )
       endif()
       ecbuild_debug("ecbuild_add_library(${_PAR_TARGET}): library type is ${_PAR_TYPE}")
     endif()
@@ -210,31 +195,7 @@ function( ecbuild_add_library_impl )
       add_custom_target( ${_PAR_TARGET}_templates SOURCES ${_PAR_TEMPLATES} )
     endif()
 
-    # glob sources
-    unset( _glob_srcs )
-    foreach( pattern ${_PAR_SOURCES_GLOB} )
-        ecbuild_list_add_pattern( LIST _glob_srcs GLOB "${pattern}" )
-    endforeach()
-
-    foreach( pattern ${_PAR_SOURCES_EXCLUDE_REGEX} )
-        ecbuild_list_exclude_pattern( LIST _glob_srcs REGEX "${pattern}" )
-    endforeach()
-
-    # insert already compiled objects (from OBJECT libraries)
-    unset( _all_objects )
-    foreach( _obj ${_PAR_OBJECTS} )
-      list( APPEND _all_objects $<TARGET_OBJECTS:${_obj}> )
-    endforeach()
-
-    list( APPEND _PAR_SOURCES ${_glob_srcs} )
-
-    if( ECBUILD_LIST_SOURCES )
-      ecbuild_debug("ecbuild_add_library(${_PAR_TARGET}): sources ${_PAR_SOURCES}")
-    endif()
-
-    add_library( ${_PAR_TARGET} ${_PAR_TYPE} ${_PAR_SOURCES}  ${_all_objects} )
-
-    # ecbuild_echo_target( ${_PAR_TARGET} )
+    add_library( ${_PAR_TARGET} ${_PAR_TYPE} ${_PAR_SOURCES} )
 
     # set OUTPUT_NAME
 
@@ -345,74 +306,27 @@ function( ecbuild_add_library_impl )
 
     # filter sources
 
-    if( _PAR_SOURCES )
-      ecbuild_separate_sources( TARGET ${_PAR_TARGET} SOURCES ${_PAR_SOURCES} )
-    endif()
+    ecbuild_separate_sources( TARGET ${_PAR_TARGET} SOURCES ${_PAR_SOURCES} )
 
-    #   ecbuild_debug_var( ${_PAR_TARGET}_h_srcs )
-    #   ecbuild_debug_var( ${_PAR_TARGET}_c_srcs )
-    #   ecbuild_debug_var( ${_PAR_TARGET}_cxx_srcs )
-    #   ecbuild_debug_var( ${_PAR_TARGET}_f_srcs )
+    #   debug_var( ${_PAR_TARGET}_h_srcs )
+    #   debug_var( ${_PAR_TARGET}_c_srcs )
+    #   debug_var( ${_PAR_TARGET}_cxx_srcs )
+    #   debug_var( ${_PAR_TARGET}_f_srcs )
 
     # add local flags
 
-    if( ${_PAR_TARGET}_c_srcs )
-
-      if( ECBUILD_SOURCE_FLAGS )
-        ecbuild_source_flags( ${_PAR_TARGET}_C_SOURCE_FLAGS
-                              ${_PAR_TARGET}_c
-                              "${_PAR_CFLAGS}"
-                              "${${_PAR_TARGET}_c_srcs}" )
-
-        ecbuild_debug("ecbuild_add_library(${_PAR_TARGET}): setting source file C flags from ${${_PAR_TARGET}_C_SOURCE_FLAGS}")
-        include( ${${_PAR_TARGET}_C_SOURCE_FLAGS} )
-
-      elseif( DEFINED _PAR_CFLAGS )
-
-        ecbuild_debug("ecbuild_add_library(${_PAR_TARGET}): use C flags ${_PAR_CFLAGS}")
-        set_source_files_properties( ${${_PAR_TARGET}_c_srcs}   PROPERTIES COMPILE_FLAGS "${_PAR_CFLAGS}" )
-
-      endif()
+    if( DEFINED _PAR_CFLAGS )
+      ecbuild_debug("ecbuild_add_library(${_PAR_TARGET}): use C flags ${_PAR_CFLAGS}")
+      set_source_files_properties( ${${_PAR_TARGET}_c_srcs}   PROPERTIES COMPILE_FLAGS "${_PAR_CFLAGS}" )
     endif()
-
-    if( ${_PAR_TARGET}_cxx_srcs )
-
-      if( ECBUILD_SOURCE_FLAGS )
-        ecbuild_source_flags( ${_PAR_TARGET}_CXX_SOURCE_FLAGS
-                              ${_PAR_TARGET}_cxx
-                              "${_PAR_CXXFLAGS}"
-                              "${${_PAR_TARGET}_cxx_srcs}" )
-
-        ecbuild_debug("ecbuild_add_library(${_PAR_TARGET}): setting source file CXX flags from ${${_PAR_TARGET}_CXX_SOURCE_FLAGS}")
-        include( ${${_PAR_TARGET}_CXX_SOURCE_FLAGS} )
-
-      elseif( DEFINED _PAR_CXXFLAGS )
-
-        ecbuild_debug("ecbuild_add_library(${_PAR_TARGET}): use C++ flags ${_PAR_CFLAGS}")
-        set_source_files_properties( ${${_PAR_TARGET}_cxx_srcs} PROPERTIES COMPILE_FLAGS "${_PAR_CXXFLAGS}" )
-
-      endif()
+    if( DEFINED _PAR_CXXFLAGS )
+      ecbuild_debug("ecbuild_add_library(${_PAR_TARGET}): use C++ flags ${_PAR_CFLAGS}")
+      set_source_files_properties( ${${_PAR_TARGET}_cxx_srcs} PROPERTIES COMPILE_FLAGS "${_PAR_CXXFLAGS}" )
     endif()
-
-    if( ${_PAR_TARGET}_f_srcs )
-
-      if( ECBUILD_SOURCE_FLAGS )
-        ecbuild_source_flags( ${_PAR_TARGET}_Fortran_SOURCE_FLAGS
-                              ${_PAR_TARGET}_f
-                              "${_PAR_FFLAGS}"
-                              "${${_PAR_TARGET}_f_srcs}" )
-
-        ecbuild_debug("ecbuild_add_library(${_PAR_TARGET}): setting source file Fortran flags from ${${_PAR_TARGET}_Fortran_SOURCE_FLAGS}")
-        include( ${${_PAR_TARGET}_Fortran_SOURCE_FLAGS} )
-
-      elseif( DEFINED _PAR_FFLAGS )
-
-        ecbuild_debug("ecbuild_add_library(${_PAR_TARGET}): use Fortran flags ${_PAR_CFLAGS}")
-        set_source_files_properties( ${${_PAR_TARGET}_f_srcs}  PROPERTIES COMPILE_FLAGS "${_PAR_FFLAGS}" )
-
-      endif()
+    if( DEFINED _PAR_FFLAGS )
+      ecbuild_debug("ecbuild_add_library(${_PAR_TARGET}): use Fortran flags ${_PAR_CFLAGS}")
+      set_source_files_properties( ${${_PAR_TARGET}_f_srcs}   PROPERTIES COMPILE_FLAGS "${_PAR_FFLAGS}" )
     endif()
-
     if( DEFINED _PAR_GENERATED )
       ecbuild_debug("ecbuild_add_library(${_PAR_TARGET}): mark as generated ${_PAR_GENERATED}")
       set_source_files_properties( ${_PAR_GENERATED} PROPERTIES GENERATED 1 )
@@ -422,18 +336,11 @@ function( ecbuild_add_library_impl )
     if( DEFINED _PAR_LINKER_LANGUAGE )
       ecbuild_debug("ecbuild_add_library(${_PAR_TARGET}): using linker language ${_PAR_LINKER_LANGUAGE}")
       set_property( TARGET ${_PAR_TARGET} PROPERTY LINKER_LANGUAGE ${_PAR_LINKER_LANGUAGE} )
-      if( ECBUILD_${_PAR_LINKER_LANGUAGE}_IMPLICIT_LINK_LIBRARIES )
-        target_link_libraries( ${_PAR_TARGET} ${ECBUILD_${_PAR_LINKER_LANGUAGE}_IMPLICIT_LINK_LIBRARIES} )
-      endif()
-    endif()
-
-    if( ECBUILD_IMPLICIT_LINK_LIBRARIES )
-      target_link_libraries( ${_PAR_TARGET} ${ECBUILD_IMPLICIT_LINK_LIBRARIES} )
     endif()
 
-    # installation (except for OBJECT libraries)
+    # installation
 
-    if( NOT _PAR_NOINSTALL AND NOT _PAR_TYPE MATCHES "OBJECT" )
+    if( NOT _PAR_NOINSTALL )
       ecbuild_debug("ecbuild_add_library(${_PAR_TARGET}): installing to ${INSTALL_LIB_DIR}")
 
       # and associate with defined component
@@ -444,7 +351,7 @@ function( ecbuild_add_library_impl )
       #            endif()
 
       install( TARGETS ${_PAR_TARGET}
-        EXPORT  ${PROJECT_NAME}-targets
+        EXPORT  ${CMAKE_PROJECT_NAME}-targets
         RUNTIME DESTINATION ${INSTALL_BIN_DIR}
         LIBRARY DESTINATION ${INSTALL_LIB_DIR}
         ARCHIVE DESTINATION ${INSTALL_LIB_DIR} )
@@ -514,9 +421,7 @@ function( ecbuild_add_library_impl )
     endif()
 
     # make sure target is removed before - some problems with AIX
-    if( NOT _PAR_TYPE MATCHES "OBJECT" )
-      add_custom_command( TARGET ${_PAR_TARGET} PRE_BUILD COMMAND ${CMAKE_COMMAND} -E remove $<TARGET_FILE:${_PAR_TARGET}> )
-    endif()
+    add_custom_command( TARGET ${_PAR_TARGET} PRE_BUILD COMMAND ${CMAKE_COMMAND} -E remove $<TARGET_FILE:${_PAR_TARGET}> )
 
     # for the links target
     if( NOT _PAR_NOINSTALL )
diff --git a/cmake/ecbuild_add_option.cmake b/cmake/ecbuild_add_option.cmake
index e0e6040..7728716 100644
--- a/cmake/ecbuild_add_option.cmake
+++ b/cmake/ecbuild_add_option.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -17,7 +17,6 @@
 #   ecbuild_add_option( FEATURE <name>
 #                       [ DEFAULT ON|OFF ]
 #                       [ DESCRIPTION <description> ]
-#                       [ PURPOSE <purpose> ]
 #                       [ REQUIRED_PACKAGES <package1> [<package2> ...] ]
 #                       [ CONDITION <condition1> [<condition2> ...] ]
 #                       [ ADVANCED ] )
@@ -34,30 +33,18 @@
 # DESCRIPTION : optional
 #   string describing the feature (shown in summary and stored in the cache)
 #
-# TYPE : optional, one of RUNTIME|OPTIONAL|RECOMMENDED|REQUIRED
-#   type of dependency of the project on this package (defaults to OPTIONAL)
-#
-# PURPOSE : optional
-#   string describing which functionality this package enables in the project
-#
 # REQUIRED_PACKAGES : optional
 #   list of packages required to be found for this feature to be enabled
 #
-#   The package specification can have one of two forms. Either ::
+#   The package specification can be either ::
 #
-#     "<package> [ <version> ... ]"
+#     <package> [ <version> ... ]
 #
-#   to search for a given package using the CMake ``find_package`` mechanism.
-#   The entire specification must be enclosed in quotes and is passed on
-#   verbatim. Any options of ``find_package`` are supported.
+#   to search for a given package with option minimum required version or ::
 #
-#   The other specification must start with ``PROJECT`` like this ::
+#     PROJECT <name> [ VERSION <version> ... ]
 #
-#     "PROJECT <name> [ VERSION <version> ... ]"
-#
-#   and is used to search for an ecBuild project via ``ecbuild_use_package``.
-#   The entire specification must be enclosed in quotes and is passed on
-#   verbatim. Any options of ``ecbuild_use_package`` are supported.
+#   to search for an ecBuild project with optional minimum required version.
 #
 # CONDITION : optional
 #   conditional expression which must evaluate to true for this option to be
@@ -85,7 +72,7 @@
 macro( ecbuild_add_option )
 
   set( options ADVANCED )
-  set( single_value_args FEATURE DEFAULT DESCRIPTION TYPE PURPOSE )
+  set( single_value_args FEATURE DEFAULT DESCRIPTION )
   set( multi_value_args  REQUIRED_PACKAGES CONDITION )
 
   cmake_parse_arguments( _p "${options}" "${single_value_args}" "${multi_value_args}"  ${_FIRST_ARG} ${ARGN} )
@@ -111,10 +98,6 @@ macro( ecbuild_add_option )
   endif()
   ecbuild_debug("ecbuild_add_option(${_p_FEATURE}): defaults to ${_p_DEFAULT}")
 
-  if( NOT _p_TYPE  )
-    set( _p_TYPE OPTIONAL )
-  endif()
-
   # check CONDITION parameter
   if( DEFINED _p_CONDITION )
     set(_feature_condition_file "${CMAKE_CURRENT_BINARY_DIR}/set_${_p_FEATURE}_condition.cmake")
@@ -152,12 +135,7 @@ macro( ecbuild_add_option )
   # define the option -- for cmake GUI
 
   option( ENABLE_${_p_FEATURE} "${_p_DESCRIPTION}" ${_p_DEFAULT} )
-  ecbuild_debug("ecbuild_add_option(${_p_FEATURE}): defining option ENABLE_${_p_FEATURE} '${_p_DESCRIPTION}' ${_p_DEFAULT}")
-  ecbuild_set_feature( ${_p_FEATURE} ENABLED ${_p_DEFAULT} )
-  set_package_properties( ${_p_FEATURE} PROPERTIES
-                          DESCRIPTION "${_p_DESCRIPTION}"
-                          TYPE ${_p_TYPE}
-                          PURPOSE "${_p_PURPOSE}" )
+  ecbuild_set_feature( ${_p_FEATURE} ENABLED ${_p_DEFAULT} PURPOSE "${_p_DESCRIPTION}" )
 
   ecbuild_debug("ecbuild_add_option(${_p_FEATURE}): ENABLE_${_p_FEATURE} = ${ENABLE_${_p_FEATURE}}")
   set( _do_search ${ENABLE_${_p_FEATURE}} )
@@ -189,9 +167,9 @@ macro( ecbuild_add_option )
           set( pkgproject 0 )
         endif()
 
-        # ecbuild_debug_var( pkg )
-        # ecbuild_debug_var( pkglist )
-        # ecbuild_debug_var( pkgname )
+        # debug_var( pkg )
+        # debug_var( pkglist )
+        # debug_var( pkgname )
 
         string( TOUPPER ${pkgname} pkgUPPER )
         string( TOLOWER ${pkgname} pkgLOWER )
@@ -228,11 +206,6 @@ macro( ecbuild_add_option )
               list( REMOVE_ITEM _find_args ${pkgname} )
               ecbuild_debug("ecbuild_add_option(${_p_FEATURE}): searching for Python")
               ecbuild_find_python( ${_find_args} )
-            elseif( pkgname STREQUAL "LEXYACC" )
-              set( _find_args ${pkglist} )
-              list( REMOVE_ITEM _find_args ${pkgname} )
-              ecbuild_debug("ecbuild_add_option(${_p_FEATURE}): searching for lex-yacc")
-              ecbuild_find_lexyacc( ${_find_args} )
             else()
               ecbuild_debug("ecbuild_add_option(${_p_FEATURE}): searching for package ${pkgname}")
               find_package( ${pkglist} )
@@ -250,9 +223,9 @@ macro( ecbuild_add_option )
 
         endif()
 
-        # ecbuild_debug_var( ${pkgname}_FOUND  )
-        # ecbuild_debug_var( ${pkgLOWER}_FOUND )
-        # ecbuild_debug_var( ${pkgUPPER}_FOUND )
+        # debug_var( ${pkgname}_FOUND  )
+        # debug_var( ${pkgLOWER}_FOUND )
+        # debug_var( ${pkgUPPER}_FOUND )
 
         # we have feature if all required packages were FOUND
 
diff --git a/cmake/ecbuild_add_persistent.cmake b/cmake/ecbuild_add_persistent.cmake
index e27eb89..96c160d 100644
--- a/cmake/ecbuild_add_persistent.cmake
+++ b/cmake/ecbuild_add_persistent.cmake
@@ -1,8 +1,8 @@
-# (C) Copyright 1996-2016 ECMWF.
-#
+# (C) Copyright 1996-2015 ECMWF.
+# 
 # This software is licensed under the terms of the Apache Licence Version 2.0
-# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-# In applying this licence, ECMWF does not waive the privileges and immunities
+# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
+# In applying this licence, ECMWF does not waive the privileges and immunities 
 # granted to it by virtue of its status as an intergovernmental organisation nor
 # does it submit to any jurisdiction.
 
@@ -34,7 +34,7 @@
 #   C++ namespace to place the persistent class information in
 #
 ##############################################################################
-
+  
 # define the script to build the persistent class information
 set( sg_perl "${CMAKE_CURRENT_LIST_DIR}/sg.pl" CACHE INTERNAL "perl script to generate persistent objects" )
 
@@ -44,7 +44,7 @@ macro( ecbuild_add_persistent )
 
   set( options )
   set( single_value_args SRC_LIST NAMESPACE )
-  set( multi_value_args  FILES )
+  set( multi_value_args  FILES ) 
 
   cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}"  ${_FIRST_ARG} ${ARGN} )
 
@@ -71,7 +71,7 @@ macro( ecbuild_add_persistent )
       set( file ${_file_dir}/${_file_we} )
     endif()
 
-    # ecbuild_debug_var(file)
+    # debug_var(file)
 
     add_custom_command( OUTPUT  ${file}.b
                         COMMAND ${PERL_EXECUTABLE} ${sg_perl} ${CMAKE_CURRENT_SOURCE_DIR}/${file}.h
diff --git a/cmake/ecbuild_add_resources.cmake b/cmake/ecbuild_add_resources.cmake
index d09581c..da6e55a 100644
--- a/cmake/ecbuild_add_resources.cmake
+++ b/cmake/ecbuild_add_resources.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 # 
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
diff --git a/cmake/ecbuild_add_test.cmake b/cmake/ecbuild_add_test.cmake
index 6d208b0..6ae839a 100644
--- a/cmake/ecbuild_add_test.cmake
+++ b/cmake/ecbuild_add_test.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -16,7 +16,6 @@
 #
 #   ecbuild_add_test( [ TARGET <name> ]
 #                     [ SOURCES <source1> [<source2> ...] ]
-#                     [ OBJECTS <obj1> [<obj2> ...] ]
 #                     [ COMMAND <executable> ]
 #                     [ TYPE EXE|SCRIPT|PYTHON ]
 #                     [ ARGS <argument1> [<argument2> ...] ]
@@ -49,9 +48,6 @@
 # SOURCES : required if TARGET is provided
 #   list of source files to be compiled
 #
-# OBJECTS : optional
-#   list of object libraries to add to this target
-#
 # COMMAND : either TARGET or COMMAND must be provided, unless TYPE is PYTHON
 #   command or script to execute (no executable is built)
 #
@@ -131,7 +127,7 @@ macro( ecbuild_add_test )
 
   set( options           BOOST )
   set( single_value_args TARGET ENABLED COMMAND TYPE LINKER_LANGUAGE MPI WORKING_DIRECTORY )
-  set( multi_value_args  SOURCES OBJECTS LIBS INCLUDES TEST_DEPENDS DEPENDS ARGS
+  set( multi_value_args  SOURCES LIBS INCLUDES TEST_DEPENDS DEPENDS ARGS
                          PERSISTENT DEFINITIONS RESOURCES TEST_DATA CFLAGS
                          CXXFLAGS FFLAGS GENERATED CONDITION ENVIRONMENT )
 
@@ -145,14 +141,13 @@ macro( ecbuild_add_test )
 
   # Check for MPI
   if(_PAR_MPI)
-    if( (_PAR_MPI GREATER 1) AND ( (NOT MPI_FOUND) OR (NOT MPIEXEC) ) )
+    if( (_PAR_MPI GREATER 1) AND ( (NOT HAVE_MPI) OR (NOT MPIEXEC) ) )
       ecbuild_debug("ecbuild_add_test(${_PAR_TARGET}): ${_PAR_MPI} MPI ranks requested but MPI not available - disabling test")
       set( _PAR_ENABLED 0 )
-    elseif( (_PAR_MPI EQUAL 1) AND (NOT MPI_FOUND) )
+    endif()
+    if( (_PAR_MPI EQUAL 1) AND (NOT HAVE_MPI) )
       ecbuild_debug("ecbuild_add_test(${_PAR_TARGET}): 1 MPI rank requested but MPI not available - disabling MPI")
       set( _PAR_MPI 0 )
-    else()
-      ecbuild_debug("ecbuild_add_test(${_PAR_TARGET}): Running using ${_PAR_MPI} MPI rank(s)")
     endif()
   endif()
 
@@ -271,13 +266,9 @@ macro( ecbuild_add_test )
         endif()
       endif()
 
-      # insert already compiled objects (from OBJECT libraries)
-      unset( _all_objects )
-      foreach( _obj ${_PAR_OBJECTS} )
-        list( APPEND _all_objects $<TARGET_OBJECTS:${_obj}> )
-      endforeach()
+      # add the test target
 
-      add_executable( ${_PAR_TARGET} ${_PAR_SOURCES} ${_all_objects} )
+      add_executable( ${_PAR_TARGET} ${_PAR_SOURCES} )
 
       # add extra dependencies
       if( DEFINED _PAR_DEPENDS)
@@ -363,6 +354,9 @@ macro( ecbuild_add_test )
                           PRE_BUILD
                           COMMAND ${CMAKE_COMMAND} -E remove ${EXE_FILENAME} )
 
+      set_property( TARGET ${_PAR_TARGET} PROPERTY SKIP_BUILD_RPATH         FALSE )
+      set_property( TARGET ${_PAR_TARGET} PROPERTY BUILD_WITH_INSTALL_RPATH FALSE )
+
     endif() # _PAR_SOURCES
 
     if( DEFINED _PAR_COMMAND AND NOT _PAR_TARGET ) # in the absence of target, we use the command as a name
@@ -382,10 +376,7 @@ macro( ecbuild_add_test )
 
     # define the arguments
     set( TEST_ARGS "" )
-    # Boost Unit Test >= 1.60 requires arguments to be passed to the application to be separated by --
-    if( DEFINED _PAR_ARGS AND _PAR_BOOST )
-      list( APPEND TEST_ARGS "--" ${_PAR_ARGS} )
-    elseif( DEFINED _PAR_ARGS )
+    if( DEFINED _PAR_ARGS  )
       list( APPEND TEST_ARGS ${_PAR_ARGS} )
     endif()
 
diff --git a/cmake/ecbuild_append_to_rpath.cmake b/cmake/ecbuild_append_to_rpath.cmake
index 4f10368..5a7bd66 100644
--- a/cmake/ecbuild_append_to_rpath.cmake
+++ b/cmake/ecbuild_append_to_rpath.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
diff --git a/cmake/ecbuild_bundle.cmake b/cmake/ecbuild_bundle.cmake
index 7a0eff4..2d9b779 100644
--- a/cmake/ecbuild_bundle.cmake
+++ b/cmake/ecbuild_bundle.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -61,7 +61,7 @@ endmacro()
 # Declare a subproject to be built as part of this bundle. ::
 #
 #   ecbuild_bundle( PROJECT <name>
-#                   STASH <repository> | GIT <giturl> | SOURCE <path>
+#                   STASH <repository> | GIT <giturl>
 #                   [ BRANCH <gitbranch> | TAG <gittag> ]
 #                   [ UPDATE | NOREMOTE ] )
 #                   [ MANUAL ] )
@@ -72,15 +72,12 @@ endmacro()
 # PROJECT : required
 #   project name for the Git repository to be managed
 #
-# STASH : cannot be combined with GIT or SOURCE
+# STASH : cannot be combined with GIT, either is required
 #   Stash repository in the form <project>/<repository>
 #
-# GIT : cannot be combined with STASH or SOURCE
+# URL : cannot be combined with STASH, either is required
 #   Git URL of the remote repository to clone (see ``git help clone``)
 #
-# SOURCE : cannot be combined with STASH or GIT
-#   Path to an existing local repository, which will be symlinked
-#
 # BRANCH : optional, cannot be combined with TAG
 #   Git branch to check out
 #
@@ -107,10 +104,6 @@ endmacro()
 # The first time a bundle is built, the sources of all subprojects are cloned
 # into directories named according to project in the *source* tree of the
 # bundle (which means these directories should be added to ``.gitignore``).
-# If the ``SOURCE`` option is used it must point to an existing local
-# repository on disk and no new repository is cloned. Be aware that using the
-# ``BRANCH`` or ``TAG`` option leads to the corresponding version being checked
-# out in that repository!
 #
 # Subprojects are configured and built in order. Due to being added as a
 # subproject, the usual project discovery mechanism (i.e. locating and
@@ -126,32 +119,23 @@ endmacro()
 macro( ecbuild_bundle )
 
   set( options )
-  set( single_value_args PROJECT STASH GIT SOURCE )
+  set( single_value_args PROJECT STASH GIT )
   set( multi_value_args )
   cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
 
   string(TOUPPER "${_PAR_PROJECT}" PNAME)
 
   if( BUNDLE_SKIP_${PNAME} )
-    message( STATUS "Skipping bundle project ${PNAME}" )
+      message( STATUS "Skipping bundle project ${PNAME}" )
   else()
 
-    if( _PAR_STASH )
-      ecmwf_stash( PROJECT ${_PAR_PROJECT} DIR ${PROJECT_SOURCE_DIR}/${_PAR_PROJECT} STASH ${_PAR_STASH} ${_PAR_UNPARSED_ARGUMENTS} )
-    elseif( _PAR_GIT )
-      ecbuild_git( PROJECT ${_PAR_PROJECT} DIR ${PROJECT_SOURCE_DIR}/${_PAR_PROJECT} URL ${_PAR_GIT} ${_PAR_UNPARSED_ARGUMENTS} )
-    elseif( _PAR_SOURCE )
-      if( DEFINED ${PNAME}_SOURCE )
-        ecbuild_critical( "ecbuild_bundle called with SOURCE for project ${_PAR_PROJECT} but ${PNAME}_SOURCE is defined" )
+      if( _PAR_STASH )
+          ecmwf_stash( PROJECT ${_PAR_PROJECT} DIR ${PROJECT_SOURCE_DIR}/${_PAR_PROJECT} STASH ${_PAR_STASH} ${_PAR_UNPARSED_ARGUMENTS} )
+      elseif( _PAR_GIT )
+          ecbuild_git( PROJECT ${_PAR_PROJECT} DIR ${PROJECT_SOURCE_DIR}/${_PAR_PROJECT} URL ${_PAR_GIT} ${_PAR_UNPARSED_ARGUMENTS} )
       endif()
-      execute_process( COMMAND ${CMAKE_COMMAND} -E create_symlink ${_PAR_SOURCE} ${PROJECT_SOURCE_DIR}/${_PAR_PROJECT} )
-    endif()
-
-    if( NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_PAR_PROJECT} OR NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_PAR_PROJECT}/CMakeLists.txt )
-      ecbuild_critical("Source directory '${CMAKE_CURRENT_SOURCE_DIR}/${_PAR_PROJECT}' for subproject '${_PAR_PROJECT}' does not exist or does not contain a CMakeLists.txt file.")
-    endif()
 
-    ecbuild_use_package( PROJECT ${_PAR_PROJECT} )
+      ecbuild_use_package( PROJECT ${_PAR_PROJECT} )
   endif()
 
 endmacro()
diff --git a/cmake/ecbuild_cache.cmake b/cmake/ecbuild_cache.cmake
index e257b36..9663bca 100644
--- a/cmake/ecbuild_cache.cmake
+++ b/cmake/ecbuild_cache.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 # 
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
diff --git a/cmake/ecbuild_check_c_source_return.cmake b/cmake/ecbuild_check_c_source_return.cmake
index 7e704cb..1dadca6 100644
--- a/cmake/ecbuild_check_c_source_return.cmake
+++ b/cmake/ecbuild_check_c_source_return.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 # 
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
diff --git a/cmake/ecbuild_check_compiler.cmake b/cmake/ecbuild_check_compiler.cmake
index 437b81e..32ff6cc 100644
--- a/cmake/ecbuild_check_compiler.cmake
+++ b/cmake/ecbuild_check_compiler.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -10,8 +10,7 @@
 # enable C to use in system introspection
 
 if( NOT CMAKE_C_COMPILER_LOADED AND ENABLE_OS_TESTS )
-  enable_language( C )
-  ecbuild_compiler_flags( C )
+	enable_language( C )
 endif()
 
 ############################################################################################
@@ -123,10 +122,6 @@ if( CMAKE_COMPILER_IS_GNUCXX )
 
 endif()
 
-if( ENABLE_WARNINGS AND CMAKE_Fortran_COMPILER_ID MATCHES "Intel" )
-  ecbuild_add_fortran_flags("-warn all")
-endif()
-
 ############################################################################################
 # compiler dependent fixes
 
diff --git a/cmake/ecbuild_check_cxx11.cmake b/cmake/ecbuild_check_cxx11.cmake
index dd78649..6453786 100644
--- a/cmake/ecbuild_check_cxx11.cmake
+++ b/cmake/ecbuild_check_cxx11.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
diff --git a/cmake/ecbuild_check_cxx_source_return.cmake b/cmake/ecbuild_check_cxx_source_return.cmake
index 402850e..e364918 100644
--- a/cmake/ecbuild_check_cxx_source_return.cmake
+++ b/cmake/ecbuild_check_cxx_source_return.cmake
@@ -1,8 +1,8 @@
-# (C) Copyright 1996-2016 ECMWF.
-#
+# (C) Copyright 1996-2015 ECMWF.
+# 
 # This software is licensed under the terms of the Apache Licence Version 2.0
-# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-# In applying this licence, ECMWF does not waive the privileges and immunities
+# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
+# In applying this licence, ECMWF does not waive the privileges and immunities 
 # granted to it by virtue of its status as an intergovernmental organisation nor
 # does it submit to any jurisdiction.
 
@@ -93,9 +93,9 @@ macro( ecbuild_check_cxx_source_return SOURCE )
         if( __add_incs )
             set(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES "-DINCLUDE_DIRECTORIES:STRING=${__add_incs}")
         endif()
-
+    
         # write the source file
-
+    
         file( WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/test_${_p_VAR}.cxx" "${SOURCE}\n" )
 
         message( STATUS "${_msg}" )
@@ -107,11 +107,11 @@ macro( ecbuild_check_cxx_source_return SOURCE )
           -DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH}
           "${CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES}"
           "${CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES}"
-          COMPILE_OUTPUT_VARIABLE compile_OUTPUT
+          COMPILE_OUTPUT_VARIABLE compile_OUTPUT 
           RUN_OUTPUT_VARIABLE     run_OUTPUT )
-
-        # ecbuild_debug_var( ${_p_VAR}_COMPILED )
-        # ecbuild_debug_var( ${_p_VAR}_EXITCODE )
+   
+        # debug_var( ${_p_VAR}_COMPILED )
+        # debug_var( ${_p_VAR}_EXITCODE )
 
         # if it did not compile make the return value fail code of 1
 
@@ -125,21 +125,21 @@ macro( ecbuild_check_cxx_source_return SOURCE )
 
         # if the return value was 0 then it worked
         if( ${_p_VAR}_COMPILED AND "${${_p_VAR}_EXITCODE}" EQUAL 0 )
-
+    
           message(STATUS "${_msg} Success")
-          file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+          file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log 
             "Performing C++ SOURCE FILE Test ${_p_VAR} succeded with the following compile output:\n"
-            "${compile_OUTPUT}\n"
+            "${compile_OUTPUT}\n" 
             "Performing C++ SOURCE FILE Run ${_p_VAR} succeded with the following run output:\n"
-            "${run_OUTPUT}\n"
+            "${run_OUTPUT}\n" 
             "Return value: ${${_p_VAR}}\n"
             "Source file was:\n${SOURCE}\n")
 
           set( ${_p_VAR}     1              CACHE INTERNAL "Test ${_p_VAR}")
           set( ${_p_OUTPUT} "${run_OUTPUT}" CACHE INTERNAL "Test ${_p_VAR} output")
-
+    
         else()
-
+    
           if(CMAKE_CROSSCOMPILING AND "${${_p_VAR}_EXITCODE}" MATCHES  "FAILED_TO_RUN")
             set(${_p_VAR} "${${_p_VAR}_EXITCODE}")
             set(${OUTPUT} "")
@@ -147,17 +147,17 @@ macro( ecbuild_check_cxx_source_return SOURCE )
             set(${_p_VAR} "" CACHE INTERNAL "Test ${_p_VAR}")
             set(${_p_OUTPUT} "" CACHE INTERNAL "Test ${_p_VAR} output")
           endif()
-
+    
           message(STATUS "Test ${_p_VAR} - Failed")
-          file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+          file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log 
             "Performing C++ SOURCE FILE Test ${_p_VAR} failed with the following compile output:\n"
-            "${compile_OUTPUT}\n"
+            "${compile_OUTPUT}\n" 
             "Performing C++ SOURCE FILE Run ${_p_VAR} failed with the following run output:\n"
-            "${run_OUTPUT}\n"
+            "${run_OUTPUT}\n" 
             "Return value: ${${_p_VAR}_EXITCODE}\n"
             "Source file was:\n${SOURCE}\n")
         endif()
-
+    
     endif()
 
 endmacro()
diff --git a/cmake/ecbuild_check_fortran_source_return.cmake b/cmake/ecbuild_check_fortran_source_return.cmake
index 7477e88..1c50896 100644
--- a/cmake/ecbuild_check_fortran_source_return.cmake
+++ b/cmake/ecbuild_check_fortran_source_return.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 # 
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
diff --git a/cmake/ecbuild_check_functions.cmake b/cmake/ecbuild_check_functions.cmake
index 7b850e9..a3ed7a1 100644
--- a/cmake/ecbuild_check_functions.cmake
+++ b/cmake/ecbuild_check_functions.cmake
@@ -1,8 +1,8 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
-# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-# In applying this licence, ECMWF does not waive the privileges and immunities
+# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
+# In applying this licence, ECMWF does not waive the privileges and immunities 
 # granted to it by virtue of its status as an intergovernmental organisation nor
 # does it submit to any jurisdiction.
 
@@ -73,10 +73,10 @@ if( ENABLE_OS_FUNCTIONS_TEST )
     ecbuild_cache_check_c_source_compiles( "#define _LARGEFILE64_SOURCE\n#include <sys/stat.h>\nint main(){ struct stat64 s; fstat64(1,&s); return 0; }" EC_HAVE_FSTAT64 )
     # test fseeko64
     ecbuild_cache_check_c_source_compiles( "#define _LARGEFILE64_SOURCE\n#include <stdio.h>\n#include <sys/types.h>\nint main(){FILE* file;off64_t l=0;fseeko64(file,l,SEEK_CUR);return 0;}\n" EC_HAVE_FSEEKO64 )
-
+   
     # test for ftello64
     ecbuild_cache_check_c_source_compiles( "#define _LARGEFILE64_SOURCE\n#include <stdio.h>\n#include <sys/types.h>\nint main(){FILE* file;off64_t l = ftello64(file);return 0;}\n"  EC_HAVE_FTELLO64 )
-
+    
     # test for lseek64
     ecbuild_cache_check_c_source_compiles( "#define _LARGEFILE64_SOURCE\n#include <sys/types.h>\n#include <unistd.h>\nint main(){off64_t h = lseek64(0,0,SEEK_SET);return 0;}\n"  EC_HAVE_LSEEK64 )
     # test for open64
@@ -114,7 +114,7 @@ if( ENABLE_OS_FUNCTIONS_TEST )
     # test for getpwuid_r
     ecbuild_cache_check_c_source_compiles( "#include <unistd.h>\n#include <sys/types.h>\n#include <pwd.h>\nint main(){ char buf[4096]; struct passwd pwbuf; struct passwd *pwbufp = 0; getpwuid_r(getuid(), &pwbuf, buf, sizeof(buf), &pwbufp); }\n" EC_HAVE_GETPWUID_R )
     # test for getpwnam_r
-    ecbuild_cache_check_c_source_compiles( "#include <sys/types.h>\n#include <pwd.h>\nint main(){ struct passwd p; char line[1024]; int n = getpwnam_r(\"user\",&p,line,sizeof(line),0); }\n" EC_HAVE_GETPWNAM_R )
+    ecbuild_cache_check_c_source_compiles( "#include <sys/types.h>\n#include <pwd.h>\nint main(){ struct passwd p; char line[1024]; int n = getpwnam_r(\"user\",&p,line,sizeof(line),0); }\n" EC_HAVE_GETPWNAM_R )    
     # test for readdir_r
     ecbuild_cache_check_c_source_compiles( "#include <dirent.h>\nint main(){ DIR *dirp; struct dirent *entry; struct dirent **result; int i = readdir_r(dirp, entry, result); }\n" EC_HAVE_READDIR_R )
     # test for gethostbyname_r
@@ -164,8 +164,8 @@ if( ENABLE_OS_FUNCTIONS_TEST )
     endif()
     ecbuild_cache_var( EC_HAVE_PROCFS )
 
-#    ecbuild_debug_var(EC_HAVE_PROCFS)
-#    ecbuild_debug_var(EC_HAVE_PROCFS_OUTPUT)
+#    debug_var(EC_HAVE_PROCFS)
+#    debug_var(EC_HAVE_PROCFS_OUTPUT)
 
 endif()
 
diff --git a/cmake/ecbuild_check_os.cmake b/cmake/ecbuild_check_os.cmake
index 5fc3c2e..942fb6b 100644
--- a/cmake/ecbuild_check_os.cmake
+++ b/cmake/ecbuild_check_os.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -9,34 +9,23 @@
 ############################################################################################
 # check size of pointer
 
-# Re-check size of void pointer since for some compiler combinations this is not properly set
 ecbuild_cache_check_type_size( "void*" CMAKE_SIZEOF_VOID_P  )
 
-if( NOT CMAKE_C_COMPILER_LOADED AND ENABLE_OS_TESTS )
-
-  enable_language( C )
-  ecbuild_compiler_flags( C )
-
-endif()
-
 math( EXPR EC_OS_BITS "${CMAKE_SIZEOF_VOID_P} * 8" )
 
 # we only support 32 and 64 bit operating systems
 if( NOT EC_OS_BITS EQUAL "32" AND NOT EC_OS_BITS EQUAL "64" )
-  message( FATAL_ERROR "operating system ${CMAKE_SYSTEM} ${EC_OS_BITS} bits -- ecbuild only supports 32 or 64 bit OS's" )
+	message( FATAL_ERROR "operating system ${CMAKE_SYSTEM} ${EC_OS_BITS} bits -- ecbuild only supports 32 or 64 bit OS's" )
 endif()
+ecbuild_cache_var( EC_OS_BITS )
 
 ############################################################################################
 # For 64 bit architectures enable PIC (position-independent code)
 
-# Allow overriding the position independent code setting (ECBUILD-220)
-if( DEFINED ECBUILD_POSITION_INDEPENDENT_CODE )
-  set( CMAKE_POSITION_INDEPENDENT_CODE ${ECBUILD_POSITION_INDEPENDENT_CODE} )
-elseif( ${EC_OS_BITS} EQUAL 64 )
-  set( CMAKE_POSITION_INDEPENDENT_CODE ON )
+if( ${EC_OS_BITS} EQUAL 64 )
+	set( CMAKE_POSITION_INDEPENDENT_CODE ON )
 endif()
 
-
 ############################################################################################
 # check architecture
 
@@ -112,19 +101,14 @@ endif()
 if( ENABLE_OS_ENDINESS_TEST )
 
   if( NOT DEFINED EC_BIG_ENDIAN AND NOT DEFINED EC_LITTLE_ENDIAN )
-
   	test_big_endian( _BIG_ENDIAN )
 
   	if( _BIG_ENDIAN )
-        set( EC_BIG_ENDIAN    1 )
-        set( EC_LITTLE_ENDIAN 0 )
+  		set( EC_BIG_ENDIAN    1 )
   	else()
-        set( EC_BIG_ENDIAN    0 )
-        set( EC_LITTLE_ENDIAN 1 )
+  		set( EC_LITTLE_ENDIAN 1 )
   	endif()
-
   endif()
-
   ecbuild_cache_var( EC_BIG_ENDIAN )
   ecbuild_cache_var( EC_LITTLE_ENDIAN )
 
@@ -158,15 +142,9 @@ if( ENABLE_OS_ENDINESS_TEST )
   	if( "${IEEE_BE}" STREQUAL "" )
   		set( IEEE_BE 0 CACHE INTERNAL "Test IEEE_BE")
   	endif()
-
   endif()
-
   ecbuild_cache_var( IEEE_BE )
 
-  if( EC_BIG_ENDIAN AND NOT IEEE_BE )
-    ecbuild_critical("Failed to sanity check on endiness: OS should be Big-Endian but compiled code runs differently -- to ignore this pass -DIEEE_BE=0 to CMake/ecBuild")
-  endif()
-
     if( NOT DEFINED IEEE_LE )
   	check_c_source_runs(
   		 "int compare(unsigned char* a,unsigned char* b) {
@@ -194,17 +172,12 @@ if( ENABLE_OS_ENDINESS_TEST )
   		   return 0;
   		 }" IEEE_LE )
 
-  	if( "${IEEE_LE}" STREQUAL "" )
+  	if( "${IEEE_BE}" STREQUAL "" )
   		set( IEEE_LE 0 CACHE INTERNAL "Test IEEE_LE")
   	endif()
   endif()
-
   ecbuild_cache_var( IEEE_LE )
 
-  if( EC_LITTLE_ENDIAN AND NOT IEEE_LE )
-    ecbuild_critical("Failed to sanity check on endiness: OS should be Little-Endian but compiled code runs differently -- to ignore this pass -DIEEE_LE=0 to CMake/ecBuild")
-  endif()
-
 endif()
 
 ############################################################################################
@@ -229,7 +202,7 @@ if( ENABLE_PROFILING )
     unset( _trust_flags )
 
     unset( _flags )
-
+  
   else()
     message( WARNING "Profiling enabled but ecbuild doesn't know how to enable for this particular compiler ${CMAKE_C_COMPILER_ID}")
   endif()
diff --git a/cmake/ecbuild_compiler_flags.cmake b/cmake/ecbuild_compiler_flags.cmake
deleted file mode 100644
index b97eb2c..0000000
--- a/cmake/ecbuild_compiler_flags.cmake
+++ /dev/null
@@ -1,97 +0,0 @@
-# (C) Copyright 1996-2016 ECMWF.
-#
-# This software is licensed under the terms of the Apache Licence Version 2.0
-# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-# In applying this licence, ECMWF does not waive the privileges and immunities
-# granted to it by virtue of its status as an intergovernmental organisation nor
-# does it submit to any jurisdiction.
-
-##############################################################################
-#.rst:
-#
-# ecbuild_compiler_flags
-# ======================
-#
-# Set default compiler flags for a given language. ::
-#
-#   ecbuild_compiler_flags( <lang> )
-#
-# The procedure is as follows:
-#
-# 1.  ecBuild does *not* set ``CMAKE_<lang>_FLAGS`` i.e. the user can set these
-#     via -D or the CMake cache and these will be the "base" flags.
-#
-# 2.  ecBuild *overwrites* ``CMAKE_<lang>_FLAGS_<btype>`` in the CMake cache
-#     for all build types with compiler specific defaults for the currently
-#     loaded compiler i.e. any value set by the user via -D or the CMake cache
-#     *has no effect*.
-#
-# 3.  Any value the user provides via ``ECBUILD_<lang>_FLAGS`` or
-#     ``ECBUILD_<lang>_FLAGS_<btype>`` *overrides* the corresponding
-#     ``CMAKE_<lang>_FLAGS`` or ``CMAKE_<lang>_FLAGS_<btype>`` *without being
-#     written to the CMake cache*.
-#
-##############################################################################
-
-macro( ecbuild_compiler_flags _lang )
-
-  if( CMAKE_${_lang}_COMPILER_LOADED )
-
-    ecbuild_debug( "try include ${ECBUILD_MACROS_DIR}/compiler_flags/${CMAKE_${_lang}_COMPILER_ID}_${_lang}.cmake ")
-
-    include( ${ECBUILD_MACROS_DIR}/compiler_flags/${CMAKE_${_lang}_COMPILER_ID}_${_lang}.cmake OPTIONAL )
-
-    ecbuild_debug_var( CMAKE_${_lang}_FLAGS )
-
-    foreach( _btype NONE DEBUG BIT PRODUCTION RELEASE RELWITHDEBINFO )
-      ecbuild_debug_var( CMAKE_${_lang}_FLAGS_${_btype} )
-    endforeach()
-
-  endif()
-
-  foreach( _btype NONE DEBUG BIT PRODUCTION RELEASE RELWITHDEBINFO )
-    if( DEFINED ECBUILD_${_lang}_FLAGS_${_btype} )
-      set( CMAKE_${_lang}_FLAGS_${_btype} ${ECBUILD_${_lang}_FLAGS_${_btype}} )
-    endif()
-    mark_as_advanced( CMAKE_${_lang}_FLAGS_${_btype} )
-  endforeach()
-
-  if( DEFINED ECBUILD_${_lang}_FLAGS )
-    set( CMAKE_${_lang}_FLAGS "${ECBUILD_${_lang}_FLAGS}" )
-  endif()
-
-  mark_as_advanced( CMAKE_${_lang}_FLAGS )
-
-  if( DEFINED ECBUILD_${_lang}_LINK_FLAGS )
-    set( CMAKE_${_lang}_LINK_FLAGS "${ECBUILD_${_lang}_LINK_FLAGS}" )
-  endif()
-
-  mark_as_advanced( CMAKE_${_lang}_LINK_FLAGS )
-
-endmacro()
-
-#-----------------------------------------------------------------------------------------------------------------------
-
-### OVERRIDE Compiler FLAGS (we override because CMake forcely defines them) -- see ecbuild_compiler_flags() macro
-
-foreach( _lang C CXX Fortran )
-  if( CMAKE_${_lang}_COMPILER_LOADED )
-    ecbuild_compiler_flags( ${_lang} )
-  endif()
-endforeach()
-
-### OVERRIDE Linker FLAGS per object type (we override because CMake forcely defines them)
-
-foreach( _btype NONE DEBUG BIT PRODUCTION RELEASE RELWITHDEBINFO )
-
-  foreach( _obj EXE SHARED MODULE )
-    if( ECBUILD_${_obj}_LINKER_FLAGS_${_btype} )
-      set( CMAKE_${_obj}_LINKER_FLAGS_${_btype} ${ECBUILD_${_obj}_LINKER_FLAGS_${_btype}} )
-    endif()
-  endforeach()
-
-endforeach()
-
-#-----------------------------------------------------------------------------------------------------------------------
-
-mark_as_advanced( CMAKE_C_FLAGS_BIT )
diff --git a/cmake/ecbuild_config.h.in b/cmake/ecbuild_config.h.in
index eef9b85..2a01618 100644
--- a/cmake/ecbuild_config.h.in
+++ b/cmake/ecbuild_config.h.in
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 1996-2016 ECMWF.
+ * (C) Copyright 1996-2015 ECMWF.
  *
  * This software is licensed under the terms of the Apache Licence Version 2.0
  * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
diff --git a/cmake/ecbuild_debug_var.cmake b/cmake/ecbuild_debug_var.cmake
new file mode 100644
index 0000000..9bb3499
--- /dev/null
+++ b/cmake/ecbuild_debug_var.cmake
@@ -0,0 +1,47 @@
+# (C) Copyright 1996-2015 ECMWF.
+# 
+# This software is licensed under the terms of the Apache Licence Version 2.0
+# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
+# In applying this licence, ECMWF does not waive the privileges and immunities 
+# granted to it by virtue of its status as an intergovernmental organisation nor
+# does it submit to any jurisdiction.
+
+##############################################################################
+# macro for exporting a variable to parent scope
+
+macro( set_parent_scope VAR )
+
+	set( ${VAR} ${${VAR}} PARENT_SCOPE )
+
+endmacro( set_parent_scope )
+
+##############################################################################
+# macro for debugging a cmake variable
+
+macro( debug_var VAR )
+
+    message( STATUS "${VAR} [${${VAR}}]" )
+
+endmacro( debug_var )
+
+##############################################################################
+# macro for debugging a cmake list
+
+macro( debug_list VAR )
+
+    message( STATUS "${VAR}:" )
+    foreach( _elem ${${VAR}} )
+      message( STATUS "  ${_elem}" )
+    endforeach()
+
+endmacro( debug_list )
+
+##############################################################################
+# macro for debugging a environment variable within cmake
+
+macro( debug_env_var VAR )
+
+    message( STATUS "ENV ${VAR} [$ENV{${VAR}}]" )
+
+endmacro( debug_env_var )
+
diff --git a/cmake/ecbuild_declare_project.cmake b/cmake/ecbuild_declare_project.cmake
index c59079e..11052c6 100644
--- a/cmake/ecbuild_declare_project.cmake
+++ b/cmake/ecbuild_declare_project.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -69,8 +69,8 @@ macro( ecbuild_declare_project )
     get_git_head_revision( GIT_REFSPEC ${PNAME}_GIT_SHA1 )
     if( ${PNAME}_GIT_SHA1 )
       string( SUBSTRING "${${PNAME}_GIT_SHA1}" 0 7 ${PNAME}_GIT_SHA1_SHORT )
-      #     ecbuild_debug_var( ${PNAME}_GIT_SHA1 )
-      #     ecbuild_debug_var( ${PNAME}_GIT_SHA1_SHORT )
+      #     debug_var( ${PNAME}_GIT_SHA1 )
+      #     debug_var( ${PNAME}_GIT_SHA1_SHORT )
     else()
       message( STATUS "Could not get git-sha1 for project ${PNAME}")
     endif()
@@ -101,11 +101,11 @@ macro( ecbuild_declare_project )
   set( ${PNAME}_VERSION_STR "${${PROJECT_NAME}_VERSION_STR}"
        CACHE INTERNAL "package ${PNAME} version string" ) # ignore caps
 
-  #    ecbuild_debug_var( ${PNAME}_VERSION )
-  #    ecbuild_debug_var( ${PNAME}_VERSION_STR )
-  #    ecbuild_debug_var( ${PNAME}_MAJOR_VERSION )
-  #    ecbuild_debug_var( ${PNAME}_MINOR_VERSION )
-  #    ecbuild_debug_var( ${PNAME}_PATCH_VERSION )
+  #    debug_var( ${PNAME}_VERSION )
+  #    debug_var( ${PNAME}_VERSION_STR )
+  #    debug_var( ${PNAME}_MAJOR_VERSION )
+  #    debug_var( ${PNAME}_MINOR_VERSION )
+  #    debug_var( ${PNAME}_PATCH_VERSION )
 
   # install dirs for this project
 
@@ -151,7 +151,7 @@ macro( ecbuild_declare_project )
            CACHE INTERNAL "${PNAME} ${p} full install path" )
     endif()
 
-    #        ecbuild_debug_var( ${PNAME}_FULL_INSTALL_${p}_DIR )
+    #        debug_var( ${PNAME}_FULL_INSTALL_${p}_DIR )
 
   endforeach()
 
@@ -162,7 +162,7 @@ macro( ecbuild_declare_project )
     if( ENABLE_RELATIVE_RPATHS )
 
       file( RELATIVE_PATH relative_rpath ${${PNAME}_FULL_INSTALL_BIN_DIR} ${${PNAME}_FULL_INSTALL_LIB_DIR} )
-      # ecbuild_debug_var( relative_rpath )
+      # debug_var( relative_rpath )
 
       ecbuild_append_to_rpath( ${relative_rpath} )
 
@@ -171,14 +171,14 @@ macro( ecbuild_declare_project )
       if( IS_ABSOLUTE ${INSTALL_LIB_DIR} )
         ecbuild_append_to_rpath( "${INSTALL_LIB_DIR}" )
       else()
-        ecbuild_append_to_rpath( "${CMAKE_INSTALL_PREFIX}/${INSTALL_LIB_DIR}" )
+        ecbuild_append_to_rpath( "${CMAKE_INSTALL_PREFIX}/${INSTALL_LIB_DIR}" ) 
       endif()
 
     endif()
 
   endif()
 
-  # ecbuild_debug_var( CMAKE_INSTALL_RPATH )
+  # debug_var( CMAKE_INSTALL_RPATH )
 
   # print project header
 
diff --git a/cmake/ecbuild_define_build_types.cmake b/cmake/ecbuild_define_build_types.cmake
index 4958458..53e4de0 100644
--- a/cmake/ecbuild_define_build_types.cmake
+++ b/cmake/ecbuild_define_build_types.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -7,6 +7,55 @@
 # does it submit to any jurisdiction.
 
 ############################################################################################
+# define a Production build type
+
+# NOTE: gcc does not guarrante that -O3 performs better than -O2
+#       -- it can perform worse due to assembly code bloating.
+#   Moreover for gcc 4.1.2 we found that -O3 remove the parser code generated from Lex/Yacc
+#   and therefore in production mode we downgrade to -O2 if the compiler is GCC (for all versions).
+
+
+if(CMAKE_COMPILER_IS_GNUCXX)
+    set( CMAKE_CXX_FLAGS_PRODUCTION "-O2 -g" CACHE STRING "Flags used by the C++ compiler during Production builds." FORCE )
+else()
+    set( CMAKE_CXX_FLAGS_PRODUCTION "-O3 -g" CACHE STRING "Flags used by the C++ compiler during Production builds." FORCE )
+endif()
+
+if(CMAKE_COMPILER_IS_GNUCC)
+    set( CMAKE_C_FLAGS_PRODUCTION "-O2 -g" CACHE STRING "Flags used by the C compiler during Production builds." FORCE )
+else()
+    set( CMAKE_C_FLAGS_PRODUCTION "-O3 -g" CACHE STRING "Flags used by the C compiler during Production builds." FORCE )
+endif()
+
+set( CMAKE_EXE_LINKER_FLAGS_PRODUCTION "" CACHE STRING "Flags used for linking binaries during Production builds." FORCE )
+set( CMAKE_SHARED_LINKER_FLAGS_PRODUCTION "" CACHE STRING "Flags used by the shared libraries linker during Production builds." FORCE )
+set( CMAKE_MODULE_LINKER_FLAGS_PRODUCTION "" CACHE STRING "Flags used by the static libraries linker during Production builds." FORCE )
+
+mark_as_advanced(
+    CMAKE_CXX_FLAGS_PRODUCTION
+    CMAKE_C_FLAGS_PRODUCTION
+    CMAKE_EXE_LINKER_FLAGS_PRODUCTION
+	  CMAKE_SHARED_LINKER_FLAGS_PRODUCTION
+	  CMAKE_MODULE_LINKER_FLAGS_PRODUCTION )
+
+############################################################################################
+# fixes for specific compilers
+
+### remove -Mipa=fast from PGI compilers in RELEASE mode
+
+if( CMAKE_C_COMPILER_ID STREQUAL "PGI" )
+  set(CMAKE_C_FLAGS_RELEASE "-fast -O3")
+endif()
+
+if( CMAKE_CXX_COMPILER_ID STREQUAL "PGI" )
+  set(CMAKE_CXX_FLAGS_RELEASE "-fast -O3")
+endif()
+
+if( CMAKE_Fortran_COMPILER_ID STREQUAL "PGI" )
+  set(CMAKE_Fortran_FLAGS_RELEASE "-fast -O3")
+endif()
+
+############################################################################################
 # define default build type
 
 set( _BUILD_TYPE_MSG "Build type options are: [ None | Debug | Bit | Production | Release | RelWithDebInfo ]" )
@@ -57,3 +106,32 @@ if( NOT CMAKE_BUILD_TYPE MATCHES "None"  AND
     NOT CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo" )
     message( FATAL_ERROR "CMAKE_BUILD_TYPE is not recognized. ${_BUILD_TYPE_MSG}" )
 endif()
+
+############################################################################################
+# overrides of the flags per build type
+
+foreach( _btype NONE DEBUG BIT PRODUCTION RELEASE RELWITHDEBINFO )
+
+  # OVERRIDE Compiler FLAGS per language (we override because CMake forcely defines them)
+  foreach( _lang C CXX Fortran )
+    if( ECBUILD_${_lang}_FLAGS_${_btype} )
+      set( CMAKE_${_lang}_FLAGS_${_btype} ${ECBUILD_${_lang}_FLAGS_${_btype}} )
+    endif()
+  endforeach()
+
+  # OVERRIDE Linker FLAGS per object type (we override because CMake forcely defines them)
+  foreach( _obj EXE SHARED MODULE )
+    if( ECBUILD_${_obj}_LINKER_FLAGS_${_btype} )
+      set( CMAKE_${_obj}_LINKER_FLAGS_${_btype} ${ECBUILD_${_obj}_LINKER_FLAGS_${_btype}} )
+    endif()
+  endforeach()
+
+endforeach()
+
+# APPEND Linker FLAGS per language (we append because CMake typically leaves them empty)
+
+foreach( _lang C CXX Fortran )
+  if( ECBUILD_${_lang}_LINK_FLAGS )
+    set( CMAKE_${_lang}_LINK_FLAGS "${CMAKE_${_lang}_LINK_FLAGS} ${ECBUILD_${_lang}_LINK_FLAGS}" )
+  endif()
+endforeach()
\ No newline at end of file
diff --git a/cmake/ecbuild_define_libs_and_execs_target.cmake b/cmake/ecbuild_define_libs_and_execs_target.cmake
deleted file mode 100644
index 812f42c..0000000
--- a/cmake/ecbuild_define_libs_and_execs_target.cmake
+++ /dev/null
@@ -1,29 +0,0 @@
-# (C) Copyright 1996-2016 ECMWF.
-#
-# This software is licensed under the terms of the Apache Licence Version 2.0
-# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-# In applying this licence, ECMWF does not waive the privileges and immunities
-# granted to it by virtue of its status as an intergovernmental organisation nor
-# does it submit to any jurisdiction.
-
-set( EC_ALL_EXES "" CACHE INTERNAL "" )
-set( EC_ALL_LIBS "" CACHE INTERNAL "" )
-
-############################################################################################
-# define libs and execs targets
-
-macro( ecbuild_define_libs_and_execs_targets )
-
-  add_custom_target( libs )
-
-  if( EC_ALL_LIBS )
-    add_dependencies( libs ${EC_ALL_LIBS} )
-  endif()
-
-  add_custom_target( execs )
-
-  if( EC_ALL_EXECS )
-    add_dependencies( execs ${EC_ALL_EXES} )
-  endif()
-
-endmacro(ecbuild_define_libs_and_execs_targets)
diff --git a/cmake/ecbuild_define_options.cmake b/cmake/ecbuild_define_options.cmake
index af40ae1..f7a2321 100644
--- a/cmake/ecbuild_define_options.cmake
+++ b/cmake/ecbuild_define_options.cmake
@@ -1,8 +1,8 @@
-# (C) Copyright 1996-2016 ECMWF.
-#
+# (C) Copyright 1996-2015 ECMWF.
+# 
 # This software is licensed under the terms of the Apache Licence Version 2.0
-# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-# In applying this licence, ECMWF does not waive the privileges and immunities
+# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
+# In applying this licence, ECMWF does not waive the privileges and immunities 
 # granted to it by virtue of its status as an intergovernmental organisation nor
 # does it submit to any jurisdiction.
 
@@ -46,7 +46,3 @@ option( ECBUILD_USE_INCLUDE_DIRECTORIES "Forces to use global include_directorie
 mark_as_advanced( ECBUILD_USE_INCLUDE_DIRECTORIES )
 
 set( CMAKE_NO_SYSTEM_FROM_IMPORTED ON )
-
-# hide some CMake options from CMake UI
-
-mark_as_advanced( CMAKE_OSX_ARCHITECTURES CMAKE_OSX_DEPLOYMENT_TARGET CMAKE_OSX_SYSROOT )
\ No newline at end of file
diff --git a/cmake/ecbuild_define_paths.cmake b/cmake/ecbuild_define_paths.cmake
index 856903d..822bf71 100644
--- a/cmake/ecbuild_define_paths.cmake
+++ b/cmake/ecbuild_define_paths.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 # 
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
diff --git a/cmake/ecbuild_dont_pack.cmake b/cmake/ecbuild_dont_pack.cmake
index 987aca7..099ee1d 100644
--- a/cmake/ecbuild_dont_pack.cmake
+++ b/cmake/ecbuild_dont_pack.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
diff --git a/cmake/ecbuild_download_resource.cmake b/cmake/ecbuild_download_resource.cmake
index 3a9abdb..d313704 100644
--- a/cmake/ecbuild_download_resource.cmake
+++ b/cmake/ecbuild_download_resource.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
diff --git a/cmake/ecbuild_echo_targets.cmake b/cmake/ecbuild_echo_targets.cmake
index 58407f7..ddaa2e4 100644
--- a/cmake/ecbuild_echo_targets.cmake
+++ b/cmake/ecbuild_echo_targets.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -32,13 +32,13 @@ function(ecbuild_echo_target_property tgt prop)
   get_property(s TARGET ${tgt} PROPERTY ${prop} SET)
 
   # only produce output for values that are set
-  if(s)
+  #if(s)
     message("tgt='${tgt}' prop='${prop}'")
     message("  value='${v}'")
     message("  defined='${d}'")
     message("  set='${s}'")
     message("")
-  endif()
+  #endif()
 
   cmake_policy(POP)
 
@@ -207,7 +207,7 @@ XCODE_ATTRIBUTE_WHATEVER
 
   message("======================== ${tgt} ========================")
   foreach(p ${props})
-    ecbuild_echo_target_property("${tgt}" "${p}")
+    ecbuild_echo_target_property("${t}" "${p}")
   endforeach()
   message("")
 endfunction()
diff --git a/cmake/ecbuild_enable_fortran.cmake b/cmake/ecbuild_enable_fortran.cmake
index 9d65a59..16512e8 100644
--- a/cmake/ecbuild_enable_fortran.cmake
+++ b/cmake/ecbuild_enable_fortran.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -39,14 +39,7 @@ macro( ecbuild_enable_fortran )
     message(FATAL_ERROR "Unknown keywords given to ecbuild_enable_fortran(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
   endif()
 
-  if( NOT CMAKE_Fortran_COMPILER_LOADED )
-    enable_language( Fortran )
-    ecbuild_compiler_flags( Fortran )
-    if( ENABLE_WARNINGS AND CMAKE_Fortran_COMPILER_ID MATCHES "Intel" )
-      set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -warn all" )
-      ecbuild_debug( "Fortran FLAG [-warn all] added" )
-    endif()
-  endif()
+  enable_language( Fortran )
 
   if( DEFINED _PAR_REQUIRED )
     if( CMAKE_Fortran_COMPILER_FORCED )
diff --git a/cmake/ecbuild_features.cmake b/cmake/ecbuild_features.cmake
index 0490783..5d619a5 100644
--- a/cmake/ecbuild_features.cmake
+++ b/cmake/ecbuild_features.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -10,6 +10,10 @@
 
 include( FeatureSummary )
 
+function( debug_var _var )
+  message( "${_var} = ${${_var}}" )
+endfunction()
+
 # Write list of enabled features to CMake variable ${OUT}
 macro( ecbuild_enabled_features OUT )
     get_property( ${OUT}  GLOBAL PROPERTY ENABLED_FEATURES )
@@ -22,17 +26,17 @@ endmacro()
 
 # Enable the feature ${_name} (add to enabled features, remove from disabled)
 function( ecbuild_enable_feature _name )
-
+  
   get_property( _enabled_features  GLOBAL PROPERTY ENABLED_FEATURES )
   get_property( _disabled_features GLOBAL PROPERTY DISABLED_FEATURES )
-
+  
   if( _disabled_features )
     list( REMOVE_ITEM _disabled_features ${_name} )
   endif()
 
   list( APPEND _enabled_features ${_name} )
   list( REMOVE_DUPLICATES _enabled_features )
-
+    
   set_property(GLOBAL PROPERTY ENABLED_FEATURES  "${_enabled_features}" )
   set_property(GLOBAL PROPERTY DISABLED_FEATURES "${_disabled_features}" )
 
@@ -43,42 +47,53 @@ function( ecbuild_disable_feature _name )
 
   get_property( _enabled_features  GLOBAL PROPERTY ENABLED_FEATURES )
   get_property( _disabled_features GLOBAL PROPERTY DISABLED_FEATURES )
-
+  
   if( _enabled_features )
     list( REMOVE_ITEM _enabled_features ${_name} )
   endif()
 
   list( APPEND _disabled_features ${_name} )
   list( REMOVE_DUPLICATES _disabled_features )
-
+    
   set_property(GLOBAL PROPERTY ENABLED_FEATURES  "${_enabled_features}" )
   set_property(GLOBAL PROPERTY DISABLED_FEATURES "${_disabled_features}" )
+  
+endfunction()
 
+# Set description of feature ${_name} to ${_desc}
+function( ecbuild_set_feature_description _name _desc)      
+  set_property(GLOBAL PROPERTY _CMAKE_${_name}_DESCRIPTION "${_desc}" )
+endfunction()
+
+# Set purpose of feature ${_name} to ${_desc}
+function( ecbuild_set_feature_purpose _name _purpose )
+  get_property( _purpose_list  GLOBAL PROPERTY _CMAKE_${_name}_PURPOSE )
+  list( APPEND _purpose_list ${_purpose} )
+  list( REMOVE_DUPLICATES _purpose_list )
+  set_property(GLOBAL PROPERTY _CMAKE_${_name}_PURPOSE "${_purpose_list}" )
 endfunction()
 
 # en/disable feature ${_name} and set its description and purpose
 function( ecbuild_set_feature _name )
 
   set(options ) # none
-  set(oneValueArgs ENABLED )
+  set(oneValueArgs ENABLED DESCRIPTION PURPOSE )
   set(multiValueArgs ) # none
 
-  cmake_parse_arguments( _PAR "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
-
-  get_property( _feature_desc      GLOBAL PROPERTY _CMAKE_${_name}_DESCRIPTION )
+  CMAKE_PARSE_ARGUMENTS( _PAR "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
+  
+  get_property( _feature_desc      GLOBAL PROPERTY _CMAKE_${_name}_DESCRIPTION )  
   get_property( _enabled_features  GLOBAL PROPERTY ENABLED_FEATURES )
   get_property( _disabled_features GLOBAL PROPERTY DISABLED_FEATURES )
-
+  
   if( DEFINED _PAR_ENABLED )
     if( _PAR_ENABLED )
-      ecbuild_debug( "ecbuild_set_feature(${_name}): enabling feature" )
       ecbuild_enable_feature( ${_name} )
     else()
-      ecbuild_debug( "ecbuild_set_feature(${_name}): disabling feature" )
       ecbuild_disable_feature( ${_name} )
     endif()
   endif()
-
+  
   ecbuild_enabled_features( _enabled_features )
   list (FIND _enabled_features "${_name}" _index)
   if (${_index} GREATER -1)
@@ -90,9 +105,17 @@ function( ecbuild_set_feature _name )
   if (${_index} GREATER -1)
     set( _feature_found 1 )
   endif()
-
+  
   if( NOT _feature_found )
     message( WARNING "Feature ${_name} has not yet been enabled or disabled" )
   endif()
+  
+  if( _PAR_DESCRIPTION )
+    ecbuild_set_feature_description( ${_name} ${_PAR_DESCRIPTION} )
+  endif()
+  
+  if( _PAR_PURPOSE )
+    ecbuild_set_feature_purpose( ${_name} ${_PAR_PURPOSE} )
+  endif()
 
 endfunction()
diff --git a/cmake/ecbuild_find_fortranlibs.cmake b/cmake/ecbuild_find_fortranlibs.cmake
index c7ccc64..850c4a3 100644
--- a/cmake/ecbuild_find_fortranlibs.cmake
+++ b/cmake/ecbuild_find_fortranlibs.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
diff --git a/cmake/ecbuild_find_lexyacc.cmake b/cmake/ecbuild_find_lexyacc.cmake
index 628488f..9876097 100644
--- a/cmake/ecbuild_find_lexyacc.cmake
+++ b/cmake/ecbuild_find_lexyacc.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -34,7 +34,6 @@
 #
 # The following CMake variables are set if lex and yacc were found:
 #
-# :LEXYACC_FOUND:   Found suitable combination of bison, lex, yacc, flex
 # :LEX_FOUND:       lex was found
 # :YACC_FOUND:      yacc was found
 # :LEX_EXECUTABLE:  path to the lex executable
@@ -60,32 +59,25 @@ macro( ecbuild_find_lexyacc )
 
   endif()
 
-  set( LEXYACC_FOUND 1 )
-
   if( NOT YACC_FOUND AND NOT BISON_FOUND ) # neither bison nor yacc were found
-    ecbuild_debug( "Neither bison or yacc were found - at least one is required (together with its lexical analyser" )
-    set( LEXYACC_FOUND 0 )
+    message( FATAL_ERROR "neither bison or yacc were found - at least one is required (together with its lexical analyser" )
   endif()
 
   if( NOT YACC_FOUND ) # check for both bison & flex together
     if( BISON_FOUND AND NOT FLEX_FOUND )
-      set( LEXYACC_FOUND 0 )
-      ecbuild_debug( "Both bison and flex are required - flex not found" )
+      message( FATAL_ERROR "both bison and flex are required - flex not found" )
     endif()
     if( FLEX_FOUND AND NOT BISON_FOUND )
-      set( LEXYACC_FOUND 0 )
-      ecbuild_debug( "Both bison and flex are required - bison not found" )
+      message( FATAL_ERROR "both bison and flex are required - bison not found" )
     endif()
   endif()
 
   if( NOT BISON_FOUND ) # check for both yacc & lex together
     if( YACC_FOUND AND NOT LEX_FOUND )
-      set( LEXYACC_FOUND 0 )
-      ecbuild_debug( "Both yacc and lex are required - lex not found" )
+      message( FATAL_ERROR "both yacc and lex are required - lex not found" )
     endif()
     if( LEX_FOUND AND NOT YACC_FOUND )
-      set( LEXYACC_FOUND 0 )
-      ecbuild_debug( "Both yacc and lex are required - yacc not found" )
+      message( FATAL_ERROR "both yacc and lex are required - yacc not found" )
     endif()
   endif()
 
diff --git a/cmake/ecbuild_find_mpi.cmake b/cmake/ecbuild_find_mpi.cmake
index 5610c77..82fc4b5 100644
--- a/cmake/ecbuild_find_mpi.cmake
+++ b/cmake/ecbuild_find_mpi.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
diff --git a/cmake/ecbuild_find_omp.cmake b/cmake/ecbuild_find_omp.cmake
index 5458d3e..882adfe 100644
--- a/cmake/ecbuild_find_omp.cmake
+++ b/cmake/ecbuild_find_omp.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -206,24 +206,17 @@ endmacro( ecbuild_find_omp )
 
 macro( ecbuild_enable_omp )
 
-  ecbuild_debug("ecbuild_enable_omp: Trying to enable OpenMP")
   ecbuild_find_omp( COMPONENTS C CXX Fortran )
 
-  ecbuild_debug_var("OMP_C_FOUND")
   if( OMP_C_FOUND )
-    ecbuild_debug("Adding ${OMP_C_FLAGS} to CMAKE_C_FLAGS")
     set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OMP_C_FLAGS}" )
   endif()
 
-  ecbuild_debug_var("OMP_CXX_FOUND")
   if( OMP_CXX_FOUND )
-    ecbuild_debug("Adding ${OMP_CXX_FLAGS} to CMAKE_CXX_FLAGS")
     set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OMP_CXX_FLAGS}" )
   endif()
 
-  ecbuild_debug_var("OMP_Fortran_FOUND")
   if( OMP_Fortran_FOUND )
-    ecbuild_debug("Adding ${OMP_Fortran_FLAGS} to CMAKE_Fortran_FLAGS")
     set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${OMP_Fortran_FLAGS}" )
   endif()
 
diff --git a/cmake/ecbuild_find_package.cmake b/cmake/ecbuild_find_package.cmake
index 33d136a..b67b51d 100644
--- a/cmake/ecbuild_find_package.cmake
+++ b/cmake/ecbuild_find_package.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -103,7 +103,7 @@ macro( ecbuild_find_package )
     message(FATAL_ERROR "Call to ecbuild_find_package() requests EXACT but doesn't specify VERSION.")
   endif()
 
-  # ecbuild_debug_var( _PAR_NAME )
+  # debug_var( _PAR_NAME )
 
   string( TOUPPER ${_PAR_NAME} pkgUPPER )
   string( TOLOWER ${_PAR_NAME} pkgLOWER )
@@ -157,9 +157,9 @@ macro( ecbuild_find_package )
     set( ${_PAR_NAME}_DIR "$ENV{${_PAR_NAME}_DIR}" )
   endif()
 
-  # Find packages quietly unless in DEVELOPER_MODE or LOG_LEVEL is DEBUG
+  # Find packages quietly unless in DEVELOPER_MODE, LOG_LEVEL is DEBUG or the package is REQUIRED
 
-  if( NOT DEVELOPER_MODE AND ( ECBUILD_LOG_LEVEL GREATER ${ECBUILD_DEBUG} ) )
+  if( NOT ( DEVELOPER_MODE OR _PAR_REQUIRED ) AND ( ECBUILD_LOG_LEVEL GREATER ${ECBUILD_DEBUG} ) )
     set( _find_quiet QUIET )
   endif()
 
diff --git a/cmake/ecbuild_find_perl.cmake b/cmake/ecbuild_find_perl.cmake
index 11e6f1d..c615203 100644
--- a/cmake/ecbuild_find_perl.cmake
+++ b/cmake/ecbuild_find_perl.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 # 
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
diff --git a/cmake/ecbuild_find_python.cmake b/cmake/ecbuild_find_python.cmake
index 2a8b457..c001a7b 100644
--- a/cmake/ecbuild_find_python.cmake
+++ b/cmake/ecbuild_find_python.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -14,7 +14,7 @@
 #
 # Find Python interpreter, its version and the Python libraries. ::
 #
-#   ecbuild_find_python( [ VERSION <version> ] [ REQUIRED ] [ NO_LIBS ] )
+#   ecbuild_find_python( [ VERSION <version> ] [ REQUIRED ] )
 #
 # Options
 # -------
@@ -25,18 +25,14 @@
 # REQUIRED : optional
 #   fail if Python was not found
 #
-# NO_LIBS : optional
-#   only search for the Python interpreter, not the libraries
-#
 # Output variables
 # ----------------
 #
-# The following CMake variables are set if python was found:
+# The following CMake variables are set if perl was found:
 #
 # :PYTHONINTERP_FOUND:    Python interpreter was found
 # :PYTHONLIBS_FOUND:      Python libraries were found
 # :PYTHON_FOUND:          Python was found (both interpreter and libraries)
-# :PYTHON_EXECUTABLE:     Python executable
 # :PYTHON_VERSION_MAJOR:  major version number
 # :PYTHON_VERSION_MINOR:  minor version number
 # :PYTHON_VERSION_PATCH:  patch version number
@@ -49,11 +45,11 @@
 
 set( __test_python ${CMAKE_CURRENT_LIST_DIR}/pymain.c )
 
-function( ecbuild_find_python )
+macro( ecbuild_find_python )
 
     # parse parameters
 
-    set( options REQUIRED NO_LIBS )
+    set( options REQUIRED )
     set( single_value_args VERSION )
     set( multi_value_args  )
 
@@ -68,7 +64,7 @@ function( ecbuild_find_python )
     find_package( PythonInterp )
 
     if( NOT PYTHONINTERP_FOUND AND _p_REQUIRED )
-        ecbuild_error( "Failed to find any Python interpreter (REQUIRED)" )
+        message( FATAL_ERROR "Failed to find any Python interpreter (REQUIRED)" )
     endif()
 
     # find python version
@@ -78,10 +74,10 @@ function( ecbuild_find_python )
     # endif()
     # endif()
 
-    # ecbuild_debug( "Python version ${PYTHON_VERSION_STRING}" )
-    # ecbuild_debug_var(PYTHON_VERSION_MAJOR)
-    # ecbuild_debug_var(PYTHON_VERSION_MINOR)
-    # ecbuild_debug_var(PYTHON_VERSION_PATCH)
+    # message( STATUS "Python version ${PYTHON_VERSION_STRING}" )
+    # debug_var(PYTHON_VERSION_MAJOR)
+    # debug_var(PYTHON_VERSION_MINOR)
+    # debug_var(PYTHON_VERSION_PATCH)
 
     if( PYTHONINTERP_FOUND AND DEFINED _p_VERSION )
         if( _p_VERSION VERSION_GREATER "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.${PYTHON_VERSION_PATCH}" )
@@ -98,77 +94,65 @@ function( ecbuild_find_python )
     if( PYTHONINTERP_FOUND )
         ecbuild_debug( "ecbuild_find_python: Found Python interpreter version ${PYTHON_VERSION_STRING} at ${PYTHON_EXECUTABLE}" )
 
-        # find where python site-packages are ...
-
-        if( PYTHON_EXECUTABLE )
-            execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE)
-        endif()
-        ecbuild_debug( "ecbuild_find_python: PYTHON_SITE_PACKAGES=${PYTHON_SITE_PACKAGES}" )
-
-    endif()
-    if( PYTHONINTERP_FOUND AND NOT _p_NO_LIBS )
         # find python config
 
         if( PYTHON_EXECUTABLE AND EXISTS ${PYTHON_EXECUTABLE}-config )
-            set(PYTHON_CONFIG_EXECUTABLE ${PYTHON_EXECUTABLE}-config CACHE PATH "" FORCE)
+            set(PYTHON_CONFIG ${PYTHON_EXECUTABLE}-config CACHE PATH "" FORCE)
         else()
-            find_program( PYTHON_CONFIG_EXECUTABLE NAMES python-config python-config${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} )
+            find_program( PYTHON_CONFIG NAMES python-config python-config${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} )
         endif()
 
-        ecbuild_debug_var( PYTHON_CONFIG_EXECUTABLE )
-
         # find python libs
 
-        # The OpenBSD python packages have python-config's
+        # The OpenBSD python packages have python-config's 
         # that don't reliably report linking flags that will work.
-
-        if( PYTHON_CONFIG_EXECUTABLE AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" )
-            ecbuild_debug( "ecbuild_find_python: Searching for Python include directories and libraries using ${PYTHON_CONFIG_EXECUTABLE}" )
-
-            execute_process(COMMAND "${PYTHON_CONFIG_EXECUTABLE}" --ldflags
+        
+        if( PYTHON_CONFIG AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" )
+            ecbuild_debug( "ecbuild_find_python: Searching for Python include directories and libraries using ${PYTHON_CONFIG}" )
+            
+            execute_process(COMMAND "${PYTHON_CONFIG}" --ldflags
                             OUTPUT_VARIABLE PYTHON_LIBRARIES
                             OUTPUT_STRIP_TRAILING_WHITESPACE
                             ERROR_QUIET)
 
-            execute_process(COMMAND "${PYTHON_CONFIG_EXECUTABLE}" --includes
-                            OUTPUT_VARIABLE PYTHON_INCLUDE_DIRS
+            execute_process(COMMAND "${PYTHON_CONFIG}" --includes
+                            OUTPUT_VARIABLE PYTHON_INCLUDE_DIR
                             OUTPUT_STRIP_TRAILING_WHITESPACE
                             ERROR_QUIET)
 
-            string(REGEX REPLACE "^[-I]" "" PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIRS}")
-            string(REGEX REPLACE "[ ]-I" " " PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIRS}")
-
-            separate_arguments(PYTHON_INCLUDE_DIRS)
+            string(REGEX REPLACE "^[-I]" "" PYTHON_INCLUDE_DIR "${PYTHON_INCLUDE_DIR}")
+            string(REGEX REPLACE "[ ]-I" " " PYTHON_INCLUDE_DIR "${PYTHON_INCLUDE_DIR}")
+            
+            separate_arguments(PYTHON_INCLUDE_DIR)
 
         else() # revert to finding pythonlibs the standard way (cmake macro)
             ecbuild_debug( "ecbuild_find_python: Searching for Python include directories and libraries using find_package(PythonLibs)" )
-
+            
             find_package(PythonLibs)
-            if( PYTHON_INCLUDE_PATH AND NOT PYTHON_INCLUDE_DIRS )
-              set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_PATH}")
+            if( PYTHON_INCLUDE_PATH AND NOT PYTHON_INCLUDE_DIR )
+                set(PYTHON_INCLUDE_DIR "${PYTHON_INCLUDE_PATH}")
             endif()
 
         endif()
 
         # Remove duplicate include directories
-        list(REMOVE_DUPLICATES PYTHON_INCLUDE_DIRS)
+        list(REMOVE_DUPLICATES PYTHON_INCLUDE_DIR)
 
+        # Test if we can link against the Python libraries and include Python.h
+        try_compile( PYTHON_LIBS_WORKING ${CMAKE_CURRENT_BINARY_DIR}
+                     ${__test_python}
+                     CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${PYTHON_INCLUDE_DIR}"
+                     LINK_LIBRARIES ${PYTHON_LIBRARIES} )
 
-        if( PYTHON_LIBRARIES AND PYTHON_INCLUDE_DIRS )
-            # Test if we can link against the Python libraries and include Python.h
-            try_compile( PYTHON_LIBS_WORKING ${CMAKE_CURRENT_BINARY_DIR}
-                         ${__test_python}
-                         CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${PYTHON_INCLUDE_DIRS}"
-                         LINK_LIBRARIES ${PYTHON_LIBRARIES} )
+        # set output variables
 
-            # set output variables
+        find_package_handle_standard_args( PythonLibs DEFAULT_MSG
+                                           PYTHON_INCLUDE_DIR PYTHON_LIBRARIES PYTHON_LIBS_WORKING )
+        ecbuild_debug( "ecbuild_find_python: PYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIR}" )
+        ecbuild_debug( "ecbuild_find_python: PYTHON_LIBRARIES=${PYTHON_LIBRARIES}" )
 
-            find_package_handle_standard_args( PythonLibs DEFAULT_MSG
-                                               PYTHON_INCLUDE_DIRS PYTHON_LIBRARIES PYTHON_LIBS_WORKING )
-            ecbuild_debug( "ecbuild_find_python: PYTHON_INCLUDE_DIRS=${PYTHON_INCLUDE_DIRS}" )
-            ecbuild_debug( "ecbuild_find_python: PYTHON_LIBRARIES=${PYTHON_LIBRARIES}" )
-
-        endif()
+        set( PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIR} )
+        set( PYTHON_INCLUDE_PATH ${PYTHON_INCLUDE_DIR} )
 
         # Also set PYTHON_FOUND and Python_FOUND for compatibility with ecbuild_add_option
         if( PYTHONLIBS_FOUND )
@@ -176,30 +160,18 @@ function( ecbuild_find_python )
           set( Python_FOUND 1 )
         endif()
 
+        # find where python site-packages are ...
+
+        execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE)
+        ecbuild_debug( "ecbuild_find_python: PYTHON_SITE_PACKAGES=${PYTHON_SITE_PACKAGES}" )
+
     endif()
 
-    ecbuild_debug_var( PYTHONINTERP_FOUND )
-    ecbuild_debug_var( PYTHON_FOUND )
-    ecbuild_debug_var( PYTHON_EXECUTABLE )
-    ecbuild_debug_var( PYTHON_CONFIG_EXECUTABLE )
-    ecbuild_debug_var( PYTHON_VERSION_MAJOR )
-    ecbuild_debug_var( PYTHON_VERSION_MINOR )
-    ecbuild_debug_var( PYTHON_VERSION_PATCH )
-    ecbuild_debug_var( PYTHON_VERSION_STRING )
-    ecbuild_debug_var( PYTHON_INCLUDE_DIRS )
-    ecbuild_debug_var( PYTHON_LIBRARIES )
-    ecbuild_debug_var( PYTHON_SITE_PACKAGES )
-
-    set( PYTHONINTERP_FOUND    ${PYTHONINTERP_FOUND} PARENT_SCOPE )
-    set( PYTHONLIBS_FOUND      ${PYTHONLIBS_FOUND} PARENT_SCOPE )
-    set( PYTHON_FOUND          ${PYTHON_FOUND} PARENT_SCOPE )
-    set( PYTHON_EXECUTABLE     ${PYTHON_EXECUTABLE} PARENT_SCOPE )
-    set( PYTHON_VERSION_MAJOR  ${PYTHON_VERSION_MAJOR} PARENT_SCOPE )
-    set( PYTHON_VERSION_MINOR  ${PYTHON_VERSION_MINOR} PARENT_SCOPE )
-    set( PYTHON_VERSION_PATCH  ${PYTHON_VERSION_PATCH} PARENT_SCOPE )
-    set( PYTHON_VERSION_STRING ${PYTHON_VERSION_STRING} PARENT_SCOPE )
-    set( PYTHON_INCLUDE_DIRS   ${PYTHON_INCLUDE_DIRS} PARENT_SCOPE )
-    set( PYTHON_LIBRARIES      ${PYTHON_LIBRARIES} PARENT_SCOPE )
-    set( PYTHON_SITE_PACKAGES  ${PYTHON_SITE_PACKAGES} PARENT_SCOPE )
-
-endfunction( ecbuild_find_python )
+#    debug_var( PYTHONINTERP_FOUND )
+#    debug_var( PYTHON_EXECUTABLE )
+#    debug_var( PYTHONLIBS_FOUND )
+#    debug_var( PYTHON_INCLUDE_DIRS )
+#    debug_var( PYTHON_LIBRARIES )
+#    debug_var( PYTHON_SITE_PACKAGES )
+
+endmacro( ecbuild_find_python )
diff --git a/cmake/ecbuild_generate_config_headers.cmake b/cmake/ecbuild_generate_config_headers.cmake
index 930fa3a..93cbb1f 100644
--- a/cmake/ecbuild_generate_config_headers.cmake
+++ b/cmake/ecbuild_generate_config_headers.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
diff --git a/cmake/ecbuild_generate_fortran_interfaces.cmake b/cmake/ecbuild_generate_fortran_interfaces.cmake
deleted file mode 100644
index 9c2045b..0000000
--- a/cmake/ecbuild_generate_fortran_interfaces.cmake
+++ /dev/null
@@ -1,115 +0,0 @@
-# (C) Copyright 1996-2016 ECMWF.
-#
-# This software is licensed under the terms of the Apache Licence Version 2.0
-# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-# In applying this licence, ECMWF does not waive the privileges and immunities
-# granted to it by virtue of its status as an intergovernmental organisation nor
-# does it submit to any jurisdiction.
-
-##############################################################################
-#.rst:
-#
-# ecbuild_generate_fortran_interfaces
-# ===================================
-#
-# Generates interfaces form the Fortran source files. ::
-#
-#   ecbuild_generate_fortran_interfaces()
-#
-# Options
-# -------
-#
-# TARGET : required
-#   target name
-#
-##############################################################################
-
-function( ecbuild_generate_fortran_interfaces )
-
-  find_program( FCM_EXECUTABLE fcm REQUIRED DOC "Fortran interface generator" )
-
-  if( NOT FCM_EXECUTABLE )
-    message( FATAL_ERROR "ecbuild_generate_fortran_interfaces: fcm executable not found." )
-  endif()
-
-  set( FCM_CONFIG_FILE "${PROJECT_SOURCE_DIR}/cmake/fcm-make-interfaces.cfg")
-
-  if( NOT EXISTS ${FCM_CONFIG_FILE} )
-    message( FATAL_ERROR "ecbuild_generate_fortran_interfaces: needs fcm configuration in ${FCM_CONFIG_FILE}" )
-  endif()
-
-  set( options )
-  set( single_value_args TARGET DESTINATION PARALLEL INCLUDE_DIRS GENERATED SOURCE_DIR )
-  set( multi_value_args DIRECTORIES )
-
-  cmake_parse_arguments( P "${options}" "${single_value_args}" "${multi_value_args}"  ${_FIRST_ARG} ${ARGN} )
-
-  if( NOT DEFINED P_TARGET )
-    message( FATAL_ERROR "ecbuild_generate_fortran_interfaces: TARGET argument missing" )
-  endif()
-
-  if( NOT DEFINED P_DESTINATION )
-    message( FATAL_ERROR "ecbuild_generate_fortran_interfaces: DESTINATION argument missing" )
-  endif()
-
-  if( NOT DEFINED P_DIRECTORIES )
-    message( FATAL_ERROR "ecbuild_generate_fortran_interfaces: DIRECTORIES argument missing" )
-  endif()
-
-  if( NOT DEFINED P_PARALLEL OR (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") )
-    set( P_PARALLEL 1 )
-  endif()
-
-  if( NOT DEFINED P_SOURCE_DIR )
-    message( FATAL_ERROR "ecbuild_generate_fortran_interfaces: SOURCE_DIR argument missing")
-  endif()
-
-  foreach( _srcdir ${P_DIRECTORIES} )
-    if( _srcdir MATCHES "/$" )
-      ecbuild_critical("ecbuild_generate_fortran_interfaces: directory ${_srcdir} must not end with /")
-    endif()
-    ecbuild_list_add_pattern( LIST fortran_files SOURCE_DIR ${P_SOURCE_DIR} GLOB ${_srcdir}/*.F* )
-  endforeach()
-
-  string( REPLACE ";" " " _srcdirs "${P_DIRECTORIES}" )
-
-  set( _cnt 0 )
-  foreach( file ${_fortran_files} )
-    if( ${${SRC}/file} IS_NEWER_THAN ${${SRC}/file} )
-      set( run_fcm 1 )
-    endif()
-  endforeach()
-
-  foreach( fortran_file ${fortran_files} )
-    #list( APPEND fullpath_fortran_files ${CMAKE_CURRENT_SOURCE_DIR}/${fortran_file} )
-      get_filename_component(base ${fortran_file} NAME_WE)
-      set( interface_file "${CMAKE_CURRENT_BINARY_DIR}/interfaces/include/${base}.intfb.h" )
-      list( APPEND interface_files ${interface_file} )
-      set_source_files_properties( ${interface_file} PROPERTIES GENERATED TRUE )
-      math(EXPR _cnt "${_cnt}+1")
-  endforeach()
-
-  ecbuild_info("Target ${P_TARGET} will generate ${_cnt} interface files using FCM")
-
-  if( DEFINED P_GENERATED )
-    set( ${P_GENERATED} ${interface_files} PARENT_SCOPE )
-  endif()
-
-  set( include_dir ${CMAKE_CURRENT_BINARY_DIR}/${P_DESTINATION}/interfaces/include )
-  set( ${P_INCLUDE_DIRS} ${include_dir} PARENT_SCOPE )
-
-  execute_process( COMMAND ${CMAKE_COMMAND} -E make_directory ${include_dir}
-                   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} )
-
-    add_custom_command(
-      OUTPUT  "${P_DESTINATION}/${P_TARGET}.timestamp"
-      COMMAND ${FCM_EXECUTABLE} make -j ${P_PARALLEL} --config-file=${FCM_CONFIG_FILE} interfaces.ns-incl=${_srcdirs} interfaces.source=${P_SOURCE_DIR}
-      COMMAND touch "${P_TARGET}.timestamp"
-      DEPENDS ${fortran_files}
-      COMMENT "Generating ${_cnt} interface files for target ${P_TARGET}"
-      WORKING_DIRECTORY ${P_DESTINATION} VERBATIM )
-
-    add_custom_target( ${P_TARGET} DEPENDS ${P_DESTINATION}/${P_TARGET}.timestamp )
-
-
-endfunction( ecbuild_generate_fortran_interfaces )
diff --git a/cmake/ecbuild_generate_rpc.cmake b/cmake/ecbuild_generate_rpc.cmake
index a2e3dd2..45a00ba 100644
--- a/cmake/ecbuild_generate_rpc.cmake
+++ b/cmake/ecbuild_generate_rpc.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
diff --git a/cmake/ecbuild_generate_yy.cmake b/cmake/ecbuild_generate_yy.cmake
index aba5620..5ef2dad 100644
--- a/cmake/ecbuild_generate_yy.cmake
+++ b/cmake/ecbuild_generate_yy.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -19,7 +19,6 @@
 #                        LEX <file>
 #                        DEPENDANT <file1> [ <file2> ... ]
 #                        [ SOURCE_DIR <dir> ]
-#                        [ OUTPUT_DIRECTORY <dir> ]
 #                        [ YACC_TARGET <file> ]
 #                        [ LEX_TARGET <file> ]
 #                        [ YACC_FLAGS <flags> ]
@@ -46,9 +45,6 @@
 # SOURCE_DIR : optional, defaults to CMAKE_CURRENT_SOURCE_DIR
 #   directory where yacc and lex source files are located
 #
-# OUTPUT_DIRECTORY : optional, defaults to CMAKE_CURRENT_BINARY_DIR
-#   output directory for yacc and lex target files
-#
 # YACC_TARGET : optional, defaults to YACC
 #   base name of the generated yacc target file (without .c extension)
 #
@@ -76,7 +72,7 @@ macro( ecbuild_generate_yy )
   ecbuild_find_perl( REQUIRED )
 
   set( options )
-  set( single_value_args YYPREFIX YACC LEX SOURCE_DIR OUTPUT_DIRECTORY YACC_TARGET LEX_TARGET LEX_FLAGS YACC_FLAGS FLEX_FLAGS BISON_FLAGS )
+  set( single_value_args YYPREFIX YACC LEX SOURCE_DIR YACC_TARGET LEX_TARGET LEX_FLAGS YACC_FLAGS FLEX_FLAGS BISON_FLAGS )
   set( multi_value_args  DEPENDANT )
 
   cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}"  ${_FIRST_ARG} ${ARGN} )
@@ -129,23 +125,19 @@ macro( ecbuild_generate_yy )
     set ( _PAR_LEX_TARGET ${_PAR_LEX} )
   endif()
 
+  set( ${BASE}yy_tmp_target ${CMAKE_CURRENT_BINARY_DIR}/${_PAR_YACC_TARGET}.tmp.c )
+  set( ${BASE}yh_tmp_target ${CMAKE_CURRENT_BINARY_DIR}/${_PAR_YACC_TARGET}.tmp.h )
+  set( ${BASE}yl_tmp_target ${CMAKE_CURRENT_BINARY_DIR}/${_PAR_LEX_TARGET}.tmp.c )
+
+  set( ${BASE}yy_target ${CMAKE_CURRENT_BINARY_DIR}/${_PAR_YACC_TARGET}.c )
+  set( ${BASE}yh_target ${CMAKE_CURRENT_BINARY_DIR}/${_PAR_YACC_TARGET}.h )
+  set( ${BASE}yl_target ${CMAKE_CURRENT_BINARY_DIR}/${_PAR_LEX_TARGET}.c )
+
   if( NOT _PAR_SOURCE_DIR )
     set( _PAR_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} )
   endif()
 
-  if( NOT _PAR_OUTPUT_DIRECTORY )
-    set( _PAR_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} )
-  else()
-    file( MAKE_DIRECTORY ${_PAR_OUTPUT_DIRECTORY} )
-  endif()
-
-  set( ${BASE}yy_tmp_target ${_PAR_OUTPUT_DIRECTORY}/${_PAR_YACC_TARGET}.tmp.c )
-  set( ${BASE}yh_tmp_target ${_PAR_OUTPUT_DIRECTORY}/${_PAR_YACC_TARGET}.tmp.h )
-  set( ${BASE}yl_tmp_target ${_PAR_OUTPUT_DIRECTORY}/${_PAR_LEX_TARGET}.tmp.c )
-
-  set( ${BASE}yy_target ${_PAR_OUTPUT_DIRECTORY}/${_PAR_YACC_TARGET}.c )
-  set( ${BASE}yh_target ${_PAR_OUTPUT_DIRECTORY}/${_PAR_YACC_TARGET}.h )
-  set( ${BASE}yl_target ${_PAR_OUTPUT_DIRECTORY}/${_PAR_LEX_TARGET}.c )
+  add_custom_target( ${_PAR_YYPREFIX}_${DEPENDANT} SOURCES ${_PAR_SOURCE_DIR}/${_PAR_YACC}.y ${_PAR_SOURCE_DIR}/${_PAR_LEX}.l )
 
   if( BISON_FOUND )
     bison_target( ${BASE}_parser ${_PAR_SOURCE_DIR}/${_PAR_YACC}.y ${${BASE}yy_tmp_target} COMPILE_FLAGS "${_PAR_BISON_FLAGS}" )
diff --git a/cmake/ecbuild_get_cxx11_flags.cmake b/cmake/ecbuild_get_cxx11_flags.cmake
index bd7d0e8..5bfed07 100644
--- a/cmake/ecbuild_get_cxx11_flags.cmake
+++ b/cmake/ecbuild_get_cxx11_flags.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
diff --git a/cmake/ecbuild_get_date.cmake b/cmake/ecbuild_get_date.cmake
index 7a35a0c..ec308a3 100644
--- a/cmake/ecbuild_get_date.cmake
+++ b/cmake/ecbuild_get_date.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 # 
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
diff --git a/cmake/ecbuild_get_resources.cmake b/cmake/ecbuild_get_resources.cmake
index 4dc4957..da824d9 100644
--- a/cmake/ecbuild_get_resources.cmake
+++ b/cmake/ecbuild_get_resources.cmake
@@ -1,8 +1,8 @@
-# (C) Copyright 1996-2016 ECMWF.
-#
+# (C) Copyright 1996-2015 ECMWF.
+# 
 # This software is licensed under the terms of the Apache Licence Version 2.0
-# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-# In applying this licence, ECMWF does not waive the privileges and immunities
+# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
+# In applying this licence, ECMWF does not waive the privileges and immunities 
 # granted to it by virtue of its status as an intergovernmental organisation nor
 # does it submit to any jurisdiction.
 
@@ -29,7 +29,7 @@ macro( ecbuild_get_resources )
     if( NOT _PAR_TO_DIR )
 		set( _PAR_TO_DIR ${CMAKE_CURRENT_BINARY_DIR} )
 	endif()
-
+	
     list( LENGTH _PAR_LIST _rsize )
     math( EXPR _max "${_rsize}-1" )
     foreach( i RANGE 0 ${_max} 2 )
@@ -39,14 +39,14 @@ macro( ecbuild_get_resources )
         list( GET _PAR_LIST ${i}  r  )
         list( GET _PAR_LIST ${in} rh )
 
-#        ecbuild_debug_var( r  )
-#        ecbuild_debug_var( rh )
+#        debug_var( r  )
+#        debug_var( rh )
 
         get_filename_component( rf ${r} NAME )
 
         file( DOWNLOAD ${r} ${_PAR_TO_DIR}/${rf} EXPECTED_HASH SHA1=${rh} )
 
     endforeach()
-
+		
 
 endmacro()
diff --git a/cmake/ecbuild_get_test_data.cmake b/cmake/ecbuild_get_test_data.cmake
index 9c1e18b..8106c65 100644
--- a/cmake/ecbuild_get_test_data.cmake
+++ b/cmake/ecbuild_get_test_data.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -151,10 +151,10 @@ function( ecbuild_get_test_data )
       set( _p_DIRNAME ${PROJECT_NAME}/${currdir} )
     endif()
 
-#    ecbuild_debug_var( _p_TARGET )
-#    ecbuild_debug_var( _p_NAME )
-#    ecbuild_debug_var( _p_URL )
-#    ecbuild_debug_var( _p_DIRNAME )
+#    debug_var( _p_TARGET )
+#    debug_var( _p_NAME )
+#    debug_var( _p_URL )
+#    debug_var( _p_DIRNAME )
 
     # download the data
 
@@ -326,9 +326,9 @@ function( ecbuild_get_test_multidata )
       message(FATAL_ERROR "ecbuild_get_test_data() expects a TARGET")
     endif()
 
-#    ecbuild_debug_var( _p_TARGET )
-#    ecbuild_debug_var( _p_NAME )
-#    ecbuild_debug_var( _p_DIRNAME )
+#    debug_var( _p_TARGET )
+#    debug_var( _p_NAME )
+#    debug_var( _p_DIRNAME )
 
     if( _p_EXTRACT )
         set( _extract EXTRACT )
@@ -372,11 +372,11 @@ endfunction()\n\n" )
             set( _md5 MD5 ${_md5} )
         endif()
 
-        #ecbuild_debug_var(_f)
-        #ecbuild_debug_var(_file)
-        #ecbuild_debug_var(_dirname)
-        #ecbuild_debug_var(_name)
-        #ecbuild_debug_var(_md5)
+        #debug_var(_f)
+        #debug_var(_file)
+        #debug_var(_dirname)
+        #debug_var(_name)
+        #debug_var(_md5)
 
         ecbuild_get_test_data(
             TARGET __get_data_${_p_TARGET}_${_name}
diff --git a/cmake/ecbuild_git.cmake b/cmake/ecbuild_git.cmake
index b20e895..42124db 100644
--- a/cmake/ecbuild_git.cmake
+++ b/cmake/ecbuild_git.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -8,8 +8,6 @@
 
 set( ECBUILD_GIT  ON  CACHE BOOL "Turn on/off ecbuild_git() function" )
 
-mark_as_advanced(ECBUILD_GIT)
-
 if( ECBUILD_GIT )
 
   find_package(Git)
@@ -108,7 +106,7 @@ macro( ecbuild_git )
         RESULT_VARIABLE nok ERROR_VARIABLE error
         WORKING_DIRECTORY "${PARENT_DIR}")
       if(nok)
-        message(FATAL_ERROR "${_PAR_DIR} git clone failed:\n  ${GIT_EXECUTABLE} clone ${_PAR_URL} ${clone_args} ${_PAR_DIR} -q\n  ${error}\n")
+        message(FATAL_ERROR "${_PAR_DIR} git clone failed: ${error}\n")
       endif()
       message( STATUS "${_PAR_DIR} retrieved.")
       set( _needs_switch 1 )
@@ -135,6 +133,7 @@ macro( ecbuild_git )
         message(STATUS "git rev-parse --abbrev-ref HEAD on ${_PAR_DIR} failed:\n ${error}")
       endif()
 
+      #message(STATUS "git describe --exact-match --abbrev=0 @ ${ABS_PAR_DIR}")
       execute_process( COMMAND ${GIT_EXECUTABLE} describe --exact-match --abbrev=0
                        OUTPUT_VARIABLE _current_tag RESULT_VARIABLE nok ERROR_VARIABLE error
                        OUTPUT_STRIP_TRAILING_WHITESPACE  ERROR_STRIP_TRAILING_WHITESPACE
@@ -149,6 +148,7 @@ macro( ecbuild_git )
       endif()
 
       if( NOT _current_tag ) # try nother method
+        #message(STATUS "git name-rev --tags --name-only @ ${ABS_PAR_DIR}")
         execute_process( COMMAND ${GIT_EXECUTABLE} name-rev --tags --name-only ${_sha1}
                          OUTPUT_VARIABLE _current_tag RESULT_VARIABLE nok ERROR_VARIABLE error
                          OUTPUT_STRIP_TRAILING_WHITESPACE
@@ -231,7 +231,7 @@ macro( ecbuild_git )
                        RESULT_VARIABLE nok ERROR_VARIABLE error
                        WORKING_DIRECTORY "${ABS_PAR_DIR}")
       if(nok)
-        message(FATAL_ERROR "git checkout ${_gitref} on ${_PAR_DIR} failed:\n  ${GIT_EXECUTABLE} checkout -q ${_gitref}\n  ${error}")
+        message(FATAL_ERROR "git checkout ${_gitref} on ${_PAR_DIR} failed:\n ${error}")
       endif()
 
       if( DEFINED _PAR_BRANCH AND _PAR_UPDATE ) #############################################################################
diff --git a/cmake/ecbuild_install_project.cmake b/cmake/ecbuild_install_project.cmake
index 8c21d7a..d53f110 100644
--- a/cmake/ecbuild_install_project.cmake
+++ b/cmake/ecbuild_install_project.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -33,7 +33,7 @@
 # the project with cpack and exports the configuration and targets for other
 # projects to use.
 #
-# Unless ECBUILD_SKIP_<PNAME>_EXPORT is set, the following files are generated:
+# In a top-level project, the following files are generated:
 #
 # :<project>-config.cmake:         default project configuration
 # :<project>-config-version.cmake: project version number
@@ -49,7 +49,7 @@
 # and ``<project>-config-version.cmake``.
 #
 # In DEVELOPER_MODE, the build tree location is also added to the CMake user
-# package registry for top level projects.
+# package registry.
 #
 # If the project is added as a subdirectory, the following CMake variables
 # are set in the parent scope:
@@ -70,6 +70,7 @@
 #
 ##############################################################################
 
+
 macro( ecbuild_install_project )
 
     set( options )
@@ -86,17 +87,6 @@ macro( ecbuild_install_project )
       message(FATAL_ERROR "The call to ecbuild_install_project() doesn't specify the NAME.")
     endif()
 
-    ### EXTRA TARGETS #####################################################
-
-    # added here to avoid adding another macro call at the end of each project,
-
-    if( PROJECT_NAME STREQUAL CMAKE_PROJECT_NAME )
-
-        ecbuild_define_libs_and_execs_targets()
-        ecbuild_define_links_target()
-
-    endif()
-
     ### PACKAGING ########################################################
 
     set( PNAME ${PROJECT_NAME_CAPS} )
@@ -170,8 +160,6 @@ macro( ecbuild_install_project )
                PATHS ${ECBUILD_MACROS_DIR}/../toolchains
                      ${ECBUILD_MACROS_DIR}/../share/ecbuild/toolchains )
 
-    mark_as_advanced( ECBUILD_TOOLCHAIN_DIR )
-
     if( ECBUILD_TOOLCHAIN_DIR )
       list( APPEND CPACK_SOURCE_INSTALLED_DIRECTORIES "${ECBUILD_TOOLCHAIN_DIR}" "share/ecbuild/toolchains/" )
     endif()
@@ -181,8 +169,6 @@ macro( ecbuild_install_project )
                   PATHS ${ECBUILD_MACROS_DIR}/../bin
                         ${ECBUILD_MACROS_DIR}/../../../bin )
 
-    mark_as_advanced( ECBUILD_SCRIPT )
-
     if( ECBUILD_SCRIPT )
       get_filename_component( ECBUILD_BIN_DIR ${ECBUILD_SCRIPT} PATH )
       list( APPEND CPACK_SOURCE_INSTALLED_DIRECTORIES "${ECBUILD_BIN_DIR}" "bin/" )
@@ -233,9 +219,16 @@ macro( ecbuild_install_project )
         endif()
     endforeach()
 
-    # Generate the project .cmake config files
-    # All variables here must be (sub)project specific in order to work within bundles
-    if ( NOT ECBUILD_SKIP_${PNAME}_EXPORT )
+    # TOP-LEVEL PROJECT EXPORT
+
+    if( PROJECT_NAME STREQUAL CMAKE_PROJECT_NAME )
+
+        # exports the package for use from the build-tree but only in DEVELOPER_MODE
+        # inserts <package> into the CMake user package registry
+
+        if( DEVELOPER_MODE )
+            export( PACKAGE ${PROJECT_NAME} )
+        endif()
 
         set( _template_config "${ECBUILD_MACROS_DIR}/project-config.cmake.in" )
         if( EXISTS ${LNAME}-config.cmake.in )
@@ -249,9 +242,7 @@ macro( ecbuild_install_project )
 
         # project-config-version.cmake -- format ([0-9]+).([0-9]+).([0-9]+)
 
-        set( PACKAGE_VERSION        "${${PNAME}_VERSION}" )
-        set( PACKAGE_GIT_SHA1       "${${PNAME}_GIT_SHA1}" )
-        set( PACKAGE_GIT_SHA1_SHORT "${${PNAME}_GIT_SHA1_SHORT}" )
+        set( PACKAGE_VERSION "${${PNAME}_VERSION}" )
 
         configure_file( "${_template_config_version}" "${PROJECT_BINARY_DIR}/${LNAME}-config-version.cmake" @ONLY )
 
@@ -306,7 +297,6 @@ macro( ecbuild_install_project )
         # If <project>-import.cmake.in exist in source tree, configure it to
         # the build tree and install the configured version
         if( EXISTS "${PROJECT_SOURCE_DIR}/${CONF_IMPORT_FILE}.in" )
-          ecbuild_debug( "Found ${PROJECT_SOURCE_DIR}/${CONF_IMPORT_FILE}.in - configuring to ${PROJECT_BINARY_DIR}/${CONF_IMPORT_FILE}" )
           configure_file( "${PROJECT_SOURCE_DIR}/${CONF_IMPORT_FILE}.in"
                           "${PROJECT_BINARY_DIR}/${CONF_IMPORT_FILE}" @ONLY )
           install( FILES "${PROJECT_BINARY_DIR}/${CONF_IMPORT_FILE}"
@@ -314,13 +304,10 @@ macro( ecbuild_install_project )
         # Otherwise, if <project>-import.cmake exist in source tree, copy it to
         # the build tree and install it
         elseif( EXISTS "${PROJECT_SOURCE_DIR}/${CONF_IMPORT_FILE}" )
-          ecbuild_debug( "Found ${PROJECT_SOURCE_DIR}/${CONF_IMPORT_FILE} - copying to ${PROJECT_BINARY_DIR}/${CONF_IMPORT_FILE}" )
           configure_file( "${PROJECT_SOURCE_DIR}/${CONF_IMPORT_FILE}"
                           "${PROJECT_BINARY_DIR}/${CONF_IMPORT_FILE}" COPYONLY )
           install( FILES "${PROJECT_SOURCE_DIR}/${CONF_IMPORT_FILE}"
                    DESTINATION "${INSTALL_CMAKE_DIR}" )
-        else()
-          ecbuild_debug( "No ${CONF_IMPORT_FILE} found in ${PROJECT_SOURCE_DIR}" )
         endif()
 
         set( _lname_config "${PROJECT_BINARY_DIR}/${LNAME}-config.cmake")
@@ -331,28 +318,13 @@ macro( ecbuild_install_project )
         file( REMOVE ${_lname_config}.tpls.in )
 
         foreach( _tpl ${${PNAME}_TPLS} )
-
             string( TOUPPER ${_tpl} TPL )
-
-            if( ${TPL}_IMPORT_FILE ) # ecBuild packages should trigger this if they export themselves
-
-              ecbuild_debug( "Adding TPL ${TPL} import file to ${_lname_config}.tpls.in" )
+            if( ${TPL}_IMPORT_FILE )
                 set( __import_file "${${TPL}_IMPORT_FILE}" )
                 file( APPEND "${_lname_config}.tpls.in" "if( NOT ${TPL}_IMPORT_FILE )\n" )
                 file( APPEND "${_lname_config}.tpls.in" "    include( \"${__import_file}\" OPTIONAL )\n" )
                 file( APPEND "${_lname_config}.tpls.in" "endif()\n" )
-
-            elseif( ${TPL}_CONFIG ) # cmake built packages (e.g. CGAL) may have exported their targets
-
-              ecbuild_debug( "Adding TPL ${TPL} import file to ${_lname_config}.tpls.in" )
-                set( __import_file "${${TPL}_CONFIG}" )
-                file( APPEND "${_lname_config}.tpls.in" "if( NOT ${TPL}_CONFIG )\n" )
-                file( APPEND "${_lname_config}.tpls.in" "    include( \"${__import_file}\" OPTIONAL )\n" )
-                file( APPEND "${_lname_config}.tpls.in" "    set( ${TPL}_CONFIG \"${__import_file}\" )\n" )
-                file( APPEND "${_lname_config}.tpls.in" "endif()\n" )
-
             endif()
-
         endforeach()
 
         if( EXISTS "${_lname_config}.tpls.in" )
@@ -389,30 +361,14 @@ macro( ecbuild_install_project )
         # install the export
 
         if( ${PROJECT_NAME}_ALL_EXES OR ${PROJECT_NAME}_ALL_LIBS )
-            install( EXPORT ${PROJECT_NAME}-targets
-                     DESTINATION "${INSTALL_CMAKE_DIR}" )
-        endif()
-
-    endif()  # if ( NOT ECBUILD_SKIP_${PNAME}_EXPORT )
-
-    # exports the package for use from the build-tree but only in DEVELOPER_MODE
-    # inserts <package> into the CMake user package registry
-
-    if( PROJECT_NAME STREQUAL CMAKE_PROJECT_NAME )
-
-        if( DEVELOPER_MODE )
-            export( PACKAGE ${PROJECT_NAME} )
+            install( EXPORT ${CMAKE_PROJECT_NAME}-targets DESTINATION "${INSTALL_CMAKE_DIR}" )
         endif()
 
     else()
 
-    # export variables for upper projects
-
         set( ${PNAME}_FOUND             TRUE                          PARENT_SCOPE )
         set( ${PROJECT_NAME}_FOUND      TRUE                          PARENT_SCOPE )
         set( ${PNAME}_VERSION           ${${PNAME}_VERSION}           PARENT_SCOPE )
-        set( ${PNAME}_GIT_SHA1          ${${PNAME}_GIT_SHA1}          PARENT_SCOPE )
-        set( ${PNAME}_GIT_SHA1_SHORT    ${${PNAME}_GIT_SHA1_SHORT}    PARENT_SCOPE )
         set( ${PROJECT_NAME}_VERSION    ${${PNAME}_VERSION}           PARENT_SCOPE )
         set( ${PNAME}_INCLUDE_DIRS      ${${PNAME}_INCLUDE_DIRS}      PARENT_SCOPE )
         set( ${PNAME}_LIBRARIES         ${${PNAME}_LIBRARIES}         PARENT_SCOPE )
@@ -426,7 +382,6 @@ macro( ecbuild_install_project )
         foreach( _f ${${PNAME}_FEATURES} )
             set( ${PNAME}_HAVE_${_f} ${${PNAME}_HAVE_${_f}} PARENT_SCOPE )
         endforeach()
-
-    endif()
+     endif()
 
 endmacro( ecbuild_install_project )
diff --git a/cmake/ecbuild_define_links_target.cmake b/cmake/ecbuild_links_target.cmake
similarity index 92%
rename from cmake/ecbuild_define_links_target.cmake
rename to cmake/ecbuild_links_target.cmake
index b5f53fe..c881c0d 100644
--- a/cmake/ecbuild_define_links_target.cmake
+++ b/cmake/ecbuild_links_target.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -63,11 +63,11 @@ macro( ecbuild_define_links_target )
 
     add_custom_target( links DEPENDS ${ec_link_libs} ${ec_link_exes} )
 
-     #   ecbuild_debug_var( EC_ALL_EXES )
-     #   ecbuild_debug_var( ec_link_exes )
+     #   debug_var( EC_ALL_EXES )
+     #   debug_var( ec_link_exes )
 
-     #  ecbuild_debug_var( EC_ALL_LIBS )
-     #   ecbuild_debug_var( ec_link_libs )
+     #  debug_var( EC_ALL_LIBS )
+     #   debug_var( ec_link_libs )
 
   endif()
 
diff --git a/cmake/ecbuild_list_add_pattern.cmake b/cmake/ecbuild_list_add_pattern.cmake
deleted file mode 100644
index 0f68217..0000000
--- a/cmake/ecbuild_list_add_pattern.cmake
+++ /dev/null
@@ -1,102 +0,0 @@
-# (C) Copyright 1996-2016 ECMWF.
-#
-# This software is licensed under the terms of the Apache Licence Version 2.0
-# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-# In applying this licence, ECMWF does not waive the privileges and immunities
-# granted to it by virtue of its status as an intergovernmental organisation nor
-# does it submit to any jurisdiction.
-
-##############################################################################
-#.rst:
-#
-# ecbuild_list_add_pattern
-# ========================
-#
-# Exclude items from a list that match a list of patterns. ::
-#
-#   ecbuild_list_add_pattern( LIST <input_list>
-#                             GLOB <pattern1> [ <pattern2> ... ]
-#                             [ SOURCE_DIR <source_dir> ]
-#                             [ QUIET ] )
-#
-# Options
-# -------
-#
-# LIST : required
-#   list variable to be appended to
-#
-# GLOB : required
-#   Regex pattern of exclusion
-#
-# SOURCE_DIR : optional
-#   Directory from where to start search
-#
-# QUIET  : optional
-#   Don't warn if patterns don't match
-#
-##############################################################################
-
-function( ecbuild_list_add_pattern )
-
-  set( options QUIET )
-  set( single_value_args LIST SOURCE_DIR )
-  set( multi_value_args  GLOB )
-
-  cmake_parse_arguments( _p "${options}" "${single_value_args}" "${multi_value_args}"  ${_FIRST_ARG} ${ARGN} )
-
-  if(_p_UNPARSED_ARGUMENTS)
-    ecbuild_critical("Unknown keywords given to ecbuild_list_add_pattern(): \"${_p_UNPARSED_ARGUMENTS}\"")
-  endif()
-
-  if( NOT _p_LIST  )
-    ecbuild_critical("The call to ecbuild_list_add_pattern() doesn't specify the LIST.")
-  endif()
-
-  if( NOT _p_GLOB )
-    ecbuild_critical("The call to ecbuild_list_add_pattern() doesn't specify the GLOB.")
-  endif()
-
-  #####
-
-  set( input_list ${${_p_LIST}} )
-  unset( matched_files )
-
-  foreach( pattern ${_p_GLOB} )
-
-    if( IS_ABSOLUTE ${pattern} )
-      ecbuild_debug( "ecbuild_list_add_pattern: Adding ${pattern}" )
-      file( GLOB_RECURSE matched_files ${pattern} )
-    else()
-
-      if(_p_SOURCE_DIR)
-        if( IS_ABSOLUTE ${_p_SOURCE_DIR} )
-          ecbuild_debug( "ecbuild_list_add_pattern: Adding ${_p_SOURCE_DIR}/${pattern}" )
-          file( GLOB_RECURSE matched_files ${_p_SOURCE_DIR}/${pattern} )
-        else()
-          ecbuild_debug( "ecbuild_list_add_pattern: Adding ${_p_SOURCE_DIR}/${pattern}" )
-          file( GLOB_RECURSE matched_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${_p_SOURCE_DIR}/${pattern} )
-        endif()
-      else()
-        ecbuild_debug( "ecbuild_list_add_pattern: Adding ${pattern} ")
-        file( GLOB_RECURSE matched_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${pattern} )
-      endif()
-
-    endif()
-
-    if(matched_files)
-      ecbuild_debug( "ecbuild_list_add_pattern: Found ${matched_files}" )
-      list( APPEND input_list ${matched_files} )
-      list( REMOVE_DUPLICATES input_list )
-      set( ${_p_LIST} ${input_list} PARENT_SCOPE )
-    else()
-      if(NOT _p_QUIET)
-        ecbuild_warn( "ecbuild_list_add_pattern: no matches found for patterns ${pattern}" )
-      else()
-        ecbuild_debug( "ecbuild_list_add_pattern:no matches found for patterns ${pattern}" )
-      endif()
-    endif()
-
-  endforeach()
-
-
-endfunction(ecbuild_list_add_pattern)
diff --git a/cmake/ecbuild_list_exclude_pattern.cmake b/cmake/ecbuild_list_exclude_pattern.cmake
deleted file mode 100644
index ab9c2d9..0000000
--- a/cmake/ecbuild_list_exclude_pattern.cmake
+++ /dev/null
@@ -1,88 +0,0 @@
-# (C) Copyright 1996-2016 ECMWF.
-#
-# This software is licensed under the terms of the Apache Licence Version 2.0
-# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-# In applying this licence, ECMWF does not waive the privileges and immunities
-# granted to it by virtue of its status as an intergovernmental organisation nor
-# does it submit to any jurisdiction.
-
-##############################################################################
-#.rst:
-#
-# ecbuild_list_exclude_pattern
-# ============================
-#
-# Exclude items from a list that match a list of patterns. ::
-#
-#   ecbuild_list_exclude_pattern( LIST <input_list>
-#                                 REGEX <regex1> [ <regex2> ... ]
-#                                 [ QUIET ] )
-#
-# Options
-# -------
-#
-# LIST : required
-#   list variable to be cleaned
-#
-# REGEX : required
-#   Regex pattern of exclusions
-#
-# QUIET  : optional
-#   Don't warn if patterns don't match
-#
-##############################################################################
-
-function( ecbuild_list_exclude_pattern )
-
-  set( options QUIET )
-  set( single_value_args LIST )
-  set( multi_value_args  REGEX )
-
-  cmake_parse_arguments( _p "${options}" "${single_value_args}" "${multi_value_args}"  ${_FIRST_ARG} ${ARGN} )
-
-  if(_p_UNPARSED_ARGUMENTS)
-    message(FATAL_ERROR "Unknown keywords given to ecbuild_list_exclude_pattern(): \"${_p_UNPARSED_ARGUMENTS}\"")
-  endif()
-
-  if( NOT _p_LIST  )
-    message(FATAL_ERROR "The call to ecbuild_list_exclude_pattern() doesn't specify the LIST.")
-  endif()
-
-  if( NOT _p_REGEX )
-    message(FATAL_ERROR "The call to ecbuild_list_exclude_pattern() doesn't specify the REGEX.")
-  endif()
-
-  #####
-
-  set( result "" )
-  set( matches_found 0 )
-
-  # ecbuild_debug_var(_p_REGEX)
-
-  foreach( item ${${_p_LIST}} )
-
-    set( _keep 1 )
-
-    foreach( pattern ${_p_REGEX} )
-        if( ${item} MATCHES ${pattern} )
-            set( _keep 0 )
-            set( matches_found 1 )
-        endif()
-    endforeach()
-    if( _keep )
-        list( APPEND result ${item} )
-#    else()
-#      ecbuild_warn( "removing ${item}" )
-    endif()
-
-  endforeach()
-
-  if( matches_found )
-      set( ${_p_LIST} ${result} PARENT_SCOPE )
-  else()
-    if( NOT _p_QUIET )
-        ecbuild_warn( "ecbuild_list_exclude_pattern: no matches found for patterns ${_p_REGEX} in ${_p_LIST}" )
-    endif()
-  endif()
-
-endfunction(ecbuild_list_exclude_pattern)
diff --git a/cmake/ecbuild_list_extra_search_paths.cmake b/cmake/ecbuild_list_extra_search_paths.cmake
index b81f062..0768a48 100644
--- a/cmake/ecbuild_list_extra_search_paths.cmake
+++ b/cmake/ecbuild_list_extra_search_paths.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -14,11 +14,11 @@
 
 function( ecbuild_list_extra_search_paths pkg var )
 
-  ecbuild_deprecate( " ecbuild_list_extra_search_paths should no longer be"
-                     " used and is going to be removed in a future version of ecBuild." )
+  message( DEPRECATION " ecbuild_list_extra_search_paths should no longer be"
+           " used and is going to be removed in a future version of ecBuild." )
 
-	# ecbuild_debug_var( pkg )
-	# ecbuild_debug_var( var )
+	# debug_var( pkg )
+	# debug_var( var )
 
 	string( TOUPPER ${pkg} _PKG )
 
@@ -75,7 +75,7 @@ function( ecbuild_list_extra_search_paths pkg var )
   ecbuild_debug("ecbuild_list_extra_search_paths(${pkg}): setting ${var} to ${${var}}")
 	set( ${var} ${${var}} PARENT_SCOPE )
 
-# ecbuild_debug_var( ${var} )
+# debug_var( ${var} )
 
 endfunction()
 
diff --git a/cmake/ecbuild_list_macros.cmake b/cmake/ecbuild_list_macros.cmake
index 176a161..a4152c7 100644
--- a/cmake/ecbuild_list_macros.cmake
+++ b/cmake/ecbuild_list_macros.cmake
@@ -1,8 +1,8 @@
-# (C) Copyright 1996-2016 ECMWF.
-#
+# (C) Copyright 1996-2015 ECMWF.
+# 
 # This software is licensed under the terms of the Apache Licence Version 2.0
-# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-# In applying this licence, ECMWF does not waive the privileges and immunities
+# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
+# In applying this licence, ECMWF does not waive the privileges and immunities 
 # granted to it by virtue of its status as an intergovernmental organisation nor
 # does it submit to any jurisdiction.
 
@@ -56,3 +56,35 @@ function( MAP_GET _map _key _var )
 	set( ${_var} "${_${_map}_${_key}}" PARENT_SCOPE )
 endfunction(MAP_GET)
 
+##############################################################################
+# function to remove items from a list that match a list of patterns
+#
+# examples:
+#
+#   ecbuild_list_remove_pattern( mylist "foo;bar" VAR )
+#
+
+function(ecbuild_list_remove_pattern _list _patterns _var)
+
+#debug_var(  _list )
+#debug_var(  _patterns )
+#debug_var(  _var )
+
+    foreach( _elem ${_list} )
+        set( _keep TRUE)
+        foreach( _pat ${_patterns} )
+            if( ${_elem} MATCHES ${_pat} )
+                set( _keep FALSE)
+            endif()
+        endforeach()
+        if( _keep )
+            list( APPEND _result ${_elem} )
+        endif()
+
+    endforeach()
+
+#debug_var(  _result )
+
+    set( ${_var} "${_result}" PARENT_SCOPE )
+
+endfunction(ecbuild_list_remove_pattern)
diff --git a/cmake/ecbuild_log.cmake b/cmake/ecbuild_log.cmake
index 732040b..fbb2349 100644
--- a/cmake/ecbuild_log.cmake
+++ b/cmake/ecbuild_log.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -15,12 +15,11 @@
 # ecBuild provides macros for logging based on a log level set by the user,
 # similar to the Python logging module:
 #
-# :ecbuild_debug:     logs a ``STATUS`` message if log level <= ``DEBUG``
-# :ecbuild_info:      logs a ``STATUS`` message if log level <= ``INFO``
-# :ecbuild_warn:      logs a ``WARNING`` message if log level <= ``WARN``
-# :ecbuild_error:     logs a ``SEND_ERROR`` message if log level <= ``ERROR``
-# :ecbuild_critical:  logs a ``FATAL_ERROR`` message if log level <= ``CRITICAL``
-# :ecbuild_deprecate: logs a ``DEPRECATION`` message
+# :ecbuild_debug:    logs a ``STATUS`` message if log level <= ``DEBUG``
+# :ecbuild_info:     logs a ``STATUS`` message if log level <= ``INFO``
+# :ecbuild_warn:     logs a ``WARNING`` message if log level <= ``WARN``
+# :ecbuild_error:    logs a ``SEND_ERROR`` message if log level <= ``ERROR``
+# :ecbuild_critical: logs a ``FATAL_ERROR`` message if log level <= ``CRITICAL``
 #
 # Input variables
 # ---------------
@@ -33,10 +32,6 @@
 # ECBUILD_NO_COLOUR : bool
 #   if set, does not colour log output (by default log output is coloured)
 #
-# ECBUILD_NO_DEPRECATIONS : bool
-#   if set, does not output deprecation messages (only set this if you *really*
-#   know what you are doing!)
-#
 # Usage
 # -----
 #
@@ -75,7 +70,7 @@ set(ECBUILD_ERROR    40)
 set(ECBUILD_CRITICAL 50)
 
 if( NOT DEFINED ECBUILD_LOG_LEVEL )
-  set(ECBUILD_LOG_LEVEL ${ECBUILD_INFO})
+  set(ECBUILD_LOG_LEVEL ${ECBUILD_WARN})
 elseif( NOT ECBUILD_LOG_LEVEL )
   set(ECBUILD_LOG_LEVEL 60)
 elseif( ECBUILD_LOG_LEVEL STREQUAL "DEBUG" )
@@ -127,81 +122,8 @@ endmacro( ecbuild_error )
 
 ##############################################################################
 
-macro( ecbuild_deprecate )
-  if( NOT ECBUILD_NO_DEPRECATIONS )
-    string(REPLACE ";" "" MSG ${ARGV})
-    message(DEPRECATION "${BoldRed}${MSG}${ColourReset}")
-  endif()
-endmacro( ecbuild_deprecate )
-
-##############################################################################
-
 macro( ecbuild_critical MSG )
   if( ECBUILD_LOG_LEVEL LESS 51)
     message(FATAL_ERROR "${BoldMagenta}CRITICAL - ${MSG}${ColourReset}")
   endif()
 endmacro( ecbuild_critical )
-
-##############################################################################
-# macro for debugging a cmake variable
-
-macro( ecbuild_debug_var VAR )
-  if( ECBUILD_LOG_LEVEL LESS 11)
-    message(STATUS "${Blue}DEBUG - ${VAR} : ${${VAR}}${ColourReset}")
-  endif()
-endmacro()
-
-##############################################################################
-# macro for debugging a cmake variable
-
-macro( ecbuild_debug_list VAR )
-  if( ECBUILD_LOG_LEVEL LESS 11)
-    message( STATUS "${Blue}DEBUG - ${VAR}" )
-    foreach( _elem ${${VAR}} )
-      message( STATUS "  ${_elem}" )
-    endforeach()
-    message(STATUS "${ColourReset}")
-  endif()
-endmacro()
-
-##############################################################################
-# macro for debugging a environment variable within cmake
-
-macro( ecbuild_debug_env_var VAR )
-  if( ECBUILD_LOG_LEVEL LESS 11)
-    message(STATUS "${Blue}DEBUG - ENV ${VAR} [$ENV{${VAR}}]${ColourReset}")
-  endif()
-endmacro()
-
-##############################################################################
-# macro for debugging a cmake variable
-
-macro( debug_var VAR )
-
-    message( WARNING "DEPRECATED debug_var() -- ${VAR} [${${VAR}}]" )
-
-endmacro()
-
-##############################################################################
-# macro for debugging a cmake list
-
-macro( debug_list VAR )
-
-    message( WARNING "DEPRECATED debug_list() -- ${VAR}:" )
-    foreach( _elem ${${VAR}} )
-      message( WARNING "  ${_elem}" )
-    endforeach()
-
-endmacro()
-
-##############################################################################
-# macro for debugging a environment variable within cmake
-
-macro( debug_env_var VAR )
-
-    message( WARNING "DEPRECATED debug_env_var() -- ENV ${VAR} [$ENV{${VAR}}]" )
-
-endmacro()
-
-
-
diff --git a/cmake/ecbuild_pkgconfig.cmake b/cmake/ecbuild_pkgconfig.cmake
index 744727e..6db3726 100644
--- a/cmake/ecbuild_pkgconfig.cmake
+++ b/cmake/ecbuild_pkgconfig.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
diff --git a/cmake/ecbuild_policies.cmake b/cmake/ecbuild_policies.cmake
index 36ab7fe..06f856b 100644
--- a/cmake/ecbuild_policies.cmake
+++ b/cmake/ecbuild_policies.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -6,17 +6,13 @@
 # granted to it by virtue of its status as an intergovernmental organisation
 # nor does it submit to any jurisdiction.
 
-##############################################################################
-#
-# ecBuild Policies
-# ================
+###############################################################################
+# define cmake policies
 #
 # NOTE: This file needs to be included with NO_POLICY_SCOPE or it will have no
 #       effect!
 # NOTE: Policies 1 through 17 will be set to NEW by requiring CMake 2.8.4 i.e.
 #       calling cmake_minimum_required( VERSION 2.8.4 FATAL_ERROR )
-#
-##############################################################################
 
 # allow for empty spaces around library names 
 if( POLICY CMP0004 )
diff --git a/cmake/ecbuild_print_summary.cmake b/cmake/ecbuild_print_summary.cmake
index 83f4f9c..d4bffba 100644
--- a/cmake/ecbuild_print_summary.cmake
+++ b/cmake/ecbuild_print_summary.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -38,6 +38,8 @@ macro( ecbuild_print_summary )
 
   if( PROJECT_NAME STREQUAL CMAKE_PROJECT_NAME )
 
+    ecbuild_define_links_target()
+
     get_property( langs GLOBAL PROPERTY ENABLED_LANGUAGES )
 
     message( STATUS "---------------------------------------------------------" )
@@ -87,7 +89,7 @@ macro( ecbuild_print_summary )
 
     ### FEATURE SUMMARY
 
-    # ecbuild_debug_var( CMAKE_VERSION )
+    # debug_var( CMAKE_VERSION )
     if( ${CMAKE_VERSION} VERSION_LESS "2.8.6" )
       feature_summary( WHAT ALL )
     else()
@@ -99,6 +101,6 @@ macro( ecbuild_print_summary )
     # issue warnings / errors in case there are unused project files
     ecbuild_warn_unused_files()
 
-  endif()
+  endif( PROJECT_NAME STREQUAL CMAKE_PROJECT_NAME )
 
 endmacro( ecbuild_print_summary )
diff --git a/cmake/ecbuild_project_files.cmake b/cmake/ecbuild_project_files.cmake
index 7e3789b..fbf3015 100644
--- a/cmake/ecbuild_project_files.cmake
+++ b/cmake/ecbuild_project_files.cmake
@@ -1,8 +1,8 @@
-# (C) Copyright 1996-2016 ECMWF.
-#
+# (C) Copyright 1996-2015 ECMWF.
+# 
 # This software is licensed under the terms of the Apache Licence Version 2.0
-# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-# In applying this licence, ECMWF does not waive the privileges and immunities
+# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
+# In applying this licence, ECMWF does not waive the privileges and immunities 
 # granted to it by virtue of its status as an intergovernmental organisation nor
 # does it submit to any jurisdiction.
 
@@ -50,7 +50,7 @@ macro( ecbuild_declare_project_files )
   if( CHECK_UNUSED_FILES )
     foreach( _afile ${ARGV} )
 
-      # ecbuild_debug_var( _afile )
+      # debug_var( _afile )
 
       get_property( _src_gen SOURCE ${_afile} PROPERTY GENERATED )
 
diff --git a/cmake/ecbuild_remove_fortran_flags.cmake b/cmake/ecbuild_remove_fortran_flags.cmake
deleted file mode 100644
index 74c8832..0000000
--- a/cmake/ecbuild_remove_fortran_flags.cmake
+++ /dev/null
@@ -1,61 +0,0 @@
-# (C) Copyright 1996-2016 ECMWF.
-#
-# This software is licensed under the terms of the Apache Licence Version 2.0
-# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-# In applying this licence, ECMWF does not waive the privileges and immunities
-# granted to it by virtue of its status as an intergovernmental organisation
-# nor does it submit to any jurisdiction.
-
-##############################################################################
-#.rst:
-#
-# ecbuild_remove_fortran_flags
-# =========================
-#
-# Remove Fortran compiler flags from CMAKE_Fortran_FLAGS. ::
-#
-#   ecbuild_remove_fortran_flags( <flag1> [ <flag2> ... ] [ BUILD <build> ] )
-#
-# Options
-# -------
-#
-# BUILD : optional
-#   remove flags from ``CMAKE_Fortran_FLAGS_<build>`` instead of
-#   ``CMAKE_Fortran_FLAGS``
-#
-##############################################################################
-
-include( CheckFortranCompilerFlag )
-macro( ecbuild_remove_fortran_flags m_flags )
-
-  set( _flags ${m_flags} )
-  if( _flags AND CMAKE_Fortran_COMPILER_LOADED )
-
-    set( single_value_args BUILD )
-    set( multi_value_args )
-    cmake_parse_arguments( _PAR "" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
-
-    string( TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_CAPS )
-    string( TOUPPER ${_PAR_BUILD} _PAR_BUILD_CAPS )
-
-    if( _PAR_BUILD AND (CMAKE_BUILD_TYPE_CAPS MATCHES "${_PAR_BUILD_CAPS}") )
-
-      foreach( _flag ${_flags} )
-        string(REGEX REPLACE " *${_flag} *" " " CMAKE_Fortran_FLAGS_${_PAR_BUILD} ${CMAKE_Fortran_FLAGS_${_PAR_BUILD}})
-        ecbuild_debug( "Fortran FLAG [${_flag}] removed from build type ${_PAR_BUILD}" )
-      endforeach()
-
-    elseif( NOT _PAR_BUILD )
-
-      foreach( _flag ${_flags} )
-        string(REGEX REPLACE " *${_flag} *" " " CMAKE_Fortran_FLAGS ${CMAKE_Fortran_FLAGS} )
-        ecbuild_debug( "Fortran FLAG [${_flag}] removed" )
-      endforeach()
-
-    endif()
-
-  endif()
-  unset( _flags )
-
-endmacro()
-
diff --git a/cmake/ecbuild_requires_macro_version.cmake b/cmake/ecbuild_requires_macro_version.cmake
index e395ff0..ef13d64 100644
--- a/cmake/ecbuild_requires_macro_version.cmake
+++ b/cmake/ecbuild_requires_macro_version.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
diff --git a/cmake/ecbuild_separate_sources.cmake b/cmake/ecbuild_separate_sources.cmake
index a0a1c9b..55c6d8f 100644
--- a/cmake/ecbuild_separate_sources.cmake
+++ b/cmake/ecbuild_separate_sources.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -83,9 +83,9 @@ macro( ecbuild_separate_sources )
 		endif()
 	endforeach()
 
-#    ecbuild_debug_var( ${_PAR_TARGET}_h_srcs )
-#    ecbuild_debug_var( ${_PAR_TARGET}_c_srcs )
-#    ecbuild_debug_var( ${_PAR_TARGET}_cxx_srcs )
-#    ecbuild_debug_var( ${_PAR_TARGET}_f_srcs )
+#    debug_var( ${_PAR_TARGET}_h_srcs )
+#    debug_var( ${_PAR_TARGET}_c_srcs )
+#    debug_var( ${_PAR_TARGET}_cxx_srcs )
+#    debug_var( ${_PAR_TARGET}_f_srcs )
 
 endmacro( ecbuild_separate_sources  )
diff --git a/cmake/ecbuild_setup_test_framework.cmake b/cmake/ecbuild_setup_test_framework.cmake
index f38bafb..538a433 100644
--- a/cmake/ecbuild_setup_test_framework.cmake
+++ b/cmake/ecbuild_setup_test_framework.cmake
@@ -2,7 +2,7 @@ ecbuild_add_option( FEATURE TESTS
                     DEFAULT ON
                     DESCRIPTION "Enable the unit tests" )
 
-if( ENABLE_TESTS AND CMAKE_CXX_COMPILER_LOADED )
+if( ENABLE_TESTS )
 
   # Try to find compiled boost
 
@@ -39,7 +39,3 @@ if( ENABLE_TESTS AND CMAKE_CXX_COMPILER_LOADED )
   endif()
 
 endif()
-
-if( NOT ENABLE_TESTS )
-  ecbuild_info("Tests have been disabled")
-endif()
\ No newline at end of file
diff --git a/cmake/ecbuild_source_flags.cmake b/cmake/ecbuild_source_flags.cmake
deleted file mode 100644
index 2414765..0000000
--- a/cmake/ecbuild_source_flags.cmake
+++ /dev/null
@@ -1,30 +0,0 @@
-# (C) Copyright 1996-2016 ECMWF.
-#
-# This software is licensed under the terms of the Apache Licence Version 2.0
-# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-# In applying this licence, ECMWF does not waive the privileges and immunities
-# granted to it by virtue of its status as an intergovernmental organisation
-# nor does it submit to any jurisdiction.
-
-set( __gen_source_flags ${CMAKE_CURRENT_LIST_DIR}/gen_source_flags.py )
-
-# Calls gen_source_flags.py to generate a CMake file with the per
-# source file flags for a given target.
-function( ecbuild_source_flags OUT TARGET DEFAULT_FLAGS SOURCES )
-
-  if( NOT PYTHONINTERP_FOUND OR PYTHON_VERSION VERSION_LESS 2.7 )
-    find_package( PythonInterp 2.7 REQUIRED )
-  endif()
-
-  set( OUTFILE ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_source_flags.cmake )
-
-  if( ECBUILD_LOG_LEVEL LESS 11)
-    set( __debug "--debug" )
-  endif()
-  execute_process( COMMAND ${PYTHON_EXECUTABLE} ${__gen_source_flags}
-                           ${ECBUILD_SOURCE_FLAGS} ${OUTFILE} "${DEFAULT_FLAGS}"
-                           ${SOURCES} "${__debug}" )
-
-  set( ${OUT} ${OUTFILE} PARENT_SCOPE )
-
-endfunction()
diff --git a/cmake/ecbuild_system.cmake b/cmake/ecbuild_system.cmake
index 64f6fad..ca4f4fa 100644
--- a/cmake/ecbuild_system.cmake
+++ b/cmake/ecbuild_system.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -28,7 +28,7 @@ endif()
 ########################################################################################################
 # ecbuild versioning support
 
-set( ECBUILD_CMAKE_MINIMUM "2.8.10" )
+set( ECBUILD_CMAKE_MINIMUM "2.8.4" )
 if( ${CMAKE_VERSION} VERSION_LESS ${ECBUILD_CMAKE_MINIMUM} )
     message(FATAL_ERROR "${PROJECT_NAME} requires at least CMake ${ECBUILD_CMAKE_MINIMUM} -- you are using ${CMAKE_COMMAND} [${CMAKE_VERSION}]\n Please, get a newer version of CMake @ www.cmake.org" )
 endif()
@@ -66,10 +66,6 @@ if( PROJECT_NAME STREQUAL CMAKE_PROJECT_NAME )
     message( STATUS "toolchain ${CMAKE_TOOLCHAIN_FILE}" )
     endif()
 
-    if( ECBUILD_CONFIG )
-    message( STATUS "config    ${ECBUILD_CONFIG}" )
-    endif()
-
     if( ECBUILD_CACHE )
     include( ${ECBUILD_CACHE} )
       message( STATUS "cache     ${ECBUILD_CACHE}" )
@@ -97,7 +93,7 @@ if( PROJECT_NAME STREQUAL CMAKE_PROJECT_NAME )
     enable_testing()
 
     # keep this until we modify the meaning to 'check' if installation worked
-    add_custom_target( check COMMAND ${CMAKE_CTEST_COMMAND} )
+    add_custom_target( check COMMAND ${CMAKE_CTEST_COMMAND} -V )
 
     ############################################################################################
     # define valid build types
@@ -125,19 +121,19 @@ if( PROJECT_NAME STREQUAL CMAKE_PROJECT_NAME )
     # include(CMakePrintSystemInformation) # available in cmake 2.8.4
 
     if( CMAKE_CXX_COMPILER_LOADED )
-        include(CheckIncludeFileCXX)
-        include(CheckCXXCompilerFlag)
-        include(CheckCXXSourceCompiles)
-        include(CheckCXXSourceRuns)
+    include(CheckIncludeFileCXX)
+    include(CheckCXXCompilerFlag)
+    include(CheckCXXSourceCompiles)
+    include(CheckCXXSourceRuns)
     endif()
 
     if( CMAKE_Fortran_COMPILER_LOADED )
         set( CMAKE_Fortran_MODULE_DIRECTORY  ${CMAKE_BINARY_DIR}/module CACHE PATH "directory for all fortran modules." )
-        include(CheckFortranFunctionExists)
-        if( CMAKE_C_COMPILER_LOADED AND ENABLE_FORTRAN_C_INTERFACE )
-            include(FortranCInterface)
-        endif()
-        set( EC_HAVE_FORTRAN 1 )
+    include(CheckFortranFunctionExists)
+    if( CMAKE_C_COMPILER_LOADED AND ENABLE_FORTRAN_C_INTERFACE )
+    include(FortranCInterface)
+    endif()
+    set( EC_HAVE_FORTRAN 1 )
     endif()
 
     include(FeatureSummary) # support features in cmake
@@ -148,18 +144,17 @@ if( PROJECT_NAME STREQUAL CMAKE_PROJECT_NAME )
     # backport of cmake > 2.8.4 functions
 
     if( "${CMAKE_VERSION}" VERSION_LESS "2.8.6" )
-        include( ${CMAKE_CURRENT_LIST_DIR}/2.8/CMakePushCheckState.cmake )
+    include( ${CMAKE_CURRENT_LIST_DIR}/2.8/CMakePushCheckState.cmake )
     else()
-        include(CMakePushCheckState)
+    include(CMakePushCheckState)
     endif()
 
     ############################################################################################
     # add our macros
 
+    include( ecbuild_debug_var )
     include( ecbuild_log )
     include( ecbuild_list_macros )
-    include( ecbuild_list_add_pattern )
-    include( ecbuild_list_exclude_pattern )
 
     include( ecbuild_check_c_source_return )
     include( ecbuild_check_cxx_source_return )
@@ -172,7 +167,6 @@ if( PROJECT_NAME STREQUAL CMAKE_PROJECT_NAME )
     include( ecbuild_generate_config_headers )
     include( ecbuild_generate_rpc )
     include( ecbuild_generate_yy )
-    include( ecbuild_generate_fortran_interfaces )
     include( ecbuild_echo_targets )
     include( ecbuild_features )
     include( ecbuild_add_option )
@@ -208,38 +202,30 @@ if( PROJECT_NAME STREQUAL CMAKE_PROJECT_NAME )
     include( ecbuild_find_fortranlibs )
     include( ecbuild_git )
     include( ecbuild_enable_fortran )
-    include( ecbuild_source_flags )
     include( ecbuild_bundle )
     include( ecbuild_pkgconfig )
     include( ecbuild_cache )
-    include( ecbuild_remove_fortran_flags )
 
     include( ${CMAKE_CURRENT_LIST_DIR}/contrib/GetGitRevisionDescription.cmake )
 
     ############################################################################################
     # kickstart the build system
 
-    if( ECBUILD_CONFIG )
-      include( ${ECBUILD_CONFIG} )
-    endif()
-
-    ecbuild_prepare_cache()
+      ecbuild_prepare_cache()
 
     include( ecbuild_define_options )               # define build options
-    include( ecbuild_compiler_flags )               # compiler flags
     include( ecbuild_check_compiler )               # check for compiler characteristics
     include( ecbuild_check_os )                     # check for os characteristics
     include( ecbuild_check_functions )              # check for available functions
-    include( ecbuild_define_paths )                 # defines installation paths
-    include( ecbuild_define_libs_and_execs_target ) # defines the top level execs and libs
-    include( ecbuild_define_links_target )          # defines the links target
+    include( ecbuild_define_paths )                 # define installation paths
+    include( ecbuild_links_target )                 # define the links target
     include( ecbuild_setup_test_framework )         # setup test framework
     include( ecbuild_define_uninstall )             # define uninstall target
 
     ecbuild_flush_cache()
 
     ############################################################################################
-    # define the build timestamp, unless the user provided one via EC_BUILD_TIMESTAMP
+    # define the build timestamp
 
     if( NOT DEFINED EC_BUILD_TIMESTAMP )
         ecbuild_get_timestamp( EC_BUILD_TIMESTAMP )
@@ -248,17 +234,5 @@ if( PROJECT_NAME STREQUAL CMAKE_PROJECT_NAME )
 
     message( STATUS "---------------------------------------------------------" )
 
-else()
-
-    # Allow subprojects with different compilation flags. This could be done by defining
-    #     set( ECBUILD_C_FLAGS_DEBUG "-O0" )
-    # or
-    #     set( ECBUILD_CONFIG "<subproject-config>.cmake" )
-    if( ECBUILD_CONFIG )
-        message( STATUS "---------------------------------------------------------" )
-        message( STATUS "config    ${ECBUILD_CONFIG}" )
-        include( ${ECBUILD_CONFIG} )
-    endif()
-    include( ecbuild_compiler_flags )
-
 endif()
+
diff --git a/cmake/ecbuild_use_package.cmake b/cmake/ecbuild_use_package.cmake
index 04dd27c..acbe495 100644
--- a/cmake/ecbuild_use_package.cmake
+++ b/cmake/ecbuild_use_package.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 #
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
@@ -105,7 +105,6 @@ macro( ecbuild_use_package )
   # user defined dir with subprojects
 
   if( NOT DEFINED ${pkgUPPER}_SOURCE AND DEFINED SUBPROJECT_DIRS )
-    ecbuild_warn("ecbuild_use_package(): setting SUBPROJECT_DIRS is deprecated")
     ecbuild_debug("ecbuild_use_package(${_p_PROJECT}): scanning subproject directories ${SUBPROJECT_DIRS}")
     foreach( dir ${SUBPROJECT_DIRS} )
       if( EXISTS ${dir}/${_p_PROJECT} AND EXISTS ${dir}/${_p_PROJECT}/CMakeLists.txt )
@@ -120,7 +119,7 @@ macro( ecbuild_use_package )
   if( DEFINED ${pkgUPPER}_SOURCE )
 
     if( NOT EXISTS ${${pkgUPPER}_SOURCE} OR NOT EXISTS ${${pkgUPPER}_SOURCE}/CMakeLists.txt )
-      ecbuild_critical("User defined source directory '${${pkgUPPER}_SOURCE}' for project '${_p_PROJECT}' does not exist or does not contain a CMakeLists.txt file.")
+      message( FATAL_ERROR "User defined source directory '${${pkgUPPER}_SOURCE}' for project '${_p_PROJECT}' does not exist or does not contain a CMakeLists.txt file." )
     endif()
 
     set( ${pkgUPPER}_subproj_dir_ "${${pkgUPPER}_SOURCE}" )
@@ -188,8 +187,6 @@ macro( ecbuild_use_package )
       set( ${pkgUPPER}_FOUND 1 )
       set( ${_p_PROJECT}_VERSION ${${pkgUPPER}_VERSION} )
 
-      list( APPEND ${pkgUPPER}_INCLUDE_DIRS ${${pkgUPPER}_TPL_INCLUDE_DIRS} )
-
     endif()
 
   endif()
@@ -224,15 +221,15 @@ macro( ecbuild_use_package )
 
   # test version for Cases 1,2,3
 
-  # ecbuild_debug_var( _p_PROJECT )
-  # ecbuild_debug_var( _p_VERSION )
-  # ecbuild_debug_var( ${pkgUPPER}_VERSION )
-  # ecbuild_debug_var( ${_p_PROJECT}_VERSION )
-  # ecbuild_debug_var( _just_added )
-  # ecbuild_debug_var( _do_version_check )
-  # ecbuild_debug_var( _source_description )
-  # ecbuild_debug_var( ${pkgUPPER}_FOUND )
-  # ecbuild_debug_var( ${pkgUPPER}_previous_subproj_ )
+  # debug_var( _p_PROJECT )
+  # debug_var( _p_VERSION )
+  # debug_var( ${pkgUPPER}_VERSION )
+  # debug_var( ${_p_PROJECT}_VERSION )
+  # debug_var( _just_added )
+  # debug_var( _do_version_check )
+  # debug_var( _source_description )
+  # debug_var( ${pkgUPPER}_FOUND )
+  # debug_var( ${pkgUPPER}_previous_subproj_ )
 
   if( _p_VERSION AND _do_version_check )
     if( _p_EXACT )
diff --git a/cmake/ecbuild_version.h.in b/cmake/ecbuild_version.h.in
index 70c5f0a..3ed96ce 100644
--- a/cmake/ecbuild_version.h.in
+++ b/cmake/ecbuild_version.h.in
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 1996-2016 ECMWF.
+ * (C) Copyright 1996-2015 ECMWF.
  *
  * This software is licensed under the terms of the Apache Licence Version 2.0
  * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
diff --git a/cmake/ecbuild_warn_unused_files.cmake b/cmake/ecbuild_warn_unused_files.cmake
index f983440..084adb3 100644
--- a/cmake/ecbuild_warn_unused_files.cmake
+++ b/cmake/ecbuild_warn_unused_files.cmake
@@ -1,4 +1,4 @@
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 # 
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
diff --git a/cmake/gen_source_flags.py b/cmake/gen_source_flags.py
deleted file mode 100644
index b976d31..0000000
--- a/cmake/gen_source_flags.py
+++ /dev/null
@@ -1,84 +0,0 @@
-# (C) Copyright 1996-2016 ECMWF.
-#
-# This software is licensed under the terms of the Apache Licence Version 2.0
-# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
-# In applying this licence, ECMWF does not waive the privileges and immunities
-# granted to it by virtue of its status as an intergovernmental organisation
-# nor does it submit to any jurisdiction.
-
-"""
-Generate .cmake file to set source-file specific compiler flags based on
-rules defined in a JSON file.
-"""
-
-from argparse import ArgumentParser
-from fnmatch import fnmatch
-import logging
-from json import JSONDecoder
-from os import path
-
-log = logging.getLogger('gen_source_flags')
-
-
-def match(source, pattern, op, flags, indent=0):
-    if fnmatch(source, pattern):
-
-        suff = '' if op[0] in ('+', '=', '/') else ' (nested pattern)'
-        log.debug('%s-> pattern "%s" matches "%s"%s',
-                  ' ' * (indent + 1), pattern, source, suff)
-
-        if op[0] == "+":
-            flags += [flag for flag in op[1:] if flag not in flags]
-            log.debug('%sappending %s --> flags: %s', ' ' * (indent + 2), op[1:], flags)
-
-        elif op[0] == "=":
-            flags = op[1:]
-            log.debug('%ssetting %s --> flags: %s', ' ' * (indent + 2), op[1:], flags)
-
-        elif op[0] == "/":
-            flags = [flag for flag in flags if flag not in op[1:]]
-            log.debug('%sremoving %s --> flags: %s', ' ' * (indent + 2), op[1:], flags)
-
-        else:  # Nested rule
-            log.debug('%sapplying nested rules for "%s" (flags: %s)',
-                      ' ' * (indent + 2), pattern, flags)
-            for nested_pattern, nested_op in op:
-                flags = match(source, nested_pattern, nested_op, flags, indent + 2)
-
-    return flags
-
-
-def generate(rules, out, default_flags, sources, debug=False):
-    logging.basicConfig(level=logging.DEBUG if debug else logging.INFO,
-                        format='-- %(levelname)s - %(name)s: %(message)s')
-
-    with open(path.expanduser(rules)) as f:
-        rules = JSONDecoder(object_pairs_hook=list).decode(f.read())
-
-    with open(path.expanduser(out), 'w') as f:
-        for source in sources:
-            log.debug('%s (default flags: "%s")', source, default_flags)
-            flags = default_flags.split()
-            for pattern, op in rules:
-                flags = match(source, pattern, op, flags)
-
-            if flags:
-                log.debug(' ==> setting flags for %s to %s', source, ' '.join(flags))
-                f.write('set_source_files_properties(%s PROPERTIES COMPILE_FLAGS "%s")\n'
-                        % (source, ' '.join(flags)))
-            else:
-                log.debug(' ==> flags for %s empty', source)
-
-
-def main():
-    """Parse arguments"""
-    parser = ArgumentParser(description=__doc__)
-    parser.add_argument('rules', metavar='RULES.json', help='JSON rules file')
-    parser.add_argument('out', metavar='OUT.cmake', help='CMake script to generate')
-    parser.add_argument('default_flags', help='Default compiler flags to use')
-    parser.add_argument('sources', metavar='file', nargs='+', help='Path to file to apply rules to')
-    parser.add_argument('--debug', '-d', action='store_true', help='Log debug messages')
-    generate(**vars(parser.parse_args()))
-
-if __name__ == '__main__':
-    main()
diff --git a/cmake/include/ecbuild/boost_test_framework.h b/cmake/include/ecbuild/boost_test_framework.h
index f593b70..8cbd8e9 100644
--- a/cmake/include/ecbuild/boost_test_framework.h
+++ b/cmake/include/ecbuild/boost_test_framework.h
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 1996-2016 ECMWF.
+ * (C) Copyright 1996-2015 ECMWF.
  *
  * This software is licensed under the terms of the Apache Licence Version 2.0
  * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
diff --git a/cmake/project-config.cmake.in b/cmake/project-config.cmake.in
index 6d48728..03f875b 100644
--- a/cmake/project-config.cmake.in
+++ b/cmake/project-config.cmake.in
@@ -1,13 +1,11 @@
 # Config file for the @PROJECT_NAME@ package
 # Defines the following variables:
 #
-#  @PNAME at _INCLUDE_DIRS   - include directories
-#  @PNAME at _DEFINITIONS    - preprocessor definitions
-#  @PNAME at _LIBRARIES      - libraries to link against
-#  @PNAME at _FEATURES       - list of enabled features
-#  @PNAME at _VERSION        - version of the package
-#  @PNAME at _GIT_SHA1       - Git revision of the package
-#  @PNAME at _GIT_SHA1_SHORT - short Git revision of the package
+#  @PNAME at _INCLUDE_DIRS - include directories
+#  @PNAME at _DEFINITIONS  - preprocessor definitions
+#  @PNAME at _LIBRARIES    - libraries to link against
+#  @PNAME at _FEATURES     - list of enabled features
+#  @PNAME at _VERSION      - version of the package
 #
 # Also defines @PROJECT_NAME@ third-party library dependencies:
 #  @PNAME at _TPLS             - package names of  third-party library dependencies
@@ -28,16 +26,12 @@ set( @PNAME at _TPL_INCLUDE_DIRS  "@CONF_TPL_INCLUDE_DIRS@" )
 set( @PNAME at _TPL_DEFINITIONS   "@CONF_TPL_DEFINITIONS@" )
 set( @PNAME at _TPL_LIBRARIES     "@CONF_TPL_LIBRARIES@" )
 
-set( @PNAME at _VERSION           "@PACKAGE_VERSION@" )
-set( @PNAME at _GIT_SHA1          "@PACKAGE_GIT_SHA1@" )
-set( @PNAME at _GIT_SHA1_SHORT    "@PACKAGE_GIT_SHA1_SHORT@" )
-
 ### export include paths as absolute paths
 
 set( @PNAME at _INCLUDE_DIRS "" )
 foreach( path ${@PNAME at _SELF_INCLUDE_DIRS} )
-  get_filename_component( abspath ${path} ABSOLUTE )
-  list( APPEND @PNAME at _INCLUDE_DIRS ${abspath} )
+	get_filename_component( abspath ${path} ABSOLUTE )
+	list( APPEND @PNAME at _INCLUDE_DIRS ${abspath} )
 endforeach()
 list( APPEND @PNAME at _INCLUDE_DIRS ${@PNAME at _TPL_INCLUDE_DIRS} )
 
@@ -53,7 +47,7 @@ set( @PNAME at _LIBRARIES        ${@PNAME at _SELF_LIBRARIES}   ${@PNAME at _TPL_LIBRARIE
 
 set( @PNAME at _FEATURES    "@CONF_FEATURES@" )
 foreach( _f ${@PNAME at _FEATURES} )
-  set( @PNAME at _HAVE_${_f} 1 )
+	set( @PNAME at _HAVE_${_f} 1 )
 endforeach()
 
 # Has this configuration been exported from a build tree?
@@ -64,22 +58,22 @@ if( EXISTS ${@PNAME at _CMAKE_DIR}/@CONF_IMPORT_FILE@ )
   include( ${@PNAME at _IMPORT_FILE} )
 endif()
 
-# here goes the imports of the TPL's
-
-include( ${CMAKE_CURRENT_LIST_FILE}.tpls OPTIONAL )
-
 # insert definitions for IMPORTED targets
 
 if( NOT @PROJECT_NAME at _BINARY_DIR )
 
   if( @PNAME at _IS_BUILD_DIR_EXPORT )
-    include( "@TOP_PROJECT_TARGETS_FILE@" OPTIONAL )
-  else()
-    include( "${@PNAME at _CMAKE_DIR}/@PROJECT_NAME at -targets.cmake" )
-  endif()
+		include( "@TOP_PROJECT_TARGETS_FILE@" OPTIONAL )
+	else()
+		include( "${@PNAME at _CMAKE_DIR}/@CMAKE_PROJECT_NAME at -targets.cmake" )
+	endif()
 
 endif()
 
+# here goes the imports of the TPL's
+
+include( ${CMAKE_CURRENT_LIST_FILE}.tpls OPTIONAL )
+
 # publish this file as imported
 
 set( @PNAME at _IMPORT_FILE ${CMAKE_CURRENT_LIST_FILE} )
@@ -88,10 +82,9 @@ mark_as_advanced( @PNAME at _IMPORT_FILE )
 # set @PROJECT_NAME at _BASE_DIR for final installations or build directories
 
 if( NOT @PROJECT_NAME@ )
-  if( @PNAME at _IS_BUILD_DIR_EXPORT )
-    set( @PROJECT_NAME at _BASE_DIR @CMAKE_BINARY_DIR@ )
-  else()
-    get_filename_component( abspath ${CMAKE_CURRENT_LIST_DIR}/../../.. ABSOLUTE )
-    set( @PROJECT_NAME at _BASE_DIR ${abspath} )
-  endif()
+	if( @PNAME at _IS_BUILD_DIR_EXPORT )
+		set( @PROJECT_NAME at _BASE_DIR @CMAKE_BINARY_DIR@ )
+	else()
+		set( @PROJECT_NAME at _BASE_DIR @CMAKE_INSTALL_PREFIX@ )
+	endif()
 endif()
diff --git a/cmake/sg.pl b/cmake/sg.pl
old mode 100644
new mode 100755
index 6bce843..8a64bf4
--- a/cmake/sg.pl
+++ b/cmake/sg.pl
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 #!/usr/local/share/perl56
 
-# (C) Copyright 1996-2016 ECMWF.
+# (C) Copyright 1996-2015 ECMWF.
 # 
 # This software is licensed under the terms of the Apache Licence Version 2.0
 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. 
diff --git a/fc_type.grib b/fc_type.grib
new file mode 100755
index 0000000..f794995
Binary files /dev/null and b/fc_type.grib differ
diff --git a/python/Magics/CMakeLists.txt b/python/Magics/CMakeLists.txt
index 858d540..9769ea4 100644
--- a/python/Magics/CMakeLists.txt
+++ b/python/Magics/CMakeLists.txt
@@ -2,12 +2,12 @@ if( HAVE_PYTHON )
 
   ### python destination
 
-  set( PYTHON_SITE "lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages" )
+  set( PYTHON_SITE "${INSTALL_LIB_DIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages" )
   set( PYTHON_DEST "${PYTHON_SITE}/Magics" )
 
   file( RELATIVE_PATH relative_rpath "${CMAKE_INSTALL_PREFIX}/${PYTHON_DEST}" "${${PNAME}_FULL_INSTALL_LIB_DIR}" )
 
-  debug_var( relative_rpath )
+  #debug_var( relative_rpath )
 
   # See comment below, where the following lines are overriden
   ecbuild_append_to_rpath( ${relative_rpath} )
diff --git a/share/ecbuild/toolchains/ecmwf-XC30-Cray.cmake b/share/ecbuild/toolchains/ecmwf-XC30-Cray.cmake
index db045ee..1e12d66 100644
--- a/share/ecbuild/toolchains/ecmwf-XC30-Cray.cmake
+++ b/share/ecbuild/toolchains/ecmwf-XC30-Cray.cmake
@@ -1,9 +1,4 @@
 ####################################################################
-# ARCHITECTURE
-####################################################################
-set( CMAKE_SIZEOF_VOID_P 8 )
-
-####################################################################
 # COMPILER
 ####################################################################
 
@@ -13,11 +8,15 @@ CMAKE_FORCE_C_COMPILER       ( cc  Cray )
 CMAKE_FORCE_CXX_COMPILER     ( CC  Cray )
 CMAKE_FORCE_Fortran_COMPILER ( ftn Cray )
 
+link_libraries("$ENV{CC_X86_64}/lib/x86-64/libcray-c++-rts.so")
+link_libraries("-lmpichf90_cray")
+link_libraries("-lmpichcxx_cray")
+
 set( ECBUILD_FIND_MPI OFF )
 set( ECBUILD_TRUST_FLAGS ON )
 
 ####################################################################
-# OpenMP FLAGS
+# FLAGS COMMON TO ALL BUILD TYPES
 ####################################################################
 
 set( OMP_C_FLAGS             "-homp" )
@@ -28,12 +27,49 @@ set( OMPSTUBS_C_FLAGS        "-hnoomp" )
 set( OMPSTUBS_CXX_FLAGS      "-hnoomp" )
 set( OMPSTUBS_Fortran_FLAGS  "-hnoomp" )
 
+set( CMAKE_C_FLAGS       "" CACHE STRING "" FORCE )
+set( CMAKE_CXX_FLAGS     "" CACHE STRING "" FORCE )
+set( CMAKE_Fortran_FLAGS "-emf -rmoid" CACHE STRING "" FORCE )   # -emf activates .mods and uses lower case -rmoid produces a listing file
+
+####################################################################
+# RELEASE FLAGS
+####################################################################
+
+set( ECBUILD_C_FLAGS_RELEASE       "-O3 -hfp3 -hscalar3 -hvector3 -DNDEBUG" )
+set( ECBUILD_CXX_FLAGS_RELEASE     "-O3 -hfp3 -hscalar3 -hvector3 -DNDEBUG" )
+set( ECBUILD_Fortran_FLAGS_RELEASE "-O3 -hfp3 -hscalar3 -hvector3 -DNDEBUG" )
+
+####################################################################
+# BIT REPRODUCIBLE FLAGS
+####################################################################
+
+set( ECBUILD_C_FLAGS_BIT        "-O1 -G2 -hflex_mp=conservative -hadd_paren -hfp1 -DNDEBUG" )
+set( ECBUILD_CXX_FLAGS_BIT      "-O1 -G2 -hflex_mp=conservative -hadd_paren -hfp1 -DNDEBUG" )
+set( ECBUILD_Fortran_FLAGS_BIT  "-O1 -G2 -hflex_mp=conservative -hadd_paren -hfp1 -DNDEBUG" )
+
+####################################################################
+# RELWITHDEBINFO FLAGS
+####################################################################
+
+set( ECBUILD_C_FLAGS_RELWITHDEBINFO        "-O2 -hfp1 -Gfast -DNDEBUG" )
+set( ECBUILD_CXX_FLAGS_RELWITHDEBINFO      "-O2 -hfp1 -Gfast -DNDEBUG" )
+set( ECBUILD_Fortran_FLAGS_RELWITHDEBINFO  "-O2 -hfp1 -Gfast -DNDEBUG" )
+
 ####################################################################
-# Fortran FLAGS
+# DEBUG FLAGS
 ####################################################################
 
-# -emf activates .mods and uses lower case -rmoid produces a listing file
-set( ECBUILD_Fortran_FLAGS   "-emf -rmoid" )
+set( ECBUILD_C_FLAGS_DEBUG        "-O0 -G0" )
+set( ECBUILD_CXX_FLAGS_DEBUG      "-O0 -G0" )
+set( ECBUILD_Fortran_FLAGS_DEBUG  "-O0 -G0" )
+
+####################################################################
+# PRODUCTION FLAGS
+####################################################################
+
+set( ECBUILD_C_FLAGS_PRODUCTION        "-O2 -hfp1 -G2" )
+set( ECBUILD_CXX_FLAGS_PRODUCTION      "-O2 -hfp1 -G2" )
+set( ECBUILD_Fortran_FLAGS_PRODUCTION  "-O2 -hfp1 -G2" )
 
 ####################################################################
 # LINK FLAGS
@@ -42,4 +78,4 @@ set( ECBUILD_Fortran_FLAGS   "-emf -rmoid" )
 set( ECBUILD_C_LINK_FLAGS        "-Wl,-Map,loadmap -Wl,--as-needed -Ktrap=fp" )
 set( ECBUILD_CXX_LINK_FLAGS      "-Wl,-Map,loadmap -Wl,--as-needed -Ktrap=fp" )
 set( ECBUILD_Fortran_LINK_FLAGS  "-Wl,-Map,loadmap -Wl,--as-needed -Ktrap=fp" )
-set( ECBUILD_CXX_IMPLICIT_LINK_LIBRARIES "$ENV{CC_X86_64}/lib/x86-64/libcray-c++-rts.so" CACHE STRING "" )
+
diff --git a/share/ecbuild/toolchains/ecmwf-XC30-GNU.cmake b/share/ecbuild/toolchains/ecmwf-XC30-GNU.cmake
index e09bc56..3c890d5 100644
--- a/share/ecbuild/toolchains/ecmwf-XC30-GNU.cmake
+++ b/share/ecbuild/toolchains/ecmwf-XC30-GNU.cmake
@@ -1,9 +1,4 @@
 ####################################################################
-# ARCHITECTURE
-####################################################################
-set( CMAKE_SIZEOF_VOID_P 8 )
-
-####################################################################
 # COMPILER
 ####################################################################
 
@@ -17,20 +12,56 @@ set( ECBUILD_FIND_MPI OFF )
 set( ECBUILD_TRUST_FLAGS ON )
 
 ####################################################################
-# OpenMP FLAGS
+# FLAGS COMMON TO ALL BUILD TYPES
 ####################################################################
 
 set( OMP_C_FLAGS             "-fopenmp" )
 set( OMP_CXX_FLAGS           "-fopenmp" )
 set( OMP_Fortran_FLAGS       "-fopenmp" )
 
+set( CMAKE_C_FLAGS       "" CACHE STRING "" FORCE )
+set( CMAKE_CXX_FLAGS     "" CACHE STRING "" FORCE )
+set( CMAKE_Fortran_FLAGS "" CACHE STRING "" FORCE )
+
+####################################################################
+# RELEASE FLAGS
+####################################################################
+
+#set( ECBUILD_C_FLAGS_RELEASE       "-O3 -hfp3 -hscalar3 -hvector3 -DNDEBUG" )
+#set( ECBUILD_CXX_FLAGS_RELEASE     "-O3 -hfp3 -hscalar3 -hvector3 -DNDEBUG" )
+#set( ECBUILD_Fortran_FLAGS_RELEASE "-O3 -hfp3 -hscalar3 -hvector3 -DNDEBUG" )
+
+####################################################################
+# BIT REPRODUCIBLE FLAGS
+####################################################################
+
+set( ECBUILD_C_FLAGS_BIT        "-g -O2 -m64 -march=native -DNDEBUG" )
+set( ECBUILD_CXX_FLAGS_BIT      "-g -O2 -m64 -march=native -DNDEBUG" )
+set( ECBUILD_Fortran_FLAGS_BIT  "-g -O2 -m64 -march=native -DNDEBUG -fno-range-check -ffree-line-length-300 -fconvert=big-endian" )
+
+####################################################################
+# RELWITHDEBINFO FLAGS
+####################################################################
+
+#set( ECBUILD_C_FLAGS_RELWITHDEBINFO        "-O2 -hfp1 -Gfast -DNDEBUG" )
+#set( ECBUILD_CXX_FLAGS_RELWITHDEBINFO      "-O2 -hfp1 -Gfast -DNDEBUG" )
+#set( ECBUILD_Fortran_FLAGS_RELWITHDEBINFO  "-O2 -hfp1 -Gfast -DNDEBUG" )
+
 ####################################################################
 # DEBUG FLAGS
 ####################################################################
 
-set( ECBUILD_C_FLAGS_DEBUG        "-O0 -g -ftrapv" )
-set( ECBUILD_CXX_FLAGS_DEBUG      "-O0 -g -ftrapv" )
-set( ECBUILD_Fortran_FLAGS_DEBUG  "-ffree-line-length-none -O0 -g -fcheck=bounds -fbacktrace -finit-real=snan -ffpe-trap=invalid,zero,overflow" )
+#set( ECBUILD_C_FLAGS_DEBUG        "-O0 -G0" )
+#set( ECBUILD_CXX_FLAGS_DEBUG      "-O0 -G0" )
+#set( ECBUILD_Fortran_FLAGS_DEBUG  "-O0 -G0" )
+
+####################################################################
+# PRODUCTION FLAGS
+####################################################################
+
+#set( ECBUILD_C_FLAGS_PRODUCTION        "-O2 -hfp1 -G2" )
+#set( ECBUILD_CXX_FLAGS_PRODUCTION      "-O2 -hfp1 -G2" )
+#set( ECBUILD_Fortran_FLAGS_PRODUCTION  "-O2 -hfp1 -G2" )
 
 ####################################################################
 # LINK FLAGS
@@ -39,3 +70,4 @@ set( ECBUILD_Fortran_FLAGS_DEBUG  "-ffree-line-length-none -O0 -g -fcheck=bounds
 set( ECBUILD_C_LINK_FLAGS        "-Wl,-Map,load.map -Wl,--as-needed" )
 set( ECBUILD_CXX_LINK_FLAGS      "-Wl,-Map,load.map -Wl,--as-needed" )
 set( ECBUILD_Fortran_LINK_FLAGS  "-Wl,-Map,load.map -Wl,--as-needed" )
+
diff --git a/share/ecbuild/toolchains/ecmwf-XC30-Intel.cmake b/share/ecbuild/toolchains/ecmwf-XC30-Intel.cmake
index c569daf..485b122 100644
--- a/share/ecbuild/toolchains/ecmwf-XC30-Intel.cmake
+++ b/share/ecbuild/toolchains/ecmwf-XC30-Intel.cmake
@@ -12,23 +12,27 @@ set( ECBUILD_FIND_MPI OFF )
 set( ECBUILD_TRUST_FLAGS ON )
 
 ####################################################################
-# OpenMP FLAGS
+# FLAGS COMMON TO ALL BUILD TYPES
 ####################################################################
 
 set( OMP_C_FLAGS             "-qopenmp -qopenmp-threadprivate=compat -qopenmp-report=2 -qopt-report-phase=vec,openmp" )
 set( OMP_CXX_FLAGS           "-qopenmp -qopenmp-threadprivate=compat -qopenmp-report=2 -qopt-report-phase=vec,openmp" )
 set( OMP_Fortran_FLAGS       " -openmp  -openmp-threadprivate=compat  -openmp-report=2  -opt-report-phase=vec,openmp" ) # -[q] is missing on purpose, ifort does not take -q as flag
 
-####################################################################
-# COMMON FLAGS
-####################################################################
-
 # for diagnostics:
 #  -diag-enable=vec -diag-file -Winline
 
-set( ECBUILD_C_FLAGS       "-fp-speculation=strict -fp-model precise -traceback")
-set( ECBUILD_CXX_FLAGS     "-fp-speculation=strict -fp-model precise -traceback" )
-set( ECBUILD_Fortran_FLAGS "-fp-speculation=strict -fp-model precise -convert big_endian -assume byterecl -traceback -fpe0" )
+set( CMAKE_C_FLAGS       "-fp-speculation=strict -fp-model precise -traceback" CACHE STRING "" FORCE )
+set( CMAKE_CXX_FLAGS     "-fp-speculation=strict -fp-model precise -traceback" CACHE STRING "" FORCE )
+set( CMAKE_Fortran_FLAGS "-fp-speculation=strict -fp-model precise -convert big_endian -assume byterecl -traceback -fpe0" CACHE STRING "" FORCE )
+
+####################################################################
+# RELEASE FLAGS
+####################################################################
+
+#set( ECBUILD_C_FLAGS_RELEASE       "not implemented" )
+#set( ECBUILD_CXX_FLAGS_RELEASE     "not implemented" )
+#set( ECBUILD_Fortran_FLAGS_RELEASE "not implemented" )
 
 ####################################################################
 # BIT REPRODUCIBLE FLAGS
@@ -39,13 +43,28 @@ set( ECBUILD_CXX_FLAGS_BIT      "-O2 -xAVX -finline-function -finline-limit=500"
 set( ECBUILD_Fortran_FLAGS_BIT  "-O2 -xAVX -finline-function -finline-limit=500 -align array64byte" )
 
 ####################################################################
+# RELWITHDEBINFO FLAGS
+####################################################################
+
+#set( ECBUILD_C_FLAGS_RELWITHDEBINFO        "not implemented" )
+#set( ECBUILD_CXX_FLAGS_RELWITHDEBINFO      "not implemented" )
+#set( ECBUILD_Fortran_FLAGS_RELWITHDEBINFO  "not implemented" )
+
+####################################################################
 # DEBUG FLAGS
 ####################################################################
 
-set( ECBUILD_C_FLAGS_DEBUG        "-O0 -g -traceback -fp-trap=common" )
-set( ECBUILD_CXX_FLAGS_DEBUG      "-O0 -g -traceback -fp-trap=common" )
-# -check all implies -check bounds
-set( ECBUILD_Fortran_FLAGS_DEBUG  "-O0 -g -traceback -warn all -heap-arrays -fpe-all=0 -fpe:0 -check all" )
+set( ECBUILD_C_FLAGS_DEBUG        "-g -O0" )
+set( ECBUILD_CXX_FLAGS_DEBUG      "-g -O0" )
+set( ECBUILD_Fortran_FLAGS_DEBUG  "-g -O0" ) # ??? -align array64byte
+
+####################################################################
+# PRODUCTION FLAGS
+####################################################################
+
+#set( ECBUILD_C_FLAGS_PRODUCTION        "not implemented" )
+#set( ECBUILD_CXX_FLAGS_PRODUCTION      "not implemented" )
+#set( ECBUILD_Fortran_FLAGS_PRODUCTION  "not implemented" )
 
 ####################################################################
 # LINK FLAGS
@@ -54,3 +73,4 @@ set( ECBUILD_Fortran_FLAGS_DEBUG  "-O0 -g -traceback -warn all -heap-arrays -fpe
 set( ECBUILD_C_LINK_FLAGS        "-Wl,-Map,load.map -Wl,--as-needed" )
 set( ECBUILD_CXX_LINK_FLAGS      "-Wl,-Map,load.map -Wl,--as-needed" )
 set( ECBUILD_Fortran_LINK_FLAGS  "-Wl,-Map,load.map -Wl,--as-needed" )
+
diff --git a/share/magics/symbols.svg b/share/magics/symbols.svg
index 5501dfc..9fcc701 100644
--- a/share/magics/symbols.svg
+++ b/share/magics/symbols.svg
@@ -7,6 +7,29 @@
  <circle cx='0' cy='-0.4' r='0.1' fill='8'/>
 </g>
 
+<g id='WMO_TropicalCycloneNHGE'>
+ <polyline points='-0.4,0. -0.4, 0.2 -0.3, 0.45  0.1, 0.7  0.4, 0.7 0., 0.5 -0.2,0.' fill='black'/>
+ <polyline points=' 0.4,0.  0.4,-0.2  0.3,-0.45 -0.1,-0.7 -0.4,-0.7 0.,-0.5 0.2,0.'  fill='black'/>
+ <circle cx='0' cy='0' r='0.4' fill='8'/>
+</g>
+<g id='WMO_TropicalCycloneSHGE'>
+ <polyline points=' 0.4,0.  0.4, 0.2  0.3, 0.45 -0.1, 0.7 -0.4, 0.7 0., 0.5 0.2,0.'  fill='black'/>
+ <polyline points='-0.4,0. -0.4,-0.2 -0.3,-0.45  0.1,-0.7  0.4,-0.7 0.,-0.5 -0.2,0.' fill='black'/>
+ <circle cx='0' cy='0' r='0.4' fill='8'/>
+</g>
+<g id='WMO_TropicalCycloneNHLT'>
+ <polyline points='-0.4,0. -0.4, 0.2 -0.3, 0.45  0.1, 0.7  0.4, 0.7 0., 0.5 -0.2,0.' fill='black'/>
+ <polyline points=' 0.4,0.  0.4,-0.2  0.3,-0.45 -0.1,-0.7 -0.4,-0.7 0.,-0.5 0.2,0.'  fill='black'/>
+ <circle cx='0' cy='0' r='0.3' fill='10'/>
+</g>
+<g id='WMO_TropicalCycloneSHLT'>
+ <polyline points=' 0.4,0.  0.4, 0.2  0.3, 0.45 -0.1, 0.7 -0.4, 0.7 0., 0.5 0.2,0.'  fill='black'/>
+ <polyline points='-0.4,0. -0.4,-0.2 -0.3,-0.45  0.1,-0.7  0.4,-0.7 0.,-0.5 -0.2,0.' fill='black'/>
+ <circle cx='0' cy='0' r='0.3' fill='10'/>
+</g>
+
+
+
 <g id='box'>
  <polyline points='-0.5,-0.5 -0.5,0.5 0.5,0.5 0.5,-0.5 -0.5,-0.5' fill='none'/>
 </g>
diff --git a/share/magics/table_260.xml b/share/magics/table_260.xml
new file mode 100644
index 0000000..173661d
--- /dev/null
+++ b/share/magics/table_260.xml
@@ -0,0 +1,10 @@
+<center code='98'>
+    <table code='260'>
+        <param code='510' mars=''
+           short_title=''
+           long_title=''
+           scaling='1.0' offset='-273.16'
+           original_unit='K' derived_unit='deg c'
+        />
+    </table>
+</center>
diff --git a/src/basic/BasicSceneObject.h b/src/basic/BasicSceneObject.h
index c75b749..5366ddb 100644
--- a/src/basic/BasicSceneObject.h
+++ b/src/basic/BasicSceneObject.h
@@ -129,9 +129,9 @@ public:
 	virtual void release() { dispatch(&BasicSceneObject::release); }
 
 	virtual void visit(MetaDataVisitor& meta)  		{ dispatch(meta); } 
-	virtual void visit(PreviewVisitor& preview)  		{ dispatch(preview); }
+	virtual void visit(PreviewVisitor& preview)  	{ dispatch(preview); }
 	virtual void visit(HistoVisitor& histo)  		{ dispatch(histo); }
-	virtual void visit(MagnifierVisitor& magnifier)  	{ dispatch(magnifier); }
+	virtual void visit(MagnifierVisitor& magnifier) { dispatch(magnifier); }
 	
 	virtual void visit(DateDescription& timestamp)  	{ dispatch(timestamp); }
 	virtual void visit(LevelDescription& level)  	{ dispatch(level); }
diff --git a/src/common/CustomisedPoint.h b/src/common/CustomisedPoint.h
index 6b03fd4..ad25158 100644
--- a/src/common/CustomisedPoint.h
+++ b/src/common/CustomisedPoint.h
@@ -39,7 +39,7 @@ namespace magics {
 class CustomisedPoint : public map<string, double> {
 
 public:
-	CustomisedPoint(): missing_(false) {}
+	CustomisedPoint(): latitude_(0), longitude_(0), identifier_(""), missing_(false) {}
 	CustomisedPoint(double lon, double lat, string ident) :
 		latitude_(lat), longitude_(lon), identifier_(ident), missing_(false){}
 	virtual ~CustomisedPoint() {}
@@ -73,6 +73,11 @@ public:
 	double distance(double lat, double lon) const {
 		return sqrt( (lat-latitude_)*(lat-latitude_) +(lon-longitude_)*(lon-longitude_) );
 	}
+	void copyProperties(const CustomisedPoint& other) {
+		for ( const_iterator value = other.begin(); value != other.end(); ++ value) {
+			 insert(make_pair(value->first, value->second));
+		}
+	}
 
 protected:
      //! Method to print string about this class on to a stream of type ostream (virtual).
diff --git a/src/common/GeoRectangularProjection.cc b/src/common/GeoRectangularProjection.cc
index bdae818..7046007 100644
--- a/src/common/GeoRectangularProjection.cc
+++ b/src/common/GeoRectangularProjection.cc
@@ -78,14 +78,14 @@ void GeoRectangularProjection::print(ostream& o) const
 PaperPoint GeoRectangularProjection::operator()(const UserPoint& point)  const
 {
 	if ( !projection_ ) {
-		return  PaperPoint(point.x(), point.y(), point.value(), point.missing(), point.border());
+		return  PaperPoint(point.x(), point.y(), point.value(), point.missing(), point.border(), 0, point.name());
 
 	}
 
 	TeCoord2D geo = TeCoord2D(point.x()*TeCDR, point.y()*TeCDR);
 	TeCoord2D xy = projection_->LL2PC(geo);
 
-	return PaperPoint(xy.x(), xy.y(), point.value(), point.missing());
+	return PaperPoint(xy.x(), xy.y(), point.value(), point.missing(), point.border(), 0, point.name());
 }
 
 PaperPoint GeoRectangularProjection::operator()(const PaperPoint& point)  const
diff --git a/src/common/Matrix.cc b/src/common/Matrix.cc
index b8e7e3f..b3c7940 100644
--- a/src/common/Matrix.cc
+++ b/src/common/Matrix.cc
@@ -33,10 +33,10 @@
 
 #include "Matrix.h"
 #include "Timer.h"
-#include "SegmentJoiner.h"
-#include "MatrixHandler.h"
+//#include "SegmentJoiner.h"
 #include "MatrixHandler.h"
 
+
 using namespace magics;
 
 
@@ -52,8 +52,22 @@ void Matrix::plus(double offset)
     std::transform(begin(), end(), begin(), Plus(offset, missing_));
 }
 
+pair<int, bool> InfoIndex::index(double pos) const
+{
+	if ( pos < min_ ) return std::make_pair(-1, false);
+	
+	if ( pos > max_ ) {
+		if ( pos > min_ + 360 )
+			return std::make_pair(-1, false);
+		else 
+			return std::make_pair(nbPoints_-1, false);
+	}
+	return std::make_pair( floor( (pos - first_ )/step_), fmod( pos - first_, step_) == 0);
+}
+
 void ProjectedMatrix::build()
 {
+	/*
 	vector< std::pair<int, int>  > coords(4);
 	for (int r = 0; r < rows_; r++)
 		for (int c = 0; c < columns_; c++)
@@ -173,6 +187,7 @@ void ProjectedMatrix::build()
 				ii++;
 			}
 		}
+		*/
 }
 
 void ProjectedMatrix::getReady()
@@ -308,8 +323,227 @@ double Matrix::interpolate(double i, double j) const
 }
 
 
+/// @brief The usual PI/180 constant
+static const double DEG_TO_RAD = 0.017453292519943295769236907684886;
+/// @brief Earth's quatratic mean radius for WGS-84
+static const double EARTH_RADIUS_IN_METERS = 6372797.560856;
+
+/** @brief Computes the arc, in radian, between two WGS-84 positions.
+ *
+ * The result is equal to <code>Distance(from,to)/EARTH_RADIUS_IN_METERS</code>
+ *    <code>= 2*asin(sqrt(h(d/EARTH_RADIUS_IN_METERS )))</code>
+ *
+ * where:<ul>
+ *    <li>d is the distance in meters between 'from' and 'to' positions.</li>
+ *    <li>h is the haversine function: <code>h(x)=sin²(x/2)</code></li>
+ * </ul>
+ *
+ * The haversine formula gives:
+ *    <code>h(d/R) = h(from.lat-to.lat)+h(from.lon-to.lon)+cos(from.lat)*cos(to.lat)</code>
+ *
+ * @sa http://en.wikipedia.org/wiki/Law_of_haversines
+ */
+double geodistance(double lat1, double lon1, double lat2, double lon2) {
+	double latitudeArc  = (lat1 - lat2) * DEG_TO_RAD;
+	double longitudeArc = (lon1 - lon2) * DEG_TO_RAD;
+	double latitudeH = sin(latitudeArc * 0.5);
+	latitudeH *= latitudeH;
+	double lontitudeH = sin(longitudeArc * 0.5);
+	lontitudeH *= lontitudeH;
+	double tmp = cos(lat1*DEG_TO_RAD) * cos(lat2*DEG_TO_RAD);
+	return EARTH_RADIUS_IN_METERS* (2.0 * asin(sqrt(latitudeH + tmp*lontitudeH)));
+}
+
+#include <limits>
+pair<double, double> Matrix::nearest_value(double row, double column,double &rowOut, double &colOut) const
+{
+	double col, offset;
+
+	col = fmod(column - minX(), 360.) + minX();
+
+	offset = column - col;
+
+	map<double, map<double, pair<double, double> > >::const_iterator  row_index;
+	map<double, pair<double, double> >::const_iterator column_index;
+	rowOut = missing();
+	colOut = missing();
+
+	vector<pair<double, map<double, pair<double, double> >::const_iterator> > points;
+	row_index = index_.find(row);
+
+	if ( row_index != index_.end() ) {
+		rowOut = row;
+		// We have to find the columns
+		column_index = row_index->second.find(col);
+		if ( column_index != row_index->second.end() ) {
+			// Perfect match !
+			colOut = col;
+			return column_index->second;
+		}
+		column_index = row_index->second.lower_bound(col);
+		if ( column_index == row_index->second.end() || column_index == row_index->second.begin()) {
+			rowOut = missing();
+			return make_pair(missing(), missing());
+		}
+		// here we have 2 points : find the nearest
+		points.push_back(make_pair(row, column_index));
+		column_index--;
+		points.push_back(make_pair(row, column_index));
+	}
+	else {
+		row_index = index_.lower_bound(row);
+		if ( row_index == index_.end() || row_index == index_.begin()) {
+			rowOut = missing();
+			return make_pair(missing(), missing());
+		}
+		// Here we may have 4 points!
+		// Deal with the first row
+		column_index = row_index->second.lower_bound(col);
+		if ( column_index != row_index->second.end() || column_index != row_index->second.begin()) {
+			points.push_back(make_pair(row, column_index));
+			column_index--;
+			points.push_back(make_pair(row, column_index));
+		}
+		row_index--;
+		column_index = row_index->second.lower_bound(col);
+		if ( column_index != row_index->second.end() || column_index != row_index->second.begin()) {
+			points.push_back(make_pair(row, column_index));
+			column_index--;
+			points.push_back(make_pair(row, column_index));
+		}
+
+	}
+	// Now we find the nearest!
+	double min = numeric_limits<double>::infinity();
+	pair<double, double> value = make_pair(missing(), missing());
+	for (vector<pair<double, map<double, pair<double, double> >::const_iterator> >::iterator point = points.begin(); point != points.end(); ++point) {
+		double  dist = geodistance(point->first, point->second->first, row, col);
+		if (dist < min ) {
+			min = dist;
+			rowOut = point->first;
+			colOut = point->second->first + offset;
+			value =  point->second->second;
+		}
+	}
+
+	return value;
+
+}
+
+
+void xx(double v)
+{
+	double offset;
+	offset = fmod(v, 360.);
+	int a = v/360;
+	cout << "-------" << endl;
+	cout << v << "--->" << offset  << "--->" << a <<  endl;
+
+	if ( offset < 0 )
+		a--;
+
+	double nv = v - (a*360);
+
+	cout << nv << "--->" << (a*360) << " " <<  nv + (a*360) << endl;
+
+
+
+}
+
+
+int Matrix::nearest_index(double row, double column,double &rowOut, double &colOut) const
+{
+	double col, offset;
+
+	int factor = (column-minX())/360.;
+
+	if ( column-minX() < 0)
+		factor--;
+
+	offset = (factor*360);
+
+	col = column - offset;
+	map<double, int >::const_iterator  row_index;
+	pair<int, bool> column_index;
+	vector<pair<double, pair<double, int> > > points;
+
+	rowOut = missing();
+	colOut = missing();
+
+
+	row_index = yIndex_.find(row);
+
+
+	if ( row_index != yIndex_.end() ) {
+		rowOut = row;
+		column_index = xIndex_[row_index->second].index(col);
+		if ( column_index.first == -1  ) {
+			return -1;
+		}
+		if ( column_index.second ) {
+					// Perfect match !
+			colOut = column;
+			int value = xIndex_[row_index->second].position(column_index.first);
+			return ( data_[value] == missing() ) ? -1 : value;
+		}
+		else {
+					// here we have 2 points : find the nearest
+			points.push_back(make_pair(row, make_pair(xIndex_[row_index->second].value(column_index.first), xIndex_[row_index->second].position(column_index.first))));
+			points.push_back(make_pair(row,  make_pair(xIndex_[row_index->second].value(column_index.first+1), xIndex_[row_index->second].position(column_index.first+1))));
+		}
+	}
+
+	row_index = yIndex_.lower_bound(row);
+	if ( row_index == yIndex_.end() || row_index == yIndex_.begin()) {
+		rowOut = missing();
+		return -1;
+	}
+			// Here we may have 4 points!
+			// Deal with the first row
+
+	InfoIndex xindex = xIndex_[row_index->second];
+	column_index = xindex.index(col);
+	if ( column_index.second )
+		points.push_back(make_pair(row_index->first, make_pair(xindex.value(column_index.first), xindex.position(column_index.first))));
+	else {
+		points.push_back(make_pair(row_index->first, make_pair(xindex.value(column_index.first), xindex.position(column_index.first))));
+		points.push_back(make_pair(row_index->first, make_pair(xindex.value(column_index.first+1), xindex.position(column_index.first+1))));
+	}
+
+	row_index--;
+	xindex = xIndex_[row_index->second];
+	column_index = xindex.index(col);
+
+		if ( column_index.second )
+			points.push_back(make_pair(row_index->first, make_pair(xindex.value(column_index.first), xindex.position(column_index.first))));
+		else {
+			points.push_back(make_pair(row_index->first, make_pair(xindex.value(column_index.first), xindex.position(column_index.first))));
+			points.push_back(make_pair(row_index->first, make_pair(xindex.value(column_index.first+1), xindex.position(column_index.first+1))));
+		}
+
+
+
+
+
+	// Now we find the nearest!
+	double min = numeric_limits<double>::infinity();
+	int value = -1;
+	for (vector<pair<double, pair<double, int> > >::const_iterator point = points.begin(); point != points.end(); ++point) {
+		double  dist = geodistance(point->first, point->second.first, row, col);
+		if (dist < min ) {
+			min = dist;
+			rowOut = point->first;
+			colOut = point->second.first + offset;
+			value =  point->second.second;
+
+		}
+	}
+	if ( value == -1 ) return value;
+	return ( data_[value] == missing() ) ? -1 : value;
+
+}
 
-double Matrix::nearest(double row, double col,double &rowOut, double &colOut) const    
+double Matrix::nearest(double row, double col,double &rowOut, double &colOut) const
 {  
 	double xleft = std::min( left(), right());
 	double xright = std::max( left(), right());
diff --git a/src/common/Matrix.h b/src/common/Matrix.h
index 2268033..e6b516e 100644
--- a/src/common/Matrix.h
+++ b/src/common/Matrix.h
@@ -162,7 +162,32 @@ public:
     }
 };
 
+struct InfoIndex
+{
+	InfoIndex() {}
+	InfoIndex(double first, double last, double nb, int offset):
+		first_(first), last_(last), nbPoints_(nb), offset_(offset) {
+			step_ = (last_ - first_)/(nbPoints_-1);
+			min_ = std::min(first_, last_);
+			max_ = std::max(first_, last_);
+		}
+	double first_;
+	double last_;
+	double min_;
+	double max_;
+	double nbPoints_;
+	int    offset_;
+	double step_;
+
+	pair<int, bool> index(double pos) const;
+	double value(int i) const {
+		return first_ + (step_)*i;
+	}
+	int position(int i) const {
+		return offset_ + i;
+	}
 
+};
 
 class Matrix: public AbstractMatrix, public magvector<double> {
 
@@ -280,7 +305,8 @@ public:
     double interpolate(double r, double c) const;
     double nearest(double i, double j) const {double d1, d2; return nearest(i,j,d1,d2);}
     double nearest(double i, double j,double &iOut, double &jOut) const;
-    
+    pair<double, double> nearest_value(double i, double j,double &iOut, double &jOut) const;
+    int nearest_index(double i, double j,double &iOut, double &jOut) const;
     void multiply(double factor);   
     void plus(double offset);
     
@@ -401,6 +427,10 @@ public:
 		return -1;
     } 
 
+	map<double, map<double, pair<double, double> > > index_;
+	map<double, int> yIndex_; // lat--> index
+	vector<InfoIndex> xIndex_;
+	vector<double> data_;
     
 protected:
      //! Method to print string about this class on to a stream of type ostream (virtual).
@@ -424,7 +454,7 @@ protected:
      double missing_;
      bool akima_;
 
-    int row_ind(double row) const {
+     int row_ind(double row) const {
         map<double, int>::const_iterator i = rowsMap_.lower_bound(row);
     	if ( same(i->first, row) )
     			return i->second;
@@ -447,7 +477,8 @@ protected:
                 return i->second;
         }
     	return -1;
-    }    
+    }
+
 private:
    mutable double min_;
    mutable double max_;
diff --git a/src/common/PaperPoint.h b/src/common/PaperPoint.h
index ac21662..63ccc71 100644
--- a/src/common/PaperPoint.h
+++ b/src/common/PaperPoint.h
@@ -39,11 +39,11 @@ namespace magics {
 class PaperPoint  {
 
 public:
-	PaperPoint(double x, double y, double value = 0, bool missing = false, bool border=false, int range = 0) :
-		x_(x), y_(y), value_(value), range_(range), high_(false), low_(false),
+	PaperPoint(double x, double y, double value = 0, bool missing = false, bool border=false, int range = 0, const string& name = "") :
+		x_(x), y_(y), value_(value), range_(range), name_(name), high_(false), low_(false),
 		missing_(missing), border_(border) {}
 	//~PaperPoint() {}
-	PaperPoint() : x_(0), y_(0), value_(0), high_(false), low_(false), 
+	PaperPoint() : x_(0), y_(0), value_(0), name_(""), high_(false), low_(false),
 		missing_(false), border_(false) {}
 	
 	void y(double y) { y_ = y; }
@@ -59,6 +59,7 @@ public:
 	inline double y() const     { return y_; }
 	inline double x() const     { return x_; }
 	inline double value() const { return value_; }
+	inline string name() const  { return name_; }
 	inline int range() const { return range_; }
 	
 	void flagMissing()          { missing_ = true; }
@@ -76,6 +77,8 @@ public:
 	double y_;
 	double value_;
 	int       range_;
+	string name_;
+
 	bool in(double left, double right, double bottom, double top) const
 	{
 		if (y_ > top)
diff --git a/src/common/PolarStereographicProjection.cc b/src/common/PolarStereographicProjection.cc
index 5531af7..991f8eb 100644
--- a/src/common/PolarStereographicProjection.cc
+++ b/src/common/PolarStereographicProjection.cc
@@ -125,7 +125,7 @@ PaperPoint PolarStereographicProjection::operator()(const UserPoint& point)  con
 	TeCoord2D geo = TeCoord2D(point.x()*TeCDR, point.y()*TeCDR);
 	TeCoord2D xy = projection_->LL2PC(geo);
 
-	return PaperPoint(xy.x(), xy.y(), point.value(), point.missing(), point.border());
+	return PaperPoint(xy.x(), xy.y(), point.value(), point.missing(), point.border(), 0, point.name());
 }
 
 
diff --git a/src/common/Polyline.cc b/src/common/Polyline.cc
index f645fe7..da2ee6b 100644
--- a/src/common/Polyline.cc
+++ b/src/common/Polyline.cc
@@ -75,7 +75,7 @@ void Polyline::print(ostream& out) const
 {
 	out << "Polyline[";
 	out << ", nb_points = " << this->size();
-	  if ( this->size() < 25 ) {
+	  if ( this->size() < 1000 ) {
             out << " Outer [";
             string sep = "";
 	    const unsigned int nb = size();
@@ -146,6 +146,7 @@ void Polyline::hole(Holes::const_iterator hole, vector<double>& x, vector<double
 
 void Polyline::hole(Holes::const_iterator hole, Polyline& poly) const
 {
+
 	for (deque<PaperPoint>::const_iterator h = hole->begin(); h != hole->end(); ++h) {
 		poly.push_back(*h);
 	}
diff --git a/src/common/Proj4Projection.cc b/src/common/Proj4Projection.cc
index db0eb4f..941fe64 100644
--- a/src/common/Proj4Projection.cc
+++ b/src/common/Proj4Projection.cc
@@ -327,7 +327,7 @@ PaperPoint Proj4Projection::operator()(const UserPoint& point)  const
 		MagLog::debug() << pj_strerrno(error) << " for " << point << endl;
 		return PaperPoint(-1000000, -10000000);
 	}
-	return PaperPoint(x, y, point.value_, point.missing());	               
+	return PaperPoint(x, y, point.value_, point.missing(), point.border(), 0, point.name());
 }
 
 PaperPoint Proj4Projection::operator()(const PaperPoint& point)  const
diff --git a/src/common/Symbol.cc b/src/common/Symbol.cc
index 1e53843..ffc4f3f 100644
--- a/src/common/Symbol.cc
+++ b/src/common/Symbol.cc
@@ -110,7 +110,7 @@ Symbol* SymbolProperties::symbol(const string& type) const
 			else
 				symbol = new Symbol();
 	}
-	if ( magCompare(type, "both") ) {
+	if ( magCompare(type, "both") || magCompare(type, "marker_text") ) {
 		TextSymbol* text = new TextSymbol();
 
 		text->position(position_);
@@ -274,7 +274,6 @@ void TextSymbol::redisplay(const BaseDriver& driver) const
 		boundingbox_.clip(line, lines);
 
 		for ( vector<Polyline>::const_iterator l = lines.begin(); l != lines.end(); ++l) {
-
 			driver.redisplay(*l);
 		}
 		//first  we remove the point that are outside!
@@ -286,8 +285,6 @@ void TextSymbol::redisplay(const BaseDriver& driver) const
 		symbol.erase(last, symbol.end());
 
 		driver.redisplay(symbol);
-
-
 }
 
 void ImageSymbol::redisplay(const BaseDriver& driver) const
@@ -297,7 +294,6 @@ void ImageSymbol::redisplay(const BaseDriver& driver) const
 		object->setOrigin(*point);
 		object->setPath(path_);
 		object->setFormat(format_);
-
 		object->setWidth(width_);
 		object->setHeight(height_);
 		driver.redisplay(*object);
diff --git a/src/common/Symbol.h b/src/common/Symbol.h
index 86e49ac..e98d0cc 100644
--- a/src/common/Symbol.h
+++ b/src/common/Symbol.h
@@ -146,7 +146,12 @@ public:
 
 	void push_back(const PaperPoint& point, const string& text) {
 		Symbol::push_back(point);
-		if ( !text.empty() ) texts_.push_back(text);
+		if ( text == "_FORCE_EMPTY_TEXT_" ) {
+			texts_.push_back("");
+			return;
+		}
+		if ( !text.empty() )
+			texts_.push_back(text);
 	}
 
 	void text(const vector<string>& text) { texts_ = text; }
diff --git a/src/common/Transformation.cc b/src/common/Transformation.cc
index d3848ee..bf5ac2c 100644
--- a/src/common/Transformation.cc
+++ b/src/common/Transformation.cc
@@ -36,7 +36,7 @@ Transformation::Transformation() :
 	dataMaxX_(-std::numeric_limits<double>::max()),
 	dataMinY_(std::numeric_limits<double>::max()),
 	dataMaxY_(-std::numeric_limits<double>::min()),
-	topAxis_(true), xTile_(0), yTile_(0)
+	topAxis_(true), xTile_(0), yTile_(0), zoomLevel_(0)
 {
 	userEnveloppe_ = new Polyline();
 	PCEnveloppe_ = new Polyline();
@@ -447,11 +447,61 @@ void Transformation::operator()(const Polyline& from, BasicGraphicsObjectContain
 	catch (...) {
 		MagLog::warning() << "error clipping->line ignored" << endl;
 	}
+}
+
+void Transformation::operator()(const Polyline& from, vector<Polyline*>& out) const
+{
+	if (from.empty())
+		return;
+	PaperPoint ll(getMinPCX(), getMinPCY());
+	PaperPoint ur(getMaxPCX(), getMaxPCY());
+	boost::geometry::model::box<PaperPoint> box(ll, ur);
+	boost::geometry::correct(box);
 
 
 
 
+	vector<deque<PaperPoint> > holes;
+	vector<Polyline*> forholes;
+
 
+	try {
+		vector<vector<PaperPoint> > lines;
+		//line.reserve( from.size());
+		lines.push_back(vector<PaperPoint>());
+		for (unsigned i = 0; i < from.size(); i++) {
+			lines.back().push_back(from.get(i));
+
+		}
+		for ( Polyline::Holes::const_iterator hole = from.beginHoles(); hole != from.endHoles(); ++hole) {
+			Polyline poly;
+			from.hole(hole, poly);
+			lines.push_back(vector<PaperPoint>());
+			for (unsigned i = 0; i < poly.size(); i++) {
+				lines.back().push_back(poly.get(i));
+			}
+		}
+
+		for (vector<vector<PaperPoint> >::iterator line = lines.begin(); line != lines.end(); ++line) {
+			vector<vector<PaperPoint> > result;
+			boost::geometry::correct(*line);
+			boost::geometry::intersection(box, *line, result);
+
+			// Now we feed the graphic container!
+			for (vector<vector<PaperPoint> >::iterator l = result.begin(); l != result.end(); l++)
+			{
+				Polyline* poly = new Polyline();
+				for (vector<PaperPoint>::iterator point = l->begin(); point != l->end(); ++point)
+					poly->push_back(*point);
+				if ( !poly->empty() )
+					out.push_back(poly);
+			}
+		}
+	}
+
+	catch (...) {
+		MagLog::warning() << "error clipping->line ignored" << endl;
+	}
 }
 
 
diff --git a/src/common/Transformation.h b/src/common/Transformation.h
index 5f470e0..a43b0f4 100644
--- a/src/common/Transformation.h
+++ b/src/common/Transformation.h
@@ -207,7 +207,7 @@ public:
 		{ return xy; }
 	virtual void operator()(const UserPoint& geo, Polyline& out) const;
 	virtual void operator()(const UserPoint& xy, vector<PaperPoint>& out) const;
-
+	void operator()(const Polyline& from, vector<Polyline*>& out) const;
 	virtual void revert(const vector< std::pair<double, double> > &, vector< std::pair<double, double> > &) const;
 	
 	virtual void revert(const PaperPoint& xy, UserPoint& point) const 
diff --git a/src/common/UserPoint.h b/src/common/UserPoint.h
index 780e1e8..a49fc1b 100644
--- a/src/common/UserPoint.h
+++ b/src/common/UserPoint.h
@@ -37,11 +37,11 @@ namespace magics {
 class UserPoint  {
 
 public:
-	UserPoint(double x, double y, double value = 0, bool missing = false, bool border = false) :
-		x_(x), y_(y), value_(value), high_(false), low_(false), missing_(missing), border_(border)  {}
+	UserPoint(double x, double y, double value = 0, bool missing = false, bool border = false, const string& name = "") :
+		x_(x), y_(y), value_(value), name_(name), high_(false), low_(false), missing_(missing), border_(border)  {}
 	// ~UserPoint() {}
 	UserPoint() :
-		x_(0), y_(0), value_(0), high_(false), low_(false), missing_(false), border_(false) {}
+		x_(0), y_(0), value_(0), name_(""), high_(false), low_(false), missing_(false), border_(false) {}
 	
 	void y(double y) { y_ = y; }
 	void x(double x) { x_ = x; }
@@ -51,6 +51,7 @@ public:
 	inline double y() const     { return y_; }
 	inline double x() const     { return x_; }
 	inline double value() const { return value_; }
+	inline const string& name() const  { return name_; }
 	
 	void flagMissing()          { missing_ = true; }
 	bool missing() const        { return missing_; }
@@ -71,7 +72,7 @@ public:
 	double x_;
 	double y_;
 	double value_;
-
+	string name_;
 	void high(bool high) { high_ = high; }
 	void low(bool low)   { low_ = low; }
 	bool high() const { return high_; }
@@ -118,6 +119,7 @@ protected:
 	bool missing_;
 	bool border_;
 	
+
 	void print(ostream& out) const
 	{ 
 		out << "UserPoint[";
diff --git a/src/decoders/EpsgramDecoder.cc b/src/decoders/EpsgramDecoder.cc
index 6be5ed1..be3c652 100644
--- a/src/decoders/EpsgramDecoder.cc
+++ b/src/decoders/EpsgramDecoder.cc
@@ -1529,35 +1529,7 @@ MatrixHandler& EpsgramDecoder::matrix()
 	    column++;
 	}
 
-	/*matrix_.set(steps_.size(), heights_.size());
 
-
-	for ( vector<double>::const_iterator height =heights_.begin(); height != heights_.end(); ++height) {
-				matrix_.rowsAxis().push_back(*height);
-	}	
-	MagLog::dev()<< " step-->" <<endl;
-	for ( vector<double>::const_iterator step = steps_.begin(); step != steps_.end(); ++step) {
-				matrix_.columnsAxis().push_back(*step);
-				MagLog::dev()<< *step << " ";
-			}
-			MagLog::dev()<< endl << "<--- step" <<endl;
-			matrix_.setMapsAxis();
-			int i = 0;
-			for ( int height = 0; height < heights_.size(); height++) {
-
-			    MagLog::dev()<< endl <<  heights_[height] << " " << steps_.size() << endl;
-				for ( int step = 0; step < steps_.size(); step++) {
-					matrix_.push_back(values_[(step*heights_.size()) + height]);
-					MagLog::dev()<< matrix_.back() << " ";
-				}
-			}
-				MagLog::debug() << matrix_ << endl;
-	for (vector<CustomisedPoint*>::const_iterator point = points_.begin(); point != points_.end(); ++point)
-	{
-			 MagLog::dev() << **point << endl;
-
-	}
-	*/
 	matrixHandlers_.push_back(new  MatrixHandler(matrix_));
 	return *(matrixHandlers_.back());
 }
diff --git a/src/decoders/GribDecoder.cc b/src/decoders/GribDecoder.cc
index 3f43193..b59cca2 100644
--- a/src/decoders/GribDecoder.cc
+++ b/src/decoders/GribDecoder.cc
@@ -56,6 +56,7 @@ GribDecoder::GribDecoder() :  matrix_(0),  xComponent_(0), yComponent_(0),
     count_++;
     title_ = "grib_" + tostring(count_);
     version();
+
 }
 
 void GribDecoder::version()
@@ -226,6 +227,10 @@ double GribDecoder::getDouble(const string& key, bool warnIfKeyAbsent) const
 void   GribDecoder::setDouble(const string& key, double val) const
 {
     int err = grib_set_double(handle_, key.c_str(), val);
+    if ( component1_ )
+    	err = grib_set_double(component1_, key.c_str(), val);
+    if ( component2_ )
+       	err = grib_set_double(component2_, key.c_str(), val);
     if ( err )
     {
         MagLog::warning() << "Grib API: can not find key [" << key << "]  - "<< grib_get_error_message(err) <<"\n";
@@ -261,7 +266,7 @@ void GribDecoder::scale(const string& metadata, double& scaling, double& offset)
 	}
 }
 
-void GribDecoder::read(Matrix **matrix)
+void GribDecoder::read(Matrix **matrix, Matrix** matrix2)
 {
 
     if ( handle_ <=0 ) {
@@ -276,7 +281,7 @@ void GribDecoder::read(Matrix **matrix)
         if ( !interpretor_ ) {
             interpretor_ = SimpleObjectMaker<GribInterpretor>::create(representation);
         }
-        interpretor_->interpretAsMatrix(*this, matrix);
+        interpretor_->interpretAsMatrix(*this, matrix, matrix2);
         if ( *matrix == 0 ) {
             valid_ = false;
             ostringstream msg;
@@ -395,9 +400,10 @@ void GribDecoder::decode2D()
     }
     readColourComponent();
     openFirstComponent();
-    read(&w1);
     openSecondComponent();
-    read(&w2);
+    read(&w1, &w2);
+
+
     Data::dimension_ = ( colourComponent_ ) ? 3 : 2;
 
     wind_mode_->x(&xComponent_, &yComponent_, w1, w2);
@@ -432,8 +438,9 @@ void GribDecoder::customisedPoints(const AutomaticThinningMethod& thinning, cons
         double ystep = ( transformation.getMaxPCY() - transformation.getMinPCY())/ (thinning.y()-1);
 
         int nb = (xstep/res);
-        xstep = nb * res;
-        ystep = int(ystep/res) * res;
+        xstep = (nb > 1 ) ? nb * res : 0;
+        nb = (ystep/res);
+        ystep = (nb > 1 ) ? nb * res : 0;
 
         customisedPoints(transformation, points, xstep, ystep, 0);
     }
@@ -536,17 +543,14 @@ struct Compare
 
 void GribDecoder::customisedPoints(const Transformation& transformation, CustomisedPointsList& out, double thinx, double thiny, double gap)
 {
-    // Initialise index and data
-    interpretor_->new_index(*this);
+    decode2D();
 
-    uComponent();
-    vComponent();
-    double minlon = interpretor_->west_;
-    double maxlon = interpretor_->east_;
+    double minlon = 0.;
+    double maxlon = 360.;
 
     double missing = getDouble("missingValue");
 
-    if ( thinx ) {
+    if ( thiny ) {
         vector<pair<double, double> > positions;
 
         PaperPoint xy = interpretor_->reference(*this, transformation);
@@ -556,59 +560,63 @@ void GribDecoder::customisedPoints(const Transformation& transformation, Customi
         out.reserve(positions.size());
 
         int i = 0;
+       
+        std::set<int> cache;
+        cache.insert(-1);
         for ( pos = positions.begin(); pos != positions.end(); ++pos) {
             double offset = 0.;
             // First make sure tthat the lon is between the minlon and maxlon.
             double lon = pos->first;
             double lat = pos->second;
+            double nlat, nlon;
 
-            i++;
-            while ( lon < minlon ) {
-                lon += 360;
-                offset -= 360.;
-            }
-            while ( lon > maxlon ) {
-                lon -= 360.;
-                offset += 360.;
-            }
-
-            Index index = interpretor_->nearest(lat, lon);
-            //cout << "[" << lat << ", " << lon << "]-->[" << index.index_ << ", " << index.lat_ << ", " << index.lon_ << "]" << endl;
-            if ( index.index_ != -1 && !index.used_ ) {
-                index.used_ = true;
-                double u = uComponent(index.index_);
-                double v = vComponent(index.index_);
+            int w = xComponent_->nearest_index(lat, lon, nlat, nlon);
 
-                if ( u != missing && v != missing) {
-                    CustomisedPoint *add = new CustomisedPoint(index.lon_+offset, index.lat_, "");
-                    pair<double, double> value = (*wind_mode_)(u, v);
+            //cout << i << " = [" << lat << ", " << lon << "]--->[" << nlat << ", " << nlon << "] = " << w << endl;
+            i++;
+            bool cached = ( cache.find(w) != cache.end() );
+            if ( !cached ) {
+                    cache.insert(w);
+                    CustomisedPoint *add = new CustomisedPoint(nlon, nlat, "");
+                    pair<double, double> value = (*wind_mode_)((*xComponent_).data_[w], (*yComponent_).data_[w]);
 
                     add->insert(make_pair("x_component", value.first));
                     add->insert(make_pair("y_component", value.second));
+                    // cout << " Point " << *add << endl;
                     out.push_back(add);
-                    /* for debug!
-                    add = new CustomisedPoint(lon+offset, lat, "");
 
-                    add->insert(make_pair("x_component", 0.01));
-                    add->insert(make_pair("y_component", 0.01));
-                    out.push_back(add);
-                    //*/
+                    string debug = getEnvVariable("WIND_DEBUG");
+                    if ( debug != "" ) {
+                    	add = new CustomisedPoint(lon, lat, "");
+
+                    	add->insert(make_pair("x_component", 0.01));
+                    	add->insert(make_pair("y_component", 0.01));
+                    	out.push_back(add);
+                    }
+
                 }
+                
             }
-        }
+            
     }
 
     else { // no thinning !
         // get all the points of the index!
-
-        for ( vector<vector<Index> >:: iterator cell = interpretor_->helper_.begin(); cell != interpretor_->helper_.end(); ++cell) {
-            for ( vector<Index>::iterator index = cell->begin(); index != cell->end(); ++index) {
-                double u = uComponent(index->index_);
-                double v = vComponent(index->index_);
+    	//map<double, int> yIndex_; // lat--> index
+    	//vector<InfoIndex> xIndex_;
+        for ( map<double, int>::iterator y = xComponent_->yIndex_.begin(); y != xComponent_->yIndex_.end(); ++y) {
+        	InfoIndex x = xComponent_->xIndex_[y->second];
+        	double lat = y->first;
+        	int index = x.offset_;
+            for ( int i = 0; i < x.nbPoints_; i++) {
+            	double lon = x.first_  + (i*x.step_);
+                double u = xComponent_->data_[index];
+                double v = yComponent_->data_[index];
+                index++;
                 if ( u != missing && v != missing) {
                     pair<double, double> value = (*wind_mode_)(u, v);
                     vector<UserPoint> pos;
-                    transformation.populate(index->lon_, index->lat_, 0, pos);
+                    transformation.populate(lon, lat, 0, pos);
                     for ( vector<UserPoint>::iterator p = pos.begin(); p != pos.end(); ++p) {
                         CustomisedPoint *add = new CustomisedPoint(p->x(), p->y(), "");
                         add->insert(make_pair("x_component", value.first));
@@ -1484,6 +1492,8 @@ const LevelDescription& GribDecoder::level()
 
 void GribDecoder::visit(MetaDataVisitor& meta)
 {
+    if ( !handle_ )
+        return;
     vector<string> need;
 
     need.push_back("<grib_info key='shortName'/>");
diff --git a/src/decoders/GribDecoder.h b/src/decoders/GribDecoder.h
index a78517d..f995d04 100644
--- a/src/decoders/GribDecoder.h
+++ b/src/decoders/GribDecoder.h
@@ -105,9 +105,13 @@ public:
 	MatrixHandler& direction();
 	// Data Interface : info for the layer managment!
 	 string layerId()  { decode(); return layerId_; }
-	 string name() { decode(); return name_; }
-	 const DateTime& from() { decode(); return from_; }
-	 const DateTime& to()  { decode(); return to_; }
+	 string name() {
+
+	 	 return name_;
+	 }
+	 const DateTime& from() {
+	 return from_; }
+	 const DateTime& to()  {  return to_; }
 
 	string title() {
 		return title_;
@@ -207,7 +211,7 @@ public:
 
     string    getstring(const string&, bool warnIfKeyAbsent = true, bool cache= true) const;
 
-	void      read(Matrix **matrix);
+	void      read(Matrix **matrix, Matrix ** matrix2 = NULL);
 	void      read(Matrix **matrix, const Transformation&);
 	bool      id(const string&, const string&) const;
 
@@ -216,6 +220,10 @@ public:
 
 	grib_handle*  uHandle(string&);
 	grib_handle*  vHandle(string&);
+
+	grib_handle*  uHandle() const { return component1_ ; }
+	grib_handle*  vHandle() const { return component2_ ; };
+
 	grib_handle*  cHandle(string&);
 
 	double uComponent(int);
@@ -311,11 +319,13 @@ public:
 	void openFirstComponent() {
 		ASSERT(handle1_);
 		handle_ = handle1_;
+		component1_ = handle1_;
 	}
 
 	void openSecondComponent() {
 		ASSERT(handle2_);
 		handle_ = handle2_;
+		component2_ = handle2_;
 	}
 	void openThirdComponent() {
 			ASSERT(handle3_);
diff --git a/src/decoders/GribInterpretor.h b/src/decoders/GribInterpretor.h
index 1b09565..4f1d630 100644
--- a/src/decoders/GribInterpretor.h
+++ b/src/decoders/GribInterpretor.h
@@ -67,7 +67,7 @@ public:
 	virtual void raw(const GribDecoder&, const Transformation&, const string&, map<double, map<double, CustomisedPoint*> >&) const;
 	virtual void raw(GribDecoder&, const Transformation&, vector<pair<double, vector<pair<double, CustomisedPoint*> > > >&, double&, double&) const;
 
-	virtual void interpretAsMatrix(const GribDecoder&, Matrix** matrix) const { *matrix = 0; }
+	virtual void interpretAsMatrix(const GribDecoder&, Matrix** matrix, Matrix** matrix2= NULL) const { *matrix = 0; }
 	virtual void interpretAsMatrix(const GribDecoder& grib, Matrix** matrix, const Transformation&) const
 		{ interpretAsMatrix(grib, matrix); }
 
diff --git a/src/decoders/GribRegularInterpretor.cc b/src/decoders/GribRegularInterpretor.cc
index f2ec7bb..d1df300 100644
--- a/src/decoders/GribRegularInterpretor.cc
+++ b/src/decoders/GribRegularInterpretor.cc
@@ -396,7 +396,7 @@ void  GribInterpretor::index(const GribDecoder& grib)
 
 int GribInterpretor::nearest(double lon, double lat, double& nlon, double& nlat)
 {
-
+/*
     map<double, map<double, int> >::iterator y1, y2, y;
     map<double, int>::iterator x1, x2, x;
 
@@ -432,7 +432,7 @@ int GribInterpretor::nearest(double lon, double lat, double& nlon, double& nlat)
     }
     nlon = x->first;
     return x->second;
-
+*/
 }
 
 void GribInterpretor::raw(GribDecoder& grib,
@@ -651,7 +651,7 @@ void GribRegularInterpretor::index(const GribDecoder& grib)
 }
 
 void GribRegularInterpretor::interpretAsMatrix(const GribDecoder& grib,
-        Matrix** matrix) const {
+        Matrix** matrix,  Matrix** matrix2) const {
     Timer timer("gribapi", " read grib");
     MagLog::dev() << "GribRegularInterpretor::interpretAsMatrix" << "\n";
     long nblon = grib.getLong("numberOfPointsAlongAParallel");
@@ -659,6 +659,8 @@ void GribRegularInterpretor::interpretAsMatrix(const GribDecoder& grib,
 
     if (*matrix == 0)
         *matrix = new Matrix(nblat, nblon);
+    if ( matrix2 )
+    	*matrix2 = new Matrix(nblat, nblon);
 
     size_t nb;
     grib_get_size(grib.id(), "values", &nb);
@@ -672,9 +674,8 @@ void GribRegularInterpretor::interpretAsMatrix(const GribDecoder& grib,
     double north = grib.getDouble("latitudeOfFirstGridPointInDegrees");
     double west = grib.getDouble("longitudeOfFirstGridPointInDegrees");
     double south = grib.getDouble("latitudeOfLastGridPointInDegrees");
-    ;
     double east = grib.getDouble("longitudeOfLastGridPointInDegrees");
-    ;
+
     longitudesSanityCheck(west, east);
 
     MagLog::dev() << "NewAPI---> area[" << west << ", " << north << ", " << east
@@ -690,6 +691,20 @@ void GribRegularInterpretor::interpretAsMatrix(const GribDecoder& grib,
 
     latitudes(grib, (*matrix)->rowsAxis());
 
+    if ( matrix2 != NULL) {
+
+    	(*matrix)->xIndex_.reserve((*matrix)->rowsAxis().size());
+    	int offset = 0;
+    	int l = 0;
+    	for ( vector<double>::iterator lat = (*matrix)->rowsAxis().begin(); lat != (*matrix)->rowsAxis().end(); ++lat) {
+    		(*matrix)->yIndex_.insert(make_pair(*lat, l));
+    		l++;
+    		(*matrix)->xIndex_.push_back(InfoIndex(west, east, nblon, offset));
+    		offset += nblon;
+    	}
+    	 (*matrix)->data_.resize(nb);
+    	 (*matrix2)->data_.resize(nb);
+    }
     double x = west;
     for (int i = 0; i < nblon; i++) {
         (*matrix)->columnsAxis().push_back(x);
@@ -719,14 +734,34 @@ void GribRegularInterpretor::interpretAsMatrix(const GribDecoder& grib,
                     d2[j * nblon + i] = d1[i * nblat + j];
                 }
             }
-
             delete d;
+
         } else  // otherwise, just copy the array of values as they are
         {
-            grib_get_double_array(grib.id(), "values", &(*matrix)->front(),
-                    &aux);
+
+
+            if ( matrix2 != NULL ) {
+            	grib_get_double_array(grib.uHandle(), "values", &(*matrix)->front(),
+            	                    &aux);
+            	grib_get_double_array(grib.uHandle(), "values", &(*matrix)->data_.front(),
+                    	                    &aux);
+            	grib_get_double_array(grib.vHandle(), "values", &(*matrix2)->front(),
+                            &aux);
+            	grib_get_double_array(grib.vHandle(), "values", &(*matrix2)->data_.front(),
+                                    &aux);
+            }
+            else
+            	grib_get_double_array(grib.handle(), "values", &(*matrix)->front(),
+            	            	                    &aux);
         }
+        for (int i = 0; i < nblon; i++) {
+        	double lon = (*matrix)->columnsAxis()[i];
+        	for (int j = 0; j < nblat; j++) {
+        		double lat = (*matrix)->rowsAxis()[j];
 
+
+        	}
+        }
         (*matrix)->missing(missing);
 
     } catch (...) {
@@ -749,6 +784,7 @@ void GribRegularInterpretor::latitudes(const GribDecoder& grib,
     for (int i = 0; i < nblat; i++) {
         latitudes.push_back(y);
         y += lat;
+
     }
 
 }
@@ -929,17 +965,19 @@ double GribReducedGaussianInterpretor::XResolution(
 }
 
 void GribReducedGaussianInterpretor::interpretAsMatrix(const GribDecoder& grib,
-        Matrix** matrix) const {
-    MagLog::dev() << "GribRegularInterpretor::interpretAsMatrix" << "\n";
-    MagLog::dev() << "GribRegularInterpretor::interpretAsMatrix" << "\n";
+        Matrix** matrix, Matrix** matrix2) const {
+
 
     Timer timer("gribapi", " read grib");
     *matrix = new Matrix();
+    if ( matrix2 )
+    	 *matrix2 = new Matrix();
     size_t nb;
     grib_get_size(grib.id(), "values", &nb);
     GribDecoder::InterpolateMethod interpolate = grib.interpolateMethod();
     MagLog::dev() << "numberOfFieldValues[" << nb << "]" << "\n";
     double missing = std::numeric_limits<double>::max();
+
     grib.setDouble("missingValue", missing);
 
     (*matrix)->missing(missing);
@@ -953,8 +991,7 @@ void GribReducedGaussianInterpretor::interpretAsMatrix(const GribDecoder& grib,
     long res = grib.getLong("numberOfParallelsBetweenAPoleAndTheEquator");
     long nblat = grib.getLong("Nj");
     longitudesSanityCheck(west, east);
-    MagLog::dev() << "NewAPI---> area[" << west << ", " << north << ", " << east
-            << ", " << south << "]" << "\n";
+    MagLog::dev() << "NewAPI---> area[" << west << ", " << north << ", " << east << ", " << south << "]" << "\n";
     MagLog::dev() << "PLPresent---> " << plp << "\n";
     MagLog::dev() << "Res---> " << res << "\n";
 
@@ -1026,61 +1063,95 @@ void GribReducedGaussianInterpretor::interpretAsMatrix(const GribDecoder& grib,
                 n = 0;
         }
 
-/*
-        // this is the previous version of the code (before using grib_get_reduced_row())
-        // compute find first grid point ..
-        double dx = 360./pl[i];
-        rows.push_back(vector<double>());
-        for ( int n = 0; n < pl[i]; n++) {
-            double x = (n*dx );
-
-            if ( x > east) x-=360.;
-
-            if ( x >= west && x <= east) {
-                rows.back().push_back(x);
-
-            }
-        }
-*/		// This line is suspicious! but I keep it ... Jsut in case!
-        std::sort(rows.back().begin(), rows.back().end());
-
 
         if ( rows.back().size() > nblon) nblon = rows.back().size();
         ii +=  rows.back().size();
     }
 
+// Find the latitudes
+    map<double, map<double, int> > index;
+    double array[2 * res];
+    grib_get_gaussian_latitudes(res, array);
 
+    for (int i = 0; i < 2*res; i++) {
+    	if ( same(array[i], north, 0.001) ) {
+    		(*matrix)->rowsAxis().push_back(array[i]);
+    		(*matrix)->yIndex_.insert(make_pair(array[i], i));
+    		continue;
+    	}
+    	if ( same(array[i], south, 0.001) ) {
+    		(*matrix)->rowsAxis().push_back(array[i]);
+    		(*matrix)->yIndex_.insert(make_pair(array[i], i));
+    		continue;
+    	}
+    	if ( array[i] < north && array[i] > south) {
+    		(*matrix)->rowsAxis().push_back(array[i]);
+    		(*matrix)->yIndex_.insert(make_pair(array[i], i));
+    	}
 
-
-
+    }
+    if ( matrix2 ) {
+    	(*matrix)->xIndex_.reserve((*matrix)->rowsAxis().size());
+	}
 
 
 
     // compute the number of points we'll be adding to the matrix so that we can
     // allocate them in one go, rather than allowing the STL to re-allocate
     // when we reach the capacity
-    (*matrix)->reserve(aux * nblon);
 
     double *data = new double[nb];
+    double *data2 = new double[nb];
+
+
 
-    size_t aux2 = size_t(nb);
+
+    (*matrix)->reserve(aux * nblon);
+       if ( matrix2) {
+       	(*matrix2)->reserve(aux * nblon);
+       	(*matrix2)->data_.reserve(nb);
+       	(*matrix)->data_.reserve(nb);
+       }
 
     double width = east - west;
     double step = (width) / (nblon);
 
-    grib_get_double_array(grib.id(), "values", data, &aux2);
+    grib_get_double_array(grib.id(), "values", data, &aux);
+    if ( matrix2 ) {
+    	grib_get_double_array(grib.uHandle(), "values", data, &aux);
+    	grib_get_double_array(grib.vHandle(), "values", data2, &aux);
+    }
+    else
+    	grib_get_double_array(grib.id(), "values", data, &aux);
 
     int d = 0;
 
     vector<double> missingLon;
 
+    d = 0;
+    vector<double>::iterator ll = (*matrix)->rowsAxis().begin();
+    {
+    Timer timer("map2", " pair");
     for (vector<vector<double> >::iterator row = rows.begin(); row != rows.end(); ++row) {
-        vector<double> p;
 
+    	vector<double> p;
+        p.reserve(row->size());
+        if ( matrix2 ) {
+
+        	(*matrix)->xIndex_.push_back(InfoIndex(row->front(), row->back(), row->size(), d));
+
+        }
+        ++ll;
         for (int ii = 0; ii < row->size(); ii++) {
             p.push_back(data[d]);
+            if ( matrix2 ) {
+                   	(*matrix)->data_.push_back(data[d]);
+                   	(*matrix2)->data_.push_back(data2[d]);
+                   }
             d++;
         }
+
+
         if (interpolate == GribDecoder::nearest_valid ) {
         	// Fill left vector
         	vector<double> left;
@@ -1148,6 +1219,9 @@ void GribReducedGaussianInterpretor::interpretAsMatrix(const GribDecoder& grib,
         }
 
 
+
+
+
         double lon = west;
         unsigned int p1 = 0;
         unsigned int p2 = 1;
@@ -1184,9 +1258,6 @@ void GribReducedGaussianInterpretor::interpretAsMatrix(const GribDecoder& grib,
             double d2 = 1 - d1;
             double val;
 
-
-
-
             if (interpolate == GribDecoder::interpolate) {
                   if (p[p1] == missing )
                         val = p[p2];
@@ -1200,33 +1271,19 @@ void GribReducedGaussianInterpretor::interpretAsMatrix(const GribDecoder& grib,
                  val = (d2 < 0.5) ? p[p1] : p[p2];
                  (*matrix)->push_back(val);
             }
+
             x++;
             lon = west + ( x*step);
         }
 
     }
+    }
     delete[] data;
 
     for (int x = 0; x < nblon; x++) {
         (*matrix)->columnsAxis().push_back(west + (x * step));
     }
 
-    double array[2 * res];
-    grib_get_gaussian_latitudes(res, array);
-
-    for (int i = 0; i < 2*res; i++) {
-
-        if ( same(array[i], north, 0.001) ) {
-            (*matrix)->rowsAxis().push_back(array[i]);
-            continue;
-        }
-        if ( same(array[i], south, 0.001) ) {
-            (*matrix)->rowsAxis().push_back(array[i]);
-            continue;
-        }
-        if ( array[i] < north && array[i] > south)
-            (*matrix)->rowsAxis().push_back(array[i]);
-    }
     (*matrix)->setMapsAxis();
 }
 
@@ -1239,68 +1296,11 @@ void GribReducedLatLonInterpretor::print(ostream& out) const {
 void GribReducedGaussianInterpretor::index(GribDecoder const& grib)
 {
 
-    if ( !index_.empty() )
-        return;
-    double north = grib.getDouble("latitudeOfFirstGridPointInDegrees");
-    west_ = grib.getDouble("longitudeOfFirstGridPointInDegrees");
-    double south = grib.getDouble("latitudeOfLastGridPointInDegrees");
-    east_ = grib.getDouble("longitudeOfLastGridPointInDegrees");
-
-    long res = grib.getLong("numberOfParallelsBetweenAPoleAndTheEquator");
-    long nblat = grib.getLong("Nj");
-    longitudesSanityCheck(west_, east_);
-    size_t aux = 2 * res;
-    double pl[aux];
-
-
-    grib_get_double_array(grib.id(), "pl", pl, &aux);
-    double array[aux];
-
-    grib_get_gaussian_latitudes(res, array);
-
-    int index = 0;
-    bool global;
-
-    // We have to determine if the field is global!
-    if (east_ - west_ > 355.) {
-        global = true;
-    }
-
-
-    for ( int i = 0; i < nblat; i++) {
-        map<double, map<double, int> >::iterator add = index_.end();
-        if ( same(array[i], north, 0.001) )
-            index_.insert(make_pair(array[i], map<double, int>()));
-        if ( same(array[i], north, 0.001) )
-            index_.insert(make_pair(array[i], map<double, int>()));
-        if ( array[i] < north && array[i] > south)
-            index_.insert(make_pair(array[i], map<double, int>()));
-        add = index_.find(array[i]);
-        if ( add ==  index_.end() )
-            continue;
-
-        // compute find first grid point ..
-        double dx = 360./pl[i];
 
-        for ( int n = 0; n < pl[i]; n++) {
-            double x = (n*dx );
-
-            if ( x > east_) x-=360.;
-
-            if ( x >= west_ && x <= east_) {
-                add->second.insert(make_pair(x, index));
-            }
-            index++;
-        }
-        if (global) {
-            map<double, int>::iterator first = add->second.begin();
-            add->second.insert(make_pair(first->first+360, first->second));
-        }
-    }
 
 }
 void GribReducedLatLonInterpretor::interpretAsMatrix(const GribDecoder& grib,
-        Matrix** matrix) const {
+        Matrix** matrix, Matrix** matrix2) const {
 
     Timer timer("gribapi", " read grib");
     *matrix = new Matrix();
@@ -1313,6 +1313,8 @@ void GribReducedLatLonInterpretor::interpretAsMatrix(const GribDecoder& grib,
 
     (*matrix)->missing(missing);
     (*matrix)->akimaEnabled();
+    if ( matrix2 )
+    	*matrix2 = new Matrix();
 
     double north = grib.getDouble("latitudeOfFirstGridPointInDegrees");
     double west = grib.getDouble("longitudeOfFirstGridPointInDegrees");
@@ -1335,8 +1337,9 @@ void GribReducedLatLonInterpretor::interpretAsMatrix(const GribDecoder& grib,
     grib_get_double_array(grib.id(), "pl", pl, &res);
 
     double *data = new double[nb];
+    double *data2 = new double[nb];
 
-    size_t aux2 = size_t(nb);
+    size_t aux = size_t(nb);
 
     int nblon = 0;
     for ( int i = 0; i < res; i++)
@@ -1356,13 +1359,40 @@ void GribReducedLatLonInterpretor::interpretAsMatrix(const GribDecoder& grib,
         step = width / nblon;
     }
 
-    grib_get_double_array(grib.id(), "values", data, &aux2);
+    map<double, map<double, int> > index;
+    for (int x = 0; x < nblon; x++) {
+           (*matrix)->columnsAxis().push_back(west + (x * step));
+       }
+
+       double y = north;
+       for (long i = 0; i < nblat; i++) {
+           (*matrix)->rowsAxis().push_back(y);
+           if ( matrix2)
+        	   (*matrix)->index_.insert(make_pair(y, map<double, pair<double, double> >()));
+
+           y += lat;
+       }
+
+    if ( matrix2) {
+          	(*matrix2)->reserve(aux * nblon);
+          	(*matrix2)->data_.reserve(nb);
+          	(*matrix)->data_.reserve(nb);
+          }
+
+    if ( matrix2 ) {
+    	 grib_get_double_array(grib.uHandle(), "values", data, &aux);
+    	 grib_get_double_array(grib.uHandle(), "values", data2, &aux);
+    }
+    else
+    	 grib_get_double_array(grib.id(), "values", data, &aux);
     int d = 0;
 
 
     for (size_t i = 0; i < res; i++) {
-
-
+    	double lat = (*matrix)->rowsAxis()[i];
+    	(*matrix)->yIndex_.insert(make_pair(lat, i));
+    	if ( matrix2 )
+    	    (*matrix)->xIndex_.push_back(InfoIndex(west, east, pl[i], d));
 
         if (pl[i] == 0) {
             // add missing data
@@ -1375,16 +1405,20 @@ void GribReducedLatLonInterpretor::interpretAsMatrix(const GribDecoder& grib,
             vector<double> lons;
 
             double datastep = width / pl[i];
+            {
+            	Timer timer("map", "pair");
+
             for (int ii = 0; ii < pl[i]; ii++) {
                 p.push_back(data[d]);
-                lons.push_back( west + (ii*datastep) );
+                double lon = west + (ii*datastep);
+                lons.push_back( lon );
+                if ( matrix2 ) {
+                      (*matrix)->data_.push_back(data[d]);
+                      (*matrix2)->data_.push_back(data2[d]);
+                }
+
                 d++;
             }
-            ASSERT( p.size() ==  pl[i]);
-            if ( global ) {
-                p.push_back(p.front());
-                lons.push_back( lons.back() + datastep );
-
             }
 
 
@@ -1450,17 +1484,9 @@ void GribReducedLatLonInterpretor::interpretAsMatrix(const GribDecoder& grib,
     }
 
     delete[] data;
+    delete[] data2;
 
 
-    for (int x = 0; x < nblon; x++) {
-        (*matrix)->columnsAxis().push_back(west + (x * step));
-    }
-
-    double y = north;
-    for (long i = 0; i < nblat; i++) {
-        (*matrix)->rowsAxis().push_back(y);
-        y += lat;
-    }
 
     (*matrix)->setMapsAxis();
 }
@@ -1566,7 +1592,7 @@ pair<double, double> GribRotatedInterpretor::rotate(double lat_y,
 }
 
 void GribLambertAzimutalInterpretor::interpretAsMatrix(const GribDecoder& grib,
-        Matrix** matrix) const {
+        Matrix** matrix, Matrix** matrix2) const {
     long im = grib.getLong("numberOfPointsAlongXAxis");
     long jm = grib.getLong("numberOfPointsAlongYAxis");
 
@@ -1620,7 +1646,7 @@ void GribLambertAzimutalInterpretor::print(ostream& out) const {
 }
 
 void GribRotatedInterpretor::interpretAsMatrix(const GribDecoder& grib,
-        Matrix** matrix) const {
+        Matrix** matrix, Matrix** matrix2) const {
 
     southPoleLat_ = grib.getDouble("latitudeOfSouthernPoleInDegrees");
     southPoleLon_ = grib.getDouble("longitudeOfSouthernPoleInDegrees");
@@ -1871,7 +1897,7 @@ void GribRotatedInterpretor::raw(const GribDecoder& grib,
 }
 
 void GribLambertInterpretor::interpretAsMatrix(const GribDecoder& grib,
-        Matrix** matrix) const {
+        Matrix** matrix, Matrix** matrix2) const {
     long im = grib.getLong("numberOfPointsAlongXAxis");
     long jm = grib.getLong("numberOfPointsAlongYAxis");
 
@@ -2120,7 +2146,7 @@ void GribPolarStereoInterpretor::print(ostream& out) const {
     out << "]";
 }
 void GribPolarStereoInterpretor::interpretAsMatrix(const GribDecoder& grib,
-        Matrix** matrix) const {
+        Matrix** matrix, Matrix** matrix2) const {
     long im = 3600;
     long jm = 1800;
 
diff --git a/src/decoders/GribRegularInterpretor.h b/src/decoders/GribRegularInterpretor.h
index 5fab4a9..4d9457d 100644
--- a/src/decoders/GribRegularInterpretor.h
+++ b/src/decoders/GribRegularInterpretor.h
@@ -42,7 +42,7 @@ public:
 	GribRegularInterpretor();
 	virtual ~GribRegularInterpretor();
 	
-	void interpretAsMatrix(const GribDecoder&, Matrix**) const; 
+	void interpretAsMatrix(const GribDecoder&, Matrix**,Matrix** matrix2 = NULL) const;
 	virtual double XResolution(const GribDecoder& grib) const { return  longitudeIncrement(grib); }
 	void interpretAsMatrix(const GribDecoder&, Matrix**, const Transformation&) const; 
 	virtual void interpretAsRaster(const GribDecoder&, RasterData&, const Transformation&) const;
@@ -75,7 +75,7 @@ public:
 	virtual ~GribReducedGaussianInterpretor() {}
 	
 	virtual double XResolution(const GribDecoder& grib) const;
-	void interpretAsMatrix(const GribDecoder&, Matrix**) const; 
+	void interpretAsMatrix(const GribDecoder&, Matrix**, Matrix** matrix2 = NULL) const;
 	void interpretAsMatrix(const GribDecoder&, Matrix**, const Transformation&) const; 
 	void interpretAsRaster(const GribDecoder&, RasterData&, const Transformation&) const;
 	void  index(const GribDecoder& grib);
@@ -103,7 +103,7 @@ public:
 	GribReducedLatLonInterpretor() {}
 	virtual ~GribReducedLatLonInterpretor() {}
 
-	void interpretAsMatrix(const GribDecoder&, Matrix**) const; 
+	void interpretAsMatrix(const GribDecoder&, Matrix**, Matrix** matrix2 = NULL) const;
 	virtual double XResolution(const GribDecoder& grib) const;
 	
 protected:
@@ -134,7 +134,7 @@ public:
 	PaperPoint reference(const GribDecoder&, const Transformation&);
 	void raw(const GribDecoder&, const Transformation&, const string&, map<double, map<double, CustomisedPoint*> >& ) const;
 	void keepOriginal(bool original) { original_ = original; }
-	void interpretAsMatrix(const GribDecoder&, Matrix**) const; 
+	void interpretAsMatrix(const GribDecoder&, Matrix**, Matrix** matrix2 = NULL) const;
 	void interpret2D(double&, double&, double&, double&) const;
 protected:
      //! Method to print string about this class on to a stream of type ostream (virtual).
@@ -154,7 +154,7 @@ public:
 	virtual ~GribLambertAzimutalInterpretor() {}
 	
 	UserPoint unrotate(double lat, double lon) const;
-	void interpretAsMatrix(const GribDecoder&, Matrix**) const; 
+	void interpretAsMatrix(const GribDecoder&, Matrix**, Matrix** matrix2 = NULL) const;
 	PaperPoint reference(const GribDecoder&, const Transformation&);
 	double XResolution(const GribDecoder& grib) const;
 
@@ -174,7 +174,7 @@ public:
 	virtual ~GribLambertInterpretor() {}
 
 
-	void interpretAsMatrix(const GribDecoder&, Matrix**) const;
+	void interpretAsMatrix(const GribDecoder&, Matrix**, Matrix** matrix2 = NULL) const;
 
 protected:
      //! Method to print string about this class on to a stream of type ostream (virtual).
@@ -192,7 +192,7 @@ public:
 	virtual ~GribPolarStereoInterpretor() {}
 
 
-	void interpretAsMatrix(const GribDecoder&, Matrix**) const;
+	void interpretAsMatrix(const GribDecoder&, Matrix**, Matrix** matrix2 = NULL) const;
 
 protected:
      //! Method to print string about this class on to a stream of type ostream (virtual).
diff --git a/src/decoders/ShapeDecoder.cc b/src/decoders/ShapeDecoder.cc
index d96895c..7ea7c18 100644
--- a/src/decoders/ShapeDecoder.cc
+++ b/src/decoders/ShapeDecoder.cc
@@ -291,7 +291,7 @@ void ShapeDecoder::decode(const Transformation& transformation, const string& fi
 /*! \brief Decoder to read land and lakes
  \sa CoastPlotting::decode(const Layout& parent )
 */
-void ShapeDecoder::decode(vector<Polyline>& data, const Transformation& transformation)
+void ShapeDecoder::decode(vector<Polyline*>& data, const Transformation& transformation)
 {
 	Timer timer("Read Shape file ", "read shape file" + path_);
 
@@ -350,21 +350,21 @@ void ShapeDecoder::decode(vector<Polyline>& data, const Transformation& transfor
 				}
 
 				if ( !in && !right && !left ) continue;
-				VectorOfPointers<vector<Polyline *> > polys;
+
 				Polyline* poly = 0;
                 Polyline* polyleft = 0;
                 Polyline* polyright = 0; 
                 if ( in) {
                     poly  = new Polyline();
-                    polys.push_back(poly);
+                    data.push_back(poly);
                 }
 				if ( left ) {
                     polyleft  = new Polyline();
-                    polys.push_back(polyleft);
+                    data.push_back(polyleft);
                 }
                 if ( right ) {
                     polyright  = new Polyline();
-                    polys.push_back(polyright);
+                    data.push_back(polyright);
                 }
                 
 				left = false;
@@ -386,6 +386,7 @@ void ShapeDecoder::decode(vector<Polyline>& data, const Transformation& transfor
 					const double y = psShape->padfY[j];
 
 					if ( iPart==1 ) {
+
 							if ( poly )      poly->push_back(PaperPoint(x, y));
 							if ( polyleft )  polyleft->push_back( PaperPoint(x-360, y));
 							if ( polyright ) polyright->push_back(PaperPoint(x+360, y));
@@ -398,18 +399,21 @@ void ShapeDecoder::decode(vector<Polyline>& data, const Transformation& transfor
 				}
 
 	            /// first we clip
+				/*
                 for (vector<Polyline*>::iterator poly = polys.begin(); poly != polys.end(); ++poly ) {
-                    //(*poly)->sanityCheck();
+                	transformation(**poly, data);
+
                     vector<Polyline> clipped;
                     geobox.intersect(**poly, clipped);
 	                // then we reproject!
                     for (vector<Polyline>::iterator clip = clipped.begin(); clip != clipped.end(); ++clip ) {
                     	clip->reproject(transformation);
-                    	//clip->sanityCheck();
                     	box.intersect(*clip, data);
-                    	//data.push_back(*clip);
-                    }
-                }
+                    	data.push_back(*clip);
+                    }}
+				*/
+
+
 			}
 			SHPDestroyObject(psShape);
 			SHPClose( hSHP );
@@ -419,3 +423,5 @@ void ShapeDecoder::decode(vector<Polyline>& data, const Transformation& transfor
 			MagLog::error() << "Can not open Shapefile " << path_ << endl;
 		}
 }
+
+
diff --git a/src/decoders/ShapeDecoder.h b/src/decoders/ShapeDecoder.h
index 2712ba8..a23db8b 100644
--- a/src/decoders/ShapeDecoder.h
+++ b/src/decoders/ShapeDecoder.h
@@ -58,7 +58,9 @@ public:
 
 	virtual void decode(const Transformation&);
 
-	virtual void decode(vector<Polyline>&, const Transformation&);
+	virtual void decode(vector<Polyline*>&, const Transformation&);
+	void clip(const Transformation&,const vector<Polyline>&, vector<Polyline*>&) const;
+	void clipAndClose(const Transformation&, const vector<Polyline>&, vector<Polyline*>&) const;
 	virtual void decode(const Transformation&, const string&, const vector<string>&);
 	void set(const map<string, string>& map ) { ShapeDecoderAttributes::set(map); }
 	void set(const XmlNode& node ) { ShapeDecoderAttributes::set(node); }
diff --git a/src/drivers/BaseDriver.cc b/src/drivers/BaseDriver.cc
index a5920b0..ff14b6c 100644
--- a/src/drivers/BaseDriver.cc
+++ b/src/drivers/BaseDriver.cc
@@ -947,11 +947,14 @@ void BaseDriver::redisplay(const BinaryObject& binary) const
 
 			for(int pts=0;pts<n;pts++)
 			{
-			  double x,y;
-			  in.read((char *)(&x), sizeof(double));
-			  in.read((char *)(&y), sizeof(double));
-			  PaperPoint p;
-			  in.read((char *)(&p), sizeof(PaperPoint));
+			  double x,y,ax,ay;
+			  in.read((char *)(&x),  sizeof(double));
+			  in.read((char *)(&y),  sizeof(double));
+			  in.read((char *)(&ax), sizeof(double));
+			  in.read((char *)(&ay), sizeof(double));
+			  //PaperPoint p;
+			  //in.read((char *)(&p), sizeof(PaperPoint));
+			  PaperPoint p(ax,ay);
 			  ArrowPoint ap(x, y, p);
 			  arrow.push_back(ap);
 			} 
@@ -995,14 +998,17 @@ void BaseDriver::redisplay(const BinaryObject& binary) const
 			tex[len]='\0';
 			string str(tex);
 			flag.setOriginMarker(str);
-
+	
 			for(int pts=0;pts<n;pts++)
 			{
-			  double x,y;
-			  in.read((char *)(&x), sizeof(double));
-			  in.read((char *)(&y), sizeof(double));
-			  PaperPoint p;
-			  in.read((char *)(&p), sizeof(PaperPoint));
+			  double x,y,ax,ay;
+			  in.read((char *)(&x),  sizeof(double));
+			  in.read((char *)(&y),  sizeof(double));
+			  in.read((char *)(&ax), sizeof(double));
+			  in.read((char *)(&ay), sizeof(double));
+			  //PaperPoint p;
+			  //in.read((char *)(&p), sizeof(PaperPoint));
+			  PaperPoint p(ax,ay);
 			  ArrowPoint ap(x, y, p);
 			  flag.push_back(ap);
 			} 
diff --git a/src/drivers/BaseDriverSymbols.h b/src/drivers/BaseDriverSymbols.h
index e9dd4c1..0b68bc9 100644
--- a/src/drivers/BaseDriverSymbols.h
+++ b/src/drivers/BaseDriverSymbols.h
@@ -123,6 +123,7 @@ MAGICS_NO_EXPORT void BaseDriver::renderTextSymbols(const TextSymbol& symbol) co
 	//Loop for all positions
 	for(int i=0;i< nPos ;i++)
 	{
+	  if(!symbol.text().at(i).empty()) {
 		Text text;
 		text.setJustification(MCENTRE);
 		text.setVerticalAlign(MHALF);
@@ -162,6 +163,7 @@ MAGICS_NO_EXPORT void BaseDriver::renderTextSymbols(const TextSymbol& symbol) co
 		text.setAngle(0.);
 		text.addText(symbol.text().at(i), symbol.font()); //75 dpi
 		renderText(text);
+	  }
 	}
 	renderSymbols(symbol);
 }
diff --git a/src/drivers/BinaryDriver.cc b/src/drivers/BinaryDriver.cc
index ea4b3eb..8096429 100644
--- a/src/drivers/BinaryDriver.cc
+++ b/src/drivers/BinaryDriver.cc
@@ -301,12 +301,16 @@ void BinaryDriver::renderWindArrow(const Arrow &arrow) const
         for(int pts=0;pts<no;pts++)
         {
           const double x = arr->x_;
-	  out_.write((char *)(&x), sizeof(double));
+          out_.write((char *)(&x), sizeof(double));
           const double y = arr->y_;
-	  out_.write((char *)(&y), sizeof(double));
+          out_.write((char *)(&y), sizeof(double));
           const PaperPoint p = arr->point_;
-	  out_.write((char *)(&p), sizeof(PaperPoint));
-	  ++arr;
+          const double ax = p.x();
+          out_.write((char *)(&ax), sizeof(double));
+          const double ay = p.y();
+          out_.write((char *)(&ay), sizeof(double));
+//          out_.write((char *)(&p), sizeof(PaperPoint));
+          ++arr;
         }
 }
 
@@ -361,12 +365,16 @@ void BinaryDriver::renderWindFlag(const Flag &flag) const
         for(int pts=0;pts<no;pts++)
         {
           const double x = fla->x_;
-	  out_.write((char *)(&x), sizeof(double));
+          out_.write((char *)(&x), sizeof(double));
           const double y = fla->y_;
-	  out_.write((char *)(&y), sizeof(double));
+          out_.write((char *)(&y), sizeof(double));
           const PaperPoint p = fla->point_;
-	  out_.write((char *)(&p), sizeof(PaperPoint));
-	  ++fla;
+          const double ax = p.x();
+          out_.write((char *)(&ax), sizeof(double));
+          const double ay = p.y();
+          out_.write((char *)(&ay), sizeof(double));
+//          out_.write((char *)(&p), sizeof(PaperPoint));
+          ++fla;
         }
 }
 
diff --git a/src/drivers/CairoDriver.cc b/src/drivers/CairoDriver.cc
index 0782e56..21657b6 100644
--- a/src/drivers/CairoDriver.cc
+++ b/src/drivers/CairoDriver.cc
@@ -539,8 +539,8 @@ MAGICS_NO_EXPORT void CairoDriver::write_tiff() const
 
     // DPI
     TIFFSetField(tif, TIFFTAG_RESOLUTIONUNIT, RESUNIT_INCH);
-    TIFFSetField(tif, TIFFTAG_XRESOLUTION, (float) 90.;// resolution_);
-    TIFFSetField(tif, TIFFTAG_YRESOLUTION, (float) 90.;// resolution_);
+    TIFFSetField(tif, TIFFTAG_XRESOLUTION, (float) 90.);
+    TIFFSetField(tif, TIFFTAG_YRESOLUTION, (float) 90.);
 
     unsigned char *buf;
     if (TIFFScanlineSize(tif))
@@ -1193,6 +1193,7 @@ MAGICS_NO_EXPORT void CairoDriver::renderText(const Text& text) const
 
 	for(;niceText<niceTextEnd;niceText++)
 	{
+		if ((*niceText).text().empty()) continue;
 		MagFont magfont = (*niceText).font();
 		const std::set<string>& styles = magfont.styles();
 
@@ -1323,9 +1324,12 @@ MAGICS_NO_EXPORT void CairoDriver::circle(const MFloat x, const MFloat y, const
 
 //	cairo_identity_matrix (cr_);
 	cairo_set_line_width (cr_, currentLineWidth_);
-	cairo_set_source_rgba(cr_,currentColour_.red(),currentColour_.green(),currentColour_.blue(),currentColour_.alpha());
-
 	int fill = s;
+	if(fill==10) {
+		cairo_set_line_width (cr_, currentLineWidth_*5);
+		fill=0;
+	}
+	cairo_set_source_rgba(cr_,currentColour_.red(),currentColour_.green(),currentColour_.blue(),currentColour_.alpha());
 
 	//if(s > 8) fill = 8;
 	if( (s > 0) && (fill != 9) )
diff --git a/src/drivers/PostScriptDriver.cc b/src/drivers/PostScriptDriver.cc
index 3c6b9ed..242f86d 100644
--- a/src/drivers/PostScriptDriver.cc
+++ b/src/drivers/PostScriptDriver.cc
@@ -1204,7 +1204,8 @@ MAGICS_NO_EXPORT bool PostScriptDriver::renderPixmap(MFloat x0,MFloat y0,MFloat
 	  for(int i=width-1;i>=0;i--)
 	  {
 		// Get image left-right and bottom-up
-		const int n = ( landscape ) ? (height*i+j)*3 : (j*width + width-1-i )*3;
+		int n = ( landscape ) ? (height*i+j)*3 : (j*width + width-1-i )*3;
+		if(alpha) n = ( landscape ) ? (height*i+j)*4 : (j*width + width-1-i )*4;
 		unsigned char *p2 = p+n;
 		unsigned char r = *(p2++);
 		unsigned char g = *(p2++);
diff --git a/src/drivers/SVGDriver.cc b/src/drivers/SVGDriver.cc
index 06b5ef3..f29faaa 100644
--- a/src/drivers/SVGDriver.cc
+++ b/src/drivers/SVGDriver.cc
@@ -1396,54 +1396,33 @@ else
 */
 MAGICS_NO_EXPORT void SVGDriver::renderImage(const ImportObject& obj) const
 {
-	closeGroup();
-	std::string file = obj.getPath();
-
-	string format = obj.getFormat();
-	if(magCompare(format,"ps") || magCompare(format,"pdf"))
+/*	if(magCompare(logoLocation_,"LOCAL"))
 	{
-		std::string cmd = "convert "+file+"[1] ___magics_svg_temp.png";
-		MagLog::info() <<"SVGDriver::renderImage calling convert ... with: " <<cmd << endl;
-		int status = system(cmd.c_str());
-		if(status)
-		{
-			MagLog::error() << "\nSVGDriver: Command exit not zero - NO PNG produced!\n"
-			             << " COMMAND: "<<cmd<<"\n"<< endl;
-			return;
-		}
-		file="___magics_svg_temp.png";
-	}
+	  closeGroup();
+	  std::string file = obj.getPath();
 
-	const MFloat w = (obj.getWidth()<0)  ? 30./coordRatioX_ : obj.getWidth();
-	const MFloat h = (obj.getHeight()<0) ? 30./coordRatioY_ : obj.getHeight();
+	  string format = obj.getFormat();
 
-	if(!magCompare(format,"svg"))
-	{
-		const MFloat x = projectX(obj.getOrigin().x());
-		const MFloat y = projectY(obj.getOrigin().y());
-		const MFloat oh = projectY(obj.getOrigin().y()+h) - y;
-		const MFloat ow = projectX(obj.getOrigin().x()+w) - x;
+	  const MFloat w = (obj.getWidth()<0)  ? 30./coordRatioX_ : obj.getWidth();
+	  const MFloat h = (obj.getHeight()<0) ? 30./coordRatioY_ : obj.getHeight();
 
-		const ImageProperties::OriginReference ori = obj.getOriginReference();
-		if(ori == ImageProperties::centre)
+	  const MFloat x = projectX(obj.getOrigin().x());
+	  const MFloat y = projectY(obj.getOrigin().y());
+	  const MFloat oh = projectY(obj.getOrigin().y()+h) - y;
+	  const MFloat ow = projectX(obj.getOrigin().x()+w) - x;
+
+	  const ImageProperties::OriginReference ori = obj.getOriginReference();
+	  if(ori == ImageProperties::centre)
 			pFile_ << "<image x=\""<<x-(ow*.5)<<"\" y=\""<<setY(y)-(oh*.5);
-		else
+	  else
 			pFile_ << "<image x=\""<<x<<"\" y=\""<<setY(y)-oh;
-		pFile_  <<"\" width=\""  << ow
+	  pFile_  <<"\" width=\""  << ow
 		        <<"\" height=\"" << oh
 		        <<"\" xlink:href=\""<<file<<"\" />\n";
 	}
-	else
+	else */
 	{
-		ifstream svgfile(file.c_str());
-		if(!svgfile){
-			MagLog::error() << "SVGDriver::renderImage() --> Cannot open SVG file! " << file <<"!\n";
-			return;
-		}
-		char ch;
-		while (svgfile.get(ch)){pFile_.put(ch);}
-		svgfile.close();
-		svg_output_resource_list_.push_back(file);
+		BaseDriver::renderImage(obj);
 	}
 }
 
diff --git a/src/params/CMakeLists.txt b/src/params/CMakeLists.txt
index 43b4c96..8289039 100644
--- a/src/params/CMakeLists.txt
+++ b/src/params/CMakeLists.txt
@@ -246,7 +246,7 @@ LandgramDecoder.xml
 MetgramCurve.xml
 MetgramFlags.xml
 MetgramGraph.xml
-
+MetgramBar.xml
 
 ObsTable.xml
 ObsJSon.xml
diff --git a/src/params/CellShading.xml b/src/params/CellShading.xml
index 26ab63a..93cbd00 100644
--- a/src/params/CellShading.xml
+++ b/src/params/CellShading.xml
@@ -3,11 +3,17 @@
 	
   	<parameter member="resolution" to="float" default="10" from="float" name="contour_shade_cell_resolution">
          		<documentation> Number of cells per cm for CELL shading 		</documentation> 
-         		<release>0.8		</release>
+         		
   	</parameter>
   
   	<parameter from="string" name="contour_shade_cell_method" default="nearest" member="method" to="string" values="nearest/interpolate">
          		<documentation> NMethod of determining the colour of a cell (INTERPOLATE/ NEAREST) 		</documentation>
-         		<release>0.8		</release>
+         		
   	</parameter>
-</class></magics>
+  	<parameter from="string" name="contour_shade_cell_resolution_method" default="classic" member="resolution_method" to="string" values="classic/adaptive">
+         		<documentation> if adaptive, magics will switch to grid_shading when the data resolution is greater that the requested resolution </documentation>
+         		
+  	</parameter>
+</class>
+
+</magics>
diff --git a/src/params/GeoJSon.xml b/src/params/GeoJSon.xml
index 0531572..9e021ff 100644
--- a/src/params/GeoJSon.xml
+++ b/src/params/GeoJSon.xml
@@ -10,6 +10,9 @@
     <parameter member="input" to="string" default="{}" from="string" name="geojson_input">
   			<documentation> String containing the GeoJson data 		</documentation>
  	</parameter>   
+ 	<parameter member="binning_resolution" to="float" default="1." from="float" name="geojson_binning_grid_resolution">
+  			<documentation> String containing the GeoJson data 		</documentation>
+ 	</parameter>   
 </class>
 
 </magics>
diff --git a/src/params/MetgramBar.xml b/src/params/MetgramBar.xml
new file mode 100644
index 0000000..e63afa2
--- /dev/null
+++ b/src/params/MetgramBar.xml
@@ -0,0 +1,17 @@
+<magics>
+<class action="pmetgram" directory="visualisers" prefix="metgram" xmltag="metgraph" name="MetgramBar">
+    	<documentation>
+        The metgram curve will plot the metgram a s a curve! 
+    	</documentation>
+        	
+        	<parameter member="keyword" to="string" default="curve1" from="string" name="metgram_bar_keyword">           
+            		<documentation> keyword used for define the bars	</documentation>
+        	</parameter>
+        	
+        	<parameter member="colour" to="Colour" default="blue" from="string" name="metgram_bar_colour">           
+            		<documentation> Colour of the curve  		</documentation>
+        	</parameter>
+        	
+         	
+</class>
+</magics>
diff --git a/src/params/MetgramCurve.xml b/src/params/MetgramCurve.xml
index 316db78..66dfb9f 100644
--- a/src/params/MetgramCurve.xml
+++ b/src/params/MetgramCurve.xml
@@ -9,9 +9,17 @@
         	<parameter member="style2" to="LineStyle" default="solid" from="string" name="metgram_curve2_line_style">           
             		<documentation> LineStyle of the second curve  		</documentation>
         	</parameter>
+        	<parameter member="keyword1" to="string" default="curve1" from="string" name="metgram_curve_keyword">           
+            		<documentation> keyword used for fefine the first curve		</documentation>
+        	</parameter>
+        	<parameter member="keyword2" to="string" default="curve2" from="string" name="metgram_curve_keyword2">           
+            		<documentation> keyword used for fefine the second curve		</documentation>
+        	</parameter>
+  
         	<parameter member="colour" to="Colour" default="red" from="string" name="metgram_curve_colour">           
             		<documentation> Colour of the curve  		</documentation>
         	</parameter>
+        	
          	<parameter member="colour2" to="Colour" default="blue" from="string" name="metgram_curve2_colour">           
             		<documentation> Colour of the second curve  		</documentation>
         	</parameter>
diff --git a/src/params/MetgramFlags.xml b/src/params/MetgramFlags.xml
index 5026a76..20c65b5 100644
--- a/src/params/MetgramFlags.xml
+++ b/src/params/MetgramFlags.xml
@@ -9,6 +9,15 @@
         	<parameter member="frequency" to="int" default="1" from="int" name="metgram_flag_frequency">           
             		<documentation> Frequency to plot the flags  		</documentation>
         	</parameter>
+        	<parameter member="method" to="string" default="SD" from="string" name="metgram_flag_method">           
+            		<documentation> SD : speed/direction is given UV : U/V components  		</documentation>
+        	</parameter>
+        	<parameter member="component1" to="string" default="curve1" from="string" name="metgram_flag_component1">           
+            		<documentation> Keyword used for the First component  		</documentation>
+        	</parameter>
+        	<parameter member="component2" to="string" default="curve2" from="string" name="metgram_flag_component2">           
+            		<documentation> Keyword used for the second component  		</documentation>
+        	</parameter>
         	<parameter member="length" to="float" default="0.5" from="float" name="metgram_flag_length">           
             		<documentation> length of the flag  		</documentation>
         	</parameter>
diff --git a/src/params/SimplePolyline.xml b/src/params/SimplePolyline.xml
index 1dfcc0b..75a85ce 100644
--- a/src/params/SimplePolyline.xml
+++ b/src/params/SimplePolyline.xml
@@ -2,7 +2,7 @@
 <class inherits="SimplePolylineInput" xmltag="polyline" name="SimplePolyline" directory="visualisers" prefix="polyline/polyline_line" action="pline" interface="ColourTechniqueInterface/LevelSelectionInterface">
  	<parameter member="legend" to="bool" default="off" from="string" name="legend">
          		<release>Magics++2.80		</release>
-         		<documentation> Turn the legend on 		</documentation>
+         		<documentation> Turn the legend on 		</documentation>f
   	</parameter>
   	<parameter member="colour" to="Colour" default="blue" from="string" name="polyline_line_colour">
          		<release>Magics++2.1		</release>
@@ -16,6 +16,21 @@
          		<release>Magics++2.1		</release>
          		<documentation> Thickness of the polylines 		</documentation>
   	</parameter>
+
+    <parameter member="method" to="string" default="classic" from="string" name="polyline_effect_method" values="classic/trajectory">
+            
+            <documentation> Method applied to draw the line   </documentation>
+    </parameter>
+
+    <parameter member="pivot" to="int" default="-1" from="int" name="polyline_trajectory_pivot_index" >
+            <documentation> Method applied to draw the line   </documentation>
+    </parameter>
+   
+    
+    <parameter member="factor" to="int" default="-1" from="int" name="polyline_trajectory_factor" >
+            
+            <documentation> Method applied to draw the line   </documentation>
+    </parameter>
   
   	<parameter member="count" to="int" default="10" from="int" name="polyline_level_count">
          		<documentation> Count or number of levels to be plotted. Magics will try to find "nice levels", 
@@ -94,5 +109,75 @@
          		<documentation> List of colours to be used in polygon shading. 		</documentation>
          		<release>Magics++2.1		</release>
   	</parameter>
+  	<parameter from="string" name="polyline_priority_variable_name" default="" member="priority_key" to="string">
+         		<documentation> Variable used for setting the priority of the segments 		</documentation>
+
+  	</parameter>
+  	
+  	<parameter from="string" name="polyline_colour_variable_name" default="" member="colour_key" to="string">
+         		<documentation> Data Variable used for setting the colour of the segments 		</documentation>
+
+  	</parameter>
+  	<parameter from="stringarray" name="polyline_colour_list" default="stringarray()" member="colour_list" to="stringarray">
+         		<documentation> list of colours to use 		</documentation>
+  	</parameter>
+  	<parameter from="floatarray" name="polyline_colour_level_list" default="floatarray()" member="colour_level_list" to="floatarray">
+         		<documentation> level list to use for setting the colours		</documentation>
+  	</parameter>
+  		<parameter from="string" name="polyline_colour_list_policy" default="lastone" member="colour_policy" to="ListPolicy">
+         		<documentation> What to do if the list of colours is smaller that the list of levels: lastone/cycle  	</documentation>
+  	</parameter>
+  	
+  	<parameter from="string" name="polyline_line_style_variable_name" default="" member="style_key" to="string">
+         		<documentation> Data Variable used for setting the line style of the segments 		</documentation>
+
+  	</parameter>
+  	<parameter from="stringarray" name="polyline_line_style_list" default="stringarray()" member="style_list" to="stringarray">
+         		<documentation> list of line styles to use 		</documentation>
+  	</parameter>
+  	<parameter from="floatarray" name="polyline_line_style_level_list" default="floatarray()" member="style_level_list" to="floatarray">
+         		<documentation> level list to use for setting the colours </documentation>
+  	</parameter>
+  		<parameter from="string" name="polyline_line_style_list_policy" default="lastone" member="style_policy" to="ListPolicy">
+         		<documentation> What to do if the list of line styles is smaller that the list of levels: lastone/cycle  	</documentation>
+  	</parameter>
+  	<parameter from="string" name="polyline_thickness_variable_name" default="" member="thickness_key" to="string">
+         		<documentation> Data Variable used for setting the thickness of the segments 		</documentation>
+
+  	</parameter>
+  	<parameter from="floatarray" name="polyline_thickness_list" default="floatarray()" member="thickness_list" to="floatarray">
+         		<documentation> list of thicknesses to use 		</documentation>
+  	</parameter>
+  	<parameter from="floatarray" name="polyline_thickness_level_list" default="floatarray()" member="thickness_level_list" to="floatarray">
+         		<documentation> level list to use for setting the Thickness </documentation>
+  	</parameter>
+  	<parameter from="string" name="polyline_thickness_list_policy" default="lastone" member="thickness_policy" to="ListPolicy">
+         		<documentation> What to do if the list of line styles is smaller that the list of levels: lastone/cycle  	</documentation>
+  	</parameter>
+  	<parameter from="string" name="polyline_transparency_variable_name" default="" member="transparency_key" to="string">
+     <documentation> Data Variable used for setting the transparency of the segments 		</documentation>
+  	</parameter>
+  	<parameter from="string" name="polyline_transparency_pivot_variable_name" default="" member="pivot_key" to="string">
+      <documentation> Data Variable used for setting the pivot used to compute the transparency of the segments 		</documentation>
+  	</parameter>
+  	<parameter from="string" name="polyline_pivot_marker" default="none" member="pivot_marker" to="string" values='all/none/lastone'>
+      <documentation> Add a marker to the the last trajectory plotted to materialse the pivot 		</documentation>
+  	</parameter>
+  	<parameter from="string" name="polyline_pivot_marker_name" default="cyclone" member="pivot_marker_name" to="string">
+      <documentation> name of the marker to use		</documentation>
+  	</parameter>
+  	<parameter from="float" name="polyline_pivot_marker_height" default="0.4" member="pivot_marker_height" to="float">
+      <documentation> height of the marker to use		</documentation>
+  	</parameter>
+  	<parameter from="string" name="polyline_pivot_marker_colour" default="black" member="pivot_marker_colour" to="Colour">
+      <documentation> Colour of the marker to use		</documentation>
+  	</parameter>
+  	<parameter from="floatarray" name="polyline_transparency_level_list" default="floatarray()" member="transparency_level_list" to="floatarray">
+         		<documentation> level list to use for setting the Transparency </documentation>
+  	</parameter>
+  	<parameter from="string" name="polyline_legend_only" visible="off" default="off" member="legend_only" to="bool" >
+	
+			<documentation for_docs="no"> Wrep only : to build only the legend... 		</documentation>
+	</parameter>
 
 </class></magics>
diff --git a/src/visualisers/CellShading.cc b/src/visualisers/CellShading.cc
index 35efb7f..8a73e4f 100644
--- a/src/visualisers/CellShading.cc
+++ b/src/visualisers/CellShading.cc
@@ -37,7 +37,7 @@
 using namespace magics;
 
 
-CellShading::CellShading()
+CellShading::CellShading() : shading_("grid")
 {
 }
 
@@ -46,8 +46,28 @@ CellShading::~CellShading()
 {
 }
 
+int CellShading::index(double value)
+{
+	return map_.find(value, -1);
+}
+
+void CellShading::operator()(Polyline* poly) const
+{
+	int index = poly->index();
+	if (index < 0  )
+		return;
+
+	poly->setStroke(false);
+	poly->setFilled(true);
+	if ( index >= colours_.size() )
+		poly->setFillColour(colours_.back());
+	else
+		poly->setFillColour(colours_[index]);
+	FillShadingProperties* shading = new FillShadingProperties();
+	poly->setShading(shading);
+}
 
-void CellShading::operator()( MatrixHandler& data, BasicGraphicsObjectContainer& parent)
+void CellShading::operator()(IsoPlot* iso, MatrixHandler& data, BasicGraphicsObjectContainer& parent)
 {
 	// Here we have to work using the parentput projection.
 	
@@ -58,9 +78,19 @@ void CellShading::operator()( MatrixHandler& data, BasicGraphicsObjectContainer&
 	double minr = projection.getMinPCY();
 	double maxr = projection.getMaxPCY();
 	
-	double width =  parent.absoluteWidth();
-	double height =  parent.absoluteHeight();
-	
+	double width =  parent.absoluteWidth(); // in cm
+	double height =  parent.absoluteHeight(); // in cm
+	shading_ = "grid";
+
+
+
+	PaperPoint middle((maxc-minc)/2, (maxr-minr)/2);
+
+
+
+
+
+	shading_ = "cell";
 	MagLog::debug() << "minx="   << minc << endl;
 	MagLog::debug() << "maxx="   << maxc << endl;
 	MagLog::debug() << "miny="   << minr << endl;
@@ -78,8 +108,26 @@ void CellShading::operator()( MatrixHandler& data, BasicGraphicsObjectContainer&
 	MagLog::debug() << "rows=" << rows << endl;
 	MagLog::debug() << "columns=" << columns << endl;
 	
-	UserPoint point;
+	UserPoint point, point1;
 	double value;
+	PaperPoint middle2(middle.x()+stepc, middle.y() + stepr);
+	projection.revert(middle, point);
+	projection.revert(middle2, point1);
+
+	UserPoint nextdata(point.x() + data.XResolution(), point.y() + data.YResolution());
+	double distance_plot = projection.distance(point, point1);
+	double distance_data = projection.distance(point, nextdata);
+
+
+	if ( magCompare(resolution_method_, "adaptive" ) ) {
+
+		if (   distance_plot < distance_data ) {
+			iso->isoline(data, parent);
+			cout << "Grid Shading" << endl;
+			MagLog::info() << "Magics will use grid shading" << endl;
+		}
+		return ;
+	}
 	
 	Image* image = new Image();
 	image->set(rows, columns);
@@ -105,6 +153,7 @@ void CellShading::operator()( MatrixHandler& data, BasicGraphicsObjectContainer&
     for (int i = 0; i <= *max_element(image->begin(), image->end()); i++)
     {
     	table.push_back(*colour);
+
     	if ( ++colour == colours_.end() ) colour = colours_.begin();
 	}
 	
@@ -128,7 +177,7 @@ DumpShading::~DumpShading()
 {
 }
 
-void DumpShading::operator()( MatrixHandler& data, BasicGraphicsObjectContainer& parent)
+void DumpShading::operator()( IsoPlot*,MatrixHandler& data, BasicGraphicsObjectContainer& parent)
 {
 	// Here we have to work using the parentput projection.
 
@@ -247,6 +296,7 @@ CellArray* CellShading::array(MatrixHandler& matrix, IntervalMap<int>& range,
 		const Transformation& transformation, int width, int height,
 		float resolution, const string& technique)
 {
-	return new CellArray(matrix, range, transformation, width, height, resolution, technique);
+
+		return new GridArray(matrix, range, transformation, width, height, resolution, "middle");
 
 }
diff --git a/src/visualisers/CellShading.h b/src/visualisers/CellShading.h
index c5c1883..d31cf62 100644
--- a/src/visualisers/CellShading.h
+++ b/src/visualisers/CellShading.h
@@ -53,15 +53,20 @@ public:
 		CellShading* object = new CellShading();
 	    return object;
 	}
+
 	void copy(const CellShading& from)
 	{
 		CellShadingAttributes::copy(from);
 		//IsoShadingAttributes::copy(from);
 	}
-	
+	bool shadingMode() { return shading_ == "grid"; }
 	virtual void visit(LegendVisitor&, const ColourTechnique&);
+
+	int index(double value);
+	void operator()(Polyline*) const;
+
 	bool hasLegend() { return true; } // Isolien legend is not needed!
-	virtual void operator()(MatrixHandler&, BasicGraphicsObjectContainer&);
+	virtual void operator()(IsoPlot*, MatrixHandler&, BasicGraphicsObjectContainer&);
     virtual bool prepare(const LevelSelection&, const ColourTechnique&);
     virtual void colour(double, Colour&);
     CellArray* array(MatrixHandler& matrix, IntervalMap<int>& range,
@@ -71,7 +76,8 @@ protected:
      //! Method to print string about this class on to a stream of type ostream (virtual).
 	 virtual void print(ostream&) const; 
 	 IntervalMap<int> map_;
-	 vector<Colour>      colours_;
+	 vector<Colour>   colours_;
+	 string 		  shading_;
 
 private:
     //! Copy constructor - No copy allowed
@@ -102,7 +108,7 @@ public:
 	}
 
 
-	void operator()(MatrixHandler&, BasicGraphicsObjectContainer&);
+	void operator()(IsoPlot*, MatrixHandler&, BasicGraphicsObjectContainer&);
 
 };
 
diff --git a/src/visualisers/CoastPlotting.cc b/src/visualisers/CoastPlotting.cc
index 2edb200..5c97d6e 100644
--- a/src/visualisers/CoastPlotting.cc
+++ b/src/visualisers/CoastPlotting.cc
@@ -80,9 +80,9 @@ void CoastPlotting::operator()(PreviewVisitor& parent)
 	transformation.coastSetting(preview.coastSet_, 10, 5);
 	preview.decode(parent);
 
-	for (vector<Polyline>::iterator poly = preview.coast_.begin(); poly != preview.coast_.end(); ++poly)
+	for (vector<Polyline*>::iterator poly = preview.coast_.begin(); poly != preview.coast_.end(); ++poly)
 	{
-		Polyline* npoly= poly->clone();
+		Polyline* npoly= (*poly)->clone();
 		npoly->setThickness(thickness_);
 		npoly->setColour(*colour_);
 		npoly->setLineStyle(style_);
@@ -242,11 +242,14 @@ void CoastPlotting::landsea(Layout& out)
 */
 void CoastPlotting::landonly(Layout& out)
 {
-	for (vector<Polyline>::iterator poly = coast_.begin(); poly != coast_.end(); ++poly)
+	vector<Polyline*> clip;
+	clipAndClose(out.transformation(), coast_, clip);
+
+	for (vector<Polyline*>::iterator coast = clip.begin(); coast != clip.end(); ++coast)
 	{
-		Polyline* coast = poly->clone();
-		setLandShading(*coast);
-		out.push_back(coast);
+
+		setLandShading(**coast);
+		out.push_back(*coast);
 	}
 }
 
@@ -258,21 +261,23 @@ void CoastPlotting::landonly(Layout& out)
 */
 void CoastPlotting::seaonly(Layout& out)
 {
-	for (vector<Polyline>::iterator poly = ocean_.begin(); poly != ocean_.end(); ++poly)
+	vector<Polyline*> clip;
+	clipAndClose(out.transformation(), ocean_, clip);
+	for (vector<Polyline*>::iterator coast = clip.begin(); coast != clip.end(); ++coast)
 	{
-		Polyline* coast = poly->clone();
-		setSeaShading(*coast);
-		out.push_back(coast);
+		setSeaShading(**coast);
+		out.push_back(*coast);
 	}
 }
 
 void CoastPlotting::nolandsea(Layout& out)
 {
-	for (vector<Polyline>::iterator coast = coast_.begin(); coast != coast_.end(); ++coast)
+	vector<Polyline*> clips;
+	clip(out.transformation(), coast_, clips);
+	for (vector<Polyline*>::iterator coast = clips.begin(); coast != clips.end(); ++coast)
 	{
-		Polyline* poly = coast->clone();
-		setLine(*poly);
-		out.push_back(poly);
+		setLine(**coast);
+		out.push_back(*coast);
 	}
 }
 
@@ -331,33 +336,63 @@ void CoastPlotting::decode(const Layout& parent )
 
 	const Transformation& transformation = parent.transformation();
 
-	vector<Polyline> coastlines;
+	vector<Polyline*> coastlines;
 	coast_.clear();
 	ShapeDecoder coastline_decoder;
 	const string file = PATH(coastSet_["land"]);
 	coastline_decoder.setPath(file);
 	coastline_decoder.decode(coastlines, transformation);
 
-	for (vector<Polyline>::iterator coast = coastlines.begin(); coast != coastlines.end(); ++coast )
+	for (vector<Polyline*>::iterator coast = coastlines.begin(); coast != coastlines.end(); ++coast )
 	{
 		coast_.push_back(*coast);
 	}
 
   if( sea_ )
   {
-	vector<Polyline> oceans;
+	vector<Polyline*> oceans;
 	ocean_.clear();
 	const string file_ocean = PATH(coastSet_["ocean"]);
 	coastline_decoder.setPath(file_ocean);
 	coastline_decoder.decode(oceans, transformation);
 
-	for (vector<Polyline>::iterator coast = oceans.begin(); coast != oceans.end(); ++coast )
+	for (vector<Polyline*>::iterator coast = oceans.begin(); coast != oceans.end(); ++coast )
 	{
 		ocean_.push_back(*coast);
 	}
   }
 }
 
+void CoastPlotting::clip(const Transformation& transformation, const vector<Polyline*>& in, vector<Polyline*>& out) const
+{
+	for (vector<Polyline*>::const_iterator poly = in.begin(); poly != in.end(); ++poly ) {
+		(*poly)->reproject(transformation);
+		transformation(**poly, out);
+	}
+}
+
+
+void CoastPlotting::clipAndClose(const Transformation& transformation, const vector<Polyline*>& in, vector<Polyline*>& out) const
+{
+	Polyline& geobox = transformation.getUserBoundingBox();
+	Polyline& box = transformation.getPCBoundingBox();
+	for (vector<Polyline*>::const_iterator poly = in.begin(); poly != in.end(); ++poly ) {
+
+
+		vector<Polyline> clipped;
+		geobox.intersect(**poly, clipped);
+		// then we reproject!
+		for (vector<Polyline>::iterator clip = clipped.begin(); clip != clipped.end(); ++clip ) {
+			vector<Polyline> clip2;
+			clip->reproject(transformation);
+			box.intersect(*clip, clip2);
+			for (vector<Polyline>::iterator c = clip2.begin(); c != clip2.end(); ++c ) {
+				out.push_back(c->clone());
+			}
+
+		}
+	}
+}
 void NoCoastPlotting::visit(MetaDataCollector& meta)
 {
 	meta["Coastlines Resolution"] = coastSet_["resolution"];
diff --git a/src/visualisers/CoastPlotting.h b/src/visualisers/CoastPlotting.h
index 9fe1e26..1c9de7f 100644
--- a/src/visualisers/CoastPlotting.h
+++ b/src/visualisers/CoastPlotting.h
@@ -165,12 +165,14 @@ public:
 	virtual void operator()(PreviewVisitor&);
 
 
+
 protected:
 	//! Method to print string about this class on to a stream of type ostream (virtual).
 	virtual void print(ostream&) const;
 
 	void decode(const Layout&);
-	
+	void clip(const Transformation&,const vector<Polyline*>&, vector<Polyline*>&) const;
+	void clipAndClose(const Transformation&, const vector<Polyline*>&, vector<Polyline*>&) const;
 	void landsea(Layout&);
 	void landonly(Layout&);
 	void seaonly(Layout&);
@@ -182,8 +184,8 @@ protected:
 
 	string coast_resolution_;
 
-	vector<Polyline> coast_;
-	vector<Polyline> ocean_;
+	vector<Polyline*> coast_;
+	vector<Polyline*> ocean_;
 };
 
 
diff --git a/src/visualisers/IsoPlot.cc b/src/visualisers/IsoPlot.cc
index 438d5af..3962028 100644
--- a/src/visualisers/IsoPlot.cc
+++ b/src/visualisers/IsoPlot.cc
@@ -1331,7 +1331,7 @@ void IsoPlot::isoline(MatrixHandler& data, BasicGraphicsObjectContainer& parent)
     double min = data.min();
     double max = data.max();
     (*levelSelection_).clear();
-    (*levelSelection_).calculate(min , max , shading_->shadingMode());
+    (*levelSelection_).calculate(min , max , true);
     (*label_).prepare(*levelSelection_, (*colour_).name());
     return (*shading_)(*levelSelection_);
 }
@@ -1360,7 +1360,7 @@ void IsoPlot::isoline(MatrixHandler& data, BasicGraphicsObjectContainer& parent)
     vector<Colour>::iterator colour = colours.begin();
 #endif
 
-    (*shading_)(data, parent);
+    (*shading_)(this, data, parent);
     (*highlight_).prepare(*levelSelection_);
 
     if ( rainbow_ ) {
@@ -1417,21 +1417,13 @@ void IsoPlot::isoline(MatrixHandler& data, BasicGraphicsObjectContainer& parent)
  void NoIsoPlot::operator()(MatrixHandler& data, BasicGraphicsObjectContainer& parent)
 {
     // Create the isolines...
-    if ( !prepare(data) ) {
-        if ( legend_only_ ) return;
-        (*shading_)(data, parent);
-        // do not send the isolines...
-        return;
-    }
+    prepare(data);
+
     if ( legend_only_ ) return;
     // The shading needs the isolines..
-    // WE will calculate them but will not send them to the printer
-    {
-        Timer timer("contouring", "Time spent in contouring");
-        isoline(data, parent);
-    }
 
-    (*shading_)(data, parent);
+
+    (*shading_)(this, data, parent);
 
     // Now we feed the task...
         for (vector<vector<Polyline* >* >::const_iterator lines = lines_.begin(); lines != lines_.end(); ++lines)
diff --git a/src/visualisers/IsoPlot.h b/src/visualisers/IsoPlot.h
index fa60a11..e41a10e 100644
--- a/src/visualisers/IsoPlot.h
+++ b/src/visualisers/IsoPlot.h
@@ -346,12 +346,12 @@ public:
 		}
 	virtual void visit(Data&, PointsHandler&, HistoVisitor&);
 	virtual bool method(ContourMethod* method) { return (*this->shading_).method(method);  }
-
+	void isoline(MatrixHandler&, BasicGraphicsObjectContainer&);
 protected:
 	//! Method to print string about this class on to a stream of type ostream (virtual).
 	virtual void print(ostream&) const; 
 
-	void isoline(MatrixHandler&, BasicGraphicsObjectContainer&);
+
 
 	bool prepare(MatrixHandler&);
 
diff --git a/src/visualisers/IsoShading.h b/src/visualisers/IsoShading.h
index 47b3929..8acc959 100644
--- a/src/visualisers/IsoShading.h
+++ b/src/visualisers/IsoShading.h
@@ -43,7 +43,7 @@
 namespace magics {
 
 class ContourMethod;
-
+class IsoPlot;
 class NoIsoShading  {
 
 public:
@@ -54,10 +54,10 @@ public:
 	virtual void toxml(ostream&, int = 0) const {}
 	virtual bool accept(const string&) { return true;}
     
-	virtual void operator()(MatrixHandler&, BasicGraphicsObjectContainer&)
+	virtual void operator()(IsoPlot*, MatrixHandler&, BasicGraphicsObjectContainer&)
+			{  }
+	virtual void operator()(Data&, BasicGraphicsObjectContainer&)
 			{  }
-		virtual void operator()(Data&, BasicGraphicsObjectContainer&)
-				{  }
  
     
     virtual NoIsoShading* clone() {
@@ -118,8 +118,8 @@ public:
 	        	    		const Transformation& transformation, int width, int height,
 	        	    		float resolution, const string& technique) {
 		 return technique_->array(matrix, range, transformation, width, height, resolution, technique); }
-	virtual void operator()(MatrixHandler& data, BasicGraphicsObjectContainer& parent)
-		{ (*this->technique_)(data, parent); }
+	virtual void operator()(IsoPlot* iso, MatrixHandler& data, BasicGraphicsObjectContainer& parent)
+		{ (*this->technique_)(iso, data, parent); }
 	virtual void operator()(Data& data, BasicGraphicsObjectContainer& parent)
 			{ (*this->technique_)(data, parent); }
 	virtual int     shadingIndex(double);
diff --git a/src/visualisers/MarkerShadingTechnique.cc b/src/visualisers/MarkerShadingTechnique.cc
index 80f015e..0bb021d 100644
--- a/src/visualisers/MarkerShadingTechnique.cc
+++ b/src/visualisers/MarkerShadingTechnique.cc
@@ -64,7 +64,7 @@ void MarkerShadingTechnique::operator()(const PaperPoint& point)
     symbol->push_back(point);
 }
 
-void MarkerShadingTechnique::operator()(MatrixHandler& data, BasicGraphicsObjectContainer& out)
+void MarkerShadingTechnique::operator()(IsoPlot*, MatrixHandler& data, BasicGraphicsObjectContainer& out)
 {
     OriginalMatrixHandler original(data);
     int rows = original.rows();
diff --git a/src/visualisers/MarkerShadingTechnique.h b/src/visualisers/MarkerShadingTechnique.h
index 4f7b4f9..c16fbd4 100644
--- a/src/visualisers/MarkerShadingTechnique.h
+++ b/src/visualisers/MarkerShadingTechnique.h
@@ -60,10 +60,11 @@ public:
     
     bool accept(const string& node) { return MarkerShadingTechniqueAttributes::accept(node); }
 
+    void operator()(IsoPlot*, MatrixHandler&, BasicGraphicsObjectContainer&);
     
     Symbol* operator()(double);
     virtual void operator()(const PaperPoint&);
-    virtual void operator()(MatrixHandler&, BasicGraphicsObjectContainer&);
+    //virtual void operator()(MatrixHandler&, BasicGraphicsObjectContainer&);
     virtual bool prepare(const LevelSelection&, const ColourTechnique&);    
     virtual void visit(LegendVisitor&, const ColourTechnique&);
     bool hasLegend() { return true; } // Isolien legend is not needed!
diff --git a/src/visualisers/MetgramStyle.cc b/src/visualisers/MetgramStyle.cc
index a6c8f18..c802057 100644
--- a/src/visualisers/MetgramStyle.cc
+++ b/src/visualisers/MetgramStyle.cc
@@ -129,8 +129,8 @@ void MetgramBar::operator()(CustomisedPointsList& points, BasicGraphicsObjectCon
 		Polyline* box  = new Polyline();	
         box->setFilled(true);
 		box->setShading(new FillShadingProperties());
-		box->setFillColour(Colour("blue"));
-		box->setColour(Colour("blue"));
+		box->setFillColour(*colour_);
+		box->setColour(*colour_);
 
 		
 	
@@ -149,13 +149,13 @@ void MetgramBar::operator()(CustomisedPointsList& points, BasicGraphicsObjectCon
 		if (left < xmin) left = xmin; 
 		if (right > xmax) right = xmax; 
 		
-		if ( (*point)->find("curve1") != (*point)->end() )   {
+		if ( (*point)->find(keyword_) != (*point)->end() )   {
 			box->push_back(PaperPoint(left, 0));
-			box->push_back(PaperPoint(left, (**point)["curve1"]));
-			box->push_back(PaperPoint(right, (**point)["curve1"]));
+			box->push_back(PaperPoint(left, (**point)[keyword_]));
+			box->push_back(PaperPoint(right, (**point)[keyword_]));
 			box->push_back(PaperPoint(right, 0));
 			box->push_back(PaperPoint(left, 0));
-			ypos.push_back((**point)["curve1"]);
+			ypos.push_back((**point)[keyword_]);
 			limits.push_back(x);
 		}
 		visitor.push_back(box);
@@ -209,21 +209,21 @@ void MetgramCurve::operator()(CustomisedPointsList& points, BasicGraphicsObjectC
 		xpos.push_back(x);		
 	    x -= (**point)["shift"];
 		
-		if ( (*point)->find("curve1") != (*point)->end() )   {
-			curve1->push_back(PaperPoint(x, (**point)["curve1"]));
-			ypos.push_back((**point)["curve1"]);
-			if ( (**point)["curve1"] < y1 ) {
+		if ( (*point)->find(keyword1_) != (*point)->end() )   {
+			curve1->push_back(PaperPoint(x, (**point)[keyword1_]));
+			ypos.push_back((**point)[keyword1_]);
+			if ( (**point)[keyword1_] < y1 ) {
 				x1 = x;
-				y1 = (**point)["curve1"];
+				y1 = (**point)[keyword1_];
 			}
 		}
 		
-		if ( (*point)->find("curve2") != (*point)->end() )   {
-			curve2->push_back(PaperPoint(x, (**point)["curve2"]));
-			ypos.push_back((**point)["curve2"]);
-			if ( (**point)["curve2"] > y2 ) {
+		if ( (*point)->find(keyword2_) != (*point)->end() )   {
+			curve2->push_back(PaperPoint(x, (**point)[keyword2_]));
+			ypos.push_back((**point)[keyword2_]);
+			if ( (**point)[keyword2_] > y2 ) {
 				x2 = x;
-				y2 = (**point)["curve2"];
+				y2 = (**point)[keyword2_];
 			}
 		}
 	}
@@ -287,7 +287,7 @@ void MetgramFlags::operator()(CustomisedPointsList& points, BasicGraphicsObjectC
    
 	flags->setOriginMarker("magics_15");
 	flags->setOriginHeight(0.05);
-	flags->setConvention(KNOTS);
+	//flags->setConvention(KNOTS);
 	int i = 0;
 	for (CustomisedPointsList::const_iterator point = points.begin(); point != points.end(); ++point) {
 		i++;
@@ -302,9 +302,9 @@ void MetgramFlags::operator()(CustomisedPointsList& points, BasicGraphicsObjectC
 		  x -= (**point)["shift"];
 		
         
-		if ( (*point)->find("curve1") != (*point)->end() && (*point)->find("curve2") != (*point)->end() )   {
+		if ( (*point)->find(component1_) != (*point)->end() && (*point)->find(component2_) != (*point)->end() )   {
 			PaperPoint pos(x, 0);
-			flags->push_back(ArrowPoint((**point)["curve1"], (**point)["curve2"], pos));
+			flags->push_back(ArrowPoint((**point)[component1_], (**point)[component2_], pos));
 		}
 	}
 	if ( !flags->empty() ) visitor.push_back(flags);	
@@ -320,7 +320,7 @@ void MetgramCurve::visit(LegendVisitor& legend)
 	Polyline* curve2  = new Polyline();
 	curve2->setColour(Colour("blue"));
 	curve2->setThickness(2);
-	legend.add(new LineEntry("curve1", curve1));
-	legend.add(new LineEntry("curve2", curve2));
+	legend.add(new LineEntry(keyword1_, curve1));
+	legend.add(new LineEntry(keyword2_, curve2));
 }
 
diff --git a/src/visualisers/MetgramStyle.h b/src/visualisers/MetgramStyle.h
index ca5854f..7b4f70a 100644
--- a/src/visualisers/MetgramStyle.h
+++ b/src/visualisers/MetgramStyle.h
@@ -38,6 +38,8 @@
 #include "BasicGraphicsObject.h"
 #include "MetgramFlagsAttributes.h"
 #include "MetgramCurveAttributes.h"
+#include "MetgramBarAttributes.h"
+
 namespace magics {
 
 
@@ -87,23 +89,24 @@ private:
 
 };
 
-class MetgramBar: public MetgramStyle {
+class MetgramBar: public MetgramStyle, public MetgramBarAttributes {
 
 public:
 	MetgramBar() {}
 	virtual ~MetgramBar() {}
     
-    virtual void set(const XmlNode&) {
-        MagLog::dev() << "(const XmlNode&)---> to be checked!...\n";
+    virtual void set(const XmlNode& node) {
+
+        MetgramBarAttributes::set(node);
     }
-    virtual void set(const map<string, string>&) {
-        MagLog::dev() << "(const map<string, string&)---> to be checked!...\n";
+    virtual void set(const map<string, string>& map) {
+    	MetgramBarAttributes::set(map);
     }
     virtual bool accept(const string& node) {
         return magCompare(node, "bar");
     }
     virtual MetgramStyle* clone() const {
-        MagLog::dev() << "(const map<string, string&)---> to be checked!...\n";
+
         return new MetgramBar();
     }
     
diff --git a/src/visualisers/ObsPlotting.cc b/src/visualisers/ObsPlotting.cc
index 3bc5b94..05e4add 100644
--- a/src/visualisers/ObsPlotting.cc
+++ b/src/visualisers/ObsPlotting.cc
@@ -38,7 +38,7 @@ ObsPlotting::ObsPlotting()
 {
 	ObsTable::print();
 	if ( ring_size_ == -1 )
-		ring_size_ = size_ * 1.5;
+		ring_size_ = size_;
 }
 
 ObsPlotting::~ObsPlotting() 
diff --git a/src/visualisers/PolyShadingTechnique.cc b/src/visualisers/PolyShadingTechnique.cc
index 27f25aa..a77999e 100644
--- a/src/visualisers/PolyShadingTechnique.cc
+++ b/src/visualisers/PolyShadingTechnique.cc
@@ -32,6 +32,10 @@
 #include "IsoPlot.h"
 
 using namespace magics;
+void ShadingTechnique::operator()(IsoPlot* iso, MatrixHandler& data, BasicGraphicsObjectContainer& parent)
+{
+	iso->isoline(data, parent);
+}
 
 CellArray* PolyShadingTechnique::array(MatrixHandler& matrix, IntervalMap<int>& range,
   	    		const Transformation& transformation, int width, int height,
@@ -59,6 +63,7 @@ CellArray* GridShading::array(MatrixHandler& matrix, IntervalMap<int>& range,
 		const Transformation& transformation, int width, int height,
 		float resolution, const string& technique)
 {
+
 	return new GridArray(matrix, range, transformation, width, height, resolution, position_);
 
 }
diff --git a/src/visualisers/ShadingTechnique.h b/src/visualisers/ShadingTechnique.h
index 6e7bddd..97a18c4 100644
--- a/src/visualisers/ShadingTechnique.h
+++ b/src/visualisers/ShadingTechnique.h
@@ -47,6 +47,7 @@ class Polyline;
 class CellArray;
 class Transformation;
 class ContourMethod;
+class IsoPlot;
 
 class ShadingTechnique  {
 
@@ -64,7 +65,7 @@ public:
     virtual bool hasLegend() { return false; }
     virtual BasicGraphicsObject* next() { return 0; }
     virtual void operator()(Data&, BasicGraphicsObjectContainer&) {}
-	virtual void operator()(MatrixHandler&, BasicGraphicsObjectContainer&) {}
+	virtual void operator()(IsoPlot* iso, MatrixHandler& data, BasicGraphicsObjectContainer& parent);
     virtual void operator()(Polyline*) const {};
     virtual bool prepare(const LevelSelection&, const ColourTechnique&)  { return false; }   
     virtual void visit(LegendVisitor&, const ColourTechnique&) {}   
diff --git a/src/visualisers/SimplePolylineVisualiser.cc b/src/visualisers/SimplePolylineVisualiser.cc
index 0c03552..8891361 100644
--- a/src/visualisers/SimplePolylineVisualiser.cc
+++ b/src/visualisers/SimplePolylineVisualiser.cc
@@ -32,13 +32,16 @@
 #include "Polyline.h"
 #include "LegendVisitor.h"
 #include "Data.h"
+#include "Symbol.h"
 
 
 using namespace magics;
 
     
 SimplePolylineVisualiser::SimplePolylineVisualiser() 
-{}
+{   map_["classic"] =  &SimplePolylineVisualiser::basic;
+    map_["trajectory"] =   &SimplePolylineVisualiser::smooth;
+}
 
 SimplePolylineVisualiser::~SimplePolylineVisualiser() 
 {}
@@ -51,11 +54,9 @@ void SimplePolylineVisualiser::print(ostream& out)  const
 	out << "SimplePolylineVisualiser[";
 	out << "]";
 }
-
-
-void SimplePolylineVisualiser::operator()(Data& data, BasicGraphicsObjectContainer& parent)
+void SimplePolylineVisualiser::basic(Data& data, BasicGraphicsObjectContainer& parent)
 {
-   levelSelection_->set(*this);
+  levelSelection_->set(*this);
   
    PointsHandler& points = data.points(parent.transformation(), true);
    points.setToFirst();
@@ -64,51 +65,323 @@ void SimplePolylineVisualiser::operator()(Data& data, BasicGraphicsObjectContain
    levelSelection_->calculate(points.min(), points.max(), false);
    
    if (shade_) {
-   		colourMethod_->set(*this);
-   		colourMethod_->prepare(*levelSelection_);
+      colourMethod_->set(*this);
+      colourMethod_->prepare(*levelSelection_);
    }
    const Transformation& transformation = parent.transformation();
    
    while ( points.more() )
    {
         if ( points.current().missing()  || line == 0 )
-	{
+  {
             if ( line )  
-            	parent.transformation()(*line, parent);
+              parent.transformation()(*line, parent);
             line = new Polyline();
             line->setColour(*colour_);
             line->setLineStyle(style_);
             line->setThickness(thickness_);
             line->setFilled(shade_);            
-	}
-	if (!points.current().missing() )
-	{
-		line->push_back(transformation(points.current()));
-		if ( shade_ && points.current().value() >= min_ && points.current().value() <= max_) {
-			
-			line->setFillColour(colourMethod_->colour(points.current().value()));
-			FillShadingProperties* shading = new FillShadingProperties();    
-			line->setShading(shading);
-		}
-		else 
-			line->setFilled(false);
-	}
-	points.advance();
+  }
+  if (!points.current().missing() )
+  {
+    line->push_back(transformation(points.current()));
+    if ( shade_ && points.current().value() >= min_ && points.current().value() <= max_) {
+      
+      line->setFillColour(colourMethod_->colour(points.current().value()));
+      FillShadingProperties* shading = new FillShadingProperties();    
+      line->setShading(shading);
+    }
+    else 
+      line->setFilled(false);
+  }
+  points.advance();
    }
    
    if ( !line ) {
-	   MagLog::warning() << "Could not find lines to plot " << endl;
-	   return;
+     MagLog::warning() << "Could not find lines to plot " << endl;
+     return;
    }
 
    if ( !line->empty() )
-	   parent.transformation()(*line, parent);
+     parent.transformation()(*line, parent);
+}
+
+
+
+void SimplePolylineVisualiser::operator()(Data& data, BasicGraphicsObjectContainer& parent)
+{
+  
+  map<string, Method>::iterator function = map_.find(method_);    
+  if ( function != map_.end())  
+    (this->*function->second)(data, parent);  
+  else {
+    MagLog::warning() << "Could not find method " << method_ << ": Use default visualisation" << endl;
+    basic(data, parent);
+  }
 }
 
 
+
+void SimplePolylineVisualiser::setup()
+{
+
+	if ( colour_list_.empty() )
+		colour_list_.push_back("blue");
+	if ( style_list_.empty() )
+		style_list_.push_back("solid");
+	if ( thickness_list_.empty() )
+		thickness_list_.push_back(2.);
+
+	vector<string>::iterator colour = colour_list_.begin();
+	vector<string>::iterator style = style_list_.begin();
+	vector<double>::iterator thickness = thickness_list_.begin();
+	MagTranslator<string, LineStyle> translator;
+
+
+
+	int max = colour_level_list_.empty() ? 0 : colour_level_list_.size() -1;
+	for ( int i = 0; i < max; i++) {
+		colour_map_[Interval(colour_level_list_[i], colour_level_list_[i+1]) ] = Colour(*colour);
+		++colour;
+		if ( colour == colour_list_.end() )
+			colour = ( colour_policy_ == M_CYCLE ) ? colour_list_.begin() : --colour;
+	}
+
+	max = style_level_list_.empty() ? 0 : style_level_list_.size() -1;
+	for ( int i = 0; i < max; i++) {
+		style_map_[Interval(style_level_list_[i], style_level_list_[i+1]) ] = translator(*style);
+		++style;
+		if ( style == style_list_.end() )
+			style = ( style_policy_ == M_CYCLE ) ? style_list_.begin() : --style;
+	}
+	max = thickness_level_list_.empty() ? 0 : thickness_level_list_.size() -1;
+	for ( int i = 0; i < max; i++) {
+			thickness_map_[Interval(thickness_level_list_[i], thickness_level_list_[i+1]) ] = *thickness;
+			++thickness;
+			if ( thickness == thickness_list_.end() )
+				thickness = ( thickness_policy_ == M_CYCLE ) ? thickness_list_.begin() : --thickness;
+		}
+	max = transparency_level_list_.empty() ? 0 : transparency_level_list_.size() -1;
+	for ( int i = 0; i < transparency_level_list_.size() -1; i++) {
+		alpha_map_[Interval(transparency_level_list_[i], transparency_level_list_[i+1]) ] = i ;
+	}
+
+}
+
+void SimplePolylineVisualiser::smooth(Data& data, BasicGraphicsObjectContainer& parent)
+{
+   setup();
+   if ( legend_only_ )
+	   return;
+   const Transformation& transformation = parent.transformation();
+   
+
+
+
+   std::set<string> needs;
+
+   needs.insert(pivot_key_);
+   needs.insert(transparency_key_);
+   needs.insert(colour_key_);
+   needs.insert(style_key_);
+   needs.insert(thickness_key_);
+
+
+   double lastone = -std::numeric_limits<double>::max();
+
+   CustomisedPointsList points;
+   data.customisedPoints(parent.transformation(), needs, points, true);
+
+   setup();
+
+   map<double, vector<CustomisedPoint*> > work;
+   map<double, vector<CustomisedPoint*> >::iterator where;
+
+
+   for ( CustomisedPointsList::iterator point = points.begin(); point != points.end(); ++point) {
+
+
+	   double index = priority(**point);
+	   if ( index > lastone )
+		   lastone = index;
+	   where = work.find( index );
+	   if ( where == work.end() ) {
+		   work.insert(make_pair(index,vector<CustomisedPoint*>()));
+		   where = work.find( index );
+	   }
+	   where->second.push_back(*point);
+
+   }
+
+
+
+
+   Symbol *marker = new Symbol();
+   bool add = false;
+
+   if ( pivot_marker_ == "all")
+	   add = true;
+
+   for ( map<double, vector<CustomisedPoint*> >::iterator where = work.begin(); where != work.end(); ++where) {
+
+      for ( int i = 1; i <  where->second.size(); i++) {
+    	  CustomisedPoint* last = where->second[i-1];
+    	  CustomisedPoint* point = where->second[i];
+
+    	  if ( point->missing() || last->missing() )
+    		  continue;
+
+    	  Polyline segment;
+
+    	  segment.setLineStyle(style(*point));
+    	  segment.setThickness(thickness(*point));
+    	  Colour col = colour(*point);
+
+    	  double a = alpha(*last);
+    	 
+    	  if ( where->first == lastone ) {
+    		  if ( pivot_marker_ == "lastone")
+    			  add = true;
+          if  ( pivot_marker_ != "none")
+    		    col =  *pivot_marker_colour_;         
+    	  }
+        col.setAlpha(a);
+    	  segment.setColour(col);
+    	  UserPoint geo(point->longitude(), point->latitude());
+    	  UserPoint lastgeo(last->longitude(), last->latitude());
+    	  segment.push_back(transformation(geo));
+    	  segment.push_back(transformation(lastgeo));
+
+
+    	  parent.transformation()(segment, parent);
+
+    	  // Add Symbol if needed
+    	  if ( add &&  alpha(*point) == 1 ) {
+    		  CustomisedPoint::const_iterator value = point->find(colour_key_);
+
+    		  double  x = ( value == point->end() ) ? 0 : value->second;
+    		  if ( magCompare(pivot_marker_name_, "cyclone" ) ) {
+    			  string name;
+    			  if ( point->latitude() > 0 ) {
+    				  name = ( x < 117 ) ? "WMO_TropicalCycloneNHLT" : "WMO_TropicalCycloneNHGE";
+    			  }
+    			  else {
+    				  name = ( x < 117 ) ? "WMO_TropicalCycloneSHLT" : "WMO_TropicalCycloneSHGE";
+    			  }
+    			  marker->setSymbol(name);
+    		  }
+    		  else  {
+    			  marker->setSymbol(pivot_marker_name_);
+
+    		  }
+    		  marker->setHeight(pivot_marker_height_);
+    		  marker->setColour(*pivot_marker_colour_);
+    	  	marker->push_back(transformation(geo));
+    	  }
+      }
+
+    }
+
+    
+    parent.push_back(marker);
+
+
+
+
+
+}
+
 void SimplePolylineVisualiser::visit(Data&, LegendVisitor& legend)
 {
+
     if ( !legend_) return;
 	if ( shade_ ) 
 		colourMethod_->visit(legend);   
+	legend.newLegend();
+		if   ( colour_map_.empty() ) {
+				// no legend to plot
+			return;
+		}
+		IntervalMap<Colour>::const_iterator interval;
+
+		for ( interval = colour_map_.begin(); interval != colour_map_.end(); ++interval) {
+				Polyline* box = new Polyline();
+
+				double min =interval->first.min_;
+				double max = interval->first.max_;
+
+				box->setShading(new FillShadingProperties());
+
+				box->setFillColour(interval->second);
+				box->setFilled(true);
+
+				legend.add(new BoxEntry(min, max, box));
+
+			}
+			legend.back()->last();
+}
+
+Colour 	SimplePolylineVisualiser::colour(const CustomisedPoint& point)
+{
+	Colour blue("blue");
+	CustomisedPoint::const_iterator value = point.find(colour_key_);
+	if ( value == point.end() )
+		return blue;
+
+	return colour_map_.find(value->second, blue);
+
+}
+LineStyle 	SimplePolylineVisualiser::style(const CustomisedPoint& point)
+{
+	LineStyle solid = M_SOLID;
+	CustomisedPoint::const_iterator value = point.find(style_key_);
+	if ( value == point.end() )
+		return solid;
+
+	return style_map_.find(value->second, solid);
+}
+double 	SimplePolylineVisualiser::thickness(const CustomisedPoint& point)
+{
+	double thickness = 4;
+	CustomisedPoint::const_iterator value = point.find(thickness_key_);
+	if ( value == point.end() )
+		return thickness;
+
+	return thickness_map_.find(value->second, thickness);
+
+}
+double SimplePolylineVisualiser::priority(const CustomisedPoint& point)
+{
+	double priority = 1;
+	CustomisedPoint::const_iterator value = point.find(priority_key_);
+	if ( value == point.end() )
+		return priority;
+	return value->second;
+
+}
+double 	SimplePolylineVisualiser::alpha(const CustomisedPoint& point)
+{
+	double alpha = 1;
+	CustomisedPoint::const_iterator p = point.find(pivot_key_);
+	if ( p == point.end() )
+		return alpha;
+	int pivot = alpha_map_.find(p->second, -1);
+	if ( pivot == -1)
+		return alpha;
+	CustomisedPoint::const_iterator value = point.find(transparency_key_);
+	if ( value == point.end() )
+		return alpha;
+	int index = alpha_map_.find(value->second, -1);
+	alpha = exp(-(abs(float(index - pivot))/factor_));
+
+	return alpha;
+}
+
+void SimplePolylineVisualiser::visit(LegendVisitor& legend)
+{
+
+
+
+
+
 }
diff --git a/src/visualisers/SimplePolylineVisualiser.h b/src/visualisers/SimplePolylineVisualiser.h
index 14c4fa7..4a4b5bb 100644
--- a/src/visualisers/SimplePolylineVisualiser.h
+++ b/src/visualisers/SimplePolylineVisualiser.h
@@ -53,7 +53,7 @@ public:
 	SimplePolylineVisualiser();
 	virtual ~SimplePolylineVisualiser();
     
-   
+    
     
 	void operator()(Data&, BasicGraphicsObjectContainer&);
 	void visit(Data&, LegendVisitor&);
@@ -75,13 +75,28 @@ public:
     // Implements the set method ... 
     void set(const map<string, string>& map ) { SimplePolylineAttributes::set(map); }
     void set(const XmlNode& node) { SimplePolylineAttributes::set(node); }
-    
+
+    void basic(Data&, BasicGraphicsObjectContainer&);
+    void smooth(Data&, BasicGraphicsObjectContainer&);
+    void visit(LegendVisitor&);
     
 protected:
      //! Method to print string about this class on to a stream of type ostream (virtual).
 	 virtual void print(ostream&) const; 
- 
+	 Colour 	colour(const CustomisedPoint&);
+	 LineStyle 	style(const CustomisedPoint&);
+	 double 	thickness(const CustomisedPoint&);
+	 double 	alpha(const CustomisedPoint&);
+	 double 	priority(const CustomisedPoint&);
+
+	 void setup();
     
+    typedef void (SimplePolylineVisualiser::*Method)(Data&, BasicGraphicsObjectContainer&);
+    map<string, Method> 		map_;
+    IntervalMap<Colour>			colour_map_;
+    IntervalMap<LineStyle>		style_map_;
+    IntervalMap<double>			thickness_map_;
+    IntervalMap<int>			alpha_map_;
 
 private:
     //! Copy constructor - No copy allowed
diff --git a/src/visualisers/Streamlines.cc b/src/visualisers/Streamlines.cc
index bf52b45..b4c4639 100644
--- a/src/visualisers/Streamlines.cc
+++ b/src/visualisers/Streamlines.cc
@@ -69,7 +69,13 @@ bool Streamlines::operator()(Data& data, BasicGraphicsObjectContainer& parent)
     int i = 0;
     for (int row = 0; row < handler.rows(); row++ )
         for (int column = 0; column < handler.columns(); column++ ) {
-            direction[i] = (handler)(row, column);
+// ************ MF RV ***************
+// CalcStreamlines.cc (line 281) -> only check NAN as missingValue
+//    and shiftPeriod(missingValue) (lines 31,44) -> catastrophic!
+//            direction[i] = (handler)(row, column);
+            double d = (handler)(row, column);
+            direction[i] = (d == handler.missing()) ? NAN : d;
+// ************ MF RV ***************
             i++;
         }
 
@@ -116,6 +122,10 @@ bool Streamlines::operator()(Data& data, BasicGraphicsObjectContainer& parent)
         transformation(poly, parent);
 
     }
+// ************ MF RV ***************
+// Leak ;-)
+    delete [] direction;
+// ************ MF RV ***************
     return true;
 }
 
diff --git a/src/visualisers/SymbolAdvancedTableMode.cc b/src/visualisers/SymbolAdvancedTableMode.cc
index 9bc2d27..949fa7b 100644
--- a/src/visualisers/SymbolAdvancedTableMode.cc
+++ b/src/visualisers/SymbolAdvancedTableMode.cc
@@ -147,7 +147,7 @@ void SymbolAdvancedTableMode::adjust(double min, double max)
     LevelSelection::const_iterator level = levels_->begin();
     vector<int>::const_iterator marker = markers_.begin();
     vector<string>::const_iterator marker_name = markers_names_.begin();
-    bool index = magCompare(parent_->marker_mode_, "index");
+    const bool index = magCompare(parent_->marker_mode_, "index");
     SymbolProperties last;
     vector<string>::const_iterator text = text_list_.begin();
     while ( true) {
@@ -157,10 +157,9 @@ void SymbolAdvancedTableMode::adjust(double min, double max)
 
     	SymbolProperties properties;
     	if ( index )
-    		properties = SymbolProperties(colourMethod_->right(*level), height_method_->height(*level), *marker, *text);
+    		properties = SymbolProperties(colourMethod_->right(*level), height_method_->height(*level), *marker     , *text);
     	else
-
-    		properties = SymbolProperties(colourMethod_->right(*level), height_method_->height(*level),  *marker_name, *text);
+    		properties = SymbolProperties(colourMethod_->right(*level), height_method_->height(*level), *marker_name, *text);
 
     	properties.position_ = position;
     	properties.font_ = font;
diff --git a/src/visualisers/SymbolMode.cc b/src/visualisers/SymbolMode.cc
index 7781c03..fadb41d 100644
--- a/src/visualisers/SymbolMode.cc
+++ b/src/visualisers/SymbolMode.cc
@@ -78,27 +78,23 @@ SymbolIndividualMode::~SymbolIndividualMode()
 
 void SymbolIndividualMode::update()
 {
-
 	if ( magCompare(marker_mode_, "index" ) ) {
 		ostringstream symbol;
 		symbol << "magics_" << marker_;
 		symbol_ = symbol.str();
 	}
-
     current_ = text_.begin();
-
-    
 }
 
 void SymbolIndividualMode::properties() const
 {
 	static map<string, TextSymbol::TextPosition> texthandlers;
 	if ( texthandlers.empty() ) {
-		texthandlers["none"] = TextSymbol::M_NONE;
-		texthandlers["left"] = TextSymbol::M_LEFT;
-		texthandlers["top"] = TextSymbol::M_ABOVE;
+		texthandlers["none"]   = TextSymbol::M_NONE;
+		texthandlers["left"]   = TextSymbol::M_LEFT;
+		texthandlers["top"]    = TextSymbol::M_ABOVE;
 		texthandlers["bottom"] = TextSymbol::M_BELOW;
-		texthandlers["right"] = TextSymbol::M_RIGHT;
+		texthandlers["right"]  = TextSymbol::M_RIGHT;
 		texthandlers["centre"] = TextSymbol::M_CENTRE;
 	}
 	TextSymbol::TextPosition position;
@@ -107,7 +103,6 @@ void SymbolIndividualMode::properties() const
 		properties_.colour_ = *colour_;
 	    properties_.height_ = height_;
 	}
-
 	else {
 		string type = lowerCase(text_position_);
 		map<string, TextSymbol::TextPosition>::iterator pos = texthandlers.find(type);
@@ -122,24 +117,22 @@ void SymbolIndividualMode::properties() const
 		}
 	}
 	if ( magCompare(marker_mode_, "image" ) ) {
-		properties_.image_ = true;
-		properties_.image_path_ = image_path_;
-		properties_.image_width_ = image_width_;
+		properties_.image_        = true;
+		properties_.image_path_   = image_path_;
+		properties_.image_width_  = image_width_;
 		properties_.image_height_ = image_height_;
 		properties_.image_format_ = image_format_;
-
 	}
 
-    properties_.outline_ = parent_->outline_;
-    properties_.outlineColour_ = *parent_->outline_colour_;
-    properties_.outlineStyle_ = parent_->outline_style_;
-    properties_.outlineThickness_ = parent_->outline_thickness_;
-
-    properties_.connectLine_ = parent_->connect_;
-    properties_.connectLineColour_ = (parent_->automatic_connect_colour_) ? *colour_ : *parent_->connect_colour_;
-    properties_.connectLineStyle_ = parent_->connect_style_;
+    properties_.outline_              = parent_->outline_;
+    properties_.outlineColour_        = *parent_->outline_colour_;
+    properties_.outlineStyle_         = parent_->outline_style_;
+    properties_.outlineThickness_     = parent_->outline_thickness_;
+    properties_.connectLine_          = parent_->connect_;
+    properties_.connectLineColour_    = (parent_->automatic_connect_colour_) ? *colour_ : *parent_->connect_colour_;
+    properties_.connectLineStyle_     = parent_->connect_style_;
     properties_.connectLineThickness_ = parent_->connect_thickness_;
-    properties_.blanking_ = parent_->text_blanking_;
+    properties_.blanking_             = parent_->text_blanking_;
 
     if ( current_ != text_.end() ) {
     	properties_.label(*current_);
@@ -153,10 +146,8 @@ void SymbolIndividualMode::properties() const
     font.size(text_font_size_);
     font.style(text_font_style_);
     properties_.font_ = font;
-
     properties_.position_ = position;
     properties_.setSymbol(symbol_, 0);
-
     properties_.text_ = text_;
 }
 
@@ -172,15 +163,10 @@ void SymbolIndividualMode::print(ostream& out)  const
 
 
 
-
-
-
 SymbolTableMode::SymbolTableMode() 
-{
-   
+{   
 }
 
-
 SymbolTableMode::~SymbolTableMode() 
 {
 }
@@ -196,12 +182,9 @@ void SymbolTableMode::print(ostream& out)  const
 }
 
 
-
 SymbolProperties SymbolTableMode::operator()(double value) const 
 {
 	return map_.find(value, SymbolProperties());
-    
-    
 }
 
 void SymbolTableMode::prepare()
@@ -229,9 +212,7 @@ void SymbolTableMode::prepare()
     doublearray::iterator height = height_.begin();
     stringarray::iterator symbol = symbol_.begin();
     
-    int index = 0;
-    
-  
+    int index = 0;  
     
     for (doublearray::const_iterator min = min_.begin(); min != min_.end(); ++min) {
 
@@ -252,10 +233,8 @@ bool  SymbolTableMode::accept(double value)
 {
 	try {
 		map_.find(value);
-
 		return true;
 	}
-
 	catch (...) {
 		return false;
 	}
@@ -264,7 +243,6 @@ bool  SymbolTableMode::accept(double value)
 
 void SymbolTableMode::visit(LegendVisitor& legend)
 {
-    
     IntervalMap<SymbolProperties>::const_iterator interval;
     
     for ( interval = map_.begin(); interval != map_.end(); ++interval) {
@@ -284,27 +262,21 @@ void SymbolTableMode::visit(Data& data, HistoVisitor& visitor)
 		buildBins(map_, beans);
 	Histogram helper;
 	helper.visit(beans, data, data.points(*visitor.dataLayoutTransformation(), false), visitor);
-
 }
 
 void SymbolTableMode::buildBins(const IntervalMap<SymbolProperties>& in, IntervalMap<Colour>& out)
 {
 	for ( IntervalMap<SymbolProperties>::const_iterator interval = in.begin(); interval != in.end(); ++interval)
 		out.insert(make_pair(Interval(interval->first.min_, interval->first.max_), interval->second.colour_));
-
 }
 
 void SymbolIndividualMode::visit(LegendVisitor& legend)
 {
-   
 	  Symbol* symbol = properties_.symbol("marker");
 	  // overwrite with the legend_height if set..
-
 	  if ( legend_height_ != -1)
 		  symbol->setHeight(legend_height_);
-      
 	  legend.add(new SimpleSymbolEntry(legend_text_, symbol));
- 	
 }
 
 void SymbolIndividualMode::visit(Data& data, LegendVisitor& legend)
@@ -316,17 +288,15 @@ void SymbolIndividualMode::visit(Data& data, LegendVisitor& legend)
     SimpleSymbolEntry *entry = new SimpleSymbolEntry(legend_text_, symbol);
     entry->userText(legend_text_);
     legend.add(entry);
-
 }
+
 void SymbolTableMode::visit(Data& data, LegendVisitor& legend)
 {
 		legend.newLegend();
 
-
     	switch (legend.legendType())  {
     		case LegendMethod::CONTINUOUS:
     		{
-
     	    for ( IntervalMap<SymbolProperties>::const_iterator interval = map_.begin(); interval != map_.end(); ++interval) {
     			Polyline* box = new Polyline();
 
@@ -391,14 +361,9 @@ void SymbolTableMode::visit(Data& data, LegendVisitor& legend)
     					   entry->first();
     					   first = false;
     				   }
-
-
     				   legend.add(entry);
-
     			}
-
     		}
-
     }
     legend.last();
-    }
+}
diff --git a/src/visualisers/SymbolPlotting.cc b/src/visualisers/SymbolPlotting.cc
index 852aa12..3649a15 100644
--- a/src/visualisers/SymbolPlotting.cc
+++ b/src/visualisers/SymbolPlotting.cc
@@ -70,11 +70,21 @@ void SymbolPlotting::operator()(const PaperPoint& point, BasicGraphicsObjectCont
 
 		if  ( magCompare(type_, "number") || magCompare(type_, "both")) {
 			ostringstream nice;
+
 			nice << MagicsFormat(format_, point.value());
+			if ( point.name() != "" )
+				nice << "[" << point.name() << "]";
 			value = nice.str();
 		}
        
+
+		if  ( magCompare(type_, "marker_text")) {
+			value = point.name();
+			if ( point.name() == "" )
+				value = "_FORCE_EMPTY_TEXT_";
+		}
        
+
          map<SymbolProperties, Symbol* >::const_iterator symb = symbols_.find(properties);
          if ( symb  != symbols_.end() )
          {
@@ -128,6 +138,7 @@ void SymbolPlotting::operator()(Data& data, BasicGraphicsObjectContainer& out)
     check.push_back("number");
     check.push_back("marker");
     check.push_back("both");
+    check.push_back("marker_text");
 
     bool valid = false;
 
@@ -180,7 +191,6 @@ void SymbolPlotting::operator()(Data& data, BasicGraphicsObjectContainer& out)
 	    for (vector<Symbol* >::iterator symbol = work.begin(); symbol != work.end(); ++symbol) {
 
 	     	if ( !(*symbol)->empty() ) {
-
 	     		(*symbol)->boundingbox(out.transformation().getPCBoundingBox());
 	     		out.push_back(*symbol);
 	     	}
diff --git a/src/visualisers/Wind.cc b/src/visualisers/Wind.cc
index dc0f4fa..f78240e 100644
--- a/src/visualisers/Wind.cc
+++ b/src/visualisers/Wind.cc
@@ -60,6 +60,10 @@ void Wind::operator()(Data& data, BasicGraphicsObjectContainer& parent)
 
 	if ( (*type_)(data, parent) )
 		return;
+	if ( type_->legend_only_ )
+		return;
+	
+	
 	ThinningMethod* method=0;
 
 	const Transformation& transformation = parent.transformation();
@@ -90,8 +94,11 @@ void Wind::operator()(Data& data, BasicGraphicsObjectContainer& parent)
 		//request.insert("debug");
 	(*method)(data, transformation, request, points);
 	if (points.empty() )
+
 		return;
-		(*this->type_).prepare(parent, method->units());
+
+	cout << points.size() << "--------------" <<  endl;
+	(*this->type_).prepare(parent, method->units());
 				
 		(*this->type_).adjust(points, transformation);
 
diff --git a/src/visualisers/WindPlotting.h b/src/visualisers/WindPlotting.h
index 52dc224..45294a2 100644
--- a/src/visualisers/WindPlotting.h
+++ b/src/visualisers/WindPlotting.h
@@ -63,7 +63,7 @@ public:
 	virtual void visit(Data&, PointsHandler&, HistoVisitor&) {};
 	virtual void adjust( CustomisedPointsList&,const Transformation&);
 	bool needLegend() { return legend_; }
-	void legendOnly(bool legend) { legendOnly_ = legend; }
+	void legendOnly(bool legend) { legendOnly_ = legend; legend_only_ = legend; }
 	Colour& colour(Colour& Colour, double, double, double);
 	
 	Colour& off(Colour& colour, double, double, double) { return colour; }
diff --git a/src/web/GeoJSon.cc b/src/web/GeoJSon.cc
index 10040eb..a452fd9 100644
--- a/src/web/GeoJSon.cc
+++ b/src/web/GeoJSon.cc
@@ -31,19 +31,270 @@
 
 
 #include "GeoJSon.h"
-
+#include "Factory.h"
+#include "BinningObject.h"
 
 
 using namespace magics;
 using namespace json_spirit;
 
+namespace magics {
+
+class GeoObject
+{
+public:
+		static int index_;
+		GeoObject():parent_(0), shift_(false) {
+
+
+			ostringstream n;
+				n << "GeoObject_" << index_;
+				name_ = n.str();
+
+			index_++;
+
+		}
+		virtual ~GeoObject() {}
+		virtual void decode(const json_spirit::Value& value) {}
+		void properties(const json_spirit::Value& value) {
+			Object object = value.get_value< Object >();
+			for (vector<Pair>::const_iterator entry = object.begin(); entry !=  object.end(); ++entry) {
+
+
+				properties_.insert(make_pair(entry->name_, entry->value_.get_value<string>()));
+			}
+		}
+		string name_;
+		void properties(CustomisedPoint&) {}
+		const string& getProperty(const string& name, const string& def = "") {
+
+
+			map<string, string>::iterator property = properties_.find(name);
+			if ( property != properties_.end() ) {
+
+				return property->second;
+			}
+			if ( parent_ )
+				return parent_->getProperty(name, def);
+			return def;
+		}
+
+		map<string, string> properties_;
+		GeoObject* parent_;
+		virtual void create(PointsList& out) {
+			for (vector<GeoObject*>::iterator object = objects_.begin(); object != objects_.end(); ++object) {
+				(*object)->create(out);
+			}
+		}
+
+		virtual void create(const std::set<string>& needs, CustomisedPointsList& out) {
+			for (vector<GeoObject*>::iterator object = objects_.begin(); object != objects_.end(); ++object) {
+				(*object)->create(needs, out);
+			}
+		}
+
+
+		virtual bool shift() {
+			for (vector<GeoObject*>::iterator object = objects_.begin(); object != objects_.end(); ++object) {
+							if ( (*object)->shift() ) {
+								shift_ = true;
+								break;
+							}
+						}
+			return shift_;
+		}
+		virtual void shift(PointsList& out) {
+
+			if ( !shift() )
+				return;
+
+
+			for (vector<GeoObject*>::iterator object = objects_.begin(); object != objects_.end(); ++object) {
+				(*object)->shift(out);
+			}
+
+		}
+		virtual void shift(const std::set<string>& needs, CustomisedPointsList& out) {
+					if ( !shift() )
+						return;
+					for (vector<GeoObject*>::iterator object = objects_.begin(); object != objects_.end(); ++object) {
+						(*object)->shift(needs, out);
+					}
+		}
+		vector<GeoObject*> objects_;
+		virtual GeoObject* push_back(GeoObject* o) {
+
+			objects_.push_back(o);
+
+			o->parent_ = this;
+			return o;
+		}
+		void newline(CustomisedPointsList& out) {
+			if ( out.empty() )
+				return;
+			CustomisedPoint* last = out.back();
+			CustomisedPoint* point = new CustomisedPoint();
+			point->copyProperties(*last);
+			point->missing(true);
+			out.push_back(point);
+		}
+		bool shift_;
+};
+
+
+int GeoObject::index_ = 0;
+class GeoFeature : public GeoObject
+{
+public:
+	GeoFeature() {
+		ostringstream n;
+		n << "GeoFeature_" << index_;
+		name_ = n.str();
+
+	}
+	virtual ~GeoFeature() {}
+
+
+	void create(PointsList& out) {
+		GeoObject::create(out);
+		out.push_back(new UserPoint(0,0,0,true));
+	}
+	void shift(PointsList& out) {
+			GeoObject::shift(out);
+			out.push_back(new UserPoint(0,0,0,true));
+	}
+	void create(const std::set<string>& needs, CustomisedPointsList& out) {
+		GeoObject::create(needs, out);
+		newline(out);
+
+	}
+	void shift(const std::set<string>& needs, CustomisedPointsList& out) {
+			GeoObject::shift(needs, out);
+			newline(out);
+	}
+
+};
+
+class GeoPoint : public GeoObject
+{
+public:
+	GeoPoint() {
+		ostringstream n;
+		n << "GeoPoint_" << index_;
+		name_ = n.str();
+
+	}
+	virtual ~GeoPoint() {}
+	virtual void decode(const json_spirit::Value& value) {
+
+		Array point = value.get_value< Array>();
+		lon_ = point[0].get_value<double>();
+		lat_ = point[1].get_value<double>();
+		if ( lon_ < 0 ) {
+			lon_ += 360;
+			shift_ = true;
+		}
+
+	}
+	double lat_;
+	double lon_;
+
+	void create(PointsList& out) {
+		UserPoint* point = new UserPoint(lon_, lat_, tonumber(getProperty("value", "0")), false, false, getProperty("name"));
+
+		out.push_back(point);
+
+	}
+	void shift(PointsList& out) {
+		UserPoint* point = new UserPoint(lon_-360., lat_, tonumber(getProperty("value", "0")), false, false, getProperty("name"));
+
+		out.push_back(point);
+	}
+
+	void set(const std::set<string>& needs, CustomisedPoint& point) {
+		for (  std::set<string>::iterator need = needs.begin(); need != needs.end(); ++need ) {
+			string value = getProperty(*need);
+			if ( value.empty() )
+				continue;
+			point.insert(make_pair(*need, tonumber(value)));
+		}
+	}
 
+	void create(const std::set<string>& needs, CustomisedPointsList& out) {
+		CustomisedPoint* point = new CustomisedPoint(lon_, lat_,  getProperty("name"));
+		set(needs, *point);
+		out.push_back(point);
+	}
+	void shift(const std::set<string>& needs, CustomisedPointsList& out) {
+		CustomisedPoint* point = new CustomisedPoint(lon_-360., lat_,  getProperty("name"));
+		set(needs, *point);
+		out.push_back(point);
+	}
+};
 
-GeoJSon::GeoJSon() 
+class MultiLineString : public GeoObject
+{
+public:
+	MultiLineString() {
+		ostringstream n;
+		n << "GeoPoint_" << index_;
+		name_ = n.str();
+
+	}
+	virtual ~MultiLineString() {}
+	virtual void decode(const json_spirit::Value& value) {
+
+		Array lines = value.get_value< Array>();
+		for (unsigned int i = 0; i < lines.size(); i++) {
+			lines_.push_back(vector<pair<double, double> >());
+			Array line = lines[i].get_value< Array >();
+			for (unsigned int pt = 0; pt < line.size(); pt++) {
+				Array point = line[pt].get_value< Array >();
+				lines_.back().push_back(make_pair(point[0].get_value<double>(), point[1].get_value<double>()) );
+			}
+		}
+
+	}
+	vector<vector<pair<double, double> > > lines_;
+	void create(PointsList& out) {
+		double value = tonumber(getProperty("value", "0"));
+		string name =  getProperty("name");
+		for (vector<vector<pair<double, double> > >::iterator line = lines_.begin(); line != lines_.end(); ++line) {
+			for ( vector<pair<double, double> >::iterator point = line->begin(); point != line->end(); ++point ) {
+				UserPoint* upoint = new UserPoint(point->first, point->second, value, false, false, name);
+				out.push_back(upoint);
+			}
+			out.push_back(new UserPoint(0,0,0,true));
+		}
+	}
+	void shift(PointsList& out) {
+			double value = tonumber(getProperty("value", "0"));
+			string name =  getProperty("name");
+			for (vector<vector<pair<double, double> > >::iterator line = lines_.begin(); line != lines_.end(); ++line) {
+				for ( vector<pair<double, double> >::iterator point = line->begin(); point != line->end(); ++point ) {
+					UserPoint* upoint = new UserPoint(point->first, point->second, value, false, false, name);
+					out.push_back(upoint);
+				}
+				out.push_back(new UserPoint(0,0,0,true));
+			}
+		}
+
+};
+
+}
+static SimpleObjectMaker<GeoPoint, GeoObject> Point("Point");
+static SimpleObjectMaker<GeoFeature, GeoObject> FeatureCollection("FeatureCollection");
+static SimpleObjectMaker<GeoObject> Feature("Feature");
+static SimpleObjectMaker<MultiLineString, GeoObject> MultiLineString("MultiLineString");
+
+GeoJSon::GeoJSon(): current_(0), parent_(0), matrix_(0)
 {
 	methods_["coordinates"] = &GeoJSon::coordinates;
 	methods_["type"] = &GeoJSon::type;
 	methods_["properties"] = &GeoJSon::properties;
+	methods_["geometry"] = &GeoJSon::geometry;
+	methods_["features"] = &GeoJSon::features;
+
 }
 
 GeoJSon::~GeoJSon()
@@ -51,6 +302,26 @@ GeoJSon::~GeoJSon()
 	
 }
 
+MatrixHandler& GeoJSon::matrix()
+{
+	if  ( !matrix_ ) {
+		decode();
+		BinningObject binning;
+		binning.x_ = "interval";
+		binning.x_interval_ = binning_resolution_;
+		binning.x_reference_ = -180.;
+		binning.y_ = "interval";
+		binning.y_interval_ = binning_resolution_;
+		binning.y_reference_ = -90.;
+
+		matrix_ = binning(*this);
+
+	}
+
+	matrixHandlers_.push_back(new MatrixHandler(*matrix_));
+	return *(matrixHandlers_.back());
+}
+
 void GeoJSon::print(ostream& out) const
 {
     out <<"ObsJSon[";
@@ -59,28 +330,71 @@ void GeoJSon::print(ostream& out) const
 }
 void GeoJSon::coordinates(const json_spirit::Value& value)
 {
-	Array lines = value.get_value< Array>();
-	for (unsigned int i = 0; i < lines.size(); i++) {
-		Array line = lines[i].get_value< Array >();
-		for (unsigned int pt = 0; pt < line.size(); pt++) {
-			Array point = line[pt].get_value< Array >();
-			push_back(new UserPoint(point[0].get_value<double>(), point[1].get_value<double>()));
-		}
-		push_back(new UserPoint(0,0,0,true));
+	ASSERT(current_);
+	current_->decode(value);
+}
+void GeoJSon::properties(const json_spirit::Value& value)
+{
+	ASSERT(current_);
+	current_->properties(value);
+}
+void GeoJSon::features(const json_spirit::Value& value)
+{
+	Array features = value.get_value< Array>();
+	for (unsigned int i = 0; i < features.size(); i++) {
+		dig(features[i]);
 	}
 }
-void GeoJSon::properties(const json_spirit::Value&)
+void GeoJSon::geometry(const json_spirit::Value& value)
+{
+	dig(value);
+}
+
+string GeoJSon::find(json_spirit::Object& object, const string& name)
 {
+	for (vector<Pair>::const_iterator entry = object.begin(); entry !=  object.end(); ++entry) {
 
+		if ( entry->name_ == name )
+			return entry->value_.get_value<string>();
+	}
+	return "";
 }
 
-void GeoJSon::type(const json_spirit::Value&)
+void GeoJSon::dig(const json_spirit::Value& value)
+{
+	Object object = value.get_value< Object >();
+
+	// Find the type :
+	string type = find(object, "type" );
+
+	GeoObject *previous = current_;
+	if ( type != "" ) {
+		GeoObject* current = SimpleObjectMaker<GeoObject>::create(type);
+		previous = current_;
+		current_ = ( current_ ) ? current_->push_back(current) : current;
+
+		if ( !parent_ )
+			parent_ = current_;
+	}
+	for (vector<Pair>::const_iterator entry = object.begin(); entry !=  object.end(); ++entry) {
+		map<string,  Method >::iterator method = methods_.find(entry->name_);
+
+		if ( method != methods_.end() ) {
+			( (this->*method->second)(entry->value_) );
+		}
+	}
+	current_ = previous;
+}
+
+void GeoJSon::type(const json_spirit::Value& value)
 {
 
 }
 
 void GeoJSon::decode()
 {
+	if ( points_.size() )
+		return;
 	points_.clear();
 
 	try {
@@ -93,24 +407,16 @@ void GeoJSon::decode()
 			ifstream is(path_.c_str());
 			json_spirit::read_or_throw(is, value );
 		}
-
-		Object object = value.get_value< Object >();
-
-
-
-		for (vector<Pair>::const_iterator entry = object.begin(); entry !=  object.end(); ++entry) {
-			map<string,  Method >::iterator method = methods_.find(entry->name_);
-			if ( method != methods_.end() ) {
-				( (this->*method->second)(entry->value_) );
-			}
-
-		}
+		dig(value);
 	}
 	catch (std::exception e) {
 		MagLog::error() << "Could not processed the file: " << path_ << ": " << e.what() << endl;
 		abort();
 	}
-
+	if ( parent_ ) {
+		parent_->create(*this);
+		parent_->shift(*this);
+	}
 }
 
 
@@ -129,7 +435,15 @@ PointsHandler& GeoJSon::points(const Transformation& transformation, bool)
 
 }
 
-void GeoJSon::customisedPoints(const Transformation&, const std::set<string>&, CustomisedPointsList&, bool )
+void GeoJSon::customisedPoints(const Transformation&, const std::set<string>& needs, CustomisedPointsList& out, bool )
 {
+	decode();
+
+	if ( parent_ ) {
+			parent_->create(needs, out);
+			parent_->shift(needs, out);
+	}
+
+
 
 }
diff --git a/src/web/GeoJSon.h b/src/web/GeoJSon.h
index 203f635..cc1295e 100644
--- a/src/web/GeoJSon.h
+++ b/src/web/GeoJSon.h
@@ -46,7 +46,7 @@
 
 namespace magics {
 
-
+class GeoObject;
 
 class GeoJSon:
 			public Data,
@@ -59,27 +59,29 @@ public:
 	
 	typedef void (GeoJSon::*Method)(const json_spirit::Value&);
 
-
 	map<string,  Method> methods_;
 	
-
-
-	
     void points(const Transformation&, vector<UserPoint>&);
     void customisedPoints(const Transformation&, const std::set<string>&, CustomisedPointsList&, bool );
     PointsHandler& points(const Transformation&, bool);
-
+    MatrixHandler& matrix();
 
 protected:
      //! Method to print string about this class on to a stream of type ostream (virtual).
 	 virtual void print(ostream&) const; 
 	 void decode();
+	 void dig(const json_spirit::Value&);
 	 void coordinates(const json_spirit::Value&);
 	 void properties(const json_spirit::Value&);
 	 void type(const json_spirit::Value&);
-	 vector<CustomisedPoint*> points_;
+	 void geometry(const json_spirit::Value&);
+	 void features(const json_spirit::Value&);
+	 string find(json_spirit::Object&, const string&);
 
-    
+	 vector<CustomisedPoint*> points_;
+	 GeoObject* current_;
+	 GeoObject* parent_;
+	 Matrix *matrix_;
 
 private:
     //! Copy constructor - No copy allowed
diff --git a/src/web/WrepJSon.cc b/src/web/WrepJSon.cc
index cd1a27c..2b336b2 100644
--- a/src/web/WrepJSon.cc
+++ b/src/web/WrepJSon.cc
@@ -383,6 +383,14 @@ void WrepJSon::eps()
 		double speed = (intensity ==  (values_.values_.end() ) ) ? 0 : intensity->second[i]; 
 		double dir = (direction ==  (values_.values_.end() ) ) ? 0 : direction->second[i]; 
 		CustomisedPoint* point = new CustomisedPoint();		
+
+		DateTime current = base_ + Second(values_.steps_[i] * 3600);
+		(*point)["year"] = current.date().year();
+		(*point)["month"] = current.date().month();
+		(*point)["day"] = current.date().day();
+		(*point)["hours"] = current.time().hours();
+		(*point)["minutes"] = current.time().minutes();
+		(*point)["seconds"] = current.time().seconds();
 		point->longitude(values_.steps_[i] * 3600);		 
 		point->latitude(values_.steps_[i] * 3600);		 
 		(*point)["step"]    = values_.steps_[i] * 3600;
@@ -1321,7 +1329,6 @@ void WrepJSon::visit(TextVisitor& text)
 	}
 
 
-
 	text.update("json", "full_temperature_correction_info", full_correction.str());
 	text.update("json", "short_temperature_correction_info", short_correction.str());
 	text.update("json", "parameter_info", (param_info_ == "none") ? "": param_info_ );
diff --git a/utils/bufrgram.py b/utils/bufrgram.py
index 24e0e1e..ca0ddec 100644
--- a/utils/bufrgram.py
+++ b/utils/bufrgram.py
@@ -94,11 +94,11 @@ def bufrgram(data):
                           metgram_plot_style = 'bar')
     cc_text = mtext(
                 text_colour =  "navy",
-                text_font_size = 0.2,
+                text_font_size = 0.5,
                 text_justification =  "left",
-                text_lines =  ["<font size='0.5'> <json_info key='station_info'/></font>",
+                text_lines =  ["<json_info key='station_info'/>",
                     "<font size='0.5'> <json_info key='date'/></font>",
-                    "<font size='0.5'> . </font>",
+                    "<font size='0.5' colour='white'> . </font>",
                     "<font size='0.4'> <json_info key='parameter_info'/></font> "]
             )
 
diff --git a/utils/input/37.00_35.32_10u.json b/utils/input/37.00_35.32_10u.json
new file mode 100644
index 0000000..61849a4
--- /dev/null
+++ b/utils/input/37.00_35.32_10u.json
@@ -0,0 +1,223 @@
+{
+    "forecast_location": {
+        "latitude": 37.012301461157264,
+        "distance": 5.167124375483275,
+        "longitude": 35.263852242744065
+    },
+    "height": 50,
+    "location": {
+        "lat": 37.0,
+        "lon": 35.32
+    },
+    "time": "00",
+    "date": "20160419",
+    "output": "37.00_35.32_10u.json",
+    "station_name": "Adana",
+    "10u": {
+        "steps": [
+            "0",
+            "3",
+            "6",
+            "9",
+            "12",
+            "15",
+            "18",
+            "21",
+            "24",
+            "27",
+            "30",
+            "33",
+            "36",
+            "39",
+            "42",
+            "45",
+            "48",
+            "51",
+            "54",
+            "57",
+            "60",
+            "63",
+            "66",
+            "69",
+            "72",
+            "75",
+            "78",
+            "81",
+            "84",
+            "87",
+            "90",
+            "93",
+            "96",
+            "99",
+            "102",
+            "105",
+            "108",
+            "111",
+            "114",
+            "117",
+            "120",
+            "123",
+            "126",
+            "129",
+            "132",
+            "135",
+            "138",
+            "141",
+            "144",
+            "150",
+            "156",
+            "162",
+            "168",
+            "174",
+            "180",
+            "186",
+            "192",
+            "198",
+            "204",
+            "210",
+            "216",
+            "222",
+            "228",
+            "234",
+            "240"
+        ],
+        "10u": [
+            -0.656097412109375,
+            -0.6875,
+            0.249542236328125,
+            -1.839080810546875,
+            -2.155181884765625,
+            -0.2914581298828125,
+            2.7479095458984375,
+            -0.734130859375,
+            -0.158233642578125,
+            -0.2945404052734375,
+            -0.208465576171875,
+            -0.87286376953125,
+            0.83441162109375,
+            2.5236663818359375,
+            0.8609161376953125,
+            -0.0679473876953125,
+            -1.31085205078125,
+            -0.466949462890625,
+            -0.8086700439453125,
+            0.3325958251953125,
+            2.6600189208984375,
+            1.0920867919921875,
+            1.309234619140625,
+            -2.84185791015625,
+            1.5451202392578125,
+            -1.59637451171875,
+            -2.3056488037109375,
+            -0.9296722412109375,
+            -1.3208160400390625,
+            3.0722808837890625,
+            2.091644287109375,
+            -0.327606201171875,
+            -0.7340240478515625,
+            -0.46807861328125,
+            0.3505401611328125,
+            0.98321533203125,
+            2.368255615234375,
+            3.6607208251953125,
+            1.883056640625,
+            0.133514404296875,
+            -0.3946380615234375,
+            -0.8407440185546875,
+            -1.099884033203125,
+            -0.4441070556640625,
+            1.5653533935546875,
+            2.5539093017578125,
+            1.6402435302734375,
+            -0.7368316650390625,
+            -0.276885986328125,
+            -0.5802154541015625,
+            0.88775634765625,
+            2.4001007080078125,
+            -0.7680511474609375,
+            -0.520843505859375,
+            0.6084747314453125,
+            -1.4952850341796875,
+            -1.7485504150390625,
+            -2.8776397705078125,
+            -0.1529541015625,
+            -0.329071044921875,
+            -1.4511260986328125,
+            -1.42181396484375,
+            1.276824951171875,
+            -0.1305694580078125,
+            -0.5270538330078125
+        ],
+        "10v": [
+            -1.39080810546875,
+            -1.6737213134765625,
+            -1.0354766845703125,
+            -1.7921295166015625,
+            -0.272064208984375,
+            1.3854217529296875,
+            -0.00360107421875,
+            -0.2913665771484375,
+            -1.6612548828125,
+            -1.758270263671875,
+            -1.0623931884765625,
+            0.9999542236328125,
+            3.6143798828125,
+            2.1895904541015625,
+            1.714599609375,
+            -0.6298675537109375,
+            -1.5398406982421875,
+            -1.8553314208984375,
+            0.619903564453125,
+            3.44122314453125,
+            5.31573486328125,
+            2.1760406494140625,
+            -10.150650024414062,
+            -5.5760498046875,
+            -3.3589019775390625,
+            -2.646209716796875,
+            -4.5130615234375,
+            -5.240478515625,
+            -0.8084259033203125,
+            2.0362396240234375,
+            1.3332977294921875,
+            -1.5885772705078125,
+            -1.3899993896484375,
+            -1.496246337890625,
+            -0.76519775390625,
+            1.0582275390625,
+            2.2641754150390625,
+            2.0411834716796875,
+            0.441070556640625,
+            1.4689788818359375,
+            -0.7352447509765625,
+            -1.158447265625,
+            0.103179931640625,
+            1.01373291015625,
+            3.3959503173828125,
+            3.2667388916015625,
+            1.3455963134765625,
+            0.137603759765625,
+            -1.5401153564453125,
+            -1.4615020751953125,
+            2.3779144287109375,
+            0.4443511962890625,
+            -1.1491241455078125,
+            -0.2032012939453125,
+            4.7884979248046875,
+            0.64691162109375,
+            -0.7286224365234375,
+            -0.5706634521484375,
+            1.9560699462890625,
+            1.3690032958984375,
+            0.233795166015625,
+            0.442840576171875,
+            3.9861297607421875,
+            1.4842071533203125,
+            -0.2207183837890625
+        ]
+    },
+    "metadata": {
+        "points_along_meridian": 2560,
+        "deterministic_height": 65.37060546875
+    }
+}
diff --git a/utils/input/37.00_35.32_10uv.json b/utils/input/37.00_35.32_10uv.json
new file mode 100644
index 0000000..fa0bba7
--- /dev/null
+++ b/utils/input/37.00_35.32_10uv.json
@@ -0,0 +1,223 @@
+{
+    "forecast_location": {
+        "latitude": 37.012301461157264,
+        "distance": 5.167124375483275,
+        "longitude": 35.263852242744065
+    },
+    "height": 50,
+    "location": {
+        "lat": 37.0,
+        "lon": 35.32
+    },
+    "time": "00",
+    "date": "20160419",
+    "output": "37.00_35.32_10u.json",
+    "station_name": "Adana",
+    "10uv": {
+        "steps": [
+            "0",
+            "3",
+            "6",
+            "9",
+            "12",
+            "15",
+            "18",
+            "21",
+            "24",
+            "27",
+            "30",
+            "33",
+            "36",
+            "39",
+            "42",
+            "45",
+            "48",
+            "51",
+            "54",
+            "57",
+            "60",
+            "63",
+            "66",
+            "69",
+            "72",
+            "75",
+            "78",
+            "81",
+            "84",
+            "87",
+            "90",
+            "93",
+            "96",
+            "99",
+            "102",
+            "105",
+            "108",
+            "111",
+            "114",
+            "117",
+            "120",
+            "123",
+            "126",
+            "129",
+            "132",
+            "135",
+            "138",
+            "141",
+            "144",
+            "150",
+            "156",
+            "162",
+            "168",
+            "174",
+            "180",
+            "186",
+            "192",
+            "198",
+            "204",
+            "210",
+            "216",
+            "222",
+            "228",
+            "234",
+            "240"
+        ],
+        "10u": [
+            -0.656097412109375,
+            -0.6875,
+            0.249542236328125,
+            -1.839080810546875,
+            -2.155181884765625,
+            -0.2914581298828125,
+            2.7479095458984375,
+            -0.734130859375,
+            -0.158233642578125,
+            -0.2945404052734375,
+            -0.208465576171875,
+            -0.87286376953125,
+            0.83441162109375,
+            2.5236663818359375,
+            0.8609161376953125,
+            -0.0679473876953125,
+            -1.31085205078125,
+            -0.466949462890625,
+            -0.8086700439453125,
+            0.3325958251953125,
+            2.6600189208984375,
+            1.0920867919921875,
+            1.309234619140625,
+            -2.84185791015625,
+            1.5451202392578125,
+            -1.59637451171875,
+            -2.3056488037109375,
+            -0.9296722412109375,
+            -1.3208160400390625,
+            3.0722808837890625,
+            2.091644287109375,
+            -0.327606201171875,
+            -0.7340240478515625,
+            -0.46807861328125,
+            0.3505401611328125,
+            0.98321533203125,
+            2.368255615234375,
+            3.6607208251953125,
+            1.883056640625,
+            0.133514404296875,
+            -0.3946380615234375,
+            -0.8407440185546875,
+            -1.099884033203125,
+            -0.4441070556640625,
+            1.5653533935546875,
+            2.5539093017578125,
+            1.6402435302734375,
+            -0.7368316650390625,
+            -0.276885986328125,
+            -0.5802154541015625,
+            0.88775634765625,
+            2.4001007080078125,
+            -0.7680511474609375,
+            -0.520843505859375,
+            0.6084747314453125,
+            -1.4952850341796875,
+            -1.7485504150390625,
+            -2.8776397705078125,
+            -0.1529541015625,
+            -0.329071044921875,
+            -1.4511260986328125,
+            -1.42181396484375,
+            1.276824951171875,
+            -0.1305694580078125,
+            -0.5270538330078125
+        ],
+        "10v": [
+            -1.39080810546875,
+            -1.6737213134765625,
+            -1.0354766845703125,
+            -1.7921295166015625,
+            -0.272064208984375,
+            1.3854217529296875,
+            -0.00360107421875,
+            -0.2913665771484375,
+            -1.6612548828125,
+            -1.758270263671875,
+            -1.0623931884765625,
+            0.9999542236328125,
+            3.6143798828125,
+            2.1895904541015625,
+            1.714599609375,
+            -0.6298675537109375,
+            -1.5398406982421875,
+            -1.8553314208984375,
+            0.619903564453125,
+            3.44122314453125,
+            5.31573486328125,
+            2.1760406494140625,
+            -10.150650024414062,
+            -5.5760498046875,
+            -3.3589019775390625,
+            -2.646209716796875,
+            -4.5130615234375,
+            -5.240478515625,
+            -0.8084259033203125,
+            2.0362396240234375,
+            1.3332977294921875,
+            -1.5885772705078125,
+            -1.3899993896484375,
+            -1.496246337890625,
+            -0.76519775390625,
+            1.0582275390625,
+            2.2641754150390625,
+            2.0411834716796875,
+            0.441070556640625,
+            1.4689788818359375,
+            -0.7352447509765625,
+            -1.158447265625,
+            0.103179931640625,
+            1.01373291015625,
+            3.3959503173828125,
+            3.2667388916015625,
+            1.3455963134765625,
+            0.137603759765625,
+            -1.5401153564453125,
+            -1.4615020751953125,
+            2.3779144287109375,
+            0.4443511962890625,
+            -1.1491241455078125,
+            -0.2032012939453125,
+            4.7884979248046875,
+            0.64691162109375,
+            -0.7286224365234375,
+            -0.5706634521484375,
+            1.9560699462890625,
+            1.3690032958984375,
+            0.233795166015625,
+            0.442840576171875,
+            3.9861297607421875,
+            1.4842071533203125,
+            -0.2207183837890625
+        ]
+    },
+    "metadata": {
+        "points_along_meridian": 2560,
+        "deterministic_height": 65.37060546875
+    }
+}
diff --git a/utils/input/37.00_35.32_10v.json b/utils/input/37.00_35.32_10v.json
new file mode 100644
index 0000000..2d115e6
--- /dev/null
+++ b/utils/input/37.00_35.32_10v.json
@@ -0,0 +1,156 @@
+{
+    "forecast_location": {
+        "latitude": 37.012301461157264,
+        "distance": 5.167124375483275,
+        "longitude": 35.263852242744065
+    },
+    "height": 50,
+    "location": {
+        "lat": 37.0,
+        "lon": 35.32
+    },
+    "time": "00",
+    "date": "20160419",
+    "output": "37.00_35.32_10v.json",
+    "station_name": "Adana",
+    "10v": {
+        "steps": [
+            "0",
+            "3",
+            "6",
+            "9",
+            "12",
+            "15",
+            "18",
+            "21",
+            "24",
+            "27",
+            "30",
+            "33",
+            "36",
+            "39",
+            "42",
+            "45",
+            "48",
+            "51",
+            "54",
+            "57",
+            "60",
+            "63",
+            "66",
+            "69",
+            "72",
+            "75",
+            "78",
+            "81",
+            "84",
+            "87",
+            "90",
+            "93",
+            "96",
+            "99",
+            "102",
+            "105",
+            "108",
+            "111",
+            "114",
+            "117",
+            "120",
+            "123",
+            "126",
+            "129",
+            "132",
+            "135",
+            "138",
+            "141",
+            "144",
+            "150",
+            "156",
+            "162",
+            "168",
+            "174",
+            "180",
+            "186",
+            "192",
+            "198",
+            "204",
+            "210",
+            "216",
+            "222",
+            "228",
+            "234",
+            "240"
+        ],
+        "forecast": [
+            -1.39080810546875,
+            -1.6737213134765625,
+            -1.0354766845703125,
+            -1.7921295166015625,
+            -0.272064208984375,
+            1.3854217529296875,
+            -0.00360107421875,
+            -0.2913665771484375,
+            -1.6612548828125,
+            -1.758270263671875,
+            -1.0623931884765625,
+            0.9999542236328125,
+            3.6143798828125,
+            2.1895904541015625,
+            1.714599609375,
+            -0.6298675537109375,
+            -1.5398406982421875,
+            -1.8553314208984375,
+            0.619903564453125,
+            3.44122314453125,
+            5.31573486328125,
+            2.1760406494140625,
+            -10.150650024414062,
+            -5.5760498046875,
+            -3.3589019775390625,
+            -2.646209716796875,
+            -4.5130615234375,
+            -5.240478515625,
+            -0.8084259033203125,
+            2.0362396240234375,
+            1.3332977294921875,
+            -1.5885772705078125,
+            -1.3899993896484375,
+            -1.496246337890625,
+            -0.76519775390625,
+            1.0582275390625,
+            2.2641754150390625,
+            2.0411834716796875,
+            0.441070556640625,
+            1.4689788818359375,
+            -0.7352447509765625,
+            -1.158447265625,
+            0.103179931640625,
+            1.01373291015625,
+            3.3959503173828125,
+            3.2667388916015625,
+            1.3455963134765625,
+            0.137603759765625,
+            -1.5401153564453125,
+            -1.4615020751953125,
+            2.3779144287109375,
+            0.4443511962890625,
+            -1.1491241455078125,
+            -0.2032012939453125,
+            4.7884979248046875,
+            0.64691162109375,
+            -0.7286224365234375,
+            -0.5706634521484375,
+            1.9560699462890625,
+            1.3690032958984375,
+            0.233795166015625,
+            0.442840576171875,
+            3.9861297607421875,
+            1.4842071533203125,
+            -0.2207183837890625
+        ]
+    },
+    "metadata": {
+        "points_along_meridian": 2560,
+        "deterministic_height": 65.37060546875
+    }
+}
diff --git a/utils/input/37.00_35.32_2t.json b/utils/input/37.00_35.32_2t.json
new file mode 100644
index 0000000..1ea5bb4
--- /dev/null
+++ b/utils/input/37.00_35.32_2t.json
@@ -0,0 +1,156 @@
+{
+    "2t": {
+        "steps": [
+            "0",
+            "3",
+            "6",
+            "9",
+            "12",
+            "15",
+            "18",
+            "21",
+            "24",
+            "27",
+            "30",
+            "33",
+            "36",
+            "39",
+            "42",
+            "45",
+            "48",
+            "51",
+            "54",
+            "57",
+            "60",
+            "63",
+            "66",
+            "69",
+            "72",
+            "75",
+            "78",
+            "81",
+            "84",
+            "87",
+            "90",
+            "93",
+            "96",
+            "99",
+            "102",
+            "105",
+            "108",
+            "111",
+            "114",
+            "117",
+            "120",
+            "123",
+            "126",
+            "129",
+            "132",
+            "135",
+            "138",
+            "141",
+            "144",
+            "150",
+            "156",
+            "162",
+            "168",
+            "174",
+            "180",
+            "186",
+            "192",
+            "198",
+            "204",
+            "210",
+            "216",
+            "222",
+            "228",
+            "234",
+            "240"
+        ],
+        "forecast": [
+            288.91458129882812,
+            288.54586791992188,
+            296.18618774414062,
+            303.82273864746094,
+            305.10614013671875,
+            301.725341796875,
+            294.60444641113281,
+            295.60850524902344,
+            290.39402770996094,
+            289.45220947265625,
+            298.20748901367188,
+            304.35835266113281,
+            306.15135192871094,
+            301.41152954101562,
+            295.39375305175781,
+            292.74162292480469,
+            288.92292785644531,
+            287.71070861816406,
+            296.14872741699219,
+            301.43095397949219,
+            300.20884704589844,
+            296.97767639160156,
+            293.11671447753906,
+            291.45625305175781,
+            288.75180053710938,
+            286.4984130859375,
+            289.8927001953125,
+            295.88160705566406,
+            298.57060241699219,
+            295.13603210449219,
+            288.06671142578125,
+            287.25543212890625,
+            286.25294494628906,
+            285.35408020019531,
+            293.31047058105469,
+            298.72000122070312,
+            300.40830993652344,
+            296.73867797851562,
+            291.20381164550781,
+            290.82534790039062,
+            290.25811767578125,
+            288.73689270019531,
+            294.11283874511719,
+            298.60238647460938,
+            300.86419677734375,
+            296.46060180664062,
+            290.23733520507812,
+            291.12948608398438,
+            287.91783142089844,
+            295.12501525878906,
+            303.47758483886719,
+            292.45878601074219,
+            287.81675720214844,
+            295.89714050292969,
+            299.05499267578125,
+            291.43338012695312,
+            289.16070556640625,
+            294.25175476074219,
+            301.20860290527344,
+            291.83244323730469,
+            288.42105102539062,
+            293.08377075195312,
+            298.53788757324219,
+            291.06959533691406,
+            290.53083801269531
+        ]
+    },
+    "forecast_location": {
+        "latitude": 37.012301461157264,
+        "distance": 5.167124375483275,
+        "longitude": 35.263852242744065
+    },
+    "height": 50,
+    "location": {
+        "lat": 37.0,
+        "lon": 35.32
+    },
+    "time": "00",
+    "date": "20160419",
+    "output": "37.00_35.32_2t.json",
+    "station_name": "Adana",
+    "metadata": {
+        "points_along_meridian": 2560,
+        "deterministic_height": 65.37060546875
+    }
+}
diff --git a/utils/input/37.00_35.32_cp.json b/utils/input/37.00_35.32_cp.json
new file mode 100644
index 0000000..6a57bdd
--- /dev/null
+++ b/utils/input/37.00_35.32_cp.json
@@ -0,0 +1,156 @@
+{
+    "forecast_location": {
+        "latitude": 37.012301461157264,
+        "distance": 5.167124375483275,
+        "longitude": 35.263852242744065
+    },
+    "height": 50,
+    "location": {
+        "lat": 37.0,
+        "lon": 35.32
+    },
+    "time": "00",
+    "date": "20160419",
+    "output": "37.00_35.32_cp.json",
+    "station_name": "Adana",
+    "cp": {
+        "steps": [
+            "0",
+            "3",
+            "6",
+            "9",
+            "12",
+            "15",
+            "18",
+            "21",
+            "24",
+            "27",
+            "30",
+            "33",
+            "36",
+            "39",
+            "42",
+            "45",
+            "48",
+            "51",
+            "54",
+            "57",
+            "60",
+            "63",
+            "66",
+            "69",
+            "72",
+            "75",
+            "78",
+            "81",
+            "84",
+            "87",
+            "90",
+            "93",
+            "96",
+            "99",
+            "102",
+            "105",
+            "108",
+            "111",
+            "114",
+            "117",
+            "120",
+            "123",
+            "126",
+            "129",
+            "132",
+            "135",
+            "138",
+            "141",
+            "144",
+            "150",
+            "156",
+            "162",
+            "168",
+            "174",
+            "180",
+            "186",
+            "192",
+            "198",
+            "204",
+            "210",
+            "216",
+            "222",
+            "228",
+            "234",
+            "240"
+        ],
+        "forecast": [
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0
+        ]
+    },
+    "metadata": {
+        "points_along_meridian": 2560,
+        "deterministic_height": 65.37060546875
+    }
+}
diff --git a/utils/input/37.00_35.32_msl.json b/utils/input/37.00_35.32_msl.json
new file mode 100644
index 0000000..ab9146b
--- /dev/null
+++ b/utils/input/37.00_35.32_msl.json
@@ -0,0 +1,156 @@
+{
+    "forecast_location": {
+        "latitude": 37.012301461157264,
+        "distance": 5.167124375483275,
+        "longitude": 35.263852242744065
+    },
+    "height": 50,
+    "msl": {
+        "steps": [
+            "0",
+            "3",
+            "6",
+            "9",
+            "12",
+            "15",
+            "18",
+            "21",
+            "24",
+            "27",
+            "30",
+            "33",
+            "36",
+            "39",
+            "42",
+            "45",
+            "48",
+            "51",
+            "54",
+            "57",
+            "60",
+            "63",
+            "66",
+            "69",
+            "72",
+            "75",
+            "78",
+            "81",
+            "84",
+            "87",
+            "90",
+            "93",
+            "96",
+            "99",
+            "102",
+            "105",
+            "108",
+            "111",
+            "114",
+            "117",
+            "120",
+            "123",
+            "126",
+            "129",
+            "132",
+            "135",
+            "138",
+            "141",
+            "144",
+            "150",
+            "156",
+            "162",
+            "168",
+            "174",
+            "180",
+            "186",
+            "192",
+            "198",
+            "204",
+            "210",
+            "216",
+            "222",
+            "228",
+            "234",
+            "240"
+        ],
+        "forecast": [
+            101546.9375,
+            101544.0,
+            101610.3125,
+            101559.375,
+            101383.3125,
+            101285.625,
+            101408.3125,
+            101413.375,
+            101374.9375,
+            101412.75,
+            101525.125,
+            101482.4375,
+            101303.1875,
+            101240.6875,
+            101302.875,
+            101254.5,
+            101146.8125,
+            101096.125,
+            101148.125,
+            101079.0625,
+            100930.25,
+            100880.6875,
+            101061.625,
+            101321.75,
+            101572.0625,
+            101749.5,
+            101873.875,
+            101771.3125,
+            101561.0625,
+            101507.8125,
+            101632.5625,
+            101608.625,
+            101498.1875,
+            101496.4375,
+            101556.5625,
+            101434.1875,
+            101235.0625,
+            101189.4375,
+            101247.4375,
+            101204.9375,
+            101103.875,
+            101085.8125,
+            101151.5625,
+            101089.0,
+            100909.5625,
+            100933.75,
+            101028.1875,
+            101000.3125,
+            100891.8125,
+            100898.25,
+            100709.5,
+            100801.25,
+            100802.75,
+            101021.8125,
+            100988.0625,
+            101165.9375,
+            101144.75,
+            101310.125,
+            101209.0,
+            101336.3125,
+            101306.875,
+            101388.375,
+            101266.75,
+            101382.25,
+            101453.5625
+        ]
+    },
+    "location": {
+        "lat": 37.0,
+        "lon": 35.32
+    },
+    "time": "00",
+    "date": "20160419",
+    "output": "37.00_35.32_msl.json",
+    "station_name": "Adana",
+    "metadata": {
+        "points_along_meridian": 2560,
+        "deterministic_height": 65.37060546875
+    }
+}
diff --git a/utils/input/37.00_35.32_r.json b/utils/input/37.00_35.32_r.json
new file mode 100644
index 0000000..52fd3ed
--- /dev/null
+++ b/utils/input/37.00_35.32_r.json
@@ -0,0 +1,156 @@
+{
+    "forecast_location": {
+        "latitude": 37.012301461157264,
+        "distance": 5.167124375483275,
+        "longitude": 35.263852242744065
+    },
+    "height": 50,
+    "r": {
+        "steps": [
+            "0",
+            "3",
+            "6",
+            "9",
+            "12",
+            "15",
+            "18",
+            "21",
+            "24",
+            "27",
+            "30",
+            "33",
+            "36",
+            "39",
+            "42",
+            "45",
+            "48",
+            "51",
+            "54",
+            "57",
+            "60",
+            "63",
+            "66",
+            "69",
+            "72",
+            "75",
+            "78",
+            "81",
+            "84",
+            "87",
+            "90",
+            "93",
+            "96",
+            "99",
+            "102",
+            "105",
+            "108",
+            "111",
+            "114",
+            "117",
+            "120",
+            "123",
+            "126",
+            "129",
+            "132",
+            "135",
+            "138",
+            "141",
+            "144",
+            "150",
+            "156",
+            "162",
+            "168",
+            "174",
+            "180",
+            "186",
+            "192",
+            "198",
+            "204",
+            "210",
+            "216",
+            "222",
+            "228",
+            "234",
+            "240"
+        ],
+        "forecast": [
+            21.959823608398438,
+            21.173563003540039,
+            21.719727516174316,
+            18.941998481750488,
+            24.244024276733398,
+            24.867341041564941,
+            19.520977020263672,
+            15.790532112121582,
+            20.673953056335449,
+            22.477451324462891,
+            24.87923526763916,
+            18.88481616973877,
+            25.713098526000977,
+            17.712313652038574,
+            14.419735908508301,
+            14.220227241516113,
+            19.132566452026367,
+            23.342550277709961,
+            23.422256469726562,
+            28.82038688659668,
+            16.295899391174316,
+            15.807450294494629,
+            60.620522499084473,
+            22.416717529296875,
+            32.967270851135254,
+            28.271215438842773,
+            12.971820831298828,
+            25.443082809448242,
+            30.015945434570312,
+            29.04448413848877,
+            25.20158863067627,
+            26.060318946838379,
+            39.803343772888184,
+            34.084344863891602,
+            19.553410530090332,
+            27.845093727111816,
+            36.661808013916016,
+            22.537065505981445,
+            18.216238021850586,
+            17.214380264282227,
+            20.381645202636719,
+            19.65166187286377,
+            22.899279594421387,
+            23.641171455383301,
+            34.671133041381836,
+            8.8245716094970703,
+            13.548418045043945,
+            18.183538436889648,
+            23.656298637390137,
+            31.788172721862793,
+            31.155279159545898,
+            13.975152015686035,
+            23.565373420715332,
+            26.078520774841309,
+            34.997767448425293,
+            42.122937202453613,
+            39.068507194519043,
+            43.608613014221191,
+            75.04088306427002,
+            57.547206878662109,
+            48.489943504333496,
+            12.80148983001709,
+            57.779317855834961,
+            47.782944679260254,
+            63.67241096496582
+        ]
+    },
+    "location": {
+        "lat": 37.0,
+        "lon": 35.32
+    },
+    "time": "00",
+    "date": "20160419",
+    "output": "37.00_35.32_r.json",
+    "station_name": "Adana",
+    "metadata": {
+        "points_along_meridian": 2560,
+        "deterministic_height": 65.37060546875
+    }
+}
diff --git a/utils/input/37.00_35.32_t.json b/utils/input/37.00_35.32_t.json
new file mode 100644
index 0000000..19484bf
--- /dev/null
+++ b/utils/input/37.00_35.32_t.json
@@ -0,0 +1,156 @@
+{
+    "forecast_location": {
+        "latitude": 37.012301461157264,
+        "distance": 5.167124375483275,
+        "longitude": 35.263852242744065
+    },
+    "time": "00",
+    "height": 50,
+    "location": {
+        "lat": 37.0,
+        "lon": 35.32
+    },
+    "t": {
+        "steps": [
+            "0",
+            "3",
+            "6",
+            "9",
+            "12",
+            "15",
+            "18",
+            "21",
+            "24",
+            "27",
+            "30",
+            "33",
+            "36",
+            "39",
+            "42",
+            "45",
+            "48",
+            "51",
+            "54",
+            "57",
+            "60",
+            "63",
+            "66",
+            "69",
+            "72",
+            "75",
+            "78",
+            "81",
+            "84",
+            "87",
+            "90",
+            "93",
+            "96",
+            "99",
+            "102",
+            "105",
+            "108",
+            "111",
+            "114",
+            "117",
+            "120",
+            "123",
+            "126",
+            "129",
+            "132",
+            "135",
+            "138",
+            "141",
+            "144",
+            "150",
+            "156",
+            "162",
+            "168",
+            "174",
+            "180",
+            "186",
+            "192",
+            "198",
+            "204",
+            "210",
+            "216",
+            "222",
+            "228",
+            "234",
+            "240"
+        ],
+        "forecast": [
+            289.57730102539062,
+            289.42794799804688,
+            289.044677734375,
+            289.59954833984375,
+            290.2451171875,
+            290.52938842773438,
+            290.98216247558594,
+            291.07249450683594,
+            290.62850952148438,
+            290.51359558105469,
+            290.15573120117188,
+            290.54217529296875,
+            291.17530822753906,
+            291.28166198730469,
+            291.00410461425781,
+            290.64161682128906,
+            289.85441589355469,
+            289.26617431640625,
+            288.56072998046875,
+            288.13592529296875,
+            288.22627258300781,
+            286.70130920410156,
+            283.9954833984375,
+            282.929931640625,
+            278.73347473144531,
+            277.6895751953125,
+            279.54631042480469,
+            280.58976745605469,
+            283.07734680175781,
+            284.07853698730469,
+            284.01048278808594,
+            283.79840087890625,
+            283.47695922851562,
+            283.62898254394531,
+            284.26853942871094,
+            284.22848510742188,
+            285.05915832519531,
+            285.98109436035156,
+            286.17326354980469,
+            286.32913208007812,
+            285.37178039550781,
+            285.12944030761719,
+            284.72381591796875,
+            284.87312316894531,
+            285.87753295898438,
+            286.71095275878906,
+            286.56674194335938,
+            286.96063232421875,
+            287.56991577148438,
+            287.60917663574219,
+            288.36334228515625,
+            289.81588745117188,
+            288.3592529296875,
+            287.59007263183594,
+            288.75871276855469,
+            286.91645812988281,
+            286.36129760742188,
+            285.1220703125,
+            285.21644592285156,
+            285.87643432617188,
+            284.5498046875,
+            284.56692504882812,
+            284.30319213867188,
+            284.92333984375,
+            284.5443115234375
+        ]
+    },
+    "date": "20160419",
+    "output": "37.00_35.32_t.json",
+    "station_name": "Adana",
+    "metadata": {
+        "points_along_meridian": 2560,
+        "deterministic_height": 65.37060546875
+    }
+}
diff --git a/utils/input/37.00_35.32_tcc.json b/utils/input/37.00_35.32_tcc.json
new file mode 100644
index 0000000..3f332ff
--- /dev/null
+++ b/utils/input/37.00_35.32_tcc.json
@@ -0,0 +1,156 @@
+{
+    "forecast_location": {
+        "latitude": 37.012301461157264,
+        "distance": 5.167124375483275,
+        "longitude": 35.263852242744065
+    },
+    "height": 50,
+    "location": {
+        "lat": 37.0,
+        "lon": 35.32
+    },
+    "time": "00",
+    "date": "20160419",
+    "output": "37.00_35.32_tcc.json",
+    "station_name": "Adana",
+    "tcc": {
+        "steps": [
+            "0",
+            "3",
+            "6",
+            "9",
+            "12",
+            "15",
+            "18",
+            "21",
+            "24",
+            "27",
+            "30",
+            "33",
+            "36",
+            "39",
+            "42",
+            "45",
+            "48",
+            "51",
+            "54",
+            "57",
+            "60",
+            "63",
+            "66",
+            "69",
+            "72",
+            "75",
+            "78",
+            "81",
+            "84",
+            "87",
+            "90",
+            "93",
+            "96",
+            "99",
+            "102",
+            "105",
+            "108",
+            "111",
+            "114",
+            "117",
+            "120",
+            "123",
+            "126",
+            "129",
+            "132",
+            "135",
+            "138",
+            "141",
+            "144",
+            "150",
+            "156",
+            "162",
+            "168",
+            "174",
+            "180",
+            "186",
+            "192",
+            "198",
+            "204",
+            "210",
+            "216",
+            "222",
+            "228",
+            "234",
+            "240"
+        ],
+        "forecast": [
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.8800048828125,
+            0.95001220703125,
+            0.489990234375,
+            0.0,
+            0.0,
+            0.790008544921875,
+            0.57000732421875,
+            0.230010986328125,
+            0.339996337890625,
+            0.0,
+            0.790008544921875,
+            0.829986572265625,
+            0.339996337890625,
+            0.0,
+            0.010009765625,
+            0.040008544921875,
+            0.089996337890625,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.07000732421875,
+            0.0,
+            0.0,
+            0.29998779296875,
+            0.94000244140625,
+            0.989990234375,
+            0.040008544921875,
+            0.170013427734375,
+            0.029998779296875,
+            0.0,
+            0.8900146484375,
+            0.0,
+            0.6099853515625,
+            0.6300048828125,
+            0.6199951171875,
+            0.339996337890625,
+            0.760009765625,
+            0.709991455078125,
+            0.8900146484375,
+            0.1199951171875,
+            0.079986572265625,
+            0.0,
+            0.0,
+            0.0,
+            0.1400146484375,
+            0.260009765625,
+            0.0,
+            0.92999267578125,
+            0.3900146484375,
+            0.079986572265625,
+            0.019989013671875,
+            0.829986572265625
+        ]
+    },
+    "metadata": {
+        "points_along_meridian": 2560,
+        "deterministic_height": 65.37060546875
+    }
+}
diff --git a/utils/input/41.30_10.50_10u.json b/utils/input/41.30_10.50_10u.json
new file mode 100644
index 0000000..03bd57a
--- /dev/null
+++ b/utils/input/41.30_10.50_10u.json
@@ -0,0 +1,225 @@
+{
+    "forecast_location": {
+        "latitude": 41.25731752730698,
+        "distance": 6.900076759787546,
+        "longitude": 10.44
+    },
+    "height": 10,
+    "location": {
+        "lat": 41.3,
+        "lon": 10.5
+    },
+    "time": "00",
+    "date": "20160113",
+    "output": "41.30_10.50_10u.json",
+    "station_name": "point2",
+    "10uv": {
+        "steps": [
+            "0",
+            "3",
+            "6",
+            "9",
+            "12",
+            "15",
+            "18",
+            "21",
+            "24",
+            "27",
+            "30",
+            "33",
+            "36",
+            "39",
+            "42",
+            "45",
+            "48",
+            "51",
+            "54",
+            "57",
+            "60",
+            "63",
+            "66",
+            "69",
+            "72",
+            "75",
+            "78",
+            "81",
+            "84",
+            "87",
+            "90",
+            "93",
+            "96",
+            "99",
+            "102",
+            "105",
+            "108",
+            "111",
+            "114",
+            "117",
+            "120",
+            "123",
+            "126",
+            "129",
+            "132",
+            "135",
+            "138",
+            "141",
+            "144",
+            "150",
+            "156",
+            "162",
+            "168",
+            "174",
+            "180",
+            "186",
+            "192",
+            "198",
+            "204",
+            "210",
+            "216",
+            "222",
+            "228",
+            "234",
+            "240"
+        ],
+        "10u": [
+            0.4387054443359375,
+            0.329803466796875,
+            0.4198760986328125,
+            0.087188720703125,
+            0.0217132568359375,
+            -0.3078765869140625,
+            -0.377288818359375,
+            0.4497833251953125,
+            -0.46002197265625,
+            0.0933837890625,
+            0.4078521728515625,
+            0.4187774658203125,
+            0.2692108154296875,
+            -0.185302734375,
+            0.5159149169921875,
+            0.40985107421875,
+            0.402191162109375,
+            0.7711639404296875,
+            0.6942596435546875,
+            0.744720458984375,
+            0.5816192626953125,
+            0.6935577392578125,
+            0.5261993408203125,
+            0.1998443603515625,
+            -0.1970977783203125,
+            0.131072998046875,
+            0.0691680908203125,
+            -0.2661285400390625,
+            -0.6531219482421875,
+            -0.5950469970703125,
+            -0.4775848388671875,
+            -0.653411865234375,
+            -0.7460784912109375,
+            -0.93499755859375,
+            -0.78021240234375,
+            -0.6671142578125,
+            -0.3684844970703125,
+            -0.27777099609375,
+            -0.18316650390625,
+            -0.130401611328125,
+            0.018341064453125,
+            0.1101226806640625,
+            0.3078155517578125,
+            0.0615234375,
+            -0.0902099609375,
+            -0.1082763671875,
+            -0.2016448974609375,
+            -0.611907958984375,
+            -0.257232666015625,
+            -1.1170654296875,
+            -0.2424774169921875,
+            -1.011260986328125,
+            -0.1312408447265625,
+            0.7652587890625,
+            0.40728759765625,
+            0.2418975830078125,
+            0.292327880859375,
+            0.7292633056640625,
+            0.2592010498046875,
+            0.1573028564453125,
+            0.0700836181640625,
+            0.5368804931640625,
+            0.0648956298828125,
+            0.3387451171875,
+            0.3949737548828125
+        ],
+
+
+        "10v": [
+            0.125823974609375,
+            -0.0283355712890625,
+            -0.0196990966796875,
+            -0.052398681640625,
+            0.0368499755859375,
+            0.0312347412109375,
+            -0.2501983642578125,
+            0.3714141845703125,
+            -0.00421142578125,
+            0.0700531005859375,
+            0.1710357666015625,
+            0.7651519775390625,
+            1.1278533935546875,
+            0.6367034912109375,
+            1.192657470703125,
+            1.0818634033203125,
+            0.65875244140625,
+            0.52130126953125,
+            0.5759735107421875,
+            0.799652099609375,
+            1.08880615234375,
+            1.110809326171875,
+            1.1493377685546875,
+            1.302490234375,
+            1.1849517822265625,
+            0.856292724609375,
+            0.5441741943359375,
+            0.808441162109375,
+            0.7717742919921875,
+            0.6020355224609375,
+            0.4735107421875,
+            0.433990478515625,
+            0.5348968505859375,
+            0.302001953125,
+            0.4048309326171875,
+            0.3337860107421875,
+            0.2388153076171875,
+            0.199981689453125,
+            0.1395263671875,
+            0.151031494140625,
+            0.0992431640625,
+            -0.04962158203125,
+            -0.13623046875,
+            0.1202545166015625,
+            0.3372802734375,
+            0.374420166015625,
+            0.2035064697265625,
+            0.1859283447265625,
+            0.4132232666015625,
+            0.256256103515625,
+            0.3888092041015625,
+            0.4021453857421875,
+            0.2176361083984375,
+            0.3428192138671875,
+            0.7100372314453125,
+            0.70989990234375,
+            0.7878875732421875,
+            0.6195068359375,
+            0.9668121337890625,
+            1.1561126708984375,
+            1.44989013671875,
+            0.96832275390625,
+            1.3133392333984375,
+            1.1692962646484375,
+            0.9862823486328125
+        ]
+    },
+    "metadata": {
+        "points_along_meridian": 1280,
+        "deterministic_height": -0.162353515625
+    }
+}
diff --git a/utils/input/41.30_10.50_10v.json b/utils/input/41.30_10.50_10v.json
new file mode 100644
index 0000000..6bf4c7b
--- /dev/null
+++ b/utils/input/41.30_10.50_10v.json
@@ -0,0 +1,156 @@
+{
+    "forecast_location": {
+        "latitude": 41.25731752730698,
+        "distance": 6.900076759787546,
+        "longitude": 10.44
+    },
+    "height": 10,
+    "location": {
+        "lat": 41.3,
+        "lon": 10.5
+    },
+    "time": "00",
+    "date": "20160113",
+    "output": "41.30_10.50_10v.json",
+    "station_name": "point2",
+    "10v": {
+        "steps": [
+            "0",
+            "3",
+            "6",
+            "9",
+            "12",
+            "15",
+            "18",
+            "21",
+            "24",
+            "27",
+            "30",
+            "33",
+            "36",
+            "39",
+            "42",
+            "45",
+            "48",
+            "51",
+            "54",
+            "57",
+            "60",
+            "63",
+            "66",
+            "69",
+            "72",
+            "75",
+            "78",
+            "81",
+            "84",
+            "87",
+            "90",
+            "93",
+            "96",
+            "99",
+            "102",
+            "105",
+            "108",
+            "111",
+            "114",
+            "117",
+            "120",
+            "123",
+            "126",
+            "129",
+            "132",
+            "135",
+            "138",
+            "141",
+            "144",
+            "150",
+            "156",
+            "162",
+            "168",
+            "174",
+            "180",
+            "186",
+            "192",
+            "198",
+            "204",
+            "210",
+            "216",
+            "222",
+            "228",
+            "234",
+            "240"
+        ],
+        "forecast": [
+            0.125823974609375,
+            -0.0283355712890625,
+            -0.0196990966796875,
+            -0.052398681640625,
+            0.0368499755859375,
+            0.0312347412109375,
+            -0.2501983642578125,
+            0.3714141845703125,
+            -0.00421142578125,
+            0.0700531005859375,
+            0.1710357666015625,
+            0.7651519775390625,
+            1.1278533935546875,
+            0.6367034912109375,
+            1.192657470703125,
+            1.0818634033203125,
+            0.65875244140625,
+            0.52130126953125,
+            0.5759735107421875,
+            0.799652099609375,
+            1.08880615234375,
+            1.110809326171875,
+            1.1493377685546875,
+            1.302490234375,
+            1.1849517822265625,
+            0.856292724609375,
+            0.5441741943359375,
+            0.808441162109375,
+            0.7717742919921875,
+            0.6020355224609375,
+            0.4735107421875,
+            0.433990478515625,
+            0.5348968505859375,
+            0.302001953125,
+            0.4048309326171875,
+            0.3337860107421875,
+            0.2388153076171875,
+            0.199981689453125,
+            0.1395263671875,
+            0.151031494140625,
+            0.0992431640625,
+            -0.04962158203125,
+            -0.13623046875,
+            0.1202545166015625,
+            0.3372802734375,
+            0.374420166015625,
+            0.2035064697265625,
+            0.1859283447265625,
+            0.4132232666015625,
+            0.256256103515625,
+            0.3888092041015625,
+            0.4021453857421875,
+            0.2176361083984375,
+            0.3428192138671875,
+            0.7100372314453125,
+            0.70989990234375,
+            0.7878875732421875,
+            0.6195068359375,
+            0.9668121337890625,
+            1.1561126708984375,
+            1.44989013671875,
+            0.96832275390625,
+            1.3133392333984375,
+            1.1692962646484375,
+            0.9862823486328125
+        ]
+    },
+    "metadata": {
+        "points_along_meridian": 1280,
+        "deterministic_height": -0.162353515625
+    }
+}
diff --git a/utils/input/41.30_10.50_2t.json b/utils/input/41.30_10.50_2t.json
new file mode 100644
index 0000000..f621c71
--- /dev/null
+++ b/utils/input/41.30_10.50_2t.json
@@ -0,0 +1,156 @@
+{
+    "2t": {
+        "steps": [
+            "0",
+            "3",
+            "6",
+            "9",
+            "12",
+            "15",
+            "18",
+            "21",
+            "24",
+            "27",
+            "30",
+            "33",
+            "36",
+            "39",
+            "42",
+            "45",
+            "48",
+            "51",
+            "54",
+            "57",
+            "60",
+            "63",
+            "66",
+            "69",
+            "72",
+            "75",
+            "78",
+            "81",
+            "84",
+            "87",
+            "90",
+            "93",
+            "96",
+            "99",
+            "102",
+            "105",
+            "108",
+            "111",
+            "114",
+            "117",
+            "120",
+            "123",
+            "126",
+            "129",
+            "132",
+            "135",
+            "138",
+            "141",
+            "144",
+            "150",
+            "156",
+            "162",
+            "168",
+            "174",
+            "180",
+            "186",
+            "192",
+            "198",
+            "204",
+            "210",
+            "216",
+            "222",
+            "228",
+            "234",
+            "240"
+        ],
+        "forecast": [
+            237.68267822265625,
+            238.19137573242188,
+            238.76434326171875,
+            237.43937683105469,
+            237.21401977539062,
+            236.74372863769531,
+            237.5899658203125,
+            236.947998046875,
+            236.59516906738281,
+            239.68904113769531,
+            238.71287536621094,
+            236.98774719238281,
+            236.031494140625,
+            237.46737670898438,
+            234.06340026855469,
+            233.43736267089844,
+            234.80355834960938,
+            237.37956237792969,
+            236.15843200683594,
+            235.60919189453125,
+            235.67730712890625,
+            237.24421691894531,
+            237.9783935546875,
+            238.81573486328125,
+            239.46421813964844,
+            241.73435974121094,
+            241.92900085449219,
+            240.32963562011719,
+            238.26527404785156,
+            237.21418762207031,
+            236.35598754882812,
+            235.9228515625,
+            235.43728637695312,
+            239.6912841796875,
+            240.39265441894531,
+            239.56777954101562,
+            239.98677062988281,
+            240.92010498046875,
+            241.86697387695312,
+            242.59832763671875,
+            244.48228454589844,
+            246.30194091796875,
+            245.49520874023438,
+            243.35879516601562,
+            241.77095031738281,
+            241.54966735839844,
+            241.49935913085938,
+            241.02452087402344,
+            240.39344787597656,
+            243.34043884277344,
+            241.21380615234375,
+            240.90493774414062,
+            240.73905944824219,
+            239.79878234863281,
+            235.546142578125,
+            235.07405090332031,
+            234.05117797851562,
+            235.9140625,
+            233.71638488769531,
+            233.55561828613281,
+            233.69891357421875,
+            236.93333435058594,
+            236.09690856933594,
+            235.18367004394531,
+            233.94316101074219
+        ]
+    },
+    "forecast_location": {
+        "latitude": 41.25731752730698,
+        "distance": 6.900076759787546,
+        "longitude": 10.44
+    },
+    "height": 10,
+    "location": {
+        "lat": 41.3,
+        "lon": 10.5
+    },
+    "time": "00",
+    "date": "20160113",
+    "output": "41.30_10.50_2t.json",
+    "station_name": "point2",
+    "metadata": {
+        "points_along_meridian": 1280,
+        "deterministic_height": -0.162353515625
+    }
+}
diff --git a/utils/input/41.30_10.50_cp.json b/utils/input/41.30_10.50_cp.json
new file mode 100644
index 0000000..66802a6
--- /dev/null
+++ b/utils/input/41.30_10.50_cp.json
@@ -0,0 +1,156 @@
+{
+    "forecast_location": {
+        "latitude": 41.25731752730698,
+        "distance": 6.900076759787546,
+        "longitude": 10.44
+    },
+    "height": 10,
+    "location": {
+        "lat": 41.3,
+        "lon": 10.5
+    },
+    "time": "00",
+    "date": "20160113",
+    "output": "41.30_10.50_cp.json",
+    "station_name": "point2",
+    "cp": {
+        "steps": [
+            "0",
+            "3",
+            "6",
+            "9",
+            "12",
+            "15",
+            "18",
+            "21",
+            "24",
+            "27",
+            "30",
+            "33",
+            "36",
+            "39",
+            "42",
+            "45",
+            "48",
+            "51",
+            "54",
+            "57",
+            "60",
+            "63",
+            "66",
+            "69",
+            "72",
+            "75",
+            "78",
+            "81",
+            "84",
+            "87",
+            "90",
+            "93",
+            "96",
+            "99",
+            "102",
+            "105",
+            "108",
+            "111",
+            "114",
+            "117",
+            "120",
+            "123",
+            "126",
+            "129",
+            "132",
+            "135",
+            "138",
+            "141",
+            "144",
+            "150",
+            "156",
+            "162",
+            "168",
+            "174",
+            "180",
+            "186",
+            "192",
+            "198",
+            "204",
+            "210",
+            "216",
+            "222",
+            "228",
+            "234",
+            "240"
+        ],
+        "forecast": [
+            0.0,
+            1.1444091796875e-05,
+            5.7220458984375e-05,
+            3.814697265625e-06,
+            7.62939453125e-06,
+            2.6702880859375e-05,
+            7.62939453125e-05,
+            7.62939453125e-06,
+            0.0,
+            0.0,
+            7.62939453125e-06,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            7.62939453125e-06,
+            7.62939453125e-06,
+            0.0001373291015625,
+            0.0002593994140625,
+            0.000213623046875,
+            0.000213623046875,
+            0.0001220703125,
+            4.57763671875e-05,
+            3.0517578125e-05,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            1.52587890625e-05,
+            0.0,
+            0.0,
+            1.52587890625e-05,
+            1.52587890625e-05,
+            3.0517578125e-05,
+            6.103515625e-05,
+            7.62939453125e-05,
+            1.52587890625e-05,
+            1.52587890625e-05,
+            0.0,
+            0.0,
+            0.0,
+            1.52587890625e-05,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            1.52587890625e-05,
+            0.0,
+            1.52587890625e-05,
+            3.0517578125e-05,
+            3.0517578125e-05,
+            3.0517578125e-05,
+            6.103515625e-05,
+            3.0517578125e-05
+        ]
+    },
+    "metadata": {
+        "points_along_meridian": 1280,
+        "deterministic_height": -0.162353515625
+    }
+}
diff --git a/utils/input/41.30_10.50_msl.json b/utils/input/41.30_10.50_msl.json
new file mode 100644
index 0000000..c9badaf
--- /dev/null
+++ b/utils/input/41.30_10.50_msl.json
@@ -0,0 +1,156 @@
+{
+    "forecast_location": {
+        "latitude": 41.25731752730698,
+        "distance": 6.900076759787546,
+        "longitude": 10.44
+    },
+    "height": 10,
+    "msl": {
+        "steps": [
+            "0",
+            "3",
+            "6",
+            "9",
+            "12",
+            "15",
+            "18",
+            "21",
+            "24",
+            "27",
+            "30",
+            "33",
+            "36",
+            "39",
+            "42",
+            "45",
+            "48",
+            "51",
+            "54",
+            "57",
+            "60",
+            "63",
+            "66",
+            "69",
+            "72",
+            "75",
+            "78",
+            "81",
+            "84",
+            "87",
+            "90",
+            "93",
+            "96",
+            "99",
+            "102",
+            "105",
+            "108",
+            "111",
+            "114",
+            "117",
+            "120",
+            "123",
+            "126",
+            "129",
+            "132",
+            "135",
+            "138",
+            "141",
+            "144",
+            "150",
+            "156",
+            "162",
+            "168",
+            "174",
+            "180",
+            "186",
+            "192",
+            "198",
+            "204",
+            "210",
+            "216",
+            "222",
+            "228",
+            "234",
+            "240"
+        ],
+        "forecast": [
+            102177.8125,
+            102249.5,
+            102374.625,
+            102456.6875,
+            102608.5625,
+            102614.1875,
+            102661.75,
+            102801.0625,
+            102847.0625,
+            102964.25,
+            103183.5625,
+            103315.875,
+            103545.375,
+            103592.0625,
+            103695.875,
+            103741.0,
+            103766.9375,
+            103734.8125,
+            103651.5625,
+            103585.625,
+            103458.3125,
+            103256.6875,
+            103108.5625,
+            102934.4375,
+            102865.25,
+            102798.875,
+            102757.5,
+            102816.125,
+            102838.625,
+            102846.375,
+            102882.1875,
+            102960.875,
+            103049.0625,
+            103073.625,
+            103103.5625,
+            103169.375,
+            103231.0625,
+            103252.0625,
+            103284.5625,
+            103307.0625,
+            103399.875,
+            103456.25,
+            103525.875,
+            103644.4375,
+            103746.5625,
+            103826.75,
+            103923.875,
+            103908.1875,
+            104007.25,
+            104018.8125,
+            104122.0,
+            103987.5,
+            103950.1875,
+            104088.875,
+            104256.5625,
+            104317.4375,
+            104353.75,
+            104397.6875,
+            104488.75,
+            104474.25,
+            104452.8125,
+            104349.25,
+            104173.5625,
+            103957.6875,
+            103789.5625
+        ]
+    },
+    "location": {
+        "lat": 41.3,
+        "lon": 10.5
+    },
+    "time": "00",
+    "date": "20160113",
+    "output": "41.30_10.50_msl.json",
+    "station_name": "point2",
+    "metadata": {
+        "points_along_meridian": 1280,
+        "deterministic_height": -0.162353515625
+    }
+}
diff --git a/utils/input/41.30_10.50_r.json b/utils/input/41.30_10.50_r.json
new file mode 100644
index 0000000..facd8cf
--- /dev/null
+++ b/utils/input/41.30_10.50_r.json
@@ -0,0 +1,156 @@
+{
+    "forecast_location": {
+        "latitude": 41.25731752730698,
+        "distance": 6.900076759787546,
+        "longitude": 10.44
+    },
+    "height": 10,
+    "r": {
+        "steps": [
+            "0",
+            "3",
+            "6",
+            "9",
+            "12",
+            "15",
+            "18",
+            "21",
+            "24",
+            "27",
+            "30",
+            "33",
+            "36",
+            "39",
+            "42",
+            "45",
+            "48",
+            "51",
+            "54",
+            "57",
+            "60",
+            "63",
+            "66",
+            "69",
+            "72",
+            "75",
+            "78",
+            "81",
+            "84",
+            "87",
+            "90",
+            "93",
+            "96",
+            "99",
+            "102",
+            "105",
+            "108",
+            "111",
+            "114",
+            "117",
+            "120",
+            "123",
+            "126",
+            "129",
+            "132",
+            "135",
+            "138",
+            "141",
+            "144",
+            "150",
+            "156",
+            "162",
+            "168",
+            "174",
+            "180",
+            "186",
+            "192",
+            "198",
+            "204",
+            "210",
+            "216",
+            "222",
+            "228",
+            "234",
+            "240"
+        ],
+        "forecast": [
+            74.820910453796387,
+            82.165701866149902,
+            86.360210418701172,
+            80.719925880432129,
+            80.606836318969727,
+            86.761063575744629,
+            81.891765594482422,
+            74.334155082702637,
+            59.696466445922852,
+            45.676423072814941,
+            38.581279754638672,
+            37.144233703613281,
+            35.139017105102539,
+            34.468579292297363,
+            47.286173820495605,
+            51.308355331420898,
+            37.389011383056641,
+            47.671236991882324,
+            51.852482795715332,
+            51.453635215759277,
+            61.616774559020996,
+            82.614348411560059,
+            93.823399543762207,
+            95.339861869812012,
+            95.361287117004395,
+            101.81180000305176,
+            100.05736351013184,
+            95.01722526550293,
+            89.225061416625977,
+            80.016554832458496,
+            75.325366020202637,
+            78.746536254882812,
+            79.828167915344238,
+            79.673000335693359,
+            81.680631637573242,
+            85.887895584106445,
+            90.476388931274414,
+            93.284921646118164,
+            96.474883079528809,
+            98.305143356323242,
+            100.91341876983643,
+            100.25549793243408,
+            98.010522842407227,
+            95.865986824035645,
+            94.254598617553711,
+            92.376155853271484,
+            96.387191772460938,
+            93.535273551940918,
+            88.973620414733887,
+            75.570710182189941,
+            52.098025321960449,
+            34.083334922790527,
+            24.869568824768066,
+            18.12131404876709,
+            21.711441993713379,
+            38.100796699523926,
+            41.021544456481934,
+            45.30150032043457,
+            50.268073081970215,
+            59.412969589233398,
+            67.466923713684082,
+            67.91804027557373,
+            88.512664794921875,
+            96.347413063049316,
+            92.478290557861328
+        ]
+    },
+    "location": {
+        "lat": 41.3,
+        "lon": 10.5
+    },
+    "time": "00",
+    "date": "20160113",
+    "output": "41.30_10.50_r.json",
+    "station_name": "point2",
+    "metadata": {
+        "points_along_meridian": 1280,
+        "deterministic_height": -0.162353515625
+    }
+}
diff --git a/utils/input/41.30_10.50_t.json b/utils/input/41.30_10.50_t.json
new file mode 100644
index 0000000..2bb6fe1
--- /dev/null
+++ b/utils/input/41.30_10.50_t.json
@@ -0,0 +1,156 @@
+{
+    "forecast_location": {
+        "latitude": 41.25731752730698,
+        "distance": 6.900076759787546,
+        "longitude": 10.44
+    },
+    "time": "00",
+    "height": 10,
+    "location": {
+        "lat": 41.3,
+        "lon": 10.5
+    },
+    "t": {
+        "steps": [
+            "0",
+            "3",
+            "6",
+            "9",
+            "12",
+            "15",
+            "18",
+            "21",
+            "24",
+            "27",
+            "30",
+            "33",
+            "36",
+            "39",
+            "42",
+            "45",
+            "48",
+            "51",
+            "54",
+            "57",
+            "60",
+            "63",
+            "66",
+            "69",
+            "72",
+            "75",
+            "78",
+            "81",
+            "84",
+            "87",
+            "90",
+            "93",
+            "96",
+            "99",
+            "102",
+            "105",
+            "108",
+            "111",
+            "114",
+            "117",
+            "120",
+            "123",
+            "126",
+            "129",
+            "132",
+            "135",
+            "138",
+            "141",
+            "144",
+            "150",
+            "156",
+            "162",
+            "168",
+            "174",
+            "180",
+            "186",
+            "192",
+            "198",
+            "204",
+            "210",
+            "216",
+            "222",
+            "228",
+            "234",
+            "240"
+        ],
+        "forecast": [
+            251.04470825195312,
+            251.86993408203125,
+            252.00492858886719,
+            251.78024291992188,
+            252.24755859375,
+            252.76583862304688,
+            254.14599609375,
+            254.87710571289062,
+            255.50410461425781,
+            255.52828979492188,
+            255.78929138183594,
+            255.73924255371094,
+            255.43524169921875,
+            255.55685424804688,
+            255.45576477050781,
+            255.55398559570312,
+            255.72198486328125,
+            255.46746826171875,
+            254.65008544921875,
+            254.50749206542969,
+            253.46942138671875,
+            251.43403625488281,
+            249.90431213378906,
+            248.80636596679688,
+            249.11924743652344,
+            249.43246459960938,
+            249.06684875488281,
+            248.78169250488281,
+            248.77041625976562,
+            248.25601196289062,
+            247.54324340820312,
+            247.00726318359375,
+            246.89073181152344,
+            247.04039001464844,
+            247.50405883789062,
+            247.99824523925781,
+            248.34211730957031,
+            248.77845764160156,
+            249.33538818359375,
+            250.15985107421875,
+            250.69728088378906,
+            250.95294189453125,
+            251.12324523925781,
+            251.51231384277344,
+            251.94697570800781,
+            252.40316772460938,
+            252.6781005859375,
+            253.06692504882812,
+            253.27223205566406,
+            253.89266967773438,
+            255.25028991699219,
+            256.90939331054688,
+            258.67735290527344,
+            259.32391357421875,
+            258.72932434082031,
+            257.258056640625,
+            256.35841369628906,
+            255.32354736328125,
+            254.59709167480469,
+            253.48078918457031,
+            251.99021911621094,
+            250.25819396972656,
+            247.81526184082031,
+            246.00517272949219,
+            246.11082458496094
+        ]
+    },
+    "date": "20160113",
+    "output": "41.30_10.50_t.json",
+    "station_name": "point2",
+    "metadata": {
+        "points_along_meridian": 1280,
+        "deterministic_height": -0.162353515625
+    }
+}
diff --git a/utils/input/41.30_10.50_tcc.json b/utils/input/41.30_10.50_tcc.json
new file mode 100644
index 0000000..d2ae655
--- /dev/null
+++ b/utils/input/41.30_10.50_tcc.json
@@ -0,0 +1,156 @@
+{
+    "forecast_location": {
+        "latitude": 41.25731752730698,
+        "distance": 6.900076759787546,
+        "longitude": 10.44
+    },
+    "height": 10,
+    "location": {
+        "lat": 41.3,
+        "lon": 10.5
+    },
+    "time": "00",
+    "date": "20160113",
+    "output": "41.30_10.50_tcc.json",
+    "station_name": "point2",
+    "tcc": {
+        "steps": [
+            "0",
+            "3",
+            "6",
+            "9",
+            "12",
+            "15",
+            "18",
+            "21",
+            "24",
+            "27",
+            "30",
+            "33",
+            "36",
+            "39",
+            "42",
+            "45",
+            "48",
+            "51",
+            "54",
+            "57",
+            "60",
+            "63",
+            "66",
+            "69",
+            "72",
+            "75",
+            "78",
+            "81",
+            "84",
+            "87",
+            "90",
+            "93",
+            "96",
+            "99",
+            "102",
+            "105",
+            "108",
+            "111",
+            "114",
+            "117",
+            "120",
+            "123",
+            "126",
+            "129",
+            "132",
+            "135",
+            "138",
+            "141",
+            "144",
+            "150",
+            "156",
+            "162",
+            "168",
+            "174",
+            "180",
+            "186",
+            "192",
+            "198",
+            "204",
+            "210",
+            "216",
+            "222",
+            "228",
+            "234",
+            "240"
+        ],
+        "forecast": [
+            0.9844970703125,
+            1.0,
+            0.962646484375,
+            0.450469970703125,
+            0.66058349609375,
+            1.0,
+            0.637298583984375,
+            0.703277587890625,
+            0.817413330078125,
+            0.27191162109375,
+            0.423828125,
+            0.347381591796875,
+            0.060455322265625,
+            0.076141357421875,
+            0.672698974609375,
+            0.959991455078125,
+            0.987884521484375,
+            0.953338623046875,
+            0.998992919921875,
+            1.0,
+            0.994781494140625,
+            1.0,
+            1.0,
+            1.0,
+            1.0,
+            0.998870849609375,
+            0.97576904296875,
+            0.713653564453125,
+            0.105377197265625,
+            0.06317138671875,
+            0.631195068359375,
+            0.831787109375,
+            0.922332763671875,
+            0.91876220703125,
+            0.707000732421875,
+            0.859527587890625,
+            0.887542724609375,
+            0.9559326171875,
+            0.99676513671875,
+            0.992095947265625,
+            0.99676513671875,
+            0.99676513671875,
+            0.576202392578125,
+            0.310211181640625,
+            0.57757568359375,
+            0.884002685546875,
+            0.77740478515625,
+            0.97113037109375,
+            0.158538818359375,
+            0.0,
+            0.01568603515625,
+            0.356719970703125,
+            0.80047607421875,
+            0.3516845703125,
+            0.3525390625,
+            0.409149169921875,
+            0.42022705078125,
+            0.72412109375,
+            0.671875,
+            0.47271728515625,
+            0.936737060546875,
+            0.988677978515625,
+            0.997772216796875,
+            0.988677978515625,
+            1.0
+        ]
+    },
+    "metadata": {
+        "points_along_meridian": 1280,
+        "deterministic_height": -0.162353515625
+    }
+}
diff --git a/utils/input/43.30_-8.50_10u.json b/utils/input/43.30_-8.50_10u.json
new file mode 100644
index 0000000..628a4a1
--- /dev/null
+++ b/utils/input/43.30_-8.50_10u.json
@@ -0,0 +1,156 @@
+{
+    "forecast_location": {
+        "latitude": 43.225298510798666,
+        "distance": 9.721345784605642,
+        "longitude": 351.5625
+    },
+    "height": 50,
+    "location": {
+        "lat": 43.3,
+        "lon": -8.5
+    },
+    "time": "00",
+    "date": "20160113",
+    "output": "43.30_-8.50_10u.json",
+    "station_name": "point1",
+    "10u": {
+        "steps": [
+            "0",
+            "3",
+            "6",
+            "9",
+            "12",
+            "15",
+            "18",
+            "21",
+            "24",
+            "27",
+            "30",
+            "33",
+            "36",
+            "39",
+            "42",
+            "45",
+            "48",
+            "51",
+            "54",
+            "57",
+            "60",
+            "63",
+            "66",
+            "69",
+            "72",
+            "75",
+            "78",
+            "81",
+            "84",
+            "87",
+            "90",
+            "93",
+            "96",
+            "99",
+            "102",
+            "105",
+            "108",
+            "111",
+            "114",
+            "117",
+            "120",
+            "123",
+            "126",
+            "129",
+            "132",
+            "135",
+            "138",
+            "141",
+            "144",
+            "150",
+            "156",
+            "162",
+            "168",
+            "174",
+            "180",
+            "186",
+            "192",
+            "198",
+            "204",
+            "210",
+            "216",
+            "222",
+            "228",
+            "234",
+            "240"
+        ],
+        "forecast": [
+            -2.4900054931640625,
+            -1.552032470703125,
+            -1.9600067138671875,
+            -1.574920654296875,
+            -1.4694976806640625,
+            -1.2356109619140625,
+            -1.353851318359375,
+            -1.4955291748046875,
+            -1.15142822265625,
+            -0.8118896484375,
+            -1.0862884521484375,
+            -1.3907928466796875,
+            -1.2161407470703125,
+            -1.044677734375,
+            -0.8981475830078125,
+            -0.74737548828125,
+            -0.700347900390625,
+            -0.4553985595703125,
+            -0.8477325439453125,
+            -1.110748291015625,
+            -1.2806854248046875,
+            -1.1365203857421875,
+            -1.3390350341796875,
+            -1.3987884521484375,
+            -1.6355743408203125,
+            -1.122833251953125,
+            -1.5821990966796875,
+            -1.2309722900390625,
+            -1.2410125732421875,
+            -1.3274688720703125,
+            -1.2139129638671875,
+            -1.111419677734375,
+            -1.1972503662109375,
+            -0.99945068359375,
+            -0.45989990234375,
+            -1.1973876953125,
+            -1.2464141845703125,
+            -1.25335693359375,
+            -1.07086181640625,
+            -0.881378173828125,
+            -0.831268310546875,
+            -0.9367523193359375,
+            -1.0134735107421875,
+            -0.6552734375,
+            -0.7855224609375,
+            -0.6668701171875,
+            -0.5043792724609375,
+            -0.799407958984375,
+            -1.078521728515625,
+            -1.2801513671875,
+            -1.6702117919921875,
+            -1.506378173828125,
+            -1.0843658447265625,
+            -0.8958740234375,
+            -1.09857177734375,
+            -1.0862274169921875,
+            -1.087554931640625,
+            -0.6867523193359375,
+            -1.3677520751953125,
+            -1.0292205810546875,
+            -0.9767913818359375,
+            -1.1164398193359375,
+            -1.3657684326171875,
+            -1.3409423828125,
+            -1.3726043701171875
+        ]
+    },
+    "metadata": {
+        "points_along_meridian": 1280,
+        "deterministic_height": 225.627197265625
+    }
+}
diff --git a/utils/input/43.30_-8.50_10v.json b/utils/input/43.30_-8.50_10v.json
new file mode 100644
index 0000000..6657808
--- /dev/null
+++ b/utils/input/43.30_-8.50_10v.json
@@ -0,0 +1,156 @@
+{
+    "forecast_location": {
+        "latitude": 43.225298510798666,
+        "distance": 9.721345784605642,
+        "longitude": 351.5625
+    },
+    "height": 50,
+    "location": {
+        "lat": 43.3,
+        "lon": -8.5
+    },
+    "time": "00",
+    "date": "20160113",
+    "output": "43.30_-8.50_10v.json",
+    "station_name": "point1",
+    "10v": {
+        "steps": [
+            "0",
+            "3",
+            "6",
+            "9",
+            "12",
+            "15",
+            "18",
+            "21",
+            "24",
+            "27",
+            "30",
+            "33",
+            "36",
+            "39",
+            "42",
+            "45",
+            "48",
+            "51",
+            "54",
+            "57",
+            "60",
+            "63",
+            "66",
+            "69",
+            "72",
+            "75",
+            "78",
+            "81",
+            "84",
+            "87",
+            "90",
+            "93",
+            "96",
+            "99",
+            "102",
+            "105",
+            "108",
+            "111",
+            "114",
+            "117",
+            "120",
+            "123",
+            "126",
+            "129",
+            "132",
+            "135",
+            "138",
+            "141",
+            "144",
+            "150",
+            "156",
+            "162",
+            "168",
+            "174",
+            "180",
+            "186",
+            "192",
+            "198",
+            "204",
+            "210",
+            "216",
+            "222",
+            "228",
+            "234",
+            "240"
+        ],
+        "forecast": [
+            -1.883941650390625,
+            -1.6757965087890625,
+            -1.9054412841796875,
+            -2.114898681640625,
+            -2.0852203369140625,
+            -1.7177886962890625,
+            -1.3703155517578125,
+            -1.5026092529296875,
+            -1.16729736328125,
+            -1.3606109619140625,
+            -2.4598236083984375,
+            -1.6274261474609375,
+            -1.4278106689453125,
+            -1.5000152587890625,
+            -1.776092529296875,
+            -1.6290740966796875,
+            -1.75628662109375,
+            -1.66717529296875,
+            -1.6095733642578125,
+            -1.308746337890625,
+            -0.83697509765625,
+            -0.836456298828125,
+            -1.0420684814453125,
+            -1.109619140625,
+            -1.2925872802734375,
+            -0.991363525390625,
+            -1.5271148681640625,
+            -0.844879150390625,
+            -0.7711944580078125,
+            -1.0454254150390625,
+            -1.0216064453125,
+            -1.044525146484375,
+            -1.2395172119140625,
+            -1.822998046875,
+            -1.3734893798828125,
+            -1.1164093017578125,
+            -0.9301300048828125,
+            -1.163299560546875,
+            -1.1153564453125,
+            -0.970062255859375,
+            -0.7415771484375,
+            -0.69317626953125,
+            -0.76318359375,
+            -0.4754486083984375,
+            -0.4820556640625,
+            -0.413665771484375,
+            -0.3462982177734375,
+            -0.5357513427734375,
+            -0.7332611083984375,
+            -1.544525146484375,
+            -1.6551361083984375,
+            -1.4709014892578125,
+            -0.9786529541015625,
+            -1.6708526611328125,
+            -1.9305877685546875,
+            -1.74322509765625,
+            -1.8429718017578125,
+            -2.0826416015625,
+            -1.2724456787109375,
+            -0.8663482666015625,
+            -0.75421142578125,
+            -1.15863037109375,
+            -1.7413482666015625,
+            -1.9996490478515625,
+            -1.8672332763671875
+        ]
+    },
+    "metadata": {
+        "points_along_meridian": 1280,
+        "deterministic_height": 225.627197265625
+    }
+}
diff --git a/utils/input/43.30_-8.50_2t.json b/utils/input/43.30_-8.50_2t.json
new file mode 100644
index 0000000..1f365b4
--- /dev/null
+++ b/utils/input/43.30_-8.50_2t.json
@@ -0,0 +1,156 @@
+{
+    "2t": {
+        "steps": [
+            "0",
+            "3",
+            "6",
+            "9",
+            "12",
+            "15",
+            "18",
+            "21",
+            "24",
+            "27",
+            "30",
+            "33",
+            "36",
+            "39",
+            "42",
+            "45",
+            "48",
+            "51",
+            "54",
+            "57",
+            "60",
+            "63",
+            "66",
+            "69",
+            "72",
+            "75",
+            "78",
+            "81",
+            "84",
+            "87",
+            "90",
+            "93",
+            "96",
+            "99",
+            "102",
+            "105",
+            "108",
+            "111",
+            "114",
+            "117",
+            "120",
+            "123",
+            "126",
+            "129",
+            "132",
+            "135",
+            "138",
+            "141",
+            "144",
+            "150",
+            "156",
+            "162",
+            "168",
+            "174",
+            "180",
+            "186",
+            "192",
+            "198",
+            "204",
+            "210",
+            "216",
+            "222",
+            "228",
+            "234",
+            "240"
+        ],
+        "forecast": [
+            247.16510009765625,
+            250.66403198242188,
+            251.54559326171875,
+            250.51750183105469,
+            250.20425415039062,
+            247.92341613769531,
+            245.6485595703125,
+            245.508544921875,
+            246.18891906738281,
+            250.85700988769531,
+            247.17381286621094,
+            245.36079406738281,
+            245.023681640625,
+            246.70565795898438,
+            249.61613464355469,
+            250.43150329589844,
+            252.16098022460938,
+            254.95182800292969,
+            252.99436950683594,
+            252.11114501953125,
+            250.68902587890625,
+            250.04304504394531,
+            250.0272216796875,
+            248.75714111328125,
+            246.30601501464844,
+            249.50584411621094,
+            245.34696960449219,
+            242.66557312011719,
+            241.46449279785156,
+            243.40950012207031,
+            244.28176879882812,
+            245.0283203125,
+            245.59548950195312,
+            249.4178466796875,
+            249.28132629394531,
+            245.68301391601562,
+            245.35200500488281,
+            247.59979248046875,
+            249.22439575195312,
+            251.25262451171875,
+            251.51158142089844,
+            253.82928466796875,
+            252.29013061523438,
+            250.34902954101562,
+            247.90962219238281,
+            246.04380798339844,
+            245.87435913085938,
+            245.47373962402344,
+            244.21571350097656,
+            247.39122009277344,
+            243.25091552734375,
+            243.17251586914062,
+            243.94999694824219,
+            248.94331359863281,
+            247.313720703125,
+            246.75569152832031,
+            246.79141235351562,
+            248.67578125,
+            245.07966613769531,
+            243.62593078613281,
+            243.27508544921875,
+            246.04075622558594,
+            240.92698669433594,
+            239.12117004394531,
+            238.76347351074219
+        ]
+    },
+    "forecast_location": {
+        "latitude": 43.225298510798666,
+        "distance": 9.721345784605642,
+        "longitude": 351.5625
+    },
+    "height": 50,
+    "location": {
+        "lat": 43.3,
+        "lon": -8.5
+    },
+    "time": "00",
+    "date": "20160113",
+    "output": "43.30_-8.50_2t.json",
+    "station_name": "point1",
+    "metadata": {
+        "points_along_meridian": 1280,
+        "deterministic_height": 225.627197265625
+    }
+}
diff --git a/utils/input/43.30_-8.50_cp.json b/utils/input/43.30_-8.50_cp.json
new file mode 100644
index 0000000..9774c6c
--- /dev/null
+++ b/utils/input/43.30_-8.50_cp.json
@@ -0,0 +1,156 @@
+{
+    "forecast_location": {
+        "latitude": 43.225298510798666,
+        "distance": 9.721345784605642,
+        "longitude": 351.5625
+    },
+    "height": 50,
+    "location": {
+        "lat": 43.3,
+        "lon": -8.5
+    },
+    "time": "00",
+    "date": "20160113",
+    "output": "43.30_-8.50_cp.json",
+    "station_name": "point1",
+    "cp": {
+        "steps": [
+            "0",
+            "3",
+            "6",
+            "9",
+            "12",
+            "15",
+            "18",
+            "21",
+            "24",
+            "27",
+            "30",
+            "33",
+            "36",
+            "39",
+            "42",
+            "45",
+            "48",
+            "51",
+            "54",
+            "57",
+            "60",
+            "63",
+            "66",
+            "69",
+            "72",
+            "75",
+            "78",
+            "81",
+            "84",
+            "87",
+            "90",
+            "93",
+            "96",
+            "99",
+            "102",
+            "105",
+            "108",
+            "111",
+            "114",
+            "117",
+            "120",
+            "123",
+            "126",
+            "129",
+            "132",
+            "135",
+            "138",
+            "141",
+            "144",
+            "150",
+            "156",
+            "162",
+            "168",
+            "174",
+            "180",
+            "186",
+            "192",
+            "198",
+            "204",
+            "210",
+            "216",
+            "222",
+            "228",
+            "234",
+            "240"
+        ],
+        "forecast": [
+            0.0,
+            1.9073486328125e-06,
+            5.7220458984375e-06,
+            1.1444091796875e-05,
+            -3.814697265625e-06,
+            0.0,
+            0.0,
+            0.0,
+            7.62939453125e-06,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            3.0517578125e-05,
+            4.57763671875e-05,
+            2.288818359375e-05,
+            1.52587890625e-05,
+            1.52587890625e-05,
+            3.0517578125e-05,
+            3.0517578125e-05,
+            6.103515625e-05,
+            7.62939453125e-05,
+            6.103515625e-05,
+            6.103515625e-05,
+            0.0,
+            1.52587890625e-05,
+            0.0,
+            6.103515625e-05,
+            4.57763671875e-05,
+            3.0517578125e-05,
+            3.0517578125e-05,
+            4.57763671875e-05,
+            9.1552734375e-05,
+            4.57763671875e-05,
+            0.0,
+            6.103515625e-05,
+            9.1552734375e-05,
+            0.00018310546875,
+            0.0001373291015625,
+            7.62939453125e-05,
+            6.103515625e-05,
+            3.0517578125e-05,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            1.52587890625e-05,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0
+        ]
+    },
+    "metadata": {
+        "points_along_meridian": 1280,
+        "deterministic_height": 225.627197265625
+    }
+}
diff --git a/utils/input/43.30_-8.50_msl.json b/utils/input/43.30_-8.50_msl.json
new file mode 100644
index 0000000..cb07e2f
--- /dev/null
+++ b/utils/input/43.30_-8.50_msl.json
@@ -0,0 +1,156 @@
+{
+    "forecast_location": {
+        "latitude": 43.225298510798666,
+        "distance": 9.721345784605642,
+        "longitude": 351.5625
+    },
+    "height": 50,
+    "msl": {
+        "steps": [
+            "0",
+            "3",
+            "6",
+            "9",
+            "12",
+            "15",
+            "18",
+            "21",
+            "24",
+            "27",
+            "30",
+            "33",
+            "36",
+            "39",
+            "42",
+            "45",
+            "48",
+            "51",
+            "54",
+            "57",
+            "60",
+            "63",
+            "66",
+            "69",
+            "72",
+            "75",
+            "78",
+            "81",
+            "84",
+            "87",
+            "90",
+            "93",
+            "96",
+            "99",
+            "102",
+            "105",
+            "108",
+            "111",
+            "114",
+            "117",
+            "120",
+            "123",
+            "126",
+            "129",
+            "132",
+            "135",
+            "138",
+            "141",
+            "144",
+            "150",
+            "156",
+            "162",
+            "168",
+            "174",
+            "180",
+            "186",
+            "192",
+            "198",
+            "204",
+            "210",
+            "216",
+            "222",
+            "228",
+            "234",
+            "240"
+        ],
+        "forecast": [
+            101359.5625,
+            101531.25,
+            101771.375,
+            101918.9375,
+            102128.8125,
+            102233.6875,
+            102425.25,
+            102479.8125,
+            102576.8125,
+            102651.5,
+            102779.3125,
+            102898.125,
+            102975.375,
+            102998.8125,
+            102962.875,
+            102855.0,
+            102709.1875,
+            102489.0625,
+            102259.5625,
+            102129.375,
+            102041.8125,
+            101962.6875,
+            102023.5625,
+            102053.4375,
+            102180.5,
+            102261.625,
+            102325.25,
+            102459.875,
+            102568.625,
+            102650.875,
+            102716.1875,
+            102808.875,
+            102911.5625,
+            102922.625,
+            102912.8125,
+            102968.875,
+            102997.8125,
+            102998.0625,
+            102992.0625,
+            103027.5625,
+            103078.875,
+            103131.5,
+            103194.125,
+            103290.9375,
+            103370.3125,
+            103469.75,
+            103591.125,
+            103675.6875,
+            103715.0,
+            103829.3125,
+            103919.5,
+            103848.25,
+            103803.9375,
+            103651.375,
+            103629.5625,
+            103592.9375,
+            103571.25,
+            103481.6875,
+            103508.25,
+            103411.5,
+            103236.8125,
+            102986.25,
+            102866.8125,
+            102695.9375,
+            102559.0625
+        ]
+    },
+    "location": {
+        "lat": 43.3,
+        "lon": -8.5
+    },
+    "time": "00",
+    "date": "20160113",
+    "output": "43.30_-8.50_msl.json",
+    "station_name": "point1",
+    "metadata": {
+        "points_along_meridian": 1280,
+        "deterministic_height": 225.627197265625
+    }
+}
diff --git a/utils/input/43.30_-8.50_r.json b/utils/input/43.30_-8.50_r.json
new file mode 100644
index 0000000..ee462a1
--- /dev/null
+++ b/utils/input/43.30_-8.50_r.json
@@ -0,0 +1,156 @@
+{
+    "forecast_location": {
+        "latitude": 43.225298510798666,
+        "distance": 9.721345784605642,
+        "longitude": 351.5625
+    },
+    "height": 50,
+    "r": {
+        "steps": [
+            "0",
+            "3",
+            "6",
+            "9",
+            "12",
+            "15",
+            "18",
+            "21",
+            "24",
+            "27",
+            "30",
+            "33",
+            "36",
+            "39",
+            "42",
+            "45",
+            "48",
+            "51",
+            "54",
+            "57",
+            "60",
+            "63",
+            "66",
+            "69",
+            "72",
+            "75",
+            "78",
+            "81",
+            "84",
+            "87",
+            "90",
+            "93",
+            "96",
+            "99",
+            "102",
+            "105",
+            "108",
+            "111",
+            "114",
+            "117",
+            "120",
+            "123",
+            "126",
+            "129",
+            "132",
+            "135",
+            "138",
+            "141",
+            "144",
+            "150",
+            "156",
+            "162",
+            "168",
+            "174",
+            "180",
+            "186",
+            "192",
+            "198",
+            "204",
+            "210",
+            "216",
+            "222",
+            "228",
+            "234",
+            "240"
+        ],
+        "forecast": [
+            65.434191703796387,
+            63.458670616149902,
+            58.496929168701172,
+            52.887894630432129,
+            40.673242568969727,
+            39.495438575744629,
+            43.317546844482422,
+            57.506030082702637,
+            62.973810195922852,
+            63.555329322814941,
+            63.569561004638672,
+            61.183296203613281,
+            51.412454605102539,
+            50.320141792297363,
+            53.590861320495605,
+            54.991949081420898,
+            53.103855133056641,
+            48.354830741882324,
+            47.985295295715332,
+            52.750510215759277,
+            59.898024559020996,
+            65.688567161560059,
+            65.073399543762207,
+            65.308611869812012,
+            72.169880867004395,
+            73.331331253051758,
+            70.600332260131836,
+            70.25941276550293,
+            70.018030166625977,
+            70.532179832458496,
+            71.141772270202637,
+            72.055130004882812,
+            73.261761665344238,
+            75.340969085693359,
+            75.668912887573242,
+            70.008989334106445,
+            66.527170181274414,
+            74.863046646118164,
+            76.431914329528809,
+            77.434049606323242,
+            69.343106269836426,
+            61.067997932434082,
+            57.604272842407227,
+            53.740986824035645,
+            49.832723617553711,
+            48.657405853271484,
+            50.328598022460938,
+            52.226679801940918,
+            51.403307914733887,
+            49.629303932189941,
+            45.734744071960449,
+            41.798178672790527,
+            42.381287574768066,
+            51.50412654876709,
+            57.777848243713379,
+            62.768765449523926,
+            63.287169456481934,
+            62.86400032043457,
+            61.787604331970215,
+            62.819219589233398,
+            62.763798713684082,
+            66.28132152557373,
+            71.965789794921875,
+            72.691163063049316,
+            74.013446807861328
+        ]
+    },
+    "location": {
+        "lat": 43.3,
+        "lon": -8.5
+    },
+    "time": "00",
+    "date": "20160113",
+    "output": "43.30_-8.50_r.json",
+    "station_name": "point1",
+    "metadata": {
+        "points_along_meridian": 1280,
+        "deterministic_height": 225.627197265625
+    }
+}
diff --git a/utils/input/43.30_-8.50_t.json b/utils/input/43.30_-8.50_t.json
new file mode 100644
index 0000000..8754da1
--- /dev/null
+++ b/utils/input/43.30_-8.50_t.json
@@ -0,0 +1,156 @@
+{
+    "forecast_location": {
+        "latitude": 43.225298510798666,
+        "distance": 9.721345784605642,
+        "longitude": 351.5625
+    },
+    "time": "00",
+    "height": 50,
+    "location": {
+        "lat": 43.3,
+        "lon": -8.5
+    },
+    "t": {
+        "steps": [
+            "0",
+            "3",
+            "6",
+            "9",
+            "12",
+            "15",
+            "18",
+            "21",
+            "24",
+            "27",
+            "30",
+            "33",
+            "36",
+            "39",
+            "42",
+            "45",
+            "48",
+            "51",
+            "54",
+            "57",
+            "60",
+            "63",
+            "66",
+            "69",
+            "72",
+            "75",
+            "78",
+            "81",
+            "84",
+            "87",
+            "90",
+            "93",
+            "96",
+            "99",
+            "102",
+            "105",
+            "108",
+            "111",
+            "114",
+            "117",
+            "120",
+            "123",
+            "126",
+            "129",
+            "132",
+            "135",
+            "138",
+            "141",
+            "144",
+            "150",
+            "156",
+            "162",
+            "168",
+            "174",
+            "180",
+            "186",
+            "192",
+            "198",
+            "204",
+            "210",
+            "216",
+            "222",
+            "228",
+            "234",
+            "240"
+        ],
+        "forecast": [
+            253.53787231445312,
+            252.69219970703125,
+            253.64750671386719,
+            254.42379760742188,
+            255.02294921875,
+            254.84591674804688,
+            254.69873046875,
+            254.53335571289062,
+            254.54512023925781,
+            254.16500854492188,
+            253.86155700683594,
+            253.89549255371094,
+            254.55047607421875,
+            254.69943237304688,
+            254.47529602050781,
+            254.72000122070312,
+            255.60577392578125,
+            256.49969482421875,
+            256.58856201171875,
+            255.98600769042969,
+            255.24481201171875,
+            253.93598937988281,
+            252.63673400878906,
+            251.74191284179688,
+            250.45323181152344,
+            249.46566772460938,
+            248.66841125488281,
+            248.09126281738281,
+            247.91494750976562,
+            248.14077758789062,
+            248.57644653320312,
+            248.84906005859375,
+            249.43565368652344,
+            251.13706970214844,
+            252.44644165039062,
+            253.04902648925781,
+            253.69563293457031,
+            254.24525451660156,
+            254.82562255859375,
+            255.07000732421875,
+            255.19044494628906,
+            255.14532470703125,
+            255.05879211425781,
+            255.33946228027344,
+            255.52705383300781,
+            255.48129272460938,
+            255.1956787109375,
+            254.83255004882812,
+            254.89918518066406,
+            254.97763061523438,
+            255.57841491699219,
+            255.85470581054688,
+            255.49180603027344,
+            255.07684326171875,
+            253.56721496582031,
+            252.527587890625,
+            252.37208557128906,
+            252.63214111328125,
+            253.04826354980469,
+            253.17024230957031,
+            253.30857849121094,
+            252.97694396972656,
+            252.26057434082031,
+            251.86454772949219,
+            251.53465270996094
+        ]
+    },
+    "date": "20160113",
+    "output": "43.30_-8.50_t.json",
+    "station_name": "point1",
+    "metadata": {
+        "points_along_meridian": 1280,
+        "deterministic_height": 225.627197265625
+    }
+}
diff --git a/utils/input/43.30_-8.50_tcc.json b/utils/input/43.30_-8.50_tcc.json
new file mode 100644
index 0000000..3c9d2ac
--- /dev/null
+++ b/utils/input/43.30_-8.50_tcc.json
@@ -0,0 +1,156 @@
+{
+    "forecast_location": {
+        "latitude": 43.225298510798666,
+        "distance": 9.721345784605642,
+        "longitude": 351.5625
+    },
+    "height": 50,
+    "location": {
+        "lat": 43.3,
+        "lon": -8.5
+    },
+    "time": "00",
+    "date": "20160113",
+    "output": "43.30_-8.50_tcc.json",
+    "station_name": "point1",
+    "tcc": {
+        "steps": [
+            "0",
+            "3",
+            "6",
+            "9",
+            "12",
+            "15",
+            "18",
+            "21",
+            "24",
+            "27",
+            "30",
+            "33",
+            "36",
+            "39",
+            "42",
+            "45",
+            "48",
+            "51",
+            "54",
+            "57",
+            "60",
+            "63",
+            "66",
+            "69",
+            "72",
+            "75",
+            "78",
+            "81",
+            "84",
+            "87",
+            "90",
+            "93",
+            "96",
+            "99",
+            "102",
+            "105",
+            "108",
+            "111",
+            "114",
+            "117",
+            "120",
+            "123",
+            "126",
+            "129",
+            "132",
+            "135",
+            "138",
+            "141",
+            "144",
+            "150",
+            "156",
+            "162",
+            "168",
+            "174",
+            "180",
+            "186",
+            "192",
+            "198",
+            "204",
+            "210",
+            "216",
+            "222",
+            "228",
+            "234",
+            "240"
+        ],
+        "forecast": [
+            0.074981689453125,
+            0.458099365234375,
+            0.227935791015625,
+            0.40863037109375,
+            0.1627197265625,
+            0.000213623046875,
+            0.0,
+            0.49481201171875,
+            0.372833251953125,
+            0.323394775390625,
+            0.0,
+            0.282623291015625,
+            0.978363037109375,
+            0.922271728515625,
+            0.994537353515625,
+            0.9921875,
+            1.0,
+            1.0,
+            0.998565673828125,
+            1.0,
+            0.9898681640625,
+            1.0,
+            0.967254638671875,
+            0.923675537109375,
+            0.897918701171875,
+            0.85577392578125,
+            0.697601318359375,
+            0.89093017578125,
+            0.976806640625,
+            0.93536376953125,
+            0.959991455078125,
+            0.96185302734375,
+            0.989990234375,
+            1.0,
+            1.0,
+            0.907257080078125,
+            0.970001220703125,
+            0.971435546875,
+            1.0,
+            0.99273681640625,
+            0.989990234375,
+            1.0,
+            0.991302490234375,
+            0.9471435546875,
+            0.77838134765625,
+            0.697479248046875,
+            0.51495361328125,
+            0.48638916015625,
+            0.002166748046875,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.102813720703125,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.0,
+            0.012908935546875
+        ]
+    },
+    "metadata": {
+        "points_along_meridian": 1280,
+        "deterministic_height": 225.627197265625
+    }
+}
diff --git a/utils/input/GRA04190000042900001 b/utils/input/GRA04190000042900001
new file mode 100644
index 0000000..12b815a
Binary files /dev/null and b/utils/input/GRA04190000042900001 differ
diff --git a/utils/input/adana.json b/utils/input/adana.json
new file mode 100644
index 0000000..d351676
--- /dev/null
+++ b/utils/input/adana.json
@@ -0,0 +1,12 @@
+{
+"stations" : [
+    
+    {  "lat" : 37.00,
+       "lon" : 35.32,
+       "height" : 50,
+       "name" : "Adana",
+       "output_formats" : ["png"],
+       "output_name" : "Adana"
+    }
+]
+}
diff --git a/utils/input/stations_classic.json b/utils/input/stations_classic.json
new file mode 100644
index 0000000..a0fc3ec
--- /dev/null
+++ b/utils/input/stations_classic.json
@@ -0,0 +1,19 @@
+{
+"stations" : [
+    
+    {  "lat" : 43.30,
+       "lon" : -8.50,
+       "height" : 50,
+       "name" : "point1",
+       "output_formats" : ["ps"],
+       "output_name" : "point1"
+    },
+    {  "lat" : 41.30,
+       "lon" : 10.50,
+       "name" : "point2",
+       "height" : 10,
+       "output_formats" : ["ps"],
+       "output_name" : "point2"
+    }
+]
+}
diff --git a/utils/input/tempe.json b/utils/input/tempe.json
new file mode 100644
index 0000000..1a34d26
--- /dev/null
+++ b/utils/input/tempe.json
@@ -0,0 +1,156 @@
+{
+    "forecast_location": {
+        "latitude": 37.012301461157264,
+        "distance": 5.167124375483275,
+        "longitude": 35.263852242744065
+    },
+    "time": "00",
+    "height": 50,
+    "location": {
+        "lat": 37.0,
+        "lon": 35.32
+    },
+    "tempe": {
+        "x": [
+            "0",
+            "3",
+            "6",
+            "9",
+            "12",
+            "15",
+            "18",
+            "21",
+            "24",
+            "27",
+            "30",
+            "33",
+            "36",
+            "39",
+            "42",
+            "45",
+            "48",
+            "51",
+            "54",
+            "57",
+            "60",
+            "63",
+            "66",
+            "69",
+            "72",
+            "75",
+            "78",
+            "81",
+            "84",
+            "87",
+            "90",
+            "93",
+            "96",
+            "99",
+            "102",
+            "105",
+            "108",
+            "111",
+            "114",
+            "117",
+            "120",
+            "123",
+            "126",
+            "129",
+            "132",
+            "135",
+            "138",
+            "141",
+            "144",
+            "150",
+            "156",
+            "162",
+            "168",
+            "174",
+            "180",
+            "186",
+            "192",
+            "198",
+            "204",
+            "210",
+            "216",
+            "222",
+            "228",
+            "234",
+            "240"
+        ],
+        "y": [
+            289.57730102539062,
+            289.42794799804688,
+            289.044677734375,
+            289.59954833984375,
+            290.2451171875,
+            290.52938842773438,
+            290.98216247558594,
+            291.07249450683594,
+            290.62850952148438,
+            290.51359558105469,
+            290.15573120117188,
+            290.54217529296875,
+            291.17530822753906,
+            291.28166198730469,
+            291.00410461425781,
+            290.64161682128906,
+            289.85441589355469,
+            289.26617431640625,
+            288.56072998046875,
+            288.13592529296875,
+            288.22627258300781,
+            286.70130920410156,
+            283.9954833984375,
+            282.929931640625,
+            278.73347473144531,
+            277.6895751953125,
+            279.54631042480469,
+            280.58976745605469,
+            283.07734680175781,
+            284.07853698730469,
+            284.01048278808594,
+            283.79840087890625,
+            283.47695922851562,
+            283.62898254394531,
+            284.26853942871094,
+            284.22848510742188,
+            285.05915832519531,
+            285.98109436035156,
+            286.17326354980469,
+            286.32913208007812,
+            285.37178039550781,
+            285.12944030761719,
+            284.72381591796875,
+            284.87312316894531,
+            285.87753295898438,
+            286.71095275878906,
+            286.56674194335938,
+            286.96063232421875,
+            287.56991577148438,
+            287.60917663574219,
+            288.36334228515625,
+            289.81588745117188,
+            288.3592529296875,
+            287.59007263183594,
+            288.75871276855469,
+            286.91645812988281,
+            286.36129760742188,
+            285.1220703125,
+            285.21644592285156,
+            285.87643432617188,
+            284.5498046875,
+            284.56692504882812,
+            284.30319213867188,
+            284.92333984375,
+            284.5443115234375
+        ]
+    },
+    "date": "20160419",
+    "output": "37.00_35.32_t.json",
+    "station_name": "Adana",
+    "metadata": {
+        "points_along_meridian": 2560,
+        "deterministic_height": 65.37060546875
+    }
+}
diff --git a/utils/bufrgram.py b/utils/metgram.py
similarity index 59%
copy from utils/bufrgram.py
copy to utils/metgram.py
index 24e0e1e..6f0bf08 100644
--- a/utils/bufrgram.py
+++ b/utils/metgram.py
@@ -7,13 +7,13 @@ import sys
 
 
 
-def bufrgram(data):
+def metgram(data):
 
 
     out = output(
-        output_formats="ps",
+        output_formats=["ps"],
         output_name_first_page_number='off',
-        output_name="bufrgram" ,
+        output_name="metgram" ,
         super_page_y_length=29.7,
         super_page_x_length=21.,
         )
@@ -78,25 +78,24 @@ def bufrgram(data):
         axis_tick_label_height =  font_size
         )
 
-    cc_data =    mmetbufr(
-                        epsbufr_parameter_title = "Cloud Amount (%)",
-                        epsbufr_parameter_descriptor =  20010,
-                        epsbufr_information =  "on",
-                        epsbufr_input_filename = data["epsbufr_input_filename"],
-                        epsbufr_station_latitude = data["epsbufr_station_latitude"],
-                        epsbufr_station_longitude = data["epsbufr_station_longitude"],
-                        epsbufr_station_name =  data["epsbufr_station_name"],
-
-
-                    )
-    cc_graph = mmetgraph( eps_box_border_thickness = 2,
-                          eps_box_width = 1.5,
-                          metgram_plot_style = 'bar')
+    cc_data =  mwrepjson(
+                wrepjson_family =  "eps",
+                wrepjson_input_filename =  data["cloud_cover"],
+                wrepjson_parameter =  "tcc",
+                wrepjson_product_information= "Classic metgram" ,
+                wrepjson_parameter_information= "Cloud Amount (%)",
+                wrepjson_parameter_scaling_factor= 100.,
+                )
+
+    cc_graph = mmetgraph( metgram_plot_style = 'bar',
+                    metgram_bar_colour = 'green',
+                    metgram_bar_keyword = "forecast")
     cc_text = mtext(
                 text_colour =  "navy",
                 text_font_size = 0.2,
                 text_justification =  "left",
-                text_lines =  ["<font size='0.5'> <json_info key='station_info'/></font>",
+                text_lines =  ["<font size='0.5'>Classic Metgram </font>",
+                    "<font size='0.5'> <json_info key='station_name'/></font> <font size='0.5'> <json_info key='location'/></font>",
                     "<font size='0.5'> <json_info key='date'/></font>",
                     "<font size='0.5'> . </font>",
                     "<font size='0.4'> <json_info key='parameter_info'/></font> "]
@@ -112,15 +111,14 @@ def bufrgram(data):
             )
 
     last  = last -y;
-    rh_data =    mmetbufr(
-                        epsbufr_parameter_title = "850 hPa Relative Humidity  (%)",
-                        epsbufr_parameter_descriptor =  13003,
-                        epsbufr_information =  "on",
-                        epsbufr_input_filename = data["epsbufr_input_filename"],
-                        epsbufr_station_latitude = data["epsbufr_station_latitude"],
-                        epsbufr_station_longitude = data["epsbufr_station_longitude"],
+    rh_data =mwrepjson(
+                        wrepjson_family =  "eps",
+                        wrepjson_input_filename = data["humidity"],
+                        wrepjson_parameter=  "r",
+                        wrepjson_parameter_information = "850 hPa Relative Humidity  (%)",
+
                     )
-    rh_graph = mmetgraph( )
+    rh_graph = mmetgraph( metgram_curve_keyword = "forecast")
     rh_text = mtext(
                 text_colour =  "navy",
                 text_font_size = 0.2,
@@ -139,17 +137,16 @@ def bufrgram(data):
             )
 
     last  = last -y;
-    precip_data =    mmetbufr(
-
-                        epsbufr_accumulated_parameter = "on",
-                        epsbufr_parameter_title = "Precipitation",
-                        epsbufr_parameter_descriptor =  13011,
-                        epsbufr_input_filename = data["epsbufr_input_filename"],
-                        epsbufr_station_latitude = data["epsbufr_station_latitude"],
-                        epsbufr_station_longitude = data["epsbufr_station_longitude"],
+    precip_data =    mwrepjson(
+                        wrepjson_family =  "eps",
+                        wrepjson_input_filename = data["precipitation"],
+                        wrepjson_parameter=  "cp",
+                        wrepjson_parameter_information = "Precipitation",
                     )
+
     precip_graph = mmetgraph(
-                          metgram_plot_style = 'bar'
+                          metgram_plot_style = 'bar',
+                          metgram_bar_keyword = "forecast"
                         )
     precip_text = mtext(
                 text_colour =  "navy",
@@ -168,16 +165,15 @@ def bufrgram(data):
             )
 
     last  = last - (y/2) -0.5;
-    msl_data =    mmetbufr(
-                        epsbufr_parameter_scaling_factor = 0.01,
-                        epsbufr_parameter_title = "MSL Pressure (hPa)",
-                        epsbufr_parameter_descriptor =  10051,
-                        epsbufr_information =  "on",
-                        epsbufr_input_filename = data["epsbufr_input_filename"],
-                        epsbufr_station_latitude = data["epsbufr_station_latitude"],
-                        epsbufr_station_longitude = data["epsbufr_station_longitude"],
+    msl_data =    mwrepjson(
+                        wrepjson_family =  "eps",
+                        wrepjson_input_filename = data["pressure"],
+                        wrepjson_parameter=  "msl",
+                        wrepjson_parameter_information = "MSL Pressure (hPa)",
+                        wrepjson_parameter_scaling_factor = 0.01,
                     )
     msl_graph = mmetgraph(
+                    metgram_curve_keyword = "forecast"
                         )
     msl_text = mtext(
                 text_colour =  "navy",
@@ -215,16 +211,17 @@ def bufrgram(data):
 
 
     last  = last -y;
-    wind_data =    mmetbufr(
-                        epsbufr_parameter_title = "10m Wind (m/s)",
-                        epsbufr_parameter_descriptor = 11003,
-                        epsbufr_parameter_2_descriptor =  11004,
-                        epsbufr_input_filename = data["epsbufr_input_filename"],
-                        epsbufr_station_latitude = data["epsbufr_station_latitude"],
-                        epsbufr_station_longitude = data["epsbufr_station_longitude"],
+    wind_data =   mwrepjson(
+                        wrepjson_family =  "eps",
+                        wrepjson_input_filename = data["wind"],
+                        wrepjson_parameter=  "10uv",
+                        wrepjson_parameter_information = "10m Wind (m/s)",
                     )
+
     wind_graph = mmetgraph(
-                          metgram_plot_style = 'flags'
+                          metgram_plot_style = 'flags',
+                          metgram_flag_component1 = "10u",
+                          metgram_flag_component2 = "10v",
                         )
     wind_text = mtext(
                 text_colour =  "navy",
@@ -244,27 +241,24 @@ def bufrgram(data):
 
     last  = last - y;
 
-    min_data =    mmetbufr(
-                        epsbufr_parameter_title = "Temperature (C)",
-                        epsbufr_parameter_descriptor =  12001,
-                        epsbufr_information =  "on",
-                        epsbufr_parameter_offset_factor =  -273.15,
-                        epsbufr_input_filename = data["epsbufr_input_filename"],
-                        epsbufr_station_latitude = data["epsbufr_station_latitude"],
-                        epsbufr_station_longitude = data["epsbufr_station_longitude"],
+    t850_data =    mwrepjson(
+                        wrepjson_family =  "eps",
+                        wrepjson_input_filename = data["temperature"],
+                        wrepjson_parameter=  "t",
+                        wrepjson_parameter_information = "Temperature (C)",
+                        wrepjson_parameter_offset_factor =  -273.15,
                     )
-    min_graph = mmetgraph( metgram_curve_colour = "blue"
+    min_graph = mmetgraph( metgram_curve_colour = "blue",
+                            metgram_curve_keyword = "forecast"
                         )
-    max_data =    mmetbufr(
-                        epsbufr_parameter_title = "",
-                        epsbufr_parameter_descriptor =  12004,
-                        epsbufr_information =  "on",
-                        epsbufr_parameter_offset_factor =  -273.15,
-                        epsbufr_input_filename = data["epsbufr_input_filename"],
-                        epsbufr_station_latitude = data["epsbufr_station_latitude"],
-                        epsbufr_station_longitude = data["epsbufr_station_longitude"],
+    t2m_data =    mwrepjson(
+                        wrepjson_family =  "eps",
+                        wrepjson_input_filename = data["2m_temperature"],
+                        wrepjson_parameter=  "2t",
+                        wrepjson_parameter_offset_factor =  -273.15,
                     )
-    max_graph = mmetgraph( metgram_curve_colour = "red"
+    max_graph = mmetgraph( metgram_curve_colour = "red",
+                        metgram_curve_keyword = "forecast"
                         )
     tempe_text = mtext(
                 text_colour =  "navy",
@@ -281,43 +275,57 @@ def bufrgram(data):
         horizontal,
         vertical,
         cc_data, cc_graph, cc_text,
+       #Relative humidity
         frame2,
         projection,
         horizontal,
         vertical,
         rh_data, rh_graph, rh_text,
+
         frame3,
         projection,
         horizontal,
         vertical,
         precip_data, precip_graph, precip_text,
+
         frame4,
         projection,
         horizontal,
         vertical,
         msl_data, msl_graph, msl_text,
+
+        # wind Flags
         frame5,
         wind_projection,
         horizontal,
         wind_vertical,
         wind_data, wind_graph, wind_text,
+
+        #Temperatures
         frame6,
         projection,
         horizontal,
         vertical,
-        min_data, min_graph, max_data, max_graph, tempe_text,
+        t850_data, min_graph, t2m_data, max_graph, tempe_text,
         )
 
 
 
+
+
 def main():
+    lat = "37.00"
+    lon = "35.32"
     data = {
-        "epsbufr_input_filename" : "GRA01130000012300001",
-        "epsbufr_station_latitude" : 38.72,
-        "epsbufr_station_longitude" :  30.51,
-        "epsbufr_station_name" :  "My Station",
+        "cloud_cover" : "input/%s_%s_tcc.json" % (lat, lon),
+        "precipitation" : "input/%s_%s_cp.json" % (lat, lon),
+        "pressure" : "input/%s_%s_msl.json" % (lat, lon),
+        "wind" : "input/%s_%s_10uv.json" % (lat, lon),
+        "temperature" : "input/%s_%s_t.json" % (lat, lon),
+        "2m_temperature" : "input/%s_%s_2t.json" % (lat, lon),
+        "humidity" : "input/%s_%s_r.json" % (lat, lon),
         }
-    bufrgram(data)
+    metgram(data)
 
 
 if __name__ == "__main__":

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/magics.git



More information about the debian-science-commits mailing list