[magics] 01/01: Upstream 2.24.4

Alastair McKinstry mckinstry at moszumanska.debian.org
Fri Jun 12 11:10:00 UTC 2015


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

mckinstry pushed a commit to tag upstream_2.24.4
in repository magics.

commit aebc73902a24706ed95314b736cfdae961aefef3
Author: Alastair McKinstry <mckinstry at debian.org>
Date:   Wed Apr 29 07:53:57 2015 +0100

    Upstream 2.24.4
---
 .gitignore                                         |    4 +-
 .project                                           |    2 +-
 CMakeFiles/2.8.10.2/CMakeCCompiler.cmake           |   55 -
 CMakeFiles/2.8.10.2/CMakeCXXCompiler.cmake         |   56 -
 .../2.8.10.2/CMakeDetermineCompilerABI_C.bin       |  Bin 7045 -> 0 bytes
 .../2.8.10.2/CMakeDetermineCompilerABI_CXX.bin     |  Bin 7331 -> 0 bytes
 .../2.8.10.2/CMakeDetermineCompilerABI_Fortran.bin |  Bin 8541 -> 0 bytes
 CMakeFiles/2.8.10.2/CMakeFortranCompiler.cmake     |   54 -
 CMakeFiles/2.8.10.2/CMakeSystem.cmake              |   15 -
 CMakeFiles/2.8.10.2/CompilerIdC/CMakeCCompilerId.c |  393 ----
 .../2.8.10.2/CompilerIdCXX/CMakeCXXCompilerId.cpp  |  375 ---
 .../CompilerIdFortran/CMakeFortranCompilerId.F     |  123 -
 CMakeFiles/2.8.11.2/CMakeCCompiler.cmake           |   56 -
 CMakeFiles/2.8.11.2/CMakeCXXCompiler.cmake         |   57 -
 .../2.8.11.2/CMakeDetermineCompilerABI_C.bin       |  Bin 11885 -> 0 bytes
 .../2.8.11.2/CMakeDetermineCompilerABI_CXX.bin     |  Bin 11955 -> 0 bytes
 .../2.8.11.2/CMakeDetermineCompilerABI_Fortran.bin |  Bin 19652 -> 0 bytes
 CMakeFiles/2.8.11.2/CMakeFortranCompiler.cmake     |   55 -
 CMakeFiles/2.8.11.2/CMakeSystem.cmake              |   15 -
 CMakeFiles/2.8.11.2/CompilerIdC/CMakeCCompilerId.c |  390 ----
 .../2.8.11.2/CompilerIdCXX/CMakeCXXCompilerId.cpp  |  372 ---
 .../CompilerIdFortran/CMakeFortranCompilerId.F     |  119 -
 .../CheckTypeSize/CMAKE_SIZEOF_UNSIGNED_SHORT.bin  |  Bin 6983 -> 0 bytes
 .../CheckTypeSize/CMAKE_SIZEOF_UNSIGNED_SHORT.c    |   40 -
 CMakeFiles/CheckTypeSize/EC_SIZEOF_CHAR.bin        |  Bin 6970 -> 0 bytes
 CMakeFiles/CheckTypeSize/EC_SIZEOF_CHAR.c          |   40 -
 CMakeFiles/CheckTypeSize/EC_SIZEOF_DOUBLE.bin      |  Bin 6972 -> 0 bytes
 CMakeFiles/CheckTypeSize/EC_SIZEOF_DOUBLE.c        |   40 -
 CMakeFiles/CheckTypeSize/EC_SIZEOF_FLOAT.bin       |  Bin 6971 -> 0 bytes
 CMakeFiles/CheckTypeSize/EC_SIZEOF_FLOAT.c         |   40 -
 CMakeFiles/CheckTypeSize/EC_SIZEOF_INT.bin         |  Bin 6969 -> 0 bytes
 CMakeFiles/CheckTypeSize/EC_SIZEOF_INT.c           |   40 -
 CMakeFiles/CheckTypeSize/EC_SIZEOF_LONG.bin        |  Bin 6970 -> 0 bytes
 CMakeFiles/CheckTypeSize/EC_SIZEOF_LONG.c          |   40 -
 CMakeFiles/CheckTypeSize/EC_SIZEOF_LONG_DOUBLE.bin |  Bin 6977 -> 0 bytes
 CMakeFiles/CheckTypeSize/EC_SIZEOF_LONG_DOUBLE.c   |   40 -
 CMakeFiles/CheckTypeSize/EC_SIZEOF_LONG_LONG.bin   |  Bin 6975 -> 0 bytes
 CMakeFiles/CheckTypeSize/EC_SIZEOF_LONG_LONG.c     |   40 -
 CMakeFiles/CheckTypeSize/EC_SIZEOF_PTR.bin         |  Bin 6969 -> 0 bytes
 CMakeFiles/CheckTypeSize/EC_SIZEOF_PTR.c           |   40 -
 CMakeFiles/CheckTypeSize/EC_SIZEOF_SHORT.bin       |  Bin 6971 -> 0 bytes
 CMakeFiles/CheckTypeSize/EC_SIZEOF_SHORT.c         |   40 -
 CMakeFiles/CheckTypeSize/EC_SIZEOF_SIZE_T.bin      |  Bin 6972 -> 0 bytes
 CMakeFiles/CheckTypeSize/EC_SIZEOF_SIZE_T.c        |   40 -
 CMakeFiles/CheckTypeSize/EC_SIZEOF_SSIZE_T.bin     |  Bin 6973 -> 0 bytes
 CMakeFiles/CheckTypeSize/EC_SIZEOF_SSIZE_T.c       |   40 -
 CMakeFiles/FortranCInterface/CMakeCache.txt        |  250 --
 .../CMakeFiles/CMakeDirectoryInformation.cmake     |   16 -
 .../FortranCInterface.dir/DependInfo.cmake         |   24 -
 .../CMakeFiles/FortranCInterface.dir/build.make    |  135 --
 .../FortranCInterface.dir/cmake_clean.cmake        |   12 -
 .../FortranCInterface.dir/depend.internal          |    9 -
 .../CMakeFiles/FortranCInterface.dir/depend.make   |    8 -
 .../CMakeFiles/FortranCInterface.dir/flags.make    |   10 -
 .../FortranCInterface.dir/fortran.internal         |    2 -
 .../CMakeFiles/FortranCInterface.dir/link.txt      |    1 -
 .../CMakeFiles/FortranCInterface.dir/progress.make |    4 -
 .../FortranCInterface/CMakeFiles/Makefile.cmake    |   50 -
 CMakeFiles/FortranCInterface/CMakeFiles/Makefile2  |  174 --
 .../CMakeFiles/TargetDirectories.txt               |    3 -
 .../FortranCInterface/CMakeFiles/cmake.check_cache |    1 -
 .../CMakeFiles/myfort.dir/DependInfo.cmake         |   23 -
 .../CMakeFiles/myfort.dir/build.make               |  152 --
 .../CMakeFiles/myfort.dir/cmake_clean.cmake        |   13 -
 .../myfort.dir/cmake_clean_Fortran.cmake           |   10 -
 .../CMakeFiles/myfort.dir/cmake_clean_target.cmake |    3 -
 .../CMakeFiles/myfort.dir/depend.internal          |   11 -
 .../CMakeFiles/myfort.dir/depend.make              |   17 -
 .../CMakeFiles/myfort.dir/flags.make               |    8 -
 .../CMakeFiles/myfort.dir/fortran.internal         |    4 -
 .../CMakeFiles/myfort.dir/link.txt                 |    2 -
 .../myfort.dir/my_module.f90.o.provides.build      |    0
 .../CMakeFiles/myfort.dir/my_module.mod.stamp      |   23 -
 .../myfort.dir/mymodule.f90.o.provides.build       |    0
 .../CMakeFiles/myfort.dir/mymodule.mod.stamp       |   23 -
 .../CMakeFiles/myfort.dir/progress.make            |    5 -
 .../FortranCInterface/CMakeFiles/progress.marks    |    1 -
 .../CMakeFiles/symbols.dir/C.includecache          |   58 -
 .../CMakeFiles/symbols.dir/DependInfo.cmake        |   45 -
 .../CMakeFiles/symbols.dir/build.make              |  730 ------
 .../CMakeFiles/symbols.dir/cmake_clean.cmake       |   34 -
 .../symbols.dir/cmake_clean_target.cmake           |    3 -
 .../CMakeFiles/symbols.dir/depend.internal         |   53 -
 .../CMakeFiles/symbols.dir/depend.make             |   53 -
 .../CMakeFiles/symbols.dir/flags.make              |    8 -
 .../CMakeFiles/symbols.dir/link.txt                |    2 -
 .../CMakeFiles/symbols.dir/progress.make           |   26 -
 CMakeFiles/FortranCInterface/FortranCInterface     |  Bin 8970 -> 0 bytes
 CMakeFiles/FortranCInterface/Input.cmake           |    3 -
 CMakeFiles/FortranCInterface/Makefile              |  905 --------
 CMakeFiles/FortranCInterface/Output.cmake          |   34 -
 CMakeFiles/FortranCInterface/cmake_install.cmake   |   44 -
 CMakeFiles/FortranCInterface/libmyfort.a           |  Bin 5340 -> 0 bytes
 CMakeFiles/FortranCInterface/libsymbols.a          |  Bin 38910 -> 0 bytes
 CMakeFiles/FortranCInterface/my_module.mod         |   23 -
 CMakeFiles/FortranCInterface/mymodule.mod          |   23 -
 .../symbols/MYMODULE_mp_MYSUB-UPPER.c              |    4 -
 CMakeFiles/FortranCInterface/symbols/MYSUB-UPPER.c |    4 -
 .../symbols/MY_MODULE_mp_MY_SUB-UPPER.c            |    4 -
 .../FortranCInterface/symbols/MY_SUB-UPPER.c       |    4 -
 .../symbols/__my_module_MOD_my_sub.c               |    4 -
 .../symbols/__my_module_NMOD_my_sub.c              |    4 -
 .../symbols/__my_module__my_sub.c                  |    4 -
 .../symbols/__mymodule_MOD_mysub.c                 |    4 -
 .../symbols/__mymodule_NMOD_mysub.c                |    4 -
 .../FortranCInterface/symbols/__mymodule__mysub.c  |    4 -
 .../FortranCInterface/symbols/my_moduleSmy_sub.c   |    4 -
 .../symbols/my_module_MP_my_sub.c                  |    4 -
 .../symbols/my_module_mp_my_sub_.c                 |    4 -
 .../FortranCInterface/symbols/my_module_my_sub_.c  |    4 -
 CMakeFiles/FortranCInterface/symbols/my_sub.c      |    4 -
 CMakeFiles/FortranCInterface/symbols/my_sub_.c     |    4 -
 CMakeFiles/FortranCInterface/symbols/my_sub__.c    |    4 -
 .../FortranCInterface/symbols/mymoduleSmysub.c     |    4 -
 .../FortranCInterface/symbols/mymodule_MP_mysub.c  |    4 -
 .../FortranCInterface/symbols/mymodule_mp_mysub_.c |    4 -
 .../FortranCInterface/symbols/mymodule_mysub_.c    |    4 -
 CMakeFiles/FortranCInterface/symbols/mysub.c       |    4 -
 CMakeFiles/FortranCInterface/symbols/mysub_.c      |    4 -
 CMakeFiles/TestEndianess.bin                       |  Bin 7108 -> 0 bytes
 CMakeFiles/cmake.check_cache                       |    1 -
 CMakeLists.txt                                     |  112 +-
 NOTICE                                             |   52 +
 VERSION.cmake                                      |    4 +-
 apps/MagMLInterpretor/json.cc                      |   24 +-
 bufr.f90                                           |   31 -
 cmake/CheckFortranSourceCompiles.cmake             |    6 +-
 cmake/FindAEC.cmake                                |   34 +
 cmake/FindCMath.cmake                              |   13 +-
 cmake/FindNetCDF.cmake                             |  137 +-
 cmake/FindNetCDF3.cmake                            |   56 +-
 cmake/FindPGIFortran.cmake                         |   12 +-
 cmake/FindPangoCairo.cmake                         |    7 -
 cmake/Findgrib_api.cmake                           |    6 +-
 cmake/VERSION.cmake                                |    7 +
 cmake/contrib/FindEigen3.cmake                     |    5 +
 cmake/contrib/FindFFTW.cmake                       |  124 +
 cmake/contrib/FindNetCDF4.cmake                    |   53 +-
 .../contrib/GreatCMakeCookOff/AddCPP11Flags.cmake  |    5 -
 .../GreatCMakeCookOff/CheckCXX11Features.cmake     |    4 +-
 cmake/ecbuild_add_executable.cmake                 |   30 +-
 cmake/ecbuild_add_extra_search_paths.cmake         |   15 +-
 cmake/ecbuild_add_library.cmake                    |   53 +-
 cmake/ecbuild_add_option.cmake                     |  163 +-
 cmake/ecbuild_add_test.cmake                       |  138 +-
 cmake/ecbuild_append_to_rpath.cmake                |   11 +-
 cmake/ecbuild_bundle.cmake                         |  284 +++
 cmake/ecbuild_cache.cmake                          |   65 +
 cmake/ecbuild_check_c_source.cmake                 |   51 +-
 cmake/ecbuild_check_compiler.cmake                 |   26 +-
 cmake/ecbuild_check_cxx11.cmake                    |    4 +-
 cmake/ecbuild_check_cxx_source.cmake               |   40 +-
 cmake/ecbuild_check_fortran_source.cmake           |   41 +-
 cmake/ecbuild_check_functions.cmake                |  119 +-
 cmake/ecbuild_check_os.cmake                       |  229 +-
 cmake/ecbuild_config.h.in                          |    3 +-
 cmake/ecbuild_declare_project.cmake                |   29 +-
 cmake/ecbuild_define_options.cmake                 |   11 +
 cmake/ecbuild_define_paths.cmake                   |   28 +-
 cmake/ecbuild_echo_targets.cmake                   |  198 ++
 cmake/ecbuild_enable_fortran.cmake                 |    9 +-
 cmake/ecbuild_find_fortranlibs.cmake               |    3 +-
 cmake/ecbuild_find_mpi.cmake                       |  243 +-
 cmake/ecbuild_find_omp.cmake                       |  204 ++
 cmake/ecbuild_find_package.cmake                   |   37 +-
 cmake/ecbuild_get_date.cmake                       |    2 +-
 cmake/ecbuild_get_test_data.cmake                  |  160 +-
 cmake/ecbuild_install_package.cmake                |  159 +-
 cmake/ecbuild_links_target.cmake                   |    8 +-
 cmake/ecbuild_list_extra_search_paths.cmake        |   88 +-
 cmake/ecbuild_list_macros.cmake                    |   57 +-
 cmake/ecbuild_pkgconfig.cmake                      |  365 +++
 cmake/ecbuild_print_summary.cmake                  |   44 +-
 cmake/ecbuild_setup_test_framework.cmake           |   16 +-
 cmake/ecbuild_system.cmake                         |  105 +-
 cmake/ecbuild_use_package.cmake                    |   14 +-
 cmake/ecbuild_warn_unused_files.cmake              |    2 +-
 cmake/include/ecbuild/boost_test_framework.h       |    1 +
 cmake/pkg-config.pc.in                             |   35 +
 cmake/project-config.cmake.in                      |   28 +-
 compile.sh                                         |  321 ---
 configure.debug                                    |  163 --
 configure.example                                  |  125 -
 configure.loxp                                     |  142 --
 ecbuild_config.h                                   |   52 -
 ecbuild_platform.h                                 |  131 --
 magics-config.in                                   |   14 +-
 magics-targets.cmake                               |   30 -
 magics.sublime-project                             |   18 +
 metview_files/MTHERMOGRIDDef                       |  322 +++
 metview_files/MTHERMOGRIDRules                     |   62 +
 python/Magics/CMakeLists.txt                       |   15 +-
 python/Magics/Magics_interface.cc                  |    5 +
 python/Magics/import                               |    2 -
 python/Magics/macro.py                             |    1 +
 share/magics/10m/10m_populated_places_simple.dbf   |  Bin 0 -> 32124176 bytes
 share/magics/10m/10m_populated_places_simple.shp   |  Bin 0 -> 204752 bytes
 share/magics/10m/10m_populated_places_simple.shx   |  Bin 0 -> 58572 bytes
 share/magics/bufr_80.xml                           |    1 +
 share/magics/bufr_98.xml                           |    1 +
 share/magics/epsg.json                             |    4 +-
 share/magics/symbols.svg                           |   11 +-
 share/magics/title_template.xml                    |   54 +-
 src/CMakeLists.txt                                 |   84 +-
 src/MagicsDouble.cc                                |    9 +-
 src/basic/BasicGraphicsObject.h                    |   23 +-
 src/basic/FortranMagics.cc                         |   25 +-
 src/basic/FortranMagics.h                          |    1 +
 src/basic/ImportObjectHandler.cc                   |   12 +-
 src/basic/Layer.cc                                 |   43 +-
 src/basic/Layer.h                                  |   59 +-
 src/basic/LegendVisitor.cc                         |   23 +-
 src/basic/LegendVisitor.h                          |   10 +-
 src/basic/TextVisitor.cc                           |   41 +-
 src/basic/ViewNode.cc                              |   28 +-
 src/basic/VisualAction.cc                          |   43 +-
 src/basic/VisualAction.h                           |   10 +-
 src/basic/XmlMagics.cc                             |   14 +-
 src/basic/XmlMagics.h                              |    2 +-
 src/common/BaseParameter.h                         |   18 -
 src/common/CMakeLists.txt                          |    1 +
 src/common/CustomisedPoint.h                       |    4 +
 src/common/Data.h                                  |    7 +-
 src/common/Layout.cc                               |    3 +-
 src/common/MagException.h                          |    8 +-
 src/common/MagLog.cc                               |    1 +
 src/common/MagTranslator.h                         |   60 -
 src/common/MagicsCalls.cc                          |   24 +-
 src/common/Matrix.cc                               |   15 +-
 src/common/Matrix.h                                |   18 +-
 src/common/MatrixHandler.h                         |    2 +
 src/common/OutputFactory.cc                        |    9 +
 src/common/OutputFactory.h                         |   10 +
 src/common/OutputHandler.cc                        |    9 +-
 src/common/PolarStereographicProjection.cc         |   17 +-
 src/common/PolarStereographicProjection.h          |    1 +
 src/common/Proj4Projection.cc                      |  135 +-
 src/common/Proj4Projection.h                       |    9 +-
 src/common/RasterData.h                            |    1 +
 src/common/TaylorProjection.cc                     |   38 +-
 src/common/TaylorProjection.h                      |    1 +
 src/common/Tephigram.cc                            |   90 +-
 src/common/Tephigram.h                             |    5 +-
 src/common/Tokenizer.cc                            |    1 +
 src/common/Transformation.cc                       |  496 ++--
 src/common/Transformation.h                        |   13 +-
 src/common/XmlReader.h                             |    2 +
 src/common/magics_api.h                            |    2 +-
 src/decoders/BinningObject.cc                      |   76 +-
 src/decoders/Date.cc                               |   10 +-
 src/decoders/GribDecoder.cc                        | 1516 ++++++------
 src/decoders/GribDecoder.h                         |    7 +-
 src/decoders/GribInterpretor.h                     |    7 +-
 src/decoders/GribRegularInterpretor.cc             | 2163 ++++++++++--------
 src/decoders/GribRegularInterpretor.h              |   27 +-
 src/decoders/GribSatelliteInterpretor.cc           |  474 +++-
 src/decoders/GribSatelliteInterpretor.h            |    8 +-
 src/decoders/InputData.cc                          |    6 +-
 src/decoders/LocalTable.cc                         |    1 +
 src/decoders/Netcdf.cc                             |   19 +-
 src/decoders/Netcdf.h                              |    5 +
 src/decoders/NetcdfDecoder.h                       |    3 +-
 src/decoders/NetcdfGeoMatrixInterpretor.cc         |   59 +-
 src/decoders/NetcdfGeoMatrixInterpretor.h          |    2 +-
 src/decoders/NetcdfGeopointsInterpretor.cc         |   18 +-
 src/decoders/NetcdfInterpretor.cc                  |   15 +-
 src/decoders/NetcdfMatrixInterpretor.cc            |   27 +-
 src/decoders/NetcdfOrcaInterpretor.cc              |   20 +-
 src/decoders/NetcdfVectorInterpretor.cc            |   44 +
 src/decoders/NetcdfVectorInterpretor.h             |    1 +
 src/decoders/ShapeDecoder.cc                       |   57 +-
 src/decoders/Time.cc                               |    2 +
 src/decoders/TitleTemplate.cc                      |   26 +-
 src/decoders/TitleTemplate.h                       |    2 +-
 src/drivers/BaseDriver.cc                          |   10 +-
 src/drivers/BaseDriver.h                           |    2 +
 src/drivers/BaseDriverSymbols.h                    |   28 +-
 src/drivers/BaseDriverWind.h                       |   12 +-
 src/drivers/CairoDriver.cc                         |  247 +-
 src/drivers/CairoDriver.h                          |   21 +-
 src/drivers/KMLDriver.cc                           |  516 ++---
 src/drivers/KMLDriver.h                            |    6 +-
 src/drivers/MgQ/MgQDriverObject.h                  |    2 +-
 src/drivers/MgQ/MgQPlotScene.h                     |    2 +-
 src/drivers/MgQ/MgQRootItem.h                      |    3 +
 src/drivers/PostScriptDriver.cc                    |   11 +-
 src/drivers/QtDriver.cc                            |   35 +-
 src/drivers/QtDriver.h                             |    6 +
 src/drivers/SVGDriver.cc                           |   85 +-
 src/drivers/SVGDriver.h                            |    3 +-
 src/libMagWrapper/MagPlus.cc                       |   28 +-
 src/magics.h                                       |   16 +-
 src/magics_ecmwf_log.h                             |   28 +-
 src/oda/OdaDecoder.cc                              |   26 +-
 src/params/ArrowPlotting.xml                       |    1 -
 src/params/BaseDriver.xml                          |   31 +-
 src/params/CMakeLists.txt                          |   16 +-
 src/params/CairoDriver.xml                         |   16 +-
 src/params/Cities.xml                              |    2 +-
 src/params/Contour.xml                             |    5 +-
 src/params/DateAxisMethod.xml                      |    8 +-
 src/params/EpsGraph.xml                            |    2 +-
 src/params/EpsPlume.xml                            |    3 +
 src/params/FlagPlotting.xml                        |    1 -
 src/params/FortranSceneNode.xml                    |    4 +-
 src/params/FortranViewNode.xml                     |    3 +-
 src/params/GraphPlotting.xml                       |    2 +-
 src/params/GribDecoder.xml                         |   31 +-
 src/params/GribLoop.xml                            |    4 +
 src/params/HiLo.xml                                |    4 +-
 src/params/HighHiLo.xml                            |    2 +-
 src/params/Histogram.xml                           |    6 +-
 src/params/ImportObjectHandler.xml                 |    8 +-
 src/params/IsoPlot.xml                             |   41 +-
 src/params/LegendVisitor.xml                       |    8 +-
 src/params/LowHiLo.xml                             |    2 +-
 src/params/MagnifierVisitor.xml                    |    2 +-
 src/params/NetcdfGeoMatrixInterpretor.xml          |   13 +-
 src/params/NetcdfInterpretor.xml                   |   19 +-
 src/params/ObsPlotting.xml                         |  124 +-
 src/params/PostScriptDriver.xml                    |    2 +-
 src/params/Proj4Projection.xml                     |    7 +-
 src/params/QtDriver.xml                            |   10 +-
 src/params/SVGDriver.xml                           |   18 +-
 src/params/SimplePolyline.xml                      |   10 +-
 src/params/SymbolAdvancedTableMode.xml             |   20 +-
 src/params/SymbolIndividualMode.xml                |   10 +-
 src/params/SymbolPlotting.xml                      |   17 +-
 src/params/TableDecoder.xml                        |    2 +-
 src/params/TephiGrid.xml                           |  224 +-
 src/params/TephiInfo.xml                           |    2 +-
 src/params/Tephigram.xml                           |   21 +-
 src/params/TextVisitor.xml                         |    4 +-
 src/params/WindPlotting.xml                        |   10 +-
 src/params/WrepJSon.xml                            |    5 +-
 src/params/xx.xml                                  |   84 -
 src/visualisers/ArrowPlotting.cc                   |    5 +-
 src/visualisers/Axis.cc                            |    5 +-
 src/visualisers/AxisMethod.h                       |    2 +-
 src/visualisers/CMakeLists.txt                     |    5 +-
 src/visualisers/CellShading.cc                     |    1 +
 src/visualisers/ColourTechnique.cc                 |   27 +-
 src/visualisers/ColourTechnique.h                  |    3 +-
 src/visualisers/Contour.cc                         |    5 +-
 src/visualisers/CountSelectionType.h               |    2 +-
 src/visualisers/Curve.cc                           |    9 +-
 src/visualisers/DateAxis.cc                        |    5 +-
 src/visualisers/EpsGraph.cc                        |   18 +-
 src/visualisers/FlagPlotting.cc                    |  132 +-
 src/visualisers/FlagPlotting.h                     |   10 +-
 src/visualisers/Histogram.cc                       |    3 +-
 src/visualisers/ImagePlotting.cc                   |  292 ---
 src/visualisers/ImagePlotting.h                    |   86 -
 src/visualisers/IntervalSelectionType.cc           |   47 +-
 src/visualisers/IntervalSelectionType.h            |    2 +-
 src/visualisers/IsoLabel.cc                        |    6 +-
 src/visualisers/IsoPlot.cc                         | 2402 ++++++++++----------
 src/visualisers/IsoPlot.h                          |  106 +-
 src/visualisers/IsoShading.h                       |    4 +
 src/visualisers/LegendMethod.cc                    |    5 +-
 src/visualisers/LevelListSelectionType.h           |    2 +-
 src/visualisers/LevelSelection.cc                  |    5 +-
 src/visualisers/LevelSelection.h                   |    2 +-
 src/visualisers/ObsItemFamily.cc                   |    6 +-
 src/visualisers/PolyShadingMethod.cc               |   10 +-
 src/visualisers/PolyShadingTechnique.h             |    4 +-
 src/visualisers/SegmentJoiner.cc                   |   38 +-
 src/visualisers/SegmentJoiner.h                    |   21 +-
 src/visualisers/ShadingTechnique.h                 |   11 +-
 src/visualisers/SymbolAdvancedTableMode.cc         |    6 +-
 src/visualisers/SymbolMode.cc                      |    2 +-
 src/visualisers/TephiGrid.cc                       |   46 +-
 src/visualisers/TephiGrid.h                        |    3 +-
 src/visualisers/WindPlotting.cc                    |   74 +-
 src/visualisers/WindPlotting.h                     |   10 +-
 src/web/CMakeLists.txt                             |    3 +-
 src/web/WrepJSon.cc                                |  101 +-
 src/web/json_spirit.h                              |   12 +-
 src/web/json_spirit.vcproj                         |  213 ++
 src/web/json_spirit_error_position.h               |   54 +
 src/web/json_spirit_reader.cpp                     |  754 +-----
 src/web/json_spirit_reader.h                       |   53 +-
 ...it_reader.cpp => json_spirit_reader_template.h} |  435 ++--
 src/web/json_spirit_stream_reader.h                |   70 +
 src/web/json_spirit_utils.h                        |   16 +-
 src/web/json_spirit_value.h                        |  287 ++-
 src/web/json_spirit_writer.cpp                     |  355 +--
 src/web/json_spirit_writer.h                       |   61 +-
 src/web/json_spirit_writer_options.h               |   33 +
 src/web/json_spirit_writer_template.h              |  387 ++++
 test/CMakeLists.txt                                |   30 +-
 test/grib.f90                                      |    3 +-
 test/grib.py                                       |    7 +-
 tools/metview.py                                   |   17 +
 tools/x                                            |  377 +--
 tools/xml2mv.pl                                    |    4 +-
 tools/xml2mv.py                                    |  119 +-
 version.sh                                         |    2 +-
 398 files changed, 10931 insertions(+), 14833 deletions(-)

diff --git a/.gitignore b/.gitignore
index ba12fa2..9fd6354 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,7 +6,6 @@
 *.grb
 *.out
 *.keep
-docs
 Debug
 CMakeLists.txt.user*
 *.nc
@@ -15,5 +14,8 @@ CMakeLists.txt.user*
 *.pyc
 *.log
 *.html
+.cproject
+.project
 
 
+*.sublime-workspace
diff --git a/.project b/.project
index 7a9dcd0..789c3c5 100644
--- a/.project
+++ b/.project
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <projectDescription>
-	<name>home</name>
+	<name>magics-off</name>
 	<comment></comment>
 	<projects>
 	</projects>
diff --git a/CMakeFiles/2.8.10.2/CMakeCCompiler.cmake b/CMakeFiles/2.8.10.2/CMakeCCompiler.cmake
deleted file mode 100644
index a972516..0000000
--- a/CMakeFiles/2.8.10.2/CMakeCCompiler.cmake
+++ /dev/null
@@ -1,55 +0,0 @@
-set(CMAKE_C_COMPILER "/usr/bin/cc")
-set(CMAKE_C_COMPILER_ARG1 "")
-set(CMAKE_C_COMPILER_ID "GNU")
-set(CMAKE_C_COMPILER_VERSION "4.4.7")
-set(CMAKE_C_PLATFORM_ID "Linux")
-
-set(CMAKE_AR "/usr/bin/ar")
-set(CMAKE_RANLIB "/usr/bin/ranlib")
-set(CMAKE_LINKER "/usr/bin/ld")
-set(CMAKE_COMPILER_IS_GNUCC 1)
-set(CMAKE_C_COMPILER_LOADED 1)
-set(CMAKE_C_COMPILER_WORKS TRUE)
-set(CMAKE_C_ABI_COMPILED TRUE)
-set(CMAKE_COMPILER_IS_MINGW )
-set(CMAKE_COMPILER_IS_CYGWIN )
-if(CMAKE_COMPILER_IS_CYGWIN)
-  set(CYGWIN 1)
-  set(UNIX 1)
-endif()
-
-set(CMAKE_C_COMPILER_ENV_VAR "CC")
-
-if(CMAKE_COMPILER_IS_MINGW)
-  set(MINGW 1)
-endif()
-set(CMAKE_C_COMPILER_ID_RUN 1)
-set(CMAKE_C_SOURCE_FILE_EXTENSIONS c)
-set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
-set(CMAKE_C_LINKER_PREFERENCE 10)
-
-# Save compiler ABI information.
-set(CMAKE_C_SIZEOF_DATA_PTR "8")
-set(CMAKE_C_COMPILER_ABI "ELF")
-set(CMAKE_C_LIBRARY_ARCHITECTURE "")
-
-if(CMAKE_C_SIZEOF_DATA_PTR)
-  set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}")
-endif()
-
-if(CMAKE_C_COMPILER_ABI)
-  set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}")
-endif()
-
-if(CMAKE_C_LIBRARY_ARCHITECTURE)
-  set(CMAKE_LIBRARY_ARCHITECTURE "")
-endif()
-
-
-
-
-set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "c")
-set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-redhat-linux/4.4.7;/usr/lib64;/lib64;/usr/lib")
-
-
-
diff --git a/CMakeFiles/2.8.10.2/CMakeCXXCompiler.cmake b/CMakeFiles/2.8.10.2/CMakeCXXCompiler.cmake
deleted file mode 100644
index 09a4653..0000000
--- a/CMakeFiles/2.8.10.2/CMakeCXXCompiler.cmake
+++ /dev/null
@@ -1,56 +0,0 @@
-set(CMAKE_CXX_COMPILER "/usr/bin/c++")
-set(CMAKE_CXX_COMPILER_ARG1 "")
-set(CMAKE_CXX_COMPILER_ID "GNU")
-set(CMAKE_CXX_COMPILER_VERSION "4.4.7")
-set(CMAKE_CXX_PLATFORM_ID "Linux")
-
-set(CMAKE_AR "/usr/bin/ar")
-set(CMAKE_RANLIB "/usr/bin/ranlib")
-set(CMAKE_LINKER "/usr/bin/ld")
-set(CMAKE_COMPILER_IS_GNUCXX 1)
-set(CMAKE_CXX_COMPILER_LOADED 1)
-set(CMAKE_CXX_COMPILER_WORKS TRUE)
-set(CMAKE_CXX_ABI_COMPILED TRUE)
-set(CMAKE_COMPILER_IS_MINGW )
-set(CMAKE_COMPILER_IS_CYGWIN )
-if(CMAKE_COMPILER_IS_CYGWIN)
-  set(CYGWIN 1)
-  set(UNIX 1)
-endif()
-
-set(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
-
-if(CMAKE_COMPILER_IS_MINGW)
-  set(MINGW 1)
-endif()
-set(CMAKE_CXX_COMPILER_ID_RUN 1)
-set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC)
-set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP)
-set(CMAKE_CXX_LINKER_PREFERENCE 30)
-set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1)
-
-# Save compiler ABI information.
-set(CMAKE_CXX_SIZEOF_DATA_PTR "8")
-set(CMAKE_CXX_COMPILER_ABI "ELF")
-set(CMAKE_CXX_LIBRARY_ARCHITECTURE "")
-
-if(CMAKE_CXX_SIZEOF_DATA_PTR)
-  set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}")
-endif()
-
-if(CMAKE_CXX_COMPILER_ABI)
-  set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}")
-endif()
-
-if(CMAKE_CXX_LIBRARY_ARCHITECTURE)
-  set(CMAKE_LIBRARY_ARCHITECTURE "")
-endif()
-
-
-
-
-set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;m;c")
-set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-redhat-linux/4.4.7;/usr/lib64;/lib64;/usr/lib")
-
-
-
diff --git a/CMakeFiles/2.8.10.2/CMakeDetermineCompilerABI_C.bin b/CMakeFiles/2.8.10.2/CMakeDetermineCompilerABI_C.bin
deleted file mode 100755
index 9a91ed2..0000000
Binary files a/CMakeFiles/2.8.10.2/CMakeDetermineCompilerABI_C.bin and /dev/null differ
diff --git a/CMakeFiles/2.8.10.2/CMakeDetermineCompilerABI_CXX.bin b/CMakeFiles/2.8.10.2/CMakeDetermineCompilerABI_CXX.bin
deleted file mode 100755
index be1e6e2..0000000
Binary files a/CMakeFiles/2.8.10.2/CMakeDetermineCompilerABI_CXX.bin and /dev/null differ
diff --git a/CMakeFiles/2.8.10.2/CMakeDetermineCompilerABI_Fortran.bin b/CMakeFiles/2.8.10.2/CMakeDetermineCompilerABI_Fortran.bin
deleted file mode 100755
index 16ea4d2..0000000
Binary files a/CMakeFiles/2.8.10.2/CMakeDetermineCompilerABI_Fortran.bin and /dev/null differ
diff --git a/CMakeFiles/2.8.10.2/CMakeFortranCompiler.cmake b/CMakeFiles/2.8.10.2/CMakeFortranCompiler.cmake
deleted file mode 100644
index d55e5aa..0000000
--- a/CMakeFiles/2.8.10.2/CMakeFortranCompiler.cmake
+++ /dev/null
@@ -1,54 +0,0 @@
-set(CMAKE_Fortran_COMPILER "/usr/bin/gfortran")
-set(CMAKE_Fortran_COMPILER_ARG1 "")
-set(CMAKE_Fortran_COMPILER_ID "GNU")
-set(CMAKE_Fortran_PLATFORM_ID "")
-
-set(CMAKE_AR "/usr/bin/ar")
-set(CMAKE_RANLIB "/usr/bin/ranlib")
-set(CMAKE_COMPILER_IS_GNUG77 1)
-set(CMAKE_Fortran_COMPILER_LOADED 1)
-set(CMAKE_Fortran_COMPILER_WORKS TRUE)
-set(CMAKE_Fortran_ABI_COMPILED TRUE)
-set(CMAKE_COMPILER_IS_MINGW )
-set(CMAKE_COMPILER_IS_CYGWIN )
-if(CMAKE_COMPILER_IS_CYGWIN)
-  set(CYGWIN 1)
-  set(UNIX 1)
-endif()
-
-set(CMAKE_Fortran_COMPILER_ENV_VAR "FC")
-
-set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 1)
-
-if(CMAKE_COMPILER_IS_MINGW)
-  set(MINGW 1)
-endif()
-set(CMAKE_Fortran_COMPILER_ID_RUN 1)
-set(CMAKE_Fortran_SOURCE_FILE_EXTENSIONS f;F;f77;F77;f90;F90;for;For;FOR;f95;F95)
-set(CMAKE_Fortran_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
-set(CMAKE_Fortran_LINKER_PREFERENCE 20)
-if(UNIX)
-  set(CMAKE_Fortran_OUTPUT_EXTENSION .o)
-else()
-  set(CMAKE_Fortran_OUTPUT_EXTENSION .obj)
-endif()
-
-# Save compiler ABI information.
-set(CMAKE_Fortran_SIZEOF_DATA_PTR "8")
-set(CMAKE_Fortran_COMPILER_ABI "")
-set(CMAKE_Fortran_LIBRARY_ARCHITECTURE "")
-
-if(CMAKE_Fortran_SIZEOF_DATA_PTR AND NOT CMAKE_SIZEOF_VOID_P)
-  set(CMAKE_SIZEOF_VOID_P "${CMAKE_Fortran_SIZEOF_DATA_PTR}")
-endif()
-
-if(CMAKE_Fortran_COMPILER_ABI)
-  set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_Fortran_COMPILER_ABI}")
-endif()
-
-if(CMAKE_Fortran_LIBRARY_ARCHITECTURE)
-  set(CMAKE_LIBRARY_ARCHITECTURE "")
-endif()
-
-set(CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES "gfortranbegin;gfortran;m;c")
-set(CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-redhat-linux/4.4.7;/usr/lib64;/lib64;/usr/lib")
diff --git a/CMakeFiles/2.8.10.2/CMakeSystem.cmake b/CMakeFiles/2.8.10.2/CMakeSystem.cmake
deleted file mode 100644
index 1f32d10..0000000
--- a/CMakeFiles/2.8.10.2/CMakeSystem.cmake
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-set(CMAKE_SYSTEM "Linux-2.6.32-358.2.1.el6.x86_64")
-set(CMAKE_SYSTEM_NAME "Linux")
-set(CMAKE_SYSTEM_VERSION "2.6.32-358.2.1.el6.x86_64")
-set(CMAKE_SYSTEM_PROCESSOR "x86_64")
-
-set(CMAKE_HOST_SYSTEM "Linux-2.6.32-358.2.1.el6.x86_64")
-set(CMAKE_HOST_SYSTEM_NAME "Linux")
-set(CMAKE_HOST_SYSTEM_VERSION "2.6.32-358.2.1.el6.x86_64")
-set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64")
-
-set(CMAKE_CROSSCOMPILING "FALSE")
-
-set(CMAKE_SYSTEM_LOADED 1)
diff --git a/CMakeFiles/2.8.10.2/CompilerIdC/CMakeCCompilerId.c b/CMakeFiles/2.8.10.2/CompilerIdC/CMakeCCompilerId.c
deleted file mode 100644
index 699d25d..0000000
--- a/CMakeFiles/2.8.10.2/CompilerIdC/CMakeCCompilerId.c
+++ /dev/null
@@ -1,393 +0,0 @@
-#ifdef __cplusplus
-# error "A C++ compiler has been selected for C."
-#endif
-
-/* Version number components: V=Version, R=Revision, P=Patch
-   Version date components:   YYYY=Year, MM=Month,   DD=Day  */
-
-#if defined(__18CXX)
-# define ID_VOID_MAIN
-#endif
-
-#if defined(__INTEL_COMPILER) || defined(__ICC)
-# define COMPILER_ID "Intel"
-  /* __INTEL_COMPILER = VRP */
-# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
-# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
-# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER    % 10)
-# if defined(__INTEL_COMPILER_BUILD_DATE)
-  /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
-#  define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
-# endif
-
-#elif defined(__PATHCC__)
-# define COMPILER_ID "PathScale"
-# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
-# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
-# if defined(__PATHCC_PATCHLEVEL__)
-#  define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
-# endif
-
-#elif defined(__clang__)
-# define COMPILER_ID "Clang"
-# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
-# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
-# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
-
-#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
-# define COMPILER_ID "Embarcadero"
-# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
-# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
-# define COMPILER_VERSION_PATCH HEX(__CODEGEARC_VERSION__     & 0xFFFF)
-
-#elif defined(__BORLANDC__)
-# define COMPILER_ID "Borland"
-  /* __BORLANDC__ = 0xVRR */
-# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
-# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
-
-#elif defined(__WATCOMC__)
-# define COMPILER_ID "Watcom"
-  /* __WATCOMC__ = VVRR */
-# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
-# define COMPILER_VERSION_MINOR DEC(__WATCOMC__ % 100)
-
-#elif defined(__SUNPRO_C)
-# define COMPILER_ID "SunPro"
-# if __SUNPRO_C >= 0x5100
-   /* __SUNPRO_C = 0xVRRP */
-#  define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12)
-#  define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF)
-#  define COMPILER_VERSION_PATCH HEX(__SUNPRO_C    & 0xF)
-# else
-   /* __SUNPRO_C = 0xVRP */
-#  define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8)
-#  define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF)
-#  define COMPILER_VERSION_PATCH HEX(__SUNPRO_C    & 0xF)
-# endif
-
-#elif defined(__HP_cc)
-# define COMPILER_ID "HP"
-  /* __HP_cc = VVRRPP */
-# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000)
-# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100)
-# define COMPILER_VERSION_PATCH DEC(__HP_cc     % 100)
-
-#elif defined(__DECC)
-# define COMPILER_ID "Compaq"
-  /* __DECC_VER = VVRRTPPPP */
-# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000)
-# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000  % 100)
-# define COMPILER_VERSION_PATCH DEC(__DECC_VER         % 10000)
-
-#elif defined(__IBMC__)
-# if defined(__COMPILER_VER__)
-#  define COMPILER_ID "zOS"
-# else
-#  if __IBMC__ >= 800
-#   define COMPILER_ID "XL"
-#  else
-#   define COMPILER_ID "VisualAge"
-#  endif
-   /* __IBMC__ = VRP */
-#  define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
-#  define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
-#  define COMPILER_VERSION_PATCH DEC(__IBMC__    % 10)
-# endif
-
-#elif defined(__PGI)
-# define COMPILER_ID "PGI"
-# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
-# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
-# if defined(__PGIC_PATCHLEVEL__)
-#  define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
-# endif
-
-#elif defined(_CRAYC)
-# define COMPILER_ID "Cray"
-# define COMPILER_VERSION_MAJOR DEC(_RELEASE)
-# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
-
-#elif defined(__TI_COMPILER_VERSION__)
-# define COMPILER_ID "TI_DSP"
-  /* __TI_COMPILER_VERSION__ = VVVRRRPPP */
-# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
-# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000   % 1000)
-# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__        % 1000)
-
-#elif defined(__TINYC__)
-# define COMPILER_ID "TinyCC"
-
-#elif defined(__SCO_VERSION__)
-# define COMPILER_ID "SCO"
-
-#elif defined(__GNUC__)
-# define COMPILER_ID "GNU"
-# define COMPILER_VERSION_MAJOR DEC(__GNUC__)
-# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
-# if defined(__GNUC_PATCHLEVEL__)
-#  define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
-# endif
-
-#elif defined(_MSC_VER)
-# define COMPILER_ID "MSVC"
-  /* _MSC_VER = VVRR */
-# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
-# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
-# if defined(_MSC_FULL_VER)
-#  if _MSC_VER >= 1400
-    /* _MSC_FULL_VER = VVRRPPPPP */
-#   define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
-#  else
-    /* _MSC_FULL_VER = VVRRPPPP */
-#   define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
-#  endif
-# endif
-# if defined(_MSC_BUILD)
-#  define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
-# endif
-
-/* Analog VisualDSP++ >= 4.5.6 */
-#elif defined(__VISUALDSPVERSION__)
-# define COMPILER_ID "ADSP"
-  /* __VISUALDSPVERSION__ = 0xVVRRPP00 */
-# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24)
-# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF)
-# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8  & 0xFF)
-
-/* Analog VisualDSP++ < 4.5.6 */
-#elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
-# define COMPILER_ID "ADSP"
-
-/* IAR Systems compiler for embedded systems.
-   http://www.iar.com
-   Not supported yet by CMake
-#elif defined(__IAR_SYSTEMS_ICC__)
-# define COMPILER_ID "IAR" */
-
-/* sdcc, the small devices C compiler for embedded systems,
-   http://sdcc.sourceforge.net  */
-#elif defined(SDCC)
-# define COMPILER_ID "SDCC"
-  /* SDCC = VRP */
-#  define COMPILER_VERSION_MAJOR DEC(SDCC/100)
-#  define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10)
-#  define COMPILER_VERSION_PATCH DEC(SDCC    % 10)
-
-#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
-# define COMPILER_ID "MIPSpro"
-# if defined(_SGI_COMPILER_VERSION)
-  /* _SGI_COMPILER_VERSION = VRP */
-#  define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100)
-#  define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10)
-#  define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION    % 10)
-# else
-  /* _COMPILER_VERSION = VRP */
-#  define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100)
-#  define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10)
-#  define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION    % 10)
-# endif
-
-/* This compiler is either not known or is too old to define an
-   identification macro.  Try to identify the platform and guess that
-   it is the native compiler.  */
-#elif defined(__sgi)
-# define COMPILER_ID "MIPSpro"
-
-#elif defined(__hpux) || defined(__hpua)
-# define COMPILER_ID "HP"
-
-#else /* unknown compiler */
-# define COMPILER_ID ""
-
-#endif
-
-/* Construct the string literal in pieces to prevent the source from
-   getting matched.  Store it in a pointer rather than an array
-   because some compilers will just produce instructions to fill the
-   array rather than assigning a pointer to a static array.  */
-char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
-
-/* Identify known platforms by name.  */
-#if defined(__linux) || defined(__linux__) || defined(linux)
-# define PLATFORM_ID "Linux"
-
-#elif defined(__CYGWIN__)
-# define PLATFORM_ID "Cygwin"
-
-#elif defined(__MINGW32__)
-# define PLATFORM_ID "MinGW"
-
-#elif defined(__APPLE__)
-# define PLATFORM_ID "Darwin"
-
-#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
-# define PLATFORM_ID "Windows"
-
-#elif defined(__FreeBSD__) || defined(__FreeBSD)
-# define PLATFORM_ID "FreeBSD"
-
-#elif defined(__NetBSD__) || defined(__NetBSD)
-# define PLATFORM_ID "NetBSD"
-
-#elif defined(__OpenBSD__) || defined(__OPENBSD)
-# define PLATFORM_ID "OpenBSD"
-
-#elif defined(__sun) || defined(sun)
-# define PLATFORM_ID "SunOS"
-
-#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
-# define PLATFORM_ID "AIX"
-
-#elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
-# define PLATFORM_ID "IRIX"
-
-#elif defined(__hpux) || defined(__hpux__)
-# define PLATFORM_ID "HP-UX"
-
-#elif defined(__HAIKU) || defined(__HAIKU__) || defined(_HAIKU)
-# define PLATFORM_ID "Haiku"
-/* Haiku also defines __BEOS__ so we must
-   put it prior to the check for __BEOS__
-*/
-
-#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
-# define PLATFORM_ID "BeOS"
-
-#elif defined(__QNX__) || defined(__QNXNTO__)
-# define PLATFORM_ID "QNX"
-
-#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
-# define PLATFORM_ID "Tru64"
-
-#elif defined(__riscos) || defined(__riscos__)
-# define PLATFORM_ID "RISCos"
-
-#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
-# define PLATFORM_ID "SINIX"
-
-#elif defined(__UNIX_SV__)
-# define PLATFORM_ID "UNIX_SV"
-
-#elif defined(__bsdos__)
-# define PLATFORM_ID "BSDOS"
-
-#elif defined(_MPRAS) || defined(MPRAS)
-# define PLATFORM_ID "MP-RAS"
-
-#elif defined(__osf) || defined(__osf__)
-# define PLATFORM_ID "OSF1"
-
-#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
-# define PLATFORM_ID "SCO_SV"
-
-#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
-# define PLATFORM_ID "ULTRIX"
-
-#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
-# define PLATFORM_ID "Xenix"
-
-#else /* unknown platform */
-# define PLATFORM_ID ""
-
-#endif
-
-/* For windows compilers MSVC and Intel we can determine
-   the architecture of the compiler being used.  This is because
-   the compilers do not have flags that can change the architecture,
-   but rather depend on which compiler is being used
-*/
-#if defined(_WIN32) && defined(_MSC_VER)
-# if defined(_M_IA64)
-#  define ARCHITECTURE_ID "IA64"
-
-# elif defined(_M_X64) || defined(_M_AMD64)
-#  define ARCHITECTURE_ID "x64"
-
-# elif defined(_M_IX86)
-#  define ARCHITECTURE_ID "X86"
-
-# elif defined(_M_ARM)
-#  define ARCHITECTURE_ID "ARM"
-
-# elif defined(_M_MIPS)
-#  define ARCHITECTURE_ID "MIPS"
-
-# elif defined(_M_SH)
-#  define ARCHITECTURE_ID "SHx"
-
-# else /* unknown architecture */
-#  define ARCHITECTURE_ID ""
-# endif
-
-#else
-#  define ARCHITECTURE_ID ""
-#endif
-
-/* Convert integer to decimal digit literals.  */
-#define DEC(n)                   \
-  ('0' + (((n) / 10000000)%10)), \
-  ('0' + (((n) / 1000000)%10)),  \
-  ('0' + (((n) / 100000)%10)),   \
-  ('0' + (((n) / 10000)%10)),    \
-  ('0' + (((n) / 1000)%10)),     \
-  ('0' + (((n) / 100)%10)),      \
-  ('0' + (((n) / 10)%10)),       \
-  ('0' +  ((n) % 10))
-
-/* Convert integer to hex digit literals.  */
-#define HEX(n)             \
-  ('0' + ((n)>>28 & 0xF)), \
-  ('0' + ((n)>>24 & 0xF)), \
-  ('0' + ((n)>>20 & 0xF)), \
-  ('0' + ((n)>>16 & 0xF)), \
-  ('0' + ((n)>>12 & 0xF)), \
-  ('0' + ((n)>>8  & 0xF)), \
-  ('0' + ((n)>>4  & 0xF)), \
-  ('0' + ((n)     & 0xF))
-
-/* Construct a string literal encoding the version number components. */
-#ifdef COMPILER_VERSION_MAJOR
-char const info_version[] = {
-  'I', 'N', 'F', 'O', ':',
-  'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
-  COMPILER_VERSION_MAJOR,
-# ifdef COMPILER_VERSION_MINOR
-  '.', COMPILER_VERSION_MINOR,
-#  ifdef COMPILER_VERSION_PATCH
-   '.', COMPILER_VERSION_PATCH,
-#   ifdef COMPILER_VERSION_TWEAK
-    '.', COMPILER_VERSION_TWEAK,
-#   endif
-#  endif
-# endif
-  ']','\0'};
-#endif
-
-/* Construct the string literal in pieces to prevent the source from
-   getting matched.  Store it in a pointer rather than an array
-   because some compilers will just produce instructions to fill the
-   array rather than assigning a pointer to a static array.  */
-char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
-char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
-
-
-
-/*--------------------------------------------------------------------------*/
-
-#ifdef ID_VOID_MAIN
-void main() {}
-#else
-int main(int argc, char* argv[])
-{
-  int require = 0;
-  require += info_compiler[argc];
-  require += info_platform[argc];
-  require += info_arch[argc];
-#ifdef COMPILER_VERSION_MAJOR
-  require += info_version[argc];
-#endif
-  (void)argv;
-  return require;
-}
-#endif
diff --git a/CMakeFiles/2.8.10.2/CompilerIdCXX/CMakeCXXCompilerId.cpp b/CMakeFiles/2.8.10.2/CompilerIdCXX/CMakeCXXCompilerId.cpp
deleted file mode 100644
index 0d13d64..0000000
--- a/CMakeFiles/2.8.10.2/CompilerIdCXX/CMakeCXXCompilerId.cpp
+++ /dev/null
@@ -1,375 +0,0 @@
-/* This source file must have a .cpp extension so that all C++ compilers
-   recognize the extension without flags.  Borland does not know .cxx for
-   example.  */
-#ifndef __cplusplus
-# error "A C compiler has been selected for C++."
-#endif
-
-/* Version number components: V=Version, R=Revision, P=Patch
-   Version date components:   YYYY=Year, MM=Month,   DD=Day  */
-
-#if defined(__COMO__)
-# define COMPILER_ID "Comeau"
-  /* __COMO_VERSION__ = VRR */
-# define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100)
-# define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100)
-
-#elif defined(__INTEL_COMPILER) || defined(__ICC)
-# define COMPILER_ID "Intel"
-  /* __INTEL_COMPILER = VRP */
-# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
-# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
-# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER    % 10)
-# if defined(__INTEL_COMPILER_BUILD_DATE)
-  /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
-#  define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
-# endif
-
-#elif defined(__PATHCC__)
-# define COMPILER_ID "PathScale"
-# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
-# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
-# if defined(__PATHCC_PATCHLEVEL__)
-#  define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
-# endif
-
-#elif defined(__clang__)
-# define COMPILER_ID "Clang"
-# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
-# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
-# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
-
-#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
-# define COMPILER_ID "Embarcadero"
-# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
-# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
-# define COMPILER_VERSION_PATCH HEX(__CODEGEARC_VERSION__     & 0xFFFF)
-
-#elif defined(__BORLANDC__)
-# define COMPILER_ID "Borland"
-  /* __BORLANDC__ = 0xVRR */
-# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
-# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
-
-#elif defined(__WATCOMC__)
-# define COMPILER_ID "Watcom"
-  /* __WATCOMC__ = VVRR */
-# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
-# define COMPILER_VERSION_MINOR DEC(__WATCOMC__ % 100)
-
-#elif defined(__SUNPRO_CC)
-# define COMPILER_ID "SunPro"
-# if __SUNPRO_CC >= 0x5100
-   /* __SUNPRO_CC = 0xVRRP */
-#  define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12)
-#  define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF)
-#  define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC    & 0xF)
-# else
-   /* __SUNPRO_CC = 0xVRP */
-#  define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8)
-#  define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF)
-#  define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC    & 0xF)
-# endif
-
-#elif defined(__HP_aCC)
-# define COMPILER_ID "HP"
-  /* __HP_aCC = VVRRPP */
-# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000)
-# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100)
-# define COMPILER_VERSION_PATCH DEC(__HP_aCC     % 100)
-
-#elif defined(__DECCXX)
-# define COMPILER_ID "Compaq"
-  /* __DECCXX_VER = VVRRTPPPP */
-# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000)
-# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000  % 100)
-# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER         % 10000)
-
-#elif defined(__IBMCPP__)
-# if defined(__COMPILER_VER__)
-#  define COMPILER_ID "zOS"
-# else
-#  if __IBMCPP__ >= 800
-#   define COMPILER_ID "XL"
-#  else
-#   define COMPILER_ID "VisualAge"
-#  endif
-   /* __IBMCPP__ = VRP */
-#  define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
-#  define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
-#  define COMPILER_VERSION_PATCH DEC(__IBMCPP__    % 10)
-# endif
-
-#elif defined(__PGI)
-# define COMPILER_ID "PGI"
-# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
-# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
-# if defined(__PGIC_PATCHLEVEL__)
-#  define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
-# endif
-
-#elif defined(_CRAYC)
-# define COMPILER_ID "Cray"
-# define COMPILER_VERSION_MAJOR DEC(_RELEASE)
-# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
-
-#elif defined(__TI_COMPILER_VERSION__)
-# define COMPILER_ID "TI_DSP"
-  /* __TI_COMPILER_VERSION__ = VVVRRRPPP */
-# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
-# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000   % 1000)
-# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__        % 1000)
-
-#elif defined(__SCO_VERSION__)
-# define COMPILER_ID "SCO"
-
-#elif defined(__GNUC__)
-# define COMPILER_ID "GNU"
-# define COMPILER_VERSION_MAJOR DEC(__GNUC__)
-# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
-# if defined(__GNUC_PATCHLEVEL__)
-#  define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
-# endif
-
-#elif defined(_MSC_VER)
-# define COMPILER_ID "MSVC"
-  /* _MSC_VER = VVRR */
-# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
-# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
-# if defined(_MSC_FULL_VER)
-#  if _MSC_VER >= 1400
-    /* _MSC_FULL_VER = VVRRPPPPP */
-#   define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
-#  else
-    /* _MSC_FULL_VER = VVRRPPPP */
-#   define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
-#  endif
-# endif
-# if defined(_MSC_BUILD)
-#  define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
-# endif
-
-/* Analog VisualDSP++ >= 4.5.6 */
-#elif defined(__VISUALDSPVERSION__)
-# define COMPILER_ID "ADSP"
-  /* __VISUALDSPVERSION__ = 0xVVRRPP00 */
-# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24)
-# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF)
-# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8  & 0xFF)
-
-/* Analog VisualDSP++ < 4.5.6 */
-#elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
-# define COMPILER_ID "ADSP"
-
-#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
-# define COMPILER_ID "MIPSpro"
-# if defined(_SGI_COMPILER_VERSION)
-  /* _SGI_COMPILER_VERSION = VRP */
-#  define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100)
-#  define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10)
-#  define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION    % 10)
-# else
-  /* _COMPILER_VERSION = VRP */
-#  define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100)
-#  define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10)
-#  define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION    % 10)
-# endif
-
-/* This compiler is either not known or is too old to define an
-   identification macro.  Try to identify the platform and guess that
-   it is the native compiler.  */
-#elif defined(__sgi)
-# define COMPILER_ID "MIPSpro"
-
-#elif defined(__hpux) || defined(__hpua)
-# define COMPILER_ID "HP"
-
-#else /* unknown compiler */
-# define COMPILER_ID ""
-
-#endif
-
-/* Construct the string literal in pieces to prevent the source from
-   getting matched.  Store it in a pointer rather than an array
-   because some compilers will just produce instructions to fill the
-   array rather than assigning a pointer to a static array.  */
-char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
-
-/* Identify known platforms by name.  */
-#if defined(__linux) || defined(__linux__) || defined(linux)
-# define PLATFORM_ID "Linux"
-
-#elif defined(__CYGWIN__)
-# define PLATFORM_ID "Cygwin"
-
-#elif defined(__MINGW32__)
-# define PLATFORM_ID "MinGW"
-
-#elif defined(__APPLE__)
-# define PLATFORM_ID "Darwin"
-
-#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
-# define PLATFORM_ID "Windows"
-
-#elif defined(__FreeBSD__) || defined(__FreeBSD)
-# define PLATFORM_ID "FreeBSD"
-
-#elif defined(__NetBSD__) || defined(__NetBSD)
-# define PLATFORM_ID "NetBSD"
-
-#elif defined(__OpenBSD__) || defined(__OPENBSD)
-# define PLATFORM_ID "OpenBSD"
-
-#elif defined(__sun) || defined(sun)
-# define PLATFORM_ID "SunOS"
-
-#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
-# define PLATFORM_ID "AIX"
-
-#elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
-# define PLATFORM_ID "IRIX"
-
-#elif defined(__hpux) || defined(__hpux__)
-# define PLATFORM_ID "HP-UX"
-
-#elif defined(__HAIKU) || defined(__HAIKU__) || defined(_HAIKU)
-# define PLATFORM_ID "Haiku"
-/* Haiku also defines __BEOS__ so we must
-   put it prior to the check for __BEOS__
-*/
-
-#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
-# define PLATFORM_ID "BeOS"
-
-#elif defined(__QNX__) || defined(__QNXNTO__)
-# define PLATFORM_ID "QNX"
-
-#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
-# define PLATFORM_ID "Tru64"
-
-#elif defined(__riscos) || defined(__riscos__)
-# define PLATFORM_ID "RISCos"
-
-#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
-# define PLATFORM_ID "SINIX"
-
-#elif defined(__UNIX_SV__)
-# define PLATFORM_ID "UNIX_SV"
-
-#elif defined(__bsdos__)
-# define PLATFORM_ID "BSDOS"
-
-#elif defined(_MPRAS) || defined(MPRAS)
-# define PLATFORM_ID "MP-RAS"
-
-#elif defined(__osf) || defined(__osf__)
-# define PLATFORM_ID "OSF1"
-
-#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
-# define PLATFORM_ID "SCO_SV"
-
-#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
-# define PLATFORM_ID "ULTRIX"
-
-#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
-# define PLATFORM_ID "Xenix"
-
-#else /* unknown platform */
-# define PLATFORM_ID ""
-
-#endif
-
-/* For windows compilers MSVC and Intel we can determine
-   the architecture of the compiler being used.  This is because
-   the compilers do not have flags that can change the architecture,
-   but rather depend on which compiler is being used
-*/
-#if defined(_WIN32) && defined(_MSC_VER)
-# if defined(_M_IA64)
-#  define ARCHITECTURE_ID "IA64"
-
-# elif defined(_M_X64) || defined(_M_AMD64)
-#  define ARCHITECTURE_ID "x64"
-
-# elif defined(_M_IX86)
-#  define ARCHITECTURE_ID "X86"
-
-# elif defined(_M_ARM)
-#  define ARCHITECTURE_ID "ARM"
-
-# elif defined(_M_MIPS)
-#  define ARCHITECTURE_ID "MIPS"
-
-# elif defined(_M_SH)
-#  define ARCHITECTURE_ID "SHx"
-
-# else /* unknown architecture */
-#  define ARCHITECTURE_ID ""
-# endif
-
-#else
-#  define ARCHITECTURE_ID ""
-#endif
-
-/* Convert integer to decimal digit literals.  */
-#define DEC(n)                   \
-  ('0' + (((n) / 10000000)%10)), \
-  ('0' + (((n) / 1000000)%10)),  \
-  ('0' + (((n) / 100000)%10)),   \
-  ('0' + (((n) / 10000)%10)),    \
-  ('0' + (((n) / 1000)%10)),     \
-  ('0' + (((n) / 100)%10)),      \
-  ('0' + (((n) / 10)%10)),       \
-  ('0' +  ((n) % 10))
-
-/* Convert integer to hex digit literals.  */
-#define HEX(n)             \
-  ('0' + ((n)>>28 & 0xF)), \
-  ('0' + ((n)>>24 & 0xF)), \
-  ('0' + ((n)>>20 & 0xF)), \
-  ('0' + ((n)>>16 & 0xF)), \
-  ('0' + ((n)>>12 & 0xF)), \
-  ('0' + ((n)>>8  & 0xF)), \
-  ('0' + ((n)>>4  & 0xF)), \
-  ('0' + ((n)     & 0xF))
-
-/* Construct a string literal encoding the version number components. */
-#ifdef COMPILER_VERSION_MAJOR
-char const info_version[] = {
-  'I', 'N', 'F', 'O', ':',
-  'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
-  COMPILER_VERSION_MAJOR,
-# ifdef COMPILER_VERSION_MINOR
-  '.', COMPILER_VERSION_MINOR,
-#  ifdef COMPILER_VERSION_PATCH
-   '.', COMPILER_VERSION_PATCH,
-#   ifdef COMPILER_VERSION_TWEAK
-    '.', COMPILER_VERSION_TWEAK,
-#   endif
-#  endif
-# endif
-  ']','\0'};
-#endif
-
-/* Construct the string literal in pieces to prevent the source from
-   getting matched.  Store it in a pointer rather than an array
-   because some compilers will just produce instructions to fill the
-   array rather than assigning a pointer to a static array.  */
-char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
-char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
-
-
-
-/*--------------------------------------------------------------------------*/
-
-int main(int argc, char* argv[])
-{
-  int require = 0;
-  require += info_compiler[argc];
-  require += info_platform[argc];
-#ifdef COMPILER_VERSION_MAJOR
-  require += info_version[argc];
-#endif
-  (void)argv;
-  return require;
-}
diff --git a/CMakeFiles/2.8.10.2/CompilerIdFortran/CMakeFortranCompilerId.F b/CMakeFiles/2.8.10.2/CompilerIdFortran/CMakeFortranCompilerId.F
deleted file mode 100644
index 4d25de0..0000000
--- a/CMakeFiles/2.8.10.2/CompilerIdFortran/CMakeFortranCompilerId.F
+++ /dev/null
@@ -1,123 +0,0 @@
-      PROGRAM CMakeFortranCompilerId
-#if 0
-! Identify the compiler
-#endif
-#if defined(__INTEL_COMPILER) || defined(__ICC)
-        PRINT *, 'INFO:compiler[Intel]'
-#elif defined(__SUNPRO_F90) || defined(__SUNPRO_F95)
-        PRINT *, 'INFO:compiler[SunPro]'
-#elif defined(_CRAYFTN)
-        PRINT *, 'INFO:compiler[Cray]'
-#elif defined(__G95__)
-        PRINT *, 'INFO:compiler[G95]'
-#elif defined(__PATHSCALE__)
-        PRINT *, 'INFO:compiler[PathScale]'
-#elif defined(__ABSOFT__)
-        PRINT *, 'INFO:compiler[Absoft]'
-#elif defined(__GNUC__)
-        PRINT *, 'INFO:compiler[GNU]'
-#elif defined(__IBMC__)
-# if defined(__COMPILER_VER__)
-        PRINT *, 'INFO:compiler[zOS]'
-# elif __IBMC__ >= 800
-        PRINT *, 'INFO:compiler[XL]'
-# else
-        PRINT *, 'INFO:compiler[VisualAge]'
-# endif
-#elif defined(__PGI)
-        PRINT *, 'INFO:compiler[PGI]'
-#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
-        PRINT *, 'INFO:compiler[MIPSpro]'
-#       if 0
-!       This compiler is either not known or is too old to define an
-!       identification macro.  Try to identify the platform and guess that
-!       it is the native compiler.
-#       endif
-#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
-        PRINT *, 'INFO:compiler[VisualAge]'
-#elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
-        PRINT *, 'INFO:compiler[MIPSpro]'
-#elif defined(__hpux) || defined(__hpux__)
-        PRINT *, 'INFO:compiler[HP]'
-#elif 1
-#       if 0
-!       The above 'elif 1' instead of 'else' is to work around a bug in the
-!       SGI preprocessor which produces both the __sgi and else blocks.
-#       endif
-        PRINT *, 'INFO:compiler[]'
-#endif
-
-#if 0
-! Identify the platform
-#endif
-#if defined(__linux) || defined(__linux__) || defined(linux)
-        PRINT *, 'INFO:platform[Linux]'
-#elif defined(__CYGWIN__)
-        PRINT *, 'INFO:platform[Cygwin]'
-#elif defined(__MINGW32__)
-        PRINT *, 'INFO:platform[MinGW]'
-#elif defined(__APPLE__)
-        PRINT *, 'INFO:platform[Darwin]'
-#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
-        PRINT *, 'INFO:platform[Windows]'
-#elif defined(__FreeBSD__) || defined(__FreeBSD)
-        PRINT *, 'INFO:platform[FreeBSD]'
-#elif defined(__NetBSD__) || defined(__NetBSD)
-        PRINT *, 'INFO:platform[NetBSD]'
-#elif defined(__OpenBSD__) || defined(__OPENBSD)
-        PRINT *, 'INFO:platform[OpenBSD]'
-#elif defined(__sun) || defined(sun)
-        PRINT *, 'INFO:platform[SunOS]'
-#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
-        PRINT *, 'INFO:platform[AIX]'
-#elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
-        PRINT *, 'INFO:platform[IRIX]'
-#elif defined(__hpux) || defined(__hpux__)
-        PRINT *, 'INFO:platform[HP-UX]'
-#elif defined(__HAIKU) || defined(__HAIKU__) || defined(_HAIKU)
-        PRINT *, 'INFO:platform[Haiku]'
-#       if 0
-!       Haiku also defines __BEOS__ so we must
-!       put it prior to the check for __BEOS__
-#       endif
-#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
-        PRINT *, 'INFO:platform[BeOS]'
-#elif defined(__QNX__) || defined(__QNXNTO__)
-        PRINT *, 'INFO:platform[QNX]'
-#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
-        PRINT *, 'INFO:platform[Tru64]'
-#elif defined(__riscos) || defined(__riscos__)
-        PRINT *, 'INFO:platform[RISCos]'
-#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
-        PRINT *, 'INFO:platform[SINIX]'
-#elif defined(__UNIX_SV__)
-        PRINT *, 'INFO:platform[UNIX_SV]'
-#elif defined(__bsdos__)
-        PRINT *, 'INFO:platform[BSDOS]'
-#elif defined(_MPRAS) || defined(MPRAS)
-        PRINT *, 'INFO:platform[MP-RAS]'
-#elif defined(__osf) || defined(__osf__)
-        PRINT *, 'INFO:platform[OSF1]'
-#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
-        PRINT *, 'INFO:platform[SCO_SV]'
-#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
-        PRINT *, 'INFO:platform[ULTRIX]'
-#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
-        PRINT *, 'INFO:platform[Xenix]'
-#elif 1
-#       if 0
-!       The above 'elif 1' instead of 'else' is to work around a bug in the
-!       SGI preprocessor which produces both the __sgi and else blocks.
-#       endif
-        PRINT *, 'INFO:platform[]'
-#endif
-#if defined(_WIN32) && (defined(__INTEL_COMPILER) || defined(__ICC))
-# if defined(_M_IA64)
-        PRINT *, 'INFO:arch[IA64]'
-# elif defined(_M_X64) || defined(_M_AMD64)
-        PRINT *, 'INFO:arch[x64]'
-# elif defined(_M_IX86)
-        PRINT *, 'INFO:arch[X86]'
-# endif
-#endif
-      END
diff --git a/CMakeFiles/2.8.11.2/CMakeCCompiler.cmake b/CMakeFiles/2.8.11.2/CMakeCCompiler.cmake
deleted file mode 100644
index a4ea959..0000000
--- a/CMakeFiles/2.8.11.2/CMakeCCompiler.cmake
+++ /dev/null
@@ -1,56 +0,0 @@
-set(CMAKE_C_COMPILER "/usr/bin/cc")
-set(CMAKE_C_COMPILER_ARG1 "")
-set(CMAKE_C_COMPILER_ID "GNU")
-set(CMAKE_C_COMPILER_VERSION "4.3.4")
-set(CMAKE_C_PLATFORM_ID "Linux")
-
-set(CMAKE_AR "/usr/bin/ar")
-set(CMAKE_RANLIB "/usr/bin/ranlib")
-set(CMAKE_LINKER "/usr/bin/ld")
-set(CMAKE_COMPILER_IS_GNUCC 1)
-set(CMAKE_C_COMPILER_LOADED 1)
-set(CMAKE_C_COMPILER_WORKS TRUE)
-set(CMAKE_C_ABI_COMPILED TRUE)
-set(CMAKE_COMPILER_IS_MINGW )
-set(CMAKE_COMPILER_IS_CYGWIN )
-if(CMAKE_COMPILER_IS_CYGWIN)
-  set(CYGWIN 1)
-  set(UNIX 1)
-endif()
-
-set(CMAKE_C_COMPILER_ENV_VAR "CC")
-
-if(CMAKE_COMPILER_IS_MINGW)
-  set(MINGW 1)
-endif()
-set(CMAKE_C_COMPILER_ID_RUN 1)
-set(CMAKE_C_SOURCE_FILE_EXTENSIONS c)
-set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
-set(CMAKE_C_LINKER_PREFERENCE 10)
-
-# Save compiler ABI information.
-set(CMAKE_C_SIZEOF_DATA_PTR "8")
-set(CMAKE_C_COMPILER_ABI "ELF")
-set(CMAKE_C_LIBRARY_ARCHITECTURE "")
-
-if(CMAKE_C_SIZEOF_DATA_PTR)
-  set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}")
-endif()
-
-if(CMAKE_C_COMPILER_ABI)
-  set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}")
-endif()
-
-if(CMAKE_C_LIBRARY_ARCHITECTURE)
-  set(CMAKE_LIBRARY_ARCHITECTURE "")
-endif()
-
-
-
-
-set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "c")
-set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/usr/lib64/gcc/x86_64-suse-linux/4.3;/usr/lib64;/lib64;/usr/x86_64-suse-linux/lib")
-set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "")
-
-
-
diff --git a/CMakeFiles/2.8.11.2/CMakeCXXCompiler.cmake b/CMakeFiles/2.8.11.2/CMakeCXXCompiler.cmake
deleted file mode 100644
index 14bf571..0000000
--- a/CMakeFiles/2.8.11.2/CMakeCXXCompiler.cmake
+++ /dev/null
@@ -1,57 +0,0 @@
-set(CMAKE_CXX_COMPILER "/usr/bin/c++")
-set(CMAKE_CXX_COMPILER_ARG1 "")
-set(CMAKE_CXX_COMPILER_ID "GNU")
-set(CMAKE_CXX_COMPILER_VERSION "4.3.4")
-set(CMAKE_CXX_PLATFORM_ID "Linux")
-
-set(CMAKE_AR "/usr/bin/ar")
-set(CMAKE_RANLIB "/usr/bin/ranlib")
-set(CMAKE_LINKER "/usr/bin/ld")
-set(CMAKE_COMPILER_IS_GNUCXX 1)
-set(CMAKE_CXX_COMPILER_LOADED 1)
-set(CMAKE_CXX_COMPILER_WORKS TRUE)
-set(CMAKE_CXX_ABI_COMPILED TRUE)
-set(CMAKE_COMPILER_IS_MINGW )
-set(CMAKE_COMPILER_IS_CYGWIN )
-if(CMAKE_COMPILER_IS_CYGWIN)
-  set(CYGWIN 1)
-  set(UNIX 1)
-endif()
-
-set(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
-
-if(CMAKE_COMPILER_IS_MINGW)
-  set(MINGW 1)
-endif()
-set(CMAKE_CXX_COMPILER_ID_RUN 1)
-set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC)
-set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP)
-set(CMAKE_CXX_LINKER_PREFERENCE 30)
-set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1)
-
-# Save compiler ABI information.
-set(CMAKE_CXX_SIZEOF_DATA_PTR "8")
-set(CMAKE_CXX_COMPILER_ABI "ELF")
-set(CMAKE_CXX_LIBRARY_ARCHITECTURE "")
-
-if(CMAKE_CXX_SIZEOF_DATA_PTR)
-  set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}")
-endif()
-
-if(CMAKE_CXX_COMPILER_ABI)
-  set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}")
-endif()
-
-if(CMAKE_CXX_LIBRARY_ARCHITECTURE)
-  set(CMAKE_LIBRARY_ARCHITECTURE "")
-endif()
-
-
-
-
-set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;m;c")
-set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/usr/lib64/gcc/x86_64-suse-linux/4.3;/usr/lib64;/lib64;/usr/x86_64-suse-linux/lib")
-set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "")
-
-
-
diff --git a/CMakeFiles/2.8.11.2/CMakeDetermineCompilerABI_C.bin b/CMakeFiles/2.8.11.2/CMakeDetermineCompilerABI_C.bin
deleted file mode 100755
index 8109d82..0000000
Binary files a/CMakeFiles/2.8.11.2/CMakeDetermineCompilerABI_C.bin and /dev/null differ
diff --git a/CMakeFiles/2.8.11.2/CMakeDetermineCompilerABI_CXX.bin b/CMakeFiles/2.8.11.2/CMakeDetermineCompilerABI_CXX.bin
deleted file mode 100755
index 2e078ce..0000000
Binary files a/CMakeFiles/2.8.11.2/CMakeDetermineCompilerABI_CXX.bin and /dev/null differ
diff --git a/CMakeFiles/2.8.11.2/CMakeDetermineCompilerABI_Fortran.bin b/CMakeFiles/2.8.11.2/CMakeDetermineCompilerABI_Fortran.bin
deleted file mode 100755
index f75cf65..0000000
Binary files a/CMakeFiles/2.8.11.2/CMakeDetermineCompilerABI_Fortran.bin and /dev/null differ
diff --git a/CMakeFiles/2.8.11.2/CMakeFortranCompiler.cmake b/CMakeFiles/2.8.11.2/CMakeFortranCompiler.cmake
deleted file mode 100644
index 397d155..0000000
--- a/CMakeFiles/2.8.11.2/CMakeFortranCompiler.cmake
+++ /dev/null
@@ -1,55 +0,0 @@
-set(CMAKE_Fortran_COMPILER "/usr/bin/gfortran")
-set(CMAKE_Fortran_COMPILER_ARG1 "")
-set(CMAKE_Fortran_COMPILER_ID "GNU")
-set(CMAKE_Fortran_PLATFORM_ID "Linux")
-
-set(CMAKE_AR "/usr/bin/ar")
-set(CMAKE_RANLIB "/usr/bin/ranlib")
-set(CMAKE_COMPILER_IS_GNUG77 1)
-set(CMAKE_Fortran_COMPILER_LOADED 1)
-set(CMAKE_Fortran_COMPILER_WORKS TRUE)
-set(CMAKE_Fortran_ABI_COMPILED TRUE)
-set(CMAKE_COMPILER_IS_MINGW )
-set(CMAKE_COMPILER_IS_CYGWIN )
-if(CMAKE_COMPILER_IS_CYGWIN)
-  set(CYGWIN 1)
-  set(UNIX 1)
-endif()
-
-set(CMAKE_Fortran_COMPILER_ENV_VAR "FC")
-
-set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 1)
-
-if(CMAKE_COMPILER_IS_MINGW)
-  set(MINGW 1)
-endif()
-set(CMAKE_Fortran_COMPILER_ID_RUN 1)
-set(CMAKE_Fortran_SOURCE_FILE_EXTENSIONS f;F;f77;F77;f90;F90;for;For;FOR;f95;F95)
-set(CMAKE_Fortran_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
-set(CMAKE_Fortran_LINKER_PREFERENCE 20)
-if(UNIX)
-  set(CMAKE_Fortran_OUTPUT_EXTENSION .o)
-else()
-  set(CMAKE_Fortran_OUTPUT_EXTENSION .obj)
-endif()
-
-# Save compiler ABI information.
-set(CMAKE_Fortran_SIZEOF_DATA_PTR "8")
-set(CMAKE_Fortran_COMPILER_ABI "ELF")
-set(CMAKE_Fortran_LIBRARY_ARCHITECTURE "")
-
-if(CMAKE_Fortran_SIZEOF_DATA_PTR AND NOT CMAKE_SIZEOF_VOID_P)
-  set(CMAKE_SIZEOF_VOID_P "${CMAKE_Fortran_SIZEOF_DATA_PTR}")
-endif()
-
-if(CMAKE_Fortran_COMPILER_ABI)
-  set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_Fortran_COMPILER_ABI}")
-endif()
-
-if(CMAKE_Fortran_LIBRARY_ARCHITECTURE)
-  set(CMAKE_LIBRARY_ARCHITECTURE "")
-endif()
-
-set(CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES "gfortranbegin;gfortran;m;c")
-set(CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES "/usr/lib64/gcc/x86_64-suse-linux/4.3;/usr/lib64;/lib64;/usr/x86_64-suse-linux/lib")
-set(CMAKE_Fortran_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "")
diff --git a/CMakeFiles/2.8.11.2/CMakeSystem.cmake b/CMakeFiles/2.8.11.2/CMakeSystem.cmake
deleted file mode 100644
index 77f4db6..0000000
--- a/CMakeFiles/2.8.11.2/CMakeSystem.cmake
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-set(CMAKE_SYSTEM "Linux-3.0.76-0.11-default")
-set(CMAKE_SYSTEM_NAME "Linux")
-set(CMAKE_SYSTEM_VERSION "3.0.76-0.11-default")
-set(CMAKE_SYSTEM_PROCESSOR "x86_64")
-
-set(CMAKE_HOST_SYSTEM "Linux-3.0.76-0.11-default")
-set(CMAKE_HOST_SYSTEM_NAME "Linux")
-set(CMAKE_HOST_SYSTEM_VERSION "3.0.76-0.11-default")
-set(CMAKE_HOST_SYSTEM_PROCESSOR "x86_64")
-
-set(CMAKE_CROSSCOMPILING "FALSE")
-
-set(CMAKE_SYSTEM_LOADED 1)
diff --git a/CMakeFiles/2.8.11.2/CompilerIdC/CMakeCCompilerId.c b/CMakeFiles/2.8.11.2/CompilerIdC/CMakeCCompilerId.c
deleted file mode 100644
index 458affc..0000000
--- a/CMakeFiles/2.8.11.2/CompilerIdC/CMakeCCompilerId.c
+++ /dev/null
@@ -1,390 +0,0 @@
-#ifdef __cplusplus
-# error "A C++ compiler has been selected for C."
-#endif
-
-/* Version number components: V=Version, R=Revision, P=Patch
-   Version date components:   YYYY=Year, MM=Month,   DD=Day  */
-
-#if defined(__18CXX)
-# define ID_VOID_MAIN
-#endif
-
-#if defined(__INTEL_COMPILER) || defined(__ICC)
-# define COMPILER_ID "Intel"
-  /* __INTEL_COMPILER = VRP */
-# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
-# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
-# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER    % 10)
-# if defined(__INTEL_COMPILER_BUILD_DATE)
-  /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
-#  define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
-# endif
-
-#elif defined(__PATHCC__)
-# define COMPILER_ID "PathScale"
-# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
-# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
-# if defined(__PATHCC_PATCHLEVEL__)
-#  define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
-# endif
-
-#elif defined(__clang__)
-# define COMPILER_ID "Clang"
-# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
-# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
-# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
-
-#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
-# define COMPILER_ID "Embarcadero"
-# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
-# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
-# define COMPILER_VERSION_PATCH HEX(__CODEGEARC_VERSION__     & 0xFFFF)
-
-#elif defined(__BORLANDC__)
-# define COMPILER_ID "Borland"
-  /* __BORLANDC__ = 0xVRR */
-# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
-# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
-
-#elif defined(__WATCOMC__)
-# define COMPILER_ID "Watcom"
-  /* __WATCOMC__ = VVRR */
-# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
-# define COMPILER_VERSION_MINOR DEC(__WATCOMC__ % 100)
-
-#elif defined(__SUNPRO_C)
-# define COMPILER_ID "SunPro"
-# if __SUNPRO_C >= 0x5100
-   /* __SUNPRO_C = 0xVRRP */
-#  define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12)
-#  define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF)
-#  define COMPILER_VERSION_PATCH HEX(__SUNPRO_C    & 0xF)
-# else
-   /* __SUNPRO_C = 0xVRP */
-#  define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8)
-#  define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF)
-#  define COMPILER_VERSION_PATCH HEX(__SUNPRO_C    & 0xF)
-# endif
-
-#elif defined(__HP_cc)
-# define COMPILER_ID "HP"
-  /* __HP_cc = VVRRPP */
-# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000)
-# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100)
-# define COMPILER_VERSION_PATCH DEC(__HP_cc     % 100)
-
-#elif defined(__DECC)
-# define COMPILER_ID "Compaq"
-  /* __DECC_VER = VVRRTPPPP */
-# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000)
-# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000  % 100)
-# define COMPILER_VERSION_PATCH DEC(__DECC_VER         % 10000)
-
-#elif defined(__IBMC__)
-# if defined(__COMPILER_VER__)
-#  define COMPILER_ID "zOS"
-# else
-#  if __IBMC__ >= 800
-#   define COMPILER_ID "XL"
-#  else
-#   define COMPILER_ID "VisualAge"
-#  endif
-   /* __IBMC__ = VRP */
-#  define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
-#  define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
-#  define COMPILER_VERSION_PATCH DEC(__IBMC__    % 10)
-# endif
-
-#elif defined(__PGI)
-# define COMPILER_ID "PGI"
-# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
-# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
-# if defined(__PGIC_PATCHLEVEL__)
-#  define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
-# endif
-
-#elif defined(_CRAYC)
-# define COMPILER_ID "Cray"
-# define COMPILER_VERSION_MAJOR DEC(_RELEASE)
-# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
-
-#elif defined(__TI_COMPILER_VERSION__)
-# define COMPILER_ID "TI"
-  /* __TI_COMPILER_VERSION__ = VVVRRRPPP */
-# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
-# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000   % 1000)
-# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__        % 1000)
-
-#elif defined(__TINYC__)
-# define COMPILER_ID "TinyCC"
-
-#elif defined(__SCO_VERSION__)
-# define COMPILER_ID "SCO"
-
-#elif defined(__GNUC__)
-# define COMPILER_ID "GNU"
-# define COMPILER_VERSION_MAJOR DEC(__GNUC__)
-# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
-# if defined(__GNUC_PATCHLEVEL__)
-#  define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
-# endif
-
-#elif defined(_MSC_VER)
-# define COMPILER_ID "MSVC"
-  /* _MSC_VER = VVRR */
-# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
-# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
-# if defined(_MSC_FULL_VER)
-#  if _MSC_VER >= 1400
-    /* _MSC_FULL_VER = VVRRPPPPP */
-#   define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
-#  else
-    /* _MSC_FULL_VER = VVRRPPPP */
-#   define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
-#  endif
-# endif
-# if defined(_MSC_BUILD)
-#  define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
-# endif
-
-/* Analog VisualDSP++ >= 4.5.6 */
-#elif defined(__VISUALDSPVERSION__)
-# define COMPILER_ID "ADSP"
-  /* __VISUALDSPVERSION__ = 0xVVRRPP00 */
-# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24)
-# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF)
-# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8  & 0xFF)
-
-/* Analog VisualDSP++ < 4.5.6 */
-#elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
-# define COMPILER_ID "ADSP"
-
-/* IAR Systems compiler for embedded systems.
-   http://www.iar.com
-   Not supported yet by CMake
-#elif defined(__IAR_SYSTEMS_ICC__)
-# define COMPILER_ID "IAR" */
-
-/* sdcc, the small devices C compiler for embedded systems,
-   http://sdcc.sourceforge.net  */
-#elif defined(SDCC)
-# define COMPILER_ID "SDCC"
-  /* SDCC = VRP */
-#  define COMPILER_VERSION_MAJOR DEC(SDCC/100)
-#  define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10)
-#  define COMPILER_VERSION_PATCH DEC(SDCC    % 10)
-
-#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
-# define COMPILER_ID "MIPSpro"
-# if defined(_SGI_COMPILER_VERSION)
-  /* _SGI_COMPILER_VERSION = VRP */
-#  define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100)
-#  define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10)
-#  define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION    % 10)
-# else
-  /* _COMPILER_VERSION = VRP */
-#  define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100)
-#  define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10)
-#  define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION    % 10)
-# endif
-
-/* This compiler is either not known or is too old to define an
-   identification macro.  Try to identify the platform and guess that
-   it is the native compiler.  */
-#elif defined(__sgi)
-# define COMPILER_ID "MIPSpro"
-
-#elif defined(__hpux) || defined(__hpua)
-# define COMPILER_ID "HP"
-
-#else /* unknown compiler */
-# define COMPILER_ID ""
-
-#endif
-
-/* Construct the string literal in pieces to prevent the source from
-   getting matched.  Store it in a pointer rather than an array
-   because some compilers will just produce instructions to fill the
-   array rather than assigning a pointer to a static array.  */
-char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
-
-/* Identify known platforms by name.  */
-#if defined(__linux) || defined(__linux__) || defined(linux)
-# define PLATFORM_ID "Linux"
-
-#elif defined(__CYGWIN__)
-# define PLATFORM_ID "Cygwin"
-
-#elif defined(__MINGW32__)
-# define PLATFORM_ID "MinGW"
-
-#elif defined(__APPLE__)
-# define PLATFORM_ID "Darwin"
-
-#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
-# define PLATFORM_ID "Windows"
-
-#elif defined(__FreeBSD__) || defined(__FreeBSD)
-# define PLATFORM_ID "FreeBSD"
-
-#elif defined(__NetBSD__) || defined(__NetBSD)
-# define PLATFORM_ID "NetBSD"
-
-#elif defined(__OpenBSD__) || defined(__OPENBSD)
-# define PLATFORM_ID "OpenBSD"
-
-#elif defined(__sun) || defined(sun)
-# define PLATFORM_ID "SunOS"
-
-#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
-# define PLATFORM_ID "AIX"
-
-#elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
-# define PLATFORM_ID "IRIX"
-
-#elif defined(__hpux) || defined(__hpux__)
-# define PLATFORM_ID "HP-UX"
-
-#elif defined(__HAIKU__)
-# define PLATFORM_ID "Haiku"
-
-#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
-# define PLATFORM_ID "BeOS"
-
-#elif defined(__QNX__) || defined(__QNXNTO__)
-# define PLATFORM_ID "QNX"
-
-#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
-# define PLATFORM_ID "Tru64"
-
-#elif defined(__riscos) || defined(__riscos__)
-# define PLATFORM_ID "RISCos"
-
-#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
-# define PLATFORM_ID "SINIX"
-
-#elif defined(__UNIX_SV__)
-# define PLATFORM_ID "UNIX_SV"
-
-#elif defined(__bsdos__)
-# define PLATFORM_ID "BSDOS"
-
-#elif defined(_MPRAS) || defined(MPRAS)
-# define PLATFORM_ID "MP-RAS"
-
-#elif defined(__osf) || defined(__osf__)
-# define PLATFORM_ID "OSF1"
-
-#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
-# define PLATFORM_ID "SCO_SV"
-
-#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
-# define PLATFORM_ID "ULTRIX"
-
-#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
-# define PLATFORM_ID "Xenix"
-
-#else /* unknown platform */
-# define PLATFORM_ID ""
-
-#endif
-
-/* For windows compilers MSVC and Intel we can determine
-   the architecture of the compiler being used.  This is because
-   the compilers do not have flags that can change the architecture,
-   but rather depend on which compiler is being used
-*/
-#if defined(_WIN32) && defined(_MSC_VER)
-# if defined(_M_IA64)
-#  define ARCHITECTURE_ID "IA64"
-
-# elif defined(_M_X64) || defined(_M_AMD64)
-#  define ARCHITECTURE_ID "x64"
-
-# elif defined(_M_IX86)
-#  define ARCHITECTURE_ID "X86"
-
-# elif defined(_M_ARM)
-#  define ARCHITECTURE_ID "ARM"
-
-# elif defined(_M_MIPS)
-#  define ARCHITECTURE_ID "MIPS"
-
-# elif defined(_M_SH)
-#  define ARCHITECTURE_ID "SHx"
-
-# else /* unknown architecture */
-#  define ARCHITECTURE_ID ""
-# endif
-
-#else
-#  define ARCHITECTURE_ID ""
-#endif
-
-/* Convert integer to decimal digit literals.  */
-#define DEC(n)                   \
-  ('0' + (((n) / 10000000)%10)), \
-  ('0' + (((n) / 1000000)%10)),  \
-  ('0' + (((n) / 100000)%10)),   \
-  ('0' + (((n) / 10000)%10)),    \
-  ('0' + (((n) / 1000)%10)),     \
-  ('0' + (((n) / 100)%10)),      \
-  ('0' + (((n) / 10)%10)),       \
-  ('0' +  ((n) % 10))
-
-/* Convert integer to hex digit literals.  */
-#define HEX(n)             \
-  ('0' + ((n)>>28 & 0xF)), \
-  ('0' + ((n)>>24 & 0xF)), \
-  ('0' + ((n)>>20 & 0xF)), \
-  ('0' + ((n)>>16 & 0xF)), \
-  ('0' + ((n)>>12 & 0xF)), \
-  ('0' + ((n)>>8  & 0xF)), \
-  ('0' + ((n)>>4  & 0xF)), \
-  ('0' + ((n)     & 0xF))
-
-/* Construct a string literal encoding the version number components. */
-#ifdef COMPILER_VERSION_MAJOR
-char const info_version[] = {
-  'I', 'N', 'F', 'O', ':',
-  'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
-  COMPILER_VERSION_MAJOR,
-# ifdef COMPILER_VERSION_MINOR
-  '.', COMPILER_VERSION_MINOR,
-#  ifdef COMPILER_VERSION_PATCH
-   '.', COMPILER_VERSION_PATCH,
-#   ifdef COMPILER_VERSION_TWEAK
-    '.', COMPILER_VERSION_TWEAK,
-#   endif
-#  endif
-# endif
-  ']','\0'};
-#endif
-
-/* Construct the string literal in pieces to prevent the source from
-   getting matched.  Store it in a pointer rather than an array
-   because some compilers will just produce instructions to fill the
-   array rather than assigning a pointer to a static array.  */
-char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
-char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
-
-
-
-/*--------------------------------------------------------------------------*/
-
-#ifdef ID_VOID_MAIN
-void main() {}
-#else
-int main(int argc, char* argv[])
-{
-  int require = 0;
-  require += info_compiler[argc];
-  require += info_platform[argc];
-  require += info_arch[argc];
-#ifdef COMPILER_VERSION_MAJOR
-  require += info_version[argc];
-#endif
-  (void)argv;
-  return require;
-}
-#endif
diff --git a/CMakeFiles/2.8.11.2/CompilerIdCXX/CMakeCXXCompilerId.cpp b/CMakeFiles/2.8.11.2/CompilerIdCXX/CMakeCXXCompilerId.cpp
deleted file mode 100644
index 17c8fd9..0000000
--- a/CMakeFiles/2.8.11.2/CompilerIdCXX/CMakeCXXCompilerId.cpp
+++ /dev/null
@@ -1,372 +0,0 @@
-/* This source file must have a .cpp extension so that all C++ compilers
-   recognize the extension without flags.  Borland does not know .cxx for
-   example.  */
-#ifndef __cplusplus
-# error "A C compiler has been selected for C++."
-#endif
-
-/* Version number components: V=Version, R=Revision, P=Patch
-   Version date components:   YYYY=Year, MM=Month,   DD=Day  */
-
-#if defined(__COMO__)
-# define COMPILER_ID "Comeau"
-  /* __COMO_VERSION__ = VRR */
-# define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100)
-# define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100)
-
-#elif defined(__INTEL_COMPILER) || defined(__ICC)
-# define COMPILER_ID "Intel"
-  /* __INTEL_COMPILER = VRP */
-# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
-# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
-# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER    % 10)
-# if defined(__INTEL_COMPILER_BUILD_DATE)
-  /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
-#  define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
-# endif
-
-#elif defined(__PATHCC__)
-# define COMPILER_ID "PathScale"
-# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
-# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
-# if defined(__PATHCC_PATCHLEVEL__)
-#  define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
-# endif
-
-#elif defined(__clang__)
-# define COMPILER_ID "Clang"
-# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
-# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
-# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
-
-#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
-# define COMPILER_ID "Embarcadero"
-# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
-# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
-# define COMPILER_VERSION_PATCH HEX(__CODEGEARC_VERSION__     & 0xFFFF)
-
-#elif defined(__BORLANDC__)
-# define COMPILER_ID "Borland"
-  /* __BORLANDC__ = 0xVRR */
-# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
-# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
-
-#elif defined(__WATCOMC__)
-# define COMPILER_ID "Watcom"
-  /* __WATCOMC__ = VVRR */
-# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
-# define COMPILER_VERSION_MINOR DEC(__WATCOMC__ % 100)
-
-#elif defined(__SUNPRO_CC)
-# define COMPILER_ID "SunPro"
-# if __SUNPRO_CC >= 0x5100
-   /* __SUNPRO_CC = 0xVRRP */
-#  define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12)
-#  define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF)
-#  define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC    & 0xF)
-# else
-   /* __SUNPRO_CC = 0xVRP */
-#  define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8)
-#  define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF)
-#  define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC    & 0xF)
-# endif
-
-#elif defined(__HP_aCC)
-# define COMPILER_ID "HP"
-  /* __HP_aCC = VVRRPP */
-# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000)
-# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100)
-# define COMPILER_VERSION_PATCH DEC(__HP_aCC     % 100)
-
-#elif defined(__DECCXX)
-# define COMPILER_ID "Compaq"
-  /* __DECCXX_VER = VVRRTPPPP */
-# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000)
-# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000  % 100)
-# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER         % 10000)
-
-#elif defined(__IBMCPP__)
-# if defined(__COMPILER_VER__)
-#  define COMPILER_ID "zOS"
-# else
-#  if __IBMCPP__ >= 800
-#   define COMPILER_ID "XL"
-#  else
-#   define COMPILER_ID "VisualAge"
-#  endif
-   /* __IBMCPP__ = VRP */
-#  define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
-#  define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
-#  define COMPILER_VERSION_PATCH DEC(__IBMCPP__    % 10)
-# endif
-
-#elif defined(__PGI)
-# define COMPILER_ID "PGI"
-# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
-# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
-# if defined(__PGIC_PATCHLEVEL__)
-#  define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
-# endif
-
-#elif defined(_CRAYC)
-# define COMPILER_ID "Cray"
-# define COMPILER_VERSION_MAJOR DEC(_RELEASE)
-# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
-
-#elif defined(__TI_COMPILER_VERSION__)
-# define COMPILER_ID "TI"
-  /* __TI_COMPILER_VERSION__ = VVVRRRPPP */
-# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
-# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000   % 1000)
-# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__        % 1000)
-
-#elif defined(__SCO_VERSION__)
-# define COMPILER_ID "SCO"
-
-#elif defined(__GNUC__)
-# define COMPILER_ID "GNU"
-# define COMPILER_VERSION_MAJOR DEC(__GNUC__)
-# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
-# if defined(__GNUC_PATCHLEVEL__)
-#  define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
-# endif
-
-#elif defined(_MSC_VER)
-# define COMPILER_ID "MSVC"
-  /* _MSC_VER = VVRR */
-# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
-# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
-# if defined(_MSC_FULL_VER)
-#  if _MSC_VER >= 1400
-    /* _MSC_FULL_VER = VVRRPPPPP */
-#   define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
-#  else
-    /* _MSC_FULL_VER = VVRRPPPP */
-#   define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
-#  endif
-# endif
-# if defined(_MSC_BUILD)
-#  define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
-# endif
-
-/* Analog VisualDSP++ >= 4.5.6 */
-#elif defined(__VISUALDSPVERSION__)
-# define COMPILER_ID "ADSP"
-  /* __VISUALDSPVERSION__ = 0xVVRRPP00 */
-# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24)
-# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF)
-# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8  & 0xFF)
-
-/* Analog VisualDSP++ < 4.5.6 */
-#elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
-# define COMPILER_ID "ADSP"
-
-#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
-# define COMPILER_ID "MIPSpro"
-# if defined(_SGI_COMPILER_VERSION)
-  /* _SGI_COMPILER_VERSION = VRP */
-#  define COMPILER_VERSION_MAJOR DEC(_SGI_COMPILER_VERSION/100)
-#  define COMPILER_VERSION_MINOR DEC(_SGI_COMPILER_VERSION/10 % 10)
-#  define COMPILER_VERSION_PATCH DEC(_SGI_COMPILER_VERSION    % 10)
-# else
-  /* _COMPILER_VERSION = VRP */
-#  define COMPILER_VERSION_MAJOR DEC(_COMPILER_VERSION/100)
-#  define COMPILER_VERSION_MINOR DEC(_COMPILER_VERSION/10 % 10)
-#  define COMPILER_VERSION_PATCH DEC(_COMPILER_VERSION    % 10)
-# endif
-
-/* This compiler is either not known or is too old to define an
-   identification macro.  Try to identify the platform and guess that
-   it is the native compiler.  */
-#elif defined(__sgi)
-# define COMPILER_ID "MIPSpro"
-
-#elif defined(__hpux) || defined(__hpua)
-# define COMPILER_ID "HP"
-
-#else /* unknown compiler */
-# define COMPILER_ID ""
-
-#endif
-
-/* Construct the string literal in pieces to prevent the source from
-   getting matched.  Store it in a pointer rather than an array
-   because some compilers will just produce instructions to fill the
-   array rather than assigning a pointer to a static array.  */
-char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
-
-/* Identify known platforms by name.  */
-#if defined(__linux) || defined(__linux__) || defined(linux)
-# define PLATFORM_ID "Linux"
-
-#elif defined(__CYGWIN__)
-# define PLATFORM_ID "Cygwin"
-
-#elif defined(__MINGW32__)
-# define PLATFORM_ID "MinGW"
-
-#elif defined(__APPLE__)
-# define PLATFORM_ID "Darwin"
-
-#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
-# define PLATFORM_ID "Windows"
-
-#elif defined(__FreeBSD__) || defined(__FreeBSD)
-# define PLATFORM_ID "FreeBSD"
-
-#elif defined(__NetBSD__) || defined(__NetBSD)
-# define PLATFORM_ID "NetBSD"
-
-#elif defined(__OpenBSD__) || defined(__OPENBSD)
-# define PLATFORM_ID "OpenBSD"
-
-#elif defined(__sun) || defined(sun)
-# define PLATFORM_ID "SunOS"
-
-#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
-# define PLATFORM_ID "AIX"
-
-#elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
-# define PLATFORM_ID "IRIX"
-
-#elif defined(__hpux) || defined(__hpux__)
-# define PLATFORM_ID "HP-UX"
-
-#elif defined(__HAIKU__)
-# define PLATFORM_ID "Haiku"
-
-#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
-# define PLATFORM_ID "BeOS"
-
-#elif defined(__QNX__) || defined(__QNXNTO__)
-# define PLATFORM_ID "QNX"
-
-#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
-# define PLATFORM_ID "Tru64"
-
-#elif defined(__riscos) || defined(__riscos__)
-# define PLATFORM_ID "RISCos"
-
-#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
-# define PLATFORM_ID "SINIX"
-
-#elif defined(__UNIX_SV__)
-# define PLATFORM_ID "UNIX_SV"
-
-#elif defined(__bsdos__)
-# define PLATFORM_ID "BSDOS"
-
-#elif defined(_MPRAS) || defined(MPRAS)
-# define PLATFORM_ID "MP-RAS"
-
-#elif defined(__osf) || defined(__osf__)
-# define PLATFORM_ID "OSF1"
-
-#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
-# define PLATFORM_ID "SCO_SV"
-
-#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
-# define PLATFORM_ID "ULTRIX"
-
-#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
-# define PLATFORM_ID "Xenix"
-
-#else /* unknown platform */
-# define PLATFORM_ID ""
-
-#endif
-
-/* For windows compilers MSVC and Intel we can determine
-   the architecture of the compiler being used.  This is because
-   the compilers do not have flags that can change the architecture,
-   but rather depend on which compiler is being used
-*/
-#if defined(_WIN32) && defined(_MSC_VER)
-# if defined(_M_IA64)
-#  define ARCHITECTURE_ID "IA64"
-
-# elif defined(_M_X64) || defined(_M_AMD64)
-#  define ARCHITECTURE_ID "x64"
-
-# elif defined(_M_IX86)
-#  define ARCHITECTURE_ID "X86"
-
-# elif defined(_M_ARM)
-#  define ARCHITECTURE_ID "ARM"
-
-# elif defined(_M_MIPS)
-#  define ARCHITECTURE_ID "MIPS"
-
-# elif defined(_M_SH)
-#  define ARCHITECTURE_ID "SHx"
-
-# else /* unknown architecture */
-#  define ARCHITECTURE_ID ""
-# endif
-
-#else
-#  define ARCHITECTURE_ID ""
-#endif
-
-/* Convert integer to decimal digit literals.  */
-#define DEC(n)                   \
-  ('0' + (((n) / 10000000)%10)), \
-  ('0' + (((n) / 1000000)%10)),  \
-  ('0' + (((n) / 100000)%10)),   \
-  ('0' + (((n) / 10000)%10)),    \
-  ('0' + (((n) / 1000)%10)),     \
-  ('0' + (((n) / 100)%10)),      \
-  ('0' + (((n) / 10)%10)),       \
-  ('0' +  ((n) % 10))
-
-/* Convert integer to hex digit literals.  */
-#define HEX(n)             \
-  ('0' + ((n)>>28 & 0xF)), \
-  ('0' + ((n)>>24 & 0xF)), \
-  ('0' + ((n)>>20 & 0xF)), \
-  ('0' + ((n)>>16 & 0xF)), \
-  ('0' + ((n)>>12 & 0xF)), \
-  ('0' + ((n)>>8  & 0xF)), \
-  ('0' + ((n)>>4  & 0xF)), \
-  ('0' + ((n)     & 0xF))
-
-/* Construct a string literal encoding the version number components. */
-#ifdef COMPILER_VERSION_MAJOR
-char const info_version[] = {
-  'I', 'N', 'F', 'O', ':',
-  'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
-  COMPILER_VERSION_MAJOR,
-# ifdef COMPILER_VERSION_MINOR
-  '.', COMPILER_VERSION_MINOR,
-#  ifdef COMPILER_VERSION_PATCH
-   '.', COMPILER_VERSION_PATCH,
-#   ifdef COMPILER_VERSION_TWEAK
-    '.', COMPILER_VERSION_TWEAK,
-#   endif
-#  endif
-# endif
-  ']','\0'};
-#endif
-
-/* Construct the string literal in pieces to prevent the source from
-   getting matched.  Store it in a pointer rather than an array
-   because some compilers will just produce instructions to fill the
-   array rather than assigning a pointer to a static array.  */
-char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
-char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
-
-
-
-/*--------------------------------------------------------------------------*/
-
-int main(int argc, char* argv[])
-{
-  int require = 0;
-  require += info_compiler[argc];
-  require += info_platform[argc];
-#ifdef COMPILER_VERSION_MAJOR
-  require += info_version[argc];
-#endif
-  (void)argv;
-  return require;
-}
diff --git a/CMakeFiles/2.8.11.2/CompilerIdFortran/CMakeFortranCompilerId.F b/CMakeFiles/2.8.11.2/CompilerIdFortran/CMakeFortranCompilerId.F
deleted file mode 100644
index f84852a..0000000
--- a/CMakeFiles/2.8.11.2/CompilerIdFortran/CMakeFortranCompilerId.F
+++ /dev/null
@@ -1,119 +0,0 @@
-      PROGRAM CMakeFortranCompilerId
-#if 0
-! Identify the compiler
-#endif
-#if defined(__INTEL_COMPILER) || defined(__ICC)
-        PRINT *, 'INFO:compiler[Intel]'
-#elif defined(__SUNPRO_F90) || defined(__SUNPRO_F95)
-        PRINT *, 'INFO:compiler[SunPro]'
-#elif defined(_CRAYFTN)
-        PRINT *, 'INFO:compiler[Cray]'
-#elif defined(__G95__)
-        PRINT *, 'INFO:compiler[G95]'
-#elif defined(__PATHSCALE__)
-        PRINT *, 'INFO:compiler[PathScale]'
-#elif defined(__ABSOFT__)
-        PRINT *, 'INFO:compiler[Absoft]'
-#elif defined(__GNUC__)
-        PRINT *, 'INFO:compiler[GNU]'
-#elif defined(__IBMC__)
-# if defined(__COMPILER_VER__)
-        PRINT *, 'INFO:compiler[zOS]'
-# elif __IBMC__ >= 800
-        PRINT *, 'INFO:compiler[XL]'
-# else
-        PRINT *, 'INFO:compiler[VisualAge]'
-# endif
-#elif defined(__PGI)
-        PRINT *, 'INFO:compiler[PGI]'
-#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
-        PRINT *, 'INFO:compiler[MIPSpro]'
-#       if 0
-!       This compiler is either not known or is too old to define an
-!       identification macro.  Try to identify the platform and guess that
-!       it is the native compiler.
-#       endif
-#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
-        PRINT *, 'INFO:compiler[VisualAge]'
-#elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
-        PRINT *, 'INFO:compiler[MIPSpro]'
-#elif defined(__hpux) || defined(__hpux__)
-        PRINT *, 'INFO:compiler[HP]'
-#elif 1
-#       if 0
-!       The above 'elif 1' instead of 'else' is to work around a bug in the
-!       SGI preprocessor which produces both the __sgi and else blocks.
-#       endif
-        PRINT *, 'INFO:compiler[]'
-#endif
-
-#if 0
-! Identify the platform
-#endif
-#if defined(__linux) || defined(__linux__) || defined(linux)
-        PRINT *, 'INFO:platform[Linux]'
-#elif defined(__CYGWIN__)
-        PRINT *, 'INFO:platform[Cygwin]'
-#elif defined(__MINGW32__)
-        PRINT *, 'INFO:platform[MinGW]'
-#elif defined(__APPLE__)
-        PRINT *, 'INFO:platform[Darwin]'
-#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
-        PRINT *, 'INFO:platform[Windows]'
-#elif defined(__FreeBSD__) || defined(__FreeBSD)
-        PRINT *, 'INFO:platform[FreeBSD]'
-#elif defined(__NetBSD__) || defined(__NetBSD)
-        PRINT *, 'INFO:platform[NetBSD]'
-#elif defined(__OpenBSD__) || defined(__OPENBSD)
-        PRINT *, 'INFO:platform[OpenBSD]'
-#elif defined(__sun) || defined(sun)
-        PRINT *, 'INFO:platform[SunOS]'
-#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
-        PRINT *, 'INFO:platform[AIX]'
-#elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
-        PRINT *, 'INFO:platform[IRIX]'
-#elif defined(__hpux) || defined(__hpux__)
-        PRINT *, 'INFO:platform[HP-UX]'
-#elif defined(__HAIKU__)
-        PRINT *, 'INFO:platform[Haiku]'
-#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
-        PRINT *, 'INFO:platform[BeOS]'
-#elif defined(__QNX__) || defined(__QNXNTO__)
-        PRINT *, 'INFO:platform[QNX]'
-#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
-        PRINT *, 'INFO:platform[Tru64]'
-#elif defined(__riscos) || defined(__riscos__)
-        PRINT *, 'INFO:platform[RISCos]'
-#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
-        PRINT *, 'INFO:platform[SINIX]'
-#elif defined(__UNIX_SV__)
-        PRINT *, 'INFO:platform[UNIX_SV]'
-#elif defined(__bsdos__)
-        PRINT *, 'INFO:platform[BSDOS]'
-#elif defined(_MPRAS) || defined(MPRAS)
-        PRINT *, 'INFO:platform[MP-RAS]'
-#elif defined(__osf) || defined(__osf__)
-        PRINT *, 'INFO:platform[OSF1]'
-#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
-        PRINT *, 'INFO:platform[SCO_SV]'
-#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
-        PRINT *, 'INFO:platform[ULTRIX]'
-#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
-        PRINT *, 'INFO:platform[Xenix]'
-#elif 1
-#       if 0
-!       The above 'elif 1' instead of 'else' is to work around a bug in the
-!       SGI preprocessor which produces both the __sgi and else blocks.
-#       endif
-        PRINT *, 'INFO:platform[]'
-#endif
-#if defined(_WIN32) && (defined(__INTEL_COMPILER) || defined(__ICC))
-# if defined(_M_IA64)
-        PRINT *, 'INFO:arch[IA64]'
-# elif defined(_M_X64) || defined(_M_AMD64)
-        PRINT *, 'INFO:arch[x64]'
-# elif defined(_M_IX86)
-        PRINT *, 'INFO:arch[X86]'
-# endif
-#endif
-      END
diff --git a/CMakeFiles/CheckTypeSize/CMAKE_SIZEOF_UNSIGNED_SHORT.bin b/CMakeFiles/CheckTypeSize/CMAKE_SIZEOF_UNSIGNED_SHORT.bin
deleted file mode 100755
index aecbc90..0000000
Binary files a/CMakeFiles/CheckTypeSize/CMAKE_SIZEOF_UNSIGNED_SHORT.bin and /dev/null differ
diff --git a/CMakeFiles/CheckTypeSize/CMAKE_SIZEOF_UNSIGNED_SHORT.c b/CMakeFiles/CheckTypeSize/CMAKE_SIZEOF_UNSIGNED_SHORT.c
deleted file mode 100644
index a192656..0000000
--- a/CMakeFiles/CheckTypeSize/CMAKE_SIZEOF_UNSIGNED_SHORT.c
+++ /dev/null
@@ -1,40 +0,0 @@
-#include <sys/types.h>
-#include <stdint.h>
-#include <stddef.h>
-
-
-#undef KEY
-#if defined(__i386)
-# define KEY '_','_','i','3','8','6'
-#elif defined(__x86_64)
-# define KEY '_','_','x','8','6','_','6','4'
-#elif defined(__ppc__)
-# define KEY '_','_','p','p','c','_','_'
-#elif defined(__ppc64__)
-# define KEY '_','_','p','p','c','6','4','_','_'
-#endif
-
-#define SIZE (sizeof(unsigned short))
-char info_size[] =  {'I', 'N', 'F', 'O', ':', 's','i','z','e','[',
-  ('0' + ((SIZE / 10000)%10)),
-  ('0' + ((SIZE / 1000)%10)),
-  ('0' + ((SIZE / 100)%10)),
-  ('0' + ((SIZE / 10)%10)),
-  ('0' +  (SIZE    % 10)),
-  ']',
-#ifdef KEY
-  ' ','k','e','y','[', KEY, ']',
-#endif
-  '\0'};
-
-#ifdef __CLASSIC_C__
-int main(argc, argv) int argc; char *argv[];
-#else
-int main(int argc, char *argv[])
-#endif
-{
-  int require = 0;
-  require += info_size[argc];
-  (void)argv;
-  return require;
-}
diff --git a/CMakeFiles/CheckTypeSize/EC_SIZEOF_CHAR.bin b/CMakeFiles/CheckTypeSize/EC_SIZEOF_CHAR.bin
deleted file mode 100755
index b3354fd..0000000
Binary files a/CMakeFiles/CheckTypeSize/EC_SIZEOF_CHAR.bin and /dev/null differ
diff --git a/CMakeFiles/CheckTypeSize/EC_SIZEOF_CHAR.c b/CMakeFiles/CheckTypeSize/EC_SIZEOF_CHAR.c
deleted file mode 100644
index af96950..0000000
--- a/CMakeFiles/CheckTypeSize/EC_SIZEOF_CHAR.c
+++ /dev/null
@@ -1,40 +0,0 @@
-#include <sys/types.h>
-#include <stdint.h>
-#include <stddef.h>
-
-
-#undef KEY
-#if defined(__i386)
-# define KEY '_','_','i','3','8','6'
-#elif defined(__x86_64)
-# define KEY '_','_','x','8','6','_','6','4'
-#elif defined(__ppc__)
-# define KEY '_','_','p','p','c','_','_'
-#elif defined(__ppc64__)
-# define KEY '_','_','p','p','c','6','4','_','_'
-#endif
-
-#define SIZE (sizeof(char))
-char info_size[] =  {'I', 'N', 'F', 'O', ':', 's','i','z','e','[',
-  ('0' + ((SIZE / 10000)%10)),
-  ('0' + ((SIZE / 1000)%10)),
-  ('0' + ((SIZE / 100)%10)),
-  ('0' + ((SIZE / 10)%10)),
-  ('0' +  (SIZE    % 10)),
-  ']',
-#ifdef KEY
-  ' ','k','e','y','[', KEY, ']',
-#endif
-  '\0'};
-
-#ifdef __CLASSIC_C__
-int main(argc, argv) int argc; char *argv[];
-#else
-int main(int argc, char *argv[])
-#endif
-{
-  int require = 0;
-  require += info_size[argc];
-  (void)argv;
-  return require;
-}
diff --git a/CMakeFiles/CheckTypeSize/EC_SIZEOF_DOUBLE.bin b/CMakeFiles/CheckTypeSize/EC_SIZEOF_DOUBLE.bin
deleted file mode 100755
index 6b375aa..0000000
Binary files a/CMakeFiles/CheckTypeSize/EC_SIZEOF_DOUBLE.bin and /dev/null differ
diff --git a/CMakeFiles/CheckTypeSize/EC_SIZEOF_DOUBLE.c b/CMakeFiles/CheckTypeSize/EC_SIZEOF_DOUBLE.c
deleted file mode 100644
index 8ec3d43..0000000
--- a/CMakeFiles/CheckTypeSize/EC_SIZEOF_DOUBLE.c
+++ /dev/null
@@ -1,40 +0,0 @@
-#include <sys/types.h>
-#include <stdint.h>
-#include <stddef.h>
-
-
-#undef KEY
-#if defined(__i386)
-# define KEY '_','_','i','3','8','6'
-#elif defined(__x86_64)
-# define KEY '_','_','x','8','6','_','6','4'
-#elif defined(__ppc__)
-# define KEY '_','_','p','p','c','_','_'
-#elif defined(__ppc64__)
-# define KEY '_','_','p','p','c','6','4','_','_'
-#endif
-
-#define SIZE (sizeof(double))
-char info_size[] =  {'I', 'N', 'F', 'O', ':', 's','i','z','e','[',
-  ('0' + ((SIZE / 10000)%10)),
-  ('0' + ((SIZE / 1000)%10)),
-  ('0' + ((SIZE / 100)%10)),
-  ('0' + ((SIZE / 10)%10)),
-  ('0' +  (SIZE    % 10)),
-  ']',
-#ifdef KEY
-  ' ','k','e','y','[', KEY, ']',
-#endif
-  '\0'};
-
-#ifdef __CLASSIC_C__
-int main(argc, argv) int argc; char *argv[];
-#else
-int main(int argc, char *argv[])
-#endif
-{
-  int require = 0;
-  require += info_size[argc];
-  (void)argv;
-  return require;
-}
diff --git a/CMakeFiles/CheckTypeSize/EC_SIZEOF_FLOAT.bin b/CMakeFiles/CheckTypeSize/EC_SIZEOF_FLOAT.bin
deleted file mode 100755
index 5286143..0000000
Binary files a/CMakeFiles/CheckTypeSize/EC_SIZEOF_FLOAT.bin and /dev/null differ
diff --git a/CMakeFiles/CheckTypeSize/EC_SIZEOF_FLOAT.c b/CMakeFiles/CheckTypeSize/EC_SIZEOF_FLOAT.c
deleted file mode 100644
index 076a87c..0000000
--- a/CMakeFiles/CheckTypeSize/EC_SIZEOF_FLOAT.c
+++ /dev/null
@@ -1,40 +0,0 @@
-#include <sys/types.h>
-#include <stdint.h>
-#include <stddef.h>
-
-
-#undef KEY
-#if defined(__i386)
-# define KEY '_','_','i','3','8','6'
-#elif defined(__x86_64)
-# define KEY '_','_','x','8','6','_','6','4'
-#elif defined(__ppc__)
-# define KEY '_','_','p','p','c','_','_'
-#elif defined(__ppc64__)
-# define KEY '_','_','p','p','c','6','4','_','_'
-#endif
-
-#define SIZE (sizeof(float))
-char info_size[] =  {'I', 'N', 'F', 'O', ':', 's','i','z','e','[',
-  ('0' + ((SIZE / 10000)%10)),
-  ('0' + ((SIZE / 1000)%10)),
-  ('0' + ((SIZE / 100)%10)),
-  ('0' + ((SIZE / 10)%10)),
-  ('0' +  (SIZE    % 10)),
-  ']',
-#ifdef KEY
-  ' ','k','e','y','[', KEY, ']',
-#endif
-  '\0'};
-
-#ifdef __CLASSIC_C__
-int main(argc, argv) int argc; char *argv[];
-#else
-int main(int argc, char *argv[])
-#endif
-{
-  int require = 0;
-  require += info_size[argc];
-  (void)argv;
-  return require;
-}
diff --git a/CMakeFiles/CheckTypeSize/EC_SIZEOF_INT.bin b/CMakeFiles/CheckTypeSize/EC_SIZEOF_INT.bin
deleted file mode 100755
index 1c96cdc..0000000
Binary files a/CMakeFiles/CheckTypeSize/EC_SIZEOF_INT.bin and /dev/null differ
diff --git a/CMakeFiles/CheckTypeSize/EC_SIZEOF_INT.c b/CMakeFiles/CheckTypeSize/EC_SIZEOF_INT.c
deleted file mode 100644
index e91c9b2..0000000
--- a/CMakeFiles/CheckTypeSize/EC_SIZEOF_INT.c
+++ /dev/null
@@ -1,40 +0,0 @@
-#include <sys/types.h>
-#include <stdint.h>
-#include <stddef.h>
-
-
-#undef KEY
-#if defined(__i386)
-# define KEY '_','_','i','3','8','6'
-#elif defined(__x86_64)
-# define KEY '_','_','x','8','6','_','6','4'
-#elif defined(__ppc__)
-# define KEY '_','_','p','p','c','_','_'
-#elif defined(__ppc64__)
-# define KEY '_','_','p','p','c','6','4','_','_'
-#endif
-
-#define SIZE (sizeof(int))
-char info_size[] =  {'I', 'N', 'F', 'O', ':', 's','i','z','e','[',
-  ('0' + ((SIZE / 10000)%10)),
-  ('0' + ((SIZE / 1000)%10)),
-  ('0' + ((SIZE / 100)%10)),
-  ('0' + ((SIZE / 10)%10)),
-  ('0' +  (SIZE    % 10)),
-  ']',
-#ifdef KEY
-  ' ','k','e','y','[', KEY, ']',
-#endif
-  '\0'};
-
-#ifdef __CLASSIC_C__
-int main(argc, argv) int argc; char *argv[];
-#else
-int main(int argc, char *argv[])
-#endif
-{
-  int require = 0;
-  require += info_size[argc];
-  (void)argv;
-  return require;
-}
diff --git a/CMakeFiles/CheckTypeSize/EC_SIZEOF_LONG.bin b/CMakeFiles/CheckTypeSize/EC_SIZEOF_LONG.bin
deleted file mode 100755
index f391fab..0000000
Binary files a/CMakeFiles/CheckTypeSize/EC_SIZEOF_LONG.bin and /dev/null differ
diff --git a/CMakeFiles/CheckTypeSize/EC_SIZEOF_LONG.c b/CMakeFiles/CheckTypeSize/EC_SIZEOF_LONG.c
deleted file mode 100644
index 44d4458..0000000
--- a/CMakeFiles/CheckTypeSize/EC_SIZEOF_LONG.c
+++ /dev/null
@@ -1,40 +0,0 @@
-#include <sys/types.h>
-#include <stdint.h>
-#include <stddef.h>
-
-
-#undef KEY
-#if defined(__i386)
-# define KEY '_','_','i','3','8','6'
-#elif defined(__x86_64)
-# define KEY '_','_','x','8','6','_','6','4'
-#elif defined(__ppc__)
-# define KEY '_','_','p','p','c','_','_'
-#elif defined(__ppc64__)
-# define KEY '_','_','p','p','c','6','4','_','_'
-#endif
-
-#define SIZE (sizeof(long))
-char info_size[] =  {'I', 'N', 'F', 'O', ':', 's','i','z','e','[',
-  ('0' + ((SIZE / 10000)%10)),
-  ('0' + ((SIZE / 1000)%10)),
-  ('0' + ((SIZE / 100)%10)),
-  ('0' + ((SIZE / 10)%10)),
-  ('0' +  (SIZE    % 10)),
-  ']',
-#ifdef KEY
-  ' ','k','e','y','[', KEY, ']',
-#endif
-  '\0'};
-
-#ifdef __CLASSIC_C__
-int main(argc, argv) int argc; char *argv[];
-#else
-int main(int argc, char *argv[])
-#endif
-{
-  int require = 0;
-  require += info_size[argc];
-  (void)argv;
-  return require;
-}
diff --git a/CMakeFiles/CheckTypeSize/EC_SIZEOF_LONG_DOUBLE.bin b/CMakeFiles/CheckTypeSize/EC_SIZEOF_LONG_DOUBLE.bin
deleted file mode 100755
index 553f7f2..0000000
Binary files a/CMakeFiles/CheckTypeSize/EC_SIZEOF_LONG_DOUBLE.bin and /dev/null differ
diff --git a/CMakeFiles/CheckTypeSize/EC_SIZEOF_LONG_DOUBLE.c b/CMakeFiles/CheckTypeSize/EC_SIZEOF_LONG_DOUBLE.c
deleted file mode 100644
index 796bd13..0000000
--- a/CMakeFiles/CheckTypeSize/EC_SIZEOF_LONG_DOUBLE.c
+++ /dev/null
@@ -1,40 +0,0 @@
-#include <sys/types.h>
-#include <stdint.h>
-#include <stddef.h>
-
-
-#undef KEY
-#if defined(__i386)
-# define KEY '_','_','i','3','8','6'
-#elif defined(__x86_64)
-# define KEY '_','_','x','8','6','_','6','4'
-#elif defined(__ppc__)
-# define KEY '_','_','p','p','c','_','_'
-#elif defined(__ppc64__)
-# define KEY '_','_','p','p','c','6','4','_','_'
-#endif
-
-#define SIZE (sizeof(long double))
-char info_size[] =  {'I', 'N', 'F', 'O', ':', 's','i','z','e','[',
-  ('0' + ((SIZE / 10000)%10)),
-  ('0' + ((SIZE / 1000)%10)),
-  ('0' + ((SIZE / 100)%10)),
-  ('0' + ((SIZE / 10)%10)),
-  ('0' +  (SIZE    % 10)),
-  ']',
-#ifdef KEY
-  ' ','k','e','y','[', KEY, ']',
-#endif
-  '\0'};
-
-#ifdef __CLASSIC_C__
-int main(argc, argv) int argc; char *argv[];
-#else
-int main(int argc, char *argv[])
-#endif
-{
-  int require = 0;
-  require += info_size[argc];
-  (void)argv;
-  return require;
-}
diff --git a/CMakeFiles/CheckTypeSize/EC_SIZEOF_LONG_LONG.bin b/CMakeFiles/CheckTypeSize/EC_SIZEOF_LONG_LONG.bin
deleted file mode 100755
index 146ecd6..0000000
Binary files a/CMakeFiles/CheckTypeSize/EC_SIZEOF_LONG_LONG.bin and /dev/null differ
diff --git a/CMakeFiles/CheckTypeSize/EC_SIZEOF_LONG_LONG.c b/CMakeFiles/CheckTypeSize/EC_SIZEOF_LONG_LONG.c
deleted file mode 100644
index 0623da0..0000000
--- a/CMakeFiles/CheckTypeSize/EC_SIZEOF_LONG_LONG.c
+++ /dev/null
@@ -1,40 +0,0 @@
-#include <sys/types.h>
-#include <stdint.h>
-#include <stddef.h>
-
-
-#undef KEY
-#if defined(__i386)
-# define KEY '_','_','i','3','8','6'
-#elif defined(__x86_64)
-# define KEY '_','_','x','8','6','_','6','4'
-#elif defined(__ppc__)
-# define KEY '_','_','p','p','c','_','_'
-#elif defined(__ppc64__)
-# define KEY '_','_','p','p','c','6','4','_','_'
-#endif
-
-#define SIZE (sizeof(long long))
-char info_size[] =  {'I', 'N', 'F', 'O', ':', 's','i','z','e','[',
-  ('0' + ((SIZE / 10000)%10)),
-  ('0' + ((SIZE / 1000)%10)),
-  ('0' + ((SIZE / 100)%10)),
-  ('0' + ((SIZE / 10)%10)),
-  ('0' +  (SIZE    % 10)),
-  ']',
-#ifdef KEY
-  ' ','k','e','y','[', KEY, ']',
-#endif
-  '\0'};
-
-#ifdef __CLASSIC_C__
-int main(argc, argv) int argc; char *argv[];
-#else
-int main(int argc, char *argv[])
-#endif
-{
-  int require = 0;
-  require += info_size[argc];
-  (void)argv;
-  return require;
-}
diff --git a/CMakeFiles/CheckTypeSize/EC_SIZEOF_PTR.bin b/CMakeFiles/CheckTypeSize/EC_SIZEOF_PTR.bin
deleted file mode 100755
index 670ef02..0000000
Binary files a/CMakeFiles/CheckTypeSize/EC_SIZEOF_PTR.bin and /dev/null differ
diff --git a/CMakeFiles/CheckTypeSize/EC_SIZEOF_PTR.c b/CMakeFiles/CheckTypeSize/EC_SIZEOF_PTR.c
deleted file mode 100644
index f7de2f8..0000000
--- a/CMakeFiles/CheckTypeSize/EC_SIZEOF_PTR.c
+++ /dev/null
@@ -1,40 +0,0 @@
-#include <sys/types.h>
-#include <stdint.h>
-#include <stddef.h>
-
-
-#undef KEY
-#if defined(__i386)
-# define KEY '_','_','i','3','8','6'
-#elif defined(__x86_64)
-# define KEY '_','_','x','8','6','_','6','4'
-#elif defined(__ppc__)
-# define KEY '_','_','p','p','c','_','_'
-#elif defined(__ppc64__)
-# define KEY '_','_','p','p','c','6','4','_','_'
-#endif
-
-#define SIZE (sizeof(void *))
-char info_size[] =  {'I', 'N', 'F', 'O', ':', 's','i','z','e','[',
-  ('0' + ((SIZE / 10000)%10)),
-  ('0' + ((SIZE / 1000)%10)),
-  ('0' + ((SIZE / 100)%10)),
-  ('0' + ((SIZE / 10)%10)),
-  ('0' +  (SIZE    % 10)),
-  ']',
-#ifdef KEY
-  ' ','k','e','y','[', KEY, ']',
-#endif
-  '\0'};
-
-#ifdef __CLASSIC_C__
-int main(argc, argv) int argc; char *argv[];
-#else
-int main(int argc, char *argv[])
-#endif
-{
-  int require = 0;
-  require += info_size[argc];
-  (void)argv;
-  return require;
-}
diff --git a/CMakeFiles/CheckTypeSize/EC_SIZEOF_SHORT.bin b/CMakeFiles/CheckTypeSize/EC_SIZEOF_SHORT.bin
deleted file mode 100755
index e566cbb..0000000
Binary files a/CMakeFiles/CheckTypeSize/EC_SIZEOF_SHORT.bin and /dev/null differ
diff --git a/CMakeFiles/CheckTypeSize/EC_SIZEOF_SHORT.c b/CMakeFiles/CheckTypeSize/EC_SIZEOF_SHORT.c
deleted file mode 100644
index 8197c01..0000000
--- a/CMakeFiles/CheckTypeSize/EC_SIZEOF_SHORT.c
+++ /dev/null
@@ -1,40 +0,0 @@
-#include <sys/types.h>
-#include <stdint.h>
-#include <stddef.h>
-
-
-#undef KEY
-#if defined(__i386)
-# define KEY '_','_','i','3','8','6'
-#elif defined(__x86_64)
-# define KEY '_','_','x','8','6','_','6','4'
-#elif defined(__ppc__)
-# define KEY '_','_','p','p','c','_','_'
-#elif defined(__ppc64__)
-# define KEY '_','_','p','p','c','6','4','_','_'
-#endif
-
-#define SIZE (sizeof(short))
-char info_size[] =  {'I', 'N', 'F', 'O', ':', 's','i','z','e','[',
-  ('0' + ((SIZE / 10000)%10)),
-  ('0' + ((SIZE / 1000)%10)),
-  ('0' + ((SIZE / 100)%10)),
-  ('0' + ((SIZE / 10)%10)),
-  ('0' +  (SIZE    % 10)),
-  ']',
-#ifdef KEY
-  ' ','k','e','y','[', KEY, ']',
-#endif
-  '\0'};
-
-#ifdef __CLASSIC_C__
-int main(argc, argv) int argc; char *argv[];
-#else
-int main(int argc, char *argv[])
-#endif
-{
-  int require = 0;
-  require += info_size[argc];
-  (void)argv;
-  return require;
-}
diff --git a/CMakeFiles/CheckTypeSize/EC_SIZEOF_SIZE_T.bin b/CMakeFiles/CheckTypeSize/EC_SIZEOF_SIZE_T.bin
deleted file mode 100755
index 7df35df..0000000
Binary files a/CMakeFiles/CheckTypeSize/EC_SIZEOF_SIZE_T.bin and /dev/null differ
diff --git a/CMakeFiles/CheckTypeSize/EC_SIZEOF_SIZE_T.c b/CMakeFiles/CheckTypeSize/EC_SIZEOF_SIZE_T.c
deleted file mode 100644
index dbaf85b..0000000
--- a/CMakeFiles/CheckTypeSize/EC_SIZEOF_SIZE_T.c
+++ /dev/null
@@ -1,40 +0,0 @@
-#include <sys/types.h>
-#include <stdint.h>
-#include <stddef.h>
-
-
-#undef KEY
-#if defined(__i386)
-# define KEY '_','_','i','3','8','6'
-#elif defined(__x86_64)
-# define KEY '_','_','x','8','6','_','6','4'
-#elif defined(__ppc__)
-# define KEY '_','_','p','p','c','_','_'
-#elif defined(__ppc64__)
-# define KEY '_','_','p','p','c','6','4','_','_'
-#endif
-
-#define SIZE (sizeof(size_t))
-char info_size[] =  {'I', 'N', 'F', 'O', ':', 's','i','z','e','[',
-  ('0' + ((SIZE / 10000)%10)),
-  ('0' + ((SIZE / 1000)%10)),
-  ('0' + ((SIZE / 100)%10)),
-  ('0' + ((SIZE / 10)%10)),
-  ('0' +  (SIZE    % 10)),
-  ']',
-#ifdef KEY
-  ' ','k','e','y','[', KEY, ']',
-#endif
-  '\0'};
-
-#ifdef __CLASSIC_C__
-int main(argc, argv) int argc; char *argv[];
-#else
-int main(int argc, char *argv[])
-#endif
-{
-  int require = 0;
-  require += info_size[argc];
-  (void)argv;
-  return require;
-}
diff --git a/CMakeFiles/CheckTypeSize/EC_SIZEOF_SSIZE_T.bin b/CMakeFiles/CheckTypeSize/EC_SIZEOF_SSIZE_T.bin
deleted file mode 100755
index 7b041d4..0000000
Binary files a/CMakeFiles/CheckTypeSize/EC_SIZEOF_SSIZE_T.bin and /dev/null differ
diff --git a/CMakeFiles/CheckTypeSize/EC_SIZEOF_SSIZE_T.c b/CMakeFiles/CheckTypeSize/EC_SIZEOF_SSIZE_T.c
deleted file mode 100644
index 920c5ef..0000000
--- a/CMakeFiles/CheckTypeSize/EC_SIZEOF_SSIZE_T.c
+++ /dev/null
@@ -1,40 +0,0 @@
-#include <sys/types.h>
-#include <stdint.h>
-#include <stddef.h>
-
-
-#undef KEY
-#if defined(__i386)
-# define KEY '_','_','i','3','8','6'
-#elif defined(__x86_64)
-# define KEY '_','_','x','8','6','_','6','4'
-#elif defined(__ppc__)
-# define KEY '_','_','p','p','c','_','_'
-#elif defined(__ppc64__)
-# define KEY '_','_','p','p','c','6','4','_','_'
-#endif
-
-#define SIZE (sizeof(ssize_t))
-char info_size[] =  {'I', 'N', 'F', 'O', ':', 's','i','z','e','[',
-  ('0' + ((SIZE / 10000)%10)),
-  ('0' + ((SIZE / 1000)%10)),
-  ('0' + ((SIZE / 100)%10)),
-  ('0' + ((SIZE / 10)%10)),
-  ('0' +  (SIZE    % 10)),
-  ']',
-#ifdef KEY
-  ' ','k','e','y','[', KEY, ']',
-#endif
-  '\0'};
-
-#ifdef __CLASSIC_C__
-int main(argc, argv) int argc; char *argv[];
-#else
-int main(int argc, char *argv[])
-#endif
-{
-  int require = 0;
-  require += info_size[argc];
-  (void)argv;
-  return require;
-}
diff --git a/CMakeFiles/FortranCInterface/CMakeCache.txt b/CMakeFiles/FortranCInterface/CMakeCache.txt
deleted file mode 100644
index 10231bb..0000000
--- a/CMakeFiles/FortranCInterface/CMakeCache.txt
+++ /dev/null
@@ -1,250 +0,0 @@
-# This is the CMakeCache file.
-# For build in directory: /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface
-# It was generated by CMake: /usr/local/apps/cmake/2.8.10/bin/cmake
-# You can edit this file to change values found and used by cmake.
-# If you do not want to change any of the values, simply exit the editor.
-# If you do want to change a value, simply edit, save, and exit the editor.
-# The syntax for the file is as follows:
-# KEY:TYPE=VALUE
-# KEY is the name of a variable in the cache.
-# TYPE is a hint to GUI's for the type of VALUE, DO NOT EDIT TYPE!.
-# VALUE is the current value for the KEY.
-
-########################
-# EXTERNAL cache entries
-########################
-
-//Choose the type of build, options are: None(CMAKE_CXX_FLAGS or
-// CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.
-CMAKE_BUILD_TYPE:STRING=
-
-//Enable/Disable color output during build.
-CMAKE_COLOR_MAKEFILE:BOOL=ON
-
-//C compiler.
-CMAKE_C_COMPILER:FILEPATH=/usr/bin/cc
-
-//No help, variable specified on the command line.
-CMAKE_C_FLAGS:STRING= -pipe
-
-//Flags used by the compiler during debug builds.
-CMAKE_C_FLAGS_DEBUG:STRING=-g
-
-//Flags used by the compiler during release minsize builds.
-CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
-
-//Flags used by the compiler during release builds (/MD /Ob1 /Oi
-// /Ot /Oy /Gs will produce slightly less optimized but smaller
-// files).
-CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
-
-//Flags used by the compiler during Release with Debug Info builds.
-CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
-
-//Flags used by the linker.
-CMAKE_EXE_LINKER_FLAGS:STRING=' '
-
-//Flags used by the linker during debug builds.
-CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=
-
-//Flags used by the linker during release minsize builds.
-CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=
-
-//Flags used by the linker during release builds.
-CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=
-
-//Flags used by the linker during Release with Debug Info builds.
-CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
-
-//Enable/Disable output of compile commands during generation.
-CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF
-
-//Fortran compiler.
-CMAKE_Fortran_COMPILER:FILEPATH=/usr/bin/gfortran
-
-//No help, variable specified on the command line.
-CMAKE_Fortran_FLAGS:STRING=
-
-//Flags used by the compiler during debug builds.
-CMAKE_Fortran_FLAGS_DEBUG:STRING=-g
-
-//Flags used by the compiler during release minsize builds.
-CMAKE_Fortran_FLAGS_MINSIZEREL:STRING=-Os
-
-//Flags used by the compiler during release builds (/MD /Ob1 /Oi
-// /Ot /Oy /Gs will produce slightly less optimized but smaller
-// files).
-CMAKE_Fortran_FLAGS_RELEASE:STRING=-O3
-
-//Flags used by the compiler during Release with Debug Info builds.
-CMAKE_Fortran_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
-
-//Install path prefix, prepended onto install directories.
-CMAKE_INSTALL_PREFIX:PATH=/usr/local
-
-//make program
-CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/gmake
-
-//Flags used by the linker during the creation of modules.
-CMAKE_MODULE_LINKER_FLAGS:STRING=' '
-
-//Flags used by the linker during debug builds.
-CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=
-
-//Flags used by the linker during release minsize builds.
-CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=
-
-//Flags used by the linker during release builds.
-CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=
-
-//Flags used by the linker during Release with Debug Info builds.
-CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
-
-//Value Computed by CMake
-CMAKE_PROJECT_NAME:STATIC=FortranCInterface
-
-//Flags used by the linker during the creation of dll's.
-CMAKE_SHARED_LINKER_FLAGS:STRING=' '
-
-//Flags used by the linker during debug builds.
-CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=
-
-//Flags used by the linker during release minsize builds.
-CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=
-
-//Flags used by the linker during release builds.
-CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=
-
-//Flags used by the linker during Release with Debug Info builds.
-CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=
-
-//If set, runtime paths are not added when installing shared libraries,
-// but are added when building.
-CMAKE_SKIP_INSTALL_RPATH:BOOL=NO
-
-//If set, runtime paths are not added when using shared libraries.
-CMAKE_SKIP_RPATH:BOOL=NO
-
-//If true, cmake will use relative paths in makefiles and projects.
-CMAKE_USE_RELATIVE_PATHS:BOOL=OFF
-
-//If this value is on, makefiles will be generated without the
-// .SILENT directive, and all commands will be echoed to the console
-// during the make.  This is useful for debugging only. With Visual
-// Studio IDE projects all commands are done without /nologo.
-CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE
-
-//Value Computed by CMake
-FortranCInterface_BINARY_DIR:STATIC=/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface
-
-//Value Computed by CMake
-FortranCInterface_SOURCE_DIR:STATIC=/usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface
-
-//Dependencies for target
-myfort_LIB_DEPENDS:STATIC=
-
-//Dependencies for the target
-symbols_LIB_DEPENDS:STATIC=general;myfort;
-
-
-########################
-# INTERNAL cache entries
-########################
-
-//ADVANCED property for variable: CMAKE_BUILD_TOOL
-CMAKE_BUILD_TOOL-ADVANCED:INTERNAL=1
-//What is the target build tool cmake is generating for.
-CMAKE_BUILD_TOOL:INTERNAL=/usr/bin/gmake
-//This is the directory where this CMakeCache.txt was created
-CMAKE_CACHEFILE_DIR:INTERNAL=/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface
-//Major version of cmake used to create the current loaded cache
-CMAKE_CACHE_MAJOR_VERSION:INTERNAL=2
-//Minor version of cmake used to create the current loaded cache
-CMAKE_CACHE_MINOR_VERSION:INTERNAL=8
-//Patch version of cmake used to create the current loaded cache
-CMAKE_CACHE_PATCH_VERSION:INTERNAL=10
-//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE
-CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1
-//Path to CMake executable.
-CMAKE_COMMAND:INTERNAL=/usr/local/apps/cmake/2.8.10/bin/cmake
-//Path to cpack program executable.
-CMAKE_CPACK_COMMAND:INTERNAL=/usr/local/apps/cmake/2.8.10/bin/cpack
-//Path to ctest program executable.
-CMAKE_CTEST_COMMAND:INTERNAL=/usr/local/apps/cmake/2.8.10/bin/ctest
-//ADVANCED property for variable: CMAKE_C_FLAGS
-CMAKE_C_FLAGS-ADVANCED:INTERNAL=1
-//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG
-CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1
-//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL
-CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
-//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE
-CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1
-//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO
-CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
-//Path to cache edit program executable.
-CMAKE_EDIT_COMMAND:INTERNAL=/usr/local/apps/cmake/2.8.10/bin/ccmake
-//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS
-CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1
-//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG
-CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
-//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL
-CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
-//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE
-CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
-//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
-CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
-//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS
-CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1
-//ADVANCED property for variable: CMAKE_Fortran_FLAGS
-CMAKE_Fortran_FLAGS-ADVANCED:INTERNAL=1
-//ADVANCED property for variable: CMAKE_Fortran_FLAGS_DEBUG
-CMAKE_Fortran_FLAGS_DEBUG-ADVANCED:INTERNAL=1
-//ADVANCED property for variable: CMAKE_Fortran_FLAGS_MINSIZEREL
-CMAKE_Fortran_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
-//ADVANCED property for variable: CMAKE_Fortran_FLAGS_RELEASE
-CMAKE_Fortran_FLAGS_RELEASE-ADVANCED:INTERNAL=1
-//ADVANCED property for variable: CMAKE_Fortran_FLAGS_RELWITHDEBINFO
-CMAKE_Fortran_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
-//Name of generator.
-CMAKE_GENERATOR:INTERNAL=Unix Makefiles
-//Start directory with the top level CMakeLists.txt file for this
-// project
-CMAKE_HOME_DIRECTORY:INTERNAL=/usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface
-//Install .so files without execute permission.
-CMAKE_INSTALL_SO_NO_EXE:INTERNAL=0
-//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS
-CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1
-//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG
-CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
-//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL
-CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
-//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE
-CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
-//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
-CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
-//number of local generators
-CMAKE_NUMBER_OF_LOCAL_GENERATORS:INTERNAL=1
-//Path to CMake installation.
-CMAKE_ROOT:INTERNAL=/usr/local/apps/cmake/2.8.10/share/cmake-2.8
-//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS
-CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1
-//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG
-CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
-//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL
-CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
-//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE
-CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
-//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
-CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
-//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH
-CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1
-//ADVANCED property for variable: CMAKE_SKIP_RPATH
-CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1
-CMAKE_SUPPRESS_DEVELOPER_WARNINGS:INTERNAL=FALSE
-//ADVANCED property for variable: CMAKE_USE_RELATIVE_PATHS
-CMAKE_USE_RELATIVE_PATHS-ADVANCED:INTERNAL=1
-//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE
-CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1
-//Test C_SUPPORTS_DOLLAR
-C_SUPPORTS_DOLLAR:INTERNAL=1
-
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/CMakeDirectoryInformation.cmake b/CMakeFiles/FortranCInterface/CMakeFiles/CMakeDirectoryInformation.cmake
deleted file mode 100644
index e2f91b2..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/CMakeDirectoryInformation.cmake
+++ /dev/null
@@ -1,16 +0,0 @@
-# CMAKE generated file: DO NOT EDIT!
-# Generated by "Unix Makefiles" Generator, CMake Version 2.8
-
-# Relative path conversion top directories.
-SET(CMAKE_RELATIVE_PATH_TOP_SOURCE "/usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface")
-SET(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface")
-
-# Force unix paths in dependencies.
-SET(CMAKE_FORCE_UNIX_PATHS 1)
-
-
-# The C and CXX include file regular expressions for this directory.
-SET(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$")
-SET(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$")
-SET(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN})
-SET(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN})
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/FortranCInterface.dir/DependInfo.cmake b/CMakeFiles/FortranCInterface/CMakeFiles/FortranCInterface.dir/DependInfo.cmake
deleted file mode 100644
index b0a884f..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/FortranCInterface.dir/DependInfo.cmake
+++ /dev/null
@@ -1,24 +0,0 @@
-# The set of languages for which implicit dependencies are needed:
-SET(CMAKE_DEPENDS_LANGUAGES
-  "Fortran"
-  )
-# The set of files for implicit dependencies of each language:
-SET(CMAKE_DEPENDS_CHECK_Fortran
-  "/usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/call_mod.f90" "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/FortranCInterface.dir/call_mod.f90.o"
-  "/usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/call_sub.f" "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/FortranCInterface.dir/call_sub.f.o"
-  "/usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/main.F" "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/FortranCInterface.dir/main.F.o"
-  )
-SET(CMAKE_Fortran_COMPILER_ID "GNU")
-
-# Targets to which this target links.
-SET(CMAKE_TARGET_LINKED_INFO_FILES
-  "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/DependInfo.cmake"
-  "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/DependInfo.cmake"
-  )
-
-# The include file search paths:
-SET(CMAKE_C_TARGET_INCLUDE_PATH
-  )
-SET(CMAKE_CXX_TARGET_INCLUDE_PATH ${CMAKE_C_TARGET_INCLUDE_PATH})
-SET(CMAKE_Fortran_TARGET_INCLUDE_PATH ${CMAKE_C_TARGET_INCLUDE_PATH})
-SET(CMAKE_ASM_TARGET_INCLUDE_PATH ${CMAKE_C_TARGET_INCLUDE_PATH})
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/FortranCInterface.dir/build.make b/CMakeFiles/FortranCInterface/CMakeFiles/FortranCInterface.dir/build.make
deleted file mode 100644
index fd041f6..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/FortranCInterface.dir/build.make
+++ /dev/null
@@ -1,135 +0,0 @@
-# CMAKE generated file: DO NOT EDIT!
-# Generated by "Unix Makefiles" Generator, CMake Version 2.8
-
-#=============================================================================
-# Special targets provided by cmake.
-
-# Disable implicit rules so canonical targets will work.
-.SUFFIXES:
-
-# Remove some rules from gmake that .SUFFIXES does not remove.
-SUFFIXES =
-
-.SUFFIXES: .hpux_make_needs_suffix_list
-
-# Suppress display of executed commands.
-$(VERBOSE).SILENT:
-
-# A target that is always out of date.
-cmake_force:
-.PHONY : cmake_force
-
-#=============================================================================
-# Set environment variables for the build.
-
-# The shell in which to execute make rules.
-SHELL = /bin/sh
-
-# The CMake executable.
-CMAKE_COMMAND = /usr/local/apps/cmake/2.8.10/bin/cmake
-
-# The command to remove a file.
-RM = /usr/local/apps/cmake/2.8.10/bin/cmake -E remove -f
-
-# Escaping for special characters.
-EQUALS = =
-
-# The program to use to edit the cache.
-CMAKE_EDIT_COMMAND = /usr/local/apps/cmake/2.8.10/bin/ccmake
-
-# The top-level source directory on which CMake was run.
-CMAKE_SOURCE_DIR = /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface
-
-# The top-level build directory on which CMake was run.
-CMAKE_BINARY_DIR = /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface
-
-# Include any dependencies generated for this target.
-include CMakeFiles/FortranCInterface.dir/depend.make
-
-# Include the progress variables for this target.
-include CMakeFiles/FortranCInterface.dir/progress.make
-
-# Include the compile flags for this target's objects.
-include CMakeFiles/FortranCInterface.dir/flags.make
-
-CMakeFiles/FortranCInterface.dir/main.F.o: CMakeFiles/FortranCInterface.dir/flags.make
-CMakeFiles/FortranCInterface.dir/main.F.o: /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/main.F
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles $(CMAKE_PROGRESS_1)
-	@echo "Building Fortran object CMakeFiles/FortranCInterface.dir/main.F.o"
-	/usr/bin/gfortran  $(Fortran_DEFINES) -DCALL_MOD $(Fortran_FLAGS) -c /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/main.F -o CMakeFiles/FortranCInterface.dir/main.F.o
-
-CMakeFiles/FortranCInterface.dir/main.F.o.requires:
-.PHONY : CMakeFiles/FortranCInterface.dir/main.F.o.requires
-
-CMakeFiles/FortranCInterface.dir/main.F.o.provides: CMakeFiles/FortranCInterface.dir/main.F.o.requires
-	$(MAKE) -f CMakeFiles/FortranCInterface.dir/build.make CMakeFiles/FortranCInterface.dir/main.F.o.provides.build
-.PHONY : CMakeFiles/FortranCInterface.dir/main.F.o.provides
-
-CMakeFiles/FortranCInterface.dir/main.F.o.provides.build: CMakeFiles/FortranCInterface.dir/main.F.o
-
-CMakeFiles/FortranCInterface.dir/call_sub.f.o: CMakeFiles/FortranCInterface.dir/flags.make
-CMakeFiles/FortranCInterface.dir/call_sub.f.o: /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/call_sub.f
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles $(CMAKE_PROGRESS_2)
-	@echo "Building Fortran object CMakeFiles/FortranCInterface.dir/call_sub.f.o"
-	/usr/bin/gfortran  $(Fortran_DEFINES) $(Fortran_FLAGS) -c /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/call_sub.f -o CMakeFiles/FortranCInterface.dir/call_sub.f.o
-
-CMakeFiles/FortranCInterface.dir/call_sub.f.o.requires:
-.PHONY : CMakeFiles/FortranCInterface.dir/call_sub.f.o.requires
-
-CMakeFiles/FortranCInterface.dir/call_sub.f.o.provides: CMakeFiles/FortranCInterface.dir/call_sub.f.o.requires
-	$(MAKE) -f CMakeFiles/FortranCInterface.dir/build.make CMakeFiles/FortranCInterface.dir/call_sub.f.o.provides.build
-.PHONY : CMakeFiles/FortranCInterface.dir/call_sub.f.o.provides
-
-CMakeFiles/FortranCInterface.dir/call_sub.f.o.provides.build: CMakeFiles/FortranCInterface.dir/call_sub.f.o
-
-CMakeFiles/FortranCInterface.dir/call_mod.f90.o: CMakeFiles/FortranCInterface.dir/flags.make
-CMakeFiles/FortranCInterface.dir/call_mod.f90.o: /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/call_mod.f90
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles $(CMAKE_PROGRESS_3)
-	@echo "Building Fortran object CMakeFiles/FortranCInterface.dir/call_mod.f90.o"
-	/usr/bin/gfortran  $(Fortran_DEFINES) $(Fortran_FLAGS) -c /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/call_mod.f90 -o CMakeFiles/FortranCInterface.dir/call_mod.f90.o
-
-CMakeFiles/FortranCInterface.dir/call_mod.f90.o.requires:
-.PHONY : CMakeFiles/FortranCInterface.dir/call_mod.f90.o.requires
-
-CMakeFiles/FortranCInterface.dir/call_mod.f90.o.provides: CMakeFiles/FortranCInterface.dir/call_mod.f90.o.requires
-	$(MAKE) -f CMakeFiles/FortranCInterface.dir/build.make CMakeFiles/FortranCInterface.dir/call_mod.f90.o.provides.build
-.PHONY : CMakeFiles/FortranCInterface.dir/call_mod.f90.o.provides
-
-CMakeFiles/FortranCInterface.dir/call_mod.f90.o.provides.build: CMakeFiles/FortranCInterface.dir/call_mod.f90.o
-
-# Object files for target FortranCInterface
-FortranCInterface_OBJECTS = \
-"CMakeFiles/FortranCInterface.dir/main.F.o" \
-"CMakeFiles/FortranCInterface.dir/call_sub.f.o" \
-"CMakeFiles/FortranCInterface.dir/call_mod.f90.o"
-
-# External object files for target FortranCInterface
-FortranCInterface_EXTERNAL_OBJECTS =
-
-FortranCInterface: CMakeFiles/FortranCInterface.dir/main.F.o
-FortranCInterface: CMakeFiles/FortranCInterface.dir/call_sub.f.o
-FortranCInterface: CMakeFiles/FortranCInterface.dir/call_mod.f90.o
-FortranCInterface: CMakeFiles/FortranCInterface.dir/build.make
-FortranCInterface: libsymbols.a
-FortranCInterface: libmyfort.a
-FortranCInterface: CMakeFiles/FortranCInterface.dir/link.txt
-	@echo "Linking Fortran executable FortranCInterface"
-	$(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/FortranCInterface.dir/link.txt --verbose=$(VERBOSE)
-
-# Rule to build all files generated by this target.
-CMakeFiles/FortranCInterface.dir/build: FortranCInterface
-.PHONY : CMakeFiles/FortranCInterface.dir/build
-
-CMakeFiles/FortranCInterface.dir/requires: CMakeFiles/FortranCInterface.dir/main.F.o.requires
-CMakeFiles/FortranCInterface.dir/requires: CMakeFiles/FortranCInterface.dir/call_sub.f.o.requires
-CMakeFiles/FortranCInterface.dir/requires: CMakeFiles/FortranCInterface.dir/call_mod.f90.o.requires
-.PHONY : CMakeFiles/FortranCInterface.dir/requires
-
-CMakeFiles/FortranCInterface.dir/clean:
-	$(CMAKE_COMMAND) -P CMakeFiles/FortranCInterface.dir/cmake_clean.cmake
-.PHONY : CMakeFiles/FortranCInterface.dir/clean
-
-CMakeFiles/FortranCInterface.dir/depend:
-	cd /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/FortranCInterface.dir/DependInfo.cmake
-.PHONY : CMakeFiles/FortranCInterface.dir/depend
-
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/FortranCInterface.dir/cmake_clean.cmake b/CMakeFiles/FortranCInterface/CMakeFiles/FortranCInterface.dir/cmake_clean.cmake
deleted file mode 100644
index 5af146e..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/FortranCInterface.dir/cmake_clean.cmake
+++ /dev/null
@@ -1,12 +0,0 @@
-FILE(REMOVE_RECURSE
-  "CMakeFiles/FortranCInterface.dir/main.F.o"
-  "CMakeFiles/FortranCInterface.dir/call_sub.f.o"
-  "CMakeFiles/FortranCInterface.dir/call_mod.f90.o"
-  "FortranCInterface.pdb"
-  "FortranCInterface"
-)
-
-# Per-language clean rules from dependency scanning.
-FOREACH(lang Fortran)
-  INCLUDE(CMakeFiles/FortranCInterface.dir/cmake_clean_${lang}.cmake OPTIONAL)
-ENDFOREACH(lang)
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/FortranCInterface.dir/depend.internal b/CMakeFiles/FortranCInterface/CMakeFiles/FortranCInterface.dir/depend.internal
deleted file mode 100644
index 248b5e7..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/FortranCInterface.dir/depend.internal
+++ /dev/null
@@ -1,9 +0,0 @@
-# CMAKE generated file: DO NOT EDIT!
-# Generated by "Unix Makefiles" Generator, CMake Version 2.8
-
-CMakeFiles/FortranCInterface.dir/call_mod.f90.o
- /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/call_mod.f90
-CMakeFiles/FortranCInterface.dir/call_sub.f.o
- /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/call_sub.f
-CMakeFiles/FortranCInterface.dir/main.F.o
- /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/main.F
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/FortranCInterface.dir/depend.make b/CMakeFiles/FortranCInterface/CMakeFiles/FortranCInterface.dir/depend.make
deleted file mode 100644
index 9ab8a82..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/FortranCInterface.dir/depend.make
+++ /dev/null
@@ -1,8 +0,0 @@
-# CMAKE generated file: DO NOT EDIT!
-# Generated by "Unix Makefiles" Generator, CMake Version 2.8
-
-
-CMakeFiles/FortranCInterface.dir/call_mod.f90.o: CMakeFiles/myfort.dir/my_module.mod.stamp
-CMakeFiles/FortranCInterface.dir/call_mod.f90.o: CMakeFiles/myfort.dir/mymodule.mod.stamp
-
-
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/FortranCInterface.dir/flags.make b/CMakeFiles/FortranCInterface/CMakeFiles/FortranCInterface.dir/flags.make
deleted file mode 100644
index c1100d4..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/FortranCInterface.dir/flags.make
+++ /dev/null
@@ -1,10 +0,0 @@
-# CMAKE generated file: DO NOT EDIT!
-# Generated by "Unix Makefiles" Generator, CMake Version 2.8
-
-# compile Fortran with /usr/bin/gfortran
-Fortran_FLAGS =  
-
-Fortran_DEFINES = 
-
-# Custom defines: CMakeFiles/FortranCInterface.dir/main.F.o_DEFINES = CALL_MOD
-
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/FortranCInterface.dir/fortran.internal b/CMakeFiles/FortranCInterface/CMakeFiles/FortranCInterface.dir/fortran.internal
deleted file mode 100644
index 1b732d3..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/FortranCInterface.dir/fortran.internal
+++ /dev/null
@@ -1,2 +0,0 @@
-# The fortran modules provided by this target.
-provides
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/FortranCInterface.dir/link.txt b/CMakeFiles/FortranCInterface/CMakeFiles/FortranCInterface.dir/link.txt
deleted file mode 100644
index d1c3388..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/FortranCInterface.dir/link.txt
+++ /dev/null
@@ -1 +0,0 @@
-/usr/bin/gfortran      CMakeFiles/FortranCInterface.dir/main.F.o CMakeFiles/FortranCInterface.dir/call_sub.f.o CMakeFiles/FortranCInterface.dir/call_mod.f90.o  -o FortranCInterface -rdynamic libsymbols.a libmyfort.a 
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/FortranCInterface.dir/progress.make b/CMakeFiles/FortranCInterface/CMakeFiles/FortranCInterface.dir/progress.make
deleted file mode 100644
index 6a9dc74..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/FortranCInterface.dir/progress.make
+++ /dev/null
@@ -1,4 +0,0 @@
-CMAKE_PROGRESS_1 = 1
-CMAKE_PROGRESS_2 = 2
-CMAKE_PROGRESS_3 = 3
-
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/Makefile.cmake b/CMakeFiles/FortranCInterface/CMakeFiles/Makefile.cmake
deleted file mode 100644
index 253c472..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/Makefile.cmake
+++ /dev/null
@@ -1,50 +0,0 @@
-# CMAKE generated file: DO NOT EDIT!
-# Generated by "Unix Makefiles" Generator, CMake Version 2.8
-
-# The generator used is:
-SET(CMAKE_DEPENDS_GENERATOR "Unix Makefiles")
-
-# The top level Makefile was generated from the following files:
-SET(CMAKE_MAKEFILE_DEPENDS
-  "CMakeCache.txt"
-  "/home/graphics/cgs/git/magics/CMakeFiles/2.8.10.2/CMakeCCompiler.cmake"
-  "/home/graphics/cgs/git/magics/CMakeFiles/2.8.10.2/CMakeFortranCompiler.cmake"
-  "/home/graphics/cgs/git/magics/CMakeFiles/2.8.10.2/CMakeSystem.cmake"
-  "Input.cmake"
-  "/usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/CMakeCInformation.cmake"
-  "/usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/CMakeCommonLanguageInclude.cmake"
-  "/usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/CMakeExpandImportedTargets.cmake"
-  "/usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/CMakeFortranInformation.cmake"
-  "/usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/CMakeGenericSystem.cmake"
-  "/usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/CMakeParseArguments.cmake"
-  "/usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/CMakeSystemSpecificInformation.cmake"
-  "/usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/CheckCSourceCompiles.cmake"
-  "/usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/Compiler/GNU-C.cmake"
-  "/usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/Compiler/GNU-Fortran.cmake"
-  "/usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/Compiler/GNU.cmake"
-  "/usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/CMakeLists.txt"
-  "/usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/symbol.c.in"
-  "/usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/Platform/Linux-GNU-C.cmake"
-  "/usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/Platform/Linux-GNU-Fortran.cmake"
-  "/usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/Platform/Linux-GNU.cmake"
-  "/usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/Platform/Linux.cmake"
-  "/usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/Platform/UnixPaths.cmake"
-  )
-
-# The corresponding makefile is:
-SET(CMAKE_MAKEFILE_OUTPUTS
-  "Makefile"
-  "CMakeFiles/cmake.check_cache"
-  )
-
-# Byproducts of CMake generate step:
-SET(CMAKE_MAKEFILE_PRODUCTS
-  "CMakeFiles/CMakeDirectoryInformation.cmake"
-  )
-
-# Dependency information for all targets:
-SET(CMAKE_DEPEND_INFO_FILES
-  "CMakeFiles/FortranCInterface.dir/DependInfo.cmake"
-  "CMakeFiles/myfort.dir/DependInfo.cmake"
-  "CMakeFiles/symbols.dir/DependInfo.cmake"
-  )
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/Makefile2 b/CMakeFiles/FortranCInterface/CMakeFiles/Makefile2
deleted file mode 100644
index eeeba5d..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/Makefile2
+++ /dev/null
@@ -1,174 +0,0 @@
-# CMAKE generated file: DO NOT EDIT!
-# Generated by "Unix Makefiles" Generator, CMake Version 2.8
-
-# Default target executed when no arguments are given to make.
-default_target: all
-.PHONY : default_target
-
-# The main recursive all target
-all:
-.PHONY : all
-
-# The main recursive preinstall target
-preinstall:
-.PHONY : preinstall
-
-#=============================================================================
-# Special targets provided by cmake.
-
-# Disable implicit rules so canonical targets will work.
-.SUFFIXES:
-
-# Remove some rules from gmake that .SUFFIXES does not remove.
-SUFFIXES =
-
-.SUFFIXES: .hpux_make_needs_suffix_list
-
-# Suppress display of executed commands.
-$(VERBOSE).SILENT:
-
-# A target that is always out of date.
-cmake_force:
-.PHONY : cmake_force
-
-#=============================================================================
-# Set environment variables for the build.
-
-# The shell in which to execute make rules.
-SHELL = /bin/sh
-
-# The CMake executable.
-CMAKE_COMMAND = /usr/local/apps/cmake/2.8.10/bin/cmake
-
-# The command to remove a file.
-RM = /usr/local/apps/cmake/2.8.10/bin/cmake -E remove -f
-
-# Escaping for special characters.
-EQUALS = =
-
-# The program to use to edit the cache.
-CMAKE_EDIT_COMMAND = /usr/local/apps/cmake/2.8.10/bin/ccmake
-
-# The top-level source directory on which CMake was run.
-CMAKE_SOURCE_DIR = /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface
-
-# The top-level build directory on which CMake was run.
-CMAKE_BINARY_DIR = /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface
-
-#=============================================================================
-# Target rules for target CMakeFiles/FortranCInterface.dir
-
-# All Build rule for target.
-CMakeFiles/FortranCInterface.dir/all: CMakeFiles/symbols.dir/all
-	$(MAKE) -f CMakeFiles/FortranCInterface.dir/build.make CMakeFiles/FortranCInterface.dir/depend
-	$(MAKE) -f CMakeFiles/FortranCInterface.dir/build.make CMakeFiles/FortranCInterface.dir/requires
-	$(MAKE) -f CMakeFiles/FortranCInterface.dir/build.make CMakeFiles/FortranCInterface.dir/build
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles  1 2 3
-	@echo "Built target FortranCInterface"
-.PHONY : CMakeFiles/FortranCInterface.dir/all
-
-# Include target in all.
-all: CMakeFiles/FortranCInterface.dir/all
-.PHONY : all
-
-# Build rule for subdir invocation for target.
-CMakeFiles/FortranCInterface.dir/rule: cmake_check_build_system
-	$(CMAKE_COMMAND) -E cmake_progress_start /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles 32
-	$(MAKE) -f CMakeFiles/Makefile2 CMakeFiles/FortranCInterface.dir/all
-	$(CMAKE_COMMAND) -E cmake_progress_start /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles 0
-.PHONY : CMakeFiles/FortranCInterface.dir/rule
-
-# Convenience name for target.
-FortranCInterface: CMakeFiles/FortranCInterface.dir/rule
-.PHONY : FortranCInterface
-
-# clean rule for target.
-CMakeFiles/FortranCInterface.dir/clean:
-	$(MAKE) -f CMakeFiles/FortranCInterface.dir/build.make CMakeFiles/FortranCInterface.dir/clean
-.PHONY : CMakeFiles/FortranCInterface.dir/clean
-
-# clean rule for target.
-clean: CMakeFiles/FortranCInterface.dir/clean
-.PHONY : clean
-
-#=============================================================================
-# Target rules for target CMakeFiles/myfort.dir
-
-# All Build rule for target.
-CMakeFiles/myfort.dir/all:
-	$(MAKE) -f CMakeFiles/myfort.dir/build.make CMakeFiles/myfort.dir/depend
-	$(MAKE) -f CMakeFiles/myfort.dir/build.make CMakeFiles/myfort.dir/requires
-	$(MAKE) -f CMakeFiles/myfort.dir/build.make CMakeFiles/myfort.dir/build
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles  4 5 6 7
-	@echo "Built target myfort"
-.PHONY : CMakeFiles/myfort.dir/all
-
-# Include target in all.
-all: CMakeFiles/myfort.dir/all
-.PHONY : all
-
-# Build rule for subdir invocation for target.
-CMakeFiles/myfort.dir/rule: cmake_check_build_system
-	$(CMAKE_COMMAND) -E cmake_progress_start /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles 4
-	$(MAKE) -f CMakeFiles/Makefile2 CMakeFiles/myfort.dir/all
-	$(CMAKE_COMMAND) -E cmake_progress_start /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles 0
-.PHONY : CMakeFiles/myfort.dir/rule
-
-# Convenience name for target.
-myfort: CMakeFiles/myfort.dir/rule
-.PHONY : myfort
-
-# clean rule for target.
-CMakeFiles/myfort.dir/clean:
-	$(MAKE) -f CMakeFiles/myfort.dir/build.make CMakeFiles/myfort.dir/clean
-.PHONY : CMakeFiles/myfort.dir/clean
-
-# clean rule for target.
-clean: CMakeFiles/myfort.dir/clean
-.PHONY : clean
-
-#=============================================================================
-# Target rules for target CMakeFiles/symbols.dir
-
-# All Build rule for target.
-CMakeFiles/symbols.dir/all: CMakeFiles/myfort.dir/all
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/depend
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/build
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles  8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
-	@echo "Built target symbols"
-.PHONY : CMakeFiles/symbols.dir/all
-
-# Include target in all.
-all: CMakeFiles/symbols.dir/all
-.PHONY : all
-
-# Build rule for subdir invocation for target.
-CMakeFiles/symbols.dir/rule: cmake_check_build_system
-	$(CMAKE_COMMAND) -E cmake_progress_start /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles 29
-	$(MAKE) -f CMakeFiles/Makefile2 CMakeFiles/symbols.dir/all
-	$(CMAKE_COMMAND) -E cmake_progress_start /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles 0
-.PHONY : CMakeFiles/symbols.dir/rule
-
-# Convenience name for target.
-symbols: CMakeFiles/symbols.dir/rule
-.PHONY : symbols
-
-# clean rule for target.
-CMakeFiles/symbols.dir/clean:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/clean
-.PHONY : CMakeFiles/symbols.dir/clean
-
-# clean rule for target.
-clean: CMakeFiles/symbols.dir/clean
-.PHONY : clean
-
-#=============================================================================
-# Special targets to cleanup operation of make.
-
-# Special rule to run CMake to check the build system integrity.
-# No rule that depends on this can have commands that come from listfiles
-# because they might be regenerated.
-cmake_check_build_system:
-	$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
-.PHONY : cmake_check_build_system
-
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/TargetDirectories.txt b/CMakeFiles/FortranCInterface/CMakeFiles/TargetDirectories.txt
deleted file mode 100644
index 692cd49..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/TargetDirectories.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/FortranCInterface.dir
-/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir
-/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/cmake.check_cache b/CMakeFiles/FortranCInterface/CMakeFiles/cmake.check_cache
deleted file mode 100644
index 3dccd73..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/cmake.check_cache
+++ /dev/null
@@ -1 +0,0 @@
-# This file is generated by cmake for dependency checking of the CMakeCache.txt file
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/DependInfo.cmake b/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/DependInfo.cmake
deleted file mode 100644
index b237eeb..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/DependInfo.cmake
+++ /dev/null
@@ -1,23 +0,0 @@
-# The set of languages for which implicit dependencies are needed:
-SET(CMAKE_DEPENDS_LANGUAGES
-  "Fortran"
-  )
-# The set of files for implicit dependencies of each language:
-SET(CMAKE_DEPENDS_CHECK_Fortran
-  "/usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/my_module.f90" "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/my_module.f90.o"
-  "/usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/my_sub.f" "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/my_sub.f.o"
-  "/usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/mymodule.f90" "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/mymodule.f90.o"
-  "/usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/mysub.f" "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/mysub.f.o"
-  )
-SET(CMAKE_Fortran_COMPILER_ID "GNU")
-
-# Targets to which this target links.
-SET(CMAKE_TARGET_LINKED_INFO_FILES
-  )
-
-# The include file search paths:
-SET(CMAKE_C_TARGET_INCLUDE_PATH
-  )
-SET(CMAKE_CXX_TARGET_INCLUDE_PATH ${CMAKE_C_TARGET_INCLUDE_PATH})
-SET(CMAKE_Fortran_TARGET_INCLUDE_PATH ${CMAKE_C_TARGET_INCLUDE_PATH})
-SET(CMAKE_ASM_TARGET_INCLUDE_PATH ${CMAKE_C_TARGET_INCLUDE_PATH})
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/build.make b/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/build.make
deleted file mode 100644
index 7439aba..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/build.make
+++ /dev/null
@@ -1,152 +0,0 @@
-# CMAKE generated file: DO NOT EDIT!
-# Generated by "Unix Makefiles" Generator, CMake Version 2.8
-
-#=============================================================================
-# Special targets provided by cmake.
-
-# Disable implicit rules so canonical targets will work.
-.SUFFIXES:
-
-# Remove some rules from gmake that .SUFFIXES does not remove.
-SUFFIXES =
-
-.SUFFIXES: .hpux_make_needs_suffix_list
-
-# Suppress display of executed commands.
-$(VERBOSE).SILENT:
-
-# A target that is always out of date.
-cmake_force:
-.PHONY : cmake_force
-
-#=============================================================================
-# Set environment variables for the build.
-
-# The shell in which to execute make rules.
-SHELL = /bin/sh
-
-# The CMake executable.
-CMAKE_COMMAND = /usr/local/apps/cmake/2.8.10/bin/cmake
-
-# The command to remove a file.
-RM = /usr/local/apps/cmake/2.8.10/bin/cmake -E remove -f
-
-# Escaping for special characters.
-EQUALS = =
-
-# The program to use to edit the cache.
-CMAKE_EDIT_COMMAND = /usr/local/apps/cmake/2.8.10/bin/ccmake
-
-# The top-level source directory on which CMake was run.
-CMAKE_SOURCE_DIR = /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface
-
-# The top-level build directory on which CMake was run.
-CMAKE_BINARY_DIR = /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface
-
-# Include any dependencies generated for this target.
-include CMakeFiles/myfort.dir/depend.make
-
-# Include the progress variables for this target.
-include CMakeFiles/myfort.dir/progress.make
-
-# Include the compile flags for this target's objects.
-include CMakeFiles/myfort.dir/flags.make
-
-CMakeFiles/myfort.dir/mysub.f.o: CMakeFiles/myfort.dir/flags.make
-CMakeFiles/myfort.dir/mysub.f.o: /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/mysub.f
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles $(CMAKE_PROGRESS_1)
-	@echo "Building Fortran object CMakeFiles/myfort.dir/mysub.f.o"
-	/usr/bin/gfortran  $(Fortran_DEFINES) $(Fortran_FLAGS) -c /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/mysub.f -o CMakeFiles/myfort.dir/mysub.f.o
-
-CMakeFiles/myfort.dir/mysub.f.o.requires:
-.PHONY : CMakeFiles/myfort.dir/mysub.f.o.requires
-
-CMakeFiles/myfort.dir/mysub.f.o.provides: CMakeFiles/myfort.dir/mysub.f.o.requires
-	$(MAKE) -f CMakeFiles/myfort.dir/build.make CMakeFiles/myfort.dir/mysub.f.o.provides.build
-.PHONY : CMakeFiles/myfort.dir/mysub.f.o.provides
-
-CMakeFiles/myfort.dir/mysub.f.o.provides.build: CMakeFiles/myfort.dir/mysub.f.o
-
-CMakeFiles/myfort.dir/my_sub.f.o: CMakeFiles/myfort.dir/flags.make
-CMakeFiles/myfort.dir/my_sub.f.o: /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/my_sub.f
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles $(CMAKE_PROGRESS_2)
-	@echo "Building Fortran object CMakeFiles/myfort.dir/my_sub.f.o"
-	/usr/bin/gfortran  $(Fortran_DEFINES) $(Fortran_FLAGS) -c /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/my_sub.f -o CMakeFiles/myfort.dir/my_sub.f.o
-
-CMakeFiles/myfort.dir/my_sub.f.o.requires:
-.PHONY : CMakeFiles/myfort.dir/my_sub.f.o.requires
-
-CMakeFiles/myfort.dir/my_sub.f.o.provides: CMakeFiles/myfort.dir/my_sub.f.o.requires
-	$(MAKE) -f CMakeFiles/myfort.dir/build.make CMakeFiles/myfort.dir/my_sub.f.o.provides.build
-.PHONY : CMakeFiles/myfort.dir/my_sub.f.o.provides
-
-CMakeFiles/myfort.dir/my_sub.f.o.provides.build: CMakeFiles/myfort.dir/my_sub.f.o
-
-CMakeFiles/myfort.dir/mymodule.f90.o: CMakeFiles/myfort.dir/flags.make
-CMakeFiles/myfort.dir/mymodule.f90.o: /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/mymodule.f90
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles $(CMAKE_PROGRESS_3)
-	@echo "Building Fortran object CMakeFiles/myfort.dir/mymodule.f90.o"
-	/usr/bin/gfortran  $(Fortran_DEFINES) $(Fortran_FLAGS) -c /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/mymodule.f90 -o CMakeFiles/myfort.dir/mymodule.f90.o
-
-CMakeFiles/myfort.dir/mymodule.f90.o.requires:
-.PHONY : CMakeFiles/myfort.dir/mymodule.f90.o.requires
-
-CMakeFiles/myfort.dir/mymodule.f90.o.provides: CMakeFiles/myfort.dir/mymodule.f90.o.requires
-	$(MAKE) -f CMakeFiles/myfort.dir/build.make CMakeFiles/myfort.dir/mymodule.f90.o.provides.build
-.PHONY : CMakeFiles/myfort.dir/mymodule.f90.o.provides
-
-CMakeFiles/myfort.dir/mymodule.f90.o.provides.build: CMakeFiles/myfort.dir/mymodule.f90.o
-
-CMakeFiles/myfort.dir/my_module.f90.o: CMakeFiles/myfort.dir/flags.make
-CMakeFiles/myfort.dir/my_module.f90.o: /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/my_module.f90
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles $(CMAKE_PROGRESS_4)
-	@echo "Building Fortran object CMakeFiles/myfort.dir/my_module.f90.o"
-	/usr/bin/gfortran  $(Fortran_DEFINES) $(Fortran_FLAGS) -c /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/my_module.f90 -o CMakeFiles/myfort.dir/my_module.f90.o
-
-CMakeFiles/myfort.dir/my_module.f90.o.requires:
-.PHONY : CMakeFiles/myfort.dir/my_module.f90.o.requires
-
-CMakeFiles/myfort.dir/my_module.f90.o.provides: CMakeFiles/myfort.dir/my_module.f90.o.requires
-	$(MAKE) -f CMakeFiles/myfort.dir/build.make CMakeFiles/myfort.dir/my_module.f90.o.provides.build
-.PHONY : CMakeFiles/myfort.dir/my_module.f90.o.provides
-
-CMakeFiles/myfort.dir/my_module.f90.o.provides.build: CMakeFiles/myfort.dir/my_module.f90.o
-
-# Object files for target myfort
-myfort_OBJECTS = \
-"CMakeFiles/myfort.dir/mysub.f.o" \
-"CMakeFiles/myfort.dir/my_sub.f.o" \
-"CMakeFiles/myfort.dir/mymodule.f90.o" \
-"CMakeFiles/myfort.dir/my_module.f90.o"
-
-# External object files for target myfort
-myfort_EXTERNAL_OBJECTS =
-
-libmyfort.a: CMakeFiles/myfort.dir/mysub.f.o
-libmyfort.a: CMakeFiles/myfort.dir/my_sub.f.o
-libmyfort.a: CMakeFiles/myfort.dir/mymodule.f90.o
-libmyfort.a: CMakeFiles/myfort.dir/my_module.f90.o
-libmyfort.a: CMakeFiles/myfort.dir/build.make
-libmyfort.a: CMakeFiles/myfort.dir/link.txt
-	@echo "Linking Fortran static library libmyfort.a"
-	$(CMAKE_COMMAND) -P CMakeFiles/myfort.dir/cmake_clean_target.cmake
-	$(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/myfort.dir/link.txt --verbose=$(VERBOSE)
-
-# Rule to build all files generated by this target.
-CMakeFiles/myfort.dir/build: libmyfort.a
-.PHONY : CMakeFiles/myfort.dir/build
-
-CMakeFiles/myfort.dir/requires: CMakeFiles/myfort.dir/mysub.f.o.requires
-CMakeFiles/myfort.dir/requires: CMakeFiles/myfort.dir/my_sub.f.o.requires
-CMakeFiles/myfort.dir/requires: CMakeFiles/myfort.dir/mymodule.f90.o.requires
-CMakeFiles/myfort.dir/requires: CMakeFiles/myfort.dir/my_module.f90.o.requires
-.PHONY : CMakeFiles/myfort.dir/requires
-
-CMakeFiles/myfort.dir/clean:
-	$(CMAKE_COMMAND) -P CMakeFiles/myfort.dir/cmake_clean.cmake
-.PHONY : CMakeFiles/myfort.dir/clean
-
-CMakeFiles/myfort.dir/depend:
-	cd /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/DependInfo.cmake
-.PHONY : CMakeFiles/myfort.dir/depend
-
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/cmake_clean.cmake b/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/cmake_clean.cmake
deleted file mode 100644
index a954a05..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/cmake_clean.cmake
+++ /dev/null
@@ -1,13 +0,0 @@
-FILE(REMOVE_RECURSE
-  "CMakeFiles/myfort.dir/mysub.f.o"
-  "CMakeFiles/myfort.dir/my_sub.f.o"
-  "CMakeFiles/myfort.dir/mymodule.f90.o"
-  "CMakeFiles/myfort.dir/my_module.f90.o"
-  "libmyfort.pdb"
-  "libmyfort.a"
-)
-
-# Per-language clean rules from dependency scanning.
-FOREACH(lang Fortran)
-  INCLUDE(CMakeFiles/myfort.dir/cmake_clean_${lang}.cmake OPTIONAL)
-ENDFOREACH(lang)
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/cmake_clean_Fortran.cmake b/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/cmake_clean_Fortran.cmake
deleted file mode 100644
index 884a249..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/cmake_clean_Fortran.cmake
+++ /dev/null
@@ -1,10 +0,0 @@
-# Remove fortran modules provided by this target.
-FILE(REMOVE
-  "my_module.mod"
-  "MY_MODULE.mod"
-  "CMakeFiles/myfort.dir/my_module.mod.stamp"
-
-  "mymodule.mod"
-  "MYMODULE.mod"
-  "CMakeFiles/myfort.dir/mymodule.mod.stamp"
-  )
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/cmake_clean_target.cmake b/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/cmake_clean_target.cmake
deleted file mode 100644
index 2de6587..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/cmake_clean_target.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-FILE(REMOVE_RECURSE
-  "libmyfort.a"
-)
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/depend.internal b/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/depend.internal
deleted file mode 100644
index cc0b855..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/depend.internal
+++ /dev/null
@@ -1,11 +0,0 @@
-# CMAKE generated file: DO NOT EDIT!
-# Generated by "Unix Makefiles" Generator, CMake Version 2.8
-
-CMakeFiles/myfort.dir/my_module.f90.o
- /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/my_module.f90
-CMakeFiles/myfort.dir/my_sub.f.o
- /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/my_sub.f
-CMakeFiles/myfort.dir/mymodule.f90.o
- /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/mymodule.f90
-CMakeFiles/myfort.dir/mysub.f.o
- /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/mysub.f
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/depend.make b/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/depend.make
deleted file mode 100644
index 5911141..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/depend.make
+++ /dev/null
@@ -1,17 +0,0 @@
-# CMAKE generated file: DO NOT EDIT!
-# Generated by "Unix Makefiles" Generator, CMake Version 2.8
-
-
-CMakeFiles/myfort.dir/my_module.mod.proxy: CMakeFiles/myfort.dir/my_module.f90.o.provides
-CMakeFiles/myfort.dir/my_module.f90.o.provides.build:
-	$(CMAKE_COMMAND) -E cmake_copy_f90_mod my_module CMakeFiles/myfort.dir/my_module.mod.stamp GNU
-	$(CMAKE_COMMAND) -E touch CMakeFiles/myfort.dir/my_module.f90.o.provides.build
-CMakeFiles/myfort.dir/build: CMakeFiles/myfort.dir/my_module.f90.o.provides.build
-
-
-CMakeFiles/myfort.dir/mymodule.mod.proxy: CMakeFiles/myfort.dir/mymodule.f90.o.provides
-CMakeFiles/myfort.dir/mymodule.f90.o.provides.build:
-	$(CMAKE_COMMAND) -E cmake_copy_f90_mod mymodule CMakeFiles/myfort.dir/mymodule.mod.stamp GNU
-	$(CMAKE_COMMAND) -E touch CMakeFiles/myfort.dir/mymodule.f90.o.provides.build
-CMakeFiles/myfort.dir/build: CMakeFiles/myfort.dir/mymodule.f90.o.provides.build
-
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/flags.make b/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/flags.make
deleted file mode 100644
index d4f4830..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/flags.make
+++ /dev/null
@@ -1,8 +0,0 @@
-# CMAKE generated file: DO NOT EDIT!
-# Generated by "Unix Makefiles" Generator, CMake Version 2.8
-
-# compile Fortran with /usr/bin/gfortran
-Fortran_FLAGS =  
-
-Fortran_DEFINES = 
-
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/fortran.internal b/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/fortran.internal
deleted file mode 100644
index 2bd82e1..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/fortran.internal
+++ /dev/null
@@ -1,4 +0,0 @@
-# The fortran modules provided by this target.
-provides
- my_module
- mymodule
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/link.txt b/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/link.txt
deleted file mode 100644
index f71bd23..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/link.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-/usr/bin/ar cr libmyfort.a  CMakeFiles/myfort.dir/mysub.f.o CMakeFiles/myfort.dir/my_sub.f.o CMakeFiles/myfort.dir/mymodule.f90.o CMakeFiles/myfort.dir/my_module.f90.o
-/usr/bin/ranlib libmyfort.a
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/my_module.f90.o.provides.build b/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/my_module.f90.o.provides.build
deleted file mode 100644
index e69de29..0000000
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/my_module.mod.stamp b/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/my_module.mod.stamp
deleted file mode 100644
index df1ccc6..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/my_module.mod.stamp
+++ /dev/null
@@ -1,23 +0,0 @@
-GFORTRAN module version '0' created from /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/my_module.f90 on Tue Apr  8 16:55:52 2014
-MD5:92c3f619b10bf01d10a98744d3beb007 -- If you edit this, you'll get what you deserve.
-
-(() () () () () () () () () () () () () () () () () () () () () () () ()
-() () ())
-
-()
-
-(('my_interface' 'my_module' 2))
-
-()
-
-()
-
-(3 'my_module' 'my_module' 'my_module' 1 ((MODULE UNKNOWN-INTENT
-UNKNOWN-PROC UNKNOWN UNKNOWN) (UNKNOWN 0 0 0 UNKNOWN ()) 0 0 () () 0 ()
-() () 0 0)
-2 'my_sub' 'my_module' 'my_sub' 1 ((PROCEDURE UNKNOWN-INTENT MODULE-PROC
-DECL UNKNOWN SUBROUTINE) (UNKNOWN 0 0 0 UNKNOWN ()) 0 0 () () 0 () () ()
-0 0)
-)
-
-('my_module' 0 3 'my_sub' 0 2)
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/mymodule.f90.o.provides.build b/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/mymodule.f90.o.provides.build
deleted file mode 100644
index e69de29..0000000
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/mymodule.mod.stamp b/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/mymodule.mod.stamp
deleted file mode 100644
index cd3bf4f..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/mymodule.mod.stamp
+++ /dev/null
@@ -1,23 +0,0 @@
-GFORTRAN module version '0' created from /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/mymodule.f90 on Tue Apr  8 16:55:52 2014
-MD5:3826198b66b6b987f94c147eb4e0ec65 -- If you edit this, you'll get what you deserve.
-
-(() () () () () () () () () () () () () () () () () () () () () () () ()
-() () ())
-
-()
-
-(('myinterface' 'mymodule' 2))
-
-()
-
-()
-
-(3 'mymodule' 'mymodule' 'mymodule' 1 ((MODULE UNKNOWN-INTENT
-UNKNOWN-PROC UNKNOWN UNKNOWN) (UNKNOWN 0 0 0 UNKNOWN ()) 0 0 () () 0 ()
-() () 0 0)
-2 'mysub' 'mymodule' 'mysub' 1 ((PROCEDURE UNKNOWN-INTENT MODULE-PROC
-DECL UNKNOWN SUBROUTINE) (UNKNOWN 0 0 0 UNKNOWN ()) 0 0 () () 0 () () ()
-0 0)
-)
-
-('mymodule' 0 3 'mysub' 0 2)
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/progress.make b/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/progress.make
deleted file mode 100644
index b78c197..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/progress.make
+++ /dev/null
@@ -1,5 +0,0 @@
-CMAKE_PROGRESS_1 = 4
-CMAKE_PROGRESS_2 = 5
-CMAKE_PROGRESS_3 = 6
-CMAKE_PROGRESS_4 = 7
-
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/progress.marks b/CMakeFiles/FortranCInterface/CMakeFiles/progress.marks
deleted file mode 100644
index f5c8955..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/progress.marks
+++ /dev/null
@@ -1 +0,0 @@
-32
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/C.includecache b/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/C.includecache
deleted file mode 100644
index 41428ee..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/C.includecache
+++ /dev/null
@@ -1,58 +0,0 @@
-#IncludeRegexLine: ^[ 	]*#[ 	]*(include|import)[ 	]*[<"]([^">]+)([">])
-
-#IncludeRegexScan: ^.*$
-
-#IncludeRegexComplain: ^$
-
-#IncludeRegexTransform: 
-
-/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/MYMODULE_mp_MYSUB-UPPER.c
-
-/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/MYSUB-UPPER.c
-
-/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/MY_MODULE_mp_MY_SUB-UPPER.c
-
-/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/MY_SUB-UPPER.c
-
-/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__my_module_MOD_my_sub.c
-
-/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__my_module_NMOD_my_sub.c
-
-/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__my_module__my_sub.c
-
-/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__mymodule_MOD_mysub.c
-
-/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__mymodule_NMOD_mysub.c
-
-/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__mymodule__mysub.c
-
-/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_moduleSmy_sub.c
-
-/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_module_MP_my_sub.c
-
-/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_module_mp_my_sub_.c
-
-/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_module_my_sub_.c
-
-/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_sub.c
-
-/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_sub_.c
-
-/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_sub__.c
-
-/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mymoduleSmysub.c
-
-/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mymodule_MP_mysub.c
-
-/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mymodule_mp_mysub_.c
-
-/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mymodule_mysub_.c
-
-/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mysub.c
-
-/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mysub_.c
-
-/usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/my_module_.c
-
-/usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/mymodule_.c
-
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/DependInfo.cmake b/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/DependInfo.cmake
deleted file mode 100644
index b81129d..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/DependInfo.cmake
+++ /dev/null
@@ -1,45 +0,0 @@
-# The set of languages for which implicit dependencies are needed:
-SET(CMAKE_DEPENDS_LANGUAGES
-  "C"
-  )
-# The set of files for implicit dependencies of each language:
-SET(CMAKE_DEPENDS_CHECK_C
-  "/usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/my_module_.c" "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/my_module_.c.o"
-  "/usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/mymodule_.c" "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/mymodule_.c.o"
-  "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/MYMODULE_mp_MYSUB-UPPER.c" "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/symbols/MYMODULE_mp_MYSUB-UPPER.c.o"
-  "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/MYSUB-UPPER.c" "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/symbols/MYSUB-UPPER.c.o"
-  "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/MY_MODULE_mp_MY_SUB-UPPER.c" "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/symbols/MY_MODULE_mp_MY_SUB-UPPER.c.o"
-  "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/MY_SUB-UPPER.c" "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/symbols/MY_SUB-UPPER.c.o"
-  "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__my_module_MOD_my_sub.c" "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/symbols/__my_module_MOD_my_sub.c.o"
-  "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__my_module_NMOD_my_sub.c" "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/symbols/__my_module_NMOD_my_sub.c.o"
-  "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__my_module__my_sub.c" "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/symbols/__my_module__my_sub.c.o"
-  "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__mymodule_MOD_mysub.c" "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/symbols/__mymodule_MOD_mysub.c.o"
-  "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__mymodule_NMOD_mysub.c" "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/symbols/__mymodule_NMOD_mysub.c.o"
-  "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__mymodule__mysub.c" "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/symbols/__mymodule__mysub.c.o"
-  "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_moduleSmy_sub.c" "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/symbols/my_moduleSmy_sub.c.o"
-  "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_module_MP_my_sub.c" "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/symbols/my_module_MP_my_sub.c.o"
-  "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_module_mp_my_sub_.c" "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/symbols/my_module_mp_my_sub_.c.o"
-  "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_module_my_sub_.c" "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/symbols/my_module_my_sub_.c.o"
-  "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_sub.c" "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/symbols/my_sub.c.o"
-  "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_sub_.c" "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/symbols/my_sub_.c.o"
-  "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_sub__.c" "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/symbols/my_sub__.c.o"
-  "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mymoduleSmysub.c" "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/symbols/mymoduleSmysub.c.o"
-  "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mymodule_MP_mysub.c" "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/symbols/mymodule_MP_mysub.c.o"
-  "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mymodule_mp_mysub_.c" "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/symbols/mymodule_mp_mysub_.c.o"
-  "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mymodule_mysub_.c" "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/symbols/mymodule_mysub_.c.o"
-  "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mysub.c" "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/symbols/mysub.c.o"
-  "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mysub_.c" "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/symbols/mysub_.c.o"
-  )
-SET(CMAKE_C_COMPILER_ID "GNU")
-
-# Targets to which this target links.
-SET(CMAKE_TARGET_LINKED_INFO_FILES
-  "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/myfort.dir/DependInfo.cmake"
-  )
-
-# The include file search paths:
-SET(CMAKE_C_TARGET_INCLUDE_PATH
-  )
-SET(CMAKE_CXX_TARGET_INCLUDE_PATH ${CMAKE_C_TARGET_INCLUDE_PATH})
-SET(CMAKE_Fortran_TARGET_INCLUDE_PATH ${CMAKE_C_TARGET_INCLUDE_PATH})
-SET(CMAKE_ASM_TARGET_INCLUDE_PATH ${CMAKE_C_TARGET_INCLUDE_PATH})
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/build.make b/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/build.make
deleted file mode 100644
index c7ecdd4..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/build.make
+++ /dev/null
@@ -1,730 +0,0 @@
-# CMAKE generated file: DO NOT EDIT!
-# Generated by "Unix Makefiles" Generator, CMake Version 2.8
-
-#=============================================================================
-# Special targets provided by cmake.
-
-# Disable implicit rules so canonical targets will work.
-.SUFFIXES:
-
-# Remove some rules from gmake that .SUFFIXES does not remove.
-SUFFIXES =
-
-.SUFFIXES: .hpux_make_needs_suffix_list
-
-# Suppress display of executed commands.
-$(VERBOSE).SILENT:
-
-# A target that is always out of date.
-cmake_force:
-.PHONY : cmake_force
-
-#=============================================================================
-# Set environment variables for the build.
-
-# The shell in which to execute make rules.
-SHELL = /bin/sh
-
-# The CMake executable.
-CMAKE_COMMAND = /usr/local/apps/cmake/2.8.10/bin/cmake
-
-# The command to remove a file.
-RM = /usr/local/apps/cmake/2.8.10/bin/cmake -E remove -f
-
-# Escaping for special characters.
-EQUALS = =
-
-# The program to use to edit the cache.
-CMAKE_EDIT_COMMAND = /usr/local/apps/cmake/2.8.10/bin/ccmake
-
-# The top-level source directory on which CMake was run.
-CMAKE_SOURCE_DIR = /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface
-
-# The top-level build directory on which CMake was run.
-CMAKE_BINARY_DIR = /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface
-
-# Include any dependencies generated for this target.
-include CMakeFiles/symbols.dir/depend.make
-
-# Include the progress variables for this target.
-include CMakeFiles/symbols.dir/progress.make
-
-# Include the compile flags for this target's objects.
-include CMakeFiles/symbols.dir/flags.make
-
-CMakeFiles/symbols.dir/mymodule_.c.o: CMakeFiles/symbols.dir/flags.make
-CMakeFiles/symbols.dir/mymodule_.c.o: /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/mymodule_.c
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles $(CMAKE_PROGRESS_1)
-	@echo "Building C object CMakeFiles/symbols.dir/mymodule_.c.o"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -o CMakeFiles/symbols.dir/mymodule_.c.o   -c /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/mymodule_.c
-
-CMakeFiles/symbols.dir/mymodule_.c.i: cmake_force
-	@echo "Preprocessing C source to CMakeFiles/symbols.dir/mymodule_.c.i"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -E /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/mymodule_.c > CMakeFiles/symbols.dir/mymodule_.c.i
-
-CMakeFiles/symbols.dir/mymodule_.c.s: cmake_force
-	@echo "Compiling C source to assembly CMakeFiles/symbols.dir/mymodule_.c.s"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -S /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/mymodule_.c -o CMakeFiles/symbols.dir/mymodule_.c.s
-
-CMakeFiles/symbols.dir/mymodule_.c.o.requires:
-.PHONY : CMakeFiles/symbols.dir/mymodule_.c.o.requires
-
-CMakeFiles/symbols.dir/mymodule_.c.o.provides: CMakeFiles/symbols.dir/mymodule_.c.o.requires
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/mymodule_.c.o.provides.build
-.PHONY : CMakeFiles/symbols.dir/mymodule_.c.o.provides
-
-CMakeFiles/symbols.dir/mymodule_.c.o.provides.build: CMakeFiles/symbols.dir/mymodule_.c.o
-
-CMakeFiles/symbols.dir/my_module_.c.o: CMakeFiles/symbols.dir/flags.make
-CMakeFiles/symbols.dir/my_module_.c.o: /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/my_module_.c
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles $(CMAKE_PROGRESS_2)
-	@echo "Building C object CMakeFiles/symbols.dir/my_module_.c.o"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -o CMakeFiles/symbols.dir/my_module_.c.o   -c /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/my_module_.c
-
-CMakeFiles/symbols.dir/my_module_.c.i: cmake_force
-	@echo "Preprocessing C source to CMakeFiles/symbols.dir/my_module_.c.i"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -E /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/my_module_.c > CMakeFiles/symbols.dir/my_module_.c.i
-
-CMakeFiles/symbols.dir/my_module_.c.s: cmake_force
-	@echo "Compiling C source to assembly CMakeFiles/symbols.dir/my_module_.c.s"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -S /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/my_module_.c -o CMakeFiles/symbols.dir/my_module_.c.s
-
-CMakeFiles/symbols.dir/my_module_.c.o.requires:
-.PHONY : CMakeFiles/symbols.dir/my_module_.c.o.requires
-
-CMakeFiles/symbols.dir/my_module_.c.o.provides: CMakeFiles/symbols.dir/my_module_.c.o.requires
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/my_module_.c.o.provides.build
-.PHONY : CMakeFiles/symbols.dir/my_module_.c.o.provides
-
-CMakeFiles/symbols.dir/my_module_.c.o.provides.build: CMakeFiles/symbols.dir/my_module_.c.o
-
-CMakeFiles/symbols.dir/symbols/my_sub.c.o: CMakeFiles/symbols.dir/flags.make
-CMakeFiles/symbols.dir/symbols/my_sub.c.o: symbols/my_sub.c
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles $(CMAKE_PROGRESS_3)
-	@echo "Building C object CMakeFiles/symbols.dir/symbols/my_sub.c.o"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -o CMakeFiles/symbols.dir/symbols/my_sub.c.o   -c /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_sub.c
-
-CMakeFiles/symbols.dir/symbols/my_sub.c.i: cmake_force
-	@echo "Preprocessing C source to CMakeFiles/symbols.dir/symbols/my_sub.c.i"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -E /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_sub.c > CMakeFiles/symbols.dir/symbols/my_sub.c.i
-
-CMakeFiles/symbols.dir/symbols/my_sub.c.s: cmake_force
-	@echo "Compiling C source to assembly CMakeFiles/symbols.dir/symbols/my_sub.c.s"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -S /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_sub.c -o CMakeFiles/symbols.dir/symbols/my_sub.c.s
-
-CMakeFiles/symbols.dir/symbols/my_sub.c.o.requires:
-.PHONY : CMakeFiles/symbols.dir/symbols/my_sub.c.o.requires
-
-CMakeFiles/symbols.dir/symbols/my_sub.c.o.provides: CMakeFiles/symbols.dir/symbols/my_sub.c.o.requires
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/my_sub.c.o.provides.build
-.PHONY : CMakeFiles/symbols.dir/symbols/my_sub.c.o.provides
-
-CMakeFiles/symbols.dir/symbols/my_sub.c.o.provides.build: CMakeFiles/symbols.dir/symbols/my_sub.c.o
-
-CMakeFiles/symbols.dir/symbols/my_sub_.c.o: CMakeFiles/symbols.dir/flags.make
-CMakeFiles/symbols.dir/symbols/my_sub_.c.o: symbols/my_sub_.c
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles $(CMAKE_PROGRESS_4)
-	@echo "Building C object CMakeFiles/symbols.dir/symbols/my_sub_.c.o"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -o CMakeFiles/symbols.dir/symbols/my_sub_.c.o   -c /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_sub_.c
-
-CMakeFiles/symbols.dir/symbols/my_sub_.c.i: cmake_force
-	@echo "Preprocessing C source to CMakeFiles/symbols.dir/symbols/my_sub_.c.i"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -E /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_sub_.c > CMakeFiles/symbols.dir/symbols/my_sub_.c.i
-
-CMakeFiles/symbols.dir/symbols/my_sub_.c.s: cmake_force
-	@echo "Compiling C source to assembly CMakeFiles/symbols.dir/symbols/my_sub_.c.s"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -S /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_sub_.c -o CMakeFiles/symbols.dir/symbols/my_sub_.c.s
-
-CMakeFiles/symbols.dir/symbols/my_sub_.c.o.requires:
-.PHONY : CMakeFiles/symbols.dir/symbols/my_sub_.c.o.requires
-
-CMakeFiles/symbols.dir/symbols/my_sub_.c.o.provides: CMakeFiles/symbols.dir/symbols/my_sub_.c.o.requires
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/my_sub_.c.o.provides.build
-.PHONY : CMakeFiles/symbols.dir/symbols/my_sub_.c.o.provides
-
-CMakeFiles/symbols.dir/symbols/my_sub_.c.o.provides.build: CMakeFiles/symbols.dir/symbols/my_sub_.c.o
-
-CMakeFiles/symbols.dir/symbols/my_sub__.c.o: CMakeFiles/symbols.dir/flags.make
-CMakeFiles/symbols.dir/symbols/my_sub__.c.o: symbols/my_sub__.c
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles $(CMAKE_PROGRESS_5)
-	@echo "Building C object CMakeFiles/symbols.dir/symbols/my_sub__.c.o"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -o CMakeFiles/symbols.dir/symbols/my_sub__.c.o   -c /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_sub__.c
-
-CMakeFiles/symbols.dir/symbols/my_sub__.c.i: cmake_force
-	@echo "Preprocessing C source to CMakeFiles/symbols.dir/symbols/my_sub__.c.i"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -E /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_sub__.c > CMakeFiles/symbols.dir/symbols/my_sub__.c.i
-
-CMakeFiles/symbols.dir/symbols/my_sub__.c.s: cmake_force
-	@echo "Compiling C source to assembly CMakeFiles/symbols.dir/symbols/my_sub__.c.s"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -S /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_sub__.c -o CMakeFiles/symbols.dir/symbols/my_sub__.c.s
-
-CMakeFiles/symbols.dir/symbols/my_sub__.c.o.requires:
-.PHONY : CMakeFiles/symbols.dir/symbols/my_sub__.c.o.requires
-
-CMakeFiles/symbols.dir/symbols/my_sub__.c.o.provides: CMakeFiles/symbols.dir/symbols/my_sub__.c.o.requires
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/my_sub__.c.o.provides.build
-.PHONY : CMakeFiles/symbols.dir/symbols/my_sub__.c.o.provides
-
-CMakeFiles/symbols.dir/symbols/my_sub__.c.o.provides.build: CMakeFiles/symbols.dir/symbols/my_sub__.c.o
-
-CMakeFiles/symbols.dir/symbols/MY_SUB-UPPER.c.o: CMakeFiles/symbols.dir/flags.make
-CMakeFiles/symbols.dir/symbols/MY_SUB-UPPER.c.o: symbols/MY_SUB-UPPER.c
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles $(CMAKE_PROGRESS_6)
-	@echo "Building C object CMakeFiles/symbols.dir/symbols/MY_SUB-UPPER.c.o"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -o CMakeFiles/symbols.dir/symbols/MY_SUB-UPPER.c.o   -c /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/MY_SUB-UPPER.c
-
-CMakeFiles/symbols.dir/symbols/MY_SUB-UPPER.c.i: cmake_force
-	@echo "Preprocessing C source to CMakeFiles/symbols.dir/symbols/MY_SUB-UPPER.c.i"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -E /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/MY_SUB-UPPER.c > CMakeFiles/symbols.dir/symbols/MY_SUB-UPPER.c.i
-
-CMakeFiles/symbols.dir/symbols/MY_SUB-UPPER.c.s: cmake_force
-	@echo "Compiling C source to assembly CMakeFiles/symbols.dir/symbols/MY_SUB-UPPER.c.s"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -S /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/MY_SUB-UPPER.c -o CMakeFiles/symbols.dir/symbols/MY_SUB-UPPER.c.s
-
-CMakeFiles/symbols.dir/symbols/MY_SUB-UPPER.c.o.requires:
-.PHONY : CMakeFiles/symbols.dir/symbols/MY_SUB-UPPER.c.o.requires
-
-CMakeFiles/symbols.dir/symbols/MY_SUB-UPPER.c.o.provides: CMakeFiles/symbols.dir/symbols/MY_SUB-UPPER.c.o.requires
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/MY_SUB-UPPER.c.o.provides.build
-.PHONY : CMakeFiles/symbols.dir/symbols/MY_SUB-UPPER.c.o.provides
-
-CMakeFiles/symbols.dir/symbols/MY_SUB-UPPER.c.o.provides.build: CMakeFiles/symbols.dir/symbols/MY_SUB-UPPER.c.o
-
-CMakeFiles/symbols.dir/symbols/mysub.c.o: CMakeFiles/symbols.dir/flags.make
-CMakeFiles/symbols.dir/symbols/mysub.c.o: symbols/mysub.c
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles $(CMAKE_PROGRESS_7)
-	@echo "Building C object CMakeFiles/symbols.dir/symbols/mysub.c.o"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -o CMakeFiles/symbols.dir/symbols/mysub.c.o   -c /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mysub.c
-
-CMakeFiles/symbols.dir/symbols/mysub.c.i: cmake_force
-	@echo "Preprocessing C source to CMakeFiles/symbols.dir/symbols/mysub.c.i"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -E /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mysub.c > CMakeFiles/symbols.dir/symbols/mysub.c.i
-
-CMakeFiles/symbols.dir/symbols/mysub.c.s: cmake_force
-	@echo "Compiling C source to assembly CMakeFiles/symbols.dir/symbols/mysub.c.s"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -S /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mysub.c -o CMakeFiles/symbols.dir/symbols/mysub.c.s
-
-CMakeFiles/symbols.dir/symbols/mysub.c.o.requires:
-.PHONY : CMakeFiles/symbols.dir/symbols/mysub.c.o.requires
-
-CMakeFiles/symbols.dir/symbols/mysub.c.o.provides: CMakeFiles/symbols.dir/symbols/mysub.c.o.requires
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/mysub.c.o.provides.build
-.PHONY : CMakeFiles/symbols.dir/symbols/mysub.c.o.provides
-
-CMakeFiles/symbols.dir/symbols/mysub.c.o.provides.build: CMakeFiles/symbols.dir/symbols/mysub.c.o
-
-CMakeFiles/symbols.dir/symbols/mysub_.c.o: CMakeFiles/symbols.dir/flags.make
-CMakeFiles/symbols.dir/symbols/mysub_.c.o: symbols/mysub_.c
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles $(CMAKE_PROGRESS_8)
-	@echo "Building C object CMakeFiles/symbols.dir/symbols/mysub_.c.o"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -o CMakeFiles/symbols.dir/symbols/mysub_.c.o   -c /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mysub_.c
-
-CMakeFiles/symbols.dir/symbols/mysub_.c.i: cmake_force
-	@echo "Preprocessing C source to CMakeFiles/symbols.dir/symbols/mysub_.c.i"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -E /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mysub_.c > CMakeFiles/symbols.dir/symbols/mysub_.c.i
-
-CMakeFiles/symbols.dir/symbols/mysub_.c.s: cmake_force
-	@echo "Compiling C source to assembly CMakeFiles/symbols.dir/symbols/mysub_.c.s"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -S /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mysub_.c -o CMakeFiles/symbols.dir/symbols/mysub_.c.s
-
-CMakeFiles/symbols.dir/symbols/mysub_.c.o.requires:
-.PHONY : CMakeFiles/symbols.dir/symbols/mysub_.c.o.requires
-
-CMakeFiles/symbols.dir/symbols/mysub_.c.o.provides: CMakeFiles/symbols.dir/symbols/mysub_.c.o.requires
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/mysub_.c.o.provides.build
-.PHONY : CMakeFiles/symbols.dir/symbols/mysub_.c.o.provides
-
-CMakeFiles/symbols.dir/symbols/mysub_.c.o.provides.build: CMakeFiles/symbols.dir/symbols/mysub_.c.o
-
-CMakeFiles/symbols.dir/symbols/MYSUB-UPPER.c.o: CMakeFiles/symbols.dir/flags.make
-CMakeFiles/symbols.dir/symbols/MYSUB-UPPER.c.o: symbols/MYSUB-UPPER.c
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles $(CMAKE_PROGRESS_9)
-	@echo "Building C object CMakeFiles/symbols.dir/symbols/MYSUB-UPPER.c.o"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -o CMakeFiles/symbols.dir/symbols/MYSUB-UPPER.c.o   -c /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/MYSUB-UPPER.c
-
-CMakeFiles/symbols.dir/symbols/MYSUB-UPPER.c.i: cmake_force
-	@echo "Preprocessing C source to CMakeFiles/symbols.dir/symbols/MYSUB-UPPER.c.i"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -E /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/MYSUB-UPPER.c > CMakeFiles/symbols.dir/symbols/MYSUB-UPPER.c.i
-
-CMakeFiles/symbols.dir/symbols/MYSUB-UPPER.c.s: cmake_force
-	@echo "Compiling C source to assembly CMakeFiles/symbols.dir/symbols/MYSUB-UPPER.c.s"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -S /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/MYSUB-UPPER.c -o CMakeFiles/symbols.dir/symbols/MYSUB-UPPER.c.s
-
-CMakeFiles/symbols.dir/symbols/MYSUB-UPPER.c.o.requires:
-.PHONY : CMakeFiles/symbols.dir/symbols/MYSUB-UPPER.c.o.requires
-
-CMakeFiles/symbols.dir/symbols/MYSUB-UPPER.c.o.provides: CMakeFiles/symbols.dir/symbols/MYSUB-UPPER.c.o.requires
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/MYSUB-UPPER.c.o.provides.build
-.PHONY : CMakeFiles/symbols.dir/symbols/MYSUB-UPPER.c.o.provides
-
-CMakeFiles/symbols.dir/symbols/MYSUB-UPPER.c.o.provides.build: CMakeFiles/symbols.dir/symbols/MYSUB-UPPER.c.o
-
-CMakeFiles/symbols.dir/symbols/__my_module_MOD_my_sub.c.o: CMakeFiles/symbols.dir/flags.make
-CMakeFiles/symbols.dir/symbols/__my_module_MOD_my_sub.c.o: symbols/__my_module_MOD_my_sub.c
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles $(CMAKE_PROGRESS_10)
-	@echo "Building C object CMakeFiles/symbols.dir/symbols/__my_module_MOD_my_sub.c.o"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -o CMakeFiles/symbols.dir/symbols/__my_module_MOD_my_sub.c.o   -c /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__my_module_MOD_my_sub.c
-
-CMakeFiles/symbols.dir/symbols/__my_module_MOD_my_sub.c.i: cmake_force
-	@echo "Preprocessing C source to CMakeFiles/symbols.dir/symbols/__my_module_MOD_my_sub.c.i"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -E /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__my_module_MOD_my_sub.c > CMakeFiles/symbols.dir/symbols/__my_module_MOD_my_sub.c.i
-
-CMakeFiles/symbols.dir/symbols/__my_module_MOD_my_sub.c.s: cmake_force
-	@echo "Compiling C source to assembly CMakeFiles/symbols.dir/symbols/__my_module_MOD_my_sub.c.s"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -S /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__my_module_MOD_my_sub.c -o CMakeFiles/symbols.dir/symbols/__my_module_MOD_my_sub.c.s
-
-CMakeFiles/symbols.dir/symbols/__my_module_MOD_my_sub.c.o.requires:
-.PHONY : CMakeFiles/symbols.dir/symbols/__my_module_MOD_my_sub.c.o.requires
-
-CMakeFiles/symbols.dir/symbols/__my_module_MOD_my_sub.c.o.provides: CMakeFiles/symbols.dir/symbols/__my_module_MOD_my_sub.c.o.requires
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/__my_module_MOD_my_sub.c.o.provides.build
-.PHONY : CMakeFiles/symbols.dir/symbols/__my_module_MOD_my_sub.c.o.provides
-
-CMakeFiles/symbols.dir/symbols/__my_module_MOD_my_sub.c.o.provides.build: CMakeFiles/symbols.dir/symbols/__my_module_MOD_my_sub.c.o
-
-CMakeFiles/symbols.dir/symbols/__my_module_NMOD_my_sub.c.o: CMakeFiles/symbols.dir/flags.make
-CMakeFiles/symbols.dir/symbols/__my_module_NMOD_my_sub.c.o: symbols/__my_module_NMOD_my_sub.c
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles $(CMAKE_PROGRESS_11)
-	@echo "Building C object CMakeFiles/symbols.dir/symbols/__my_module_NMOD_my_sub.c.o"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -o CMakeFiles/symbols.dir/symbols/__my_module_NMOD_my_sub.c.o   -c /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__my_module_NMOD_my_sub.c
-
-CMakeFiles/symbols.dir/symbols/__my_module_NMOD_my_sub.c.i: cmake_force
-	@echo "Preprocessing C source to CMakeFiles/symbols.dir/symbols/__my_module_NMOD_my_sub.c.i"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -E /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__my_module_NMOD_my_sub.c > CMakeFiles/symbols.dir/symbols/__my_module_NMOD_my_sub.c.i
-
-CMakeFiles/symbols.dir/symbols/__my_module_NMOD_my_sub.c.s: cmake_force
-	@echo "Compiling C source to assembly CMakeFiles/symbols.dir/symbols/__my_module_NMOD_my_sub.c.s"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -S /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__my_module_NMOD_my_sub.c -o CMakeFiles/symbols.dir/symbols/__my_module_NMOD_my_sub.c.s
-
-CMakeFiles/symbols.dir/symbols/__my_module_NMOD_my_sub.c.o.requires:
-.PHONY : CMakeFiles/symbols.dir/symbols/__my_module_NMOD_my_sub.c.o.requires
-
-CMakeFiles/symbols.dir/symbols/__my_module_NMOD_my_sub.c.o.provides: CMakeFiles/symbols.dir/symbols/__my_module_NMOD_my_sub.c.o.requires
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/__my_module_NMOD_my_sub.c.o.provides.build
-.PHONY : CMakeFiles/symbols.dir/symbols/__my_module_NMOD_my_sub.c.o.provides
-
-CMakeFiles/symbols.dir/symbols/__my_module_NMOD_my_sub.c.o.provides.build: CMakeFiles/symbols.dir/symbols/__my_module_NMOD_my_sub.c.o
-
-CMakeFiles/symbols.dir/symbols/__my_module__my_sub.c.o: CMakeFiles/symbols.dir/flags.make
-CMakeFiles/symbols.dir/symbols/__my_module__my_sub.c.o: symbols/__my_module__my_sub.c
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles $(CMAKE_PROGRESS_12)
-	@echo "Building C object CMakeFiles/symbols.dir/symbols/__my_module__my_sub.c.o"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -o CMakeFiles/symbols.dir/symbols/__my_module__my_sub.c.o   -c /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__my_module__my_sub.c
-
-CMakeFiles/symbols.dir/symbols/__my_module__my_sub.c.i: cmake_force
-	@echo "Preprocessing C source to CMakeFiles/symbols.dir/symbols/__my_module__my_sub.c.i"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -E /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__my_module__my_sub.c > CMakeFiles/symbols.dir/symbols/__my_module__my_sub.c.i
-
-CMakeFiles/symbols.dir/symbols/__my_module__my_sub.c.s: cmake_force
-	@echo "Compiling C source to assembly CMakeFiles/symbols.dir/symbols/__my_module__my_sub.c.s"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -S /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__my_module__my_sub.c -o CMakeFiles/symbols.dir/symbols/__my_module__my_sub.c.s
-
-CMakeFiles/symbols.dir/symbols/__my_module__my_sub.c.o.requires:
-.PHONY : CMakeFiles/symbols.dir/symbols/__my_module__my_sub.c.o.requires
-
-CMakeFiles/symbols.dir/symbols/__my_module__my_sub.c.o.provides: CMakeFiles/symbols.dir/symbols/__my_module__my_sub.c.o.requires
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/__my_module__my_sub.c.o.provides.build
-.PHONY : CMakeFiles/symbols.dir/symbols/__my_module__my_sub.c.o.provides
-
-CMakeFiles/symbols.dir/symbols/__my_module__my_sub.c.o.provides.build: CMakeFiles/symbols.dir/symbols/__my_module__my_sub.c.o
-
-CMakeFiles/symbols.dir/symbols/__mymodule_MOD_mysub.c.o: CMakeFiles/symbols.dir/flags.make
-CMakeFiles/symbols.dir/symbols/__mymodule_MOD_mysub.c.o: symbols/__mymodule_MOD_mysub.c
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles $(CMAKE_PROGRESS_13)
-	@echo "Building C object CMakeFiles/symbols.dir/symbols/__mymodule_MOD_mysub.c.o"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -o CMakeFiles/symbols.dir/symbols/__mymodule_MOD_mysub.c.o   -c /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__mymodule_MOD_mysub.c
-
-CMakeFiles/symbols.dir/symbols/__mymodule_MOD_mysub.c.i: cmake_force
-	@echo "Preprocessing C source to CMakeFiles/symbols.dir/symbols/__mymodule_MOD_mysub.c.i"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -E /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__mymodule_MOD_mysub.c > CMakeFiles/symbols.dir/symbols/__mymodule_MOD_mysub.c.i
-
-CMakeFiles/symbols.dir/symbols/__mymodule_MOD_mysub.c.s: cmake_force
-	@echo "Compiling C source to assembly CMakeFiles/symbols.dir/symbols/__mymodule_MOD_mysub.c.s"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -S /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__mymodule_MOD_mysub.c -o CMakeFiles/symbols.dir/symbols/__mymodule_MOD_mysub.c.s
-
-CMakeFiles/symbols.dir/symbols/__mymodule_MOD_mysub.c.o.requires:
-.PHONY : CMakeFiles/symbols.dir/symbols/__mymodule_MOD_mysub.c.o.requires
-
-CMakeFiles/symbols.dir/symbols/__mymodule_MOD_mysub.c.o.provides: CMakeFiles/symbols.dir/symbols/__mymodule_MOD_mysub.c.o.requires
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/__mymodule_MOD_mysub.c.o.provides.build
-.PHONY : CMakeFiles/symbols.dir/symbols/__mymodule_MOD_mysub.c.o.provides
-
-CMakeFiles/symbols.dir/symbols/__mymodule_MOD_mysub.c.o.provides.build: CMakeFiles/symbols.dir/symbols/__mymodule_MOD_mysub.c.o
-
-CMakeFiles/symbols.dir/symbols/__mymodule_NMOD_mysub.c.o: CMakeFiles/symbols.dir/flags.make
-CMakeFiles/symbols.dir/symbols/__mymodule_NMOD_mysub.c.o: symbols/__mymodule_NMOD_mysub.c
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles $(CMAKE_PROGRESS_14)
-	@echo "Building C object CMakeFiles/symbols.dir/symbols/__mymodule_NMOD_mysub.c.o"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -o CMakeFiles/symbols.dir/symbols/__mymodule_NMOD_mysub.c.o   -c /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__mymodule_NMOD_mysub.c
-
-CMakeFiles/symbols.dir/symbols/__mymodule_NMOD_mysub.c.i: cmake_force
-	@echo "Preprocessing C source to CMakeFiles/symbols.dir/symbols/__mymodule_NMOD_mysub.c.i"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -E /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__mymodule_NMOD_mysub.c > CMakeFiles/symbols.dir/symbols/__mymodule_NMOD_mysub.c.i
-
-CMakeFiles/symbols.dir/symbols/__mymodule_NMOD_mysub.c.s: cmake_force
-	@echo "Compiling C source to assembly CMakeFiles/symbols.dir/symbols/__mymodule_NMOD_mysub.c.s"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -S /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__mymodule_NMOD_mysub.c -o CMakeFiles/symbols.dir/symbols/__mymodule_NMOD_mysub.c.s
-
-CMakeFiles/symbols.dir/symbols/__mymodule_NMOD_mysub.c.o.requires:
-.PHONY : CMakeFiles/symbols.dir/symbols/__mymodule_NMOD_mysub.c.o.requires
-
-CMakeFiles/symbols.dir/symbols/__mymodule_NMOD_mysub.c.o.provides: CMakeFiles/symbols.dir/symbols/__mymodule_NMOD_mysub.c.o.requires
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/__mymodule_NMOD_mysub.c.o.provides.build
-.PHONY : CMakeFiles/symbols.dir/symbols/__mymodule_NMOD_mysub.c.o.provides
-
-CMakeFiles/symbols.dir/symbols/__mymodule_NMOD_mysub.c.o.provides.build: CMakeFiles/symbols.dir/symbols/__mymodule_NMOD_mysub.c.o
-
-CMakeFiles/symbols.dir/symbols/__mymodule__mysub.c.o: CMakeFiles/symbols.dir/flags.make
-CMakeFiles/symbols.dir/symbols/__mymodule__mysub.c.o: symbols/__mymodule__mysub.c
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles $(CMAKE_PROGRESS_15)
-	@echo "Building C object CMakeFiles/symbols.dir/symbols/__mymodule__mysub.c.o"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -o CMakeFiles/symbols.dir/symbols/__mymodule__mysub.c.o   -c /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__mymodule__mysub.c
-
-CMakeFiles/symbols.dir/symbols/__mymodule__mysub.c.i: cmake_force
-	@echo "Preprocessing C source to CMakeFiles/symbols.dir/symbols/__mymodule__mysub.c.i"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -E /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__mymodule__mysub.c > CMakeFiles/symbols.dir/symbols/__mymodule__mysub.c.i
-
-CMakeFiles/symbols.dir/symbols/__mymodule__mysub.c.s: cmake_force
-	@echo "Compiling C source to assembly CMakeFiles/symbols.dir/symbols/__mymodule__mysub.c.s"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -S /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__mymodule__mysub.c -o CMakeFiles/symbols.dir/symbols/__mymodule__mysub.c.s
-
-CMakeFiles/symbols.dir/symbols/__mymodule__mysub.c.o.requires:
-.PHONY : CMakeFiles/symbols.dir/symbols/__mymodule__mysub.c.o.requires
-
-CMakeFiles/symbols.dir/symbols/__mymodule__mysub.c.o.provides: CMakeFiles/symbols.dir/symbols/__mymodule__mysub.c.o.requires
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/__mymodule__mysub.c.o.provides.build
-.PHONY : CMakeFiles/symbols.dir/symbols/__mymodule__mysub.c.o.provides
-
-CMakeFiles/symbols.dir/symbols/__mymodule__mysub.c.o.provides.build: CMakeFiles/symbols.dir/symbols/__mymodule__mysub.c.o
-
-CMakeFiles/symbols.dir/symbols/my_moduleSmy_sub.c.o: CMakeFiles/symbols.dir/flags.make
-CMakeFiles/symbols.dir/symbols/my_moduleSmy_sub.c.o: symbols/my_moduleSmy_sub.c
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles $(CMAKE_PROGRESS_16)
-	@echo "Building C object CMakeFiles/symbols.dir/symbols/my_moduleSmy_sub.c.o"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -o CMakeFiles/symbols.dir/symbols/my_moduleSmy_sub.c.o   -c /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_moduleSmy_sub.c
-
-CMakeFiles/symbols.dir/symbols/my_moduleSmy_sub.c.i: cmake_force
-	@echo "Preprocessing C source to CMakeFiles/symbols.dir/symbols/my_moduleSmy_sub.c.i"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -E /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_moduleSmy_sub.c > CMakeFiles/symbols.dir/symbols/my_moduleSmy_sub.c.i
-
-CMakeFiles/symbols.dir/symbols/my_moduleSmy_sub.c.s: cmake_force
-	@echo "Compiling C source to assembly CMakeFiles/symbols.dir/symbols/my_moduleSmy_sub.c.s"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -S /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_moduleSmy_sub.c -o CMakeFiles/symbols.dir/symbols/my_moduleSmy_sub.c.s
-
-CMakeFiles/symbols.dir/symbols/my_moduleSmy_sub.c.o.requires:
-.PHONY : CMakeFiles/symbols.dir/symbols/my_moduleSmy_sub.c.o.requires
-
-CMakeFiles/symbols.dir/symbols/my_moduleSmy_sub.c.o.provides: CMakeFiles/symbols.dir/symbols/my_moduleSmy_sub.c.o.requires
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/my_moduleSmy_sub.c.o.provides.build
-.PHONY : CMakeFiles/symbols.dir/symbols/my_moduleSmy_sub.c.o.provides
-
-CMakeFiles/symbols.dir/symbols/my_moduleSmy_sub.c.o.provides.build: CMakeFiles/symbols.dir/symbols/my_moduleSmy_sub.c.o
-
-CMakeFiles/symbols.dir/symbols/my_module_mp_my_sub_.c.o: CMakeFiles/symbols.dir/flags.make
-CMakeFiles/symbols.dir/symbols/my_module_mp_my_sub_.c.o: symbols/my_module_mp_my_sub_.c
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles $(CMAKE_PROGRESS_17)
-	@echo "Building C object CMakeFiles/symbols.dir/symbols/my_module_mp_my_sub_.c.o"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -o CMakeFiles/symbols.dir/symbols/my_module_mp_my_sub_.c.o   -c /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_module_mp_my_sub_.c
-
-CMakeFiles/symbols.dir/symbols/my_module_mp_my_sub_.c.i: cmake_force
-	@echo "Preprocessing C source to CMakeFiles/symbols.dir/symbols/my_module_mp_my_sub_.c.i"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -E /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_module_mp_my_sub_.c > CMakeFiles/symbols.dir/symbols/my_module_mp_my_sub_.c.i
-
-CMakeFiles/symbols.dir/symbols/my_module_mp_my_sub_.c.s: cmake_force
-	@echo "Compiling C source to assembly CMakeFiles/symbols.dir/symbols/my_module_mp_my_sub_.c.s"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -S /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_module_mp_my_sub_.c -o CMakeFiles/symbols.dir/symbols/my_module_mp_my_sub_.c.s
-
-CMakeFiles/symbols.dir/symbols/my_module_mp_my_sub_.c.o.requires:
-.PHONY : CMakeFiles/symbols.dir/symbols/my_module_mp_my_sub_.c.o.requires
-
-CMakeFiles/symbols.dir/symbols/my_module_mp_my_sub_.c.o.provides: CMakeFiles/symbols.dir/symbols/my_module_mp_my_sub_.c.o.requires
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/my_module_mp_my_sub_.c.o.provides.build
-.PHONY : CMakeFiles/symbols.dir/symbols/my_module_mp_my_sub_.c.o.provides
-
-CMakeFiles/symbols.dir/symbols/my_module_mp_my_sub_.c.o.provides.build: CMakeFiles/symbols.dir/symbols/my_module_mp_my_sub_.c.o
-
-CMakeFiles/symbols.dir/symbols/MY_MODULE_mp_MY_SUB-UPPER.c.o: CMakeFiles/symbols.dir/flags.make
-CMakeFiles/symbols.dir/symbols/MY_MODULE_mp_MY_SUB-UPPER.c.o: symbols/MY_MODULE_mp_MY_SUB-UPPER.c
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles $(CMAKE_PROGRESS_18)
-	@echo "Building C object CMakeFiles/symbols.dir/symbols/MY_MODULE_mp_MY_SUB-UPPER.c.o"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -o CMakeFiles/symbols.dir/symbols/MY_MODULE_mp_MY_SUB-UPPER.c.o   -c /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/MY_MODULE_mp_MY_SUB-UPPER.c
-
-CMakeFiles/symbols.dir/symbols/MY_MODULE_mp_MY_SUB-UPPER.c.i: cmake_force
-	@echo "Preprocessing C source to CMakeFiles/symbols.dir/symbols/MY_MODULE_mp_MY_SUB-UPPER.c.i"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -E /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/MY_MODULE_mp_MY_SUB-UPPER.c > CMakeFiles/symbols.dir/symbols/MY_MODULE_mp_MY_SUB-UPPER.c.i
-
-CMakeFiles/symbols.dir/symbols/MY_MODULE_mp_MY_SUB-UPPER.c.s: cmake_force
-	@echo "Compiling C source to assembly CMakeFiles/symbols.dir/symbols/MY_MODULE_mp_MY_SUB-UPPER.c.s"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -S /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/MY_MODULE_mp_MY_SUB-UPPER.c -o CMakeFiles/symbols.dir/symbols/MY_MODULE_mp_MY_SUB-UPPER.c.s
-
-CMakeFiles/symbols.dir/symbols/MY_MODULE_mp_MY_SUB-UPPER.c.o.requires:
-.PHONY : CMakeFiles/symbols.dir/symbols/MY_MODULE_mp_MY_SUB-UPPER.c.o.requires
-
-CMakeFiles/symbols.dir/symbols/MY_MODULE_mp_MY_SUB-UPPER.c.o.provides: CMakeFiles/symbols.dir/symbols/MY_MODULE_mp_MY_SUB-UPPER.c.o.requires
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/MY_MODULE_mp_MY_SUB-UPPER.c.o.provides.build
-.PHONY : CMakeFiles/symbols.dir/symbols/MY_MODULE_mp_MY_SUB-UPPER.c.o.provides
-
-CMakeFiles/symbols.dir/symbols/MY_MODULE_mp_MY_SUB-UPPER.c.o.provides.build: CMakeFiles/symbols.dir/symbols/MY_MODULE_mp_MY_SUB-UPPER.c.o
-
-CMakeFiles/symbols.dir/symbols/my_module_my_sub_.c.o: CMakeFiles/symbols.dir/flags.make
-CMakeFiles/symbols.dir/symbols/my_module_my_sub_.c.o: symbols/my_module_my_sub_.c
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles $(CMAKE_PROGRESS_19)
-	@echo "Building C object CMakeFiles/symbols.dir/symbols/my_module_my_sub_.c.o"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -o CMakeFiles/symbols.dir/symbols/my_module_my_sub_.c.o   -c /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_module_my_sub_.c
-
-CMakeFiles/symbols.dir/symbols/my_module_my_sub_.c.i: cmake_force
-	@echo "Preprocessing C source to CMakeFiles/symbols.dir/symbols/my_module_my_sub_.c.i"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -E /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_module_my_sub_.c > CMakeFiles/symbols.dir/symbols/my_module_my_sub_.c.i
-
-CMakeFiles/symbols.dir/symbols/my_module_my_sub_.c.s: cmake_force
-	@echo "Compiling C source to assembly CMakeFiles/symbols.dir/symbols/my_module_my_sub_.c.s"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -S /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_module_my_sub_.c -o CMakeFiles/symbols.dir/symbols/my_module_my_sub_.c.s
-
-CMakeFiles/symbols.dir/symbols/my_module_my_sub_.c.o.requires:
-.PHONY : CMakeFiles/symbols.dir/symbols/my_module_my_sub_.c.o.requires
-
-CMakeFiles/symbols.dir/symbols/my_module_my_sub_.c.o.provides: CMakeFiles/symbols.dir/symbols/my_module_my_sub_.c.o.requires
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/my_module_my_sub_.c.o.provides.build
-.PHONY : CMakeFiles/symbols.dir/symbols/my_module_my_sub_.c.o.provides
-
-CMakeFiles/symbols.dir/symbols/my_module_my_sub_.c.o.provides.build: CMakeFiles/symbols.dir/symbols/my_module_my_sub_.c.o
-
-CMakeFiles/symbols.dir/symbols/my_module_MP_my_sub.c.o: CMakeFiles/symbols.dir/flags.make
-CMakeFiles/symbols.dir/symbols/my_module_MP_my_sub.c.o: symbols/my_module_MP_my_sub.c
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles $(CMAKE_PROGRESS_20)
-	@echo "Building C object CMakeFiles/symbols.dir/symbols/my_module_MP_my_sub.c.o"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -o CMakeFiles/symbols.dir/symbols/my_module_MP_my_sub.c.o   -c /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_module_MP_my_sub.c
-
-CMakeFiles/symbols.dir/symbols/my_module_MP_my_sub.c.i: cmake_force
-	@echo "Preprocessing C source to CMakeFiles/symbols.dir/symbols/my_module_MP_my_sub.c.i"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -E /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_module_MP_my_sub.c > CMakeFiles/symbols.dir/symbols/my_module_MP_my_sub.c.i
-
-CMakeFiles/symbols.dir/symbols/my_module_MP_my_sub.c.s: cmake_force
-	@echo "Compiling C source to assembly CMakeFiles/symbols.dir/symbols/my_module_MP_my_sub.c.s"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -S /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_module_MP_my_sub.c -o CMakeFiles/symbols.dir/symbols/my_module_MP_my_sub.c.s
-
-CMakeFiles/symbols.dir/symbols/my_module_MP_my_sub.c.o.requires:
-.PHONY : CMakeFiles/symbols.dir/symbols/my_module_MP_my_sub.c.o.requires
-
-CMakeFiles/symbols.dir/symbols/my_module_MP_my_sub.c.o.provides: CMakeFiles/symbols.dir/symbols/my_module_MP_my_sub.c.o.requires
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/my_module_MP_my_sub.c.o.provides.build
-.PHONY : CMakeFiles/symbols.dir/symbols/my_module_MP_my_sub.c.o.provides
-
-CMakeFiles/symbols.dir/symbols/my_module_MP_my_sub.c.o.provides.build: CMakeFiles/symbols.dir/symbols/my_module_MP_my_sub.c.o
-
-CMakeFiles/symbols.dir/symbols/mymoduleSmysub.c.o: CMakeFiles/symbols.dir/flags.make
-CMakeFiles/symbols.dir/symbols/mymoduleSmysub.c.o: symbols/mymoduleSmysub.c
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles $(CMAKE_PROGRESS_21)
-	@echo "Building C object CMakeFiles/symbols.dir/symbols/mymoduleSmysub.c.o"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -o CMakeFiles/symbols.dir/symbols/mymoduleSmysub.c.o   -c /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mymoduleSmysub.c
-
-CMakeFiles/symbols.dir/symbols/mymoduleSmysub.c.i: cmake_force
-	@echo "Preprocessing C source to CMakeFiles/symbols.dir/symbols/mymoduleSmysub.c.i"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -E /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mymoduleSmysub.c > CMakeFiles/symbols.dir/symbols/mymoduleSmysub.c.i
-
-CMakeFiles/symbols.dir/symbols/mymoduleSmysub.c.s: cmake_force
-	@echo "Compiling C source to assembly CMakeFiles/symbols.dir/symbols/mymoduleSmysub.c.s"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -S /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mymoduleSmysub.c -o CMakeFiles/symbols.dir/symbols/mymoduleSmysub.c.s
-
-CMakeFiles/symbols.dir/symbols/mymoduleSmysub.c.o.requires:
-.PHONY : CMakeFiles/symbols.dir/symbols/mymoduleSmysub.c.o.requires
-
-CMakeFiles/symbols.dir/symbols/mymoduleSmysub.c.o.provides: CMakeFiles/symbols.dir/symbols/mymoduleSmysub.c.o.requires
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/mymoduleSmysub.c.o.provides.build
-.PHONY : CMakeFiles/symbols.dir/symbols/mymoduleSmysub.c.o.provides
-
-CMakeFiles/symbols.dir/symbols/mymoduleSmysub.c.o.provides.build: CMakeFiles/symbols.dir/symbols/mymoduleSmysub.c.o
-
-CMakeFiles/symbols.dir/symbols/mymodule_mp_mysub_.c.o: CMakeFiles/symbols.dir/flags.make
-CMakeFiles/symbols.dir/symbols/mymodule_mp_mysub_.c.o: symbols/mymodule_mp_mysub_.c
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles $(CMAKE_PROGRESS_22)
-	@echo "Building C object CMakeFiles/symbols.dir/symbols/mymodule_mp_mysub_.c.o"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -o CMakeFiles/symbols.dir/symbols/mymodule_mp_mysub_.c.o   -c /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mymodule_mp_mysub_.c
-
-CMakeFiles/symbols.dir/symbols/mymodule_mp_mysub_.c.i: cmake_force
-	@echo "Preprocessing C source to CMakeFiles/symbols.dir/symbols/mymodule_mp_mysub_.c.i"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -E /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mymodule_mp_mysub_.c > CMakeFiles/symbols.dir/symbols/mymodule_mp_mysub_.c.i
-
-CMakeFiles/symbols.dir/symbols/mymodule_mp_mysub_.c.s: cmake_force
-	@echo "Compiling C source to assembly CMakeFiles/symbols.dir/symbols/mymodule_mp_mysub_.c.s"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -S /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mymodule_mp_mysub_.c -o CMakeFiles/symbols.dir/symbols/mymodule_mp_mysub_.c.s
-
-CMakeFiles/symbols.dir/symbols/mymodule_mp_mysub_.c.o.requires:
-.PHONY : CMakeFiles/symbols.dir/symbols/mymodule_mp_mysub_.c.o.requires
-
-CMakeFiles/symbols.dir/symbols/mymodule_mp_mysub_.c.o.provides: CMakeFiles/symbols.dir/symbols/mymodule_mp_mysub_.c.o.requires
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/mymodule_mp_mysub_.c.o.provides.build
-.PHONY : CMakeFiles/symbols.dir/symbols/mymodule_mp_mysub_.c.o.provides
-
-CMakeFiles/symbols.dir/symbols/mymodule_mp_mysub_.c.o.provides.build: CMakeFiles/symbols.dir/symbols/mymodule_mp_mysub_.c.o
-
-CMakeFiles/symbols.dir/symbols/MYMODULE_mp_MYSUB-UPPER.c.o: CMakeFiles/symbols.dir/flags.make
-CMakeFiles/symbols.dir/symbols/MYMODULE_mp_MYSUB-UPPER.c.o: symbols/MYMODULE_mp_MYSUB-UPPER.c
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles $(CMAKE_PROGRESS_23)
-	@echo "Building C object CMakeFiles/symbols.dir/symbols/MYMODULE_mp_MYSUB-UPPER.c.o"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -o CMakeFiles/symbols.dir/symbols/MYMODULE_mp_MYSUB-UPPER.c.o   -c /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/MYMODULE_mp_MYSUB-UPPER.c
-
-CMakeFiles/symbols.dir/symbols/MYMODULE_mp_MYSUB-UPPER.c.i: cmake_force
-	@echo "Preprocessing C source to CMakeFiles/symbols.dir/symbols/MYMODULE_mp_MYSUB-UPPER.c.i"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -E /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/MYMODULE_mp_MYSUB-UPPER.c > CMakeFiles/symbols.dir/symbols/MYMODULE_mp_MYSUB-UPPER.c.i
-
-CMakeFiles/symbols.dir/symbols/MYMODULE_mp_MYSUB-UPPER.c.s: cmake_force
-	@echo "Compiling C source to assembly CMakeFiles/symbols.dir/symbols/MYMODULE_mp_MYSUB-UPPER.c.s"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -S /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/MYMODULE_mp_MYSUB-UPPER.c -o CMakeFiles/symbols.dir/symbols/MYMODULE_mp_MYSUB-UPPER.c.s
-
-CMakeFiles/symbols.dir/symbols/MYMODULE_mp_MYSUB-UPPER.c.o.requires:
-.PHONY : CMakeFiles/symbols.dir/symbols/MYMODULE_mp_MYSUB-UPPER.c.o.requires
-
-CMakeFiles/symbols.dir/symbols/MYMODULE_mp_MYSUB-UPPER.c.o.provides: CMakeFiles/symbols.dir/symbols/MYMODULE_mp_MYSUB-UPPER.c.o.requires
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/MYMODULE_mp_MYSUB-UPPER.c.o.provides.build
-.PHONY : CMakeFiles/symbols.dir/symbols/MYMODULE_mp_MYSUB-UPPER.c.o.provides
-
-CMakeFiles/symbols.dir/symbols/MYMODULE_mp_MYSUB-UPPER.c.o.provides.build: CMakeFiles/symbols.dir/symbols/MYMODULE_mp_MYSUB-UPPER.c.o
-
-CMakeFiles/symbols.dir/symbols/mymodule_mysub_.c.o: CMakeFiles/symbols.dir/flags.make
-CMakeFiles/symbols.dir/symbols/mymodule_mysub_.c.o: symbols/mymodule_mysub_.c
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles $(CMAKE_PROGRESS_24)
-	@echo "Building C object CMakeFiles/symbols.dir/symbols/mymodule_mysub_.c.o"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -o CMakeFiles/symbols.dir/symbols/mymodule_mysub_.c.o   -c /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mymodule_mysub_.c
-
-CMakeFiles/symbols.dir/symbols/mymodule_mysub_.c.i: cmake_force
-	@echo "Preprocessing C source to CMakeFiles/symbols.dir/symbols/mymodule_mysub_.c.i"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -E /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mymodule_mysub_.c > CMakeFiles/symbols.dir/symbols/mymodule_mysub_.c.i
-
-CMakeFiles/symbols.dir/symbols/mymodule_mysub_.c.s: cmake_force
-	@echo "Compiling C source to assembly CMakeFiles/symbols.dir/symbols/mymodule_mysub_.c.s"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -S /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mymodule_mysub_.c -o CMakeFiles/symbols.dir/symbols/mymodule_mysub_.c.s
-
-CMakeFiles/symbols.dir/symbols/mymodule_mysub_.c.o.requires:
-.PHONY : CMakeFiles/symbols.dir/symbols/mymodule_mysub_.c.o.requires
-
-CMakeFiles/symbols.dir/symbols/mymodule_mysub_.c.o.provides: CMakeFiles/symbols.dir/symbols/mymodule_mysub_.c.o.requires
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/mymodule_mysub_.c.o.provides.build
-.PHONY : CMakeFiles/symbols.dir/symbols/mymodule_mysub_.c.o.provides
-
-CMakeFiles/symbols.dir/symbols/mymodule_mysub_.c.o.provides.build: CMakeFiles/symbols.dir/symbols/mymodule_mysub_.c.o
-
-CMakeFiles/symbols.dir/symbols/mymodule_MP_mysub.c.o: CMakeFiles/symbols.dir/flags.make
-CMakeFiles/symbols.dir/symbols/mymodule_MP_mysub.c.o: symbols/mymodule_MP_mysub.c
-	$(CMAKE_COMMAND) -E cmake_progress_report /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles $(CMAKE_PROGRESS_25)
-	@echo "Building C object CMakeFiles/symbols.dir/symbols/mymodule_MP_mysub.c.o"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -o CMakeFiles/symbols.dir/symbols/mymodule_MP_mysub.c.o   -c /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mymodule_MP_mysub.c
-
-CMakeFiles/symbols.dir/symbols/mymodule_MP_mysub.c.i: cmake_force
-	@echo "Preprocessing C source to CMakeFiles/symbols.dir/symbols/mymodule_MP_mysub.c.i"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -E /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mymodule_MP_mysub.c > CMakeFiles/symbols.dir/symbols/mymodule_MP_mysub.c.i
-
-CMakeFiles/symbols.dir/symbols/mymodule_MP_mysub.c.s: cmake_force
-	@echo "Compiling C source to assembly CMakeFiles/symbols.dir/symbols/mymodule_MP_mysub.c.s"
-	/usr/bin/cc  $(C_DEFINES) $(C_FLAGS) -S /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mymodule_MP_mysub.c -o CMakeFiles/symbols.dir/symbols/mymodule_MP_mysub.c.s
-
-CMakeFiles/symbols.dir/symbols/mymodule_MP_mysub.c.o.requires:
-.PHONY : CMakeFiles/symbols.dir/symbols/mymodule_MP_mysub.c.o.requires
-
-CMakeFiles/symbols.dir/symbols/mymodule_MP_mysub.c.o.provides: CMakeFiles/symbols.dir/symbols/mymodule_MP_mysub.c.o.requires
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/mymodule_MP_mysub.c.o.provides.build
-.PHONY : CMakeFiles/symbols.dir/symbols/mymodule_MP_mysub.c.o.provides
-
-CMakeFiles/symbols.dir/symbols/mymodule_MP_mysub.c.o.provides.build: CMakeFiles/symbols.dir/symbols/mymodule_MP_mysub.c.o
-
-# Object files for target symbols
-symbols_OBJECTS = \
-"CMakeFiles/symbols.dir/mymodule_.c.o" \
-"CMakeFiles/symbols.dir/my_module_.c.o" \
-"CMakeFiles/symbols.dir/symbols/my_sub.c.o" \
-"CMakeFiles/symbols.dir/symbols/my_sub_.c.o" \
-"CMakeFiles/symbols.dir/symbols/my_sub__.c.o" \
-"CMakeFiles/symbols.dir/symbols/MY_SUB-UPPER.c.o" \
-"CMakeFiles/symbols.dir/symbols/mysub.c.o" \
-"CMakeFiles/symbols.dir/symbols/mysub_.c.o" \
-"CMakeFiles/symbols.dir/symbols/MYSUB-UPPER.c.o" \
-"CMakeFiles/symbols.dir/symbols/__my_module_MOD_my_sub.c.o" \
-"CMakeFiles/symbols.dir/symbols/__my_module_NMOD_my_sub.c.o" \
-"CMakeFiles/symbols.dir/symbols/__my_module__my_sub.c.o" \
-"CMakeFiles/symbols.dir/symbols/__mymodule_MOD_mysub.c.o" \
-"CMakeFiles/symbols.dir/symbols/__mymodule_NMOD_mysub.c.o" \
-"CMakeFiles/symbols.dir/symbols/__mymodule__mysub.c.o" \
-"CMakeFiles/symbols.dir/symbols/my_moduleSmy_sub.c.o" \
-"CMakeFiles/symbols.dir/symbols/my_module_mp_my_sub_.c.o" \
-"CMakeFiles/symbols.dir/symbols/MY_MODULE_mp_MY_SUB-UPPER.c.o" \
-"CMakeFiles/symbols.dir/symbols/my_module_my_sub_.c.o" \
-"CMakeFiles/symbols.dir/symbols/my_module_MP_my_sub.c.o" \
-"CMakeFiles/symbols.dir/symbols/mymoduleSmysub.c.o" \
-"CMakeFiles/symbols.dir/symbols/mymodule_mp_mysub_.c.o" \
-"CMakeFiles/symbols.dir/symbols/MYMODULE_mp_MYSUB-UPPER.c.o" \
-"CMakeFiles/symbols.dir/symbols/mymodule_mysub_.c.o" \
-"CMakeFiles/symbols.dir/symbols/mymodule_MP_mysub.c.o"
-
-# External object files for target symbols
-symbols_EXTERNAL_OBJECTS =
-
-libsymbols.a: CMakeFiles/symbols.dir/mymodule_.c.o
-libsymbols.a: CMakeFiles/symbols.dir/my_module_.c.o
-libsymbols.a: CMakeFiles/symbols.dir/symbols/my_sub.c.o
-libsymbols.a: CMakeFiles/symbols.dir/symbols/my_sub_.c.o
-libsymbols.a: CMakeFiles/symbols.dir/symbols/my_sub__.c.o
-libsymbols.a: CMakeFiles/symbols.dir/symbols/MY_SUB-UPPER.c.o
-libsymbols.a: CMakeFiles/symbols.dir/symbols/mysub.c.o
-libsymbols.a: CMakeFiles/symbols.dir/symbols/mysub_.c.o
-libsymbols.a: CMakeFiles/symbols.dir/symbols/MYSUB-UPPER.c.o
-libsymbols.a: CMakeFiles/symbols.dir/symbols/__my_module_MOD_my_sub.c.o
-libsymbols.a: CMakeFiles/symbols.dir/symbols/__my_module_NMOD_my_sub.c.o
-libsymbols.a: CMakeFiles/symbols.dir/symbols/__my_module__my_sub.c.o
-libsymbols.a: CMakeFiles/symbols.dir/symbols/__mymodule_MOD_mysub.c.o
-libsymbols.a: CMakeFiles/symbols.dir/symbols/__mymodule_NMOD_mysub.c.o
-libsymbols.a: CMakeFiles/symbols.dir/symbols/__mymodule__mysub.c.o
-libsymbols.a: CMakeFiles/symbols.dir/symbols/my_moduleSmy_sub.c.o
-libsymbols.a: CMakeFiles/symbols.dir/symbols/my_module_mp_my_sub_.c.o
-libsymbols.a: CMakeFiles/symbols.dir/symbols/MY_MODULE_mp_MY_SUB-UPPER.c.o
-libsymbols.a: CMakeFiles/symbols.dir/symbols/my_module_my_sub_.c.o
-libsymbols.a: CMakeFiles/symbols.dir/symbols/my_module_MP_my_sub.c.o
-libsymbols.a: CMakeFiles/symbols.dir/symbols/mymoduleSmysub.c.o
-libsymbols.a: CMakeFiles/symbols.dir/symbols/mymodule_mp_mysub_.c.o
-libsymbols.a: CMakeFiles/symbols.dir/symbols/MYMODULE_mp_MYSUB-UPPER.c.o
-libsymbols.a: CMakeFiles/symbols.dir/symbols/mymodule_mysub_.c.o
-libsymbols.a: CMakeFiles/symbols.dir/symbols/mymodule_MP_mysub.c.o
-libsymbols.a: CMakeFiles/symbols.dir/build.make
-libsymbols.a: CMakeFiles/symbols.dir/link.txt
-	@echo "Linking C static library libsymbols.a"
-	$(CMAKE_COMMAND) -P CMakeFiles/symbols.dir/cmake_clean_target.cmake
-	$(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/symbols.dir/link.txt --verbose=$(VERBOSE)
-
-# Rule to build all files generated by this target.
-CMakeFiles/symbols.dir/build: libsymbols.a
-.PHONY : CMakeFiles/symbols.dir/build
-
-CMakeFiles/symbols.dir/requires: CMakeFiles/symbols.dir/mymodule_.c.o.requires
-CMakeFiles/symbols.dir/requires: CMakeFiles/symbols.dir/my_module_.c.o.requires
-CMakeFiles/symbols.dir/requires: CMakeFiles/symbols.dir/symbols/my_sub.c.o.requires
-CMakeFiles/symbols.dir/requires: CMakeFiles/symbols.dir/symbols/my_sub_.c.o.requires
-CMakeFiles/symbols.dir/requires: CMakeFiles/symbols.dir/symbols/my_sub__.c.o.requires
-CMakeFiles/symbols.dir/requires: CMakeFiles/symbols.dir/symbols/MY_SUB-UPPER.c.o.requires
-CMakeFiles/symbols.dir/requires: CMakeFiles/symbols.dir/symbols/mysub.c.o.requires
-CMakeFiles/symbols.dir/requires: CMakeFiles/symbols.dir/symbols/mysub_.c.o.requires
-CMakeFiles/symbols.dir/requires: CMakeFiles/symbols.dir/symbols/MYSUB-UPPER.c.o.requires
-CMakeFiles/symbols.dir/requires: CMakeFiles/symbols.dir/symbols/__my_module_MOD_my_sub.c.o.requires
-CMakeFiles/symbols.dir/requires: CMakeFiles/symbols.dir/symbols/__my_module_NMOD_my_sub.c.o.requires
-CMakeFiles/symbols.dir/requires: CMakeFiles/symbols.dir/symbols/__my_module__my_sub.c.o.requires
-CMakeFiles/symbols.dir/requires: CMakeFiles/symbols.dir/symbols/__mymodule_MOD_mysub.c.o.requires
-CMakeFiles/symbols.dir/requires: CMakeFiles/symbols.dir/symbols/__mymodule_NMOD_mysub.c.o.requires
-CMakeFiles/symbols.dir/requires: CMakeFiles/symbols.dir/symbols/__mymodule__mysub.c.o.requires
-CMakeFiles/symbols.dir/requires: CMakeFiles/symbols.dir/symbols/my_moduleSmy_sub.c.o.requires
-CMakeFiles/symbols.dir/requires: CMakeFiles/symbols.dir/symbols/my_module_mp_my_sub_.c.o.requires
-CMakeFiles/symbols.dir/requires: CMakeFiles/symbols.dir/symbols/MY_MODULE_mp_MY_SUB-UPPER.c.o.requires
-CMakeFiles/symbols.dir/requires: CMakeFiles/symbols.dir/symbols/my_module_my_sub_.c.o.requires
-CMakeFiles/symbols.dir/requires: CMakeFiles/symbols.dir/symbols/my_module_MP_my_sub.c.o.requires
-CMakeFiles/symbols.dir/requires: CMakeFiles/symbols.dir/symbols/mymoduleSmysub.c.o.requires
-CMakeFiles/symbols.dir/requires: CMakeFiles/symbols.dir/symbols/mymodule_mp_mysub_.c.o.requires
-CMakeFiles/symbols.dir/requires: CMakeFiles/symbols.dir/symbols/MYMODULE_mp_MYSUB-UPPER.c.o.requires
-CMakeFiles/symbols.dir/requires: CMakeFiles/symbols.dir/symbols/mymodule_mysub_.c.o.requires
-CMakeFiles/symbols.dir/requires: CMakeFiles/symbols.dir/symbols/mymodule_MP_mysub.c.o.requires
-.PHONY : CMakeFiles/symbols.dir/requires
-
-CMakeFiles/symbols.dir/clean:
-	$(CMAKE_COMMAND) -P CMakeFiles/symbols.dir/cmake_clean.cmake
-.PHONY : CMakeFiles/symbols.dir/clean
-
-CMakeFiles/symbols.dir/depend:
-	cd /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/DependInfo.cmake
-.PHONY : CMakeFiles/symbols.dir/depend
-
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/cmake_clean.cmake b/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/cmake_clean.cmake
deleted file mode 100644
index 6e9497f..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/cmake_clean.cmake
+++ /dev/null
@@ -1,34 +0,0 @@
-FILE(REMOVE_RECURSE
-  "CMakeFiles/symbols.dir/mymodule_.c.o"
-  "CMakeFiles/symbols.dir/my_module_.c.o"
-  "CMakeFiles/symbols.dir/symbols/my_sub.c.o"
-  "CMakeFiles/symbols.dir/symbols/my_sub_.c.o"
-  "CMakeFiles/symbols.dir/symbols/my_sub__.c.o"
-  "CMakeFiles/symbols.dir/symbols/MY_SUB-UPPER.c.o"
-  "CMakeFiles/symbols.dir/symbols/mysub.c.o"
-  "CMakeFiles/symbols.dir/symbols/mysub_.c.o"
-  "CMakeFiles/symbols.dir/symbols/MYSUB-UPPER.c.o"
-  "CMakeFiles/symbols.dir/symbols/__my_module_MOD_my_sub.c.o"
-  "CMakeFiles/symbols.dir/symbols/__my_module_NMOD_my_sub.c.o"
-  "CMakeFiles/symbols.dir/symbols/__my_module__my_sub.c.o"
-  "CMakeFiles/symbols.dir/symbols/__mymodule_MOD_mysub.c.o"
-  "CMakeFiles/symbols.dir/symbols/__mymodule_NMOD_mysub.c.o"
-  "CMakeFiles/symbols.dir/symbols/__mymodule__mysub.c.o"
-  "CMakeFiles/symbols.dir/symbols/my_moduleSmy_sub.c.o"
-  "CMakeFiles/symbols.dir/symbols/my_module_mp_my_sub_.c.o"
-  "CMakeFiles/symbols.dir/symbols/MY_MODULE_mp_MY_SUB-UPPER.c.o"
-  "CMakeFiles/symbols.dir/symbols/my_module_my_sub_.c.o"
-  "CMakeFiles/symbols.dir/symbols/my_module_MP_my_sub.c.o"
-  "CMakeFiles/symbols.dir/symbols/mymoduleSmysub.c.o"
-  "CMakeFiles/symbols.dir/symbols/mymodule_mp_mysub_.c.o"
-  "CMakeFiles/symbols.dir/symbols/MYMODULE_mp_MYSUB-UPPER.c.o"
-  "CMakeFiles/symbols.dir/symbols/mymodule_mysub_.c.o"
-  "CMakeFiles/symbols.dir/symbols/mymodule_MP_mysub.c.o"
-  "libsymbols.pdb"
-  "libsymbols.a"
-)
-
-# Per-language clean rules from dependency scanning.
-FOREACH(lang C)
-  INCLUDE(CMakeFiles/symbols.dir/cmake_clean_${lang}.cmake OPTIONAL)
-ENDFOREACH(lang)
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/cmake_clean_target.cmake b/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/cmake_clean_target.cmake
deleted file mode 100644
index 365289f..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/cmake_clean_target.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-FILE(REMOVE_RECURSE
-  "libsymbols.a"
-)
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/depend.internal b/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/depend.internal
deleted file mode 100644
index e05e92f..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/depend.internal
+++ /dev/null
@@ -1,53 +0,0 @@
-# CMAKE generated file: DO NOT EDIT!
-# Generated by "Unix Makefiles" Generator, CMake Version 2.8
-
-CMakeFiles/symbols.dir/my_module_.c.o
- /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/my_module_.c
-CMakeFiles/symbols.dir/mymodule_.c.o
- /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/mymodule_.c
-CMakeFiles/symbols.dir/symbols/MYMODULE_mp_MYSUB-UPPER.c.o
- /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/MYMODULE_mp_MYSUB-UPPER.c
-CMakeFiles/symbols.dir/symbols/MYSUB-UPPER.c.o
- /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/MYSUB-UPPER.c
-CMakeFiles/symbols.dir/symbols/MY_MODULE_mp_MY_SUB-UPPER.c.o
- /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/MY_MODULE_mp_MY_SUB-UPPER.c
-CMakeFiles/symbols.dir/symbols/MY_SUB-UPPER.c.o
- /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/MY_SUB-UPPER.c
-CMakeFiles/symbols.dir/symbols/__my_module_MOD_my_sub.c.o
- /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__my_module_MOD_my_sub.c
-CMakeFiles/symbols.dir/symbols/__my_module_NMOD_my_sub.c.o
- /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__my_module_NMOD_my_sub.c
-CMakeFiles/symbols.dir/symbols/__my_module__my_sub.c.o
- /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__my_module__my_sub.c
-CMakeFiles/symbols.dir/symbols/__mymodule_MOD_mysub.c.o
- /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__mymodule_MOD_mysub.c
-CMakeFiles/symbols.dir/symbols/__mymodule_NMOD_mysub.c.o
- /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__mymodule_NMOD_mysub.c
-CMakeFiles/symbols.dir/symbols/__mymodule__mysub.c.o
- /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/__mymodule__mysub.c
-CMakeFiles/symbols.dir/symbols/my_moduleSmy_sub.c.o
- /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_moduleSmy_sub.c
-CMakeFiles/symbols.dir/symbols/my_module_MP_my_sub.c.o
- /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_module_MP_my_sub.c
-CMakeFiles/symbols.dir/symbols/my_module_mp_my_sub_.c.o
- /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_module_mp_my_sub_.c
-CMakeFiles/symbols.dir/symbols/my_module_my_sub_.c.o
- /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_module_my_sub_.c
-CMakeFiles/symbols.dir/symbols/my_sub.c.o
- /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_sub.c
-CMakeFiles/symbols.dir/symbols/my_sub_.c.o
- /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_sub_.c
-CMakeFiles/symbols.dir/symbols/my_sub__.c.o
- /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/my_sub__.c
-CMakeFiles/symbols.dir/symbols/mymoduleSmysub.c.o
- /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mymoduleSmysub.c
-CMakeFiles/symbols.dir/symbols/mymodule_MP_mysub.c.o
- /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mymodule_MP_mysub.c
-CMakeFiles/symbols.dir/symbols/mymodule_mp_mysub_.c.o
- /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mymodule_mp_mysub_.c
-CMakeFiles/symbols.dir/symbols/mymodule_mysub_.c.o
- /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mymodule_mysub_.c
-CMakeFiles/symbols.dir/symbols/mysub.c.o
- /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mysub.c
-CMakeFiles/symbols.dir/symbols/mysub_.c.o
- /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/symbols/mysub_.c
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/depend.make b/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/depend.make
deleted file mode 100644
index c7efdf3..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/depend.make
+++ /dev/null
@@ -1,53 +0,0 @@
-# CMAKE generated file: DO NOT EDIT!
-# Generated by "Unix Makefiles" Generator, CMake Version 2.8
-
-CMakeFiles/symbols.dir/my_module_.c.o: /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/my_module_.c
-
-CMakeFiles/symbols.dir/mymodule_.c.o: /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/mymodule_.c
-
-CMakeFiles/symbols.dir/symbols/MYMODULE_mp_MYSUB-UPPER.c.o: symbols/MYMODULE_mp_MYSUB-UPPER.c
-
-CMakeFiles/symbols.dir/symbols/MYSUB-UPPER.c.o: symbols/MYSUB-UPPER.c
-
-CMakeFiles/symbols.dir/symbols/MY_MODULE_mp_MY_SUB-UPPER.c.o: symbols/MY_MODULE_mp_MY_SUB-UPPER.c
-
-CMakeFiles/symbols.dir/symbols/MY_SUB-UPPER.c.o: symbols/MY_SUB-UPPER.c
-
-CMakeFiles/symbols.dir/symbols/__my_module_MOD_my_sub.c.o: symbols/__my_module_MOD_my_sub.c
-
-CMakeFiles/symbols.dir/symbols/__my_module_NMOD_my_sub.c.o: symbols/__my_module_NMOD_my_sub.c
-
-CMakeFiles/symbols.dir/symbols/__my_module__my_sub.c.o: symbols/__my_module__my_sub.c
-
-CMakeFiles/symbols.dir/symbols/__mymodule_MOD_mysub.c.o: symbols/__mymodule_MOD_mysub.c
-
-CMakeFiles/symbols.dir/symbols/__mymodule_NMOD_mysub.c.o: symbols/__mymodule_NMOD_mysub.c
-
-CMakeFiles/symbols.dir/symbols/__mymodule__mysub.c.o: symbols/__mymodule__mysub.c
-
-CMakeFiles/symbols.dir/symbols/my_moduleSmy_sub.c.o: symbols/my_moduleSmy_sub.c
-
-CMakeFiles/symbols.dir/symbols/my_module_MP_my_sub.c.o: symbols/my_module_MP_my_sub.c
-
-CMakeFiles/symbols.dir/symbols/my_module_mp_my_sub_.c.o: symbols/my_module_mp_my_sub_.c
-
-CMakeFiles/symbols.dir/symbols/my_module_my_sub_.c.o: symbols/my_module_my_sub_.c
-
-CMakeFiles/symbols.dir/symbols/my_sub.c.o: symbols/my_sub.c
-
-CMakeFiles/symbols.dir/symbols/my_sub_.c.o: symbols/my_sub_.c
-
-CMakeFiles/symbols.dir/symbols/my_sub__.c.o: symbols/my_sub__.c
-
-CMakeFiles/symbols.dir/symbols/mymoduleSmysub.c.o: symbols/mymoduleSmysub.c
-
-CMakeFiles/symbols.dir/symbols/mymodule_MP_mysub.c.o: symbols/mymodule_MP_mysub.c
-
-CMakeFiles/symbols.dir/symbols/mymodule_mp_mysub_.c.o: symbols/mymodule_mp_mysub_.c
-
-CMakeFiles/symbols.dir/symbols/mymodule_mysub_.c.o: symbols/mymodule_mysub_.c
-
-CMakeFiles/symbols.dir/symbols/mysub.c.o: symbols/mysub.c
-
-CMakeFiles/symbols.dir/symbols/mysub_.c.o: symbols/mysub_.c
-
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/flags.make b/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/flags.make
deleted file mode 100644
index 1a9eee2..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/flags.make
+++ /dev/null
@@ -1,8 +0,0 @@
-# CMAKE generated file: DO NOT EDIT!
-# Generated by "Unix Makefiles" Generator, CMake Version 2.8
-
-# compile C with /usr/bin/cc
-C_FLAGS =  -pipe  
-
-C_DEFINES = 
-
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/link.txt b/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/link.txt
deleted file mode 100644
index 30cac76..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/link.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-/usr/bin/ar cr libsymbols.a  CMakeFiles/symbols.dir/mymodule_.c.o CMakeFiles/symbols.dir/my_module_.c.o CMakeFiles/symbols.dir/symbols/my_sub.c.o CMakeFiles/symbols.dir/symbols/my_sub_.c.o CMakeFiles/symbols.dir/symbols/my_sub__.c.o CMakeFiles/symbols.dir/symbols/MY_SUB-UPPER.c.o CMakeFiles/symbols.dir/symbols/mysub.c.o CMakeFiles/symbols.dir/symbols/mysub_.c.o CMakeFiles/symbols.dir/symbols/MYSUB-UPPER.c.o CMakeFiles/symbols.dir/symbols/__my_module_MOD_my_sub.c.o CMakeFiles/symbols.dir/ [...]
-/usr/bin/ranlib libsymbols.a
diff --git a/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/progress.make b/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/progress.make
deleted file mode 100644
index 813c8c9..0000000
--- a/CMakeFiles/FortranCInterface/CMakeFiles/symbols.dir/progress.make
+++ /dev/null
@@ -1,26 +0,0 @@
-CMAKE_PROGRESS_1 = 8
-CMAKE_PROGRESS_2 = 9
-CMAKE_PROGRESS_3 = 10
-CMAKE_PROGRESS_4 = 11
-CMAKE_PROGRESS_5 = 12
-CMAKE_PROGRESS_6 = 13
-CMAKE_PROGRESS_7 = 14
-CMAKE_PROGRESS_8 = 15
-CMAKE_PROGRESS_9 = 16
-CMAKE_PROGRESS_10 = 17
-CMAKE_PROGRESS_11 = 18
-CMAKE_PROGRESS_12 = 19
-CMAKE_PROGRESS_13 = 20
-CMAKE_PROGRESS_14 = 21
-CMAKE_PROGRESS_15 = 22
-CMAKE_PROGRESS_16 = 23
-CMAKE_PROGRESS_17 = 24
-CMAKE_PROGRESS_18 = 25
-CMAKE_PROGRESS_19 = 26
-CMAKE_PROGRESS_20 = 27
-CMAKE_PROGRESS_21 = 28
-CMAKE_PROGRESS_22 = 29
-CMAKE_PROGRESS_23 = 30
-CMAKE_PROGRESS_24 = 31
-CMAKE_PROGRESS_25 = 32
-
diff --git a/CMakeFiles/FortranCInterface/FortranCInterface b/CMakeFiles/FortranCInterface/FortranCInterface
deleted file mode 100755
index b952dde..0000000
Binary files a/CMakeFiles/FortranCInterface/FortranCInterface and /dev/null differ
diff --git a/CMakeFiles/FortranCInterface/Input.cmake b/CMakeFiles/FortranCInterface/Input.cmake
deleted file mode 100644
index d56b465..0000000
--- a/CMakeFiles/FortranCInterface/Input.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-set(CMAKE_Fortran_COMPILER_ID "GNU")
-set(FortranCInterface_GLOBAL_SYMBOLS "")
-set(FortranCInterface_MODULE_SYMBOLS "")
diff --git a/CMakeFiles/FortranCInterface/Makefile b/CMakeFiles/FortranCInterface/Makefile
deleted file mode 100644
index ec7790c..0000000
--- a/CMakeFiles/FortranCInterface/Makefile
+++ /dev/null
@@ -1,905 +0,0 @@
-# CMAKE generated file: DO NOT EDIT!
-# Generated by "Unix Makefiles" Generator, CMake Version 2.8
-
-# Default target executed when no arguments are given to make.
-default_target: all
-.PHONY : default_target
-
-#=============================================================================
-# Special targets provided by cmake.
-
-# Disable implicit rules so canonical targets will work.
-.SUFFIXES:
-
-# Remove some rules from gmake that .SUFFIXES does not remove.
-SUFFIXES =
-
-.SUFFIXES: .hpux_make_needs_suffix_list
-
-# Suppress display of executed commands.
-$(VERBOSE).SILENT:
-
-# A target that is always out of date.
-cmake_force:
-.PHONY : cmake_force
-
-#=============================================================================
-# Set environment variables for the build.
-
-# The shell in which to execute make rules.
-SHELL = /bin/sh
-
-# The CMake executable.
-CMAKE_COMMAND = /usr/local/apps/cmake/2.8.10/bin/cmake
-
-# The command to remove a file.
-RM = /usr/local/apps/cmake/2.8.10/bin/cmake -E remove -f
-
-# Escaping for special characters.
-EQUALS = =
-
-# The program to use to edit the cache.
-CMAKE_EDIT_COMMAND = /usr/local/apps/cmake/2.8.10/bin/ccmake
-
-# The top-level source directory on which CMake was run.
-CMAKE_SOURCE_DIR = /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface
-
-# The top-level build directory on which CMake was run.
-CMAKE_BINARY_DIR = /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface
-
-#=============================================================================
-# Targets provided globally by CMake.
-
-# Special rule for the target edit_cache
-edit_cache:
-	@echo "Running CMake cache editor..."
-	/usr/local/apps/cmake/2.8.10/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
-.PHONY : edit_cache
-
-# Special rule for the target edit_cache
-edit_cache/fast: edit_cache
-.PHONY : edit_cache/fast
-
-# Special rule for the target rebuild_cache
-rebuild_cache:
-	@echo "Running CMake to regenerate build system..."
-	/usr/local/apps/cmake/2.8.10/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
-.PHONY : rebuild_cache
-
-# Special rule for the target rebuild_cache
-rebuild_cache/fast: rebuild_cache
-.PHONY : rebuild_cache/fast
-
-# The main all target
-all: cmake_check_build_system
-	$(CMAKE_COMMAND) -E cmake_progress_start /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles/progress.marks
-	$(MAKE) -f CMakeFiles/Makefile2 all
-	$(CMAKE_COMMAND) -E cmake_progress_start /home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/CMakeFiles 0
-.PHONY : all
-
-# The main clean target
-clean:
-	$(MAKE) -f CMakeFiles/Makefile2 clean
-.PHONY : clean
-
-# The main clean target
-clean/fast: clean
-.PHONY : clean/fast
-
-# Prepare targets for installation.
-preinstall: all
-	$(MAKE) -f CMakeFiles/Makefile2 preinstall
-.PHONY : preinstall
-
-# Prepare targets for installation.
-preinstall/fast:
-	$(MAKE) -f CMakeFiles/Makefile2 preinstall
-.PHONY : preinstall/fast
-
-# clear depends
-depend:
-	$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
-.PHONY : depend
-
-#=============================================================================
-# Target rules for targets named FortranCInterface
-
-# Build rule for target.
-FortranCInterface: cmake_check_build_system
-	$(MAKE) -f CMakeFiles/Makefile2 FortranCInterface
-.PHONY : FortranCInterface
-
-# fast build rule for target.
-FortranCInterface/fast:
-	$(MAKE) -f CMakeFiles/FortranCInterface.dir/build.make CMakeFiles/FortranCInterface.dir/build
-.PHONY : FortranCInterface/fast
-
-#=============================================================================
-# Target rules for targets named myfort
-
-# Build rule for target.
-myfort: cmake_check_build_system
-	$(MAKE) -f CMakeFiles/Makefile2 myfort
-.PHONY : myfort
-
-# fast build rule for target.
-myfort/fast:
-	$(MAKE) -f CMakeFiles/myfort.dir/build.make CMakeFiles/myfort.dir/build
-.PHONY : myfort/fast
-
-#=============================================================================
-# Target rules for targets named symbols
-
-# Build rule for target.
-symbols: cmake_check_build_system
-	$(MAKE) -f CMakeFiles/Makefile2 symbols
-.PHONY : symbols
-
-# fast build rule for target.
-symbols/fast:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/build
-.PHONY : symbols/fast
-
-call_mod.o: call_mod.f90.o
-.PHONY : call_mod.o
-
-# target to build an object file
-call_mod.f90.o:
-	$(MAKE) -f CMakeFiles/FortranCInterface.dir/build.make CMakeFiles/FortranCInterface.dir/call_mod.f90.o
-.PHONY : call_mod.f90.o
-
-call_sub.o: call_sub.f.o
-.PHONY : call_sub.o
-
-# target to build an object file
-call_sub.f.o:
-	$(MAKE) -f CMakeFiles/FortranCInterface.dir/build.make CMakeFiles/FortranCInterface.dir/call_sub.f.o
-.PHONY : call_sub.f.o
-
-main.o: main.F.o
-.PHONY : main.o
-
-# target to build an object file
-main.F.o:
-	$(MAKE) -f CMakeFiles/FortranCInterface.dir/build.make CMakeFiles/FortranCInterface.dir/main.F.o
-.PHONY : main.F.o
-
-my_module.o: my_module.f90.o
-.PHONY : my_module.o
-
-# target to build an object file
-my_module.f90.o:
-	$(MAKE) -f CMakeFiles/myfort.dir/build.make CMakeFiles/myfort.dir/my_module.f90.o
-.PHONY : my_module.f90.o
-
-my_module_.o: my_module_.c.o
-.PHONY : my_module_.o
-
-# target to build an object file
-my_module_.c.o:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/my_module_.c.o
-.PHONY : my_module_.c.o
-
-my_module_.i: my_module_.c.i
-.PHONY : my_module_.i
-
-# target to preprocess a source file
-my_module_.c.i:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/my_module_.c.i
-.PHONY : my_module_.c.i
-
-my_module_.s: my_module_.c.s
-.PHONY : my_module_.s
-
-# target to generate assembly for a file
-my_module_.c.s:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/my_module_.c.s
-.PHONY : my_module_.c.s
-
-my_sub.o: my_sub.f.o
-.PHONY : my_sub.o
-
-# target to build an object file
-my_sub.f.o:
-	$(MAKE) -f CMakeFiles/myfort.dir/build.make CMakeFiles/myfort.dir/my_sub.f.o
-.PHONY : my_sub.f.o
-
-mymodule.o: mymodule.f90.o
-.PHONY : mymodule.o
-
-# target to build an object file
-mymodule.f90.o:
-	$(MAKE) -f CMakeFiles/myfort.dir/build.make CMakeFiles/myfort.dir/mymodule.f90.o
-.PHONY : mymodule.f90.o
-
-mymodule_.o: mymodule_.c.o
-.PHONY : mymodule_.o
-
-# target to build an object file
-mymodule_.c.o:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/mymodule_.c.o
-.PHONY : mymodule_.c.o
-
-mymodule_.i: mymodule_.c.i
-.PHONY : mymodule_.i
-
-# target to preprocess a source file
-mymodule_.c.i:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/mymodule_.c.i
-.PHONY : mymodule_.c.i
-
-mymodule_.s: mymodule_.c.s
-.PHONY : mymodule_.s
-
-# target to generate assembly for a file
-mymodule_.c.s:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/mymodule_.c.s
-.PHONY : mymodule_.c.s
-
-mysub.o: mysub.f.o
-.PHONY : mysub.o
-
-# target to build an object file
-mysub.f.o:
-	$(MAKE) -f CMakeFiles/myfort.dir/build.make CMakeFiles/myfort.dir/mysub.f.o
-.PHONY : mysub.f.o
-
-symbols/MYMODULE_mp_MYSUB-UPPER.o: symbols/MYMODULE_mp_MYSUB-UPPER.c.o
-.PHONY : symbols/MYMODULE_mp_MYSUB-UPPER.o
-
-# target to build an object file
-symbols/MYMODULE_mp_MYSUB-UPPER.c.o:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/MYMODULE_mp_MYSUB-UPPER.c.o
-.PHONY : symbols/MYMODULE_mp_MYSUB-UPPER.c.o
-
-symbols/MYMODULE_mp_MYSUB-UPPER.i: symbols/MYMODULE_mp_MYSUB-UPPER.c.i
-.PHONY : symbols/MYMODULE_mp_MYSUB-UPPER.i
-
-# target to preprocess a source file
-symbols/MYMODULE_mp_MYSUB-UPPER.c.i:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/MYMODULE_mp_MYSUB-UPPER.c.i
-.PHONY : symbols/MYMODULE_mp_MYSUB-UPPER.c.i
-
-symbols/MYMODULE_mp_MYSUB-UPPER.s: symbols/MYMODULE_mp_MYSUB-UPPER.c.s
-.PHONY : symbols/MYMODULE_mp_MYSUB-UPPER.s
-
-# target to generate assembly for a file
-symbols/MYMODULE_mp_MYSUB-UPPER.c.s:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/MYMODULE_mp_MYSUB-UPPER.c.s
-.PHONY : symbols/MYMODULE_mp_MYSUB-UPPER.c.s
-
-symbols/MYSUB-UPPER.o: symbols/MYSUB-UPPER.c.o
-.PHONY : symbols/MYSUB-UPPER.o
-
-# target to build an object file
-symbols/MYSUB-UPPER.c.o:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/MYSUB-UPPER.c.o
-.PHONY : symbols/MYSUB-UPPER.c.o
-
-symbols/MYSUB-UPPER.i: symbols/MYSUB-UPPER.c.i
-.PHONY : symbols/MYSUB-UPPER.i
-
-# target to preprocess a source file
-symbols/MYSUB-UPPER.c.i:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/MYSUB-UPPER.c.i
-.PHONY : symbols/MYSUB-UPPER.c.i
-
-symbols/MYSUB-UPPER.s: symbols/MYSUB-UPPER.c.s
-.PHONY : symbols/MYSUB-UPPER.s
-
-# target to generate assembly for a file
-symbols/MYSUB-UPPER.c.s:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/MYSUB-UPPER.c.s
-.PHONY : symbols/MYSUB-UPPER.c.s
-
-symbols/MY_MODULE_mp_MY_SUB-UPPER.o: symbols/MY_MODULE_mp_MY_SUB-UPPER.c.o
-.PHONY : symbols/MY_MODULE_mp_MY_SUB-UPPER.o
-
-# target to build an object file
-symbols/MY_MODULE_mp_MY_SUB-UPPER.c.o:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/MY_MODULE_mp_MY_SUB-UPPER.c.o
-.PHONY : symbols/MY_MODULE_mp_MY_SUB-UPPER.c.o
-
-symbols/MY_MODULE_mp_MY_SUB-UPPER.i: symbols/MY_MODULE_mp_MY_SUB-UPPER.c.i
-.PHONY : symbols/MY_MODULE_mp_MY_SUB-UPPER.i
-
-# target to preprocess a source file
-symbols/MY_MODULE_mp_MY_SUB-UPPER.c.i:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/MY_MODULE_mp_MY_SUB-UPPER.c.i
-.PHONY : symbols/MY_MODULE_mp_MY_SUB-UPPER.c.i
-
-symbols/MY_MODULE_mp_MY_SUB-UPPER.s: symbols/MY_MODULE_mp_MY_SUB-UPPER.c.s
-.PHONY : symbols/MY_MODULE_mp_MY_SUB-UPPER.s
-
-# target to generate assembly for a file
-symbols/MY_MODULE_mp_MY_SUB-UPPER.c.s:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/MY_MODULE_mp_MY_SUB-UPPER.c.s
-.PHONY : symbols/MY_MODULE_mp_MY_SUB-UPPER.c.s
-
-symbols/MY_SUB-UPPER.o: symbols/MY_SUB-UPPER.c.o
-.PHONY : symbols/MY_SUB-UPPER.o
-
-# target to build an object file
-symbols/MY_SUB-UPPER.c.o:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/MY_SUB-UPPER.c.o
-.PHONY : symbols/MY_SUB-UPPER.c.o
-
-symbols/MY_SUB-UPPER.i: symbols/MY_SUB-UPPER.c.i
-.PHONY : symbols/MY_SUB-UPPER.i
-
-# target to preprocess a source file
-symbols/MY_SUB-UPPER.c.i:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/MY_SUB-UPPER.c.i
-.PHONY : symbols/MY_SUB-UPPER.c.i
-
-symbols/MY_SUB-UPPER.s: symbols/MY_SUB-UPPER.c.s
-.PHONY : symbols/MY_SUB-UPPER.s
-
-# target to generate assembly for a file
-symbols/MY_SUB-UPPER.c.s:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/MY_SUB-UPPER.c.s
-.PHONY : symbols/MY_SUB-UPPER.c.s
-
-symbols/__my_module_MOD_my_sub.o: symbols/__my_module_MOD_my_sub.c.o
-.PHONY : symbols/__my_module_MOD_my_sub.o
-
-# target to build an object file
-symbols/__my_module_MOD_my_sub.c.o:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/__my_module_MOD_my_sub.c.o
-.PHONY : symbols/__my_module_MOD_my_sub.c.o
-
-symbols/__my_module_MOD_my_sub.i: symbols/__my_module_MOD_my_sub.c.i
-.PHONY : symbols/__my_module_MOD_my_sub.i
-
-# target to preprocess a source file
-symbols/__my_module_MOD_my_sub.c.i:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/__my_module_MOD_my_sub.c.i
-.PHONY : symbols/__my_module_MOD_my_sub.c.i
-
-symbols/__my_module_MOD_my_sub.s: symbols/__my_module_MOD_my_sub.c.s
-.PHONY : symbols/__my_module_MOD_my_sub.s
-
-# target to generate assembly for a file
-symbols/__my_module_MOD_my_sub.c.s:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/__my_module_MOD_my_sub.c.s
-.PHONY : symbols/__my_module_MOD_my_sub.c.s
-
-symbols/__my_module_NMOD_my_sub.o: symbols/__my_module_NMOD_my_sub.c.o
-.PHONY : symbols/__my_module_NMOD_my_sub.o
-
-# target to build an object file
-symbols/__my_module_NMOD_my_sub.c.o:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/__my_module_NMOD_my_sub.c.o
-.PHONY : symbols/__my_module_NMOD_my_sub.c.o
-
-symbols/__my_module_NMOD_my_sub.i: symbols/__my_module_NMOD_my_sub.c.i
-.PHONY : symbols/__my_module_NMOD_my_sub.i
-
-# target to preprocess a source file
-symbols/__my_module_NMOD_my_sub.c.i:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/__my_module_NMOD_my_sub.c.i
-.PHONY : symbols/__my_module_NMOD_my_sub.c.i
-
-symbols/__my_module_NMOD_my_sub.s: symbols/__my_module_NMOD_my_sub.c.s
-.PHONY : symbols/__my_module_NMOD_my_sub.s
-
-# target to generate assembly for a file
-symbols/__my_module_NMOD_my_sub.c.s:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/__my_module_NMOD_my_sub.c.s
-.PHONY : symbols/__my_module_NMOD_my_sub.c.s
-
-symbols/__my_module__my_sub.o: symbols/__my_module__my_sub.c.o
-.PHONY : symbols/__my_module__my_sub.o
-
-# target to build an object file
-symbols/__my_module__my_sub.c.o:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/__my_module__my_sub.c.o
-.PHONY : symbols/__my_module__my_sub.c.o
-
-symbols/__my_module__my_sub.i: symbols/__my_module__my_sub.c.i
-.PHONY : symbols/__my_module__my_sub.i
-
-# target to preprocess a source file
-symbols/__my_module__my_sub.c.i:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/__my_module__my_sub.c.i
-.PHONY : symbols/__my_module__my_sub.c.i
-
-symbols/__my_module__my_sub.s: symbols/__my_module__my_sub.c.s
-.PHONY : symbols/__my_module__my_sub.s
-
-# target to generate assembly for a file
-symbols/__my_module__my_sub.c.s:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/__my_module__my_sub.c.s
-.PHONY : symbols/__my_module__my_sub.c.s
-
-symbols/__mymodule_MOD_mysub.o: symbols/__mymodule_MOD_mysub.c.o
-.PHONY : symbols/__mymodule_MOD_mysub.o
-
-# target to build an object file
-symbols/__mymodule_MOD_mysub.c.o:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/__mymodule_MOD_mysub.c.o
-.PHONY : symbols/__mymodule_MOD_mysub.c.o
-
-symbols/__mymodule_MOD_mysub.i: symbols/__mymodule_MOD_mysub.c.i
-.PHONY : symbols/__mymodule_MOD_mysub.i
-
-# target to preprocess a source file
-symbols/__mymodule_MOD_mysub.c.i:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/__mymodule_MOD_mysub.c.i
-.PHONY : symbols/__mymodule_MOD_mysub.c.i
-
-symbols/__mymodule_MOD_mysub.s: symbols/__mymodule_MOD_mysub.c.s
-.PHONY : symbols/__mymodule_MOD_mysub.s
-
-# target to generate assembly for a file
-symbols/__mymodule_MOD_mysub.c.s:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/__mymodule_MOD_mysub.c.s
-.PHONY : symbols/__mymodule_MOD_mysub.c.s
-
-symbols/__mymodule_NMOD_mysub.o: symbols/__mymodule_NMOD_mysub.c.o
-.PHONY : symbols/__mymodule_NMOD_mysub.o
-
-# target to build an object file
-symbols/__mymodule_NMOD_mysub.c.o:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/__mymodule_NMOD_mysub.c.o
-.PHONY : symbols/__mymodule_NMOD_mysub.c.o
-
-symbols/__mymodule_NMOD_mysub.i: symbols/__mymodule_NMOD_mysub.c.i
-.PHONY : symbols/__mymodule_NMOD_mysub.i
-
-# target to preprocess a source file
-symbols/__mymodule_NMOD_mysub.c.i:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/__mymodule_NMOD_mysub.c.i
-.PHONY : symbols/__mymodule_NMOD_mysub.c.i
-
-symbols/__mymodule_NMOD_mysub.s: symbols/__mymodule_NMOD_mysub.c.s
-.PHONY : symbols/__mymodule_NMOD_mysub.s
-
-# target to generate assembly for a file
-symbols/__mymodule_NMOD_mysub.c.s:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/__mymodule_NMOD_mysub.c.s
-.PHONY : symbols/__mymodule_NMOD_mysub.c.s
-
-symbols/__mymodule__mysub.o: symbols/__mymodule__mysub.c.o
-.PHONY : symbols/__mymodule__mysub.o
-
-# target to build an object file
-symbols/__mymodule__mysub.c.o:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/__mymodule__mysub.c.o
-.PHONY : symbols/__mymodule__mysub.c.o
-
-symbols/__mymodule__mysub.i: symbols/__mymodule__mysub.c.i
-.PHONY : symbols/__mymodule__mysub.i
-
-# target to preprocess a source file
-symbols/__mymodule__mysub.c.i:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/__mymodule__mysub.c.i
-.PHONY : symbols/__mymodule__mysub.c.i
-
-symbols/__mymodule__mysub.s: symbols/__mymodule__mysub.c.s
-.PHONY : symbols/__mymodule__mysub.s
-
-# target to generate assembly for a file
-symbols/__mymodule__mysub.c.s:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/__mymodule__mysub.c.s
-.PHONY : symbols/__mymodule__mysub.c.s
-
-symbols/my_moduleSmy_sub.o: symbols/my_moduleSmy_sub.c.o
-.PHONY : symbols/my_moduleSmy_sub.o
-
-# target to build an object file
-symbols/my_moduleSmy_sub.c.o:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/my_moduleSmy_sub.c.o
-.PHONY : symbols/my_moduleSmy_sub.c.o
-
-symbols/my_moduleSmy_sub.i: symbols/my_moduleSmy_sub.c.i
-.PHONY : symbols/my_moduleSmy_sub.i
-
-# target to preprocess a source file
-symbols/my_moduleSmy_sub.c.i:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/my_moduleSmy_sub.c.i
-.PHONY : symbols/my_moduleSmy_sub.c.i
-
-symbols/my_moduleSmy_sub.s: symbols/my_moduleSmy_sub.c.s
-.PHONY : symbols/my_moduleSmy_sub.s
-
-# target to generate assembly for a file
-symbols/my_moduleSmy_sub.c.s:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/my_moduleSmy_sub.c.s
-.PHONY : symbols/my_moduleSmy_sub.c.s
-
-symbols/my_module_MP_my_sub.o: symbols/my_module_MP_my_sub.c.o
-.PHONY : symbols/my_module_MP_my_sub.o
-
-# target to build an object file
-symbols/my_module_MP_my_sub.c.o:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/my_module_MP_my_sub.c.o
-.PHONY : symbols/my_module_MP_my_sub.c.o
-
-symbols/my_module_MP_my_sub.i: symbols/my_module_MP_my_sub.c.i
-.PHONY : symbols/my_module_MP_my_sub.i
-
-# target to preprocess a source file
-symbols/my_module_MP_my_sub.c.i:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/my_module_MP_my_sub.c.i
-.PHONY : symbols/my_module_MP_my_sub.c.i
-
-symbols/my_module_MP_my_sub.s: symbols/my_module_MP_my_sub.c.s
-.PHONY : symbols/my_module_MP_my_sub.s
-
-# target to generate assembly for a file
-symbols/my_module_MP_my_sub.c.s:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/my_module_MP_my_sub.c.s
-.PHONY : symbols/my_module_MP_my_sub.c.s
-
-symbols/my_module_mp_my_sub_.o: symbols/my_module_mp_my_sub_.c.o
-.PHONY : symbols/my_module_mp_my_sub_.o
-
-# target to build an object file
-symbols/my_module_mp_my_sub_.c.o:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/my_module_mp_my_sub_.c.o
-.PHONY : symbols/my_module_mp_my_sub_.c.o
-
-symbols/my_module_mp_my_sub_.i: symbols/my_module_mp_my_sub_.c.i
-.PHONY : symbols/my_module_mp_my_sub_.i
-
-# target to preprocess a source file
-symbols/my_module_mp_my_sub_.c.i:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/my_module_mp_my_sub_.c.i
-.PHONY : symbols/my_module_mp_my_sub_.c.i
-
-symbols/my_module_mp_my_sub_.s: symbols/my_module_mp_my_sub_.c.s
-.PHONY : symbols/my_module_mp_my_sub_.s
-
-# target to generate assembly for a file
-symbols/my_module_mp_my_sub_.c.s:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/my_module_mp_my_sub_.c.s
-.PHONY : symbols/my_module_mp_my_sub_.c.s
-
-symbols/my_module_my_sub_.o: symbols/my_module_my_sub_.c.o
-.PHONY : symbols/my_module_my_sub_.o
-
-# target to build an object file
-symbols/my_module_my_sub_.c.o:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/my_module_my_sub_.c.o
-.PHONY : symbols/my_module_my_sub_.c.o
-
-symbols/my_module_my_sub_.i: symbols/my_module_my_sub_.c.i
-.PHONY : symbols/my_module_my_sub_.i
-
-# target to preprocess a source file
-symbols/my_module_my_sub_.c.i:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/my_module_my_sub_.c.i
-.PHONY : symbols/my_module_my_sub_.c.i
-
-symbols/my_module_my_sub_.s: symbols/my_module_my_sub_.c.s
-.PHONY : symbols/my_module_my_sub_.s
-
-# target to generate assembly for a file
-symbols/my_module_my_sub_.c.s:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/my_module_my_sub_.c.s
-.PHONY : symbols/my_module_my_sub_.c.s
-
-symbols/my_sub.o: symbols/my_sub.c.o
-.PHONY : symbols/my_sub.o
-
-# target to build an object file
-symbols/my_sub.c.o:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/my_sub.c.o
-.PHONY : symbols/my_sub.c.o
-
-symbols/my_sub.i: symbols/my_sub.c.i
-.PHONY : symbols/my_sub.i
-
-# target to preprocess a source file
-symbols/my_sub.c.i:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/my_sub.c.i
-.PHONY : symbols/my_sub.c.i
-
-symbols/my_sub.s: symbols/my_sub.c.s
-.PHONY : symbols/my_sub.s
-
-# target to generate assembly for a file
-symbols/my_sub.c.s:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/my_sub.c.s
-.PHONY : symbols/my_sub.c.s
-
-symbols/my_sub_.o: symbols/my_sub_.c.o
-.PHONY : symbols/my_sub_.o
-
-# target to build an object file
-symbols/my_sub_.c.o:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/my_sub_.c.o
-.PHONY : symbols/my_sub_.c.o
-
-symbols/my_sub_.i: symbols/my_sub_.c.i
-.PHONY : symbols/my_sub_.i
-
-# target to preprocess a source file
-symbols/my_sub_.c.i:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/my_sub_.c.i
-.PHONY : symbols/my_sub_.c.i
-
-symbols/my_sub_.s: symbols/my_sub_.c.s
-.PHONY : symbols/my_sub_.s
-
-# target to generate assembly for a file
-symbols/my_sub_.c.s:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/my_sub_.c.s
-.PHONY : symbols/my_sub_.c.s
-
-symbols/my_sub__.o: symbols/my_sub__.c.o
-.PHONY : symbols/my_sub__.o
-
-# target to build an object file
-symbols/my_sub__.c.o:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/my_sub__.c.o
-.PHONY : symbols/my_sub__.c.o
-
-symbols/my_sub__.i: symbols/my_sub__.c.i
-.PHONY : symbols/my_sub__.i
-
-# target to preprocess a source file
-symbols/my_sub__.c.i:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/my_sub__.c.i
-.PHONY : symbols/my_sub__.c.i
-
-symbols/my_sub__.s: symbols/my_sub__.c.s
-.PHONY : symbols/my_sub__.s
-
-# target to generate assembly for a file
-symbols/my_sub__.c.s:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/my_sub__.c.s
-.PHONY : symbols/my_sub__.c.s
-
-symbols/mymoduleSmysub.o: symbols/mymoduleSmysub.c.o
-.PHONY : symbols/mymoduleSmysub.o
-
-# target to build an object file
-symbols/mymoduleSmysub.c.o:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/mymoduleSmysub.c.o
-.PHONY : symbols/mymoduleSmysub.c.o
-
-symbols/mymoduleSmysub.i: symbols/mymoduleSmysub.c.i
-.PHONY : symbols/mymoduleSmysub.i
-
-# target to preprocess a source file
-symbols/mymoduleSmysub.c.i:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/mymoduleSmysub.c.i
-.PHONY : symbols/mymoduleSmysub.c.i
-
-symbols/mymoduleSmysub.s: symbols/mymoduleSmysub.c.s
-.PHONY : symbols/mymoduleSmysub.s
-
-# target to generate assembly for a file
-symbols/mymoduleSmysub.c.s:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/mymoduleSmysub.c.s
-.PHONY : symbols/mymoduleSmysub.c.s
-
-symbols/mymodule_MP_mysub.o: symbols/mymodule_MP_mysub.c.o
-.PHONY : symbols/mymodule_MP_mysub.o
-
-# target to build an object file
-symbols/mymodule_MP_mysub.c.o:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/mymodule_MP_mysub.c.o
-.PHONY : symbols/mymodule_MP_mysub.c.o
-
-symbols/mymodule_MP_mysub.i: symbols/mymodule_MP_mysub.c.i
-.PHONY : symbols/mymodule_MP_mysub.i
-
-# target to preprocess a source file
-symbols/mymodule_MP_mysub.c.i:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/mymodule_MP_mysub.c.i
-.PHONY : symbols/mymodule_MP_mysub.c.i
-
-symbols/mymodule_MP_mysub.s: symbols/mymodule_MP_mysub.c.s
-.PHONY : symbols/mymodule_MP_mysub.s
-
-# target to generate assembly for a file
-symbols/mymodule_MP_mysub.c.s:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/mymodule_MP_mysub.c.s
-.PHONY : symbols/mymodule_MP_mysub.c.s
-
-symbols/mymodule_mp_mysub_.o: symbols/mymodule_mp_mysub_.c.o
-.PHONY : symbols/mymodule_mp_mysub_.o
-
-# target to build an object file
-symbols/mymodule_mp_mysub_.c.o:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/mymodule_mp_mysub_.c.o
-.PHONY : symbols/mymodule_mp_mysub_.c.o
-
-symbols/mymodule_mp_mysub_.i: symbols/mymodule_mp_mysub_.c.i
-.PHONY : symbols/mymodule_mp_mysub_.i
-
-# target to preprocess a source file
-symbols/mymodule_mp_mysub_.c.i:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/mymodule_mp_mysub_.c.i
-.PHONY : symbols/mymodule_mp_mysub_.c.i
-
-symbols/mymodule_mp_mysub_.s: symbols/mymodule_mp_mysub_.c.s
-.PHONY : symbols/mymodule_mp_mysub_.s
-
-# target to generate assembly for a file
-symbols/mymodule_mp_mysub_.c.s:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/mymodule_mp_mysub_.c.s
-.PHONY : symbols/mymodule_mp_mysub_.c.s
-
-symbols/mymodule_mysub_.o: symbols/mymodule_mysub_.c.o
-.PHONY : symbols/mymodule_mysub_.o
-
-# target to build an object file
-symbols/mymodule_mysub_.c.o:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/mymodule_mysub_.c.o
-.PHONY : symbols/mymodule_mysub_.c.o
-
-symbols/mymodule_mysub_.i: symbols/mymodule_mysub_.c.i
-.PHONY : symbols/mymodule_mysub_.i
-
-# target to preprocess a source file
-symbols/mymodule_mysub_.c.i:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/mymodule_mysub_.c.i
-.PHONY : symbols/mymodule_mysub_.c.i
-
-symbols/mymodule_mysub_.s: symbols/mymodule_mysub_.c.s
-.PHONY : symbols/mymodule_mysub_.s
-
-# target to generate assembly for a file
-symbols/mymodule_mysub_.c.s:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/mymodule_mysub_.c.s
-.PHONY : symbols/mymodule_mysub_.c.s
-
-symbols/mysub.o: symbols/mysub.c.o
-.PHONY : symbols/mysub.o
-
-# target to build an object file
-symbols/mysub.c.o:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/mysub.c.o
-.PHONY : symbols/mysub.c.o
-
-symbols/mysub.i: symbols/mysub.c.i
-.PHONY : symbols/mysub.i
-
-# target to preprocess a source file
-symbols/mysub.c.i:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/mysub.c.i
-.PHONY : symbols/mysub.c.i
-
-symbols/mysub.s: symbols/mysub.c.s
-.PHONY : symbols/mysub.s
-
-# target to generate assembly for a file
-symbols/mysub.c.s:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/mysub.c.s
-.PHONY : symbols/mysub.c.s
-
-symbols/mysub_.o: symbols/mysub_.c.o
-.PHONY : symbols/mysub_.o
-
-# target to build an object file
-symbols/mysub_.c.o:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/mysub_.c.o
-.PHONY : symbols/mysub_.c.o
-
-symbols/mysub_.i: symbols/mysub_.c.i
-.PHONY : symbols/mysub_.i
-
-# target to preprocess a source file
-symbols/mysub_.c.i:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/mysub_.c.i
-.PHONY : symbols/mysub_.c.i
-
-symbols/mysub_.s: symbols/mysub_.c.s
-.PHONY : symbols/mysub_.s
-
-# target to generate assembly for a file
-symbols/mysub_.c.s:
-	$(MAKE) -f CMakeFiles/symbols.dir/build.make CMakeFiles/symbols.dir/symbols/mysub_.c.s
-.PHONY : symbols/mysub_.c.s
-
-# Help Target
-help:
-	@echo "The following are some of the valid targets for this Makefile:"
-	@echo "... all (the default if no target is provided)"
-	@echo "... clean"
-	@echo "... depend"
-	@echo "... FortranCInterface"
-	@echo "... edit_cache"
-	@echo "... myfort"
-	@echo "... rebuild_cache"
-	@echo "... symbols"
-	@echo "... call_mod.o"
-	@echo "... call_sub.o"
-	@echo "... main.o"
-	@echo "... my_module.o"
-	@echo "... my_module_.o"
-	@echo "... my_module_.i"
-	@echo "... my_module_.s"
-	@echo "... my_sub.o"
-	@echo "... mymodule.o"
-	@echo "... mymodule_.o"
-	@echo "... mymodule_.i"
-	@echo "... mymodule_.s"
-	@echo "... mysub.o"
-	@echo "... symbols/MYMODULE_mp_MYSUB-UPPER.o"
-	@echo "... symbols/MYMODULE_mp_MYSUB-UPPER.i"
-	@echo "... symbols/MYMODULE_mp_MYSUB-UPPER.s"
-	@echo "... symbols/MYSUB-UPPER.o"
-	@echo "... symbols/MYSUB-UPPER.i"
-	@echo "... symbols/MYSUB-UPPER.s"
-	@echo "... symbols/MY_MODULE_mp_MY_SUB-UPPER.o"
-	@echo "... symbols/MY_MODULE_mp_MY_SUB-UPPER.i"
-	@echo "... symbols/MY_MODULE_mp_MY_SUB-UPPER.s"
-	@echo "... symbols/MY_SUB-UPPER.o"
-	@echo "... symbols/MY_SUB-UPPER.i"
-	@echo "... symbols/MY_SUB-UPPER.s"
-	@echo "... symbols/__my_module_MOD_my_sub.o"
-	@echo "... symbols/__my_module_MOD_my_sub.i"
-	@echo "... symbols/__my_module_MOD_my_sub.s"
-	@echo "... symbols/__my_module_NMOD_my_sub.o"
-	@echo "... symbols/__my_module_NMOD_my_sub.i"
-	@echo "... symbols/__my_module_NMOD_my_sub.s"
-	@echo "... symbols/__my_module__my_sub.o"
-	@echo "... symbols/__my_module__my_sub.i"
-	@echo "... symbols/__my_module__my_sub.s"
-	@echo "... symbols/__mymodule_MOD_mysub.o"
-	@echo "... symbols/__mymodule_MOD_mysub.i"
-	@echo "... symbols/__mymodule_MOD_mysub.s"
-	@echo "... symbols/__mymodule_NMOD_mysub.o"
-	@echo "... symbols/__mymodule_NMOD_mysub.i"
-	@echo "... symbols/__mymodule_NMOD_mysub.s"
-	@echo "... symbols/__mymodule__mysub.o"
-	@echo "... symbols/__mymodule__mysub.i"
-	@echo "... symbols/__mymodule__mysub.s"
-	@echo "... symbols/my_moduleSmy_sub.o"
-	@echo "... symbols/my_moduleSmy_sub.i"
-	@echo "... symbols/my_moduleSmy_sub.s"
-	@echo "... symbols/my_module_MP_my_sub.o"
-	@echo "... symbols/my_module_MP_my_sub.i"
-	@echo "... symbols/my_module_MP_my_sub.s"
-	@echo "... symbols/my_module_mp_my_sub_.o"
-	@echo "... symbols/my_module_mp_my_sub_.i"
-	@echo "... symbols/my_module_mp_my_sub_.s"
-	@echo "... symbols/my_module_my_sub_.o"
-	@echo "... symbols/my_module_my_sub_.i"
-	@echo "... symbols/my_module_my_sub_.s"
-	@echo "... symbols/my_sub.o"
-	@echo "... symbols/my_sub.i"
-	@echo "... symbols/my_sub.s"
-	@echo "... symbols/my_sub_.o"
-	@echo "... symbols/my_sub_.i"
-	@echo "... symbols/my_sub_.s"
-	@echo "... symbols/my_sub__.o"
-	@echo "... symbols/my_sub__.i"
-	@echo "... symbols/my_sub__.s"
-	@echo "... symbols/mymoduleSmysub.o"
-	@echo "... symbols/mymoduleSmysub.i"
-	@echo "... symbols/mymoduleSmysub.s"
-	@echo "... symbols/mymodule_MP_mysub.o"
-	@echo "... symbols/mymodule_MP_mysub.i"
-	@echo "... symbols/mymodule_MP_mysub.s"
-	@echo "... symbols/mymodule_mp_mysub_.o"
-	@echo "... symbols/mymodule_mp_mysub_.i"
-	@echo "... symbols/mymodule_mp_mysub_.s"
-	@echo "... symbols/mymodule_mysub_.o"
-	@echo "... symbols/mymodule_mysub_.i"
-	@echo "... symbols/mymodule_mysub_.s"
-	@echo "... symbols/mysub.o"
-	@echo "... symbols/mysub.i"
-	@echo "... symbols/mysub.s"
-	@echo "... symbols/mysub_.o"
-	@echo "... symbols/mysub_.i"
-	@echo "... symbols/mysub_.s"
-.PHONY : help
-
-
-
-#=============================================================================
-# Special targets to cleanup operation of make.
-
-# Special rule to run CMake to check the build system integrity.
-# No rule that depends on this can have commands that come from listfiles
-# because they might be regenerated.
-cmake_check_build_system:
-	$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
-.PHONY : cmake_check_build_system
-
diff --git a/CMakeFiles/FortranCInterface/Output.cmake b/CMakeFiles/FortranCInterface/Output.cmake
deleted file mode 100644
index 1382ed6..0000000
--- a/CMakeFiles/FortranCInterface/Output.cmake
+++ /dev/null
@@ -1,34 +0,0 @@
-# Global symbol without underscore.
-set(FortranCInterface_GLOBAL_SYMBOL  "mysub_")
-set(FortranCInterface_GLOBAL_PREFIX  "")
-set(FortranCInterface_GLOBAL_SUFFIX  "_")
-set(FortranCInterface_GLOBAL_CASE    "LOWER")
-set(FortranCInterface_GLOBAL_MACRO   "(name,NAME) name##_")
-
-# Global symbol with underscore.
-set(FortranCInterface_GLOBAL__SYMBOL "my_sub_")
-set(FortranCInterface_GLOBAL__PREFIX "")
-set(FortranCInterface_GLOBAL__SUFFIX "_")
-set(FortranCInterface_GLOBAL__CASE   "LOWER")
-set(FortranCInterface_GLOBAL__MACRO  "(name,NAME) name##_")
-
-# Module symbol without underscore.
-set(FortranCInterface_MODULE_SYMBOL  "__mymodule_MOD_mysub")
-set(FortranCInterface_MODULE_PREFIX  "__")
-set(FortranCInterface_MODULE_MIDDLE  "_MOD_")
-set(FortranCInterface_MODULE_SUFFIX  "")
-set(FortranCInterface_MODULE_CASE    "LOWER")
-set(FortranCInterface_MODULE_MACRO   "(mod_name,name, mod_NAME,NAME) __##mod_name##_MOD_##name")
-
-# Module symbol with underscore.
-set(FortranCInterface_MODULE__SYMBOL "__my_module_MOD_my_sub")
-set(FortranCInterface_MODULE__PREFIX "__")
-set(FortranCInterface_MODULE__MIDDLE "_MOD_")
-set(FortranCInterface_MODULE__SUFFIX "")
-set(FortranCInterface_MODULE__CASE   "LOWER")
-set(FortranCInterface_MODULE__MACRO  "(mod_name,name, mod_NAME,NAME) __##mod_name##_MOD_##name")
-
-# Summarize what was found.
-set(FortranCInterface_GLOBAL_FOUND 1)
-set(FortranCInterface_MODULE_FOUND 1)
-
diff --git a/CMakeFiles/FortranCInterface/cmake_install.cmake b/CMakeFiles/FortranCInterface/cmake_install.cmake
deleted file mode 100644
index b9022d0..0000000
--- a/CMakeFiles/FortranCInterface/cmake_install.cmake
+++ /dev/null
@@ -1,44 +0,0 @@
-# Install script for directory: /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface
-
-# Set the install prefix
-IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
-  SET(CMAKE_INSTALL_PREFIX "/usr/local")
-ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)
-STRING(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
-
-# Set the install configuration name.
-IF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
-  IF(BUILD_TYPE)
-    STRING(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
-           CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
-  ELSE(BUILD_TYPE)
-    SET(CMAKE_INSTALL_CONFIG_NAME "")
-  ENDIF(BUILD_TYPE)
-  MESSAGE(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
-ENDIF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
-
-# Set the component getting installed.
-IF(NOT CMAKE_INSTALL_COMPONENT)
-  IF(COMPONENT)
-    MESSAGE(STATUS "Install component: \"${COMPONENT}\"")
-    SET(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
-  ELSE(COMPONENT)
-    SET(CMAKE_INSTALL_COMPONENT)
-  ENDIF(COMPONENT)
-ENDIF(NOT CMAKE_INSTALL_COMPONENT)
-
-# Install shared libraries without execute permission?
-IF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
-  SET(CMAKE_INSTALL_SO_NO_EXE "0")
-ENDIF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
-
-IF(CMAKE_INSTALL_COMPONENT)
-  SET(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
-ELSE(CMAKE_INSTALL_COMPONENT)
-  SET(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
-ENDIF(CMAKE_INSTALL_COMPONENT)
-
-FILE(WRITE "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/${CMAKE_INSTALL_MANIFEST}" "")
-FOREACH(file ${CMAKE_INSTALL_MANIFEST_FILES})
-  FILE(APPEND "/home/graphics/cgs/git/magics/CMakeFiles/FortranCInterface/${CMAKE_INSTALL_MANIFEST}" "${file}\n")
-ENDFOREACH(file)
diff --git a/CMakeFiles/FortranCInterface/libmyfort.a b/CMakeFiles/FortranCInterface/libmyfort.a
deleted file mode 100644
index 9cbc8bf..0000000
Binary files a/CMakeFiles/FortranCInterface/libmyfort.a and /dev/null differ
diff --git a/CMakeFiles/FortranCInterface/libsymbols.a b/CMakeFiles/FortranCInterface/libsymbols.a
deleted file mode 100644
index 9600898..0000000
Binary files a/CMakeFiles/FortranCInterface/libsymbols.a and /dev/null differ
diff --git a/CMakeFiles/FortranCInterface/my_module.mod b/CMakeFiles/FortranCInterface/my_module.mod
deleted file mode 100644
index df1ccc6..0000000
--- a/CMakeFiles/FortranCInterface/my_module.mod
+++ /dev/null
@@ -1,23 +0,0 @@
-GFORTRAN module version '0' created from /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/my_module.f90 on Tue Apr  8 16:55:52 2014
-MD5:92c3f619b10bf01d10a98744d3beb007 -- If you edit this, you'll get what you deserve.
-
-(() () () () () () () () () () () () () () () () () () () () () () () ()
-() () ())
-
-()
-
-(('my_interface' 'my_module' 2))
-
-()
-
-()
-
-(3 'my_module' 'my_module' 'my_module' 1 ((MODULE UNKNOWN-INTENT
-UNKNOWN-PROC UNKNOWN UNKNOWN) (UNKNOWN 0 0 0 UNKNOWN ()) 0 0 () () 0 ()
-() () 0 0)
-2 'my_sub' 'my_module' 'my_sub' 1 ((PROCEDURE UNKNOWN-INTENT MODULE-PROC
-DECL UNKNOWN SUBROUTINE) (UNKNOWN 0 0 0 UNKNOWN ()) 0 0 () () 0 () () ()
-0 0)
-)
-
-('my_module' 0 3 'my_sub' 0 2)
diff --git a/CMakeFiles/FortranCInterface/mymodule.mod b/CMakeFiles/FortranCInterface/mymodule.mod
deleted file mode 100644
index cd3bf4f..0000000
--- a/CMakeFiles/FortranCInterface/mymodule.mod
+++ /dev/null
@@ -1,23 +0,0 @@
-GFORTRAN module version '0' created from /usr/local/apps/cmake/2.8.10/share/cmake-2.8/Modules/FortranCInterface/mymodule.f90 on Tue Apr  8 16:55:52 2014
-MD5:3826198b66b6b987f94c147eb4e0ec65 -- If you edit this, you'll get what you deserve.
-
-(() () () () () () () () () () () () () () () () () () () () () () () ()
-() () ())
-
-()
-
-(('myinterface' 'mymodule' 2))
-
-()
-
-()
-
-(3 'mymodule' 'mymodule' 'mymodule' 1 ((MODULE UNKNOWN-INTENT
-UNKNOWN-PROC UNKNOWN UNKNOWN) (UNKNOWN 0 0 0 UNKNOWN ()) 0 0 () () 0 ()
-() () 0 0)
-2 'mysub' 'mymodule' 'mysub' 1 ((PROCEDURE UNKNOWN-INTENT MODULE-PROC
-DECL UNKNOWN SUBROUTINE) (UNKNOWN 0 0 0 UNKNOWN ()) 0 0 () () 0 () () ()
-0 0)
-)
-
-('mymodule' 0 3 'mysub' 0 2)
diff --git a/CMakeFiles/FortranCInterface/symbols/MYMODULE_mp_MYSUB-UPPER.c b/CMakeFiles/FortranCInterface/symbols/MYMODULE_mp_MYSUB-UPPER.c
deleted file mode 100644
index bc17697..0000000
--- a/CMakeFiles/FortranCInterface/symbols/MYMODULE_mp_MYSUB-UPPER.c
+++ /dev/null
@@ -1,4 +0,0 @@
-const char* MYMODULE_mp_MYSUB(void)
-{
-  return "INFO:symbol[MYMODULE_mp_MYSUB]";
-}
diff --git a/CMakeFiles/FortranCInterface/symbols/MYSUB-UPPER.c b/CMakeFiles/FortranCInterface/symbols/MYSUB-UPPER.c
deleted file mode 100644
index 3ec16d0..0000000
--- a/CMakeFiles/FortranCInterface/symbols/MYSUB-UPPER.c
+++ /dev/null
@@ -1,4 +0,0 @@
-const char* MYSUB(void)
-{
-  return "INFO:symbol[MYSUB]";
-}
diff --git a/CMakeFiles/FortranCInterface/symbols/MY_MODULE_mp_MY_SUB-UPPER.c b/CMakeFiles/FortranCInterface/symbols/MY_MODULE_mp_MY_SUB-UPPER.c
deleted file mode 100644
index d74980d..0000000
--- a/CMakeFiles/FortranCInterface/symbols/MY_MODULE_mp_MY_SUB-UPPER.c
+++ /dev/null
@@ -1,4 +0,0 @@
-const char* MY_MODULE_mp_MY_SUB(void)
-{
-  return "INFO:symbol[MY_MODULE_mp_MY_SUB]";
-}
diff --git a/CMakeFiles/FortranCInterface/symbols/MY_SUB-UPPER.c b/CMakeFiles/FortranCInterface/symbols/MY_SUB-UPPER.c
deleted file mode 100644
index c9de0bf..0000000
--- a/CMakeFiles/FortranCInterface/symbols/MY_SUB-UPPER.c
+++ /dev/null
@@ -1,4 +0,0 @@
-const char* MY_SUB(void)
-{
-  return "INFO:symbol[MY_SUB]";
-}
diff --git a/CMakeFiles/FortranCInterface/symbols/__my_module_MOD_my_sub.c b/CMakeFiles/FortranCInterface/symbols/__my_module_MOD_my_sub.c
deleted file mode 100644
index bab5b8a..0000000
--- a/CMakeFiles/FortranCInterface/symbols/__my_module_MOD_my_sub.c
+++ /dev/null
@@ -1,4 +0,0 @@
-const char* __my_module_MOD_my_sub(void)
-{
-  return "INFO:symbol[__my_module_MOD_my_sub]";
-}
diff --git a/CMakeFiles/FortranCInterface/symbols/__my_module_NMOD_my_sub.c b/CMakeFiles/FortranCInterface/symbols/__my_module_NMOD_my_sub.c
deleted file mode 100644
index 44bc79b..0000000
--- a/CMakeFiles/FortranCInterface/symbols/__my_module_NMOD_my_sub.c
+++ /dev/null
@@ -1,4 +0,0 @@
-const char* __my_module_NMOD_my_sub(void)
-{
-  return "INFO:symbol[__my_module_NMOD_my_sub]";
-}
diff --git a/CMakeFiles/FortranCInterface/symbols/__my_module__my_sub.c b/CMakeFiles/FortranCInterface/symbols/__my_module__my_sub.c
deleted file mode 100644
index 2a315ed..0000000
--- a/CMakeFiles/FortranCInterface/symbols/__my_module__my_sub.c
+++ /dev/null
@@ -1,4 +0,0 @@
-const char* __my_module__my_sub(void)
-{
-  return "INFO:symbol[__my_module__my_sub]";
-}
diff --git a/CMakeFiles/FortranCInterface/symbols/__mymodule_MOD_mysub.c b/CMakeFiles/FortranCInterface/symbols/__mymodule_MOD_mysub.c
deleted file mode 100644
index c412a98..0000000
--- a/CMakeFiles/FortranCInterface/symbols/__mymodule_MOD_mysub.c
+++ /dev/null
@@ -1,4 +0,0 @@
-const char* __mymodule_MOD_mysub(void)
-{
-  return "INFO:symbol[__mymodule_MOD_mysub]";
-}
diff --git a/CMakeFiles/FortranCInterface/symbols/__mymodule_NMOD_mysub.c b/CMakeFiles/FortranCInterface/symbols/__mymodule_NMOD_mysub.c
deleted file mode 100644
index fe22ef0..0000000
--- a/CMakeFiles/FortranCInterface/symbols/__mymodule_NMOD_mysub.c
+++ /dev/null
@@ -1,4 +0,0 @@
-const char* __mymodule_NMOD_mysub(void)
-{
-  return "INFO:symbol[__mymodule_NMOD_mysub]";
-}
diff --git a/CMakeFiles/FortranCInterface/symbols/__mymodule__mysub.c b/CMakeFiles/FortranCInterface/symbols/__mymodule__mysub.c
deleted file mode 100644
index 42ede0e..0000000
--- a/CMakeFiles/FortranCInterface/symbols/__mymodule__mysub.c
+++ /dev/null
@@ -1,4 +0,0 @@
-const char* __mymodule__mysub(void)
-{
-  return "INFO:symbol[__mymodule__mysub]";
-}
diff --git a/CMakeFiles/FortranCInterface/symbols/my_moduleSmy_sub.c b/CMakeFiles/FortranCInterface/symbols/my_moduleSmy_sub.c
deleted file mode 100644
index 3aaa979..0000000
--- a/CMakeFiles/FortranCInterface/symbols/my_moduleSmy_sub.c
+++ /dev/null
@@ -1,4 +0,0 @@
-const char* my_module$my_sub(void)
-{
-  return "INFO:symbol[my_module$my_sub]";
-}
diff --git a/CMakeFiles/FortranCInterface/symbols/my_module_MP_my_sub.c b/CMakeFiles/FortranCInterface/symbols/my_module_MP_my_sub.c
deleted file mode 100644
index 79e7ece..0000000
--- a/CMakeFiles/FortranCInterface/symbols/my_module_MP_my_sub.c
+++ /dev/null
@@ -1,4 +0,0 @@
-const char* my_module_MP_my_sub(void)
-{
-  return "INFO:symbol[my_module_MP_my_sub]";
-}
diff --git a/CMakeFiles/FortranCInterface/symbols/my_module_mp_my_sub_.c b/CMakeFiles/FortranCInterface/symbols/my_module_mp_my_sub_.c
deleted file mode 100644
index f36fa76..0000000
--- a/CMakeFiles/FortranCInterface/symbols/my_module_mp_my_sub_.c
+++ /dev/null
@@ -1,4 +0,0 @@
-const char* my_module_mp_my_sub_(void)
-{
-  return "INFO:symbol[my_module_mp_my_sub_]";
-}
diff --git a/CMakeFiles/FortranCInterface/symbols/my_module_my_sub_.c b/CMakeFiles/FortranCInterface/symbols/my_module_my_sub_.c
deleted file mode 100644
index ec85c53..0000000
--- a/CMakeFiles/FortranCInterface/symbols/my_module_my_sub_.c
+++ /dev/null
@@ -1,4 +0,0 @@
-const char* my_module_my_sub_(void)
-{
-  return "INFO:symbol[my_module_my_sub_]";
-}
diff --git a/CMakeFiles/FortranCInterface/symbols/my_sub.c b/CMakeFiles/FortranCInterface/symbols/my_sub.c
deleted file mode 100644
index ce80fd8..0000000
--- a/CMakeFiles/FortranCInterface/symbols/my_sub.c
+++ /dev/null
@@ -1,4 +0,0 @@
-const char* my_sub(void)
-{
-  return "INFO:symbol[my_sub]";
-}
diff --git a/CMakeFiles/FortranCInterface/symbols/my_sub_.c b/CMakeFiles/FortranCInterface/symbols/my_sub_.c
deleted file mode 100644
index 693daeb..0000000
--- a/CMakeFiles/FortranCInterface/symbols/my_sub_.c
+++ /dev/null
@@ -1,4 +0,0 @@
-const char* my_sub_(void)
-{
-  return "INFO:symbol[my_sub_]";
-}
diff --git a/CMakeFiles/FortranCInterface/symbols/my_sub__.c b/CMakeFiles/FortranCInterface/symbols/my_sub__.c
deleted file mode 100644
index deddc23..0000000
--- a/CMakeFiles/FortranCInterface/symbols/my_sub__.c
+++ /dev/null
@@ -1,4 +0,0 @@
-const char* my_sub__(void)
-{
-  return "INFO:symbol[my_sub__]";
-}
diff --git a/CMakeFiles/FortranCInterface/symbols/mymoduleSmysub.c b/CMakeFiles/FortranCInterface/symbols/mymoduleSmysub.c
deleted file mode 100644
index 6528fb5..0000000
--- a/CMakeFiles/FortranCInterface/symbols/mymoduleSmysub.c
+++ /dev/null
@@ -1,4 +0,0 @@
-const char* mymodule$mysub(void)
-{
-  return "INFO:symbol[mymodule$mysub]";
-}
diff --git a/CMakeFiles/FortranCInterface/symbols/mymodule_MP_mysub.c b/CMakeFiles/FortranCInterface/symbols/mymodule_MP_mysub.c
deleted file mode 100644
index 2f394a2..0000000
--- a/CMakeFiles/FortranCInterface/symbols/mymodule_MP_mysub.c
+++ /dev/null
@@ -1,4 +0,0 @@
-const char* mymodule_MP_mysub(void)
-{
-  return "INFO:symbol[mymodule_MP_mysub]";
-}
diff --git a/CMakeFiles/FortranCInterface/symbols/mymodule_mp_mysub_.c b/CMakeFiles/FortranCInterface/symbols/mymodule_mp_mysub_.c
deleted file mode 100644
index e308e51..0000000
--- a/CMakeFiles/FortranCInterface/symbols/mymodule_mp_mysub_.c
+++ /dev/null
@@ -1,4 +0,0 @@
-const char* mymodule_mp_mysub_(void)
-{
-  return "INFO:symbol[mymodule_mp_mysub_]";
-}
diff --git a/CMakeFiles/FortranCInterface/symbols/mymodule_mysub_.c b/CMakeFiles/FortranCInterface/symbols/mymodule_mysub_.c
deleted file mode 100644
index 1fb0777..0000000
--- a/CMakeFiles/FortranCInterface/symbols/mymodule_mysub_.c
+++ /dev/null
@@ -1,4 +0,0 @@
-const char* mymodule_mysub_(void)
-{
-  return "INFO:symbol[mymodule_mysub_]";
-}
diff --git a/CMakeFiles/FortranCInterface/symbols/mysub.c b/CMakeFiles/FortranCInterface/symbols/mysub.c
deleted file mode 100644
index fa32bd7..0000000
--- a/CMakeFiles/FortranCInterface/symbols/mysub.c
+++ /dev/null
@@ -1,4 +0,0 @@
-const char* mysub(void)
-{
-  return "INFO:symbol[mysub]";
-}
diff --git a/CMakeFiles/FortranCInterface/symbols/mysub_.c b/CMakeFiles/FortranCInterface/symbols/mysub_.c
deleted file mode 100644
index 5d98d30..0000000
--- a/CMakeFiles/FortranCInterface/symbols/mysub_.c
+++ /dev/null
@@ -1,4 +0,0 @@
-const char* mysub_(void)
-{
-  return "INFO:symbol[mysub_]";
-}
diff --git a/CMakeFiles/TestEndianess.bin b/CMakeFiles/TestEndianess.bin
deleted file mode 100755
index 30b361e..0000000
Binary files a/CMakeFiles/TestEndianess.bin and /dev/null differ
diff --git a/CMakeFiles/cmake.check_cache b/CMakeFiles/cmake.check_cache
deleted file mode 100644
index 3dccd73..0000000
--- a/CMakeFiles/cmake.check_cache
+++ /dev/null
@@ -1 +0,0 @@
-# This file is generated by cmake for dependency checking of the CMakeCache.txt file
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 346990e..fb10c82 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,7 +28,7 @@ project( magics CXX )
 # note that this needs to be done before ecbuild_declare_project()
 # to ensure that the ecbuild header files are also put there
 # note also that we need to CACHE this so that ecbuild_declare_project() does not overwrite it
-set(MAGICS_INSTALL_INCLUDE_DIR include/magics CACHE PATH "Magics installation directory for header files")
+set(INSTALL_INCLUDE_DIR include/magics CACHE PATH "Magics installation directory for header files")
 
 set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../ecbuild/cmake")
 
@@ -45,7 +45,8 @@ option( ENABLE_NETCDF         "enable netcdf support"             ON  )
 option( ENABLE_ODB            "enable odb"                        OFF )
 option( ENABLE_BUFR           "enable bufr support"               OFF )
 option( ENABLE_SPOT           "enable spot support"               OFF )
-option( ENABLE_CAIRO          "enable cairo support[png/jpeg]"   OFF )
+option( ENABLE_CAIRO          "enable cairo support[png/jpeg]"    OFF )
+option( ENABLE_GEOTIFF        "enable geotiff support [implies cairo]" OFF )
 
 option( ENABLE_PYTHON         "enable python interface"   ON  )
 option( ENABLE_FORTRAN        "enable fortran interface"  ON  )
@@ -53,9 +54,9 @@ option( ENABLE_FORTRAN        "enable fortran interface"  ON  )
 option( ENABLE_METVIEW        "enable Metview interface"  OFF  )
 option( ENABLE_METVIEW_NO_QT  "enable Metview interface without Qt"    OFF )
 
-option( ENABLE_STATIC_LIBRARY  "Internal Build static Library"    OFF  )
-option( ENABLE_REGRESSION     "Internal use only: enable regression test"  OFF  )
-option( ENABLE_REGRESSION_UPLOAD     "Internal use only : enable upload of reference image"  OFF  )
+option( ENABLE_STATIC_LIBRARY    "Internal Build static Library"    OFF  )
+option( ENABLE_REGRESSION        "Internal use only: enable regression test"  OFF  )
+option( ENABLE_REGRESSION_UPLOAD "Internal use only : enable upload of reference image"  OFF  )
 
 set( MAGICS_NAME          "Magics" )
 set( MAGICS_EXCEPTION     "ON" )
@@ -63,8 +64,7 @@ set( MAGICS_SITE          "ecmwf" )
 set( MAGICS_INSTALL_PATH  ${CMAKE_INSTALL_PREFIX} )
 
 # Regression definitions
-set( MAGICS_REFERENCE_VERSIONS            "2.22.6" )
-#list( APPEND MAGICS_REFERENCE_VERSIONS    "2.18.14" )
+set( MAGICS_REFERENCE_VERSIONS            "2.24.3" )
 set( MAGICS_HTML_ROOT        "${CMAKE_BINARY_DIR}/regression/html")
 file(MAKE_DIRECTORY ${MAGICS_HTML_ROOT} )
 
@@ -85,6 +85,14 @@ endif()
 
 if( ENABLE_PYTHON )
 	ecbuild_find_python( REQUIRED )
+
+    debug_var( PYTHON_INCLUDE_DIRS )
+    debug_var( PYTHON_LIBRARIES )
+
+    if( NOT PYTHON_INCLUDE_DIRS OR NOT PYTHON_LIBRARIES )
+        message( FATAL_ERROR "Couldn't find Python libraries" )
+    endif()
+
 	find_package( SWIG REQUIRED )
 	find_package( NumPy REQUIRED )
 endif()
@@ -93,6 +101,7 @@ if( SWIG_FOUND )
 endif()
 
 ### grib
+#cmake_add_cxx_flags("-gdwarf-2")
 
 set( grib no )
 if( ENABLE_GRIB )
@@ -106,26 +115,38 @@ endif()
 ### netcdf
 
 set( netcdf no )
-set( PREFER_NETCDF4 1)
-set( NETCDF_CXX 1 )
+# set( PREFER_NETCDF4 1)
+# set( NETCDF_CXX 1 )
 if ( ENABLE_NETCDF )
-  find_package( NetCDF REQUIRED)
+  find_package( NetCDF 4 COMPONENTS C CXX REQUIRED)
 endif()
 if ( NETCDF_FOUND )
     list( APPEND MAGICS_TPLS  NetCDF )
     set(MAGICS_NETCDF 1)
-	set( netcdf no)
+	set( netcdf yes)
 endif()
 
 ### odb
 
 set( odb no )
 if( ENABLE_ODB )
-  ecbuild_use_package( PROJECT odb_api  VERSION 0.9.31 REQUIRED)
+  ecbuild_use_package( PROJECT odb_api  VERSION 0.10.2 REQUIRED)
 endif()
 if( ODB_API_FOUND )
+
+    get_filename_component( odb_api_install_dir ${ODB_API_CMAKE_DIR}/../../../lib ABSOLUTE )
+    get_filename_component( eckit_install_dir   ${ECKIT_CMAKE_DIR}/../../../lib ABSOLUTE )
+
       set( MAGICS_ODB 1 )
 	  set( odb yes)
+
+	  # does this version use eckit?
+	  list(FIND ODB_API_LIBRARIES eckit ODB_ECKIT_INDEX)
+
+    if (NOT ODB_ECKIT_INDEX EQUAL -1)  # is an eckit version
+        add_definitions(-DODB_ECKIT)
+    endif()
+
 endif()
 
 ### spot
@@ -142,7 +163,6 @@ endif()
 
 ### bufr
 
-debug_var (ENABLE_BUFR )
 set( bufr no )
 if( ENABLE_BUFR )
   find_package( EMOS REQUIRED )
@@ -152,18 +172,25 @@ if( EMOS_FOUND )
    set( bufr yes)
 endif()
 
-debug_var ( EMOS_FOUND )
 
 ### cairo
 
 set( cairo no )
 if( ENABLE_CAIRO )
 	find_package( PangoCairo REQUIRED )
+else()
+    find_package( PangoCairo )
 endif()
     
 if( PANGOCAIRO_FOUND )
-   	set( MAGICS_CAIRO 1 )
+	set( MAGICS_CAIRO 1 )
 	set( cairo yes )
+	if( ENABLE_GEOTIFF )
+	   find_package( GeoTIFF REQUIRED )
+	   if( GEOTIFF_FOUND )
+	      set( MAGICS_GEOTIFF 1 )
+	   endif()
+	endif()
 endif()
 
 
@@ -206,9 +233,9 @@ find_package( Threads )
 # set(Boost_USE_MULTITHREADED      ON)
 ecbuild_add_extra_search_paths( boost )
 
-find_package( Boost 1.49.0 )
-find_package( Proj4  )
-find_package( EXPAT  )
+find_package( Boost 1.49.0 REQUIRED)
+find_package( Proj4 REQUIRED )
+find_package( EXPAT  REQUIRED )
 
 
 install( FILES ${CMAKE_CURRENT_BINARY_DIR}/magics-config
@@ -256,10 +283,6 @@ foreach( _tpl ${MAGICS_TPLS} )
     list( APPEND MAGICS_EXTRA_LIBRARIES     ${${TPL}_LIBRARIES} )
 endforeach()
 
-# message(STATUS "MAGICS_EXTRA_DEFINITIONS  => ${MAGICS_EXTRA_DEFINITIONS}")
-# message(STATUS "MAGICS_EXTRA_INCLUDE_DIRS => ${MAGICS_EXTRA_INCLUDE_DIRS}")
-# message(STATUS "MAGICS_EXTRA_LIBRARIES    => ${MAGICS_EXTRA_LIBRARIES}")
-
 if( MAGICS_BUFR )
 	list( APPEND MAGICS_EXTRA_DEFINITIONS   fortfloat=double fortint=int )
 endif()
@@ -272,9 +295,21 @@ if( MAGICS_QT )
 	list( APPEND MAGICS_EXTRA_LIBRARIES     ${QT_LIBRARIES} )
 endif()
 
+if( MAGICS_GEOTIFF )
+	list( APPEND MAGICS_EXTRA_INCLUDE_DIRS  ${GEOTIFF_INCLUDE_DIR} )
+	list( APPEND MAGICS_EXTRA_LIBRARIES  ${GEOTIFF_LIBRARY} )
+	list( APPEND MAGICS_EXTRA_DEFINITIONS MAGICS_GEOTIFF )
+endif()
+
 list( APPEND MAGICS_EXTRA_LIBRARIES     ${CMAKE_THREAD_LIBS_INIT} )
 
-# set_directory_properties( PROPERTIES COMPILE_DEFINITIONS ${ECKIT_DEFINITIONS} )
+message(STATUS "MAGICS_EXTRA_DEFINITIONS  => ${MAGICS_EXTRA_DEFINITIONS}")
+message(STATUS "MAGICS_EXTRA_INCLUDE_DIRS => ${MAGICS_EXTRA_INCLUDE_DIRS}")
+message(STATUS "MAGICS_EXTRA_LIBRARIES    => ${MAGICS_EXTRA_LIBRARIES}")
+
+
+
+# set_directory_properties( PROPERTIES COMPILE_DEFINITIONS "${ECKIT_DEFINITIONS}" )
 get_directory_property( MAGICS_DEFINITIONS COMPILE_DEFINITIONS )
 
 include_directories( ${MAGICS_INCLUDE_DIRS} ${MAGICS_EXTRA_INCLUDE_DIRS} )
@@ -333,6 +368,12 @@ set(  __magics_tmp ${MAGICS_EXTRA_LIBRARIES} )
 
 list(REMOVE_ITEM __magics_tmp debug )
 list(REMOVE_ITEM __magics_tmp optimized )
+if( ODB_API_FOUND )
+    list(REMOVE_ITEM __magics_tmp Odb)
+    list(REMOVE_ITEM __magics_tmp eckit)
+    list(REMOVE_ITEM __magics_tmp eckit_web)
+    list(REMOVE_ITEM __magics_tmp eckit_geometry)
+endif()
 
 set(MAGICS_EXTRA_LIBS "")
 
@@ -347,7 +388,7 @@ foreach( lib ${__magics_tmp} )
 		
 		list( APPEND RPATH "-Wl,-rpath,${path}")
 	  endif()
-	 #set(MAGICS_EXTRA_LIBS "${MAGICS_EXTRA_LIBS} ${lib}" )
+	 
   else()
     if( NOT lib MATCHES "^-l.*" )
 		set( lib "-l${lib}" )
@@ -357,14 +398,29 @@ foreach( lib ${__magics_tmp} )
   set(MAGICS_EXTRA_LIBS "${MAGICS_EXTRA_LIBS} ${lib}" )
 endforeach()
 
-set(MAGICS_EXTRA_LIBS "${MAGICS_EXTRA_LIBS} -Wl,-rpath,${CMAKE_INSTALL_PREFIX}/lib" )
+
+set(MAGICS_RPATH " -Wl,-rpath,${CMAKE_INSTALL_PREFIX}/lib" )
+
+if( ODB_API_FOUND )
+
+    set(MAGICS_EXTRA_LIBS "${MAGICS_EXTRA_LIBS} -L${odb_api_install_dir} -lOdb")
+    set(MAGICS_EXTRA_LIBS "${MAGICS_EXTRA_LIBS} -L${eckit_install_dir} -leckit")
+    set(MAGICS_EXTRA_LIBS "${MAGICS_EXTRA_LIBS} -L${eckit_install_dir} -leckit_web")
+    set(MAGICS_EXTRA_LIBS "${MAGICS_EXTRA_LIBS} -L${eckit_install_dir} -leckit_geometry")
+    set(MAGICS_RPATH "${MAGICS_RPATH}  -Wl,-rpath,${eckit_install_dir}" ) 
+    set(MAGICS_RPATH "${MAGICS_RPATH}  -Wl,-rpath,${odb_api_install_dir}" )
+endif()
+
+
 
 
 list(REMOVE_DUPLICATES RPATH)
-		
-foreach( lib ${RPATH} )
-	set(MAGICS_EXTRA_LIBS "${MAGICS_EXTRA_LIBS} ${lib}" )
+
+foreach( path ${RPATH} )
+	set(MAGICS_RPATH "${MAGICS_RPATH} ${path}" )
 endforeach()
+
+debug_var(MAGICS_RPATH)
 	
 
 configure_file( magics-config.in  magics-config @ONLY )					
diff --git a/NOTICE b/NOTICE
index fefab6e..602bfdf 100644
--- a/NOTICE
+++ b/NOTICE
@@ -150,3 +150,55 @@ SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
 FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 DEALINGS IN THE SOFTWARE.
+
+
+
+EUMETSAT Image Navigation Code
+==============================
+
+http://www.eumetsat.int/website/home/Data/DataDelivery/SupportSoftwareandTools/index.html
+
+(c)(2014) EUMETSAT
+
+Freeware -  freely available software, which doesn't require a signed licence
+or the formal acceptance of licensing conditions.
+
+The navigation software incorporates source code written in Fortran 90 and C-Code,
+for the conversion of image coordinates (pixel column and row) into the corresponding
+geographical coordinates (Latitude and Longitude) of all MSG Satellites
+(Meteosat-8, Meteosat-9 and Meteosat-10) Level 1.5 VIS/IR data. The theoretical
+basis for the software is the CGMS (Coordination Group for Meteorological Satellites)
+LRIT/HRIT Global Specifications (PDF, 260 KB) . Additional information about how to
+use the software is given as comments in the source code.
+
+* COPYRIGHT AND LICENCE INFORMATION
+* 
+* Freeware Licence Disclaimer
+* 
+* The user acknowledges and shall at all times respect EUMETSAT's
+* intellectual property rights in the software. EUMETSAT shall at all
+* times retain such intellectual property rights in the software and in
+* all copies thereof regardless of form.
+* 
+* The user may freely use, copy, modify and/or distribute the software.
+* The user agrees when using the software in any recognisable form to
+* name EUMETSAT as the source by including "(c)(year)
+* EUMETSAT". Furthermore, In any distributed version of the software,
+* including modifications or derivatives, the present licence text shall
+* be included.  The user of the software may provide feedback, report
+* problems and suggest enhancements to the software to EUMETSAT. In
+* addition, the user shall grant to EUMETSAT unrestricted use of this
+* information.
+* 
+* Neither EUMETSAT nor its Member States are liable for the usefulness
+* or proper functioning of software, nor do they accept any liability
+* for any consequences, whether direct or indirect, of any use of
+* software or for any results related to the use of software or for any
+* right or claims by third parties related to all or any part of
+* software or its use. Where the source code is made available to users
+* this is done without any warranty, and EUMETSAT will not provide any
+* support for its use and customisation."
+*
+
+Note that we (ECMWF) have made some small modifications to the code in order to allow
+it to be used also for non-MSG satellite images.
diff --git a/VERSION.cmake b/VERSION.cmake
index a36106f..ddd858f 100644
--- a/VERSION.cmake
+++ b/VERSION.cmake
@@ -1,5 +1,5 @@
-
-set ( _version 2.22.7 )
+set ( metabuilder_version 2.24.4 )
+set ( _version 2.24.4 )
 if ( MAGICS_BUILD )
     set( ${PROJECT_NAME}_VERSION_STR  "${_version}-${MAGICS_BUILD}" )   
 else ()
diff --git a/apps/MagMLInterpretor/json.cc b/apps/MagMLInterpretor/json.cc
index 5f06943..cc64cf0 100644
--- a/apps/MagMLInterpretor/json.cc
+++ b/apps/MagMLInterpretor/json.cc
@@ -1,3 +1,5 @@
+#include <unistd.h>
+#include <signal.h>
 #include "WebFormat.h"
 #include "MetaData.h"
 
@@ -14,9 +16,9 @@ pair<string, string> cut(const string& in)
 	bool  param = true;
 
 	while ( c != in.end() )
-	{		
+	{
 		if ( *c == '='  && param )
-		{			
+		{
 			var = current;
 			current = "";
 			param= false;
@@ -41,6 +43,12 @@ void setVariable(const string& in, map<string, string>& variables)
 
 } //end of namespace magml
 
+void catch_alarm(int)
+{
+    printf("MagPlus ERROR: Operation timed out. Exiting...\n");
+    abort();
+}
+
 int normal_main(int argc, char **argv)
 {
   try
@@ -57,10 +65,16 @@ int normal_main(int argc, char **argv)
 	for( int i = 2; i < argc; i++ )
 		magml::setVariable(argv[i], WebInterpretor::parameters());
 
-	//for ( int i = 0; i < 10; i++) 
+	//for ( int i = 0; i < 10; i++)
 	{
 		try {
-			WebInterpretor::json(argv[1]);
+            map<string, string>::const_iterator out = WebInterpretor::parameters().find("timeout");
+            int timeout = (out == WebInterpretor::parameters().end() ) ? 0 : tonumber(out->second);
+            MagLog::info() << "Time out armed for " << timeout << endl;
+            signal(SIGALRM, catch_alarm);
+            alarm(timeout);
+            WebInterpretor::json(argv[1]);
+            alarm(0);
 		}
 		catch (...) {
 			std::cout << argv[0] << " FAILED to dispatch JSON file!"<< endl;
@@ -79,7 +93,7 @@ int server_main(int argc, char **argv)
 {
     char line[10240];
     cout << "MAGJSON_SERVER_MODE Ready" << endl;
-    for(;;) 
+    for(;;)
     {
         cin.getline(line, sizeof(line));
         cout << "Running " << line << endl;
diff --git a/bufr.f90 b/bufr.f90
deleted file mode 100644
index 1e01c54..0000000
--- a/bufr.f90
+++ /dev/null
@@ -1,31 +0,0 @@
-	program magics
-
-	call popen
-
-	call pset1c("output_formats", (/"ps"/), 1)
-	call psetc("output_name", "bufr")
-	call psetc("output_name_first_page_number", "off")
-
-	call psetr("subpage_lower_left_longitude", -20.00)
-	call psetr("subpage_upper_right_longitude", 60.00)
-	call psetr("subpage_upper_right_latitude", 60.00)
-	call psetc("subpage_map_projection", "cylindrical")
-	call psetr("subpage_lower_left_latitude", 30.00)
-
-	call psetc("obs_input_file_name", "synop.bufr")
-	call pobs
-
-	call preset('obs_input_file_name')
-
-	call psetc("map_grid_colour", "tan")
-	call psetc("map_grid", "on")
-	call psetc("map_coastline_colour", "tan")
-	call pcoast
-
-	call preset('map_grid_colour')
-	call preset('map_grid')
-	call preset('map_coastline_colour')
-
-	call pclose
-
-	end
diff --git a/cmake/CheckFortranSourceCompiles.cmake b/cmake/CheckFortranSourceCompiles.cmake
index 0b5c423..ad4b91f 100644
--- a/cmake/CheckFortranSourceCompiles.cmake
+++ b/cmake/CheckFortranSourceCompiles.cmake
@@ -58,7 +58,7 @@ if("${VAR}" MATCHES "^${VAR}$")
     file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.f90"
       "${SOURCE}\n")
 
-    # message(STATUS "Performing Test ${VAR}")
+    message(STATUS "Performing Test ${VAR}")
     try_compile(${VAR}
       ${CMAKE_BINARY_DIR}
       ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.f90
@@ -76,13 +76,13 @@ if("${VAR}" MATCHES "^${VAR}$")
 
     if(${VAR})
       set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
-      # message(STATUS "Performing Test ${VAR} - Success")
+      message(STATUS "Performing Test ${VAR} - Success")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "Performing Fortran SOURCE FILE Test ${VAR} succeded with the following output:\n"
         "${OUTPUT}\n"
         "Source file was:\n${SOURCE}\n")
     else()
-      # message(STATUS "Performing Test ${VAR} - Failed")
+      message(STATUS "Performing Test ${VAR} - Failed")
       set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "Performing Fortran SOURCE FILE Test ${VAR} failed with the following output:\n"
diff --git a/cmake/FindAEC.cmake b/cmake/FindAEC.cmake
new file mode 100644
index 0000000..70a63b1
--- /dev/null
+++ b/cmake/FindAEC.cmake
@@ -0,0 +1,34 @@
+# (C) Copyright 1996-2014 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.
+
+# - Try to find AEC (Adaptive Entropy Coding library)
+# See https://www.dkrz.de/redmine/projects/aec/wiki
+
+# Once done this will define
+#  AEC_FOUND - System has AEC
+#  AEC_INCLUDE_DIRS - The AEC include directories
+#  AEC_LIBRARIES - The libraries needed to use AEC
+
+ecbuild_add_extra_search_paths( aec )
+
+if( DEFINED AEC_PATH )
+    find_path( AEC_INCLUDE_DIR szlib.h    PATHS ${AEC_PATH}/include PATH_SUFFIXES aec NO_DEFAULT_PATH )
+    find_library( AEC_LIBRARY  NAMES aec  PATHS ${AEC_PATH}/lib     PATH_SUFFIXES aec NO_DEFAULT_PATH )
+endif()
+
+find_path( AEC_INCLUDE_DIR szlib.h PATH_SUFFIXES aec )
+find_library( AEC_LIBRARY NAMES aec PATH_SUFFIXES aec )
+
+set( AEC_LIBRARIES    ${AEC_LIBRARY} )
+set( AEC_INCLUDE_DIRS ${AEC_INCLUDE_DIR} )
+
+include(FindPackageHandleStandardArgs)
+
+find_package_handle_standard_args(AEC  DEFAULT_MSG AEC_LIBRARY AEC_INCLUDE_DIR)
+
+mark_as_advanced(AEC_INCLUDE_DIR AEC_LIBRARY )
diff --git a/cmake/FindCMath.cmake b/cmake/FindCMath.cmake
index f498c01..7cf6f58 100644
--- a/cmake/FindCMath.cmake
+++ b/cmake/FindCMath.cmake
@@ -9,12 +9,15 @@
 #Sets:
 # CMATH_LIBRARIES      = the library to link against (RT etc)
 
-if( DEFINED CMATH_PATH )
+IF(UNIX)
+ if( DEFINED CMATH_PATH )
     find_library(CMATH_LIBRARIES m PATHS ${CMATH_PATH}/lib NO_DEFAULT_PATH )
-endif()
+ endif()
 
-find_library(CMATH_LIBRARIES m )
+ find_library(CMATH_LIBRARIES m )
 
-include(FindPackageHandleStandardArgs)
+ include(FindPackageHandleStandardArgs)
 
-find_package_handle_standard_args(CMATH  DEFAULT_MSG CMATH_LIBRARIES )
+ find_package_handle_standard_args(CMATH  DEFAULT_MSG CMATH_LIBRARIES )
+
+ENDIF(UNIX)
diff --git a/cmake/FindNetCDF.cmake b/cmake/FindNetCDF.cmake
index 5d71504..99ead8d 100644
--- a/cmake/FindNetCDF.cmake
+++ b/cmake/FindNetCDF.cmake
@@ -1,16 +1,19 @@
 # (C) Copyright 1996-2014 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.
 
 # Try to find NetCDF3 or NetCDF4 -- default is 4
 #
+# find_package( NetCDF <version> COMPONENTS C CXX Fortran )
+#
 # Input:
-#  * NETCDF_PATH - user defined path where to search for the library first
-#  * NETCDF_CXX  - if to search also for netcdf_c++ wrapper library
+#  * NETCDF_PATH    - user defined path where to search for the library first
+#  * NETCDF_DIR     - user defined path where to search for the library first
+#  * NETCDF_ROOT    - user defined path where to search for the library first
 #
 # Output:
 #  NETCDF_FOUND - System has NetCDF
@@ -19,6 +22,9 @@
 #  NETCDF_LIBRARIES - The libraries needed to use NetCDF
 
 # default is netcdf4
+if( NetCDF_FIND_VERSION STREQUAL "3" )
+    set( PREFER_NETCDF3 1 )
+endif()
 
 if( NOT PREFER_NETCDF3 )
   set( PREFER_NETCDF4 1 )
@@ -27,37 +33,78 @@ else()
 endif()
 mark_as_advanced( PREFER_NETCDF4 PREFER_NETCDF3 )
 
+set( NETCDF_FIND_REQUIRED   ${NetCDF_FIND_REQUIRED} )
+set( NETCDF_FIND_QUIETLY    ${NetCDF_FIND_QUIETLY} )
+set( NETCDF_FIND_COMPONENTS ${NetCDF_FIND_COMPONENTS} )
+
+list( APPEND NETCDF_FIND_COMPONENTS C )
+
+if( NETCDF_CXX )
+    list( APPEND NETCDF_FIND_COMPONENTS CXX )
+endif()
+
+if( NETCDF_Fortran OR NETCDF_FORTRAN OR NETCDF_F90 )
+    list( APPEND NETCDF_FIND_COMPONENTS FORTRAN F90 )
+endif()
+
+list(FIND NETCDF_FIND_COMPONENTS "FORTRAN" _index)
+if(${_index} GREATER -1)
+    list( APPEND NETCDF_FIND_COMPONENTS F90 )
+endif()
+
+list (FIND NETCDF_FIND_COMPONENTS "F90" _index)
+if(${_index} GREATER -1)
+    list( APPEND NETCDF_FIND_COMPONENTS FORTRAN )
+endif()
+
+list(FIND NETCDF_FIND_COMPONENTS "Fortran" _index)
+if(${_index} GREATER -1)
+    list( REMOVE_ITEM NETCDF_FIND_COMPONENTS Fortran )
+    list( APPEND NETCDF_FIND_COMPONENTS FORTRAN F90 )
+endif()
+
+list( REMOVE_DUPLICATES NETCDF_FIND_COMPONENTS )
+
 ### NetCDF4
 
 if( PREFER_NETCDF4 )
 
-    # hdf5
+    ## hdf5
 
     ecbuild_add_extra_search_paths( hdf5 )
 
-    find_package( HDF5 COMPONENTS C CXX HL )
+    # Note: Only the HDF5 C-library is required for NetCDF 
+    #       ( even for Fortan and CXX bindings)
+    find_package( HDF5 COMPONENTS C QUIET )
 
-    # netcdf4
-
-    if( DEFINED $ENV{NETCDF_PATH} )
-        set( NETCDF_ROOT "$ENV{NETCDF_PATH}" )
-        list( APPEND CMAKE_PREFIX_PATH  $ENV{NETCDF_PATH} )
-    endif()
+    ## netcdf4
 
-    if( DEFINED NETCDF_PATH )
-        set( NETCDF_ROOT "${NETCDF_PATH}" )
-        list( APPEND CMAKE_PREFIX_PATH  ${NETCDF_PATH} )
-    endif()
+    # CONFIGURE the NETCDF_FIND_COMPONENTS variable
 
-    if( NETCDF_CXX )
-       set( NETCDF_FIND_COMPONENTS C CXX )
-    else()
-       set( NETCDF_FIND_COMPONENTS C )
-    endif()
+    # Find NetCDF4
 
     ecbuild_add_extra_search_paths( netcdf4 )
 
+    # message( "NETCDF CMAKE_PREFIX_PATH = [${CMAKE_PREFIX_PATH}]")
+    # debug_var( NETCDF_ROOT )
+    # debug_var( NETCDF_FIND_COMPONENTS )
+    # debug_var( NETCDF_FIND_QUIETLY )
+    # debug_var( NETCDF_FIND_REQUIRED )
     find_package( NetCDF4 )
+    # 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()
+
+    # 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" )
 
@@ -67,13 +114,13 @@ if( PREFER_NETCDF4 )
         list( APPEND NETCDF_INCLUDE_DIRS ${HDF5_INCLUDE_DIRS} )
     endif()
 
-#    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 )
+    #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()
 
@@ -81,6 +128,38 @@ endif()
 
 if( PREFER_NETCDF3 )
 
+    # message( "LOOKING FOR NETCDF3" )
+
+    # 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)
+        set( NETCDF_CXX 1 )
+    endif()
+
+	list(FIND NetCDF_FIND_COMPONENTS "Fortran" _index)
+	if(${_index} GREATER -1)
+        set( NETCDF_Fortran 1 )
+    endif()
+
+	list(FIND NetCDF_FIND_COMPONENTS "FORTRAN" _index)
+	if(${_index} GREATER -1)
+        set( NETCDF_Fortran 1 )
+    endif()
+
+	list(FIND NetCDF_FIND_COMPONENTS "F90" _index)
+	if(${_index} GREATER -1)
+        set( NETCDF_Fortran 1 )
+    endif()
+
+    ecbuild_add_extra_search_paths( netcdf3 )
+
+	ecbuild_add_extra_search_paths( netcdf ) # fallback to netcdf search paths
+
+    message( "NETCDF CMAKE_PREFIX_PATH = ${CMAKE_PREFIX_PATH}" )
+
     find_package( NetCDF3 )
 
 	set_package_properties( NetCDF3 PROPERTIES TYPE RECOMMENDED PURPOSE "support for NetCDF3 file format" )
diff --git a/cmake/FindNetCDF3.cmake b/cmake/FindNetCDF3.cmake
index a903d2c..079e55e 100644
--- a/cmake/FindNetCDF3.cmake
+++ b/cmake/FindNetCDF3.cmake
@@ -10,7 +10,9 @@
 #
 # Input:
 #  * NETCDF_PATH - user defined path where to search for the library first
+#  * NETCDF_DIR  - user defined path where to search for the library first
 #  * NETCDF_CXX  - if to search also for netcdf_c++ wrapper library
+#  * NETCDF_Fortran  - if to search also for netcdff wrapper library
 #
 # Output:
 #  NETCDF_FOUND - System has NetCDF
@@ -19,11 +21,24 @@
 
 ### TODO: generalize this into a macro for all ecbuild
 
+if( DEFINED $ENV{NETCDF_PATH} )
+    list( APPEND CMAKE_PREFIX_PATH  $ENV{NETCDF_PATH} )
+endif()
+
+if( DEFINED $ENV{NETCDF_DIR} )
+    list( APPEND CMAKE_PREFIX_PATH  $ENV{NETCDF_DIR} )
+endif()
+
 if( DEFINED NETCDF_PATH )
     list( APPEND _netcdf_incs ${NETCDF_PATH} ${NETCDF_PATH}/include )
     list( APPEND _netcdf_libs ${NETCDF_PATH} ${NETCDF_PATH}/lib )
 endif()
 	
+if( DEFINED NETCDF_DIR )
+    list( APPEND _netcdf_incs ${NETCDF_DIR} ${NETCDF_DIR}/include )
+    list( APPEND _netcdf_libs ${NETCDF_DIR} ${NETCDF_DIR}/lib )
+endif()
+
 foreach( _h /usr/local/apps/netcdf )
 
 	if( EXISTS ${_h} )
@@ -55,7 +70,9 @@ find_library( NETCDF_LIBRARY  netcdf  PATHS ${_netcdf_libs} PATH_SUFFIXES ${_ncd
 set( NETCDF_LIBRARIES    ${NETCDF_LIBRARY} )
 set( NETCDF_INCLUDE_DIRS ${NETCDF_INCLUDE_DIR} )
 
-include(FindPackageHandleStandardArgs)
+mark_as_advanced(NETCDF_INCLUDE_DIR NETCDF_LIBRARY )
+
+list( APPEND NETCDF_REQUIRED_VARS NETCDF_LIBRARY NETCDF_INCLUDE_DIR )
 
 if( NETCDF_CXX )
 
@@ -70,16 +87,43 @@ if( NETCDF_CXX )
     list( APPEND NETCDF_INCLUDE_DIRS ${NETCDF_CXX_INCLUDE_DIR} )
     list( APPEND NETCDF_LIBRARIES    ${NETCDF_CXX_LIBRARY} )
 
-	find_package_handle_standard_args( NETCDF3  DEFAULT_MSG NETCDF_LIBRARY NETCDF_CXX_LIBRARY NETCDF_INCLUDE_DIR NETCDF_CXX_INCLUDE_DIR )
+    list( APPEND NETCDF_REQUIRED_VARS NETCDF_CXX_INCLUDE_DIR NETCDF_CXX_LIBRARY )
+
+    mark_as_advanced(NETCDF_CXX_INCLUDE_DIR NETCDF_CXX_LIBRARY )
+
+endif()
+
+if( NETCDF_Fortran )
+
+    find_path( NETCDF_Fortran_INCLUDE_DIR netcdf.mod PATHS ${_netcdf_incs} PATH_SUFFIXES ${_ncdf_sfx} NO_DEFAULT_PATH)
+    find_path( NETCDF_Fortran_INCLUDE_DIR netcdf.mod PATHS ${_netcdf_incs} PATH_SUFFIXES ${_ncdf_sfx} )
+
+    set( _ncdf_fortran netcdff )
+
+    find_library( NETCDF_Fortran_LIBRARY NAMES ${_ncdf_fortran} PATHS ${_netcdf_libs} PATH_SUFFIXES ${_ncdf_sfx} NO_DEFAULT_PATH )
+    find_library( NETCDF_Fortran_LIBRARY NAMES ${_ncdf_fortran} PATHS ${_netcdf_libs} PATH_SUFFIXES ${_ncdf_sfx} )
+
+    list( APPEND NETCDF_INCLUDE_DIRS ${NETCDF_Fortran_INCLUDE_DIR} )
+    list( APPEND NETCDF_LIBRARIES    ${NETCDF_Fortran_LIBRARY} )
+
+    list( APPEND NETCDF_REQUIRED_VARS NETCDF_Fortran_INCLUDE_DIR NETCDF_Fortran_LIBRARY )
 
-    mark_as_advanced(NETCDF_INCLUDE_DIR NETCDF_CXX_LIBRARY )
+    mark_as_advanced(NETCDF_Fortran_INCLUDE_DIR NETCDF_Fortran_LIBRARY )
 
-else()
+endif()
+
+list( REMOVE_DUPLICATES NETCDF_INCLUDE_DIRS )
 
-	find_package_handle_standard_args( NETCDF3  DEFAULT_MSG NETCDF_LIBRARY NETCDF_INCLUDE_DIR)
+include(FindPackageHandleStandardArgs)
 
+if( NETCDF_FIND_QUIETLY )
+  set( NETCDF3_FIND_QUIETLY ${NETCDF_FIND_QUIETLY} )
 endif()
+if( NETCDF_FIND_REQUIRED )
+  set( NETCDF3_FIND_REQUIRED ${NETCDF_FIND_REQUIRED} )
+endif()
+
+find_package_handle_standard_args( NETCDF3  DEFAULT_MSG ${NETCDF_REQUIRED_VARS} )
 
 set( NETCDF_FOUND ${NETCDF3_FOUND} )
 
-mark_as_advanced(NETCDF_INCLUDE_DIR NETCDF_LIBRARY )
diff --git a/cmake/FindPGIFortran.cmake b/cmake/FindPGIFortran.cmake
index 66afeda..ae2221b 100644
--- a/cmake/FindPGIFortran.cmake
+++ b/cmake/FindPGIFortran.cmake
@@ -9,15 +9,17 @@
 ###############################################################################
 # FORTRAN support
 
-# list( APPEND pg_libs pgmp pgbind numa pgf90 pgf90_rpm1 pgf902 pgf90rtl  pgftnrtl nspgc pgc rt pgsse1 pgsse2 ) # init
-# list( APPEND pg_libs pgf90 pgf90_rpm1 pgf902 pgf90rtl pgftnrtl pghpf pgc pgf90 rt pgsse1 pgsse2 )             # mars client linux.2
-# list( APPEND pg_libs pgftnrtl nspgc pgc rt pgsse1 pgsse2 )                                                    # mars client linux.3
+# set( PGIFORTRAN_SEARCH_LIBS pgmp pgbind numa pgf90 pgf90_rpm1 pgf902 pgf90rtl  pgftnrtl nspgc pgc rt pgsse1 pgsse2 ) # init
+# set( PGIFORTRAN_SEARCH_LIBS pgf90 pgf90_rpm1 pgf902 pgf90rtl pgftnrtl pghpf pgc pgf90 rt pgsse1 pgsse2 )             # mars client linux.2
+# set( PGIFORTRAN_SEARCH_LIBS pgftnrtl nspgc pgc rt pgsse1 pgsse2 )                                                    # mars client linux.3
 
-list( APPEND pg_libs pgmp pgbind numa pgf90 pgf90_rpm1 pgf902 pgf90rtl pgftnrtl pghpf nspgc pgc pgf90 pgf902 pghpf_rpm1 pghpf2 pgsse1 pgsse2 ) # better ?                                                    #
+if( NOT DEFINED PGIFORTRAN_SEARCH_LIBS )
+	set( PGIFORTRAN_SEARCH_LIBS pgmp pgbind numa pgf90 pgf90_rpm1 pgf902 pgf90rtl pgftnrtl pghpf nspgc pgc pgf90 pgf902 pghpf_rpm1 pghpf2 pgsse1 pgsse2 ) # better ?                                                    #
+endif()
 
 set( pgi_fortran_all_libs_found 1 )
 
-foreach( pglib ${pg_libs} )
+foreach( pglib ${PGIFORTRAN_SEARCH_LIBS} )
 
 	find_library( ${pglib}_lib  ${pglib} PATHS ${PGI_PATH} PATH_SUFFIXES lib libso NO_DEFAULT_PATH )
 
diff --git a/cmake/FindPangoCairo.cmake b/cmake/FindPangoCairo.cmake
index 43fbf11..4fb1fd2 100644
--- a/cmake/FindPangoCairo.cmake
+++ b/cmake/FindPangoCairo.cmake
@@ -23,19 +23,13 @@ pkg_check_modules(PC_LIBPANGOCAIRO QUIET pangocairo)
 #debug_var( PC_LIBPANGOCAIRO_LIBRARIES )
 #debug_var( PC_LIBPANGOCAIRO_INCLUDE_DIRS )
 
-# find_package(X11)
-# debug_var( X11_LIBRARIES )
-
-
 
 if(PC_LIBPANGOCAIRO_FOUND)
-
     include(FindPackageHandleStandardArgs)
     find_package_handle_standard_args( pangocairo DEFAULT_MSG PC_LIBPANGOCAIRO_LIBRARIES PC_LIBPANGOCAIRO_INCLUDE_DIRS )
     set( PANGOCAIRO_VERSION ${PC_LIBPANGOCAIRO_VERSION} )
     set( PANGOCAIRO_LIBRARIES ${PC_LIBPANGOCAIRO_LIBRARIES} )
     set( PANGOCAIRO_INCLUDE_DIRS ${PC_LIBPANGOCAIRO_INCLUDE_DIRS} )
-
 else()
 
     # this is to get magics compiling on mac with macbrew
@@ -79,7 +73,6 @@ else()
     find_library( _CAIRO_LIBRARIES NAMES cairo)
     find_library( _GLIB_LIBRARIES NAMES glib-${GLIB_VERSION})
 
-    debug_var(X11_LIBRARIES)
     set(PANGOCAIRO_LIBRARIES
         ${_PANGOCAIRO_LIBRARIES}
         ${_PANGO_LIBRARIES}
diff --git a/cmake/Findgrib_api.cmake b/cmake/Findgrib_api.cmake
index 2bf9ff7..55a7b19 100644
--- a/cmake/Findgrib_api.cmake
+++ b/cmake/Findgrib_api.cmake
@@ -83,14 +83,18 @@ if( NOT grib_api_FOUND AND NOT NO_GRIB_API_BINARIES )
     if( DEFINED GRIB_API_PATH )
         find_path(GRIB_API_INCLUDE_DIR NAMES grib_api.h PATHS ${GRIB_API_PATH} ${GRIB_API_PATH}/include PATH_SUFFIXES grib_api  NO_DEFAULT_PATH)
         find_library(GRIB_API_LIBRARY  NAMES grib_api   PATHS ${GRIB_API_PATH} ${GRIB_API_PATH}/lib     PATH_SUFFIXES grib_api  NO_DEFAULT_PATH)
+        find_library(GRIB_API_LIB_F90  NAMES grib_api_f90 PATHS ${GRIB_API_PATH} ${GRIB_API_PATH}/lib     PATH_SUFFIXES grib_api  NO_DEFAULT_PATH)
+        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 )
     
-    set( GRIB_API_LIBRARIES    ${GRIB_API_LIBRARY} )
+    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 )
diff --git a/cmake/VERSION.cmake b/cmake/VERSION.cmake
new file mode 100644
index 0000000..40762d8
--- /dev/null
+++ b/cmake/VERSION.cmake
@@ -0,0 +1,7 @@
+set( ECBUILD_MAJOR_VERSION "1" )
+set( ECBUILD_MINOR_VERSION "7" )
+set( ECBUILD_PATCH_VERSION "0" )
+
+set( ECBUILD_VERSION_STR  "1.7.0" )
+
+set( ECBUILD_MACRO_VERSION "${ECBUILD_MAJOR_VERSION}.${ECBUILD_MINOR_VERSION}" )
diff --git a/cmake/contrib/FindEigen3.cmake b/cmake/contrib/FindEigen3.cmake
index df0cb13..72d4a9d 100644
--- a/cmake/contrib/FindEigen3.cmake
+++ b/cmake/contrib/FindEigen3.cmake
@@ -71,6 +71,11 @@ else(EIGEN3_INCLUDE_DIR)
       ${CMAKE_INSTALL_PREFIX}/include
       ${KDE4_INCLUDE_DIR}
       ${EIGEN3_PATH}/include
+      ${EIGEN3_DIR}/include
+      ${EIGEN3_ROOT}/include
+      ${EIGEN_PATH}/include
+      ${EIGEN_DIR}/include
+      ${EIGEN_ROOT}/include
       PATH_SUFFIXES eigen3 eigen
     )
 
diff --git a/cmake/contrib/FindFFTW.cmake b/cmake/contrib/FindFFTW.cmake
new file mode 100644
index 0000000..1ddaf4c
--- /dev/null
+++ b/cmake/contrib/FindFFTW.cmake
@@ -0,0 +1,124 @@
+# - 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_LIBRARY            ... fftw library to use
+#   FFTW_INCLUDE_DIR        ... fftw include directory
+#
+
+#=======================#
+#
+#      From Eigen3
+#
+#========================
+
+#If environment variable FFTWDIR is specified, it has same effect as FFTW_ROOT
+if( NOT FFTW_ROOT AND ENV{FFTWDIR} )
+  set( FFTW_ROOT $ENV{FFTWDIR} )
+endif()
+
+# Check if we can use PkgConfig
+find_package(PkgConfig)
+
+#Determine from PKG
+if( PKG_CONFIG_FOUND AND NOT FFTW_ROOT )
+  pkg_check_modules( PKG_FFTW QUIET "fftw3" )
+endif()
+
+#Check whether to search static or dynamic libs
+set( CMAKE_FIND_LIBRARY_SUFFIXES_SAV ${CMAKE_FIND_LIBRARY_SUFFIXES} )
+
+if( ${FFTW_USE_STATIC_LIBS} )
+  set( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX} )
+else()
+  set( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX} )
+endif()
+
+if( FFTW_ROOT )
+
+  #find libs
+  find_library(
+    FFTW_LIB
+    NAMES "fftw3"
+    PATHS ${FFTW_ROOT}
+    PATH_SUFFIXES "lib" "lib64"
+    NO_DEFAULT_PATH
+  )
+
+  find_library(
+    FFTWF_LIB
+    NAMES "fftw3f"
+    PATHS ${FFTW_ROOT}
+    PATH_SUFFIXES "lib" "lib64"
+    NO_DEFAULT_PATH
+  )
+
+  find_library(
+    FFTWL_LIB
+    NAMES "fftw3l"
+    PATHS ${FFTW_ROOT}
+    PATH_SUFFIXES "lib" "lib64"
+    NO_DEFAULT_PATH
+  )
+
+  #find includes
+  find_path(
+    FFTW_INCLUDES
+    NAMES "fftw3.h"
+    PATHS ${FFTW_ROOT}
+    PATH_SUFFIXES "include"
+    NO_DEFAULT_PATH
+  )
+
+else()
+
+  find_library(
+    FFTW_LIB
+    NAMES "fftw3"
+    PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
+  )
+
+  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 )
+
+set(FFTW_LIBRARIES ${FFTW_LIB} ${FFTWF_LIB})
+
+if(FFTWL_LIB)
+  set(FFTW_LIBRARIES ${FFTW_LIBRARIES} ${FFTWL_LIB})
+endif()
+
+set( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SAV} )
+
+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)
\ No newline at end of file
diff --git a/cmake/contrib/FindNetCDF4.cmake b/cmake/contrib/FindNetCDF4.cmake
index b046b39..33e7b36 100644
--- a/cmake/contrib/FindNetCDF4.cmake
+++ b/cmake/contrib/FindNetCDF4.cmake
@@ -102,11 +102,9 @@ set(HAS_HDF5 FALSE)
 
 if(${output} STREQUAL yes)
   set(HAS_HDF5 TRUE)
-  if(NETCDF_FIND_QUIETLY OR NOT NETCDF_FIND_REQUIRED)
-    find_package(HDF5)
-  else()
-    find_package(HDF5 REQUIRED)
-  endif()
+  set(HDF5_FIND_QUIETLY ${NETCDF_FIND_QUIETLY})
+  set(HDF5_FIND_REQUIRED ${NETCDF_FIND_REQUIRED})
+  find_package(HDF5)
 #        list( APPEND NETCDF_LIBRARIES_DEBUG
 #            ${HDF5_LIBRARIES_DEBUG} )
 #        list( APPEND NETCDF_LIBRARIES_RELEASE
@@ -153,9 +151,13 @@ else()
     set( NETCDF_FORTRAN_LIBRARY_NAMES netcdff ${NETCDF_C_LIBRARY_NAMES})
     set( NETCDF_F90_LIBRARY_NAMES ${NETCDF_FORTRAN_LIBRARY_NAMES} )
 
-    set( NETCDF_REQUIRED netcdf.h netcdfcpp.h netcdf.mod typesizes.mod netcdf netcdf_c++)
+    set( NETCDF_REQUIRED netcdf.h netcdfcpp.h netcdf.mod typesizes.mod netcdf netcdff netcdf_c++)
 
     foreach( LANGUAGE ${NETCDF_LANGUAGE_BINDINGS} )
+      # debug_var(LANGUAGE)
+        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}
               HINTS
@@ -167,15 +169,19 @@ else()
                   Include
           )
           mark_as_advanced( 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()
             list( FIND NETCDF_REQUIRED ${INC} location )
             if( ${location} EQUAL -1 )
-            else()
+              else()
               if(NETCDF_FIND_REQUIRED)
-                message( SEND_ERROR "\"${INC}\" is not found." )
+                message( SEND_ERROR "\"${INC}\" is not found for NetCDF component ${LANGUAGE}" )
+              elseif( NOT NETCDF_FIND_QUIETLY )
+                message( STATUS "\"${INC}\" is not found for NetCDF component ${LANGUAGE}" )
               endif()
+              set( NETCDF_${LANGUAGE}_FOUND 0 )
             else()
             endif()
           endif()
@@ -217,18 +223,24 @@ else()
             # libraries is allowed to specify debug and optimized only once.
           if (NETCDF_${LIB}_LIBRARY_RELEASE)
             list( APPEND NETCDF_LIBRARIES_RELEASE ${NETCDF_${LIB}_LIBRARY_RELEASE} )
+            list( APPEND NETCDF_${LANGUAGE}_LIBRARIES_RELEASE ${NETCDF_${LIB}_LIBRARY_RELEASE} )
           endif()
           if (NETCDF_${LIB}_LIBRARY_DEBUG)
             list( APPEND NETCDF_LIBRARIES_DEBUG ${NETCDF_${LIB}_LIBRARY_DEBUG} )
+            list( APPEND NETCDF_${LANGUAGE}_LIBRARIES_DEBUG ${NETCDF_${LIB}_LIBRARY_DEBUG} )
           endif()
           if (NETCDF_${LIB}_LIBRARY_RELEASE OR NETCDF_${LIB}_LIBRARY_DEBUG )
           else()
-#             message( STATUS "\"${LIB}\" is not found." )
+            # message( STATUS "\"${LIB}\" is not found." )
             list( FIND NETCDF_REQUIRED ${LIB} location )
             if( ${location} EQUAL -1 )
             else()
               if(NETCDF_FIND_REQUIRED)
-                message( SEND_ERROR "\"${LIB}\" is not found." )
+                message( SEND_ERROR "\"${LIB}\" is not found for NetCDF component ${LANGUAGE}." )
+              elseif( NOT NETCDF_FIND_QUIETLY )
+                message( STATUS "\"${LIB}\" is not found for NetCDF component ${LANGUAGE}." )
+              else()
+                set( NETCDF_${LANGUAGE}_FOUND 0 )
               endif()
            endif()
           endif()
@@ -237,10 +249,20 @@ else()
 
         # Append the libraries for this language binding to the list of all
         # required libraries.
-        list( APPEND NETCDF_LIBRARIES_DEBUG
-            ${NETCDF_${LANGUAGE}_LIBRARIES_DEBUG} )
-        list( APPEND NETCDF_LIBRARIES_RELEASE
-            ${NETCDF_${LANGUAGE}_LIBRARIES_RELEASE} )
+        
+        # debug_var( NETCDF_${LANGUAGE}_FOUND )
+        if( NETCDF_${LANGUAGE}_FOUND )
+            if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
+                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} )                  
+            endif()
+        endif()
+        # debug_var( NETCDF_${LANGUAGE}_LIBRARIES )
+        list( APPEND NETCDF_FOUND_REQUIRED_VARS NETCDF_${LANGUAGE}_FOUND )
     endforeach()
 
     # We may have picked up some duplicates in various lists during the above
@@ -270,7 +292,10 @@ else()
     endif()
 endif()
 
+set( NETCDF4_FIND_QUIETLY ${NETCDF_FIND_QUIETLY} )
+set( NETCDF4_FIND_REQUIRED ${NETCDF_FIND_REQUIRED} )
 find_package_handle_standard_args( NETCDF4 DEFAULT_MSG
+    ${NETCDF_FOUND_REQUIRED_VARS}
     NETCDF_LIBRARIES
     NETCDF_INCLUDE_DIRS
 )
diff --git a/cmake/contrib/GreatCMakeCookOff/AddCPP11Flags.cmake b/cmake/contrib/GreatCMakeCookOff/AddCPP11Flags.cmake
index 172e7b6..2a11e04 100644
--- a/cmake/contrib/GreatCMakeCookOff/AddCPP11Flags.cmake
+++ b/cmake/contrib/GreatCMakeCookOff/AddCPP11Flags.cmake
@@ -43,11 +43,6 @@ elseif(has_std_cpp0x)
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
 endif(has_std_gnupp11)
 
-check_cxx_compiler_flag(-stdlib=libc++ has_stdlib_libcpp)
-if(has_stdlib_libcpp)
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
-endif(has_stdlib_libcpp)
-
 if(MSVC) 
   set(MSWINDOBE TRUE)
   add_definitions(/EHsc)
diff --git a/cmake/contrib/GreatCMakeCookOff/CheckCXX11Features.cmake b/cmake/contrib/GreatCMakeCookOff/CheckCXX11Features.cmake
index b4f26d8..71fa610 100644
--- a/cmake/contrib/GreatCMakeCookOff/CheckCXX11Features.cmake
+++ b/cmake/contrib/GreatCMakeCookOff/CheckCXX11Features.cmake
@@ -17,10 +17,8 @@
 # Original script by Rolf Eike Beer
 # Modifications by Andreas Weis
 # Further Modifications by RSDT at UCL
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3)
 
-set(CPP11_FEATURE_CHECK_DIR ${CMAKE_CURRENT_LIST_DIR}/cpp11
-    CACHE INTERNAL "c++11 file directory")
+set(CPP11_FEATURE_CHECK_DIR ${CMAKE_CURRENT_LIST_DIR}/cpp11 CACHE INTERNAL "c++11 file directory")
 
 MACRO(cxx11_check_single_feature FEATURE_NAME FEATURE_NUMBER RESULT_VAR)
 	IF (NOT DEFINED ${RESULT_VAR})
diff --git a/cmake/ecbuild_add_executable.cmake b/cmake/ecbuild_add_executable.cmake
index c6591de..389505a 100644
--- a/cmake/ecbuild_add_executable.cmake
+++ b/cmake/ecbuild_add_executable.cmake
@@ -13,7 +13,7 @@
 macro( ecbuild_add_executable )
 
 	set( options NOINSTALL AUTO_VERSION )
-	set( single_value_args TARGET COMPONENT LINKER_LANGUAGE VERSION )
+	set( single_value_args TARGET COMPONENT LINKER_LANGUAGE VERSION OUTPUT_NAME )
     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} )
@@ -77,7 +77,13 @@ macro( ecbuild_add_executable )
         # add the executable target
         add_executable( ${_PAR_TARGET} ${_PAR_SOURCES} )
     
-        # add extra dependencies
+		# set OUTPUT_NAME
+
+		if( DEFINED _PAR_OUTPUT_NAME )
+			set_target_properties( ${_PAR_TARGET} PROPERTIES OUTPUT_NAME ${_PAR_OUTPUT_NAME} )
+		endif()
+
+		# add extra dependencies
         if( DEFINED _PAR_DEPENDS)
           add_dependencies( ${_PAR_TARGET} ${_PAR_DEPENDS} )
         endif()
@@ -154,7 +160,11 @@ macro( ecbuild_add_executable )
 
             export( TARGETS ${_PAR_TARGET} APPEND FILE "${TOP_PROJECT_TARGETS_FILE}" )
 
-         endif()
+		else()
+				# NOINSTALL targets are always built the build_rpath, not the install_rpath
+				set_property( TARGET ${_PAR_TARGET} PROPERTY SKIP_BUILD_RPATH         FALSE )
+				set_property( TARGET ${_PAR_TARGET} PROPERTY BUILD_WITH_INSTALL_RPATH FALSE )
+		endif()
     
         # add definitions to compilation
         if( DEFINED _PAR_DEFINITIONS )
@@ -168,22 +178,12 @@ macro( ecbuild_add_executable )
             set_property( TARGET ${_PAR_TARGET} PROPERTY LINKER_LANGUAGE ${_PAR_LINKER_LANGUAGE} )
         endif()
 
-        # paths to target
-        get_target_property(EXE_FILENAME ${_PAR_TARGET} OUTPUT_NAME)
-        if( NOT EXE_FILENAME )
-            set( EXE_FILENAME ${_PAR_TARGET} )
-        endif()
-
         # make sure target is removed before - some problems with AIX
-        add_custom_command(
-              TARGET ${_PAR_TARGET}
-              PRE_BUILD
-              COMMAND ${CMAKE_COMMAND} -E remove ${EXE_FILENAME}
-        )
+        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 )
-            ecbuild_link_exe( ${_PAR_TARGET} ${EXE_FILENAME} )
+            ecbuild_link_exe( ${_PAR_TARGET} $<TARGET_FILE_NAME:${_PAR_TARGET}> $<TARGET_FILE:${_PAR_TARGET}>  )
         endif()
 
         # append to the list of this project targets
diff --git a/cmake/ecbuild_add_extra_search_paths.cmake b/cmake/ecbuild_add_extra_search_paths.cmake
index e504664..8e28091 100644
--- a/cmake/ecbuild_add_extra_search_paths.cmake
+++ b/cmake/ecbuild_add_extra_search_paths.cmake
@@ -11,17 +11,24 @@
 # macro for adding search paths to CMAKE_PREFIX_PATH
 # for example the ECMWF /usr/local/apps paths
 #
-# usage: ecbuild_search_paths( netcdf4 )
+# usage: ecbuild_add_extra_search_paths( netcdf4 )
 
 function( ecbuild_add_extra_search_paths pkg )
 
-	# debug_var( pkg )
+# debug_var( pkg )
 
 	ecbuild_list_extra_search_paths( ${pkg} CMAKE_PREFIX_PATH )
 
-	# debug_var( CMAKE_PREFIX_PATH )
-
 	set( CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} PARENT_SCOPE )
 
+	# fixes BOOST_ROOT taking precedence on the search for location
+	if( ${pkg} STREQUAL "boost" )
+		if( BOOST_ROOT OR BOOSTROOT OR DEFINED ENV{BOOST_ROOT} OR DEFINED ENV{BOOSTROOT} )
+			set( CMAKE_PREFIX_PATH ${BOOST_ROOT} ${BOOSTROOT} $ENV{BOOST_ROOT} $ENV{BOOSTROOT} ${CMAKE_PREFIX_PATH} )
+		endif()
+	endif()
+
+# debug_var( CMAKE_PREFIX_PATH )
+
 endfunction()
 
diff --git a/cmake/ecbuild_add_library.cmake b/cmake/ecbuild_add_library.cmake
index 860f9ec..a7e3dd2 100644
--- a/cmake/ecbuild_add_library.cmake
+++ b/cmake/ecbuild_add_library.cmake
@@ -13,7 +13,7 @@
 function( ecbuild_add_library_impl )
 
 	set( options NOINSTALL AUTO_VERSION )
-	set( single_value_args TARGET TYPE COMPONENT INSTALL_HEADERS LINKER_LANGUAGE HEADER_DESTINATION VERSION )
+	set( single_value_args TARGET TYPE COMPONENT INSTALL_HEADERS LINKER_LANGUAGE HEADER_DESTINATION VERSION OUTPUT_NAME )
 	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} )
@@ -63,17 +63,6 @@ function( ecbuild_add_library_impl )
 			endif()
 		endif()
 
-		# add include dirs if defined
-		if( DEFINED _PAR_INCLUDES )
-		  list( REMOVE_DUPLICATES _PAR_INCLUDES )
-		  foreach( path ${_PAR_INCLUDES} ) # skip NOTFOUND
-			if( path )
-			  include_directories( ${path} )
-	#        else()
-	#          message( WARNING "Path ${path} was skipped" )
-			endif()
-		  endforeach()
-		endif()
 
 		# add persistent layer files
 		if( DEFINED _PAR_PERSISTENT )
@@ -93,6 +82,12 @@ function( ecbuild_add_library_impl )
 
 		add_library( ${_PAR_TARGET} ${_PAR_TYPE} ${_PAR_SOURCES} )
 
+		# set OUTPUT_NAME
+
+		if( DEFINED _PAR_OUTPUT_NAME )
+			set_target_properties( ${_PAR_TARGET} PROPERTIES OUTPUT_NAME ${_PAR_OUTPUT_NAME} )
+		endif()
+
 		# add extra dependencies
 		if( DEFINED _PAR_DEPENDS)
 		  add_dependencies( ${_PAR_TARGET} ${_PAR_DEPENDS} )
@@ -112,6 +107,22 @@ function( ecbuild_add_library_impl )
 		  endforeach()
 		endif()
 
+		# add include dirs if defined
+		if( DEFINED _PAR_INCLUDES )
+		  list( REMOVE_DUPLICATES _PAR_INCLUDES )
+		  foreach( path ${_PAR_INCLUDES} ) # skip NOTFOUND
+			if( path )
+				if( "${CMAKE_VERSION}" VERSION_LESS "2.8.11" )
+					include_directories( ${path} )
+				else()
+			  		target_include_directories( ${_PAR_TARGET} PUBLIC ${path} )
+				endif()
+	#        else()
+	#          message( WARNING "Path ${path} was skipped" )
+			endif()
+		  endforeach()
+		endif()
+
 		# FIX: Cray compiler PIC option is not detected by CMake
 
 		get_property( _target_pic TARGET ${_PAR_TARGET} PROPERTY POSITION_INDEPENDENT_CODE )
@@ -248,20 +259,12 @@ function( ecbuild_add_library_impl )
 			set_property( TARGET ${_PAR_TARGET} PROPERTY COMPILE_DEFINITIONS ${_target_defs} )
 		endif()
 
-		# paths to target
-		set(LIB_FILENAME ${CMAKE_SHARED_LIBRARY_PREFIX}${_PAR_TARGET}${CMAKE_SHARED_LIBRARY_SUFFIX}${LIB_SUFFIX})
-		get_target_property(LIB_LOCNAME ${_PAR_TARGET} LOCATION)
-
 		# make sure target is removed before - some problems with AIX
-		add_custom_command(
-			  TARGET ${_PAR_TARGET}
-			  PRE_BUILD
-			  COMMAND ${CMAKE_COMMAND} -E remove ${LIB_LOCNAME}
-	   )
+		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 )
-			ecbuild_link_lib( ${_PAR_TARGET} ${LIB_FILENAME} )
+			ecbuild_link_lib( ${_PAR_TARGET} $<TARGET_FILE_NAME:${_PAR_TARGET}> $<TARGET_FILE:${_PAR_TARGET}>  )
 		endif()
 
 		# append to the list of this project targets
@@ -291,9 +294,7 @@ macro( ecbuild_add_library )
 			if( _p_TYPE MATCHES "[Bb][Oo][Tt][Hh]" ) # build both types
 
 				ecbuild_add_library_impl( TARGET ${_p_TARGET}        TYPE SHARED ${_p_UNPARSED_ARGUMENTS} )
-				ecbuild_add_library_impl( TARGET ${_p_TARGET}-static TYPE STATIC ${_p_UNPARSED_ARGUMENTS} )
-
-				set_target_properties( ${_p_TARGET}-static PROPERTIES OUTPUT_NAME ${_p_TARGET} )
+				ecbuild_add_library_impl( TARGET ${_p_TARGET}-static TYPE STATIC ${_p_UNPARSED_ARGUMENTS} OUTPUT_NAME ${_p_TARGET} DEPENDS ${_p_TARGET} )
 
 			else()
 
@@ -310,7 +311,7 @@ macro( ecbuild_add_library )
 			if( BUILD_SHARED_LIBS MATCHES "[Bb][Oo][Tt][Hh]" ) # build both types
 
 				ecbuild_add_library_impl( TARGET ${_p_TARGET}        TYPE SHARED ${_p_UNPARSED_ARGUMENTS} )
-				ecbuild_add_library_impl( TARGET ${_p_TARGET}-static TYPE STATIC ${_p_UNPARSED_ARGUMENTS} )
+				ecbuild_add_library_impl( TARGET ${_p_TARGET}-static TYPE STATIC ${_p_UNPARSED_ARGUMENTS} DEPENDS ${_p_TARGET} )
 
 				set_target_properties( ${_p_TARGET}-static PROPERTIES OUTPUT_NAME ${_p_TARGET} )
 
diff --git a/cmake/ecbuild_add_option.cmake b/cmake/ecbuild_add_option.cmake
index 92e5386..85417fa 100644
--- a/cmake/ecbuild_add_option.cmake
+++ b/cmake/ecbuild_add_option.cmake
@@ -13,31 +13,44 @@
 macro( ecbuild_add_option )
 
 	set( options ADVANCED )
-	set( single_value_args FEATURE DEFAULT DESCRIPTION )
-	set( multi_value_args  REQUIRED_PACKAGES )
+  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} )
 
-	if( _p_UNPARSED_ARGUMENTS )
+  if( _p_UNPARSED_ARGUMENTS )
 	  message(FATAL_ERROR "Unknown keywords given to ecbuild_add_option(): \"${_p_UNPARSED_ARGUMENTS}\"")
-    endif()
+  endif()
 
 	# check FEATURE parameter
 
-	if( NOT _p_FEATURE  )
+  if( NOT _p_FEATURE  )
 	  message(FATAL_ERROR "The call to ecbuild_add_option() doesn't specify the FEATURE.")
-    endif()
+  endif()
 
 	# check DEFAULT parameter
 
-	if( NOT DEFINED _p_DEFAULT )
+  if( NOT DEFINED _p_DEFAULT )
 		set( _p_DEFAULT ON )
-	else()
+  else()
 		if( NOT _p_DEFAULT MATCHES "[Oo][Nn]" AND NOT _p_DEFAULT MATCHES "[Oo][Ff][Ff]" )
 			message(FATAL_ERROR "In macro ecbuild_add_option(), DEFAULT is either ON or OFF: \"${_p_DEFAULT}\"")
 		endif()
 	endif()
 
+  # check CONDITION parameter
+  if( DEFINED _p_CONDITION )
+    set(_feature_condition_file "${CMAKE_CURRENT_BINARY_DIR}/set_${_p_FEATURE}_condition.cmake")
+    file( WRITE  ${_feature_condition_file} "  if( ")
+    foreach( term ${_p_CONDITION} )
+      file( APPEND ${_feature_condition_file} " ${term}")
+    endforeach()
+    file( APPEND ${_feature_condition_file} " )\n    set(_${_p_FEATURE}_condition TRUE)\n  else()\n    set(_${_p_FEATURE}_condition FALSE)\n  endif()\n")
+    include( ${_feature_condition_file} )
+  else()
+    set( _${_p_FEATURE}_condition TRUE )
+  endif()
+
 	# check if user provided value
 
 	get_property( _in_cache CACHE ENABLE_${_p_FEATURE} PROPERTY VALUE )
@@ -50,76 +63,93 @@ macro( ecbuild_add_option )
 
 	mark_as_advanced( ${_p_FEATURE}_user_provided_input )
 
+
 	# define the option -- for cmake GUI
 
 	option( ENABLE_${_p_FEATURE} "${_p_DESCRIPTION}" ${_p_DEFAULT} )
 
-	if( ${_p_ADVANCED} )
-		mark_as_advanced( ENABLE_${_p_FEATURE} )
-	endif()
+  set( _do_search ${ENABLE_${_p_FEATURE}} )
+  if( _p_FEATURE STREQUAL "OMP" )
+    set( _do_search TRUE )
+  endif()
 
-	# debug_var( ENABLE_${_p_FEATURE} )
-	# debug_var( ${_p_FEATURE}_user_provided_input )
+  if( _do_search  )
 
-	if( ENABLE_${_p_FEATURE} )
+    set( HAVE_${_p_FEATURE} 1 )
 
-		set( HAVE_${_p_FEATURE} 1 )
+    if( _${_p_FEATURE}_condition )
 
-		### search for dependent packages
+      ### search for dependent packages
 
-		foreach( pkg ${_p_REQUIRED_PACKAGES} )
+      foreach( pkg ${_p_REQUIRED_PACKAGES} )
 
-			string(REPLACE " " ";" pkglist ${pkg}) # string to list
+        string(REPLACE " " ";" pkglist ${pkg}) # string to list
 
-			list( GET pkglist 0 pkgname )
+        list( GET pkglist 0 pkgname )
 
-			if( pkgname STREQUAL "PROJECT" )  # if 1st entry is PROJECT, then we are looking for a ecbuild project
-				set( pkgproject 1 )
-				list( GET pkglist 1 pkgname )
-			else()                            # else 1st entry is package name
-				set( pkgproject 0 )
-			endif()
+        if( pkgname STREQUAL "PROJECT" )  # if 1st entry is PROJECT, then we are looking for a ecbuild project
+          set( pkgproject 1 )
+          list( GET pkglist 1 pkgname )
+        else()                            # else 1st entry is package name
+          set( pkgproject 0 )
+        endif()
 
-			# debug_var( pkg )
-			# debug_var( pkglist )
-			# debug_var( pkgname )
+        # debug_var( pkg )
+        # debug_var( pkglist )
+        # debug_var( pkgname )
 
-			string( TOUPPER ${pkgname} pkgUPPER )
-			string( TOLOWER ${pkgname} pkgLOWER )
+        string( TOUPPER ${pkgname} pkgUPPER )
+        string( TOLOWER ${pkgname} pkgLOWER )
 
-			if( ${pkgname}_FOUND OR ${pkgUPPER}_FOUND OR ${pkgLOWER}_FOUND )
-				set( ${pkgname}_already_found 1 )
-			else()
+        if( ${pkgname}_FOUND OR ${pkgUPPER}_FOUND OR ${pkgLOWER}_FOUND )
+          set( ${pkgname}_already_found 1 )
+        else()
 
-				ecbuild_add_extra_search_paths( ${pkgLOWER} ) # adds search paths specific to ECMWF
+          ecbuild_add_extra_search_paths( ${pkgLOWER} ) # adds search paths specific to ECMWF
 
-				if( pkgproject )
-					ecbuild_use_package( ${pkglist} )
-				else()
-					find_package( ${pkglist} )
-				endif()
+          if( pkgproject )
+            ecbuild_use_package( ${pkglist} )
+          else()
+            if( pkgname STREQUAL "MPI" )
+              set( _find_args ${pkglist} )
+              list( REMOVE_ITEM _find_args "MPI" )
+              ecbuild_find_mpi( ${_find_args} )
+            elseif( pkgname STREQUAL "OMP" )
+              set( _find_args ${pkglist} )
+              list( REMOVE_ITEM _find_args "OMP" )
+              if( NOT ENABLE_${_p_FEATURE} )
+                list( APPEND _find_args STUBS )
+              endif()
+              ecbuild_find_omp( ${_find_args} )
+            else()
+              find_package( ${pkglist} )
+            endif()
+          endif()
 
-				# append to list of third-party libraries (to be forward to other packages )
-				string( TOUPPER ${PROJECT_NAME} PNAME )
-				list( APPEND ${PNAME}_TPLS ${pkgname} )
+          # append to list of third-party libraries (to be forward to other packages )
+          string( TOUPPER ${PROJECT_NAME} PNAME )
+          list( APPEND ${PNAME}_TPLS ${pkgname} )
 
-			endif()
+        endif()
 
-			# debug_var( ${pkgname}_FOUND  )
-			# debug_var( ${pkgLOWER}_FOUND )
-			# debug_var( ${pkgUPPER}_FOUND )
+        # debug_var( ${pkgname}_FOUND  )
+        # debug_var( ${pkgLOWER}_FOUND )
+        # debug_var( ${pkgUPPER}_FOUND )
 
-			# we have feature iff all required packages were FOUND
+        # we have feature if all required packages were FOUND
 
-			if( ${pkgname}_FOUND OR ${pkgUPPER}_FOUND OR ${pkgLOWER}_FOUND )
-				message( STATUS "Found package ${pkgname} required for feature ${_p_FEATURE}" )
-			else()
-				message( STATUS "Could not find package ${pkgname} required for feature ${_p_FEATURE}" )
-				set( HAVE_${_p_FEATURE} 0 )
-				list( APPEND _failed_to_find_packages ${pkgname} )
-			endif()
+        if( ${pkgname}_FOUND OR ${pkgUPPER}_FOUND OR ${pkgLOWER}_FOUND )
+          message( STATUS "Found package ${pkgname} required for feature ${_p_FEATURE}" )
+        else()
+          message( STATUS "Could not find package ${pkgname} required for feature ${_p_FEATURE} -- Provide ${pkgname} location with -D${pkgUPPER}_PATH=/..." )
+          set( HAVE_${_p_FEATURE} 0 )
+          list( APPEND _failed_to_find_packages ${pkgname} )
+        endif()
 
-		endforeach()
+      endforeach()
+    else()
+      set( HAVE_${_p_FEATURE} 0 )
+    endif()
 
 		# FINAL CHECK
 
@@ -130,7 +160,11 @@ macro( ecbuild_add_option )
 		else() # if user provided input and we cannot satisfy FAIL otherwise WARN
 
 			if( ${_p_FEATURE}_user_provided_input )
-				message( FATAL_ERROR "Feature ${_p_FEATURE} cannot be enabled -- following required packages weren't found: ${_failed_to_find_packages}" )
+        if( _${_p_FEATURE}_condition )
+          message( FATAL_ERROR "Feature ${_p_FEATURE} cannot be enabled -- following required packages weren't found: ${_failed_to_find_packages}" )
+        else()
+          message( FATAL_ERROR "Feature ${_p_FEATURE} cannot be enabled -- following condition was not met: ${_p_CONDITION}" )
+        endif()
 			else()
 				message( STATUS "Feature ${_p_FEATURE} was not enabled (also not requested) -- following required packages weren't found: ${_failed_to_find_packages}" )
 				set( ENABLE_${_p_FEATURE} OFF )
@@ -138,12 +172,23 @@ macro( ecbuild_add_option )
 
 		endif()
 
-	else( ENABLE_${_p_FEATURE} )
+  else( _do_search )
 
 		set( HAVE_${_p_FEATURE} 0 )
 
-	endif( ENABLE_${_p_FEATURE} )
+  endif( _do_search )
+
+
+	if( ${_p_ADVANCED} )
+		mark_as_advanced( ENABLE_${_p_FEATURE} )
+	else()
+		add_feature_info( ${_p_FEATURE} ENABLE_${_p_FEATURE} "${_p_DESCRIPTION}")
+	endif()
 
-	add_feature_info( ${_p_FEATURE} ENABLE_${_p_FEATURE} "${_p_DESCRIPTION}")
+  if( HAVE_${_p_FEATURE} )
+    string( TOUPPER PNAME ${PROJECT_NAME} )
+    set( ${PNAME}_HAVE_${_p_FEATURE} 1 )
+    set( ${PNAME}_FEATURES "${${PNAME}_FEATURES};${PNAME}_HAVE_${_p_FEATURE}" CACHE INTERNAL "" )
+  endif()
 
 endmacro( ecbuild_add_option  )
diff --git a/cmake/ecbuild_add_test.cmake b/cmake/ecbuild_add_test.cmake
index b4a8155..44f850f 100644
--- a/cmake/ecbuild_add_test.cmake
+++ b/cmake/ecbuild_add_test.cmake
@@ -1,8 +1,8 @@
 # (C) Copyright 1996-2014 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.
 
@@ -20,14 +20,15 @@
 #  SOURCES: sources to be compiled
 #  LIBS: Libraries needed for linking
 #  INCLUDES: Extra include directories
-#  DEPENDS: Add explicit dependency to other targets
+#  DEPENDS: Add explicit dependency to other targets (for building)
+#  TEST_DEPENDS: add explicity dependency on another test running before
 #  ARGS: Command-line arguments to COMMAND OR TARGET
 
 macro( ecbuild_add_test )
 
     set( options           BOOST )
-    set( single_value_args TARGET ENABLED COMMAND TYPE LINKER_LANGUAGE MPI )
-    set( multi_value_args  SOURCES LIBS INCLUDES DEPENDS ARGS PERSISTENT DEFINITIONS RESOURCES TEST_DATA CFLAGS CXXFLAGS FFLAGS GENERATED CONDITION ENVIRONMENT )
+    set( single_value_args TARGET ENABLED COMMAND TYPE LINKER_LANGUAGE MPI WORKING_DIRECTORY )
+    set( multi_value_args  SOURCES LIBS INCLUDES TEST_DEPENDS DEPENDS ARGS PERSISTENT DEFINITIONS RESOURCES TEST_DATA CFLAGS CXXFLAGS FFLAGS GENERATED CONDITION ENVIRONMENT )
 
     cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}"  ${_FIRST_ARG} ${ARGN} )
 
@@ -42,8 +43,9 @@ macro( ecbuild_add_test )
       if( (_PAR_MPI GREATER 1) AND ( (NOT HAVE_MPI) OR (NOT MPIEXEC) ) )
         set( _PAR_ENABLED 0 )
       endif()
-    else()
-      set( _PAR_MPI 1 )
+      if( (_PAR_MPI EQUAL 1) AND (NOT HAVE_MPI) )
+        set( _PAR_MPI 0 )
+      endif()
     endif()
 
     # default is enabled
@@ -106,11 +108,17 @@ macro( ecbuild_add_test )
 	# boost unit test linking to unit_test lib ?
 
 	if( _PAR_BOOST AND ENABLE_TESTS AND _${_PAR_TARGET}_condition )
-		if( BOOST_UNIT_TEST_FRAMEWORK_HEADER_ONLY )
-			include_directories( ${ECBUILD_BOOST_HEADER_DIRS} )
+
+		if( HAVE_BOOST_UNIT_TEST )
+			if( BOOST_UNIT_TEST_FRAMEWORK_HEADER_ONLY )
+				include_directories( ${ECBUILD_BOOST_HEADER_DIRS} )
+			else()
+				include_directories( ${ECBUILD_BOOST_HEADER_DIRS} ${Boost_INCLUDE_DIRS} )
+			endif()
 		else()
-			include_directories( ${ECBUILD_BOOST_HEADER_DIRS} ${Boost_INCLUDE_DIRS} )
+			set( _${_PAR_TARGET}_condition FALSE )
 		endif()
+
 	endif()
 
 	### enable the tests
@@ -125,32 +133,10 @@ macro( ecbuild_add_test )
         endforeach()
       endif()
 
-      # get test data
-
-      if( _PAR_TEST_DATA )
-
-         foreach( _d ${_PAR_TEST_DATA} )
-
-            string( REGEX MATCH "[^:]+" _name "${_d}" )
-            string( REGEX MATCH ":.*"  _md5  "${_d}" )
-            string( REPLACE ":" "" _md5 "${_md5}" )
-
-            if( _md5 )
-              ecbuild_get_test_data( TARGET _test_data_${name} NAME ${_name} MD5 ${_md5} )
-            else()
-              ecbuild_get_test_data( TARGET _test_data_${name} NAME ${_name} )
-            endif()
-
-            list( APPEND _PAR_DEPENDS _test_data_${name} )
-
-         endforeach()
-
-      endif()
-
       # build executable
 
       if( DEFINED _PAR_SOURCES )
-    
+
                 # add include dirs if defined
                 if( DEFINED _PAR_INCLUDES )
                   list(REMOVE_DUPLICATES _PAR_INCLUDES )
@@ -160,7 +146,7 @@ macro( ecbuild_add_test )
                     endif()
                   endforeach()
                 endif()
-        
+
                 # add persistent layer files
                 if( DEFINED _PAR_PERSISTENT )
 		            if( DEFINED PERSISTENT_NAMESPACE )
@@ -169,16 +155,16 @@ macro( ecbuild_add_test )
                 		ecbuild_add_persistent( SRC_LIST _PAR_SOURCES FILES ${_PAR_PERSISTENT} )
             		endif()
                 endif()
-        
+
                 # add the test target
-                
+
                 add_executable( ${_PAR_TARGET} ${_PAR_SOURCES} )
-        
+
                 # add extra dependencies
                 if( DEFINED _PAR_DEPENDS)
                   add_dependencies( ${_PAR_TARGET} ${_PAR_DEPENDS} )
                 endif()
-        
+
                 # add the link libraries
                 if( DEFINED _PAR_LIBS )
                   list(REMOVE_DUPLICATES _PAR_LIBS )
@@ -194,10 +180,10 @@ macro( ecbuild_add_test )
                 endif()
 
                 # add test libraries
-				if( _PAR_BOOST AND BOOST_UNIT_TEST_FRAMEWORK_LINKED )
+				if( _PAR_BOOST AND BOOST_UNIT_TEST_FRAMEWORK_LINKED AND HAVE_BOOST_UNIT_TEST )
                     target_link_libraries( ${_PAR_TARGET} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${Boost_TEST_EXEC_MONITOR_LIBRARY} )
                 endif()
-        
+
                 # add local flags
                 if( DEFINED _PAR_CFLAGS )
                     set_source_files_properties( ${${_PAR_TARGET}_c_srcs}   PROPERTIES COMPILE_FLAGS "${_PAR_CFLAGS}" )
@@ -212,26 +198,33 @@ macro( ecbuild_add_test )
                     set_source_files_properties( ${_PAR_GENERATED} PROPERTIES GENERATED 1 )
                 endif()
 
-        
-                # add definitions to compilation
+
+                # modify definitions to compilation ( -D... )
+                get_property( _target_defs TARGET ${_PAR_TARGET} PROPERTY COMPILE_DEFINITIONS )
+
                 if( DEFINED _PAR_DEFINITIONS )
-                    get_property( _target_defs TARGET ${_PAR_TARGET} PROPERTY COMPILE_DEFINITIONS )
                     list( APPEND _target_defs ${_PAR_DEFINITIONS} )
-					if( BOOST_UNIT_TEST_FRAMEWORK_HEADER_ONLY )
-						list( APPEND _target_defs BOOST_UNIT_TEST_FRAMEWORK_HEADER_ONLY )
-					endif()
-					set_property( TARGET ${_PAR_TARGET} PROPERTY COMPILE_DEFINITIONS ${_target_defs} )
                 endif()
-        
+
+				if( _PAR_BOOST AND BOOST_UNIT_TEST_FRAMEWORK_HEADER_ONLY )
+					list( APPEND _target_defs BOOST_UNIT_TEST_FRAMEWORK_HEADER_ONLY )
+				endif()
+
+			    set_property( TARGET ${_PAR_TARGET} PROPERTY COMPILE_DEFINITIONS ${_target_defs} )
+
                 # set build location to local build dir
                 # not the project base as defined for libs and execs
                 set_property( TARGET ${_PAR_TARGET} PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} )
 
+				# whatever project settings are, we always build tests with the build_rpath, not the install_rpath
+				set_property( TARGET ${_PAR_TARGET} PROPERTY BUILD_WITH_INSTALL_RPATH FALSE )
+				set_property( TARGET ${_PAR_TARGET} PROPERTY SKIP_BUILD_RPATH         FALSE )
+
                 # set linker language
                 if( DEFINED _PAR_LINKER_LANGUAGE )
                     set_property( TARGET ${_PAR_TARGET} PROPERTY LINKER_LANGUAGE ${_PAR_LINKER_LANGUAGE} )
                 endif()
-        
+
                 # make sure target is removed before - some problems with AIX
                 get_target_property(EXE_FILENAME ${_PAR_TARGET} OUTPUT_NAME)
                 add_custom_command(
@@ -240,25 +233,26 @@ macro( ecbuild_add_test )
                       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
           set( _PAR_TARGET ${_PAR_COMMAND} )
       endif()
 
-      # scripts dont have actual build targets so no data downloads are executed
-      # we build a phony target to trigger the dependency downloads
-      if( DEFINED _PAR_COMMAND )
+      # scripts dont have actual build targets
+      # we build a phony target to trigger the dependencies
+      if( DEFINED _PAR_COMMAND AND DEFINED _PAR_DEPENDS )
 
-          add_custom_target( ${_PAR_TARGET}.x ALL COMMAND touch ${_PAR_TARGET}.x )
+          add_custom_target( ${_PAR_TARGET}.x ALL COMMAND ${CMAKE_COMMAND} -E touch ${_PAR_TARGET}.x )
 
-          if( DEFINED _PAR_DEPENDS)
-             add_dependencies( ${_PAR_TARGET}.x ${_PAR_DEPENDS} )
-           endif()
+          add_dependencies( ${_PAR_TARGET}.x ${_PAR_DEPENDS} )
 
       endif()
 
-    
+
       # define the arguments
       set( TEST_ARGS "" )
       if( DEFINED _PAR_ARGS  )
@@ -266,7 +260,7 @@ macro( ecbuild_add_test )
       endif()
 
       # Wrap with MPIEXEC
-      if( HAVE_MPI AND MPIEXEC )
+      if( _PAR_MPI )
         if( DEFINED _PAR_COMMAND )
           set( _PAR_COMMAND ${MPIEXEC} -n ${_PAR_MPI} ${_PAR_COMMAND} )
         else()
@@ -279,19 +273,35 @@ macro( ecbuild_add_test )
       if( _PAR_ENABLED ) # we can disable and still build it but not run it with 'make tests'
 
           if( DEFINED _PAR_COMMAND )
-              add_test( ${_PAR_TARGET} ${_PAR_COMMAND} ${TEST_ARGS} ) # run a command as test
+              add_test( ${_PAR_TARGET} ${_PAR_COMMAND} ${TEST_ARGS} ${_working_dir} ) # run a command as test
           else()
-              add_test( ${_PAR_TARGET} ${_PAR_TARGET}  ${TEST_ARGS} ) # run the test that was generated
+              add_test( ${_PAR_TARGET} ${_PAR_TARGET}  ${TEST_ARGS} ${_working_dir} ) # run the test that was generated
           endif()
 
-          add_dependencies( check ${_PAR_TARGET} )
+          # get test data
+
+          if( _PAR_TEST_DATA )
+
+             ecbuild_get_test_multidata( TARGET ${_PAR_TARGET}_data NAMES ${_PAR_TEST_DATA} )
+
+             list( APPEND _PAR_TEST_DEPENDS ${_PAR_TARGET}_data )
+
+          endif()
 
           if( DEFINED _PAR_ENVIRONMENT )
-              set_tests_properties( ${_PAR_TARGET} PROPERTIES ENVIRONMENT "${_PAR_ENVIRONMENT}")
+              set_property( TEST ${_PAR_TARGET} APPEND PROPERTY ENVIRONMENT "${_PAR_ENVIRONMENT}" )
+          endif()
+
+          if( DEFINED _PAR_WORKING_DIRECTORY )
+              set_tests_properties( ${_PAR_TARGET} PROPERTIES WORKING_DIRECTORY "${_PAR_WORKING_DIRECTORY}")
+          endif()
+
+          if( DEFINED _PAR_TEST_DEPENDS )
+              set_property( TEST ${_PAR_TARGET} APPEND PROPERTY DEPENDS "${_PAR_TEST_DEPENDS}" )
           endif()
 
       endif()
-    
+
       # add to the overall list of tests
       list( APPEND ECBUILD_ALL_TESTS ${_PAR_TARGET} )
       list( REMOVE_DUPLICATES ECBUILD_ALL_TESTS )
diff --git a/cmake/ecbuild_append_to_rpath.cmake b/cmake/ecbuild_append_to_rpath.cmake
index bf48730..6868e50 100644
--- a/cmake/ecbuild_append_to_rpath.cmake
+++ b/cmake/ecbuild_append_to_rpath.cmake
@@ -43,9 +43,13 @@ macro( ecbuild_append_to_rpath RPATH_DIRS )
 				set( _done 0 )
 
 				if( EC_OS_NAME STREQUAL "macosx" )
-					set( CMAKE_INSTALL_NAME_DIR "@loader_path/${RPATH_DIR}" )
+
+					if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_LESS 3.0) # cmake < 3.0
+						set( CMAKE_INSTALL_NAME_DIR "@loader_path/${RPATH_DIR}" )
+					endif()
 					_path_append( CMAKE_INSTALL_RPATH "@loader_path/${RPATH_DIR}" )
 					set( _done 1 )
+
 				endif()
 
 				if( EC_OS_NAME STREQUAL "linux" )
@@ -58,6 +62,11 @@ macro( ecbuild_append_to_rpath RPATH_DIRS )
 					set( _done 1 )
 				endif()
 
+				if( EC_OS_NAME STREQUAL "aix" ) # always relative to exectuable path
+					_path_append( CMAKE_INSTALL_RPATH "${RPATH_DIR}" ) 
+					set( _done 1 )
+				endif()
+
 				# fallback
 
 				if( NOT _done )
diff --git a/cmake/ecbuild_bundle.cmake b/cmake/ecbuild_bundle.cmake
new file mode 100644
index 0000000..2a75e84
--- /dev/null
+++ b/cmake/ecbuild_bundle.cmake
@@ -0,0 +1,284 @@
+# Manages an external git repository
+# Usage:
+# git(DIR <directory> URL <giturl> [BRANCH <gitbranch>] [TAG <gittag>] [UPDATE] )
+#
+# Arguments:
+#  - DIR: directory name where repo will be cloned to
+#  - URL: location of origin git repository
+#  - BRANCH (optional): Branch to clone
+#  - TAG (optional): Tag or commit-id to checkout
+#  - UPDATE (optional) : Option to try to update every cmake run
+#  - NOREMOTE (optional) : Option to avoid remote operations that require network
+#                          changes to tags that havent been fetched might fail
+
+macro( debug_here VAR )
+  message( STATUS " >>>>> ${VAR} [${${VAR}}]")
+endmacro()
+
+include(CMakeParseArguments)
+
+set( ECBUILD_GIT  ON  CACHE BOOL "Turn on/off ecbuild_git() function" )
+
+if( ECBUILD_GIT )
+
+  find_package(Git)
+
+  set( ECMWF_USER $ENV{USER} CACHE STRING "ECMWF git user" )
+  set( ECMWF_GIT  SSH        CACHE STRING "ECMWF git protocol" )
+
+  set( ECMWF_GIT_SSH   "ssh://git@software.ecmwf.int:7999"                  CACHE INTERNAL "ECMWF ssh address" )
+  set( ECMWF_GIT_HTTPS "https://${ECMWF_USER}@software.ecmwf.int/stash/scm" CACHE INTERNAL "ECMWF https address" )
+
+  if( ECMWF_GIT MATCHES "[Ss][Ss][Hh]" )
+    set( ECMWF_GIT_ADDRESS ${ECMWF_GIT_SSH} CACHE INTERNAL "" )
+  else()
+    set( ECMWF_GIT_ADDRESS ${ECMWF_GIT_HTTPS} CACHE INTERNAL "" )
+  endif()
+  
+endif()
+
+macro( ecbuild_git )
+
+  set( options UPDATE NOREMOTE )
+  set( single_value_args PROJECT DIR URL TAG BRANCH )
+  set( multi_value_args )
+  cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
+
+  if( DEFINED _PAR_BRANCH AND DEFINED _PAR_TAG )
+    message( FATAL_ERROR "Cannot defined both BRANCH and TAG in macro ecbuild_git" )
+  endif()
+
+  if( _PAR_UPDATE AND _PAR_NOREMOTE )
+    message( FATAL_ERROR "Cannot pass both NOREMOTE and UPDATE in macro ecbuild_git" )
+  endif()
+
+  if(_PAR_UNPARSED_ARGUMENTS)
+    message(FATAL_ERROR "Unknown keywords given to ecbuild_git(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
+  endif()
+
+  if( ECBUILD_GIT )
+
+    set( _needs_switch 0 )
+
+    get_filename_component( ABS_PAR_DIR "${_PAR_DIR}" ABSOLUTE )
+    get_filename_component( PARENT_DIR  "${_PAR_DIR}/.." ABSOLUTE )
+
+    ### clone if no directory
+
+    if( NOT EXISTS "${_PAR_DIR}" )
+
+      message( STATUS "Cloning ${_PAR_PROJECT} from ${_PAR_URL} into ${_PAR_DIR}...")
+      execute_process(
+        COMMAND ${GIT_EXECUTABLE} "clone" ${_PAR_URL} ${clone_args} ${_PAR_DIR} "-q"
+        RESULT_VARIABLE nok ERROR_VARIABLE error
+        WORKING_DIRECTORY "${PARENT_DIR}")
+      if(nok)
+        message(FATAL_ERROR "${_PAR_DIR} git clone failed: ${error}\n")
+      endif()
+      message( STATUS "${_PAR_DIR} retrieved.")
+      set( _needs_switch 1 )
+
+    endif()
+
+    ### check current tag and sha1
+
+    if( IS_DIRECTORY "${_PAR_DIR}/.git" )
+
+        execute_process(
+          COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
+          OUTPUT_VARIABLE _sha1 RESULT_VARIABLE nok ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE
+          WORKING_DIRECTORY "${ABS_PAR_DIR}" )
+        if(nok)
+          message(STATUS "git rev-parse HEAD on ${_PAR_DIR} failed:\n ${error}")
+        endif()
+
+        execute_process(
+          COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
+          OUTPUT_VARIABLE _current_branch RESULT_VARIABLE nok ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE
+          WORKING_DIRECTORY "${ABS_PAR_DIR}" )
+        if( nok OR _current_branch STREQUAL "" )
+          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
+          WORKING_DIRECTORY "${ABS_PAR_DIR}" )
+
+        if( error MATCHES "no tag exactly matches" OR error MATCHES "No names found" )
+          unset( _current_tag )
+        else()
+          if( nok )
+            message(STATUS "git describe --exact-match --abbrev=0 on ${_PAR_DIR} failed:\n ${error}")
+          endif()
+        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
+            WORKING_DIRECTORY "${ABS_PAR_DIR}" )
+          if( nok OR _current_tag STREQUAL "" )
+            message(STATUS "git name-rev --tags --name-only on ${_PAR_DIR} failed:\n ${error}")
+          endif()
+        endif()
+
+    endif()
+
+    if( DEFINED _PAR_BRANCH AND NOT "${_current_branch}" STREQUAL "${_PAR_BRANCH}" )
+      set( _needs_switch 1 )
+    endif()
+
+    if( DEFINED _PAR_TAG AND NOT "${_current_tag}" STREQUAL "${_PAR_TAG}" )
+      set( _needs_switch 1 )
+    endif()
+
+    if( DEFINED _PAR_BRANCH AND _PAR_UPDATE AND NOT _PAR_NOREMOTE )
+
+      add_custom_target( git_update_${_PAR_PROJECT}
+                         COMMAND "${GIT_EXECUTABLE}" pull -q
+                         WORKING_DIRECTORY "${ABS_PAR_DIR}"
+                         COMMENT "git pull of branch ${_PAR_BRANCH} on ${_PAR_DIR}" )
+
+      set( git_update_targets "git_update_${_PAR_PROJECT};${git_update_targets}" )
+
+    endif()
+
+    ### updates
+
+    if( _needs_switch AND IS_DIRECTORY "${_PAR_DIR}/.git" )
+
+      # debug_here( ABS_PAR_DIR )
+      # debug_here( _sha1 )
+      # debug_here( _current_branch )
+      # debug_here( _current_tag )
+      # debug_here( _PAR_TAG )
+      # debug_here( _PAR_BRANCH )
+      # debug_here( _needs_switch )
+      # debug_here( _PAR_UPDATE )
+
+      if( DEFINED _PAR_BRANCH )
+        set ( _gitref ${_PAR_BRANCH} )
+        message(STATUS "Updating ${_PAR_PROJECT} to head of BRANCH ${_PAR_BRANCH}...")
+      else()
+        message(STATUS "Updating ${_PAR_PROJECT} to TAG ${_PAR_TAG}...")
+        set ( _gitref ${_PAR_TAG} )
+      endif()
+
+      # fetching latest tags and branches
+
+      if( NOT _PAR_NOREMOTE )
+
+          message(STATUS "git fetch --all @ ${ABS_PAR_DIR}")
+          execute_process(COMMAND "${GIT_EXECUTABLE}" fetch --all -q
+            RESULT_VARIABLE nok ERROR_VARIABLE error
+            WORKING_DIRECTORY "${ABS_PAR_DIR}")
+          if(nok)
+            message(STATUS "git fetch --all in ${_PAR_DIR} failed:\n ${error}")
+          endif()
+
+          message(STATUS "git fetch --all --tags @ ${ABS_PAR_DIR}")
+          execute_process(COMMAND "${GIT_EXECUTABLE}" fetch --all --tags -q
+            RESULT_VARIABLE nok ERROR_VARIABLE error
+            WORKING_DIRECTORY "${ABS_PAR_DIR}")
+          if(nok)
+            message(STATUS "git fetch --all --tags in ${_PAR_DIR} failed:\n ${error}")
+          endif()
+
+      else()
+          message(STATUS "${_PAR_DIR} marked NOREMOTE : Skipping git fetch")
+      endif()
+
+      # checking out gitref
+
+      message(STATUS "git checkout ${_gitref} @ ${ABS_PAR_DIR}")
+      execute_process(COMMAND "${GIT_EXECUTABLE}" checkout -q "${_gitref}"
+        RESULT_VARIABLE nok ERROR_VARIABLE error
+        WORKING_DIRECTORY "${ABS_PAR_DIR}")
+      if(nok)
+        message(FATAL_ERROR "git checkout ${_gitref} on ${_PAR_DIR} failed:\n ${error}")
+      endif()
+
+      if( DEFINED _PAR_BRANCH AND _PAR_UPDATE ) #############################################################################
+
+            execute_process(COMMAND "${GIT_EXECUTABLE}" pull -q
+              RESULT_VARIABLE nok ERROR_VARIABLE error
+              WORKING_DIRECTORY "${ABS_PAR_DIR}")
+            if(nok)
+              message(STATUS "git pull of branch ${_PAR_BRANCH} on ${_PAR_DIR} failed:\n ${error}")
+            endif()
+
+      endif() ####################################################################################
+
+    endif( _needs_switch AND IS_DIRECTORY "${_PAR_DIR}/.git" )
+
+  endif( ECBUILD_GIT )
+
+endmacro()
+
+########################################################################################################################
+
+macro( ecmwf_stash )
+
+  set( options )
+  set( single_value_args STASH )
+  set( multi_value_args )
+  cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
+
+  ecbuild_git( URL "${ECMWF_GIT_ADDRESS}/${_PAR_STASH}.git" ${_PAR_UNPARSED_ARGUMENTS} )
+
+endmacro()
+
+########################################################################################################################
+
+macro( ecbuild_bundle_initialize )
+
+  include( local-config.cmake OPTIONAL )
+
+  # ecmwf_stash( PROJECT ecbuild DIR ${PROJECT_SOURCE_DIR}/ecbuild STASH "ecsdk/ecbuild" BRANCH develop )
+
+  # set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/ecbuild/cmake;${CMAKE_MODULE_PATH}" )
+
+  include( ecbuild_system )
+
+  ecbuild_requires_macro_version( 1.6 )
+
+  ecbuild_declare_project()
+
+  file( GLOB local_config_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *local-config.cmake )
+
+  ecbuild_add_resources( TARGET ecbuild_bundle_dont_pack DONT_PACK "${local_config_files}" )
+
+  if( EXISTS "${PROJECT_SOURCE_DIR}/README.md" )
+    add_custom_target( ${PROJECT_NAME}_readme SOURCES "${PROJECT_SOURCE_DIR}/README.md" )
+  endif()
+
+endmacro()
+
+########################################################################################################################
+
+macro( ecbuild_bundle )
+
+  set( options )
+  set( single_value_args PROJECT )
+  set( multi_value_args )
+  cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
+
+  ecmwf_stash( PROJECT ${_PAR_PROJECT} DIR ${PROJECT_SOURCE_DIR}/${_PAR_PROJECT} ${_PAR_UNPARSED_ARGUMENTS} )
+
+  ecbuild_use_package( PROJECT ${_PAR_PROJECT} )
+
+endmacro()
+
+macro( ecbuild_bundle_finalize )
+
+  add_custom_target( update DEPENDS ${git_update_targets} )
+
+  ecbuild_install_project( NAME ${CMAKE_PROJECT_NAME} )
+
+  ecbuild_print_summary()
+
+endmacro()
diff --git a/cmake/ecbuild_cache.cmake b/cmake/ecbuild_cache.cmake
new file mode 100644
index 0000000..af12cf1
--- /dev/null
+++ b/cmake/ecbuild_cache.cmake
@@ -0,0 +1,65 @@
+# (C) Copyright 1996-2014 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( ecbuild_prepare_cache )
+    include( CheckSymbolExists )
+    include( CheckIncludeFiles )
+    include( CheckCSourceCompiles )
+    include( CheckCXXSourceCompiles )
+    include( CheckTypeSize )
+    set( ecbuild_cache_file ${CMAKE_BINARY_DIR}/ecbuild-cache.cmake )
+    file(WRITE ${ecbuild_cache_file} "# ecbuild cache file\n\n")    
+endmacro()
+
+
+function( ecbuild_cache_var var )
+  if( NOT ${var} )
+    set( ${var} 0 )
+  endif()
+  set( ECBUILD_CACHE_BUFFER "${ECBUILD_CACHE_BUFFER}set( ${var} ${${var}} )\n" CACHE INTERNAL "Cache buffer" )
+endfunction()
+
+function( ecbuild_cache_check_symbol_exists symbol includes output )
+  if( NOT DEFINED ${output} )
+    check_symbol_exists( ${symbol} ${includes} ${output} )
+  endif()
+  ecbuild_cache_var( ${output} )
+endfunction()
+
+function( ecbuild_cache_check_include_files includes output )
+  if( NOT DEFINED ${output} )
+    check_include_files( ${includes} ${output} )
+  endif()
+  ecbuild_cache_var( ${output} )
+endfunction()
+
+function( ecbuild_cache_check_c_source_compiles source output )
+  if( NOT DEFINED ${output} )
+    check_c_source_compiles( "${source}" ${output} )
+  endif()
+  ecbuild_cache_var( ${output} )
+endfunction()
+
+function( ecbuild_cache_check_cxx_source_compiles source output )
+  if( NOT DEFINED ${output} )
+    check_cxx_source_compiles( "${source}" ${output} )
+  endif()
+  ecbuild_cache_var( ${output} )
+endfunction()
+
+function( ecbuild_cache_check_type_size type output )
+  if( NOT DEFINED ${output} )
+    check_type_size( "${type}" ${output} )
+  endif()
+  ecbuild_cache_var( ${output} )
+endfunction()
+
+function( ecbuild_flush_cache )
+  file( APPEND ${ecbuild_cache_file} "${ECBUILD_CACHE_BUFFER}" )
+  set( ECBUILD_CACHE_BUFFER "" CACHE INTERNAL "Cache buffer" )
+endfunction()
\ No newline at end of file
diff --git a/cmake/ecbuild_check_c_source.cmake b/cmake/ecbuild_check_c_source.cmake
index 397a18f..12a26c1 100644
--- a/cmake/ecbuild_check_c_source.cmake
+++ b/cmake/ecbuild_check_c_source.cmake
@@ -48,7 +48,7 @@ macro( ecbuild_check_c_source_return SOURCE )
         if( _PAR_INCLUDES )
             list( APPEND __add_incs ${_PAR_INCLUDES} )
         endif()
-        if( __add_libs )
+		if( __add_incs )
             set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES "-DINCLUDE_DIRECTORIES:STRING=${__add_incs}")
         endif()
     
@@ -117,30 +117,45 @@ endmacro()
 
 macro( cmake_add_c_flags m_c_flags )
 
-  set( options )
-  set( single_value_args BUILD )
-  set( multi_value_args )
+  set( _flags ${m_c_flags} )
 
-  cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}"  ${_FIRST_ARG} ${ARGN} )
+  if( _flags AND CMAKE_C_COMPILER_LOADED )
+    set( options )
+    set( single_value_args BUILD NAME )
+    set( multi_value_args )
 
-  if( NOT DEFINED N_CFLAG )
-    set( N_CFLAG 0 )
-  endif()
+    cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}"  ${_FIRST_ARG} ${ARGN} )
 
-  math( EXPR N_CFLAG '${N_CFLAG}+1' )
+    if( NOT DEFINED N_CFLAG )
+      set( N_CFLAG 0 )
+    endif()
 
-  check_c_compiler_flag( ${m_c_flags} C_FLAG_TEST_${N_CFLAG} )
+    math( EXPR N_CFLAG '${N_CFLAG}+1' )
 
-  if( C_FLAG_TEST_${N_CFLAG} )
-    if( _PAR_BUILD )
-      set( CMAKE_C_FLAGS_${_PAR_BUILD} "${CMAKE_C_FLAGS_${_PAR_BUILD}} ${m_c_flags}" )
+    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()
     else()
-      set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${m_c_flags}" )
-      # message( STATUS "C FLAG [${m_c_flags}] added" )
+      set( _flag_ok 1 )
+    endif()
+    
+    if( _flag_ok )
+      if( _PAR_BUILD )
+        set( CMAKE_C_FLAGS_${_PAR_BUILD} "${CMAKE_C_FLAGS_${_PAR_BUILD}} ${_flags}" )
+      else()
+        set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_flags}" )
+        # message( STATUS "C FLAG [${_flags}] added" )
+      endif()
+    else()
+      message( WARNING "Unrecognised C flag [${_flags}] -- skipping" )
     endif()
-  else()
-	message( WARNING "Unrecognised C flag [${m_c_flags}] -- skipping" )
   endif()
-
+  unset( _flags )
+  unset( _flag_ok )
 endmacro()
 
diff --git a/cmake/ecbuild_check_compiler.cmake b/cmake/ecbuild_check_compiler.cmake
index 8a7b46d..7ac4ea0 100644
--- a/cmake/ecbuild_check_compiler.cmake
+++ b/cmake/ecbuild_check_compiler.cmake
@@ -62,9 +62,9 @@ endif()
 ############################################################################################
 # c compiler tests
 
-if( CMAKE_C_COMPILER_LOADED )
+if( CMAKE_C_COMPILER_LOADED AND ENABLE_OS_TESTS )
 
-	check_c_source_compiles(
+	ecbuild_cache_check_c_source_compiles(
 		  " typedef int foo_t;
 			static inline foo_t static_foo(){return 0;}
 			foo_t foo(){return 0;}
@@ -76,24 +76,25 @@ endif()
 ############################################################################################
 # c++ compiler tests
 
-if( CMAKE_CXX_COMPILER_LOADED )
+if( CMAKE_CXX_COMPILER_LOADED AND ENABLE_OS_TESTS )
 
     # check for __FUNCTION__
-	check_cxx_source_compiles( "#include <iostream>\nint main(int argc, char* argv[]) { std::cout << __FUNCTION__ << std::endl; }"
-		EC_HAVE_FUNCTION_DEF )
+    ecbuild_cache_check_cxx_source_compiles( "#include <iostream>\nint main(int argc, char* argv[]) { std::cout << __FUNCTION__ << std::endl; }"
+      EC_HAVE_FUNCTION_DEF )
+    
 
     # check for c++ abi, usually present in GNU compilers
-	check_cxx_source_compiles( "#include <cxxabi.h>\n int main() { char * type; int status; char * r = abi::__cxa_demangle(type, 0, 0, &status); }"
-		EC_HAVE_CXXABI_H )
+    ecbuild_cache_check_cxx_source_compiles( "#include <cxxabi.h>\n int main() { char * type; int status; char * r = abi::__cxa_demangle(type, 0, 0, &status); }"
+    EC_HAVE_CXXABI_H )
 
     # check for bool
-	check_cxx_source_compiles( "int main() { bool aflag = true; }"
-		EC_HAVE_CXX_BOOL )
+    ecbuild_cache_check_cxx_source_compiles( "int main() { bool aflag = true; }"
+	  EC_HAVE_CXX_BOOL )
 
     # check for sstream
-	check_cxx_source_compiles( "#include <sstream>\nint main() { std::stringstream s; }"
-		EC_HAVE_CXX_SSTREAM )
-
+    ecbuild_cache_check_cxx_source_compiles( "#include <sstream>\nint main() { std::stringstream s; }"
+	  EC_HAVE_CXX_SSTREAM )
+ 
 endif()
 
 ############################################################################################
@@ -105,6 +106,7 @@ if( CMAKE_COMPILER_IS_GNUCC )
 
     if( ENABLE_WARNINGS )
         cmake_add_c_flags("-Wall")
+        cmake_add_c_flags("-pedantic")
         #    cmake_add_c_flags("-Wextra")
     endif()
 
diff --git a/cmake/ecbuild_check_cxx11.cmake b/cmake/ecbuild_check_cxx11.cmake
index 8ab084a..ef1b24e 100644
--- a/cmake/ecbuild_check_cxx11.cmake
+++ b/cmake/ecbuild_check_cxx11.cmake
@@ -15,8 +15,8 @@ function( ecbuild_check_cxx11 )
 	# parse parameters
 
 	set( options PRINT )
-	set( single_value_args FEATURES REQUIRED )
-	set( multi_value_args  )
+	set( single_value_args )
+	set( multi_value_args   FEATURES REQUIRED )
 
 	cmake_parse_arguments( _p "${options}" "${single_value_args}" "${multi_value_args}"  ${_FIRST_ARG} ${ARGN} )
 
diff --git a/cmake/ecbuild_check_cxx_source.cmake b/cmake/ecbuild_check_cxx_source.cmake
index a6ab49e..a48ae5a 100644
--- a/cmake/ecbuild_check_cxx_source.cmake
+++ b/cmake/ecbuild_check_cxx_source.cmake
@@ -49,7 +49,7 @@ macro( ecbuild_check_cxx_source_return SOURCE )
         if( _p_INCLUDES )
             list( APPEND __add_incs ${_p_INCLUDES} )
         endif()
-        if( __add_libs )
+		if( __add_incs )
             set(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES "-DINCLUDE_DIRECTORIES:STRING=${__add_incs}")
         endif()
     
@@ -126,29 +126,35 @@ endmacro()
 
 macro( cmake_add_cxx_flags m_cxx_flags )
 
-  set( options )
-  set( single_value_args BUILD )
-  set( multi_value_args )
+  set( _flags ${m_cxx_flags} )
+  if( _flags AND CMAKE_CXX_COMPILER_LOADED )
+    set( options )
+    set( single_value_args BUILD )
+    set( multi_value_args )
 
-  cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}"  ${_FIRST_ARG} ${ARGN} )
+    cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}"  ${_FIRST_ARG} ${ARGN} )
 
-  if( NOT DEFINED N_CXXFLAG )
-    set( N_CXXFLAG 0 )
-  endif()
+    if( NOT DEFINED N_CXXFLAG )
+      set( N_CXXFLAG 0 )
+    endif()
 
-  math( EXPR N_CXXFLAG '${N_CXXFLAG}+1' )
+    math( EXPR N_CXXFLAG '${N_CXXFLAG}+1' )
 
-  check_cxx_compiler_flag( ${m_cxx_flags} CXX_FLAG_TEST_${N_CXXFLAG} )
+    if( NOT ECBUILD_TRUST_FLAGS )
+      check_cxx_compiler_flag( ${_flags} CXX_FLAG_TEST_${N_CXXFLAG} )
+    endif()
 
-  if( CXX_FLAG_TEST_${N_CXXFLAG} )
-    if( _PAR_BUILD )
-      set( CMAKE_CXX_FLAGS_${_PAR_BUILD} "${CMAKE_CXX_FLAGS_${_PAR_BUILD}} ${m_cxx_flags}" )
+    if( CXX_FLAG_TEST_${N_CXXFLAG} OR ECBUILD_TRUST_FLAGS )
+      if( _PAR_BUILD )
+        set( CMAKE_CXX_FLAGS_${_PAR_BUILD} "${CMAKE_CXX_FLAGS_${_PAR_BUILD}} ${_flags}" )
+      else()
+        set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flags}" )
+        # message( STATUS "C++ FLAG [${_flags}] added" )
+      endif()
     else()
-      set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${m_cxx_flags}" )
-      # message( STATUS "C++ FLAG [${m_cxx_flags}] added" )
+      message( STATUS "Unrecognised CXX flag [${_flags}] -- skipping" )
     endif()
-  else()
-	message( STATUS "Unrecognised CXX flag [${m_cxx_flags}] -- skipping" )
   endif()
+  unset( _flags )
 
 endmacro()
diff --git a/cmake/ecbuild_check_fortran_source.cmake b/cmake/ecbuild_check_fortran_source.cmake
index ff2212a..da04a70 100644
--- a/cmake/ecbuild_check_fortran_source.cmake
+++ b/cmake/ecbuild_check_fortran_source.cmake
@@ -119,30 +119,39 @@ endmacro()
 include( CheckFortranCompilerFlag )
 macro( cmake_add_fortran_flags m_fortran_flags )
 
-  set( options )
-  set( single_value_args BUILD )
-  set( multi_value_args )
+  set( _flags ${m_fortran_flags} )
 
-  cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}"  ${_FIRST_ARG} ${ARGN} )
+  if( _flags AND CMAKE_Fortran_COMPILER_LOADED )
 
-  if( NOT DEFINED N_FortranFLAG )
-    set( N_FortranFLAG 0 )
-  endif()
+    set( options )
+    set( single_value_args BUILD )
+    set( multi_value_args )
+
+    cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}"  ${_FIRST_ARG} ${ARGN} )
 
-  math( EXPR N_FortranFLAG '${N_FortranFLAG}+1' )
+    if( NOT DEFINED N_FortranFLAG )
+      set( N_FortranFLAG 0 )
+    endif()
+
+    math( EXPR N_FortranFLAG '${N_FortranFLAG}+1' )
 
-  check_fortran_compiler_flag( ${m_fortran_flags} Fortran_FLAG_TEST_${N_FortranFLAG} )
+    if( NOT ECBUILD_TRUST_FLAGS )
+      check_fortran_compiler_flag( ${_flags} Fortran_FLAG_TEST_${N_FortranFLAG} )
+    endif()
 
-  if( Fortran_FLAG_TEST_${N_FortranFLAG} )
-    if( _PAR_BUILD )
-      set( CMAKE_Fortran_FLAGS_${_PAR_BUILD} "${CMAKE_Fortran_FLAGS_${_PAR_BUILD}} ${m_fortran_flags}" )
+    if( Fortran_FLAG_TEST_${N_FortranFLAG} OR ECBUILD_TRUST_FLAGS )
+      if( _PAR_BUILD )
+        set( CMAKE_Fortran_FLAGS_${_PAR_BUILD} "${CMAKE_Fortran_FLAGS_${_PAR_BUILD}} ${_flags}" )
+      else()
+        set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${_flags}" )
+        # message( STATUS "Fortran FLAG [${_flags}] added" )
+      endif()
     else()
-      set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${m_fortran_flags}" )
-      # message( STATUS "Fortran FLAG [${m_fortran_flags}] added" )
+      message( STATUS "Unrecognised Fortran flag [${_flags}] -- skipping" )
     endif()
-  else()
-    message( STATUS "Unrecognised Fortran flag [${m_fortran_flags}] -- skipping" )
   endif()
 
+  unset( _flags )
+
 endmacro()
 
diff --git a/cmake/ecbuild_check_functions.cmake b/cmake/ecbuild_check_functions.cmake
index 4741b88..e859432 100644
--- a/cmake/ecbuild_check_functions.cmake
+++ b/cmake/ecbuild_check_functions.cmake
@@ -13,111 +13,112 @@ if( ENABLE_OS_FUNCTIONS_TEST )
     
     ### symbol checks ##################
 
-    check_symbol_exists( fseek        "stdio.h"                         EC_HAVE_FSEEK  )
-    check_symbol_exists( fseeko       "stdio.h"                         EC_HAVE_FSEEKO )
-    check_symbol_exists( ftello       "stdio.h"                         EC_HAVE_FTELLO )
-    check_symbol_exists( lseek        "sys/types.h;unistd.h"            EC_HAVE_LSEEK  )
-    check_symbol_exists( ftruncate    "sys/types.h;unistd.h"            EC_HAVE_FTRUNCATE  )
-    check_symbol_exists( open         "sys/types.h;sys/stat.h;fcntl.h"  EC_HAVE_OPEN   )
-    check_symbol_exists( fopen        "stdio.h"                         EC_HAVE_FOPEN  )
-    check_symbol_exists( flock        "sys/file.h"                      EC_HAVE_FLOCK  )
-    check_symbol_exists( mmap         "sys/mman.h"                      EC_HAVE_MMAP   )
+    ecbuild_cache_check_symbol_exists( fseek        "stdio.h"                         EC_HAVE_FSEEK  )
+    ecbuild_cache_check_symbol_exists( fseeko       "stdio.h"                         EC_HAVE_FSEEKO )
+    ecbuild_cache_check_symbol_exists( ftello       "stdio.h"                         EC_HAVE_FTELLO )
+    ecbuild_cache_check_symbol_exists( lseek        "sys/types.h;unistd.h"            EC_HAVE_LSEEK  )
+    ecbuild_cache_check_symbol_exists( ftruncate    "sys/types.h;unistd.h"            EC_HAVE_FTRUNCATE  )
+    ecbuild_cache_check_symbol_exists( open         "sys/types.h;sys/stat.h;fcntl.h"  EC_HAVE_OPEN   )
+    ecbuild_cache_check_symbol_exists( fopen        "stdio.h"                         EC_HAVE_FOPEN  )
+    ecbuild_cache_check_symbol_exists( flock        "sys/file.h"                      EC_HAVE_FLOCK  )
+    ecbuild_cache_check_symbol_exists( mmap         "sys/mman.h"                      EC_HAVE_MMAP   )
     
-    check_symbol_exists( posix_memalign "stdlib.h"                      EC_HAVE_POSIX_MEMALIGN )
+    ecbuild_cache_check_symbol_exists( posix_memalign "stdlib.h"                      EC_HAVE_POSIX_MEMALIGN )
     
-    check_symbol_exists( F_GETLK      "fcntl.h"                         EC_HAVE_F_GETLK  )
-    check_symbol_exists( F_SETLK      "fcntl.h"                         EC_HAVE_F_SETLK  )
-    check_symbol_exists( F_SETLKW     "fcntl.h"                         EC_HAVE_F_SETLKW  )
+    ecbuild_cache_check_symbol_exists( F_GETLK      "fcntl.h"                         EC_HAVE_F_GETLK  )
+    ecbuild_cache_check_symbol_exists( F_SETLK      "fcntl.h"                         EC_HAVE_F_SETLK  )
+    ecbuild_cache_check_symbol_exists( F_SETLKW     "fcntl.h"                         EC_HAVE_F_SETLKW  )
      
-    check_symbol_exists( F_GETLK64     "fcntl.h"                        EC_HAVE_F_GETLK64  )
-    check_symbol_exists( F_SETLK64     "fcntl.h"                        EC_HAVE_F_SETLK64  )
-    check_symbol_exists( F_SETLKW64    "fcntl.h"                        EC_HAVE_F_SETLKW64  )
+    ecbuild_cache_check_symbol_exists( F_GETLK64     "fcntl.h"                        EC_HAVE_F_GETLK64  )
+    ecbuild_cache_check_symbol_exists( F_SETLK64     "fcntl.h"                        EC_HAVE_F_SETLK64  )
+    ecbuild_cache_check_symbol_exists( F_SETLKW64    "fcntl.h"                        EC_HAVE_F_SETLKW64  )
     
-    check_symbol_exists( MAP_ANONYMOUS "sys/mman.h"                     EC_HAVE_MAP_ANONYMOUS )
-    check_symbol_exists( MAP_ANON      "sys/mman.h"                     EC_HAVE_MAP_ANON )
+    ecbuild_cache_check_symbol_exists( MAP_ANONYMOUS "sys/mman.h"                     EC_HAVE_MAP_ANONYMOUS )
+    ecbuild_cache_check_symbol_exists( MAP_ANON      "sys/mman.h"                     EC_HAVE_MAP_ANON )
 
     ### include files checks ##################
 
-    check_include_files( assert.h       EC_HAVE_ASSERT_H      )
-    check_include_files( stdlib.h       EC_HAVE_STDLIB_H      )
-    check_include_files( unistd.h       EC_HAVE_UNISTD_H      )
-    check_include_files( string.h       EC_HAVE_STRING_H      )
-    check_include_files( strings.h      EC_HAVE_STRINGS_H     )
-    check_include_files( sys/stat.h     EC_HAVE_SYS_STAT_H    )
-    check_include_files( sys/time.h     EC_HAVE_SYS_TIME_H    )
-    check_include_files( sys/types.h    EC_HAVE_SYS_TYPES_H   )
-    check_include_files( malloc.h       EC_HAVE_MALLOC_H      )
-    check_include_files( sys/malloc.h   EC_HAVE_SYS_MALLOC_H  )
+    ecbuild_cache_check_include_files( assert.h       EC_HAVE_ASSERT_H      )
+    ecbuild_cache_check_include_files( stdlib.h       EC_HAVE_STDLIB_H      )
+    ecbuild_cache_check_include_files( unistd.h       EC_HAVE_UNISTD_H      )
+    ecbuild_cache_check_include_files( string.h       EC_HAVE_STRING_H      )
+    ecbuild_cache_check_include_files( strings.h      EC_HAVE_STRINGS_H     )
+    ecbuild_cache_check_include_files( sys/stat.h     EC_HAVE_SYS_STAT_H    )
+    ecbuild_cache_check_include_files( sys/time.h     EC_HAVE_SYS_TIME_H    )
+    ecbuild_cache_check_include_files( sys/types.h    EC_HAVE_SYS_TYPES_H   )
+    ecbuild_cache_check_include_files( malloc.h       EC_HAVE_MALLOC_H      )
+    ecbuild_cache_check_include_files( sys/malloc.h   EC_HAVE_SYS_MALLOC_H  )
     
-    check_include_files("sys/param.h;sys/mount.h" EC_HAVE_SYS_MOUNT_H )
-    check_include_files("sys/vfs.h"               EC_HAVE_SYS_VFS_H )
+    ecbuild_cache_check_include_files( sys/param.h    EC_HAVE_SYS_PARAM_H   )
+    ecbuild_cache_check_include_files( sys/mount.h    EC_HAVE_SYS_MOUNT_H   )
+    ecbuild_cache_check_include_files( sys/vfs.h      EC_HAVE_SYS_VFS_H     )
 
     ### capability checks ##################
 
     # test off_t
-    check_c_source_compiles( "#include <sys/types.h>\nint main(){ off_t l=0; return 0;}\n" EC_HAVE_OFFT )
+    ecbuild_cache_check_c_source_compiles( "#include <sys/types.h>\nint main(){ off_t l=0; return 0;}\n" EC_HAVE_OFFT )
     # test off64_t
-    check_c_source_compiles( "#define _LARGEFILE64_SOURCE\n#include <stdio.h>\n#include <sys/types.h>\nint main(){ off64_t l=0; return 0;}\n" EC_HAVE_OFF64T  )
+    ecbuild_cache_check_c_source_compiles( "#define _LARGEFILE64_SOURCE\n#include <stdio.h>\n#include <sys/types.h>\nint main(){ off64_t l=0; return 0;}\n" EC_HAVE_OFF64T  )
     # test struct stat
-    check_c_source_compiles( "#include <sys/stat.h>\nint main(){ struct stat s; return 0; }"   EC_HAVE_STRUCT_STAT )
+    ecbuild_cache_check_c_source_compiles( "#include <sys/stat.h>\nint main(){ struct stat s; return 0; }"   EC_HAVE_STRUCT_STAT )
     # test struct stat64
-    check_c_source_compiles( "#define _LARGEFILE64_SOURCE\n#include <sys/stat.h>\nint main(){ struct stat64 s; return 0; }" EC_HAVE_STRUCT_STAT64 )
+    ecbuild_cache_check_c_source_compiles( "#define _LARGEFILE64_SOURCE\n#include <sys/stat.h>\nint main(){ struct stat64 s; return 0; }" EC_HAVE_STRUCT_STAT64 )
     # test stat
-    check_c_source_compiles( "#include <sys/stat.h>\nint main(){ struct stat s;	stat(\"\",&s); return 0; }"    EC_HAVE_STAT )
+    ecbuild_cache_check_c_source_compiles( "#include <sys/stat.h>\nint main(){ struct stat s;	stat(\"\",&s); return 0; }"    EC_HAVE_STAT )
     # test stat64
-    check_c_source_compiles( "#define _LARGEFILE64_SOURCE\n#include <sys/stat.h>\nint main(){ struct stat64 s; stat64(\"\",&s); return 0; }"  EC_HAVE_STAT64 )
+    ecbuild_cache_check_c_source_compiles( "#define _LARGEFILE64_SOURCE\n#include <sys/stat.h>\nint main(){ struct stat64 s; stat64(\"\",&s); return 0; }"  EC_HAVE_STAT64 )
     # test fstat
-    check_c_source_compiles( "#include <sys/stat.h>\nint main(){ struct stat s; fstat(1,&s); return 0; }" EC_HAVE_FSTAT )
+    ecbuild_cache_check_c_source_compiles( "#include <sys/stat.h>\nint main(){ struct stat s; fstat(1,&s); return 0; }" EC_HAVE_FSTAT )
     # test fstat64
-    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 )
+    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
-    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 )
+    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
-    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 )
+    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
-    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 )
+    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
-    check_c_source_compiles( "#define _LARGEFILE64_SOURCE\n#include <fcntl.h>\nint main(){int fd = open64(\"name\",O_RDWR|O_CREAT,0777);return 0;}\n" EC_HAVE_OPEN64 )
+    ecbuild_cache_check_c_source_compiles( "#define _LARGEFILE64_SOURCE\n#include <fcntl.h>\nint main(){int fd = open64(\"name\",O_RDWR|O_CREAT,0777);return 0;}\n" EC_HAVE_OPEN64 )
     # test for fopen64
-    check_c_source_compiles( "#define _LARGEFILE64_SOURCE\n#include <stdio.h>\nint main(){FILE* file = fopen64(\"name\",\"w\");return 0;}\n"  EC_HAVE_FOPEN64 )
+    ecbuild_cache_check_c_source_compiles( "#define _LARGEFILE64_SOURCE\n#include <stdio.h>\nint main(){FILE* file = fopen64(\"name\",\"w\");return 0;}\n"  EC_HAVE_FOPEN64 )
     # test for ftruncate64
-    check_c_source_compiles( "#define _LARGEFILE64_SOURCE\n#include <unistd.h>\n#include <sys/types.h>\nint main(){ftruncate64(0,(off64_t)0);return 0;}\n" EC_HAVE_FTRUNCATE64 )
+    ecbuild_cache_check_c_source_compiles( "#define _LARGEFILE64_SOURCE\n#include <unistd.h>\n#include <sys/types.h>\nint main(){ftruncate64(0,(off64_t)0);return 0;}\n" EC_HAVE_FTRUNCATE64 )
     # test for flock64
-    check_c_source_compiles( "#define _LARGEFILE64_SOURCE\n#include <fcntl.h>\nint main(){struct flock64 l;return 0;}\n" EC_HAVE_FLOCK64 )
+    ecbuild_cache_check_c_source_compiles( "#define _LARGEFILE64_SOURCE\n#include <fcntl.h>\nint main(){struct flock64 l;return 0;}\n" EC_HAVE_FLOCK64 )
     # test for mmap64
-    check_c_source_compiles( "#define _LARGEFILE64_SOURCE\n#include <sys/mman.h>\nint main(){void* addr = mmap64(0,10,PROT_READ|PROT_WRITE,MAP_PRIVATE,10,0); return 0;}\n" EC_HAVE_MMAP64 )
+    ecbuild_cache_check_c_source_compiles( "#define _LARGEFILE64_SOURCE\n#include <sys/mman.h>\nint main(){void* addr = mmap64(0,10,PROT_READ|PROT_WRITE,MAP_PRIVATE,10,0); return 0;}\n" EC_HAVE_MMAP64 )
     # test for struct statvfs
-    check_c_source_compiles( "#include <sys/statvfs.h>\nint main(){ struct statvfs v; }" EC_HAVE_STRUCT_STATVFS )
+    ecbuild_cache_check_c_source_compiles( "#include <sys/statvfs.h>\nint main(){ struct statvfs v; }" EC_HAVE_STRUCT_STATVFS )
     # test for struct statvfs64
-    check_c_source_compiles( "#define _LARGEFILE64_SOURCE\n#include <sys/statvfs.h>\nint main(){ struct statvfs64 v; }" EC_HAVE_STRUCT_STATVFS64 )
+    ecbuild_cache_check_c_source_compiles( "#define _LARGEFILE64_SOURCE\n#include <sys/statvfs.h>\nint main(){ struct statvfs64 v; }" EC_HAVE_STRUCT_STATVFS64 )
         
     # test for fsync
-    check_symbol_exists(fsync "unistd.h" EC_HAVE_FSYNC)
+    ecbuild_cache_check_symbol_exists(fsync "unistd.h" EC_HAVE_FSYNC)
     # test for fdatasync
-    check_symbol_exists(fdatasync "unistd.h" EC_HAVE_FDATASYNC)
+    ecbuild_cache_check_symbol_exists(fdatasync "unistd.h" EC_HAVE_FDATASYNC)
     # test for dirfd
-    check_c_source_compiles( "#include <sys/types.h>\n#include <dirent.h>\nint main(){ DIR *dirp; int i = dirfd(dirp); }\n" EC_HAVE_DIRFD )
+    ecbuild_cache_check_c_source_compiles( "#include <sys/types.h>\n#include <dirent.h>\nint main(){ DIR *dirp; int i = dirfd(dirp); }\n" EC_HAVE_DIRFD )
     # test for sys/proc.h
-    check_c_source_compiles( "#include <sys/proc.h>\nint main(){ return 0; }\n" EC_HAVE_SYSPROC )
+    ecbuild_cache_check_c_source_compiles( "#include <sys/proc.h>\nint main(){ return 0; }\n" EC_HAVE_SYSPROC )
     # test for procfs
-    check_c_source_compiles( "#include <sys/procfs.h>\nint main(){ return 0; }\n" EC_HAVE_SYSPROCFS )
+    ecbuild_cache_check_c_source_compiles( "#include <sys/procfs.h>\nint main(){ return 0; }\n" EC_HAVE_SYSPROCFS )
     # test for backtrace
-    check_c_source_compiles( "#include <unistd.h>\n#include <execinfo.h>\n int main(){ void ** buffer; int i = backtrace(buffer, 256); }\n" EC_HAVE_EXECINFO_BACKTRACE )
+    ecbuild_cache_check_c_source_compiles( "#include <unistd.h>\n#include <execinfo.h>\n int main(){ void ** buffer; int i = backtrace(buffer, 256); }\n" EC_HAVE_EXECINFO_BACKTRACE )
            
     #### reentrant funtions support  #############
 
     # test for gmtime_r
-    check_c_source_compiles( "#include <time.h>\nint main(){ time_t now; time(&now); struct tm t; gmtime_r(&now,&t); }\n" EC_HAVE_GMTIME_R )
+    ecbuild_cache_check_c_source_compiles( "#include <time.h>\nint main(){ time_t now; time(&now); struct tm t; gmtime_r(&now,&t); }\n" EC_HAVE_GMTIME_R )
     # test for getpwuid_r
-    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 )
+    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
-    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
-    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 )
+    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
-    check_c_source_compiles( "#include <netdb.h>\nint main(){ const char *name; struct hostent *ret; char *buf; struct hostent **result; size_t buflen; int *h_errnop; int i = gethostbyname_r(name,ret,buf,buflen,result,h_errnop); }\n" EC_HAVE_GETHOSTBYNAME_R )
+    ecbuild_cache_check_c_source_compiles( "#include <netdb.h>\nint main(){ const char *name; struct hostent *ret; char *buf; struct hostent **result; size_t buflen; int *h_errnop; int i = gethostbyname_r(name,ret,buf,buflen,result,h_errnop); }\n" EC_HAVE_GETHOSTBYNAME_R )
 
 endif()
 
diff --git a/cmake/ecbuild_check_os.cmake b/cmake/ecbuild_check_os.cmake
index 6c9d524..8373c4a 100644
--- a/cmake/ecbuild_check_os.cmake
+++ b/cmake/ecbuild_check_os.cmake
@@ -9,9 +9,7 @@
 ############################################################################################
 # check size of pointer
 
-if( NOT DEFINED CMAKE_SIZEOF_VOID_P)
-	message( FATAL_ERROR "CMake could not check sizeof void* to infer addressing mode of the OS -- try to upgrade to a more recent CMake" )
-endif()
+ecbuild_cache_check_type_size( "void*" CMAKE_SIZEOF_VOID_P  )
 
 math( EXPR EC_OS_BITS "${CMAKE_SIZEOF_VOID_P} * 8" )
 
@@ -19,6 +17,7 @@ math( EXPR EC_OS_BITS "${CMAKE_SIZEOF_VOID_P} * 8" )
 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" )
 endif()
+ecbuild_cache_var( EC_OS_BITS )
 
 ############################################################################################
 # For 64 bit architectures enable PIC (position-independent code)
@@ -28,34 +27,34 @@ if( ${EC_OS_BITS} EQUAL 64 )
 endif()
 
 ############################################################################################
-# check architecture architecture
+# check architecture
 
 if( ENABLE_OS_TYPES_TEST )
 
 	set( EC_SIZEOF_PTR ${CMAKE_SIZEOF_VOID_P} )
-
-	check_type_size( char           EC_SIZEOF_CHAR        )
-	check_type_size( short          EC_SIZEOF_SHORT       )
-	check_type_size( int            EC_SIZEOF_INT         )
-	check_type_size( long           EC_SIZEOF_LONG        )
-	check_type_size( "long long"    EC_SIZEOF_LONG_LONG   )
-	check_type_size( float          EC_SIZEOF_FLOAT       )
-	check_type_size( double         EC_SIZEOF_DOUBLE      )
-	check_type_size( "long double"  EC_SIZEOF_LONG_DOUBLE )
-	check_type_size( size_t         EC_SIZEOF_SIZE_T      )
-	check_type_size( ssize_t        EC_SIZEOF_SSIZE_T     )
-	check_type_size( off_t          EC_SIZEOF_OFF_T       )
-
-	message( STATUS "sizeof void*  [${EC_SIZEOF_PTR}]" )
-	message( STATUS "sizeof off_t  [${EC_SIZEOF_OFF_T}]" )
-	message( STATUS "sizeof int    [${EC_SIZEOF_INT}]" )
-	message( STATUS "sizeof short  [${EC_SIZEOF_SHORT}]" )
-	message( STATUS "sizeof long   [${EC_SIZEOF_LONG}]" )
-	message( STATUS "sizeof size_t [${EC_SIZEOF_SIZE_T}]" )
-	message( STATUS "sizeof float  [${EC_SIZEOF_FLOAT}]" )
-	message( STATUS "sizeof double [${EC_SIZEOF_DOUBLE}]" )
-	message( STATUS "sizeof long long   [${EC_SIZEOF_LONG_LONG}]" )
-	message( STATUS "sizeof long double [${EC_SIZEOF_LONG_DOUBLE}]" )
+	ecbuild_cache_var( EC_SIZEOF_PTR )
+    ecbuild_cache_check_type_size( char           EC_SIZEOF_CHAR        )
+    ecbuild_cache_check_type_size( short          EC_SIZEOF_SHORT       )
+	ecbuild_cache_check_type_size( int            EC_SIZEOF_INT         )
+	ecbuild_cache_check_type_size( long           EC_SIZEOF_LONG        )
+	ecbuild_cache_check_type_size( "long long"    EC_SIZEOF_LONG_LONG   )
+	ecbuild_cache_check_type_size( float          EC_SIZEOF_FLOAT       )
+	ecbuild_cache_check_type_size( double         EC_SIZEOF_DOUBLE      )
+	ecbuild_cache_check_type_size( "long double"  EC_SIZEOF_LONG_DOUBLE )
+	ecbuild_cache_check_type_size( size_t         EC_SIZEOF_SIZE_T      )
+	ecbuild_cache_check_type_size( ssize_t        EC_SIZEOF_SSIZE_T     )
+	ecbuild_cache_check_type_size( off_t          EC_SIZEOF_OFF_T       )
+
+#	message( STATUS "sizeof void*  [${EC_SIZEOF_PTR}]" )
+#	message( STATUS "sizeof off_t  [${EC_SIZEOF_OFF_T}]" )
+#	message( STATUS "sizeof int    [${EC_SIZEOF_INT}]" )
+#	message( STATUS "sizeof short  [${EC_SIZEOF_SHORT}]" )
+#	message( STATUS "sizeof long   [${EC_SIZEOF_LONG}]" )
+#	message( STATUS "sizeof size_t [${EC_SIZEOF_SIZE_T}]" )
+#	message( STATUS "sizeof float  [${EC_SIZEOF_FLOAT}]" )
+#	message( STATUS "sizeof double [${EC_SIZEOF_DOUBLE}]" )
+#	message( STATUS "sizeof long long   [${EC_SIZEOF_LONG_LONG}]" )
+#	message( STATUS "sizeof long double [${EC_SIZEOF_LONG_DOUBLE}]" )
 
 #	message( STATUS "system sizeof :" )
 #	message( STATUS "  void*  [${EC_SIZEOF_PTR}]  size_t [${EC_SIZEOF_SIZE_T}]  off_t  [${EC_SIZEOF_OFF_T}]   short  [${EC_SIZEOF_SHORT}]" )
@@ -72,32 +71,25 @@ endif()
 
 if( ENABLE_LARGE_FILE_SUPPORT )
 
-	check_type_size( off_t EC_SIZEOF_OFF_T )
+  ecbuild_cache_check_type_size( off_t EC_SIZEOF_OFF_T )
 
 	if( EC_SIZEOF_OFF_T LESS "8" )
 
-	if( ${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
-		add_definitions( -D_FILE_OFFSET_BITS=64 )
-	endif()
-
-	if( ${CMAKE_SYSTEM_NAME} MATCHES "AIX" )
-		add_definitions( -D_LARGE_FILES=64 )
-	endif()
+		if( ${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
+			add_definitions( -D_FILE_OFFSET_BITS=64 )
+		endif()
 
-	get_directory_property( __compile_defs COMPILE_DEFINITIONS )
+		if( ${CMAKE_SYSTEM_NAME} MATCHES "AIX" )
+			add_definitions( -D_LARGE_FILES=64 )
+		endif()
 
-	if( __compile_defs )
-		foreach( def ${__compile_defs} )
-			list( APPEND CMAKE_REQUIRED_DEFINITIONS -D${def} )
-		endforeach()
-	endif()
+		get_directory_property( __compile_defs COMPILE_DEFINITIONS )
 
-#	ecbuild_check_c_source_return( "#include <stdio.h>\n#include <sys/types.h>\nint main(){printf(\"%ld\",sizeof(off_t));return 0;}"
-#		VAR  check_off_t_final
-#		OUTPUT __sizeof_off_t_final )
-#	if( NOT check_off_t_final OR __sizeof_off_t_final LESS "8" )
-#		message( FATAL_ERROR "operating system ${CMAKE_SYSTEM} ${EC_OS_BITS} bits -- sizeof off_t [${__sizeof_off_t_final}]" )
-#	endif()
+		if( __compile_defs )
+			foreach( def ${__compile_defs} )
+				list( APPEND CMAKE_REQUIRED_DEFINITIONS -D${def} )
+			endforeach()
+		endif()
 
 	endif()
 
@@ -108,80 +100,83 @@ endif()
 
 if( ENABLE_OS_ENDINESS_TEST )
 
-	test_big_endian( _BIG_ENDIAN )
-
-	if( _BIG_ENDIAN )
-		set( EC_BIG_ENDIAN    1 )
-	else()
-		set( EC_LITTLE_ENDIAN 1 )
-	endif()
+  if( NOT DEFINED EC_BIG_ENDIAN AND NOT DEFINED EC_LITTLE_ENDIAN )
+  	test_big_endian( _BIG_ENDIAN )
 
-	check_c_source_runs(
-		 "int compare(unsigned char* a,unsigned char* b) {
-		   while(*a != 0) if (*(b++)!=*(a++)) return 1;
-		   return 0;
-		 }
-		 int main(int argc,char** argv) {
-		   unsigned char dc[]={0x30,0x61,0xDE,0x80,0x93,0x67,0xCC,0xD9,0};
-		   double da=1.23456789e-75;
-		   unsigned char* ca;
+  	if( _BIG_ENDIAN )
+  		set( EC_BIG_ENDIAN    1 )
+  	else()
+  		set( EC_LITTLE_ENDIAN 1 )
+  	endif()
+  endif()
+  ecbuild_cache_var( EC_BIG_ENDIAN )
+  ecbuild_cache_var( EC_LITTLE_ENDIAN )
 
-		   unsigned char fc[]={0x05,0x83,0x48,0x22,0};
-		   float fa=1.23456789e-35;
+  if( NOT DEFINED IEEE_BE )
+  	check_c_source_runs(
+  		 "int compare(unsigned char* a,unsigned char* b) {
+  		   while(*a != 0) if (*(b++)!=*(a++)) return 1;
+  		   return 0;
+  		 }
+  		 int main(int argc,char** argv) {
+  		   unsigned char dc[]={0x30,0x61,0xDE,0x80,0x93,0x67,0xCC,0xD9,0};
+  		   double da=1.23456789e-75;
+  		   unsigned char* ca;
 
-		   if (sizeof(double)!=8) return 1;
+  		   unsigned char fc[]={0x05,0x83,0x48,0x22,0};
+  		   float fa=1.23456789e-35;
 
-		   ca=(unsigned char*)&da;
-		   if (compare(dc,ca)) return 1;
+  		   if (sizeof(double)!=8) return 1;
 
-		   if (sizeof(float)!=4) return 1;
+  		   ca=(unsigned char*)&da;
+  		   if (compare(dc,ca)) return 1;
 
-		   ca=(unsigned char*)&fa;
-		   if (compare(fc,ca)) return 1;
+  		   if (sizeof(float)!=4) return 1;
 
-		   return 0;
-		 }" IEEE_BE )
+  		   ca=(unsigned char*)&fa;
+  		   if (compare(fc,ca)) return 1;
 
-	if( "${IEEE_BE}" STREQUAL "" )
-		set( IEEE_BE 0 CACHE INTERNAL "Test IEEE_BE")
-	endif()
+  		   return 0;
+  		 }" IEEE_BE )
 
-	check_c_source_runs(
-		 "int compare(unsigned char* a,unsigned char* b) {
-		   while(*a != 0) if (*(b++)!=*(a++)) return 1;
-		   return 0;
-		 }
-		 int main(int argc,char** argv) {
-		   unsigned char dc[]={0xD9,0xCC,0x67,0x93,0x80,0xDE,0x61,0x30,0};
-		   double da=1.23456789e-75;
-		   unsigned char* ca;
+  	if( "${IEEE_BE}" STREQUAL "" )
+  		set( IEEE_BE 0 CACHE INTERNAL "Test IEEE_BE")
+  	endif()
+  endif()
+  ecbuild_cache_var( IEEE_BE )
 
-		   unsigned char fc[]={0x22,0x48,0x83,0x05,0};
-		   float fa=1.23456789e-35;
+    if( NOT DEFINED IEEE_LE )
+  	check_c_source_runs(
+  		 "int compare(unsigned char* a,unsigned char* b) {
+  		   while(*a != 0) if (*(b++)!=*(a++)) return 1;
+  		   return 0;
+  		 }
+  		 int main(int argc,char** argv) {
+  		   unsigned char dc[]={0xD9,0xCC,0x67,0x93,0x80,0xDE,0x61,0x30,0};
+  		   double da=1.23456789e-75;
+  		   unsigned char* ca;
 
-		   if (sizeof(double)!=8) return 1;
+  		   unsigned char fc[]={0x22,0x48,0x83,0x05,0};
+  		   float fa=1.23456789e-35;
 
-		   ca=(unsigned char*)&da;
-		   if (compare(dc,ca)) return 1;
+  		   if (sizeof(double)!=8) return 1;
 
-		   if (sizeof(float)!=4) return 1;
+  		   ca=(unsigned char*)&da;
+  		   if (compare(dc,ca)) return 1;
 
-		   ca=(unsigned char*)&fa;
-		   if (compare(fc,ca)) return 1;
+  		   if (sizeof(float)!=4) return 1;
 
-		   return 0;
-		 }" IEEE_LE )
+  		   ca=(unsigned char*)&fa;
+  		   if (compare(fc,ca)) return 1;
 
-	if( "${IEEE_BE}" STREQUAL "" )
-		set( IEEE_LE 0 CACHE INTERNAL "Test IEEE_LE")
-	endif()
+  		   return 0;
+  		 }" IEEE_LE )
 
-	if( EC_BIG_ENDIAN )
-		message( STATUS "system is Big Endian [${EC_BIG_ENDIAN}] IEEE BE [${IEEE_BE}]" )
-	endif()
-	if( EC_LITTLE_ENDIAN )
-		message( STATUS "system is Little Endian [${EC_LITTLE_ENDIAN}] IEEE LE [${IEEE_LE}]" )
-	endif()
+  	if( "${IEEE_BE}" STREQUAL "" )
+  		set( IEEE_LE 0 CACHE INTERNAL "Test IEEE_LE")
+  	endif()
+  endif()
+  ecbuild_cache_var( IEEE_LE )
 
 endif()
 
@@ -321,33 +316,27 @@ if( UNIX )
 
 endif()
 
-### Windows -- are you sure?
+### Cygwin
 
-if( WIN32 )
+if( ${CMAKE_SYSTEM_NAME} MATCHES "CYGWIN" )
 
-	### Cygwin
-
-	if( CYGWIN )
-
-		set( EC_OS_NAME "cygwin" )
-		message( WARNING "Building on Cygwin should work but is untested -- proceed at your own risk" )
-
-	else()
-
-		message( FATAL_ERROR "ecBuild can only build on Windows using Cygwin" )
-
-	endif()
+	set( EC_OS_NAME "cygwin" )
+	message( WARNING "Building on Cygwin should work but is untested" )
 
 endif()
 
 ### final warning / error
 
 if( ${EC_OS_NAME} MATCHES "UNKNOWN" )
+
 	if( DISABLE_OS_CHECK )
-		message( WARNING "ecBuild is untested for this operating system: [${CMAKE_SYSTEM_NAME}]" )
+		message( WARNING "ecBuild is untested for this operating system: [${CMAKE_SYSTEM_NAME}]"
+						 " -- DISABLE_OS_CHECK is ON so proceeding at your own risk ..." )
 	else()
-		message( FATAL_ERROR "ecBuild is untested for this operating system: [${CMAKE_SYSTEM_NAME}]" )
+		message( FATAL_ERROR "ecBuild is untested for this operating system: [${CMAKE_SYSTEM_NAME}]"
+							 " -- refusing to continue. Disable this check with -DDISABLE_OS_CHECK=ON" )
 	endif()
+
 endif()
 
 
diff --git a/cmake/ecbuild_config.h.in b/cmake/ecbuild_config.h.in
index 37172d5..8e68a8e 100644
--- a/cmake/ecbuild_config.h.in
+++ b/cmake/ecbuild_config.h.in
@@ -57,12 +57,11 @@
 #cmakedefine EC_HAVE_SYS_STAT_H
 #cmakedefine EC_HAVE_SYS_TIME_H
 #cmakedefine EC_HAVE_SYS_TYPES_H
-#cmakedefine EC_HAVE_MALLOC_H
-#cmakedefine EC_HAVE_SYS_MALLOC_H
 
 #cmakedefine EC_HAVE_MALLOC_H
 #cmakedefine EC_HAVE_SYS_MALLOC_H
 
+#cmakedefine EC_HAVE_SYS_PARAM_H
 #cmakedefine EC_HAVE_SYS_MOUNT_H
 #cmakedefine EC_HAVE_SYS_VFS_H
 
diff --git a/cmake/ecbuild_declare_project.cmake b/cmake/ecbuild_declare_project.cmake
index 570d04f..57dd1b0 100644
--- a/cmake/ecbuild_declare_project.cmake
+++ b/cmake/ecbuild_declare_project.cmake
@@ -50,9 +50,9 @@ macro( ecbuild_declare_project )
 
 	string( REGEX REPLACE "^([0-9]+).*" "\\1" ${PNAME}_PATCH_VERSION "${${PNAME}_PATCH_VERSION}" )
 
-	set( ${PNAME}_VERSION "${${PNAME}_MAJOR_VERSION}.${${PNAME}_MINOR_VERSION}.${${PNAME}_PATCH_VERSION}" )
+	set( ${PNAME}_VERSION "${${PNAME}_MAJOR_VERSION}.${${PNAME}_MINOR_VERSION}.${${PNAME}_PATCH_VERSION}" CACHE INTERNAL "package ${PNAME} version" )
 
-	set( ${PNAME}_VERSION_STR "${${PROJECT_NAME}_VERSION_STR}" ) # ignore caps
+	set( ${PNAME}_VERSION_STR "${${PROJECT_NAME}_VERSION_STR}" CACHE INTERNAL "package ${PNAME} version string" ) # ignore caps
 
 #    debug_var( ${PNAME}_VERSION )
 #    debug_var( ${PNAME}_VERSION_STR )
@@ -82,6 +82,12 @@ macro( ecbuild_declare_project )
 		set( INSTALL_CMAKE_DIR share/${PROJECT_NAME}/cmake CACHE PATH "Installation directory for CMake files")
 	endif()
 
+		mark_as_advanced( INSTALL_BIN_DIR )
+		mark_as_advanced( INSTALL_LIB_DIR )
+		mark_as_advanced( INSTALL_INCLUDE_DIR )
+		mark_as_advanced( INSTALL_DATA_DIR )
+		mark_as_advanced( INSTALL_CMAKE_DIR )
+
 	# warnings for non-relocatable projects
 
 	foreach( p LIB BIN INCLUDE DATA CMAKE )
@@ -110,15 +116,26 @@ macro( ecbuild_declare_project )
 
 	if( ENABLE_RPATHS )
 
-		file( RELATIVE_PATH relative_rpath ${${PNAME}_FULL_INSTALL_BIN_DIR} ${${PNAME}_FULL_INSTALL_LIB_DIR} )
+		if( ENABLE_RELATIVE_RPATHS )
+
+			file( RELATIVE_PATH relative_rpath ${${PNAME}_FULL_INSTALL_BIN_DIR} ${${PNAME}_FULL_INSTALL_LIB_DIR} )
+			# debug_var( relative_rpath )
 
-#		debug_var( relative_rpath )
+			ecbuild_append_to_rpath( ${relative_rpath} )
 
-		ecbuild_append_to_rpath( ${relative_rpath} )
+		else() # make rpaths absolute
 
+		    if( IS_ABSOLUTE ${INSTALL_LIB_DIR} )
+		        ecbuild_append_to_rpath( "${INSTALL_LIB_DIR}" )
+		    else()
+		        ecbuild_append_to_rpath( "${CMAKE_INSTALL_PREFIX}/${INSTALL_LIB_DIR}" ) 
+		    endif()
+
+		endif()
+    
 	endif()
 
-#	debug_var( CMAKE_INSTALL_RPATH )
+	# debug_var( CMAKE_INSTALL_RPATH )
 
 	# print project header
 
diff --git a/cmake/ecbuild_define_options.cmake b/cmake/ecbuild_define_options.cmake
index f0a7d6e..a79fcf3 100644
--- a/cmake/ecbuild_define_options.cmake
+++ b/cmake/ecbuild_define_options.cmake
@@ -11,15 +11,26 @@
 option( BUILD_SHARED_LIBS       "build shared libraries when possible"            ON  )
 
 option( ENABLE_RPATHS           "when installing insert RPATHS into binaries"     ON  )
+option( ENABLE_RELATIVE_RPATHS  "try to use relative RPATHS, including build dir" ON  )
 option( ENABLE_WARNINGS         "enable compiler warnings"                        OFF )
 
 option( ENABLE_LARGE_FILE_SUPPORT "build with large file support"   ON  )
 
+mark_as_advanced( ENABLE_LARGE_FILE_SUPPORT )
+
 option( ENABLE_OS_TESTS          "Run all OS tests" ON )
 
+mark_as_advanced( ENABLE_OS_TESTS )
+
+option( ENABLE_FORTRAN_C_INTERFACE "Enable Fortran/C Interface" OFF )
+mark_as_advanced( ENABLE_FORTRAN_C_INTERFACE )
+
 option( DEVELOPER_MODE           "activates developer mode"               OFF )
 option( CHECK_UNUSED_FILES       "check for unused project files"         ON )
 
+mark_as_advanced( DEVELOPER_MODE  )
+mark_as_advanced( CHECK_UNUSED_FILES  )
+
 include( CMakeDependentOption ) # make options depend on one another
 
 cmake_dependent_option( ENABLE_OS_TYPES_TEST     "Run sizeof tests on C types" ON "ENABLE_OS_TESTS" OFF)
diff --git a/cmake/ecbuild_define_paths.cmake b/cmake/ecbuild_define_paths.cmake
index 08a92cf..57a3f1a 100644
--- a/cmake/ecbuild_define_paths.cmake
+++ b/cmake/ecbuild_define_paths.cmake
@@ -15,26 +15,18 @@ file( MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/lib )
 
 # setup library building rpaths (both in build dir and then when installed)
 
-set( CMAKE_SKIP_BUILD_RPATH              FALSE ) # use full RPATHs for the build tree
-set( CMAKE_BUILD_WITH_INSTALL_RPATH      FALSE ) # when building, don't use the install RPATH already (but later on when installing)
 set( CMAKE_INSTALL_RPATH_USE_LINK_PATH   TRUE  ) # add the automatic parts to RPATH which point to dirs outside build tree
 
-if( ENABLE_RPATHS )
-    
-    # install with this RPATH 
-    if( IS_ABSOLUTE ${INSTALL_LIB_DIR} )
-        set( CMAKE_INSTALL_RPATH "${INSTALL_LIB_DIR}/lib" )
-    else()
-        set( CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${INSTALL_LIB_DIR}/lib" ) 
-    endif()
-    
-    # the RPATH to be used when installing, but only if it's not a system directory
-    # list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${INSTALL_LIB_DIR}" isSystemDir)
-    # if("${isSystemDir}" STREQUAL "-1")
-    #    set(CMAKE_INSTALL_RPATH "${INSTALL_LIB_DIR}")
-    # endif()
-
-ENDIF()
+# use RPATHs for the build tree
+set( CMAKE_SKIP_BUILD_RPATH              FALSE  )
+
+if( ENABLE_RELATIVE_RPATHS )
+    # when building, use the install RPATH immedietly
+	set( CMAKE_BUILD_WITH_INSTALL_RPATH      TRUE  )
+else()
+    # when building, don't use the install RPATH yet, but later on when installing
+    set( CMAKE_BUILD_WITH_INSTALL_RPATH      FALSE  ) 
+endif()
 
 # Always include srcdir and builddir in include path
 # This saves typing ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
diff --git a/cmake/ecbuild_echo_targets.cmake b/cmake/ecbuild_echo_targets.cmake
new file mode 100644
index 0000000..015192b
--- /dev/null
+++ b/cmake/ecbuild_echo_targets.cmake
@@ -0,0 +1,198 @@
+#
+#
+# FUNCTION ecbuild_echo_targets ( <list-of-targets> )
+#
+#   Writes all possible target properties of the specified list-of-targets.
+#   This is very useful for debugging
+# 
+
+
+function(echo_target_property tgt prop)
+ 
+  cmake_policy(PUSH)
+
+  if( POLICY CMP0026 )
+    cmake_policy( SET CMP0026 OLD)
+  endif()
+
+  # v for value, d for defined, s for set
+  get_property(v TARGET ${tgt} PROPERTY ${prop})
+  get_property(d TARGET ${tgt} PROPERTY ${prop} DEFINED)
+  get_property(s TARGET ${tgt} PROPERTY ${prop} SET)
+ 
+  # only produce output for values that are set
+  #if(s)
+    message("tgt='${tgt}' prop='${prop}'")
+    message("  value='${v}'")
+    message("  defined='${d}'")
+    message("  set='${s}'")
+    message("")
+  #endif()
+
+  cmake_policy(POP)
+
+endfunction()
+ 
+function(echo_target tgt)
+  if(NOT TARGET ${tgt})
+    message("There is no target named '${tgt}'")
+    return()
+  endif()
+ 
+  set(props
+DEBUG_OUTPUT_NAME
+DEBUG_POSTFIX
+RELEASE_OUTPUT_NAME
+RELEASE_POSTFIX
+ARCHIVE_OUTPUT_DIRECTORY
+ARCHIVE_OUTPUT_DIRECTORY_DEBUG
+ARCHIVE_OUTPUT_DIRECTORY_RELEASE
+ARCHIVE_OUTPUT_NAME
+ARCHIVE_OUTPUT_NAME_DEBUG
+ARCHIVE_OUTPUT_NAME_RELEASE
+AUTOMOC
+AUTOMOC_MOC_OPTIONS
+BUILD_WITH_INSTALL_RPATH
+BUNDLE
+BUNDLE_EXTENSION
+COMPILE_DEFINITIONS
+COMPILE_DEFINITIONS_DEBUG
+COMPILE_DEFINITIONS_RELEASE
+COMPILE_FLAGS
+DEBUG_POSTFIX
+RELEASE_POSTFIX
+DEFINE_SYMBOL
+ENABLE_EXPORTS
+EXCLUDE_FROM_ALL
+EchoString
+FOLDER
+FRAMEWORK
+Fortran_FORMAT
+Fortran_MODULE_DIRECTORY
+GENERATOR_FILE_NAME
+GNUtoMS
+HAS_CXX
+IMPLICIT_DEPENDS_INCLUDE_TRANSFORM
+IMPORTED
+IMPORTED_CONFIGURATIONS
+IMPORTED_IMPLIB
+IMPORTED_IMPLIB_DEBUG
+IMPORTED_IMPLIB_RELEASE
+IMPORTED_LINK_DEPENDENT_LIBRARIES
+IMPORTED_LINK_DEPENDENT_LIBRARIES_DEBUG
+IMPORTED_LINK_DEPENDENT_LIBRARIES_RELEASE
+IMPORTED_LINK_INTERFACE_LANGUAGES
+IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG
+IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE
+IMPORTED_LINK_INTERFACE_LIBRARIES
+IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG
+IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE
+IMPORTED_LINK_INTERFACE_MULTIPLICITY
+IMPORTED_LINK_INTERFACE_MULTIPLICITY_DEBUG
+IMPORTED_LINK_INTERFACE_MULTIPLICITY_RELEASE
+IMPORTED_LOCATION
+IMPORTED_LOCATION_DEBUG
+IMPORTED_LOCATION_RELEASE
+IMPORTED_NO_SONAME
+IMPORTED_NO_SONAME_DEBUG
+IMPORTED_NO_SONAME_RELEASE
+IMPORTED_SONAME
+IMPORTED_SONAME_DEBUG
+IMPORTED_SONAME_RELEASE
+IMPORT_PREFIX
+IMPORT_SUFFIX
+INCLUDE_DIRECTORIES
+INSTALL_NAME_DIR
+INSTALL_RPATH
+INSTALL_RPATH_USE_LINK_PATH
+INTERPROCEDURAL_OPTIMIZATION
+INTERPROCEDURAL_OPTIMIZATION_DEBUG
+INTERPROCEDURAL_OPTIMIZATION_RELEASE
+LABELS
+LIBRARY_OUTPUT_DIRECTORY
+LIBRARY_OUTPUT_DIRECTORY_DEBUG
+LIBRARY_OUTPUT_DIRECTORY_RELEASE
+LIBRARY_OUTPUT_NAME
+LIBRARY_OUTPUT_NAME_DEBUG
+LIBRARY_OUTPUT_NAME_RELEASE
+LINKER_LANGUAGE
+LINK_DEPENDS
+LINK_FLAGS
+LINK_FLAGS_DEBUG
+LINK_FLAGS_RELEASE
+LINK_INTERFACE_LIBRARIES
+LINK_INTERFACE_LIBRARIES_DEBUG
+LINK_INTERFACE_LIBRARIES_RELEASE
+LINK_INTERFACE_MULTIPLICITY
+LINK_INTERFACE_MULTIPLICITY_DEBUG
+LINK_INTERFACE_MULTIPLICITY_RELEASE
+LINK_SEARCH_END_STATIC
+LINK_SEARCH_START_STATIC
+LOCATION
+LOCATION_DEBUG
+LOCATION_RELEASE
+MACOSX_BUNDLE
+MACOSX_BUNDLE_INFO_PLIST
+MACOSX_FRAMEWORK_INFO_PLIST
+MAP_IMPORTED_CONFIG_DEBUG
+MAP_IMPORTED_CONFIG_RELEASE
+OSX_ARCHITECTURES
+OSX_ARCHITECTURES_DEBUG
+OSX_ARCHITECTURES_RELEASE
+OUTPUT_NAME
+OUTPUT_NAME_DEBUG
+OUTPUT_NAME_RELEASE
+POST_INSTALL_SCRIPT
+PREFIX
+PRE_INSTALL_SCRIPT
+PRIVATE_HEADER
+PROJECT_LABEL
+PUBLIC_HEADER
+RESOURCE
+RULE_LAUNCH_COMPILE
+RULE_LAUNCH_CUSTOM
+RULE_LAUNCH_LINK
+RUNTIME_OUTPUT_DIRECTORY
+RUNTIME_OUTPUT_DIRECTORY_DEBUG
+RUNTIME_OUTPUT_DIRECTORY_RELEASE
+RUNTIME_OUTPUT_NAME
+RUNTIME_OUTPUT_NAME_DEBUG
+RUNTIME_OUTPUT_NAME_RELEASE
+SKIP_BUILD_RPATH
+SOURCES
+SOVERSION
+STATIC_LIBRARY_FLAGS
+STATIC_LIBRARY_FLAGS_DEBUG
+STATIC_LIBRARY_FLAGS_RELEASE
+SUFFIX
+TYPE
+VERSION
+VS_DOTNET_REFERENCES
+VS_GLOBAL_WHATEVER
+VS_GLOBAL_KEYWORD
+VS_GLOBAL_PROJECT_TYPES
+VS_KEYWORD
+VS_SCC_AUXPATH
+VS_SCC_LOCALPATH
+VS_SCC_PROJECTNAME
+VS_SCC_PROVIDER
+VS_WINRT_EXTENSIONS
+VS_WINRT_REFERENCES
+WIN32_EXECUTABLE
+XCODE_ATTRIBUTE_WHATEVER
+)
+ 
+  message("======================== ${tgt} ========================")
+  foreach(p ${props})
+    echo_target_property("${t}" "${p}")
+  endforeach()
+  message("")
+endfunction()
+ 
+ 
+function(ecbuild_echo_targets)
+  set(tgts ${ARGV})
+  foreach(t ${tgts})
+    echo_target("${t}")
+  endforeach()
+endfunction()
\ No newline at end of file
diff --git a/cmake/ecbuild_enable_fortran.cmake b/cmake/ecbuild_enable_fortran.cmake
index 70ce435..dfb28d4 100644
--- a/cmake/ecbuild_enable_fortran.cmake
+++ b/cmake/ecbuild_enable_fortran.cmake
@@ -25,6 +25,9 @@ macro( ecbuild_enable_fortran )
     enable_language( Fortran )
 
     if( DEFINED _PAR_REQUIRED )
+      if( CMAKE_Fortran_COMPILER_FORCED )
+        set( CMAKE_Fortran_COMPILER_WORKS 1 )
+      endif()
       if( NOT CMAKE_Fortran_COMPILER OR NOT CMAKE_Fortran_COMPILER_WORKS )
           message( FATAL_ERROR "Fortran compiler required by project ${PROJECT_NAME} but does not seem to work" )
       endif()
@@ -32,16 +35,16 @@ macro( ecbuild_enable_fortran )
 
     if( CMAKE_Fortran_COMPILER_LOADED )
         include(CheckFortranFunctionExists)
-		if( CMAKE_C_COMPILER_LOADED )
+		if( CMAKE_C_COMPILER_LOADED AND ENABLE_FORTRAN_C_INTERFACE )
 			include(FortranCInterface)
 		endif()
 		set( EC_HAVE_FORTRAN 1 )
     endif()
 
     if( DEFINED _PAR_MODULE_DIRECTORY )
-        set( CMAKE_Fortran_MODULE_DIRECTORY  ${_PAR_MODULE_DIRECTORY} CACHE PATH "directory for all fortran modules." )
+        set( CMAKE_Fortran_MODULE_DIRECTORY  ${_PAR_MODULE_DIRECTORY} )
     else()
-        set( CMAKE_Fortran_MODULE_DIRECTORY  ${PROJECT_BINARY_DIR}/fortran CACHE PATH "directory for all fortran modules." )
+        set( CMAKE_Fortran_MODULE_DIRECTORY  ${CMAKE_BINARY_DIR}/module CACHE PATH "directory for all fortran modules." )
     endif()
 
 	file( MAKE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} )
diff --git a/cmake/ecbuild_find_fortranlibs.cmake b/cmake/ecbuild_find_fortranlibs.cmake
index 8d1ea36..b40a5eb 100644
--- a/cmake/ecbuild_find_fortranlibs.cmake
+++ b/cmake/ecbuild_find_fortranlibs.cmake
@@ -66,7 +66,8 @@ macro( ecbuild_find_fortranlibs )
 
 		### default is to search for gfortran
 
-		if( NOT WITH_PGI_FORTRAN AND NOT WITH_LIBGFORTRAN AND NOT WITH_XL_FORTRAN )
+		if( NOT WITH_PGI_FORTRAN AND NOT WITH_LIBGFORTRAN AND NOT WITH_XL_FORTRAN
+			AND NOT DEFINED PGI_PATH AND NOT DEFINED LIBGFORTRAN_PATH AND NOT DEFINED XLF_PATH )
 			message( WARNING "Finding fortran libs for unspecified Fortran compiler: default search [ gfortran ]" )
 			set( WITH_LIBGFORTRAN 1 )
 		endif()
diff --git a/cmake/ecbuild_find_mpi.cmake b/cmake/ecbuild_find_mpi.cmake
index b617d11..9ed4b3c 100644
--- a/cmake/ecbuild_find_mpi.cmake
+++ b/cmake/ecbuild_find_mpi.cmake
@@ -16,8 +16,8 @@ macro( ecbuild_find_mpi )
     # parse parameters
 
     set( options REQUIRED )
-	set( single_value_args )
-    set( multi_value_args  )
+    set( single_value_args )
+    set( multi_value_args COMPONENTS )
 
     cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}"  ${_FIRST_ARG} ${ARGN} )
 
@@ -26,92 +26,205 @@ macro( ecbuild_find_mpi )
     endif()
 
     # if user defined compilers are MPI compliant, then we use them ...
+    if( NOT DEFINED ECBUILD_FIND_MPI )
+      set( ECBUILD_FIND_MPI TRUE )
+    endif()
+    if( ECBUILD_FIND_MPI )
+
+        # C compiler
+
+        if( CMAKE_C_COMPILER_LOADED AND NOT MPI_C_COMPILER )
+
+            include(CheckCSourceCompiles)
+
+            check_c_source_compiles("
+                #include <mpi.h>
+                int main(int argc, char* argv[])
+                {
+                int rank;
+                MPI_Init(&argc, &argv); 
+                MPI_Comm_rank(MPI_COMM_WORLD, &rank); 
+                MPI_Finalize();
+                return 0;
+                }
+                "
+                C_COMPILER_SUPPORTS_MPI )
+
+            if( C_COMPILER_SUPPORTS_MPI )
+                message( STATUS "C compiler supports MPI -- ${CMAKE_C_COMPILER}" )
+                set( MPI_C_COMPILER ${CMAKE_C_COMPILER} )
+            endif()
+
+        endif()
+
+        # CXX compiler
+
+        if( CMAKE_CXX_COMPILER_LOADED AND NOT MPI_CXX_COMPILER )
+
+            include(CheckCXXSourceCompiles)
+
+            check_cxx_source_compiles("
+                #include <mpi.h>
+                 #include <iostream>
+                 int main(int argc, char* argv[])
+                 {
+                   MPI_Init(&argc, &argv); int rank; MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Finalize();
+                   return 0;
+                 }
+                 "
+                 CXX_COMPILER_SUPPORTS_MPI )
+
+            if( CXX_COMPILER_SUPPORTS_MPI )
+                message( STATUS "C++ compiler supports MPI -- ${CMAKE_CXX_COMPILER}" )
+                set( MPI_CXX_COMPILER ${CMAKE_CXX_COMPILER} )
+            endif()
+
+        endif()
+
+        # Fortran compiler
+
+        if( CMAKE_Fortran_COMPILER_LOADED AND NOT MPI_Fortran_COMPILER )
+
+            include(CheckFortranSourceCompiles)
+
+            check_fortran_source_compiles("
+                program main
+                use MPI
+                integer ierr
+                call MPI_INIT( ierr )
+                call MPI_FINALIZE( ierr )
+                end
+                "
+            Fortran_COMPILER_SUPPORTS_MPI )
+
+            if( Fortran_COMPILER_SUPPORTS_MPI )
+                message( STATUS "Fortran compiler supports MPI (F90) -- ${CMAKE_Fortran_COMPILER}" )
+                set( MPI_Fortran_COMPILER ${CMAKE_Fortran_COMPILER} )
+                set( MPI_Fortran_FOUND TRUE )
+            endif()
+
+        endif()
+
+        if( NOT _PAR_REQUIRED )
+            find_package( MPI QUIET )
+        else()
+            find_package( MPI QUIET REQUIRED )
+        endif()
+
+        if( C_COMPILER_SUPPORTS_MPI )
+            set( MPI_C_FOUND TRUE )
+        endif()
+        if( CXX_COMPILER_SUPPORTS_MPI )
+            set( MPI_CXX_FOUND TRUE )
+        endif()
+        if( Fortran_COMPILER_SUPPORTS_MPI )
+            set( MPI_Fortran_FOUND TRUE )
+        endif()
+
+    else()
+
+        # find_package with Cray compiler did not send MPI_<lang>_FOUND
+        if( CMAKE_C_COMPILER_LOADED )
+            set( C_COMPILER_SUPPORTS_MPI TRUE )
+            set( MPI_C_FOUND TRUE )
+        endif()
+        if( CMAKE_CXX_COMPILER_LOADED )
+            set( CXX_COMPILER_SUPPORTS_MPI TRUE )
+            set( MPI_CXX_FOUND TRUE )
+        endif()
+        if( CMAKE_Fortran_COMPILER_LOADED )
+            set( Fortran_COMPILER_SUPPORTS_MPI TRUE )
+            set( MPI_Fortran_FOUND TRUE )
+        endif()
+
+    endif( ECBUILD_FIND_MPI )
 
-	# C compiler
+    # hide these variables from UI
 
-	if( CMAKE_C_COMPILER_LOADED AND NOT MPI_C_COMPILER )
+    mark_as_advanced( MPI_LIBRARY MPI_EXTRA_LIBRARY )
 
-		include(CheckCSourceCompiles)
+    if( NOT _PAR_COMPONENTS )
+      set( _PAR_COMPONENTS C )
+    endif()
 
-		check_c_source_compiles("
-			#include <mpi.h>
-			int main(int argc, char* argv[])
-			{
-			int rank;
-			MPI_Init(&argc, &argv); 
-			MPI_Comm_rank(MPI_COMM_WORLD, &rank); 
-			MPI_Finalize();
-			return 0;
-			}
-			"
-		    C_COMPILER_SUPPORTS_MPI )
+    set( MPI_FOUND TRUE )
+    foreach( _lang ${_PAR_COMPONENTS} )
+      if( NOT MPI_${_lang}_FOUND )
+        set( MPI_FOUND FALSE )
+      endif()
+    endforeach()
 
-		if( C_COMPILER_SUPPORTS_MPI )
-			message( STATUS "C compiler supports MPI -- ${CMAKE_C_COMPILER}" )
-			set( MPI_C_COMPILER ${CMAKE_C_COMPILER} )
-		endif()
+endmacro( ecbuild_find_mpi )
 
-    endif()
 
-	# CXX compiler
+macro( ecbuild_enable_mpi )
 
-	if( CMAKE_CXX_COMPILER_LOADED AND NOT MPI_CXX_COMPILER )
+    set( options REQUIRED )
+    set( single_value_args )
+    set( multi_value_args COMPONENTS )
 
-		include(CheckCXXSourceCompiles)
+    cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}"  ${_FIRST_ARG} ${ARGN} )
 
-		check_cxx_source_compiles("
-			#include <mpi.h>
-			 #include <iostream>
-		     int main(int argc, char* argv[])
-		     {
-		       MPI_Init(&argc, &argv); int rank; MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Finalize();
-		       return 0;
-		     }
-		     "
-		     CXX_COMPILER_SUPPORTS_MPI )
+    if(_PAR_UNPARSED_ARGUMENTS)
+        message(FATAL_ERROR "Unknown keywords given to ecbuild_find_mpi(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
+    endif()
 
-		if( CXX_COMPILER_SUPPORTS_MPI )
-			message( STATUS "C++ compiler supports MPI -- ${CMAKE_CXX_COMPILER}" )
-			set( MPI_CXX_COMPILER ${CMAKE_CXX_COMPILER} )
-		endif()
+    if( NOT _PAR_COMPONENTS )
+      set (_PAR_COMPONENTS C )
+    endif()
 
+    if( NOT _PAR_REQUIRED )
+       ecbuild_find_mpi( COMPONENTS ${_PAR_COMPONENTS} )
+    else()
+       ecbuild_find_mpi( COMPONENTS ${_PAR_COMPONENTS} REQUIRED )
     endif()
 
-	# Fortran compiler
+    if( MPI_C_FOUND AND NOT C_COMPILER_SUPPORTS_MPI )
+        cmake_add_c_flags("${MPI_C_COMPILE_FLAGS}")
+        include_directories(${MPI_C_INCLUDE_PATH})
+    endif()
 
-	if( CMAKE_Fortran_COMPILER_LOADED AND NOT MPI_Fortran_COMPILER )
+    if( MPI_CXX_FOUND AND NOT CXX_COMPILER_SUPPORTS_MPI )
+        cmake_add_cxx_flags("${MPI_CXX_COMPILE_FLAGS}")
+        include_directories(${MPI_CXX_INCLUDE_PATH})
+    endif()
 
-		include(CheckFortranSourceCompiles)
+    if( MPI_Fortran_FOUND AND NOT Fortran_COMPILER_SUPPORTS_MPI )
+        include(ecbuild_check_fortran_source)
+        cmake_add_fortran_flags("${MPI_Fortran_COMPILE_FLAGS}")
+        include_directories(${MPI_Fortran_INCLUDE_PATH})
+    endif()
 
-		check_fortran_source_compiles("
-			program main
-			use MPI
-			integer ierr
-			call MPI_INIT( ierr )
-			call MPI_FINALIZE( ierr )
-			end
-			"
-		Fortran_COMPILER_SUPPORTS_MPI )
+endmacro( ecbuild_enable_mpi )
 
-		if( Fortran_COMPILER_SUPPORTS_MPI )
-			message( STATUS "Fortran compiler supports MPI (F90) -- ${CMAKE_Fortran_COMPILER}" )
-			set( MPI_Fortran_COMPILER ${CMAKE_Fortran_COMPILER} )
-			set( MPI_Fortran_FOUND TRUE )
-		endif()
+macro( ecbuild_include_mpi )
 
-    endif()
+    set( options )
+    set( single_value_args )
+    set( multi_value_args )
 
-    # canonical MPI search
+    cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}"  ${_FIRST_ARG} ${ARGN} )
 
-	find_package( MPI )
+    if(_PAR_UNPARSED_ARGUMENTS)
+        message(FATAL_ERROR "Unknown keywords given to ecbuild_find_mpi(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
+    endif()
 
-    # hide these variables from UI
+    if( MPI_C_FOUND AND NOT C_COMPILER_SUPPORTS_MPI )
+        include( ecbuild_check_c_source )
+        cmake_add_c_flags("${MPI_C_COMPILE_FLAGS}")
+        include_directories(${MPI_C_INCLUDE_PATH})
+    endif()
 
-    mark_as_advanced( MPI_LIBRARY MPI_EXTRA_LIBRARY )
+    if( MPI_CXX_FOUND AND NOT CXX_COMPILER_SUPPORTS_MPI )
+        include( ecbuild_check_cxx_source )
+        cmake_add_cxx_flags("${MPI_CXX_COMPILE_FLAGS}")
+        include_directories(${MPI_CXX_INCLUDE_PATH})
+    endif()
 
-    # find_package with Cray compiler did not send MPI_Fortran_FOUND
-    if( Fortran_COMPILER_SUPPORTS_MPI )
-    	set( MPI_Fortran_FOUND TRUE )
+    if( MPI_Fortran_FOUND AND NOT Fortran_COMPILER_SUPPORTS_MPI )
+        include( ecbuild_check_fortran_source )
+        cmake_add_fortran_flags("${MPI_Fortran_COMPILE_FLAGS}")
+        include_directories(${MPI_Fortran_INCLUDE_PATH})
     endif()
 
-endmacro( ecbuild_find_mpi )
+endmacro( ecbuild_include_mpi )
diff --git a/cmake/ecbuild_find_omp.cmake b/cmake/ecbuild_find_omp.cmake
new file mode 100644
index 0000000..86ab139
--- /dev/null
+++ b/cmake/ecbuild_find_omp.cmake
@@ -0,0 +1,204 @@
+# (C) Copyright 1996-2014 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 adding a test
+##############################################################################
+
+macro( lookup_omp_flags )
+  set(_OMP_FLAG_GNU        "-fopenmp")
+  set(_OMPSTUBS_FLAG_GNU   "-fno-openmp")
+
+  set(_OMP_FLAG_Cray       "-homp")
+  set(_OMPSTUBS_FLAG_Cray  "-hnoomp")
+
+  set(_OMP_FLAG_XL         "-qsmp=omp")
+  set(_OMPSTUBS_FLAG_XL    "-qsmp=noomp")
+
+  set(_OMP_FLAG_Intel      "-openmp")
+  set(_OMPSTUBS_FLAG_Intel "-openmp-stubs")
+
+  # sample C openmp source code to test
+  set(_OMP_C_TEST_SOURCE
+  "
+  #include <omp.h>
+  int main() {
+  #ifdef _OPENMP
+    #pragma omp parallel
+    {
+      int id = omp_get_thread_num();
+    }
+    return 0;
+  #else
+    breaks_on_purpose
+  #endif
+  }
+  ")
+  set( _OMP_CXX_TEST_SOURCE ${_OMP_C_TEST_SOURCE} )
+
+
+  # sample C openmp source code to test
+  set(_OMPSTUBS_C_TEST_SOURCE
+  "
+  // Include must be found
+  #include <omp.h>
+  int main() {
+  #ifdef _OPENMP
+    breaks_on_purpose
+  #else
+    #pragma omp parallel
+    {
+      // This pragma should have passed compilation
+      int id = 0;
+    }
+    return 0;
+  #endif
+  }
+  ")
+  set( _OMPSTUBS_CXX_TEST_SOURCE ${_OMPSTUBS_C_TEST_SOURCE} )
+
+
+  # sample Fortran openmp source code to test
+  set(_OMP_Fortran_TEST_SOURCE
+  "
+  program main
+    use omp_lib
+  end program
+  ")
+  set( _OMPSTUBS_Fortran_TEST_SOURCE ${_OMP_Fortran_TEST_SOURCE} )
+
+endmacro()
+
+
+# MACRO ecbuild_find_omp
+#
+# ecbuild_find_omp( COMPONENTS C CXX Fortran
+#                   STUBS )
+# Sets following variables
+#   - OMP_FOUND
+#   - OMP_<lang>_FOUND
+#   - OMP_<lang>_FLAGS
+#
+# If STUBS are available, above flags will still hold TRUE,
+# as OMP code will just work.
+#
+macro( ecbuild_find_omp )
+
+  set( options REQUIRED STUBS )
+  set( single_value_args )
+  set( multi_value_args COMPONENTS )
+
+  cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}"  ${_FIRST_ARG} ${ARGN} )
+
+  if( NOT _PAR_COMPONENTS )
+    message( FATAL_ERROR "No COMPONENTS were specified, looking for OMP.\n Please find with COMPONENTS C CXX Fortran " )
+  endif()
+
+  set( _STUBS "" )
+  if( _PAR_STUBS )
+    set( _STUBS "STUBS" )
+  endif()
+
+  lookup_omp_flags()
+
+  set( OMP${_STUBS}_FOUND TRUE )
+
+  foreach( _LANG ${_PAR_COMPONENTS} )
+
+    if( NOT OMP${_STUBS}_${_LANG}_FLAGS )
+
+      if( DEFINED _OMP${_STUBS}_FLAG_${CMAKE_${_LANG}_COMPILER_ID} )
+        set( _OMP${_STUBS}_${_LANG}_FLAG "${_OMP${_STUBS}_FLAG_${CMAKE_${_LANG}_COMPILER_ID}}" )
+      endif()
+      if( CMAKE_${_LANG}_COMPILER_LOADED AND _OMP${_STUBS}_${_LANG}_FLAG )
+        set(SAVE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
+        set(CMAKE_REQUIRED_FLAGS "${_OMP${_STUBS}_${_LANG}_FLAG}")
+        include(Check${_LANG}SourceCompiles)
+        set( _SOURCE ${_OMP${_STUBS}_${_LANG}_TEST_SOURCE} )
+        set( _FLAG ${_LANG}_COMPILER_SUPPORTS_OMP${_STUBS})
+        if( _LANG STREQUAL "C" )
+          check_c_source_compiles("${_SOURCE}" ${_FLAG} )
+        endif()
+        if( _LANG STREQUAL "CXX" )
+          check_cxx_source_compiles("${_SOURCE}" ${_FLAG} )
+        endif()
+        if( _LANG STREQUAL "Fortran" )
+          check_fortran_source_compiles("${_SOURCE}" ${_FLAG} )
+        endif()
+        set(CMAKE_REQUIRED_FLAGS "${SAVE_CMAKE_REQUIRED_FLAGS}")
+      endif()
+
+      if( ${_LANG}_COMPILER_SUPPORTS_OMP${_STUBS} )
+        set( OMP${_STUBS}_${_LANG}_FLAGS ${_OMP${_STUBS}_${_LANG}_FLAG} )
+      endif()
+
+    else()
+      set( ${_LANG}_COMPILER_SUPPORTS_OMP${_STUBS} TRUE )
+    endif()
+
+
+    set( OMP${_STUBS}_${_LANG}_FIND_QUIETLY TRUE )
+    find_package_handle_standard_args( OMP${_STUBS}_${_LANG} REQUIRED_VARS ${_LANG}_COMPILER_SUPPORTS_OMP${_STUBS}  )
+
+    if( OMP${_STUBS}_FORTRAN_FOUND )
+      set( OMP${_STUBS}_Fortran_FOUND TRUE )
+    endif()
+
+    if( NOT OMP${_STUBS}_${_LANG}_FOUND )
+      set( OMP${_STUBS}_FOUND FALSE )
+    endif()
+
+    if( _PAR_STUBS )
+      set( OMP_${_LANG}_FOUND ${OMPSTUBS_${_LANG}_FOUND} )
+      set( OMP_${_LANG}_FLAGS ${OMPSTUBS_${_LANG}_FLAGS} )
+    endif()
+
+  endforeach()
+
+  if( _PAR_STUBS )
+    set( OMP_FOUND ${OMPSTUBS_FOUND} )
+  endif()
+
+endmacro( ecbuild_find_omp )
+
+
+macro( ecbuild_enable_omp )
+
+  ecbuild_find_omp( COMPONENTS C CXX Fortran )
+
+  if( OMP_C_FOUND )
+    set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OMP_C_FLAGS}" )
+  endif()
+
+  if( OMP_CXX_FOUND )
+    set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OMP_CXX_FLAGS}" )
+  endif()
+
+  if( OMP_Fortran_FOUND )
+    set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${OMP_Fortran_FLAGS}" )
+  endif()
+
+endmacro( ecbuild_enable_omp )
+
+macro( ecbuild_enable_ompstubs )
+
+  ecbuild_find_omp( COMPONENTS C CXX Fortran STUBS )
+
+  if( OMPSTUBS_C_FOUND )
+    set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OMPSTUBS_C_FLAGS}" )
+  endif()
+
+  if( OMPSTUBS_CXX_FOUND )
+    set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OMPSTUBS_CXX_FLAGS}" )
+  endif()
+
+  if( OMPSTUBS_Fortran_FOUND )
+    set( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${OMPSTUBS_Fortran_FLAGS}" )
+  endif()
+
+endmacro( ecbuild_enable_ompstubs )
diff --git a/cmake/ecbuild_find_package.cmake b/cmake/ecbuild_find_package.cmake
index 95a2126..e6cea19 100644
--- a/cmake/ecbuild_find_package.cmake
+++ b/cmake/ecbuild_find_package.cmake
@@ -50,7 +50,7 @@ macro( ecbuild_find_package )
 
 	# search user defined paths first
 
-	if( ${_PAR_NAME}_PATH OR ${PNAME}_PATH )
+	if( ${_PAR_NAME}_PATH OR ${PNAME}_PATH OR ${_PAR_NAME}_DIR OR ${PNAME}_DIR )
 
 		# debug_var( ${_PAR_NAME}_PATH )
 		# debug_var( ${PNAME}_PATH )
@@ -58,7 +58,9 @@ macro( ecbuild_find_package )
 		# 1) search using CONFIG mode -- try to locate a configuration file provided by the package (package-config.cmake)
 
 		if( NOT ${_PAR_NAME}_FOUND )
-			find_package( ${_PAR_NAME} ${_${PNAME}_version} NO_MODULE QUIET HINTS ${${PNAME}_PATH} ${_PAR_NAME}_PATH NO_DEFAULT_PATH )
+			find_package( ${_PAR_NAME} ${_${PNAME}_version} NO_MODULE QUIET
+                HINTS ${${PNAME}_PATH} ${_PAR_NAME}_PATH ${${PNAME}_DIR} ${${_PAR_NAME}_DIR}
+                NO_DEFAULT_PATH )
 		endif()
 
 		# 2) search using a file Find<package>.cmake if it exists ( macro should itself take *_PATH into account )
@@ -74,7 +76,7 @@ macro( ecbuild_find_package )
 				message( FATAL_ERROR "${_PAR_NAME}_PATH was provided by user but package ${_PAR_NAME} wasn't found" )
 			endif()
 			if( ${PNAME}_PATH )
-				message( FATAL_ERROR "${PNAME}_PATH was provided by user but package ${PNAME} wasn't found" )
+				message( FATAL_ERROR "${PNAME}_PATH was provided by user but package ${_PAR_NAME} wasn't found" )
 			endif()
 		endif()
 
@@ -130,19 +132,23 @@ macro( ecbuild_find_package )
             if( ${_PAR_NAME}_VERSION )
                 if( _PAR_EXACT )
                     if( NOT ${_PAR_NAME}_VERSION VERSION_EQUAL _PAR_VERSION )
-                        message( STATUS "${PROJECT_NAME} requires (exactly) ${_PAR_NAME} = ${_PAR_VERSION} -- found ${${_PAR_NAME}_VERSION}" )
+                        message( WARNING "${PROJECT_NAME} requires (exactly) ${_PAR_NAME} = ${_PAR_VERSION} -- found ${${_PAR_NAME}_VERSION}" )
                         set( _version_acceptable 0 )
                     endif()
                 else()
                     if( _PAR_VERSION VERSION_LESS ${_PAR_NAME}_VERSION OR _PAR_VERSION VERSION_EQUAL ${_PAR_NAME}_VERSION )
                         set( _version_acceptable 1 )
                     else()
-                        message( WARNING "${PROJECT_NAME} requires ${_PAR_NAME} >= ${_PAR_VERSION} -- found ${${_PAR_NAME}_VERSION}" )
+                        if( NOT _PAR_QUIET )
+                            message( WARNING "${PROJECT_NAME} requires ${_PAR_NAME} >= ${_PAR_VERSION} -- found ${${_PAR_NAME}_VERSION}" )
+                        endif()
                         set( _version_acceptable 0 )
                     endif()
                 endif()
             else()
-                message( WARNING "${PROJECT_NAME} found ${_PAR_NAME} but no version information, so cannot check if satisfies ${_PAR_VERSION}" )
+                if( NOT _PAR_QUIET )
+                    message( WARNING "${PROJECT_NAME} found ${_PAR_NAME} but no version information, so cannot check if satisfies ${_PAR_VERSION}" )
+                endif()
                 set( _version_acceptable 0 )
             endif()
         endif()
@@ -153,6 +159,9 @@ macro( ecbuild_find_package )
         if( _version_acceptable )
             set( ${PNAME}_FOUND ${${_PAR_NAME}_FOUND} )
         else()
+            if( NOT _PAR_QUIET )
+                message( WARNING "${PROJECT_NAME} found ${_PAR_NAME} but with unsuitable version" )
+            endif()
             set( ${PNAME}_FOUND 0 )
             set( ${_PAR_NAME}_FOUND 0 )
         endif()
@@ -162,11 +171,19 @@ macro( ecbuild_find_package )
 	### final messages
 
 	if( NOT ${_PAR_NAME}_FOUND )
-		if( NOT _PAR_QUIET )
-			message( WARNING "FAILED to find package ${_PAR_NAME}" )
-		endif()
 		if( _PAR_REQUIRED )
-			message( FATAL_ERROR "${PROJECT_NAME} requires package ${_PAR_NAME} but no suitable version was found" )
+			message( FATAL_ERROR
+              "    ${PROJECT_NAME} FAILED to find REQUIRED package ${_PAR_NAME}"
+              "    Provide location with \"-D ${PNAME}_DIR=/...\"\n"
+              "    or export ${PNAME}_DIR in environment"
+            )
+		else()
+			if( NOT _PAR_QUIET )
+				message( STATUS
+                      "${PROJECT_NAME} couldn't find package ${_PAR_NAME}.\n"
+                      "      Provide location with \"-D ${PNAME}_DIR=/...\"\n"
+                      "      or export ${PNAME}_DIR in environment" )
+			endif()
 		endif()
 	endif()
 
diff --git a/cmake/ecbuild_get_date.cmake b/cmake/ecbuild_get_date.cmake
index 4db2e84..afe3d09 100644
--- a/cmake/ecbuild_get_date.cmake
+++ b/cmake/ecbuild_get_date.cmake
@@ -26,7 +26,7 @@ macro(ecbuild_get_timestamp RESULT)
         execute_process(COMMAND "date" "+%Y/%m/%d/%H/%M/%S" OUTPUT_VARIABLE _timestamp)
         string(REGEX REPLACE "(....)/(..)/(..)/(..)/(..)/(..).*" "\\1\\2\\3\\4\\5\\6" ${RESULT} ${_timestamp})
     else()
-        message(SEND_ERROR "timestamp not implemented")
+        message(WARNING "This is NOT UNIX - timestamp not implemented")
     endif()
 endmacro(ecbuild_get_timestamp)
 
diff --git a/cmake/ecbuild_get_test_data.cmake b/cmake/ecbuild_get_test_data.cmake
index d5c7345..b617a7d 100644
--- a/cmake/ecbuild_get_test_data.cmake
+++ b/cmake/ecbuild_get_test_data.cmake
@@ -22,8 +22,9 @@ function( _download_test_data _p_NAME _p_DIRNAME )
 
     if( CURL_PROGRAM )
 
-        add_custom_command( OUTPUT ${_p_NAME}
-            COMMAND ${CURL_PROGRAM} --silent --show-error --fail --output ${_p_NAME} http://download.ecmwf.org/test-data/${_p_DIRNAME}/${_p_NAME} )
+		add_custom_command( OUTPUT ${_p_NAME}
+			COMMENT "(curl) downloading http://download.ecmwf.org/test-data/${_p_DIRNAME}/${_p_NAME}"
+			COMMAND ${CURL_PROGRAM} --silent --show-error --fail --output ${_p_NAME} http://download.ecmwf.org/test-data/${_p_DIRNAME}/${_p_NAME} )
 
     else()
 
@@ -31,8 +32,17 @@ function( _download_test_data _p_NAME _p_DIRNAME )
 
         if( WGET_PROGRAM )
 
-           add_custom_command( OUTPUT ${_p_NAME}
-               COMMAND ${WGET_PROGRAM} -nv --fail -O ${_p_NAME} http://download.ecmwf.org/test-data/${_p_DIRNAME}/${_p_NAME} )
+				 add_custom_command( OUTPUT ${_p_NAME}
+						COMMENT "(wget) downloading http://download.ecmwf.org/test-data/${_p_DIRNAME}/${_p_NAME}"
+						COMMAND ${WGET_PROGRAM} -nv -O ${_p_NAME} http://download.ecmwf.org/test-data/${_p_DIRNAME}/${_p_NAME} )
+
+				else()
+
+					if( WARNING_CANNOT_DOWNLOAD_TEST_DATA )
+						message( WARNING "Couldn't find curl neither wget -- cannot download test data from server.\nPlease obtain the test data by other means and pleace it in the build directory." )
+						set( WARNING_CANNOT_DOWNLOAD_TEST_DATA 1 CACHE INTERNAL "Couldn't find curl neither wget -- cannot download test data from server" )
+						mark_as_advanced( WARNING_CANNOT_DOWNLOAD_TEST_DATA )
+					endif()
 
         endif()
 
@@ -55,7 +65,7 @@ endfunction()
 ## checksum agains local md5
 #    ecbuild_get_test_data( NAME msl.grib MD5 f69ca0929d1122c7878d19f32401abe9 )
 #
-## checksum agains local sha1
+## (DEPRECATED) checksum agains local sha1
 #    ecbuild_get_test_data( NAME msl.grib SHA1 5a8e8c57c510b64e31863ca47cfc3b65971089d9 )
 
 function( ecbuild_get_test_data )
@@ -110,14 +120,16 @@ function( ecbuild_get_test_data )
 #            message( STATUS " ---  getting MD5 sum " )
 
             add_custom_command( OUTPUT ${_p_NAME}.localmd5
-                                COMMAND md5sum ${_p_NAME} > ${_p_NAME}.localmd5 )
-
-            add_custom_command(	OUTPUT ${_p_NAME}.ok
-                                COMMAND diff ${_p_NAME}.md5 ${_p_NAME}.localmd5 && touch ${_p_NAME}.ok )
+                                COMMAND ${MD5SUM} -t ${_p_NAME} > ${_p_NAME}.localmd5
+                                DEPENDS ${_p_NAME} )
 
             _download_test_data( ${_p_NAME}.md5 ${_p_DIRNAME} )
 
-            list( APPEND _deps ${_p_NAME}.md5 ${_p_NAME}.localmd5 ${_p_NAME}.ok )
+            add_custom_command(	OUTPUT ${_p_NAME}.ok
+                                COMMAND diff ${_p_NAME}.md5 ${_p_NAME}.localmd5 && touch ${_p_NAME}.ok
+                                DEPENDS ${_p_NAME}.localmd5 ${_p_NAME}.md5 )
+
+            list( APPEND _deps  ${_p_NAME}.localmd5 ${_p_NAME}.ok )
 
         endif()
 
@@ -126,38 +138,134 @@ function( ecbuild_get_test_data )
 #            message( STATUS " ---  computing MD5 sum [${_p_MD5}]" )
 
             add_custom_command( OUTPUT ${_p_NAME}.localmd5
-                                COMMAND ${MD5SUM} ${_p_NAME} > ${_p_NAME}.localmd5 )
-
-            add_custom_command( OUTPUT ${_p_NAME}.ok
-                                COMMAND diff ${_p_NAME}.md5 ${_p_NAME}.localmd5 && touch ${_p_NAME}.ok )
+                                COMMAND ${MD5SUM} -t ${_p_NAME} > ${_p_NAME}.localmd5
+                                DEPENDS ${_p_NAME} )
 
             configure_file( "${ECBUILD_MACROS_DIR}/md5.in" ${_p_NAME}.md5 @ONLY )
 
+            add_custom_command( OUTPUT ${_p_NAME}.ok
+                                COMMAND diff ${_p_NAME}.md5 ${_p_NAME}.localmd5 && touch ${_p_NAME}.ok
+                                DEPENDS ${_p_NAME}.localmd5 )
+
             list( APPEND _deps ${_p_NAME}.localmd5 ${_p_NAME}.ok )
 
         endif()
 
-        if( _p_SHA1 )
+#        if( _p_SHA1 )
 
-            message( STATUS " ---  computing SHA1 sum [${_p_SHA1}]" )
+##            message( STATUS " ---  computing SHA1 sum [${_p_SHA1}]" )
 
-            find_program( SHASUM NAMES sha1sum shasum )
-            if( SHASUM )
-                add_custom_command( OUTPUT ${_p_NAME}.localsha1
-                                    COMMAND ${SHASUM} ${_p_NAME} > ${_p_NAME}.localsha1 )
+#            find_program( SHASUM NAMES sha1sum shasum )
+#            if( SHASUM )
+#                add_custom_command( OUTPUT ${_p_NAME}.localsha1
+#                                    COMMAND ${SHASUM} ${_p_NAME} > ${_p_NAME}.localsha1 )
 
-                add_custom_command( OUTPUT ${_p_NAME}.ok
-                                    COMMAND diff ${_p_NAME}.sha1 ${_p_NAME}.localsha1 && touch ${_p_NAME}.ok )
+#                add_custom_command( OUTPUT ${_p_NAME}.ok
+#                                    COMMAND diff ${_p_NAME}.sha1 ${_p_NAME}.localsha1 && touch ${_p_NAME}.ok )
 
-                configure_file( "${ECBUILD_MACROS_DIR}/sha1.in" ${_p_NAME}.sha1 @ONLY )
+#                configure_file( "${ECBUILD_MACROS_DIR}/sha1.in" ${_p_NAME}.sha1 @ONLY )
 
-                list( APPEND _deps ${_p_NAME}.localsha1 ${_p_NAME}.ok )
-            endif()
+#                list( APPEND _deps ${_p_NAME}.localsha1 ${_p_NAME}.ok )
+#            endif()
 
-        endif()
+#        endif()
 
     endif()
 
     add_custom_target( ${_p_TARGET} DEPENDS ${_deps} )
 
 endfunction(ecbuild_get_test_data)
+
+##############################################################################
+# function for getting test data
+#
+# examples:
+#
+## no check done
+#    ecbuild_get_test_multidata( TARGET get_foobar_data NAMES foo.grib bar.grib DIRNAME test/data/dir NOCHECK )
+#
+## check for remote md5
+#    ecbuild_get_test_multidata( TARGET get_foobar_data NAMES foo.grib bar.grib DIRNAME test/data/dir )
+#
+
+function( ecbuild_get_test_multidata )
+
+    set( options NOCHECK )
+    set( single_value_args TARGET DIRNAME )
+    set( multi_value_args  NAMES )
+
+    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_get_test_data(): \"${_p_UNPARSED_ARGUMENTS}\"")
+    endif()
+
+    ### check parameters
+
+    if( NOT _p_NAMES )
+      message(FATAL_ERROR "ecbuild_get_test_data() expects a NAMES")
+    endif()
+
+    if( NOT _p_TARGET )
+      message(FATAL_ERROR "ecbuild_get_test_data() expects a TARGET")
+    endif()
+
+#    debug_var( _p_TARGET )
+#    debug_var( _p_NAME )
+#    debug_var( _p_DIRNAME )
+
+    if( _p_NOCHECK )
+        set( _nocheck NOCHECK )
+    endif()
+
+    ### prepare file
+
+    set( _script ${CMAKE_CURRENT_BINARY_DIR}/get_data_${_p_TARGET}.cmake )
+
+    file( WRITE ${_script} "
+function(EXEC_CHECK)
+     execute_process(COMMAND \${ARGV} RESULT_VARIABLE CMD_RESULT)
+     if(CMD_RESULT)
+           message(FATAL_ERROR \"Error running ${CMD}\")
+     endif()
+endfunction()\n\n" )
+
+    foreach( _d ${_p_NAMES} )
+
+        string( REGEX MATCH "[^:]+" _f "${_d}" )
+
+        get_filename_component( _file ${_f} NAME )
+        get_filename_component( _dir  ${_f} PATH )
+
+        list( APPEND _path_comps ${_p_DIRNAME} ${_dir} )
+
+        join( _path_comps "/" _dirname )
+
+        if( _dirname )
+            set( _dirname DIRNAME ${_dirname} )
+        endif()
+
+        string( REPLACE "." "_" _name "${_file}" )
+        string( REGEX MATCH ":.*"  _md5  "${_d}" )
+        string( REPLACE ":" "" _md5 "${_md5}" )
+
+        if( _md5 )
+            set( _md5 MD5 ${_md5} )
+        endif()
+
+        #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} NAME ${_file} ${_dirname} ${_md5} ${_nocheck} )
+
+        file( APPEND ${_script} "exec_check( ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target __get_data_${_p_TARGET}_${_name} )\n" )
+
+    endforeach()
+
+    add_test(  NAME ${_p_TARGET} COMMAND ${CMAKE_COMMAND} -P ${_script} )
+
+endfunction(ecbuild_get_test_multidata)
+
diff --git a/cmake/ecbuild_install_package.cmake b/cmake/ecbuild_install_package.cmake
index d0df710..dec046f 100644
--- a/cmake/ecbuild_install_package.cmake
+++ b/cmake/ecbuild_install_package.cmake
@@ -32,11 +32,11 @@ macro( ecbuild_install_project )
     
     # components
 
-#    if( DEFINED _PAR_COMPONENTS )
-#        set(CPACK_COMPONENTS_ALL   "${_PAR_COMPONENTS}")
-#    else()
-#        set(CPACK_COMPONENTS_ALL   "${PROJECT_NAME}")
-#    endif()
+    #    if( DEFINED _PAR_COMPONENTS )
+    #        set(CPACK_COMPONENTS_ALL   "${_PAR_COMPONENTS}")
+    #    else()
+    #        set(CPACK_COMPONENTS_ALL   "${PROJECT_NAME}")
+    #    endif()
     
     # name, version, etc ...
 
@@ -47,10 +47,10 @@ macro( ecbuild_install_project )
 
     set(CPACK_DEBIAN_PACKAGE_MAINTAINER "ECMWF") # required for DEB
 
-#    set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON")
-#    set(CPACK_RPM_COMPONENT_INSTALL "ON")
+    #    set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON")
+    #    set(CPACK_RPM_COMPONENT_INSTALL "ON")
 
-#    set(CPACK_GENERATOR        "TGZ;RPM;DEB")
+    #    set(CPACK_GENERATOR        "TGZ;RPM;DEB")
     set(CPACK_GENERATOR        "TGZ")
     set(CPACK_SOURCE_GENERATOR "TGZ")
     set(CPACK_PACKAGE_VENDOR   "ECMWF")
@@ -68,13 +68,17 @@ macro( ecbuild_install_project )
     if( EXISTS ${PROJECT_SOURCE_DIR}/INSTALL )
         set(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/INSTALL")
     endif()
-    if( EXISTS ${PROJECT_SOURCE_DIR}/LICENSE )
+	if( EXISTS ${PROJECT_SOURCE_DIR}/LICENSE )
         set(CPACK_RESOURCE_FILE_LICENSE    "${PROJECT_SOURCE_DIR}/LICENSE")
     endif()
 
     # set(CPACK_PACKAGE_EXECUTABLES ${ECBUILD_ALL_EXES})
-    
-    # what to pack and not
+
+	list( APPEND CPACK_SOURCE_INSTALLED_DIRECTORIES
+	   "${PROJECT_SOURCE_DIR}" "."
+	   "${ECBUILD_MACROS_DIR}" "cmake/" )
+
+	# what to pack and not
 
     set(CPACK_SOURCE_IGNORE_FILES
         /build/
@@ -97,9 +101,40 @@ macro( ecbuild_install_project )
 
     ### EXPORTS ########################################################
  
+
+    foreach( _tpl ${${PNAME}_TPLS} )
+        string( TOUPPER ${_tpl} _TPL )
+
+        if( ${_tpl}_INCLUDE_DIRS )
+            list( APPEND ${PNAME}_TPL_INCLUDE_DIRS ${${_tpl}_INCLUDE_DIRS} )
+        elseif( ${_tpl}_INCLUDE_DIR )
+            list( APPEND ${PNAME}_TPL_INCLUDE_DIRS ${${_tpl}_INCLUDE_DIR} )
+        elseif( ${_TPL}_INCLUDE_DIRS )
+            list( APPEND ${PNAME}_TPL_INCLUDE_DIRS ${${_TPL}_INCLUDE_DIRS} )
+        elseif( ${_TPL}_INCLUDE_DIR )
+            list( APPEND ${PNAME}_TPL_INCLUDE_DIRS ${${_TPL}_INCLUDE_DIR} )
+        endif()
+
+        if( ${_tpl}_LIBRARIES )
+            list( APPEND ${PNAME}_TPL_LIBRARIES   ${${_tpl}_LIBRARIES} )
+        elseif( ${_tpl}_LIBRARY )
+            list( APPEND ${PNAME}_TPL_LIBRARIES   ${${_tpl}_LIBRARY} )
+        elseif( ${_TPL}_LIBRARIES )
+            list( APPEND ${PNAME}_TPL_LIBRARIES   ${${_TPL}_LIBRARIES} )
+        elseif( ${_TPL}_LIBRARY )
+            list( APPEND ${PNAME}_TPL_LIBRARIES   ${${_TPL}_LIBRARY} )
+        endif()
+
+        if( ${_tpl}_DEFINITIONS )
+            list( APPEND ${PNAME}_TPL_DEFINITIONS ${${_tpl}_DEFINITIONS} )
+        elseif( ${_TPL}_DEFINITIONS )
+            list( APPEND ${PNAME}_TPL_DEFINITIONS ${${_TPL}_DEFINITIONS} )
+        endif()
+    endforeach()
+
     # TOP-LEVEL PROJECT EXPORT
 
-    if( ${PROJECT_NAME} STREQUAL ${CMAKE_PROJECT_NAME} )
+    if( PROJECT_NAME STREQUAL CMAKE_PROJECT_NAME )
 
         # exports the package for use from the build-tree -- inserts <package> into the CMake user package registry
     
@@ -119,11 +154,17 @@ macro( ecbuild_install_project )
     
         set( PACKAGE_VERSION "${${PNAME}_VERSION}" ) 
         
-		configure_file( "${_template_config_version}" "${PROJECT_BINARY_DIR}/${LNAME}-config-version.cmake" @ONLY )
-		install( FILES "${PROJECT_BINARY_DIR}/${LNAME}-config-version.cmake" DESTINATION "${INSTALL_CMAKE_DIR}" )
+        configure_file( "${_template_config_version}" "${PROJECT_BINARY_DIR}/${LNAME}-config-version.cmake" @ONLY )
+
+        install( FILES "${PROJECT_BINARY_DIR}/${LNAME}-config-version.cmake" DESTINATION "${INSTALL_CMAKE_DIR}" )
 
         # prepare imutable variables (don't depend on install path)
-                        
+
+        set( CONF_FEATURES "" )
+        if( ${PNAME}_FEATURES )
+          set( CONF_FEATURES ${${PNAME}_FEATURES} )
+        endif()
+
         set( CONF_LIBRARIES ${${PROJECT_NAME}_ALL_LIBS} )
         if( ${PNAME}_LIBRARIES )
             set( CONF_LIBRARIES ${${PNAME}_LIBRARIES} )
@@ -135,26 +176,10 @@ macro( ecbuild_install_project )
         endif()
 
         set( CONF_TPL_LIBRARIES   "" )
-        set( CONF_TPL_DEFINITIONS "" )
-        foreach( _tpl ${${PNAME}_TPLS} )
-            string( TOUPPER ${_tpl} TPL )
-            if( ${_tpl}_INCLUDE_DIRS )
-                list( APPEND CONF_TPL_LIBRARIES   ${${_tpl}_LIBRARIES} )
-            elseif( ${_tpl}_INCLUDE_DIR )
-                list( APPEND CONF_TPL_LIBRARIES   ${${_tpl}_LIBRARY} )
-            elseif( ${TPL}_LIBRARIES )
-                list( APPEND CONF_TPL_LIBRARIES   ${${TPL}_LIBRARIES} )
-            elseif( ${TPL}_INCLUDE_DIR )
-                list( APPEND CONF_TPL_LIBRARIES   ${${TPL}_LIBRARY} )
-            endif()
+        if( ${PNAME}_TPL_LIBRARIES )
+           set( CONF_TPL_LIBRARIES ${${PNAME}_TPL_LIBRARIES} )
+        endif()
 
-            if( ${_tpl}_DEFINITIONS )
-                list( APPEND CONF_TPL_DEFINITIONS ${${_tpl}_DEFINITIONS} )
-            elseif( ${TPL}_DEFINITIONS )
-                list( APPEND CONF_TPL_DEFINITIONS ${${TPL}_DEFINITIONS} )
-            endif()
-        endforeach()
-   
         # project-config.cmake @ build tree
 
         set( CONF_TPLS ${${PNAME}_TPLS} )
@@ -178,17 +203,18 @@ macro( ecbuild_install_project )
             endif()
         endforeach()
 
-		set( CONF_IMPORT_FILE "${LNAME}-import.cmake" )
-		if( EXISTS "${PROJECT_SOURCE_DIR}/${CONF_IMPORT_FILE}.in" )
-			configure_file( "${PROJECT_SOURCE_DIR}/${CONF_IMPORT_FILE}.in" 
+        set( CONF_IMPORT_FILE "${LNAME}-import.cmake" )
+
+        if( EXISTS "${PROJECT_SOURCE_DIR}/${CONF_IMPORT_FILE}.in" )
+            configure_file( "${PROJECT_SOURCE_DIR}/${CONF_IMPORT_FILE}.in"
                             "${PROJECT_BINARY_DIR}/${CONF_IMPORT_FILE}" @ONLY )
-			install( FILES "${PROJECT_BINARY_DIR}/${CONF_IMPORT_FILE}" 
+            install( FILES "${PROJECT_BINARY_DIR}/${CONF_IMPORT_FILE}"
                      DESTINATION "${INSTALL_CMAKE_DIR}" )
-		endif()
+        endif()
 
         set( _lname_config "${PROJECT_BINARY_DIR}/${LNAME}-config.cmake")
 
-		set( _is_build_dir_export ON )
+        set( _is_build_dir_export ON )
         configure_file( "${_template_config}" "${_lname_config}" @ONLY )
 
         file( REMOVE ${_lname_config}.tpls.in )
@@ -196,17 +222,17 @@ macro( ecbuild_install_project )
         foreach( _tpl ${${PNAME}_TPLS} )
             string( TOUPPER ${_tpl} TPL )
             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" )
+                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" )
             endif()
         endforeach()
 
         if( EXISTS "${_lname_config}.tpls.in" )
             configure_file( "${_lname_config}.tpls.in" "${_lname_config}.tpls" @ONLY )
-			install( FILES "${_lname_config}.tpls" DESTINATION "${INSTALL_CMAKE_DIR}" )
-		endif()
+            install( FILES "${_lname_config}.tpls" DESTINATION "${INSTALL_CMAKE_DIR}" )
+        endif()
 
         # project-config.cmake @ install tree
         
@@ -217,7 +243,7 @@ macro( ecbuild_install_project )
         foreach( _tpl ${${PNAME}_TPLS} )
             string( TOUPPER ${_tpl} TPL )
             if( ${TPL}_FULL_INSTALL_INCLUDE_DIR )
-                list( APPEND CONF_TPL_INCLUDE_DIRS "\${${PNAME}_CMAKE_DIR}/${REL_INCLUDE_DIR}" )
+                 list( APPEND CONF_TPL_INCLUDE_DIRS "\${${PNAME}_CMAKE_DIR}/${REL_INCLUDE_DIR}" )
             endif()
             if( ${_tpl}_INCLUDE_DIRS )
                 list( APPEND CONF_TPL_INCLUDE_DIRS ${${_tpl}_INCLUDE_DIRS} )
@@ -230,35 +256,30 @@ macro( ecbuild_install_project )
             endif()
         endforeach()
         
-		set( _is_build_dir_export OFF )
-		configure_file( "${_template_config}" "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${LNAME}-config.cmake" @ONLY )
-		install( FILES "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${LNAME}-config.cmake" DESTINATION "${INSTALL_CMAKE_DIR}" )
+        set( _is_build_dir_export OFF )
+        configure_file( "${_template_config}" "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${LNAME}-config.cmake" @ONLY )
+        install( FILES "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${LNAME}-config.cmake" DESTINATION "${INSTALL_CMAKE_DIR}" )
      
         # install the export
     
         if( ${PROJECT_NAME}_ALL_EXES OR ${PROJECT_NAME}_ALL_LIBS )
-            install( EXPORT ${PROJECT_NAME}-targets DESTINATION "${INSTALL_CMAKE_DIR}" )
+            install( EXPORT ${CMAKE_PROJECT_NAME}-targets DESTINATION "${INSTALL_CMAKE_DIR}" )
         endif()
     
-    else() ### SUB-PROJECT EXPORT
-
-        set( ${PNAME}_FOUND  TRUE  PARENT_SCOPE )
-        set( ${PROJECT_NAME}_FOUND  TRUE  PARENT_SCOPE )
-
-        set( ${PNAME}_VERSION ${${PNAME}_VERSION} PARENT_SCOPE )
-        set( ${PROJECT_NAME}_VERSION ${${PNAME}_VERSION} PARENT_SCOPE )
+    else()
 
-        if( ${PNAME}_INCLUDE_DIRS )
-            set( ${PNAME}_INCLUDE_DIRS ${${PNAME}_INCLUDE_DIRS} PARENT_SCOPE )
-        endif()
-        
-        if( ${PNAME}_LIBRARIES )
-            set( ${PNAME}_LIBRARIES ${${PNAME}_LIBRARIES} PARENT_SCOPE )
-        endif()
-                
-        if( ${PNAME}_DEFINITIONS )
-            set( ${PNAME}_DEFINITIONS ${${PNAME}_DEFINITIONS} PARENT_SCOPE )
-        endif()
+        set( ${PNAME}_FOUND             TRUE                          PARENT_SCOPE )
+        set( ${PROJECT_NAME}_FOUND      TRUE                          PARENT_SCOPE )
+        set( ${PNAME}_VERSION           ${${PNAME}_VERSION}           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 )
+        set( ${PNAME}_DEFINITIONS       ${${PNAME}_DEFINITIONS}       PARENT_SCOPE )
+        set( ${PNAME}_PACKAGES          ${${PNAME}_PACKAGES}          PARENT_SCOPE )
+        set( ${PNAME}_TPLS              ${${PNAME}_TPLS}              PARENT_SCOPE )
+        set( ${PNAME}_TPL_LIBRARIES     ${${PNAME}_TPL_LIBRARIES}     PARENT_SCOPE )
+        set( ${PNAME}_TPL_DEFINITIONS   ${${PNAME}_TPL_DEFINITIONS}   PARENT_SCOPE )
+        set( ${PNAME}_TPL_INCLUDE_DIRS  ${${PNAME}_TPL_INCLUDE_DIRS}  PARENT_SCOPE )
 
     endif()
 
diff --git a/cmake/ecbuild_links_target.cmake b/cmake/ecbuild_links_target.cmake
index dd26576..5dfacdc 100644
--- a/cmake/ecbuild_links_target.cmake
+++ b/cmake/ecbuild_links_target.cmake
@@ -12,14 +12,14 @@
 set( EC_ALL_EXES "" CACHE INTERNAL "" )
 set( EC_ALL_LIBS "" CACHE INTERNAL "" )
 
-macro( ecbuild_link_exe TARGET  FILENAME )
+macro( ecbuild_link_exe TARGET  FILENAME FILEPATH )
 
     if( DEFINED EC_LINK_DIR )
        add_custom_target(${TARGET}_link
           COMMAND ${CMAKE_COMMAND} -E make_directory ${EC_LINK_DIR}
           COMMAND ${CMAKE_COMMAND} -E make_directory ${EC_LINK_DIR}/bin
           COMMAND ${CMAKE_COMMAND} -E remove ${EC_LINK_DIR}/bin/${FILENAME}
-          COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_BINARY_DIR}/bin/${FILENAME} ${EC_LINK_DIR}/bin/${FILENAME}
+          COMMAND ${CMAKE_COMMAND} -E create_symlink ${FILEPATH} ${EC_LINK_DIR}/bin/${FILENAME}
           DEPENDS ${TARGET}
           COMMENT "link ${EC_LINK_DIR}/bin/${FILENAME}" )
     endif()
@@ -31,14 +31,14 @@ endmacro( ecbuild_link_exe  )
 ###############################################################################
 # macro for adding a link to library on a development system
 
-macro( ecbuild_link_lib  TARGET  FILENAME )
+macro( ecbuild_link_lib  TARGET FILENAME FILEPATH )
 
     if( DEFINED EC_LINK_DIR )
        add_custom_target(${TARGET}_link
           COMMAND ${CMAKE_COMMAND} -E make_directory ${EC_LINK_DIR}
           COMMAND ${CMAKE_COMMAND} -E make_directory ${EC_LINK_DIR}/lib
           COMMAND ${CMAKE_COMMAND} -E remove ${EC_LINK_DIR}/lib/${FILENAME}
-          COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_BINARY_DIR}/lib/${FILENAME} ${EC_LINK_DIR}/lib/${FILENAME}
+          COMMAND ${CMAKE_COMMAND} -E create_symlink ${FILEPATH} ${EC_LINK_DIR}/lib/${FILENAME}
           DEPENDS ${TARGET}
           COMMENT "link ${EC_LINK_DIR}/lib/${FILENAME}" )
     endif()
diff --git a/cmake/ecbuild_list_extra_search_paths.cmake b/cmake/ecbuild_list_extra_search_paths.cmake
index 57ad169..7373486 100644
--- a/cmake/ecbuild_list_extra_search_paths.cmake
+++ b/cmake/ecbuild_list_extra_search_paths.cmake
@@ -11,7 +11,7 @@
 # macro for adding search paths to CMAKE_PREFIX_PATH
 # for example the ECMWF /usr/local/apps paths
 #
-# usage: ecbuild_search_paths( netcdf4 )
+# usage: ecbuild_list_extra_search_paths( netcdf4 VARIABLE )
 
 function( ecbuild_list_extra_search_paths pkg var )
 
@@ -22,53 +22,75 @@ function( ecbuild_list_extra_search_paths pkg var )
 
 	# PKG_PATH (upper case)
 
-	if( DEFINED ${_PKG}_PATH )
+	if( DEFINED ${_PKG}_PATH AND EXISTS ${${_PKG}_PATH} )
+		message( "${_PKG}_PATH ${${_PKG}_PATH} exists " )
 		list( APPEND ${var} ${${_PKG}_PATH} )
 	endif()
 
-	# PKG_PATH (lower case)
+	# ENV PKG_PATH (upper case)
 
-	if( DEFINED ${pkg}_PATH )
+	if( DEFINED ENV{${_PKG}_PATH} AND EXISTS $ENV{${_PKG}_PATH}  )
+		list( APPEND ${var} $ENV{${_PKG}_PATH} )
+	endif()
+
+	# pkg_PATH (lower case)
+
+	if( DEFINED ${pkg}_PATH AND EXISTS ${${pkg}_PATH} )
 		list( APPEND ${var} ${${pkg}_PATH} )
 	endif()
 
-	# fixes BOOST_ROOT taking precedence on the search for location
-	if( ${pkg} STREQUAL "boost" )
-		if( BOOST_ROOT OR BOOSTROOT OR DEFINED ENV{BOOST_ROOT} OR DEFINED ENV{BOOSTROOT} )
-			set( CMAKE_PREFIX_PATH ${BOOST_ROOT} ${BOOSTROOT} $ENV{BOOST_ROOT} $ENV{BOOSTROOT} ${CMAKE_PREFIX_PATH} )
-		endif()
+	# ENV pkg_PATH (lower case)
+
+	if( DEFINED ${pkg}_PATH AND EXISTS ${${pkg}_PATH} )
+		list( APPEND ${var} ${${pkg}_PATH} )
+	endif()
+
+	# ENV PKG_DIR (upper case)
+
+	if( DEFINED ENV{${_PKG}_DIR} AND EXISTS $ENV{${_PKG}_DIR}  )
+		list( APPEND ${var} $ENV{${_PKG}_DIR} )
+	endif()
+
+	# ENV pkg_DIR (lower case)
+
+	if( DEFINED ENV{${pkg}_DIR} AND EXISTS $ENV{${pkg}_DIR} )
+		list( APPEND ${var} $ENV{${pkg}_DIR} )
 	endif()
 
 	# directories under /usr/local/apps/${pkg}
 
-	foreach( _apps /usr/local/apps/${pkg} /usr/local/lib/metaps/lib/${pkg} )
+	if( SEARCH_ECMWF_PATHS )
+
+		foreach( _apps /usr/local/apps/${pkg} /usr/local/lib/metaps/lib/${pkg} )
+
+			if( EXISTS ${_apps} )
 
-		if( EXISTS ${_apps} )
+				 file( GLOB ps ${_apps}/[0-9]* )
+				 list( SORT ps )
+				 list( REVERSE ps ) # reversing will give us the newest versions first
+				 foreach( p ${ps} )
+					 if( IS_DIRECTORY ${p} )
+						  list( APPEND ${var}  ${p} )
+						  if( EXISTS ${p}/LP64 )
+							  list( APPEND ${var} ${p}/LP64 )
+						  endif()
+					 endif()
+				 endforeach()
 
-			 file( GLOB ps ${_apps}/[0-9]* )
-			 list( SORT ps )
-			 list( REVERSE ps ) # reversing will give us the newest versions first
-			 foreach( p ${ps} )
-				 if( IS_DIRECTORY ${p} )
-					  list( APPEND ${var}  ${p} )
-					  if( EXISTS ${p}/LP64 )
-						  list( APPEND ${var} ${p}/LP64 )
-					  endif()
-				 endif()
-			 endforeach()
+				 foreach( p ${_apps} ${_apps}/current ${_apps}/stable ${_apps}/new ${_apps}/next ${_apps}/prev )
+				   if( EXISTS ${p} )
+					   list( APPEND ${var} ${p} )
+				   endif()
+				   if( EXISTS ${p}/LP64 )
+					   list( APPEND ${var} ${p}/LP64 )
+				   endif()
+				 endforeach()
 
-			 foreach( p ${_apps} ${_apps}/current ${_apps}/stable ${_apps}/new ${_apps}/next ${_apps}/prev )
-			   if( EXISTS ${p} )
-				   list( APPEND ${var} ${p} )
-			   endif()
-			   if( EXISTS ${p}/LP64 )
-				   list( APPEND ${var} ${p}/LP64 )
-			   endif()
-			 endforeach()
+			endif()
 
-		endif()
+		endforeach()
 
-	endforeach()
+	endif( SEARCH_ECMWF_PATHS )
 
 	# sanitize the list
 
@@ -80,7 +102,7 @@ function( ecbuild_list_extra_search_paths pkg var )
 
 	set( ${var} ${${var}} PARENT_SCOPE )
 
-#	debug_var( ${var} )
+# debug_var( ${var} )
 
 endfunction()
 
diff --git a/cmake/ecbuild_list_macros.cmake b/cmake/ecbuild_list_macros.cmake
index 4b7bcb0..5c10dd2 100644
--- a/cmake/ecbuild_list_macros.cmake
+++ b/cmake/ecbuild_list_macros.cmake
@@ -6,21 +6,52 @@
 # granted to it by virtue of its status as an intergovernmental organisation nor
 # does it submit to any jurisdiction.
 
-function(JOIN _listname _glue _output )
-
-	set( _return "" )
-
-	foreach( VAL ${${_listname}} )
-		set(_return "${_return}${_glue}${VAL}")
+##############################################################################
+# function for concatenating list into a string
+#
+# examples:
+#
+#   set( _paths "foo" "bar" )
+#   join( _paths "/" _mypath )
+#
+#   message( "${_mpath}" ) #  produces "foo/bar"
+
+function( JOIN _listname _glue _output )
+
+	set( _ret "" )
+
+	foreach( _v ${${_listname}} )
+		if( _ret )
+			set(_ret "${_ret}${_glue}${_v}") # append
+		else()
+			set(_ret "${_v}") # init
+		endif()
 	endforeach()
 
-	string(LENGTH "${_glue}" _glue_len)
-	string(LENGTH "${_return}" _return_len)
-
-	math(EXPR _return_len ${_return_len}-${_glue_len})
-	string(SUBSTRING "${_return}" ${_glue_len} ${_return_len} _return)
-
-	set(${_output} "${_return}" PARENT_SCOPE)
+	set(${_output} "${_ret}" PARENT_SCOPE)
 
 endfunction()
 
+##############################################################################
+# function for inserting a key / value into a map
+#
+# examples:
+#
+#   map_insert( "mymap" "foo" "bar" )
+#
+
+function( MAP_INSERT _map _key _value )
+	set( "_${_map}_${_key}" "${_value}" PARENT_SCOPE )
+endfunction(MAP_INSERT)
+
+##############################################################################
+# function for inserting a key / value into a map
+#
+# examples:
+#
+#   map_get( "mymap" "foo" VAR )
+#
+
+function( MAP_GET _map _key _var )
+	set( ${_var} "${_${_map}_${_key}}" PARENT_SCOPE )
+endfunction(MAP_GET)
diff --git a/cmake/ecbuild_pkgconfig.cmake b/cmake/ecbuild_pkgconfig.cmake
new file mode 100644
index 0000000..8549d46
--- /dev/null
+++ b/cmake/ecbuild_pkgconfig.cmake
@@ -0,0 +1,365 @@
+# (C) Copyright 1996-2014 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 ecbuild_pkgconfig
+#
+# This macro creates a pkg-config file for the current project
+#
+# It takes following optional arguments:
+#
+#  - FILENAME <filename>
+#       The file that will be generated. Default value is the lowercase
+#       name of the project with suffix ".pc" is used
+#
+#  - NAME <name>
+#       The name to be given to the package. Default value is the lowercase
+#       name of the project
+#
+#  - TEMPLATE <template>
+#       The template configuration file to use. This is useful to create more
+#       custom pkg-config files. Default is ${ECBUILD_CMAKE_DIR}/pkg-config.pc.in
+#
+#  - URL <url>
+#       The url of the package. Default is ${UPPERCASE_PROJECT_NAME}_URL
+#
+#  - DESCRIPTION <description>
+#       The description of the package. Default is ${UPPERCASE_PROJECT_NAME}_DESCRIPTION
+#
+#  - LIBRARIES <libraries>
+#       The package libraries. Default is ${UPPERCASE_PROJECT_NAME}_LIBRARIES
+#       This is e.g. of the form "eckit;eckit_geometry"
+#
+#  - IGNORE_INCLUDE_DIRS <include_dirs>
+#       Ignore specified include directories
+#
+#  - IGNORE_LIBRARIES <libraries>
+#       Ignore specified libraries
+#
+#  - LANGUAGES <languages>
+#       List of languages used. If none given, all CMake_<lang>_COMPILER_LOAED languages
+#       are added. Accepted languages: C CXX Fortran
+#
+#  - NO_PRIVATE_INCLUDE_DIRS
+#       Don't add include dirs of dependencies to Cflags. This is mainly useful
+#       for Fortran only packages, when only the modules need to be added to Cflags
+#
+#############################################################################################
+
+function( ecbuild_library_dependencies dependencies libraries )
+
+  set( _libraries ${${libraries}} )
+
+  foreach( _lib ${_libraries})
+
+    unset( _location )
+
+    if( TARGET ${_lib} ) # check if this is an existing target
+
+      set( _imported 0 )
+      get_property( _imported TARGET ${_lib} PROPERTY IMPORTED )
+
+      unset( _deps )
+
+      if( _imported )
+
+        get_property( _location TARGET ${_lib} PROPERTY LOCATION )
+        get_property( _configs   TARGET ${_lib} PROPERTY IMPORTED_CONFIGURATIONS )
+        list( REVERSE _configs )
+        list( GET _configs 0 _config)
+        get_property( _deps     TARGET ${_lib} PROPERTY IMPORTED_LINK_INTERFACE_LIBRARIES_${_config} )
+        get_property( _locimp   TARGET ${_lib} PROPERTY IMPORTED_LOCATION_${_config} )
+
+      else()
+
+        list( APPEND _location ${_lib} )
+        get_property( _deps TARGET ${_lib} PROPERTY LINK_LIBRARIES )
+
+      endif()
+
+      ecbuild_library_dependencies( _deps_location _deps )
+      list( APPEND _location ${_deps_location} )
+
+    else()
+
+      set( _location ${_lib} )
+
+    endif()
+
+    list( APPEND _dependencies ${_location} )
+
+  endforeach()
+
+  if( _dependencies )
+    list( REVERSE           _dependencies )
+    list( REMOVE_DUPLICATES _dependencies )
+    list( REVERSE           _dependencies )
+    set( ${dependencies} ${_dependencies} PARENT_SCOPE )
+  endif()
+
+endfunction(ecbuild_library_dependencies)
+
+#############################################################################################
+
+function( ecbuild_include_dependencies dependencies libraries )
+
+  set( _libraries ${${libraries}} )
+
+  foreach( _lib ${_libraries})
+
+    if( TARGET ${_lib} ) # check if this is an existing target
+
+      get_property( _include_dirs TARGET ${_lib} PROPERTY INCLUDE_DIRECTORIES )
+      list( APPEND _dependencies ${_include_dirs} )
+
+    endif()
+
+  endforeach()
+
+  if( _dependencies )
+    list( REMOVE_DUPLICATES _dependencies )
+    set( ${dependencies} ${_dependencies} PARENT_SCOPE )
+  endif()
+
+endfunction(ecbuild_include_dependencies)
+
+#############################################################################################
+
+function( ecbuild_pkgconfig_libs pkgconfig_libs libraries ignore_libs )
+
+  set( _libraries ${${libraries}} )
+  set( _ignore_libs ${${ignore_libs}} )
+
+  foreach( _lib ${_libraries} )
+
+    unset( _name )
+    unset( _dir  )
+
+    if( ${_lib} MATCHES ".+/Frameworks/.+" )
+
+      get_filename_component( _name ${_lib} NAME_WE )
+      list( APPEND _pkgconfig_libs "-framework ${_name}" )
+
+    else()
+
+      if( ${_lib} MATCHES "-l.+" )
+
+        string( REGEX REPLACE "^-l" "" _name ${_lib} )
+
+      else()
+
+
+        get_filename_component( _name ${_lib} NAME_WE )
+        get_filename_component( _dir  ${_lib} PATH )
+
+        if( NOT _name )
+          set( _name ${_lib} )
+        endif()
+
+        string( REGEX REPLACE "^lib" "" _name ${_name} )
+
+        if( "${_dir}" STREQUAL "/usr/lib" )
+          unset( _dir )
+        endif()
+        if( "${_dir}" STREQUAL "/usr/lib64" )
+          unset( _dir )
+        endif()
+
+      endif()
+
+      set( _set_append TRUE )
+        foreach( _ignore ${_ignore_libs} )
+          if( "${_name}" STREQUAL "${_ignore}" )
+            set( _set_append FALSE )
+          endif()
+      endforeach()
+
+      if( _set_append )
+
+        if( _dir )
+          list( APPEND _pkgconfig_libs "-L${_dir}" "-l${_name}" )
+        else()
+          list( APPEND _pkgconfig_libs "-l${_name}" )
+        endif()
+
+      endif()
+
+    endif( ${_lib} MATCHES ".+/Frameworks/.+" )
+
+  endforeach( _lib ${_libraries} )
+
+  if( _pkgconfig_libs )
+    list( REMOVE_DUPLICATES _pkgconfig_libs )
+    string( REPLACE ";" " " _pkgconfig_libs "${_pkgconfig_libs}" )
+
+    set( ${pkgconfig_libs} ${_pkgconfig_libs} PARENT_SCOPE )
+  endif()
+
+endfunction(ecbuild_pkgconfig_libs)
+
+
+#############################################################################################
+
+
+function( ecbuild_pkgconfig_include INCLUDE INCLUDE_DIRS ignore_includes )
+
+  string( TOUPPER ${PROJECT_NAME} PNAME )
+
+  set( _ignore_includes ${${ignore_includes}} )
+
+  list( APPEND ignore_include_dirs
+    "/usr/include"
+     ${${PNAME}_INCLUDE_DIRS} # These are build-directory includes
+     ${_ignore_includes}
+  )
+
+  foreach( _incdir ${${INCLUDE_DIRS}} )
+
+    foreach( _ignore ${ignore_include_dirs} )
+      if( "${_incdir}" STREQUAL "${_ignore}" )
+        unset( _incdir )
+      endif()
+    endforeach()
+
+    if( _incdir )
+      list( APPEND _include "-I${_incdir}")
+    endif()
+
+  endforeach()
+
+  if( _include )
+    list( REMOVE_DUPLICATES _include)
+    string( REPLACE ";" " " _include "${_include}")
+    set( ${INCLUDE} ${_include} PARENT_SCOPE )
+  endif()
+
+endfunction(ecbuild_pkgconfig_include)
+
+
+#############################################################################################
+
+function( ecbuild_pkgconfig )
+
+  set( options REQUIRES NO_PRIVATE_INCLUDE_DIRS )
+  set( single_value_args FILEPATH NAME TEMPLATE URL DESCRIPTION )
+  set( multi_value_args LIBRARIES IGNORE_INCLUDE_DIRS IGNORE_LIBRARIES VARIABLES LANGUAGES )
+
+  cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}"  ${_FIRST_ARG} ${ARGN} )
+
+  string( TOUPPER ${PROJECT_NAME} PNAME )
+  string( TOLOWER ${PROJECT_NAME} LNAME )
+
+  if(_PAR_UNPARSED_ARGUMENTS)
+    message(FATAL_ERROR "Unknown keywords given to ecbuild_add_executable(): \"${_PAR_UNPARSED_ARGUMENTS}\"")
+  endif()
+
+  unset( PKGCONFIG_LANGUAGES )
+  if( NOT _PAR_LANGUAGES )
+    if( CMAKE_C_COMPILER_LOADED )
+      list( APPEND PKGCONFIG_LANGUAGES C )
+    endif()
+    if( CMAKE_CXX_COMPILER_LOADED )
+      list( APPEND PKGCONFIG_LANGUAGES CXX )
+    endif()
+    if( CMAKE_Fortran_COMPILER_LOADED )
+      list( APPEND PKGCONFIG_LANGUAGES Fortran )
+    endif()
+  else()
+    foreach( _lang ${_PAR_LANGUAGES} )
+      if( CMAKE_${_lang}_COMPILER_LOADED )
+        list( APPEND PKGCONFIG_LANGUAGES ${_lang} )
+      endif()
+    endforeach()
+  endif()
+
+  foreach( _lang ${PKGCONFIG_LANGUAGES} )
+    set( PKGCONFIG_HAVE_${_lang} 1 )
+  endforeach()
+
+  set( LIBRARIES ${${PNAME}_LIBRARIES} )
+  if( _PAR_LIBRARIES )
+    set( LIBRARIES ${_PAR_LIBRARIES} )
+  endif()
+
+  if( CMAKE_CXX_COMPILER_LOADED )
+   set( _linker_lang CXX )
+  elseif( CMAKE_C_COMPILER_LOADED )
+   set( _linker_lang C )
+  elseif( CMAKE_Fortran_COMPILER_LOADED )
+   set( _linker_lang Fortran )
+  endif()
+
+  set( RPATH_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_${_linker_lang}_FLAG} )
+
+  set( PKGCONFIG_MOD_FLAG ${CMAKE_Fortran_MODPATH_FLAG} )
+
+  if( NOT PKGCONFIG_MOD_FLAG )
+    set( PKGCONFIG_MOD_FLAG "-I" )
+  endif()
+
+  ecbuild_pkgconfig_libs( PKGCONFIG_LIBS LIBRARIES _PAR_IGNORE_LIBRARIES )
+
+  ecbuild_library_dependencies( _libraries LIBRARIES )
+  foreach( _lib ${LIBRARIES} )
+    list( REMOVE_ITEM _libraries ${_lib} )
+  endforeach()
+
+  ecbuild_pkgconfig_libs( PKGCONFIG_LIBS_PRIVATE _libraries _PAR_IGNORE_LIBRARIES )
+
+  if( NOT _PAR_NO_PRIVATE_INCLUDE_DIRS )
+    ecbuild_include_dependencies( _include_dirs LIBRARIES )
+    ecbuild_pkgconfig_include( PKGCONFIG_CFLAGS _include_dirs _PAR_IGNORE_INCLUDE_DIRS )
+  endif()
+
+  set( PKGCONFIG_INCLUDE "-I\${includedir}" )
+  if( PKGCONFIG_HAVE_Fortran )
+    set( PKGCONFIG_INCLUDE "${PKGCONFIG_INCLUDE} ${PKGCONFIG_MOD_FLAG}\${fmoddir}" )
+  endif()
+
+  if( NOT _PAR_TEMPLATE )
+    set( _PAR_TEMPLATE "${ECBUILD_MACROS_DIR}/pkg-config.pc.in" )
+  endif()
+
+  set( PKGCONFIG_NAME ${LNAME} )
+  if( _PAR_NAME )
+    set( PKGCONFIG_NAME ${_PAR_NAME} )
+  endif()
+
+  if( NOT _PAR_FILEPATH )
+    set( _PAR_FILEPATH "${PKGCONFIG_NAME}.pc" )
+  endif()
+
+  set( PKGCONFIG_DESCRIPTION ${${PNAME}_DESCRIPTION} )
+  if( _PAR_DESCRIPTION )
+    set( PKGCONFIG_DESCRIPTION ${_PAR_DESCRIPTION} )
+  endif()
+
+  set( PKGCONFIG_URL ${${PNAME}_URL} )
+  if( _PAR_URL )
+    set( PKGCONFIG_URL ${_PAR_URL} )
+  endif()
+
+  set( PKGCONFIG_VERSION ${${PNAME}_VERSION} )
+  set( PKGCONFIG_GIT_TAG ${${PNAME}_GIT_SHA1} )  # For now set it to a commit id
+
+  if( _PAR_VARIABLES )
+    set( PKGCONFIG_VARIABLES "\n### Features:\n\n")
+    foreach( _var ${_PAR_VARIABLES} )
+      set( PKGCONFIG_VARIABLES "${PKGCONFIG_VARIABLES}${_var}=${${_var}}\n" )
+    endforeach()
+  endif()
+
+  configure_file( ${_PAR_TEMPLATE} "${CMAKE_BINARY_DIR}/${_PAR_FILEPATH}" @ONLY )
+  message( STATUS "pkg-config file created: ${_PAR_FILEPATH}" )
+
+  install( FILES ${CMAKE_BINARY_DIR}/${_PAR_FILEPATH}
+           DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig/
+           COMPONENT utilities )
+
+endfunction(ecbuild_pkgconfig)
diff --git a/cmake/ecbuild_print_summary.cmake b/cmake/ecbuild_print_summary.cmake
index a3985ae..193bf1f 100644
--- a/cmake/ecbuild_print_summary.cmake
+++ b/cmake/ecbuild_print_summary.cmake
@@ -18,25 +18,34 @@ macro( ecbuild_print_summary )
 
     endif()
 
-    if( ${PROJECT_NAME} STREQUAL ${CMAKE_PROJECT_NAME} )
-
+    if( PROJECT_NAME STREQUAL CMAKE_PROJECT_NAME )
+	
         ecbuild_define_links_target()
 
         get_property( langs GLOBAL PROPERTY ENABLED_LANGUAGES )
 
 		message( STATUS "---------------------------------------------------------" )
-		message( STATUS "Build summary" )
+		if( NOT ${DEVELOPER_MODE} )
+			message( STATUS "Build summary" )
+		else()
+			message( STATUS "Build summary -- ( DEVELOPER_MODE )" )
+		endif()
 		message( STATUS "---------------------------------------------------------" )
 
 		message( STATUS "system : [${BUILD_SITE}] [${CMAKE_SYSTEM}] [${EC_OS_NAME}.${EC_OS_BITS}]" )
 		message( STATUS "processor        : [${CMAKE_SYSTEM_PROCESSOR}]" )
-		message( STATUS "cmake            : [${CMAKE_COMMAND}] (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION})" )
+		if( EC_BIG_ENDIAN )
+			message( STATUS "endiness         : Big Endian -- IEEE [${IEEE_BE}]" )
+		endif()
+		if( EC_LITTLE_ENDIAN )
+			message( STATUS "endiness         : Little Endian -- IEEE [${IEEE_LE}]" )
+		endif()
 		message( STATUS "build type       : [${CMAKE_BUILD_TYPE}]" )
 		message( STATUS "timestamp        : [${EC_BUILD_TIMESTAMP}]" )
 		message( STATUS "install prefix   : [${CMAKE_INSTALL_PREFIX}]" )
-    if( EC_LINK_DIR )
-		message( STATUS "links prefix     : [${EC_LINK_DIR}]" )
-    endif()
+		if( EC_LINK_DIR )
+			message( STATUS "links prefix     : [${EC_LINK_DIR}]" )
+		endif()
         message( STATUS "---------------------------------------------------------" )
 
         foreach( lang ${langs} )
@@ -58,21 +67,16 @@ macro( ecbuild_print_summary )
 
 	message( STATUS "common definitions: ${defs}" )
 
-        message( STATUS "---------------------------------------------------------" )
-
-    endif()
+	message( STATUS "---------------------------------------------------------" )
 
 	### FEATURE SUMMARY
 
-  if( ${CMAKE_VERSION} VERSION_LESS "2.8.6" )
-    debug_var( CMAKE_VERSION )
-    message( STATUS without include_quiet )
-    feature_summary( WHAT ALL )
-  else()
-    debug_var( CMAKE_VERSION )
-    message( STATUS with include_quiet )
-    feature_summary( WHAT ALL INCLUDE_QUIET_PACKAGES )
-  endif()
+	  # debug_var( CMAKE_VERSION )
+	  if( ${CMAKE_VERSION} VERSION_LESS "2.8.6" )
+		feature_summary( WHAT ALL )
+	  else()
+		feature_summary( WHAT ALL INCLUDE_QUIET_PACKAGES )
+	  endif()
 
 	### WARNINGS
 
@@ -106,4 +110,6 @@ macro( ecbuild_print_summary )
 
     endif()
 
+    endif( PROJECT_NAME STREQUAL CMAKE_PROJECT_NAME )
+
 endmacro( ecbuild_print_summary )
diff --git a/cmake/ecbuild_setup_test_framework.cmake b/cmake/ecbuild_setup_test_framework.cmake
index de9e11b..86f026e 100644
--- a/cmake/ecbuild_setup_test_framework.cmake
+++ b/cmake/ecbuild_setup_test_framework.cmake
@@ -15,25 +15,27 @@ if( ENABLE_TESTS )
 	set( Boost_USE_MULTITHREADED  ON )
 #   set( Boost_DEBUG              ON )
 
-	find_package( Boost 1.47.0 COMPONENTS unit_test_framework test_exec_monitor )
+	find_package( Boost 1.47.0 COMPONENTS unit_test_framework )
 
 	set( ECBUILD_BOOST_HEADER_DIRS "${CMAKE_CURRENT_LIST_DIR}/include" )
 
-	if( Boost_FOUND AND Boost_UNIT_TEST_FRAMEWORK_LIBRARY AND Boost_TEST_EXEC_MONITOR_LIBRARY )
+	if( Boost_FOUND AND Boost_UNIT_TEST_FRAMEWORK_LIBRARY )
 
+		set( HAVE_BOOST_UNIT_TEST 1 )
 		set( BOOST_UNIT_TEST_FRAMEWORK_LINKED 1 )
 
 		# message( STATUS "Boost unit test framework -- FOUND [${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}]" )
 
 	else()
 
-		set( BOOST_UNIT_TEST_FRAMEWORK_HEADER_ONLY 1 )
+		message( STATUS "Boost unit test framework -- NOT FOUND" )
 
-		list( APPEND ECBUILD_BOOST_HEADER_DIRS "${CMAKE_CURRENT_LIST_DIR}/contrib/boost-1.55/include" )
+		set( HAVE_BOOST_UNIT_TEST 0 )
 
-		# comment out this when ecbuild paks boost unit test inside...
-		message( WARNING "Boost unit test framework -- NOT FOUND : deactivating tests, ENABLE_TESTS = OFF" )
-		set( ENABLE_TESTS OFF )
+		# set( BOOST_UNIT_TEST_FRAMEWORK_HEADER_ONLY 1 )
+		# comment out this when ecbuild packs boost unit test inside...
+		# list( APPEND ECBUILD_BOOST_HEADER_DIRS "${CMAKE_CURRENT_LIST_DIR}/contrib/boost-1.55/include" )
+		# set( HAVE_BOOST_UNIT_TEST 1 )
 
 	endif()
 
diff --git a/cmake/ecbuild_system.cmake b/cmake/ecbuild_system.cmake
index 7ef7cfb..939d92e 100644
--- a/cmake/ecbuild_system.cmake
+++ b/cmake/ecbuild_system.cmake
@@ -19,10 +19,10 @@ get_filename_component(bindir "${CMAKE_BINARY_DIR}" REALPATH)
 
 if(${srcdir} STREQUAL ${bindir})
   message("######################################################")
-  message("You are attempting to build in your Source Directory.")
-  message("You must run cmake from a build directory.")
+  message("You are attempting to build in your source directory (${srcdir}).")
+  message("You must run cmake from a different build directory.")
   message("######################################################")
-	message( FATAL_ERROR "${PROJECT_NAME} requires an out of source build.\n Please create a separate build directory and run 'cmake path/to/project [options]' from there.")
+  message( FATAL_ERROR "${PROJECT_NAME} requires an out of source build.\n Please create a separate build directory and run 'cmake path/to/project [options]' from there.")
 endif()
 
 ########################################################################################################
@@ -33,17 +33,91 @@ 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()
 
-set( ECBUILD_MACRO_VERSION "1.3" )
+set( ECBUILD_MACROS_DIR "${CMAKE_CURRENT_LIST_DIR}" CACHE INTERNAL "where ecbuild system is" )
+
+include( "${ECBUILD_MACROS_DIR}/VERSION.cmake" )
+
+set( ecbuild_VERSION_STR "${ECBUILD_VERSION_STR}" )
+
+########################################################################################################
+# define cmake policies
+
+# Included scripts don't automatic cmake_policy PUSH and POP
+
+if( POLICY CMP0011 )
+	cmake_policy( SET CMP0011 OLD )
+endif()
+
+# Allow use of the LOCATION target property.
+
+if( POLICY CMP0026 )
+	cmake_policy( SET CMP0026 OLD )
+endif()
+
+# for macosx use @rpath in a target’s install name
+
+if( POLICY CMP0042 )
+	cmake_policy( SET CMP0042 NEW )
+	set( CMAKE_MACOSX_RPATH ON )
+endif()
+
+# Error on non-existent target in get_target_property
+
+if( POLICY CMP0045 )
+	cmake_policy( SET CMP0045 NEW )
+endif()
+
+# Error on non-existent target in get_target_property
+
+if( POLICY CMP0046 )
+	cmake_policy( SET CMP0046 NEW )
+endif()
+
+# Error on non-existent dependency in add_dependencies
+
+if( POLICY CMP0046 )
+	cmake_policy( SET CMP0050 NEW )
+endif()
+
+# Reject source and build dirs in installed INTERFACE_INCLUDE_DIRECTORIES
+
+if( POLICY CMP0052 )
+	cmake_policy( SET CMP0052 NEW )
+endif()
+
+# inside if() don't dereference variables if they are quoted 
+# e.g. "VAR" is not dereferenced 
+#      "${VAR}" is dereference only once
+
+if( POLICY CMP0054 )
+	cmake_policy( SET CMP0054 NEW )
+endif()
 
 ########################################################################################################
 # include our cmake macros, but only do so if this is the top project
-if( ${PROJECT_NAME} STREQUAL ${CMAKE_PROJECT_NAME} )
+if( PROJECT_NAME STREQUAL CMAKE_PROJECT_NAME )
 
-	site_name( BUILD_SITE ) # hostname of where we build
+	# hostname of where we build
+
+	site_name( BUILD_SITE )
+	mark_as_advanced( BUILD_SITE )
+	mark_as_advanced( BUILD_TESTING )
 
 	set( ECBUILD_PROJECTS  "" CACHE INTERNAL "list of ecbuild (sub)projects that use ecbuild" )
 
-	set( ECBUILD_MACROS_DIR "${CMAKE_CURRENT_LIST_DIR}" CACHE INTERNAL "where ecbuild system is" )
+	message( STATUS "ecbuild   ${ecbuild_VERSION_STR}\t${ECBUILD_MACROS_DIR}" )
+	message( STATUS "cmake     ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}\t${CMAKE_COMMAND}" )
+
+	if( CMAKE_TOOLCHAIN_FILE )
+		message( STATUS "toolchain ${CMAKE_TOOLCHAIN_FILE}" )
+	endif()
+
+	if( ECBUILD_CACHE )
+		include( ${ECBUILD_CACHE} )
+      message( STATUS "cache     ${ECBUILD_CACHE}" )
+	endif()
+
+	message( STATUS "---------------------------------------------------------" )
 
 	# clear the build dir exported targets file (only on the top project)
 
@@ -63,6 +137,8 @@ if( ${PROJECT_NAME} STREQUAL ${CMAKE_PROJECT_NAME} )
 
 	include(CTest)                 # add cmake testing support
 	enable_testing()
+
+	# keep this until we modify the meaning to 'check' if installation worked
 	add_custom_target( check COMMAND ${CMAKE_CTEST_COMMAND} -V )
 
 	############################################################################################
@@ -98,8 +174,9 @@ if( ${PROJECT_NAME} STREQUAL ${CMAKE_PROJECT_NAME} )
 	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 )
+		if( CMAKE_C_COMPILER_LOADED AND ENABLE_FORTRAN_C_INTERFACE )
 			include(FortranCInterface)
 		endif()
 		set( EC_HAVE_FORTRAN 1 )
@@ -141,6 +218,7 @@ if( ${PROJECT_NAME} STREQUAL ${CMAKE_PROJECT_NAME} )
 	include( ecbuild_generate_config_headers )
 	include( ecbuild_generate_rpc )
 	include( ecbuild_generate_yy )
+	include( ecbuild_echo_targets )
 	include( ecbuild_add_option )
 	include( ecbuild_add_library )
 	include( ecbuild_add_executable )
@@ -161,17 +239,25 @@ if( ${PROJECT_NAME} STREQUAL ${CMAKE_PROJECT_NAME} )
 	include( ecbuild_print_summary )
 	include( ecbuild_warn_unused_files )
 	include( ecbuild_find_mpi )
+	include( ecbuild_find_omp )
 	include( ecbuild_find_perl )
 	include( ecbuild_find_python )
 	include( ecbuild_find_lexyacc )
 	include( ecbuild_find_fortranlibs )
 	include( ecbuild_enable_fortran )
+	include( ecbuild_check_c_source )
+	include( ecbuild_check_cxx_source )
+	include( ecbuild_check_fortran_source )
+	include( ecbuild_bundle )
+	include( ecbuild_pkgconfig )
+	include( ecbuild_cache )
 
 	include( ${CMAKE_CURRENT_LIST_DIR}/contrib/GetGitRevisionDescription.cmake )
 
 	############################################################################################
 	# kickstart the build system
 
+  	ecbuild_prepare_cache()
 	include( ecbuild_define_options )               # define build options
 	include( ecbuild_check_compiler )               # check for compiler characteristics
 	include( ecbuild_check_os )                     # check for os characteristics
@@ -179,6 +265,7 @@ if( ${PROJECT_NAME} STREQUAL ${CMAKE_PROJECT_NAME} )
 	include( ecbuild_define_paths )                 # define installation paths
 	include( ecbuild_links_target )                 # define the links target
 	include( ecbuild_setup_test_framework )         # setup test framework
+ 	ecbuild_flush_cache()
 
 	############################################################################################
 	# define the build timestamp
@@ -188,5 +275,7 @@ if( ${PROJECT_NAME} STREQUAL ${CMAKE_PROJECT_NAME} )
 		set( EC_BUILD_TIMESTAMP  "${EC_BUILD_TIMESTAMP}" CACHE INTERNAL "Build timestamp" )
 	endif()
 
+	message( STATUS "---------------------------------------------------------" )
+
 endif()
 
diff --git a/cmake/ecbuild_use_package.cmake b/cmake/ecbuild_use_package.cmake
index 9be319b..3d77384 100644
--- a/cmake/ecbuild_use_package.cmake
+++ b/cmake/ecbuild_use_package.cmake
@@ -139,11 +139,15 @@ macro( ecbuild_use_package )
 
     # test version for Cases 1,2,3
 
-	# debug_var( _p_PROJECT )
-	# debug_var( _p_VERSION )
-    # debug_var( _just_added )
-    # debug_var( ${PNAME}_FOUND )
-	# debug_var( ${PNAME}_previous_subproj_ )
+# debug_var( _p_PROJECT )
+# debug_var( _p_VERSION )
+# debug_var( ${PNAME}_VERSION )
+# debug_var( ${_p_PROJECT}_VERSION )
+# debug_var( _just_added )
+# debug_var( _do_version_check )
+# debug_var( _source_description )
+# debug_var( ${PNAME}_FOUND )
+# debug_var( ${PNAME}_previous_subproj_ )
 
 	if( _p_VERSION AND _do_version_check )
 			if( _p_EXACT )
diff --git a/cmake/ecbuild_warn_unused_files.cmake b/cmake/ecbuild_warn_unused_files.cmake
index a839da7..c3aa7d5 100644
--- a/cmake/ecbuild_warn_unused_files.cmake
+++ b/cmake/ecbuild_warn_unused_files.cmake
@@ -11,7 +11,7 @@
 
 macro( ecbuild_warn_unused_files )
 
-    if( ${PROJECT_NAME} STREQUAL ${CMAKE_PROJECT_NAME} ) # only for top level project
+    if( PROJECT_NAME STREQUAL CMAKE_PROJECT_NAME ) # only for top level project
     
       # if cache file with unused files exists remove it
       set( UNUSED_FILE "${CMAKE_BINARY_DIR}/UnusedFiles.txt" )
diff --git a/cmake/include/ecbuild/boost_test_framework.h b/cmake/include/ecbuild/boost_test_framework.h
index 4bb7d96..09e61dd 100644
--- a/cmake/include/ecbuild/boost_test_framework.h
+++ b/cmake/include/ecbuild/boost_test_framework.h
@@ -11,6 +11,7 @@
 #ifdef BOOST_UNIT_TEST_FRAMEWORK_HEADER_ONLY
 #include <boost/test/included/unit_test.hpp>
 #else
+#define BOOST_TEST_DYN_LINK
 #include <boost/test/unit_test.hpp>
 #endif
 
diff --git a/cmake/pkg-config.pc.in b/cmake/pkg-config.pc.in
new file mode 100644
index 0000000..86031db
--- /dev/null
+++ b/cmake/pkg-config.pc.in
@@ -0,0 +1,35 @@
+# This pkg-config file is generated by ecbuild_pkgconfig()
+# with template ecbuild/cmake/pkg-config.pc.in
+
+git_tag=@PKGCONFIG_GIT_TAG@
+
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=${prefix}
+libdir=${prefix}/lib
+includedir=${prefix}/include
+bindir=${prefix}/bin
+fmoddir=${prefix}/include
+
+CC=@CMAKE_C_COMPILER@
+CXX=@CMAKE_CXX_COMPILER@
+FC=@CMAKE_Fortran_COMPILER@
+
+rpath=@RPATH_FLAG@${libdir}
+
+libs=-L${libdir} ${rpath} @PKGCONFIG_LIBS@
+
+libs_private=@PKGCONFIG_LIBS_PRIVATE@
+
+cflags=@PKGCONFIG_INCLUDE@ @PKGCONFIG_CFLAGS@
+ at PKGCONFIG_VARIABLES@
+#====================================================================
+Name: @PKGCONFIG_NAME@
+Description: @PKGCONFIG_DESCRIPTION@
+URL: @PKGCONFIG_URL@
+Version: @PKGCONFIG_VERSION@
+Libs: ${libs}
+Libs.private: ${libs_private}
+Requires: @PKGCONFIG_REQUIRES@
+Requires.private: @PKGCONFIG_REQUIRES_PRIVATE@
+Cflags: ${cflags}
+#====================================================================
diff --git a/cmake/project-config.cmake.in b/cmake/project-config.cmake.in
index a2a35dd..dbb936f 100644
--- a/cmake/project-config.cmake.in
+++ b/cmake/project-config.cmake.in
@@ -4,6 +4,8 @@
 #  @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
@@ -11,7 +13,7 @@
 #  @PNAME at _TPL_DEFINITIONS  - preprocessor definitions
 #  @PNAME at _TPL_LIBRARIES    - libraries to link against
 
-# compute paths
+### compute paths
 
 get_filename_component(@PNAME at _CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
 
@@ -19,13 +21,13 @@ set( @PNAME at _SELF_INCLUDE_DIRS "@CONF_INCLUDE_DIRS@" )
 set( @PNAME at _SELF_DEFINITIONS  "@CONF_DEFINITIONS@" )
 set( @PNAME at _SELF_LIBRARIES    "@CONF_LIBRARIES@" )
 
-set( @PNAME at _TPLS             "@CONF_TPLS@" )
+set( @PNAME at _TPLS              "@CONF_TPLS@" )
+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 _TPL_INCLUDE_DIRS "@CONF_TPL_INCLUDE_DIRS@" )
-set( @PNAME at _TPL_DEFINITIONS  "@CONF_TPL_DEFINITIONS@" )
-set( @PNAME at _TPL_LIBRARIES    "@CONF_TPL_LIBRARIES@" )
+### export include paths as absolute paths
 
-# include paths as absolute paths
 set( @PNAME at _INCLUDE_DIRS "" )
 foreach( path ${@PNAME at _SELF_INCLUDE_DIRS} )
 	get_filename_component( abspath ${path} ABSOLUTE )
@@ -33,13 +35,23 @@ foreach( path ${@PNAME at _SELF_INCLUDE_DIRS} )
 endforeach()
 list( APPEND @PNAME at _INCLUDE_DIRS ${@PNAME at _TPL_INCLUDE_DIRS} )
 
+### export definitions
+
 set( @PNAME at _DEFINITIONS      ${@PNAME at _SELF_DEFINITIONS} ${@PNAME at _TPL_DEFINITIONS} )
-set( @PNAME at _LIBRARIES        ${@PNAME at _SELF_LIBRARIES}  ${@PNAME at _TPL_LIBRARIES} )
 
+### export list of all libraries
+
+set( @PNAME at _LIBRARIES        ${@PNAME at _SELF_LIBRARIES}   ${@PNAME at _TPL_LIBRARIES}   )
+
+### export the features provided by the package
+
+set( @PNAME at _FEATURES    "@CONF_FEATURES@" )
+foreach( _f ${@PNAME at _FEATURES} )
+	set( ${_f} 1 )
+endforeach()
 
 if( EXISTS ${@PNAME at _CMAKE_DIR}/@CONF_IMPORT_FILE@ )
   set( @PNAME at _IMPORT_FILE "${@PNAME at _CMAKE_DIR}/@CONF_IMPORT_FILE@" )
-  debug_var( @PNAME at _IMPORT_FILE )
   include( ${@PNAME at _IMPORT_FILE} )
 endif()
 
diff --git a/compile.sh b/compile.sh
deleted file mode 100755
index 376f2af..0000000
--- a/compile.sh
+++ /dev/null
@@ -1,321 +0,0 @@
-#!/bin/ksh
-
-
-. ./version.sh
-version="${MAGICS_PACKAGE_VERSION}"
-subdir="."
-
-metview=off
-if test "x$1" = x"mv4" -o "x$1" = x"mv4d"; then
-  compile="--enable-metview "
-  metview=on
-fi
-
-
-debug=off
-if test "x$1" = x"debug" -o "x$1" = x"mv4d"; then
-  compile="${compile}--enable-debug "
-#  export CXXFLAGS="${CXXFLAGS} -g -DOBS_DEBUG_ -DDRIVERS_DEBUG_"
-  export CXXFLAGS="${CXXFLAGS} -g"
-  debug=on
-  subdir="debug"
-fi
-
-export CXX=g++ 
-export CC=gcc 
-export F77=pgf90
-export FC=pgf90
-
-if test "x$1" = x"in" -o "x$1" = x"ip" -o "x$1" = x"id"; then
-  compile="--enable-metview "
-  metview=on
-  export CXX=icpc 
-  export CC=icc
-  export F77=ifort
-  export FC=ifort
-  intel_common="-O3 -xhost -opt-report -vec-report3"
-  if test "x$1" = x"ip"; then
-    intel_common="-O3 -xhost -opt-report -vec-report3 -parallel -par-report3"
-  fi
-  if test "x$1" = x"id"; then
-    intel_common="-guide -parallel"
-  fi
-  export CFLAGS="${intel_common}"
-  export CXXFLAGS="${intel_common}"
-fi
-
-if test x"$OS_VERSION" = "xrhel63"; then
-  export F77=gfortran
-  export FC=gfortran
-fi
-
-
-echo ""
-echo " ++++++++++++++++++++++++++++++++++++++++++++++++++"
-echo ""
-started="`date`"
-echo "  BUILDING  Magics version ${version}  starting ${started}"
-echo ""
-echo " ++++++++++++++++++++++++++++++++++++++++++++++++++"
-echo ""
-echo " CC =${CC}"
-echo " CXX=${CXX}"
-echo " F77=${F77}"
-echo " FC =${FC}"
-echo ""
-
-./bootstrap
-
-apps_path="/usr/local/apps/Magics/${version}"
-
-exp="--disable-exception "
-static_common=" ${exp}--enable-static --disable-shared"
-shared_common=" --disable-static --enable-shared"
-
-case "${OS_VERSION}" in
-   # 32bit Linux
-   suse91)
-	if test "x$debug" = x"off"; then
-	   export CXXFLAGS="${CXXFLAGS} -mtune=native -O2"
-	fi
-	# STATIC
-	./configure.ecmwf --prefix=${apps_path} --disable-cairo --enable-bufr --enable-spot ${static_common}
-	make clean
-	make quiet
-
-	# SHARED
-	./configure.ecmwf --prefix=${apps_path} --disable-cairo --enable-json --enable-bufr --enable-spot ${shared_common}
-	make clean
-	make quiet
-   ;;
-   sles11)
-        if test "x$CC" = "x"; then
-	   export CC=gcc
-	fi
-	if test "x$debug" = "xoff" -a "x$CC" = "xgcc"; then
-	   export CXXFLAGS="${CXXFLAGS} -mtune=native -O2"
-	fi
-	export PATH=/usr/local/apps/qt/4.6.2\-64/bin:${PATH}
-	export GNU_MODE=64
-	export PGI_MODE=64
-	export GRIB_API_MODE=64
-	export OBJECT_MODE=64
-	use pgi
-	use grib_api
-
-	if test "x$CC" = "xicc"; then            # intel
-	  . /usr/local/apps/intel/current/bin/ifortvars.sh intel64
-	  . /usr/local/apps/intel/current/bin/iccvars.sh intel64
-	  export INTEL_LICENSE_FILE='28518 at papercup'
-	  bash ./configure.ecmwf --prefix=${apps_path}_intel --enable-bufr --enable-spot --enable-json --enable-odb ${compile}${shared_common} --enable-python && \
-	  make clean && \
-	  make -j 4
-	else   # gcc
-	  # STATIC
-	  ./configure.ecmwf --prefix=${apps_path} --enable-bufr --enable-spot ${static_common} && \
-	  make clean && \
-	  make quiet && \
-	  ./configure.ecmwf --prefix=${apps_path} --enable-bufr --enable-spot --enable-json --enable-odb ${compile}${shared_common} --enable-python && \
-	  make clean && \
-	  make quiet
-	fi
-   ;;
-   rhel6)
-           ./configure.ecmwf --prefix=${apps_path} --enable-bufr --enable-odb ${static_common} && \
-           make clean && make quiet
-           ./configure.ecmwf --prefix=${apps_path} --enable-bufr --enable-odb ${compile}${shared_common} --enable-python --enable-json && \
-           make clean && make quiet
-   ;;
-   opensuse113)
-	export PATH=/usr/local/apps/python/current/bin/:$PATH
-	export GNU_MODE=64
-	export PGI_MODE=64
-	export GRIB_API_MODE=64
-	export OBJECT_MODE=64
-	use pgi
-	use grib_api
-
-	if test "x$debug" = "xoff"; then
-	   export CXXFLAGS="${CXXFLAGS} -mtune=native -O3"
-#	   subdir="release"
-#	   rm -rf ${subdir}
-#	   mkdir ${subdir}
-#	   cd ${subdir}
-#	   mkdir -p src/drivers/MgQ
-#	   ../
-	   ./configure.ecmwf --prefix=${apps_path} --enable-bufr --enable-odb --enable-spot ${static_common} && \
-	   make clean && \
-	   make quiet
-	   ./configure.ecmwf --prefix=${apps_path} --enable-bufr --enable-odb --enable-spot ${compile}${shared_common} --enable-python && \
-	   make clean && \
-	   make quiet
-#	   cd -
-	else
-	   export CXXFLAGS="${CXXFLAGS} -O0 -g"
-#	   subdir="debug"
-#	   rm -rf ${subdir}
-#	   mkdir ${subdir}
-#	   cd ${subdir}
-#	   mkdir -p src/drivers/MgQ
-#	   ../
-	   ./configure.ecmwf --prefix=${apps_path} --enable-bufr --enable-odb --enable-spot ${compile}--enable-static --enable-python && \
-	   make clean && \
-	   make quiet
-#	   cd -
-	fi
-
-	#
-	#   M E T V I E W
-	#
-	if test "x$metview" = "xon" ; then
-	    cd ../metview && ./bootstrap
-	    if test "x$debug" = x"off"; then
-	      ./configure.ecmwf --enable-ecregrid --enable-experimental --with-magics-home=${apps_path} && make clean && make
-	    else
-	      rm -rf debug
-	      mkdir debug
-	      cd debug
-	      ../configure.ecmwf --enable-debug --enable-qtdebug --enable-ecregrid --enable-experimental --with-magics-home=${apps_path} && make clean && make
-	    fi
-	fi
-   ;;
-
-   opensuse103)
-	if test "x$debug" = x"off"; then
-	   export CXXFLAGS="${CXXFLAGS} -mtune=native -O2"
-	fi
-	#
-	# STATIC
-	#
-	./configure.ecmwf --prefix=${apps_path} --enable-bufr --enable-spot ${compile}${static_common} \
-	&& make clean && make quiet
-
-	#
-	# SHARED
-	#
-	export CXXFLAGS="-g ${CXXFLAGS}"
-	./configure.ecmwf --prefix=${apps_path} --enable-bufr --enable-spot ${compile}${shared_common} \
-	   --enable-json --enable-odb --enable-python \
-	&& make clean && make quiet
-   ;;
-   
-   #########################################################
-   #
-   # IBM Server
-   #
-   #	*** C1B ***
-   #	ssh -X c1b
-   #	module unload c
-   #	module load c++/vacpp/12.0.0.0_b01
-   #	PROJ4 --> bash configure --disable-shared CC=xlC_r --prefix=/perm/graphics/cgm/proj4
-   #	./configure CPPFLAGS="-I/perm/graphics/cgm/boost_1_49_0/" LDFLAGS=-L/usr/local/lib/metaps/lib/grib_api/jasper/lib --with-grib-api=/usr/local/lib/metaps/lib/grib_api/1.9.16 --disable-netcdf --with-proj4=/perm/graphics/cgm/proj4 CXX=xlC_r LD=xlC_r
-
-   #	Base=/usr/local/apps/vacpp/vacpp12.eval/
-   #	export PATH=$Base/usr/vacpp/bin:$PATH
-   #	export LIBPATH=$Base/usr/lib:/usr/lib:/usr/local/lib
-   aix)
-    use vacpp12100
-
-    export AR=/usr/bin/ar 
-    export LD=/usr/bin/ld
-    export NM='/usr/bin/nm -B'
-    export CC=xlc_r
-    export CXX=xlC_r
-    export F77=xlf
-    export FC=xlf90
-#    export CXXFLAGS="-g -O2"
-#    export CFLAGS="-g -O2"
-
-    /bin/bash ./configure.ecmwf --prefix=${apps_path} --disable-python --enable-raster --disable-cairo --enable-bufr ${compile} --enable-static --disable-shared ; gmake clean ;  gmake -j 4 && gmake install
-###    /bin/bash ./configure.ecmwf --prefix=${apps_path} --disable-raster --disable-cairo --enable-bufr ${compile} --enable-static --enable-python ; gmake clean ;  gmake -j 4 && gmake install
-
-#    export GRIB_API_MODE=64
-#    export OBJECT_MODE=64
-###    /bin/bash ./configure.ecmwf --prefix=${apps_path}_${OBJECT_MODE} --enable-metview --disable-raster --disable-cairo --enable-bufr --enable-static --disable-shared ${compile} ; gmake clean ;  gmake -j 4 && gmake install
-#    /bin/bash ./configure.ecmwf --prefix=${apps_path}_${OBJECT_MODE} --enable-metview --disable-raster --disable-cairo --enable-bufr --enable-static ${compile} ; gmake clean ;  gmake -j 4 && gmake install
-   ;;
-
-   hpux11)
-	./configure.ecmwf CXX=aC++ CC=aCC F77=f90 GREP=egrep LD=ld
-   ;;
-
-	#######################################################
-    #
-    #  MAC OS X 
-    #
-    #  sudo port install cairo pango pkgconfig swig swig-python py-numpy p5-xml-simple curl boost netcdf gcc46 qt4-mac openmotif grib_api pdksh gv proj
-    #  export PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/X11R6/lib/pkgconfig:/local/lib/pkgconfig:/opt/local/lib/pkgconfig"
-    #  export RSYNC_PROXY=http://proxy.ecmwf.int:2222
-    #  export OS_VERSION=mac
-
-   mac)
-    export MACOSX_DEPLOYMENT_TARGET=10.8
-    ./configure ${compile} CXX="g++-mp-4.6" CC="gcc-mp-4.6" F77="gfortran-mp-4.6" \
-    && make clean  \
-    && make
-#      --enable-json --enable-python \
-#   cd ../metview
-#   ./configure --with-magics-home=/usr/local --with-grib-api=/opt/local/ LDFLAGS=-L/opt/local/lib LIBS=-lpng CXX=g++-mp-4.6 CC=gcc-mp-4.6 F77=gfortran-mp-4.6 --disable-ui
-   ;;
-
-
-   *)
-      if test "x${1}" = "xintel"; then
-	echo ""
-	echo "    I N T E L "
-	echo ""
-	compile=" --enable-metview "
-	./configure CXX="icpc" CC="icc" F77="ifort" ${compile} CXXFLAGS="${CXXFLAGS} -Wall -DOBS_DEBUG_ -DDRIVERS_DEBUG_" LIBS="-lgfortran" --libdir=/usr/local/lib64 \
-	    --enable-json --enable-bufr --enable-python
-#	&& make clean \
-#	&& make && sudo make install
-
-#	cd ../metview &&./bootstrap && \
-#	./configure CXX="icpc" CC="icc" F77="ifort" --enable-experimental --enable-ecregrid --enable-qtdebug --with-grib-api=/usr && make clean && make
-
-      else
-
-	echo ""
-	echo "SETUP choosen for OUTSIDE the centre!!!"
-	echo ""
-	export F77=gfortran
-	export FC=gfortran
-
-	if test "x$debug" = x"off"; then
-	   export CXXFLAGS="${CXXFLAGS} -mtune=native -O2 -ftree-vectorizer-verbose=1" #  -Wdisabled-optimization"
-	else
-	   export CXXFLAGS="${CXXFLAGS} -g -O0 -Wextra -Wdisabled-optimization"  # -Wfloat-equal -Wshadow
-	fi 
-	compile=" --enable-metview "
-	./configure ${compile} CXXFLAGS="${CXXFLAGS} -Wall -DOBS_DEBUG_ -DDRIVERS_DEBUG_" --libdir=/usr/local/lib64 --enable-bufr --enable-python \
-	&& make clean  \
-	&& make && sudo make install
-
-	if test -f apps/MagMLInterpretor/magmlx ; then
-	  cd ../metview &&./bootstrap && \
-	   ./configure --enable-experimental --enable-ecregrid --enable-qtdebug --with-grib-api=/usr && make clean && make
-	else
-	   echo ""
-	   echo "    Magics++ did NOT build!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
-	   echo ""
-	fi
-      fi
-   ;;
-esac
-
-
-echo ""
-echo " ++++++++++++++++++++++++++++++++++++++++++++++++++"
-echo ""
-echo "  FINISHED BUILDING  Magics version ${version}" 
-if test "x$debug" = x"on"; then
-echo ""
-echo "            D E B U G  version" 
-fi
-echo ""
-echo "  Started  ${started}"
-echo ""
-echo "  Finished `date`"
-echo ""
-echo " ++++++++++++++++++++++++++++++++++++++++++++++++++"
-echo ""
diff --git a/configure.debug b/configure.debug
deleted file mode 100755
index 16ed714..0000000
--- a/configure.debug
+++ /dev/null
@@ -1,163 +0,0 @@
-#!/usr/bin/ksh
-
-git_home="/home/graphics/cgs/git"
-version="2.22.6"
-magics="next-debug"
-install_home="/tmp/cgs/Magics/$version"
-debug="on"
-bufr="on"
-netcdf="on"
-odb="on"
-grib="on"
-metview="off"
-cairo="on"
-regression="off"
-spot="on"
-build_home="/scratch/graphics/cgs/build/${OS_VERSION}"
-run="1"
-
-
-
-case "${OS_VERSION}" in    
-    opensuse113) # Local worksation
-        regression="off"
-        build_home="/tmp/cgs/magics_debug"
-        cmake="/usr/local/apps/cmake/current/bin/cmake"
-        boost="/usr/local/apps/boost/1.50.0"
-        proj4="/usr/local/apps/proj4/4.8.0/LP64"
-        python="/usr/local/apps/python/2.7.1-02"
-        netcdf_lib="/usr/local/apps/netcdf4/4.1.3/LP64"
-        odb_lib="/usr/local/apps/odb_api/0.9.31"
-        grib_lib="/usr/local/lib/metaps/lib/grib_api/1.11.0"
-        pgi_lib="/usr/local/apps/pgi/pgi-10.8/linux86-64/10.8/libso"
-        spot_lib="/usr/local/lib/metaps/lib/spot_database/new"
-        emos_lib="/usr/local/apps/libemos/000393"
-        run="4"
-    ;;
-    sles11) # lxab
-        cmake="/usr/local/apps/cmake/current/bin/cmake"
-        boost="/usr/local/apps/boost/1.50.0"
-        proj4="/usr/local/apps/proj4/4.8.0/LP64"
-        python="/usr/local/apps/python/2.7.1-02"
-        netcdf_lib="/usr/local/apps/netcdf4/4.1.3/LP64"
-        odb_lib="/usr/local/apps/odb_api/0.9.31"
-        grib_lib="/usr/local/lib/metaps/lib/grib_api/1.11.0"
-        emos_lib="/usr/local/apps/libemos/000393"
-        pgi_lib="/usr/local/apps/pgi/pgi-10.8/linux86-64/10.8/libso"
-        spot_lib="/usr/local/lib/metaps/lib/spot_database/new"
-        run="4"
-    ;;
-    rhel6) #ecgb
-        cmake="/usr/local/apps/cmake/current/bin/cmake"
-        boost="/usr/local/apps/boost/1.50.0"
-        proj4="/usr/local/apps/proj4/4.8.0/LP64"
-
-        python="/usr/local/apps/python/current"
-        odb_lib="/usr/local/apps/odb_api/0.9.31"
-        grib_lib="/usr/local/apps/grib_api/1.11.0"
-        spot_lib="/usr/local/apps/spot_database/new"
-        emos_lib="/usr/local/apps/libemos/000393"
-        run="10"
-    ;;
-
- esac   
-    
-
-
-
-
-args="-DCMAKE_INSTALL_PREFIX=${install_home}"
-args=" $args -DCMAKE_MODULE_PATH=${git_home}/ecbuild/cmake"
-args=" $args -DMAGICS_BUILD=${magics} -DENABLE_STATIC_LIBRARY=OFF"
-args=" $args -DBOOST_ROOT=$boost"
-args=" $args -DPROJ4_PATH=$proj4"
-args=" $args -DENABLE_PYTHON=ON -DCMAKE_PREFIX_PATH=$python"
-
-if [[ $debug = "on" ]];then
-    args="$args -DCMAKE_BUILD_TYPE=Debug"
-    echo "Debug enabled"
-else
-    args="$args -DCMAKE_BUILD_TYPE=Production"
-    echo "Release Mode enabled"
-fi
-if [[ $regression = "on" ]];then
-    args="$args -DENABLE_REGRESSION=ON -DENABLE_REGRESSION_UPLOAD=on"
-    echo "Regression enabled"
-else
-    args="$args -DENABLE_REGRESSION=OFF"
-    echo "Regression disabled"
-fi
-if [[ $metview = "on" ]];then
-    args="$args -DENABLE_METVIEW=ON"
-    echo "Metview enabled"
-else
-    args="$args -DENABLE_MEVIEW=OFF"
-    echo "Metview not required"
-fi
-if [[ $cairo = "on" ]];then
-    args="$args -DENABLE_CAIRO=ON"
-    echo "Cairo enabled"
-else
-    args="$args -DENABLE_CAIRO=OFF"
-    echo "Cairo not required"
-fi
-if [[ $bufr = "on" ]];then
-    args=" $args -DENABLE_BUFR=ON"
-    if [[ $pgi_lib != "" ]];then
-        args=" $args -DWITH_PGI_FORTRAN=ON -DPGI_PATH=${pgi_lib}"
-    fi
-    if [[ $emos_lib != "" ]];then
-        args=" $args -DEMOS_PATH=${emos_lib}"
-    fi
-    echo "Bufr enabled"
-else
-    args="$args -DENABLE_BUFR=OFF"
-    echo "Bufr not required"
-fi
-if [[ $netcdf = "on" ]];then
-    args=" $args -DENABLE_NETCDF=ON "
-    echo "Netcdf enabled"
-    if [[ $netcdf_lib != "" ]];then
-        args=" $args -DNETCDF_PATH=${netcdf_lib}"
-    fi
-else
-    args="$args -DENABLE_NETCDF=OFF"
-    echo "NETCDF not required"
-fi
-if [[ $odb = "on" ]];then
-    args="$args -DENABLE_ODB=ON "
-    echo "ODB enabled"
-    if [[ $odb_lib != "" ]];then
-        args=" $args -DODB_API_PATH=${odb_lib}"
-    fi
-else
-    args="$args -DENABLE_ODB=OFF"
-    echo "ODB not required"
-fi
-if [[ $grib = "on" ]];then
-    args="$args -DENABLE_GRIB=ON "
-    echo "GRIB enabled"
-    if [[ $grib_lib != "" ]];then
-        args=" $args -DGRIB_API_PATH=${grib_lib}"
-    fi
-else
-    args="$args -DENABLE_GRIB=OFF"
-    echo "GRIB not required"
-fi
-if [[ $spot = "on" ]];then
-    args="$args -DENABLE_SPOT=ON "
-    echo "SPOT enabled"
-    if [[ $spot_lib != "" ]];then
-        args=" $args -DSPOT_PATH=${spot_lib}"
-    fi
-else
-    args="$args -DENABLE_SPOT=OFF"
-    echo "GRIB not required"
-fi
-
-mkdir -p ${build_home}
-cd ${build_home}
-
-echo $args
-$cmake ${git_home}/magics $args
-make -j ${run} install
diff --git a/configure.example b/configure.example
deleted file mode 100755
index 0301253..0000000
--- a/configure.example
+++ /dev/null
@@ -1,125 +0,0 @@
-#!/usr/bin/ksh
-
-home=".."
-version="2.21.1"
-install_home="../../$version"
-
-debug="off"
-bufr="on"
-netcdf="on"
-odb="off"
-grib="on"
-metview="off"
-cairo="on"
-spot="off"
-regression="off"
-static_lib="off"
-
-cmake="/usr/local/apps/cmake/current/bin/cmake"
-boost="/usr/local/apps/boost/1.50.0"
-
-proj4="/usr/local/apps/proj4/4.8.0/LP64"
-python="/usr/local/apps/python/2.7.1-02"
-netcdf_lib="/usr/local/apps/netcdf4/4.1.3/LP64"
-odb_lib="/usr/local/apps/odb_api/0.9.31"
-grib_lib="/usr/local/lib/metaps/lib/grib_api/1.11.0"
-pgi_lib="/usr/local/apps/pgi/pgi-10.8/linux86-64/10.8/libso"
-spot_lib="/usr/local/lib/metaps/lib/spot_database/new"
-emos_lib="/usr/local/apps/libemos/000393"
-
-args="-DCMAKE_INSTALL_PREFIX=${install_home}"
-args=" $args -DCMAKE_MODULE_PATH=${home}/cmake -DENABLE_STATIC_LIBRARY=ON"
-args=" $args -DBOOST_ROOT=$boost"
-args=" $args -DPROJ4_PATH=$proj4"
-args=" $args -DCMAKE_PREFIX_PATH=$python"
-
-if [[ $debug = "on" ]];then
-    args="$args -DCMAKE_BUILD_TYPE=Debug"
-    echo "Debug enabled"
-else
-    args="$args -DCMAKE_BUILD_TYPE=Production"
-    echo "Release Mode enabled"
-fi
-if [[ $static_lib = "on" ]];then
-    args="$args  -DENABLE_STATIC_LIBRARY=ON"
-    echo "build static library"
-else
-    args="$args -DENABLE_STATIC_LIBRARY=OFF"
-    echo "No Static Mode enabled"
-fi
-if [[ $regression = "on" ]];then
-    args="$args -DENABLE_REGRESSION=ON -DENABLE_REGRESSION_UPLOAD=on"
-    echo "Regression enabled"
-else
-    args="$args -DENABLE_REGRESSION=OFF"
-    echo "Regression disabled"
-fi
-if [[ $metview = "on" ]];then
-    args="$args -DENABLE_METVIEW=ON"
-    echo "Metview enabled"
-else
-    args="$args -DENABLE_MEVIEW=OFF"
-    echo "Metview not required"
-fi
-if [[ $cairo = "on" ]];then
-    args="$args -DENABLE_CAIRO=ON"
-    echo "Cairo enabled"
-else
-    args="$args -DENABLE_CAIRO=OFF"
-    echo "Cairo not required"
-fi
-if [[ $bufr = "on" ]];then
-    args=" $args -DENABLE_BUFR=ON"
-    if [[ $pgi_lib != "" ]];then
-        args=" $args -DWITH_PGI_FORTRAN=ON -DPGI_PATH=${pgi_lib}"
-    fi 
-    if [[ $emos_lib != "" ]];then
-        args=" $args -DEMOS_PATH=${emos_lib}"
-    fi
-    echo "Bufr enabled"
-else
-    args="$args -DENABLE_BUFR=OFF"
-    echo "Bufr not required"
-fi
-if [[ $netcdf = "on" ]];then
-    args=" $args -DENABLE_NETCDF=ON "
-    echo "Netcdf enabled"
-    if [[ $netcdf_lib != "" ]];then
-        args=" $args -DNETCDF_PATH=${netcdf_lib}"
-    fi
-else
-    args="$args -DENABLE_NETCDF=OFF"
-    echo "NETCDF not required"
-fi
-if [[ $odb = "on" ]];then
-    args="$args -DENABLE_ODB=ON "
-    echo "ODB enabled"
-    if [[ $odb_lib != "" ]];then
-        args=" $args -DODB_API_PATH=${odb_lib}"
-    fi
-else
-    args="$args -DENABLE_ODB=OFF"
-    echo "ODB not required"
-fi
-if [[ $grib = "on" ]];then
-    args="$args -DENABLE_GRIB=ON "
-    echo "GRIB enabled"
-    if [[ $grib_lib != "" ]];then
-        args=" $args -DGRIB_API_PATH=${grib_lib}"
-    fi
-else
-    args="$args -DENABLE_GRIB=OFF"
-    echo "GRIB not required"
-fi
-if [[ $spot = "on" ]];then
-    args="$args -DENABLE_SPOT=ON "
-    echo "SPOT enabled"
-    if [[ $spot_lib != "" ]];then
-        args=" $args -DSPOT_PATH=${spot_lib}"
-    fi
-else
-    args="$args -DENABLE_SPOT=OFF"
-    echo "SPOT not required"
-fi
-echo $args
-$cmake ${home} $args
diff --git a/configure.loxp b/configure.loxp
deleted file mode 100755
index 4f498e3..0000000
--- a/configure.loxp
+++ /dev/null
@@ -1,142 +0,0 @@
-#!/usr/bin/ksh
-
-git_home="/home/graphics/cgs/git"
-version="2.22.7"
-magics=""
-install_home="/usr/local/apps/Magics/$version"
-debug="off"
-bufr="off"
-netcdf="on"
-odb="off"
-grib="on"
-metview="off"
-cairo="on"
-regression="off"
-spot="off"
-static="on"
-build_home="/home/graphics/cgs/build/2.22.7/lxop"
-run="1"
-cmake="cmake"
-
-
-
-        cmake="/usr/local/apps/cmake/current/bin/cmake"
-        boost="/usr/local/apps/boost/1.50.0"
-        proj4="/usr/local/apps/proj4/4.8.0/LP64"
-        python="/usr/local/apps/python/2.7.1-02"
-        netcdf_lib="/usr/local/apps/netcdf_lib/LP64"
-        odb_lib="/usr/local/apps/odb_api/0.9.31"
-        grib_lib="/usr/local/lib/metaps/lib/grib_api/1.12.0"
-        emos_lib="/usr/local/apps/libemos/000393"
-        pgi_lib="/usr/local/apps/pgi/pgi-10.8/linux86-64/10.8/libso"
-        spot_lib="/usr/local/lib/metaps/lib/spot_database/new"
-        run="4"
-    
-
-
-
-
-args="-DCMAKE_INSTALL_PREFIX=${install_home}"
-args=" $args "
-args=" $args -DMAGICS_BUILD=${magics}"
-args=" $args -DBOOST_ROOT=$boost"
-args=" $args -DPROJ4_PATH=$proj4"
-args=" $args -DENABLE_PYTHON=ON -DCMAKE_PREFIX_PATH=$python"
-
-if [[ $static = "on" ]];then
-    args="$args  -DENABLE_STATIC_LIBRARY=ON"
-    echo "static enabled"
-else
-    args="$args -DENABLE_STATIC=OFF"
-    echo "No static library"
-fi
-if [[ $debug = "on" ]];then
-    args="$args -DCMAKE_BUILD_TYPE=Debug"
-    echo "Debug enabled"
-else
-    args="$args -DCMAKE_BUILD_TYPE=Release"
-    echo "Release Mode enabled"
-fi
-if [[ $regression = "on" ]];then
-    args="$args -DENABLE_REGRESSION=ON -DENABLE_REGRESSION_UPLOAD=ON"
-    echo "Regression enabled"
-else
-    args="$args -DENABLE_REGRESSION=OFF"
-    echo "Regression disabled"
-fi
-if [[ $metview = "on" ]];then
-    args="$args -DENABLE_METVIEW=ON"
-    echo "Metview enabled"
-else
-    args="$args -DENABLE_MEVIEW=OFF"
-    echo "Metview not required"
-fi
-if [[ $cairo = "on" ]];then
-    args="$args -DENABLE_CAIRO=ON"
-    echo "Cairo enabled"
-else
-    args="$args -DENABLE_CAIRO=OFF"
-    echo "Cairo not required"
-fi
-if [[ $bufr = "on" ]];then
-    args=" $args -DENABLE_BUFR=ON"
-    if [[ $pgi_lib != "" ]];then
-        args=" $args -DWITH_PGI_FORTRAN=ON -DPGI_PATH=${pgi_lib}"
-    fi
-    if [[ $emos_lib != "" ]];then
-        args=" $args -DEMOS_PATH=${emos_lib}"
-    fi
-    echo "Bufr enabled"
-else
-    args="$args -DENABLE_BUFR=OFF"
-    echo "Bufr not required"
-fi
-if [[ $netcdf = "on" ]];then
-    args=" $args -DENABLE_NETCDF=ON "
-    echo "Netcdf enabled"
-    if [[ $netcdf_lib != "" ]];then
-        args=" $args -DNETCDF_PATH=${netcdf_lib}"
-    fi
-else
-    args="$args -DENABLE_NETCDF=OFF"
-    echo "NETCDF not required"
-fi
-if [[ $odb = "on" ]];then
-    args="$args -DENABLE_ODB=ON "
-    echo "ODB enabled"
-    if [[ $odb_lib != "" ]];then
-        args=" $args -DODB_API_PATH=${odb_lib}"
-    fi
-else
-    args="$args -DENABLE_ODB=OFF"
-    echo "ODB not required"
-fi
-if [[ $grib = "on" ]];then
-    args="$args -DENABLE_GRIB=ON "
-    echo "GRIB enabled"
-    if [[ $grib_lib != "" ]];then
-        args=" $args -DGRIB_API_PATH=${grib_lib}"
-    fi
-else
-    args="$args -DENABLE_GRIB=OFF"
-    echo "GRIB not required"
-fi
-if [[ $spot = "on" ]];then
-    args="$args -DENABLE_SPOT=ON "
-    echo "SPOT enabled"
-    if [[ $spot_lib != "" ]];then
-        args=" $args -DSPOT_PATH=${spot_lib}"
-    fi
-else
-    args="$args -DENABLE_SPOT=OFF"
-    echo "GRIB not required"
-fi
-echo "start"
-
-mkdir -p ${build_home}
-cd ${build_home}
-rm -fR *
-
-
-${cmake} ${git_home}/magics $args
-make -j ${run} install
diff --git a/ecbuild_config.h b/ecbuild_config.h
deleted file mode 100644
index 53426ab..0000000
--- a/ecbuild_config.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * (C) Copyright 1996-2012 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.
- */
-
-#ifndef ecbuild_config_h
-#define ecbuild_config_h
-
-#include "ecbuild_platform.h"
-
-/* config info */
-
-#define EC_OS_NAME          "Linux-2.6.32-358.2.1.el6.x86_64"
-#define EC_OS_BITS          64
-#define EC_OS_BITS_STR      "64"
-#define EC_OS_STR           "linux.64"
-#define EC_OS_VERSION       "2.6.32-358.2.1.el6.x86_64"
-#define EC_SYS_PROCESSOR    "x86_64"
-
-#define EC_BUILD_TIMESTAMP  "20140408165549"
-#define EC_BUILD_TYPE       "Release"
-
-#define EC_C_COMPILER_ID      "GNU"
-#define EC_C_COMPILER_VERSION "4.4.7"
-
-#define EC_CXX_COMPILER_ID      "GNU"
-#define EC_CXX_COMPILER_VERSION "4.4.7"
-
-#define EC_C_COMPILER       "/usr/bin/cc"
-#define EC_C_FLAGS          " -pipe -O3 -DNDEBUG"
-
-#define EC_CXX_COMPILER     "/usr/bin/c++"
-#define EC_CXX_FLAGS        " -pipe -O3 -DNDEBUG"
-
-/* #undef EC_HAVE_Fortran */
-
-#ifdef EC_HAVE_Fortran
-
-#define EC_Fortran_COMPILER_ID      ""
-#define EC_Fortran_COMPILER_VERSION ""
-
-#define EC_Fortran_COMPILER "/usr/bin/gfortran"
-#define EC_Fortran_FLAGS    ""
-
-#endif
-
-#endif /* ecbuild_config_h */
diff --git a/ecbuild_platform.h b/ecbuild_platform.h
deleted file mode 100644
index ee18a0d..0000000
--- a/ecbuild_platform.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * (C) Copyright 1996-2012 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.
- */
-
-#ifndef ecbuild_platform_h
-#define ecbuild_platform_h
-
-/* cpu arch info */
-
-/* #undef EC_BIG_ENDIAN */
-#define EC_LITTLE_ENDIAN    1
-
-/* compiler support */
-
-#define EC_HAVE_FUNCTION_DEF
-
-/* os capability checks */
-
-/* --- symbols --- */
-
-#define EC_HAVE_FSEEK
-#define EC_HAVE_FSEEKO
-#define EC_HAVE_FTELLO
-#define EC_HAVE_LSEEK
-#define EC_HAVE_FTRUNCATE
-#define EC_HAVE_OPEN
-#define EC_HAVE_FOPEN
-#define EC_HAVE_FLOCK
-#define EC_HAVE_MMAP
-
-#define EC_HAVE_POSIX_MEMALIGN
-
-#define EC_HAVE_F_GETLK
-#define EC_HAVE_F_SETLKW
-#define EC_HAVE_F_SETLK
-
-#define EC_HAVE_F_GETLK64
-#define EC_HAVE_F_SETLKW64
-#define EC_HAVE_F_SETLK64
-
-#define EC_HAVE_MAP_ANONYMOUS
-#define EC_HAVE_MAP_ANON
-
-/* --- include files --- */
-
-#define EC_HAVE_ASSERT_H      
-#define EC_HAVE_STDLIB_H      
-#define EC_HAVE_UNISTD_H      
-#define EC_HAVE_STRING_H      
-#define EC_HAVE_STRINGS_H     
-#define EC_HAVE_SYS_STAT_H    
-#define EC_HAVE_SYS_TIME_H    
-#define EC_HAVE_SYS_TYPES_H   
-#define EC_HAVE_MALLOC_H      
-/* #undef EC_HAVE_SYS_MALLOC_H */
-
-#define EC_HAVE_MALLOC_H
-/* #undef EC_HAVE_SYS_MALLOC_H */
-
-#define EC_HAVE_SYS_MOUNT_H
-#define EC_HAVE_SYS_VFS_H
-
-/* --- capabilities --- */
-
-#define EC_STAT_SIZEOF_OFF_T 8
-
-#define EC_HAVE_OFFT
-#define EC_HAVE_OFF64T
-
-#define EC_HAVE_STRUCT_STAT
-#define EC_HAVE_STRUCT_STAT64
-#define EC_HAVE_STAT
-#define EC_HAVE_STAT64
-#define EC_HAVE_FSTAT
-#define EC_HAVE_FSTAT64
-
-#define EC_HAVE_FSEEKO64
-#define EC_HAVE_FTELLO64
-#define EC_HAVE_LSEEK64
-#define EC_HAVE_OPEN64
-#define EC_HAVE_FOPEN64
-#define EC_HAVE_FTRUNCATE64
-#define EC_HAVE_FLOCK64
-#define EC_HAVE_MMAP64
-
-#define EC_HAVE_STRUCT_STATVFS
-#define EC_HAVE_STRUCT_STATVFS64
-/* #undef EC_HAVE_STATVFS */
-/* #undef EC_HAVE_STATVFS64 */
-
-#define EC_HAVE_FSYNC
-#define EC_HAVE_FDATASYNC
-#define EC_HAVE_DIRFD
-/* #undef EC_HAVE_SYSPROC */
-#define EC_HAVE_SYSPROCFS
-
-#define EC_HAVE_EXECINFO_BACKTRACE
-
-/* --- asynchronous IO support --- */
-
-#define EC_HAVE_AIO
-#define EC_HAVE_AIO64
-
-/* --- reentrant funtions support --- */
-
-#define EC_HAVE_GMTIME_R
-#define EC_HAVE_GETPWUID_R
-#define EC_HAVE_GETPWNAM_R
-#define EC_HAVE_READDIR_R
-#define EC_HAVE_GETHOSTBYNAME_R
-
-/* --- c compiler support --- */
-
-#define EC_HAVE_C_INLINE
-
-/* --- c++ compiler support --- */
-
-#define EC_HAVE_FUNCTION_DEF
-
-#define EC_HAVE_CXXABI_H
-#define EC_HAVE_CXX_BOOL
-
-#define EC_HAVE_CXX_SSTREAM
-
-#endif /* ecbuild_platform_h */
diff --git a/magics-config.in b/magics-config.in
index 9d93bd5..b6098bc 100644
--- a/magics-config.in
+++ b/magics-config.in
@@ -3,7 +3,7 @@
 prefix=@CMAKE_INSTALL_PREFIX@
 exec_prefix=@CMAKE_INSTALL_PREFIX@/bin
 libdir=@CMAKE_INSTALL_PREFIX@/lib
-includedir=@CMAKE_INSTALL_PREFIX@/include
+includedir=@CMAKE_INSTALL_PREFIX@/include/magics
 F77="@CMAKE_Fortran_COMPILER@"
 CC="@CMAKE_C_COMPILER@"
 CXX="@CMAKE_CXX_COMPILER@"
@@ -259,15 +259,18 @@ if test -f ${libdir}/libMagPlus at CMAKE_SHARED_LIBRARY_SUFFIX@; then
 fi
 
 if test "$double" = "yes"; then
-	precision="${FXX} ${libdir}/libMagPlusDouble.a"
+	precision_static="${FXX} ${libdir}/libMagPlusDouble.a"
+	precision_shared="${FXX} -L${libdir} -lMagPlusDouble"
 else
-	precision="${FXX} ${libdir}/libMagPlusSingle.a"
+	precision_static="${FXX} ${libdir}/libMagPlusSingle.a"
+	precision_shared="${FXX} -L${libdir} -lMagPlusSingle"
 fi
 
 
 if test "$echo_static" = "yes"; then
 	if test -f ${libdir}/libMagPlus.a ; then
-	  static="${precision} ${libdir}/libMagPlus.a -L${libdir} @LDFLAGS@ @MAGICS_EXTRA_LIBS@ $CPPLIBS"
+	  static="${precision_static} ${libdir}/libMagPlus.a -L${libdir} @LDFLAGS@ @MAGICS_EXTRA_LIBS@  @MAGICS_RPATH@ $CPPLIBS"
+      precision=${precision_static}
 	  echo ${static}
 	else
 	  echo "magics-config: NO STATIC LIBRARY available"
@@ -278,8 +281,9 @@ fi
 
 if test "$echo_shared" = "yes"; then
 	if test -f ${libdir}/libMagPlus at CMAKE_SHARED_LIBRARY_SUFFIX@ ; then
-	  shared=" ${precision} -L${libdir} -lMagPlus @LDFLAGS@ @MAGICS_EXTRA_LIBS@ $CPPLIBS"
+	  shared=" ${precision_shared} -L${libdir} -lMagPlus @LDFLAGS@ @MAGICS_RPATH@ $CPPLIBS"
 	  echo ${shared}
+      precision=${precision_shared}
 	else
 	  echo "magics-config: NO SHARED LIBRARY"
 	fi
diff --git a/magics-targets.cmake b/magics-targets.cmake
deleted file mode 100644
index c09094f..0000000
--- a/magics-targets.cmake
+++ /dev/null
@@ -1,30 +0,0 @@
-# Generated by CMake 2.8.10.2
-
-IF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5)
-   MESSAGE(FATAL_ERROR "CMake >= 2.6.0 required")
-ENDIF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5)
-CMAKE_POLICY(PUSH)
-CMAKE_POLICY(VERSION 2.6)
-#----------------------------------------------------------------
-# Generated CMake target import file.
-#----------------------------------------------------------------
-
-# Commands may need to know the format version.
-SET(CMAKE_IMPORT_FILE_VERSION 1)
-
-# Create imported target MagPlusSingle
-ADD_LIBRARY(MagPlusSingle STATIC IMPORTED)
-
-# Make sure the targets which have been exported in some other 
-# export set exist.
-
-# Import target "MagPlusSingle" for configuration "Release"
-SET_PROPERTY(TARGET MagPlusSingle APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
-SET_TARGET_PROPERTIES(MagPlusSingle PROPERTIES
-  IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
-  IMPORTED_LOCATION_RELEASE "/home/graphics/cgs/git/magics/lib/libMagPlusSingle.a"
-  )
-
-# Commands beyond this point should not need to know the version.
-SET(CMAKE_IMPORT_FILE_VERSION)
-CMAKE_POLICY(POP)
diff --git a/magics.sublime-project b/magics.sublime-project
new file mode 100644
index 0000000..2e3ccfe
--- /dev/null
+++ b/magics.sublime-project
@@ -0,0 +1,18 @@
+{
+    "folders": [
+        {
+            "path": ".", 
+            "follow_symlinks": true
+        }
+    ], 
+    "build_systems": [
+        {
+            "working_dir": "${project_path}/../../build/magics", 
+            "cmd": [
+                "make"
+            ], 
+            "file_regex": "([/\\w\\-\\.]+):(\\d+):(\\d+:)?", 
+            "name": "Build"
+        }
+    ]
+}
diff --git a/metview_files/MTHERMOGRIDDef b/metview_files/MTHERMOGRIDDef
new file mode 100644
index 0000000..511fe49
--- /dev/null
+++ b/metview_files/MTHERMOGRIDDef
@@ -0,0 +1,322 @@
+PARAMSHARE ; ParamShare; PARAMSHARE
+{
+	COLOUR {
+		%include MagicsColors.h
+	}
+	STYLE {
+		SOLID; SOLID
+		DASH; DASH
+		DOT; DOT
+		CHAIN_DOT; CHAIN_DOT
+		CHAIN_DASH; CHAIN_DASH
+	}
+}
+
+MTHERMOGRID; Magics; Automatically generated
+{
+	THERMO_ISOTHERM_GRID [ help_text = 'Plot the isotherms' ]
+ 	{
+		ON;  ON
+		OFF; OFF
+	} = ON
+
+	THERMO_ISOTHERM_COLOUR [ help = help_colour,interface = colour, help_text='Colou of the isotherms' ]
+	{ 
+		&PARAMSHARE&COLOUR
+	} = CHARCOAL
+
+	THERMO_ISOTHERM_THICKNESS[ help_text = 'Thickness  of the isotherms' ]
+	{
+		*
+	} = 1
+
+	THERMO_ISOTHERM_STYLE
+	{
+		&PARAMSHARE&STYLE
+	} = SOLID
+
+	THERMO_ISOTHERM_INTERVAL[ help_text = 'interval for isotherms grid' ]
+	{
+		*
+	} = 10
+
+	THERMO_ISOTHERM_REFERENCE[ help_text = 'Reference   of the isotherms' ]
+	{
+		*
+	} = 0
+
+	THERMO_ISOTHERM_REFERENCE_COLOUR [ help = help_colour,interface = colour, help_text='Reference   of the isotherms' ]
+	{ 
+		&PARAMSHARE&COLOUR
+	} = RED
+
+	THERMO_ISOTHERM_REFERENCE_STYLE
+	{
+		&PARAMSHARE&STYLE
+	} = SOLID
+
+	THERMO_ISOTHERM_REFERENCE_THICKNESS[ help_text = 'Reference   of the isotherms' ]
+	{
+		*
+	} = 2
+
+	THERMO_ISOTHERM_LABEL_COLOUR [ help = help_colour,interface = colour, help_text='Label Colour for the isotherms' ]
+	{ 
+		&PARAMSHARE&COLOUR
+	} = CHARCOAL
+
+	THERMO_ISOTHERM_LABEL_FONT_NAME
+	{
+		@
+	} = SANSERIF
+
+	THERMO_ISOTHERM_LABEL_FONT_STYLE
+	{
+		NORMAL;NORMAL
+		BOLD;BOLD
+		ITALIC;ITALIC
+		BOLDITALIC;BOLDITALIC
+	} = NORMAL
+
+	THERMO_ISOTHERM_LABEL_FONT_SIZE[ help_text = 'Font Size used for the isotherms labels' ]
+	{
+		*
+	} = 0.3
+
+	THERMO_ISOTHERM_LABEL_FREQUENCY[ help_text = 'Isotherm frequency for labelling' ]
+	{
+		*
+	} = 1
+
+	THERMO_ISOBAR_GRID [ help_text = 'Plot the isobars' ]
+ 	{
+		ON;  ON
+		OFF; OFF
+	} = ON
+
+	THERMO_ISOBAR_COLOUR [ help = help_colour,interface = colour, help_text='Colou of the isobars' ]
+	{ 
+		&PARAMSHARE&COLOUR
+	} = EVERGREEN
+
+	THERMO_ISOBAR_THICKNESS[ help_text = 'Thickness  of the isobars' ]
+	{
+		*
+	} = 2
+
+	THERMO_ISOBAR_STYLE
+	{
+		&PARAMSHARE&STYLE
+	} = SOLID
+
+	THERMO_ISOBAR_INTERVAL[ help_text = 'Interval between isobars' ]
+	{
+		*
+	} = 100
+
+	THERMO_ISOBAR_REFERENCE[ help_text = 'Line Style  of the isobars' ]
+	{
+		*
+	} = 1000
+
+	THERMO_ISOBAR_LABEL_COLOUR [ help = help_colour,interface = colour, help_text='Label Colour for the isotherms' ]
+	{ 
+		&PARAMSHARE&COLOUR
+	} = EVERGREEN
+
+	THERMO_ISOBAR_LABEL_FONT_NAME
+	{
+		@
+	} = SANSERIF
+
+	THERMO_ISOBAR_LABEL_FONT_STYLE
+	{
+		NORMAL;NORMAL
+		BOLD;BOLD
+		ITALIC;ITALIC
+		BOLDITALIC;BOLDITALIC
+	} = NORMAL
+
+	THERMO_ISOBAR_LABEL_FONT_SIZE[ help_text = 'Font Size used for the isobars labels' ]
+	{
+		*
+	} = 0.3
+
+	THERMO_ISOBAR_LABEL_FREQUENCY[ help_text = 'isobar frequency for labelling' ]
+	{
+		*
+	} = 1
+
+	THERMO_DRY_ADIABATIC_GRID [ help_text = 'Plot the dry_adiabatics' ]
+ 	{
+		ON;  ON
+		OFF; OFF
+	} = ON
+
+	THERMO_DRY_ADIABATIC_COLOUR [ help = help_colour,interface = colour, help_text='Colou of the dry_adiabatics' ]
+	{ 
+		&PARAMSHARE&COLOUR
+	} = CHARCOAL
+
+	THERMO_DRY_ADIABATIC_THICKNESS[ help_text = 'Thickness  of the dry_adiabatics' ]
+	{
+		*
+	} = 1
+
+	THERMO_DRY_ADIABATIC_STYLE
+	{
+		&PARAMSHARE&STYLE
+	} = SOLID
+
+	THERMO_DRY_ADIABATIC_INTERVAL[ help_text = 'Interval between 2 dry_adiabatics.' ]
+	{
+		*
+	} = 10
+
+	THERMO_DRY_ADIABATIC_REFERENCE[ help_text = 'Reference   of the dry_adiabatics' ]
+	{
+		*
+	} = 0
+
+	THERMO_DRY_ADIABATIC_LABEL_COLOUR [ help = help_colour,interface = colour, help_text='Label Colour for the isotherms' ]
+	{ 
+		&PARAMSHARE&COLOUR
+	} = CHARCOAL
+
+	THERMO_DRY_ADIABATIC_LABEL_FONT_NAME
+	{
+		@
+	} = SANSERIF
+
+	THERMO_DRY_ADIABATIC_LABEL_FONT_STYLE
+	{
+		NORMAL;NORMAL
+		BOLD;BOLD
+		ITALIC;ITALIC
+		BOLDITALIC;BOLDITALIC
+	} = NORMAL
+
+	THERMO_DRY_ADIABATIC_LABEL_FONT_SIZE[ help_text = 'Font Size used for the dry_adiabatics labels' ]
+	{
+		*
+	} = 0.3
+
+	THERMO_DRY_ADIABATIC_LABEL_FREQUENCY[ help_text = 'frequency for dry_adiabatic labelling' ]
+	{
+		*
+	} = 1
+
+	THERMO_SATURATED_ADIABATIC_GRID [ help_text = 'Plot the saturated_adiabatics' ]
+ 	{
+		ON;  ON
+		OFF; OFF
+	} = ON
+
+	THERMO_SATURATED_ADIABATIC_COLOUR [ help = help_colour,interface = colour, help_text='Colou of the saturated_adiabatics' ]
+	{ 
+		&PARAMSHARE&COLOUR
+	} = CHARCOAL
+
+	THERMO_SATURATED_ADIABATIC_THICKNESS[ help_text = 'Thickness  of the dry_adiabatics' ]
+	{
+		*
+	} = 2
+
+	THERMO_SATURATED_ADIABATIC_STYLE
+	{
+		&PARAMSHARE&STYLE
+	} = SOLID
+
+	THERMO_SATURATED_ADIABATIC_INTERVAL[ help_text = 'interval for saturated_adiabatics grid' ]
+	{
+		*
+	} = 5
+
+	THERMO_SATURATED_ADIABATIC_REFERENCE[ help_text = 'Reference   of the saturated_adiabatics' ]
+	{
+		*
+	} = 0
+
+	THERMO_SATURATED_ADIABATIC_LABEL_COLOUR [ help = help_colour,interface = colour, help_text='Label Colour for the isotherms' ]
+	{ 
+		&PARAMSHARE&COLOUR
+	} = CHARCOAL
+
+	THERMO_SATURATED_ADIABATIC_LABEL_FONT_NAME
+	{
+		@
+	} = SANSERIF
+
+	THERMO_SATURATED_ADIABATIC_LABEL_FONT_STYLE
+	{
+		NORMAL;NORMAL
+		BOLD;BOLD
+		ITALIC;ITALIC
+		BOLDITALIC;BOLDITALIC
+	} = NORMAL
+
+	THERMO_SATURATED_ADIABATIC_LABEL_FONT_SIZE[ help_text = 'Font Size used for the saturated_adiabatics labels' ]
+	{
+		*
+	} = 0.3
+
+	THERMO_SATURATED_ADIABATIC_LABEL_FREQUENCY[ help_text = 'saturated_adiabatic frequency for labelling' ]
+	{
+		*
+	} = 1
+
+	THERMO_MIXING_RATIO_GRID [ help_text = 'Plot the mixing_ratios' ]
+ 	{
+		ON;  ON
+		OFF; OFF
+	} = ON
+
+	THERMO_MIXING_RATIO_COLOUR [ help = help_colour,interface = colour, help_text='Colou of the mixing_ratios' ]
+	{ 
+		&PARAMSHARE&COLOUR
+	} = PURPLE
+
+	THERMO_MIXING_RATIO_THICKNESS[ help_text = 'Thickness  of the mixing_ratios' ]
+	{
+		*
+	} = 1
+
+	THERMO_MIXING_RATIO_STYLE
+	{
+		&PARAMSHARE&STYLE
+	} = DASH
+
+	THERMO_MIXING_RATIO_FREQUENCY[ help_text = 'mixing_ratio frequency for grid' ]
+	{
+		*
+	} = 1
+
+	THERMO_MIXING_RATIO_LABEL_COLOUR [ help = help_colour,interface = colour, help_text='Label Colour for the isotherms' ]
+	{ 
+		&PARAMSHARE&COLOUR
+	} = PURPLE
+
+	THERMO_MIXING_RATIO_LABEL_FONT_NAME
+	{
+		@
+	} = SANSERIF
+
+	THERMO_MIXING_RATIO_LABEL_FONT_STYLE
+	{
+		NORMAL;NORMAL
+		BOLD;BOLD
+		ITALIC;ITALIC
+		BOLDITALIC;BOLDITALIC
+	} = NORMAL
+
+	THERMO_MIXING_RATIO_LABEL_FONT_SIZE[ help_text = 'Font Size used for the mixing_ratios labels' ]
+	{
+		*
+	} = 0.3
+
+	THERMO_MIXING_RATIO_LABEL_FREQUENCY[ help_text = 'mixing_ratio frequency for labelling' ]
+	{
+		*
+	} = 1
+
+}
diff --git a/metview_files/MTHERMOGRIDRules b/metview_files/MTHERMOGRIDRules
new file mode 100644
index 0000000..bbfe9f1
--- /dev/null
+++ b/metview_files/MTHERMOGRIDRules
@@ -0,0 +1,62 @@
+
+%if THERMO_ISOTHERM_GRID <> ON %then
+	%unset THERMO_ISOTHERM_LABEL_FONT_STYLE
+	%unset THERMO_ISOTHERM_LABEL_COLOUR
+	%unset THERMO_ISOTHERM_LABEL_FREQUENCY
+	%unset THERMO_ISOTHERM_REFERENCE_STYLE
+	%unset THERMO_ISOTHERM_REFERENCE_THICKNESS
+	%unset THERMO_ISOTHERM_STYLE
+	%unset THERMO_ISOTHERM_COLOUR
+	%unset THERMO_ISOTHERM_REFERENCE
+	%unset THERMO_ISOTHERM_LABEL_FONT_NAME
+	%unset THERMO_ISOTHERM_INTERVAL
+	%unset THERMO_ISOTHERM_REFERENCE_COLOUR
+	%unset THERMO_ISOTHERM_THICKNESS
+	%unset THERMO_ISOTHERM_LABEL_FONT_SIZE
+
+%if THERMO_MIXING_RATIO_GRID <> ON %then
+	%unset THERMO_MIXING_RATIO_STYLE
+	%unset THERMO_MIXING_RATIO_COLOUR
+	%unset THERMO_MIXING_RATIO_LABEL_COLOUR
+	%unset THERMO_MIXING_RATIO_LABEL_FONT_STYLE
+	%unset THERMO_MIXING_RATIO_LABEL_FONT_SIZE
+	%unset THERMO_MIXING_RATIO_LABEL_FONT_NAME
+	%unset THERMO_MIXING_RATIO_THICKNESS
+	%unset THERMO_MIXING_RATIO_LABEL_FREQUENCY
+
+%if THERMO_ISOBAR_GRID <> ON %then
+	%unset THERMO_ISOBAR_INTERVAL
+	%unset THERMO_ISOBAR_LABEL_FREQUENCY
+	%unset THERMO_ISOBAR_COLOUR
+	%unset THERMO_ISOBAR_LABEL_FONT_NAME
+	%unset THERMO_ISOBAR_STYLE
+	%unset THERMO_ISOBAR_THICKNESS
+	%unset THERMO_ISOBAR_LABEL_FONT_SIZE
+	%unset THERMO_ISOBAR_LABEL_REFERENCE
+	%unset THERMO_ISOBAR_LABEL_COLOUR
+	%unset THERMO_ISOBAR_LABEL_FONT_STYLE
+	%unset THERMO_ISOBAR_REFERENCE
+
+%if THERMO_SATURATED_ADIABATIC_GRID <> ON %then
+	%unset THERMO_SATURATED_ADIABATIC_REFERENCE
+	%unset THERMO_SATURATED_ADIABATIC_LABEL_FONT_STYLE
+	%unset THERMO_SATURATED_ADIABATIC_LABEL_COLOUR
+	%unset THERMO_SATURATED_ADIABATIC_LABEL_FONT_NAME
+	%unset THERMO_SATURATED_ADIABATIC_STYLE
+	%unset THERMO_SATURATED_ADIABATIC_THICKNESS
+	%unset THERMO_SATURATED_ADIABATIC_COLOUR
+	%unset THERMO_SATURATED_ADIABATIC_LABEL_FONT_SIZE
+	%unset THERMO_SATURATED_ADIABATIC_LABEL_FREQUENCY
+	%unset THERMO_SATURATED_ADIABATIC_INTERVAL
+
+%if THERMO_DRY_ADIABATIC_GRID <> ON %then
+	%unset THERMO_DRY_ADIABATIC_THICKNESS
+	%unset THERMO_DRY_ADIABATIC_COLOUR
+	%unset THERMO_DRY_ADIABATIC_STYLE
+	%unset THERMO_DRY_ADIABATIC_LABEL_FONT_NAME
+	%unset THERMO_DRY_ADIABATIC_LABEL_COLOUR
+	%unset THERMO_DRY_ADIABATIC_REFERENCE
+	%unset THERMO_DRY_ADIABATIC_LABEL_FONT_STYLE
+	%unset THERMO_DRY_ADIABATIC_LABEL_FREQUENCY
+	%unset THERMO_DRY_ADIABATIC_LABEL_FONT_SIZE
+	%unset THERMO_DRY_ADIABATIC_INTREVAL
diff --git a/python/Magics/CMakeLists.txt b/python/Magics/CMakeLists.txt
index 59de143..d1d920c 100644
--- a/python/Magics/CMakeLists.txt
+++ b/python/Magics/CMakeLists.txt
@@ -2,8 +2,15 @@ if( ENABLE_PYTHON AND NUMPY_FOUND )
 
   ### python destination
 
-  set(PYTHON_SITE "lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages" )
-  set(PYTHON_DEST "${PYTHON_SITE}/Magics" )
+  set( PYTHON_SITE "lib/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 )
+
+  ecbuild_append_to_rpath( ${relative_rpath} )
+  ecbuild_append_to_rpath( "../../lib" ) # for the ctest to find magics libs
 
   ### place in build tree so we can run python tests
 
@@ -16,9 +23,9 @@ if( ENABLE_PYTHON AND NUMPY_FOUND )
 
   include_directories( ${PYTHON_INCLUDE_DIRS} ${NUMPY_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR} )
 
-  set_source_files_properties( Magics.i PROPERTIES GENERATED TRUE CXX ON )
+  set_source_files_properties( ${CMAKE_CURRENT_BINARY_DIR}/Magics.i PROPERTIES GENERATED TRUE CXX ON )
 
-  swig_add_module( Magics python Magics_interface.cc Magics.i )
+  swig_add_module( Magics python Magics_interface.cc ${CMAKE_CURRENT_BINARY_DIR}/Magics.i )
 
   set_source_files_properties(partio.i PROPERTIES SWIG_FLAGS "-includeall")
 
diff --git a/python/Magics/Magics_interface.cc b/python/Magics/Magics_interface.cc
index 99d16ea..321ad28 100755
--- a/python/Magics/Magics_interface.cc
+++ b/python/Magics/Magics_interface.cc
@@ -89,6 +89,11 @@ void wrepjson() {
   mag_wrepjson();
 }
 
+
+void epsinput() {
+  mag_epsinput();
+}
+
 void epsgraph() {
   mag_epsgraph();
 }
diff --git a/python/Magics/import b/python/Magics/import
deleted file mode 100644
index dc3d935..0000000
--- a/python/Magics/import
+++ /dev/null
@@ -1,2 +0,0 @@
-ys.path.insert(0, '/usr/local/apps/odb_api/0.9.26/lib/python2.7.1/site-packages')
-import odb
diff --git a/python/Magics/macro.py b/python/Magics/macro.py
index 4a2c9f5..f8becfd 100644
--- a/python/Magics/macro.py
+++ b/python/Magics/macro.py
@@ -403,6 +403,7 @@ mtable = make_action("mtable", Magics.mtable, "CSV+Table+Decoder")
 
 
 mwrepjson = make_action("mwrepjson", Magics.wrepjson, "WrepJSon")
+mepsinput = make_action("mepsinput", Magics.epsinput, "EpsInput")
 mepscloud = make_action("mepscloud", Magics.epscloud)
 mepsbar = make_action("mepsbar", Magics.epsbar)
 mepswind = make_action("mepswind", Magics.epswind)
diff --git a/share/magics/10m/10m_populated_places_simple.dbf b/share/magics/10m/10m_populated_places_simple.dbf
new file mode 100755
index 0000000..1823111
Binary files /dev/null and b/share/magics/10m/10m_populated_places_simple.dbf differ
diff --git a/share/magics/10m/10m_populated_places_simple.shp b/share/magics/10m/10m_populated_places_simple.shp
new file mode 100755
index 0000000..90d2b4e
Binary files /dev/null and b/share/magics/10m/10m_populated_places_simple.shp differ
diff --git a/share/magics/10m/10m_populated_places_simple.shx b/share/magics/10m/10m_populated_places_simple.shx
new file mode 100755
index 0000000..28c7910
Binary files /dev/null and b/share/magics/10m/10m_populated_places_simple.shx differ
diff --git a/share/magics/bufr_80.xml b/share/magics/bufr_80.xml
index 734e57f..191fdf5 100644
--- a/share/magics/bufr_80.xml
+++ b/share/magics/bufr_80.xml
@@ -60,6 +60,7 @@
     	<past_weather_1 descriptor='20004'/>
     	<past_weather_2 descriptor='20005'/>
     	<cloud_amount descriptor='20011'/>
+    	<station_type descriptor='2001'/>
     	<height_of_cloud_base descriptor='20013'/>
    	 <dewpoint_2meters descriptor='12006'/>
     <sea_temperature descriptor='22043'/>
diff --git a/share/magics/bufr_98.xml b/share/magics/bufr_98.xml
index 7ee2291..1cfde3b 100644
--- a/share/magics/bufr_98.xml
+++ b/share/magics/bufr_98.xml
@@ -56,6 +56,7 @@
     <past_weather_1 descriptor='20004'/>
     <past_weather_2 descriptor='20005'/>
     <cloud_amount descriptor='20011'/>
+    <station_type descriptor='2001'/>
     <height_of_cloud_base descriptor='20013'/>
     <dewpoint_2meters descriptor='12006'/>
     <sea_temperature descriptor='22042'/>
diff --git a/share/magics/epsg.json b/share/magics/epsg.json
index 897539e..91b22ba 100644
--- a/share/magics/epsg.json
+++ b/share/magics/epsg.json
@@ -35,9 +35,9 @@
    {
 		"lambert_north_atlantic" : {
     		"definition" : "+proj=lcc +lon_0=40w +x_0=2000000 +y_0=2000000 +ellps=WGS84 +datum=WGS84",
-			"min_longitude" : -220,
+			"min_longitude" : -180,
 			"min_latitude" : -20,
-			"max_longitude" : +140,
+			"max_longitude" : +180,
 			"max_latitude" : 90,
             "method" : "conic"
     	}
diff --git a/share/magics/symbols.svg b/share/magics/symbols.svg
index 95e89a1..de0445e 100644
--- a/share/magics/symbols.svg
+++ b/share/magics/symbols.svg
@@ -75,8 +75,8 @@
    </g>
    <g id='magics_13'>
       	<circle cx='0' cy='0' r='0.5' fill='0'/>
-   	<polyline points='-0.5,-0.5 0.5,0.5' fill='none'/>
-	<polyline points='-0.5,0.5 0.5,-0.5' fill='none'/>
+   	<polyline points='-0.35,-0.35 0.35,0.35' fill='none'/>
+	<polyline points='-0.35,0.35 0.35,-0.35' fill='none'/>
    </g>
    <g id='magics_14'>
 	<polyline points='-0.5,-0.5 -0.5,0.5 0.5,0.5 0.5,-0.5 -0.5,-0.5' fill='none'/>
@@ -587,14 +587,17 @@
 </g>
 <g id="ww_96">
     <triangle cx='0' cy='0.55' r='0.2' fill='0' />
-  
-  
     <lightning cx='0' cy='0'  r='0.5'/>
 </g>
 <g id="ww_97">
     <circle r="0.1" cx="0." cy="0.6" fill="8" />
     <lightning cx='0' cy='0'  r='0.4'/>
 </g>
+
+<g id="ww_99">
+	<triangle cx='0' cy='0.55' r='0.3' fill='0' />
+    <lightning cx='0' cy='0'  r='0.4'/>
+</g>
    <g id='N_0'>
  	<circle cx='0' cy='0' r='0.5' fill='0'/>
    </g> 
diff --git a/share/magics/title_template.xml b/share/magics/title_template.xml
index fefbcb3..4808de1 100644
--- a/share/magics/title_template.xml
+++ b/share/magics/title_template.xml
@@ -1,49 +1,57 @@
 
  <!-- Default title  -->
-<title> <centre/> <gribapi key='typeOfGeneratingProcess'/> <base_date format = 'Base Time: %A %d %B %Y %H UTC'/> <parameter/>
+<title> 
+	<text>
+	<centre/> <gribapi key='typeOfGeneratingProcess'/> <base_date format = 'Base Time: %A %d %B %Y %H UTC'/> <parameter/></text>
     <!-- OBSTAT -->
-    <title observationDiagnostic=''>Statistics for <gribapi key='codeType'/> from  <gribapi key='platform'/> / <gribapi key='instrument'/> 
-         <newline/><gribapi key='observationDiagnostic'/> [ <gribapi key='units'/> ] ( <gribapi key='dataSelection'/> ) 
-         <newline/>Exp = <gribapi key='experimentVersionNumber'/> Channel =   <gribapi key='scaledValueOfFirstFixedSurface'/> 
-         <newline/>Min: <gribapi key='min'/> Max: <gribapi key='max'/> Mean: <gribapi key='average'/>
+    <title observationDiagnostic=''>
+    	<text>Statistics for <gribapi key='codeType'/> from  <gribapi key='platform'/> / <gribapi key='instrument'/> 
+        	 <newline/><gribapi key='observationDiagnostic'/> [ <gribapi key='units'/> ] ( <gribapi key='dataSelection'/> ) 
+         	<newline/>Exp = <gribapi key='experimentVersionNumber'/> Channel =   <gribapi key='scaledValueOfFirstFixedSurface'/> 
+         	<newline/>Min: <gribapi key='min'/> Max: <gribapi key='max'/> Mean: <gribapi key='average'/></text>
     </title>   	 
-    <title typeOfGeneratingProcess='1'>
-        <base_date format = '%A %d %B %Y %H UTC'/> <centre format = "%s Analysis"/> <level/> <parameter/> <units/> <expver/>  <plot_type/> 
+    <title typeOfGeneratingProcess='1'> 
+    	<text><base_date format = '%A %d %B %Y %H UTC'/> <centre format = "%s Analysis"/> <level/> <parameter/><units/><expver/></text>
     </title>
     <title 	timeRangeIndicator='1'>
-        <base_date format = '%A %d %B %Y %H UTC'/> <centre format = "%s Analysis"/> <level/> <parameter/> <units/> <expver/>  <plot_type/> 
+    	<text><base_date format = '%A %d %B %Y %H UTC'/> <centre format = "%s Analysis"/> <level/> <parameter/><units/><expver/></text>
+    </title>
+    <title dataType='im' timeRangeIndicator='0'> 
+    	<text><base_date format = '%A %d %B %Y %H%M UTC'/> <centre  format = "%s Forecast"/> <step format="t+%s"/> <valid_date format = 'VT:%A %d %B %Y %H%M UTC'/> <satellite/> <channel/></text>
     </title>
     <title typeOfGeneratingProcess='2'>
-        <base_date format = '%A %d %B %Y %H UTC'/> <centre  format = "%s Forecast"/> <step format="t+%s"/> 
-<valid_date format = 'VT:%A %d %B %Y %H UTC'/> <level/> <parameter/> <units/> <expver/>  <plot_type/> 
+    	<text><base_date format = '%A %d %B %Y %H UTC'/> <centre  format = "%s Forecast"/> <step format="t+%s"/> 
+			<valid_date format = 'VT:%A %d %B %Y %H UTC'/> <level/> <parameter/><units/><expver/></text>
     </title>
     <title timeRangeIndicator='0'>
-        <base_date format = '%A %d %B %Y %H UTC'/> <centre  format = "%s Forecast"/> <step format="t+%s"/> 
-<valid_date format = 'VT:%A %d %B %Y %H UTC'/> <level/> <parameter/> <units/> <expver/>  <plot_type/> 
+    	<text><base_date format = '%A %d %B %Y %H UTC'/> <centre  format = "%s Forecast"/> <step format="t+%s"/> <valid_date format = 'VT:%A %d %B %Y %H UTC'/> <level/> <parameter/><units/><expver/></text>
+    </title>
+    <title timeRangeIndicator='4'>
+    	<text><base_date format = '%A %d %B %Y %H UTC'/> <centre  format = "%s Forecast"/> <step format="t+%s"/> 
+<valid_date format = 'VT:%A %d %B %Y %H UTC'/> <level/> <parameter/><units/><expver/></text>
     </title>
     <title dataType='fc'>
-        <base_date format = '%A %d %B %Y %H UTC'/> <centre/> <product/> <step format="t+%s"/> 
-<valid_date format = 'VT:%A %d %B %Y %H UTC'/> <level/> <parameter/> <units/> <expver/>  <plot_type/> 
+    	<text><base_date format = '%A %d %B %Y %H UTC'/> <centre/> <product/> <step format="t+%s"/> 
+<valid_date format = 'VT:%A %d %B %Y %H UTC'/> <level/> <parameter/><units/><expver/></text>
     </title>
     <!-- EPS Control Forecast forecasts -->
-     <title dataType='cf'>
-        <base_date format = '%A %d %B %Y %H UTC'/> <centre/> <product/> <step format="t+%s"/> 
-<valid_date format = 'VT:%A %d %B %Y %H UTC'/> <level/> <parameter/> <units/> <expver/>  <plot_type/> 
+    <title dataType='cf'>
+    	<text><base_date format = '%A %d %B %Y %H UTC'/> <centre/> <product/> <step format="t+%s"/> 
+<valid_date format = 'VT:%A %d %B %Y %H UTC'/> <level/> <parameter/> <units/> <expver/></text>
     </title>
     <!-- Normal analysis -->
     <title dataType='an'>
-        <centre/> <product/> <base_date format = 'VT: %A %d %B %Y %H UTC'/> <level/> <parameter/> <units/> <expver/>  <plot_type/> 
+    	<text><centre/> <product/> <base_date format = 'VT: %A %d %B %Y %H UTC'/> <level/> <parameter/> <units/> <expver/></text>
     </title>
     <!-- Ensemble means, Standard devs, and perturbed forecast -->
     <title dataType='em' stream='enfo'>
-        <base_date format = '%A %d %B %Y %H UTC '/> <centre/> <product/> <step format="t+%s"/> <valid_date format = 'VT:%A %d %B %Y %H UTC'/>
-<newline/><level/><parameter/><units/><expver/><eps_number_info/>
+    	<text><base_date format = '%A %d %B %Y %H UTC '/> <centre/> <product/> <step format="t+%s"/> <valid_date format = 'VT:%A %d %B %Y %H UTC'/>
+<newline/><level/> <parameter/> <units/> <expver/> <eps_number_info/></text>
      </title>
      <title dataType='ep' stream='enfo'>
-        <base_date format = '%A %d %B %Y %H UTC '/> <centre/> <product/> <step format="t+%s"/> <valid_date format = 'VT:%A %d %B %Y %H UTC'/>
-<newline/><level/><parameter/><units/><expver/><eps_number_info/>
+    	<text><base_date format = '%A %d %B %Y %H UTC '/> <centre/> <product/> <step format="t+%s"/> <valid_date format = 'VT:%A %d %B %Y %H UTC'/>
+<newline/><level/> <parameter/> <units/> <expver/> <eps_number_info/></text>
      </title>
-     <title dataType='im'> <satellite/> <channel/> <date format = '%A %d %B %Y %H UTC '/> </title>
 </title>
  
  
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 751b16f..335e0d3 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -8,8 +8,28 @@ install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/magics.pc      DESTINATION ${INSTALL
 
 ###############################################################################
 
+
+function( add_metview_definition_file )
+   
+    set( single_value_args ACTION BASENAME FILE ) 
+    cmake_parse_arguments( _p "${options}" "${single_value_args}" "${multi_value_args}"  ${_FIRST_ARG} ${ARGN} )
+     
+    add_custom_command( 
+            OUTPUT ${_p_BASENAME}Def ${_p_BASENAME}Rules
+            COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/xml2mv.py ${CMAKE_CURRENT_SOURCE_DIR} ${_p_FILE}  ${_p_BASENAME}Def ${_p_ACTION} ${_p_BASENAME}Rules
+            DEPENDS ${_p_FILE}
+      )
+     
+     
+    add_custom_target( ${_p_BASENAME} ALL DEPENDS ${_p_BASENAME}Def)
+    install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/${_p_BASENAME}Def ${CMAKE_CURRENT_BINARY_DIR}/${_p_BASENAME}Rules DESTINATION ${INSTALL_DATA_DIR}/../magics/metview)
+
+endfunction(add_metview_definition_file)
+
 add_subdirectory( params )
 
+
+
 foreach( file ${magics_xmls} )
 
       get_filename_component( path     ${file} PATH   )
@@ -31,7 +51,9 @@ foreach( file ${magics_xmls} )
 
 endforeach()
      
-if ( metview )      
+if ( metview )
+
+      
 	foreach( file ${metview_xmls} )
 	      get_filename_component( path     ${file} PATH   )
           get_filename_component( basefile ${file} NAME_WE )
@@ -86,15 +108,7 @@ if( MAGICS_ODB )
 	add_subdirectory( oda )
 endif()
 
-ecbuild_add_library( TARGET    MagPlusSingle 
-		     SOURCES MagicsSingle.cc
-		     INCLUDES  ${CMAKE_CURRENT_SOURCE_DIR}/common
-		     TYPE STATIC)
-		     
-ecbuild_add_library( TARGET    MagPlusDouble 
-		     SOURCES MagicsDouble.cc
-		     INCLUDES  ${CMAKE_CURRENT_SOURCE_DIR}/common
-		     TYPE STATIC)		     
+include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/common )
 
 ecbuild_add_library( TARGET    MagPlusShared
                      DEPENDS   magics_params
@@ -119,7 +133,24 @@ ecbuild_add_library( TARGET    MagPlusShared
                         ${MAGICS_EXTRA_LIBRARIES}
 		            TYPE SHARED		     
                     )
+
+ecbuild_add_library( TARGET    MagPlusSingleShared 
+		     SOURCES MagicsSingle.cc
+             LIBS MagPlusShared
+		     TYPE SHARED)
+		     
+ecbuild_add_library(TARGET    MagPlusDoubleShared 
+             LIBS MagPlusShared
+		     SOURCES MagicsDouble.cc
+		     TYPE SHARED)		     
+
 SET_TARGET_PROPERTIES(MagPlusShared PROPERTIES OUTPUT_NAME "MagPlus")
+SET_TARGET_PROPERTIES(MagPlusDoubleShared PROPERTIES OUTPUT_NAME "MagPlusDouble")
+SET_TARGET_PROPERTIES(MagPlusSingleShared PROPERTIES OUTPUT_NAME "MagPlusSingle")
+
+
+
+
 if ( ENABLE_STATIC_LIBRARY ) 	     
 ecbuild_add_library( TARGET    MagPlusStatic
                      DEPENDS   magics_params
@@ -144,22 +175,24 @@ ecbuild_add_library( TARGET    MagPlusStatic
                         ${MAGICS_EXTRA_LIBRARIES} 
 		            TYPE STATIC		     
                     )
+ecbuild_add_library( TARGET    MagPlusSingleStatic 
+		     SOURCES MagicsSingle.cc
+		     INCLUDES  ${CMAKE_CURRENT_SOURCE_DIR}/common
+		     TYPE SHARED)
+		     
+ecbuild_add_library(TARGET    MagPlusDoubleStatic 
+		     SOURCES MagicsDouble.cc
+		     INCLUDES  ${CMAKE_CURRENT_SOURCE_DIR}/common
+		     TYPE SHARED)
 
     SET_TARGET_PROPERTIES(MagPlusStatic PROPERTIES OUTPUT_NAME "MagPlus")
+    SET_TARGET_PROPERTIES(MagPlusDoubleStatic PROPERTIES OUTPUT_NAME "MagPlusDouble")
+    SET_TARGET_PROPERTIES(MagPlusSingleStatic PROPERTIES OUTPUT_NAME "MagPlusSingle")
 
 endif()
 
 if( metview )
-  ecbuild_add_library( TARGET    MagWrapper
-                     DEPENDS   mv_params
-                     SOURCES
-                        magics.h
-                        ${metview_srcs} 
-                        ${metview_wrappers_srcs} 
-                     DEFINITIONS
-                        ${MAGICS_EXTRA_DEFINITIONS}
-                     INCLUDES  
-                        ${CMAKE_CURRENT_SOURCE_DIR} 
+ include_directories(  ${CMAKE_CURRENT_SOURCE_DIR} 
                         ${CMAKE_CURRENT_BINARY_DIR} 
                         ${CMAKE_CURRENT_BINARY_DIR}/params 
                         ${CMAKE_CURRENT_SOURCE_DIR}/common  
@@ -171,7 +204,16 @@ if( metview )
                         ${CMAKE_CURRENT_SOURCE_DIR}/terralib
                         ${CMAKE_CURRENT_SOURCE_DIR}/terralib/kernel
                         ${CMAKE_CURRENT_SOURCE_DIR}/terralib/utils 
-                        ${CMAKE_CURRENT_SOURCE_DIR}/libMagWrapper
+                        ${CMAKE_CURRENT_SOURCE_DIR}/libMagWrapper )
+                        
+  ecbuild_add_library( TARGET    MagWrapper
+                     DEPENDS   mv_params magics_params
+                     SOURCES
+                        magics.h
+                        ${metview_srcs} 
+                        ${metview_wrappers_srcs} 
+                     DEFINITIONS
+                        ${MAGICS_EXTRA_DEFINITIONS}                   
                     LIBS
                         ${MAGICS_EXTRA_LIBRARIES}
                     TYPE STATIC		
diff --git a/src/MagicsDouble.cc b/src/MagicsDouble.cc
index 5723e3b..c202604 100755
--- a/src/MagicsDouble.cc
+++ b/src/MagicsDouble.cc
@@ -73,16 +73,13 @@
  
  \section links Links
  
- - <a href="http://www.ecmwf.int/publications/manuals/magics/index.html">Magics++ homepage</a>
+ - <a href="http://software.ecmwf.int/magics">Magics++ homepage</a>
  
  - <a href="http://www.ecmwf.int/services/computing/training/material/com_mag.html">Training course</a>
- 
- - <a href="file:///scratch/graphics/cgi/mpptestsuite/html/test/fortran/timings.html">Magics++ test suite [ECMWF internal]</a>
- 
- 
+  
  \section copyright License
  
-  Copyright 2007 European Centre for Medium-Range Weather Forecasts (ECMWF)
+  Copyright 2007-2014 European Centre for Medium-Range Weather Forecasts (ECMWF)
 
   Licensed under the Apache License, Version 2.0 (the "License"); 
   you may not use this file except in compliance with the License. 
diff --git a/src/basic/BasicGraphicsObject.h b/src/basic/BasicGraphicsObject.h
index 8f1357b..4f563ec 100644
--- a/src/basic/BasicGraphicsObject.h
+++ b/src/basic/BasicGraphicsObject.h
@@ -28,12 +28,11 @@
 
 #include "magics.h"
 
-#include "MagLog.h"
-
+#include <algorithm>
 
+#include "MagLog.h"
 #include "VectorOfPointers.h"
 
-
 namespace magics {
 
 class BaseDriver;
@@ -45,7 +44,7 @@ class BasicGraphicsObjectContainer;
 
 class BasicGraphicsObject {
 public:
-	BasicGraphicsObject();	
+	BasicGraphicsObject();
 	virtual ~BasicGraphicsObject();
 
 	virtual bool reproject(BasicGraphicsObjectContainer&) const 
@@ -79,8 +78,6 @@ public:
 	int widthResolution() const { return widthResolution_; }
 	int heightResolution() const { return heightResolution_; }
 
-
-
 	virtual bool buildTree(const Layout&,  unsigned int, const BaseDriver&) const
 	{ return false; }
 
@@ -121,19 +118,17 @@ public:
 		object->parent(this);
 	}
 	void push_last(BasicGraphicsObject* object)
-		{
-			object->check(); // here we make sure that the object is not in 2 containres!
-			last_.push_back(object);
-			object->parent(this);
-		}
+	{
+		object->check(); // here we make sure that the object is not in 2 containres!
+		last_.push_back(object);
+		object->parent(this);
+	}
 
-	
 	void clear();
 	bool buildTree(const Layout&,  unsigned int, const BaseDriver&) const;
 	void release();
 	void remove(BasicGraphicsObject* object) {
-		std::remove(objects_.begin(), objects_.end(), object);
-
+		objects_.erase(std::remove(objects_.begin(), objects_.end(), object), objects_.end());
 	}
 
 
diff --git a/src/basic/FortranMagics.cc b/src/basic/FortranMagics.cc
index e2ef99f..d610de2 100644
--- a/src/basic/FortranMagics.cc
+++ b/src/basic/FortranMagics.cc
@@ -53,7 +53,6 @@
 #include "XYList.h"
 #include "GraphPlotting.h"
 #include "InputMatrix.h"
-#include "ImagePlotting.h"
 #include "BoxPlotDecoder.h"
 #include "BoxPlotVisualiser.h"
 #include "SimplePolylineInput.h"
@@ -554,13 +553,7 @@ void FortranMagics::pgrib()
 
 void FortranMagics::pimage()
 {
-	actions();
-	if ( !action_ ) {
-		action_ = new VisualAction();
-		action_->data(new GribDecoder());
-	}
-	action_->visdef(new ImagePlotting());
-	action_ = 0;
+	MagLog::warning() <<" pimage is deprecated! Please use pcont."<< endl;
 }
 #else
 void FortranMagics::pgrib()
@@ -569,6 +562,7 @@ void FortranMagics::pgrib()
 
 void FortranMagics::pimage()
 {
+	MagLog::warning() <<" pimage is deprecated! Please use pcont."<< endl;
 }
 #endif
 
@@ -649,7 +643,7 @@ bool FortranMagics::geographical()
 	ParameterManager::get("subpage_map_projection", projection);
 	if ( magCompare(projection, "cartesian") ) return false;
 	if ( magCompare(projection, "taylor") ) return false;
-	if ( magCompare(projection, "tephigram") ) return false;
+	if ( magCompare(projection, "thermo") ) return false;
 	if ( magCompare(projection, "tephiinfo") ) return false;
 	return true;
 }
@@ -855,6 +849,7 @@ void FortranMagics::pline()
 }
 
 #include "WrepJSon.h"
+#include "EpsXmlInput.h"
 #include "EpsGraph.h"
 void  FortranMagics::wrepjson()
 {
@@ -869,6 +864,18 @@ void  FortranMagics::wrepjson()
 	action_->data(wrep);
 
 }
+void  FortranMagics::epsinput()
+{
+	actions();
+	action_ = new VisualAction();
+
+	EpsXmlInput* input = new EpsXmlInput();
+
+	top()->push_back(action_);
+	action_->data(input);
+}
+
+
 
 void  FortranMagics::epscloud()
 {
diff --git a/src/basic/FortranMagics.h b/src/basic/FortranMagics.h
index 67a14ed..9d6da2c 100644
--- a/src/basic/FortranMagics.h
+++ b/src/basic/FortranMagics.h
@@ -81,6 +81,7 @@ public:
 	void simplelegend();
 
 	//Wrep-Eps family!
+	void epsinput();
 	void wrepjson();
 	void epscloud();
 	void epsplumes();
diff --git a/src/basic/ImportObjectHandler.cc b/src/basic/ImportObjectHandler.cc
index 0d63ced..38fafeb 100644
--- a/src/basic/ImportObjectHandler.cc
+++ b/src/basic/ImportObjectHandler.cc
@@ -49,10 +49,10 @@ void  ImportObjectHandler::visit(SceneLayer& tree, vector<LayoutVisitor*>&)
    layout_ = new Layout();
    import->add(layout_);
    
-   layout_->x(adjustDimension(ImportObjectHandlerAttributes::x_,0., BasicPositionalObject::absoluteWidth()));
-   layout_->y( adjustDimension(ImportObjectHandlerAttributes::y_, 0.,BasicPositionalObject::absoluteHeight()));
-   layout_->width(adjustDimension(ImportObjectHandlerAttributes::width_, 10., BasicPositionalObject::absoluteWidth()));
-   layout_->height(adjustDimension(ImportObjectHandlerAttributes::height_, 10., BasicPositionalObject::absoluteHeight()));
+   layout_->x(adjustDimension(import_x_,0., BasicPositionalObject::absoluteWidth()));
+   layout_->y( adjustDimension(import_y_, 0.,BasicPositionalObject::absoluteHeight()));
+   layout_->width(adjustDimension(import_width_, 100., BasicPositionalObject::absoluteWidth()));
+   layout_->height(adjustDimension(import_height_, 100., BasicPositionalObject::absoluteHeight()));
 
    //layout_->frame(true, true, Colour("blue"), M_DOT, 3);
    //layout_->frameIt();
@@ -60,8 +60,8 @@ void  ImportObjectHandler::visit(SceneLayer& tree, vector<LayoutVisitor*>&)
    ImportObject* object = new ImportObject();
    object->setPath(path_);
    object->setOrigin(PaperPoint(0, 0));
-   object->setWidth(100);
-   object->setHeight(100);
+   object->setWidth(import_width_ == -1 ? import_width_ : 100);
+   object->setHeight(import_height_ == -1 ? import_height_: 100);
    object->setFormat(format_);
    object->setOriginReference(ImportObject::bottom_left);
    layout_->push_back(object);
diff --git a/src/basic/Layer.cc b/src/basic/Layer.cc
index eb0843a..475a672 100644
--- a/src/basic/Layer.cc
+++ b/src/basic/Layer.cc
@@ -125,21 +125,21 @@ string Layer::timeEnd(const string& fmt) const
 	return to_.tostring(fmt);
 }
 
-static string kml("%Y-%m-%dT%H:%M:00Z");
+static string iso_time("%Y-%m-%dT%H:%M:00Z");
 
-string Layer::kmlTimeBegin() const 
+string Layer::timeBegin() const 
 { 
-	return timeBegin(kml); 
+	return timeBegin(iso_time); 
 }
 
-string Layer::kmlTimeEnd() const 
+string Layer::timeEnd() const 
 { 
-	return timeEnd(kml);  
+	return timeEnd(iso_time);  
 }
 
-string Layer::kmlTimeStamp() const
+string Layer::timeStamp() const
 {
-	return timeStamp(kml);
+	return timeStamp(iso_time);
 }
 
 void Layer:: execute(const BaseDriver& ) const 
@@ -583,6 +583,7 @@ void TextLayer::getInfo(int i, const BaseDriver&  driver) const
 		parent->push_back(layout);
 	}
 	parent->redisplay(driver);
+	delete parent;
 }
 
 void TextLayer::collectText(vector<TextVisitor*>& texts, LegendVisitor* legend)
@@ -625,17 +626,14 @@ bool SceneLayer::buildTree(const Layout& parent,  unsigned int frame, const Base
 	layout_->x(parent.x());
 	layout_->y(parent.y());
 
-
-
 	getReady(frame);
 	execute(frame, out);
 	textHandler_.getInfo(frame, out);
 
-
-
-
 	return ( frame+1 < numberOfSteps() );
 }
+
+
 void SceneLayer::redisplay(const BaseDriver& driver) const
 {
 	intarray frames = driver.frames();
@@ -758,7 +756,7 @@ vector<Layer*>& SceneLayer::prepare(int i) const
 	return steps_[i];
 } 
 
-void  SceneLayer:: execute(int i, const BaseDriver& driver) const 
+void  SceneLayer::execute(int i, const BaseDriver& driver) const 
 {
 	// Look for the step! 
 	int size =  (rules_) ? rules_->size() : 0;
@@ -1002,7 +1000,7 @@ void MagnifierCollector::visit(const BaseDriver& driver)
 	Symbol* points = new Symbol();
 	points->setSymbol("magics_3"); // A little dot
 	points->setHeight(0.2); 
-	points->setColour(Colour("red")); 				
+	points->setColour(Colour("red"));
 
 	for ( iterator point = begin(); point != end(); ++point)
 		points->push_back(*point);
@@ -1016,7 +1014,7 @@ void MetviewIcon::visit(Layer& layer)
 {
 	if ( !iconClass_.empty() && !iconName_.empty() )
 	{
-		layer.icon(iconName_,iconClass_,iconId_);	 
+		layer.icon(iconName_,iconClass_,iconId_);
 	}
 
 	//if ( !iconClass_.empty() && !iconName_.empty() )
@@ -1084,7 +1082,6 @@ void DateDescription::update(const DateDescription& current) const
 
 bool DateDescription::operator < (const DateDescription& other) const // DEclaration function in Data.h
 {
-
 	if ( this->valid_ == other.valid_ )
 		if ( this->set_ == other.set_ )
 			return this->index_ < other.index_;
@@ -1099,23 +1096,24 @@ LevelDescription::LevelDescription(): surface_(true)
 LevelDescription::~LevelDescription()
 {
 }
+
 DateDescription::~DateDescription()
 {
 }
+
 LevelDescription& SingleLayer::dataLevel() const
 {
 	static LevelDescription level;
 	object_->visit(level_);
 	return level_;
-
 }
 
 DateDescription& SingleLayer::timeStamp() const
 {
 	object_->visit(stamp_);
-
 	return stamp_;
 }
+
 ValuesCollectorPoint::~ValuesCollectorPoint()
 {
 	while (!empty()) {
@@ -1123,11 +1121,8 @@ ValuesCollectorPoint::~ValuesCollectorPoint()
 		pop_back();
 		//delete data;
 	}
-
-
 }
 
-
 void ValuesCollectorData::print(ostream& out) const
 {
 	out << "ValuesCollectorData[";
@@ -1157,23 +1152,19 @@ void ValuesCollectorSDData::print(ostream& out) const
 	out << ", direction=" << direction_;
 	out << "]";
 }
+
 void ValuesCollectorVisitor::visit(const ValuesCollectorData& data)
 {
-
 }
 
 void ValuesCollectorVisitor::visit(const ValuesCollectorUVData& data)
 {
-
 }
 
 void ValuesCollectorVisitor::visit(const ValuesCollectorSDData& data)
 {
-
 }
 
 ValuesCollectorVisitor::ValuesCollectorVisitor()
 {
-
 }
-
diff --git a/src/basic/Layer.h b/src/basic/Layer.h
index 016ab6a..58884eb 100644
--- a/src/basic/Layer.h
+++ b/src/basic/Layer.h
@@ -78,7 +78,7 @@ public:
 	void visibility(bool visibility) { visibility_ = visibility; }
 	void zindex(int zindex) { zindex_ = zindex; }
 	void transparency(int transparency) { transparency_ = transparency; }
-	void valid(const DateTime& from, const DateTime& to) { from_ = from; to_ = to; }
+	void validTime(const DateTime& from, const DateTime& to) { from_ = from; to_ = to; }
 	
 	bool visibility() const { return visibility_; }
 	int transparency() const { return transparency_; }
@@ -106,17 +106,14 @@ public:
 	string timeBegin(const string&) const;
 	string timeEnd(const string&) const;
 
-	string kmlTimeBegin() const;
-	string kmlTimeEnd() const;
-	string kmlTimeStamp() const ;
+	string timeBegin() const;
+	string timeEnd() const;
+	string timeStamp() const ;
 	
 	const string& metadata(const string&);
 	void metadata(const string&, const string&);
 	virtual void update(const Layout&) {}
 
-
-
-
 	vector<MetviewIcon >::const_iterator iconsBegin() { return icons_.begin(); }
 	vector<MetviewIcon >::const_iterator iconsEnd() { return icons_.end(); }
 	void  icon(const string& iconname, const string& iconclass,const string& iconid) 
@@ -256,7 +253,7 @@ protected:
 };
 
 /*
- * A NoDataLayer is a static layer that do not contain ant data information :ie some driver like KML may 
+ * A NoDataLayer is a static layer that do not contain any data information :ie some driver like KML may 
  * not need to handle them
  */
 class NoDataLayer : public StaticLayer
@@ -269,6 +266,8 @@ public:
 	void redisplay(const BaseDriver&) const;
 	void getReady() const {}
 };
+
+
 class TextLayer : public StepLayer
 {
 public:
@@ -280,6 +279,8 @@ public:
 	void getInfo(int, const BaseDriver&) const;
 	void collectText(vector<TextVisitor*>&, LegendVisitor*); // update the text informations!
 };
+
+
 /*
  * A SceneLayer is attach to a SceneNode...
  * It contains the list of layers needed to perform a plot.
@@ -385,22 +386,22 @@ class ValuesCollectorData
 public:
 	ValuesCollectorData(double x, double y, double value, double distance,int index=-1) :
 	   x_(x), y_(y), value_(value), distance_(distance), missing_(false), index_(index) {}
-	   
+   
 	double x() const {return x_;}
 	double y() const {return y_;}
-  	double value() const {return value_;}
-  	double distance() const {return distance_;}  
-  	void setScaledValue(double d) {scaledValue_=d;}
-  	double scaledValue() const {return scaledValue_;}
-  	bool missing() {return missing_;}
-  	void setMissing(bool b) {missing_=b;}
-  	int index() const {return index_;}
-  	virtual void visit(ValuesCollectorVisitor& visitor) {
-  		 visitor.visit(*this);
-  	}
+	double value() const {return value_;}
+	double distance() const {return distance_;}  
+	void setScaledValue(double d) {scaledValue_=d;}
+	double scaledValue() const {return scaledValue_;}
+	bool missing() {return missing_;}
+	void setMissing(bool b) {missing_=b;}
+	int index() const {return index_;}
+	virtual void visit(ValuesCollectorVisitor& visitor) {
+		 visitor.visit(*this);
+	}
 
 protected: 
-  	virtual void print(ostream&) const;
+	virtual void print(ostream&) const;
 	double x_;
 	double y_;
 	double value_;
@@ -412,7 +413,7 @@ protected:
 	//! Overloaded << operator to call print().
 	friend ostream& operator<<(ostream& s,const ValuesCollectorData& p)
 		{ p.print(s); return s; }
-};	
+};
 
 class ValuesCollectorUVData : public ValuesCollectorData
 {
@@ -420,20 +421,20 @@ public:
 	ValuesCollectorUVData(double x, double y, double u, double v, double distance,int index=-1) :
 		ValuesCollectorData(x, y, 0, distance,index), xComponent_(u), yComponent_(v) {}
 
- 	virtual void visit(ValuesCollectorVisitor& visitor)
- 		{ visitor.visit(*this); }
+	virtual void visit(ValuesCollectorVisitor& visitor)
+		{ visitor.visit(*this); }
 
- 	double  xComponent() const { return xComponent_; }
- 	double  yComponent() const { return yComponent_; }
- 	double  scaledXComponent() const { return scaledXComponent_; }
- 	double  scaledYComponent() const { return scaledYComponent_; }
+	double  xComponent() const { return xComponent_; }
+	double  yComponent() const { return yComponent_; }
+	double  scaledXComponent() const { return scaledXComponent_; }
+	double  scaledYComponent() const { return scaledYComponent_; }
 
 protected:
- 	virtual void print(ostream&) const;
+	virtual void print(ostream&) const;
 	double xComponent_;
 	double yComponent_;
 	double scaledXComponent_;
-	double scaledYComponent_;	
+	double scaledYComponent_;
 };
 
 class ValuesCollectorSDData : public ValuesCollectorData
diff --git a/src/basic/LegendVisitor.cc b/src/basic/LegendVisitor.cc
index 21ba62d..bda116f 100644
--- a/src/basic/LegendVisitor.cc
+++ b/src/basic/LegendVisitor.cc
@@ -139,16 +139,20 @@ void LineEntry::rowBox(const PaperPoint& point, BasicGraphicsObjectContainer& ou
 {
 	double x = point.x();
 	double y = point.y();
-	double width = 1;
-	line_->push_back(PaperPoint(x- width, y));
-	line_->push_back(PaperPoint(x, y));
+
+	line_->push_back(PaperPoint(x-0.5, y));
+	line_->push_back(PaperPoint(x+0.5, y));
 	out.push_back(line_);
 }
 void LineEntry::columnBox(const PaperPoint& point, BasicGraphicsObjectContainer& out)
 {
-	set(point, out);
-}
+	double x = point.x();
+	double y = point.y();
 
+	line_->push_back(PaperPoint(x-15, y));
+	line_->push_back(PaperPoint(x+1, y));
+	out.push_back(line_);
+}
 void DoubleLineEntry::rowBox(const PaperPoint& point, BasicGraphicsObjectContainer& out)
 {
 	set(point, out);
@@ -174,7 +178,7 @@ void LegendVisitor::build()
 	current_->clear();
 	current_->blankIt();
 	current_->push_back(legend_);
-	
+	positions_.clear();
 
 	grid();
 
@@ -1391,3 +1395,10 @@ void SimpleSymbolEntry::columnBox(const PaperPoint& point, BasicGraphicsObjectCo
 	box->setColour(colour);
 	legend.push_back(box);
 }
+
+SymbolEntry::~SymbolEntry() {} // { delete symbol_; }
+FlagEntry::~FlagEntry(){} //{ delete flag_; }
+BoxEntry::~BoxEntry() {} //{ delete box_; }
+ArrowEntry::~ArrowEntry() {} //{ delete arrow_; }
+DoubleLineEntry::~DoubleLineEntry() {} //{ { delete line1_; delete line2_; }
+LineEntry::~LineEntry() {} //{ delete line_;}
diff --git a/src/basic/LegendVisitor.h b/src/basic/LegendVisitor.h
index 51f40d4..3ac0758 100644
--- a/src/basic/LegendVisitor.h
+++ b/src/basic/LegendVisitor.h
@@ -173,7 +173,7 @@ public:
 	virtual void rowBox(const PaperPoint&, BasicGraphicsObjectContainer&);
 		virtual void columnBox(const PaperPoint&, BasicGraphicsObjectContainer&);
     void set(const PaperPoint&, BasicGraphicsObjectContainer&);
-    
+    ~SymbolEntry();
 protected:
 	Symbol* symbol_;
 	Colour colour();
@@ -208,6 +208,8 @@ public:
     void set(const PaperPoint&, BasicGraphicsObjectContainer&);
     virtual void rowBox(const PaperPoint&, BasicGraphicsObjectContainer&);
 	virtual void columnBox(const PaperPoint&, BasicGraphicsObjectContainer&);
+	bool needContinuousText() { return true;  }
+	~LineEntry();
 protected:
 	Polyline* line_;
 	Colour colour();
@@ -229,6 +231,7 @@ public:
     virtual void rowBox(const PaperPoint&, BasicGraphicsObjectContainer&);
 	virtual void columnBox(const PaperPoint&, BasicGraphicsObjectContainer&);
 	bool needContinuousText() { return true;  }
+	~DoubleLineEntry();
 protected:
 	Polyline* line1_;
 	Polyline* line2_;
@@ -246,6 +249,7 @@ public:
 	ArrowEntry(const double min, double max, Arrow* arrow = 0 ) : 
 		LegendEntry(min, max), arrow_(arrow)
         { format(min, max); }
+	~ArrowEntry();
 	void setArrow(Arrow* arrow) { arrow_ = arrow; }
 	void set(const PaperPoint&, BasicGraphicsObjectContainer&);
 	virtual void rowBox(const PaperPoint&, BasicGraphicsObjectContainer&);
@@ -267,6 +271,7 @@ public:
 	FlagEntry(const double min, double max, Flag* flag = 0 ) : 
 		LegendEntry(min, max), flag_(flag)
         { format(min, max); }
+	~FlagEntry();
 	void setArrow(Flag* flag) { flag_ = flag; }
 	void set(const PaperPoint&, BasicGraphicsObjectContainer&);
 	 virtual void rowBox(const PaperPoint&, BasicGraphicsObjectContainer&);
@@ -288,6 +293,7 @@ public:
 	BoxEntry(double min, double max, Polyline* box = 0 ) : 
 		LegendEntry(min, max), box_(box)
         { format(min, max); }
+	~BoxEntry();
 	void set(const PaperPoint&, BasicGraphicsObjectContainer&);
 	void rowBox(const PaperPoint&, BasicGraphicsObjectContainer&);
 	void columnBox(const PaperPoint&, BasicGraphicsObjectContainer&);
@@ -327,6 +333,8 @@ public:
 	void visit(BasicSceneObject&);
 	 void visit(AnimationStep&);
 	bool positional() { return positional_; }
+	bool right() { return magCompare(box_position_, "right"); }
+	bool top() { return magCompare(box_position_, "top"); }
 	void finish(BasicGraphicsObjectContainer&);
 	LegendMethod::LegendType legendType() const { return method_->name(); }
 	void last() {
diff --git a/src/basic/TextVisitor.cc b/src/basic/TextVisitor.cc
index 567e402..88c48d9 100644
--- a/src/basic/TextVisitor.cc
+++ b/src/basic/TextVisitor.cc
@@ -236,12 +236,16 @@ void TextVisitor::finish(BasicGraphicsObjectContainer& parent)
 	current_->blankIt();
 
 	double absheight = current_->absoluteHeight();
-
+	double abswidth = current_->absoluteWidth();
 	double height = (font_size_ /absheight)*100;
-	double last = (0.10/absheight)*100; //in %
+
+	double last = orientation_ == "horizontal" ? (0.10/absheight)*100 : (0.10/abswidth)*100;//in %
 	double ratio = OutputHandler::patchLineSpacing();
 	double gap = height*ratio;
 
+	double angle = 0;
+
+
 
 
 
@@ -250,6 +254,7 @@ void TextVisitor::finish(BasicGraphicsObjectContainer& parent)
 
 		// Calculate the position depending on the jsutification.
 		double x;
+
 		if (justification_ == MLEFT) x = .1; // 0.1% 
 		else if (justification_ == MRIGHT) x = 98.; //98 %
 		else x = 50.; 
@@ -257,9 +262,35 @@ void TextVisitor::finish(BasicGraphicsObjectContainer& parent)
 		(*text)->setJustification(justification_);
 		(*text)->setVerticalAlign(MBOTTOM);
 
-		gap = (*text)->noText() ?  height*ratio : (((*text)->getFontMax()/absheight)*100)*ratio;
-		(*text)->push_back(PaperPoint(x, last)); // approximate position to be improved 
 
+
+		if ( orientation_ == "horizontal" ) {
+			angle = 0;
+			gap = (*text)->noText() ?  (font_size_ /absheight)*100 *ratio : (((*text)->getFontMax()/absheight)*100)*ratio;
+			(*text)->push_back(PaperPoint(x, last)); // approximate position to be improved
+		}
+		if ( magCompare(orientation_, "bottom_top" ) ) {
+
+			angle = 3*3.14/2;;
+			(*text)->setVerticalAlign(MTOP);
+			gap = (*text)->noText() ?  (font_size_ /abswidth)*100 *ratio : (((*text)->getFontMax()/abswidth)*100)*ratio;
+			(*text)->push_back(PaperPoint(last, x)); // approximate position to be improved
+		}
+
+		if ( magCompare(orientation_, "top_bottom" ) ) {
+			if (justification_ == MLEFT) x = 98.; // 0.1%
+			else if (justification_ == MRIGHT) x = .1; //98 %
+			else x = 50.;
+			angle = 3.14/2;
+			gap = (*text)->noText() ?  (font_size_ /abswidth) *ratio : (((*text)->getFontMax()/abswidth)*100)*ratio;
+			(*text)->push_back(PaperPoint(last, x)); // approximate position to be improved
+		}
+
+		(*text)->setJustification(justification_);
+
+
+
+		(*text)->setAngle(angle);
 		last += gap;
 
 		current_->push_back(*text);
@@ -379,7 +410,7 @@ void XmlTextVisitor::getReady()
 	layout_->display(ABSOLUTE);
 	layout_->frame(TextVisitorAttributes::blanking_, TextVisitorAttributes::border_, *TextVisitorAttributes::border_colour_, M_SOLID, 1);
 
-	}
+}
 
 FortranTextVisitor::FortranTextVisitor()
 {
diff --git a/src/basic/ViewNode.cc b/src/basic/ViewNode.cc
index 6933b80..1e798fd 100644
--- a/src/basic/ViewNode.cc
+++ b/src/basic/ViewNode.cc
@@ -203,12 +203,21 @@ void ViewNode::prepareLayout(SceneLayer& tree)
 	if ( legend_)
 	{
 		tree.legend(legend_);
-		legend_->height(5);
-		helper.attachTop(legend_);
-		legend_->x(drawing_left_);
-		legend_->width(100-drawing_left_-drawing_right_);
-		if ( !legend_->positional() )
+		if ( !legend_->positional() ) {
+			if ( legend_->top() ) {
+				legend_->height(5);
+				helper.attachTop(legend_);
+				legend_->x(drawing_left_);
+				legend_->width(100-drawing_left_-drawing_right_);
+			}
+			else {
+				legend_->width(7.5);
+				helper.attachRight(legend_);
+				legend_->y(drawing_bottom_);
+				legend_->height(100-drawing_top_-drawing_bottom_);
+			}
 			helper.add(legend_);
+		}
 		((BasicSceneObject*)legend_)->parent((BasicSceneObject*)this);
 		legend_->getReady();
 
@@ -387,21 +396,24 @@ void XmlViewNode::getReady()
 		w2 = waa / width.absolute() *100;
 		h2 = haa / height.absolute() *100;
 	}
-	if ( fitted_  == "tiling" )
+	else if ( fitted_  == "tiling" )
 	{
 
 		viewTransformation_->tile(waa, haa);
+
 		absoluteRootWidth(waa);
 		absoluteRootHeight(haa);
+
+
 	}
-	if ( fitted_  == "crop" )
+	else if ( fitted_  == "crop" )
 	{
 		viewTransformation_->aspectRatio(waa, haa);
 		absoluteRootWidth(waa); 
 		absoluteRootHeight(haa);
 	}
 
-	if ( fitted_  == "off" )
+	else
 	{
 		viewTransformation_->aspectRatio(waa, haa);
 				w2 = waa / width.absolute() *100;
diff --git a/src/basic/VisualAction.cc b/src/basic/VisualAction.cc
index 4ae3cf7..ac5957e 100644
--- a/src/basic/VisualAction.cc
+++ b/src/basic/VisualAction.cc
@@ -76,7 +76,6 @@ void VisualAction::getReady()
 
 void VisualAction::release()
 {
-
 	if ( data_ )
 		data_->release();
 }
@@ -97,7 +96,6 @@ void VisualAction::visit(LevelDescription& level) {
 
 void VisualAction::visit(DrawingVisitor& drawing)
 {
-
 	if ( !data_ || ( data_ && !data_->valid() ) || visdefs_.empty() )
 	{
 		MagLog::warning() << " Check data or visual action!" << endl;
@@ -117,9 +115,7 @@ void VisualAction::visit(HistoVisitor& drawing)
 {
 	if ( !visdefs_.empty() ) {
 		// We only send it to the first action...
-
-
-		 
+ 
 		drawing.basic(true);
 		drawing.dataLayoutTransformation(&transformation());
 		 
@@ -132,12 +128,8 @@ void VisualAction::visit(HistoVisitor& drawing)
 				drawing.basic(false);
 				(*visdef)->visit(*data_, drawing);
 				return;	
-			}  
-			  
-			  	
+			}
 		}
-
-
 		visdefs_.front()->visit(*data_, drawing);
 	}
 }
@@ -234,22 +226,18 @@ void VisualAction::visit(AnimationRules& rules)
 	if ( data_  && data_->valid() ) data_->visit(rules);
 }
 
-static string unknown("unknown");
-const string& VisualAction::name()
+const string VisualAction::name()
 {
-
-	return ( data_ ) ? data_->name() : unknown;
+	return ( data_ ) ? data_->name() : "unknown";
 }
 
 
-const string& VisualAction::id() {
-	static string name("unknown");
-	return ( data_  ) ? data_->layerId() : unknown;
+const string VisualAction::id()
+{
+	return ( data_  ) ? data_->layerId() : "unknown";
 }
 
 
-	
-
 VisualAnimation::VisualAnimation():loop_(0)
 {
 }
@@ -257,7 +245,6 @@ VisualAnimation::VisualAnimation():loop_(0)
 
 VisualAnimation::~VisualAnimation()
 {
-
 	if (loop_) delete loop_;
 }
 
@@ -293,8 +280,6 @@ void VisualAnimation::prepare()
 
 		layer_->addStep(action);
 
-
-
 		loop_->next();
 	}
 }
@@ -325,11 +310,11 @@ void VisualAnimation::visit(Transformation& transformation)
 
 void VisualAnimation::visit(SceneLayer& layer, vector<LayoutVisitor*>& visitors)
 {
-   	layer.add(layer_);
- 	for  (vector<LayoutVisitor*>::iterator visitor = visitors.begin(); visitor != visitors.end(); ++visitor) {
-   		layer.addVisitor(*visitor); 
-   		layer_->addVisitor(*visitor);  
-   	}
+	layer.add(layer_);
+	for  (vector<LayoutVisitor*>::iterator visitor = visitors.begin(); visitor != visitors.end(); ++visitor) {
+		layer.addVisitor(*visitor); 
+		layer_->addVisitor(*visitor);  
+	}
 }
 
 bool VisualAction::needLegend()
@@ -345,7 +330,6 @@ bool VisualAction::needLegend()
 void VisualAction::visit(SceneLayer& layer, vector<LayoutVisitor*>& visitors)
 {
 	layer_ = new StaticLayer(this);
-	
 
 	if ( data_ ) 
 		data_->visit(*layer_);
@@ -360,7 +344,4 @@ void VisualAction::visit(SceneLayer& layer, vector<LayoutVisitor*>& visitors)
 	{    
 		(*visdef)->visit(*layer_);
 	}
-
-
 }
-
diff --git a/src/basic/VisualAction.h b/src/basic/VisualAction.h
index 7c878d0..a379d3f 100644
--- a/src/basic/VisualAction.h
+++ b/src/basic/VisualAction.h
@@ -52,8 +52,8 @@ public:
 	void set2D()     { data_->dimension(2); }
 	void visdef(Visdef* visdef) { visdefs_.push_back(visdef); }
 	void binning(BinningObject* binning)     { if (data_) data_->binning(binning); }
-	const string& name();
-    const string& id();
+	const string name();
+	const string id();
 
     // A visual Action is valid, if the data have been set and the list of visdef is not empty!
     bool isValid() const { return data_ && visdefs_.empty() == false; }
@@ -90,8 +90,7 @@ protected:
 
 	 void visit(DateDescription&);
 	 void visit(LevelDescription&);
-	
-	 
+
 private:
     //! Copy constructor - No copy allowed
 	VisualAction(const VisualAction&);
@@ -102,7 +101,6 @@ private:
     //! Overloaded << operator to call print().
 	friend ostream& operator<<(ostream& s,const VisualAction& p)
 		{ p.print(s); return s; }
-
 };
 
 
@@ -127,8 +125,6 @@ protected:
     
     DataLoop* loop_;
     StepLayer* layer_;
-    
-    
 };
 
 } // namespace magics
diff --git a/src/basic/XmlMagics.cc b/src/basic/XmlMagics.cc
index f32f77e..2a56af3 100644
--- a/src/basic/XmlMagics.cc
+++ b/src/basic/XmlMagics.cc
@@ -46,7 +46,6 @@
 #include "XYList.h"
 #include "EpsXmlInput.h"
 #include "WrepJSon.h"
-#include "ImagePlotting.h"
 #include "SymbolPlotting.h"
 #include "Contour.h"
 #include "Wind.h"
@@ -102,7 +101,7 @@ XmlMagics::XmlMagics() : root_(0),
 	actions_["coastlines"] = &XmlMagics::coastlines;
 	actions_["taylorgrid"] = &XmlMagics::taylor;
 	actions_["tephigrid"] = &XmlMagics::tephigrid;
-	actions_["tephigram"] = &XmlMagics::cartesian;
+	actions_["thermo"] = &XmlMagics::cartesian;
 	actions_["grib"] = &XmlMagics::grib;
 	actions_["netcdf"] = &XmlMagics::netcdf;
 	actions_["table"] = &XmlMagics::table;
@@ -853,16 +852,7 @@ void XmlMagics::contour(const XmlNode& node)
 
 void XmlMagics::image(const XmlNode& node)
 {
-	if ( geographical_ ) {
-		ImagePlotting* image =  new ImagePlotting();
-		image->set(node);
-		top()->visdef(image);
-	}
-	else {
-		ImagePlotting* image =  new ImagePlotting();
-		image->set(node);
-		top()->visdef(image);
-	}
+	MagLog::warning() <<" Image has been deprecated! Please use contour."<< endl;
 }
 
 #include "ImportObjectHandler.h"
diff --git a/src/basic/XmlMagics.h b/src/basic/XmlMagics.h
index 02c2207..cb42f49 100644
--- a/src/basic/XmlMagics.h
+++ b/src/basic/XmlMagics.h
@@ -72,7 +72,7 @@ public:
 	void map(const XmlNode&);
 	void coastlines(const XmlNode&);
 	void tephigrid(const XmlNode&);
-	void tephigram(const XmlNode&);
+	void thermo(const XmlNode&);
 	void taylor(const XmlNode&);
 	void layer(const XmlNode&);
 	void grib(const XmlNode&);
diff --git a/src/common/BaseParameter.h b/src/common/BaseParameter.h
index dac08c3..d56931f 100644
--- a/src/common/BaseParameter.h
+++ b/src/common/BaseParameter.h
@@ -41,13 +41,6 @@
  typedef cairo_t* CairoPtr;
 #endif
 
-#ifdef MAGICS_QT
- #include "Qt/qwidget.h"
- #include "Qt/qgraphicsscene.h"	
- typedef QWidget* QWidgetPtr;
- typedef QGraphicsScene* QGraphicsScenePtr;
-#endif
-
 #ifdef LATER
 #include "grib_api.h"
 typedef grib_handle* GribHandlePtr ;
@@ -192,17 +185,6 @@ public:
 	virtual string type() const = 0;
 	
 
-
-#ifdef MAGICS_QT
-	virtual void set(const QWidgetPtr&) { throw MistmatchType(name_, "qt_widget", type()); }
-	virtual void get(QWidgetPtr&) const { throw MistmatchType(name_, "qt_widget", type()); }
-	string getType(QWidgetPtr) const { return "qt_widget"; }
-
-	virtual void set(const QGraphicsScenePtr&) { throw MistmatchType(name_, "qt_scene", type()); }
-	virtual void get(QGraphicsScenePtr&) const { throw MistmatchType(name_, "qt_scene", type()); }
-	string getType(QGraphicsScenePtr) const { return "qt_scene"; }
-#endif
-
 #ifdef MAGICS_CAIRO
 	virtual void set(const CairoPtr&) { throw MistmatchType(name_, "cairo_context", type()); }
 	virtual void get(CairoPtr&) const { throw MistmatchType(name_, "cairo_context", type()); }
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index 12d437e..759dfed 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -142,3 +142,4 @@ if ( ENABLE_METVIEW )
 				)
 	set( metview_include ${metview_include} PARENT_SCOPE )
 endif()
+#install ( FILES ${CMAKE_CURRENT_SRC_DIR}/magics_api.h  DESTINATION ${INSTALL_INCLUDE_DIR})
diff --git a/src/common/CustomisedPoint.h b/src/common/CustomisedPoint.h
index 81ddeeb..6b03fd4 100644
--- a/src/common/CustomisedPoint.h
+++ b/src/common/CustomisedPoint.h
@@ -70,6 +70,10 @@ public:
 	bool missing() const { return missing_; }
 	void missing(bool missing) { missing_  = missing; }
 
+	double distance(double lat, double lon) const {
+		return sqrt( (lat-latitude_)*(lat-latitude_) +(lon-longitude_)*(lon-longitude_) );
+	}
+
 protected:
      //! Method to print string about this class on to a stream of type ostream (virtual).
 	 virtual void print(ostream& out) const
diff --git a/src/common/Data.h b/src/common/Data.h
index b77afa7..ef095b1 100644
--- a/src/common/Data.h
+++ b/src/common/Data.h
@@ -82,9 +82,6 @@ public:
     void binning(BinningObject* binning) { binning_ = binning; }
 
   
-
-
-
     virtual void release() {}
     
     virtual void getReady(const Transformation&) {}
@@ -93,7 +90,7 @@ public:
     //! Methods to access the data as a file used by pplot action routine
     virtual string path() { throw DataInMemory(); }
     //! Methods to access the data as a RasterData used by pimage action routine.
-    virtual RasterData& raster(const Transformation&) { throw MethodNotYetImplemented("Data<P>::raster"); }
+    //virtual RasterData& raster(const Transformation&) { throw MethodNotYetImplemented("Data<P>::raster"); }
     
     virtual void getInfo(const std::set<string>&, multimap<string, string>&) 
     { throw MethodNotYetImplemented("Data::getInfo"); }
@@ -123,7 +120,7 @@ public:
     virtual void visit(Layer& layer) { 
     	MetviewIcon::visit(layer);
     	layer.name(name());
-    	layer.valid(from(), to());
+    	layer.validTime(from(), to());
     }
    bool valid() { return valid_; }
     virtual void visit(MetaDataCollector& collector)  {MetviewIcon::visit(collector);}  
diff --git a/src/common/Layout.cc b/src/common/Layout.cc
index eef2016..f8cec55 100644
--- a/src/common/Layout.cc
+++ b/src/common/Layout.cc
@@ -192,8 +192,7 @@ void LayoutFrame::frame(Layout& owner)
 	frame->setLineStyle(style_);
 	frame->setThickness(thickness_);
 	frame->setColour(colour_); 
-	frame->setThickness(2);
-		frame->setColour(Colour("charcoal"));
+
 	double px = (owner.maxX() - owner.minX())*0.00;
 	double py = (owner.maxY() - owner.minY())*0.00;
 	
diff --git a/src/common/MagException.h b/src/common/MagException.h
index 791a448..6aaaed5 100644
--- a/src/common/MagException.h
+++ b/src/common/MagException.h
@@ -28,14 +28,14 @@ class MagicsException : public exception
 {
  public:
 	MagicsException( const string& why) : what_(why) {
-        if (::getenv("MAGICS_ABORT_EXCEPTION")) {
-            ::abort();
+        if (std::getenv("MAGICS_ABORT_EXCEPTION")) {
+            std::abort();
         }
     } 
 
     MagicsException() : what_("") {
-        if (::getenv("MAGICS_ABORT_EXCEPTION")) {
-            ::abort();
+        if (std::getenv("MAGICS_ABORT_EXCEPTION")) {
+            std::abort();
         }
     } 
 
diff --git a/src/common/MagLog.cc b/src/common/MagLog.cc
index 1f08592..1d1c213 100644
--- a/src/common/MagLog.cc
+++ b/src/common/MagLog.cc
@@ -25,6 +25,7 @@
     Changes:
 */
 
+#include <algorithm>
 #include <MagLog.h>
 #include "MagicsObserver.h"
 
diff --git a/src/common/MagTranslator.h b/src/common/MagTranslator.h
index 931e507..fb088e4 100644
--- a/src/common/MagTranslator.h
+++ b/src/common/MagTranslator.h
@@ -123,66 +123,6 @@ public:
 };
 #endif
 
-#ifdef MAGICS_QT
-template<>
-class MagTranslator<QWidget*, QWidget*> {
-public:
-	QWidget* operator()(QWidget* value)
-	{
-		return value;
-	}
-    
-	QWidget* magics(const string& param)
-	{
-		QWidget* from;
-		ParameterManager::get(param, from);
-		return (*this)(from); 
-	}
-};
-
-template<>
-class MagTranslator<string,  QWidget*> {
-public:
-	QWidget* operator()(const string&)
-	{
-		return 0;
-	}
-	string magics(const string&)
-	{
-		return "unknown";
-	}
-};
-template<>
-class MagTranslator<QGraphicsScene*, QGraphicsScene*> {
-public:
-	QGraphicsScene* operator()(QGraphicsScene* value)
-	{
-		return value;
-	}
-    
-	QGraphicsScene* magics(const string& param)
-	{
-		QGraphicsScene* from;
-		ParameterManager::get(param, from);
-		return (*this)(from); 
-	}
-};
-
-template<>
-class MagTranslator<string,  QGraphicsScene*> {
-public:
-	QGraphicsScene* operator()(const string&)
-	{
-		return 0;
-	}
-	string magics(const string&)
-	{
-		return "unknown";
-	}
-};
-#endif
-
-
 template<>
 class MagTranslator<doublearray, doublearray> {
 public:
diff --git a/src/common/MagicsCalls.cc b/src/common/MagicsCalls.cc
index 59205fb..debc7e9 100644
--- a/src/common/MagicsCalls.cc
+++ b/src/common/MagicsCalls.cc
@@ -877,6 +877,13 @@ static SimpleTranslator graph_y_missing_value("graph_y_missing_value", "y_missin
 static SimpleTranslator symbol_marker("symbol_marker", "symbol_marker_index");
 
 
+// Clean font parametermap_cities_font_
+static SimpleTranslator map_cities_font_name("map_cities_font_name", "map_cities_font");
+static SimpleTranslator eps_maximum_font_name("eps_maximum_font_name", "eps_maximum_font");
+static SimpleTranslator magnifier_text_font_name("magnifier_text_font_name", "magnifier_text_font");
+static SimpleTranslator symbol_text_font_name("symbol_text_font_name", "symbol_text_font");
+
+
 extern "C" {
 
 /* **************************************************************************
@@ -1170,6 +1177,10 @@ void pwrepjson_()
 {
 	magics_->wrepjson();
 }
+void pepsinput_()
+{
+	magics_->epsinput();
+}
 void pepscloud_()
 {
 	magics_->epscloud();
@@ -1243,6 +1254,7 @@ void mag_boxplot()  {pboxplot_();}
 void mag_taylor()  {ptaylor_();}
 void mag_tephi()  {ptephi_();}
 void mag_wrepjson()  { pwrepjson_(); }
+void mag_epsinput()  { pepsinput_(); }
 void mag_epscloud()  { pepscloud_(); }
 
 void mag_epsgraph()  	   { pepsgraph_(); }
@@ -1303,14 +1315,6 @@ void mag_setp(const char* name, void* value)
        ParameterManager::set("output_cairo_drawing_context", (CairoPtr)value); 
     }
 #endif
-#ifdef MAGICS_QT
-    if ( magCompare(n, "output_qt_widget") ) {
-       ParameterManager::set("output_qt_widget", (QWidgetPtr)value); 
-    }
-    if ( magCompare(n, "output_qt_scene") ) {
-       ParameterManager::set("output_qt_scene", (QGraphicsScenePtr)value); 
-    }	
-#endif
 }
 
 void mag_act(const char* a, const char* b, const char* c)
@@ -1555,7 +1559,7 @@ public:
 				if (magCompare(val, "position_list") ){
 					MagLog::warning() << "position_list is now using the user coordinates system and not cm" << endl;
 					MagLog::warning() << "please check your coordinates system" << endl;
-					ParameterManager::set(vertical_, "regular");
+
 				}
 				else
 					ParameterManager::set(horizontal_, val);
@@ -1565,7 +1569,7 @@ public:
 				if (magCompare(val, "position_list") ){
 					MagLog::warning() << "position_list is now using the user coordinates system and not cm" << endl;
 					MagLog::warning() << "please check your coordinates system" << endl;
-					ParameterManager::set(vertical_, "regular");
+
 				}
 				else
 					ParameterManager::set(vertical_, val);
diff --git a/src/common/Matrix.cc b/src/common/Matrix.cc
index 1e0cb73..6ab743e 100644
--- a/src/common/Matrix.cc
+++ b/src/common/Matrix.cc
@@ -29,15 +29,28 @@
     
 */
 
+#include <algorithm>
+
 #include "Matrix.h"
 #include "Timer.h"
 #include "SegmentJoiner.h"
 #include "MatrixHandler.h"
 #include "MatrixHandler.h"
-using namespace magics;
 
+using namespace magics;
 
 
+void Matrix::multiply(double factor) 
+{
+    if (factor == 1 ) return;
+    std::transform(begin(), end(), begin(), Multiply(factor, missing_));
+}
+    
+void Matrix::plus(double offset) 
+{
+    if (offset == 0 ) return;
+    std::transform(begin(), end(), begin(), Plus(offset, missing_));
+}
 
 void ProjectedMatrix::build()
 {
diff --git a/src/common/Matrix.h b/src/common/Matrix.h
index 22b0fbb..429f800 100644
--- a/src/common/Matrix.h
+++ b/src/common/Matrix.h
@@ -65,7 +65,7 @@ public :
     virtual double   height() const = 0;
     virtual bool akimaEnable() const { return false; }
 
-    virtual MatrixHandler* getReady(const Transformation&) const { assert(false); }
+    virtual MatrixHandler* getReady(const Transformation&) const { assert(false); return 0;}
 
    
    
@@ -219,8 +219,6 @@ public:
     double regular_row(int i) const { return rowsAxis_[i]; } 
     double row(int i, int) const { return regular_row(i); }
     
-
-
     void release()
     {
     	rows_ = 0;
@@ -283,18 +281,8 @@ public:
     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;
     
-   void multiply(double factor) 
-    {
-        if (factor == 1 ) return;
-        std::transform(begin(), end(), begin(), Multiply(factor, missing_));
-    }
-    
-    void plus(double offset) 
-    {
-        if (offset == 0 ) return;
-        std::transform(begin(), end(), begin(), Plus(offset, missing_));
-       
-    }
+    void multiply(double factor);   
+    void plus(double offset);
     
      virtual int firstRow() const { return 0; }
      virtual int nextRow(int i, int f) const   
diff --git a/src/common/MatrixHandler.h b/src/common/MatrixHandler.h
index fd56644..8322d4e 100644
--- a/src/common/MatrixHandler.h
+++ b/src/common/MatrixHandler.h
@@ -332,6 +332,8 @@ public :
     
     
     MatrixHandler* getReady(const Transformation& transformation) {
+    	if ( !&matrix_ )
+    		return 0;
     	return matrix_.getReady(transformation);
 
     }
diff --git a/src/common/OutputFactory.cc b/src/common/OutputFactory.cc
index 9d6ac78..dc7a897 100644
--- a/src/common/OutputFactory.cc
+++ b/src/common/OutputFactory.cc
@@ -255,6 +255,15 @@ void CAIRO_XOutputFactory::set(DriverManager& magics, const XmlNode& node)
 	
 	magics.push_back(driver);
 }
+
+void CAIRO_GeoTiffOutputFactory::set(DriverManager& magics, const XmlNode& node)
+{
+	CairoDriver* driver = new CairoDriver();
+	driver->set(node);
+	driver->setGEOTIFF();
+
+	magics.push_back(driver);
+}
 #endif
 
 #include "KMLDriver.h"
diff --git a/src/common/OutputFactory.h b/src/common/OutputFactory.h
index a8ce890..bf7cd1a 100644
--- a/src/common/OutputFactory.h
+++ b/src/common/OutputFactory.h
@@ -270,6 +270,16 @@ public:
 	virtual OutputFactory* clone() const  { return new CAIRO_XOutputFactory(); }    
 	virtual void set(DriverManager&, const XmlNode&);
 };
+
+class CAIRO_GeoTiffOutputFactory : public OutputFactory
+{
+public:
+	CAIRO_GeoTiffOutputFactory() {}
+	virtual ~CAIRO_GeoTiffOutputFactory() {}
+	
+	virtual OutputFactory* clone() const  { return new CAIRO_GeoTiffOutputFactory(); }    
+	virtual void set(DriverManager&, const XmlNode&);
+};
 #endif
 
 class KML_KmlOutputFactory : public OutputFactory
diff --git a/src/common/OutputHandler.cc b/src/common/OutputHandler.cc
index ff2edd8..a8175c5 100644
--- a/src/common/OutputHandler.cc
+++ b/src/common/OutputHandler.cc
@@ -106,13 +106,16 @@ static SimpleObjectMaker<SVG_SvgOutputFactory, OutputFactory> svg("svg");
 static SimpleObjectMaker<BinaryOutputFactory, OutputFactory> binary("mgb");
 
 #ifdef MAGICS_CAIRO
-static SimpleObjectMaker<CAIRO_PngOutputFactory,   OutputFactory> png("png");
+static SimpleObjectMaker<CAIRO_PngOutputFactory,    OutputFactory> png("png");
 static SimpleObjectMaker<CAIRO_PdfOutputFactory,    OutputFactory> pdf("pdf");
-static SimpleObjectMaker<CAIRO_XOutputFactory,       OutputFactory> x("x");
+static SimpleObjectMaker<CAIRO_XOutputFactory,      OutputFactory> x("x");
 static SimpleObjectMaker<CAIRO_CairoOutputFactory,  OutputFactory> cairo("cairo");
 static SimpleObjectMaker<CAIRO_SvgOutputFactory,    OutputFactory> csvg("cairo_svg");
-static SimpleObjectMaker<CAIRO_PsOutputFactory,      OutputFactory> cps("cairo_ps");
+static SimpleObjectMaker<CAIRO_PsOutputFactory,     OutputFactory> cps("cairo_ps");
 static SimpleObjectMaker<CAIRO_EpsOutputFactory,    OutputFactory> ceps("cairo_eps");
+#ifdef MAGICS_GEOTIFF
+static SimpleObjectMaker<CAIRO_GeoTiffOutputFactory,OutputFactory> geotiff("geotiff");
+#endif
 #endif
 
 static SimpleObjectMaker<KML_KmlOutputFactory, OutputFactory> kml("kml");
diff --git a/src/common/PolarStereographicProjection.cc b/src/common/PolarStereographicProjection.cc
index bf8cc8c..e6ee827 100644
--- a/src/common/PolarStereographicProjection.cc
+++ b/src/common/PolarStereographicProjection.cc
@@ -139,10 +139,15 @@ void PolarStereographicProjection::revert(const vector< std::pair<double, double
 {
 	assert(projection_);
 	out.reserve(in.size());
+
 	for ( vector< std::pair<double, double> >::const_iterator pt = in.begin();  pt != in.end(); ++pt) {
 		TeCoord2D texy = TeCoord2D(pt->first, pt->second);
 		TeCoord2D geo = projection_->PC2LL(texy);
-		out.push_back(make_pair(geo.x()*TeCRD, geo.y()*TeCRD));
+
+		if ( texy.y() > 0 && same(texy.x(), 0) )
+			out.push_back(make_pair(-180, geo.y()*TeCRD));
+		else
+			out.push_back(make_pair(geo.x()*TeCRD, geo.y()*TeCRD));
 	}
 }
 
@@ -213,6 +218,8 @@ void PolarStereographicProjection::init(double width, double height)
 
 		double stepx= (urx - llx)/100.;
 		double stepy= (ury - lly)/100.;
+		if (same(stepx, 0) )return;
+		if (same(stepy, 0) ) return;;
 		for (double x = llx; x <= urx; x += stepx )
 		{
 		   for (double y = lly; y <= ury; y += stepy )
@@ -734,7 +741,7 @@ void PolarStereographicProjection::centre(double width, double height)
 
 
 
-/*!
+/*!polar
  Read in the documentation:	
  For Polar Stereographic projections, the thinning factor is the distance, 
  in both X and Y directions, corresponding to the projected INPUT_FIELD_LONGITUDE_STEP ,
@@ -1003,5 +1010,11 @@ void PolarStereographicProjection::setDefinition(const string& json)
 
 
 }
+UserPoint PolarStereographicProjection::reference() const
+{
+	UserPoint ll = ( hemisphere_ ==  NORTH ) ? UserPoint(0, 60) : UserPoint(0, -60);
+
 
+	return ll;
+}
 
diff --git a/src/common/PolarStereographicProjection.h b/src/common/PolarStereographicProjection.h
index cf32bc1..4ba9f32 100644
--- a/src/common/PolarStereographicProjection.h
+++ b/src/common/PolarStereographicProjection.h
@@ -179,6 +179,7 @@ public:
         { return parent.absoluteHeight(); }
 	void getNewDefinition(const UserPoint&, const UserPoint&, string&) const;
 	void setDefinition(const string&);
+	UserPoint reference() const;
 protected:
 	//! Method to print string about this class on to a stream of type ostream (virtual).
 	virtual void print(ostream&) const; 
diff --git a/src/common/Proj4Projection.cc b/src/common/Proj4Projection.cc
index 96ec557..5f8cae6 100644
--- a/src/common/Proj4Projection.cc
+++ b/src/common/Proj4Projection.cc
@@ -41,8 +41,9 @@
 namespace magics
 {
 
-struct Epsg
+class Epsg
 {
+public:
 	Epsg(const string& name) : name_(name) {
 		epsgs_.insert(make_pair(lowerCase(name), this));
 		methods_["definition"] = &Epsg::definition;
@@ -51,13 +52,15 @@ struct Epsg
 		methods_["max_longitude"] = &Epsg::maxlon;
 		methods_["max_latitude"] = &Epsg::maxlat;
 		methods_["method"] = &Epsg::method;
+		initMethods_["geos"] = &Epsg::geosinit;
 	}
 	string name_;
 	string definition_;
 
-
+	typedef void (Epsg::*InitMethod)(const Proj4Projection&);
 	typedef void (Epsg::*Method)(const json_spirit::Value&);
 	map<string,  Method> methods_;
+	map<string,  InitMethod> initMethods_;
 
 	void definition(const json_spirit::Value& value) {
 		definition_ =  value.get_value<string>();
@@ -78,6 +81,28 @@ struct Epsg
 		method_ =  value.get_value<string>();
 	}
 
+	void init(const Proj4Projection& from) {
+		map<string,  InitMethod >::iterator initmethod = initMethods_.find(name_);
+		if ( initmethod != initMethods_.end() ) {
+			( this->*initmethod->second)(from) ;
+		}
+	}
+
+	void geosinit(const Proj4Projection& from) {
+		//cout <<  from.vertical_longitude_ << endl;
+		minlon_ = from.vertical_longitude_ - 80;
+		maxlon_ = from.vertical_longitude_ + 80;
+		minlat_ = -80;
+		maxlat_ = 80;
+		//cout <<  minlon_ << "   " << maxlon_ << endl;
+		ostringstream def;
+		def << "+proj=geos +h=42164000 +ellps=WGS84 +lon_0=" << from.vertical_longitude_;
+
+		definition_ = def.str();
+		//cout << definition_ << endl;
+	}
+
+
 	double minlon_ ;
 	double minlat_;
 	double maxlon_ ;
@@ -89,19 +114,24 @@ struct Epsg
 
 	void  set(const json_spirit::Value&);
 
-	static Epsg* find(const string& name) {
-		map<string, Epsg*>::iterator epsg = epsgs_.find(lowerCase(name));
+	static Epsg* find(const Proj4Projection& from) {
+		string name = lowerCase(from.name());
+		map<string, Epsg*>::iterator epsg = epsgs_.find(name);
 		if ( epsg == epsgs_.end() )  {
 			MagLog::warning() << "Can not find information on " << name << ": use epsg instead" << endl;
-			return find("EPSG:4326");
+			return epsgs_.find("EPSG:4326")->second;
 		}
+		epsg->second->init(from);
+
 		return epsg->second;
 	}
-	const char* definition() { return definition_.c_str(); }
 
+	const char* definition() { return definition_.c_str(); }
 
 };
 
+
+
 class EpsgConfig : public MagConfig
 {
 public:
@@ -152,51 +182,26 @@ void  EpsgConfig::callback(const string& name, const json_spirit::Value& value)
 	}
 
 }
-/*
-static Epsg epsg_4336("EPSG:4326",
-		"+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs",
-		-180, -90, +180, 90,
-		-180, -90, +180, 90,
-		20, 20, true
-		);
-
-static Epsg cylindrical("cylindrical",
-				"+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs",
-				-180, -90, +180, 90,
-				-180, -90, +180, 90,
-				20, 20, true
-				);
-
-static Epsg polar_north("polar_north",
-				"+proj=stere +lat_0=90 +lat_ts=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +ellps=WGS84 +datum=WGS84 +units=m +no_defs",
-				-180, -20, +180, -20,// line this one is to find the limit of the projection coordinate system.
-				-45, -20, 135, -20, // this one to define the default full extend
-				2,2, false
-				);
-static Epsg epsg_32661("EPSG:32661",
-				"+proj=stere +lat_0=90 +lat_ts=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +ellps=WGS84 +datum=WGS84 +units=m +no_defs",
-				-180, -20, +180, -20,// line this one is to find the limit of the projection coordinate system.
-				-45, -20, 135, -20, // this one to define the default full extend
-				2,2, false
-				);
-static Epsg geos("geos",
-				"+proj=goode",
-				-160,  0, 160, 0,// line this one is to find the limit of the projection coordinate system.
-				-180,  -90, 180, 90, // this one to define the default full extend
-				2,2, false
-				);
-*/
+
 /*!
   \brief Constructor
 */
-Proj4Projection::Proj4Projection(const string& definition) : definition_(definition)
+Proj4Projection::Proj4Projection(const string& definition) : definition_(definition),
+						gridMinLon_(DBL_MAX),
+						gridMinLat_(DBL_MAX),
+						gridMaxLon_(-DBL_MAX),
+						gridMaxLat_(-DBL_MAX)
+
 {
 
 	//init();
 	EpsgConfig config;
 	config.init();
 }
-Proj4Projection::Proj4Projection()
+Proj4Projection::Proj4Projection(): gridMinLon_(DBL_MAX),
+		gridMinLat_(DBL_MAX),
+		gridMaxLon_(-DBL_MAX),
+		gridMaxLat_(-DBL_MAX)
 {
 
 	//init();
@@ -222,7 +227,7 @@ void Proj4Projection::print(ostream& out) const
 
 Polyline& Proj4Projection::getPCBoundingBox() const
 {
-
+   
 	return *PCEnveloppe_;
 }
 
@@ -244,7 +249,7 @@ void Proj4Projection::init()
 
 
 	from_ = pj_init_plus("+proj=longlat +ellps=WGS84 +datum=WGS84");
-	projection_ = Epsg::find(definition_);
+	projection_ = Epsg::find(*this);
 	to_    = pj_init_plus(projection_->definition());
 	if ( !to_) {
 		MagLog::error() << pj_strerrno(pj_errno) << endl;
@@ -252,6 +257,8 @@ void Proj4Projection::init()
 		assert(false);
 	}
 
+
+
 	methods_["geos"] = &Proj4Projection::geos;
 	methods_["conic"] = &Proj4Projection::conic;
 	methods_["simple"] = &Proj4Projection::simple;
@@ -260,6 +267,8 @@ void Proj4Projection::init()
 		(this->*method->second)();
 	else
 		simple();
+
+
 	helpers_["full"] = &Proj4Projection::full;
 	helpers_["corners"] = &Proj4Projection::corners;
 	helpers_["centre"] = &Proj4Projection::centre;
@@ -320,7 +329,7 @@ PaperPoint Proj4Projection::operator()(const UserPoint& point)  const
 {
 	if ( ! from_ ) {
 		from_ = pj_init_plus("+proj=longlat +ellps=WGS84 +datum=WGS84");
-		projection_ = Epsg::find(definition_);
+		projection_ = Epsg::find(*this);
 		to_    = pj_init_plus(projection_->definition());
 	}
 	double x = point.x();
@@ -401,10 +410,6 @@ void Proj4Projection::aspectRatio(double& width, double& height)
 	Transformation::aspectRatio(width, height);
 }
 
-static double gridMinLon_ = DBL_MAX;
-static double gridMinLat_= DBL_MAX;
-static double gridMaxLon_= -DBL_MAX;
-static double gridMaxLat_= -DBL_MAX;
 
 void Proj4Projection::add(double lon, double lat)
 {
@@ -486,6 +491,11 @@ void Proj4Projection::geos()
 		min_pcy_ = DBL_MAX;
 		max_pcx_ = -DBL_MAX;
 		max_pcy_ = -DBL_MAX;
+
+
+		PCEnveloppe_->correct();
+		userEnveloppe_->correct();
+
 		map<double, vector<double> > helper;
 
 		for ( int lat = projection_->minlat_; lat <= projection_->maxlat_; lat++) {
@@ -528,13 +538,15 @@ void Proj4Projection::boundingBox(double& xmin, double& ymin, double& xmax, doub
 	if ( ! from_ ) {
 			from_ = pj_init_plus("+proj=longlat +ellps=WGS84 +datum=WGS84");
 			projection_ = Epsg::find(definition_);
-			to_    = pj_init_plus(projection_->definition());
+			to_    = pj_init_plus(proj4_definition_.c_str());
 		}
 	ymin = gridMinLat_;
 	xmin = gridMinLon_-5;
 	ymax = gridMaxLat_;
 	xmax = gridMaxLon_+5;
 
+	//cout << "Bounding box ->" << xmin << " " << xmax << endl;
+
 }
 
 double Proj4Projection::getMinX()  const
@@ -894,6 +906,27 @@ void Proj4Projection::labels(const LabelPlotting& label, TopAxisVisitor& visitor
 		horizontalLabels(label, max_pcy_, y, MBOTTOM);
 	}
 }
+void Proj4Projection::reprojectComponents(double& x, double& y, pair<double, double>& components) const
+{
+	double speed = sqrt((components.first * components.first) + (components.second * components.second));
+	double angle = atan2(components.second,components.first);
+
+
+	double ppx=x+cos(angle);
+	double ppy=y+sin(angle);
+
+	fast_reproject(ppx, ppy);
+	fast_reproject(x, y);
+
+
+
+	double rotation = atan2((ppy - y), (ppx - x));
+
+		// we the angle and the spped we compute u/v...
+		components.first = speed * cos(rotation);
+		components.second = speed * sin(rotation);
+
+}
 
 void Proj4Projection::revert(const vector< std::pair<double, double> > & in, vector< std::pair<double, double> > & out) const
 {
@@ -918,6 +951,8 @@ void Proj4Projection::revert(const vector< std::pair<double, double> > & in, vec
 		  }
 		  else {
 			  double lon = x*RAD_TO_DEG;
+			  if ( lon > gridMaxLon_ ) lon -= 360.;
+			  else if ( lon < gridMinLon_ ) lon += 360.;
 			  double lat = y*RAD_TO_DEG;
 			  out.push_back(make_pair(lon, lat));
 		  }
diff --git a/src/common/Proj4Projection.h b/src/common/Proj4Projection.h
index 028a431..50f6912 100644
--- a/src/common/Proj4Projection.h
+++ b/src/common/Proj4Projection.h
@@ -211,10 +211,10 @@ public:
 	void simple();
 	void add(double, double);
 	double patchDistance(double) const;
-
+	const string& name() const { return definition_; }
 	void getNewDefinition(const UserPoint&, const UserPoint&, string&) const;
 	void setDefinition(const string&);
-
+	void reprojectComponents(double&, double&, pair<double, double>&) const;
 protected:
      //! Method to print string about this class on to a stream of type ostream (virtual).
 	 typedef void (Proj4Projection::*SettingHelper)();
@@ -233,6 +233,11 @@ protected:
 	 double max_pcy_;
 	 mutable Epsg*   projection_;
 	 string definition_;
+	 double gridMinLon_;
+	 double gridMinLat_;
+	 double gridMaxLon_;
+	 double gridMaxLat_;
+
 
 private:
     //! Copy constructor - No copy allowed
diff --git a/src/common/RasterData.h b/src/common/RasterData.h
index fb932b1..3cd1a11 100644
--- a/src/common/RasterData.h
+++ b/src/common/RasterData.h
@@ -30,6 +30,7 @@
 #ifndef RasterData_H
 #define RasterData_H
 
+#include <algorithm>
 #include "magics.h"
 
 class TeProjection;
diff --git a/src/common/TaylorProjection.cc b/src/common/TaylorProjection.cc
index e671a3a..1b709ba 100644
--- a/src/common/TaylorProjection.cc
+++ b/src/common/TaylorProjection.cc
@@ -53,25 +53,28 @@ void TaylorProjection::print(ostream& out) const
     out << "TaylorProjection[";
     TaylorProjectionAttributes::print(out);
     out << "]"; 
-} 
+}
+void TaylorProjection::cleanPCEnveloppe() {
+    PCEnveloppe_->clear();
+    PCEnveloppe_->push_back(PaperPoint(min_, min_));
+    PCEnveloppe_->push_back(PaperPoint(min_, max_));
+
+    for ( float i = 0; i <= (3.14/2); i = i +0.1) {
+    
+    
+        PCEnveloppe_->push_back(PaperPoint(max_*cos(i), max_*sin(i)));
+    
+    }
 
+    PCEnveloppe_->push_back(PaperPoint(max_, min_));
+    PCEnveloppe_->push_back(PaperPoint(min_, min_));
+}
 void TaylorProjection::init()  
 {
 
 	Transformation::init();
-	PCEnveloppe_->clear();
-	PCEnveloppe_->push_back(PaperPoint(min_, min_));
-	PCEnveloppe_->push_back(PaperPoint(min_, max_));
-
-	for ( float i = 0; i <= (3.14/2); i = i +0.1) {
-
-
-		PCEnveloppe_->push_back(PaperPoint(max_*cos(i), max_*sin(i)));
-
-	}
-
-	PCEnveloppe_->push_back(PaperPoint(max_, min_));
-	PCEnveloppe_->push_back(PaperPoint(min_, min_));
+    cleanPCEnveloppe();
+    
 }
 
 PaperPoint TaylorProjection::operator()(const UserPoint& xy)  const
@@ -186,11 +189,14 @@ Polyline& TaylorProjection::getPCBoundingBox() const
 	if ( PCEnveloppe_->empty() ) {
 		PCEnveloppe_->push_back(PaperPoint(min_, min_));
 		PCEnveloppe_->push_back(PaperPoint(min_, max_));
-		PCEnveloppe_->push_back(PaperPoint(max_, max_));
+
+		for ( float i = 0; i <= (3.14/2); i = i +0.1) {
+			PCEnveloppe_->push_back(PaperPoint(max_*cos(i), max_*sin(i)));
+		}
+
 		PCEnveloppe_->push_back(PaperPoint(max_, min_));
 		PCEnveloppe_->push_back(PaperPoint(min_, min_));
 	}
-
 	return *PCEnveloppe_;
 
 }
diff --git a/src/common/TaylorProjection.h b/src/common/TaylorProjection.h
index 59b4cb9..37bc935 100644
--- a/src/common/TaylorProjection.h
+++ b/src/common/TaylorProjection.h
@@ -77,6 +77,7 @@ public:
 	\\brief Initialise the projection
 	*/
 	virtual void init() ;
+    virtual void cleanPCEnveloppe();
 	/*!
 	\\brief 
 	*/
diff --git a/src/common/Tephigram.cc b/src/common/Tephigram.cc
index a41f8ac..8445d9e 100644
--- a/src/common/Tephigram.cc
+++ b/src/common/Tephigram.cc
@@ -45,7 +45,7 @@ Tephigram::Tephigram()
 /*!
   \brief Destructor
 */
-Tephigram::~Tephigram() 
+Tephigram::~Tephigram()
 {
 }
 
@@ -58,25 +58,29 @@ void Tephigram::print(ostream& out) const
 #define sinus  -0.7071
 #define cosinus  0.7071
 static double maxpcx;
-void Tephigram::init()  
+void Tephigram::init()
 {
-	if ( x_min_ == 0 && x_max_ == 100 ) {
-		x_min_ = -20;
-		x_max_ =40;
-	}
 
-	if ( y_min_ == 0 && y_max_ == 100 ) {
-			y_min_ = 1060.;
-			y_max_ = 200;
+	if ( x_min_ == 0 && x_max_ == 100 ) {
+			x_min_ = -90;
+			x_max_ = 50;
 		}
 
-	double tmin = x_min_;
-	double thmin= magics::theta(tmin+273.15, y_min_*100.)-273.15;
+		if ( y_min_ == 0 && y_max_ == 100 ) {
+				y_min_ = 1060.;
+				y_max_ = 200;
+			}
+
+		vector<double> x, y;
 
-	double thmax = magics::theta(tmin+273.15, y_max_*100.)-273.15;
-	double tmax = temperatureFromTheta(thmax+273.15,  y_max_*100. ) -273.15;
 
+		double tmin = (x_min_ + x_max_)/2.;
+		double pmin = std::max(y_min_, y_max_);
+		double pmax = std::min(y_min_, y_max_);
 
+		double thmin= magics::theta(tmin+273.15, pmin*100.)-273.15;
+		double thmax = magics::theta(tmin+273.15, pmax*100.)-273.15;
+		double tmax = temperatureFromTheta(thmax+273.15,  pmax*100. ) -273.15;
 	minPCX_ = ((tmin * cosinus) - (thmin * sinus) );
 	minPCY_ = (tmin * sinus) + (thmin * cosinus);
 	maxPCX_ = ((tmax * cosinus) - (thmax * sinus));
@@ -86,7 +90,7 @@ void Tephigram::init()
 	maxpcx = maxPCX_;
 
 	MagLog::dev() << "useful in tephi " << maxpcx << endl;
-	maxPCX_ += (maxPCX_ - minPCX_)*0.25;
+	maxPCX_ += (maxPCX_ - minPCX_)*(annotation_width_/100.);
 	MagLog::dev() << "set in tephi in grid " << maxpcx << endl;
 
 
@@ -115,11 +119,16 @@ void TephiInfo::init()
 const double KAPPA=0.285611;
 PaperPoint Tephigram::operator()(const UserPoint& xy)  const
 {
+
+
+	double p = (same(xy.y(), 0) ) ? 1. : xy.y();
 	if (  xy.x() >= 1000 ) {// x = x
 	// y = p
-		double coefficient = pow(100000./(xy.y()*100),KAPPA);
+
+
+		double coefficient = pow(100000./(p*100),KAPPA);
 		double y = (maxpcx+(273.15*(cosinus-sinus)))*((sinus + (coefficient*cosinus)))/(cosinus -(coefficient*sinus)) - 2713.15*(sinus+cosinus);
-		MagLog::dev() << xy.y() << "-->" << y << "??? " << minPCY_ << "<<" <<  maxPCY_<< endl;
+		MagLog::dev() << p << "-->" << y << "??? " << minPCY_ << "<<" <<  maxPCY_<< endl;
 		double x =  (maxPCX_ - maxpcx)*(xy.x()-1000.) + maxpcx;
 		MagLog::dev() << x << endl;
 		return PaperPoint(x, y, xy.value());
@@ -127,7 +136,8 @@ PaperPoint Tephigram::operator()(const UserPoint& xy)  const
 	// UserPoint X = temperature in deg Y = Pressure in hPa
 	// First we calculate theta and we rotate!
 	double tempe = xy.x();
-	double theta = magics::theta(tempe+273.15, (xy.y())*100.)-273.15;
+
+	double theta = magics::theta(tempe+273.15, p*100.)-273.15;
 	double x = ((tempe * cosinus) - (theta * sinus) );
 	double y = (tempe * sinus) + (theta * cosinus);
 
@@ -169,8 +179,28 @@ bool Tephigram::needShiftedCoastlines()  const
 {
 	return false;
 }
+void Tephigram::setMinMaxX(double min, double max)
+{
+	if ( min > 1000 || max > 1000) return;
+	setMinX(min);
+	setMaxX(max);
+	init();
+}
+
+void Tephigram::setMinMaxY(double min, double max)
+{
+	// Careful, Tephigram are in pressure levels...
+	if ( min < 50.) {
+		MagLog::warning() << " Top Pressure reset to 50." << endl;
+		min = 50.;
+	}
 
-void Tephigram::aspectRatio(double& width, double& height)  
+
+	setMinY(max);
+	setMaxY(min);
+	init();
+}
+void Tephigram::aspectRatio(double& width, double& height)
 {
 
 
@@ -238,24 +268,28 @@ double Tephigram::getMaxY()  const
 	return y_max_;
 }
 
-void Tephigram::setMinX(double x)  
+void Tephigram::setMinX(double x)
 {
-	x_min_ = x;
+	if ( x < x_min_ )
+		x_min_ = x;
 }
 
-void Tephigram::setMinY(double y)  
+void Tephigram::setMinY(double y)
 {
-	y_min_ = y;
+	if ( y > y_min_ )
+		y_min_ = y;
 }
 
-void Tephigram::setMaxX(double x)  
+void Tephigram::setMaxX(double x)
 {
-	x_max_ = x;
+	if ( x > x_max_ )
+		x_max_ = x;
 }
 
-void Tephigram::setMaxY(double y)  
+void Tephigram::setMaxY(double y)
 {
-	y_max_ = y;
+	if ( y < y_max_ )
+		y_max_ = y;
 }
 
 double Tephigram::getMinPCX()  const
@@ -325,7 +359,7 @@ void Tephigram::setDefinition(const string& json)
 
 		XmlNode node = **helper.tree_.firstElement();
 
-		node.name("tephigram");
+		node.name("Tephigram");
 
 
 		set(node);
@@ -344,7 +378,7 @@ void toxml2(string& out, const map<string, string>& def)
 void Tephigram::getNewDefinition(const UserPoint& ll, const UserPoint& ur, string& out) const
 {
 	map<string, string> def;
-	def["subpage_map_projection"] = "tephigram";
+	def["subpage_map_projection"] = "Tephigram";
 
 	def["x_min"]= tostring(ll.x_);
 			def["x_max"]= tostring(ur.x_);
diff --git a/src/common/Tephigram.h b/src/common/Tephigram.h
index 94be57b..2a21524 100644
--- a/src/common/Tephigram.h
+++ b/src/common/Tephigram.h
@@ -85,7 +85,10 @@ public:
 	/*!
 	\\brief 
 	*/
-
+	virtual bool getAutomaticX() const { return x_automatic_; }
+	virtual bool getAutomaticY() const { return y_automatic_; }
+	virtual void setMinMaxX(double, double);
+	virtual void setMinMaxY(double, double);
 	virtual PaperPoint operator()(const PaperPoint&) const;
 	/*!
 	\\brief 
diff --git a/src/common/Tokenizer.cc b/src/common/Tokenizer.cc
index 809628b..93a6327 100644
--- a/src/common/Tokenizer.cc
+++ b/src/common/Tokenizer.cc
@@ -20,6 +20,7 @@
 #include "Tokenizer.h"
 #endif
 
+#include <algorithm>
 #include <fstream>
 
 Tokenizer::Tokenizer(const string& separators)
diff --git a/src/common/Transformation.cc b/src/common/Transformation.cc
index 9626f53..14a6ccb 100644
--- a/src/common/Transformation.cc
+++ b/src/common/Transformation.cc
@@ -57,10 +57,11 @@ void Transformation::forceNewArea(double xpcmin, double ypmin, double xpcmax, do
 {
 	
 }
+#define PRINT(w, a) MagLog::dev() << w << "---> " << #a << ": " << (a) << std::endl
 void Transformation::fill(double& width, double& height)
 {
+    init();
 
-	init();
 		// with and height will only
 		double w = getAbsoluteMaxPCX() - getAbsoluteMinPCX();
 		double h = getAbsoluteMaxPCY() - getAbsoluteMinPCY();
@@ -91,175 +92,73 @@ void Transformation::fill(double& width, double& height)
 
 			  	askedWidth_ = width*40;
 			  		askedHeight_ = height*40;
-		
+
+			  		 PRINT ("fill", minx);
+			  		    PRINT ("fill", miny);
+			  		    PRINT ("fill", maxx);
+			  		    PRINT ("fill", maxy);
 			setNewPCBox(minx, miny, maxx, maxy);
 }
 
-#define PRINT(w, a) MagLog::dev() << w << "---> " << #a << ": " << (a) << std::endl
 
 
 void Transformation::tile(double& width, double& height)
 {
-	init();
-	// here we assume we are in the wrepMode, this should be checked!
-
+	fill(width, height);
 
-	// with and height will only
-	double awidth = getAbsoluteMaxPCX() - getAbsoluteMinPCX();
-	double aheight = getAbsoluteMaxPCY() - getAbsoluteMinPCY();
+	// here we assume we are in the wrepMode, this should be checked!
+	init();
 
 	double minx =  getAbsoluteMinPCX();
 	double maxx =  getAbsoluteMaxPCX();
 	double miny =  getAbsoluteMinPCY();
 	double maxy =  getAbsoluteMaxPCY();
-
-	awidth = maxx -minx;
-	aheight = maxy -miny;
-
-
-
-
-			int tiles;
-			double nw = (width/height) * aheight;
-
-
-
-
-
-
-
-
-
-
+	  PRINT ("B", minx);
+	    PRINT ("Btile", miny);
+	    PRINT ("Btile", maxx);
+	    PRINT ("Btile", maxy);
+    double pcwidth = maxx - minx;
+    double pcheight = maxy - miny;
 
 	double pxheight = height*40.;
 	double pxwidth = width*40.;
 
-	// Try to see if we have already a number of tile.
-	if (same((pxheight/tile_ - int(pxheight)/tile_), 0)) {
-		pxheight = int(pxheight);
+	tile_ = 512;
+	double tile = 512;
 
-	}
-	if (same((pxwidth/tile_ - int(pxwidth)/tile_), 0)) {
-		pxwidth = int(pxwidth);
+	int xtile = ceil(pxwidth/tile);
+	int ytile = ceil(pxheight/tile);
 
-	}
 
 	askedWidth_ = pxwidth;
 	askedHeight_ = pxheight;
 
-	double pcwidth = maxx-minx;
-	double pcheight = maxy-miny;
-	PRINT("pcwidth", pcwidth);
-	PRINT("pcheight", pcheight);
-	vector<double> levels;
-	double u = unit_;
-	for ( float i = 6; i > 0; i--) {
-
-		levels.push_back((u)/tile_);
-
-
-		u = u/2.;
-	}
-	std::sort(levels.begin(), levels.end());
-
-
-	for ( vector<double>::iterator l = levels.begin(); l != levels.end(); ++l)
-		MagLog::debug()  << *l << ", ";
-
-	double ratio = ( nw > awidth) ? pcheight/pxheight : pcwidth/pxwidth;
-					  	// we need to extend in the x direction
-
-
-
-
-
-
-	vector<double>::iterator l = levels.begin();
-	while ( l != levels.end() ) {
-
-		if ( ratio - *l   <  unitEpsilon_  ) {
-			break;
-		}
-		++l;
-	}
-
-
-
-
-	double level = ( l == levels.end() ) ? levels.back() : *l;
-
-
-	int ytiles = ceil((pcheight/level)/tile_);
-	int xtiles = ceil((pcwidth/level)/tile_);
-
-	zoomLevel_ = ytiles;
-
-
-	pxwidth  = tile_*xtiles;
-	pxheight = tile_*ytiles;
-
-
-	// compute new pxminx, pxminy, pxmaxx, pxmaxy
-
-	int pxminx, pxminy, pxmaxx, pxmaxy;
-
-	pxminx = (minx-originX_)/level;
-	pxminy = (miny-originY_)/level;;
-	pxmaxx = (maxx-originX_)/level;
-	pxmaxy = (maxy-originY_)/level;
-
-	xTile_ = pxminx;
-	yTile_ = pxmaxy;
-
-
-
-	// compute  new minx
-
-	pxminx = floor((float)pxminx/tile_)*tile_;
-	pxminy = floor((float)pxminy/tile_)*tile_;
-
-	pxmaxx =  ceil((float)pxmaxx/tile_)*tile_;
-	pxmaxy =  ceil((float)pxmaxy/tile_)*tile_;
-
-
-
-
-	// now we can compute the new minx,,,
-	minx = (pxminx * level) + originX_;
-	miny =  (pxminy * level) + originY_;
-	maxx = (pxmaxx * level) + originX_;
-	maxy = (pxmaxy * level) + originY_;
-	// now we jsut have to count the number of tiles to find the width and the hieght
-
-	width = (pxmaxx-pxminx);
-	height = (pxmaxy-pxminy);
-
-	if ( askedWidth_ > width ) {
-		maxx += level*tile_;
-		width += tile_;
-
-	}
-	if ( askedHeight_ > height ) {
-
-			miny -= level*tile_;
-			height +=tile_;
-
-	}
-	width /=40.;
-	height /=40.;
-
-
-
-
-	xTile_ = xTile_ - pxminx;
-	yTile_ = pxmaxy - yTile_;
-
-
+	width = xtile * tile;
+	height = ytile * tile;
+
+
+    double xoffset = ((width - pxwidth)/pxwidth)*pcwidth; 
+    double yoffset = ((height - pxheight)/pxheight)*pcheight; 
+    xoffset /=2;
+    yoffset /=2;
+    
+    minx -= xoffset;
+    miny -= yoffset;
+    maxx += xoffset;
+    maxy += yoffset;
+    xTile_ = (width - pxwidth)/2;
+    yTile_ = (height - pxheight)/2;
+    // Now we fill
+
+    PRINT ("tile", minx);
+    PRINT ("tile", miny);
+    PRINT ("tile", maxx);
+    PRINT ("tile", maxy);
+	width = width/40.;
+	height = height/40.;
+	setNewPCBox(minx, miny, maxx, maxy);
 
 
-	setNewPCBox(minx, miny, maxx, maxy);
-	init();
 }
 
 void Transformation::aspectRatio(double& width, double& height)
@@ -346,28 +245,30 @@ bool ViewFilter::in(const PaperPoint& xy){
 
 void Transformation::init()
 {
-	PCEnveloppe_->clear();
-
-	PCEnveloppe_->push_back(PaperPoint(getMinPCX(), getMinPCY()));
-	PCEnveloppe_->push_back(PaperPoint(getMinPCX(), getMaxPCY()));
-	PCEnveloppe_->push_back(PaperPoint(getMaxPCX(), getMaxPCY()));
-	PCEnveloppe_->push_back(PaperPoint(getMaxPCX(), getMinPCY()));
-	PCEnveloppe_->push_back(PaperPoint(getMinPCX(), getMinPCY()));
+    cleanPCEnveloppe();
 	askedxmin_ =  std::min(getMinPCX(), getMaxPCX());
 	askedxmax_ =  std::max(getMinPCX(), getMaxPCX());
 	askedymin_ =  std::min(getMinPCY(), getMaxPCY());
 	askedymax_ =  std::max(getMinPCY(), getMaxPCY());
 }
 
-void Transformation::cleaninit()
+void Transformation::cleanPCEnveloppe()
 {
-	PCEnveloppe_->clear();
+    PCEnveloppe_->clear();
+        
+        PCEnveloppe_->push_back(PaperPoint(getMinPCX(), getMinPCY()));
+        PCEnveloppe_->push_back(PaperPoint(getMinPCX(), getMaxPCY()));
+        PCEnveloppe_->push_back(PaperPoint(getMaxPCX(), getMaxPCY()));
+        PCEnveloppe_->push_back(PaperPoint(getMaxPCX(), getMinPCY()));
+        PCEnveloppe_->push_back(PaperPoint(getMinPCX(), getMinPCY()));
+    
+    
+}
 
-	PCEnveloppe_->push_back(PaperPoint(getMinPCX(), getMinPCY()));
-	PCEnveloppe_->push_back(PaperPoint(getMinPCX(), getMaxPCY()));
-	PCEnveloppe_->push_back(PaperPoint(getMaxPCX(), getMaxPCY()));
-	PCEnveloppe_->push_back(PaperPoint(getMaxPCX(), getMinPCY()));
-	PCEnveloppe_->push_back(PaperPoint(getMinPCX(), getMinPCY()));
+void Transformation::cleaninit()
+{
+    cleanPCEnveloppe();
+	
 	askedxmin_ =  std::min(getMinPCX(), getMaxPCX());
 	askedxmax_ =  std::max(getMinPCX(), getMaxPCX());
 	askedymin_ =  std::min(getMinPCY(), getMaxPCY());
@@ -413,8 +314,8 @@ void Transformation::visit(MetaDataVisitor& visitor,
 
 	java << "\"pcxmin\" : \"" << getMinPCX() <<  "\",";		
 	java << "\"pcymin\" : \"" << getMinPCY() <<  "\",";		
-	java << "\"pcxmin\" : \"" << getMinPCX() <<  "\",";
-	java << "\"pcymin\" : \"" << getMinPCY() <<  "\",";
+	java << "\"pcxmax\" : \"" << getMaxPCX() <<  "\",";
+	java << "\"pcymax\" : \"" << getMaxPCY() <<  "\",";
 
 	java << "\"pcwidth\" : \"" << w <<  "\",";	
 	java << "\"pcheight\" : \"" << h <<  "\",";
@@ -448,67 +349,109 @@ void Transformation::operator()(const Polyline& from, BasicGraphicsObjectContain
 	PaperPoint ur(getMaxPCX(), getMaxPCY());
 	boost::geometry::model::box<PaperPoint> box(ll, ur);
 	boost::geometry::correct(box);
-	if ( from.closed() ) {
-		deque<PaperPoint> line;
-
-		for (unsigned i = 0; i < from.size(); i++) {
-			line.push_back(from.get(i));
-
-		}
-
-		boost::geometry::correct(line);
-		vector<deque<PaperPoint> > result;
-		try {
-			boost::geometry::intersection(box, line, result);
 
-			// Now we feed the graphic container!
 
-			for (vector<deque<PaperPoint> >::iterator l = result.begin(); l != result.end(); l++)
-			{
-				Polyline* poly = from.getNew();
 
-				for (deque<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;
-		}
-	}
-	else {
-		vector<PaperPoint> line;
+	vector<deque<PaperPoint> > holes;
+	vector<Polyline*> forholes;
 
+	if ( from.closed() ) {
+	try {
+		deque<PaperPoint> line;
+			//line.reserve( from.size());
 		for (unsigned i = 0; i < from.size(); i++) {
-			line.push_back(from.get(i));
+				line.push_back(from.get(i));
+
 		}
+		vector<deque<PaperPoint> > result;
 		boost::geometry::correct(line);
-		vector<vector<PaperPoint> > result;
-		try {
 		boost::geometry::intersection(box, line, result);
 
 		// Now we feed the graphic container!
 
-		for (vector<vector<PaperPoint> >::iterator l = result.begin(); l != result.end(); l++)
+		for (vector<deque<PaperPoint> >::iterator l = result.begin(); l != result.end(); l++)
 		{
 			Polyline* poly = from.getNew();
 
-			for (vector<PaperPoint>::iterator point = l->begin(); point != l->end(); ++point)
+			for (deque<PaperPoint>::iterator point = l->begin(); point != l->end(); ++point)
 				poly->push_back(*point);
 
-			if ( !poly->empty() )
+			if ( !poly->empty() ) {
 				out.push_back(poly);
+				forholes.push_back(poly);
+			}
+			// Now we add the holes
 		}
+
+		for (Polyline::Holes::const_iterator h = from.beginHoles(); h !=  from.endHoles(); ++h) {
+
+			deque<PaperPoint> hole;
+			for (deque<PaperPoint>::const_iterator pt = h->begin(); pt != h->end(); ++pt) {
+				hole.push_back(*pt);
+			}
+
+			vector<deque<PaperPoint> > clip;
+			boost::geometry::correct(hole);
+			boost::geometry::intersection(box, hole, clip);
+			for (vector<deque<PaperPoint> >::iterator l = clip.begin(); l != clip.end(); l++) {
+				if ( l->size() ) {
+					holes.push_back(deque<PaperPoint>());
+					for (deque<PaperPoint>::iterator point = l->begin(); point != l->end(); ++point)
+						holes.back().push_back(*point);
+				}
+
+			}
 		}
 
-				catch (...) {
-					MagLog::warning() << "error clipping->line ignored" << endl;
+		for ( vector<Polyline*>::const_iterator poly = forholes.begin(); poly != forholes.end(); ++poly)
+			for (vector<deque<PaperPoint> >::iterator x = holes.begin(); x != holes.end(); x++) {
+
+				if ( (*poly)->within(x->front()) ) {
+					(*poly)->newHole();
+					for (deque<PaperPoint>::iterator point = x->begin(); point != x->end(); ++point)
+						(*poly)->push_back_hole(*point);
 				}
+			}
+	}
+	catch (...) {
+		MagLog::warning() << "error clipping->line ignored" << endl;
+	}
+	return;
+	}
+	try {
+			vector<PaperPoint> line;
+				//line.reserve( from.size());
+			for (unsigned i = 0; i < from.size(); i++) {
+					line.push_back(from.get(i));
+
+			}
+			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 = from.getNew();
 
+				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;
+	}
+
+
+
+
+
 }
 
 
@@ -553,6 +496,7 @@ bool Transformation::in(const UserPoint& point) const
 bool Transformation::in(const PaperPoint& point) const
 {
 	if ( PCEnveloppe_->empty()) {
+        
 		PCEnveloppe_->push_back(PaperPoint(getMinPCX(), getMinPCY()));
 		PCEnveloppe_->push_back(PaperPoint(getMinPCX(), getMaxPCY()));
 		PCEnveloppe_->push_back(PaperPoint(getMaxPCX(), getMaxPCY()));
@@ -713,119 +657,113 @@ void useRef(double ref, double inc, double& min, double& max)
 
 }
 
-/* refx, rey,stepx stepy Should in projection coordinates! */
 
-void Transformation::thin(double xstep, double ystep, double gap,  vector<UserPoint>& in) const
-{
-	Timer timer("thiining", "");
 
 
 
 
-	double uxmin, uxmax, uymin, uymax;
-	int dimx, dimy;
-	// Find the box..
-	uxmin = uxmax = in.front().x_;
-	uymin = uymax = in.front().y_;
 
+void Transformation::thin(double step, PaperPoint& origin, vector<pair<double, double> >& points) const
+{
+	Timer timer("thinning", "");
 
+	vector< std::pair<double, double> > xypoints;
+	double minx = getMinPCX();
+	double maxx = getMaxPCX();
+	double miny = getMinPCY();
+	double maxy = getMaxPCY();
 
-	for ( PointIter pt = in.begin(); pt != in.end(); ++pt ) {
-		double x = pt->x_;
-		double y = pt->y_;
-		if ( x < uxmin ) uxmin = x;
-		if ( y < uymin ) uymin = y;
-		if ( x > uxmax ) uxmax = x;
-		if ( y > uymax ) uymax = y;
-	}
 
+	std::set<double> xl, yl;
 
 
 
-	dimx = ((uxmax - uxmin)  / xstep ) +1;
-	dimy = ((uymax - uymin ) / ystep ) +1;
-	vector<bool> mask(dimx*dimy, false);
-	for ( int j = 0; j < dimy; j++)	{
-		double lasty = uymin +(ystep*j);
-		double lastx = uxmin;
-		fast_reproject(lastx, lasty);
-		for ( int i = 0; i < dimx; i++) {
-			double y = uymin +(ystep*j);
-			double x = uxmin +(xstep*i);
-			fast_reproject(x, y);
-			if ( ( (x-lastx)*(x-lastx) + (y-lasty)*(y-lasty)) < gap )
-				mask[j*dimx+i] = true;
-			else {
-				lastx = x;
-				lasty = y;
-			}
-		}
+	for ( double x = origin.x(), i = 1; x <= maxx; x = origin.x() + i*step, i++) {
+		if ( x > minx )
+			xl.insert(x);
 	}
+	for ( double x = origin.x(), i = 1; x >= minx; x = origin.x() - i*step, i++)
+		if ( x < maxx )
+			xl.insert(x);
+	for ( double y = origin.y(), i = 1; y <= maxy; y = origin.y() + i*step, i++)
+		if ( y > miny )
+			yl.insert(y);
+	for ( double y = origin.y(), i = 1; y >= miny; y = origin.y() - i*step, i++)
+		if ( y < maxy ) {
+			yl.insert(y);
 
-
-	vector<PointIter> helper(dimx*dimy, in.end());
-
-	for ( PointIter pt = in.begin(); pt != in.end(); ++pt ) {
-		double x = pt->x_;
-		double y = pt->y_;
-
+		}
+	for (std::set<double>::iterator x = xl.begin(); x != xl.end(); ++x)
+		for (std::set<double>::iterator y = yl.begin(); y != yl.end(); ++y){
+							xypoints.push_back(make_pair(*x, *y));
+					}
 
 
-		int xx = ceil(x-uxmin)/xstep;
-		int yy = ceil(y-uymin)/ystep;
+	revert(xypoints, points);
 
+}
 
+void Transformation::thin(double step, PaperPoint& origin, Matrix& matrix, double missing) const
+{
+/*
+	Timer timer("thinning", "");
 
-		vector<pair<int, int> > check;
+	vector< std::pair<double, double> > xypoints;
+	double minx = getMinPCX();
+	double maxx = getMaxPCX();
+	double miny = getMinPCY();
+	double maxy = getMaxPCY();
 
-		check.push_back(make_pair(yy, xx));
-		//if ( xx + 1 < dimx )
-			//check.push_back(make_pair(yy, xx+1));
-		//if ( yy + 1 < dimy )
-			//check.push_back(make_pair(yy+1, xx));
-		//if ( xx + 1 < dimx && yy + 1 < dimy )
-			//check.push_back(make_pair(yy+1, xx+1));
 
+	std::set<double> xl, yl;
 
 
-		for ( vector<pair<int, int> >::iterator ind = check.begin(); ind != check.end(); ++ind) {
-			int i = ind->first*dimx + ind->second;
-			if ( mask[i] )
-				continue;
-			if ( i < 0 || i >= dimx*dimy)
-				continue;
 
-			double x0 = ind->second * xstep + uxmin;
-			double y0 = ind->first * ystep + uymin;
-			if ( !this->in(x0, y0) )
-				continue;
+	for ( double x = origin.x(), i = 1; x <= maxx; x = origin.x() + i*step, i++) {
+		if ( x > minx )
+			xl.insert(x);
+	}
+	for ( double x = origin.x(), i = 1; x >= minx; x = origin.x() - i*step, i++)
+		if ( x < maxx )
+			xl.insert(x);
+	for ( double y = origin.y(), i = 1; y <= maxy; y = origin.y() + i*step, i++)
+		if ( y > miny )
+			yl.insert(y);
+	for ( double y = origin.y(), i = 1; y >= miny; y = origin.y() - i*step, i++)
+		if ( y < maxy ) {
+			yl.insert(y);
 
+		}
 
-			PointIter last = helper[i];
+	matrix.set(x.size(), y.size(), missing);
 
-			if ( last == in.end()) {
-				helper[i ]= pt;
-			}
-			else {
+	for ( std::set<double>::iterator x = xl.begin(), x != xl.end(); ++x )
+		matrix.columns().push_back(*x);
+	for ( std::set<double>::iterator y = yl.begin(), y != yl.end(); ++y )
+			matrix.columns().push_back(*y);
 
-				double dist = sqrt(((x-x0) * (x-x0)) +  ((y - y0) * (y - y0)));
-
-				double lastx = last->x_;
-				double lasty = last->y_;
+	(*matrix)->setMapsAxis();
+*/
+}
 
-				double min = sqrt(((lastx-x0) * (lastx-x0)) +  ((lasty - y0) * (lasty -y0)));
-				if (dist < min){
-					helper[i ] = pt;
-				}
-			}
-		}
+UserPoint Transformation::reference() const
+{
+	PaperPoint xy((getMinPCX() +  getMaxPCX())/2., (getMinPCY() +  getMaxPCY())/2.);
+	UserPoint ll;
+	revert(xy, ll);
+	return ll;
+}
 
+double Transformation::distance(UserPoint& point1, UserPoint& point2) const
+{
+	double x1 = point1.x_;
+	double y1 = point1.y_;
+	double x2 = point2.x_;
+	double y2 = point2.y_;
+	fast_reproject(x1, y1);
+	fast_reproject(x2, y2);
 
-	}
+	return sqrt (( x1-x2 ) *  ( x1-x2 ) + ( y1-y2 ) *  ( y1-y2 ));
 
-	for ( int j = 0; j < dimx*dimy; j++) {
-		if ( helper[j] != in.end() )
-			helper[j]->flagMissing();
-	}
 
 }
diff --git a/src/common/Transformation.h b/src/common/Transformation.h
index c4121af..c2fff51 100644
--- a/src/common/Transformation.h
+++ b/src/common/Transformation.h
@@ -111,6 +111,7 @@ public:
 	Transformation();
 	virtual ~Transformation();
 	virtual void init();
+    virtual void cleanPCEnveloppe();
 	void cleaninit();
 	enum CoordinateType {GeoType,XyType};
 	CoordinateType coordinateType() const {return coordinateType_;}	
@@ -125,8 +126,8 @@ public:
 		return object;
 	}
 	
-	virtual Polyline& getUserBoundingBox() const  { assert(false); }
-	virtual Polyline& getPCBoundingBox()   const  { assert(false); }
+	virtual Polyline& getUserBoundingBox() const  { assert(false);}
+	virtual Polyline& getPCBoundingBox()   const  { assert(false);}
 	
 	bool needTopAxis() const   { return topAxis_; }
 	void needTopAxis(bool top) { topAxis_ = top; }
@@ -187,7 +188,7 @@ public:
 	virtual void fill(double&, double&); // fill the space , can adapt the coordiantes to return the biggest area..
 	virtual void tile(double&, double&); // fill the space , can adapt the coordiantes to return the biggest area..
     virtual void forceNewArea(double, double, double, double, double&, double&);
-	
+	virtual UserPoint reference() const;
 	
 // Basic reprojection method! 
 	virtual PaperPoint operator()(const UserPoint& xy) const 
@@ -197,7 +198,7 @@ public:
 	virtual void fast_reproject(double& x, double& y) const
 			{ }
 
-	virtual double patchDistance(double) const { assert(false); }
+	virtual double patchDistance(double) const { assert(false);  return 0;}
 
 	virtual PaperPoint operator()(const PaperPoint& xy) const 
 		{ return xy; }
@@ -291,8 +292,9 @@ public:
 	
 	virtual double height() const { return getMaxX() - getMinX(); }
 	
-	virtual void thin(double, double, double, vector<UserPoint>&) const;
 
+	virtual void thin(double, PaperPoint&, vector<pair<double, double> >&) const;
+	virtual void thin(double, PaperPoint&, Matrix&, double) const;
 	virtual void getNewDefinition(const UserPoint&, const UserPoint&, string&) const
 		{ assert(false); }
 	virtual void setDefinition(const string&)
@@ -321,6 +323,7 @@ public:
 	   if (in(lon, lat) )
 		   out.push_back(UserPoint(lon, lat, val));
    }
+   double distance(UserPoint&, UserPoint&) const;
 protected:
 	virtual void print(ostream&) const;    
     
diff --git a/src/common/XmlReader.h b/src/common/XmlReader.h
index 8a99080..ae61151 100644
--- a/src/common/XmlReader.h
+++ b/src/common/XmlReader.h
@@ -27,6 +27,8 @@
 #ifndef XmlReader_H
 #define XmlReader_H
 
+#include <stack>
+
 #include "magics.h"
 #include "XmlTree.h"
 
diff --git a/src/common/magics_api.h b/src/common/magics_api.h
index 12db6e0..af912f1 100644
--- a/src/common/magics_api.h
+++ b/src/common/magics_api.h
@@ -58,7 +58,7 @@ void mag_input();
 void mag_table();
 
 void mag_wrepjson();
-void mag_epsxml();
+void mag_epsinput();
 void mag_epscloud();
 void mag_epsplumes();
 void mag_epsgraph();
diff --git a/src/decoders/BinningObject.cc b/src/decoders/BinningObject.cc
index 6ab20e7..a00028f 100644
--- a/src/decoders/BinningObject.cc
+++ b/src/decoders/BinningObject.cc
@@ -9,18 +9,14 @@
     
 */
 
-
-
+#include <algorithm>
 #include "BinningObject.h"
 
-
 using namespace magics;
 
 
-
 BinningObject::BinningObject() 
 {
-
 	binners_x_["count"] = &BinningObject::countx;
 	binners_x_["list"] = &BinningObject::listx;
 	binners_x_["interval"] = &BinningObject::intervalx;
@@ -28,10 +24,8 @@ BinningObject::BinningObject()
 	binners_y_["count"] = &BinningObject::county;
 	binners_y_["list"] = &BinningObject::listy;
 	binners_y_["interval"] = &BinningObject::intervaly;
-
 }
 
-
 BinningObject::~BinningObject() 
 {
 }
@@ -65,10 +59,6 @@ void BinningObject::build(vector<double>& vals, IntervalMap<int>& binns)
 	}
 	max = vals.back();
 	binns.insert(make_pair(Interval(min, max), index));
-
-
-
-
 }
 
 /*
@@ -80,65 +70,56 @@ static double maxdef = 1.0e+21;
 
 void  BinningObject::countx(vector<double>& vals, double min, double max)
 {
-	double vmin = ( x_min_ == mindef) ? min : std::max(min, x_min_);
-	double vmax = ( x_max_ == maxdef) ? max : std::min(max, x_max_);
-
-	double step = (max-min)/(x_count_);
-
+	const double vmin = ( x_min_ == mindef) ? min : std::max(min, x_min_);
+	const double vmax = ( x_max_ == maxdef) ? max : std::min(max, x_max_);
+	const double step = (max-min)/(x_count_);
 
 	for (double val = vmin; val < vmax; val+=step) {
 		vals.push_back(val);
-
 	}
 
 	vals.push_back(vmax+epsilon);
-
 }
 
 void  BinningObject::county(vector<double>& vals, double min, double max)
 {
-	double vmin = ( y_min_ == mindef) ? min : std::max(min, y_min_);
-	double vmax = ( y_max_ == maxdef) ? max : std::min(max, y_max_);
-	double step = (max-min)/(y_count_);
-
+	const double vmin = ( y_min_ == mindef) ? min : std::max(min, y_min_);
+	const double vmax = ( y_max_ == maxdef) ? max : std::min(max, y_max_);
+	const double step = (max-min)/(y_count_);
 
 	for (double val = vmin; val < vmax; val+=step) {
 		vals.push_back(val);
-
 	}
 
 	vals.push_back(vmax+epsilon);
-
 }
 
 void  BinningObject::listx(vector<double>& vals, double min, double max)
 {
-	double vmin = ( y_min_ == mindef) ? min : std::max(min, y_min_);
-	double vmax = ( y_max_ == maxdef) ? max : std::min(max, y_max_);
+	const double vmin = ( y_min_ == mindef) ? min : std::max(min, y_min_);
+	const double vmax = ( y_max_ == maxdef) ? max : std::min(max, y_max_);
 
 	for (vector<double>::iterator val = x_list_.begin(); val != x_list_.end(); ++val) {
 		if ( *val >=vmin && *val <=vmax )
 			vals.push_back(*val);
 	}
-
-
 }
+
 void  BinningObject::listy(vector<double>& vals, double min, double max)
 {
-	double vmin = ( y_min_ == mindef) ? min : std::max(min, y_min_);
-	double vmax = ( y_max_ == maxdef) ? max : std::min(max, y_max_);
+	const double vmin = ( y_min_ == mindef) ? min : std::max(min, y_min_);
+	const double vmax = ( y_max_ == maxdef) ? max : std::min(max, y_max_);
 
 	for (vector<double>::iterator val = x_list_.begin(); val != x_list_.end(); ++val) {
 		if ( *val >=vmin && *val <=vmax )
 			vals.push_back(*val);
 	}
-
 }
 
 void  BinningObject::intervalx(vector<double>& vals, double min, double max)
 {
-	double vmin = ( x_min_ == mindef) ? min : std::max(min, x_min_);
-	double vmax = ( x_max_ == maxdef) ? max : std::min(max, x_max_);
+	const double vmin = ( x_min_ == mindef) ? min : std::max(min, x_min_);
+	const double vmax = ( x_max_ == maxdef) ? max : std::min(max, x_max_);
 
 	for (double val = x_reference_; val < vmax; val+= x_interval_)
 		vals.push_back(val);
@@ -146,16 +127,14 @@ void  BinningObject::intervalx(vector<double>& vals, double min, double max)
 		vals.push_back(val);
 
 	std::sort(vals.begin(), vals.end());
-
 	vals.insert(vals.begin(), vals.front()- x_interval_);
 	vals.push_back(vals.back() + x_interval_);
-
-
 }
+
 void  BinningObject::intervaly(vector<double>& vals, double min, double max)
 {
-	double vmin = ( y_min_ == mindef) ? min : std::max(min, y_min_);
-	double vmax = ( y_max_ == maxdef) ? max : std::min(max, y_max_);
+	const double vmin = ( y_min_ == mindef) ? min : std::max(min, y_min_);
+	const double vmax = ( y_max_ == maxdef) ? max : std::min(max, y_max_);
 
 	for (double val = y_reference_; val < vmax; val+= y_interval_)
 		vals.push_back(val);
@@ -166,8 +145,6 @@ void  BinningObject::intervaly(vector<double>& vals, double min, double max)
 	std::sort(vals.begin(), vals.end());
 	vals.insert(vals.begin(), vals.front()- y_interval_);
 	vals.push_back(vals.back() + y_interval_);
-
-
 }
 
 Matrix*   BinningObject::operator()(PointsList& points)
@@ -251,21 +228,10 @@ Matrix*   BinningObject::operator()(PointsList& points)
 			}
 		}
 	}
-
-	else {
-		for (unsigned int i = 0; i < matrix->size(); ++i) {
-			if ( (*matrix)[i] == 0 ) {
-				(*matrix)[i] = matrix->missing();
-
-			}
-		}
-	}
-#ifdef need_debug
-		for ( int r = 0; r < rows; ++r) {
-					for ( int c = 0; c < columns; ++c) {
-						log::dev() << "[" << matrix->row(r,c) << ",  " << matrix->column(r,c) << "] = " << (*matrix)(r, c) << endl;
+    /*
+	for ( int c = 0; c < columns; ++c) {
+						MagLog::dev() << "[" << matrix->row(r,c) << ",  " << matrix->column(r,c) << "] = " << (*matrix)(r, c) << endl;
 					}
-		}
-#endif
+		}i*/
 	return matrix;
 }
diff --git a/src/decoders/Date.cc b/src/decoders/Date.cc
index ad8e368..7ef4440 100644
--- a/src/decoders/Date.cc
+++ b/src/decoders/Date.cc
@@ -21,6 +21,8 @@
 #include "DateTime.h"
 #include "Tokenizer.h"
 
+#include "MagLog.h"
+
 #include <time.h>
 #include <iomanip>
 
@@ -138,9 +140,13 @@ long MagDate::parse(const string& s)
 			err = true;
 			break;
 	}
-
+/*
+ *   Stephan: Removed exception - caused Metview to not plot the field (but title) - see MAGP-455 
+ */
 	if(err) 
-		throw MagicsException(string("Invalid date ") + s);
+//		throw MagicsException(string("Invalid date ") + s);
+	    MagLog::warning() << "The date read looks invalid: " << s << ". Please check your title!\n";
+
 
 	// Come back here....
 	// temp patch for monthly means
diff --git a/src/decoders/GribDecoder.cc b/src/decoders/GribDecoder.cc
index d03eb76..e668225 100644
--- a/src/decoders/GribDecoder.cc
+++ b/src/decoders/GribDecoder.cc
@@ -18,15 +18,15 @@
 
 /*! \file GribDecoder.cc
     \brief Implementation of the Template class GribDecoder.
-    
+
     Magics Team - ECMWF 2004
-    
+
     Started: Tue 16-Mar-2004
-    
+
     Changes:
-    
-*/
- 
+
+ */
+
 #include "GribDecoder.h"
 #include "Factory.h"
 #include <limits>
@@ -42,34 +42,7 @@
 #include "VisualAction.h"
 #include "AnimationRules.h"
 #include "Transformation.h"
-/*
-#include "grib_api_internal.h"
-
-
-string getLongNameCentre(int centre)
-{
-        grib_context* context = grib_context_get_default();
-        grib_codetable* t = context->codetable;
-        while(t)
-        {
-            grib_codetable* s = t->next;
-            for(int i = 0; i < t->size; i++)
-            {
-                char* the_title = t->entries[i].title;
-                char* the_recomposed_name = t->recomposed_name[0];
-                if (strcmp(the_recomposed_name, "grib1/0.table") ==0 )
-                {
-                    if (the_title && i==centre)
-                    {
-                        printf("title for centre %d is %s\n", i, t->entries[i].title);
-                        return t->entries[i].title;
-                    }
-                }
-            }
-            t = s;
-        }
-}
-*/
+
 using namespace magics;
 
 int  GribDecoder::count_ = 0;
@@ -118,11 +91,37 @@ void GribDecoder::set(const GribLoop& loop, int index)
 	scaling_offset_  = loop.scaling_offset_;
 	scaling_factor_  = loop.scaling_factor_;
 	index_           = loop.uniqueId_;
+	interpolation_method_ = loop.interpolation_method_;
 	wind_mode_       = auto_ptr<WindMode>(loop.wind_mode_->clone());
 	internalIndex_ = index;
 
 }
-
+long computeStep( const GribDecoder& grib,const string&  key)
+{
+	static map<string, double> stepUnits;
+	if ( stepUnits.empty() ) {
+		stepUnits["h"] = 3600;
+		stepUnits["s"] = 1;
+		stepUnits["m"] = 60;
+		stepUnits["3h"] = stepUnits["h"] * 3;
+		stepUnits["6h"] = stepUnits["h"] * 6;
+		stepUnits["12h"] = stepUnits["h"] * 6;
+		stepUnits["D"] = stepUnits["h"] * 24;
+		stepUnits["M"] = stepUnits["D"] * 30;
+		stepUnits["Y"] = stepUnits["M"] * 12;
+		stepUnits["10Y"] = stepUnits["M"] * 10;
+		stepUnits["30Y"] = stepUnits["M"] * 30;
+		stepUnits["C"] = stepUnits["M"] * 100;
+	}
+	string units = grib.getString("stepUnits");
+	long step = grib.getLong(key);
+
+	map<string, double>::iterator stepunit = stepUnits.find(units);
+	double factor = 1;
+	if ( stepunit != stepUnits.end() )
+		factor = stepunit->second;
+	return step * factor;
+}
 long GribDecoder::getLong(const string& key, bool warnIfKeyAbsent) const
 {
 	long val;
@@ -135,8 +134,7 @@ long GribDecoder::getLong(const string& key, bool warnIfKeyAbsent) const
 	{
 		if (warnIfKeyAbsent)
 		{
-			MagLog::warning() << "Grib API: can not find key [" << key << "]\n"
-			               << grib_get_error_message(err) <<"\n";
+			MagLog::warning() << "Grib API: can not find key [" << key << "]  - "<< grib_get_error_message(err) <<"\n";
 		}
 		return 0;
 	}
@@ -162,10 +160,9 @@ string GribDecoder::getstring(const string& key, bool warnIfKeyAbsent, bool cach
 	{
 		if (warnIfKeyAbsent)
 		{
-				MagLog::warning() << "Grib API: can not find key [" << key << "]\n"
-				               << grib_get_error_message(err) <<"\n";
-			}
-			return "";
+			MagLog::warning() << "Grib API: can not find key [" << key << "]  - "<< grib_get_error_message(err) <<"\n";
+		}
+		return "";
 	}
 	if ( cache )
 		sKeys_.insert(make_pair(key, val));
@@ -204,17 +201,16 @@ string GribDecoder::getString(const string& key, bool warnIfKeyAbsent) const
 double GribDecoder::getDouble(const string& key, bool warnIfKeyAbsent) const
 {
 	map<string, double>::const_iterator dk = dKeys_.find(key);
-		if ( dk != dKeys_.end() ) {
-			return dk->second;
-		}
+	if ( dk != dKeys_.end() ) {
+		return dk->second;
+	}
 	double val;
 	int err = grib_get_double(handle_, key.c_str(), &val);
 	if ( err )
 	{
 		if (warnIfKeyAbsent)
 		{
-			MagLog::warning() << "Grib API: can not find key [" << key << "]\n"
-			               << grib_get_error_message(err) <<"\n";
+			MagLog::warning() << "Grib API: can not find key [" << key << "]  - " << grib_get_error_message(err) <<"\n";
 		}
 		return 0;
 	}
@@ -229,8 +225,7 @@ void   GribDecoder::setDouble(const string& key, double val) const
 	int err = grib_set_double(handle_, key.c_str(), val);
 	if ( err )
 	{
-		MagLog::warning() << "Grib API: can not find key [" << key << "]\n"
-		               << grib_get_error_message(err) <<"\n";
+		MagLog::warning() << "Grib API: can not find key [" << key << "]  - "<< grib_get_error_message(err) <<"\n";
 	}
 }
 
@@ -252,11 +247,11 @@ void GribDecoder::read(Matrix **matrix)
 		}
 		interpretor_->interpretAsMatrix(*this, matrix);
 		if ( *matrix == 0 ) {
-			 valid_ = false;
-			 ostringstream msg;
-			 msg << "Grib Decoder: Representation [" << representation << "] not yet fully implemented";
-			 MagLog::error() <<  msg.str() << std::endl;
-			 throw MagicsException(msg.str());
+			valid_ = false;
+			ostringstream msg;
+			msg << "Grib Decoder: Representation [" << representation << "] not yet fully implemented";
+			MagLog::error() <<  msg.str() << std::endl;
+			throw MagicsException(msg.str());
 		}
 
 		interpretor_->scaling(*this, matrix);
@@ -284,8 +279,8 @@ void GribDecoder::read(Matrix **matrix, const Transformation&  transformation)
 
 	try {
 		if ( !interpretor_ ) {
-					interpretor_ = SimpleObjectMaker<GribInterpretor>::create(representation);
-				}
+			interpretor_ = SimpleObjectMaker<GribInterpretor>::create(representation);
+		}
 		interpretor_->interpretAsMatrix(*this, matrix, transformation);
 		interpretor_->scaling(*this, matrix);
 	}
@@ -300,7 +295,7 @@ void GribDecoder::read(Matrix **matrix, const Transformation&  transformation)
 
 /*!
  Class information are given to the output-stream.
-*/		
+ */
 void GribDecoder::print(ostream& out)  const
 {
 	out << "GribDecoder[";
@@ -323,14 +318,14 @@ void GribDecoder::release()
 		yComponent_ = 0;
 	}
 	if ( colourComponent_ ) {
-			delete colourComponent_;
-			colourComponent_ = 0;
-		}
+		delete colourComponent_;
+		colourComponent_ = 0;
+	}
 
 	for (PointsList::iterator point = points_.begin(); point != points_.end(); ++point) {
-				delete *point;
-				*point = 0;
-		}
+		delete *point;
+		*point = 0;
+	}
 	points_.clear();
 
 }
@@ -364,7 +359,7 @@ void GribDecoder::decode2D()
 	try {
 
 		if ( !interpretor_ ) {
-					interpretor_ = SimpleObjectMaker<GribInterpretor>::create(representation);
+			interpretor_ = SimpleObjectMaker<GribInterpretor>::create(representation);
 		}
 		interpretor_->keepOriginal(true);
 
@@ -380,7 +375,7 @@ void GribDecoder::decode2D()
 	read(&w1);
 	openSecondComponent();
 	read(&w2);
-    Data::dimension_ = ( colourComponent_ ) ? 3 : 2;
+	Data::dimension_ = ( colourComponent_ ) ? 3 : 2;
 
 
 
@@ -404,21 +399,28 @@ void GribDecoder::customisedPoints(const AutomaticThinningMethod& thinning, cons
 		// Compute the thinning factor...
 
 
+		double x1 = 0;
+		double y1 = 60;
+		double x2 = 0;
+		double y2 = 60 + interpretor_->XResolution(*this);
+
+		UserPoint p1(x1, y1);
+		UserPoint p2(x2, y2);
 
-		double max = transformation.getMaxY();
-		double min = transformation.getMinY();
+		double res = transformation.distance(p1, p2);
 
+		double xstep = ( transformation.getMaxPCX() - transformation.getMinPCX())/ (thinning.x()-1);
+		double ystep = ( transformation.getMaxPCY() - transformation.getMinPCY())/ (thinning.y()-1);
 
-		double res = interpretor_->XResolution(*this);
+		int nb = (xstep/res);
 
 
-		bool thinit =  ( (max-min)/thinning.y() > 2*res );
 
-		double xpoints = (thinit) ? thinning.x() : 0;
-		double ypoints = (thinit) ? thinning.y() : 0;
+		xstep = nb * res;
+		ystep = int(ystep/res) * res;
 
 
-		customisedPoints(transformation, points, res*xpoints, res*ypoints, 0);
+		customisedPoints(transformation, points, xstep, ystep, 0);
 
 
 
@@ -431,7 +433,24 @@ void GribDecoder::customisedPoints(const AutomaticThinningMethod& thinning, cons
 }
 
 
+grib_handle*  GribDecoder::uHandle(string& name)
+{
+	openFirstComponent();
+	name = "x_component";
+	return handle_;
+}
 
+grib_handle*  GribDecoder::vHandle(string& name)
+{
+	openSecondComponent();
+	name = "y_component";
+	return handle_;
+}
+
+grib_handle*  GribDecoder::cHandle(string&)
+{
+	return 0;
+}
 
 
 
@@ -453,103 +472,215 @@ void GribDecoder::newPoint(const Transformation& transformation, double lat, dou
 
 
 	std::stack<UserPoint>   duplicates;
-  	UserPoint geo(lon, lat);
+	UserPoint geo(lon, lat);
 
 
 
 
-  	 transformation.wraparound(geo, duplicates);
-		 while (duplicates.empty() == false) {
-			UserPoint pt = duplicates.top();
-			// we try to see if no to near neighborg ...
+	transformation.wraparound(geo, duplicates);
+	while (duplicates.empty() == false) {
+		UserPoint pt = duplicates.top();
+		// we try to see if no to near neighborg ...
 
-			map<double, std::set<double> >::iterator row =  positions_.find(pt.y());
-			if ( row == positions_.end() )
-				positions_.insert(make_pair(pt.y(), std::set<double>()));
-			row =  positions_.find(pt.y());
-			std::set<double>::iterator low =  row->second.lower_bound(pt.x());
-			bool add = true;
+		map<double, std::set<double> >::iterator row =  positions_.find(pt.y());
+		if ( row == positions_.end() )
+			positions_.insert(make_pair(pt.y(), std::set<double>()));
+		row =  positions_.find(pt.y());
+		std::set<double>::iterator low =  row->second.lower_bound(pt.x());
+		bool add = true;
+		if ( low != row->second.end() ) {
+			double diff = fabs(*low-pt.x());
+			if ( diff <= grid )
+				add = false;
+			++low;
 			if ( low != row->second.end() ) {
-				double diff = fabs(*low-pt.x());
+				double diff = fabs(*low -pt.x());
 				if ( diff <= grid )
 					add = false;
-				++low;
-				if ( low != row->second.end() ) {
-					double diff = fabs(*low -pt.x());
-					if ( diff <= grid )
-						add = false;
-				}
-			}
-			if ( !add ) {
-				duplicates.pop();
-				continue;
 			}
+		}
+		if ( !add ) {
+			duplicates.pop();
+			continue;
+		}
 
-			row->second.insert(pt.x());
+		row->second.insert(pt.x());
 
-			CustomisedPoint *point = new CustomisedPoint(pt.x(), pt.y(), "");
+		CustomisedPoint *point = new CustomisedPoint(pt.x(), pt.y(), "");
 
-			point->insert(make_pair("x_component", uc));
-            point->insert(make_pair("y_component", vc));
-		    points.push_back(point);
-		    if ( cc != -9999 ) {
-				point->insert(make_pair("colour_component", cc));
+		point->insert(make_pair("x_component", uc));
+		point->insert(make_pair("y_component", vc));
+		points.push_back(point);
+		if ( cc != -9999 ) {
+			point->insert(make_pair("colour_component", cc));
 
-			}
-		    duplicates.pop();
+		}
+		duplicates.pop();
 
-		 }
+	}
 }
+
+
+
+struct Compare
+{
+
+	template< typename T1, typename T2 >
+	bool operator()( T1 const& t1, T2 const& t2 ) const
+	{
+		return t1.first < t2;
+	}
+};
+
 void GribDecoder::customisedPoints(const Transformation& transformation, CustomisedPointsList& out, double thinx, double thiny, double gap)
 {
 
 
-	vector<UserPoint> xin, yin, cin;
+	map<double, map<double, CustomisedPoint*> > data;
 
 
-	string xc = "x_component";
-	string yc = "y_component";
-	string cc = "colour_component";
+		string xc = "x_component";
+		string yc = "y_component";
+		string cc = "colour_component";
 
+		vector<pair<double, vector<pair<double, CustomisedPoint*> > > > points;
+		double minlon, maxlon;
+		interpretor_->raw(*this, transformation, points, minlon, maxlon);
+		double missing = getDouble("missingValue");
+		if ( thinx ) {
+		vector<pair<double, double> > positions;
 
-	interpretor_->raw(*this, transformation, xc, xin);
+		PaperPoint xy = interpretor_->reference(*this, transformation);
 
-	readColourComponent();
-	if ( colourComponent_ ) {
-		interpretor_->raw(*this, transformation, cc, cin);
+		transformation.thin(thinx, xy, positions);
+		vector<pair<double, double> >::iterator pos = positions.begin();
+		out.reserve(positions.size());
+
+		std::reverse(points.begin(),points.end());
+
+		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;
+			while ( lon < minlon ) {
+				lon += 360;
+				offset -= 360.;
+			}
+			while ( lon > maxlon ) {
+				lon -= 360.;
+				offset += 360.;
+			}
+			UserPoint ref(lon, lat);
+
+			vector<pair<double, vector<pair<double, CustomisedPoint*> > > >::iterator y;
+			vector<pair<double, CustomisedPoint*> >::iterator x;
+
+
+			y = std::lower_bound(points.begin(), points.end(), pos->second, Compare());
+
+
+			if (y == points.end() ) {
+
+				continue;
+                }
+
+			if (y!=points.begin() )
+
+			map<double, CustomisedPoint*> result;
+
+			x = std::lower_bound(y->second.begin(), y->second.end(), lon, Compare());
+			UserPoint check(x->first, y->first);
+
+			double val = transformation.distance(check, ref);
+			double min = val;
+			CustomisedPoint* point = x->second;
+
+
+			if ( x != y->second.begin() ) {
+				--x;
+				UserPoint check(x->first, y->first);
+				val = transformation.distance( check, ref );
+				if ( val < min ) {
+					min = val;
+					point = x->second;
+				}
 
-	}
-	openSecondComponent();
-	interpretor_->raw(*this, transformation, yc, yin);
-
-	vector<UserPoint>::iterator x = xin.begin();
-	vector<UserPoint>::iterator y = yin.begin();
-	vector<UserPoint>::iterator c = cin.begin();
-	bool thinit = thinx || thiny;
-
-	if (thinit)
-		transformation.thin(thinx, thiny, gap, xin);
-	out.reserve(yin.size());
-	while ( x != xin.end() && y!= yin.end() )
-	{
-		if ( x->missing() || !thinit ) {
-			assert(x->x_ == y->x_);
-			assert(x->y_ == y->y_);
-			CustomisedPoint* point = new CustomisedPoint(x->x_, x->y_, "");
-			std::pair<double, double> val = (*wind_mode_)(x->value_, y->value_);
-			point->insert(make_pair(xc, val.first));
-			point->insert(make_pair(yc, val.second));
-			if ( c != cin.end() ) {
-				point->insert(make_pair(cc, c->value_));
 			}
-			out.push_back(point);
+
+			if (y != points.begin() ) {
+				--y;
+
+				x = std::lower_bound(y->second.begin(), y->second.end(), lon, Compare());
+				UserPoint check(x->first, y->first);
+				val = transformation.distance( check, ref );
+				if ( val < min ) {
+					min = val;
+					point = x->second;
+				}
+
+
+				if ( x != y->second.begin() ) {
+					--x;
+					UserPoint check(x->first, y->first);
+					val = transformation.distance( check, ref );
+
+					if ( val < min ) {
+						min = val;
+						point = x->second;
+					}
+
+				}
+
+			}
+
+
+
+
+
+			if ( (*point)["x_component"] != missing && (*point)["y_component"] != missing) {
+
+				CustomisedPoint *add = new CustomisedPoint(point->longitude()+offset, point->latitude(), "");
+								pair<double, double> value = (*wind_mode_)((*point)["x_component"], (*point)["y_component"]);
+
+								add->insert(make_pair("x_component", value.first));
+								add->insert(make_pair("x_component", value.first));
+								add->insert(make_pair("y_component", value.second));
+								out.push_back(add);
+
+
+			}
+
+
+
 		}
-		x++;
-		y++;
-		if ( c != cin.end() ) {
-			c++;
+
+		for ( vector<pair<double, vector<pair<double, CustomisedPoint*> > > >::iterator y = points.begin(); y != points.end(); ++y )
+			for ( vector<pair<double, CustomisedPoint*> >::iterator x = y->second.begin(); x != y->second.end(); ++x)
+				delete x->second;
 		}
-	}
+		else {
+			for ( vector<pair<double, vector<pair<double, CustomisedPoint*> > > >::iterator y = points.begin(); y != points.end(); ++y )
+				for ( vector<pair<double, CustomisedPoint*> >::iterator x = y->second.begin(); x != y->second.end(); ++x) {
+					CustomisedPoint *point = x->second;
+					if ( (*point)["x_component"] != missing && (*point)["y_component"] != missing ) {
+						double lon = point->longitude();
+						double lat = point->latitude();
+						vector<UserPoint> 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_, "");
+							pair<double, double> value = (*wind_mode_)((*point)["x_component"], (*point)["y_component"]);
+							add->insert(make_pair("x_component", value.first));
+							add->insert(make_pair("y_component", value.second));
+							out.push_back(add);
+						}
+					}
+					delete point;
+
+				}
+		}
+
 
 
 
@@ -570,22 +701,23 @@ void GribDecoder::customisedPoints(const BasicThinningMethod& thinning, const Tr
 		// Compute the thinning factor...
 
 		double gap = 0;
+		// find the middle point :
+		UserPoint ll = transformation.reference();
+		PaperPoint xy1 = transformation(ll);
+		ll.y_ = ll.y_ + interpretor_->XResolution(*this);
+		PaperPoint xy2 = transformation(ll);
 
-		if ( thinning.factor() > 1 ) {
-			double x1 = 0;
-			double y1 = 60;
-			double x2 = interpretor_->XResolution(*this);
-			double y2 = 60+interpretor_->XResolution(*this);
 
-            transformation.fast_reproject(x1, y1);
-            transformation.fast_reproject(x2, y2);
 
-            gap = ((x2-x1)*(x2-x1)) + ((y2-y1)*(y2-y1));
+		gap = xy1.distance(xy2);
+		if ( thinning.factor() == 1 ) {
+			gap = 0;
 
 		}
+
 		customisedPoints(transformation, points,
-				interpretor_->XResolution(*this)* thinning.factor(),
-				interpretor_->XResolution(*this)* thinning.factor(), gap);
+				gap * thinning.factor(),
+				gap * thinning.factor(), gap);
 
 	}
 	catch (NoFactoryException&)
@@ -608,22 +740,20 @@ void GribDecoder::decode2D(const Transformation&)
 
 	try {
 		if ( !interpretor_ ) {
-					interpretor_ = SimpleObjectMaker<GribInterpretor>::create(representation);
-				}
+			interpretor_ = SimpleObjectMaker<GribInterpretor>::create(representation);
+		}
 		readColourComponent();
 
-			openFirstComponent();
-			read(&w1);
-			openSecondComponent();
-			read(&w2);
+		openFirstComponent();
+		read(&w1);
+		openSecondComponent();
+		read(&w2);
 
 	}
 	catch (NoFactoryException&)
 	{
 		MagLog::warning() << "Grib Decoder: Representation [" << representation << "] not yet supported.\n"<< std::endl;;
-
 	}
-
 	wind_mode_->x(&xComponent_, &yComponent_, w1, w2);
 }
 
@@ -638,10 +768,10 @@ void GribDecoder::openFirstComponent()
 
 }
 grib_handle* GribEntryDecoder::open(grib_handle* handle, bool) {
-		if ( !handle_ ) {
-			return handle_;
-		}
-		return handle;
+	if ( !handle_ ) {
+		return handle_;
+	}
+	return handle;
 }
 
 void GribDecoder::openSecondComponent() 
@@ -720,25 +850,25 @@ bool GribDecoder::id(const string& id, const string& where) const
 bool GribDecoder::verify(const string& val) const
 {
 	// we except a string with the following format "key1=val,key2=val2,...,keyn=valn"
-			Tokenizer tokenizer(",= ");
-			vector<string> tokens;
-			map<string, string> where;
-			tokenizer(val, tokens);
-			vector<string>::iterator token = tokens.begin();
-
-			string key, value;
-			while (true) {
-				if (token == tokens.end() )
-					break;
-				key = *token;
-				++token;
-				if (token == tokens.end() )
-					break;
-				value = *token;
-				where.insert(make_pair(key, value));
-
-				++token;
-			}
+	Tokenizer tokenizer(",= ");
+	vector<string> tokens;
+	map<string, string> where;
+	tokenizer(val, tokens);
+	vector<string>::iterator token = tokens.begin();
+
+	string key, value;
+	while (true) {
+		if (token == tokens.end() )
+			break;
+		key = *token;
+		++token;
+		if (token == tokens.end() )
+			break;
+		value = *token;
+		where.insert(make_pair(key, value));
+
+		++token;
+	}
 	for (  map<string, string>::const_iterator w = where.begin(); w != where.end(); ++w) {
 		string val = getString(w->first);
 		if ( magCompare(val, w->second) == false )
@@ -761,8 +891,8 @@ void GribDecoder::decodePoints()
 		double missing = getDouble("missingValue");
 		try {
 			if ( !interpretor_ ) {
-						interpretor_ = SimpleObjectMaker<GribInterpretor>::create(representation);
-					}
+				interpretor_ = SimpleObjectMaker<GribInterpretor>::create(representation);
+			}
 			interpretor_->scaling(*this, scaling, offset);
 		}
 		catch (NoFactoryException&)
@@ -778,6 +908,7 @@ void GribDecoder::decodePoints()
 		if (!iter)
 		{
 			MagLog::error() << "Grib Iterator not yet supported on this kind of grib\n";
+			MagLog::broadcast();
 			throw MagicsException("Grib Iterator not yet supported.");
 		}
 
@@ -824,10 +955,10 @@ void GribDecoder::decodePoints()
 
 GribLoop::~GribLoop()
 {
-    for (vector<GribDecoder*>::const_iterator g = gribs_.begin(); g != gribs_.end(); ++g)
-    {
-        delete *g;
-    }
+	for (vector<GribDecoder*>::const_iterator g = gribs_.begin(); g != gribs_.end(); ++g)
+	{
+		delete *g;
+	}
 }
 
 
@@ -870,146 +1001,146 @@ bool  GribLoop::hasMore()
 			throw GribFileMagException(path_, 0);
 		}	
 	}
-	
-    
-
-    // Now we have to find the right Entry!!! 
-    
-
-   if ( currentDim_ == dimension_.end() )
-	   return false;
-    
-   
-    if ( *currentDim_ == 1 ) {
-    	if (  dim_.empty() ) {
-    		 // case 1 dimension= 1 and loop on all the fields! 
-    		int error;
-    		grib_handle* handle = grib_handle_new_from_file(0, file_, &error) ;
-    		if (handle <=0)
-    			return false;
-    		currentgrib_ = new GribEntryDecoder(handle);
-
-    		currentgrib_->set(*this, counter_++);
-
-            gribs_.push_back(currentgrib_);
-    	}
-    	else {
-    		if ( currentPos_ == dim_.end() )
-    			return false;
-    		 // Case 3 Dimension = 1 but we only used  a subset of fields
-
-    		grib_handle* handle =  (*address_mode_)(0, file_, *currentPos_);
-    		currentPos_++;
-    		if (handle <=0)  
-    			return false;
-    		currentgrib_ = new GribEntryDecoder(handle);
-    		currentgrib_->set(*this, counter_++);
-            gribs_.push_back(currentgrib_);
-    	}
-    }
-    
-   
-    if ( *currentDim_  == 2)
-    {
-    	if ( dim_.empty()  )
-    	{
-    		// case 2 Dimension = 2 and loop on all the field!
-    		int error;
-    		grib_handle* handle1 = grib_handle_new_from_file(0, file_, &error) ;
-    		if (handle1 <=0)  return false;
-    		grib_handle* handle2 = grib_handle_new_from_file(0, file_, &error) ;
-    		if (handle2 <=0)  return false;
-    		currentgrib_ = new GribEntryDecoder(handle1, handle2);
-    		currentgrib_->set(*this, counter_++);
-    		gribs_.push_back(currentgrib_);
-    	}
-    	else {
-    		// Case 4 Dimesnion = 2 and we only used a subset of fields!
-    		vector<int>::iterator dim1 =  currentPos_;
-    		if ( currentPos_ ==  dim_.end() )
-    			return false;
-    		currentPos_++;
-    		vector<int>::iterator dim2 =  currentPos_;
-    		if ( currentPos_ ==  dim_.end() )
-    			return false;
-    		currentPos_++;
-
-
-    		grib_handle* handle1 =  (*address_mode_)(0, file_, *dim1);
-    		grib_handle* handle2 =  (*address_mode_)(0, file_, *dim2);
-    		if ( handle1 <=0 )
-    			return false;
-    		if ( handle2 <=0 )
-    			return false;
-    		currentgrib_ = new GribEntryDecoder(handle1, handle2);
-    		currentgrib_->set(*this, counter_++);
-
-    		gribs_.push_back(currentgrib_);
-
-    	}
-    }
+
+
+
+	// Now we have to find the right Entry!!!
+
+
+	if ( currentDim_ == dimension_.end() )
+		return false;
+
+
+	if ( *currentDim_ == 1 ) {
+		if (  dim_.empty() ) {
+			// case 1 dimension= 1 and loop on all the fields!
+			int error;
+			grib_handle* handle = grib_handle_new_from_file(0, file_, &error) ;
+			if (handle <=0)
+				return false;
+			currentgrib_ = new GribEntryDecoder(handle);
+
+			currentgrib_->set(*this, counter_++);
+
+			gribs_.push_back(currentgrib_);
+		}
+		else {
+			if ( currentPos_ == dim_.end() )
+				return false;
+			// Case 3 Dimension = 1 but we only used  a subset of fields
+
+			grib_handle* handle =  (*address_mode_)(0, file_, *currentPos_);
+			currentPos_++;
+			if (handle <=0)
+				return false;
+			currentgrib_ = new GribEntryDecoder(handle);
+			currentgrib_->set(*this, counter_++);
+			gribs_.push_back(currentgrib_);
+		}
+	}
+
+
+	if ( *currentDim_  == 2)
+	{
+		if ( dim_.empty()  )
+		{
+			// case 2 Dimension = 2 and loop on all the field!
+			int error;
+			grib_handle* handle1 = grib_handle_new_from_file(0, file_, &error) ;
+			if (handle1 <=0)  return false;
+			grib_handle* handle2 = grib_handle_new_from_file(0, file_, &error) ;
+			if (handle2 <=0)  return false;
+			currentgrib_ = new GribEntryDecoder(handle1, handle2);
+			currentgrib_->set(*this, counter_++);
+			gribs_.push_back(currentgrib_);
+		}
+		else {
+			// Case 4 Dimesnion = 2 and we only used a subset of fields!
+			vector<int>::iterator dim1 =  currentPos_;
+			if ( currentPos_ ==  dim_.end() )
+				return false;
+			currentPos_++;
+			vector<int>::iterator dim2 =  currentPos_;
+			if ( currentPos_ ==  dim_.end() )
+				return false;
+			currentPos_++;
+
+
+			grib_handle* handle1 =  (*address_mode_)(0, file_, *dim1);
+			grib_handle* handle2 =  (*address_mode_)(0, file_, *dim2);
+			if ( handle1 <=0 )
+				return false;
+			if ( handle2 <=0 )
+				return false;
+			currentgrib_ = new GribEntryDecoder(handle1, handle2);
+			currentgrib_->set(*this, counter_++);
+
+			gribs_.push_back(currentgrib_);
+
+		}
+	}
 
 	if ( *currentDim_  == 3)
+	{
+		if ( dim_.empty()  )
 		{
-			if ( dim_.empty()  )
-			{
-				// case 2 Dimension = 2 and loop on all the field!
-	    			int error;
-	       			grib_handle* handle1 = grib_handle_new_from_file(0, file_, &error) ;
-	       			if (handle1 <=0)  return false;
-	       			grib_handle* handle2 = grib_handle_new_from_file(0, file_, &error) ;
-	        		if (handle2 <=0)  return false;
-	        		grib_handle* handle3 = grib_handle_new_from_file(0, file_, &error) ;
-	        		if (handle3 <=0)  return false;
-	        		currentgrib_ = new GribEntryDecoder(handle1, handle2, handle3);
-	        		currentgrib_->set(*this, counter_++);
-	        		gribs_.push_back(currentgrib_);
-			}
-			else {
-	        		// Case 4 Dimesnion = 2 and we only used a subset of fields!
-					vector<int>::iterator dim1 =  currentPos_;
-					if ( currentPos_ ==  dim_.end() )
-						return false;
-					currentPos_++;
-					vector<int>::iterator dim2 =  currentPos_;
-					if ( currentPos_ ==  dim_.end() )
-						return false;
-					currentPos_++;
-					vector<int>::iterator dim3 =  currentPos_;
-										if ( currentPos_ ==  dim_.end() )
-											return false;
-										currentPos_++;
-
-	        		grib_handle* handle1 =  (*address_mode_)(0, file_, *dim1);
-	        		grib_handle* handle2 =  (*address_mode_)(0, file_, *dim2);
-	        		grib_handle* handle3 =  (*address_mode_)(0, file_, *dim3);
-
-	        		if ( handle1 <=0 )
-	        			return false;
-	        		if ( handle2 <=0 )
-	        		       return false;
-	        		if ( handle3 <=0 )
-	        			        		       return false;
-	        		currentgrib_ = new GribEntryDecoder(handle1, handle2, handle3);
-	        		currentgrib_->set(*this, counter_++);
-
-	        		gribs_.push_back(currentgrib_);
+			// case 2 Dimension = 2 and loop on all the field!
+			int error;
+			grib_handle* handle1 = grib_handle_new_from_file(0, file_, &error) ;
+			if (handle1 <=0)  return false;
+			grib_handle* handle2 = grib_handle_new_from_file(0, file_, &error) ;
+			if (handle2 <=0)  return false;
+			grib_handle* handle3 = grib_handle_new_from_file(0, file_, &error) ;
+			if (handle3 <=0)  return false;
+			currentgrib_ = new GribEntryDecoder(handle1, handle2, handle3);
+			currentgrib_->set(*this, counter_++);
+			gribs_.push_back(currentgrib_);
+		}
+		else {
+			// Case 4 Dimesnion = 2 and we only used a subset of fields!
+			vector<int>::iterator dim1 =  currentPos_;
+			if ( currentPos_ ==  dim_.end() )
+				return false;
+			currentPos_++;
+			vector<int>::iterator dim2 =  currentPos_;
+			if ( currentPos_ ==  dim_.end() )
+				return false;
+			currentPos_++;
+			vector<int>::iterator dim3 =  currentPos_;
+			if ( currentPos_ ==  dim_.end() )
+				return false;
+			currentPos_++;
+
+			grib_handle* handle1 =  (*address_mode_)(0, file_, *dim1);
+			grib_handle* handle2 =  (*address_mode_)(0, file_, *dim2);
+			grib_handle* handle3 =  (*address_mode_)(0, file_, *dim3);
+
+			if ( handle1 <=0 )
+				return false;
+			if ( handle2 <=0 )
+				return false;
+			if ( handle3 <=0 )
+				return false;
+			currentgrib_ = new GribEntryDecoder(handle1, handle2, handle3);
+			currentgrib_->set(*this, counter_++);
+
+			gribs_.push_back(currentgrib_);
 
-			}
 		}
+	}
 	currentDim_++;
 	currentgrib_->setPath(path_);
 	if ( iconName_.empty() )
 	{
-    		map<string, string>::iterator id = ids_.find(path_);
-    		if ( id == ids_.end() )
+		map<string, string>::iterator id = ids_.find(path_);
+		if ( id == ids_.end() )
 		{
-    		    	iconName_ = "Grib" + tostring(index_);
-    		    	index_++;
-    		    	ids_.insert(make_pair(path_, iconName_));  		
-    		 }
-    		 else 
-    		    	iconName_ = id->second;
+			iconName_ = "Grib" + tostring(index_);
+			index_++;
+			ids_.insert(make_pair(path_, iconName_));
+		}
+		else
+			iconName_ = id->second;
 	}
 	currentgrib_->icon(*this);
 	return true;
@@ -1030,80 +1161,89 @@ class GribTag: public XmlNodeVisitor
 public:
 	GribTag(GribDecoder& grib, TagHandler& title) : grib_(grib), title_(title) {
 	}
-	
+
 	~GribTag() {}
 	string baseDate(const XmlNode& node)
 	{
 		string format= node.getAttribute("format");
 		if ( format.empty() )  
-			format =  "%A %d %B %Y at %H UTC";
+			format =  "%A %d %B %Y %H%M UTC";
 		const long day  = grib_.getLong("date");  
 		const long hour = grib_.getLong("hour");  
 		const long mn   = grib_.getLong("minute"); 
 		MagDate part1 = MagDate(day);
 		MagTime part2 = MagTime(hour, mn, 0);
 		DateTime full(part1, part2);
-	    
+
+		const long type  = grib_.getLong("significanceOfReferenceTime", false);  
+        if ( type == 2 ) { //     Verifying time of forecast
+		    const long step =  computeStep(grib_, "stepRange");
+            full = full + (step * -1);
+        }
+
 		return full.tostring(format);
-		
+
 	}
 
 	string startDate(const XmlNode& node)
 	{
-			string format= node.getAttribute("format");
-			if ( format.empty() )  
-				format =  "%A %d %B %Y at %H UTC";
-			const long day  = grib_.getLong("date");  
-			const long hour = grib_.getLong("hour");  
-			const long mn   = grib_.getLong("minute");
-			const long step = grib_.getLong("startStep");  // default is in hours. Set 'stepUnits' to change.
+		string format= node.getAttribute("format");
+		if ( format.empty() )
+			format =  "%A %d %B %Y %H%M UTC";
+		const long day  = grib_.getLong("date");
+		const long hour = grib_.getLong("hour");
+		const long mn   = grib_.getLong("minute");
+		const long step = computeStep(grib_, "startStep");
+
+		MagDate part1 = MagDate(day);
+		MagTime part2 = MagTime(hour, mn, 0);
+		DateTime full(part1, part2);
+		full = full + step;
 
-			MagDate part1 = MagDate(day);
-			MagTime part2 = MagTime(hour, mn, 0);
-			DateTime full(part1, part2);	
-			full = full + (step*3600);
-			    
-			return full.tostring(format);
+		return full.tostring(format);
 	}
 
 	string validDate(const XmlNode& node)
 	{
-			string format= node.getAttribute("format");
-			if ( format.empty() )  
-				format =  "%A %d %B %Y at %H UTC";
-			const long day =  grib_.getLong("date");  
-			const long hour = grib_.getLong("hour");  
-			const long mn =  grib_.getLong("minute");
-			const long step =  grib_.getLong("stepRange");  // default is in hours. Set 'stepUnits' to change.
-			
+		string format= node.getAttribute("format");
+		if ( format.empty() )
+			format =  "%A %d %B %Y %H%M UTC";
+		const long day =  grib_.getLong("date");
+		const long hour = grib_.getLong("hour");
+		const long mn =  grib_.getLong("minute");
+		const long step =  computeStep(grib_, "stepRange");  // default is in hours. Set 'stepUnits' to change.
+
 
-						
-			MagDate part1 = MagDate(day);
-			MagTime part2 = MagTime(hour, mn, 0);
-			DateTime full(part1, part2);	
-			full = full + (step*3600);
 
-			return full.tostring(format);
-			
+		MagDate part1 = MagDate(day);
+		MagTime part2 = MagTime(hour, mn, 0);
+		DateTime full(part1, part2);
+		const long type  = grib_.getLong("significanceOfReferenceTime", false);
+        if ( type != 2 ) { //     Verifying time of forecast
+		    full = full + step;
+        }
+
+		return full.tostring(format);
+
 	}
 
 	string endDate(const XmlNode& node)
 	{
 		string format=  node.getAttribute("format");
 		if ( format.empty() )  
-			format =  "%A %d %B %Y at %H UTC";
+			format =  "%A %d %B %Y %H%M UTC";
 		const long day =  grib_.getLong("date");  
 		const long hour = grib_.getLong("hour");  
 		const long mn =  grib_.getLong("minute");
-		const long step =  grib_.getLong("endStep");  // default is in hours. Set 'stepUnits' to change.
+		const long step = computeStep(grib_, "endStep");
 
 		MagDate part1 = MagDate(day);
 		MagTime part2 = MagTime(hour, mn, 0);
 		DateTime full(part1, part2);	
-		full = full + ( step*3600 );
-		    
+		full = full + step;
+
 		return full.tostring(format);
-		
+
 	}
 
 
@@ -1116,18 +1256,18 @@ public:
 			string where = node.getAttribute("where");
 			if ( !grib_.id(grib, where)) {
 
-					return;
+				return;
 			}
 			string def = node.getAttribute("key");
 			if (def.empty()) {
-				 def = node.getAttribute("definition");
-				 // for backward compatibility with the first version! 
+				def = node.getAttribute("definition");
+				// for backward compatibility with the first version!
 			}
 			if ( def== "valid-date") {
-							title_.update("grib"+grib, def, validDate(node));
-							return;
-						}
-			
+				title_.update("grib"+grib, def, validDate(node));
+				return;
+			}
+
 			if ( def == "base-date") {
 				title_.update("grib"+grib, def, baseDate(node));
 				return;
@@ -1158,7 +1298,7 @@ public:
 					char tmp[256];
 					sprintf(tmp, format.c_str(), val.c_str());
 					val = tmp;
-					
+
 				}
 			}
 			else
@@ -1168,12 +1308,12 @@ public:
 				sst << longVal;
 				val=sst.str(); 
 			}
-	
+
 			if ( val.empty() ) 
 				val =  node.getAttribute("default");
 			title_.update("grib"+grib, def, val);
 		}		
-		
+
 		if ( magCompare(node.name(), "magics_title") )
 		{
 			string grib = node.getAttribute("id");
@@ -1193,12 +1333,12 @@ public:
 		}
 		node.visit(*this);	
 	}
-	
+
 	void decode(const string& line)
 	{
 		XmlReader parser;
 		XmlTree tree;
-	
+
 		ostringstream xml;
 		xml << "<?xml version='1.0' ?> \n";		
 		xml << "<xml> \n";
@@ -1212,8 +1352,8 @@ public:
 		catch (MagicsException& e) {
 			MagLog::debug() << e.what() << endl;
 		}	
-     } 
-     string str() const { return out.str(); }
+	}
+	string str() const { return out.str(); }
 protected :
 	GribDecoder& grib_;
 	TagHandler& title_;
@@ -1228,7 +1368,7 @@ void GribDecoder::visit(ValuesCollector& points)
 {
 	field_ = open(field_);
 	const Transformation& transformation = points.transformation();
-		
+
 	points.setCollected(true);
 
 	int nb = points.size();
@@ -1244,14 +1384,14 @@ void GribDecoder::visit(ValuesCollector& points)
 	double scaling, offset;
 	string oriUnits, derivedUnits;
 	string representation = getString("typeOfGrid");
-		
+
 	//Scaling works only for scalar data!!!
-	
+
 	try 
 	{
 		if ( !interpretor_ ) {
-					interpretor_ = SimpleObjectMaker<GribInterpretor>::create(representation);
-				}
+			interpretor_ = SimpleObjectMaker<GribInterpretor>::create(representation);
+		}
 		interpretor_->scaling(*this, scaling, offset,oriUnits,derivedUnits);
 	}      
 	catch (NoFactoryException&)
@@ -1259,24 +1399,24 @@ void GribDecoder::visit(ValuesCollector& points)
 		MagLog::warning() << "Grib Decoder: Representation [" << representation << "] not yet supported.\n"<< std::endl;;
 		scaling =1 ; offset =0;
 	}
- 	
+
 	for (int i =0; i < nb; i++)
 	{
-		 
-	  	 inlats[i] = points[i].y();
-		 inlons[i] = std::fmod(points[i].x(),360.);
-		 if(inlons[i] < 0.) inlons[i]+=360.;
-		 i++;
+
+		inlats[i] = points[i].y();
+		inlons[i] = std::fmod(points[i].x(),360.);
+		if(inlons[i] < 0.) inlons[i]+=360.;
+		i++;
 	}
- 
+
 	double missing = getDouble("missingValue");
-		
+
 	if ( Data::dimension_ == 1 ) {
-	  	bool scaled=(scaling==1 && offset == 0)?false:true;
+		bool scaled=(scaling==1 && offset == 0)?false:true;
 		points.setScaled(scaled);
 		points.setUnits(oriUnits);
 		points.setScaledUnits(derivedUnits);
-	  
+
 		field_ = open(field_);
 		grib_nearest_find_multiple(handle_, 0, inlats, inlons, nb, outlats, outlons, values, distances, indexes);
 		for (int i =0; i < nb; i++) 
@@ -1285,7 +1425,7 @@ void GribDecoder::visit(ValuesCollector& points)
 			if(scaled)
 				points[i].back()->setScaledValue(scaling*values[i] + offset);
 			if(values[i] == missing)
-			  	points[i].back()->setMissing(true);
+				points[i].back()->setMissing(true);
 		}
 	}
 	else if ( Data::dimension_ == 2  ) {
@@ -1293,12 +1433,12 @@ void GribDecoder::visit(ValuesCollector& points)
 		oriUnits=getString("units",false);
 		if(oriUnits.find("/") == string::npos)
 		{
-		  	oriUnits=oriUnits + "/" + oriUnits;
+			oriUnits=oriUnits + "/" + oriUnits;
 		}	
 		points.setUnits(oriUnits);
 		points.setScaledUnits("/");
-				  			
-		
+
+
 		openFirstComponent();
 		grib_nearest_find_multiple(handle_, 0, inlats, inlons, nb, outlats, outlons, x, distances, indexes);
 		openSecondComponent();
@@ -1310,28 +1450,28 @@ void GribDecoder::visit(ValuesCollector& points)
 				points[i].back()->setMissing(true);	  
 		}
 	}
-		else   {
-			bool scaled=(scaling==1 && offset == 0)?false:true;
-					oriUnits=getString("units",false);
-					if(oriUnits.find("/") == string::npos)
-					{
-					  	oriUnits=oriUnits + "/" + oriUnits;
-					}
-					points.setUnits(oriUnits);
-					points.setScaledUnits("/");
+	else   {
+		bool scaled=(scaling==1 && offset == 0)?false:true;
+		oriUnits=getString("units",false);
+		if(oriUnits.find("/") == string::npos)
+		{
+			oriUnits=oriUnits + "/" + oriUnits;
+		}
+		points.setUnits(oriUnits);
+		points.setScaledUnits("/");
 
 
-					openFirstComponent();
-					grib_nearest_find_multiple(handle_, 0, inlats, inlons, nb, outlats, outlons, x, distances, indexes);
-					openSecondComponent();
-					grib_nearest_find_multiple(handle_, 0, inlats, inlons, nb, outlats, outlons, y, distances, indexes);
-					for (int i =0; i < nb; i++)
-					{
-						points[i].push_back(wind_mode_->values(outlons[i],outlats[i],x[i],y[i], distances[i]));
-						if(x[i] == missing || y[i] == missing)
-							points[i].back()->setMissing(true);
-					}
+		openFirstComponent();
+		grib_nearest_find_multiple(handle_, 0, inlats, inlons, nb, outlats, outlons, x, distances, indexes);
+		openSecondComponent();
+		grib_nearest_find_multiple(handle_, 0, inlats, inlons, nb, outlats, outlons, y, distances, indexes);
+		for (int i =0; i < nb; i++)
+		{
+			points[i].push_back(wind_mode_->values(outlons[i],outlats[i],x[i],y[i], distances[i]));
+			if(x[i] == missing || y[i] == missing)
+				points[i].back()->setMissing(true);
 		}
+	}
 
 }
 
@@ -1357,7 +1497,7 @@ const DateDescription& GribDecoder::timeStamp()
 	TagHandler helper;
 	GribTag tag1(*this, helper);
 	for ( vector<string>::const_iterator t = need.begin(); t != need.end(); ++t )
-			tag1.decode(*t);
+		tag1.decode(*t);
 
 
 	timeStamp_ = DateDescription(helper.get("grib", "valid-date"), index_, internalIndex_);
@@ -1378,63 +1518,63 @@ void GribDecoder::visit(MetaDataCollector& step)
 {
 	// Here we gather information for the label!
 	const Transformation& transformation = step.transformation();
-	
+
 	field_ = open(field_); // just to be sure the file is opened!
 
 	initInfo();
 
-	 //Collect infos
+	//Collect infos
 	if(step.empty())
 	{
 		MetviewIcon::visit(step);
-	   	return;
+		return;
 	}
-	   
+
 	try {	  
 		bool members=false;
 		vector<string> need;
 		if(name_.empty())
 		{
 			members=true;
-		  	need.push_back("<grib_info key='shortName'/>");
+			need.push_back("<grib_info key='shortName'/>");
 			need.push_back("<grib_info key='level'/>");
 			need.push_back("<grib_info key='start-date' format='%Y-%m-%d %H:%M:00'/>");
 			need.push_back("<grib_info key='end-date' format='%Y-%m-%d %H:%M:00'/>");
 		}
-		
+
 		for(map<string, string>::iterator key = step.begin(); key != step.end(); ++key )
 		{	    
 			//If key is not found in information we use gribapi
-		  	if(information_.find(key->first) == information_.end())
+			if(information_.find(key->first) == information_.end())
 			{  
 				//Compute stats
 				if (step.attribute(key->first).group() == MetaDataAttribute::StatsGroup)
 				{
 					stats_.clear();
-					
+
 
 					PointsHandler& points = this->points(transformation, false);
 
 					points.setToFirst();
-	
+
 					while( points.more() )
 					{
 						stats_["value"].push_back(points.current().value());						
 						points.advance();
 					}
-					
+
 					computeStats();
-					
+
 
 				}
 				//We use gribapi
 				else if(step.attribute(key->first).source() == MetaDataAttribute::AnySource ||
-				   step.attribute(key->first).source() == MetaDataAttribute::GribApiSource)
+						step.attribute(key->first).source() == MetaDataAttribute::GribApiSource)
 				{  					  
 					if(step.attribute(key->first).type() != MetaDataAttribute::NumberType)   
 					{
 						need.push_back("<grib_info key='"+key->first+ "'/>");
-		   			}
+					}
 					else
 					{
 						need.push_back("<grib_info key='"+key->first+ "' readAsLong='yes'/>");
@@ -1467,50 +1607,50 @@ void GribDecoder::visit(MetaDataCollector& step)
 						MagLog::warning() << "Grib Decoder: Representation [" << representation << "] not yet supported.\n"<< std::endl;;
 						information_[key->first]="N/A";
 					}
-					
+
 				}       	
-				
+
 			}	
 			//If key is found in information_ we copy it
 			else
 			{
-				  	key->second=information_[key->first];
+				key->second=information_[key->first];
 			}	
 		}
-		
-		
+
+
 		if(!need.empty())	
 		{
 			TagHandler helper;
 			GribTag tag1(*this, helper);
 			for ( vector<string>::const_iterator t = need.begin(); t != need.end(); ++t ) 
 			{
-	   			tag1.decode(*t);
+				tag1.decode(*t);
 			}	
-				
-	   		if(members)
+
+			if(members)
 			{  
-	   			name_ = helper.get("grib", "shortName") +  " " +  helper.get("grib", "level");
+				name_ = helper.get("grib", "shortName") +  " " +  helper.get("grib", "level");
 
-	   			from_ = DateTime(helper.get("grib", "start-date"));
-	   			to_ =  DateTime(helper.get("grib", "end-date"));
+				from_ = DateTime(helper.get("grib", "start-date"));
+				to_ =  DateTime(helper.get("grib", "end-date"));
 			}
-			
+
 			for(map<string, string>::iterator key = step.begin(); key != step.end(); ++key )
 			{	    
 				if(information_.find(key->first) == information_.end())
 				{  
 					if(step.attribute(key->first).source() == MetaDataAttribute::AnySource ||
-				   	   step.attribute(key->first).source() == MetaDataAttribute::GribApiSource)
+							step.attribute(key->first).source() == MetaDataAttribute::GribApiSource)
 					{  					  
-					 	key->second = helper.get("grib", key->first);
+						key->second = helper.get("grib", key->first);
 						setInfo(key->first,key->second);
 					}	
 				} 
 
 			}	  
-			
-	   	}
+
+		}
 	}
 
 	catch (...) {}
@@ -1529,25 +1669,25 @@ MatrixHandler& GribDecoder::direction() {
 	vector<double> directions;
 	//	MagLog::dev()<< "missing1-->" << in1->missing() << endl;
 	//	MagLog::dev()<< "missing2-->" << in2->missing() << endl;
-		while ( x != xComponent_->end() &&  x != yComponent_->end() ) {
-			if ( *x == xComponent_->missing() || *y == yComponent_->missing() )
-	    	   directions.push_back(xComponent_->missing());
-			else
-				directions.push_back(atan2((*y), (*x)) );
-			++x;
-			++y;
-		}
-		matrix_->clear();
-		xComponent_ = 0;
+	while ( x != xComponent_->end() &&  x != yComponent_->end() ) {
+		if ( *x == xComponent_->missing() || *y == yComponent_->missing() )
+			directions.push_back(xComponent_->missing());
+		else
+			directions.push_back(atan2((*y), (*x)) );
+		++x;
+		++y;
+	}
+	matrix_->clear();
+	xComponent_ = 0;
 
 
 
-		for (vector<double>::iterator d = directions.begin(); d != directions.end(); ++d) {
-				matrix_->push_back(*d);
-		}
+	for (vector<double>::iterator d = directions.begin(); d != directions.end(); ++d) {
+		matrix_->push_back(*d);
+	}
 
-		matrixHandlers_.push_back(new MatrixHandler(*matrix_));
-		return *(matrixHandlers_.back());
+	matrixHandlers_.push_back(new MatrixHandler(*matrix_));
+	return *(matrixHandlers_.back());
 
 }
 void GribDecoder::decode(const Transformation& transformation) 
@@ -1556,9 +1696,9 @@ void GribDecoder::decode(const Transformation& transformation)
 
 	field_ = open(field_);
 
-		read(&matrix_, transformation);
+	read(&matrix_, transformation);
 	if (!matrix_) return;
-	
+
 	// here we build information for the layers!
 	TagHandler helper; 
 	vector<string> need;
@@ -1582,7 +1722,7 @@ void GribDecoder::decode(const Transformation& transformation)
 
 void GribDecoder::decode() 
 {
-	
+
 	if ( dimension_ == 1) {
 		if (matrix_) return;
 		field_ = open(field_);
@@ -1626,12 +1766,12 @@ void GribDecoder::visit(TextVisitor& title)
 	{
 		return;
 	}
-	
+
 	vector<string> titles;
 
 	title.titles(titles);
 	GribTag tag(*this, title);
-	
+
 	for ( vector<string>::const_iterator t = titles.begin(); t != titles.end(); ++t ) {
 		tag.decode(*t);
 	}
@@ -1642,21 +1782,21 @@ void GribDecoder::visit(TextVisitor& title)
 void GribDecoder::decodeRaster(const Transformation& transformation) 
 {
 	field_ = open(field_);
-	
+
 	string representation = getString("typeOfGrid");
-	
+
 	try {
 		if ( !interpretor_ ) {
-					interpretor_ = SimpleObjectMaker<GribInterpretor>::create(representation);
-				}
+			interpretor_ = SimpleObjectMaker<GribInterpretor>::create(representation);
+		}
 		interpretor_->interpretAsRaster(*this, raster_, transformation);
 	}
-    
-    catch (NoFactoryException&)
-    {
-    	MagLog::error() << "Grib Decoder: Representation [" << representation << "] not yet supported.\n";
-    	throw MagicsException("Grib Decoder: Representation [] not yet supported.");
-    }
+
+	catch (NoFactoryException&)
+	{
+		MagLog::error() << "Grib Decoder: Representation [" << representation << "] not yet supported.\n";
+		throw MagicsException("Grib Decoder: Representation [] not yet supported.");
+	}
 }
 
 
@@ -1664,14 +1804,14 @@ void GribDecoder::initInfo()
 {
 	if(information_.find("_datatype") == information_.end())
 	{
-	  	setInfo("_datatype","GRIB");
-		
+		setInfo("_datatype","GRIB");
+
 		char buf[1024];
-    		int count = readlink(file_name_.c_str(), buf, sizeof(buf));
-    		if (count > 0)
+		int count = readlink(file_name_.c_str(), buf, sizeof(buf));
+		if (count > 0)
 		{
-		    	buf[count] = '\0';
-   			setInfo("path", string(buf));
+			buf[count] = '\0';
+			setInfo("path", string(buf));
 		}	
 		else
 		{  
@@ -1685,6 +1825,8 @@ void GribDecoder::initInfo()
 
 namespace magics {
 
+
+
 class GribInfo
 {
 public:
@@ -1701,7 +1843,7 @@ public:
 	void operator()(ostream& out, const GribDecoder& grib)
 	{
 		string val = grib.getString("name");
- 		out << val;
+		out << val;
 	}
 };
 
@@ -1769,10 +1911,10 @@ public:
 	void operator()(TitleField&, vector<string>& title, const GribDecoder& grib)
 	{
 
-        ostringstream out;
+		ostringstream out;
 		string local = grib.getString("observationDiagnostic");       
-        out << "diagnostic =" << local << " ";   
-        title.back() += out.str();
+		out << "diagnostic =" << local << " ";
+		title.back() += out.str();
 	}
 };
 
@@ -1838,7 +1980,7 @@ public:
 	{
 
 		string param = grib.getString("name");
- 		title.back()+=param;
+		title.back()+=param;
 	}
 };
 
@@ -1850,16 +1992,16 @@ public:
 	~GribKeyHandler() {}
 	void operator()(TitleField& field, vector<string>& title, const GribDecoder& grib)
 	{
-		
+
 
 		char x[256];
-		
+
 		string key = field.attribute("key", ""); 	
 		string value  = grib.getString(key);       
 		string format = field.attribute("format", "%s");
 		sprintf(x, format.c_str(), value.c_str());
 
-	    title.back() += string(x);
+		title.back() += string(x);
 
 	}
 };
@@ -1882,57 +2024,70 @@ public:
 		MagDate part1 = MagDate(date);
 		MagTime part2 = MagTime(hour, mn, 0);
 		DateTime full(part1, part2);
-	
-		string format = field.attribute("format", "%A %d %B %Y at %H UTC");
-	
+		const long type  = grib.getLong("significanceOfReferenceTime", false);
+        if ( type == 2 ) { //     Verifying time of forecast
+		    long step = grib.getLong("step"); // needs steps in second!   // default is in hours. Set 'stepUnits' to change.
+		    full = full + (step*-3600);
+        }
+
+		string format = field.attribute("format", "%A %d %B %Y at %H%M UTC");
+
 		title.back() += full.tostring(format);
 	}	
 };
 
+
 class GribValidDateHandler : public TitleFieldHandler
 {
 public:
-    GribValidDateHandler() {}
-    ~GribValidDateHandler() {}
-    void operator()(TitleField& field, vector<string>& title, const GribDecoder& grib)
-    {
-	    ostringstream out;
-        long date = grib.getLong("date");    
-        long hour = grib.getLong("hour");  
-        long mn   = grib.getLong("minute"); 
-        long step = grib.getLong("step") * 3600; // needs steps in second!   // default is in hours. Set 'stepUnits' to change.
-       
-        MagDate part1 = MagDate(date);
-        MagTime part2 = MagTime(hour, mn, 0);
-        DateTime full(part1, part2);
-        full = full + step;
-
-        
-	    string format = field.attribute("format", "%A %d %B %Y %H UTC");
-	        
-	    title.back() += full.tostring(format);
-       
-
-    }
+	GribValidDateHandler() {}
+	~GribValidDateHandler() {}
+	void operator()(TitleField& field, vector<string>& title, const GribDecoder& grib)
+	{
+
+
+		ostringstream out;
+		long date = grib.getLong("date");
+		long hour = grib.getLong("hour");
+		long mn   = grib.getLong("minute");
+
+
+		long step = computeStep(grib, "step");
+
+		MagDate part1 = MagDate(date);
+		MagTime part2 = MagTime(hour, mn, 0);
+		DateTime full(part1, part2);
+		const long type  = grib.getLong("significanceOfReferenceTime", false);
+        if ( type != 2 ) { //     Verifying time of forecast
+		    full = full + step;
+        }
+
+
+		string format = field.attribute("format", "%A %d %B %Y %H%M UTC");
+
+		title.back() += full.tostring(format);
+
+
+	}
 };
 
 class GribStepHandler : public TitleFieldHandler
 {
 public:
-    GribStepHandler() {}
-    ~GribStepHandler() {}
-    void operator()(TitleField& field, vector<string>& title, const GribDecoder& grib)
-    {
+	GribStepHandler() {}
+	~GribStepHandler() {}
+	void operator()(TitleField& field, vector<string>& title, const GribDecoder& grib)
+	{
 
-        ostringstream out;
-        long istep = grib.getLong("startStep");
+		ostringstream out;
+		long istep = grib.getLong("startStep");
 
 
-        ostringstream step;
-        step << istep;
-        string format = field.attribute("format", "t+%s");
-        out << SimpleStringFormat(step.str(), format);
-        title.back() += out.str();
+		ostringstream step;
+		step << istep;
+		string format = field.attribute("format", "t+%s");
+		out << SimpleStringFormat(step.str(), format);
+		title.back() += out.str();
 	}
 };
 
@@ -1940,38 +2095,38 @@ public:
 class GribLevelHandler : public TitleFieldHandler
 {
 public:
-    GribLevelHandler() { 
-    	if (map_.empty()) {
-    		map_["Surface"] = &GribLevelHandler::surface;
-    		map_["Unknown"] = &GribLevelHandler::surface;
-    		map_["isobaricInhPa"] = &GribLevelHandler::isobaricInhPa;
-    		map_["heightAboveGround"] = &GribLevelHandler::heightAboveGround;
-    		map_["heightAboveGround"] = &GribLevelHandler::heightAboveGround;
-    		map_["hybrid"] = &GribLevelHandler::hybrid;
-    	}
-    }
-    
-    ~GribLevelHandler() {}
-    typedef string (GribLevelHandler::*Builder)(const string& def, const GribDecoder& grib) const;
-    
-    void operator()(TitleField&, vector<string>& title, const GribDecoder& grib)
-    {
-    	ostringstream out;
-
-        string level = grib.getString("typeOfLevel");
-
-        
-        map<string,  GribLevelHandler::Builder>::iterator help = map_.find(level);
-        if ( help != map_.end() ) out << (this->*help->second)(level, grib) << " ";
-        else out << level << " ";    
-        
-        title.back() +=  out.str();
-        
-    }
-    
+	GribLevelHandler() {
+		if (map_.empty()) {
+			map_["Surface"] = &GribLevelHandler::surface;
+			map_["Unknown"] = &GribLevelHandler::surface;
+			map_["isobaricInhPa"] = &GribLevelHandler::isobaricInhPa;
+			map_["heightAboveGround"] = &GribLevelHandler::heightAboveGround;
+			map_["heightAboveGround"] = &GribLevelHandler::heightAboveGround;
+			map_["hybrid"] = &GribLevelHandler::hybrid;
+		}
+	}
+
+	~GribLevelHandler() {}
+	typedef string (GribLevelHandler::*Builder)(const string& def, const GribDecoder& grib) const;
+
+	void operator()(TitleField&, vector<string>& title, const GribDecoder& grib)
+	{
+		ostringstream out;
+
+		string level = grib.getString("typeOfLevel");
+
+
+		map<string,  GribLevelHandler::Builder>::iterator help = map_.find(level);
+		if ( help != map_.end() ) out << (this->*help->second)(level, grib) << " ";
+		else out << level << " ";
+
+		title.back() +=  out.str();
+
+	}
+
 protected: 
 	static map<string, GribLevelHandler::Builder> map_;
-	
+
 	string surface(const string&, const GribDecoder& ) const
 	{
 		return "";
@@ -1990,12 +2145,12 @@ protected:
 		return out.str();
 	}	
 	string pv(const string& , const GribDecoder& grib) const
-		{
-			ostringstream out;
-			long level = grib.getLong("level");
-			out  << level  <<  " mPVU";
-			return out.str();
-		}
+	{
+		ostringstream out;
+		long level = grib.getLong("level");
+		out  << level  <<  " mPVU";
+		return out.str();
+	}
 	string heightAboveGround(const string& , const GribDecoder& grib) const
 	{
 		ostringstream out;
@@ -2017,20 +2172,20 @@ map<string, GribLevelHandler::Builder> GribLevelHandler::map_;
 class GribTimeHandler : public TitleFieldHandler
 {
 public:
-    GribTimeHandler() {}
-    ~GribTimeHandler() {}
-    void operator()(TitleField&, vector<string>& title, const GribDecoder& grib)
-    {
-//        if (!grib.getText()) return;
-//        ostringstream out;
-//        grib_int_t idate;
-//        grib_get(grib.id(),(grib_string_t*)"time","I",&idate);      
-//     
-//        out << "Time:" << idate;
-//        title.add(out.str());
-
-          title.back() +=  "Time? ";
-    }
+	GribTimeHandler() {}
+	~GribTimeHandler() {}
+	void operator()(TitleField&, vector<string>& title, const GribDecoder& grib)
+	{
+		//        if (!grib.getText()) return;
+		//        ostringstream out;
+		//        grib_int_t idate;
+		//        grib_get(grib.id(),(grib_string_t*)"time","I",&idate);
+		//
+		//        out << "Time:" << idate;
+		//        title.add(out.str());
+
+		title.back() +=  "Time? ";
+	}
 };
 
 class GribCentreHandler : public TitleFieldHandler
@@ -2051,147 +2206,204 @@ public:
 class GribProductHandler : public TitleFieldHandler
 {
 public:
-    GribProductHandler() {}
-    ~GribProductHandler() {}
-    void operator()(TitleField&, vector<string>& title, const GribDecoder& grib)
-    {
+	GribProductHandler() {}
+	~GribProductHandler() {}
+	void operator()(TitleField&, vector<string>& title, const GribDecoder& grib)
+	{
 
-       long type = grib.getLong("type");
+		long type = grib.getLong("type");
 
-       GeneralDef def = TypeTable::definition(type);
-       title.back() += def.longTitle();
-    }
+		GeneralDef def = TypeTable::definition(type);
+		title.back() += def.longTitle();
+	}
 };
 
 
 class GribPlotTypeHandler : public TitleFieldHandler
 {
 public:
-    GribPlotTypeHandler() {}
-    ~GribPlotTypeHandler() {}
-    void operator()(TitleField&, vector<string>&,const GribDecoder&)
-    {
-         //MagLog::warning() << "Plot Type: not implemented--> wait for the specification." << "\n";
-    }
+	GribPlotTypeHandler() {}
+	~GribPlotTypeHandler() {}
+	void operator()(TitleField&, vector<string>&,const GribDecoder&)
+	{
+		//MagLog::warning() << "Plot Type: not implemented--> wait for the specification." << "\n";
+	}
 };
 
 
 class NewLineHandler : public TitleFieldHandler
 {
 public:
-    NewLineHandler() {}
-    ~NewLineHandler() {}
-    void operator()(TitleField&, vector<string>& title,const GribDecoder&)
-    {
-        title.push_back("");
-    }
+	NewLineHandler() {}
+	~NewLineHandler() {}
+	void operator()(TitleField&, vector<string>& title,const GribDecoder&)
+	{
+		title.push_back("");
+	}
 };
 
 
 class SatelliteHandler : public TitleFieldHandler
 {
 public:
-    SatelliteHandler()  {}
-    ~SatelliteHandler() {}
-    void operator()(TitleField&, vector<string>& title,const GribDecoder& grib)
-    {
-       ostringstream out;
-       long ident =  grib.getLong("ident");
-
-       out << "Sat:" << ident << " ";
-       title.back() += out.str();
-    }
+	SatelliteHandler()  {}
+	~SatelliteHandler() {}
+	void operator()(TitleField&, vector<string>& title,const GribDecoder& grib)
+	{
+        static map<long, string> names;
+        if ( names.empty() ){
+            names[54] = "METEOSAT-7";
+            names[57] = "METEOSAT-10";
+            names[172] = "MTSAT-2";
+            names[257] = "GOES-13";
+            names[259] = "GOES-15";
+        }
+
+		long ident =  grib.getLong("ident");
+        map<long, string>::iterator sat = names.find(ident);
+
+        if ( sat != names.end() ) 
+            title.back() += sat->second;
+        else 
+            title.back() += "satellite identifier " + tostring(ident);
+
+	}
 };
 
 class ChannelHandler : public TitleFieldHandler
 {
 public:
-    ChannelHandler()  {}
-    ~ChannelHandler() {}
-    void operator()(TitleField&, vector<string>& title,const GribDecoder& grib)
-    {       
-    	ostringstream out;
-        long band = grib.getLong("obstype");
-        out << "Band:" << band << " ";
-        title.back() += out.str();
-    }
+	ChannelHandler()  {}
+	~ChannelHandler() {}
+	void operator()(TitleField&, vector<string>& title,const GribDecoder& grib)
+	{
+        map<long, map<long, string> > channels;
+        if ( channels.empty() ) {
+            map<long, string>  l54;
+            l54[1] = "WV 6-4";
+            l54[2] = "IR 11-5";
+            l54[3] = "VIS 00-7";
+            channels[54] = l54;
+            map<long, string>  l57;
+            l57[1] = "VIS 0-6";
+            l57[4] = "IR 3-9";
+            l57[5] = "WV 6-2";
+            l57[6] = "WV 7-3";
+            l57[8] = "IR 9-7";
+            l57[9] = "IR 10-8";
+            l57[10] = "IR 12-0";
+            channels[57] = l57;
+            map<long, string>  l172;
+            l172[2] = "IR 10-8";
+            l172[4] = "WV 6-8";
+            l172[9] = "IR 10-8";
+            channels[172] = l172;
+            map<long, string>  l257;
+            l257[1] = "VIS 00-7";
+            l257[3] = "WV 6-6";
+            l257[4] = "IR 10-7";
+            channels[257] = l257;
+            map<long, string>  l259;
+            l259[1] = "VIS 00-7";
+            l259[3] = "WV 6-6";
+            l259[4] = "IR 10-7";
+            channels[259] = l259;
+        }
+		ostringstream out;
+		long ident = grib.getLong("ident");
+		long band = grib.getLong("channel");
+
+        map<long, map<long, string> >::iterator sat = channels.find(ident);
+
+        if ( sat == channels.end() )  {
+            title.back() += "channel " + tostring(band);
+            return;
+        }
+        map<long, string>::iterator channel = sat->second.find(band);
+        if ( channel == sat->second.end() )  {
+            title.back() += "channel " + tostring(band);
+            return;
+        }
+
+		title.back() += channel->second;
+	}
 };
 
 
 class GribExpverHandler : public TitleFieldHandler
 {
 public:
-    GribExpverHandler() {}
-    ~GribExpverHandler() {}
-    void operator()(TitleField& field, vector<string>& title, const GribDecoder& grib)
-    {
-
-       if ( !grib.getExpver() ) return; 
-       ostringstream out;    
-       string expver = grib.getString("mars.experimentVersionNumber");
-       string format = field.attribute("format", "Expver=%s");          
-       out << SimpleStringFormat(expver, format);
-       title.back() += out.str();
-   }
+	GribExpverHandler() {}
+	~GribExpverHandler() {}
+	void operator()(TitleField& field, vector<string>& title, const GribDecoder& grib)
+	{
+
+		if ( !grib.getExpver() ) return;
+		ostringstream out;
+		string expver = grib.getString("mars.experimentVersionNumber");
+		string format = field.attribute("format", "Expver=%s");
+		out << SimpleStringFormat(expver, format);
+		title.back() += out.str();
+	}
 };
 
 
 class GribEpsNumberInfoHandler : public TitleFieldHandler
 {
 public:
-    GribEpsNumberInfoHandler() {}
-    ~GribEpsNumberInfoHandler() {}
-    void operator()(TitleField& field, vector<string>& title, const GribDecoder& grib)
-    {
-	    
-//       if (!grib.getText()) return;
-//        ostringstream out;
-//       grib_int_t local;
-//       grib_get(grib.id(),(grib_string_t*)"localDefinition","I","localDefinitionNumber",&local);
-//       if (local != 1) return;
-//
-//       char number[1024];
-//       grib_get(grib.id(),(grib_string_t*)"localDefinition","s","total",number);
-//       string format = field.attribute("format", "(%s members)");     
-//      
-//      out << SimpleStringFormat(number, format);
-//        title.add(out.str());
-
-    	 title.back() +=  "epsnumber?";
-
-    }
+	GribEpsNumberInfoHandler() {}
+	~GribEpsNumberInfoHandler() {}
+	void operator()(TitleField& field, vector<string>& title, const GribDecoder& grib)
+	{
+
+		//       if (!grib.getText()) return;
+		//        ostringstream out;
+		//       grib_int_t local;
+		//       grib_get(grib.id(),(grib_string_t*)"localDefinition","I","localDefinitionNumber",&local);
+		//       if (local != 1) return;
+		//
+		//       char number[1024];
+		//       grib_get(grib.id(),(grib_string_t*)"localDefinition","s","total",number);
+		//       string format = field.attribute("format", "(%s members)");
+		//
+		//      out << SimpleStringFormat(number, format);
+		//        title.add(out.str());
+
+		title.back() +=  "epsnumber?";
+
+	}
 };
 
 
 class GribUnitHandler : public TitleFieldHandler
 {
 public:
-    GribUnitHandler() {}
-    ~GribUnitHandler() {}
-    void operator()(TitleField& field, vector<string>& title, const GribDecoder& grib)
-    {
-/*
+	GribUnitHandler() {}
+	~GribUnitHandler() {}
+	void operator()(TitleField& field, vector<string>& title, const GribDecoder& grib)
+	{
+		/*
 		if (!grib.getText()) return;
         if ( !grib.getUnits() ) return; 
         ostringstream out;      
-     
+
         double id   = grib.getDouble("paramId");
         long centre  = grib.getLong("centre");
-        				
+
         long param = (long) id;
         long table   = (id - param )*100;
 
-          
+
         const ParamDef& parameter = LocalTable::localInfo(param, table, centre);
-           
+
         string format = field.attribute("format", "Units:%s");           
         string unit = (grib.getScaling()) ? parameter.derivedUnit() :  parameter.originalUnit();
         out << SimpleStringFormat(unit, format);
-      
-        
+
+
         title.back() += out.str();
-   */
-    }
+		 */
+	}
 };
 
 }// end namespace magics
@@ -2234,6 +2446,7 @@ static SimpleObjectMaker<GribLocalCriter, MatchCriteria > gribtypecriter("type")
 static SimpleObjectMaker<GribLocalCriter, MatchCriteria > gribclasscriter("class");
 static SimpleObjectMaker<GribLocalCriter, MatchCriteria > typeOfgeneratingProcess("typeOfGeneratingProcess");
 static SimpleObjectMaker<GribLocalCriter, MatchCriteria > timeRangeIndicator("timeRangeIndicator");
+static SimpleObjectMaker<GribLocalCriter, MatchCriteria > dataType("dataType");
 
 #include "GribRegularInterpretor.h"
 static SimpleObjectMaker<GribRegularInterpretor, GribInterpretor> regular_ll("regular_ll");
@@ -2243,6 +2456,7 @@ static SimpleObjectMaker<GribReducedGaussianInterpretor, GribInterpretor> reduce
 static SimpleObjectMaker<GribRotatedInterpretor, GribInterpretor> rotated_ll("rotated_ll");
 static SimpleObjectMaker<GribLambertAzimutalInterpretor, GribInterpretor> lambert_azimuthal_equal_area("lambert_azimuthal_equal_area");
 static SimpleObjectMaker<GribLambertInterpretor, GribInterpretor> lambert("lambert");
+static SimpleObjectMaker<GribPolarStereoInterpretor, GribInterpretor> polar("polar_stereographic");
 
 
 #include "GribSatelliteInterpretor.h"
diff --git a/src/decoders/GribDecoder.h b/src/decoders/GribDecoder.h
index eff2d5a..1f757dc 100644
--- a/src/decoders/GribDecoder.h
+++ b/src/decoders/GribDecoder.h
@@ -92,7 +92,7 @@ public:
 	void decode();
 	void decode2D();
 	void decode(const Transformation&);
-		void decode2D(const Transformation&);
+	void decode2D(const Transformation&);
 	void decodeRaster(const Transformation&);
 	void decodePoints();
 	void release();
@@ -109,7 +109,7 @@ public:
 		return title_;
 	}
 
-
+	bool interpolate() const { return magCompare(interpolation_method_, "interpolate"); }
 	bool getExpver() const { return expver_; }
 	void version();
 	
@@ -197,6 +197,9 @@ public:
 	bool      id(const string&, const string&) const;
 
 
+	grib_handle*  uHandle(string&);
+	grib_handle*  vHandle(string&);
+	grib_handle*  cHandle(string&);
 
 	grib_handle*  handle() const { return handle_; }
         void initInfo();
diff --git a/src/decoders/GribInterpretor.h b/src/decoders/GribInterpretor.h
index 52c8ce1..28a29d2 100644
--- a/src/decoders/GribInterpretor.h
+++ b/src/decoders/GribInterpretor.h
@@ -52,7 +52,9 @@ public:
 	GribInterpretor() {}
 	virtual ~GribInterpretor() {}
 	virtual double XResolution(const GribDecoder&) const { return 0; }
-	virtual void raw(const GribDecoder&, const Transformation&, const string&, vector<UserPoint>&) const;
+	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& grib, Matrix** matrix, const Transformation&) const
 		{ interpretAsMatrix(grib, matrix); }
@@ -60,12 +62,15 @@ public:
 
     virtual void interpret2D(double&, double&, double&, double&) const {}
     virtual void keepOriginal(bool) {}
+    virtual PaperPoint reference(const GribDecoder&, const Transformation&);
     virtual void interpretAsRaster(const GribDecoder&, RasterData&, const Transformation&) const {}
     virtual void scaling(const GribDecoder&, Matrix**) const;
     virtual void scaling(const GribDecoder& grib, double& scaling, double& offset) const;
     virtual void scaling(const GribDecoder& grib, double& scaling, double& offset, string& originalUnits, string& derivedUnits) const;
     void longitudesSanityCheck(double&, double&) const;
 
+    void interpolate(const GribDecoder& grib, Matrix& matrix) const;
+
     
 protected:
      //! Method to print string about this class on to a stream of type ostream (virtual).
diff --git a/src/decoders/GribRegularInterpretor.cc b/src/decoders/GribRegularInterpretor.cc
index 096c6b6..a94eb5c 100644
--- a/src/decoders/GribRegularInterpretor.cc
+++ b/src/decoders/GribRegularInterpretor.cc
@@ -6,7 +6,7 @@
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at 
 
-    http://www.apache.org/licenses/LICENSE-2.0
+ http://www.apache.org/licenses/LICENSE-2.0
 
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,13 +17,13 @@
  ******************************** LICENSE ********************************/
 
 /*! \file GribRegularInterpretor.cc
-    \brief Implementation of the Template class GribRegularInterpretor.
-    \author Meteorological Visualisation Section, ECMWF
+ \brief Implementation of the Template class GribRegularInterpretor.
+ \author Meteorological Visualisation Section, ECMWF
 
-    Started: Mon 18-Apr-2005
+ Started: Mon 18-Apr-2005
 
-    Changes:
-*/
+ Changes:
+ */
 
 #include <limits>
 
@@ -36,55 +36,48 @@
 #include "RasterData.h"
 #include "Timer.h"
 
-
 using namespace magics;
 
-GribRegularInterpretor::GribRegularInterpretor() 
-{
+GribRegularInterpretor::GribRegularInterpretor() {
 }
 
-GribRegularInterpretor::~GribRegularInterpretor() 
-{
+GribRegularInterpretor::~GribRegularInterpretor() {
 }
 
-void GribInterpretor::longitudesSanityCheck(double& west, double& east) const
-{
-	 // make sure that the west longitudes is always inferior to teh East longitudes and always 
+void GribInterpretor::longitudesSanityCheck(double& west, double& east) const {
+	// make sure that the west longitudes is always inferior to teh East longitudes and always
 	// betwwen -180 and 360...
-	
-	while ( east <= west) {		
+
+	while (east <= west) {
 		// We add 360 to the east ...
 		east += 360;
 	}
-	
+
 	// We reposition if needed 
-	
-	while ( east > 360 ) {
+
+	while (east > 360) {
 		west -= 360.;
 		east -= 360.;
 	}
 }
-void GribInterpretor::scaling(const GribDecoder& grib, double& scaling, double& offset) const
-{
-	string originalUnits,derivedUnits;
-	this->scaling(grib,scaling,offset,originalUnits,derivedUnits);
-}	
-  
-  
-void GribInterpretor::scaling(const GribDecoder& grib, double& scaling, double& offset,
-			      string& originalUnits, string& derivedUnits) const
-{
+void GribInterpretor::scaling(const GribDecoder& grib, double& scaling,
+		double& offset) const {
+	string originalUnits, derivedUnits;
+	this->scaling(grib, scaling, offset, originalUnits, derivedUnits);
+}
+
+void GribInterpretor::scaling(const GribDecoder& grib, double& scaling,
+		double& offset, string& originalUnits, string& derivedUnits) const {
 	scaling = 1;
-	offset  = 0;
+	offset = 0;
 
 	// First check that they are not derived fields! 
 
-	if (grib.scaling_ || grib.derived_scaling_)
-	{
+	if (grib.scaling_ || grib.derived_scaling_) {
 		long derived = grib.getLong("generatingProcessIdentifier");
 
-		if ( (derived != 254 && grib.scaling_) || (derived == 254 && grib.derived_scaling_) )
-		{
+		if ((derived != 254 && grib.scaling_)
+				|| (derived == 254 && grib.derived_scaling_)) {
 			// The key 'paramId' embodies a number of features such as centre, parameter,
 			// level, etc. This means that we should not need to worry about table
 			// numbers, etc as we did with GRIBEX. However, it's not entirely clear
@@ -96,8 +89,8 @@ void GribInterpretor::scaling(const GribDecoder& grib, double& scaling, double&
 			// In practice, this means pretending that all data is from
 			// centre=98,table=128.
 
-			long table   = 128; // hard-coded in case of GRIB 2
-			long centre  = 98;  // hard-coded in case of GRIB 2
+			long table = 128; // hard-coded in case of GRIB 2
+			long centre = 98;  // hard-coded in case of GRIB 2
 
 			//long edition = grib.getLong("edition");
 			//
@@ -112,33 +105,31 @@ void GribInterpretor::scaling(const GribDecoder& grib, double& scaling, double&
 			//	// work with most data if we use the standard ECMWF tables...
 			//}
 
-
 			long id = grib.getLong("paramId");
 
 			try {
-				const ParamDef& paramdef = LocalTable::localInfo(id, table, centre);
+				const ParamDef& paramdef = LocalTable::localInfo(id, table,
+						centre);
 				scaling = paramdef.scaling();
 				offset = paramdef.offset();
-				originalUnits =paramdef.originalUnit();
-				derivedUnits =paramdef.derivedUnit();
+				originalUnits = paramdef.originalUnit();
+				derivedUnits = paramdef.derivedUnit();
+			} catch (...) {
+				MagLog::warning()
+						<< " Can not find information for the parameter [" << id
+						<< "." << table << "]\n";
 			}
-			catch (...) {
-				MagLog::warning() << " Can not find information for the parameter [" << id << "." << table << "]\n";
-			}
-            		}
-	}
-	else {
+		}
+	} else {
 		scaling = grib.scaling_factor_;
-		offset  = grib.scaling_offset_;
+		offset = grib.scaling_offset_;
 	}
 	// Add a sanity check : the factor can not be 0..
 	if (scaling == 0)
 		scaling = 1;
 }
 
-
-void GribInterpretor::scaling(const GribDecoder& grib, Matrix** matrix) const
-{
+void GribInterpretor::scaling(const GribDecoder& grib, Matrix** matrix) const {
 	double factor, offset;
 
 	scaling(grib, factor, offset);
@@ -147,330 +138,437 @@ void GribInterpretor::scaling(const GribDecoder& grib, Matrix** matrix) const
 	(*matrix)->plus(offset);
 }
 
-
-void GribInterpretor::raw(const GribDecoder& grib, const Transformation& transformation, const string& key, vector<UserPoint>& points) const
+void GribInterpretor::raw(GribDecoder& grib,
+		const Transformation& transformation,
+		vector<pair<double, vector<pair<double, CustomisedPoint*> > > >& points,
+		double& minlon, double& maxlon) const
 {
 	Timer timer("grib", "raw");
 	double factor, offset;
 	scaling(grib, factor, offset);
 	int err;
+
+	string uname, vname;
+
+	grib_handle* uc = grib.uHandle(uname);
+	grib_handle* vc = grib.vHandle(vname);
+
+	long nblon = grib.getLong("numberOfPointsAlongAParallel");
+	long nblat = grib.getLong("numberOfPointsAlongAMeridian");
+
+	points.reserve(nblat);
+
+	grib_iterator* uiter = grib_iterator_new(uc, 0, &err);
+	grib_iterator* viter = grib_iterator_new(vc, 0, &err);
+	double missing = grib.getDouble("missingValue");
+
+	double lat, lon, u, v;
+	double last = -99999999;
+
+	minlon = 999999;
+	maxlon = -999999;
+
+	while (grib_iterator_next(uiter, &lat, &lon, &u)
+			&& grib_iterator_next(viter, &lat, &lon, &v)) {
+
+		if (transformation.in(lon, lat) || transformation.in(lon - 360, lat)) {
+			if (minlon > lon)
+				minlon = lon;
+			if (maxlon < lon)
+				maxlon = lon;
+			if (u != missing)
+				u = (u * factor) + offset;
+			if (v != missing)
+				v = (v * factor) + offset;
+
+			if (lat != last) {
+				last = lat;
+				points.push_back(
+						make_pair(lat,
+								vector<pair<double, CustomisedPoint*> >()));
+				points.back().second.reserve(nblat * 2);
+
+			}
+
+			CustomisedPoint* point = new CustomisedPoint(lon, lat, "");
+			point->insert(make_pair(uname, u));
+			point->insert(make_pair(vname, v));
+			points.back().second.push_back(make_pair(lon, point));
+
+		}
+
+	}
+
+	grib_iterator_delete(viter);
+	grib_iterator_delete(uiter);
+
+	for (vector<pair<double, vector<pair<double, CustomisedPoint*> > > >::iterator ilat =
+			points.begin(); ilat != points.end(); ++ilat) {
+		vector < pair<double, CustomisedPoint*> > &lons = ilat->second;
+
+		CustomisedPoint* first = lons.front().second;
+		;
+		CustomisedPoint* last = lons.back().second;
+		//if (last->longitude() - first->longitude() > XResolution(grib)) {
+		CustomisedPoint* dup = new CustomisedPoint(first->longitude() + 360,first->latitude(), "");
+		dup->insert(make_pair("x_component", (*first)["x_component"]));
+		dup->insert(make_pair("y_component", (*first)["y_component"]));
+		lons.push_back(make_pair(dup->longitude(), dup));
+		//}
+
+	}
+
+}
+
+void GribInterpretor::raw(const GribDecoder& grib,
+		const Transformation& transformation, const string& key,
+		map<double, map<double, CustomisedPoint*> >& points) const {
+	Timer timer("grib", "raw");
+	double factor, offset;
+	scaling(grib, factor, offset);
+	int err;
 	size_t nb;
 	grib_get_size(grib.id(), "values", &nb);
 
-	points.reserve(nb);
+	map<double, map<double, CustomisedPoint*> >::iterator ilat;
+	map<double, CustomisedPoint*>::iterator ilon;
 
+	grib_iterator* iter = grib_iterator_new(grib.handle(), 0, &err);
+	double missing = grib.getDouble("missingValue");
 
-	grib_iterator* iter = grib_iterator_new(grib.handle(), 0,&err);
-    double missing = grib.getDouble("missingValue");
+	double lat, lon, value;
 
+	/* Loop on all the lat/lon/values. */
+	while (grib_iterator_next(iter, &lat, &lon, &value)) {
 
-    double lat, lon, value;
+		if (transformation.in(lon, lat) || transformation.in(lon - 360, lat)) {
+			if (value != missing)
+				value = (value * factor) + offset;
 
-        /* Loop on all the lat/lon/values. */
-    while(grib_iterator_next(iter,&lat,&lon,&value)) {   
+			ilat = points.find(lat);
+			if (ilat == points.end()) {
 
-      
-      if (value != missing ) {
+				points.insert(make_pair(lat, map<double, CustomisedPoint*>()));
+				ilat = points.find(lat);
 
-    		  value = (value*factor)+offset;
+			}
+			ilon = ilat->second.find(lon);
 
-    		  transformation.populate(lon, lat, value, points);
-      }
+			if (ilon == ilat->second.end()) {
+				CustomisedPoint* pt = new CustomisedPoint(lon, lat, "");
+				pt->missing(true);
+				ilat->second.insert(make_pair(lon, pt));
+				ilon = ilat->second.find(lon);
 
+			}
+			ilon->second->insert(make_pair(key, value));
 
-    }
+		}
 
-        /* At the end the iterator is deleted to free memory. */
-    grib_iterator_delete(iter);               
+	}
+
+	/* At the end the iterator is deleted to free memory. */
+	grib_iterator_delete(iter);
 
-	
 }
 /*!
  Class information are given to the output-stream.
-*/		
-void GribRegularInterpretor::print(ostream& out)  const
-{
+ */
+void GribRegularInterpretor::print(ostream& out) const {
 	out << "GribRegularInterpretor[";
 	out << "]";
 }
 
-void GribRegularInterpretor::interpretAsMatrix(const GribDecoder& grib, Matrix** matrix, const Transformation& ) const
-{
+void GribRegularInterpretor::interpretAsMatrix(const GribDecoder& grib,
+		Matrix** matrix, const Transformation&) const {
 	interpretAsMatrix(grib, matrix);
 }
 
-void GribRegularInterpretor::interpretAsMatrix(const GribDecoder& grib, Matrix** matrix) const 
-{
-  Timer timer("gribapi", " read grib");
-  MagLog::dev() << "GribRegularInterpretor::interpretAsMatrix" << "\n";
-  long nblon = grib.getLong("numberOfPointsAlongAParallel");
-  long nblat = grib.getLong("numberOfPointsAlongAMeridian");
-  
-  if ( *matrix == 0 ) *matrix = new Matrix(nblat, nblon);
-  
-  
-  size_t nb;
-  grib_get_size(grib.id(), "values", &nb);
-
-  MagLog::dev() << "numberOfFieldValues[" << nb << "]" << "\n";
-  double missing = INT_MAX;
-  grib.setDouble("missingValue", missing);    
-  (*matrix)->missing(missing);
-  (*matrix)->akimaEnabled();
-
-  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 << ", " << south << "]" << "\n";
-  double loni = longitudeIncrement(grib);
-  
-  double lon = (east-west)/(nblon-1);
-  
-  MagLog::dev() << "increment -->" << loni << " (from->" << west << " to-->" << west + (nblon-1) *loni << ")" <<  endl;
-  MagLog::dev() << "calcul -->" << lon << " (from->" << west << " to-->" << west + (nblon-1) *lon << ")" <<  endl;
-
-  latitudes(grib, (*matrix)->rowsAxis());
- 
-  double x = west;
-  for (int i = 0; i < nblon; i++)
-  {
-	(*matrix)->columnsAxis().push_back(x);
-	x  = west + (i+1)*lon;
-  }
-	
-  (*matrix)->setMapsAxis();
-
-
-  long jPointsAreConsecutive = grib.getLong("jPointsAreConsecutive");
-
-  try
-  { 
-	(*matrix)->resize(nb);
-  	size_t aux = size_t(nb);
-
-    // if jPointsAreConsecutive=1 then the values represent columns of data instead
-    // of rows, so we have to 'reshape' the array so that it is reorganised into rows.
-
-    if (jPointsAreConsecutive)
-    {
-        vector<double> *d = new vector<double>(nb);  // temporary array
-        double *d1 = &d->front();                    // temporary array pointer
-        double *d2 = &(*matrix)->front();            // final array
-    
-  	    grib_get_double_array(grib.id(), "values", d1, &aux); 
-
-        for (int i = 0; i < nblon; i++)
-        {
-            for (int j = 0; j < nblat; j++)
-            {
-                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); 
-    }
-
-  	(*matrix)->missing(missing);
-
-
-  } 
-  catch (...) 
-  {
-	throw MagicsException("GribRegularInterpretor - Not enough memory");
-  }
-}
+void GribRegularInterpretor::interpretAsMatrix(const GribDecoder& grib,
+		Matrix** matrix) const {
+	Timer timer("gribapi", " read grib");
+	MagLog::dev() << "GribRegularInterpretor::interpretAsMatrix" << "\n";
+	long nblon = grib.getLong("numberOfPointsAlongAParallel");
+	long nblat = grib.getLong("numberOfPointsAlongAMeridian");
 
+	if (*matrix == 0)
+		*matrix = new Matrix(nblat, nblon);
 
-void  GribRegularInterpretor::latitudes(const GribDecoder& grib, vector<double>& latitudes) const
-{
-		double north = grib.getDouble("latitudeOfFirstGridPointInDegrees");	
+	size_t nb;
+	grib_get_size(grib.id(), "values", &nb);
 
-		long nblat = grib.getLong("numberOfPointsAlongAMeridian");
-		int scanning = grib.getLong("jScansPositively") ? 1 : -1;
-		double lat =  scanning * grib.getDouble("jDirectionIncrementInDegrees");
-	
-		double y = north;
-		for (int i = 0; i < nblat; i++)
+	MagLog::dev() << "numberOfFieldValues[" << nb << "]" << "\n";
+	double missing = INT_MAX;
+	grib.setDouble("missingValue", missing);
+	(*matrix)->missing(missing);
+	(*matrix)->akimaEnabled();
+
+	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
+			<< ", " << south << "]" << "\n";
+	double loni = longitudeIncrement(grib);
+
+	double lon = (east - west) / (nblon - 1);
+
+	MagLog::dev() << "increment -->" << loni << " (from->" << west << " to-->"
+			<< west + (nblon - 1) * loni << ")" << endl;
+	MagLog::dev() << "calcul -->" << lon << " (from->" << west << " to-->"
+			<< west + (nblon - 1) * lon << ")" << endl;
+
+	latitudes(grib, (*matrix)->rowsAxis());
+
+	double x = west;
+	for (int i = 0; i < nblon; i++) {
+		(*matrix)->columnsAxis().push_back(x);
+		x = west + (i + 1) * lon;
+	}
+
+	(*matrix)->setMapsAxis();
+
+	long jPointsAreConsecutive = grib.getLong("jPointsAreConsecutive");
+
+	try {
+		(*matrix)->resize(nb);
+		size_t aux = size_t(nb);
+
+		// if jPointsAreConsecutive=1 then the values represent columns of data instead
+		// of rows, so we have to 'reshape' the array so that it is reorganised into rows.
+
+		if (jPointsAreConsecutive) {
+			vector<double> *d = new vector<double>(nb);  // temporary array
+			double *d1 = &d->front();                 // temporary array pointer
+			double *d2 = &(*matrix)->front();            // final array
+
+			grib_get_double_array(grib.id(), "values", d1, &aux);
+
+			for (int i = 0; i < nblon; i++) {
+				for (int j = 0; j < nblat; j++) {
+					d2[j * nblon + i] = d1[i * nblat + j];
+				}
+			}
+
+			delete d;
+		} else  // otherwise, just copy the array of values as they are
 		{
-				latitudes.push_back(y);
-				 y  += lat;
+			grib_get_double_array(grib.id(), "values", &(*matrix)->front(),
+					&aux);
 		}
 
+		(*matrix)->missing(missing);
+
+	} catch (...) {
+		throw MagicsException("GribRegularInterpretor - Not enough memory");
+	}
 }
 
+void GribRegularInterpretor::latitudes(const GribDecoder& grib,
+		vector<double>& latitudes) const {
+	double north = grib.getDouble("latitudeOfFirstGridPointInDegrees");
 
-void GribRegularGaussianInterpretor::latitudes(const GribDecoder& grib, vector<double>& latitudes) const 
-{
-	long res     = grib.getLong("numberOfParallelsBetweenAPoleAndTheEquator");
-	double array[2 *res];
+	long nblat = grib.getLong("numberOfPointsAlongAMeridian");
+	int scanning = grib.getLong("jScansPositively") ? 1 : -1;
+	double lat = scanning * grib.getDouble("jDirectionIncrementInDegrees");
+
+	double y = north;
+	for (int i = 0; i < nblat; i++) {
+		latitudes.push_back(y);
+		y += lat;
+	}
+
+}
+
+void GribRegularGaussianInterpretor::latitudes(const GribDecoder& grib,
+		vector<double>& latitudes) const {
+	long res = grib.getLong("numberOfParallelsBetweenAPoleAndTheEquator");
+	double array[2 * res];
 	grib_get_gaussian_latitudes(res, array);
 	double first = grib.getDouble("latitudeOfFirstGridPointInDegrees");
-	double last = grib.getDouble("latitudeOfLastGridPointInDegrees");;
+	double last = grib.getDouble("latitudeOfLastGridPointInDegrees");
+	;
 	// get the scanning mode !
 	double north = first;
 	double south = last;
-	long scanning = grib.getLong("jScansPositively");;
-	if (scanning == 1 ) {
+	long scanning = grib.getLong("jScansPositively");
+	;
+	if (scanning == 1) {
 		north = last;
 		south = first;
 	}
 
-	for ( int i = 0; i < 2*res; i++ )
-	{
-		if ( same(array[i],north, 10e-2) ) {
+	for (int i = 0; i < 2 * res; i++) {
+		if (same(array[i], north, 10e-2)) {
 			latitudes.push_back(array[i]);
 			continue;
 		}
-		if ( same(array[i],south, 10e-2) ) {
+		if (same(array[i], south, 10e-2)) {
 			latitudes.push_back(array[i]);
 			continue;
 		}
-		if ( array[i] < north && array[i] > south)
+		if (array[i] < north && array[i] > south)
 			latitudes.push_back(array[i]);
 	}
 
-
-	if (scanning == 1 )
+	if (scanning == 1)
 		std::reverse(latitudes.begin(), latitudes.end());
 }
 
-
-double GribRegularInterpretor::longitudeIncrement(const GribDecoder& grib) const 
-{
+double GribRegularInterpretor::longitudeIncrement(
+		const GribDecoder& grib) const {
 	int scanning = grib.getLong("iScansNegatively") ? -1 : 1;
-	return scanning * grib.getDouble("iDirectionIncrementInDegrees");	
-	
+	return scanning * grib.getDouble("iDirectionIncrementInDegrees");
+
 }
 
+PaperPoint GribInterpretor::reference(const GribDecoder& grib, const Transformation& transformation)
+{
+	double lon = grib.getDouble("longitudeOfFirstGridPointInDegrees");
+	double lat = grib.getDouble("latitudeOfFirstGridPointInDegrees");
 
+	UserPoint point(grib.getDouble("longitudeOfFirstGridPointInDegrees"),
+			grib.getDouble("latitudeOfFirstGridPointInDegrees"));
 
+	if (transformation.in(point))
+		return transformation(point);
+	int err;
+	grib_iterator* iter = grib_iterator_new(grib.handle(), 0, &err);
+
+	double value;
+	/* Loop on all the lat/lon/values. */
+	while (grib_iterator_next(iter, &lat, &lon, &value)) {
+		point = UserPoint(lon, lat);
+		if (transformation.in(point)) {
+			grib_iterator_delete(iter);
+			return transformation(point);
+		}
+	}
 
-void GribRegularInterpretor::interpretAsRaster(const GribDecoder& grib, RasterData& raster,const Transformation& transformation) const
-{
+	/* At the end the iterator is deleted to free memory. */
+	grib_iterator_delete(iter);
+	return PaperPoint(transformation.getMinPCX(), transformation.getMinPCY());
+}
+
+void GribRegularInterpretor::interpretAsRaster(const GribDecoder& grib,
+		RasterData& raster, const Transformation& transformation) const {
 	MagLog::dev() << "GribRegularInterpretor::interpretAsRaster" << "\n";
-	
-	BoxMatrixHandler box(const_cast<GribDecoder* >(&grib)->matrix(), transformation);
-	
+
+	BoxMatrixHandler box(const_cast<GribDecoder*>(&grib)->matrix(),
+			transformation);
+
 	int nblon = box.columns();
 	int nblat = box.rows();
-	double east = box.column(0,nblon-1);
+	double east = box.column(0, nblon - 1);
 	double west = box.column(0, 0);
 	double south = box.row(0, 0);
-	double north = box.row(nblat-1, 0);
-	
+	double north = box.row(nblat - 1, 0);
+
 	raster.setUpperRightCorner(east, north);
 	raster.setLowerLeftCorner(west, south);
 
-	double lon = (east-west)/(nblon-1);
-	double lat = (north-south)/(nblat-1);
-	
+	double lon = (east - west) / (nblon - 1);
+	double lat = (north - south) / (nblat - 1);
+
 	raster.setXResolution(lon);
 	raster.setYResolution(lat);
-	
+
 	raster.setColumns(nblon);
 	raster.setRows(nblat);
-//	
+	//
 	raster.setProjection(new TeLatLong(TeDatum()));
 
-	raster.reserve(nblon*nblat);
-	
-		for ( int j = nblat-1; j >= 0; j--)
-			for ( int i = 0; i < nblon; i++)
-				raster.push_back(box(j, i));
-}
+	raster.reserve(nblon * nblat);
 
+	for (int j = nblat - 1; j >= 0; j--)
+		for (int i = 0; i < nblon; i++)
+			raster.push_back(box(j, i));
+}
 
-void GribReducedGaussianInterpretor::interpretAsRaster(const GribDecoder& grib, RasterData& raster,const Transformation& transformation) const
-{
+void GribReducedGaussianInterpretor::interpretAsRaster(const GribDecoder& grib,
+		RasterData& raster, const Transformation& transformation) const {
 	MagLog::dev() << "GribRegularInterpretor::interpretAsRaster" << "\n";
-	Timer timer("grib api", "read grib" );
-	BoxMatrixHandler box(const_cast<GribDecoder* >(&grib)->matrix(), transformation);
-	
+	Timer timer("grib api", "read grib");
+	BoxMatrixHandler box(const_cast<GribDecoder*>(&grib)->matrix(),
+			transformation);
+
 	int nblon = box.columns();
 	int nblat = box.rows();
-	double east = box.column(0,nblon-1);
+	double east = box.column(0, nblon - 1);
 	double west = box.column(0, 0);
 	double south = box.row(0, 0);
-	double north = box.row(nblat-1, 0);
-	
+	double north = box.row(nblat - 1, 0);
+
 	raster.setUpperRightCorner(east, north);
 	raster.setLowerLeftCorner(west, south);
 
-	double lon = (east-west)/(nblon-1);
-	double lat = (north-south)/(nblat-1);
-	
+	double lon = (east - west) / (nblon - 1);
+	double lat = (north - south) / (nblat - 1);
+
 	raster.setXResolution(lon);
 	raster.setYResolution(lat);
-	
+
 	raster.setColumns(nblon);
 	raster.setRows(nblat);
-//	
+	//
 	raster.setProjection(new TeLatLong(TeDatum()));
 
-	
-	raster.reserve(nblon*nblat);
-	
-		for ( int j = nblat-1; j >= 0; j--)
-			for ( int i = 0; i < nblon; i++)
-				raster.push_back(box(j, i));
-}
+	raster.reserve(nblon * nblat);
 
+	for (int j = nblat - 1; j >= 0; j--)
+		for (int i = 0; i < nblon; i++)
+			raster.push_back(box(j, i));
+}
 
-void GribReducedGaussianInterpretor::print(ostream& out)  const
-{
+void GribReducedGaussianInterpretor::print(ostream& out) const {
 	out << "GribRegularInterpretor[";
 	out << "]";
 }
 
-
-void GribReducedGaussianInterpretor::interpretAsMatrix(const GribDecoder& grib, Matrix** matrix, const Transformation& transformation) const
-{ 
+void GribReducedGaussianInterpretor::interpretAsMatrix(const GribDecoder& grib,
+		Matrix** matrix, const Transformation& transformation) const {
 	interpretAsMatrix(grib, matrix);
 
 }
 
-double GribReducedLatLonInterpretor::XResolution(const GribDecoder& grib) const
-{
-	long res     = grib.getLong("Nj");
-	
+double GribReducedLatLonInterpretor::XResolution(
+		const GribDecoder& grib) const {
+	long res = grib.getLong("Nj");
+
+	double west = grib.getDouble("longitudeOfFirstGridPointInDegrees");
+	double east = grib.getDouble("longitudeOfLastGridPointInDegrees");
+	;
 
-	double west  = grib.getDouble("longitudeOfFirstGridPointInDegrees");
-	double east  = grib.getDouble("longitudeOfLastGridPointInDegrees");;
-	
 	longitudesSanityCheck(west, east);
-	
-	return (east-west)/(2*res);
+
+	return (east - west) / (2 * res);
 }
-double GribReducedGaussianInterpretor::XResolution(const GribDecoder& grib) const
-{
-	long res     = grib.getLong("numberOfParallelsBetweenAPoleAndTheEquator");
-	double west  = grib.getDouble("longitudeOfFirstGridPointInDegrees");
-	
-	double east  = grib.getDouble("longitudeOfLastGridPointInDegrees");;
-		
+double GribReducedGaussianInterpretor::XResolution(
+		const GribDecoder& grib) const {
+	long res = grib.getLong("numberOfParallelsBetweenAPoleAndTheEquator");
+	double west = grib.getDouble("longitudeOfFirstGridPointInDegrees");
+
+	double east = grib.getDouble("longitudeOfLastGridPointInDegrees");
+	;
+
 	longitudesSanityCheck(west, east);
-	return (east-west)/(4*res);
+	return (east - west) / (4 * res);
 }
 
-void GribReducedGaussianInterpretor::interpretAsMatrix(const GribDecoder& grib, Matrix** matrix) const
-{
+void GribReducedGaussianInterpretor::interpretAsMatrix(const GribDecoder& grib,
+		Matrix** matrix) const {
 	MagLog::dev() << "GribRegularInterpretor::interpretAsMatrix" << "\n";
 	MagLog::dev() << "GribRegularInterpretor::interpretAsMatrix" << "\n";
- 
+
 	Timer timer("gribapi", " read grib");
 	*matrix = new Matrix();
 	size_t nb;
 	grib_get_size(grib.id(), "values", &nb);
-
+	bool interpolate = grib.interpolate();
 	MagLog::dev() << "numberOfFieldValues[" << nb << "]" << "\n";
 	double missing = std::numeric_limits<double>::max();
 	grib.setDouble("missingValue", missing);
@@ -479,78 +577,88 @@ void GribReducedGaussianInterpretor::interpretAsMatrix(const GribDecoder& grib,
 	(*matrix)->akimaEnabled();
 
 	double north = grib.getDouble("latitudeOfFirstGridPointInDegrees");
-	double west  = grib.getDouble("longitudeOfFirstGridPointInDegrees");
-	double south = grib.getDouble("latitudeOfLastGridPointInDegrees");;
-	double east  = grib.getDouble("longitudeOfLastGridPointInDegrees");;
-	double plp   = grib.getDouble("PLPresent");
-	long res     = grib.getLong("numberOfParallelsBetweenAPoleAndTheEquator");
+	double west = grib.getDouble("longitudeOfFirstGridPointInDegrees");
+	double south = grib.getDouble("latitudeOfLastGridPointInDegrees");
+	double east = grib.getDouble("longitudeOfLastGridPointInDegrees");
+	double plp = grib.getDouble("PLPresent");
+	long res = grib.getLong("numberOfParallelsBetweenAPoleAndTheEquator");
+
 	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";
 
-	double pl[2*res];
+	double pl[2 * res];
+	size_t aux = 2 * res;
+	grib_get_double_array(grib.id(), "pl", pl, &aux);
+    int nblon = 0;
+    for ( int i = 0; i < aux; i++)
+        if ( pl[i] > nblon) nblon = pl[i];
+
+	double array[2 * res];
+	grib_get_gaussian_latitudes(res, array);
+
+	MagLog::dev() << "Resolution ---> " << nblon << "???" << 4 * res << "\n";
 
-	size_t aux = 2*res;
-	grib_get_double_array(grib.id(),"pl",pl,&aux);
-	
-    // We have to determine if the field is global! 
-	if (north-south > 175.) {
-        east = west + 360.;
+	// We have to determine if the field is global!
+	if (north - south > 175.) {
+		east = west + 360.;
 	}
 
 	// 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 * 4 * res);
+	(*matrix)->reserve(aux * nblon);
 
 	double *data = new double[nb];
 
 	size_t aux2 = size_t(nb);
-	int nblon = 4*res;
-	double width = east-west;
-	double step = (width)/(nblon);
 
-	grib_get_double_array(grib.id(),"values",data,&aux2);
+	double width = east - west;
+	double step = (width) / (nblon);
+
+	grib_get_double_array(grib.id(), "values", data, &aux2);
+
 	int d = 0;
-	for ( size_t i = 0; i < aux; i++)
-	{
+	for (size_t i = 0; i < aux; i++) {
 		vector<double> p;
-		for ( int ii = 0; ii < pl[i]; ii++)
-		{
+		for (int ii = 0; ii < pl[i]; ii++) {
 			p.push_back(data[d]);
 			d++;
 		}
-		
+
 		double lon = west;
 		unsigned int p1 = 0;
 		unsigned int p2 = 1;
 		double lon1 = west;
-		double lon2 = lon1 + (width/(p.size()));
+		double lon2 = lon1 + (width / (p.size()));
 
-		for ( int x = 0; x < 4*res; x++ )
-		{
+		for (int x = 0; x < nblon; x++) {
 
-			if ( lon >= lon2 )
-			{
+			if (lon >= lon2) {
 				p1++;
 				p2++;
 				lon1 = lon2;
-				lon2 += (width)/(p.size());
+				lon2 += (width) / (p.size());
 			}
-			double d1 = (lon2 - lon)/(lon2-lon1);
-			double d2 = 1-d1;
+			double d1 = (lon2 - lon) / (lon2 - lon1);
+			double d2 = 1 - d1;
 			double val;
 
-			assert ( p1 < p.size() );
+			assert(p1 < p.size());
 			if (p2 == p.size()) {
 				(*matrix)->push_back(p[p1]);
-			}
-			else {
-				if (p[p1] == missing ||  p[p2] == missing)
-					val = missing;
-				else
-					val = (p[p1] * d1) + (p[p2] * d2);
+			} else {
+				if (interpolate) {
+					if (p[p1] == missing || p[p2] == missing)
+						val = missing;
+					else
+						val = (p[p1] * d1) + (p[p2] * d2);
+				} else {
+					val = (d2 < 0.5) ? p[p1] : p[p2];
+
+				}
 				(*matrix)->push_back(val);
 			}
 			lon += step;
@@ -558,472 +666,502 @@ void GribReducedGaussianInterpretor::interpretAsMatrix(const GribDecoder& grib,
 
 	}
 
-	delete [] data;
+	delete[] data;
 
-	for (int x = 0; x < nblon; x++)
-	{
-		(*matrix)->columnsAxis().push_back(west+(x*step));
+	for (int x = 0; x < nblon; x++) {
+		(*matrix)->columnsAxis().push_back(west + (x * step));
 	}
-		
-	double array[2 *res];
-	long par = grib.getLong("numberOfParallelsBetweenAPoleAndTheEquator");
-	grib_get_gaussian_latitudes(par, array);
 
-	for ( int i = 0; i < 2*res; i++ )
-	{
+
+	for (int i = 0; i < 2 * res; i++) {
+
 		(*matrix)->rowsAxis().push_back(array[i]);
 	}
 	(*matrix)->setMapsAxis();
 }
 
-void GribReducedLatLonInterpretor::print(ostream& out)  const
-{
+
+void GribReducedLatLonInterpretor::print(ostream& out) const {
 	out << "GribReducedLatLonInterpretor[";
 	out << "]";
 }
 
-void GribReducedLatLonInterpretor::interpretAsMatrix(const GribDecoder& grib, Matrix** matrix) const
-{
-	
- 
+void GribReducedLatLonInterpretor::interpretAsMatrix(const GribDecoder& grib,
+		Matrix** matrix) const {
+
 	Timer timer("gribapi", " read grib");
-    *matrix = new Matrix();
+	*matrix = new Matrix();
 	size_t nb;
 	grib_get_size(grib.id(), "values", &nb);
 
-	MagLog::dev() << "numberOfFieldValues[" << nb << "]" << "\n";
+
 	double missing = std::numeric_limits<double>::max();
 	grib.setDouble("missingValue", missing);
+
 	(*matrix)->missing(missing);
 	(*matrix)->akimaEnabled();
 
 	double north = grib.getDouble("latitudeOfFirstGridPointInDegrees");
-	double west  = grib.getDouble("longitudeOfFirstGridPointInDegrees");
-	double south = grib.getDouble("latitudeOfLastGridPointInDegrees");; 
-	double east  = grib.getDouble("longitudeOfLastGridPointInDegrees");;
+	double west = grib.getDouble("longitudeOfFirstGridPointInDegrees");
+	double south = grib.getDouble("latitudeOfLastGridPointInDegrees");
+	double east = grib.getDouble("longitudeOfLastGridPointInDegrees");
+
 	longitudesSanityCheck(west, east);
-	size_t res     = grib.getLong("Nj");
+	size_t res = grib.getLong("Nj");
 
-	MagLog::dev() << "NewAPI---> area[" << west << ", " << north << ", " << east << ", " << south << "]" << "\n";
+	MagLog::dev() << "NewAPI---> area[" << west << ", " << north << ", " << east
+			<< ", " << south << "]" << "\n";
 	MagLog::dev() << "Res---> " << res << "\n";
 
 	double pl[res];
-	
+
 	long nblat = grib.getLong("numberOfPointsAlongAMeridian");
 	int scanning = grib.getLong("jScansPositively") ? 1 : -1;
-	double lat =  scanning * grib.getDouble("jDirectionIncrementInDegrees");
+	double lat = scanning * grib.getDouble("jDirectionIncrementInDegrees");
 
-	grib_get_double_array(grib.id(),"pl",pl,&res);
+	grib_get_double_array(grib.id(), "pl", pl, &res);
 
 	double *data = new double[nb];
 
 	size_t aux2 = size_t(nb);
-	int nblon = 2*res;
-	float width = east-west;
-	float step = (width)/(nblon-1); 
+
+	int nblon = 0;
+	for ( int i = 0; i < res; i++)
+		if (nblon < pl[i] )
+			nblon = pl[i];
+
+	double width = east - west;
+	double step = width / nblon;
+
 	// We have to determine if the field is global! 
-        bool global = east-west > 360 - 5*step;
-        if (global) {
-                MagLog::dev() << "YES THE FIELD IS GLOBAL" << endl;
-                east = west + 360;
-        }
-
-	
-	grib_get_double_array(grib.id(),"values",data,&aux2);
+	// We have to determine if the field is global!
+	bool global = east - west > 360 - 5 * step;
+
+	if (global) {
+		east = west + 360;
+		width = east - west;
+		step = width / nblon;
+	}
+
+	grib_get_double_array(grib.id(), "values", data, &aux2);
 	int d = 0;
-	for ( size_t i = 0; i < res; i++)
-	{
-		float lon = west;
-	
-		float lon1 = west;
-		if ( pl[i] == 0 ) {
+
+
+	for (size_t i = 0; i < res; i++) {
+
+
+
+		if (pl[i] == 0) {
 			// add missing data 
-			for ( int x = 0; x < nblon; x++ ) 
+			for (int x = 0; x < nblon; x++)
 				(*matrix)->push_back(missing);
 		}
-		else
-		{
+		else {
 			unsigned int p1 = 0;
-			unsigned int p2 = 1;
 			vector<double> p;
+			vector<double> lons;
 
-			for ( int ii = 0; ii < pl[i]; ii++)
-			{
+			double datastep = width / pl[i];
+			for (int ii = 0; ii < pl[i]; ii++) {
 				p.push_back(data[d]);
+				lons.push_back( west + (ii*datastep) );
+
+
 				d++;
 			}
-		
-			float lon2 = lon1 + (width/(p.size()-1));
-
-			for ( int x = 0; x < nblon; x++ )
-			{
-				float d1 = (lon2 - lon)/(lon2-lon1);
-				float d2 = 1-d1;
-				double val; 
-				if (p[p1] == missing ||  p[p2] == missing)
-					val = missing;
-				else
-					val = (p[p1] * d1) + (p[p2] * d2);
-				(*matrix)->push_back(val);
-				lon += step;
-				if ( lon >= lon2 )
-				{
-					p1++;
-					if ( p1==p.size() )
-					{
-						p1 = 0;
+			assert( p.size() ==  pl[i]);
+
+
+			vector<double>::iterator val = p.begin();
+			vector<double>::iterator lval = lons.begin();
+			vector<double>::iterator nval = p.begin();
+			nval++;
+			vector<double>::iterator nlval = lons.begin();
+			nlval++;
+
+			for (int x = 0; x < nblon; x++) {
+
+				double lon = west + (x*step);
+
+				if ( lon > *lval ) {
+
+					lval++;
+					val++;
+
+
+					if ( lval == lons.end() ) {
+						val = p.begin();
+						lval = lons.begin();
 					}
-					p2++;
-					if ( p2 == p.size() )
-					{
-						p2 = 0;
+					nval++;
+					nlval++;
+					if ( nlval == lons.end() ) {
+						nval = p.begin();
+						nlval = lons.begin();
 					}
-					lon1 = lon2;
-					lon2 += (width)/(p.size()-1);
+
+
 				}
+
+
+
+
+				if ( *val == missing ||  *nval == missing)
+					(*matrix)->push_back(*val);
+				else {
+
+
+					double d1 = ( *nlval - lon) / (datastep);
+					if ( d1 <  0 ) d1 = 1;
+					double d2 = 1 - d1;
+					(*matrix)->push_back( ( d1 * (*val)) + (d2 * (*nval)));
+				}
+
+
+
+
 			}
 		}
 	}
-    
-	delete [] data;
-
-	float lon = (width) / (nblon-1);
-//	float lat = (north - south) / (2 *res);
-	for (int x = 0; x < nblon; x++)
-	{
-		(*matrix)->columnsAxis().push_back(west+(x*lon));
+
+	delete[] data;
+
+
+	for (int x = 0; x < nblon; x++) {
+		(*matrix)->columnsAxis().push_back(west + (x * step));
 	}
 
 	double y = north;
-	for (long i = 0; i < nblat; i++)
-	{
+	for (long i = 0; i < nblat; i++) {
 		(*matrix)->rowsAxis().push_back(y);
-		y  += lat;
+		y += lat;
 	}
 
 	(*matrix)->setMapsAxis();
 }
 
-
 /*
  * Imported from Metview MvGrid...
- */ 
-
+ */
 
-void GribRotatedInterpretor::print(ostream& out) const
-{
+void GribRotatedInterpretor::print(ostream& out) const {
 	out << "GribRotatedInterpretor[]";
 }
 
+UserPoint GribLambertAzimutalInterpretor::unrotate(double lat,
+		double lon) const {
 
-UserPoint GribLambertAzimutalInterpretor::unrotate(double lat, double lon) const
-{
-	  
-	  return UserPoint(lon, lat);
+	return UserPoint(lon, lat);
 }
 
-pair<double, double> GribRotatedInterpretor::unrotate( double lat_y, double lon_x) const
-{
-	const double cToRadians         = M_PI/180.0;    
-	double ZRADI  = 1./cToRadians; 
-	double ZSYCEN = sin(cToRadians*(southPoleLat_+90.));  
-	double ZCYCEN = cos(cToRadians*(southPoleLat_+90.));            
-	double ZSXROT = sin(cToRadians*lon_x);                                       
-	double ZCXROT = cos(cToRadians*lon_x);                                   
-	double ZSYROT = sin(cToRadians*lat_y);                                    
-	double ZCYROT = cos(cToRadians*lat_y);                                  
-	double ZSYREG = ZCYCEN*ZSYROT + ZSYCEN*ZCYROT*ZCXROT;             
-	ZSYREG = MAX( MIN(ZSYREG, +1.0), -1.0 );                                            
-	double PYREG = asin(ZSYREG)*ZRADI;                                   
-	double ZCYREG = cos(PYREG*cToRadians);                         
-	double ZCXMXC = (ZCYCEN*ZCYROT*ZCXROT - ZSYCEN*ZSYROT)/ZCYREG;                           
-	ZCXMXC = MAX( MIN(ZCXMXC, +1.0), -1.0 );                                                
-	double ZSXMXC = ZCYROT*ZSXROT/ZCYREG;                                       
-	double ZXMXC  = acos(ZCXMXC)*ZRADI;                                            
-	if( ZSXMXC < 0.0)                                                                             
-		ZXMXC = -ZXMXC;                                                          
-	double PXREG = ZXMXC + southPoleLon_;                        
-	return std::make_pair( PYREG, PXREG );                                     
-}               
-
-pair<double, double> GribRotatedInterpretor::rotate( double lat_y, double lon_x) const
-{
-  const double cToRadians         = M_PI/180.0;
-  double ZRADI  = 1./cToRadians;
-  double ZSYCEN = sin(cToRadians*(southPoleLat_+90.));
-  double ZCYCEN = cos(cToRadians*(southPoleLat_+90.));
+pair<double, double> GribRotatedInterpretor::unrotate(double lat_y,
+		double lon_x) const {
+	const double cToRadians = M_PI / 180.0;
+	double ZRADI = 1. / cToRadians;
+	double ZSYCEN = sin(cToRadians * (southPoleLat_ + 90.));
+	double ZCYCEN = cos(cToRadians * (southPoleLat_ + 90.));
+	double ZSXROT = sin(cToRadians * lon_x);
+	double ZCXROT = cos(cToRadians * lon_x);
+	double ZSYROT = sin(cToRadians * lat_y);
+	double ZCYROT = cos(cToRadians * lat_y);
+	double ZSYREG = ZCYCEN * ZSYROT + ZSYCEN * ZCYROT * ZCXROT;
+	ZSYREG = MAX(MIN(ZSYREG, +1.0), -1.0);
+	double PYREG = asin(ZSYREG) * ZRADI;
+	double ZCYREG = cos(PYREG * cToRadians);
+	double ZCXMXC = (ZCYCEN * ZCYROT * ZCXROT - ZSYCEN * ZSYROT) / ZCYREG;
+	ZCXMXC = MAX(MIN(ZCXMXC, +1.0), -1.0);
+	double ZSXMXC = ZCYROT * ZSXROT / ZCYREG;
+	double ZXMXC = acos(ZCXMXC) * ZRADI;
+	if (ZSXMXC < 0.0)
+		ZXMXC = -ZXMXC;
+	double PXREG = ZXMXC + southPoleLon_;
+	return std::make_pair(PYREG, PXREG);
+}
 
-  double ZXMXC  = cToRadians*(lon_x - southPoleLon_);
-  double ZSXMXC = sin(ZXMXC);
-  double ZCXMXC = cos(ZXMXC);
-  double ZSYREG = sin(cToRadians*lat_y);
-  double ZCYREG = cos(cToRadians*lat_y);
-  double ZSYROT = ZCYCEN*ZSYREG - ZSYCEN*ZCYREG*ZCXMXC;
-  ZSYROT = MAX( MIN(ZSYROT, +1.0), -1.0 );
+PaperPoint GribRotatedInterpretor::reference(const GribDecoder& grib, const Transformation& transformation) {
+	double lon = grib.getDouble("longitudeOfFirstGridPointInDegrees");
+	double lat = grib.getDouble("latitudeOfFirstGridPointInDegrees");
+	pair<double, double> xy = unrotate(lat, lon);
+	UserPoint point(xy.second, xy.first);
+	if (transformation.in(point))
+			return transformation(point);
 
-  double PYROT  = asin(ZSYROT)*ZRADI;
 
-  double ZCYROT = cos(PYROT*cToRadians);
-  double ZCXROT = (ZCYCEN*ZCYREG*ZCXMXC + ZSYCEN*ZSYREG)/ZCYROT;
-  ZCXROT = MAX( MIN(ZCXROT, +1.0), -1.0 );
-  double ZSXROT = ZCYREG*ZSXMXC/ZCYROT;
+	int err;
+	grib_iterator* iter = grib_iterator_new(grib.handle(), 0, &err);
+
+	double value;
+	/* Loop on all the lat/lon/values. */
+	while (grib_iterator_next(iter, &lat, &lon, &value)) {
+		pair<double, double> xy = unrotate(lat, lon);
+		point = UserPoint(xy.second, xy.first);
+		if (transformation.in(point)) {
+			grib_iterator_delete(iter);
+			return transformation(point);
+		}
+	}
 
-  double PXROT = acos(ZCXROT)*ZRADI;
+	/* At the end the iterator is deleted to free memory. */
+	grib_iterator_delete(iter);
+	return PaperPoint(transformation.getMinPCX(), transformation.getMinPCY());
+}
+pair<double, double> GribRotatedInterpretor::rotate(double lat_y,
+		double lon_x) const {
+	const double cToRadians = M_PI / 180.0;
+	double ZRADI = 1. / cToRadians;
+	double ZSYCEN = sin(cToRadians * (southPoleLat_ + 90.));
+	double ZCYCEN = cos(cToRadians * (southPoleLat_ + 90.));
+
+	double ZXMXC = cToRadians * (lon_x - southPoleLon_);
+	double ZSXMXC = sin(ZXMXC);
+	double ZCXMXC = cos(ZXMXC);
+	double ZSYREG = sin(cToRadians * lat_y);
+	double ZCYREG = cos(cToRadians * lat_y);
+	double ZSYROT = ZCYCEN * ZSYREG - ZSYCEN * ZCYREG * ZCXMXC;
+	ZSYROT = MAX(MIN(ZSYROT, +1.0), -1.0);
+
+	double PYROT = asin(ZSYROT) * ZRADI;
+
+	double ZCYROT = cos(PYROT * cToRadians);
+	double ZCXROT = (ZCYCEN * ZCYREG * ZCXMXC + ZSYCEN * ZSYREG) / ZCYROT;
+	ZCXROT = MAX(MIN(ZCXROT, +1.0), -1.0);
+	double ZSXROT = ZCYREG * ZSXMXC / ZCYROT;
+
+	double PXROT = acos(ZCXROT) * ZRADI;
+
+	if (ZSXROT < 0.0)
+		PXROT = -PXROT;
+
+	return std::make_pair(PYROT, PXROT);
+}
 
-  if( ZSXROT < 0.0)
-    PXROT = -PXROT;
+void GribLambertAzimutalInterpretor::interpretAsMatrix(const GribDecoder& grib,
+		Matrix** matrix) const {
+	long im = grib.getLong("numberOfPointsAlongXAxis");
+	long jm = grib.getLong("numberOfPointsAlongYAxis");
 
-  return std::make_pair( PYROT, PXROT );
-}
+	RotatedMatrix *rotated = new RotatedMatrix(jm, im);
+	*matrix = rotated;
 
+	size_t nb;
+	grib_get_size(grib.id(), "values", &nb);
 
-void GribLambertAzimutalInterpretor::interpretAsMatrix(const GribDecoder& grib, Matrix** matrix) const
-{
-	  long im = grib.getLong("numberOfPointsAlongXAxis");
-	  long jm = grib.getLong("numberOfPointsAlongYAxis");
-	  
-	  RotatedMatrix *rotated = new RotatedMatrix(jm, im);
-	  *matrix = rotated;
-	  
-	
-	  
-	  size_t nb;
-	  grib_get_size(grib.id(), "values", &nb);
-
-	  
-
-	  MagLog::dev() << "numberOfFieldValues[" << nb << "]" << "\n";
-
-	  double missing = -std::numeric_limits<double>::max();
-
-	  missing = grib.getDouble("missingValue");    
-	  rotated->missing(missing);
-
-	  double north = grib.getDouble("latitudeOfFirstGridPointInDegrees");
-	  double west = grib.getDouble("longitudeOfFirstGridPointInDegrees");
-	  
-	  MagLog::dev() << "NewAPI---> area[" << west << ", " << north << "]" << "\n";
-	  
-	  
-
-	 
-	 
-	 
-	  
-      		try
-		{
-			Timer time("Grib", "lambert");
-				
-               
-			
-					
-			MagLog::debug() << "Version" << 	grib_get_api_version()<< endl;
-    
-            vector<double>& data = rotated->values();
-            vector<double>& latm = rotated->rowsArray();
-            vector<double>& lonm = rotated->columnsArray();
-
-            
-			size_t aux = size_t(nb);
-	        
-            grib_get_double_array(grib.id(),"latitudes",&(latm.front()),&aux); 
-            grib_get_double_array(grib.id(),"values",&(data.front()),&aux);
-            grib_get_double_array(grib.id(),"longitudes",&(lonm.front()),&aux);
-     for ( int i = 0; i < nb; i++) {
-        
-        if ( lonm[i] > 180. )
-        	 lonm[i] -= 360.;
-
-    }
-/*
-     vector<double> left;
-     vector<double> right;
-    for (int l = 0; l < jm; l++ ) {
-    	left.push_back(lonm[l*im]);
-    	right.push_back(lonm[(im-1)+(l*im)]);
+	MagLog::dev() << "numberOfFieldValues[" << nb << "]" << "\n";
 
+	double missing = -std::numeric_limits<double>::max();
 
-    }
-   minlon = *min_element(left.begin(), left.end());
-   maxlon = *max_element(right.begin(), right.end());
-      
-        MagLog::debug() << "lat [" << minlat << ", " << maxlat << "]" << std::endl;
-		MagLog::debug()	<< "lon [" << minlon << ", " << maxlon << "]" << std::endl;
-				
- 
-	  
+	missing = grib.getDouble("missingValue");
+	rotated->missing(missing);
 
+	double north = grib.getDouble("latitudeOfFirstGridPointInDegrees");
+	double west = grib.getDouble("longitudeOfFirstGridPointInDegrees");
 
-					vector<double>& lon = (*matrix)->columnsAxis();
-					for (vector<double>::iterator l = lon.begin(); l != lon.end(); ++l )
-						if ( *l > 180) *l  -=360;
+	MagLog::dev() << "NewAPI---> area[" << west << ", " << north << "]" << "\n";
 
-					vector<double>& lat = (*matrix)->rowsAxis();
+	try {
+		Timer time("Grib", "lambert");
 
-					// for the lon we take the fisrt line :
-					double inci = (maxlon - minlon)/((im) -1);
-					double incj = (maxlat - minlat)/((jm) -1);
-					for (int i = 0; i < im; i++)
-						lon.push_back(minlon + (i*inci));
-					// for the lon we take the fisrt column :
-					for (int i = 0; i < jm; i++)
-						lat.push_back(minlat + (i*incj));
+		MagLog::debug() << "Version" << grib_get_api_version() << endl;
 
-					typedef map<double, map<double, pair<int, int> > > Helper;
+		vector<double>& data = rotated->values();
+		vector<double>& latm = rotated->rowsArray();
+		vector<double>& lonm = rotated->columnsArray();
 
-					//typedef map<double, double> Helper;
-					Helper helper;
-					int row = 0;
-					for (vector<double>::iterator y = lat.begin(); y != lat.end(); ++y) {
+		size_t aux = size_t(nb);
 
-						helper.insert(make_pair(*y, map<double, pair<int, int>  >()));
+		grib_get_double_array(grib.id(), "latitudes", &(latm.front()), &aux);
+		grib_get_double_array(grib.id(), "values", &(data.front()), &aux);
+		grib_get_double_array(grib.id(), "longitudes", &(lonm.front()), &aux);
+		for (int i = 0; i < nb; i++) {
 
-						Helper::iterator h = helper.find(*y);
+			if (lonm[i] > 180.)
+				lonm[i] -= 360.;
 
-						int column = 0;
-						for (vector<double>::iterator x = lon.begin(); x != lon.end(); ++x) {
-							h->second.insert(make_pair(*x, std::make_pair(row, column)));
+		}
+		/*
+		 vector<double> left;
+		 vector<double> right;
+		 for (int l = 0; l < jm; l++ ) {
+		 left.push_back(lonm[l*im]);
+		 right.push_back(lonm[(im-1)+(l*im)]);
 
-							(*matrix)->push_back(missing);
-							column++;
 
-						}
-						row++;
-					}
+		 }
+		 minlon = *min_element(left.begin(), left.end());
+		 maxlon = *max_element(right.begin(), right.end());
 
+		 MagLog::debug() << "lat [" << minlat << ", " << maxlat << "]" << std::endl;
+		 MagLog::debug()	<< "lon [" << minlon << ", " << maxlon << "]" << std::endl;
 
 
-					int r = 0;
-					int c = 0;
-
-					double lat11, lat12, lat21, lat22;
-					double lon11, lon12, lon21, lon22;
-					double val11, val12, val21, val22;
-
-					for (int r = 0; r < jm -1; r++) {
-						for (int c = 0;  c < im -1; c++) {
-
-							lat11 = latm[c + (im*r)];
-
-							lat12 = latm[(c+1) + (im*r)];
-							minlat = std::min(lat11, lat12);
-							maxlat = std::max(lat11, lat12);
-							lat21 = latm[c + (im* (r+1))];
-							minlat = std::min(minlat, lat21);
-							maxlat = std::max(maxlat, lat21);
-							lat22 = latm[(c+1) + (im* (r+1))];
-							minlat = std::min(minlat, lat22);
-							maxlat = std::max(maxlat, lat22);
-
-							lon11 = lonm[c + (im*r)];
-							lon12 = lonm[(c+1) + (im*r)];
-							if ( lon12 < lon11 )
-								lon12 +=360.;
-							minlon = std::min(lon11, lon12);
-							maxlon = std::max(lon11, lon12);
-							lon21 = lonm[c + (im* (r+1))];
-							minlon = std::min(minlon, lon21);
-							maxlon = std::max(maxl  inline double column(int, int column) const {
-       	return regular_longitudes_[column];
-   }
-    inline double row(int row, int) const {
-    	return regular_latitudes_[row];
-    }on, lon21);
-							lon22 = lonm[(c+1) + (im* (r+1))];
-							if ( lon22 < lon21 )
-									lon22 +=360.;
-							minlon = std::min(minlon, lon22);
-							maxlon = std::max(maxlon, lon22);
-
-							val11 = data[c + (im*r)];
-							val12 = data[(c+1) + (im*r)];
-							val21 = data[c + (im* (r+1))];
-							val22 = data[(c+1) + (im* (r+1))];
-
-
-
-							// find the points from the helper!
-							Helper::iterator low,up;
-							low = helper.lower_bound(minlat);
-							up = helper.lower_bound(maxlat);
-							if ( low == helper.end() || up == helper.end() )
-								break;
-							for (Helper::iterator it = low; it != up; ++it) {
-								if (it == helper.end()) break;
-								map<double, pair<int, int> >&  lons = it->second;
-								map<double, pair<int, int> >::iterator llow = lons.lower_bound(minlon);
-								map<double, pair<int, int> >::iterator lup = lons.lower_bound(maxlon);
-								if ( llow == lons.end() || lup == lons.end() )
-									break;;
-								for (map<double, pair<int, int> >::iterator lit = llow; lit != lup; ++lit) {
-
-									double lat = it->first;
-									double lon = lit->first;
-									std::pair<int, int> index = lit->second;
-
-									// we interpolate at the point using the 4 points found!
-									double val = missing;
-									map<double, double> values;
-									vector<double> distances;
-
-									distances.push_back((lon12 - lon)*(lon12 - lon) + (lat12 -lat) *(lat12 -lat));
-									values[distances.back()] = val12;
-									distances.push_back((lon11 - lon)*(lon11 - lon) + (lat11 -lat) *(lat11 -lat));
-									values[distances.back()] = val11;
-									distances.push_back((lon21 - lon)*(lon21 - lon) + (lat21 -lat) *(lat21 -lat));
-									values[distances.back()] = val21;
-									distances.push_back((lon22 - lon)*(lon22 - lon) + (lat22 -lat) *(lat22 -lat));
-									values[distances.back()] = val22;
-									if ( (**matrix)[index.second +( index.first*im)] == missing )
-										(**matrix)[index.second +( index.first*im)] = values[*std::min_element(distances.begin(), distances.end())];
-
-									//we compute the distance ... we take the vlaue of the nearest non_missing point!
 
 
-								}
 
+		 vector<double>& lon = (*matrix)->columnsAxis();
+		 for (vector<double>::iterator l = lon.begin(); l != lon.end(); ++l )
+		 if ( *l > 180) *l  -=360;
 
-							}
+		 vector<double>& lat = (*matrix)->rowsAxis();
+
+		 // for the lon we take the fisrt line :
+		 double inci = (maxlon - minlon)/((im) -1);
+		 double incj = (maxlat - minlat)/((jm) -1);
+		 for (int i = 0; i < im; i++)
+		 lon.push_back(minlon + (i*inci));
+		 // for the lon we take the fisrt column :
+		 for (int i = 0; i < jm; i++)
+		 lat.push_back(minlat + (i*incj));
+
+		 typedef map<double, map<double, pair<int, int> > > Helper;
+
+		 //typedef map<double, double> Helper;
+		 Helper helper;
+		 int row = 0;
+		 for (vector<double>::iterator y = lat.begin(); y != lat.end(); ++y) {
+
+		 helper.insert(make_pair(*y, map<double, pair<int, int>  >()));
+
+		 Helper::iterator h = helper.find(*y);
+
+		 int column = 0;
+		 for (vector<double>::iterator x = lon.begin(); x != lon.end(); ++x) {
+		 h->second.insert(make_pair(*x, std::make_pair(row, column)));
 
+		 (*matrix)->push_back(missing);
+		 column++;
 
-					}
+		 }
+		 row++;
+		 }
 
 
-					 (*matrix)->setMapsAxis();
-                     (*matrix)->missing(missing);
-					}
 
-					
+		 int r = 0;
+		 int c = 0;
 
-					
-	        
-			MagLog::dev() << **matrix << "\n";
-			
+		 double lat11, lat12, lat21, lat22;
+		 double lon11, lon12, lon21, lon22;
+		 double val11, val12, val21, val22;
 
-	    */
-		}
-		catch (MagicsException& e)
-		{
-			MagLog::error() << e << "\n";
-		}
+		 for (int r = 0; r < jm -1; r++) {
+		 for (int c = 0;  c < im -1; c++) {
 
-}
+		 lat11 = latm[c + (im*r)];
 
+		 lat12 = latm[(c+1) + (im*r)];
+		 minlat = std::min(lat11, lat12);
+		 maxlat = std::max(lat11, lat12);
+		 lat21 = latm[c + (im* (r+1))];
+		 minlat = std::min(minlat, lat21);
+		 maxlat = std::max(maxlat, lat21);
+		 lat22 = latm[(c+1) + (im* (r+1))];
+		 minlat = std::min(minlat, lat22);
+		 maxlat = std::max(maxlat, lat22);
 
+		 lon11 = lonm[c + (im*r)];
+		 lon12 = lonm[(c+1) + (im*r)];
+		 if ( lon12 < lon11 )
+		 lon12 +=360.;
+		 minlon = std::min(lon11, lon12);
+		 maxlon = std::max(lon11, lon12);
+		 lon21 = lonm[c + (im* (r+1))];
+		 minlon = std::min(minlon, lon21);
+		 maxlon = std::max(maxl  inline double column(int, int column) const {
+		 return regular_longitudes_[column];
+		 }
+		 inline double row(int row, int) const {
+		 return regular_latitudes_[row];
+		 }on, lon21);
+		 lon22 = lonm[(c+1) + (im* (r+1))];
+		 if ( lon22 < lon21 )
+		 lon22 +=360.;
+		 minlon = std::min(minlon, lon22);
+		 maxlon = std::max(maxlon, lon22);
 
-void GribLambertAzimutalInterpretor::print(ostream& out) const
-{
+		 val11 = data[c + (im*r)];
+		 val12 = data[(c+1) + (im*r)];
+		 val21 = data[c + (im* (r+1))];
+		 val22 = data[(c+1) + (im* (r+1))];
+
+
+
+		 // find the points from the helper!
+		 Helper::iterator low,up;
+		 low = helper.lower_bound(minlat);
+		 up = helper.lower_bound(maxlat);
+		 if ( low == helper.end() || up == helper.end() )
+		 break;
+		 for (Helper::iterator it = low; it != up; ++it) {
+		 if (it == helper.end()) break;
+		 map<double, pair<int, int> >&  lons = it->second;
+		 map<double, pair<int, int> >::iterator llow = lons.lower_bound(minlon);
+		 map<double, pair<int, int> >::iterator lup = lons.lower_bound(maxlon);
+		 if ( llow == lons.end() || lup == lons.end() )
+		 break;;
+		 for (map<double, pair<int, int> >::iterator lit = llow; lit != lup; ++lit) {
+
+		 double lat = it->first;
+		 double lon = lit->first;
+		 std::pair<int, int> index = lit->second;
+
+		 // we interpolate at the point using the 4 points found!
+		 double val = missing;
+		 map<double, double> values;
+		 vector<double> distances;
+
+		 distances.push_back((lon12 - lon)*(lon12 - lon) + (lat12 -lat) *(lat12 -lat));
+		 values[distances.back()] = val12;
+		 distances.push_back((lon11 - lon)*(lon11 - lon) + (lat11 -lat) *(lat11 -lat));
+		 values[distances.back()] = val11;
+		 distances.push_back((lon21 - lon)*(lon21 - lon) + (lat21 -lat) *(lat21 -lat));
+		 values[distances.back()] = val21;
+		 distances.push_back((lon22 - lon)*(lon22 - lon) + (lat22 -lat) *(lat22 -lat));
+		 values[distances.back()] = val22;
+		 if ( (**matrix)[index.second +( index.first*im)] == missing )
+		 (**matrix)[index.second +( index.first*im)] = values[*std::min_element(distances.begin(), distances.end())];
+
+		 //we compute the distance ... we take the vlaue of the nearest non_missing point!
+
+
+		 }
+
+
+		 }
+
+
+		 }
+
+
+		 (*matrix)->setMapsAxis();
+		 (*matrix)->missing(missing);
+		 }
+
+
+
+
+
+		 MagLog::dev() << **matrix << "\n";
+
+
+		 */
+	} catch (MagicsException& e) {
+		MagLog::error() << e << "\n";
+	}
+
+}
+
+void GribLambertAzimutalInterpretor::print(ostream& out) const {
 	out << "GribLambertAzimutalInterpretor[]";
 }
 
-void GribRotatedInterpretor::interpretAsMatrix(const GribDecoder& grib, Matrix** matrix) const
-{
+void GribRotatedInterpretor::interpretAsMatrix(const GribDecoder& grib,
+		Matrix** matrix) const {
 
-	southPoleLat_  = grib.getDouble("latitudeOfSouthernPoleInDegrees");
-	southPoleLon_  = grib.getDouble("longitudeOfSouthernPoleInDegrees");
-	angle_  = grib.getDouble("angleOfRotationInDegrees") * 180.0/M_PI;
-	uvRelativeToGrid_  = grib.getLong("uvRelativeToGrid");
-	if ( original_ ) {
+	southPoleLat_ = grib.getDouble("latitudeOfSouthernPoleInDegrees");
+	southPoleLon_ = grib.getDouble("longitudeOfSouthernPoleInDegrees");
+	angle_ = grib.getDouble("angleOfRotationInDegrees") * 180.0 / M_PI;
+	uvRelativeToGrid_ = grib.getLong("uvRelativeToGrid");
+	if (original_) {
 		long nblon = grib.getLong("numberOfPointsAlongAParallel");
 		long nblat = grib.getLong("numberOfPointsAlongAMeridian");
 
@@ -1039,58 +1177,51 @@ void GribRotatedInterpretor::interpretAsMatrix(const GribDecoder& grib, Matrix**
 
 		double north = grib.getDouble("latitudeOfFirstGridPointInDegrees");
 		double west = grib.getDouble("longitudeOfFirstGridPointInDegrees");
-		double south = grib.getDouble("latitudeOfLastGridPointInDegrees");;
-		double east = grib.getDouble("longitudeOfLastGridPointInDegrees");;
+		double south = grib.getDouble("latitudeOfLastGridPointInDegrees");
+		;
+		double east = grib.getDouble("longitudeOfLastGridPointInDegrees");
+		;
 		longitudesSanityCheck(west, east);
 
+		double lon = (east - west) / (nblon - 1);
+		double lat = (south - north) / (nblat - 1);
 
-		double lon = (east-west)/(nblon-1);
-		double lat =   (south-north)/(nblat-1);
-
-		vector<double>& rows = static_cast<RotatedMatrix*>(*matrix)->rowsArray();
-		vector<double>& columns = static_cast<RotatedMatrix*>(*matrix)->columnsArray();
+		vector<double>& rows =
+				static_cast<RotatedMatrix*>(*matrix)->rowsArray();
+		vector<double>& columns =
+				static_cast<RotatedMatrix*>(*matrix)->columnsArray();
 		vector<double>& values = static_cast<RotatedMatrix*>(*matrix)->values();
-		MagLog::dev() << "calcul -->" << lon << " (from->" << west << " to-->" << west + (nblon-1) *lon << ")" <<  endl;
+		MagLog::dev() << "calcul -->" << lon << " (from->" << west << " to-->"
+				<< west + (nblon - 1) * lon << ")" << endl;
 
 		double y = north;
-		for (int i = 0; i < nblat; i++)
-		{
+		for (int i = 0; i < nblat; i++) {
 			double x = west;
-			for (int  j = 0; j < nblon; j++)
-			{
-				if ( i == 0 )
+			for (int j = 0; j < nblon; j++) {
+				if (i == 0)
 					(*matrix)->columnsAxis().push_back(x);
 				std::pair<double, double> point = unrotate(y, x);
 				columns.push_back(point.second);
 				rows.push_back(point.first);
-				x  = west + (j+1)*lon;
+				x = west + (j + 1) * lon;
 
 			}
 
-			y  = north + (i+1)*lat;
+			y = north + (i + 1) * lat;
 
 		}
 
-
-
-
-
-
 		try {
 			(*matrix)->resize(nb);
 			size_t aux = size_t(nb);
-			grib_get_double_array(grib.id(),"values", &values.front(),&aux);
-		}
-		catch (...)
-		{
+			grib_get_double_array(grib.id(), "values", &values.front(), &aux);
+		} catch (...) {
 			throw MagicsException("Not enough memory");
 		}
 
-
 		return;
 	}
 
-
 	long nblon = grib.getLong("numberOfPointsAlongAParallel");
 	long nblat = grib.getLong("numberOfPointsAlongAMeridian");
 	*matrix = new Matrix(nblat, nblon);
@@ -1102,89 +1233,75 @@ void GribRotatedInterpretor::interpretAsMatrix(const GribDecoder& grib, Matrix**
 
 	MagLog::dev() << "numberOfFieldValues[" << nb << "]" << "\n";
 	double missing = -std::numeric_limits<double>::max();
-	grib.setDouble("missingValue", missing);    
+	grib.setDouble("missingValue", missing);
 	helper->missing(missing);
 	(*matrix)->missing(missing);
 
 	double north = grib.getDouble("latitudeOfFirstGridPointInDegrees");
 	double west = grib.getDouble("longitudeOfFirstGridPointInDegrees");
-	double south = grib.getDouble("latitudeOfLastGridPointInDegrees");; 
-	double east = grib.getDouble("longitudeOfLastGridPointInDegrees");;
+	double south = grib.getDouble("latitudeOfLastGridPointInDegrees");
+	;
+	double east = grib.getDouble("longitudeOfLastGridPointInDegrees");
+	;
 	longitudesSanityCheck(west, east);
 
-	MagLog::dev() << "NewAPI---> area[" << west << ", " << north << ", " << east << ", " << south << "]" << "\n";
+	MagLog::dev() << "NewAPI---> area[" << west << ", " << north << ", " << east
+			<< ", " << south << "]" << "\n";
 
-	double lon = (east-west)/(nblon-1);
-	double lat =   (south-north)/(nblat-1);
+	double lon = (east - west) / (nblon - 1);
+	double lat = (south - north) / (nblat - 1);
+
+	MagLog::dev() << "calcul -->" << lon << " (from->" << west << " to-->"
+			<< west + (nblon - 1) * lon << ")" << endl;
 
-	MagLog::dev() << "calcul -->" << lon << " (from->" << west << " to-->" << west + (nblon-1) *lon << ")" <<  endl;
-    
 	double y = north;
-    	for (int i = 0; i < nblat; i++)
-    	{
-    	    
-    		helper->rowsAxis().push_back(y);
-    		y  = north + (i+1)*lat;
-    		
-    	}
-    	
-   
-   
-
-   
+	for (int i = 0; i < nblat; i++) {
+
+		helper->rowsAxis().push_back(y);
+		y = north + (i + 1) * lat;
+
+	}
+
 	double x = west;
-  	for (int i = 0; i < nblon; i++)
-  	{
-  	    
-  		helper->columnsAxis().push_back(x);
-  		x  = west + (i+1)*lon;
-  		
-  	}
-  
-	helper->setMapsAxis();
+	for (int i = 0; i < nblon; i++) {
 
+		helper->columnsAxis().push_back(x);
+		x = west + (i + 1) * lon;
 
-	try { 
+	}
+
+	helper->setMapsAxis();
+
+	try {
 		helper->resize(nb);
 		size_t aux = size_t(nb);
-		grib_get_double_array(grib.id(),"values", &helper->front(),&aux); 
-	} 
-	catch (...) 
-	{
+		grib_get_double_array(grib.id(), "values", &helper->front(), &aux);
+	} catch (...) {
 		throw MagicsException("Not enough memory");
 	}
-   
-  
-	
 
-
-	lon = west; 
-	lat = north; 
-	double steplon = (east-west)/(nblon-1);
-	double steplat = (south-north)/(nblat-1);
+	lon = west;
+	lat = north;
+	double steplon = (east - west) / (nblon - 1);
+	double steplat = (south - north) / (nblat - 1);
 
 	// Fisrt try to find the bounding box 
-	vector<double>  rows;
+	vector<double> rows;
 	rows.reserve(nb);
-	vector<double>  columns;
+	vector<double> columns;
 	columns.reserve(nb);
-	vector<double>  values;
+	vector<double> values;
 	values.reserve(nb);
 
-	for ( int j = 0; j < nblat; j++ )
-	{
+	for (int j = 0; j < nblat; j++) {
 		lon = west;
-		
-		for ( int i = 0; i < nblon; i++ )
-		{
-			std::pair<double, double> point = unrotate(lat,lon);
-			
-			
-			
 
-			rows.push_back(point.first);   
+		for (int i = 0; i < nblon; i++) {
+			std::pair<double, double> point = unrotate(lat, lon);
+
+			rows.push_back(point.first);
 			columns.push_back(point.second);
-			
+
 			lon += steplon;
 		}
 		lat += steplat;
@@ -1194,352 +1311,436 @@ void GribRotatedInterpretor::interpretAsMatrix(const GribDecoder& grib, Matrix**
 	double maxx = *std::max_element(columns.begin(), columns.end());
 	double miny = *std::min_element(rows.begin(), rows.end());
 	double maxy = *std::max_element(rows.begin(), rows.end());
-	
-	
-	
 
-	double stepx = (maxx - minx)/(nblon-1);
-	double stepy = (maxy - miny)/(nblat-1);
+	double stepx = (maxx - minx) / (nblon - 1);
+	double stepy = (maxy - miny) / (nblat - 1);
 	x = minx;
 	y = miny;
 	// Create the Axis for Regular Matrix..
-	for ( int i = 0; i < nblon; i++)
-	{
-		(*matrix)->columnsAxis().push_back(x); 
+	for (int i = 0; i < nblon; i++) {
+		(*matrix)->columnsAxis().push_back(x);
 		x += stepx;
 	}
-	for ( int j = 0; j < nblat; j++)
-	{
-		(*matrix)->rowsAxis().push_back(y); 
-		y +=  stepy;
+	for (int j = 0; j < nblat; j++) {
+		(*matrix)->rowsAxis().push_back(y);
+		y += stepy;
 	}
 
 	miny = std::min(north, south);
 	maxy = std::max(north, south);
 	minx = std::min(west, east);
 	maxx = std::max(west, east);
-	
+
 	(*matrix)->setMapsAxis();
-	for ( int j = 0; j < nblat; j++)
-	{
-		for ( int i = 0; i < nblon; i++)
-		{
-			
-		    pair<double, double> point = rotate( (*matrix)->row(j, i), (*matrix)->column(j, i) );
-		    if ( point.first >  miny && point.first < maxy && point.second > minx && point.second < maxx )		    {	
-		    	(*matrix)->push_back(helper->interpolate(point.first, point.second));
-		    	
-		    }
-		    else {
-		    	(*matrix)->push_back(missing);
-		    	
-		    }
+	for (int j = 0; j < nblat; j++) {
+		for (int i = 0; i < nblon; i++) {
+
+			pair<double, double> point = rotate((*matrix)->row(j, i),
+					(*matrix)->column(j, i));
+			if (point.first > miny && point.first < maxy && point.second > minx
+					&& point.second < maxx) {
+				(*matrix)->push_back(
+						helper->interpolate(point.first, point.second));
+
+			} else {
+				(*matrix)->push_back(missing);
+
+			}
 		}
 	}
 }
 
-
-void GribRotatedInterpretor::interpret2D(double& lat, double& lon, double& uc, double& vc) const
-{
-	if ( !uvRelativeToGrid_ )
+void GribRotatedInterpretor::interpret2D(double& lat, double& lon, double& uc,
+		double& vc) const {
+	if (!uvRelativeToGrid_)
 		return;
 	double speed = sqrt((uc * uc) + (vc * vc));
-	double angle = atan2(vc,uc);
+	double angle = atan2(vc, uc);
 
 	std::pair<double, double> pt = rotate(lat, lon);
 	std::pair<double, double> pv = unrotate(pt.first, pt.second + 1);
 
-	double rangle = atan2(pv.first - lat ,pv.second - lon) + angle;
+	double rangle = atan2(pv.first - lat, pv.second - lon) + angle;
 	//components.second *= f;
 	// we the angle and the spped we compute u/v...
 	uc = speed * cos(rangle);
 	vc = speed * sin(rangle);
 
-
 }
 
-void GribRotatedInterpretor::raw(const GribDecoder& grib, const Transformation& transformation, const string& key, vector<UserPoint>& points) const
-{
+void GribRotatedInterpretor::raw(const GribDecoder& grib,
+		const Transformation& transformation, const string& key,
+		map<double, map<double, CustomisedPoint*> >& points) const {
 	double factor, offset;
 	scaling(grib, factor, offset);
 	int err;
-	southPoleLat_  = grib.getDouble("latitudeOfSouthernPoleInDegrees");
-	southPoleLon_  = grib.getDouble("longitudeOfSouthernPoleInDegrees");
-	angle_  = grib.getDouble("angleOfRotationInDegrees") * 180.0/M_PI;;
-    grib_iterator* iter = grib_iterator_new(grib.handle(), 0,&err);
-    double missing = grib.getDouble("missingValue");
-
-
-    double lat, lon, value;
-        /* Loop on all the lat/lon/values. */
-    while(grib_iterator_next(iter,&lat,&lon,&value)) {
-
-      pair<double, double> coords = unrotate(lat, lon);
-      lat = coords.first;
-      lon = coords.second;
-      if (value != missing ) {
-    	  std::stack<UserPoint>   duplicates;
-    	  UserPoint geo(lon, lat);
-    	  value = (value*factor)+offset;
-    	  transformation.populate(lon, lat, value, points);
-
-
-      }
+	southPoleLat_ = grib.getDouble("latitudeOfSouthernPoleInDegrees");
+	southPoleLon_ = grib.getDouble("longitudeOfSouthernPoleInDegrees");
+	angle_ = grib.getDouble("angleOfRotationInDegrees") * 180.0 / M_PI;
+	;
+	grib_iterator* iter = grib_iterator_new(grib.handle(), 0, &err);
+	double missing = grib.getDouble("missingValue");
+
+	double lat, lon, value;
+	/* Loop on all the lat/lon/values. */
+	while (grib_iterator_next(iter, &lat, &lon, &value)) {
+
+		pair<double, double> coords = unrotate(lat, lon);
+		lat = coords.first;
+		lon = coords.second;
+		if (value != missing) {
+			/*
+			 std::stack<UserPoint>   duplicates;
+			 UserPoint geo(lon, lat);
+			 value = (value*factor)+offset;
+			 transformation.populate(lon, lat, value, points);
+			 */
 
-    }
+		}
 
-        /* At the end the iterator is deleted to free memory. */
-    grib_iterator_delete(iter);
+	}
 
+	/* At the end the iterator is deleted to free memory. */
+	grib_iterator_delete(iter);
 
 }
 
-void GribLambertInterpretor::interpretAsMatrix(const GribDecoder& grib, Matrix** matrix) const
-{
-	  long im = grib.getLong("numberOfPointsAlongXAxis");
-	  long jm = grib.getLong("numberOfPointsAlongYAxis");
-
-	  *matrix = new Matrix(im, jm);
-
-
-
-	  size_t nb;
-	  grib_get_size(grib.id(), "values", &nb);
-
-
-
-	  MagLog::dev() << "numberOfFieldValues[" << nb << "]" << "\n";
-	  double missing = -std::numeric_limits<double>::max();
-	  missing = grib.getDouble("missingValue");
-
-
-	  double north = grib.getDouble("latitudeOfFirstGridPointInDegrees");
-	  double west = grib.getDouble("longitudeOfFirstGridPointInDegrees");
+void GribLambertInterpretor::interpretAsMatrix(const GribDecoder& grib,
+		Matrix** matrix) const {
+	long im = grib.getLong("numberOfPointsAlongXAxis");
+	long jm = grib.getLong("numberOfPointsAlongYAxis");
 
-	  MagLog::dev() << "NewAPI---> area[" << west << ", " << north << "]" << "\n";
+	*matrix = new Matrix(im, jm);
 
+	size_t nb;
+	grib_get_size(grib.id(), "values", &nb);
 
+	MagLog::dev() << "numberOfFieldValues[" << nb << "]" << "\n";
+	double missing = -std::numeric_limits<double>::max();
+	missing = grib.getDouble("missingValue");
 
+	double north = grib.getDouble("latitudeOfFirstGridPointInDegrees");
+	double west = grib.getDouble("longitudeOfFirstGridPointInDegrees");
 
+	MagLog::dev() << "NewAPI---> area[" << west << ", " << north << "]" << "\n";
 
+	try {
+		Timer time("Grib", "lambert");
 
+		MagLog::debug() << "Version" << grib_get_api_version() << endl;
 
-      		try
-		{
-			Timer time("Grib", "lambert");
+		vector<double> latm;
+		vector<double> lonm;
+		vector<double> data;
+		latm.reserve(nb);
+		lonm.reserve(nb);
+		data.reserve(nb);
 
+		size_t aux = size_t(nb);
 
+		grib_get_double_array(grib.id(), "latitudes", &(latm.front()), &aux);
+
+		double minlat = *min_element(latm.begin(), latm.end());
+		double maxlat = *max_element(latm.begin(), latm.end());
+		;
+		grib_get_double_array(grib.id(), "longitudes", &(lonm.front()), &aux);
+
+		double minlon = *min_element(lonm.begin(), lonm.end());
+		double maxlon = *max_element(lonm.begin(), lonm.end());
+		;
+
+		// This test needs to be improved ...
+
+		if (minlon > 50.)
+			minlon -= 360;
+		if (maxlon > 50.)
+			maxlon -= 360;
+
+		grib_get_double_array(grib.id(), "values", &(data.front()), &aux);
+		double min = *min_element(data.begin(), data.end());
+		double max = *max_element(data.begin(), data.end());
+		;
+
+		for (int i = 0; i < nb; i++) {
+			if (lonm[i] > 50.)
+				lonm[i] = lonm[i] - 360;
+
+			if (minlat > latm[i])
+				minlat = latm[i];
+			if (maxlat < latm[i])
+				maxlat = latm[i];
+			if (minlon > lonm[i])
+				minlon = lonm[i];
+			if (maxlon < lonm[i])
+				maxlon = lonm[i];
+		}
 
+		MagLog::debug() << "lat [" << minlat << ", " << maxlat << "]"
+				<< std::endl;
+		MagLog::debug() << "lon [" << minlon << ", " << maxlon << "]"
+				<< std::endl;
 
-			MagLog::debug() << "Version" << 	grib_get_api_version()<< endl;
+		vector<double>& lon = (*matrix)->columnsAxis();
+		vector<double>& lat = (*matrix)->rowsAxis();
 
-            vector<double> latm;
-            vector<double> lonm;
-            vector<double> data;
-            latm.reserve(nb);
-            lonm.reserve(nb);
-            data.reserve(nb);
+		// for the lon we take the fisrt line :
+		double inci = (maxlon - minlon) / ((im) - 1);
+		double incj = (maxlat - minlat) / ((jm) - 1);
+		for (int i = 0; i < im; i++)
+			lon.push_back(minlon + (i * inci));
+		// for the lon we take the fisrt column :
+		for (int i = 0; i < jm; i++)
+			lat.push_back(minlat + (i * incj));
 
-			size_t aux = size_t(nb);
+		typedef map<double, map<double, pair<int, int> > > Helper;
 
-            grib_get_double_array(grib.id(),"latitudes",&(latm.front()),&aux);
+		//typedef map<double, double> Helper;
+		Helper helper;
+		int row = 0;
+		for (vector<double>::iterator y = lat.begin(); y != lat.end(); ++y) {
 
-            double minlat = *min_element(latm.begin(), latm.end());
-	         double maxlat =*max_element(latm.begin(), latm.end());;
-            grib_get_double_array(grib.id(),"longitudes",&(lonm.front()),&aux);
+			helper.insert(make_pair(*y, map<double, pair<int, int> >()));
 
-            double minlon = *min_element(lonm.begin(), lonm.end());
-	         double maxlon =*max_element(lonm.begin(), lonm.end());;
+			Helper::iterator h = helper.find(*y);
 
-             // This test needs to be improved ...
+			int column = 0;
+			for (vector<double>::iterator x = lon.begin(); x != lon.end();
+					++x) {
+				h->second.insert(make_pair(*x, std::make_pair(row, column)));
 
-             if (minlon > 50.) minlon -=360;
-             if (maxlon > 50.) maxlon -=360;
+				(*matrix)->push_back(missing);
+				column++;
 
+			}
+			row++;
+		}
 
-            grib_get_double_array(grib.id(),"values", &(data.front()),&aux);
-            double min = *min_element(data.begin(), data.end());
-	         double max =*max_element(data.begin(), data.end());;
+		int r = 0;
+		int c = 0;
+
+		double lat11, lat12, lat21, lat22;
+		double lon11, lon12, lon21, lon22;
+		double val11, val12, val21, val22;
+
+		for (int r = 0; r < jm - 1; r++) {
+			for (int c = 0; c < im - 1; c++) {
+
+				lat11 = latm[c + (im * r)];
+
+				lat12 = latm[(c + 1) + (im * r)];
+				minlat = std::min(lat11, lat12);
+				maxlat = std::max(lat11, lat12);
+				lat21 = latm[c + (im * (r + 1))];
+				minlat = std::min(minlat, lat21);
+				maxlat = std::max(maxlat, lat21);
+				lat22 = latm[(c + 1) + (im * (r + 1))];
+				minlat = std::min(minlat, lat22);
+				maxlat = std::max(maxlat, lat22);
+
+				lon11 = lonm[c + (im * r)];
+				lon12 = lonm[(c + 1) + (im * r)];
+				if (lon12 < lon11)
+					lon12 += 360.;
+				minlon = std::min(lon11, lon12);
+				maxlon = std::max(lon11, lon12);
+				lon21 = lonm[c + (im * (r + 1))];
+				minlon = std::min(minlon, lon21);
+				maxlon = std::max(maxlon, lon21);
+				lon22 = lonm[(c + 1) + (im * (r + 1))];
+				if (lon22 < lon21)
+					lon22 += 360.;
+				minlon = std::min(minlon, lon22);
+				maxlon = std::max(maxlon, lon22);
+
+				val11 = data[c + (im * r)];
+				val12 = data[(c + 1) + (im * r)];
+				val21 = data[c + (im * (r + 1))];
+				val22 = data[(c + 1) + (im * (r + 1))];
+
+				// find the points from the helper!
+				Helper::iterator low, up;
+				low = helper.lower_bound(minlat);
+				up = helper.lower_bound(maxlat);
+				if (low == helper.end() || up == helper.end())
+					break;
+				for (Helper::iterator it = low; it != up; ++it) {
+					if (it == helper.end())
+						break;
+					map<double, pair<int, int> >& lons = it->second;
+					map<double, pair<int, int> >::iterator llow =
+							lons.lower_bound(minlon);
+					map<double, pair<int, int> >::iterator lup =
+							lons.lower_bound(maxlon);
+					if (llow == lons.end() || lup == lons.end())
+						break;;
+					for (map<double, pair<int, int> >::iterator lit = llow;
+							lit != lup; ++lit) {
+
+						double lat = it->first;
+						double lon = lit->first;
+						std::pair<int, int> index = lit->second;
+
+						// we interpolate at the point using the 4 points found!
+						double val = missing;
+						if (val11 != missing && val12 != missing
+								&& val21 != missing && val22 != missing) {
+							double val1 = ((lon12 - lon) / (lon12 - lon11))
+									* val11
+									+ ((lon - lon11) / (lon12 - lon11)) * val12;
+
+							double val2 = ((lon22 - lon) / (lon22 - lon21))
+									* val21
+									+ ((lon - lon21) / (lon22 - lon21)) * val22;
+							if (isnan(val1)) {
+								if (isnan(val2)) {
+									val = missing;
+								} else
+									val = ((lat - lat11) / (lat22 - lat11))
+											* val2;
+							} else {
+								if (isnan(val2)) {
+									val = ((lat22 - lat) / (lat22 - lat11))
+											* val1;
+								} else {
+									val = ((lat22 - lat) / (lat22 - lat11))
+											* val1
+											+ ((lat - lat11) / (lat22 - lat11))
+													* val2;
+								}
+							}
 
-     for ( int i = 0; i < nb; i++) {
-     if (lonm[i] > 50.) lonm[i] = lonm[i] -360;
+							if (isnan(val) || isinf(val) || isinf(-val)) {
+								val = missing;
+							}
+						}
+						if (isnan(val))
+							val = missing;
+						if ((**matrix)[index.second + (index.first * im)]
+								== missing) {
+							(**matrix)[index.second + (index.first * im)] = val;
 
+						}
 
-        if ( minlat > latm[i] ) minlat=latm[i];
-        if ( maxlat < latm[i] ) maxlat=latm[i];
-        if ( minlon > lonm[i] ) minlon=lonm[i];
-        if ( maxlon < lonm[i] ) maxlon=lonm[i];
-    }
+					}
 
+				}
 
+			}
 
-        MagLog::debug() << "lat [" << minlat << ", " << maxlat << "]" << std::endl;
-		MagLog::debug()	<< "lon [" << minlon << ", " << maxlon << "]" << std::endl;
+			(*matrix)->setMapsAxis();
+			(*matrix)->missing(missing);
+		}
 
+		MagLog::dev() << **matrix << "\n";
 
+	}
 
+	catch (MagicsException& e) {
+		MagLog::error() << e << "\n";
+	}
 
+}
+void GribLambertInterpretor::print(ostream& out) const {
+	out << "GribLambertInterpretor[";
+	out << "]";
+}
 
-					vector<double>& lon = (*matrix)->columnsAxis();
-					vector<double>& lat = (*matrix)->rowsAxis();
 
-					// for the lon we take the fisrt line :
-					double inci = (maxlon - minlon)/((im) -1);
-					double incj = (maxlat - minlat)/((jm) -1);
-					for (int i = 0; i < im; i++)
-						lon.push_back(minlon + (i*inci));
-					// for the lon we take the fisrt column :
-					for (int i = 0; i < jm; i++)
-						lat.push_back(minlat + (i*incj));
 
-					typedef map<double, map<double, pair<int, int> > > Helper;
+PaperPoint GribLambertAzimutalInterpretor::reference(const GribDecoder&, const Transformation&)
+{
+	assert(false);
 
-					//typedef map<double, double> Helper;
-					Helper helper;
-					int row = 0;
-					for (vector<double>::iterator y = lat.begin(); y != lat.end(); ++y) {
+}
 
-						helper.insert(make_pair(*y, map<double, pair<int, int>  >()));
+void GribPolarStereoInterpretor::print(ostream& out) const {
+	out << "GribLambertInterpretor[";
+	out << "]";
+}
+void GribPolarStereoInterpretor::interpretAsMatrix(const GribDecoder& grib,
+		Matrix** matrix) const {
+	long im = 3600;
+	long jm = 1800;
+
+	*matrix = new Matrix(im, jm);
+	double steplon= 0.1;
+	double lon0 = 0 - (steplon/2);
+	double steplat= 0.1;
+	double lat0 = -90 - (steplat/2);
+
+	double missing =  grib.getDouble("missingValue");
+	for (int i = 0; i < im; i++) {
+		double x = 0 + (i*steplon);
+		(*matrix)->columnsAxis().push_back(x);
 
-						Helper::iterator h = helper.find(*y);
+	}
 
-						int column = 0;
-						for (vector<double>::iterator x = lon.begin(); x != lon.end(); ++x) {
-							h->second.insert(make_pair(*x, std::make_pair(row, column)));
+	for (int i = 0; i < jm; i++) {
+		double y = -90 + (i*steplat);
+		(*matrix)->rowsAxis().push_back(y);
 
-							(*matrix)->push_back(missing);
-							column++;
 
-						}
-						row++;
-					}
+	}
+	vector<double> distance(im*jm, 999999);
 
 
+	for (int i = 0; i < im; i++) {
+		for (int j = 0; j < jm; j++)
+		(**matrix)[i + (j * im)] = missing;
+	}
+	(*matrix)->missing(missing);
+	(*matrix)->setMapsAxis();
 
-					int r = 0;
-					int c = 0;
-
-					double lat11, lat12, lat21, lat22;
-					double lon11, lon12, lon21, lon22;
-					double val11, val12, val21, val22;
-
-					for (int r = 0; r < jm -1; r++) {
-						for (int c = 0;  c < im -1; c++) {
-
-							lat11 = latm[c + (im*r)];
-
-							lat12 = latm[(c+1) + (im*r)];
-							minlat = std::min(lat11, lat12);
-							maxlat = std::max(lat11, lat12);
-							lat21 = latm[c + (im* (r+1))];
-							minlat = std::min(minlat, lat21);
-							maxlat = std::max(maxlat, lat21);
-							lat22 = latm[(c+1) + (im* (r+1))];
-							minlat = std::min(minlat, lat22);
-							maxlat = std::max(maxlat, lat22);
-
-							lon11 = lonm[c + (im*r)];
-							lon12 = lonm[(c+1) + (im*r)];
-							if ( lon12 < lon11 )
-								lon12 +=360.;
-							minlon = std::min(lon11, lon12);
-							maxlon = std::max(lon11, lon12);
-							lon21 = lonm[c + (im* (r+1))];
-							minlon = std::min(minlon, lon21);
-							maxlon = std::max(maxlon, lon21);
-							lon22 = lonm[(c+1) + (im* (r+1))];
-							if ( lon22 < lon21 )
-									lon22 +=360.;
-							minlon = std::min(minlon, lon22);
-							maxlon = std::max(maxlon, lon22);
-
-							val11 = data[c + (im*r)];
-							val12 = data[(c+1) + (im*r)];
-							val21 = data[c + (im* (r+1))];
-							val22 = data[(c+1) + (im* (r+1))];
-
-
-
-							// find the points from the helper!
-							Helper::iterator low,up;
-							low = helper.lower_bound(minlat);
-							up = helper.lower_bound(maxlat);
-							if ( low == helper.end() || up == helper.end() )
-								break;
-							for (Helper::iterator it = low; it != up; ++it) {
-								if (it == helper.end()) break;
-								map<double, pair<int, int> >&  lons = it->second;
-								map<double, pair<int, int> >::iterator llow = lons.lower_bound(minlon);
-								map<double, pair<int, int> >::iterator lup = lons.lower_bound(maxlon);
-								if ( llow == lons.end() || lup == lons.end() )
-									break;;
-								for (map<double, pair<int, int> >::iterator lit = llow; lit != lup; ++lit) {
-
-									double lat = it->first;
-									double lon = lit->first;
-									std::pair<int, int> index = lit->second;
-
-									// we interpolate at the point using the 4 points found!
-									double val = missing;
-									if ( val11 != missing && val12 != missing && val21 != missing && val22 != missing) {
-										double val1 =  	((lon12 - lon )/(lon12-lon11))*val11 + ((lon - lon11)/(lon12-lon11))*val12;
-
-										double val2 =  	((lon22 - lon )/(lon22-lon21))*val21 + ((lon - lon21)/(lon22-lon21))*val22;
-										if ( isnan(val1) ) {
-											if ( isnan(val2) ) {
-												val = missing;
-											}
-											else
-												val = ((lat - lat11)/(lat22-lat11))*val2;
-										}
-										else {
-											if ( isnan(val2) ) {
-												val =  	((lat22 - lat )/(lat22-lat11))*val1;
-											}
-											else {
-												val =  	((lat22 - lat )/(lat22-lat11))*val1 + ((lat - lat11)/(lat22-lat11))*val2;
-											}
-										}
-
-										if (isnan(val) || isinf(val) || isinf(-val) ) {
-											val = missing;
-										}
-									}
-									if (isnan(val) ) val = missing;
-									if ( (**matrix)[index.second +( index.first*im)] == missing ) {
-										(**matrix)[index.second +( index.first*im)] = val;
-
-                                    }
+	interpolate(grib, **matrix);
 
-								}
 
+	MagLog::dev() << **matrix << "\n";
 
-							}
 
 
-					}
 
+}
 
-					 (*matrix)->setMapsAxis();
-                     (*matrix)->missing(missing);
-					}
+void GribInterpretor::interpolate(const GribDecoder& grib, Matrix& matrix) const
+{
+	int err;
 
+	grib_iterator* iter = grib_iterator_new(grib.handle(), 0, &err);
+	if ( err ) {
+		MagLog::warning() << "Grib Iterator not available : Chech Grib Api Version " << grib_get_api_version() << endl;
+		return;
+	}
+	double xres = matrix.XResolution();
+	double yres = matrix.YResolution();
+
+	double xbase = matrix.left() - (xres/2);
+	double ybase = matrix.bottom() - (yres/2);
+	double columns = matrix.columns();
+	double rows = matrix.rows();
+
+	vector<double> distance(columns*rows, 999999);
+
+	double lat, lon, value;
+	/* Loop on all the lat/lon/values. */
+	while (grib_iterator_next(iter, &lat, &lon, &value)) {
+		int ix =  (lon - xbase )/xres;
+		double x = (ix * xres) + xbase;
+		int iy =  (lat - ybase )/yres;
+		double y = (iy * yres) + ybase;
+		double dist = ((lon - x)*(lon - x)) + ((lat - y)*(lat - y));
+		if ( dist < distance[ix + (iy * columns)] ) {
+			matrix[ix + (iy * columns)] = value;
+			distance[ix + (iy * columns)]= dist;
+		}
+	}
+	/* At the end the iterator is deleted to free memory. */
+	grib_iterator_delete(iter);
 
 
 
 
-			MagLog::dev() << **matrix << "\n";
 
-		}
 
-		catch (MagicsException& e)
-		{
-			MagLog::error() << e << "\n";
-		}
 
 }
-void GribLambertInterpretor::print(ostream& out)  const
-{
-	out << "GribLambertInterpretor[";
-	out << "]";
-}
+
diff --git a/src/decoders/GribRegularInterpretor.h b/src/decoders/GribRegularInterpretor.h
index 1b3030b..0a369af 100644
--- a/src/decoders/GribRegularInterpretor.h
+++ b/src/decoders/GribRegularInterpretor.h
@@ -44,7 +44,6 @@ public:
 	
 	void interpretAsMatrix(const GribDecoder&, Matrix**) 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;
     virtual void latitudes(const GribDecoder&, vector<double>&) const;
@@ -77,7 +76,6 @@ public:
 	void interpretAsMatrix(const GribDecoder&, Matrix**, const Transformation&) const; 
 	void interpretAsRaster(const GribDecoder&, RasterData&, const Transformation&) const;
 	
-	
 protected:
      //! Method to print string about this class on to a stream of type ostream (virtual).
 	 virtual void print(ostream&) const; 
@@ -100,7 +98,7 @@ class GribReducedLatLonInterpretor: public GribInterpretor {
 public:
 	GribReducedLatLonInterpretor() {}
 	virtual ~GribReducedLatLonInterpretor() {}
-	
+
 	void interpretAsMatrix(const GribDecoder&, Matrix**) const; 
 	virtual double XResolution(const GribDecoder& grib) const;
 	
@@ -129,12 +127,11 @@ public:
 	
 	std::pair<double, double> unrotate(double lat, double lon) const;
 	std::pair<double, double> rotate(double lat, double lon) const;
-
-	void raw(const GribDecoder&, const Transformation&, const string&, vector<UserPoint>&) const;
+	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 interpret2D(double&, double&, double&, double&) const;
-
 protected:
      //! Method to print string about this class on to a stream of type ostream (virtual).
 	 virtual void print(ostream&) const; 
@@ -154,7 +151,7 @@ public:
 	
 	UserPoint unrotate(double lat, double lon) const;
 	void interpretAsMatrix(const GribDecoder&, Matrix**) const; 
-	
+	PaperPoint reference(const GribDecoder&, const Transformation&);
 protected:
      //! Method to print string about this class on to a stream of type ostream (virtual).
 	 virtual void print(ostream&) const; 
@@ -182,6 +179,22 @@ protected:
 };
 
 
+class GribPolarStereoInterpretor: public GribRegularInterpretor {
+
+public:
+	GribPolarStereoInterpretor() {}
+	virtual ~GribPolarStereoInterpretor() {}
+
+
+	void interpretAsMatrix(const GribDecoder&, Matrix**) const;
+
+protected:
+     //! Method to print string about this class on to a stream of type ostream (virtual).
+	 virtual void print(ostream&) const;
+
+
+
+};
 
 
 class GribRegularGaussianInterpretor: public GribRegularInterpretor 
diff --git a/src/decoders/GribSatelliteInterpretor.cc b/src/decoders/GribSatelliteInterpretor.cc
index b8cb590..4f60d40 100644
--- a/src/decoders/GribSatelliteInterpretor.cc
+++ b/src/decoders/GribSatelliteInterpretor.cc
@@ -31,9 +31,216 @@
 #include "GribDecoder.h"
 #include "RasterData.h"
 #include "TeProjection.h"
+#include "TeDataTypes.h"
+#include "TeRasterParams.h"
+#include "TeDecoderMemory.h"
+#include "TeRasterRemap.h"
+#include "GeoRectangularProjection.h"
 
 using namespace magics;
 
+
+////////////////////////////
+
+/* parameters used in the routines as given in Ref. [1] */
+//const double  PI         =     3.14159265359;
+const double  SAT_HEIGHT = 42164.0;       /* distance from Earth centre to satellite     */
+const double  R_EQ       =  6378.169;     /* radius from Earth centre to equator         */
+const double  R_POL      =  6356.5838;    /* radius from Earth centre to pol             */
+//const double  SUB_LON    =     0.0;       /* longitude of sub-satellite point in radiant */
+
+//const double  CFAC_NONHRV  =  -781648343;      /* scaling coefficients (see note above)  */
+//const double  LFAC_NONHRV  =  -781648343;      /* scaling coefficients (see note above)  */
+
+//const double  CFAC_HRV     =   -2344945030.;   /* scaling coefficients (see note above)  */
+//const double  LFAC_HRV     =   -2344945030.;   /* scaling coefficients (see note above)  */
+
+
+const long    COFF_NONHRV  =        1856;      /* scaling coefficients (see note above)  */
+const long    LOFF_NONHRV  =        1856;      /* scaling coefficients (see note above)  */
+
+const long    COFF_HRV     =        5566;      /* scaling coefficients (see note above)  */
+const long    LOFF_HRV     =        5566;      /* scaling coefficients (see note above)  */
+				       
+
+//////////////////////////////////////////////////////////////////////////
+
+#include<stdio.h>
+#include<stdlib.h>
+#include<math.h>
+
+
+/* this function returns the nearest integer to the value val */
+/* and is used in function geocoord2pixcoord */
+
+int nint(double val){
+
+  double a=0.0; /* integral  part of val */
+  double b=0.0; /* frational part of val */
+
+  b = modf(val,&a);
+  
+  if ( b > 0.5 ){
+    val = ceil(val);
+  } 
+  else{
+    val = floor(val);
+  }
+
+  return (int)val;
+
+}
+
+/**************************************************************
+ * function geocoord2pixcoord                                 *
+ *                                                            *
+ * PURPOSE:                                                   *
+ *   return the pixel column and line of an MSG image         *
+ *   for a given pair of latitude/longitude.                  *
+ *   (based on the formulas given in Ref. [1])                *
+ *                                                            *
+ *                                                            *
+ * DEPENDENCIES:                                              *
+ *   none                                                     * 
+ *                                                            *
+ *                                                            *
+ * REFERENCE:                                                 *
+ * [1] LRIT/HRIT Global Specification                         * 
+ *     (CGMS 03, Issue 2.6, 12.08.1999)                       *
+ *     for the parameters used in the program                 *
+ * [2] MSG Ground Segment LRIT/HRIT Mission Specific          *
+ *     Implementation, EUMETSAT Document,                     *
+ *     (EUM/MSG/SPE/057, Issue 6, 21. June 2006).             *
+ *                                                            *
+ *                                                            *
+ * MODIFICATION HISTORY:                                      *
+ *   Version 1.02                                             *
+ *  30.11.2011 added HRV to the calculation                   *
+ *             Implemented with introducing CFAC/LFAC in      *
+ *             function call                                  *
+ *   Copyright(c) EUMETSAT 2005, 2009, 2011                   *
+ *                                                            *
+ *   Updated by ECMWF (31.10.2014) to take sublon as a        *
+ *   parameter                                                *
+ *                                                            *
+ * INPUT:                                                     *
+ *   latitude  (double) geographic Latitude of a point        *
+ *                      [Degrees]                             *
+ *   longitude (double) geographic Longitude of a point       *
+ *                      [Degrees]                             *
+ *   coff (int)   coefficient of the scalling function        *
+ *                (see page 28, Ref [1])                      *
+ *   loff (int)   coefficient of the scalling function        *
+ *                (see page 28, Ref [1])                      *
+ *   cfac  (real) image "spread" in the EW direction          *
+ *   lfac  (real) image "spread" in the NS direction          *
+ *   sublon (real) longitude of the sub-latitude point        *
+ *                                                            *
+ *                                                            *
+ * OUTPUT:                                                    *
+ *   row    (int) row-value of the wanted pixel               *
+ *   column (int) column-value of the wanted pixel            *
+ *                                                            *
+ *************************************************************/
+
+int geocoord2pixcoord(double latitude, double longitude, int coff, int loff,
+		      double cfac, double lfac, double sublon,
+		      int *column, int *row){
+
+  int ccc=0, lll=0;
+
+  double lati=0.0, longi=0.0;
+  double c_lat=0.0;
+  double lat=0.0;
+  double lon=0.0;
+  double r1=0.0, r2=0.0, r3=0.0, rn=0.0, re=0.0, rl=0.0;
+  double xx=0.0, yy=0.0;
+  double cc=0.0, ll=0.0; 
+  double dotprod=0.0;
+
+  lati= latitude;
+  longi= longitude;
+
+  /* check if the values are sane, otherwise return error values */
+  if (lati < -90.0 || lati > 90.0 || longi < -180.0 || longi > 180.0 ){ 
+    *row = -999;
+    *column = -999;
+    return (-1);
+  }
+
+
+  /* convert them to radiants */
+  lat = lati*PI / (double)180.;
+  lon = longi *PI / (double)180.;
+    
+  /* calculate the geocentric latitude from the          */
+  /* geograhpic one using equations on page 24, Ref. [1] */
+
+  c_lat = atan ( ((double)0.993243*(sin(lat)/cos(lat)) ));
+      
+
+  /* using c_lat calculate the length form the Earth */
+  /* centre to the surface of the Earth ellipsoid    */
+  /* equations on page 23, Ref. [1]                  */
+  
+  re = R_POL / sqrt( ((double)1.0 - (double)0.00675701 * cos(c_lat) * cos(c_lat) ) );
+
+
+  /* calculate the forward projection using equations on */
+  /* page 24, Ref. [1]                                        */
+
+  rl = re; 
+  r1 = SAT_HEIGHT - rl * cos(c_lat) * cos(lon - sublon);
+  r2 = - rl *  cos(c_lat) * sin(lon - sublon);
+  r3 = rl * sin(c_lat);
+  rn = sqrt( r1*r1 + r2*r2 +r3*r3 );
+  
+  
+  /* check for visibility, whether the point on the Earth given by the */
+  /* latitude/longitude pair is visible from the satellte or not. This */ 
+  /* is given by the dot product between the vectors of:               */
+  /* 1) the point to the spacecraft,			               */
+  /* 2) the point to the centre of the Earth.			       */
+  /* If the dot product is positive the point is visible otherwise it  */
+  /* is invisible.						       */
+     
+  dotprod = r1*(rl * cos(c_lat) * cos(lon - sublon)) - r2*r2 - r3*r3*(pow((R_EQ/R_POL),2));
+     
+  if (dotprod <= 0 ){
+    *column = -999;
+    *row = -999;
+    return (-1);
+  }
+  
+
+  /* the forward projection is x and y */
+
+  xx = atan( (-r2/r1) );
+  yy = asin( (-r3/rn) );
+
+
+  /* convert to pixel column and row using the scaling functions on */
+  /* page 28, Ref. [1]. And finding nearest integer value for them. */
+
+
+  cc = coff + xx *  pow(2,-16) * cfac ;
+  ll = loff + yy *  pow(2,-16) * lfac ;
+
+
+  ccc=nint(cc);
+  lll=nint(ll);		
+
+  *column = ccc;
+  *row = lll;
+
+      
+  return (0);
+
+}
+
+
+
+
 GribSatelliteInterpretor::GribSatelliteInterpretor() 
 {
 }
@@ -43,6 +250,44 @@ GribSatelliteInterpretor::~GribSatelliteInterpretor()
 {
 }
 
+
+/*
+	GribSatelliteInterpretor::AdjustBadlyEncodedGribs
+	Correct the information provided in the headers of certain satellite imagery that
+	we have available. This is a very specific function.
+*/
+void GribSatelliteInterpretor::AdjustBadlyEncodedGribs(int satId, int chanId, long &nx, long &ny, long &dx, long &dy, double &xp, double &yp, double &slon, long &functionCode) const
+{
+	if (satId == 172 && slon == 140.0) // MTSAT-2, pre-2015 data
+	{
+		dx = dy = 888;
+		xp = yp = nx/2;
+		slon = 145.0;
+	}
+	else if (satId == 54 && chanId == 2 && dx == 1179)  // Meteosat 7, channel 2
+	{
+		nx = ny = 900;
+		dx = dy = 853;  // obtained through trial-and-error to get the best match with the coastlines
+		xp = yp = 450;
+		functionCode = 1;  // wrongly encoded as 0
+	}
+	else if (satId == 54 && chanId == 3 && dx == 1179)  // Meteosat 7, channel 3
+	{
+		dx = dy = 1184;  // obtained through trial-and-error to get the best match with the coastlines
+		xp = yp = 635;
+	}
+	else if (satId == 259 && chanId == 4 && dx == 1185)  // GOES-15 (West) channel 4
+	{
+		dx = dy = 880;  // obtained through trial-and-error to get the best match with the coastlines
+		xp = yp = 450;
+	}
+	else if (satId == 57 && dx == 1732)  // MSG (Meteosat second generation), non-HRV channels
+	{
+		dx = dy = 1811;  // obtained through trial-and-error to get the best match with the coastlines
+		xp = yp = 928;
+	}
+}
+
 /*!
  Class information are given to the output-stream.
 */		
@@ -51,82 +296,165 @@ void GribSatelliteInterpretor::print(ostream& out)  const
      out << "GribSatelliteInterpretor[";
      out << "]";
 }
+void GribSatelliteInterpretor::interpretAsMatrix(const GribDecoder& grib, Matrix** matrix) const
+{
+	Timer timer("gribapi", " reproject satellite");
+	MagLog::dev() << "GribRegularInterpretor::interpretAsMatrix" << "\n";
 
+	double altitude = grib.getDouble("NrInRadiusOfEarth");
+	if ( !altitude ) altitude =  6610839.;
+		altitude *= 0.000001;
+	long   nx   = grib.getLong("numberOfPointsAlongXAxis");
+	long   ny   = grib.getLong("numberOfPointsAlongYAxis");
+	long   dx   = grib.getLong("dx");
+	long   dy   = grib.getLong("dy");
+	double offx = grib.getDouble("xCoordinateOfOriginOfSectorImage");
+	double offy = grib.getDouble("yCoordinateOfOriginOfSectorImage");
+	double prj  = 2*asin(1/altitude)/dx;
+	double pri  = 2*asin(1/altitude)/dy;
+	double pjs  = grib.getDouble("XpInGridLengths");
+	double pis  = grib.getDouble("YpInGridLengths");
 
-void GribSatelliteInterpretor::interpretAsRaster(const GribDecoder& grib, RasterData& raster,const Transformation&) const
-{
-     MagLog::dev() << "GribSatelliteInterpretor::interpretAsRaster" << "\n";
-/*
-     \param datum:    planimetric datum
-     \param offx:     x offset
-     \param offy:     y offset
-     \param Pri:      Sensor angle resolution along y axis in radians
-     \param Prj:      Sensor angle resolution along x axis in radians
-     \param Pis:      Y-coordinate of sub-satellite point 
-     \param Pjs:      X-coordinate of sub-satellite point
-     \param Pla0:     Latitude of sub-satellite point in radians
-     \param Plo0:     Longitude of sub-satellite point in radians
-     \param Prs:      Radius of satellite orbit in meters
-     \param Pscn:     Scanning mode: 0-WE/NS, 1-SN/EW
-     \param Pyaw:     Grid orientation, i.e., angle in radians between
-			 the increasing y axis and the meridian of the
-			 sub-satellite point along the direction of
-			 increasing latitude.
-*/
-     double altitude = grib.getDouble("NrInRadiusOfEarth") * 0.000001;
-     long   nx   = grib.getLong("numberOfPointsAlongXAxis");
-     long   ny   = grib.getLong("numberOfPointsAlongYAxis");
-     double offx = grib.getDouble("xCoordinateOfOriginOfSectorImage");
-     double offy = grib.getDouble("yCoordinateOfOriginOfSectorImage");
-     double prj  = 2*asin(1/altitude)/grib.getDouble("dx");
-     double pri  = 2*asin(1/altitude)/grib.getDouble("dy");
-     double pjs  = grib.getDouble("XpInGridLengths");
-     double pis  = grib.getDouble("YpInGridLengths");
-     double lao  = grib.getDouble("latitudeOfSubSatellitePointInDegrees") *TeCDR;
-     double lono = grib.getDouble("longitudeOfSubSatellitePointInDegrees")*TeCDR;
-     double prs  = altitude * TeEARTHRADIUS;
-     double scn  = 0; // scanning mode later! 
-     double yaw  = grib.getDouble("orientationOfTheGrid");
-
-     yaw = RAD(yaw/1000);
-     if (yaw < 0.) yaw += PI;
-     else          yaw -= PI; 
-
-     TeSatelliteProjection* projection = new TeSatelliteProjection(TeDatum(), offx, offy, pri, prj, pis, pjs, lao, lono, prs, scn, yaw);
-
-     double resx = (double)( atan( tan(pri) * (altitude-1.) ) * TeEARTHRADIUS );
-     double resy = (double)( atan( tan(prj) * (altitude-1.) ) * TeEARTHRADIUS );
-
-     double west  = offx * resx;
-     double east  = (offx + nx - 1) * resx;
-     double north = -(offy * resy);
-     double south = -(offy + ny - 1) * resy;
-
-     raster.setXResolution(resx);
-     raster.setYResolution(resy);
-     raster.setColumns(nx);
-     raster.setRows(ny);
-     raster.setUpperRightCorner(east, north);
-     raster.setLowerLeftCorner(west, south);
-     raster.setProjection(projection);
-
-     size_t nb=0;
-     grib_get_size(grib.id(), "values", &nb);
-     raster.reserve(nb);
-
-     // If value is temperature in degrees K then add 145 to pixel value
-     double offset = (grib.getLong("functionCode") == 1) ? 145. : 0.;
-     
-    grib_get_double_array(grib.id(),"values",&raster.front(),&nb);
-    
-     if (offset) { 
-    	 for (unsigned int i = 0; i < nb; i++) {
-    		 	raster[i] +=offset;
-    	       
-    	 }
-     }
-     
+
+	double lao  = grib.getDouble("latitudeOfSubSatellitePointInDegrees") *TeCDR;
+	double slon = grib.getDouble("longitudeOfSubSatellitePointInDegrees");
+	long   sat  = grib.getLong("satelliteIdentifier");
+	long   chan = grib.getLong("channelNumber");
+	long   functionCode = grib.getLong("functionCode");
+
+	// correct bad GRIB headers that we know exist
+	AdjustBadlyEncodedGribs(sat, chan, nx, ny, dx, dy, pjs, pis, slon, functionCode);
+
+	double lono = slon*TeCDR;
+	double prs  = altitude * TeEARTHRADIUS;
+	double scn  = 0;
+	double yaw  = grib.getDouble("orientationOfTheGrid");
+	double target_dx = 0.1;  // resolution, in degrees of output lat/lon matrix
+	double target_dy = 0.1;  // resolution, in degrees of output lat/lon matrix
+
+	yaw = RAD(yaw/1000);
+	if (yaw < 0.) yaw += PI;
+	else		  yaw -= PI;
+
+//	double resx = (double)(abs(( atan( tan(pri) * (altitude-1.) ) * TeEARTHRADIUS )));
+//	double resy = (double)(abs(( atan( tan(prj) * (altitude-1.) ) * TeEARTHRADIUS )));
+	double resx = (double)(abs(( atan( tan(pri) * (altitude-1.) ))));
+	double resy = (double)(abs(( atan( tan(prj) * (altitude-1.) ))));
+
+//	double west  = slon - 90 + (offx * resx);
+//	double east  = slon + 90 + ((offx + nx - 1) * resx);
+//	double north = -(offy * resy);
+//	double south = -(offy + ny - 1) * resy;
+
+	double west  = -180;
+	double east  = 180;
+	double north = 90;
+	double south = -90;
+
+	long hasBitmap = grib.getLong("bitmapPresent");
+	double missingValue = 65535;
+	if (hasBitmap)
+			grib_set_double(grib.id(),"missingValue", missingValue);
+
+		// get the array of values
+	size_t nb=0;
+	grib_get_size(grib.id(), "values", &nb);
+	vector<double> raster(nb);
+	grib_get_double_array(grib.id(),"values",&raster.front(),&nb);
+
+
+	// If value is temperature in degrees K then add 145 to pixel value
+	double offset = (functionCode == 1) ? 145. : 0.;
+
+	if (offset) {
+		for (unsigned int i = 0; i < nb; i++) {
+			if (!hasBitmap || raster[i]!=missingValue)  // if not missing value
+				raster[i] +=offset;
+		}
+	}
+
+
+
+	long nblon = ((east - west) / target_dx);// + 1;
+	long nblat = ((north - south) / target_dy);// + 1;
+
+	if ( *matrix == 0 ) *matrix = new Matrix(nblat, nblon);
+
+
+	double missing = INT_MAX;
+	grib.setDouble("missingValue", missing);
+	(*matrix)->missing(missing);
+
+
+	MagLog::dev() << "NewAPI---> area[" << west << ", " << north << ", " << east << ", " << south << "]" << "\n";
+
+	double dlon = (east-west)/(nblon-1);
+	double dlat = (south-north)/(nblat-1);
+
+	MagLog::dev() << "calcul -->" << dlon << " (from->" << west << " to-->" << west + (nblon-1) *dlon << ")" <<  endl;
+
+	double x = west;
+	for (int i = 1; i <= nblon; i++)
+	{
+
+		(*matrix)->columnsAxis().push_back(x);
+		x  = west + (i*dlon);
+	}
+
+	double y = north;
+	for (int i = 1; i <= nblat; i++)
+	{
+
+		(*matrix)->rowsAxis().push_back(y);
+		y  = north + (i*dlat);
+	}
+	(*matrix)->setMapsAxis();
+
+
+
+	// coff, loff, cfac and lfac are 'normalised' on the NONHRV resolution of MSG images
+	double coff, loff, cfac, lfac;
+	double scale = (double)ny / (double)3711;
+
+
+	coff = COFF_NONHRV * scale;
+	loff = LOFF_NONHRV * scale;
+
+	double rx = 2 * asin(1.0/altitude) / dx;
+	cfac = (-65536.0 / (rx));
+	lfac = cfac;
+
+
+	int k = 0;
+
+	for (int j=0;j < nblat;j++) {
+		for (int i=0;i < nblon;i++) {
+			double val;
+			int srcCol, srcRow;
+			double lat = south - j*dlat;
+			double lon = east  - i*dlon;
+
+			geocoord2pixcoord(lat,
+							lon,
+							coff, loff,
+							cfac, lfac,
+							-lono,  // sub-satellite longitude in radians; unclear why we have to negate it
+							&srcCol, &srcRow);
+
+			if (srcCol == -999 || srcRow == -999)
+				val = 65535;
+			else
+				val = raster[srcRow*nx + srcCol];
+
+			(**matrix)[k++] = val;
+		}
+	}
+
+
+	(*matrix)->missing(missingValue);
 
 }
 
+
+
 static SimpleObjectMaker<GribSatelliteInterpretor, GribInterpretor> gribsatellite("90");
diff --git a/src/decoders/GribSatelliteInterpretor.h b/src/decoders/GribSatelliteInterpretor.h
index ee42aa6..efac8c0 100644
--- a/src/decoders/GribSatelliteInterpretor.h
+++ b/src/decoders/GribSatelliteInterpretor.h
@@ -42,11 +42,10 @@ public:
 	GribSatelliteInterpretor();
 	virtual ~GribSatelliteInterpretor();
 	
-	virtual void interpretAsRaster(const GribDecoder&, RasterData&, const Transformation&) const;
+//	virtual void interpretAsRaster(const GribDecoder&, RasterData&, const Transformation&) const;
     virtual void interpretAsVectors(const GribDecoder&, Matrix&, Matrix&) const 
     	{ throw  NotYetImplemented("Satellite representation", " Vectors"); }
-    virtual void interpretAsMatrix(const GribDecoder&, Matrix&) const 
-    	{ throw  NotYetImplemented("Satellite representation", " Matrix "); }
+    virtual void interpretAsMatrix(const GribDecoder&, Matrix**) const;
 
 	
 
@@ -58,7 +57,8 @@ private:
     //! Copy constructor - No copy allowed
 	GribSatelliteInterpretor(const GribSatelliteInterpretor&);
     //! Overloaded << operator to copy - No copy allowed
-	GribSatelliteInterpretor& operator=(const GribSatelliteInterpretor&);
+    void AdjustBadlyEncodedGribs(int satId, int chanId, long &nx, long &ny, long &dx, long &dy, double &xp, double &yp, double &slon, long &functionCode) const;
+
 
 // -- Friends
     //! Overloaded << operator to call print().
diff --git a/src/decoders/InputData.cc b/src/decoders/InputData.cc
index 3836149..008df3d 100644
--- a/src/decoders/InputData.cc
+++ b/src/decoders/InputData.cc
@@ -259,7 +259,11 @@ MatrixHandler& InputData::matrix()
 {
 	if  ( !matrix_ ) {
 		prepare();
-		matrix_ = (*binning_)(*this);
+		if (binning_) {
+			matrix_ = (*binning_)(*this);
+        }
+		else if ( input_binning_.get() )
+			matrix_ = (*input_binning_)(*this);
 	}
 
 	matrixHandlers_.push_back(new MatrixHandler(*matrix_));
diff --git a/src/decoders/LocalTable.cc b/src/decoders/LocalTable.cc
index 0154f63..6558de7 100644
--- a/src/decoders/LocalTable.cc
+++ b/src/decoders/LocalTable.cc
@@ -26,6 +26,7 @@
     Changes:
     
 */
+#include <fstream>
 #include "LocalTable.h"
 #include "MagException.h"
 #include "expat.h"
diff --git a/src/decoders/Netcdf.cc b/src/decoders/Netcdf.cc
index 5a5ec51..7aa9479 100644
--- a/src/decoders/Netcdf.cc
+++ b/src/decoders/Netcdf.cc
@@ -24,6 +24,7 @@
  
    Apr 06: update for GCC 4.0 (Stephan) 
 */
+#include <algorithm>
 #include <Netcdf.h>
 #include <MagException.h>
 #include <MagLog.h>
@@ -62,8 +63,6 @@ void TypedAccessor<F,T>::operator() (vector<T>& to, vector<long>& start, vector<
 	// Convert the data....       
 	std::transform(from, from + to.size(), to.begin(), Convertor<F, T>(var));
 	delete[] from;
-	
-	
 }
 
 template <class F, class T> 
@@ -83,7 +82,6 @@ Netcdf::Netcdf(const string& path, const string& method) : file_(path.c_str())
 		NcVar* var = file_.get_var(v); 
 		variables_.insert(std::make_pair(var->name(), NetVariable(var->name(), var, file_, method)));
 
-
 		if (isVariable(var)) dataset_.insert(std::make_pair(var->name(), NetVariable(var->name(), var, file_, method)));
 	}
 	MagLog::debug() << "Initialisation of  Netcdf [" << path << "] OK! " << "\n";  
@@ -103,6 +101,13 @@ Netcdf::Netcdf(const string& path, const string& method) : file_(path.c_str())
 Netcdf::~Netcdf() 
 {	
 }
+double Netcdf::getMissing(const string& var, const string& attr)
+{
+
+	double missing = getAttribute(attr, getDefaultMissing(var));
+	missing = getVariableAttribute(var, attr, missing);
+	return missing;
+}
 
 void Netcdf::print(ostream& out)  const
 {
@@ -161,6 +166,7 @@ struct FloatIndex: public Index
 		throw MagicsException("No such value : " + val);
 	}
 };
+
 struct DoubleIndex: public Index
 {
 	DoubleIndex() : Index(ncDouble) {}
@@ -251,7 +257,7 @@ int  NetDimension::value(const string& val)
 void NetDimension::first(const string& val)
 {
 
-	first_ = (method_ == "value") ? value(val) : index(val);
+	first_ = ( magCompare(method_, "value") ) ? value(val) : index(val);
 
 }
 
@@ -259,7 +265,7 @@ void NetDimension::first(const string& val)
 void NetDimension::last(const string& val)
 {
 
-	int last =  (method_ == "value") ? value(val) : index(val);
+	int last =  (magCompare(method_, "value")) ? value(val) : index(val);
 	if ( last < first_ )
 	{
 		MagLog::warning() << "last position (" + val + ") < first position: exchange " << "\n";
@@ -292,6 +298,7 @@ NetVariable::NetVariable(const string& name, NcVar* id, const NcFile& file, cons
 			attributes_[att->name()] = NetAttribute(att->name(), att); 
 		}
 	}
+
 double NetVariable::getDefaultMissing()
 {
 
@@ -300,6 +307,8 @@ double NetVariable::getDefaultMissing()
 	return NC_FILL_FLOAT;
 }
 
+
+
 namespace magics {
 	template<> map<NcType, Accessor<double>*>*  Accessor<double>::accessors_ = 0;
 	template<> map<NcType, Accessor<float>*>*  Accessor<float>::accessors_ = 0;
diff --git a/src/decoders/Netcdf.h b/src/decoders/Netcdf.h
index 095ce41..6ca9c05 100644
--- a/src/decoders/Netcdf.h
+++ b/src/decoders/Netcdf.h
@@ -241,6 +241,7 @@ struct NetVariable
     } 
     
     double getDefaultMissing();
+    double getMissing(const string&);
 
     template <class T>
     void get(vector<T>& vals, map<string, string> first, map<string, string> last)
@@ -290,6 +291,10 @@ public:
     	  return var->second.getDefaultMissing();
     }
 
+    double getMissing(const string&, const string&);
+
+
+
     template <class T>
     void get(const string& name, vector<T>& vals, 
                                 map<string, string> first, 
diff --git a/src/decoders/NetcdfDecoder.h b/src/decoders/NetcdfDecoder.h
index 1c44aaf..1cdc977 100644
--- a/src/decoders/NetcdfDecoder.h
+++ b/src/decoders/NetcdfDecoder.h
@@ -81,7 +81,8 @@ public:
     
     MatrixHandler& matrix() {
         MagLog::dev() << "NetcdfDecoder::matrix! " << "\n";
-        valid_ = (*interpretor_).interpretAsMatrix(&data_);
+        if ( !data_ )
+        	valid_ = (*interpretor_).interpretAsMatrix(&data_);
         this->matrixHandlers_.push_back(new MatrixHandler(*data_));
         return *(this->matrixHandlers_.back());
     } 
diff --git a/src/decoders/NetcdfGeoMatrixInterpretor.cc b/src/decoders/NetcdfGeoMatrixInterpretor.cc
index b8b127a..4ea044e 100644
--- a/src/decoders/NetcdfGeoMatrixInterpretor.cc
+++ b/src/decoders/NetcdfGeoMatrixInterpretor.cc
@@ -55,9 +55,9 @@ bool NetcdfGeoMatrixInterpretor::interpretAsMatrix(Matrix** data)
    
 	Netcdf netcdf(path_, dimension_method_);
 
-	double missing_value = netcdf.getDefaultMissing(field_);
 
-	missing_value = netcdf.getVariableAttribute(field_, missing_attribute_, missing_value);
+
+	double missing_value = netcdf.getMissing(field_, missing_attribute_);
 
 
 	// get the data ...
@@ -92,6 +92,7 @@ bool NetcdfGeoMatrixInterpretor::interpretAsMatrix(Matrix** data)
 			for (vector<double>::iterator d = data.begin(); d != data.end(); ++d ) {
 				if ( !isnan(*d) ) {
 					matrix_->push_back(*d);
+
 				}
 				else 
 					matrix_->push_back(missing_value);
@@ -217,4 +218,58 @@ void NetcdfGeoMatrixInterpretor::visit(ValuesCollector& vcp,PointsList&)
 	}
 }
 
+void NetcdfGeoMatrixInterpretor::customisedPoints(const Transformation& transformation, const std::set<string>&, CustomisedPointsList& out)
+{
+	Netcdf netcdf(path_, dimension_method_);
+
+		// get the data ...
+		try
+		{
+			vector<double> latitudes;
+			vector<double> longitudes;
+			vector<double> xcomponent;
+			vector<double> ycomponent;
+			vector<double> colcomponent;
+			map<string, string> first, last;
+			setDimensions(dimension_, first, last);
+			double missing_value = missing(netcdf);
+
+			netcdf.get(x_component_, xcomponent, first, last);
+			netcdf.get(y_component_, ycomponent, first, last);
+			if ( !colour_component_.empty() )
+				netcdf.get(colour_component_, colcomponent, first, last);
+			netcdf.get(longitude_, longitudes, first, last);
+			netcdf.get(latitude_, latitudes, first, last);
+			unsigned int val = 0;
+
+			for (unsigned int  lat  =0 ; lat < latitudes.size(); lat+=latitude_sample_) {
+				for ( unsigned int lon = 0; lon < longitudes.size(); lon+=longitude_sample_) {
+					val = (lat* longitudes.size() + lon);
+					if ( val >= xcomponent.size() ) return;
+					if ( val >= ycomponent.size() ) return;
+					if ( !colour_component_.empty() )
+						if ( val >= colcomponent.size() ) return;
+					if ( same(xcomponent[val], missing_value ) ) continue;
+					if ( same(ycomponent[val], missing_value ) ) continue;
+					vector<UserPoint> points;
+					transformation.populate(longitudes[lon], latitudes[lat], 0, points);
+					for (vector<UserPoint>::iterator  pt = points.begin(); pt != points.end(); ++pt ) {
+						CustomisedPoint* point = new CustomisedPoint(pt->x_, pt->y_, "");
+							(*point)["x_component"] = xcomponent[val];
+						(*point)["y_component"] = ycomponent[val];
+						if ( !colour_component_.empty() )
+							(*point)["colour_component"] = colcomponent[val];
+						out.push_back(point);
+					}
+				}
+			}
+	 		MagLog::dev()<< "everything ok" << endl;
+		}
+		catch (MagicsException& e)
+		{
+			MagLog::error() << e << "\n";
+
+		}
+
 
+}
diff --git a/src/decoders/NetcdfGeoMatrixInterpretor.h b/src/decoders/NetcdfGeoMatrixInterpretor.h
index b4fe1e7..ba6b9aa 100644
--- a/src/decoders/NetcdfGeoMatrixInterpretor.h
+++ b/src/decoders/NetcdfGeoMatrixInterpretor.h
@@ -74,7 +74,7 @@ public:
     virtual void statsData(map<string,vector<double> >&);
     virtual void visit(MetaDataCollector&);
     virtual void visit(ValuesCollector&,PointsList&); 
-
+    void customisedPoints(const Transformation&, const std::set<string>&, CustomisedPointsList&);
 protected:
      //! Method to print string about this class on to a stream of type ostream (virtual).
 	 virtual void print(ostream&) const; 
diff --git a/src/decoders/NetcdfGeopointsInterpretor.cc b/src/decoders/NetcdfGeopointsInterpretor.cc
index 372104d..1bb053f 100644
--- a/src/decoders/NetcdfGeopointsInterpretor.cc
+++ b/src/decoders/NetcdfGeopointsInterpretor.cc
@@ -287,8 +287,8 @@ bool NetcdfXYpointsInterpretor::interpretAsPoints(PointsList& list, const Transf
 		setDim(netcdf, x_, xs, first, last);
 		setDim(netcdf, y_, ys, first, last);
 
-		double xmissing = netcdf.getDefaultMissing(x_);
-		double ymissing = netcdf.getDefaultMissing(y_);
+		double xmissing = netcdf.getMissing(x_, missing_attribute_);
+		double ymissing = netcdf.getMissing(y_, missing_attribute_);
 
 		vector<double>::iterator x = xs.begin();
 		vector<double>::iterator y = ys.begin();
@@ -341,9 +341,9 @@ bool NetcdfXYpointsInterpretor::interpretAsPoints(PointsList& list, const std::s
 		}
 		setDim(netcdf, x_, xs, first, last);
 		setDim(netcdf, y_, ys, first, last);
-		//double xmissing = netcdf.getDefaultMissing(x_);
-		double ymissing = netcdf.getDefaultMissing(y_);
-		ymissing = netcdf.getVariableAttribute(y_, missing_attribute_, ymissing);
+
+		double xmissing = netcdf.getMissing(x_, missing_attribute_);
+		double ymissing = netcdf.getMissing(y_, missing_attribute_);
 
 		 baseDateX_ = "";
 		 if ( !reference_date(netcdf, x_, refDateX_, baseDateX_, xs, datex) )
@@ -362,8 +362,10 @@ bool NetcdfXYpointsInterpretor::interpretAsPoints(PointsList& list, const std::s
 			 	value = *val;
 			 	val++;
 			}
+			if ( !same(*y,ymissing) || !same(*x,xmissing) ) {
+				list.push_back(new UserPoint(*x,*y,value, (same(*y,ymissing) || same(*x,xmissing)) ));
 
-			list.push_back(new UserPoint(*x,*y,value, same(*y,ymissing) ));
+			}
 
 			x++;
 			y++;
@@ -428,7 +430,9 @@ void NetcdfXYpointsInterpretor::visit(Transformation& transformation)
 
 			}
 		}
-		transformation.setMinMaxY(points.minY(), points.maxY());
+		if ( transformation.getAutomaticY() ) {
+			transformation.setMinMaxY(points.minY(), points.maxY());
+		}
 	}
 	catch ( ... ) {}
 }
diff --git a/src/decoders/NetcdfInterpretor.cc b/src/decoders/NetcdfInterpretor.cc
index 82cfbf6..1123209 100644
--- a/src/decoders/NetcdfInterpretor.cc
+++ b/src/decoders/NetcdfInterpretor.cc
@@ -45,7 +45,7 @@ void NetcdfInterpretor::setDimensions(const stringarray& value, map<string, stri
     first.clear();
     last.clear();
  
-    Tokenizer tokenizer("/ ");
+    Tokenizer tokenizer("/ :");
     vector<string> tokens;
     for (stringarray::const_iterator val = value.begin(); val != value.end(); ++val) {
         tokens.clear();
@@ -140,8 +140,19 @@ bool NetcdfInterpretor::cf_date(Netcdf& netcdf, const string& var, const string&
 
 
 	basedate = tokens[2];
-	double diff = ( refdate.empty() ) ? 0 : DateTime(basedate) - DateTime(refdate) ;
+	double diff;
 	map<string, double>::const_iterator factor = factors.find(tokens[0]);
+	if ( refdate.empty() ) {
+		diff = Multiply(factor->second, std::numeric_limits<double>::max())(coords.front());
+		DateTime newref = DateTime(basedate) + Second(diff);
+		basedate =  newref.tostring("%F %T");
+		diff = -diff;
+	}
+	else {
+		diff = DateTime(basedate) - DateTime(refdate) ;
+	}
+
+
 	if ( factor != factors.end() )
 		std::transform(coords.begin(), coords.end(),  coords.begin(), Multiply(factor->second, std::numeric_limits<double>::max()));
 	std::transform(coords.begin(), coords.end(),  coords.begin(), Plus(diff, std::numeric_limits<double>::max()));
diff --git a/src/decoders/NetcdfMatrixInterpretor.cc b/src/decoders/NetcdfMatrixInterpretor.cc
index 1f0eb5c..5c3f1a8 100644
--- a/src/decoders/NetcdfMatrixInterpretor.cc
+++ b/src/decoders/NetcdfMatrixInterpretor.cc
@@ -63,7 +63,7 @@ bool NetcdfMatrixInterpretor::interpretAsMatrix(Matrix** matrix)
 	matrix_->missing(std::numeric_limits<double>::max());
 
 	Netcdf netcdf(path_, dimension_method_);
-	double missing =  netcdf.getVariableAttribute(field_, missing_attribute_,netcdf.getDefaultMissing(field_));
+	double missing =  netcdf.getMissing(field_, missing_attribute_);
 	matrix_->missing(missing);
 
 	string title = netcdf.getAttribute("title", "NO TITLE");
@@ -249,13 +249,13 @@ bool NetcdfMatrixInterpretor::y()
     	if ( !aux.empty() ) {
     		ostringstream geominy, geomaxy;
     		if ( magCompare(geo_y_convention_, "latlon") ) {
-    			geominy << rows_.front() << "/" << aux.front();
-    			geomaxy << rows_.back() << "/" << aux.back();
-    		}
-    		else {
     			geominy << aux.front() << "/" << rows_.front();
     			geomaxy << aux.back() << "/" << rows_.back();
     		}
+    		else {
+    			geominy << rows_.front() << "/" << aux.front();
+    			geomaxy << rows_.back() << "/" << aux.back();
+    		}
 
     		geoMinY_ = geominy.str();
     		geoMaxY_ = geomaxy.str();
@@ -295,12 +295,12 @@ void NetcdfMatrixInterpretor::visit(Transformation& transformation)
 			y();
 
 			if ( transformation.getAutomaticX() ) {
-				if ( !this->baseDateX_.empty() ) {
-					transformation.setDataMinMaxX(columns_.front(), columns_.back(), this->baseDateX_);
+				if ( !baseDateX_.empty() ) {
+					transformation.setDataMinMaxX(columns_.front(), columns_.back(), baseDateX_);
 
 				}
-				else if ( !this->geoMinX_.empty() ) {
-					string coords = this->geoMinX_ + "/" + this->geoMaxX_;
+				else if ( !geoMinX_.empty() ) {
+					string coords = geoMinX_ + "/" + geoMaxX_;
 					transformation.setDataMinMaxX(columns_.front(), columns_.back(), coords);
 				}
 				else
@@ -310,12 +310,13 @@ void NetcdfMatrixInterpretor::visit(Transformation& transformation)
 				}
 			}
 			if ( transformation.getAutomaticY() ) {
-				if ( !this->baseDateY_.empty() ) {
-					transformation.setDataMinMaxY(rows_.front(), rows_.back(), this->baseDateY_);
+				if ( !baseDateY_.empty() ) {
+					transformation.setDataMinMaxY(rows_.front(), rows_.back(), baseDateY_);
 
 				}
-				else if ( !this->geoMinY_.empty() ) {
-					transformation.setDataMinMaxY(rows_.front(), rows_.back(),this->geoMinY_);
+				else if ( !geoMinY_.empty() ) {
+					string coords = geoMinY_ + "/" + geoMaxY_;
+					transformation.setDataMinMaxY(rows_.front(), rows_.back(),coords);
 
 				}
 				else {
diff --git a/src/decoders/NetcdfOrcaInterpretor.cc b/src/decoders/NetcdfOrcaInterpretor.cc
index 02ad6d5..8e91c64 100644
--- a/src/decoders/NetcdfOrcaInterpretor.cc
+++ b/src/decoders/NetcdfOrcaInterpretor.cc
@@ -68,7 +68,7 @@ bool NetcdfOrcaInterpretor::interpretAsMatrix(Matrix** data)
 		*data = matrix;
 
 
-		double missing =  netcdf.getVariableAttribute(field_, missing_attribute_,netcdf.getDefaultMissing(field_));
+		double missing =  netcdf.getMissing(field_, missing_attribute_);
 		typedef boost::geometry::model::d2::point_xy<double> point_type;
 		typedef boost::geometry::model::polygon<point_type> polygon_type;
 
@@ -238,6 +238,9 @@ bool NetcdfOrcaInterpretor::interpretAsMatrix(Matrix** data)
 
 
 					}
+                    matrix->multiply(scaling_);
+                    matrix->plus(offset_);
+
 
 
 					 matrix->setMapsAxis();
@@ -263,11 +266,6 @@ bool NetcdfOrcaInterpretor::interpretAsMatrix(Matrix** data)
 bool NetcdfOrcaInterpretor::interpretAsPoints(PointsList& points)
 {
 	
-    Matrix latitudes;
-    Matrix longitudes;
-	Matrix matrix;
-	
-	matrix.missing(std::numeric_limits<double>::max());
 	// later!
 
 	// get the data ...
@@ -277,6 +275,7 @@ bool NetcdfOrcaInterpretor::interpretAsPoints(PointsList& points)
 		Netcdf netcdf(path_, dimension_method_);
 		map<string, string> first, last;
 		setDimensions(dimension_, first, last);
+        double missing =  netcdf.getMissing(field_, missing_attribute_);
 		vector<double> latm;
 		vector<double> lonm;
 		vector<double> data;
@@ -295,7 +294,14 @@ bool NetcdfOrcaInterpretor::interpretAsPoints(PointsList& points)
         vector<double>::iterator val = data.begin();
         
 		while (lat != latm.end() ) {
-		  	points.push_back(new UserPoint(*lon, *lat, *val));
+            double value = *val;
+           if (isnan(value) ) 
+                value = missing;
+
+            if ( value  != missing) { 
+                value = (value * scaling_) + offset_;
+		  	    points.push_back(new UserPoint(*lon, *lat, value));
+            }
 			++lat;
 			++lon;
 			++val;
diff --git a/src/decoders/NetcdfVectorInterpretor.cc b/src/decoders/NetcdfVectorInterpretor.cc
index d139f8c..e9afaef 100644
--- a/src/decoders/NetcdfVectorInterpretor.cc
+++ b/src/decoders/NetcdfVectorInterpretor.cc
@@ -76,6 +76,50 @@ NetcdfGeoVectorInterpretor::~NetcdfGeoVectorInterpretor()
 {
 }
 
+void NetcdfVectorInterpretor::customisedPoints(const Transformation& transformation, const std::set<string>&, CustomisedPointsList& list)
+{
+	Netcdf netcdf(path_, dimension_method_);
+	try {
+			vector<double> x;
+			vector<double> y;
+			vector<double> x_component;
+			vector<double> y_component;
+			map<string, string> first, last;
+			setDimensions(dimension_, first, last);
+			
+			netcdf.get(x_component_, x_component, first, last);
+			netcdf.get(y_component_, y_component, first, last);
+			netcdf.get(x_, x, first, last);
+			netcdf.get(y_, y, first, last);
+			
+			vector<double>::iterator xi = x.begin();
+			vector<double>::iterator yi = y.begin();
+			vector<double>::const_iterator u = x_component.begin();
+			vector<double>::const_iterator v = y_component.begin();
+			
+			xi = x.begin();		
+			yi = y.begin();
+			while ( xi != x.end() && yi != y.end() &&
+						u != x_component.end() && v != y_component.end() ) {
+//				       if ( transformation.in( *xi, *yi) ) {
+				    	   CustomisedPoint* point = new CustomisedPoint();		
+				    	   point->longitude(*xi);
+				    	   point->latitude(*yi);
+				    	   (*point)["x_component"] = *u;
+				    	   (*point)["y_component"] = *v;
+				    	   list.push_back(point);
+//				       }
+						xi++;
+						yi++;
+						u++;
+						v++;
+			}
+	}
+	catch (MagicsException& e)
+	{
+		MagLog::error() << e << "\n";
+        }
+}
 
 void NetcdfGeoVectorInterpretor::customisedPoints(const Transformation& transformation, const std::set<string>&, CustomisedPointsList& list)
 {
diff --git a/src/decoders/NetcdfVectorInterpretor.h b/src/decoders/NetcdfVectorInterpretor.h
index 855b842..a1de590 100644
--- a/src/decoders/NetcdfVectorInterpretor.h
+++ b/src/decoders/NetcdfVectorInterpretor.h
@@ -87,6 +87,7 @@ public:
     	NetcdfVectorInterpretorAttributes::copy(*this); 
     }
     virtual void customisedPoints(const std::set<string>&, CustomisedPointsList&);
+    virtual void customisedPoints(const Transformation&, const std::set<string>&, CustomisedPointsList&);
    
 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 20eb207..db572ea 100644
--- a/src/decoders/ShapeDecoder.cc
+++ b/src/decoders/ShapeDecoder.cc
@@ -324,7 +324,22 @@ void ShapeDecoder::decode(vector<Polyline>& data, const Transformation& transfor
 			data.clear();
 			SHPGetInfo( hSHP, &nEntities, &nShapeType, adfMinBound, adfMaxBound );
 
-			//vector<polygon_2d> polys;
+			double south =  transformation.getMinY();
+			double north =  transformation.getMaxY();
+			double west =  transformation.getMinX();
+			double east =  transformation.getMaxX();
+
+			double shift = 0;
+
+			if ( west < -180 )
+				shift = 360;
+			if ( east > 180 )
+				shift = 360;
+			if ( ( east - west ) > 360. )
+				shift = 0;
+
+
+
 			SHPObject	*psShape = 0;
 			int nb  = 0;
 			for( i = 0; i < nEntities; i++ )
@@ -341,14 +356,17 @@ void ShapeDecoder::decode(vector<Polyline>& data, const Transformation& transfor
 				bool left = false;
 				bool right = false;
 
-				if ( psShape->dfYMax <= transformation.getMinY() ) continue;
-				if ( psShape->dfYMin >= transformation.getMaxY() ) continue;
-				if ( psShape->dfXMax <= transformation.getMinX() ) in = false;
-				if ( psShape->dfXMin >=  transformation.getMaxX()) in = false;
-				if ( psShape->dfXMax-360 > transformation.getMinX() &&  !same(psShape->dfXMax-360, transformation.getMinX())) {
+
+
+
+				if ( psShape->dfYMax  <= south ) continue;
+				if ( psShape->dfYMin  >= north ) continue;
+				if ( psShape->dfXMax + shift  <= west) in = false;
+				if ( psShape->dfXMin  + shift >=  east) in = false;
+				if ( psShape->dfXMax + shift -360 > transformation.getMinX() &&  !same(psShape->dfXMax-360, transformation.getMinX())) {
 					        left = true;
 				}
-				if ( psShape->dfXMin+360 < transformation.getMaxX() && !same(psShape->dfXMin+360, transformation.getMaxX() ) ) {
+				if ( psShape->dfXMin + shift +360 < transformation.getMaxX() && !same(psShape->dfXMin+360, transformation.getMaxX() ) ) {
 						right = true;
 				}
 
@@ -372,9 +390,10 @@ void ShapeDecoder::decode(vector<Polyline>& data, const Transformation& transfor
                 
 				left = false;
 				right=false;
-				double last;
+
 				for( j = 0, iPart = 1, hole = false; j < psShape->nVertices ; j++ )
 				{
+					bool patch = false;
 					if( iPart < psShape->nParts && psShape->panPartStart[iPart] == j )
 					{
 						iPart++;
@@ -392,10 +411,7 @@ void ShapeDecoder::decode(vector<Polyline>& data, const Transformation& transfor
 
 					else {
 						double x = psShape->padfX[j];
-
-						last = psShape->padfX[j];
-
-
+							x += shift;
 						double y = psShape->padfY[j];
 
 						if ( iPart==1 ) {
@@ -404,11 +420,11 @@ void ShapeDecoder::decode(vector<Polyline>& data, const Transformation& transfor
 							}
 
 							if ( polyleft ) {
-								x -= 360;
-								polyleft->push_back(PaperPoint(x, y));
+
+								polyleft->push_back(PaperPoint(x-360, y));
 							}
 							if ( polyright ) {
-								polyright->push_back(PaperPoint(psShape->padfX[j]+360,  psShape->padfY[j]));
+								polyright->push_back(PaperPoint(x+360,  y));
 							}
 
 						}
@@ -418,12 +434,12 @@ void ShapeDecoder::decode(vector<Polyline>& data, const Transformation& transfor
 							}
 
 							if ( polyleft ) {
-								x -= 360;
-								polyleft->push_back_hole(PaperPoint(x, y));
+
+								polyleft->push_back_hole(PaperPoint(x-360, y));
 
 							}
 							if ( polyright ) {
-								polyright->push_back_hole(PaperPoint(psShape->padfX[j]+360, psShape->padfY[j]));
+								polyright->push_back_hole(PaperPoint(x+360, y));
 							}
 						 }
 					}
@@ -433,15 +449,12 @@ void ShapeDecoder::decode(vector<Polyline>& data, const Transformation& transfor
 				}
 				
 
-	// first we clip
+	             /// first we clip
 					for (vector<Polyline*>::iterator poly = polys.begin(); poly != polys.end(); ++poly ) {
 						(*poly)->sanityCheck();
-					//polyleft.sanityCheck();
 						vector<Polyline> clipped;
 						geobox.intersect(**poly, clipped);
 
-
-	                //geobox.intersect(polyleft, clipped);
 	                // then we reproject!
 						for (vector<Polyline>::iterator clip = clipped.begin(); clip != clipped.end(); ++clip ) {
 							clip->reproject(transformation);
diff --git a/src/decoders/Time.cc b/src/decoders/Time.cc
index accf3e0..5216de9 100644
--- a/src/decoders/Time.cc
+++ b/src/decoders/Time.cc
@@ -56,6 +56,8 @@ magics::MagTime::MagTime(const string& s)
 	//MagLog::debug() << "time-->[" << s << "]=" << s.length() << "\n";
 	switch(result.size())
 	{
+		case 0: 
+            break;
 		case 1:
 			// hh or hhmm or hhmmss
 			switch(s.length())
diff --git a/src/decoders/TitleTemplate.cc b/src/decoders/TitleTemplate.cc
index 2fdd83e..105c835 100644
--- a/src/decoders/TitleTemplate.cc
+++ b/src/decoders/TitleTemplate.cc
@@ -35,10 +35,12 @@
 #include "GribDecoder.h"
 using namespace magics;
 
+static bool ignore_space_;
 static void XMLCALL
 startElement(void *userData, const char *name, const char **atts)
 {
 	TitleTemplate* object  = (TitleTemplate*) userData; 
+
 	if (string(name) == "title" )
 	{
 		TitleTemplate* title = new TitleTemplate();
@@ -48,7 +50,11 @@ startElement(void *userData, const char *name, const char **atts)
 		}
 		object->top()->push_back(title);
 		object->push(title);
+		ignore_space_ = true;
+		return;
 	}
+	if (string(name) == "text"  )
+		ignore_space_ = false;
 	else
 	{
 		TitleMetaField* meta = new TitleMetaField(name);
@@ -59,16 +65,22 @@ startElement(void *userData, const char *name, const char **atts)
 		}
 		object->top()->add(meta);
 	}
+
 }
 
 static void XMLCALL
 endElement(void *userData, const char *name)
 {
+
 	if (string(name) == "title" )
 	{
 		TitleTemplate* object  = (TitleTemplate*) userData;
 		object->pop();
+		ignore_space_ = true;
+
 	}
+	if (string(name) == "text"  )
+			ignore_space_ = true;
 }
 
 
@@ -77,10 +89,16 @@ static void XMLCALL character (void *userData,
                             const char *s,
                             int len)
 {
-	//int *depthPtr = (int*)userData;
+
+
+	string data(s, len);
+
 	TitleTemplate* object  = (TitleTemplate*) userData;
-	if (  std::string(s, len) == "\n" ) return;
-	object->top()->add(new TitleStringField(string(s, len)));
+	if (  data == "\n" ) return;
+	if( ignore_space_ && data.find_first_not_of(" \n\t") == std::string::npos)
+		return;
+
+	object->top()->add(new TitleStringField(data));
 }
 
 static void XMLCALL startData(void *)
@@ -105,7 +123,7 @@ void TitleTemplate::decode()
 	singleton_ = this;
 	string filename = getEnvVariable("MAGPLUS_HOME") + MAGPLUS_PATH_TO_SHARE_ + file_;
 	char buf[BUFSIZ];
-
+	ignore_space_ = true;
 	push(this);
 	XML_Parser parser = XML_ParserCreate(NULL);
 	int done;
diff --git a/src/decoders/TitleTemplate.h b/src/decoders/TitleTemplate.h
index b869124..a826359 100644
--- a/src/decoders/TitleTemplate.h
+++ b/src/decoders/TitleTemplate.h
@@ -111,7 +111,7 @@ public:
 	template <class D>
 	void operator()(vector<string>& out, const D& data) const
 	{
-		if ( !verify(data) ) return;
+
 		vector<string> lines;
 		lines.push_back("");
 		for (const_iterator child = begin(); child != end(); ++child)
diff --git a/src/drivers/BaseDriver.cc b/src/drivers/BaseDriver.cc
index 6d0ffe5..7cebf62 100644
--- a/src/drivers/BaseDriver.cc
+++ b/src/drivers/BaseDriver.cc
@@ -150,6 +150,7 @@ void BaseDriver::printOutputName(const std::string & str) const
 {
 	if(filelist_)
 	{
+		if(filelist_reset_) remove(filelist_name_.c_str()); 
 		const SystemInfo info;
 		fstream fs;
 		if(numFiles_ == 0)
@@ -542,14 +543,17 @@ void BaseDriver::printLine(const Polyline &line) const
 		PaperPoint pp(pro_x,pro_y);		
 		text.push_back(pp);
 
-		const Label label= line.getLabel();
+		Label label= line.getLabel();
+		MagFont font = label.font();
 
-		text.addText(label.getText(),label.getFontColour(),label.getFontSize()); 
+		text.setFont(font);
+		text.addText(label.getText(),font.colour(),font.size());
 		text.setBlanking(label.getBlanking());
 		text.setJustification(label.getJustification());
 		text.setVerticalAlign(MHALF);
-		text.setAngle(-setAngleY(angle));	
 
+		text.setAngle(-setAngleY(angle));	
+		text.setFont(font);
 		renderText(text);
 
 		labelx [num_labels] = x[i];
diff --git a/src/drivers/BaseDriver.h b/src/drivers/BaseDriver.h
index 56e2681..9b9bc56 100644
--- a/src/drivers/BaseDriver.h
+++ b/src/drivers/BaseDriver.h
@@ -61,6 +61,8 @@
 #ifndef MPP_BaseDriver_H
 #define MPP_BaseDriver_H
 
+#include <stack>
+
 #include <magics.h>
 #include <MagTranslator.h>
 #include <Colour.h>
diff --git a/src/drivers/BaseDriverSymbols.h b/src/drivers/BaseDriverSymbols.h
index 946cdf4..6477e17 100644
--- a/src/drivers/BaseDriverSymbols.h
+++ b/src/drivers/BaseDriverSymbols.h
@@ -499,20 +499,20 @@ MAGICS_NO_EXPORT void BaseDriver::drizzle(const MFloat x, const MFloat y, const
 MAGICS_NO_EXPORT void BaseDriver::lightning(const MFloat x, const MFloat y, const MFloat size) const
 {
 	vector<PaperPoint> line;
-		  line.push_back(PaperPoint(x-(size*.5),y-(size*.9)));
-		  line.push_back(PaperPoint(x-(size*.5),y+(size*.9)));
-		renderPolyline(line);
-		line.clear();
-		  line.push_back(PaperPoint(x-(size*.5),y+(size*.9)));
-		  line.push_back(PaperPoint(x+(size*.5),y+(size*.9)));
-		  line.push_back(PaperPoint(x+(size*.1),y));
-		  line.push_back(PaperPoint(x+(size*.5),y-(size*.9)));
-		renderPolyline(line);
-		line.clear();
-		  line.push_back(PaperPoint(x+(size*.4), y-(size*.4) ));
-		  line.push_back(PaperPoint(x+(size*.5), y-(size*.9) ));
-		  line.push_back(PaperPoint(x+(size*.3), y-(size*.8)));
-		renderPolyline(line);
+	  line.push_back(PaperPoint(x-(size*.3),y-(size)));
+	  line.push_back(PaperPoint(x-(size*.3),y+(size)));
+	renderPolyline(line);
+	line.clear();
+	  line.push_back(PaperPoint(x-(size*.3),y-(size)));
+	  line.push_back(PaperPoint(x+(size*.3),y-(size)));
+	  line.push_back(PaperPoint(x,y));
+	  line.push_back(PaperPoint(x+(size*.3),y+(size)));
+	renderPolyline(line);
+	line.clear();
+	  line.push_back(PaperPoint(x+(size*.35), y+(size*.3) ));
+	  line.push_back(PaperPoint(x+(size*.3), y+(size) ));
+	  line.push_back(PaperPoint(x, y+(size*.7)));
+	renderPolyline(line);
 }
 
 /*!
diff --git a/src/drivers/BaseDriverWind.h b/src/drivers/BaseDriverWind.h
index 93fa2f8..8f70a3d 100644
--- a/src/drivers/BaseDriverWind.h
+++ b/src/drivers/BaseDriverWind.h
@@ -104,8 +104,8 @@ MAGICS_NO_EXPORT void BaseDriver::renderWindArrow(const Arrow &arrow) const
 
 	  vector<PaperPoint> line;
 	  (pos==M_TAIL) ? line.push_back(PaperPoint(0.,0.)) : line.push_back(PaperPoint( -0.5*norm,0.));
-	  double xx       = (pos==M_TAIL) ? norm  :       0.5  * norm;
-	  if(index==2) xx = (pos==M_TAIL) ? norm2 : (base-0.5) * norm;
+	  double xx                       = (pos==M_TAIL) ? norm  :       0.5  * norm;
+	  if((index==2) || (index==1)) xx = (pos==M_TAIL) ? norm2 : (base-0.5) * norm;
 
 	  line.push_back(PaperPoint(xx,0));
 	  for_each(line.begin(),line.end(),rotate(angle,ratio) );
@@ -132,18 +132,12 @@ MAGICS_NO_EXPORT void BaseDriver::renderWindArrow(const Arrow &arrow) const
 	  if(index == 0)
 	  {
 		line.clear();
-		line.push_back(PaperPoint(xx,0. ));
 		line.push_back(PaperPoint(xx-bx,-by));
-		for_each(line.begin(),line.end(),rotate(angle,ratio) );
-		for_each(line.begin(),line.end(),translate(arr->point_) );
-		renderPolyline2(line);
-
-		line.clear();
 		line.push_back(PaperPoint(xx,0. ));
 		line.push_back(PaperPoint(xx-bx,by));
 		for_each(line.begin(),line.end(),rotate(angle,ratio) );
 		for_each(line.begin(),line.end(),translate(arr->point_) );
-		renderPolyline2(line);
+		renderPolyline(line);
 	  }
 	  else
 	  {
diff --git a/src/drivers/CairoDriver.cc b/src/drivers/CairoDriver.cc
index 184fd39..fef14bf 100644
--- a/src/drivers/CairoDriver.cc
+++ b/src/drivers/CairoDriver.cc
@@ -154,7 +154,7 @@ void CairoDriver::open()
 
 void CairoDriver::setupNewSurface() const
 {
-	if(magCompare(backend_,"png"))
+	if(magCompare(backend_,"png") || magCompare(backend_,"geotiff"))
 	{
 	    surface_ = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, dimensionXglobal_, dimensionYglobal_);
 	}
@@ -293,7 +293,7 @@ void CairoDriver::setupNewSurface() const
 #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 2, 0)
 	cairo_surface_set_fallback_resolution (surface_, resolution_, resolution_);
 #endif
-	if(magCompare(transparent_,"off") || !magCompare(backend_,"png"))
+	if(magCompare(transparent_,"off") || !(magCompare(backend_,"png") || magCompare(backend_,"geotiff")) )
 	{
 		cairo_set_source_rgb (cr_, 1.0, 1.0, 1.0); /* white */
 	}
@@ -361,7 +361,7 @@ MAGICS_NO_EXPORT void CairoDriver::startPage() const
 {
 	if(currentPage_ > 0)
 	{
-		if (magCompare(backend_,"png") )
+		if (magCompare(backend_,"png") || magCompare(backend_,"geotiff"))
 		{
 			cairo_destroy (cr_);
 			cairo_surface_destroy (surface_);
@@ -442,14 +442,107 @@ MAGICS_NO_EXPORT void CairoDriver::endPage() const
 		filename_ = getFileName("png" ,currentPage_);
 		cairo_surface_write_to_png(surface_, filename_.c_str());
 		if(!filename_.empty()) printOutputName("CAIRO png "+filename_);
-
-	//	filename_ = getFileName("jpg" ,currentPage_);
-	//	write_jpeg(surface_, "test.jpg", JCS_RGB, JCS_RGB, 3, false, true);
-	//	filename_ = getFileName("tiff" ,currentPage_);
-	//	write_tiff(surface_, "test.tiff");
+	}
+	else if (magCompare(backend_,"geotiff") )
+	{
+#ifdef MAGICS_GEOTIFF
+		filename_ = getFileName("tif" ,currentPage_);
+		write_tiff();
+#else
+		MagLog::error() << "CairoDriver: GEOTIFF not enabled!"<< std::endl;
+#endif
 	}
 }
 
+#ifdef MAGICS_GEOTIFF
+
+#include <geotiffio.h>
+#include <tiffio.h>
+/*!
+  \brief write raster into (Geo)Tiff
+
+  Only the raw raster (normally written to a PNG) is here written into a (Geo)Tiff.
+
+  \sa http://trac.osgeo.org/geotiff/
+  \sa http://www.remotesensing.org/geotiff/spec/geotiffhome.html
+  \sa http://www.remotesensing.org/geotiff/spec/geotiff6.html
+
+*/
+MAGICS_NO_EXPORT void CairoDriver::write_tiff() const
+{
+    int compression = 1;
+
+    unsigned char *data = cairo_image_surface_get_data(surface_);
+    int           width = cairo_image_surface_get_width(surface_);
+    int          height = cairo_image_surface_get_height(surface_);
+    const int    stride = cairo_image_surface_get_stride(surface_);
+
+    TIFF *tif = TIFFOpen(filename_.c_str(), "w");
+    if (!tif) {
+        MagLog::warning() << "CairoDriver: Unable to open TIFF file "<<filename_.c_str()<< std::endl;
+        return;
+    }
+    
+    GTIF *gtif = GTIFNew(tif);
+    if (!gtif)
+    {
+        MagLog::warning() << "CairoDriver: Unable to open GeoTIFF file "<<filename_.c_str()<< std::endl;
+        return;
+    }
+
+    TIFFSetField(tif, TIFFTAG_IMAGEWIDTH,      width);
+    TIFFSetField(tif, TIFFTAG_IMAGELENGTH,     height);
+    TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, 4);
+    TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE,   8);
+    TIFFSetField(tif, TIFFTAG_ORIENTATION,     ORIENTATION_TOPLEFT);
+    TIFFSetField(tif, TIFFTAG_PLANARCONFIG,    PLANARCONFIG_CONTIG);
+    TIFFSetField(tif, TIFFTAG_PHOTOMETRIC,     PHOTOMETRIC_RGB);
+    TIFFSetField(tif, TIFFTAG_SOFTWARE,        "Magics");
+
+    GTIFKeySet(gtif, GTModelTypeGeoKey,       TYPE_SHORT,  1, ModelGeographic);
+    GTIFKeySet(gtif, GTRasterTypeGeoKey,      TYPE_SHORT,  1, RasterPixelIsArea);
+    GTIFKeySet(gtif, GTCitationGeoKey,        TYPE_ASCII,  0, "MagicsPlot");
+    GTIFKeySet(gtif, GeographicTypeGeoKey,    TYPE_SHORT,  1, KvUserDefined);
+    GTIFKeySet(gtif, GeogCitationGeoKey,      TYPE_ASCII,  0, "Everest Ellipsoid Used.");
+    GTIFKeySet(gtif, GeogAngularUnitsGeoKey,  TYPE_SHORT,  1, Angular_Degree);
+    GTIFKeySet(gtif, GeogLinearUnitsGeoKey,   TYPE_SHORT,  1, Linear_Meter);
+    GTIFKeySet(gtif, GeogGeodeticDatumGeoKey, TYPE_SHORT,  1, KvUserDefined);
+    GTIFKeySet(gtif, GeogEllipsoidGeoKey,     TYPE_SHORT,  1, Ellipse_WGS_84);
+    GTIFKeySet(gtif, GeogSemiMajorAxisGeoKey, TYPE_DOUBLE, 1, (double)6377298.556);
+    GTIFKeySet(gtif, GeogInvFlatteningGeoKey, TYPE_DOUBLE, 1, (double)300.8017);
+
+    if(compression > 1) {
+        if (compression > 10) compression = 10;
+        TIFFSetField(tif, TIFFTAG_COMPRESSION, compression);
+    }
+
+    // DPI
+    TIFFSetField(tif, TIFFTAG_RESOLUTIONUNIT, RESUNIT_INCH);
+    TIFFSetField(tif, TIFFTAG_XRESOLUTION, (float) resolution_);
+    TIFFSetField(tif, TIFFTAG_YRESOLUTION, (float) resolution_);
+
+    unsigned char *buf;
+    if (TIFFScanlineSize(tif))
+        buf = (unsigned char *)_TIFFmalloc(4 * width);
+    else
+        buf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(tif));
+
+    unsigned char *pscanline;
+    for (unsigned int i = 0; i < height; i++) {
+        pscanline = buf;
+        for(unsigned int j = 0; j < stride; j++) {
+            *pscanline++ = data[i*stride+j++];
+            *pscanline++ = data[i*stride+j++];
+            *pscanline++ = data[i*stride+j++];
+            *pscanline++ = data[i*stride+j];
+        }
+        TIFFWriteScanline(tif, buf, i, 0);
+    }
+    TIFFClose(tif);
+    _TIFFfree(buf);
+    return;
+}
+#endif  // MAGICS_GEOTIFF
 
 /*!
   \brief project to a new Layout
@@ -505,7 +598,7 @@ MAGICS_NO_EXPORT void CairoDriver::project(const Layout& layout) const
 	else obsBox_=false;
 */
 	// write meta info
-	if(layout.isNavigable() && (magCompare(backend_,"png") || magCompare(backend_,"svg")) )
+	if(layout.isNavigable() && (magCompare(backend_,"png") || magCompare(backend_,"svg") || magCompare(backend_,"geotiff")) )
 	{
 		const double offsetX = projectX(layout.minX());
 		const double offsetY = projectY(layout.maxY());
@@ -748,113 +841,7 @@ MAGICS_NO_EXPORT void CairoDriver::renderSimplePolygon(const Polyline& line) con
 	}
 
 //	cairo_close_path (cr_);
-
-#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 2, 0)
-	if (currentShading_==M_SH_DOT)
-	{
-		const DotShadingProperties *pro = (DotShadingProperties*)currentShadingProperties_;
-		const int density = (int)sqrt(pro->density_);
-		if(density<=0) return;
-		const int s = (int)(pro->size_*convertCM(1.)*5.);
-		const MFloat square_size = convertCM(1.)/density;
-
-		cairo_surface_t *pat_surface;
-		cairo_pattern_t *pattern;
-		cairo_t *cr2;
-
-		pat_surface = cairo_surface_create_similar(cairo_get_group_target(cr_),CAIRO_CONTENT_COLOR_ALPHA, square_size, square_size);
-		cr2 = cairo_create (pat_surface);
-
-		cairo_set_source_rgba(cr2,currentColour_.red(),currentColour_.green(),currentColour_.blue(),currentColour_.alpha());
-		const MFloat off = (square_size)*.5;
-		cairo_rectangle (cr2, off, off, s, s);
-		cairo_fill (cr2);
-
-		pattern = cairo_pattern_create_for_surface (cairo_get_target (cr2));
-
-		cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);
-
-		cairo_set_source (cr_, pattern);
-		cairo_fill (cr_);
-
-		cairo_pattern_destroy(pattern);
-		cairo_surface_destroy (pat_surface);
-		cairo_destroy (cr2);
-	}
-	else if (currentShading_==M_SH_HATCH)
-	{
-		const HatchShadingProperties *pro = (HatchShadingProperties*)currentShadingProperties_;
-		indexHatch_ = pro->index_;
-		if(indexHatch_<1 || indexHatch_>6)
-		{
-			MagLog::warning() << "CairoDriver::renderSimplePolygon > Hatch index " <<indexHatch_<<" is wrong. No hatch sahding possible!" << endl;
-			return;
-		}
-		const int density = (int)(1./pro->density_*150);
-
-		cairo_surface_t *pat_surface;
-		cairo_pattern_t *pattern;
-		cairo_t *cr2;
-
-		pat_surface = cairo_surface_create_similar(cairo_get_group_target(cr_),CAIRO_CONTENT_COLOR_ALPHA, density, density);
-		cr2 = cairo_create (pat_surface);
-		cairo_surface_destroy (pat_surface);
-
-		cairo_set_source_rgba(cr2,currentColour_.red(),currentColour_.green(),currentColour_.blue(),currentColour_.alpha());
-		if(indexHatch_==1 || indexHatch_==3) // horizontal
-		{
-			cairo_move_to(cr2,       0, density*.5+.5);
-			cairo_line_to(cr2, density+.5, density*.5+.5);
-		}
-		if(indexHatch_==2 || indexHatch_==3) // vertical
-		{
-			cairo_move_to(cr2, density+.5*.5, 0);
-			cairo_line_to(cr2, density+.5*.5, density+.5);
-		}
-		if(indexHatch_==4 || indexHatch_==6) 
-		{
-			cairo_move_to(cr2,       0, 0);
-			cairo_line_to(cr2, density+.5, density+.5);
-		}
-		if(indexHatch_==5 || indexHatch_==6)
-		{
-			cairo_move_to(cr2, density+.5, 0);
-			cairo_line_to(cr2,       0, density+.5);
-		}
-                cairo_identity_matrix (cr_);
-		cairo_set_line_width (cr_,pro->thickness_*.5);
-		cairo_stroke(cr2);
-
-		pattern = cairo_pattern_create_for_surface (cairo_get_target (cr2));
-		cairo_destroy (cr2);
-
-		cairo_pattern_set_extend (pattern, CAIRO_EXTEND_REPEAT);
-
-		cairo_set_source (cr_, pattern);
-		cairo_fill (cr_);
-
-		cairo_pattern_destroy(pattern);
-	}
-	else
-#else
-                if (currentShading_==M_SH_HATCH || currentShading_==M_SH_DOT)
-                    MagLog::error() << "CairoDriver: For hatch and dot shading you need at least Cairo 1.2!\n"
-                                 << "             Solid shading used instead."<< std::endl;
-#endif
-	{
-	    if(cairo_get_antialias(cr_) != CAIRO_ANTIALIAS_NONE && currentColour_.alpha() > 0.9999 )
-	    {
-	        cairo_fill_preserve(cr_);
-	        cairo_set_line_width(cr_, 1.);
-	        cairo_stroke(cr_);
-	    }
-	    else
-	    {
-	        cairo_fill(cr_);
-	    }
-	}
-	cairo_restore(cr_);
-	currentShading_=M_SH_SOLID;
+	renderSimplePolygon();
 }
 
 
@@ -889,7 +876,23 @@ MAGICS_NO_EXPORT void CairoDriver::renderSimplePolygon(const int n, MFloat* x, M
 
 	cairo_close_path (cr_);
 
-#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 2, 0)
+	renderSimplePolygon();
+}
+
+/*!
+  \brief renders a filled polygon
+
+  This method renders a filled polygon. The style is
+  determined by what is described in the current LineStyle.
+
+  \sa setLineParameters()
+  \param n number of points
+  \param x array of x values
+  \param y array of y values
+*/
+MAGICS_NO_EXPORT void CairoDriver::renderSimplePolygon() const
+{
+  #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 2, 0)
 	if (currentShading_==M_SH_DOT)
 	{
 		const DotShadingProperties *pro = (DotShadingProperties*)currentShadingProperties_;
@@ -982,7 +985,9 @@ MAGICS_NO_EXPORT void CairoDriver::renderSimplePolygon(const int n, MFloat* x, M
                                  << "             Solid shading used instead."<< std::endl;
 #endif
 	{
-	    if(cairo_get_antialias(cr_) != CAIRO_ANTIALIAS_NONE && currentColour_.alpha() > 0.9999 )
+        if(cairo_get_antialias(cr_) != CAIRO_ANTIALIAS_NONE && currentColour_.alpha() > 0.9999 )
+
+	    //if(magCompare(backend_,"png")) // if(cairo_get_antialias(cr_) != CAIRO_ANTIALIAS_NONE && currentColour_.alpha() > 0.9999 )
 	    {
 	        cairo_fill_preserve(cr_);
 	        cairo_set_line_width(cr_, 1.);
@@ -997,6 +1002,9 @@ MAGICS_NO_EXPORT void CairoDriver::renderSimplePolygon(const int n, MFloat* x, M
 	currentShading_=M_SH_SOLID;
 }
 
+
+
+
 /*!
   \brief renders text strings
 
@@ -1054,7 +1062,8 @@ MAGICS_NO_EXPORT void CairoDriver::renderText(const Text& text) const
 
 		  alltext << "<span color=\""<<col.str()<<"\" font_family=\""<<magfont.name()<<"\" size=\""<<int(magfont.size()*FONT_SCALE*1024)<<"\"";
 		  if(styles.find("bold")    != styles.end())  alltext << " weight=\"bold\"";
-		  if(styles.find("italic")  != styles.end())  alltext << " style=\"italic\"";
+		  else if(styles.find("italic")  != styles.end())  alltext << " style=\"italic\"";
+		  else if(styles.find("bolditalic") != styles.end())  alltext << " style=\"italic\" weight=\"bold\"";
 		  if(text.getBlanking()) alltext << " background=\"#FFFFFF\"";
 		  if(styles.find("underlined") != styles.end()) alltext << " underline=\"single\"";
 		  if((*niceText).elevation()==SUPERSCRIPT)    alltext << "><sup";
diff --git a/src/drivers/CairoDriver.h b/src/drivers/CairoDriver.h
index 17ae2ce..4ed28db 100644
--- a/src/drivers/CairoDriver.h
+++ b/src/drivers/CairoDriver.h
@@ -66,7 +66,8 @@ public:
 		     magCompare(node.name(), "cairo_ps") ||
 		     magCompare(node.name(), "cairo_svg") ||
 		     magCompare(node.name(), "x") ||
-		     magCompare(node.name(), "cairo_eps") )
+		     magCompare(node.name(), "cairo_eps") ||
+		     magCompare(node.name(), "geotiff") )
 		{
 			XmlNode basic = node;
 			basic.name("driver");
@@ -85,12 +86,13 @@ public:
 		CairoDriverAttributes::set(map);
 	}
 
-	void setPNG() const {backend_ = "PNG";}
-	void setPDF() const {backend_ = "PDF";}
-	void setPS () const {backend_ = "PS";}
-	void setEPS() const {backend_ = "EPS";}
-	void setSVG() const {backend_ = "SVG";}
-	void setX()   const {backend_ = "X";}
+	void setPNG() const {backend_ = "png";}
+	void setPDF() const {backend_ = "pdf";}
+	void setPS () const {backend_ = "ps";}
+	void setEPS() const {backend_ = "eps";}
+	void setSVG() const {backend_ = "svg";}
+	void setX()   const {backend_ = "x";}
+	void setGEOTIFF() const {backend_ = "geotiff";}
 	void setCairo() const {backend_ = "cairo";}
 
 private:
@@ -109,6 +111,7 @@ private:
 	MAGICS_NO_EXPORT void renderPolyline2(const int n, MFloat *x, MFloat *y) const;
 	MAGICS_NO_EXPORT void renderSimplePolygon(const int, MFloat *, MFloat *) const;
 	MAGICS_NO_EXPORT void renderSimplePolygon(const Polyline& line) const;
+	MAGICS_NO_EXPORT void renderSimplePolygon() const;
 	MAGICS_NO_EXPORT void renderText(const Text& text) const;
 	MAGICS_NO_EXPORT void circle(const MFloat x, const MFloat y, const MFloat r, const int) const;
 	MAGICS_NO_EXPORT bool renderPixmap(MFloat,MFloat,MFloat,MFloat,int,int,unsigned char*,int,bool) const;
@@ -134,7 +137,9 @@ private:
 	MAGICS_NO_EXPORT MFloat setSymbolY(const MFloat y) const {return -y;}
 	MAGICS_NO_EXPORT MFloat setFlagY(const MFloat y) const {return -y;}
 	MAGICS_NO_EXPORT MFloat setY(const MFloat y) const {return y;}
-
+#ifdef MAGICS_GEOTIFF
+	MAGICS_NO_EXPORT void write_tiff() const;
+#endif
 	mutable MFloat offsetX_;
 	mutable MFloat offsetY_;
 	mutable stack<MFloat> offsetsX_;
diff --git a/src/drivers/KMLDriver.cc b/src/drivers/KMLDriver.cc
index 9e96a49..24dae1d 100755
--- a/src/drivers/KMLDriver.cc
+++ b/src/drivers/KMLDriver.cc
@@ -57,8 +57,6 @@ extern "C"{
 #include <CairoDriver.h>
 #endif
 
-// #include <boost/filesystem.hpp>
-
 using namespace magics;
 
 bool copy_file(string from, string to)
@@ -161,134 +159,134 @@ void KMLDriver::close()
 
     // Wind icon file
     const string iconfile="magics_kml_icons.png";
-    const string path=getEnvVariable("MAGPLUS_HOME") + MAGPLUS_PATH_TO_SHARE_ + iconfile;
-//    boost::filesystem::path from(path);
-//    boost::filesystem::path to(iconfile);
-//    boost::filesystem::copy_file(from, to);
-    bool is_copied = copy_file(path,iconfile);
+    const string path=getEnvVariable("MAGPLUS_HOME") + MAGPLUS_PATH_TO_SHARE_;
+    const string icon_path=path + iconfile;
+
+    bool is_copied = copy_file(icon_path,iconfile);
     if(is_copied) kml_output_resource_list_.push_back(iconfile);
 
-	if(ecmwf_logo_)
+    if(ecmwf_logo_)
+    {
+       const string logofilename = "kml_logo.png";
+       const string logofile = path + logofilename;
+       is_copied = copy_file(logofile,logofilename);
+       if(is_copied) kml_output_resource_list_.push_back(logofilename);
+   
+       pFile_ << "<ScreenOverlay id=\"logo\">\n"
+              << "<name>MagLogo</name>\n"
+              << "<Icon>\n"
+              << " <href>"<<logofilename<<"</href>\n"
+              << "</Icon>\n"
+              << "<overlayXY x=\"0\" y=\"0\" xunits=\"fraction\" yunits=\"fraction\"/>\n"
+              << "<screenXY x=\"0\" y=\"0\" xunits=\"fraction\" yunits=\"fraction\"/>\n"
+              << "<size x=\"-1\" y=\"0.1\" xunits=\"fraction\" yunits=\"fraction\"/>\n"
+              << "</ScreenOverlay>\n";
+    }
+
+    pFile_ << "</Document>\n</kml>\n";
+    pFile_.close();
+    kml_output_resource_list_.push_back(fileName_);
+
+    /***********************  K M Z ********************************/    
+    if(kmz_ && !kml_output_resource_list_.empty())
+    {
+      fileName_ = getFileName("kmz");
+      zipFile zf;
+      int err=0;
+
+      zf = zipOpen(fileName_.c_str(),0);
+      if (zf == 0)
+      {
+        printf("ERROR opening zip file %s\n",fileName_.c_str());
+      }
+      else
+      {
+	int size_buf = WRITEBUFFERSIZE;
+	void* buf = (void*)malloc(size_buf);
+	if (buf==0)
 	{
-	   const string logofilename = "kml_logo.png";
-	   const string logofile = getEnvVariable("MAGPLUS_HOME") + MAGPLUS_PATH_TO_SHARE_ + logofilename;
-           is_copied = copy_file(logofile,logofilename);
-           if(is_copied) kml_output_resource_list_.push_back(logofilename);
-	   
-		pFile_	<< "<ScreenOverlay id=\"logo\">\n"
-			<< "<name>MagLogo</name>\n"
-			<< "<Icon>\n"
-			<< " <href>"<<logofilename<<"</href>\n"
-			<< "</Icon>\n"
-			<< "<overlayXY x=\"0\" y=\"0\" xunits=\"fraction\" yunits=\"fraction\"/>\n"
-			<< "<screenXY x=\"0\" y=\"0\" xunits=\"fraction\" yunits=\"fraction\"/>\n"
-			<< "<size x=\"-1\" y=\"0.1\" xunits=\"fraction\" yunits=\"fraction\"/>\n"
-			<< "</ScreenOverlay>\n";
+		MagLog::error() <<"Error allocating memory for KMZ generation!"<< std::endl;
+		return;
 	}
-	pFile_ << "</Document>\n</kml>\n";
-	pFile_.close();
-	kml_output_resource_list_.push_back(fileName_);
-
-	if(kmz_ && !kml_output_resource_list_.empty())
+	stringarray::iterator it    = kml_output_resource_list_.begin();
+	stringarray::iterator itend = kml_output_resource_list_.end();
+	for(; it != itend; it++)
 	{
-	   fileName_ = getFileName("kmz");
-
-	   zipFile zf;
-	   int err=0;
-
-	   zf = zipOpen(fileName_.c_str(),0);
-           if (zf == 0)
-           {
-               printf("ERROR opening zip file %s\n",fileName_.c_str());
-           }
-           else
-	   {
-		int size_buf = WRITEBUFFERSIZE;
-		void* buf = (void*)malloc(size_buf);
-		if (buf==0)
-		{
-			MagLog::error() <<"Error allocating memory for KMZ generation!"<< std::endl;
-			return;
-		}
-		stringarray::iterator it    = kml_output_resource_list_.begin();
-		stringarray::iterator itend = kml_output_resource_list_.end();
-		for(; it != itend; it++)
-		{
-			if(debug_) MagLog::dev()<< "KMLDriver.close() > Start adding file " <<  *it << " to KMZ file.\n";
-			FILE * fin;
-			int size_read;
+		if(debug_) MagLog::dev()<< "KMLDriver.close() > Start adding file " <<  *it << " to KMZ file.\n";
+		FILE * fin;
+		int size_read;
 
-			const char *filename = (*it).c_str();
+		const char *filename = (*it).c_str();
 
-			err = zipOpenNewFileInZip(zf,filename, 0, 0, 0, 0, 0, 0, Z_DEFLATED, Z_DEFAULT_COMPRESSION);
+		err = zipOpenNewFileInZip(zf,filename, 0, 0, 0, 0, 0, 0, Z_DEFLATED, Z_DEFAULT_COMPRESSION);
 
-			if(err != ZIP_OK)
-				MagLog::error() << "Could NOT open KMZ file "<< filename << endl;
-			else
-			{
-			  fin = fopen(filename,"rb");
-			  if(fin==0)
+		if(err != ZIP_OK)
+			MagLog::error() << "Could NOT open KMZ file "<< filename << endl;
+		else
+		{
+		  fin = fopen(filename,"rb");
+		  if(fin==0)
+		  {
+		     MagLog::error() << "Open file "<<filename<<" to be added to KMZ FAILED!"<< endl;
+		     return;
+		  }
+		  else
+		  {
+		    do{
+			err=ZIP_OK;
+			size_read = (int)fread(buf,1,size_buf,fin);
+			if (size_read < size_buf)
+			  if (feof(fin)==0)
 			  {
-			     MagLog::error() << "Open file "<<filename<<" to be added to KMZ FAILED!"<< endl;
-			     return;
+				MagLog::error() << "Could NOT add "<<(*it) << endl;
+				err = ZIP_ERRNO;
 			  }
-			  else
+
+			if (size_read>0)
+			{
+			  err = zipWriteInFileInZip(zf,buf,size_read);
+			  if (err<0)
 			  {
-			    do{
-				err=ZIP_OK;
-				size_read = (int)fread(buf,1,size_buf,fin);
-				if (size_read < size_buf)
-				  if (feof(fin)==0)
-				  {
-					MagLog::error() << "Could NOT add "<<(*it) << endl;
-					err = ZIP_ERRNO;
-				  }
-
-				if (size_read>0)
-				{
-				  err = zipWriteInFileInZip(zf,buf,size_read);
-				  if (err<0)
-				  {
-					MagLog::error() << "Could NOT write KMZ file "<< fileName_<< endl;
-				  }
-				}
-			     } while ((err==ZIP_OK) && (size_read>0));
+				MagLog::error() << "Could NOT write KMZ file "<< fileName_<< endl;
 			  }
-			  if (fin)
-				fclose(fin);
 			}
-
-			err = zipCloseFileInZip(zf);
-			if (err!=ZIP_OK)
-				MagLog::error() << "Could NOT close KMZ file "<< fileName_<< endl;
-//			delete [] filename;
+		     } while ((err==ZIP_OK) && (size_read>0));
+		  }
+		  if (fin)
+			fclose(fin);
 		}
-		free(buf);
 
-		err = zipClose(zf,0);
-		if (err != ZIP_OK)
+		err = zipCloseFileInZip(zf);
+		if (err!=ZIP_OK)
 			MagLog::error() << "Could NOT close KMZ file "<< fileName_<< endl;
-		else if (!debug_)
-		{
-			stringarray::iterator it = kml_output_resource_list_.begin();
-			stringarray::iterator itend = kml_output_resource_list_.end();
-			for(; it != itend; it++)
-			{
-				remove((*it).c_str());
-			}
-			printOutputName("KML kmz "+fileName_);
-		}
-	   }// Zipping ---> K M Z
+//		delete [] filename;
 	}
-	else if(!kmz_)
+	free(buf);
+
+	err = zipClose(zf,0);
+	if (err != ZIP_OK)
+		MagLog::error() << "Could NOT close KMZ file "<< fileName_<< endl;
+	else if (!debug_)
 	{
 		stringarray::iterator it = kml_output_resource_list_.begin();
 		stringarray::iterator itend = kml_output_resource_list_.end();
 		for(; it != itend; it++)
 		{
-			printOutputName("KML misc "+(*it));
+			remove((*it).c_str());
 		}
 	}
+	printOutputName("KML kmz "+fileName_);
+   }// end Zipping ---> K M Z
+  }
+  else if(!kmz_)
+  {
+	stringarray::iterator it = kml_output_resource_list_.begin();
+	stringarray::iterator itend = kml_output_resource_list_.end();
+	for(; it != itend; it++)
+	{
+		printOutputName("KML misc "+(*it));
+	}
+  }
 }
 
 /*!
@@ -307,7 +305,8 @@ MAGICS_NO_EXPORT void KMLDriver::startPage() const
 
 	polyline_begin_ = true;
 	polygon_begin_  = true;
-	currentLayer_   = "none";
+	currentLayer_   = "Page";
+	newLayer();
 }
 
 /*!
@@ -321,8 +320,7 @@ MAGICS_NO_EXPORT void KMLDriver::startPage() const
 MAGICS_NO_EXPORT void KMLDriver::endPage() const
 {
 	if (kml_placemark_) closePlacemark();
-
-	layer_=false;
+	closeLayer();
 	debugOutput("Close page");
 }
 
@@ -384,38 +382,35 @@ MAGICS_NO_EXPORT void KMLDriver::redisplay(const magics::LegendLayout& layout) c
 */
 MAGICS_NO_EXPORT void KMLDriver::redisplay(const StaticLayer& layer) const
 {
-  if(!magCompare("coastlines",layer.name()) ||coastlines_ )
-  {
-//	if(!magCompare(currentLayer_,layer.name()))
-//	{
-		currentLayer_     = (layer.name().empty()) ? "StaticLayer" : layer.name();
-		currentTimeBegin_ = layer.kmlTimeBegin();
-		currentTimeEnd_   = layer.kmlTimeEnd();
-		newLayer();
-		layer.visit(*this);
-		closeLayer();
-//	}
-//	else
-//		layer.visit(*this);
-  }
+	currentLayer_     = (layer.name().empty()) ? "StaticLayer" : layer.name();
+	currentTimeBegin_ = layer.timeBegin();
+	currentTimeEnd_   = layer.timeEnd();
+	currentTimeStamp_ = layer.timeStamp();
+	newLayer();
+	layer.visit(*this);
+	closeLayer();
 }
 
 MAGICS_NO_EXPORT void KMLDriver::redisplay(const StepLayer& layer) const
 {
-  if(!magCompare("coastlines",layer.name()) || coastlines_ )
-  {
-//	if(!magCompare(currentLayer_,layer.name()))
-//	{
-		currentLayer_     = (layer.name().empty()) ? "Step" : layer.name();
-		currentTimeBegin_ = layer.kmlTimeBegin();
-		currentTimeEnd_   = layer.kmlTimeEnd();
-		newLayer();
-		layer.visit(*this);
-		closeLayer();
-//	}
-//	else
-//		layer.visit(*this);
-  }
+	currentLayer_     = (layer.name().empty()) ? "Step" : layer.name();
+	currentTimeBegin_ = layer.timeBegin();
+	currentTimeEnd_   = layer.timeEnd();
+	currentTimeStamp_ = layer.timeStamp();
+	newLayer();
+	layer.visit(*this);
+	closeLayer();
+}
+
+MAGICS_NO_EXPORT void KMLDriver::redisplay(const SceneLayer& layer) const
+{
+	currentLayer_     = (layer.name().empty()) ? "Scene" : layer.name();
+//	currentTimeBegin_ = layer.timeBegin();
+//	currentTimeEnd_   = layer.timeEnd();
+//	currentTimeStamp_ = layer.timeStamp();
+	newLayer();
+	layer.visit(*this);
+	closeLayer();
 }
 
 /*!
@@ -425,6 +420,15 @@ MAGICS_NO_EXPORT void KMLDriver::redisplay(const StepLayer& layer) const
  */
 MAGICS_NO_EXPORT void KMLDriver::redisplay(const NoDataLayer& layer) const
 {
+	if( coastlines_ )
+	{
+		currentLayer_     = (layer.name().empty()) ? "NoData" : layer.name();
+		currentTimeBegin_ = layer.timeBegin();
+		currentTimeEnd_   = layer.timeEnd();
+		newLayer();
+		layer.visit(*this);
+		closeLayer();
+	}
 }
 
 /*!
@@ -435,11 +439,31 @@ MAGICS_NO_EXPORT void KMLDriver::newLayer() const
 {
 	if (kml_placemark_) closePlacemark();
 
+	// cut off path (especially for Metview
+	unsigned found = currentLayer_.find_last_of("/\\");
+	currentLayer_=currentLayer_.substr(found+1);
+
 	debugOutput("Start Layer - "+currentLayer_);
 
-	pFile_ << "<Folder>\n<name>"<<currentLayer_<<"</name>\n<open>0</open>\n"
+	pFile_ << "<Folder>\n<name>Layer:"<<currentLayer_<<"</name>\n<open>0</open>\n"
 	       << " <styleUrl>#check-hide-children</styleUrl>\n";
+	if(!currentTimeBegin_.empty())
+	{
+		pFile_	<< "<TimeStamp>\n"
+			<< " <when>"<<currentTimeStamp_<<"</when>\n"
+ 			<< "</TimeStamp>\n"
+			<< "<styleUrl>#hiker-icon</styleUrl>\n";
+	}
+	else
+	{
+		pFile_	<< "<TimeSpan>\n"
+			<< " <begin>"<<currentTimeBegin_<<"</begin>\n"
+			<< " <end>"<<currentTimeEnd_<<"</end>\n"
+ 			<< "</TimeSpan>\n";
+			//<< "<styleUrl>#hiker-icon</styleUrl>\n";
+	}
 
+	pFile_ << "<description><![CDATA[Layer:"<<currentLayer_<<"]]></description>\n";
 	polyline_begin_=true;
 	polygon_begin_=true;
 	layer_=true;
@@ -569,34 +593,9 @@ MAGICS_NO_EXPORT void KMLDriver::renderPolyline(const int n, MFloat *x, MFloat *
 	{
 		if (kml_placemark_) closePlacemark();
 		pFile_ << "<Placemark>\n";
-		if(layer_)
-		{
-			pFile_ << "<name>"<<currentLayer_<<"</name>\n";
-			if(!currentTimeBegin_.empty())
-			{
-//			   if(magCompare(currentTimeBegin_,currentTimeEnd_))
-//			   {
-//				pFile_	<< "<TimeStamp>\n"
-//					<< " <when>"<<currentTimeBegin_<<"</when>\n"
-// 					<< "</TimeStamp>\n"
-//					<< "<styleUrl>#hiker-icon</styleUrl>\n";
-//			   }
-//			   else
-			   {
-				pFile_	<< "<TimeSpan>\n"
-					<< " <begin>"<<currentTimeBegin_<<"</begin>\n"
-					<< " <end>"<<currentTimeEnd_<<"</end>\n"
- 					<< "</TimeSpan>\n";
-					//<< "<styleUrl>#hiker-icon</styleUrl>\n";
-			   }
-			}
-			pFile_	<< "<description><![CDATA["<<currentLayer_<<"]]></description>\n";
-		}
 		pFile_ << "<visibility>1</visibility>\n<open>0</open>\n";
-
 		kml_placemark_=true;
 
-
 		pFile_	<< "<Style>\n<LineStyle>\n";
 		writeColour(currentColour_);
 		pFile_	<< "\t<width>"<<currentLineWidth_<<"</width>\n"<<"</LineStyle>\n"
@@ -622,20 +621,6 @@ MAGICS_NO_EXPORT void KMLDriver::renderPolyline(const int n, MFloat *x, MFloat *
 }
 
 
-/*!
-  \brief renders a single line
-
-  This method renders a polyline with two points.The style is
-  determined by what is described in the current LineStyle.
-
-  \sa setLineParameters()
-  \param n number of points
-  \param x array of x values
-  \param y array of y values
-*/
-MAGICS_NO_EXPORT void KMLDriver::renderPolyline2(const int , MFloat* , MFloat* ) const
-{
-}
 
 /*!
   \brief renders a filled polygon
@@ -653,40 +638,8 @@ MAGICS_NO_EXPORT void KMLDriver::renderSimplePolygon(const int n, MFloat* xx, MF
 	if (!render_) return;
 	if (kml_placemark_) closePlacemark();
 
-//pFile_	<< "<!-- r:"<<r<<" g:"<<g<<" b:"<<b <<" -->"<< endl;
-	pFile_	<< "<Placemark>\n";
-//	if(layer_)
-//	{
-//		pFile_ << "<name>"<<currentLayer_<<"</name>\n"
-//		       << "<description><![CDATA["<<currentLayer_<<"]]></description>\n";
-//	}
-//	    << "<altitudeMode>clampToGround</altitudeMode>\n"
-	if(layer_)
-	{
-		pFile_ << "<name>"<<currentLayer_<<"</name>\n";
-		if(!currentTimeBegin_.empty())
-		{
-//			   if(magCompare(currentTimeBegin_,currentTimeEnd_))
-//			   {
-//				pFile_	<< "<TimeStamp>\n"
-//					<< " <when>"<<currentTimeBegin_<<"</when>\n"
-// 					<< "</TimeStamp>\n"
-//					<< "<styleUrl>#hiker-icon</styleUrl>\n";
-//			   }
-//			   else
-		   {
-			pFile_	<< "<TimeSpan>\n"
-				<< " <begin>"<<currentTimeBegin_<<"</begin>\n"
-				<< " <end>"<<currentTimeEnd_<<"</end>\n"
-				<< "</TimeSpan>\n";
-		   }
-		}
-		pFile_	<< "<description><![CDATA["<<currentLayer_<<"]]></description>\n";
-	}
-
-	pFile_<< "<visibility>1</visibility>\n<open>0</open>\n";
-
-//	kml_placemark_=true;
+	pFile_ << "<Placemark>\n";
+	pFile_ << "<visibility>1</visibility>\n<open>0</open>\n";
 
 	const int a = (int)(transparency_ * 2.55);
 
@@ -700,7 +653,6 @@ MAGICS_NO_EXPORT void KMLDriver::renderSimplePolygon(const int n, MFloat* xx, MF
 		<< "</Style>\n"
 		<< "<MultiGeometry>\n";
 	MultiGeometrySet_=true;
-//		polygon_begin_=false;
 
 	pFile_ << "<Polygon>\n"
 	       << " <extrude>1</extrude>\n"
@@ -743,37 +695,8 @@ void KMLDriver::renderSimplePolygon(const Polyline& line) const
 		y[i] = pp.y();
 	}
 
-	pFile_	<< "<Placemark>\n";
-//	if(layer_)
-//	{
-//		pFile_ << "<name>"<<currentLayer_<<"</name>\n"
-//		       << "<description><![CDATA["<<currentLayer_<<"]]></description>\n";
-//	}
-//	    << "<altitudeMode>clampToGround</altitudeMode>\n"
-	if(layer_)
-	{
-		pFile_ << "<name>"<<currentLayer_<<"</name>\n";
-		if(!currentTimeBegin_.empty())
-		{
-//			   if(magCompare(currentTimeBegin_,currentTimeEnd_))
-//			   {
-//				pFile_	<< "<TimeStamp>\n"
-//					<< " <when>"<<currentTimeBegin_<<"</when>\n"
-// 					<< "</TimeStamp>\n"
-//					<< "<styleUrl>#hiker-icon</styleUrl>\n";
-//			   }
-//			   else
-		   {
-			pFile_	<< "<TimeSpan>\n"
-				<< " <begin>"<<currentTimeBegin_<<"</begin>\n"
-				<< " <end>"<<currentTimeEnd_<<"</end>\n"
-				<< "</TimeSpan>\n";
-		   }
-		}
-		pFile_	<< "<description><![CDATA["<<currentLayer_<<"]]></description>\n";
-	}
-
-	pFile_<< "<visibility>1</visibility>\n<open>0</open>\n";
+	pFile_ << "<Placemark>\n";
+	pFile_ << "<visibility>1</visibility>\n<open>0</open>\n";
 
 	pFile_	<< "<Style>\n<PolyStyle>\n";
 	writeColour(currentColour_);
@@ -846,26 +769,9 @@ void KMLDriver::renderSimplePolygon(const Polyline& line) const
 */
 MAGICS_NO_EXPORT void KMLDriver::renderText(const Text& text) const
 {
-	if(text.empty()) return;
 }
 
-/*!
-  \brief drawing a circle
-
-  This method renders given text strings.
-
-  The meaning of the last parameter <i>s</i> is as follows:
-     - 0-8 determines how many quarters of the circle are filled. Starting from the top clock-wise.
-     - 9 fills the whole circle but leaves a vertical bar empty in the middle of the circle.
 
-  \param x X Position
-  \param y Y Position
-  \param r Radius of circle
-  \param s Style which determines how the circle is shaded
-*/
-MAGICS_NO_EXPORT void KMLDriver::circle(const MFloat , const MFloat , const MFloat , const int ) const
-{
-}
 
 /*!
   \brief render pixmaps
@@ -899,29 +805,7 @@ MagLog::dev()<< "KML driver Image import uses GD -> for better results use Cairo
 	out << 15 * kml_output_resource_list_.size();
 	const string filename = "KML_overlay_"+out.str()+"png";
 
-	pFile_	<< "<GroundOverlay>\n";
-	if(layer_)
-	{
-		if(!currentTimeBegin_.empty())
-		{
-//			   if(magCompare(currentTimeBegin_,currentTimeEnd_))
-//			   {
-//				pFile_	<< "<TimeStamp>\n"
-//					<< " <when>"<<currentTimeBegin_<<"</when>\n"
-// 					<< "</TimeStamp>\n"
-//					<< "<styleUrl>#hiker-icon</styleUrl>\n";
-//			   }
-//			   else
-			   {
-				pFile_	<< "<TimeSpan>\n"
-					<< " <begin>"<<currentTimeBegin_<<"</begin>\n"
-					<< " <end>"<<currentTimeEnd_<<"</end>\n"
- 					<< "</TimeSpan>\n"
-					<< "<styleUrl>#hiker-icon</styleUrl>\n";
-			   }
-		}
-		pFile_	<< "<name><![CDATA[Layer: "<<currentLayer_<<"]]></name>\n";
-	}
+	pFile_ << "<GroundOverlay>\n";
 
 	const int a = (int)(transparency_ * 2.55);
 	pFile_ << "<styleUrl>#hiker-icon</styleUrl>\n"
@@ -984,28 +868,6 @@ MagLog::dev()<< "KML driver Image import uses GD -> for better results use Cairo
 	string filename = "KML_overlay_"+out.str()+"png";
 
 	pFile_	<< "<GroundOverlay>\n";
-	if(layer_)
-	{
-		if(!currentTimeBegin_.empty())
-		{
-//			   if(magCompare(currentTimeBegin_,currentTimeEnd_))
-//			   {
-//				pFile_	<< "<TimeStamp>\n"
-//					<< " <when>"<<currentTimeBegin_<<"</when>\n"
-// 					<< "</TimeStamp>\n"
-//					<< "<styleUrl>#hiker-icon</styleUrl>\n";
-//			   }
-//			   else
-			   {
-				pFile_	<< "<TimeSpan>\n"
-					<< " <begin>"<<currentTimeBegin_<<"</begin>\n"
-					<< " <end>"<<currentTimeEnd_<<"</end>\n"
- 					<< "</TimeSpan>\n"
-					<< "<styleUrl>#hiker-icon</styleUrl>\n";
-			   }
-		}
-		pFile_	<< "<name><![CDATA[Time: "<<currentLayer_<<"]]></name>\n";
-	}
 
 	const int a = (int)(transparency_ * 2.55);
 	pFile_	<< "<styleUrl>#hiker-icon</styleUrl>\n"
@@ -1111,28 +973,6 @@ MagLog::dev()<< "KML driver uses GD -> for better results use Cairo backend."<<
 	const string filename = "KML_cell_overlay_"+layer_name+"_"+out.str()+".png";
 
 	pFile_	<< "<GroundOverlay>\n";
-	if(layer_)
-	{
-		if(!currentTimeBegin_.empty())
-		{
-//			   if(magCompare(currentTimeBegin_,currentTimeEnd_))
-//			   {
-//				pFile_	<< "<TimeStamp>\n"
-//					<< " <when>"<<currentTimeBegin_<<"</when>\n"
-// 					<< "</TimeStamp>\n"
-//					<< "<styleUrl>#hiker-icon</styleUrl>\n";
-//			   }
-//			   else
-			   {
-				pFile_	<< "<TimeSpan>\n"
-					<< " <begin>"<<currentTimeBegin_<<"</begin>\n"
-					<< " <end>"<<currentTimeEnd_<<"</end>\n"
- 					<< "</TimeSpan>\n"
-					<< "<styleUrl>#hiker-icon</styleUrl>\n";
-			   }
-		}
-		pFile_	<< "<name><![CDATA[Layer: "<<currentLayer_<<"]]></name>\n";
-	}
 
 	const int a = (int)(transparency_ * 2.55);
 	pFile_	<< "<color>"<<hex;
@@ -1209,28 +1049,6 @@ MagLog::dev()<< "KML driver uses GD -> for better results use Cairo backend."<<
         }
 
 	pFile_	<< "<GroundOverlay>\n";
-	if(layer_)
-	{
-		if(!currentTimeBegin_.empty())
-		{
-//			   if(magCompare(currentTimeBegin_,currentTimeEnd_))
-//			   {
-//				pFile_	<< "<TimeStamp>\n"
-//					<< " <when>"<<currentTimeBegin_<<"</when>\n"
-// 					<< "</TimeStamp>\n"
-//					<< "<styleUrl>#hiker-icon</styleUrl>\n";
-//			   }
-//			   else
-			   {
-				pFile_	<< "<TimeSpan>\n"
-					<< " <begin>"<<currentTimeBegin_<<"</begin>\n"
-					<< " <end>"<<currentTimeEnd_<<"</end>\n"
- 					<< "</TimeSpan>\n"
-					<< "<styleUrl>#hiker-icon</styleUrl>\n";
-			   }
-		}
-		pFile_	<< "<name><![CDATA[Layer: "<<currentLayer_<<"]]></name>\n";
-	}
 
 	const int a = (int)(transparency_ * 2.55);
 	pFile_	<< "<color>"<<hex;
diff --git a/src/drivers/KMLDriver.h b/src/drivers/KMLDriver.h
index 006727f..c46d68d 100755
--- a/src/drivers/KMLDriver.h
+++ b/src/drivers/KMLDriver.h
@@ -83,6 +83,7 @@ private:
 	MAGICS_NO_EXPORT void redisplay(const StaticLayer&) const;
 	MAGICS_NO_EXPORT void redisplay(const NoDataLayer&) const;
 	MAGICS_NO_EXPORT void redisplay(const StepLayer&) const;
+	MAGICS_NO_EXPORT void redisplay(const SceneLayer&) const;
 	MAGICS_NO_EXPORT void newLayer() const;
 	MAGICS_NO_EXPORT void closeLayer() const;
 
@@ -92,11 +93,11 @@ private:
 	MAGICS_NO_EXPORT int setLineParameters(const LineStyle style, const MFloat w) const;
 
 	MAGICS_NO_EXPORT void renderPolyline(const int, MFloat *, MFloat *) const;
-	MAGICS_NO_EXPORT void renderPolyline2(const int n, MFloat *x, MFloat *y) const;
+	MAGICS_NO_EXPORT void renderPolyline2(const int n, MFloat *x, MFloat *y) const {}
 	MAGICS_NO_EXPORT void renderSimplePolygon(const int, MFloat *, MFloat *) const;
 	MAGICS_NO_EXPORT void renderSimplePolygon(const Polyline& line) const;
 	MAGICS_NO_EXPORT void renderText(const Text& text) const;
-	MAGICS_NO_EXPORT void circle(const MFloat x, const MFloat y, const MFloat r, const int) const;
+	MAGICS_NO_EXPORT void circle(const MFloat x, const MFloat y, const MFloat r, const int) const {}
 	MAGICS_NO_EXPORT bool renderPixmap(MFloat,MFloat,MFloat,MFloat,int,int,unsigned char*,int, bool) const;
 	MAGICS_NO_EXPORT bool renderCellArray(const Image& obj) const;
 	MAGICS_NO_EXPORT void renderSymbols(const Symbol& symbol) const;
@@ -115,6 +116,7 @@ private:
 	mutable string		currentLayerPath_;
 	mutable string		currentTimeBegin_;
 	mutable string		currentTimeEnd_;
+	mutable string		currentTimeStamp_;
 	mutable bool		doKmz_;
 	mutable bool		kml_placemark_;
 	mutable bool		polyline_begin_;
diff --git a/src/drivers/MgQ/MgQDriverObject.h b/src/drivers/MgQ/MgQDriverObject.h
index 2a9f3ee..e8eaad0 100644
--- a/src/drivers/MgQ/MgQDriverObject.h
+++ b/src/drivers/MgQ/MgQDriverObject.h
@@ -26,7 +26,7 @@
     Started: April 2010
 */
 
-#ifndef MgQDriverObjectH
+#ifndef MgQDriverObject_H
 #define MgQDriverObject_H
 
 #include "QtDriver.h"
diff --git a/src/drivers/MgQ/MgQPlotScene.h b/src/drivers/MgQ/MgQPlotScene.h
index fb6e793..56f5eb1 100644
--- a/src/drivers/MgQ/MgQPlotScene.h
+++ b/src/drivers/MgQ/MgQPlotScene.h
@@ -26,7 +26,7 @@
     Started: March 2010
 */
 
-#ifndef MgPlotScene_H
+#ifndef MgQPlotScene_H
 #define MgQPlotScene_H
 
 #include <QGraphicsScene>
diff --git a/src/drivers/MgQ/MgQRootItem.h b/src/drivers/MgQ/MgQRootItem.h
index 3cdd114..51b15b7 100644
--- a/src/drivers/MgQ/MgQRootItem.h
+++ b/src/drivers/MgQ/MgQRootItem.h
@@ -32,6 +32,9 @@
 #include <magics.h>
 #include "MgQ.h"
 
+#include <QGraphicsItem>
+#include <QGraphicsScene>
+
 class MgQRootItem : public QGraphicsItem
 {
 public:
diff --git a/src/drivers/PostScriptDriver.cc b/src/drivers/PostScriptDriver.cc
index d9a1e14..966a88d 100644
--- a/src/drivers/PostScriptDriver.cc
+++ b/src/drivers/PostScriptDriver.cc
@@ -1016,11 +1016,14 @@ MAGICS_NO_EXPORT void PostScriptDriver::renderText(const Text& text) const
 		}
 
 		const std::set<string>& styles = magfont.styles();
+
 		string style = "";
 		if(styles.find("bold") != styles.end()) style = "bold";
-		if(styles.find("italic") != styles.end()) style += "italic";
+		else if(styles.find("italic") != styles.end()) style += "italic";
+		else if(styles.find("bolditalic") != styles.end()) style += "bolditalic";
 		if(style == "") style = "normal";
 		const string lowFont = lowerCase(magfont.name()+"_"+style);
+
 		fontMapIter iter = FontMap_.find(lowFont);
 
 		const bool underlined = (styles.find("underlined") != styles.end()) ? true : false;
@@ -1031,7 +1034,7 @@ MAGICS_NO_EXPORT void PostScriptDriver::renderText(const Text& text) const
 		else
 		{
 			font = 0; // if not found get default
-			MagLog::info() << "PostScriptDriver: Font "<< lowFont << " is not registered!\n   Default font used for "<<(*niceText).text()<<"."<< endl;
+			MagLog::warning() << "PostScriptDriver: Font "<< lowFont << " is not registered!\n   Default font used for "<<(*niceText).text()<<"."<< endl;
 		}
 
 		setNewColour(magfont.colour());
@@ -1209,7 +1212,7 @@ MAGICS_NO_EXPORT bool PostScriptDriver::renderPixmap(MFloat x0,MFloat y0,MFloat
 		switch ( col_model )
 		{
 			 case 0:
-				 sprintf(t,"%02hx%02hx%02hx",r,g,b);
+				 sprintf(t,"%02hhx%02hhx%02hhx",r,g,b);
 				 break;
 			 case 1:
 				 cc = 1. - (r*0.00392156); cm = 1. - (g*0.00392156); cy = 1. - (b*0.00392156);
@@ -1238,7 +1241,7 @@ MAGICS_NO_EXPORT bool PostScriptDriver::renderPixmap(MFloat x0,MFloat y0,MFloat
 				 sprintf(t,"%02hx%02hx%02hx",kr,kr,kr);
 				 break;
 			 default:
-				 sprintf(t,"%02hx%02hx%02hx",r,g,b);
+				 sprintf(t,"%02hhx%02hhx%02hhx",r,g,b);
 				 break;
 		}
 		*ps << t;
diff --git a/src/drivers/QtDriver.cc b/src/drivers/QtDriver.cc
index dcc1991..f08d88d 100644
--- a/src/drivers/QtDriver.cc
+++ b/src/drivers/QtDriver.cc
@@ -42,7 +42,9 @@
 #include <QDesktopWidget>
 #include <QGraphicsItem>
 #include <QPainter>
+#ifdef Q_WS_X11
 #include <QX11Info>
+#endif
 
 #include "MgQPlotScene.h"
 
@@ -67,7 +69,7 @@ using namespace magics;
 */
 QtDriver::QtDriver() 
 {
-	//scene_ = 0;
+	scene_ = 0;
 	initialized_=false;
 	symbolManager_=0;
 	patternManager_=0;
@@ -132,7 +134,11 @@ void QtDriver::open()
 	//We find out the screen dpy from Qt. It can be diffrenet to the value
 	//given by 'xdpyinfo' returned by scene->dpiResolution(). So we compute
 	//their ratio to correctly set font size for rendering!
-	int qtDpiResolution=QX11Info::appDpiY(0);
+#ifdef Q_WS_X11  // Do we work with a X11 display?
+	const int qtDpiResolution=QX11Info::appDpiY(0);
+#else     // for MacOS X
+	const int qtDpiResolution=72;
+#endif
 	if(qtDpiResolution < 50 || qtDpiResolution > 150)
 	{
 	  	dpiResolutionRatio_=1.;		
@@ -1166,7 +1172,7 @@ MAGICS_NO_EXPORT void QtDriver::renderText(const Text& text) const
 	//Loop for all string CO-ORDINATES
 	unsigned int noTexts = text.size();
 	for(unsigned int nT=0;nT<noTexts;nT++)  
-	{		
+	{
 		const MFloat x0 = projectX(text[nT].x());
 		const MFloat y0 = projectY(text[nT].y());
 		const MFloat an = text.getAngle()*57.29577951;
@@ -1177,20 +1183,21 @@ MAGICS_NO_EXPORT void QtDriver::renderText(const Text& text) const
 		
 		if(sameFontForItems)
 		{
-               		const MagFont magfont=magfontFirst;
+			const MagFont magfont=magfontFirst;
 			const std::set<string>& styles = magfont.styles();
 
 			pheight = 72.*magfont.size()/2.54; //height in points
-			pheight/=dpiResolutionRatio_; 		
+			pheight/=dpiResolutionRatio_;
 			pheight*=fontSizeFactor_;
 		
 			QFont font(QString::fromStdString(magfont.name()), pheight);
 			font.setPointSizeF(pheight);
 		
-			if (styles.find("underlined") != styles.end()) font.setUnderline(true);
-                	if(styles.find("bold") != styles.end())        font.setBold(true);
-                	if(styles.find("italic") != styles.end())      font.setItalic(true);
-		
+			if(styles.find("underlined") != styles.end())  font.setUnderline(true);
+			if(styles.find("bold") != styles.end())        font.setBold(true);
+			if(styles.find("italic") != styles.end())      font.setItalic(true);
+			if(styles.find("bolditalic") != styles.end())  {font.setItalic(true);font.setBold(true);}
+
 			QString allText;
 			for(vector<NiceText>::const_iterator niceText=text.textBegin(); niceText != text.textEnd(); niceText++)
 			{	
@@ -1200,12 +1207,12 @@ MAGICS_NO_EXPORT void QtDriver::renderText(const Text& text) const
 			}
 			
 			QFontMetrics fm(font);
-                	int width  = fm.width(allText);
-                	int height = fm.height();
+			int width  = fm.width(allText);
+			int height = fm.height();
 
 			MFloat x = 0;
-                	if(horizontal == MCENTRE)     x = width*.5;
-                	else if(horizontal == MRIGHT) x = width;
+			if(horizontal == MCENTRE)     x = width*.5;
+			else if(horizontal == MRIGHT) x = width;
 
 			MFloat y = 0.;
                 	if (vertical==MBASE)        { y = height;}
@@ -1279,7 +1286,7 @@ MAGICS_NO_EXPORT void QtDriver::renderText(const Text& text) const
 				
 		  	//Loop for the indidual text items
 			for(vector<NiceText>::const_iterator niceText=text.textBegin(); niceText != text.textEnd(); niceText++)                               
-			{					
+			{
 				const MagFont magfont = niceText->font();	
 				const std::set<string>& styles = magfont.styles();
 	
diff --git a/src/drivers/QtDriver.h b/src/drivers/QtDriver.h
index f1d4759..80f5868 100644
--- a/src/drivers/QtDriver.h
+++ b/src/drivers/QtDriver.h
@@ -33,11 +33,13 @@
 #include <QtDriverAttributes.h>
 #include <XmlNode.h>
 
+#include <QColor>
 #include <QMap>
 
 //#include <Qt/qqwidget.h>
 
 class QGraphicsItem;
+class QGraphicsScene;
 class QPainterPath;
 
 class MgQHistoItem;
@@ -105,6 +107,9 @@ public:
 	MAGICS_NO_EXPORT void executeHisto(Layer *,MgQHistoItem*,QString,QString) const;
 	void setUpdateMode(bool mode) { updateMode_ = mode; }
 	bool getUpdateMode() const    { return updateMode_; }
+
+	void setScene(QGraphicsScene* sc) {scene_=sc;}
+
 private:
 
 	MAGICS_NO_EXPORT void startPage() const;
@@ -183,6 +188,7 @@ private:
 	friend ostream& operator<<(ostream& s,const QtDriver& p)
 		{ p.print(s); return s; }
 
+	QGraphicsScene *scene_;
 	mutable int stepToRender_;
 	mutable std::stack<MgQLayoutItem*>  layoutItemStack_;
 	mutable std::stack<MgQLayerItem*>   layerItemStack_;
diff --git a/src/drivers/SVGDriver.cc b/src/drivers/SVGDriver.cc
index f157df5..3f478ef 100644
--- a/src/drivers/SVGDriver.cc
+++ b/src/drivers/SVGDriver.cc
@@ -100,7 +100,6 @@ void SVGDriver::close()
 MAGICS_NO_EXPORT void SVGDriver::startPage() const
 {
 	debugOutput("Page - START");
-//	bool fixSize = fixSize_;
 	MFloat ratio = getRatio();
 	int   wid   = width_;
 
@@ -157,12 +156,12 @@ MAGICS_NO_EXPORT void SVGDriver::startPage() const
 	         << "inkscape:version=\"0.46\"\n"
 	         << "inkscape:output_extension=\"org.inkscape.output.svg.inkscape\"\n";
 	
-//	if(fixSize) pFile_<< "width=\""<<width<<"px\" height=\""<<height<<"px\" ";          ?????????????????????????????????????????????????????
+	if(fixSize_) pFile_<< "width=\""<<width<<"px\" height=\""<<height<<"px\" ";
 
 	pFile_ << "viewBox=\"0 0 "<<width+1<<" "<<height+1<<"\" xml:space=\"preserve\"";   
 //	 preserveAspectRatio=\"xMidYMid meet\"\n"
 //	 << " shape-rendering=\"optimizeSpeed\" text-rendering=\"optimizeSpeed\""
-	if(scripting_) pFile_<< " onload=\"OnLoadEvent(evt)\"";
+///	if(scripting_) pFile_<< " onload=\"OnLoadEvent(evt)\"";
 	pFile_<< ">\n<title>"<<title_<<"</title>\n";
 
 	if(!desc_.empty()) pFile_<< "<desc>"<<desc_<<"</desc>\n";
@@ -180,7 +179,7 @@ MAGICS_NO_EXPORT void SVGDriver::startPage() const
 	      << "\t<dc:coverage>Plot of meteorological data</dc:coverage>\n";
 	if(!meta_.empty()) pFile_<< "<!-- \n"<<meta_<<"\n-->\n";
 	pFile_<<"</cc:Work></rdf:RDF>\n</metadata>\n";
-
+/*
 	if(scripting_)
 	{
 		pFile_ << "<defs>\n"
@@ -189,6 +188,7 @@ MAGICS_NO_EXPORT void SVGDriver::startPage() const
 		       << " </clipPath>\n"
 		       << "</defs>\n";
 	}
+*/
 	pFile_<< "<g id=\"page\" transform=\"translate(0,"<<dimensionY_<<")\" vector-effect=\"non-scaling-stroke\">\n";
 }
 
@@ -206,7 +206,7 @@ MAGICS_NO_EXPORT void SVGDriver::endPage() const
 	debugOutput("Page - END");
 	closeGroup();
 	pFile_	<< "</g><!--ePage-->\n";   // needed for y-axis translation in beginning!
-
+/*
 	if(scripting_)
 	{
 		pFile_ << "<g id=\"menu\" visibility=\"visible\" fill=\"blue\" stroke=\"none\" font-size=\"10\" transform=\"translate("<<static_cast<int>(dimensionX_)-100<<" 5)\""
@@ -299,19 +299,19 @@ MAGICS_NO_EXPORT void SVGDriver::endPage() const
 			}
 			pFile_	<< "]]></script>\n";
 	}
-
+*/
 	pFile_ << "</svg>\n";
 	pFile_.close();
 
 	layers_.clear();
-/*
+
 	stringarray::iterator it    = svg_output_resource_list_.begin();
 	stringarray::iterator itend = svg_output_resource_list_.end();
 	for(; it != itend; it++)
 	{
 		printOutputName("SVG misc "+(*it));
 	}
-*/
+
 }
 
 /*!
@@ -381,6 +381,20 @@ MAGICS_NO_EXPORT void SVGDriver::unproject() const
 }
 
 
+MAGICS_NO_EXPORT string SVGDriver::buildLayerName(const Layer* layer, string type) const
+{
+  string s=layer->name();
+  if(s.empty()) return type;
+
+  char chars[] = "<>";
+  for (unsigned int i = 0; i < strlen(chars); ++i)
+  {
+    s.erase(std::remove(s.begin(), s.end(), chars[i]), s.end());
+  }
+  return s;
+}
+
+
 
 /*!
   \brief setup a new layer
@@ -392,10 +406,7 @@ MAGICS_NO_EXPORT void SVGDriver::unproject() const
 */
 MAGICS_NO_EXPORT void SVGDriver::redisplay(const StaticLayer& layer) const
 {
-	const string layName = layer.name();
-	currentLayer_ = (layName.empty()) ? "StaticLayer" : layName;
-//	currentTimeBegin_ = layer.kmlTimeBegin();
-//	currentTimeEnd_   = layer.kmlTimeEnd();
+	currentLayer_ = buildLayerName(&layer,string("StaticLayer"));
 
 	newLayer();
 	layer.visit(*this);
@@ -405,8 +416,7 @@ MAGICS_NO_EXPORT void SVGDriver::redisplay(const StaticLayer& layer) const
 
 MAGICS_NO_EXPORT void SVGDriver::redisplay(const StepLayer& layer) const
 {
-	const string layName = layer.name();
-	currentLayer_ = (layName.empty()) ? "Step" : layName;
+	currentLayer_ = buildLayerName(&layer,string("StepLayer"));
 
 	newLayer();
 	layer.visit(*this);
@@ -419,8 +429,7 @@ MAGICS_NO_EXPORT void SVGDriver::redisplay(const StepLayer& layer) const
  */
 MAGICS_NO_EXPORT void SVGDriver::redisplay(const NoDataLayer& layer) const
 {
-	const string layName = layer.name();
-	currentLayer_ = (layName.empty()) ? "Coast" : layName;
+	currentLayer_ = buildLayerName(&layer,string("Coastline"));
 
 	newLayer();
 	layer.visit(*this);
@@ -638,7 +647,11 @@ MAGICS_NO_EXPORT void SVGDriver::renderPolyline(const int n, MFloat *x, MFloat *
 MAGICS_NO_EXPORT void SVGDriver::renderPolyline2(const int n, MFloat* x, MFloat* y) const
 {
 	if(n != 2 || (currentColour_==Colour("none")) ) return;
-	pFile_ << "<path d=\"M"<<x[0]<< " " <<setY(y[0])<<"L"<< x[1] <<" "<< setY(y[1]) << "\"/>\n";
+	closeGroup();
+	const int r = static_cast<int>(currentColour_.red()  *255);
+	const int g = static_cast<int>(currentColour_.green()*255);
+	const int b = static_cast<int>(currentColour_.blue() *255);
+	pFile_ << "<path stroke=\"rgb("<<r<<","<<g<<","<<b<<")\" d=\"M"<<x[0]<< " " <<setY(y[0])<<"L"<< x[1] <<" "<< setY(y[1]) << "\"/>\n";
 }
 
 /*!
@@ -664,9 +677,8 @@ MAGICS_NO_EXPORT void SVGDriver::renderSimplePolygon(const int n, MFloat* x, MFl
 
 	ostringstream gStream;
 	if(currentColour_.alpha() < 1.) gStream << "fill-opacity=\""<<currentColour_.alpha()<<"\" stroke-opacity=\"0.01\" ";
-	gStream << "stroke=\"none\" fill-rule=\"evenodd\"";
+	gStream << "stroke=\"rgb("<<r<<","<<g<<","<<b<<")\" stroke-width=\"0.01\" fill-rule=\"evenodd\"";
 	openGroup(gStream.str());
-	//if(currentColour_.red()*currentColour_.green()*currentColour_.blue()<0) return;
 
 	int count = 1;
 	MFloat old_x = projectX(x[0]);
@@ -675,7 +687,7 @@ MAGICS_NO_EXPORT void SVGDriver::renderSimplePolygon(const int n, MFloat* x, MFl
 	double sumV = 0;
 	double sumH = 0;
 	ostringstream stream;
-	stream  <<" d=\"M"<<old_x<< " " << old_y;
+	stream  <<"d=\"M"<<old_x<< " " << old_y;
 
 	for(int is=1;is<n;is++)
 	{
@@ -710,9 +722,7 @@ MAGICS_NO_EXPORT void SVGDriver::renderSimplePolygon(const int n, MFloat* x, MFl
 	if     (fabs(sumV) > 0.001) {stream <<"v"<< sumV;}
 	else if(fabs(sumH) > 0.001) {stream <<"h"<< sumH;}
 
-//	if(!interactive_) stream  << "pointer-events=\"none\" ";
-
-	if(count > 3)
+	if(count > 2)
 	{
 		if(currentShading_==M_SH_DOT)
 		{
@@ -774,7 +784,7 @@ MAGICS_NO_EXPORT void SVGDriver::renderSimplePolygon(const int n, MFloat* x, MFl
 				<< r << ","
 				<< g << ","
 				<< b << ")\" ";
-//				<< "stroke=\"rgb("               // mde ECMWF logo blurry
+//				<< "stroke=\"rgb("               // made ECMWF logo blurry
 //				<< static_cast<int>(currentColour_.red()  *255) << ","
 //				<< static_cast<int>(currentColour_.green()*255) << ","
 //				<< static_cast<int>(currentColour_.blue() *255) << ")\" "
@@ -983,12 +993,15 @@ MAGICS_NO_EXPORT void SVGDriver::renderText(const Text& text) const
 		setNewColour(magfont.colour());
 		const MFloat dheight = magfont.size()*text_scale;
 		const std::set<string>& styles = magfont.styles();
-		string style = "";
-		if(styles.find("bold") != styles.end()) style = "bold";
-		if(styles.find("italic") != styles.end()) style += "italic";
-		if(style == "") style = "normal";
-		const string font   = magfont.name()+"_"+style;
-
+//		for (std::set<string>::iterator it=styles.begin(); it!=styles.end(); ++it)
+//		   std::cout << '_' << *it;
+//		string style = "";
+//		if(styles.find("bolditalic") != styles.end()) style = "bolditalic";
+//		else if(styles.find("bold") != styles.end()) style = "bold";
+//		else if(styles.find("italic") != styles.end()) style = "italic";
+		string style = "normal";
+//		cout << "___"<<style<<endl;
+		const string font = magfont.name()+"_"+style;
 		if (verticalAlign==MBASE )       vertical = dheight * .15;
 		else if (verticalAlign==MTOP)    vertical = dheight;
 		else if (verticalAlign==MHALF)   vertical = dheight * .5;
@@ -1014,8 +1027,9 @@ MAGICS_NO_EXPORT void SVGDriver::renderText(const Text& text) const
 		   {
 			ostringstream stream;
 			stream << "text-anchor=\""<<justification<< "\" font-size=\""<<dheight<<"cm\" font-family=\""<< ttf << "\" ";
-			if(styles.find("bold") != styles.end())   stream <<"font-weight=\"bold\" ";
-			if(styles.find("italic") != styles.end()) stream <<"font-style=\"italic\" ";
+			if(styles.find("bolditalic") != styles.end()) stream <<"font-weight=\"bold\" font-style=\"italic\" ";
+			else if(styles.find("bold")  != styles.end()) stream <<"font-weight=\"bold\" ";
+			else if(styles.find("italic")!= styles.end()) stream <<"font-style=\"italic\" ";
 			if(text.getAngle()!=0)
 				stream << "transform=\"rotate("<<text.getAngle()*57.29577951<<","<<xxx<<","<<yyy<<")\" ";
 			stream << "fill=\"rgb("<<static_cast<int>(currentColour_.red()*255)<<","<<static_cast<int>(currentColour_.green()*255)<<","
@@ -1035,8 +1049,9 @@ MAGICS_NO_EXPORT void SVGDriver::renderText(const Text& text) const
 		{
 		  pFile_ <<"<tspan "
 		      <<"font-size=\""<<dheight<<"cm\" font-family=\""<< ttf << "\" ";
-		  if(styles.find("bold") != styles.end())   pFile_ <<"font-weight=\"bold\" ";
-		  if(styles.find("italic") != styles.end()) pFile_ <<"font-style=\"italic\" ";
+		  if(styles.find("bolditalic") != styles.end()) pFile_ <<"font-weight=\"bold\" font-style=\"italic\" ";
+		  else if(styles.find("bold")  != styles.end()) pFile_ <<"font-weight=\"bold\" ";
+		  else if(styles.find("italic")!= styles.end()) pFile_ <<"font-style=\"italic\" ";
 		  pFile_ <<"fill=\"rgb("<<static_cast<int>(currentColour_.red()*255)<<","<<static_cast<int>(currentColour_.green()*255)<<","
 		      << static_cast<int>(currentColour_.blue()*255)<<")\""
 		      <<">"<<(*niceText).text()<<"</tspan>";
@@ -1468,7 +1483,7 @@ MAGICS_NO_EXPORT void SVGDriver::renderSymbols(const Symbol& symbol) const
 	  const MFloat y = projectY(symbol[0].y());
 
 	  string logofile;
-	  if(magCompare(location,"WWW")) logofile = "http://www.ecmwf.int/publications/manuals/magics/magplus/resources/ecmwf_logo.png";
+	  if(magCompare(location,"WWW")) logofile = "http://old.ecmwf.int/publications/manuals/magics/magplus/resources/ecmwf_logo.png";
 	  else if(magCompare(location,"LOCAL")) logofile = "ecmwf_logo.png";
 	  else logofile = getEnvVariable("MAGPLUS_HOME") + MAGPLUS_PATH_TO_SHARE_ + "ecmwf_logo.png";
 	  svg_output_resource_list_.push_back(logofile);
diff --git a/src/drivers/SVGDriver.h b/src/drivers/SVGDriver.h
index bc5a021..ddd61a1 100644
--- a/src/drivers/SVGDriver.h
+++ b/src/drivers/SVGDriver.h
@@ -82,6 +82,7 @@ private:
 	MAGICS_NO_EXPORT void redisplay(const StaticLayer& layer) const;
 	MAGICS_NO_EXPORT void redisplay(const StepLayer& layer) const;
 	MAGICS_NO_EXPORT void redisplay(const NoDataLayer& layer) const;
+	MAGICS_NO_EXPORT string buildLayerName(const Layer* layer, string type) const;
 	MAGICS_NO_EXPORT void newLayer() const;
 	MAGICS_NO_EXPORT void closeLayer() const;
 //	MAGICS_NO_EXPORT void renderInteractiveBegin(const InteractiveBegin&) const;
@@ -96,7 +97,7 @@ private:
 	MAGICS_NO_EXPORT void renderPolyline(const int, MFloat *, MFloat *) const;
 	MAGICS_NO_EXPORT void renderPolyline2(const int n, MFloat *x, MFloat *y) const;
 	MAGICS_NO_EXPORT void renderSimplePolygon(const int, MFloat *, MFloat *) const;
-	MAGICS_NO_EXPORT void renderSimplePolygon(const Polyline& lines) const;
+	MAGICS_NO_EXPORT void renderSimplePolygon(const Polyline& line) const;
 	MAGICS_NO_EXPORT void renderText(const Text& text) const;
 	MAGICS_NO_EXPORT bool renderPixmap(MFloat,MFloat,MFloat,MFloat,int,int,unsigned char*,int,bool) const;
 	MAGICS_NO_EXPORT void renderSymbols(const Symbol& symbol) const;
diff --git a/src/libMagWrapper/MagPlus.cc b/src/libMagWrapper/MagPlus.cc
index b099221..ef66a5d 100644
--- a/src/libMagWrapper/MagPlus.cc
+++ b/src/libMagWrapper/MagPlus.cc
@@ -10,6 +10,7 @@
 #include <AxisWrapper.h>
 #include <VisualAction.h>
 #include "MetaDataWrapper.h"
+#include "ImportObjectHandlerWrapper.h"
 
 #ifdef MAGICS_GRIB
 #include <GribDecoderWrapper.h>
@@ -157,7 +158,7 @@ MagPlus::MagPlus() : root_(0), superpage_(-1), geographical_(true), mode_(intera
  		sceneCreators_["PAGE"] = &MagPlus::page;
  		sceneCreators_["NEWPAGE"] = &MagPlus::newpage;
  		sceneCreators_["MCOAST"] = &MagPlus::coastlines;
- 		sceneCreators_["MTEPHI"] = &MagPlus::tephigrid;
+ 		sceneCreators_["MTHERMOGRID"] = &MagPlus::tephigrid;
  		sceneCreators_["PCOAST"] = &MagPlus::oldcoastlines;
 
 
@@ -222,7 +223,7 @@ MagPlus::MagPlus() : root_(0), superpage_(-1), geographical_(true), mode_(intera
         sceneCreators_["MTEXT"] = &MagPlus::text;
         sceneCreators_["MLEGEND"] = &MagPlus::legend;
         sceneCreators_["DEVICE"] = &MagPlus::device;
-        sceneCreators_["PIMPORT"] = &MagPlus::import; 
+        sceneCreators_["MIMPORT"] = &MagPlus::import;
         sceneCreators_["PRASTER"] = &MagPlus::raster;
         sceneCreators_["PRASTERLOOP"] = &MagPlus::rasterloop;
         sceneCreators_["BINNING_OBJECT"] = &MagPlus::binning;
@@ -336,7 +337,7 @@ bool MagPlus::qtdriver(magics::MagRequest& /*in*/)
 	{
 		assert(qtScene_);
 		qtDriver_ = new magics::QtDriver();
-        qtDriver_->scene_= qtScene_;
+        qtDriver_->setScene(qtScene_);
 
 	}
 #ifndef MAG_NEXT
@@ -577,7 +578,7 @@ bool MagPlus::cartesianGrid(magics::MagRequest& in) {
 }
 bool MagPlus::tephiGrid(magics::MagRequest& in)
 {
-	magics::MagRequest& tephi = in.getSubRequest("TEPHIGRAM_GRID");
+	magics::MagRequest& tephi = in.getSubRequest("THERMO_GRID");
 	if ( tephi ) {
 
 		// use the user defined one
@@ -592,7 +593,7 @@ bool MagPlus::tephiGrid(magics::MagRequest& in)
 	}
 	else {
 		TephiGrid* grid = new TephiGrid();
-		grid->icon("Tephigram Grid", "MTEPHI");
+		grid->icon("Tephigram Grid", "MTHERMO_GRID");
 		top()->push_back(grid);
 
 	}
@@ -646,8 +647,8 @@ bool MagPlus::tephigrid(magics::MagRequest& in)
 	MagLog::dev()<< "add Tephi Grid" << endl;
 
 
-	replace_string(in, "_NAME", "", "Tephigram");
-	replace_string(in, "_CLASS", "", "MTEPHI");
+	replace_string(in, "_NAME", "", "Thermogrid");
+	replace_string(in, "_CLASS", "", "MTHERMOGRID");
 	TephiGridWrapper helper;
 
 	helper.set(in);
@@ -679,9 +680,12 @@ bool MagPlus::axis(magics::MagRequest& in)
 	return false; // do not exit
 }
 
-bool MagPlus::import(magics::MagRequest& /*in*/)
+bool MagPlus::import(magics::MagRequest& in)
 {
-	MagLog::dev()<< "ignore for now!!!" << endl;
+
+	ImportObjectHandlerWrapper object;
+	object.set(in);
+	top()->push_back(object.object());
 	return false; // do not exit
 }
 
@@ -1200,6 +1204,8 @@ void checknctypes() {
 	        nctypes["NETCDF_XY_POINTS"] = "xypoint";
 	        nctypes["NETCDF_XY_VECTORS"] = "vector";
 	        nctypes["NETCDF_XY_MATRIX"] = "matrix";
+	        nctypes["ARRAY"] = "matrix";
+	        nctypes["MATRIX"] = "complex_matrix";
 
 	        nctypes["NETCDF_GEOPOINTS"] = "geopoint";
 	        nctypes["NETCDF_GEOVECTORS"] = "geovector";
@@ -1224,8 +1230,8 @@ bool MagPlus::netcdf(magics::MagRequest& in)
 	in("NETCDF_FILENAME") = path.c_str();
 	    static map<string, string> types;
 
-	string type = get(in, "NETCDF_PLOT_TYPE", in.getVerb());
-	in("NETCDF_TYPE") = nctypes[type].c_str();
+    string type = get(in, "NETCDF_POSITION_TYPE", in.getVerb());
+   	in("NETCDF_TYPE") = nctypes[type].c_str();
 
 	VisualAnimation* action = new VisualAnimation();
 	top()->push_back(action);
diff --git a/src/magics.h b/src/magics.h
index c462c1b..2c6a4ea 100644
--- a/src/magics.h
+++ b/src/magics.h
@@ -80,11 +80,13 @@
 #define MAGICS_DEPRECATED
 #endif
 
+#include <cstdlib>
+
 #include <iostream>
 #include <cstring>
 #include <string>
 #include <sstream>
-#include <fstream>
+//#include <fstream>
 
 using std::string;
 using std::ostream;
@@ -96,21 +98,21 @@ using std::ostringstream;
 using std::ofstream;
 using std::ifstream;
 
-#include <list>
+//#include <list>
 #include <vector>
-#include <stack>
+//#include <stack>
 #include <memory>
 #include <map>
 #include <set>
-#include <iterator>
+//#include <iterator>
 #include <numeric>
 //#include <cfloat>
-#include <algorithm>
+//#include <algorithm>
 
 using std::allocator;
 using std::vector;
 using std::pair;
-using std::list;
+//using std::list;
 using std::map;
 using std::set;
 using std::auto_ptr;
@@ -305,7 +307,7 @@ inline MAGICS_NO_EXPORT bool fileReadable(const string &strFile)
 */
 
 #define MAGPLUS_PATH_TO_SHARE_ "/share/magics/"
-#define MAGPLUS_LINK_  "http://www.ecmwf.int/publications/manuals/magics"
+#define MAGPLUS_LINK_  "http://software.ecmwf.int/magics"
 #define MAGPLUS_PATH_TO_PS_FONTS_ POSTSCRIPT_FONT_PATH;
 }
 #endif
diff --git a/src/magics_ecmwf_log.h b/src/magics_ecmwf_log.h
index 88df0be..bf3769e 100644
--- a/src/magics_ecmwf_log.h
+++ b/src/magics_ecmwf_log.h
@@ -36,17 +36,16 @@ inline MAGICS_NO_EXPORT void writeMagLog(const std::string &interface)
 {
   if(magCompare(MAGICS_SITE,"ecmwf"))
   {
-//   string logpath = getEnvVariable("MAG_LOGGING_FILE");
-//   if(logpath.empty()) logpath = "/vol/netlog/magics/usage_log";
-//   FILE* filePtr_ = fopen(logpath.c_str(),"a");
-   FILE* filePtr_ = fopen("/vol/netlog/magics/usage_log","a");
-
-   if(filePtr_)
-   {
-	string id = getEnvVariable("USER"); //user-id
-
-	if(! (id=="cgm" || id=="cgs" || id=="cgi" || id=="cgk" || id=="cgr" || id=="cgjd" ) )
-	{
+     string id = getEnvVariable("USER"); //user-id
+
+     if(! (id=="cgm" || id=="cgs" || id=="cgi" || id=="cgk" || id=="cgr" ) )
+     {
+//     string logpath = getEnvVariable("MAG_LOGGING_FILE");
+//     if(logpath.empty()) logpath = "/vol/netlog/magics/usage_log";
+//     FILE* filePtr_ = fopen(logpath.c_str(),"a");
+       FILE* filePtr_ = fopen("/vol/netlog/magics/usage_log","a");
+       if(filePtr_)
+       {
 		char            host[64];
 		char            mytime[24];
 		time_t          when;
@@ -69,10 +68,9 @@ inline MAGICS_NO_EXPORT void writeMagLog(const std::string &interface)
 		fprintf(filePtr_,"%s\n",logline.c_str());
 
 		fflush(filePtr_);
-
-	}//endif NOT cgm or cgs
-	fclose(filePtr_);
-   }
+		fclose(filePtr_);
+       }
+     }//endif NOT cgm or cgs
   }
 }
 
diff --git a/src/oda/OdaDecoder.cc b/src/oda/OdaDecoder.cc
index f3b4c7d..5243be2 100644
--- a/src/oda/OdaDecoder.cc
+++ b/src/oda/OdaDecoder.cc
@@ -31,9 +31,19 @@
 #include <map>
 #include <set>
 
-#include "odblib/odb_api.h"
+#ifdef ODB_ECKIT
+    #include <odb_api/ColumnType.h>
+    #include <odb_api/Reader.h>
+#else
+    #include <odblib/odb_api.h>
+#endif
+
 extern "C" {
-#include "odblib/odbcapi.h"
+#ifdef ODB_ECKIT
+    #include <odb_api/odbcapi.h>
+#else
+    #include <odblib/odbcapi.h>
+#endif
 }
 
 
@@ -43,14 +53,13 @@ extern "C" {
 #include "SciMethods.h"
 #include "TextVisitor.h"
 
-#include "odblib/Reader.h"
 
 static int getOdbColumnIndex(odb::Reader::iterator &,const string&);
 
 int getOdbColumnIndex(odb::Reader::iterator &firstRowIt,const string& colName)
 {
 	int index=0;
-  	for(odb::MetaData::iterator it=firstRowIt->columns().begin(); it != firstRowIt->columns().end(); ++it)
+  	for(odb::MetaData::const_iterator it=firstRowIt->columns().begin(); it != firstRowIt->columns().end(); ++it)
 	{			
 		string s=(*it)->name();
 		if(s == colName)
@@ -291,10 +300,13 @@ void OdaGeoDecoder:: visit(TextVisitor& title)
 	{
 		ostringstream text;
 		if ( !info("stats::min").empty() && !info("stats::max").empty() ) {
-			text  << "Min: " << info("stats::min") << " Max: " << info("stats::max") << " (" <<  size() << " points)";
+			text  << "Min: " << info("stats::min") << " Max: " << info("stats::max") << " (" << info("stats::points") << " points)";
 		}
-		else
-			text << size() << " points";
+		else {
+			string pts = info("stats::points").empty() ? "0" : info("stats::points");
+			text << pts << " points";
+		}
+
 		title.addAutomaticTitle(text.str());
 	}
 	else if (info("stats::points").empty())
diff --git a/src/params/ArrowPlotting.xml b/src/params/ArrowPlotting.xml
index 7a9385a..fdbd5c9 100644
--- a/src/params/ArrowPlotting.xml
+++ b/src/params/ArrowPlotting.xml
@@ -7,7 +7,6 @@
 	  		<option xml="calm" fortran="on" include="CalmIndicator.h" name="CalmIndicator">		</option>
       		<option xml="nocalm" fortran="off" include="CalmIndicator.h" name="NoCalmIndicator">		</option>
       		<set name="wind_arrow_calm_indicator_size" value="on">		</set>
-      		<set name="wind_arrow_calm_below" value="on">		</set>
 			<documentation>Plot calm indicator circle if wind speed is less than or equal to the value in WIND_ARROW_CALM_BELOW (ON / OFF)		</documentation>
   	</parameter>
 
diff --git a/src/params/BaseDriver.xml b/src/params/BaseDriver.xml
index 1f2d8ae..47d8b8c 100644
--- a/src/params/BaseDriver.xml
+++ b/src/params/BaseDriver.xml
@@ -18,56 +18,61 @@
 	</parameter>
 
 	<parameter member="firstnumber" to="bool" default="on" from="string" name="output_name_first_page_number">
-  		<documentation>Determines whether, for the first page of multipage output, the number is included in the filename. 		</documentation>
+  		<documentation>Determines whether, for the first page of multipage output, the number is included in the filename.</documentation>
 	</parameter>
 
 	<parameter member="firstvalue" to="int" default="1" from="int" name="output_name_first_page_number_value">
-  		<documentation>Sets the number of the first page. All other pages are number from this value onwards.		</documentation>
+  		<documentation>Sets the number of the first page. All other pages are number from this value onwards.</documentation>
 	</parameter>
 
 	<parameter member="fullname" to="string" default="" from="string" name="output_fullname">
-  		<documentation>Alternative way of specifying the output filename. Will be overwritten by output_name if defined.		</documentation>
+  		<documentation>Alternative way of specifying the output filename. Will be overwritten by output_name if defined.</documentation>
 	</parameter>
 
 	<parameter from="string" name="output_legacy_name" visible="no" default="" member="legacyname" to="string">
-  		<documentation>Alternative way of specifying the output filename. Will be overwritten by output_name if defined.		</documentation>
+  		<documentation>Alternative way of specifying the output filename. Will be overwritten by output_name if defined.</documentation>
 	</parameter>
 
 	<parameter member="numberingwidth" to="int" default="1" from="int" name="output_file_minimal_width">
-  		<documentation>Width of numbering of multi-file outputs (eg, 'plot.1.png' or 'plot.001.png').		</documentation>
+  		<documentation>Width of numbering of multi-file outputs (eg, 'plot.1.png' or 'plot.001.png').</documentation>
 	</parameter>
 
 	<parameter member="separator" to="string" default="." from="string" name="output_file_separator">
-  		<documentation>Defines the separator between root name and the page number. Default is a dot.		</documentation>
+  		<documentation>Defines the separator between root name and the page number. Default is a dot.</documentation>
 	</parameter>
 
 	<parameter from="string" name="output_mgb_template" visible="no" default="" member="mgb_template" to="string">
-  		<documentation for_docs="no">Path to the magics binary file to be used as a template 		</documentation>
+  		<documentation for_docs="no">Path to the magics binary file to be used as a template</documentation>
 	</parameter>
 
 	<parameter member="debug" to="bool" default="off" from="string" name="output_debug">
-  		<documentation>Defines if extra debug information are written in the output file (PS, EPS, SVG) or console (GIF/PNG).		</documentation>
+  		<documentation>Defines if extra debug information are written in the output file (PS, EPS, SVG) or console (GIF/PNG).</documentation>
   		<release>2.1		</release>        
 	</parameter>
 	<parameter member="width" to="int" default="800" from="int" name="output_width">
-  		<documentation>Defines the width of the image in pixels.(For GD and SVG)		</documentation>
+  		<documentation>Defines the width of the image in pixels.(For GD and SVG)</documentation>
 	</parameter>
 	<parameter member="resolution" to="int" default="300" from="int" name="output_resolution">
-  		<documentation>Defines the resolution of the (graphical) output in dpi (72 - screen, 300 - print).		</documentation>
+  		<documentation>Defines the resolution of the (graphical) output in dpi (72 - screen, 300 - print).</documentation>
 	</parameter>
 
 	<parameter member="filelist" to="bool" default="off" from="string" name="output_filelist">
- 		<documentation>Defines if a list of all generated files should be written.		</documentation>
+ 		<documentation>Defines if a list of all generated files should be written.</documentation>
  		<set name="output_filelist_name" value="on">		</set>
  		<release>2.7.10		</release>
 	</parameter>   
 
 	<parameter member="filelist_name" to="string" default="magics_outputs.lst" from="string" name="output_filelist_name">
- 		<documentation>Defines the name of the file containing the list of generated files.		</documentation>
+ 		<documentation>Defines the name of the file containing the list of generated files.</documentation>
  		<release>2.7.10		</release>
 	</parameter>
+	
+	<parameter name='output_filelist_reset' from='string' to='bool' member='filelist_reset' default='off'>
+	 <documentation>Defines if the file containing the list of generated files is started from scratch or appends to previous file.</documentation>
+	 <release>2.24.1</release>
+	</parameter>
  
  	<parameter from="intarray" name="output_frame_list" visible="no" default="intarray()" member="frame_list" to="intarray">
- 		<documentation for_docs="no">Defines the list of frames to plot ( if empty, all the frames will be plotted!).		</documentation>
+ 		<documentation for_docs="no">Defines the list of frames to plot ( if empty, all the frames will be plotted!).</documentation>
  	</parameter>
 </class></magics>
diff --git a/src/params/CMakeLists.txt b/src/params/CMakeLists.txt
index afb97d1..916dfaa 100644
--- a/src/params/CMakeLists.txt
+++ b/src/params/CMakeLists.txt
@@ -158,6 +158,7 @@ Proj4Geose.xml
 SDWindMode.xml
 SVGDriver.xml
 SampleContourMethod.xml
+ImportObjectHandler.xml
 
 SelectionMode.xml
 ShadingTechnique.xml
@@ -227,7 +228,7 @@ YRegularCoordinate.xml
 		EpsgramDecoder.xml
 		EquidistantTableMode.xml
 		FixedTableMode.xml
-		ImportObjectHandler.xml
+		
 		EfiDataDecoder.xml
 		EfiGraph.xml
 		EfiJSon.xml
@@ -318,4 +319,17 @@ endforeach()
 set( magics_xmls ${magics_xmls} PARENT_SCOPE )
 set( metview_xmls ${metview_xmls} PARENT_SCOPE )
 
+add_metview_definition_file(FILE ImportObjectHandler.xml  BASENAME MIMPORT   ACTION MIMPORT)
+
+add_metview_definition_file(FILE Contour.xml  BASENAME MCONT   ACTION MCONT)
+add_metview_definition_file(FILE SymbolPlotting.xml  BASENAME MSYMB ACTION   MSYMB)
+add_metview_definition_file(FILE Coastlines.xml      BASENAME MCOAST  ACTION MCOAST)
+add_metview_definition_file(FILE LegendVisitor.xml          BASENAME MLEGEND ACTION MLEGEND)
+add_metview_definition_file(FILE Wind.xml            BASENAME MWIND   ACTION MWIND)
+add_metview_definition_file(FILE GraphPlotting.xml   BASENAME MGRAPH  ACTION MGRAPH)
+add_metview_definition_file(FILE TextVisitor.xml     BASENAME MTEXT   ACTION MTEXT)
+add_metview_definition_file(FILE Axis.xml            BASENAME MAXIS   ACTION MAXIS)
+add_metview_definition_file(FILE BinningObject.xml   BASENAME BinningObject  ACTION MBINNING)
+add_metview_definition_file(FILE TephiGrid.xml   BASENAME MTHERMOGRID  ACTION MTHERMOGRID)
+add_metview_definition_file(FILE ObsPlotting.xml   BASENAME ObsPlotting  ACTION MOBS)
 
diff --git a/src/params/CairoDriver.xml b/src/params/CairoDriver.xml
index 192c026..e28e6a8 100644
--- a/src/params/CairoDriver.xml
+++ b/src/params/CairoDriver.xml
@@ -1,19 +1,23 @@
 <magics>
 <class inherits="BaseDriver" xmltag="cairo" name="CairoDriver" directory="drivers" prefix="output/output_cairo" action="Cairo" include="CairoDriver.h">
   	<documentation for_docs="no">
-   Output driver using the Cairo graphics library. This driver is still in the development stage!
+   Output driver using the Cairo graphics library.
   	</documentation>
 
  	<parameter from="cairo_t*" name="output_cairo_drawing_context" visible="no" default="0" metview="no" member="context" to="cairo_t*">
-   		<documentation> Programs can pass their own Cairo context for Magics to draw into it.		</documentation>
+   		<documentation> Programs can pass their own Cairo context for Magics to draw into it.</documentation>
  	</parameter> 
 
  	<parameter xml="transparent" from="string" name="output_cairo_transparent_background" default="off" member="transparent" to="string" values="on/off">
-   		<documentation>Defines the background to be transparent (only for PNG).		</documentation>
+   		<documentation>Defines the background to be transparent (only for PNG).</documentation>
  	</parameter>
 
  	<parameter xml="antialias" from="string" name="output_cairo_antialias" default="on" member="antialias" to="string" values="on/off">
-   		<documentation>Defines if lines are antialiased (only for PNG).		</documentation>
+   		<documentation>Defines if lines are antialiased (only for PNG).</documentation>
  	</parameter>
-
-</class></magics>
+<!--
+	 <parameter xml="quality" name='output_geotiff_quality' from='int' to='int' member='quality' default='1'>
+	 	 <documentation for_docs='no'>Defines the quality of GeoTiff output. The default of 1. Should be a value in the range 0-10.</documentation>
+	 </parameter>
+ -->
+ </class></magics>
diff --git a/src/params/Cities.xml b/src/params/Cities.xml
index 9500d4f..7b22a2c 100644
--- a/src/params/Cities.xml
+++ b/src/params/Cities.xml
@@ -5,7 +5,7 @@
   		<documentation>Unit for city name sizes.		</documentation>
 	</parameter>
  
-	<parameter member="font_name" to="string" default="sansserif" from="string" name="map_cities_font_name">
+	<parameter member="font_name" to="string" default="sansserif" from="string" name="map_cities_font">
    		<documentation>Font used to display the city names.		</documentation>
 	</parameter>
  
diff --git a/src/params/Contour.xml b/src/params/Contour.xml
index 66b7f72..19fae70 100644
--- a/src/params/Contour.xml
+++ b/src/params/Contour.xml
@@ -15,14 +15,11 @@
          		<documentation> Turn contouring on or off  		</documentation>
           		<option xml="isoline" fortran="on" include="IsoPlot.h" name="IsoPlot">		</option>
           		<option xml="noisoline" fortran="off" include="IsoPlot.h" name="NoIsoPlot">		</option>
-		 		<unset name="contour_line_style" value="off">		</unset>
-		 		<unset name="contour_line_thickness" value="off">		</unset>
-		 		<unset name="contour_line_colour" value="off">		</unset>
   	</parameter> 
       
   	<parameter member="method" to="ContourMethod" default="automatic" from="string" name="contour_method">
          		<documentation> Contouring method  		</documentation>
-         		<option xml="automatic" fortran="automatic" xmlfile="Akima" include="AutomaticContourMethod.h" name="AutomaticContourMethod">		</option>
+         		<option xml="automatic" fortran="automatic"  include="AutomaticContourMethod.h" name="AutomaticContourMethod">		</option>
          		<option xml="sample" fortran="sample" include="AutomaticContourMethod.h" name="SampleContourMethod">		</option>		
          		<option xml="linear" fortran="linear" include="ContourMethod.h" name="ContourMethod">		</option>
          		<option xml="akima760" fortran="akima760" include="Akima760Method.h" name="Akima760Method">		</option>
diff --git a/src/params/DateAxisMethod.xml b/src/params/DateAxisMethod.xml
index 905717c..7ac76f3 100644
--- a/src/params/DateAxisMethod.xml
+++ b/src/params/DateAxisMethod.xml
@@ -18,7 +18,7 @@
          		<documentation> Label colour for 'YEARS' 		</documentation> 
   	</parameter>
 
-  	<parameter member="year_font" to="string" default="sanserif" from="string" name="axis_years_label_font">
+  	<parameter member="year_font" to="string" default="sansserif" from="string" name="axis_years_label_font">
          		<documentation> Font to use for the label  		</documentation>
   	</parameter>
    	<parameter member="year_font_style" to="string" default="normal" from="string" name="axis_years_label_font_style">
@@ -44,7 +44,7 @@
          		<documentation> Label colour for months 		</documentation>
   	</parameter>
 
-   	<parameter member="month_font" to="string" default="sanserif" from="string" name="axis_months_label_font">
+   	<parameter member="month_font" to="string" default="sansserif" from="string" name="axis_months_label_font">
          		<documentation> Font to use for the label  		</documentation>
   	</parameter>
    	<parameter member="month_font_style" to="string" default="normal" from="string" name="axis_months_label_font_style">
@@ -81,7 +81,7 @@
   	<parameter member="sunday_colour" to="Colour" default="red" from="string" name="axis_days_sunday_label_colour">
          		<documentation> Label colour for sundays 		</documentation>
   	</parameter>
-  	<parameter member="day_font" to="string" default="sanserif" from="string" name="axis_days_label_font">
+  	<parameter member="day_font" to="string" default="sansserif" from="string" name="axis_days_label_font">
          		<documentation> Font to use for the label  		</documentation>
   	</parameter>
    	<parameter member="day_font_style" to="string" default="normal" from="string" name="axis_days_label_font_style">
@@ -102,7 +102,7 @@
    	<parameter member="hour_colour" to="Colour" default="black" from="string" name="axis_hours_label_colour">
          		<documentation> Label quality for hours 		</documentation>
   	</parameter>
-   	<parameter member="hour_font" to="string" default="sanserif" from="string" name="axis_hours_label_font">
+   	<parameter member="hour_font" to="string" default="sansserif" from="string" name="axis_hours_label_font">
          		<documentation> Font to use for the label  		</documentation>
   	</parameter>
    	<parameter member="hour_font_style" to="string" default="normal" from="string" name="axis_hours_label_font_style">
diff --git a/src/params/EpsGraph.xml b/src/params/EpsGraph.xml
index e80184c..218eea6 100644
--- a/src/params/EpsGraph.xml
+++ b/src/params/EpsGraph.xml
@@ -29,7 +29,7 @@
         	</parameter>
         	<parameter xml="max" from="float" name="eps_maximum" default="INT_MAX" member="max" to="float">            
         	</parameter>
-        	<parameter xml="max_font_name" from="string" name="eps_maximum_font_name" default="sansserif" member="max_font_name" to="string">            
+        	<parameter  from="string" name="eps_maximum_font" default="sansserif" member="max_font_name" to="string">            
         	</parameter>
         	<parameter xml="max_font_style" from="string" name="eps_maximum_font_style" default="normal" member="max_font_style" to="string">            
         	</parameter>
diff --git a/src/params/EpsPlume.xml b/src/params/EpsPlume.xml
index 2937b1c..77fad69 100644
--- a/src/params/EpsPlume.xml
+++ b/src/params/EpsPlume.xml
@@ -6,6 +6,9 @@
 			<parameter from="string" name="eps_plume_method" default="time_serie" member="method" to="string" values="time_serie/vertical_profile">           
             		<documentation> Type of visualisation required : time_serie or vertical_profile 		</documentation>
         	</parameter>
+        	<parameter from="string" name="eps_plume_legend" default="on" member="legend" to="bool" visible='false'>           
+            		<documentation> ignore legend 		</documentation>
+        	</parameter>
          	<parameter member="line" to="bool" default="on" from="string" name="eps_plume_members">           
             		<documentation>show the eps members  		</documentation>
         	</parameter>
diff --git a/src/params/FlagPlotting.xml b/src/params/FlagPlotting.xml
index b6d9d9e..fb01a9f 100644
--- a/src/params/FlagPlotting.xml
+++ b/src/params/FlagPlotting.xml
@@ -6,7 +6,6 @@
         		<option xml="calm" fortran="on" include="CalmIndicator.h" name="CalmIndicator">		</option>
         		<option xml="nocalm" fortran="off" include="CalmIndicator.h" name="NoCalmIndicator">		</option>
 			<set name="wind_flag_calm_indicator_size" value="on">		</set>
-			<set name="wind_flag_calm_below" value="on">		</set>
   	</parameter>
 
   	<parameter member="calm_indicator_size" to="float" default="0.3" from="float" name="wind_flag_calm_indicator_size">
diff --git a/src/params/FortranSceneNode.xml b/src/params/FortranSceneNode.xml
index c01be51..755df8f 100644
--- a/src/params/FortranSceneNode.xml
+++ b/src/params/FortranSceneNode.xml
@@ -27,7 +27,7 @@
          		<migration> Default as changed from magics6) 		</migration>
   	</parameter>
 
-  	<parameter member="frame_colour" to="Colour" default="blue" from="string" name="page_frame_colour">
+  	<parameter member="frame_colour" to="Colour" default="charcoal" from="string" name="page_frame_colour">
          		<release>Magics++0.5		</release>
          		<documentation> Colour of page frame (Full choice of colours) 		</documentation>
   	</parameter>
@@ -37,7 +37,7 @@
          		<documentation> Style of page frame(SOLID/DASH/DOT/CHAIN_DASH/CHAIN_DOT) 		</documentation>
   	</parameter>
 
-  	<parameter member="frame_thickness" to="int" default="1" from="int" name="page_frame_thickness">
+  	<parameter member="frame_thickness" to="int" default="2" from="int" name="page_frame_thickness">
          		<documentation> Thickness of page frame 		</documentation>
          		<release>Magics++0.5		</release>
   	</parameter>
diff --git a/src/params/FortranViewNode.xml b/src/params/FortranViewNode.xml
index 1d377e6..a040d0f 100644
--- a/src/params/FortranViewNode.xml
+++ b/src/params/FortranViewNode.xml
@@ -51,7 +51,6 @@
 				<option xml="cartesian" fortran="cartesian" include="CartesianTransformation.h" name="CartesianTransformation">		</option>
         		<option xml="taylor" fortran="taylor" include="TaylorProjection.h" name="TaylorProjection">		</option>
         		<option xml="tephigram" fortran="tephigram" include="Tephigram.h" name="Tephigram">		</option> 
-        		<option xml="tephiinfo" fortran="tephiinfo" include="Tephigram.h" name="TephiInfo">		</option>
               
 	</parameter>
 	<parameter from="float" name="subpage_y_position_internal" visible="off" default="-1" member="bottom_internal" to="float">
@@ -92,7 +91,7 @@
          		<set name="subpage_frame_thickness" value="on">		</set>
 	</parameter>
 
-	<parameter member="frame_colour" to="Colour" default="black" from="string" name="subpage_frame_colour">
+	<parameter member="frame_colour" to="Colour" default="charcoal" from="string" name="subpage_frame_colour">
          		<documentation> Colour of subpage frame (Full choice of colours) 		</documentation>
 	</parameter>
 
diff --git a/src/params/GraphPlotting.xml b/src/params/GraphPlotting.xml
index 91770cb..ebe8b92 100644
--- a/src/params/GraphPlotting.xml
+++ b/src/params/GraphPlotting.xml
@@ -6,7 +6,7 @@
  	<parameter xml="legend" from="string" name="legend" default="off" member="legend" to="bool">
          		<documentation>  Turn on/off the legend for this graph (this parameter is new to Magics++) 		</documentation>
          		<release>1.3		</release>
-         		<set name="legend_user_text" value="off">		</set>
+         		<set name="legend_user_text" value="on">		</set>
     	</parameter>
 
   	<parameter xml="legend_text" from="string" name="legend_user_text" default="" member="legend_text" to="string">
diff --git a/src/params/GribDecoder.xml b/src/params/GribDecoder.xml
index ed0ac06..d00143e 100644
--- a/src/params/GribDecoder.xml
+++ b/src/params/GribDecoder.xml
@@ -14,7 +14,7 @@
          		<documentation>Id used to identify a grib file in the title production		</documentation>
   	</parameter>
 
- 
+
   	<parameter member="scaling" to="bool" default="on" from="string" name="grib_automatic_scaling">
          		<release>Magics++0.3		</release>
          		<documentation> Scaling of the decoded field 		</documentation>
@@ -33,8 +33,11 @@
          		<release>Magics++2.10		</release>
          		<documentation> Apply a scaling offset to the field. 		</documentation>
   	</parameter>
+    <parameter member="interpolation_method" to="string" default="interpolate" from="string" name="grib_interpolation_method" values='interpolate/nearest' >
+         		<release>Magics++2.10		</release>
+         		<documentation> Used for reduced gaussian grid: use an linear interpolation to convert from reduced to regular		</documentation>
+  	</parameter>
 
- 
   	<parameter from="string" name="grib_text_experiment" visible="false" default="off" member="expver" to="bool">
          		<release>Magics++0.3		</release>
          		<documentation> Include the name or number of the experiment, used to generate the GRIB code field, in the automatic text  (ON/OFF)  		</documentation>
@@ -45,40 +48,27 @@
          		<documentation> Include the units of the input field in the automatic text  		</documentation>
   	</parameter>
 
-  
-
-  
-
- 
-
   	<parameter from="string" name="grib_file_address_mode" default="record" metview="on" member="address_mode" to="GribAddressMode">
 	     		<option xml="record" fortran="record" include="GribAddressMode.h" name="GribAddressRecordMode">		</option>
 	     		<option xml="byte_offset" fortran="byte_offset" include="GribAddressMode.h" name="GribAddressByteMode">		</option>
          		<documentation> Normally GRIB fields are stored as records on a file. If the BYTE offset method is being used, the parameter GRIB_FILE_ADDRESS_MODE should be set to 'BYTE_OFFSET'.(RECORD_NUMBER/BYTE_OFFSET) 		</documentation>
   	</parameter>
 
-  
+
 
   	<parameter member="wind_mode" to="WindMode" default="uv" from="string" name="grib_wind_mode">
          		<documentation> The incoming wind field may contain data other than wind components, e.g. wave height and direction.
-	                 grib_wind_mode should be set to indicate how to interpret the incoming wind field, 
+	                 grib_wind_mode should be set to indicate how to interpret the incoming wind field,
 	                 as u/v components, or speed/direction (uv/vd).
          		</documentation>
          		<option xml="uvmode" fortran="uv" include="WindMode.h" name="UVWindMode">		</option>
          		<option xml="vdmode" fortran="sd" include="WindMode.h" name="SDWindMode">		</option>
   	</parameter>
 
-  
-
   	<parameter member="grib_field_position" to="int" default="1" from="int" name="grib_field_position">
          		<documentation> The position in the input file of a field other than a wind component 		</documentation>
   	</parameter>
 
-  
-  
-
- 
-
   	<parameter member="position_1" to="int" default="1" from="int" name="grib_wind_position_1">
          		<documentation> The position in the input file of a wind component field 		</documentation>
   	</parameter>
@@ -86,17 +76,16 @@
   	<parameter member="position_2" to="int" default="2" from="int" name="grib_wind_position_2">
          		<documentation> The position in the input file of a wind component field 		</documentation>
   	</parameter>
-  
+
 
   	<parameter member="colour_position" to="int" default="3" from="int" name="grib_wind_position_colour">
          		<documentation> The position in the input file of a wind component field used to colour the flag		</documentation>
   	</parameter>
-  
-  
+
 
   	<parameter from="float" name="grib_missing_value_indicator" visible="false" default="-1.5e+21" member="missing_value" to="float">
          		<documentation> When MAGICS is decoding GRIB code, this is the value to be assigned to field values where data is missing, as indicated by the bit map in the GRIB file. 		</documentation>
   	</parameter>
 
-  
+
 </class></magics>
diff --git a/src/params/GribLoop.xml b/src/params/GribLoop.xml
index d367a8a..61eabf6 100644
--- a/src/params/GribLoop.xml
+++ b/src/params/GribLoop.xml
@@ -49,6 +49,10 @@
          		<release>Magics++2.10		</release>
          		<documentation> Apply a scaling offset to the field. 		</documentation>
   	</parameter> 
+  	<parameter member="interpolation_method" to="string" default="interpolate" from="string" name="grib_interpolation_method" values='interpolate/nearest' >
+         		<release>Magics++2.10		</release>
+         		<documentation> Used for reduced gaussian grid: use an linear interpolation to convert from reduced to regular		</documentation>
+  	</parameter>
   	<parameter member="wind_mode" to="WindMode" default="uv" from="string" name="grib_wind_mode">
          		<documentation> The incoming wind field may contain data other than wind components, e.g. wave height and direction.
 	                 grib_wind_mode should be set to indicate how to interpret the incoming wind field, 
diff --git a/src/params/HiLo.xml b/src/params/HiLo.xml
index f106b56..a2e4ccd 100644
--- a/src/params/HiLo.xml
+++ b/src/params/HiLo.xml
@@ -28,13 +28,11 @@
 	<parameter from="float" name="contour_hilo_reduction_radius" default="0.0" member="reduction_radius" to="float" implemented="no">
          		<documentation> Search radius (in grid points) for reducing the number of minima 		</documentation>
          		<migration> New Magics: Parameter contour_hilo_reduction_radius sent to new Magics[HiLo].  		</migration>
-         		<release_info>Parameter defined but not implemented : expected in 0.7		</release_info>
 	</parameter>
   
-	<parameter member="suppress_radius" to="float" default="15.0" from="float" name="contour_hilo_suppress_radius">
+	<parameter member="suppress_radius" to="float" default="15.0" from="float" name="contour_hilo_suppress_radius" implemented='no'>
          		<documentation> Radius of HiLo search in grid points (default value is for global cylindrical map) 		</documentation>
          		<migration> New Magics: Parameter contour_hilo_suppress_radius sent to new Magics[HiLo].  		</migration>
-         		<release_info>Parameter defined but not implemented: expected in 0.7		</release_info>
 	</parameter>
 
 	<parameter member="hilo_max_value" to="float" default="1.0e+21" from="float" name="contour_hilo_max_value">
diff --git a/src/params/HighHiLo.xml b/src/params/HighHiLo.xml
index 69f5fc6..aa28b68 100644
--- a/src/params/HighHiLo.xml
+++ b/src/params/HighHiLo.xml
@@ -1,2 +1,2 @@
 <magics>
-<class inherits="HiLoBase" xmltag="high" name="HighHiLo" directory="visualisers" action="pcont" include="HiLo.h"/></magics>
+<class inherits="HiLo" xmltag="high" name="HighHiLo" directory="visualisers" action="pcont" include="HiLo.h"/></magics>
diff --git a/src/params/Histogram.xml b/src/params/Histogram.xml
index 3a9ebeb..20a3b78 100644
--- a/src/params/Histogram.xml
+++ b/src/params/Histogram.xml
@@ -7,9 +7,9 @@
     	<parameter member="levels" to="LevelSelection" default="count" from="string" name="histogram_selection_type">
          		<documentation>  (COUNT/ INTERVAL/ LEVEL_LIST) 		</documentation>
          		<release>Magics++2.6		</release>
-         		<option xml="count" fortran="count" docdive="no" include="CountSelectionType.h" name="CountSelectionType">		</option>
-         		<option xml="interval" fortran="interval" docdive="no" include="IntervalSelectionType.h" name="IntervalSelectionType">		</option>
-         		<option xml="list" fortran="list" docdive="no" include="LevelListSelectionType.h" name="LevelListSelectionType">		</option>
+         		<option xml="count" fortran="count"  include="CountSelectionType.h" name="CountSelectionType">		</option>
+         		<option xml="interval" fortran="interval"  include="IntervalSelectionType.h" name="IntervalSelectionType">		</option>
+         		<option xml="list" fortran="list"  include="LevelListSelectionType.h" name="LevelListSelectionType">		</option>
      	</parameter>     
 
   	<parameter member="min" to="float" default="-1.e21" from="float" name="histogram_min_value">
diff --git a/src/params/ImportObjectHandler.xml b/src/params/ImportObjectHandler.xml
index 91cab01..3ce1940 100644
--- a/src/params/ImportObjectHandler.xml
+++ b/src/params/ImportObjectHandler.xml
@@ -7,19 +7,19 @@
   		<documentation>Specify the format of the imported file 		</documentation>
 	</parameter>
 
-	<parameter member="x" to="float" default="0" from="float" name="import_x_position">
+	<parameter member="import_x" to="float" default="0" from="float" name="import_x_position">
   		<documentation>X position of the imported image 		</documentation>
 	</parameter>
   
-	<parameter member="y" to="float" default="0" from="float" name="import_y_position">
+	<parameter member="import_y" to="float" default="0" from="float" name="import_y_position">
   		<documentation>Y position of the imported image 		</documentation>
 	</parameter>
 
-	<parameter member="width" to="float" default="-1" from="float" name="import_width">
+	<parameter member="import_width" to="float" default="-1" from="float" name="import_width">
   		<documentation>Width of the imported image (-1 means use the dimension of the image)		</documentation>
 	</parameter>
 
-	<parameter member="height" to="float" default="-1" from="float" name="import_height">
+	<parameter member="import_height" to="float" default="-1" from="float" name="import_height">
   		<documentation>Height of the imported image (-1 means use the dimension of the image)		</documentation>
 	</parameter>
 
diff --git a/src/params/IsoPlot.xml b/src/params/IsoPlot.xml
index c008579..b204761 100644
--- a/src/params/IsoPlot.xml
+++ b/src/params/IsoPlot.xml
@@ -25,32 +25,31 @@
 
     	<parameter xml="style" from="string" name="contour_line_style" default="solid" member="style" to="LineStyle">
         		<documentation> Style of contour line  		</documentation>
-        		<migration> New Magics: Parameter contour_line_style sent to new Magics[IsoPlot].  		</migration>
+        		
         		<release>0.1		</release>
     	</parameter>
 
     	<parameter xml="thickness" from="int" name="contour_line_thickness" default="1" member="thickness" to="int">
         		<documentation> Thickness of contour line 		</documentation>
-        		<migration> New Magics: Parameter contour_line_thickness sent to new Magics[IsoPlot].  		</migration>
+        		
         		<release>0.1		</release>
     	</parameter>
 
     	<parameter member="rainbow" to="bool" default="off" from="string" name="contour_line_colour_rainbow">
         		<documentation> if On, rainbow colouring method will be used.  		</documentation>
         		<release>2.20		</release>
-        		<set name="contour_line_colour" value="off">		</set> 
+
         		<set name="contour_line_colour_rainbow_method" value="on">		</set>
-        		<set name="contour_line_colour_rainbow_max_level_colour" value="on">		</set>
-        		<set name="contour_line_colour_rainbow_min_level_colour" value="on">		</set>
-        		<set name="contour_line_colour_rainbow_direction" value="on">		</set>
-        		<set name="contour_line_colour_rainbow_colour_list" value="on">		</set>
-        		<set name="contour_line_colour_rainbow_colour_list_policy" value="on">		</set>
+        		<set name="contour_line_thickness_rainbow_list" value="on">		</set>
+        		<set name="contour_line_thickness_rainbow_list_policy" value="on">		</set>
+        		<set name="contour_line_style_rainbow_list" value="on">		</set>
+        		<set name="contour_line_style_rainbow_list_policy" value="on">		</set>
     	</parameter>
 
 
     	<parameter xml="colour" from="string" name="contour_line_colour" default="blue" member="colour" to="Colour">
         		<documentation> Colour of contour line 		</documentation>
-        		<migration> New Magics: Parameter contour_line_colour sent to new Magics[IsoPlot].  		</migration>
+        	
         		<release>0.1		</release>
     	</parameter>
 
@@ -77,15 +76,31 @@
         		<documentation> Direction of colour sequencing for colouring 		</documentation>
     	</parameter>
 
-    	<parameter member="rainbowColours" to="stringarray" default="stringarray()" from="stringarray" name="contour_line_colour_rainbow_colour_list">
+    	<parameter member="rainbowColours" to="stringarray" default="stringarray()" from="stringarray" name="contour_line_colour_rainbow_colour_list" colourlist="on">
         		<documentation> List of colours to be used in rainbow isolines 		</documentation>
         		<release>2.6		</release>
     	</parameter>
 
-    	<parameter member="rainbowColourPolicy" to="ListPolicy" default="lastone" from="string" name="contour_line_colour_rainbow_colour_list_policy">
+    	<parameter member="rainbowColourPolicy" to="ListPolicy" default="lastone" from="string" 
+    			name="contour_line_colour_rainbow_colour_list_policy">
         		<documentation> What to do if the list of colours is smaller that the list of contour: lastone/cycle 		</documentation>           
     	</parameter>
-
+    	<parameter member="rainbowThicknessList" to="intarray" default="intarray()" from="intarray" 
+    			name="contour_line_thickness_rainbow_list">
+        		<documentation> List of thickness to used when rainbow method is on </documentation>           
+    	</parameter>
+		<parameter member="rainbowThicknessListPolicy" to="ListPolicy" default="lastone" from="string" 
+				name="contour_line_thickness_rainbow_list_policy">
+        		<documentation> What to do if the list of thickness is smaller that the list of contour: lastone/cycle 		</documentation>           
+    	</parameter>
+    	<parameter member="rainbowStyleList" to="stringarray" default="stringarray()" 
+    			from="stringarray" name="contour_line_style_rainbow_list">
+        		<documentation> List of line style to used when rainbow method is on </documentation>           
+    	</parameter>
+		<parameter member="rainbowStyleListPolicy" to="ListPolicy" default="lastone" from="string" 
+				name="contour_line_style_rainbow_list_policy">
+        		<documentation> What to do if the list of line styles is smaller that the list of contour: lastone/cycle 		</documentation>           
+    	</parameter>
     	<parameter xml="highlight" priority="0.2" from="string" name="contour_highlight" default="on" member="highlight" to="NoIsoHighlight" include="IsoHighlight.h">
         		<documentation> Plot contour highlights (ON/OFF) 		</documentation>
         		<option xml="highlight" fortran="on" include="IsoHighlight.h" name="IsoHighlight">		</option>
@@ -98,7 +113,7 @@
         		<documentation> count: calculate a reasonable  contour interval taking into account the min/max and the requested number of isolines. 
         interval: regularly spaced intervals using the reference_level as base.
         level_list: uses the given list of levels. 		</documentation>
-        		<option xml="count" fortran="count" xmlfile="LevelSelection" include="CountSelectionType.h" name="CountSelectionType">		</option>
+        		<option xml="count" fortran="count" include="CountSelectionType.h" name="CountSelectionType">		</option>
         		<option xml="interval" fortran="interval" include="IntervalSelectionType.h" name="IntervalSelectionType">		</option>
         		<option xml="list" fortran="level_list" include="LevelListSelectionType.h" name="LevelListSelectionType">		</option>
     	</parameter>
diff --git a/src/params/LegendVisitor.xml b/src/params/LegendVisitor.xml
index 50621a3..d27cf2a 100644
--- a/src/params/LegendVisitor.xml
+++ b/src/params/LegendVisitor.xml
@@ -77,13 +77,19 @@
 	</parameter>  
         
 	<parameter from="string" name="legend_box_mode" default="automatic" member="box" to="string" values="automatic/positional">
-        	
+        			<set name="legend_automatic_position" value="automatic">		</set>
+        			
         			<set name="legend_box_x_position" value="positional">		</set>
         			<set name="legend_box_x_length" value="positional">		</set>
         			<set name="legend_box_y_position" value="positional">		</set>
         			<set name="legend_box_y_length" value="positional">		</set>
         			<documentation>Whether legend box is positioned automatically or by the user  		</documentation>
 	</parameter>
+	<parameter from="string" name="legend_automatic_position" default="top" member="box_position" to="string" values="top/right">
+        	
+        			
+        			<documentation>Whether legend box is positioned on the top or on the right of the drawing area  		</documentation>
+	</parameter>
 	<parameter xml="font" from="string" name="legend_text_font" default="sansserif" member="font" to="string">
 			<documentation>Font name - please make sure this font is installed!		</documentation>
 	</parameter>
diff --git a/src/params/LowHiLo.xml b/src/params/LowHiLo.xml
index d4545c0..443fa12 100644
--- a/src/params/LowHiLo.xml
+++ b/src/params/LowHiLo.xml
@@ -1,2 +1,2 @@
 <magics>
-<class inherits="HiLoBase" xmltag="low" name="LowHiLo" directory="visualisers" action="pcont" include="HiLo.h"/></magics>
+<class inherits="HiLo" xmltag="low" name="LowHiLo" directory="visualisers" action="pcont" include="HiLo.h"/></magics>
diff --git a/src/params/MagnifierVisitor.xml b/src/params/MagnifierVisitor.xml
index 09bc703..7978844 100644
--- a/src/params/MagnifierVisitor.xml
+++ b/src/params/MagnifierVisitor.xml
@@ -30,7 +30,7 @@
          		<release>Magics++2.8		</release>
 	</parameter>
 
-	<parameter member="text_font_name" to="string" default="sanserif" from="string" name="magnifier_text_font_name">
+	<parameter member="text_font_name" to="string" default="sanserif" from="string" name="magnifier_text_font">
          		<documentation for_docs="no"> Mv4: Colour of the symbol in the magnifier 		</documentation>
          		<release>Magics++2.8		</release>
 	</parameter>
diff --git a/src/params/NetcdfGeoMatrixInterpretor.xml b/src/params/NetcdfGeoMatrixInterpretor.xml
index e5cb6e2..a419cff 100644
--- a/src/params/NetcdfGeoMatrixInterpretor.xml
+++ b/src/params/NetcdfGeoMatrixInterpretor.xml
@@ -19,7 +19,18 @@
              		<release>Magics++0.1		</release>
             		<documentation>sample the input data by taking a latitude every nth latitude		</documentation>
         	</parameter>
-        
+        	<parameter member="x_component" to="string" default="" from="string" name="netcdf_x_component_variable">
+              		<release>Magics++2.6		</release>
+              		<documentation>Variable name representing the x component of the vector		</documentation>
+        	</parameter> 
+         	<parameter member="y_component" to="string" default="" from="string" name="netcdf_y_component_variable">
+             		<release>Magics++2.6		</release>
+            		<documentation>Variable name representing the y component of the vector		</documentation>
+        	</parameter>
+        	<parameter member="colour_component" to="string" default="" from="string" name="netcdf_colour_component_variable">
+             		<release>Magics++2.6		</release>
+            		<documentation>Variable name representing the colour component of the vector ( in case of coloured wind)		</documentation>
+        	</parameter>
             	<parameter member="primary_index" to="string" default="longitude" from="string" name="netcdf_matrix_primary_index">
              		<release>Magics++2.4		</release>
             		<documentation> Primary index latitude/longitude		</documentation>
diff --git a/src/params/NetcdfInterpretor.xml b/src/params/NetcdfInterpretor.xml
index 717a849..b83caeb 100644
--- a/src/params/NetcdfInterpretor.xml
+++ b/src/params/NetcdfInterpretor.xml
@@ -5,41 +5,32 @@
         It is possible to load only a subarray of the data, by setting the dimensions.
 		</documentation>
         	<parameter member="path" to="string" default="" from="string" name="netcdf_filename">
-            		<release>Magics++0.1		</release>
             		<documentation>Path of the file to be read		</documentation>
         	</parameter>
 
         	<parameter member="dimension" to="stringarray" default="stringarray()" from="stringarray" name="netcdf_dimension_setting">
             		<metview default="" class="">  		</metview>
-             		<release>Magics++0.1		</release>
-            		<documentation>The dimensions of the data to load, eg. p/100/10		</documentation>
+            		<documentation> Extract only of a subset of variables [ex: level:100:500]	</documentation>
         	</parameter>
         	<parameter from="string" name="netcdf_dimension_setting_method" default="value" member="dimension_method" to="string" values="index/value">
-            
-             		<release>Magics++0.1		</release>
-            		<documentation>To specify a dimension the user can choose the method value: in that case he will pass to Magics the value of the dimension (as defined in the variable), or index : index if the dimesion in the array		</documentation>
+            		 <documentation>Method used to specify how to interpret the extraction of a subset, the range can by specified by value or by index 		</documentation>
         	</parameter>
         
          	<parameter member="field" to="string" default="" from="string" name="netcdf_value_variable">
-              		<release>Magics++0.1		</release>
-              		<documentation>Variable name to plot		</documentation>
+              		<documentation>Variable to plot</documentation>
         	</parameter> 
        
           	<parameter member="scaling" to="float" default="1" from="float" name="netcdf_field_scaling_factor">
-            		<release>Magics++0.1		</release>
             		<documentation>Scaling factor to multiply the field value by		</documentation>
         	</parameter>
          	<parameter member="offset" to="float" default="0" from="float" name="netcdf_field_add_offset">
-            		<release>Magics++0.1		</release>
             		<documentation>Offset added to the field values		</documentation>
            	</parameter>
            	<parameter member="missing_attribute" to="string" default="missing_value" from="string" name="netcdf_missing_attribute">
-            		<release>Magics++2.15		</release>
-            		<documentation>Attribute to read to know the value used to indicate a missing value in the data		</documentation>
+            		<documentation>Attribute indicating the value used to indicate a missing value in the data		</documentation>
            	</parameter>  
             	<parameter member="reference" to="string" default="0" from="string" name="netcdf_reference_date">
-            		<release>Magics++0.7		</release>
-            		<documentation>attributes name to find the refernce date		</documentation>
+            		<documentation>attribute indicating  the reference date		</documentation>
            	</parameter> 
            	<parameter member="suppress_below" to="float" default="-1.0e+21" from="float" name="netcdf_field_suppress_below">
          		<documentation> Values in the input field(s) below this value are to be suppressed, i.e. not to be taken into consideration for plotting purposes 		</documentation>
diff --git a/src/params/ObsPlotting.xml b/src/params/ObsPlotting.xml
index 58b2766..0993a41 100644
--- a/src/params/ObsPlotting.xml
+++ b/src/params/ObsPlotting.xml
@@ -17,167 +17,167 @@
         </parameter>
 
 		<parameter member="present_ww_visible" to="bool" default="on" from="string" name="obs_present_weather">
-				<documentation> Turn On/off the present weather		</documentation>
-                <set name="obs_present_weather" value="on">        </set> 
+				<documentation> Turn On/off the present weather </documentation>
+                <set name="obs_present_weather_colour" value="on"/>
     	</parameter>
 
     	<parameter member="present_ww_colour" to="Colour" default="automatic" from="string" name="obs_present_weather_colour">
-				<documentation> Colour used to display  the present weather  		</documentation>
+				<documentation> Colour used to display  the present weather </documentation>
     	</parameter>
         
  	<parameter member="pressure_visible" to="bool" default="on" from="string" name="obs_pressure">
-    		<documentation> Turn On/off the pressure		</documentation>
-            <set name="obs_pressure_colour" value="on">        </set> 
+    		<documentation> Turn On/off the pressure </documentation>
+            <set name="obs_pressure_colour" value="on"/>
  	</parameter>
 
  	<parameter member="pressure_colour" to="Colour" default="automatic" from="string" name="obs_pressure_colour">
-    		<documentation> Colour used to display the pressure  		</documentation>
+    		<documentation> Colour used to display the pressure </documentation>
  	</parameter>
     <parameter member="upper_air_visible" to="bool" default="off" from="string" name="obs_upper_air_pressure">
-				<documentation> Turn On/off the upper air pressure level ( satob)  		</documentation>
-            <set name="obs_upper_air_pressure" value="on">        </set> 
+				<documentation> Turn On/off the upper air pressure level (satob) </documentation>
+            <set name="obs_upper_air_pressure_colour" value="on"/>
     	</parameter>
 
-    	<parameter  from="string" name="obs_upper_level_pressure_colour" default="automatic" member="upper_air_colour" to="Colour">
+    	<parameter  from="string" name="obs_upper_air_pressure_colour" default="automatic" member="upper_air_colour" to="Colour">
 				<documentation> Colour used to display the upper air pressure level	</documentation>
     	</parameter>
         <parameter member="pressure_tendency_visible" to="bool" default="on" from="string" name="obs_pressure_tendency">
-				<documentation> Turn On/off the pressure tendency		</documentation>
-                <set name="obs_pressure_tendency" value="on">        </set> 
+				<documentation> Turn On/off the pressure tendency </documentation>
+                <set name="obs_pressure_tendency_colour" value="on"/>
     	</parameter>
     
     	<parameter member="pressure_tendency_colour" to="Colour" default="automatic" from="string" name="obs_pressure_tendency_colour">
-				<documentation> Colour used to display the pressure tendency 		</documentation>
+				<documentation> Colour used to display the pressure tendency </documentation>
     	</parameter>
         <parameter member="station_ring_visible" to="bool" default="on" from="string" name="obs_station_ring">
-    		<documentation> Turn On/off the station ring 			</documentation>
-            <set name="obs_station_ring" value="on">        </set> 
+    		<documentation> Turn On/off the station ring </documentation>
+            <set name="obs_station_ring_colour" value="on"/>
  	</parameter>
 
  	<parameter member="station_ring_colour" to="Colour" default="automatic" from="string" name="obs_station_ring_colour">
-   		<documentation> Colour used to display the station ring    </documentation>
+   		<documentation> Colour used to display the station ring </documentation>
 
  	</parameter>
-<parameter member="temperature_visible" to="bool" default="on" from="string" name="obs_temperature">
-    		<documentation> Turn On/off the Air temperature		</documentation>
-            <set name="obs_temperature" value="on">        </set> 
+ 	<parameter member="temperature_visible" to="bool" default="on" from="string" name="obs_temperature">
+    		<documentation> Turn On/off the Air temperature </documentation>
+            <set name="obs_temperature_colour" value="on"/>
  	</parameter>
 
  	<parameter member="temperature_colour" to="Colour" default="automatic" from="string" name="obs_temperature_colour">
-    		<documentation> Colour  used to display the Air temperature  </documentation>
+    		<documentation> Colour  used to display the Air temperature </documentation>
  	</parameter>
     <parameter member="thickness_visible" to="bool" default="on" from="string" name="obs_thickness">
-        		<documentation> Turn On/off the Thickness		</documentation>
-                <set name="obs_thickness" value="on">        </set> 
-        		<release>2.6		</release>
+        		<documentation> Turn On/off the Thickness </documentation>
+                <set name="obs_thickness_colour" value="on"/>
+        		<release>2.6</release>
     	</parameter>
     
     	<parameter member="thickness_colour" to="Colour" default="automatic" from="string" name="obs_thickness_colour">
-        		<documentation> Colour  used to display the thickness 		</documentation>
+        		<documentation> Colour  used to display the thickness </documentation>
     	</parameter>
         <parameter member="height_visible" to="bool" default="on" from="string" name="obs_height">
-        		<documentation> Turn On/off the height (geopotential)  		</documentation>
-                <set name="obs_height" value="on">        </set> 
-        		<release>2.6		</release>
+        		<documentation> Turn On/off the height (geopotential) </documentation>
+                <set name="obs_height_colour" value="on"/>
+        		<release>2.6</release>
     	</parameter>
     	<parameter member="height_colour" to="Colour" default="automatic" from="string" name="obs_height_colour">
-        		<documentation> Colour  used to display  the height information 		</documentation>
-        		<release>2.6		</release>
+        		<documentation> Colour  used to display  the height information </documentation>
+        		<release>2.6</release>
     	</parameter>
         <parameter member="identifier_visible" to="bool" default="off" from="string" name="obs_identification">
-				<documentation> Turn On/off the station identification  		</documentation>
-                <set name="obs_identification" value="on">        </set> 
+				<documentation> Turn On/off the station identification </documentation>
+                <set name="obs_identification_colour" value="on"/>
     	</parameter>
 
     	<parameter member="identifier_colour" to="Colour" default="automatic" from="string" name="obs_identification_colour">
-				<documentation> Colour  used to display  the station identification  		</documentation>
+				<documentation> Colour  used to display  the station identification </documentation>
     	</parameter>
         <parameter member="cloud_visible" to="bool" default="on" from="string" name="obs_cloud">
-				<documentation> Turn On/off the cloud   		</documentation>
+				<documentation> Turn On/off the cloud </documentation>
     	</parameter>
 
     	<parameter member="low" to="bool" default="on" from="string" name="obs_low_cloud">
-				<documentation> Turn On/off the low cloud  		</documentation>
-                <set name="obs_low_cloud_colour" value="on">        </set> 
+				<documentation> Turn On/off the low cloud </documentation>
+                <set name="obs_low_cloud_colour" value="on"/>
     	</parameter>
     
     	<parameter member="low_colour" to="Colour" default="automatic" from="string" name="obs_low_cloud_colour">
-				<documentation> Colour used to display the low cloud 		</documentation>
+				<documentation> Colour used to display the low cloud </documentation>
     	</parameter>
     
      	<parameter member="medium" to="bool" default="on" from="string" name="obs_medium_cloud">
-				<documentation> Turn On/off the medium cloud  		</documentation>
+				<documentation> Turn On/off the medium cloud </documentation>
+                <set name="obs_medium_cloud_colour" value="on"/> 
     	</parameter>    
 
     	<parameter member="medium_colour" to="Colour" default="automatic" from="string" name="obs_medium_cloud_colour">
-       		<documentation> Colour used to display the  medium cloud 		</documentation>
-                <set name="obs_medium_cloud_colour" value="on">        </set> 
+       		<documentation> Colour used to display the  medium cloud </documentation>
     	</parameter>
 
     	<parameter member="high" to="bool" default="on" from="string" name="obs_high_cloud">
-      		<documentation> Turn On/off the high cloud  		</documentation>
-                <set name="obs_high_cloud_colour" value="on">        </set> 
+      		<documentation> Turn On/off the high cloud </documentation>
+                <set name="obs_high_cloud_colour" value="on"/>
     	</parameter>
 
     	<parameter member="high_colour" to="Colour" default="red" from="string" name="obs_high_cloud_colour">
-      		<documentation> Colour used to display the high cloud 		</documentation>
+      		<documentation> Colour used to display the high cloud </documentation>
  		</parameter>
 		<parameter member="dewpoint_visible" to="bool" default="on" from="string" name="obs_dewpoint">
-				<documentation> Turn On/off the dewpoint		</documentation>
-                <set name="obs_dewpoint_colour" value="on">        </set> 
+				<documentation> Turn On/off the dewpoint </documentation>
+                <set name="obs_dewpoint_colour" value="on"/>
     	</parameter>
     	
     	<parameter member="dewpoint_colour" to="Colour" default="red" from="string" name="obs_dewpoint_colour">
-				<documentation> Colour used to display the dewpoint 		</documentation>
+				<documentation> Colour used to display the dewpoint </documentation>
     	</parameter>
     	<parameter member="sea_temperature_visible" to="bool" default="on" from="string" name="obs_sea_temperature">
-				<documentation> Turn On/off the sea temperature		</documentation>
+				<documentation> Turn On/off the sea temperature </documentation>
+                <set name="obs_sea_temperature_colour" value="on"/>
     	</parameter>
     	
     	<parameter member="sea_temperature_colour" to="Colour" default="black" from="string" name="obs_sea_temperature_colour">
-				<documentation> Colour sed to display the sea temperature 		</documentation>
-                <set name="obs_sea_temperature_colour" value="on">        </set> 
+				<documentation> Colour sed to display the sea temperature </documentation>
     	</parameter>
     	
     	<parameter member="waves_visible" to="bool" default="on" from="string" name="obs_waves">
-				<documentation> Turn On/off the waves and swell information		</documentation>
-                <set name="obs_waves_colour" value="on">        </set> 
+				<documentation> Turn On/off the waves and swell information </documentation>
+                <set name="obs_waves_colour" value="on"/>
     	</parameter>
     	
     	<parameter member="waves_colour" to="Colour" default="black" from="string" name="obs_waves_colour">
-				<documentation> Colour used to display  the waves and swell 		</documentation>
+				<documentation> Colour used to display  the waves and swell </documentation>
     	</parameter>
         <parameter member="past_ww_visible" to="bool" default="on" from="string" name="obs_past_weather">
-				<documentation> Turn On/off the pas Weather level (satob)		</documentation>
-                <set name="obs_past_weather_colour" value="on">        </set> 
+				<documentation> Turn On/off the pas Weather level (satob) </documentation>
+                <set name="obs_past_weather_colour" value="on"/>
     	</parameter>
     
     	<parameter member="past_ww_colour" to="Colour" default="red" from="string" name="obs_past_weather_colour">
-				<documentation> Colour  used to display  the past weather 		</documentation>
+				<documentation> Colour  used to display  the past weather </documentation>
     	</parameter>
         <parameter member="time_plot_visible" to="bool" default="off" from="string" name="obs_time">
-				<documentation> Turn On/off the observation time  		</documentation>
-                <set name="obs_time_colour" value="on">        </set> 
+				<documentation> Turn On/off the observation time </documentation>
+                <set name="obs_time_colour" value="on"/>
     	</parameter>
     
     	<parameter member="time_plot_colour" to="Colour" default="automatic" from="string" name="obs_time_colour">
-				<documentation> Colour used to display the observation time 		</documentation>
+				<documentation> Colour used to display the observation time </documentation>
         </parameter>
 		<parameter member="visibility_visible" to="bool" default="on" from="string" name="obs_visibility">
-				<documentation> Turn On/off the visibility</documentation>
-                <set name="obs_visibility_colour" value="on">        </set> 
+				<documentation> Turn On/off the visibility </documentation>
+                <set name="obs_visibility_colour" value="on"/>
     	</parameter>
     
     	<parameter member="visibility_colour" to="Colour" default="automatic" from="string" name="obs_visibility_colour">
-				<documentation> Colour  used to display  the visibility 		</documentation>
+				<documentation> Colour  used to display  the visibility </documentation>
     	</parameter>
         <parameter member="wind_visible" to="bool" default="on" from="string" name="obs_wind">
-    		<documentation> Turn On/off the wind 		</documentation>
-                <set name="obs_wind" value="on">        </set> 
+    		<documentation> Turn On/off the wind </documentation>
+                <set name="obs_wind_colour" value="on"/>
  	</parameter>
 
  	<parameter member="wind_colour" to="Colour" default="automatic" from="string" name="obs_wind_colour">
-    		<documentation> Colour   used to display  wind 		</documentation>
+    		<documentation> Colour used to display wind </documentation>
  	</parameter>
 </class>
 </magics>
diff --git a/src/params/PostScriptDriver.xml b/src/params/PostScriptDriver.xml
index 3e2ede2..b31a24f 100644
--- a/src/params/PostScriptDriver.xml
+++ b/src/params/PostScriptDriver.xml
@@ -4,7 +4,7 @@
 		This is the default driver for Magics, and PostScript is the default output format. 
 		</documentation>
 
-	<parameter from="string" name="output_ps_colour_model" default="cmyk" member="colour_model" to="string" values="rgb/cmyk/monochrome/gray/cmyk_monochrome/cmyk_gray">
+	<parameter from="string" name="output_ps_colour_model" default="rgb" member="colour_model" to="string" values="rgb/cmyk/monochrome/gray/cmyk_monochrome/cmyk_gray">
    		<metview default="" class="">  		</metview>
    		<documentation>Defines the PostScript colour model .		</documentation>
 
diff --git a/src/params/Proj4Projection.xml b/src/params/Proj4Projection.xml
index f20083a..3a83660 100644
--- a/src/params/Proj4Projection.xml
+++ b/src/params/Proj4Projection.xml
@@ -30,10 +30,13 @@
          		<release>Magics++0.1		</release>
          		<documentation> Longitude of upper right corner of map. 		</documentation>
   	</parameter> 
-  	<parameter member="vertical_longitude" to="float" default="0" from="float" name="subpage_map_vertical_longitude">
-       
+  	<parameter member="vertical_longitude" to="float" default="0" from="float" name="subpage_map_vertical_longitude">  
          		<documentation> Developement in progress 		</documentation>
   	</parameter>
+  
+  	<parameter member="sweep" to="float" default="0" from="float" name="subpage_map_geos_sweep">  
+         		<documentation> the sweep angle axis of the viewing instrument		</documentation>
+  	</parameter>
   	<parameter from="string" name="subpage_map_proj4_definition" visible="no" default="" member="proj4_definition" to="string">
          		<documentation> Proj4 defintion string : to be used very carefully --> possible side effect  		</documentation>
   	</parameter>
diff --git a/src/params/QtDriver.xml b/src/params/QtDriver.xml
index dde5ce6..652dad5 100644
--- a/src/params/QtDriver.xml
+++ b/src/params/QtDriver.xml
@@ -1,16 +1,8 @@
 <magics>
-<class inherits="BaseDriver" xmltag="qt" name="QtDriver" directory="drivers" prefix="output/output_qt" action="Qt" include="Qt/qgraphicsscene.h">
+<class inherits="BaseDriver" xmltag="qt" name="QtDriver" directory="drivers" prefix="output/output_qt" action="Qt">
 
 	<documentation>
 These are the attributes of the Qt output driver. This driver is intended for Qt applications such as Metview.
 	</documentation>
 
-	<parameter member="widget" to="QWidget*" default="0" from="QWidget*" name="output_qt_widget">
-			<documentation>Enable an application to instantiate its own QGraphicsScene and to pass it to Magics++ for it to use it.		</documentation>
-	</parameter>
-
-	<parameter member="scene" to="QGraphicsScene*" default="0" from="QGraphicsScene*" name="output_qt_scene">
-			<documentation>Enable an application to instantiate its own QGraphicsScene and to pass it to Magics++ for it to use it.		</documentation>
-	</parameter>
-
 </class></magics>
diff --git a/src/params/SVGDriver.xml b/src/params/SVGDriver.xml
index 384e0a4..175e394 100644
--- a/src/params/SVGDriver.xml
+++ b/src/params/SVGDriver.xml
@@ -4,28 +4,26 @@
 		The output driver produces vector graphics in the SVG format. See also the parameters for the Base Driver.
 		</documentation>
 		<parameter from="string" name="output_svg_logo_location" default="inline" member="logoLocation" to="string" values="inline/share/www/local">
-				<documentation>Sets where the (ECMWF) logo can be found. Possible values are 'inline'(default),'share', 'www' or 'local'.		</documentation>
+				<documentation>Sets where the (ECMWF) logo can be found. Possible values are 'inline'(default),'share', 'www' or 'local'.</documentation>
 		</parameter>
 		<parameter member="desc" to="string" default="" from="string" name="output_svg_desc">
-				<documentation>Defines a text describing the content of the SVG output.		</documentation>
+				<documentation>Defines a text describing the content of the SVG output.</documentation>
 		</parameter>
 
 		<parameter member="meta" to="string" default="" from="string" name="output_svg_meta">
-				<documentation>Defining meta data in RDF to be added to the SVG output.		</documentation>
+				<documentation>Defining meta data in RDF to be added to the SVG output.</documentation>
 		</parameter>
 
 		<parameter member="external" to="bool" default="off" from="string" name="output_svg_use_external_files">
-				<documentation>Can the SVG driver use external files for cell and image plotting. External files will reduce the SVG file size but add an external dependency!		</documentation>
+				<documentation>Can the SVG driver use external files for cell and image plotting. External files will reduce the SVG file size but add an external dependency!</documentation>
 		</parameter>
-
+<!--
 		<parameter member="scripting" to="bool" default="off" from="string" name="output_svg_scripting">
-				<documentation>Integrates scripting for interaction (toggle layers and pan/zooming).		</documentation>
+				<documentation for_docs='no'>Integrates scripting for interaction (toggle layers and pan/zooming).</documentation>
 		</parameter>
-
+		-->
 		<parameter member="fixSize" to="bool" default="off" from="string" name="output_svg_fix_size">
-				<documentation>Decides if the size is fixed in the SVG document.		</documentation>
+				<documentation>Decides if the size is fixed in the SVG document.</documentation>
 		</parameter>
 
-
-
 </class></magics>
diff --git a/src/params/SimplePolyline.xml b/src/params/SimplePolyline.xml
index e5af1df..1dfcc0b 100644
--- a/src/params/SimplePolyline.xml
+++ b/src/params/SimplePolyline.xml
@@ -62,15 +62,15 @@
   	<parameter member="levelSelection" to="LevelSelection" default="count" from="string" name="polyline_shade_level_selection_type">
          		<documentation> Can be set to one of: (COUNT/ INTERVAL/ LEVEL_LIST) 		</documentation>
          		<release>Magics++2.1		</release>
-         		<option xml="count" fortran="count" docdive="no" include="CountSelectionType.h" name="CountSelectionType">		</option>
-         		<option xml="interval" fortran="interval" docdive="no" include="IntervalSelectionType.h" name="IntervalSelectionType">		</option>
-         		<option xml="list" fortran="list" docdive="no" include="LevelListSelectionType.h" name="LevelListSelectionType">		</option>
+         		<option xml="count" fortran="count"  include="CountSelectionType.h" name="CountSelectionType">		</option>
+         		<option xml="interval" fortran="interval"  include="IntervalSelectionType.h" name="IntervalSelectionType">		</option>
+         		<option xml="list" fortran="list"  include="LevelListSelectionType.h" name="LevelListSelectionType">		</option>
   	</parameter>
 
   	<parameter member="colourMethod" to="ColourTechnique" default="calculate" from="string" name="polyline_shade_colour_method">
          		<documentation> Method of generating the colours of the bands in polygon shading (LIST/CALCULATE) 		</documentation>
-         		<option xml="calculate" fortran="calculate" docdive="no" include="CalculateColourTechnique.h" name="CalculateColourTechnique">		</option>
-         		<option xml="list" fortran="list" docdive="no" include="ListColourTechnique.h" name="ListColourTechnique">		</option>
+         		<option xml="calculate" fortran="calculate"  include="CalculateColourTechnique.h" name="CalculateColourTechnique">		</option>
+         		<option xml="list" fortran="list"  include="ListColourTechnique.h" name="ListColourTechnique">		</option>
          		<available>list		</available>
          		<release>Magics++2.1		</release>
   	</parameter>
diff --git a/src/params/SymbolAdvancedTableMode.xml b/src/params/SymbolAdvancedTableMode.xml
index 00c30a9..1a245f6 100644
--- a/src/params/SymbolAdvancedTableMode.xml
+++ b/src/params/SymbolAdvancedTableMode.xml
@@ -9,9 +9,9 @@
         		<migration> New Magics: Parameter contour_level_selection_type sent to new Magics[IsoPlot].  		</migration>
         		<release>2.6		</release>
 
-        		<option xml="count" fortran="count" docdive="no" include="CountSelectionType.h" name="CountSelectionType">		</option>
-        		<option xml="interval" fortran="interval" docdive="no" include="IntervalSelectionType.h" name="IntervalSelectionType">		</option>
-        		<option xml="list" fortran="list" docdive="no" include="LevelListSelectionType.h" name="LevelListSelectionType">		</option>
+        		<option xml="count" fortran="count"  include="CountSelectionType.h" name="CountSelectionType">		</option>
+        		<option xml="interval" fortran="interval"  include="IntervalSelectionType.h" name="IntervalSelectionType">		</option>
+        		<option xml="list" fortran="list"  include="LevelListSelectionType.h" name="LevelListSelectionType">		</option>
                
         		<set name="symbol_advanced_table_level_list" value="list">		</set>
         		<set name="symbol_advanced_table_interval" value="interval">		</set> 
@@ -58,8 +58,8 @@
 
     	<parameter member="colourMethod" to="ColourTechnique" default="calculate" from="string" name="symbol_advanced_table_colour_method">
         		<documentation> Method of generating the colours of the bands in polygon shading  		</documentation>
-        		<option xml="calculate" fortran="calculate" docdive="no" include="CalculateColourTechnique.h" name="CalculateColourTechnique">		</option>
-        		<option xml="list" fortran="list" docdive="no" include="ListColourTechnique.h" name="ListColourTechnique">		</option>
+        		<option xml="calculate" fortran="calculate"  include="CalculateColourTechnique.h" name="CalculateColourTechnique">		</option>
+        		<option xml="list" fortran="list" include="ListColourTechnique.h" name="ListColourTechnique">		</option>
         		<available>list		</available>
         		<release>2.6		</release>
         		<set name="symbol_advanced_table_colour_list" value="list">		</set>
@@ -106,8 +106,8 @@
   
     	<parameter member="height_method" to="HeightTechnique" default="list" from="string" name="symbol_advanced_table_height_method">
         		<documentation> Method of generating the height   		</documentation>
-        		<option xml="calculate" fortran="calculate" docdive="no" include="HeightTechnique.h" name="CalculateHeightTechnique">		</option>
-        		<option xml="list" fortran="list" docdive="no" include="HeightTechnique.h" name="ListHeightTechnique">		</option>
+        		<option xml="calculate" fortran="calculate"  include="HeightTechnique.h" name="CalculateHeightTechnique">		</option>
+        		<option xml="list" fortran="list"  include="HeightTechnique.h" name="ListHeightTechnique">		</option>
         		<set name="symbol_advanced_table_height_list" value="list">		</set>
         		<set name="symbol_advanced_table_height_list_policy" value="list">		</set>
         		<set name="symbol_advanced_table_height_max_value" value="calculate">		</set>
@@ -150,7 +150,7 @@
         		<release>2.6		</release>
     	</parameter>
 
-    	<parameter member="text_font_name" to="string" default="sansserif" from="string" name="symbol_advanced_table_text_font_name">
+    	<parameter member="text_font_name" to="string" default="sansserif" from="string" name="symbol_advanced_table_text_font">
         		<documentation> Font to use for text plotting. 		</documentation>
     	</parameter>
 
@@ -179,8 +179,8 @@
 
     	<parameter from="string" name="symbol_advanced_table_outlayer_method" default="none" member="outlayer" to="NoOutLayerTechnique" include="OutLayerTechnique.h">
         		<documentation> outlayer method 		</documentation> 
-        		<option xml="nooutlayer" fortran="none" docdive="no" include="OutLayerTechnique.h" name="NoOutLayerTechnique">		</option>
-        		<option xml="simple" name="SimpleOutLayerTechnique" fortran="simple" docdive="no" visible="no" include="OutLayerTechnique.h">		</option>                 
+        		<option xml="nooutlayer" fortran="none" include="OutLayerTechnique.h" name="NoOutLayerTechnique">		</option>
+        		<option xml="simple" name="SimpleOutLayerTechnique" fortran="simple"  visible="no" include="OutLayerTechnique.h">		</option>                 
         		<release>2.6		</release>
     	</parameter>    
 
diff --git a/src/params/SymbolIndividualMode.xml b/src/params/SymbolIndividualMode.xml
index 21bfa66..f3a0805 100644
--- a/src/params/SymbolIndividualMode.xml
+++ b/src/params/SymbolIndividualMode.xml
@@ -14,15 +14,9 @@
         		<documentation> Height of symbols.  		</documentation>
     	</parameter>
 
-    	<parameter from="string" name="symbol_marker_mode" default="index" member="marker_mode" to="string" values="index/name/image">
+    	<parameter from="string" name="symbol_marker_mode" default="index" member="marker_mode" to="string" >
         		<documentation> Method to select a marker : by name, by index, by image : in that case, Magics will use an external image as marker.
         		</documentation>
-        		<set name="symbol_marker_index" value="index">		</set>
-        		<noset name="symbol_marker_name" value="name">		</noset>
-        		<set name="symbol_image_path" value="image">		</set>
-        		<set name="symbol_image_format" value="image">		</set> 
-        		<set name="symbol_image_width" value="image">		</set>
-        		<set name="symbol_image_height" value="image">		</set>
     	</parameter>
         
        
@@ -58,7 +52,7 @@
         		<documentation> Position of the text 		</documentation>
     	</parameter>
 
-    	<parameter member="text_font_name" to="string" default="sansserif" from="string" name="symbol_text_font_name">
+    	<parameter member="text_font_name" to="string" default="sansserif" from="string" name="symbol_text_font">
         		<documentation> Font to use  		</documentation>
     	</parameter>
 
diff --git a/src/params/SymbolPlotting.xml b/src/params/SymbolPlotting.xml
index e74069d..2edb336 100644
--- a/src/params/SymbolPlotting.xml
+++ b/src/params/SymbolPlotting.xml
@@ -14,7 +14,7 @@
 
         		<set name="symbol_text_list" value="text">		</set>
         		<set name="symbol_text_position" value="text">		</set> 
-        		<set name="symbol_text_font_name" value="text">		</set>
+        		<set name="symbol_text_font" value="text">		</set>
         		<set name="symbol_text_font_size" value="text">		</set>
         		<set name="symbol_text_font_style" value="text">		</set>
         		<set name="symbol_text_font_colour" value="text">		</set>  
@@ -30,14 +30,14 @@
 
         		<set name="symbol_format" value="number">		</set>
         		<set name="symbol_text_position" value="number">		</set> 
-        		<set name="symbol_text_font_name" value="number">		</set>
+        		<set name="symbol_text_font" value="number">		</set>
         		<set name="symbol_text_font_size" value="number">		</set>
         		<set name="symbol_text_font_style" value="number">		</set>
         		<set name="symbol_text_font_colour" value="number">		</set>  
         		<set name="symbol_text_blanking" value="number">		</set>  
 
         		<set name="symbol_text_position" value="both">		</set> 
-        		<set name="symbol_text_font_name" value="both">		</set>
+        		<set name="symbol_text_font" value="both">		</set>
         		<set name="symbol_text_font_size" value="both">		</set>
         		<set name="symbol_text_font_style" value="both">		</set>
         		<set name="symbol_text_font_colour" value="both">		</set> 
@@ -54,21 +54,20 @@
 
 
     	<parameter xml="table_mode" from="string" name="symbol_table_mode" default="OFF" member="mode" to="SymbolMode">
-        		<option xml="individual" fortran="off" docdive="no" include="SymbolMode.h" name="SymbolIndividualMode">		</option>
-        		<option xml="advanced" fortran="advanced" docdive="no" include="SymbolAdvancedTableMode.h" name="SymbolAdvancedTableMode">		</option>
-        		<option xml="table" fortran="on" docdive="no" include="SymbolMode.h" name="SymbolTableMode">		</option>
+        		<option xml="individual" fortran="off"  include="SymbolMode.h" name="SymbolIndividualMode">		</option>
+        		<option xml="advanced" fortran="advanced"  include="SymbolAdvancedTableMode.h" name="SymbolAdvancedTableMode">		</option>
+        		<option xml="table" fortran="on"  include="SymbolMode.h" name="SymbolTableMode">		</option>
         		<documentation> Specifies if plotting is to be in advanced, table (on) or individual mode (off).
             	        Note:  The simple table mode is not recommended anymore, try to use the advanced mode instead, 
             		    this  should give you easier control of the plot. 		</documentation>
 
         		<set name="symbol_colour" value="off">		</set>
-        		<set name="symbol_format" value="off">		</set>
         		<set name="symbol_height" value="off">		</set>
         		<set name="symbol_marker_mode" value="off">		</set>
         		<set name="symbol_marker_index" value="off">		</set>
         		<set name="symbol_marker_name" value="off">		</set>
         		<set name="symbol_text_position" value="off">		</set>
-        		<set name="symbol_text_font_name" value="off">		</set>
+        		<set name="symbol_text_font" value="off">		</set>
         		<set name="symbol_text_font_size" value="off">		</set>
         		<set name="symbol_text_font_style" value="off">		</set>
         		<set name="symbol_text_font_colour" value="off">		</set>
@@ -104,7 +103,7 @@
         		<set name="symbol_advanced_table_height_list_policy" value="advanced">		</set>
         		<set name="symbol_advanced_table_text_list" value="advanced">		</set>
         		<set name="symbol_advanced_table_text_list_policy" value="advanced">		</set>
-        		<set name="symbol_advanced_table_text_font_name" value="advanced">		</set>
+        		<set name="symbol_advanced_table_text_font" value="advanced">		</set>
         		<set name="symbol_advanced_table_text_font_size" value="advanced">		</set>
         		<set name="symbol_advanced_table_text_font_style" value="advanced">		</set>
         		<set name="symbol_advanced_table_text_font_colour" value="advanced">		</set>
diff --git a/src/params/TableDecoder.xml b/src/params/TableDecoder.xml
index a004be4..ed6b9ba 100644
--- a/src/params/TableDecoder.xml
+++ b/src/params/TableDecoder.xml
@@ -35,7 +35,7 @@
          		<documentation>Type used for Y variable_index: number or date 		</documentation>
   	</parameter>
   
-  	<parameter from="string" name="table_variable_identifier_type" default="index" member="name_mode" to="string" values="index/name">
+  	<parameter from="string" name="table_variable_identifier_type" default="index" member="name_mode" to="string" >
          		<documentation> are we refering to the columns by names or index (index/name) 		</documentation>
   	</parameter>
   
diff --git a/src/params/TephiGrid.xml b/src/params/TephiGrid.xml
index 348bcaf..f0ddd31 100644
--- a/src/params/TephiGrid.xml
+++ b/src/params/TephiGrid.xml
@@ -1,132 +1,134 @@
 <magics>
 <class action="ptephi" directory="visualisers" name="TephiGrid">
 		<documentation> description of the grid 	</documentation>
-	
-		<parameter from="string" name="tephigram_isotherm_grid" default="on" member="isotherm" to="bool" values="on/off">
+	 <parameter member="annotation_width" to="float" default="25" from="float" name="thermo_annotation_width">
+    		<documentation> Percentage of the width used to display the annotation on the right side . </documentation>
+	</parameter>  
+		<parameter from="string" name="thermo_isotherm_grid" default="on" member="isotherm" to="bool" values="on/off">
             		<documentation>
               	Plot the isotherms
            		</documentation>
            		<release>Magics++2.20		</release>
-           		<set name="tephigram_isotherm_colour" value="on">		</set>
-           		<set name="tephigram_isotherm_style" value="on">		</set> 
-           		<set name="tephigram_isotherm_thickness" value="on">		</set>
-           		<set name="tephigram_isotherm_interval" value="on">		</set>
-           		<set name="tephigram_isotherm_reference" value="on">		</set>
-           		<set name="tephigram_isotherm_reference_colour" value="on">		</set>
-           		<set name="tephigram_isotherm_reference_style" value="on">		</set>
-            		<set name="tephigram_isotherm_reference_thickness" value="on">		</set>
-           		<set name="tephigram_isotherm_label_colour" value="on">		</set>
-           		<set name="tephigram_isotherm_label_font_name" value="on">		</set>
-           		<set name="tephigram_isotherm_label_font_style" value="on">		</set>
-           		<set name="tephigram_isotherm_label_font_size" value="on">		</set>
-           		<set name="tephigram_isotherm_label_frequency" value="on">		</set>
+           		<set name="thermo_isotherm_colour" value="on">		</set>
+           		<set name="thermo_isotherm_style" value="on">		</set> 
+           		<set name="thermo_isotherm_thickness" value="on">		</set>
+           		<set name="thermo_isotherm_interval" value="on">		</set>
+           		<set name="thermo_isotherm_reference" value="on">		</set>
+           		<set name="thermo_isotherm_reference_colour" value="on">		</set>
+           		<set name="thermo_isotherm_reference_style" value="on">		</set>
+            		<set name="thermo_isotherm_reference_thickness" value="on">		</set>
+           		<set name="thermo_isotherm_label_colour" value="on">		</set>
+           		<set name="thermo_isotherm_label_font" value="on">		</set>
+           		<set name="thermo_isotherm_label_font_style" value="on">		</set>
+           		<set name="thermo_isotherm_label_font_size" value="on">		</set>
+           		<set name="thermo_isotherm_label_frequency" value="on">		</set>
         	</parameter>  
-     	<parameter member="isotherm_colour" to="Colour" default="charcoal" from="string" name="tephigram_isotherm_colour">
+     	<parameter member="isotherm_colour" to="Colour" default="charcoal" from="string" name="thermo_isotherm_colour">
             		<documentation>
               	Colou of the isotherms
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter>  
-        	<parameter member="isotherm_thickness" to="int" default="1" from="int" name="tephigram_isotherm_thickness">
+        	<parameter member="isotherm_thickness" to="int" default="1" from="int" name="thermo_isotherm_thickness">
             		<documentation>
               	Thickness  of the isotherms
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter> 
+       
         
-        
-       	<parameter member="isotherm_style" to="LineStyle" default="solid" from="string" name="tephigram_isotherm_style">
+       	<parameter member="isotherm_style" to="LineStyle" default="solid" from="string" name="thermo_isotherm_style">
             		<documentation>
               	Line Style  of the isotherms
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter>   
-        	<parameter member="isotherm_interval" to="float" default="10" from="float" name="tephigram_isotherm_interval">
+        	<parameter member="isotherm_interval" to="float" default="10" from="float" name="thermo_isotherm_interval">
             		<documentation>
               	interval for isotherms grid
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter> 
-          	<parameter member="isotherm_reference" to="float" default="0" from="float" name="tephigram_isotherm_reference">
+          	<parameter member="isotherm_reference" to="float" default="0" from="float" name="thermo_isotherm_reference">
             		<documentation>
               Reference   of the isotherms
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter>    
-        	<parameter member="isotherm_reference_colour" to="Colour" default="red" from="string" name="tephigram_isotherm_reference_colour">
+        	<parameter member="isotherm_reference_colour" to="Colour" default="red" from="string" name="thermo_isotherm_reference_colour">
             		<documentation>
               Reference   of the isotherms
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter> 
-          	<parameter member="isotherm_reference_style" to="LineStyle" default="solid" from="string" name="tephigram_isotherm_reference_style">
+          	<parameter member="isotherm_reference_style" to="LineStyle" default="solid" from="string" name="thermo_isotherm_reference_style">
             		<documentation>
               Reference   of the isotherms
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter>  
-        	<parameter member="isotherm_reference_thickness" to="int" default="2" from="int" name="tephigram_isotherm_reference_thickness">
+        	<parameter member="isotherm_reference_thickness" to="int" default="2" from="int" name="thermo_isotherm_reference_thickness">
             		<documentation>
               Reference   of the isotherms
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter> 
-        	<parameter member="isotherm_label_colour" to="Colour" default="charcoal" from="string" name="tephigram_isotherm_label_colour">
+        	<parameter member="isotherm_label_colour" to="Colour" default="charcoal" from="string" name="thermo_isotherm_label_colour">
             		<documentation>
               Label Colour for the isotherms
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter> 
-         	<parameter member="isotherm_label_font" to="string" default="sanserif" from="string" name="tephigram_isotherm_label_font_name">
+         	<parameter member="isotherm_label_font" to="string" default="sanserif" from="string" name="thermo_isotherm_label_font">
             		<documentation>
               Font name used for the isotherms labels 
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter> 
-        	<parameter member="isotherm_label_style" to="string" default="normal" from="string" name="tephigram_isotherm_label_font_style">
+        	<parameter member="isotherm_label_style" to="string" default="normal" from="string" name="thermo_isotherm_label_font_style">
             		<documentation>
                Font Style used for the isotherms labels 
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter> 
-         	<parameter member="isotherm_label_size" to="float" default="0.3" from="float" name="tephigram_isotherm_label_font_size">
+         	<parameter member="isotherm_label_size" to="float" default="0.3" from="float" name="thermo_isotherm_label_font_size">
             		<documentation>
               Font Size used for the isotherms labels 
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter>  
        
-         	<parameter member="isotherm_label_frequency" to="int" default="1" from="int" name="tephigram_isotherm_label_frequency">
+         	<parameter member="isotherm_label_frequency" to="int" default="1" from="int" name="thermo_isotherm_label_frequency">
             		<documentation>
              Isotherm frequency for labelling
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter> 
         
-    	<parameter member="isobar" to="bool" default="on" from="string" name="tephigram_isobar_grid">
+    	<parameter member="isobar" to="bool" default="on" from="string" name="thermo_isobar_grid">
             		<documentation>
               	Plot the isobars
            		</documentation>
            		<release>Magics++2.20		</release>
-           		<set name="tephigram_isobar_colour" value="on">		</set>
-           		<set name="tephigram_isobar_style" value="on">		</set> 
-           		<set name="tephigram_isobar_thickness" value="on">		</set>
-           		<set name="tephigram_isobar_interval" value="on">		</set>
-           		<set name="tephigram_isobar_reference" value="on">		</set>
-           		<set name="tephigram_isobar_label_colour" value="on">		</set>
-           		<set name="tephigram_isobar_label_font_name" value="on">		</set>
-           		<set name="tephigram_isobar_label_font_style" value="on">		</set>
-           		<set name="tephigram_isobar_label_font_size" value="on">		</set>
-           		<set name="tephigram_isobar_label_reference" value="on">		</set>
-           		<set name="tephigram_isobar_label_frequency" value="on">		</set>
+           		<set name="thermo_isobar_colour" value="on">		</set>
+           		<set name="thermo_isobar_style" value="on">		</set> 
+           		<set name="thermo_isobar_thickness" value="on">		</set>
+           		<set name="thermo_isobar_interval" value="on">		</set>
+           		<set name="thermo_isobar_reference" value="on">		</set>
+           		<set name="thermo_isobar_label_colour" value="on">		</set>
+           		<set name="thermo_isobar_label_font" value="on">		</set>
+           		<set name="thermo_isobar_label_font_style" value="on">		</set>
+           		<set name="thermo_isobar_label_font_size" value="on">		</set>
+           		<set name="thermo_isobar_label_reference" value="on">		</set>
+           		<set name="thermo_isobar_label_frequency" value="on">		</set>
         	</parameter>  
-     	<parameter member="isobar_colour" to="Colour" default="evergreen" from="string" name="tephigram_isobar_colour">
+     	<parameter member="isobar_colour" to="Colour" default="evergreen" from="string" name="thermo_isobar_colour">
             		<documentation>
               	Colou of the isobars
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter>  
-        	<parameter member="isobar_thickness" to="int" default="2" from="int" name="tephigram_isobar_thickness">
+        	<parameter member="isobar_thickness" to="int" default="2" from="int" name="thermo_isobar_thickness">
             		<documentation>
               	Thickness  of the isobars
            		</documentation>
@@ -134,78 +136,78 @@
         	</parameter> 
         
         
-       	<parameter member="isobar_style" to="LineStyle" default="solid" from="string" name="tephigram_isobar_style">
+       	<parameter member="isobar_style" to="LineStyle" default="solid" from="string" name="thermo_isobar_style">
             		<documentation>
               	Line Style  of the isobars
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter>   
-        	<parameter member="isobar_interval" to="float" default="100" from="float" name="tephigram_isobar_interval">
+        	<parameter member="isobar_interval" to="float" default="100" from="float" name="thermo_isobar_interval">
             		<documentation>
               	Interval between isobars
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter> 
-          	<parameter member="isobar_reference" to="float" default="1000" from="float" name="tephigram_isobar_reference">
+          	<parameter member="isobar_reference" to="float" default="1000" from="float" name="thermo_isobar_reference">
             		<documentation>
               	Line Style  of the isobars
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter> 
-                	<parameter member="isobar_label_colour" to="Colour" default="evergreen" from="string" name="tephigram_isobar_label_colour">
+                	<parameter member="isobar_label_colour" to="Colour" default="evergreen" from="string" name="thermo_isobar_label_colour">
             		<documentation>
               Label Colour for the isotherms
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter> 
-         	<parameter member="isobar_label_font" to="string" default="sanserif" from="string" name="tephigram_isobar_label_font_name">
+         	<parameter member="isobar_label_font" to="string" default="sanserif" from="string" name="thermo_isobar_label_font">
             		<documentation>
               Font name used for the isobars labels 
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter> 
-        	<parameter member="isobar_label_style" to="string" default="normal" from="string" name="tephigram_isobar_label_font_style">
+        	<parameter member="isobar_label_style" to="string" default="normal" from="string" name="thermo_isobar_label_font_style">
             		<documentation>
                Font Style used for the isobars labels 
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter> 
-         	<parameter member="isobar_label_size" to="float" default="0.3" from="float" name="tephigram_isobar_label_font_size">
+         	<parameter member="isobar_label_size" to="float" default="0.3" from="float" name="thermo_isobar_label_font_size">
             		<documentation>
               Font Size used for the isobars labels 
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter>  
         
-         	<parameter member="isobar_label_frequency" to="int" default="1" from="int" name="tephigram_isobar_label_frequency">
+         	<parameter member="isobar_label_frequency" to="int" default="1" from="int" name="thermo_isobar_label_frequency">
             		<documentation>
              isobar frequency for labelling
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter> 
-        	<parameter member="dry_adiabatic" to="bool" default="on" from="string" name="tephigram_dry_adiabatic_grid">
+        	<parameter member="dry_adiabatic" to="bool" default="on" from="string" name="thermo_dry_adiabatic_grid">
             		<documentation>
               	Plot the dry_adiabatics
            		</documentation>
            		<release>Magics++2.20		</release>
-           		<set name="tephigram_dry_adiabatic_colour" value="on">		</set>
-           		<set name="tephigram_dry_adiabatic_style" value="on">		</set> 
-           		<set name="tephigram_dry_adiabatic_thickness" value="on">		</set>
-           		<set name="tephigram_dry_adiabatic_intreval" value="on">		</set>
-           		<set name="tephigram_dry_adiabatic_reference" value="on">		</set>
-           		<set name="tephigram_dry_adiabatic_label_colour" value="on">		</set>
-           		<set name="tephigram_dry_adiabatic_label_font_name" value="on">		</set>
-           		<set name="tephigram_dry_adiabatic_label_font_style" value="on">		</set>
-           		<set name="tephigram_dry_adiabatic_label_font_size" value="on">		</set>
-           		<set name="tephigram_dry_adiabatic_label_frequency" value="on">		</set>
+           		<set name="thermo_dry_adiabatic_colour" value="on">		</set>
+           		<set name="thermo_dry_adiabatic_style" value="on">		</set> 
+           		<set name="thermo_dry_adiabatic_thickness" value="on">		</set>
+           		<set name="thermo_dry_adiabatic_intreval" value="on">		</set>
+           		<set name="thermo_dry_adiabatic_reference" value="on">		</set>
+           		<set name="thermo_dry_adiabatic_label_colour" value="on">		</set>
+           		<set name="thermo_dry_adiabatic_label_font" value="on">		</set>
+           		<set name="thermo_dry_adiabatic_label_font_style" value="on">		</set>
+           		<set name="thermo_dry_adiabatic_label_font_size" value="on">		</set>
+           		<set name="thermo_dry_adiabatic_label_frequency" value="on">		</set>
         	</parameter>  
-     	<parameter member="dry_adiabatic_colour" to="Colour" default="charcoal" from="string" name="tephigram_dry_adiabatic_colour">
+     	<parameter member="dry_adiabatic_colour" to="Colour" default="charcoal" from="string" name="thermo_dry_adiabatic_colour">
             		<documentation>
               	Colou of the dry_adiabatics
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter>  
-        	<parameter member="dry_adiabatic_thickness" to="int" default="1" from="int" name="tephigram_dry_adiabatic_thickness">
+        	<parameter member="dry_adiabatic_thickness" to="int" default="1" from="int" name="thermo_dry_adiabatic_thickness">
             		<documentation>
               	Thickness  of the dry_adiabatics
            		</documentation>
@@ -213,79 +215,79 @@
         	</parameter> 
         
         
-       	<parameter member="dry_adiabatic_style" to="LineStyle" default="solid" from="string" name="tephigram_dry_adiabatic_style">
+       	<parameter member="dry_adiabatic_style" to="LineStyle" default="solid" from="string" name="thermo_dry_adiabatic_style">
             		<documentation>
               	Line Style  of the dry_adiabatics
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter>   
-        	<parameter member="dry_adiabatic_interval" to="float" default="10" from="float" name="tephigram_dry_adiabatic_interval">
+        	<parameter member="dry_adiabatic_interval" to="float" default="10" from="float" name="thermo_dry_adiabatic_interval">
             		<documentation>
               	Interval between 2 dry_adiabatics.
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter> 
-          	<parameter member="dry_adiabatic_reference" to="float" default="0" from="float" name="tephigram_dry_adiabatic_reference">
+          	<parameter member="dry_adiabatic_reference" to="float" default="0" from="float" name="thermo_dry_adiabatic_reference">
             		<documentation>
               Reference   of the dry_adiabatics
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter> 
-         	<parameter member="dry_adiabatic_label_colour" to="Colour" default="charcoal" from="string" name="tephigram_dry_adiabatic_label_colour">
+         	<parameter member="dry_adiabatic_label_colour" to="Colour" default="charcoal" from="string" name="thermo_dry_adiabatic_label_colour">
             		<documentation>
               Label Colour for the isotherms
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter> 
-         	<parameter member="dry_adiabatic_label_font" to="string" default="sanserif" from="string" name="tephigram_dry_adiabatic_label_font_name">
+         	<parameter member="dry_adiabatic_label_font" to="string" default="sanserif" from="string" name="thermo_dry_adiabatic_label_font">
             		<documentation>
               Font name used for the dry_adiabatics labels 
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter> 
-        	<parameter member="dry_adiabatic_label_style" to="string" default="normal" from="string" name="tephigram_dry_adiabatic_label_font_style">
+        	<parameter member="dry_adiabatic_label_style" to="string" default="normal" from="string" name="thermo_dry_adiabatic_label_font_style">
             		<documentation>
                Font Style used for the dry_adiabatics labels 
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter> 
-         	<parameter member="dry_adiabatic_label_size" to="float" default="0.3" from="float" name="tephigram_dry_adiabatic_label_font_size">
+         	<parameter member="dry_adiabatic_label_size" to="float" default="0.3" from="float" name="thermo_dry_adiabatic_label_font_size">
             		<documentation>
               Font Size used for the dry_adiabatics labels 
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter>  
         
-         	<parameter member="dry_adiabatic_label_frequency" to="int" default="1" from="int" name="tephigram_dry_adiabatic_label_frequency">
+         	<parameter member="dry_adiabatic_label_frequency" to="int" default="1" from="int" name="thermo_dry_adiabatic_label_frequency">
             		<documentation>
               frequency for dry_adiabatic labelling
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter> 
     
-                	<parameter member="saturated_adiabatic" to="bool" default="on" from="string" name="tephigram_saturated_adiabatic_grid">
+                	<parameter member="saturated_adiabatic" to="bool" default="on" from="string" name="thermo_saturated_adiabatic_grid">
             		<documentation>
               	Plot the saturated_adiabatics
            		</documentation>
            		<release>Magics++2.20		</release>
-           		<set name="tephigram_saturated_adiabatic_colour" value="on">		</set>
-           		<set name="tephigram_saturated_adiabatic_style" value="on">		</set> 
-           		<set name="tephigram_saturated_adiabatic_thickness" value="on">		</set>
-           		<set name="tephigram_saturated_adiabatic_interval" value="on">		</set>
-           		<set name="tephigram_saturated_adiabatic_reference" value="on">		</set>
-           		<set name="tephigram_saturated_adiabatic_label_colour" value="on">		</set>
-           		<set name="tephigram_saturated_adiabatic_label_font_name" value="on">		</set>
-           		<set name="tephigram_saturated_adiabatic_label_font_style" value="on">		</set>
-           		<set name="tephigram_saturated_adiabatic_label_font_size" value="on">		</set>
-           		<set name="tephigram_saturated_adiabatic_label_frequency" value="on">		</set>
+           		<set name="thermo_saturated_adiabatic_colour" value="on">		</set>
+           		<set name="thermo_saturated_adiabatic_style" value="on">		</set> 
+           		<set name="thermo_saturated_adiabatic_thickness" value="on">		</set>
+           		<set name="thermo_saturated_adiabatic_interval" value="on">		</set>
+           		<set name="thermo_saturated_adiabatic_reference" value="on">		</set>
+           		<set name="thermo_saturated_adiabatic_label_colour" value="on">		</set>
+           		<set name="thermo_saturated_adiabatic_label_font" value="on">		</set>
+           		<set name="thermo_saturated_adiabatic_label_font_style" value="on">		</set>
+           		<set name="thermo_saturated_adiabatic_label_font_size" value="on">		</set>
+           		<set name="thermo_saturated_adiabatic_label_frequency" value="on">		</set>
         	</parameter>  
-     	<parameter member="saturated_adiabatic_colour" to="Colour" default="charcoal" from="string" name="tephigram_saturated_adiabatic_colour">
+     	<parameter member="saturated_adiabatic_colour" to="Colour" default="charcoal" from="string" name="thermo_saturated_adiabatic_colour">
             		<documentation>
               	Colou of the saturated_adiabatics
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter>  
-        	<parameter member="saturated_adiabatic_thickness" to="int" default="2" from="int" name="tephigram_saturated_adiabatic_thickness">
+        	<parameter member="saturated_adiabatic_thickness" to="int" default="2" from="int" name="thermo_saturated_adiabatic_thickness">
             		<documentation>
               	Thickness  of the dry_adiabatics
            		</documentation>
@@ -293,78 +295,78 @@
         	</parameter> 
         
         
-       	<parameter member="saturated_adiabatic_style" to="LineStyle" default="solid" from="string" name="tephigram_saturated_adiabatic_style">
+       	<parameter member="saturated_adiabatic_style" to="LineStyle" default="solid" from="string" name="thermo_saturated_adiabatic_style">
             		<documentation>
               	Line Style  of the saturated_adiabatics
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter>   
-        	<parameter member="saturated_adiabatic_interval" to="float" default="5" from="float" name="tephigram_saturated_adiabatic_interval">
+        	<parameter member="saturated_adiabatic_interval" to="float" default="5" from="float" name="thermo_saturated_adiabatic_interval">
             		<documentation>
               	interval for saturated_adiabatics grid
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter> 
-          	<parameter member="saturated_adiabatic_reference" to="float" default="0" from="float" name="tephigram_saturated_adiabatic_reference">
+          	<parameter member="saturated_adiabatic_reference" to="float" default="0" from="float" name="thermo_saturated_adiabatic_reference">
             		<documentation>
               Reference   of the saturated_adiabatics
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter> 
-         	<parameter member="saturated_adiabatic_label_colour" to="Colour" default="charcoal" from="string" name="tephigram_saturated_adiabatic_label_colour">
+         	<parameter member="saturated_adiabatic_label_colour" to="Colour" default="charcoal" from="string" name="thermo_saturated_adiabatic_label_colour">
             		<documentation>
               Label Colour for the isotherms
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter> 
-         	<parameter member="saturated_adiabatic_label_font" to="string" default="sanserif" from="string" name="tephigram_saturated_adiabatic_label_font_name">
+         	<parameter member="saturated_adiabatic_label_font" to="string" default="sanserif" from="string" name="thermo_saturated_adiabatic_label_font">
             		<documentation>
               Font name used for the saturated_adiabatics labels 
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter> 
-        	<parameter member="saturated_adiabatic_label_style" to="string" default="normal" from="string" name="tephigram_saturated_adiabatic_label_font_style">
+        	<parameter member="saturated_adiabatic_label_style" to="string" default="normal" from="string" name="thermo_saturated_adiabatic_label_font_style">
             		<documentation>
                Font Style used for the saturated_adiabatics labels 
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter> 
-         	<parameter member="saturated_adiabatic_label_size" to="float" default="0.3" from="float" name="tephigram_saturated_adiabatic_label_font_size">
+         	<parameter member="saturated_adiabatic_label_size" to="float" default="0.3" from="float" name="thermo_saturated_adiabatic_label_font_size">
             		<documentation>
               Font Size used for the saturated_adiabatics labels 
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter>  
         
-         	<parameter member="saturated_adiabatic_label_frequency" to="int" default="1" from="int" name="tephigram_saturated_adiabatic_label_frequency">
+         	<parameter member="saturated_adiabatic_label_frequency" to="int" default="1" from="int" name="thermo_saturated_adiabatic_label_frequency">
             		<documentation>
              saturated_adiabatic frequency for labelling
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter> 
-         	<parameter member="mixing_ratio" to="bool" default="on" from="string" name="tephigram_mixing_ratio_grid">
+         	<parameter member="mixing_ratio" to="bool" default="on" from="string" name="thermo_mixing_ratio_grid">
             		<documentation>
               	Plot the mixing_ratios
            		</documentation>
            		<release>Magics++2.20		</release>
-           		<set name="tephigram_mixing_ratio_colour" value="on">		</set>
-           		<set name="tephigram_mixing_ratio_style" value="on">		</set> 
-           		<set name="tephigram_mixing_ratio_thickness" value="on">		</set>
-           		<set name="tephigram_mixing_ratio_label_colour" value="on">		</set>
-           		<set name="tephigram_mixing_ratio_label_font_name" value="on">		</set>
-           		<set name="tephigram_mixing_ratio_label_font_style" value="on">		</set>
-           		<set name="tephigram_mixing_ratio_label_font_size" value="on">		</set>
-           		<set name="tephigram_mixing_ratio_label_frequency" value="on">		</set>
+           		<set name="thermo_mixing_ratio_colour" value="on">		</set>
+           		<set name="thermo_mixing_ratio_style" value="on">		</set> 
+           		<set name="thermo_mixing_ratio_thickness" value="on">		</set>
+           		<set name="thermo_mixing_ratio_label_colour" value="on">		</set>
+           		<set name="thermo_mixing_ratio_label_font" value="on">		</set>
+           		<set name="thermo_mixing_ratio_label_font_style" value="on">		</set>
+           		<set name="thermo_mixing_ratio_label_font_size" value="on">		</set>
+           		<set name="thermo_mixing_ratio_label_frequency" value="on">		</set>
            
           
         	</parameter>  
-     	<parameter member="mixing_ratio_colour" to="Colour" default="purple" from="string" name="tephigram_mixing_ratio_colour">
+     	<parameter member="mixing_ratio_colour" to="Colour" default="purple" from="string" name="thermo_mixing_ratio_colour">
             		<documentation>
               	Colou of the mixing_ratios
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter>  
-        	<parameter member="mixing_ratio_thickness" to="int" default="1" from="int" name="tephigram_mixing_ratio_thickness">
+        	<parameter member="mixing_ratio_thickness" to="int" default="1" from="int" name="thermo_mixing_ratio_thickness">
             		<documentation>
               	Thickness  of the mixing_ratios
            		</documentation>
@@ -372,45 +374,45 @@
         	</parameter> 
         
         
-       	<parameter member="mixing_ratio_style" to="LineStyle" default="dash" from="string" name="tephigram_mixing_ratio_style">
+       	<parameter member="mixing_ratio_style" to="LineStyle" default="dash" from="string" name="thermo_mixing_ratio_style">
             		<documentation>
               	Line Style  of the mixing_ratios
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter>   
        
-         	<parameter member="mixing_ratio_frequency" to="int" default="1" from="int" name="tephigram_mixing_ratio_frequency">
+         	<parameter member="mixing_ratio_frequency" to="int" default="1" from="int" name="thermo_mixing_ratio_frequency">
             		<documentation>
              mixing_ratio frequency for grid
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter> 
-         	<parameter member="mixing_ratio_label_colour" to="Colour" default="purple" from="string" name="tephigram_mixing_ratio_label_colour">
+         	<parameter member="mixing_ratio_label_colour" to="Colour" default="purple" from="string" name="thermo_mixing_ratio_label_colour">
             		<documentation>
               Label Colour for the isotherms
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter> 
-         	<parameter member="mixing_ratio_label_font" to="string" default="sanserif" from="string" name="tephigram_mixing_ratio_label_font_name">
+         	<parameter member="mixing_ratio_label_font" to="string" default="sanserif" from="string" name="thermo_mixing_ratio_label_font">
             		<documentation>
               Font name used for the mixing_ratios labels 
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter> 
-        	<parameter member="mixing_ratio_label_style" to="string" default="normal" from="string" name="tephigram_mixing_ratio_label_font_style">
+        	<parameter member="mixing_ratio_label_style" to="string" default="normal" from="string" name="thermo_mixing_ratio_label_font_style">
             		<documentation>
                Font Style used for the mixing_ratios labels 
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter> 
-         	<parameter member="mixing_ratio_label_size" to="float" default="0.3" from="float" name="tephigram_mixing_ratio_label_font_size">
+         	<parameter member="mixing_ratio_label_size" to="float" default="0.3" from="float" name="thermo_mixing_ratio_label_font_size">
             		<documentation>
               Font Size used for the mixing_ratios labels 
            		</documentation>
            		<release>Magics++2.20		</release> 
         	</parameter>  
       
-         	<parameter member="mixing_ratio_label_frequency" to="int" default="1" from="int" name="tephigram_mixing_ratio_label_frequency">
+         	<parameter member="mixing_ratio_label_frequency" to="int" default="1" from="int" name="thermo_mixing_ratio_label_frequency">
             		<documentation>
              mixing_ratio frequency for labelling
            		</documentation>
diff --git a/src/params/TephiInfo.xml b/src/params/TephiInfo.xml
index b535b35..18e87de 100644
--- a/src/params/TephiInfo.xml
+++ b/src/params/TephiInfo.xml
@@ -1,2 +1,2 @@
 <magics>
-<class inherits="Tephigram" xmltag="tephigram" name="TephiInfo" directory="common" action="ptephi" include="Tephigram.h"/></magics>
+<class inherits="Tephigram" xmltag="thermo" name="TephiInfo" directory="common" action="ptephi" include="Tephigram.h"/></magics>
diff --git a/src/params/Tephigram.xml b/src/params/Tephigram.xml
index 14be777..bdc236f 100644
--- a/src/params/Tephigram.xml
+++ b/src/params/Tephigram.xml
@@ -1,20 +1,27 @@
 <magics>
-<class action="ptephi" inherits="Transformation" directory="common" xmltag="tephigram" name="Tephigram">
+<class action="ptephi" inherits="Transformation" directory="common" xmltag="thermo" name="Tephigram">
 
 	<parameter member="x_min" to="float" default="0" from="float" name="x_min">
-    		<release>Magics++0.1		</release>
+    		
+	</parameter>
+   <parameter member="x_automatic" to="bool" default="off" from="string" name="subpage_x_automatic">
+    		
+	</parameter> 
+	 <parameter member="y_automatic" to="bool" default="off" from="string" name="subpage_y_automatic">
+    		
 	</parameter>
-
 	<parameter member="x_max" to="float" default="100" from="float" name="x_max">
-    		<release>Magics++0.1		</release>
+    	
 	</parameter>    
 	<parameter member="y_min" to="float" default="0" from="float" name="y_min">
-    		<release>Magics++0.1		</release>
+    		
 	</parameter>
 
 	<parameter member="y_max" to="float" default="100" from="float" name="y_max">
-    		<release>Magics++0.1		</release>
+    		
 	</parameter>     
-
+	<parameter member="annotation_width" to="float" default="25" from="float" name="thermo_annotation_width">
+    		<documentation> Percentage of the width used to display the annotation on the right side . </documentation>
+	</parameter>  
 
 </class></magics>
diff --git a/src/params/TextVisitor.xml b/src/params/TextVisitor.xml
index 6f423ec..70c06af 100644
--- a/src/params/TextVisitor.xml
+++ b/src/params/TextVisitor.xml
@@ -117,7 +117,9 @@
 			<release>Magisc++0.3		</release>
 			<documentation> How text is to be positioned in each line (LEFT/CENTRE/RIGHT)		</documentation>
   	</parameter>
-
+	<parameter from="string" name="text_orientation" default="horizontal" member="orientation" to="string" values="horizontal/top_bottom/bottom_top">
+    		<documentation> Orientation of the text		</documentation>
+	</parameter>
 
    	<parameter from="string" name="text_automatic" visible="no" default="on" member="automatic" to="bool">
 			<release>Magisc++2.1		</release>
diff --git a/src/params/WindPlotting.xml b/src/params/WindPlotting.xml
index 0cd61c0..b69b722 100644
--- a/src/params/WindPlotting.xml
+++ b/src/params/WindPlotting.xml
@@ -42,9 +42,9 @@
 	<parameter member="levels" to="LevelSelection" default="count" from="string" name="wind_advanced_colour_selection_type">
          		<documentation>Set selection method 		</documentation>
          		<release>2.6		</release>
-         		<option xml="count" fortran="count" docdive="no" include="CountSelectionType.h" name="CountSelectionType">		</option>
-         		<option xml="interval" fortran="interval" docdive="no" include="IntervalSelectionType.h" name="IntervalSelectionType">		</option>
-         		<option xml="list" fortran="list" docdive="no" include="LevelListSelectionType.h" name="LevelListSelectionType">		</option>
+         		<option xml="count" fortran="count"  include="CountSelectionType.h" name="CountSelectionType">		</option>
+         		<option xml="interval" fortran="interval"  include="IntervalSelectionType.h" name="IntervalSelectionType">		</option>
+         		<option xml="list" fortran="list" include="LevelListSelectionType.h" name="LevelListSelectionType">		</option>
          		<set name="wind_advanced_colour_level_list" value="list">		</set>
          		<set name="wind_advanced_colour_level_interval" value="interval">		</set>	
          		<set name="wind_advanced_colour_reference_level" value="interval">		</set>
@@ -97,8 +97,8 @@
   				<set name="wind_advanced_colour_direction" value="calculate">		</set>
   				<set name="wind_advanced_colour_list" value="list">		</set>
   				<set name="wind_advanced_colour_list_policy" value="list">		</set>
-         		<option xml="calculate" fortran="calculate" docdive="no" include="CalculateColourTechnique.h" name="CalculateColourTechnique">		</option>
-         		<option xml="list" fortran="list" docdive="no" include="ListColourTechnique.h" name="ListColourTechnique">		</option>
+         		<option xml="calculate" fortran="calculate"  include="CalculateColourTechnique.h" name="CalculateColourTechnique">		</option>
+         		<option xml="list" fortran="list"  include="ListColourTechnique.h" name="ListColourTechnique">		</option>
          		<release>2.6		</release>
   	</parameter>
 
diff --git a/src/params/WrepJSon.xml b/src/params/WrepJSon.xml
index 4322bd7..10d596d 100644
--- a/src/params/WrepJSon.xml
+++ b/src/params/WrepJSon.xml
@@ -6,7 +6,10 @@
     	<parameter member="param_info" to="string" default="" from="string" name="wrepjson_parameter_information">
          		<documentation> Product information for  key=parameter_info  		</documentation>
         	</parameter> 
-        		
+        <parameter member="title" to="bool" default="on" from="string" name="wrepjson_title" visible='false'>
+         		<documentation> Do not create automatic title	</documentation>
+        	</parameter>   
+        			
         	<parameter member="position_info" to="bool" default="on" from="string" name="wrepjson_position_information">
          		<documentation> Switch on/off the position information in the title. 		</documentation>
         	</parameter> 
diff --git a/src/params/xx.xml b/src/params/xx.xml
deleted file mode 100644
index f4dd7ce..0000000
--- a/src/params/xx.xml
+++ /dev/null
@@ -1,84 +0,0 @@
-<magics>
-<class inherits="SymbolMode" xmltag="individual" name="SymbolIndividualMode" prefix="symbol" directory="visualisers" include="SymbolMode.h">
-    	<documentation>Here comes the description of the SymbolIndividualMode object	</documentation>
-
-    	<parameter default="" to="string" member="legend_text" from="string" name="legend_user_text">
-        		<documentation> if set, the text to be shown for the symbol group in the legend				</documentation>
-    	</parameter>
-
-    	<parameter member="colour" to="Colour" default="BLUE" from="string" name="symbol_colour">
-        		<documentation> Colour of symbols.   		</documentation>
-    	</parameter>
-
-    	<parameter member="height" to="float" default="0.2" from="float" name="symbol_height">
-        		<documentation> Height of symbols.  		</documentation>
-    	</parameter>
-
-    	<parameter from="string" name="symbol_marker_mode" default="index" member="marker_mode" to="string" values="index/name/image">
-        		<documentation> Method to select a marker : by name, by index, by image : in that case, Magics will use an external image as marker.
-        		</documentation>
-        		<set name="symbol_marker_index" value="index"/>
-        		<noset name="symbol_marker_name" value="name"/>
-        		<set name="symbol_image_path" value="image"/>
-        		<set name="symbol_image_format" value="image"/>
-        		<set name="symbol_image_width" value="image"/>
-        		<set name="symbol_image_height" value="image"/>
-
-    	</parameter>
-        
-       
-    	<parameter member="marker" to="int" default="1" from="int" name="symbol_marker_index">
-        		<documentation> Marker indice:  An integer between 1 and 28		</documentation>
-    	</parameter>
-        
-    	<parameter member="symbol" to="string" default="dot" from="string" name="symbol_marker_name">
-        		<documentation> Symbol name. Choose in a list of available markers dot/circle/ww_00 ... 		</documentation>
-    	</parameter>
-
-    	<parameter member="image_path" to="string" default="" from="string" name="symbol_image_path">
-        		<documentation> Path to the image 		</documentation>
-    	</parameter>
-        
-    	<parameter from="string" name="symbol_image_format" default="automatic" member="image_format" to="string" values="automatic/png/svg">
-        		<documentation> Format of the image file. If set to AUTOMATIC, the file extension will be used to determine the file type. 		</documentation>
-    	</parameter>
-        
-    	<parameter member="image_width" to="float" default="-1" from="float" name="symbol_image_width">
-        		<documentation>  width of the image 		</documentation>
-    	</parameter> 
-
-    	<parameter member="image_height" to="float" default="-1" from="float" name="symbol_image_height">
-        		<documentation>  height of the image 		</documentation>
-    	</parameter>
-
-    	<parameter member="text" to="stringarray" default="stringarray()" from="stringarray" name="symbol_text_list">
-        		<documentation> list of texts to plot 		</documentation>
-    	</parameter>
-
-    	<parameter from="string" name="symbol_text_position" default="right" member="text_position" to="string" values="right/left/bottom/top">
-        		<documentation> Position of the text 		</documentation>
-    	</parameter>
-
-    	<parameter member="text_font_name" to="string" default="sansserif" from="string" name="symbol_text_font_name">
-        		<documentation> Font to use  		</documentation>
-    	</parameter>
-
-    	<parameter member="text_font_size" to="float" default="0.25" from="float" name="symbol_text_font_size">
-        		<documentation> Font size  		</documentation>
-    	</parameter>
-
-    	<parameter member="text_font_style" to="string" default="normal" from="string" name="symbol_text_font_style">
-            		<documentation> Font style  		</documentation>
-    	</parameter>
-
-    	<parameter member="text_font_colour" to="Colour" default="automatic" from="string" name="symbol_text_font_colour">
-        		<documentation> Font colour.  		</documentation>
-    	</parameter> 
-
-    	<parameter member="text_blanking" to="bool" default="off" from="string" name="symbol_text_blanking">
-        		<documentation> blanking of the text 		</documentation>
-    	</parameter>
-    	<parameter member="legend_height" to="float" default="-1" from="float" name="symbol_legend_height">
-         		<documentation> If set, the height will be used to plot the symbols in the legend 		</documentation>
-  		</parameter>
-</class></magics>
diff --git a/src/visualisers/ArrowPlotting.cc b/src/visualisers/ArrowPlotting.cc
index 646f82c..f490a6e 100644
--- a/src/visualisers/ArrowPlotting.cc
+++ b/src/visualisers/ArrowPlotting.cc
@@ -38,11 +38,14 @@ void ArrowPlotting::operator()(bool north, const PaperPoint& point, double x, do
    if ( maxVelocity_ < speed )
        maxVelocity_ = speed;
 
-   if ( !levels_->empty() && (speed < levels_->front() || speed > levels_->back()) ) return;
+   double value = this->value(x, y, val);
+
+   if ( !levels_->empty() && ( value < levels_->front() || value > levels_->back()) ) return;
    if ( speed < min_speed_ || speed > max_speed_ ) return;
 
    if ((*this->calm_)(point, x, y)) return; 
 
+
    Colour colour = this->colour(*colour_, x, y, val);
    if ( north )
 	   northArrow(colour)->push_back(ArrowPoint(x, y, point));
diff --git a/src/visualisers/Axis.cc b/src/visualisers/Axis.cc
index 203d9a8..0b6fa86 100644
--- a/src/visualisers/Axis.cc
+++ b/src/visualisers/Axis.cc
@@ -356,11 +356,14 @@ void VerticalAxis::label(VerticalAxisVisitor& axis)
 	{
 		if ( (*y)->isLabel() == false)
 			continue;
+
+		string label = createLabel(**y);
+
 		if ( !transformation.inY((*y)->position()) ) continue;
 
 		if ( (*y)->isFirst()   && !label_first_ ) continue;
 		if ( (*y)->isLast() && !label_last_ ) continue;
-		string label = createLabel(**y);
+
 
 		if ( label.empty() ) continue;
 		count++;
diff --git a/src/visualisers/AxisMethod.h b/src/visualisers/AxisMethod.h
index a3d8dd0..e911bf5 100644
--- a/src/visualisers/AxisMethod.h
+++ b/src/visualisers/AxisMethod.h
@@ -51,7 +51,7 @@ public:
 	AxisMethod();
 	virtual ~AxisMethod();
 
-	AxisMethod* clone() { assert(false); }
+	AxisMethod* clone() { assert(false);  return 0;}
 	virtual void set(const map<string, string>& map) {
 		AxisMethodAttributes::set(map);
 	}
diff --git a/src/visualisers/CMakeLists.txt b/src/visualisers/CMakeLists.txt
index 0c99287..dbd53c3 100644
--- a/src/visualisers/CMakeLists.txt
+++ b/src/visualisers/CMakeLists.txt
@@ -102,8 +102,6 @@ Histogram.cc
 Histogram.h
 ImageCalculateColourTechnique.h
 ImageListColourTechnique.h
-ImagePlotting.cc
-ImagePlotting.h
 ImportPlot.h
 IntervalSelectionType.cc
 IntervalSelectionType.h
@@ -200,8 +198,7 @@ set( visualisers_srcs ${visualisers_srcs} PARENT_SCOPE )
 if ( ENABLE_METVIEW )
     list (APPEND metview_include 
             visualisers/LegendMethod.h      
-             visualisers/ImagePlotting.h
-             visualisers/LookupTableMode.h
+            visualisers/LookupTableMode.h
             )
     set( metview_include ${metview_include} PARENT_SCOPE )
 endif()
diff --git a/src/visualisers/CellShading.cc b/src/visualisers/CellShading.cc
index 33618eb..35efb7f 100644
--- a/src/visualisers/CellShading.cc
+++ b/src/visualisers/CellShading.cc
@@ -180,6 +180,7 @@ bool CellShading::prepare(const LevelSelection& levels, const ColourTechnique& t
 	// First Interval ...
 	
 	map_.clear();
+	colours_.clear();
 	map_[Interval(INT_MIN, levels.front())] = 0;
 	colours_.push_back(Colour("none"));
 	for (unsigned int i = 0; i < levels.size() -1; i++)
diff --git a/src/visualisers/ColourTechnique.cc b/src/visualisers/ColourTechnique.cc
index be085e3..b340e5c 100644
--- a/src/visualisers/ColourTechnique.cc
+++ b/src/visualisers/ColourTechnique.cc
@@ -55,13 +55,16 @@ void ColourTechnique::print(ostream& out)  const
 	out << "]";
 }
 
-void ColourTechnique::prepare(const LevelSelection& levels) 
+void ColourTechnique::prepare(const LevelSelection& levels, bool rainbow)
 {
 	if (levels.empty() ) return; 
 	clear();
 	bands_.clear();
 	ColourTable table;
-	set(table, levels.size());
+	if ( rainbow )
+		set(table, levels.size()+1);
+	else
+		set(table, levels.size());
 	
 	if ( table.empty()) table.push_back(Colour("none"));
     ColourTable::ColourIterator colour = table.begin(); 
@@ -73,11 +76,15 @@ void ColourTechnique::prepare(const LevelSelection& levels)
     
     double previous = 0;
     int index = 0;
-   
+
     for (LevelSelection::const_iterator  val  = levels.begin();  val != levels.end(); ++val)
     {               
-    	
-         (*this)[*val] = ColourInfo(index, *val, left, right);
+    	 if ( rainbow ) {
+    		 (*this)[*val] = ColourInfo(index, *val, right, right);
+    	 }
+    	 else {
+    		 (*this)[*val] = ColourInfo(index, *val, left, right);
+    	 }
          ranges_[*val] = std::make_pair(previous, *val);
          previous = *val;
          index++;
@@ -96,7 +103,8 @@ void ColourTechnique::prepare(const LevelSelection& levels)
          else right = colour->colour();
 
     }
-    bands_.insert(make_pair(Interval(levels.back(), levels.back() + epsilon), left));
+    if ( !rainbow )
+    	bands_.insert(make_pair(Interval(levels.back(), levels.back() + epsilon), left));
 
     MagLog::dev() << levels.back() << "<<" << left << "<<" << levels.back() + epsilon << endl;
 } 
@@ -107,9 +115,11 @@ Colour ColourTechnique::operator()(double value) const
     const_iterator info = find(value);
     if (info == end() ) {
 
-        //MagLog::warning() << "canot find a colour for " << value << "\n";
+
         return Colour(-1, -1, -1);
     }
+    Colour colour =   info->second.left_;
+
 
     return info->second.left_;
 } 
@@ -188,7 +198,8 @@ void ColourTechnique::visit(LegendVisitor& legend)
         
         legend.add(new BoxEntry(min, max, box));
      
-	}	
+	}
+
 }
 
 
diff --git a/src/visualisers/ColourTechnique.h b/src/visualisers/ColourTechnique.h
index b17efab..ddaa93c 100644
--- a/src/visualisers/ColourTechnique.h
+++ b/src/visualisers/ColourTechnique.h
@@ -88,12 +88,13 @@ public:
     double rightRange(double) const;
     
     virtual void set(ColourTable&, int) const {}
-    void prepare(const LevelSelection&);  
+    void prepare(const LevelSelection&, bool rainbow = false);
     
     void colours(vector<string>&) const; 
     
 	void visit(LegendVisitor&);
 	ListPolicy getPolicy() const { return policy_; }
+
 protected:
      //! Method to print string about this class on to a stream of type ostream (virtual).
 	 virtual void print(ostream&) const; 
diff --git a/src/visualisers/Contour.cc b/src/visualisers/Contour.cc
index 1b19692..1ab7cb0 100644
--- a/src/visualisers/Contour.cc
+++ b/src/visualisers/Contour.cc
@@ -107,7 +107,10 @@ void Contour::operator()(Data& data, BasicGraphicsObjectContainer& parent)
     data.getReady(parent.transformation());
 
 	MatrixHandler* box =  data.matrix().getReady(parent.transformation());
-
+	if (!box  ){
+		MagLog::error() << "Invalid data for contouring" << endl;
+		return;
+	}
 	if ( !box->rows() ||  !box->columns() ) {
 		(*this->contour_)(data, parent);
 		(*this->grid_)(data, parent);
diff --git a/src/visualisers/CountSelectionType.h b/src/visualisers/CountSelectionType.h
index cde83dc..3b649ba 100644
--- a/src/visualisers/CountSelectionType.h
+++ b/src/visualisers/CountSelectionType.h
@@ -63,7 +63,7 @@ public:
     }
     void set(const LevelSelectionInterface&);
 
-    double reference() const { return reference_; }
+    double reference(int) const { return reference_; }
 
 protected:
      //! Method to print string about this class on to a stream of type ostream (virtual).
diff --git a/src/visualisers/Curve.cc b/src/visualisers/Curve.cc
index 7b4da1c..c05206b 100644
--- a/src/visualisers/Curve.cc
+++ b/src/visualisers/Curve.cc
@@ -106,7 +106,7 @@ void Curve::operator()(Data& data, BasicGraphicsObjectContainer& task)
 
 
     std::set<string> needs;
-    CustomisedPointsList points;
+    CustomisedPointsList raw, points;
 
     data.customisedPoints(transformation, needs, points, true);
 
@@ -121,6 +121,10 @@ void Curve::operator()(Data& data, BasicGraphicsObjectContainer& task)
 	
 	CustomisedPointsList::iterator point = points.begin();
 
+	// we clean the list;
+
+
+
     while ( point != points.end() ) {
     	if ( this->missing(**point) ) {
     		++point;
@@ -193,6 +197,7 @@ void Curve::operator()(Data& data, BasicGraphicsObjectContainer& task)
     }
 
     if ( missing.empty() == false ) {
+
     	std::map<string, MissingMethod>::iterator method = missingMethods_.find(lowerCase(missing_mode_));
     	if ( method == missingMethods_.end() )
     	{
@@ -396,6 +401,8 @@ bool Curve::ignore(const PaperPoint&, const PaperPoint&, const vector<PaperPoint
 
 bool Curve::join(const PaperPoint& p1, const PaperPoint& p2, const vector<PaperPoint>& , BasicGraphicsObjectContainer& task)
 {
+	if ( !task.transformation().in(p2) )
+		return true;
 	Polyline* curve  = new Polyline();
 	(*curve).setColour(*missing_colour_);
 	(*curve).setLineStyle(missing_style_);
diff --git a/src/visualisers/DateAxis.cc b/src/visualisers/DateAxis.cc
index 4a93e5c..5b908ac 100644
--- a/src/visualisers/DateAxis.cc
+++ b/src/visualisers/DateAxis.cc
@@ -252,8 +252,11 @@ void DateAxisMethod::years(AxisItems& list)
 		    else if ( max-min < 50*seconds_a_year ) {
 		    	frequency = 2;
 		    }
-		    else
+		    else if ( max-min < 100*seconds_a_year ) {
 		    	frequency = 5;
+		    }
+		    else
+		    	frequency = 10;
 		}
 		else {
 			frequency = (int) interval_;
diff --git a/src/visualisers/EpsGraph.cc b/src/visualisers/EpsGraph.cc
index 35f3543..83a9df7 100644
--- a/src/visualisers/EpsGraph.cc
+++ b/src/visualisers/EpsGraph.cc
@@ -779,8 +779,11 @@ void EpsGraph::operator()(Data& data, BasicGraphicsObjectContainer& visitor)
 
 	std::sort(eps.begin(), eps.end());
 
-	for (vector<double>::iterator e = eps.begin(); e != eps.end(); ++e)
+	for (vector<double>::iterator e = eps.begin(); e != eps.end(); ++e) {
 		if ( same(*e, 0) ) *e = 0;
+        //cout << *e << " ";
+    }
+    //cout << endl;
 
         double epsmin, eps10, eps25,  eps50, eps75, eps90, epsmax;
         if ( ninty != (*point)->end() ) {
@@ -826,25 +829,31 @@ void EpsGraph::operator()(Data& data, BasicGraphicsObjectContainer& visitor)
         
         if ( ninty != (*point)->end() ) {
         	fullEps_ = true;
+        	if ( eps75 != eps90 ) {
             box->push_back(PaperPoint(x-(width/2), eps75));
             box->push_back(PaperPoint(x-(width/2), eps90) );
             box->push_back(PaperPoint(x+(width/2), eps90));
             box->push_back(PaperPoint(x+(width/2), eps75));
+        	}
             
         }
+        if ( eps75 != eps25 ) {
 		box->push_back(PaperPoint(x+width, eps75));
 		box->push_back(PaperPoint(x+width, eps25));
-
+        }
         if ( ten != (*point)->end() ) {
+        	if ( eps25 != eps10 ) {
+
             box->push_back(PaperPoint(x+(width/2), eps25));
             box->push_back(PaperPoint(x+(width/2),eps10));
             box->push_back(PaperPoint(x-(width/2), eps10));
             box->push_back(PaperPoint(x-(width/2), eps25));
-            
+        	}
         }
+        if ( eps25 != eps50 ) {
         box->push_back(PaperPoint(x-width, eps25));
         box->push_back(PaperPoint(x-width, eps50));
-
+        }
     	bar1->push_back(PaperPoint(x+width, eps25));
     	bar1->push_back(PaperPoint(x-width, eps25));
 
@@ -2419,6 +2428,7 @@ EpsPlume::EpsPlume()
 
 void EpsPlume::visit(LegendVisitor& legend)
 {
+	if (!legend_) return;
 	if ( shading_ )
 	{
 		for ( vector<Colour>::iterator entry = shading_legend_.begin(); entry != shading_legend_.end(); ++entry) {
diff --git a/src/visualisers/FlagPlotting.cc b/src/visualisers/FlagPlotting.cc
index dbb6f27..d16dd04 100644
--- a/src/visualisers/FlagPlotting.cc
+++ b/src/visualisers/FlagPlotting.cc
@@ -33,22 +33,69 @@
 
 using namespace magics;
 
-void FlagPlotting::operator()(bool north, const PaperPoint& point, double x, double y,double)
+void FlagPlotting::operator()(bool north, const PaperPoint& point, double x, double y,double val)
 { 
 	   if (legendOnly_ )
 		   return;
 		double speed = sqrt((x*x)+(y*y));
-		 if ( !levels_->empty() && (speed < levels_->front() || speed > levels_->back()) ) return;
+
+		double value = this->value(x, y, val);
+		 if ( !levels_->empty() && (value < levels_->front() || value  > levels_->back()) ) return;
 		   if ( speed < min_speed_ || speed > max_speed_ ) return;
 		
 	   if ((*calm_)(point, x, y)) return;
-	
-		if ( north )
-			northFlags_->push_back(ArrowPoint(x, y, point));
-		else southFlags_->push_back(ArrowPoint(x, y, point));
+	   Colour colour = this->colour(*colour_, x, y, val);
+	   if ( north )
+	   	   northFlag(colour)->push_back(ArrowPoint(x, y, point));
+	   else
+	   	   southFlag(colour)->push_back(ArrowPoint(x, y, point));
+
 		
 		
 }
+//! Setting for south Hemisphere wind
+Flag* FlagPlotting::southFlag(const Colour& colour)
+{
+	map<Colour, Flag* >:: iterator flag =  southFlags_.find(colour);
+	if ( flag !=southFlags_.end()  )
+		return flag->second;
+
+	 Flag* south = new Flag();
+	   south->setColour(colour);
+	   south->setThickness(thickness_);
+	   south->setOriginHeight(origin_marker_size_);
+	   south->setStyle(this->style_);
+	   south->setCrossBoundary(cross_boundary_);
+	   south->setOriginHeight(origin_marker_size_);
+	   south->setHemisphere(SOUTH);
+	   south->setLength(length_);
+	   southFlags_.insert(make_pair(colour, south));
+	   (*origin_).prepare(*south);
+	   return south;
+}
+
+
+//! Setting for north Hemisphere wind
+Flag* FlagPlotting::northFlag(const Colour& colour)
+{
+	map<Colour, Flag* >:: iterator flag =  northFlags_.find(colour);
+	if ( flag != northFlags_.end()  )
+	return flag->second;
+
+	Flag *north = new Flag();
+	north->setColour(colour);
+	north->setOriginHeight(origin_marker_size_);
+	north->setThickness(thickness_);
+	north->setCrossBoundary(cross_boundary_);
+	north->setOriginHeight(origin_marker_size_);
+	north->setHemisphere(NORTH);
+	northFlags_.insert(make_pair(colour, north));
+	north->setLength(length_);
+	(*origin_).prepare(*north);
+
+    return north;
+}
+
 
 void FlagPlotting::prepare(BasicGraphicsObjectContainer& task, double)
 { 
@@ -61,38 +108,16 @@ void FlagPlotting::prepare(BasicGraphicsObjectContainer& task, double)
     
   
     
-    
-    // Setting for south Hemisphere wind	
-	southFlags_ = new Flag();
-	southFlags_->setColour(*colour_);
-	southFlags_->setThickness(thickness_);
-	southFlags_->setStyle(style_);
-	southFlags_->setCrossBoundary(cross_boundary_);
-	southFlags_->setHemisphere(SOUTH);
-	southFlags_->setOriginHeight(calm_indicator_size_);
-	southFlags_->setLength(length_);
-	
-	// Setting for south Hemisphere wind	
-	northFlags_ = new Flag();
-	northFlags_->setColour(*colour_);
-	northFlags_->setThickness(thickness_);
-	northFlags_->setCrossBoundary(cross_boundary_);
-	northFlags_->setOriginHeight(calm_indicator_size_);
-	northFlags_->setHemisphere(NORTH);
-	northFlags_->setLength(length_);
-	
-	// Origin Indicator 	  
-    (*origin_).prepare(*southFlags_);
-    (*origin_).prepare(*northFlags_);
-    
-    northFlags_->setOriginHeight(origin_marker_size_);
-    southFlags_->setOriginHeight(origin_marker_size_);
+
+
 	if ( legendOnly_) {
 
 		return;
 	}
-	task.push_back(southFlags_);	
-	task.push_back(northFlags_);	
+	// We also empty the containers to get a clean new plot
+	northFlags_.clear();
+	southFlags_.clear();
+
 }
 
 void FlagPlotting::visit(LegendVisitor& legend)
@@ -143,9 +168,46 @@ void FlagPlotting::visit(Data& data, PointsHandler& points, HistoVisitor& visito
 		} 	
             	beans.insert(make_pair(Interval(*from, *to), colour ));
             	++from;
-        }		  	
+        }
     }
     
     Histogram helper;
     helper.visit(beans, data, points, visitor);
 }  
+
+struct SortHelper
+{
+	SortHelper() {}
+	~SortHelper() {}
+	MAGICS_NO_EXPORT bool operator()(const Arrow* first, const Arrow* second)
+	{
+ 		return first->size() > second->size();
+	}
+};
+void FlagPlotting::finish(BasicGraphicsObjectContainer& out)
+{
+	if ( legendOnly_) {
+		// and now we reset
+		northFlags_.clear();
+		southFlags_.clear();
+		return;
+	}
+
+	vector<Flag*> flags;
+	for ( map<Colour, Flag*>::iterator flag = northFlags_.begin(); flag != northFlags_.end(); ++flag)
+		flags.push_back(flag->second);
+
+	for ( map<Colour, Flag*>::iterator flag = southFlags_.begin(); flag != southFlags_.end(); ++flag)
+		flags.push_back(flag->second);
+
+	 std::sort(flags.begin(), flags.end(), SortHelper());
+
+	// Now we feed the task...
+	for (vector<Flag* >::iterator flag = flags.begin(); flag != flags.end(); ++flag) {
+		if ( !(*flag)->empty() ) {
+
+		     out.push_back(*flag);
+		}
+	}
+
+}
diff --git a/src/visualisers/FlagPlotting.h b/src/visualisers/FlagPlotting.h
index 8b2300d..d8c59a6 100644
--- a/src/visualisers/FlagPlotting.h
+++ b/src/visualisers/FlagPlotting.h
@@ -42,7 +42,7 @@ class FlagPlotting: public WindPlotting, public FlagPlottingAttributes
 {
 
 public:
-	FlagPlotting() : northFlags_(0), southFlags_(0) {}
+	FlagPlotting() {}
 	virtual ~FlagPlotting() {}
 	virtual void set(const map<string, string>& map) 
 		{ WindPlottingAttributes::set(map); FlagPlottingAttributes::set(map); }
@@ -57,19 +57,21 @@ public:
 	}
 	
 	virtual void operator()(bool, const PaperPoint& point, double x, double y,double);
-
+	Flag* southFlag(const Colour& colour);
+	Flag* northFlag(const Colour& colour);
 	virtual void prepare(BasicGraphicsObjectContainer& task, double);
 	void visit(LegendVisitor& legend);
 	void visit(Data&, PointsHandler&, HistoVisitor&);
 	double minSpeed() { return min_speed_; }
 	double maxSpeed() { return max_speed_; }
+	void finish(BasicGraphicsObjectContainer&);
 
 protected:     	 
      	 //! Method to print string about this class on to a stream of type ostream (virtual).
 	 virtual void print(ostream& out) const
 	 { out << "FlagPlotting<P>"; } 
-	  Flag* northFlags_;
-	  Flag* southFlags_;
+	map<Colour, Flag*> northFlags_;
+	map<Colour, Flag*> southFlags_;
 
 private:
     //! Copy constructor - No copy allowed
diff --git a/src/visualisers/Histogram.cc b/src/visualisers/Histogram.cc
index 24201fc..238d747 100644
--- a/src/visualisers/Histogram.cc
+++ b/src/visualisers/Histogram.cc
@@ -90,7 +90,8 @@ void Histogram::prepare(PointsHandler& points)
 {
 		levels_->set(*this);
 		levels_->calculate(points.min(), points.max(), false);
-	
+		if ( levels_->empty() )
+			return;
 		
 		double delta=0;
 		LevelSelection::const_iterator min = levels_->begin();
diff --git a/src/visualisers/ImagePlotting.cc b/src/visualisers/ImagePlotting.cc
deleted file mode 100644
index f43a729..0000000
--- a/src/visualisers/ImagePlotting.cc
+++ /dev/null
@@ -1,292 +0,0 @@
-/******************************** LICENSE ********************************
-
- Copyright 2007 European Centre for Medium-Range Weather Forecasts (ECMWF)
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at 
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- ******************************** LICENSE ********************************/
-
-/*! \file ImagePlotting.cc
-    \brief Implementation of the Template class ImagePlotting.
-    
-    Magics Team - ECMWF 2005
-    
-    Started: Wed 13-Apr-2005
-    
-    Changes:
-    
-*/
-
-#include "ImagePlotting.h"
-#include "Image.h"
-
-
-#include "LookupTableMode.h"
-#include "TeDataTypes.h"
-#include "TeRasterParams.h"
-#include "TeDecoderMemory.h"
-#include "TeRasterRemap.h"
-#include "TeProjection.h"
-#include "LegendVisitor.h"
-#include "RasterData.h"
-
-using namespace magics;
-
-
-ImagePlotting::ImagePlotting()
-{
-}
-
-
-ImagePlotting::~ImagePlotting()
-{
-}
-
-/*!
- Class information are given to the output-stream.
-*/	
-
-void ImagePlotting::print(ostream& out)  const
-{
-	out << "ImagePlotting[";
-	ImagePlottingAttributes::print(out);
-	out << "]";
-}
-
-
-void ImagePlotting::operator()(Data& data, BasicGraphicsObjectContainer& out)
-{
-	// Reproject input data using Terralib routines
-	RasterData& rdin = data.raster(out.transformation());  //input data
-	RasterData  rdout;                 //output data
-	MagLog::dev() << "ImagePlotting::operator()---> NEEDS TO BE IMPLENTED" << endl;
-	
-	if ( !createOutputRaster(out, rdin,rdout) )
-	{
-	     MagLog::dev() << "ERROR: ImagePlotting::createOutputRaster:" << *this << "\n";
-	     return;
-	}
-
-	// Create output image from Terralib reprojected data
-	Image* object = new Image();
-	PaperPoint pp(rdout.getLowerLeftCorner().x(),rdout.getUpperRightCorner().y(),0.);
-	object->setOrigin(pp);
-	object->setWidth(rdout.getUpperRightCorner().x()-rdout.getLowerLeftCorner().x());
-	object->setHeight(rdout.getUpperRightCorner().y()-rdout.getLowerLeftCorner().y());
-	object->set(rdout.getRows(),rdout.getColumns());
-//	    object->setFormat(format_);
-
-
-    ColourTable& table = object->getColourTable();
-	table.push_back(Colour("none"));
-	//count--;
-        (*colourMethod_).set(table, count_-1);
-//
-
-	(*mode_)(*object, rdout);
-	//table.visit(legend_);
-	// When the image is ready, we give it to the task 
-	//(the task will be responsible to send it to the driver when necessary)
-	out.push_back(object);
-	
-}
-
-//
-// IMPORTANT: The 2 routines below (createOutputRaster and reproject) have
-// two important issues that needs to be addressed in the future:
-// 1. Speed performance: currently, the input image matrix (Magics++
-//    structure) is copied to the Terralib environment and, after the 
-//    processing, it is copied back to the Magics++ structure.
-// 2. Pixel size: currently, this value is hardcoded to TeUNSIGNEDSHORT
-//     *IF THIS IS CHANGED, THEN metview/src/Reprojection/ReprojectService.cc
-//     WILL ALSO NEED TO BE UPDATED*
-
-bool ImagePlotting::createOutputRaster(const BasicGraphicsObjectContainer& owner, RasterData& rdin, RasterData& rdout)
-{
-	int i,j;
-	static TeDecoderMemoryFactory theDecoderMemoryFactory("MEM");
-	
-	// Initialize Terralib raster structure for input data
-	// Initialise parameters
-	
-	TeRasterParams parin;
-	parin.ncols_  = rdin.getColumns();
-	parin.nlines_ = rdin.getRows();
-	parin.resx_   = abs(rdin.getXResolution());
-	parin.resy_   = abs(rdin.getYResolution());
-	parin.decName("MEM");
-	
-	parin.projection(&rdin.getProjection());
-	UserPoint ll = rdin.getLowerLeftCorner();
-	UserPoint ur = rdin.getUpperRightCorner();
-	parin.boundingBoxLinesColumns(ll.x(),ll.y(),ur.x(),ur.y(),rdin.getRows(),  rdin.getColumns(), TeBox::TeLOWERLEFT);
-	parin.nBands(1);
-	parin.setDataType(TeUNSIGNEDSHORT);
-	parin.setCompressionMode(TeRasterParams::TeNoCompression);
-
-	// Copy input image to the raster structure
-	TeRaster rastin(parin);
-	rastin.params().decName("MEM");
-	bool ok = rastin.init(parin);
-	for (i = 0; i < parin.nlines_; i++)
-		for (j = 0; j < parin.ncols_; j++)
-			rastin.setElement(j,i,rdin(i,j),0);
-
-	// Initialize Terralib raster structure for output data
-	// Initialise parameters
-	
-	TeRasterParams parout;
-	
-	const Transformation& transf = owner.transformation();
-	TeProjection& projout = const_cast<Transformation * >(&transf)->getProjection();
-
-	parout.projection(&projout);
-	double minX = transf.getMinPCX();  
-	double maxX = transf.getMaxPCX();  
-	double minY = transf.getMinPCY();  
-	double maxY = transf.getMaxPCY();  
-
-	// Set output resolution and compute image size
-	// Set the same x/y resolution
-	double width  = owner.absoluteWidth();
-	int ifreq = max(int(parin.ncols_/(pixelFrequency_*width)),1);
-	int nnx   = (parin.ncols_ - 1) / ifreq + 1;
-	double res = (maxX-minX)/double(nnx-1);
-
-	parout.boundingBoxResolution(minX,minY,maxX,maxY,res,res, TeBox::TeLOWERLEFT);
-	parout.decName("MEM");
-	parout.nBands(1);
-	parout.setDummy(0);
-	parout.setDataType(TeUNSIGNEDSHORT); // see note 2 above
-	parout.setCompressionMode(TeRasterParams::TeNoCompression);
-
-	// Initialise raster structure
-	TeRaster rastout(parout);
-	rastout.params().decName("MEM");
-	ok = rastout.init(parout);
-
-	// Reproject input data
-	TeRasterRemap reproj(&rastin,&rastout);
-	ok = reproj.apply();
-
-	// Copy output raster structure to output image
-    rdout.setColumns(parout.ncols_);
-	rdout.setRows(parout.nlines_);
-
-	rdout.setXResolution(parout.resx_);
-	rdout.setYResolution(parout.resy_);
-	// boundingBox or box function ???
-	rdout.setUpperRightCorner(parout.boundingBox().x2(), parout.boundingBox().y2());
-	rdout.setLowerLeftCorner(parout.boundingBox().x1(), parout.boundingBox().y1());
-	rdout.reserve(parout.nlines_*parout.ncols_);
-	double val;
-	for (i = 0; i < parout.nlines_; i++)
-	{
-		for (j = 0; j < parout.ncols_; j++)
-		{
-			if (!rastout.getElement(j,i,val,0) )
-				val = 0;
-           //points outside the rectangle image area is set
-           //to 0 by the Terralib interpolation procedure
-  		   rdout.push_back(val);
-		}
-	}
-
-	return ok;
-}
-
-
-void ImagePlotting::visit(LegendVisitor& legend)
-{
-	//(*mode_)(legend);
-}
-
-bool ImagePlotting::reproject(RasterData& rdin, RasterData& rdout,
-	Transformation& transformation, double resx, double resy)
-{
-	int i,j;
-	
-	static TeDecoderMemoryFactory theDecoderMemoryFactory("MEM");
-
-	// Initialize Terralib raster structure for input data
-	// Initialise parameters
-	TeRasterParams parin;
-	parin.ncols_  = rdin.getColumns();
-	parin.nlines_ = rdin.getRows();
-	parin.resx_   = abs(rdin.getXResolution());
-	parin.resy_   = abs(rdin.getYResolution());
-	parin.projection (&rdin.getProjection());
-	UserPoint ll = rdin.getLowerLeftCorner();
-	UserPoint ur = rdin.getUpperRightCorner();
-	parin.boundingBoxResolution(ll.x(),ll.y(),ur.x(),ur.y(), parin.resx_, parin.resy_);
-	parin.nBands(1);
-	parin.setDataType(TeUNSIGNEDSHORT);
-	//parin.compressionType_ = TeNoCompression;
-    parin.setCompressionMode(TeRasterParams::TeNoCompression);
-	parin.decName("MEM");
-
-	// Copy input image to the raster structure
-	TeRaster rastin(parin);
-	bool ok = rastin.init(parin);
-	for (i = 0; i < parin.nlines_; i++)
-		for (j = 0; j < parin.ncols_; j++)
-			rastin.setElement(j,i,rdin(i,j),0); //too slow???
-
-	// Initialize Terralib raster structure for output data
-	// Initialise parameters
-	TeRasterParams parout;
-	TeProjection& projout = const_cast<Transformation * >(&transformation)->getProjection();
-	parout.projection(&projout);
-	parout.decName("MEM");
-
-	double minX = transformation.getMinPCX();  
-	double maxX = transformation.getMaxPCX();  
-	double minY = transformation.getMinPCY();  
-	double maxY = transformation.getMaxPCY();  
-
-	// Set output resolution
-	parout.boundingBoxResolution(minX,minY,maxX,maxY,resx,resx);
-
-	parout.nBands(1);
-	parout.setDataType(TeUNSIGNEDSHORT);   // see note 2 above
-	//parout.compressionType_ = TeNoCompression;
-    parout.setCompressionMode(TeRasterParams::TeNoCompression);
-
-	// Initialise raster structure
-	TeRaster rastout(parout);
-	ok = rastout.init(parout);
-
-	// Reproject input data
-	TeRasterRemap reproj(&rastin,&rastout);
-	ok = reproj.apply();
-
-	// Copy output raster structure to output image
-        rdout.setColumns(parout.ncols_);
-	rdout.setRows(parout.nlines_);
-// no need	rdout.setProjection(&projout);
-	rdout.setXResolution(parout.resx_);
-	rdout.setYResolution(parout.resy_);
-	// boundingBox or box function ???
-	rdout.setUpperRightCorner(parout.boundingBox().x2(), parout.boundingBox().y2());
-	rdout.setLowerLeftCorner(parout.boundingBox().x1(), parout.boundingBox().y1());
-	rdout.reserve(parout.nlines_*parout.ncols_);
-	double val;
-	for (i = 0; i < parout.nlines_; i++)
-		for (j = 0; j < parout.ncols_; j++)
-		{
-			rastout.getElement(j,i,val,0); //too slow???
-			rdout.push_back(val);
-		}
-
-	return ok;
-}
diff --git a/src/visualisers/ImagePlotting.h b/src/visualisers/ImagePlotting.h
deleted file mode 100644
index eb1d60b..0000000
--- a/src/visualisers/ImagePlotting.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/******************************** LICENSE ********************************
-
- Copyright 2007 European Centre for Medium-Range Weather Forecasts (ECMWF)
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at 
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- ******************************** LICENSE ********************************/
-
-/*! \file ImagePlotting.h
-    \brief Definition of the Template class ImagePlotting.
-    
-    Magics Team - ECMWF 2005
-    
-    Started: Wed 13-Apr-2005
-    
-    Changes:
-    
-*/
-
-#ifndef ImagePlotting_H
-#define ImagePlotting_H
-
-#include "magics.h"
-
-#include "Visdef.h"
-#include "ImagePlottingAttributes.h"
-#include "LegendVisitor.h"
-
-namespace magics {
-	
-
-
-class ImagePlotting: public Visdef, public ImagePlottingAttributes {
-
-public:
-	ImagePlotting();
-	virtual ~ImagePlotting();
-	
-	virtual void operator()(Data&, BasicGraphicsObjectContainer&);
-	
-	void set(const map<string, string>& map) { ImagePlottingAttributes::set(map); }
-	void set(const XmlNode& node) { ImagePlottingAttributes::set(node); }
-	ImagePlotting* clone() const {
-		ImagePlotting* object = new ImagePlotting();
-		object->copy(*this);
-		return object;
-	}
-	
-	void visit(LegendVisitor&);
-
-	bool reproject(RasterData& in, RasterData& out, Transformation&, double, double);
-		
-protected:
-     //! Method to print string about this class on to a stream of type ostream (virtual).
-	 virtual void print(ostream&) const; 
-	 vector<LegendEntry* > legend_;
-	 
-
-private:
-    //! Copy constructor - No copy allowed
-	ImagePlotting(const ImagePlotting&);
-    //! Overloaded << operator to copy - No copy allowed
-	ImagePlotting& operator=(const ImagePlotting&);
-    
-// -- Friends
-    //! Overloaded << operator to call print().
-	friend ostream& operator<<(ostream& s,const ImagePlotting& p)
-		{ p.print(s); return s; }
-
-	bool createOutputRaster(const BasicGraphicsObjectContainer&, RasterData&, RasterData& );
-};
-
-} // namespace magics
-
-
-#endif
diff --git a/src/visualisers/IntervalSelectionType.cc b/src/visualisers/IntervalSelectionType.cc
index e35db1b..c09877e 100644
--- a/src/visualisers/IntervalSelectionType.cc
+++ b/src/visualisers/IntervalSelectionType.cc
@@ -58,8 +58,6 @@ void IntervalSelectionType::calculate(double min, double max, bool shading)
 {
 	
     clear();
-    //double maxi = data.max();
-    //double mini = data.min();
 	std::set<double> levels;
 	
 	double lmax, lmin;
@@ -79,12 +77,14 @@ void IntervalSelectionType::calculate(double min, double max, bool shading)
    
    
        
-    levels.insert(lmax);
     levels.insert(lmin);
+    levels.insert(lmax);
     
     
     double level = reference_;
-    int i = 0;
+    double newref;
+
+    int i = 1;
     while ( level < lmax && !same(level, lmax) ) {
     	if ( level > lmin )
     		levels.insert(level);
@@ -92,7 +92,7 @@ void IntervalSelectionType::calculate(double min, double max, bool shading)
         i++;
     }
     level = reference_;
-    i = 1;
+    i=1;
     while ( level > lmin &&   !same(level, lmin) ) {
         if ( level < lmax )
         	levels.insert(level);
@@ -109,10 +109,47 @@ void IntervalSelectionType::calculate(double min, double max, bool shading)
     out << "]" << endl;
     MagLog::dev()  << out.str() << endl;
     	
+    // Now make sure that the reference is inside the interval ..
+
+
     
 
 }
 
+double IntervalSelectionType::reference(int freq) const
+{
+    if ( empty() ) 
+        return reference_;
+    // Now make sure that the reference is inside the interval ..
+    
+    const_iterator reflev = find(begin(), end(), reference_);
+
+    if ( reflev != end() )
+        return reference_;
+
+    vector<double> values;
+    double val = reference_;
+    if ( reference_ < front() )  {
+        while ( val  <  back()) {
+            values.push_back(val);
+            val += ( freq * interval_);
+        }
+    }
+    if ( reference_ > back() )  {
+        while ( val  >  front()) {
+            values.push_back(val);
+            val -= ( freq * interval_);
+        }
+        // revert 
+        std::reverse(values.begin(), values.end());
+    }
+            
+    set_intersection(begin(), end(), values.begin(), values.end(), values.begin());
+
+    return values.front();
+
+            
 
+}
 
 
diff --git a/src/visualisers/IntervalSelectionType.h b/src/visualisers/IntervalSelectionType.h
index 92a8805..aaddfcb 100644
--- a/src/visualisers/IntervalSelectionType.h
+++ b/src/visualisers/IntervalSelectionType.h
@@ -67,7 +67,7 @@ public:
     }
 
     void calculate(double min, double max, bool); 
-    double reference() const { return reference_; }
+    double reference(int) const;
 protected:
      //! Method to print string about this class on to a stream of type ostream (virtual).
 	 virtual void print(ostream&) const; 
diff --git a/src/visualisers/IsoLabel.cc b/src/visualisers/IsoLabel.cc
index adbcc7f..2d426a3 100644
--- a/src/visualisers/IsoLabel.cc
+++ b/src/visualisers/IsoLabel.cc
@@ -79,10 +79,14 @@ void IsoLabel::operator()(Polyline& object, double l)  const
 	label.setVisible(true);
 	label.setHeight(height_);
 	label.setBlanking(blanking_);
-	MagFont font(font_, "", height_); 
+	MagFont font(font_, style_, height_);
 	font.colour(colour );
+
 	label.font(font);
 	object.setLabel(label);
+
+
+
 } 
 
 
diff --git a/src/visualisers/IsoPlot.cc b/src/visualisers/IsoPlot.cc
index 087974e..2315ce5 100644
--- a/src/visualisers/IsoPlot.cc
+++ b/src/visualisers/IsoPlot.cc
@@ -4,7 +4,7 @@
 
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
- You may obtain a copy of the License at 
+ You may obtain a copy of the License at
 
  http://www.apache.org/licenses/LICENSE-2.0
 
@@ -16,17 +16,17 @@
 
  ******************************** LICENSE ********************************/
 
-/*! \file IsoPlot.cc  
+/*! \file IsoPlot.cc
  \brief Implementation of the Template class IsoPlot.
- 
+
  Magics Team - ECMWF 2004
- 
+
  Started: Wed 3-Mar-2004
-  
+
  Changes:
  */
- 
- 
+
+
 #include "IsoPlot.h"
 #include "Factory.h"
 #include "MatrixHandler.h"
@@ -42,8 +42,8 @@
 
 
 namespace magics {
-  
- static double testLevels;
+
+ 
 
 static MutexCond producerMutex_;
 
@@ -65,7 +65,7 @@ static MutexCond producerMutex_;
 
 
 /*! \brief Helper class for Countouring
- * 
+ *
  */
 
 class CellBox : public VectorOfPointers<vector<CellBox* > >
@@ -73,30 +73,30 @@ class CellBox : public VectorOfPointers<vector<CellBox* > >
 public:
     CellBox(const CellArray* parent, int row1, int row2, int column1, int column2) :
              parent_(parent), row1_(row1), row2_(row2), column1_(column1), column2_(column2) {
-        shape_ = 0;
+
 
 
     }
 
     CellBox(const CellArray* parent) :
             parent_(parent), row1_(0), row2_(parent->rows_-1), column1_(0), column2_(parent->columns_-1) {
-        shape_ = 0;
+
     }
-    
+
     CellBox() :
             parent_(0), row1_(0), row2_(0), column1_(0), column2_(0) {
-    		shape_ = 0;
+
     }
 
      ~CellBox() {
 
 
     }
-   
+
      double value () {
         return (*parent_)(row1_, column1_)->value(0);
     }
-    
+
      RangeType range()
     {
         // First try to finfd iif the cell is outOfRange...
@@ -124,7 +124,7 @@ public:
              RangeType range   = cell->range();
              if ( range == outOfRange) {
                  oneout = true;
-            	 continue;
+                 continue;
              }
 
              if (range == multipleRange)
@@ -132,118 +132,208 @@ public:
 
              min = ( min < cell->min_ ) ? min : cell->min_;
              max = ( max > cell->max_ ) ? max : cell->max_;
-             if (max-min > 0 ) 
-                return multipleRange; 
+             if (max-min > 0 )
+                return multipleRange;
            }
         }
         if ( max-min == 0 ) {
-        	if ( oneout )
-        		return multipleRange;
-        	return singleRange;
+            if ( oneout )
+                return multipleRange;
+            return singleRange;
         }
 
     }
 
-    void reshape(vector<Shape*>& shapes, vector<Shape*>& out)
-    {
-    	Timer timer("reduce", "reduce");
+    void push_back(int index, double x1, double y1, double x2, double y2 ){
+        if ( index == -1 )
+            return;
+
+
+        map<int, SegmentJoiner*>::iterator helper = helper_.find(index);
+        if ( helper == helper_.end() ) {
+            helper_.insert(make_pair(index, new SegmentJoiner()));
+            helper = helper_.find(index);
+        }
+        helper->second->push_back(x1, y1, x2, y2);
     }
 
+    void push_back(int index, vector<PaperPoint>& points) {
+        if ( index == -1 || points.empty() )
+            return;
 
-    void reshape(Shape* cell)
-    {
-        int index = cell->index_;
-        if ( index < 0 ) {
-        	delete cell;
-        	return;
+        map<int, SegmentJoiner*>::iterator helper = helper_.find(index);
+        if ( helper == helper_.end()  ) {
+            helper_.insert(make_pair(index, new SegmentJoiner()));
+            helper = helper_.find(index);
         }
-        if ( cell->points_.size() < 2 ) {
+        if ( helper->second-> size() == 0 ) {
+            int size = points.size();
+            for ( int i = 0; i < size; i++ ) {
+                int j = (i+1)%size;
+                helper->second->push_back(points[i].x_, points[i].y_, points[j].x_, points[j].y_);
+            }
+
+
 
-        	delete cell;
-        	return;
         }
-        cell->points_.push_back(cell->points_.front());
+        else {
+            // intersect !
+            // Create line from 1first
+
+            typedef boost::geometry::model::polygon<PaperPoint > polygon;
+
+
+            polygon previous, pts;
+
+            for ( vector<PaperPoint>::iterator pt = points.begin();  pt != points.end(); ++pt ) {
+               pts.outer().push_back(*pt);
+            }
+            pts.outer().push_back(points.front());
+            vector<vector<Point> > result;
+            helper->second->computePolygonLines(result);
+            assert( result.size() == 1);
+            for ( vector<Point>::iterator pt = result.front().begin();  pt != result.front().end(); ++pt ) {
+                 previous.outer().push_back(PaperPoint(pt->x_, pt->y_));
+            }
 
-        if (SegmentJoiner::isHole(cell->points_) )
-        	std::reverse(cell->points_.begin(), cell->points_.end());
+            helper_[index] = new SegmentJoiner();
 
 
+            std::vector<polygon > output;
+
+
+
+            boost::geometry::intersection(previous, pts, output);
+
+
+
+            if (output.size() == 1){
+                            vector<PaperPoint> xx;
+                                                        for ( vector<PaperPoint>::iterator pt = output.front().outer().begin();  pt != output.front().outer().end(); ++pt ) {
+                                                           xx.push_back(*pt);
+                                                         }
+
+                                                        push_back(index, xx);
+
+            }
+            else
+                {
+
+                    boost::geometry::union_(pts, previous, output);
+                            if (output.size() == 1){
+                                push_back(index, output.front().outer());
+                            }
+                            else
+                                push_back(index, previous.outer());
+
+                }
 
-        HelperStruct::iterator entry = helper_.find(index);
-        if (entry == helper_.end() ) {
-            helper_.insert(make_pair(index, vector<Shape*>())) ;
-            entry = helper_.find(index);
         }
 
-        entry->second.push_back(cell);
+
 
     }
 
-    void reshape(CellBox* parent)
-    {
-        if ( parent == this) return;
-        for (HelperStruct::iterator entry = helper_.begin(); entry != helper_.end(); ++entry) {
-                    for (vector<Shape*>::iterator shape = entry->second.begin(); shape != entry->second.end(); ++shape) {
-                            parent->reshape(*shape);                    
-                }
+    void push_back(int index, const SegmentJoiner& segment) {
+        if ( index == -1 )
+            return;
+
+        map<int, SegmentJoiner*>::iterator helper = helper_.find(index);
+        if ( helper == helper_.end() ) {
+            helper_.insert(make_pair(index, new SegmentJoiner()));
+            helper = helper_.find(index);
         }
-        helper_.clear();
+        helper->second->add(segment);
+    }
+
+    void push_back(CellBox* box) {
+        VectorOfPointers<vector<CellBox* > >::push_back(box);
     }
 
     void split();
-    
-     Shape* shape(int index)
+
+    void addShape(int index)
     {
-        if (!shape_)
-        {
-        	shape_ = new Shape();
-            Cell* cell;
-            
-            // bottom 
-            for (int column = column1_; column <= column2_; column++) {
-                cell = (*parent_)(row1_, column);
-                shape_->push_back(cell->column(0), cell->row(0));
-            }
+        if ( index == -1 )
+            return;
+        Cell* cell;
+        vector<PaperPoint> points;
+        /*
+        if ( column1_ == column2_ && row1_ == row2_ ) {
+            cell = (*parent_)(row1_, column1_);
+            points.push_back(PaperPoint(cell->column(0), cell->row(0)));
+            points.push_back(PaperPoint(cell->column(1), cell->row(0)));
+            points.push_back(PaperPoint(cell->column(1), cell->row(2)));
+            points.push_back(PaperPoint(cell->column(0), cell->row(2)));
 
-            // right
-            for (int row = row1_; row <= row2_; row++) {
-                cell = (*parent_)(row, column2_);
-                shape_->push_back(cell->column(1), cell->row(1));
-            }
 
-            for (int column = column2_; column >= column1_; column--) {
-                cell = (*parent_)(row2_, column);
-                shape_->push_back(cell->column(2), cell->row(2));
-            }
 
-            for (int row = row2_; row >= row1_; row--) {
-                cell = (*parent_)(row, column1_);    
-                shape_->push_back(cell->column(3), cell->row(3));
-            }
+
+            push_back(index, points);
+            return;
+         }
+         */
+
+        // bottom
+        for (int column = column1_; column <= column2_; column++) {
+            cell = (*parent_)(row1_, column);
+            points.push_back(PaperPoint(cell->column(0), cell->row(0)));
+
         }
-        shape_->index_= index;
-        return shape_;
+
+        // right
+        for (int row = row1_; row <= row2_; row++) {
+            cell = (*parent_)(row, column2_);
+            points.push_back(PaperPoint(cell->column(1), cell->row(1)));
+
+        }
+        // top
+        for (int column = column2_; column >= column1_; column--) {
+            cell = (*parent_)(row2_, column);
+            points.push_back(PaperPoint(cell->column(2), cell->row(2)));
+
+        }
+        //left
+        for (int row = row2_; row >= row1_; row--) {
+            cell = (*parent_)(row, column1_);
+
+            points.push_back(PaperPoint(cell->column(3), cell->row(3)));
+        }
+
+
+        push_back(index, points);
     }
-    
+
+    void reshape(CellBox* parent)
+    {
+        if ( parent == this) return;
+        for (map<int, SegmentJoiner*>::iterator entry = helper_.begin(); entry != helper_.end(); ++entry) {
+            parent->push_back(entry->first, *entry->second);
+            delete (entry->second);
+        }
+
+        helper_.clear();
+    }
+
+
     void shade(const IsoPlot& owner);
-    
+
 
     void shade(const IsoPlot& owner, CellBox* parent) {
         RangeType def = range();
         switch (def)
         {
-          case outOfRange : 
+          case outOfRange :
                 break;
 
-          case singleRange: 
+          case singleRange:
 
-
-                parent->reshape(shape(owner.shadingIndex(value())));
+                    addShape(owner.shadingIndex(value()));
 
                 break;
 
           default:
-                split();        
+                split();
                 if (empty()) {
                     assert( row1_ == row2_);
                     assert( column1_ == column2_);
@@ -259,172 +349,109 @@ public:
                 }
         }
     }
-    
+
 
 
     void contour(const IsoPlot& owner)
     {
            for (int row = row1_; row <= row2_; row++) {
-                        for (int column = column1_; column <= column2_; column++) {                                                    
+                        for (int column = column1_; column <= column2_; column++) {
                                     owner.isoline(*(*parent_)(row, column));
                         }
-            }            
+            }
     }
 
     void feed(IsoPlot& owner, BasicGraphicsObjectContainer& out)
     {
-    	const Transformation& transformation = out.transformation();
-    	for (vector<Polyline*>::iterator poly = polylines_.begin(); poly != polylines_.end(); ++poly) {
-
-    		(*owner.shading_)(*poly);
-    		(*poly)->correct();
-    		if ( (*owner.shading_).needClipping()  ) {
-    			transformation(**poly, out);
-    			delete *poly;
-    		}
-    		else {
-    			out.push_back(*poly);
-    		}
-
-
-    	}
-    	polylines_.clear();
+        for (vector<Polyline*>::iterator poly = polylines_.begin(); poly != polylines_.end(); ++poly) {
+            (*owner.shading_)(*poly);
+            out.push_back(*poly);
+        }
+        polylines_.clear();
     }
 
     void finish()
     {
 
         Timer timer("Feed", "Feed");
-        for ( HelperStruct::iterator index = helper_.begin(); index!= helper_.end(); ++index) {
-        	if (index->first == -1) {
-				continue;
-        	}
-        	SegmentJoiner joiner;
-        	int count = 0;
-
-        	for ( vector<Shape*>::iterator s = index->second.begin(); s != index->second.end(); ++s) {
-        		vector<Point>& points = (*s)->points_;
-
-
-        		count += (*s)->points_.size();
-
-
-        	}
-        	joiner.reserve(count);
-
-
-        	// feed the joiner
-        	for ( vector<Shape*>::iterator s = index->second.begin(); s !=index->second.end(); ++s) {
-        		vector<Point>& points = (*s)->points_;
-
-
-        		if ( SegmentJoiner::isHole(points) ) {
-
-        			vector<Point>::reverse_iterator from = points.rbegin();
-        			vector<Point>::reverse_iterator to = points.rbegin();
-        			to++;
-        			while ( to != points.rend() ) {
-
-        				joiner.push_back(*from, *to);
-        				++from;
-        				++to;
-        			}
-        		}
-        		else {
-
-        			vector<Point>::iterator from = points.begin();
-        			vector<Point>::iterator to = points.begin();
-        			to++;
-        			while ( to != points.end() ) {
-
-        				joiner.push_back(*from, *to);
-        				++from;
-        				++to;
-        			}
-        		}
-        	}
-
-
-
-
-        	vector<vector<Point> > result;
-        	vector<vector<Point> > polys;
-        	list<vector<Point> > holes;
-
-
-
-        	joiner.computePolygonLines(result);
-
-        	Polyline* poly = 0;
-
+        for ( map<int, SegmentJoiner*>::iterator index = helper_.begin(); index!= helper_.end(); ++index) {
+            vector<vector<Point> > result;
+            vector<vector<Point> > polys;
+            list<vector<Point> > holes;
+            SegmentJoiner& joiner = *index->second;
 
+            //if (index->first == 4)
+                //joiner.print();
+            joiner.computePolygonLines(result);
+            Polyline* poly = 0;
+            bool reverse = joiner.isHole(result.front());
 
-            	 for(vector<vector<Point> >::iterator j = result.begin() ; j != result.end(); ++j) {
-            	        if(joiner.isHole((*j))) {
-            	            holes.push_back(vector<Point>());
-            	            std::swap((*j),holes.back());
-            	        }
-            	        else {
-            	            polys.push_back(vector<Point>());
-            	            std::swap((*j),polys.back());
-            	        }
-            	    }
+            for (vector<vector<Point> >::iterator j = result.begin() ; j != result.end(); ++j) {
 
-            	 for(vector<vector<Point> >::iterator j = polys.begin() ; j != polys.end(); ++j) {
-
-            		 poly = new Polyline();
-            		             	polylines_.push_back(poly);
-            		             	poly->reserve(j->size());
+                if ( reverse ) {
+                if ( !joiner.isHole((*j)) ) {
+                    holes.push_back(vector<Point>());
+                    std::swap((*j),holes.back());
 
+                }
+                else {
+                    polys.push_back(vector<Point>());
+                    std::swap((*j),polys.back());
 
-            		             		poly->index(index->first);
+                }
+                }
+                else {
+                if ( joiner.isHole((*j)) ) {
+                    holes.push_back(vector<Point>());
+                    std::swap((*j),holes.back());
 
-            		             	for (vector<Point>::iterator point = j->begin(); point != j->end(); ++point)
-            		             		poly->push_back(PaperPoint(point->x_, point->y_));
+                }
+                else {
+                    polys.push_back(vector<Point>());
+                    std::swap((*j),polys.back());
 
+                }
+                }
+            }
 
-            	        for(std::list<vector<Point> >::iterator h = holes.begin() ; h != holes.end(); ) {
-            	            list<vector<Point> >::iterator next = h; next++;
+            for(vector<vector<Point> >::iterator j = polys.begin() ; j != polys.end(); ++j) {
+                poly = new Polyline();
+                polylines_.push_back(poly);
 
+                poly->reserve(j->size());
+                poly->index(index->first);
 
-            	            	if ( joiner.pointInPoly((*h).front(), *j) ) {
 
+                for (vector<Point>::iterator point = j->begin(); point != j->end(); ++point)
+                    poly->push_back(PaperPoint(point->x_, point->y_));
 
-            	            	poly->newHole();
-            	            	for (vector<Point>::iterator point = h->begin(); point != h->end(); ++point)
-            	            	   poly->push_back_hole(PaperPoint(point->x_, point->y_));
 
-            	            	 holes.erase(h);
-            	            }
-            	            h = next;
-            	        }
+                for(std::list<vector<Point> >::iterator h = holes.begin() ; h != holes.end(); ) {
+                    list<vector<Point> >::iterator next = h; next++;
 
-            	 }
+                    if ( joiner.pointInPoly((*h).front(), *j) ) {
 
+                        poly->newHole();
+                        for (vector<Point>::iterator point = h->begin(); point != h->end(); ++point)
+                            poly->push_back_hole(PaperPoint(point->x_, point->y_));
+                        holes.erase(h);
+                    }
+                    h = next;
+                }
+            }
+            delete index->second;
         }
 
-        // Release the memory.
-        for ( HelperStruct::iterator colour = helper_.begin(); colour!= helper_.end(); ++colour) {
-        	for ( vector<Shape*>::iterator s = colour->second.begin(); s !=colour->second.end(); ++s) {
-        		delete *s;
-        		*s = 0;
-        	}
-        	colour->second.clear();
+    }
 
-        }
 
-        }
-    
-    Shape* shape_;
     const CellArray* parent_;
     int row1_;
     int row2_;
     int column1_;
     int column2_;
 
-    typedef map<int, vector<Shape*> > HelperStruct;
-
-    HelperStruct helper_;
+    map<int, SegmentJoiner*> helper_;
     vector<Polyline*> polylines_;
 };
 
@@ -443,7 +470,7 @@ void CellBox::shade(const IsoPlot& owner) {
 
 void CellBox::split()
 {
-    if ( row1_ == row2_ && column1_ ==  column2_ ) 
+    if ( row1_ == row2_ && column1_ ==  column2_ )
             return;
 
     const int row    = (row2_   + row1_) /2;
@@ -454,7 +481,7 @@ void CellBox::split()
        //try first 2 split in columns ...
        CellBox* cell = new CellBox(parent_, row1_, row2_, column1_, column);
        RangeType def = cell->range();
-            
+
        if ( def != multipleRange ) {
              push_back(cell);
        }
@@ -499,7 +526,7 @@ public:
         IsoProducerData(bool shading, IsoPlot& parent, CellBox& cell):
               shading_(shading), parent_(parent), cell_(cell) {
            more_ = true;
-        }  
+        }
         bool shading_;
         IsoPlot& parent_;
         CellBox& cell_;
@@ -510,19 +537,19 @@ public:
 
 class IsoProducer: public Thread {
 
-public:    
+public:
     IsoProducer(int n, IsoProducerData& data) : n_(n), objects_(data) {}
     void run()
     {
-    	{
-    		Timer timer("cell", "shading");
-    		( objects_.shading_ ) ? objects_.cell_.shade(objects_.parent_) : objects_.cell_.contour(objects_.parent_);
+        {
+            Timer timer("cell", "shading");
+            ( objects_.shading_ ) ? objects_.cell_.shade(objects_.parent_) : objects_.cell_.contour(objects_.parent_);
 
-    	}
+        }
         objects_.cell_.finish();
     }
      ~IsoProducer() {}
-   
+
 protected:
      //! Method to print string about this class on to a stream of type ostream (virtual).
      void print(ostream&) const {}
@@ -530,7 +557,7 @@ protected:
     IsoProducerData&  objects_;
 
 private:
-    //! Copy constructor - No copy allowed
+    //! Copy constructor - No copy allowedf
     IsoProducer(const IsoProducer&);
     //! Overloaded << operator to copy - No copy allowed
     IsoProducer& operator=(const IsoProducer&);
@@ -544,52 +571,55 @@ private:
 
 
 
-void IsoPlot::isoline(Cell& cell, CellBox* box) const
+void IsoPlot::isoline(Cell& cell, CellBox* parent) const
 {
-   static int cases[3][3][3] = { { { 0, 1, 2 },   { 3, 4, 5 },    { 6, 7, 8 } }, 
-                               { { 9, 10, 11 }, { 12, 13, 14 }, { 15, 16, 17 } }, 
-                               { { 18, 19, 20 },{ 21, 22, 23 }, { 24, 25, 0 } } };
-   int p1, p2, p3;
-   int current;
-   double x1=0, x2=0, y1=0, y2=0;
+    static int cases[3][3][3] = { { { 0, 1, 2 },   { 3, 4, 5 },    { 6, 7, 8 } },
+            { { 9, 10, 11 }, { 12, 13, 14 }, { 15, 16, 17 } },
+            { { 18, 19, 20 },{ 21, 22, 23 }, { 24, 25, 0 } } };
+    int p1, p2, p3;
+    int current;
+    double x1=0, x2=0, y1=0, y2=0;
 
-   RangeType def = cell.range();
+    RangeType def = cell.range();
 
-   if ( def == outOfRange )
+    if ( def == outOfRange )
         return;
-   if ( def == singleRange )
-   {
-        if ( !box  ) // NO Shading == Nothing to do! 
+    if ( def == singleRange )
+    {
+        if ( !parent  ) // NO Shading == Nothing to do!
             return;
         else {
-            const double contour = levels_[cell.min_];
-            Shape* x = new Shape();
+            
+            int index  = shading_->shadingIndex(cell.value(0));
+
+                  vector<PaperPoint> points;
             for (int i = 0; i < 4; i++) {
-                    x->push_back(cell.column(i), cell.row(i));            
+                 points.push_back(PaperPoint(cell.column(i), cell.row(i)));
+
+
+            parent->push_back(index, points);
+
+                return;
             }
-            x->index_  = shading_->shadingIndex(cell.value(0));
-            box->reshape(x);
-            return;
         }
-   }
+    }
 
-   for (int p=0; p<2; p++)
-   {
+    for (int p=0; p<2; p++)
+    {
         p1 = p;
         p2 = p1+1;
         p3 = 3;
 
-        //int count = 0;
-        if (cell.missing(p1) || cell.missing(p2) || cell.missing(p3)) {
 
-        continue;
+        if (cell.missing(p1) || cell.missing(p2) || cell.missing(p3)) {
+            continue;
         }
 
 
-        vector< std::pair<Shape*, Shape*> > shapes;
-        
+
+
         // First, build the list of isolines in this triangle...
-        vector<int> levels;        
+        vector<int> levels;
 
         for (int l = cell.min_; l != cell.max_; ++l) {
             const double contour = levels_[l];
@@ -598,577 +628,576 @@ void IsoPlot::isoline(Cell& cell, CellBox* box) const
                 levels.push_back(l);
             }
         }
-        
-        if ( levels.empty() && box ) {
-
-            Shape* shape = new Shape(shading_->shadingIndex(cell.value(p1)));
-            shape->push_back(cell.column(p1), cell.row(p1));
-            shape->push_back(cell.column(p2), cell.row(p2));
-            shape->push_back(cell.column(p3), cell.row(p3));
-
-
-            box->reshape(shape);
-
-        }
-        else {
-
-    bool complex = ( levels.size() > 1);
-    for (vector<int>::const_iterator l = levels.begin(); l != levels.end(); ++l)
-    {
-        int level = *l;                
-        // First make a quich check to see if there is at l
-        
-        const double contour=levels_[level];
 
 
-        current = cases[cell.coef(p1, contour)][cell.coef(p2, contour)][cell.coef(p3, contour)];
+        if ( levels.empty() && parent ) {
+            int index = shading_->shadingIndex(cell.value(p1));
 
-        int add = 2;
-        Shape* leftcell  = (box) ? new Shape(shading_->leftIndex(contour))  :0;
-        Shape* rightcell = (box) ? new Shape(shading_->rightIndex(contour)) :0;
-        
 
-        switch (current)
-        {
-        //-------------------------------------------------------------------------------------------------------
-        //     Case 0 -point out!
-        //-------------------------------------------------------------------------------------------------------
-        case 0:
-            add = 0;
-            break;
-            if ( !box ) break;
-            
-            if (cell.height(p1, contour) < 0) {
-                leftcell->push_back(cell.column(p1), cell.row(p1));
-                leftcell->push_back(cell.column(p2), cell.row(p2));
-                leftcell->push_back(cell.column(p3), cell.row(p3));
-            }
-            else {
-                rightcell->push_back(cell.column(p1), cell.row(p1));
-                rightcell->push_back(cell.column(p2), cell.row(p2));
-                rightcell->push_back(cell.column(p3), cell.row(p3));
-            }
-            break;
-
-        //-------------------------------------------------------------------------------------------------------
-        //     Case 1 -Single point 3
-        //-------------------------------------------------------------------------------------------------------
-        case 1:
-            x1=cell.column(p3);
-            y1=cell.row(p3);
-            add = 1;
-            if ( !box) break;
-            if (cell.height(p1, contour) < 0) {
-                leftcell->push_back(cell.column(p1), cell.row(p1));
-                leftcell->push_back(cell.column(p2), cell.row(p2));
-                leftcell->push_back(cell.column(p3), cell.row(p3));
-            }
-            else {
-                rightcell->push_back(cell.column(p1), cell.row(p1));
-                rightcell->push_back(cell.column(p2), cell.row(p2));
-                rightcell->push_back(cell.column(p3), cell.row(p3));
-            }
-            break;
-
-        //-------------------------------------------------------------------------------------------------------
-        //     Case 2 - Line between sides 2-3 and 3-1
-        //-------------------------------------------------------------------------------------------------------
-        case 2:
-            cell.xysect(p2,p3, contour, x1, y1);
-            cell.xysect(p3,p1, contour, x2, y2);
-        
-            if ( !box ) break;
-            leftcell->push_back(x1, y1);
-            leftcell->push_back(x2, y2);
-            leftcell->push_back(cell.column(p1), cell.row(p1));
-            leftcell->push_back(cell.column(p2), cell.row(p2));
-            
-            rightcell->push_back(x1, y1);
-            rightcell->push_back(cell.column(p3), cell.row(p3));
-            rightcell->push_back(x2, y2);
-            break;
-
-        //-------------------------------------------------------------------------------------------------------
-        //     Case 3 -Single point 2
-        //-------------------------------------------------------------------------------------------------------
-        case 3:
-            x1=cell.column(p2);
-            y1=cell.row(p2);
-            add = 1;
-            if ( !box) break;
-            
-            if (cell.height(p1, contour) < 0) {
-                  leftcell->push_back(cell.column(p1), cell.row(p1));
-                  leftcell->push_back(cell.column(p2), cell.row(p2));
-                  leftcell->push_back(cell.column(p3), cell.row(p3));
-            }
-            else {
-                  rightcell->push_back(cell.column(p1), cell.row(p1));
-                  rightcell->push_back(cell.column(p2), cell.row(p2));
-                  rightcell->push_back(cell.column(p3), cell.row(p3));
-            }
-            break;
-
-        //-------------------------------------------------------------------------------------------------------
-        //     Case 4 - Line between vertex 2 and vertex 3
-        //-------------------------------------------------------------------------------------------------------
-        case 4:
-            
-            x1=cell.column(p2);
-            y1=cell.row(p2);
-            x2=cell.column(p3);
-            y2=cell.row(p3);
-            if ( !box ) break;
-            
-            leftcell->push_back(cell.column(p1), cell.row(p1));
-            leftcell->push_back(cell.column(p2), cell.row(p2));
-            leftcell->push_back(cell.column(p3), cell.row(p3));
-            break;
-
-        //-------------------------------------------------------------------------------------------------------
-        //     Case 5 - Line between vertex 2 and side 3-1
-        //-------------------------------------------------------------------------------------------------------
-        case 5:            
-            x1=cell.column(p2);
-            y1=cell.row(p2);
-            
-            cell.xysect(p3,p1, contour,x2, y2);
-            if ( !box ) break;
-            leftcell->push_back(cell.column(p1), cell.row(p1));
-            leftcell->push_back(x1, y1);
-            leftcell->push_back(x2, y2);
-            
-            rightcell->push_back(x1, y1);
-            rightcell->push_back(cell.column(p3), cell.row(p3));
-            rightcell->push_back(x2, y2);   
-            break;
 
-        //-------------------------------------------------------------------------------------------------------
-        //     Case 6 - Line between side 1-2  and side 2.3
-        //-------------------------------------------------------------------------------------------------------
-        case 6:
-            
-            cell.xysect(p1,p2, contour, x1, y1);
-            cell.xysect(p2,p3, contour, x2, y2);
-    
-            if ( !box ) break;
-            leftcell->push_back(cell.column(p1), cell.row(p1));
-            leftcell->push_back(x1, y1);
-            leftcell->push_back(x2, y2);
-            leftcell->push_back(cell.column(p3), cell.row(p3));
-            
-            rightcell->push_back(x1, y1);
-            rightcell->push_back(cell.column(p2), cell.row(p2));
-            rightcell->push_back(x2, y2);
-            
-            break;
-        //-------------------------------------------------------------------------------------------------------
-        //     Case 7 - Line between sides 1-2 aanve vertex 3
-        //-------------------------------------------------------------------------------------------------------
-        case 7:
-            cell.xysect(p1,p2, contour, x1, y1);
-            x2=cell.column(p3);
-            y2=cell.row(p3);
-            
-            if ( !box ) break;
-            leftcell->push_back(cell.column(p1), cell.row(p1));
-            leftcell->push_back(x1, y1);
-            leftcell->push_back(x2, y2);
-
-            rightcell->push_back(x1, y1);
-            rightcell->push_back(cell.column(p2), cell.row(p2));
-            rightcell->push_back(x2, y2);
-            break;
 
-        //-------------------------------------------------------------------------------------------------------
-        //     Case 8 - Line between sides 1-2 and 3-1
-        //-------------------------------------------------------------------------------------------------------
-        case 8:            
-            cell.xysect(p1,p2, contour, x1, y1);
-            cell.xysect(p3,p1, contour, x2, y2);
-            
-            if ( !box ) break;
-            leftcell->push_back(cell.column(p1), cell.row(p1));
-            leftcell->push_back(x1, y1);
-            leftcell->push_back(x2, y2);
-
-            rightcell->push_back(x1, y1);
-            rightcell->push_back(cell.column(p2), cell.row(p2));
-            rightcell->push_back(cell.column(p3), cell.row(p3));
-            rightcell->push_back(x2, y2);            
-            break;
 
-        //-------------------------------------------------------------------------------------------------------
-        //     Case 9 -single point 1
-        //-------------------------------------------------------------------------------------------------------
-        case 9:            
-            x1=cell.column(p1);
-            y1=cell.row(p1);
-            add = 1;
-            if ( !box) break;
-            if (cell.height(p2, contour) < 0) {
-                   leftcell->push_back(cell.column(p1), cell.row(p1));
-                   leftcell->push_back(cell.column(p2), cell.row(p2));
-                   leftcell->push_back(cell.column(p3), cell.row(p3));
-            }
-            else {
-                   rightcell->push_back(cell.column(p1), cell.row(p1));
-                   rightcell->push_back(cell.column(p2), cell.row(p2));
-                   rightcell->push_back(cell.column(p3), cell.row(p3));
-            }
-            break;
+            parent->push_back(index, cell.column(p1), cell.row(p1), cell.column(p2), cell.row(p2));
+            parent->push_back(index, cell.column(p2), cell.row(p2), cell.column(p3), cell.row(p3));
+            parent->push_back(index, cell.column(p3), cell.row(p3), cell.column(p1), cell.row(p1));
 
-        //-------------------------------------------------------------------------------------------------------
-        //     Case 10 - Line between vertex 3 and vertex 1
-        //-------------------------------------------------------------------------------------------------------
-        case 10:
-            
-            x1=cell.column(p3);
-            y1=cell.row(p3);
-            x2=cell.column(p1);
-            y2=cell.row(p1);
-            if ( !box) break;
-
-            leftcell->push_back(cell.column(p1), cell.row(p1));
-            leftcell->push_back(cell.column(p2), cell.row(p2));
-            leftcell->push_back(cell.column(p3), cell.row(p3));
-            break;
+        }
+        else {
+            CellBox* box = (parent) ? new CellBox() : 0;
+
+            for (vector<int>::const_iterator l = levels.begin(); l != levels.end(); ++l)
+            {
+                int level = *l;
+                // First make a quich check to see if there is at l
+
+                const double contour=levels_[level];
+
+
+                current = cases[cell.coef(p1, contour)][cell.coef(p2, contour)][cell.coef(p3, contour)];
+
+                int add = 2;
+                int leftindex  = shading_->leftIndex(contour);
+                int rightindex = shading_->rightIndex(contour);
+                vector<PaperPoint> left, right;
+
+
+
+                switch (current)
+                        {
+                        //-------------------------------------------------------------------------------------------------------
+                        //     Case 0 -point out!
+                        //-------------------------------------------------------------------------------------------------------
+                        case 0:
+                            add = 0;
+                            break;
+                            if ( !box ) break;
+
+                            if (cell.height(p1, contour) < 0) {
+                                left.push_back(PaperPoint(cell.column(p1), cell.row(p1)));
+                                left.push_back(PaperPoint(cell.column(p2), cell.row(p2)));
+                                left.push_back(PaperPoint(cell.column(p3), cell.row(p3)));
+                            }
+                            else {
+                                right.push_back(PaperPoint(cell.column(p1), cell.row(p1)));
+                                right.push_back(PaperPoint(cell.column(p2), cell.row(p2)));
+                                right.push_back(PaperPoint(cell.column(p3), cell.row(p3)));
+                            }
+
+                            break;
+
+                        //-------------------------------------------------------------------------------------------------------
+                        //     Case 1 -Single point 3
+                        //-------------------------------------------------------------------------------------------------------
+                        case 1:
+                            x1=cell.column(p3);
+                            y1=cell.row(p3);
+                            add = 1;
+                            if ( !box) break;
+                            if (cell.height(p1, contour) < 0) {
+                                left.push_back(PaperPoint(cell.column(p1), cell.row(p1)));
+                                left.push_back(PaperPoint(cell.column(p2), cell.row(p2)));
+                                left.push_back(PaperPoint(cell.column(p3), cell.row(p3)));
+                            }
+                            else {
+                                right.push_back(PaperPoint(cell.column(p1), cell.row(p1)));
+                                right.push_back(PaperPoint(cell.column(p2), cell.row(p2)));
+                                right.push_back(PaperPoint(cell.column(p3), cell.row(p3)));
+                            }
+                            break;
+
+                        //-------------------------------------------------------------------------------------------------------
+                        //     Case 2 - Line between sides 2-3 and 3-1
+                        //-------------------------------------------------------------------------------------------------------
+                        case 2:
+                            cell.xysect(p2,p3, contour, x1, y1);
+                            cell.xysect(p3,p1, contour, x2, y2);
+
+                            if ( !box ) break;
+                            left.push_back(PaperPoint(x1, y1));
+                            left.push_back(PaperPoint(x2, y2));
+                            left.push_back(PaperPoint(cell.column(p1), cell.row(p1)));
+                            left.push_back(PaperPoint(cell.column(p2), cell.row(p2)));
+
+                            right.push_back(PaperPoint(x1, y1));
+                            right.push_back(PaperPoint(cell.column(p3), cell.row(p3)));
+                            right.push_back(PaperPoint(x2, y2));
+                            break;
+
+                        //-------------------------------------------------------------------------------------------------------
+                        //     Case 3 -Single point 2
+                        //-------------------------------------------------------------------------------------------------------
+                        case 3:
+                            x1=cell.column(p2);
+                            y1=cell.row(p2);
+                            add = 1;
+                            if ( !box) break;
+
+                            if (cell.height(p1, contour) < 0) {
+                                  left.push_back(PaperPoint(cell.column(p1), cell.row(p1)));
+                                  left.push_back(PaperPoint(cell.column(p2), cell.row(p2)));
+                                  left.push_back(PaperPoint(cell.column(p3), cell.row(p3)));
+                            }
+                            else {
+                                  right.push_back(PaperPoint(cell.column(p1), cell.row(p1)));
+                                  right.push_back(PaperPoint(cell.column(p2), cell.row(p2)));
+                                  right.push_back(PaperPoint(cell.column(p3), cell.row(p3)));
+                            }
+                            break;
+
+                        //-------------------------------------------------------------------------------------------------------
+                        //     Case 4 - Line between vertex 2 and vertex 3
+                        //-------------------------------------------------------------------------------------------------------
+                        case 4:
+
+                            x1=cell.column(p2);
+                            y1=cell.row(p2);
+                            x2=cell.column(p3);
+                            y2=cell.row(p3);
+                            if ( !box ) break;
+
+                            left.push_back(PaperPoint(cell.column(p1), cell.row(p1)));
+                            left.push_back(PaperPoint(cell.column(p2), cell.row(p2)));
+                            left.push_back(PaperPoint(cell.column(p3), cell.row(p3)));
+                            break;
+
+                        //-------------------------------------------------------------------------------------------------------
+                        //     Case 5 - Line between vertex 2 and side 3-1
+                        //-------------------------------------------------------------------------------------------------------
+                        case 5:
+                            x1=cell.column(p2);
+                            y1=cell.row(p2);
+
+                            cell.xysect(p3,p1, contour,x2, y2);
+                            if ( !box ) break;
+                            left.push_back(PaperPoint(cell.column(p1), cell.row(p1)));
+                            left.push_back(PaperPoint(x1, y1));
+                            left.push_back(PaperPoint(x2, y2));
+
+                            right.push_back(PaperPoint(x1, y1));
+                            right.push_back(PaperPoint(cell.column(p3), cell.row(p3)));
+                            right.push_back(PaperPoint(x2, y2));
+                            break;
+
+                        //-------------------------------------------------------------------------------------------------------
+                        //     Case 6 - Line between side 1-2  and side 2.3
+                        //-------------------------------------------------------------------------------------------------------
+                        case 6:
+
+                            cell.xysect(p1,p2, contour, x1, y1);
+                            cell.xysect(p2,p3, contour, x2, y2);
+
+                            if ( !box ) break;
+                            left.push_back(PaperPoint(cell.column(p1), cell.row(p1)));
+                            left.push_back(PaperPoint(x1, y1));
+                            left.push_back(PaperPoint(x2, y2));
+                            left.push_back(PaperPoint(cell.column(p3), cell.row(p3)));
+
+                            right.push_back(PaperPoint(x1, y1));
+                            right.push_back(PaperPoint(cell.column(p2), cell.row(p2)));
+                            right.push_back(PaperPoint(x2, y2));
+
+                            break;
+                        //-------------------------------------------------------------------------------------------------------
+                        //     Case 7 - Line between sides 1-2 aanve vertex 3
+                        //-------------------------------------------------------------------------------------------------------
+                        case 7:
+                            cell.xysect(p1,p2, contour, x1, y1);
+                            x2=cell.column(p3);
+                            y2=cell.row(p3);
+
+                            if ( !box ) break;
+                            left.push_back(PaperPoint(cell.column(p1), cell.row(p1)));
+                            left.push_back(PaperPoint(x1, y1));
+                            left.push_back(PaperPoint(x2, y2));
+
+                            right.push_back(PaperPoint(x1, y1));
+                            right.push_back(PaperPoint(cell.column(p2), cell.row(p2)));
+                            right.push_back(PaperPoint(x2, y2));
+                            break;
+
+                        //-------------------------------------------------------------------------------------------------------
+                        //     Case 8 - Line between sides 1-2 and 3-1
+                        //-------------------------------------------------------------------------------------------------------
+                        case 8:
+                            cell.xysect(p1,p2, contour, x1, y1);
+                            cell.xysect(p3,p1, contour, x2, y2);
+
+                            if ( !box ) break;
+                            left.push_back(PaperPoint(cell.column(p1), cell.row(p1)));
+                            left.push_back(PaperPoint(x1, y1));
+                            left.push_back(PaperPoint(x2, y2));
+
+                            right.push_back(PaperPoint(x1, y1));
+                            right.push_back(PaperPoint(cell.column(p2), cell.row(p2)));
+                            right.push_back(PaperPoint(cell.column(p3), cell.row(p3)));
+                            right.push_back(PaperPoint(x2, y2));
+                            break;
+
+                        //-------------------------------------------------------------------------------------------------------
+                        //     Case 9 -single point 1
+                        //-------------------------------------------------------------------------------------------------------
+                        case 9:
+                            x1=cell.column(p1);
+                            y1=cell.row(p1);
+                            add = 1;
+                            if ( !box) break;
+                            if (cell.height(p2, contour) < 0) {
+                                   left.push_back(PaperPoint(cell.column(p1), cell.row(p1)));
+                                   left.push_back(PaperPoint(cell.column(p2), cell.row(p2)));
+                                   left.push_back(PaperPoint(cell.column(p3), cell.row(p3)));
+                            }
+                            else {
+                                   right.push_back(PaperPoint(cell.column(p1), cell.row(p1)));
+                                   right.push_back(PaperPoint(cell.column(p2), cell.row(p2)));
+                                   right.push_back(PaperPoint(cell.column(p3), cell.row(p3)));
+                            }
+                            break;
+
+                        //-------------------------------------------------------------------------------------------------------
+                        //     Case 10 - Line between vertex 3 and vertex 1
+                        //-------------------------------------------------------------------------------------------------------
+                        case 10:
+
+                            x1=cell.column(p3);
+                            y1=cell.row(p3);
+                            x2=cell.column(p1);
+                            y2=cell.row(p1);
+                            if ( !box) break;
+
+                            left.push_back(PaperPoint(cell.column(p1), cell.row(p1)));
+                            left.push_back(PaperPoint(cell.column(p2), cell.row(p2)));
+                            left.push_back(PaperPoint(cell.column(p3), cell.row(p3)));
+                            break;
+
+                        //-------------------------------------------------------------------------------------------------------
+                        //     Case 11 - Line between side 3-2 and vertex 1
+                        //-------------------------------------------------------------------------------------------------------
+                        case 11:
+                            cell.xysect(p3,p2, contour, x1, y1);
+                            x2=cell.column(p1);
+                            y2=cell.row(p1);
+                            if ( !box ) break;
+                            left.push_back(PaperPoint(cell.column(p1), cell.row(p1)));
+                            left.push_back(PaperPoint(cell.column(p2), cell.row(p2)));
+                            left.push_back(PaperPoint(x1, y1));
+
+                            right.push_back(PaperPoint(x1, y1));
+                            right.push_back(PaperPoint(cell.column(p3), cell.row(p3)));
+                            right.push_back(PaperPoint(x2, y2));
+                            break;
+
+                        //-------------------------------------------------------------------------------------------------------
+                        //     Case 12 - Line between vertex 1 and vertex 2
+                        //-------------------------------------------------------------------------------------------------------
+                        case 12:
+                            x1=cell.column(p1);
+                            y1=cell.row(p1);
+                            x2=cell.column(p2);
+                            y2=cell.row(p2);
+                            if ( !box ) break;
+
+                            left.push_back(PaperPoint(cell.column(p1), cell.row(p1)));
+                            left.push_back(PaperPoint(cell.column(p2), cell.row(p2)));
+                            left.push_back(PaperPoint(cell.column(p3), cell.row(p3)));
+                            break;
+
+                        //-------------------------------------------------------------------------------------------------------
+                        //     Case 13 - Flat Area all vertex have the isoline value!
+                        //-------------------------------------------------------------------------------------------------------
+                        case 13:
+                            add = 0;
+                            if ( !box ) break;
+                            if (cell.height(p1, contour) < 0) {
+                                   left.push_back(PaperPoint(cell.column(p1), cell.row(p1)));
+                                   left.push_back(PaperPoint(cell.column(p2), cell.row(p2)));
+                                   left.push_back(PaperPoint(cell.column(p3), cell.row(p3)));
+                            }
+                            else {
+                                   right.push_back(PaperPoint(cell.column(p1), cell.row(p1)));
+                                   right.push_back(PaperPoint(cell.column(p2), cell.row(p2)));
+                                   right.push_back(PaperPoint(cell.column(p3), cell.row(p3)));
+                            }
+                            break;
+
+                        //-------------------------------------------------------------------------------------------------------
+                        //     Case 14 - Line between vertex 2 and vertex 1
+                        //-------------------------------------------------------------------------------------------------------
+                        case 14:
+                            x1=cell.column(p2);
+                            y1=cell.row(p2);
+                            x2=cell.column(p1);
+                            y2=cell.row(p1);
+                            if ( !box ) break;
+
+                            right.push_back(PaperPoint(cell.column(p1), cell.row(p1)));
+                            right.push_back(PaperPoint(cell.column(p2), cell.row(p2)));
+                            right.push_back(PaperPoint(cell.column(p3), cell.row(p3)));
+                            break;
+
+                        //-------------------------------------------------------------------------------------------------------
+                        //     Case 15 - Line between vertex 1 and side3-2
+                        //-------------------------------------------------------------------------------------------------------
+                        case 15:
+                            x1=cell.column(p1);
+                            y1=cell.row(p1);
+                            cell.xysect(p3,p2, contour, x2, y2);
+                            if ( !box ) break;
+
+                            left.push_back(PaperPoint(x1, y1));
+                            left.push_back(PaperPoint(x2, y2));
+                            left.push_back(PaperPoint(cell.column(p3), cell.row(p3)));
+
+                            right.push_back(PaperPoint(x1, y1));
+                            right.push_back(PaperPoint(cell.column(p2), cell.row(p2)));
+                            right.push_back(PaperPoint(x2, y2));
+                            break;
+
+                        //-------------------------------------------------------------------------------------------------------
+                        //     Case 16 - Line between vertex 1 and vertex 3
+                        //-------------------------------------------------------------------------------------------------------
+                        case 16:
+                            x1=cell.column(p1);
+                            y1=cell.row(p1);
+                            x2=cell.column(p3);
+                            y2=cell.row(p3);
+                            if ( !box ) break;
+                            right.push_back(PaperPoint(x1, y1));
+                            right.push_back(PaperPoint(cell.column(p2), cell.row(p2)));
+                            right.push_back(PaperPoint(x2, y2));
+
+                            break;
+
+                        //-------------------------------------------------------------------------------------------------------
+                        //     Case 17 - single point 1
+                        //-------------------------------------------------------------------------------------------------------
+                        case 17:
+                            x1=cell.column(p1);
+                            y1=cell.row(p1);
+                            add = 1;
+                            if ( !box ) break;
+                            if (cell.height(p2, contour) < 0) {
+                                      left.push_back(PaperPoint(cell.column(p1), cell.row(p1)));
+                                      left.push_back(PaperPoint(cell.column(p2), cell.row(p2)));
+                                      left.push_back(PaperPoint(cell.column(p3), cell.row(p3)));
+                            }
+                            else {
+                                      right.push_back(PaperPoint(cell.column(p1), cell.row(p1)));
+                                      right.push_back(PaperPoint(cell.column(p2), cell.row(p2)));
+                                      right.push_back(PaperPoint(cell.column(p3), cell.row(p3)));
+                            }
+                            break;
+
+                        //-------------------------------------------------------------------------------------------------------
+                        //     Case 18 - Line between side3-1 and side1-2
+                        //-------------------------------------------------------------------------------------------------------
+                        case 18:
+                            cell.xysect(p3,p1, contour, x1, y1);
+                            cell.xysect(p1,p2, contour, x2, y2);
+
+                            if ( !box ) break;
+                            left.push_back(PaperPoint(x1, y1));
+                            left.push_back(PaperPoint(x2, y2));
+                            left.push_back(PaperPoint(cell.column(p2), cell.row(p2)));
+                            left.push_back(PaperPoint(cell.column(p3), cell.row(p3)));
+
+                            right.push_back(PaperPoint(x1, y1));
+                            right.push_back(PaperPoint(cell.column(p1), cell.row(p1)));
+                            right.push_back(PaperPoint(x2, y2));
+
+                            break;
+
+                        //-------------------------------------------------------------------------------------------------------
+                        //     Case 19 - Line between vertex 3 and side1-2
+                        //-------------------------------------------------------------------------------------------------------
+                        case 19:
+                            x1=cell.column(p3);
+                            y1=cell.row(p3);
+
+                            cell.xysect(p1,p2, contour, x2, y2);
+
+                            if ( !box ) break;
+                            left.push_back(PaperPoint(x1, y1));
+                            left.push_back(PaperPoint(x2, y2));
+                            left.push_back(PaperPoint(cell.column(p2), cell.row(p2)));
+
+                            right.push_back(PaperPoint(x1, y1));
+                            right.push_back(PaperPoint(cell.column(p1), cell.row(p1)));
+                            right.push_back(PaperPoint(x2, y2));
+                            break;
+
+                        //-------------------------------------------------------------------------------------------------------
+                        //     Case 20 - Line between side3-2 and side1-2
+                        //-------------------------------------------------------------------------------------------------------
+                        case 20:
+                            cell.xysect(p3,p2, contour, x1, y1);
+                            cell.xysect(p1,p2, contour, x2, y2);
+
+                            if ( !box ) break;
+                            left.push_back(PaperPoint(x1, y1));
+                            left.push_back(PaperPoint(x2, y2));
+                            left.push_back(PaperPoint(cell.column(p2), cell.row(p2)));
+
+                            right.push_back(PaperPoint(x1, y1));
+                            right.push_back(PaperPoint(cell.column(p3), cell.row(p3)));
+                            right.push_back(PaperPoint(cell.column(p1), cell.row(p1)));
+                            right.push_back(PaperPoint(x2, y2));
+                            break;
+
+                        //-------------------------------------------------------------------------------------------------------
+                        //     Case 21 - Line between side 3-1 and vertex 2
+                        //-------------------------------------------------------------------------------------------------------
+                        case 21:
+                            cell.xysect(p3,p1, contour, x1, y1);
+
+                            x2=cell.column(p2);
+                            y2=cell.row(p2);
+                            if ( !box ) break;
+
+                            left.push_back(PaperPoint(x1, y1));
+                            left.push_back(PaperPoint(x2, y2));
+                            left.push_back(PaperPoint(cell.column(p3), cell.row(p3)));
+
+                            right.push_back(PaperPoint(x1, y1));
+                            right.push_back(PaperPoint(cell.column(p1), cell.row(p1)));
+                            right.push_back(PaperPoint(cell.column(p2), cell.row(p2)));
+                            break;
+
+                        //-------------------------------------------------------------------------------------------------------
+                        //     Case 22 - Line between vertex 3 and vertex 2
+                        //-------------------------------------------------------------------------------------------------------
+                        case 22:
+                            x1=cell.column(p3);
+                            y1=cell.row(p3);
+                            x2=cell.column(p2);
+                            y2=cell.row(p2);
+                            if ( !box) break;
+                            right.push_back(PaperPoint(cell.column(p1), cell.row(p1)));
+                            right.push_back(PaperPoint(cell.column(p2), cell.row(p2)));
+                            right.push_back(PaperPoint(cell.column(p3), cell.row(p3)));
+                            break;
+
+                        //-------------------------------------------------------------------------------------------------------
+                        //     Case 23 - single point 2
+                        //-------------------------------------------------------------------------------------------------------
+                        case 23:
+                            x1=cell.column(p2);
+                            y1=cell.row(p2);
+                            add = 1;
+                            if ( !box) break;
+                            if (cell.height(p1, contour) < 0) {
+                                     left.push_back(PaperPoint(cell.column(p1), cell.row(p1)));
+                                     left.push_back(PaperPoint(cell.column(p2), cell.row(p2)));
+                                     left.push_back(PaperPoint(cell.column(p3), cell.row(p3)));
+                            }
+                            else {
+                                     right.push_back(PaperPoint(cell.column(p1), cell.row(p1)));
+                                     right.push_back(PaperPoint(cell.column(p2), cell.row(p2)));
+                                     right.push_back(PaperPoint(cell.column(p3), cell.row(p3)));
+                            }
+                            break;
+
+                        //-------------------------------------------------------------------------------------------------------
+                        //     Case 24 - Line between side1-3  and side3-2
+                        //-------------------------------------------------------------------------------------------------------
+                        case 24:
+                            cell.xysect(p1,p3, contour, x1, y1);
+                            cell.xysect(p3,p2, contour, x2, y2);
+                            if ( !box) break;
+                            left.push_back(PaperPoint(x1, y1));
+                            left.push_back(PaperPoint(x2, y2));
+                            left.push_back(PaperPoint(cell.column(p3), cell.row(p3)));
+
+                            right.push_back(PaperPoint(x1, y1));
+                            right.push_back(PaperPoint(cell.column(p1), cell.row(p1)));
+                            right.push_back(PaperPoint(cell.column(p2), cell.row(p2)));
+                            right.push_back(PaperPoint(x2, y2));
+                            break;
+
+                        //-------------------------------------------------------------------------------------------------------
+                        //     Case 25 - single point C
+                        //-------------------------------------------------------------------------------------------------------
+                        case 25:
+                            x1=cell.column(p3);
+                            y1=cell.row(p3);
+                            add = 1;
+                            if ( !box) break;
+                            if (cell.height(p1, contour) < 0) {
+                                     left.push_back(PaperPoint(cell.column(p1), cell.row(p1)));
+                                     left.push_back(PaperPoint(cell.column(p2), cell.row(p2)));
+                                     left.push_back(PaperPoint(cell.column(p3), cell.row(p3)));
+                            }
+                            else {
+                                     right.push_back(PaperPoint(cell.column(p1), cell.row(p1)));
+                                     right.push_back(PaperPoint(cell.column(p2), cell.row(p2)));
+                                     right.push_back(PaperPoint(cell.column(p3), cell.row(p3)));
+                            }
+                            break;
+
+                        default:
+                            break;
+                        }
 
-        //-------------------------------------------------------------------------------------------------------
-        //     Case 11 - Line between side 3-2 and vertex 1
-        //-------------------------------------------------------------------------------------------------------
-        case 11:
-            cell.xysect(p3,p2, contour, x1, y1);
-            x2=cell.column(p1);
-            y2=cell.row(p1);
-            if ( !box ) break;
-            leftcell->push_back(cell.column(p1), cell.row(p1));
-            leftcell->push_back(cell.column(p2), cell.row(p2));
-            leftcell->push_back(x1, y1);
-            
-            rightcell->push_back(x1, y1);
-            rightcell->push_back(cell.column(p3), cell.row(p3));
-            rightcell->push_back(x2, y2);
-            break;
+                if (add == 2 && needIsolines() )
+                {
+                    // here we have 2 Points to add!
+                    // We send it to a thread!
+                    const int t = (*l) % threads_;
+                    {
+                        AutoLock<MutexCond> lockproducer(producerMutex_);
+                        {
+                            AutoLock<MutexCond> lock(segments_[t]->cond_);
+                            segments_[t]->segments_.push_back(make_pair(levels_[*l],
+                                    std::make_pair(make_pair(x1, y1), std::make_pair(x2, y2))));
+                            if ( segments_[t]->segments_.size() >= 2000 )
+                                segments_[t]->cond_.signal();
+                        }
+                        producerMutex_.signal();
+                    }
+                }
 
-        //-------------------------------------------------------------------------------------------------------
-        //     Case 12 - Line between vertex 1 and vertex 2
-        //-------------------------------------------------------------------------------------------------------
-        case 12:
-            x1=cell.column(p1);
-            y1=cell.row(p1);
-            x2=cell.column(p2);
-            y2=cell.row(p2);
-            if ( !box ) break;
-        
-            leftcell->push_back(cell.column(p1), cell.row(p1));
-            leftcell->push_back(cell.column(p2), cell.row(p2));
-            leftcell->push_back(cell.column(p3), cell.row(p3));
-            break;
+                if (box) {
 
-        //-------------------------------------------------------------------------------------------------------
-        //     Case 13 - Flat Area all vertex have the isoline value!
-        //-------------------------------------------------------------------------------------------------------
-        case 13:
-            add = 0;
-            if ( !box ) break;
-            if (cell.height(p1, contour) < 0) {
-                   leftcell->push_back(cell.column(p1), cell.row(p1));
-                   leftcell->push_back(cell.column(p2), cell.row(p2));
-                   leftcell->push_back(cell.column(p3), cell.row(p3));
-            }
-            else {
-                   rightcell->push_back(cell.column(p1), cell.row(p1));
-                   rightcell->push_back(cell.column(p2), cell.row(p2));
-                   rightcell->push_back(cell.column(p3), cell.row(p3));
-            }
-            break;
+                        box->push_back(leftindex, left);
+                        box->push_back(rightindex, right);
+                }
 
-        //-------------------------------------------------------------------------------------------------------
-        //     Case 14 - Line between vertex 2 and vertex 1
-        //-------------------------------------------------------------------------------------------------------
-        case 14:
-            x1=cell.column(p2);
-            y1=cell.row(p2);
-            x2=cell.column(p1);
-            y2=cell.row(p1);
-            if ( !box ) break;
-            
-            rightcell->push_back(cell.column(p1), cell.row(p1));
-            rightcell->push_back(cell.column(p2), cell.row(p2));
-            rightcell->push_back(cell.column(p3), cell.row(p3));
-            break;
 
-        //-------------------------------------------------------------------------------------------------------
-        //     Case 15 - Line between vertex 1 and side3-2
-        //-------------------------------------------------------------------------------------------------------
-        case 15:
-            x1=cell.column(p1);
-            y1=cell.row(p1);
-            cell.xysect(p3,p2, contour, x2, y2);
-            if ( !box ) break;
-
-            leftcell->push_back(x1, y1);
-            leftcell->push_back(x2, y2);
-            leftcell->push_back(cell.column(p3), cell.row(p3));
-            
-            rightcell->push_back(x1, y1);
-            rightcell->push_back(cell.column(p2), cell.row(p2));
-            rightcell->push_back(x2, y2);
-            break;
 
-        //-------------------------------------------------------------------------------------------------------
-        //     Case 16 - Line between vertex 1 and vertex 3
-        //-------------------------------------------------------------------------------------------------------
-        case 16:
-            x1=cell.column(p1);
-            y1=cell.row(p1);
-            x2=cell.column(p3);
-            y2=cell.row(p3);
-            if ( !box ) break;
-            rightcell->push_back(x1, y1);
-            rightcell->push_back(cell.column(p2), cell.row(p2));
-            rightcell->push_back(x2, y2);
+            } // end of levels...
 
-            break;
 
-        //-------------------------------------------------------------------------------------------------------
-        //     Case 17 - single point 1
-        //-------------------------------------------------------------------------------------------------------
-        case 17:
-            x1=cell.column(p1);
-            y1=cell.row(p1);
-            add = 1;
-            if ( !box ) break;
-            if (cell.height(p2, contour) < 0) {
-                      leftcell->push_back(cell.column(p1), cell.row(p1));
-                      leftcell->push_back(cell.column(p2), cell.row(p2));
-                      leftcell->push_back(cell.column(p3), cell.row(p3));
-            }
-            else {
-                      rightcell->push_back(cell.column(p1), cell.row(p1));
-                      rightcell->push_back(cell.column(p2), cell.row(p2));
-                      rightcell->push_back(cell.column(p3), cell.row(p3));
-            }
-            break;
+            box->reshape(parent);
+            delete box;
 
-        //-------------------------------------------------------------------------------------------------------
-        //     Case 18 - Line between side3-1 and side1-2
-        //-------------------------------------------------------------------------------------------------------
-        case 18:
-            cell.xysect(p3,p1, contour, x1, y1);
-            cell.xysect(p1,p2, contour, x2, y2);
-            
-            if ( !box ) break;
-            leftcell->push_back(x1, y1);
-            leftcell->push_back(x2, y2);
-            leftcell->push_back(cell.column(p2), cell.row(p2));
-            leftcell->push_back(cell.column(p3), cell.row(p3));
-        
-            rightcell->push_back(x1, y1);
-            rightcell->push_back(cell.column(p1), cell.row(p1));
-            rightcell->push_back(x2, y2);
-        
-            break;
 
-        //-------------------------------------------------------------------------------------------------------
-        //     Case 19 - Line between vertex 3 and side1-2
-        //-------------------------------------------------------------------------------------------------------
-        case 19:
-            x1=cell.column(p3);
-            y1=cell.row(p3);
-        
-            cell.xysect(p1,p2, contour, x2, y2);
-            
-            if ( !box ) break;
-            leftcell->push_back(x1, y1);
-            leftcell->push_back(x2, y2);
-            leftcell->push_back(cell.column(p2), cell.row(p2));
-        
-            rightcell->push_back(x1, y1);
-            rightcell->push_back(cell.column(p1), cell.row(p1));
-            rightcell->push_back(x2, y2);
-            break;
 
-        //-------------------------------------------------------------------------------------------------------
-        //     Case 20 - Line between side3-2 and side1-2
-        //-------------------------------------------------------------------------------------------------------
-        case 20:
-            cell.xysect(p3,p2, contour, x1, y1);
-            cell.xysect(p1,p2, contour, x2, y2);
-            
-            if ( !box ) break;
-            leftcell->push_back(x1, y1);
-            leftcell->push_back(x2, y2);
-            leftcell->push_back(cell.column(p2), cell.row(p2));
-        
-            rightcell->push_back(x1, y1);
-            rightcell->push_back(cell.column(p3), cell.row(p3));
-            rightcell->push_back(cell.column(p1), cell.row(p1));
-            rightcell->push_back(x2, y2);
-            break;
+        }// step to next triangle
 
-        //-------------------------------------------------------------------------------------------------------
-        //     Case 21 - Line between side 3-1 and vertex 2 
-        //-------------------------------------------------------------------------------------------------------
-        case 21:
-            cell.xysect(p3,p1, contour, x1, y1);
-            
-            x2=cell.column(p2);
-            y2=cell.row(p2);
-            if ( !box ) break;
-            
-            leftcell->push_back(x1, y1);
-            leftcell->push_back(x2, y2);
-            leftcell->push_back(cell.column(p3), cell.row(p3));
-                
-            rightcell->push_back(x1, y1);
-            rightcell->push_back(cell.column(p1), cell.row(p1));
-            rightcell->push_back(cell.column(p2), cell.row(p2));
-            break;
 
-        //-------------------------------------------------------------------------------------------------------
-        //     Case 22 - Line between vertex 3 and vertex 2
-        //-------------------------------------------------------------------------------------------------------
-        case 22:
-            x1=cell.column(p3);
-            y1=cell.row(p3);
-            x2=cell.column(p2);
-            y2=cell.row(p2);
-            if ( !box) break;
-            rightcell->push_back(cell.column(p1), cell.row(p1));
-            rightcell->push_back(cell.column(p2), cell.row(p2));
-            rightcell->push_back(cell.column(p3), cell.row(p3));
-            break;
+    }
 
-        //-------------------------------------------------------------------------------------------------------
-        //     Case 23 - single point 2
-        //-------------------------------------------------------------------------------------------------------
-        case 23:
-            x1=cell.column(p2);
-            y1=cell.row(p2);
-            add = 1;
-            if ( !box) break;
-            if (cell.height(p1, contour) < 0) {
-                     leftcell->push_back(cell.column(p1), cell.row(p1));
-                     leftcell->push_back(cell.column(p2), cell.row(p2));
-                     leftcell->push_back(cell.column(p3), cell.row(p3));
-            }
-            else {
-                     rightcell->push_back(cell.column(p1), cell.row(p1));
-                     rightcell->push_back(cell.column(p2), cell.row(p2));
-                     rightcell->push_back(cell.column(p3), cell.row(p3));
-            }
-            break;
+}
 
-        //-------------------------------------------------------------------------------------------------------
-        //     Case 24 - Line between side1-3  and side3-2
-        //-------------------------------------------------------------------------------------------------------
-        case 24:
-            cell.xysect(p1,p3, contour, x1, y1);
-            cell.xysect(p3,p2, contour, x2, y2);
-            if ( !box) break;
-            leftcell->push_back(x1, y1);
-            leftcell->push_back(x2, y2);
-            leftcell->push_back(cell.column(p3), cell.row(p3));
-            
-            rightcell->push_back(x1, y1);
-            rightcell->push_back(cell.column(p1), cell.row(p1));
-            rightcell->push_back(cell.column(p2), cell.row(p2));
-            rightcell->push_back(x2, y2);
-            break;
 
-        //-------------------------------------------------------------------------------------------------------
-        //     Case 25 - single point C
-        //-------------------------------------------------------------------------------------------------------
-        case 25:
-            x1=cell.column(p3);
-            y1=cell.row(p3);
-            add = 1;
-            if ( !box) break;
-            if (cell.height(p1, contour) < 0) {
-                     leftcell->push_back(cell.column(p1), cell.row(p1));
-                     leftcell->push_back(cell.column(p2), cell.row(p2));
-                     leftcell->push_back(cell.column(p3), cell.row(p3));
-            }
-            else {
-                     rightcell->push_back(cell.column(p1), cell.row(p1));
-                     rightcell->push_back(cell.column(p2), cell.row(p2));
-                     rightcell->push_back(cell.column(p3), cell.row(p3));
-            }
-            break;
-            
-        default:
-            break;
-        }
-        
-        if (add == 2 && needIsolines() )
-        {
-            // here we have 2 Points to add! 
-            // We send it to a thread! 
-            const int t = (*l) % threads_;
-            {     
-              AutoLock<MutexCond> lockproducer(producerMutex_);
-              {
-                 AutoLock<MutexCond> lock(segments_[t]->cond_);
-                 segments_[t]->segments_.push_back(make_pair(levels_[*l], 
-                                                   std::make_pair(make_pair(x1, y1), std::make_pair(x2, y2))));
-                 if ( segments_[t]->segments_.size() >= 2000 ) 
-                       segments_[t]->cond_.signal();
-                 }
-                 producerMutex_.signal();
-              }
-            }
 
-            if ( !box) {
-                continue;
-            }
-            
-            if ( !complex ) {
 
-            	box->reshape(leftcell);
-                box->reshape(rightcell);
-            }
-           else {
-                shapes.push_back(make_pair(leftcell, rightcell));
-           }
-        } // end of levels...
-        
-        if ( shapes.empty() ) continue;
-        
-
-        // Now we reduce the shape! 
-
-        vector< std::pair<Shape*, Shape*> >::iterator current = shapes.begin();    
-        vector< std::pair<Shape*, Shape*> >::iterator next = shapes.begin();
-        box->reshape(current->first);
-
-        next++;
-        while ( next != shapes.end() ) {
-            current->second->intersection(*next->second);
-            box->reshape(current->second);
-            delete next->first;
-            current++;
-            next++ ;
-        }
-        box->reshape(current->second);
+void IsoPlot::isoline(MatrixHandler& data, BasicGraphicsObjectContainer& parent)
+{
 
-        }
-    } // step to next triangle
-}
+    const Transformation& transformation = parent.transformation();
+    Polyline& x = transformation.getPCBoundingBox();
 
 
 
 
-void IsoPlot::isoline(MatrixHandler& data, BasicGraphicsObjectContainer& parent)
-{
-    const Transformation& transformation = parent.transformation();
     levels_.clear();
+    if ( levelSelection_->empty() )
+        return;
+
 
     // Find the used levels!
     const vector<double>::const_iterator end = (*levelSelection_).end();
-    vector<double>::const_iterator previous = (*levelSelection_).end();
-    vector<double>::const_iterator last = (*levelSelection_).end();
+        vector<double>::const_iterator last = (*levelSelection_).end();
 
     double min = data.min();
     double max = data.max();
@@ -1180,24 +1209,24 @@ void IsoPlot::isoline(MatrixHandler& data, BasicGraphicsObjectContainer& parent)
     vector<double>::const_iterator level = levelSelection_->begin();
 
     while (*level < min && level != end ) {
-    	last = level;
-    	++level;
+        last = level;
+        ++level;
     }
     if ( last != end)
-    	levels_.push_back(*last);
+        levels_.push_back(*last);
     while (*level < max && level != end ) {
-    	levels_.push_back(*level);
-    	++level;
+        levels_.push_back(*level);
+        ++level;
     }
     if ( level != end ) {
-    	levels_.push_back(*level);
+        levels_.push_back(*level);
     }
     else
-    	levels_.push_back(max);
+        levels_.push_back(max);
+
 
 
 
-    
     missing_ = data.missing();
 
 
@@ -1209,14 +1238,14 @@ void IsoPlot::isoline(MatrixHandler& data, BasicGraphicsObjectContainer& parent)
        if (level+1!= levels_.end() )
           range.insert(make_pair(Interval(*level, *(level+1)), r++));
        }
-       if ( shading_->shadingMode())
-    	   range.insert(make_pair(Interval(levels_.back(), levels_.back()+epsilon), r));
+       if ( shading_->shadingMode() )
+           range.insert(make_pair(Interval(levels_.back(), levels_.back()+epsilon), r-1));
        CellArray* array = shading_->array(data, range, transformation, parent.widthResolution(), parent.heightResolution(),
-	   		resolution_, technique_);
+            resolution_, technique_);
        CellBox view(array);
 
        threads_ = (needIsolines())  ? 4: 0;
-
+        //threads_ = 1;
        vector<IsoHelper*> consumers_;
        vector<IsoProducer* >  producers_;
 
@@ -1229,21 +1258,20 @@ void IsoPlot::isoline(MatrixHandler& data, BasicGraphicsObjectContainer& parent)
 
         for (int c = 0; c < threads_; c++) {
             vector<Polyline* >* lines = new vector<Polyline*>();
-            lines_.push_back(lines);    
-            segments_.push_back(new IsoData()); 
+            lines_.push_back(lines);
+            segments_.push_back(new IsoData());
             consumers_.push_back(new IsoHelper(c, *lines,*(segments_.back())));
             consumers.push_back(new ThreadControler(consumers_.back(), false));
             consumers.back()->start();
         }
-        
+
         view.split();
 
         // let's start 4 producers...
         int c = 0;
         VectorOfPointers<vector<IsoProducerData*> > datas;
-        //for (CellBox::iterator cell = view.begin(); cell != view.end(); ++cell)
         for ( int i = 0; i < view.size(); i++)
-
+        //int i = 0;
         {
 
            IsoProducerData* data = new IsoProducerData(shading_->shadingMode(), *this, *(view[i]));
@@ -1255,18 +1283,18 @@ void IsoPlot::isoline(MatrixHandler& data, BasicGraphicsObjectContainer& parent)
 
         }
 
-        for (vector<ThreadControler *>::iterator producer = producers.begin(); 
+        for (vector<ThreadControler *>::iterator producer = producers.begin();
            producer != producers.end(); ++producer) {
            (*producer)->wait();
         }
 
         // No more
-        { 
+        {
            for (int i = 0; i < threads_; i++) {
                  AutoLock<MutexCond> lock(segments_[i]->cond_);
                  segments_[i]->more_ = false;
                  segments_[i]->cond_.signal();
-           }     
+           }
         }
 
         for (vector<ThreadControler *>::iterator consumer = consumers.begin(); consumer != consumers.end(); ++consumer) {
@@ -1275,14 +1303,14 @@ void IsoPlot::isoline(MatrixHandler& data, BasicGraphicsObjectContainer& parent)
        }
 
        for (CellBox::iterator cell = view.begin(); cell != view.end(); ++cell) {
-           (*cell)->feed(*this,parent);        
+           (*cell)->feed(*this,parent);
 
        }
 
        delete array;
        for ( vector<IsoData*>::iterator segment = segments_.begin(); segment != segments_.end(); ++segment)  {
-       	   delete *segment;
-       	   *segment = 0;
+           delete *segment;
+           *segment = 0;
        }
        segments_.clear();
 
@@ -1291,11 +1319,11 @@ void IsoPlot::isoline(MatrixHandler& data, BasicGraphicsObjectContainer& parent)
 
  bool IsoPlot::prepare(MatrixHandler& data)
 {
-	//double replaceMissing_ = 0;
-	//double min = std::min(replaceMissing_, data.min());
-	//double max = std::max(replaceMissing_, data.max());
-	double min = data.min();
-	double max = data.max();
+    //double replaceMissing_ = 0;
+    //double min = std::min(replaceMissing_, data.min());
+    //double max = std::max(replaceMissing_, data.max());
+    double min = data.min();
+    double max = data.max();
     (*levelSelection_).clear();
     (*levelSelection_).calculate(min , max , shading_->shadingMode());
     (*label_).prepare(*levelSelection_, (*colour_).name());
@@ -1311,14 +1339,14 @@ void IsoPlot::isoline(MatrixHandler& data, BasicGraphicsObjectContainer& parent)
 {
     prepare(data);
     if ( legend_only_ ) return;
-    
+
     {
         Timer timer("contouring", "Time spent in contouring");
         isoline(data, parent);
     }
 
 #ifdef ISOPLOT_DEBUG
-    vector<Colour> colours;    
+    vector<Colour> colours;
     colours.push_back(Colour("red"));
     colours.push_back(Colour("green"));
     colours.push_back(Colour("blue"));
@@ -1329,34 +1357,47 @@ void IsoPlot::isoline(MatrixHandler& data, BasicGraphicsObjectContainer& parent)
     (*shading_)(data, parent);
     (*highlight_).prepare(*levelSelection_);
 
-    rainbowMethod_->set(*this);
-    rainbowMethod_->prepare(*levelSelection_);
+    if ( rainbow_ ) {
+        rainbowMethod_->set(*this);
+        rainbowMethod_->prepare(*levelSelection_, true);
+        setThicknessAndStyle();
 
-    // Now we feed the task...   
+    }
+    // Now we feed the task...
     for (vector<vector<Polyline* >* >::const_iterator lines = lines_.begin(); lines != lines_.end(); ++lines)
     {
       for (vector<Polyline* >::const_iterator poly = (*lines)->begin(); poly != (*lines)->end(); ++poly)
       {
         if ( (*poly)->empty() ) continue;
-        (*poly)->setLineStyle(style_);
-        (*poly)->setThickness(thickness_);
+        double level = (*poly)->front().value();
+
 
-        if ( !rainbow_ )
-        	(*poly)->setColour(*colour_);
-        else
-        	(*poly)->setColour((*rainbowMethod_)((*poly)->front().value()));
+        if ( !rainbow_ ) {
+            (*poly)->setColour(*colour_);
+            (*poly)->setLineStyle(style_);
+            (*poly)->setThickness(thickness_);
+            (*highlight_)(*(*poly));
+        }
+        else {
+            double level = (*poly)->front().value();
+            (*poly)->setColour((*rainbowMethod_)(level));
+            (*poly)->setLineStyle(line_style(level));
+            (*poly)->setThickness(thickness(level));
+        }
 #ifdef ISOPLOT_DEBUG
         (*poly)->setColour(*colour);
         colour++;
-        if ( colour == colours.end()) 
+        if ( colour == colours.end())
             colour = colours.begin();
 #endif
-        (*highlight_)(*(*poly));
+
         if ( rainbow_ ) {
-        	(*poly)->setColour((*rainbowMethod_)((*poly)->front().value()));
+            (*poly)->setColour((*rainbowMethod_)((*poly)->front().value()));
         }
         (*label_)(**poly, (*poly)->front().value());
 
+
+
         parent.push_back(*poly);
       }
       delete *lines;
@@ -1369,16 +1410,16 @@ void IsoPlot::isoline(MatrixHandler& data, BasicGraphicsObjectContainer& parent)
 
  void NoIsoPlot::operator()(MatrixHandler& data, BasicGraphicsObjectContainer& parent)
 {
-    // Create the isolines...        
-    if ( !prepare(data) ) {    
+    // Create the isolines...
+    if ( !prepare(data) ) {
         if ( legend_only_ ) return;
         (*shading_)(data, parent);
-        // do not send the isolines...  
+        // do not send the isolines...
         return;
     }
     if ( legend_only_ ) return;
     // The shading needs the isolines..
-    // WE will calculate them but will not send them to the printer     
+    // WE will calculate them but will not send them to the printer
     {
         Timer timer("contouring", "Time spent in contouring");
         isoline(data, parent);
@@ -1405,144 +1446,155 @@ void IsoPlot::isoline(MatrixHandler& data, BasicGraphicsObjectContainer& parent)
 
 void IsoPlot::visit(Data& data, LegendVisitor& legend) {
 
-	if ( magCompare(legend_special_, "spaghetti") ) {
-		Polyline* blue = new Polyline();
-		blue->setColour(Colour("blue"));
-		blue->setLineStyle(M_DASH);
-		Polyline* red = new Polyline();
-		red->setColour(Colour("red"));
-		red->setLineStyle(M_DASH);
-		Polyline* grey = new Polyline();
-		grey->setColour(Colour("grey"));
-		grey->setLineStyle(M_SOLID);
-		legend.add(new DoubleLineEntry("Det", blue,0));
-		legend.add(new DoubleLineEntry("Control", red,0));
-		legend.add(new DoubleLineEntry("EPS members", grey,0));
-		return;
-	}
-	switch (legend.legendType())  {
-		case LegendMethod::CONTINUOUS :
-		case LegendMethod::DISJOINT: {
-			(*shading_).visit(legend);
-			if (shading_->hasLegend() ) return;
-
-			Polyline* line1 = new Polyline();
-			Polyline* line2 = 0;
-			line1->setColour(*colour_);
-			line1->setLineStyle(style_);
-			line1->setThickness(thickness_);
-    
-			highlight_->visit(line2);
-			legend.add(new DoubleLineEntry(legend_text_, line1, line2));
-			// Should do something for the wrep legend!!!
-			if ( legend.size() < 3 && legend.wrep_ ) {
-				legend.add(new EmptyEntry());
-			}
-			break;
-		}
-		case LegendMethod::HISTOGRAM: {
-			legend.newLegend();
-			IntervalMap<Colour> beans;
-			vector<double>::iterator from = levelSelection_->begin();
-			vector<double>::iterator to = levelSelection_->begin();
-			++to;
-			for (;  to != levelSelection_->end(); ++to){
-				Colour colour = *colour_;
-				shading_->colour(*from, colour);
-				beans.insert(make_pair(Interval(*from, *to), colour ));
-				++from;
-			}
-			Histogram helper;
-			const Transformation& transformation = legend.transformation();
-			IntervalMap<int>& histogram = helper.histogram(beans, data.points(transformation,false));
-			int total = 0;
-			for (IntervalMap<int>::const_iterator  interval = histogram.begin(); interval != histogram.end(); ++interval){
-				total+=interval->second;
-			}
-			bool first = true;
-			for ( IntervalMap<Colour>::const_iterator interval = beans.begin(); interval != beans.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);
-				   BoxEntry* entry = new BoxEntry(min, max, box);
-				   int count = histogram.find(min, 0);
-				   entry->population(count);
-				   entry->totalPopulation(total);
-				   if (first) {
-					   entry->first();
-					   first = false;
-				   }
-
-
-				   legend.add(entry);
-
-			}
-
-			legend.last();
-		}
-	}
-    
+    if ( magCompare(legend_special_, "spaghetti") ) {
+        Polyline* blue = new Polyline();
+        blue->setColour(Colour("blue"));
+        blue->setLineStyle(M_DASH);
+        Polyline* red = new Polyline();
+        red->setColour(Colour("red"));
+        red->setLineStyle(M_DASH);
+        Polyline* grey = new Polyline();
+        grey->setColour(Colour("grey"));
+        grey->setLineStyle(M_SOLID);
+        legend.add(new DoubleLineEntry("Det", blue,0));
+        legend.add(new DoubleLineEntry("Control", red,0));
+        legend.add(new DoubleLineEntry("EPS members", grey,0));
+        return;
+    }
+    switch (legend.legendType())  {
+        case LegendMethod::CONTINUOUS :
+        case LegendMethod::DISJOINT: {
+            (*shading_).visit(legend);
+            if (shading_->hasLegend() ) return;
+            if ( rainbow_) {
+
+                for ( vector<double>::iterator level = levelSelection_->begin(); level != levelSelection_->end(); ++level) {
+                    Polyline* line = new Polyline();
+
+                    line->setColour((*rainbowMethod_)(*level));
+                    line->setLineStyle(line_style(*level));
+                    line->setThickness(thickness(*level));
+                    legend.add(new LineEntry(*level, line));
+                }
+                break;
+            }
+            Polyline* line1 = new Polyline();
+            Polyline* line2 = 0;
+            line1->setColour(*colour_);
+            line1->setLineStyle(style_);
+            line1->setThickness(thickness_);
+
+            highlight_->visit(line2);
+            legend.add(new DoubleLineEntry(legend_text_, line1, line2));
+            // Should do something for the wrep legend!!!
+            if ( legend.size() < 3 && legend.wrep_ ) {
+                legend.add(new EmptyEntry());
+            }
+            break;
+        }
+        case LegendMethod::HISTOGRAM: {
+            legend.newLegend();
+            IntervalMap<Colour> beans;
+            vector<double>::iterator from = levelSelection_->begin();
+            vector<double>::iterator to = levelSelection_->begin();
+            ++to;
+            for (;  to != levelSelection_->end(); ++to){
+                Colour colour = *colour_;
+                shading_->colour(*from, colour);
+                beans.insert(make_pair(Interval(*from, *to), colour ));
+                ++from;
+            }
+            Histogram helper;
+            const Transformation& transformation = legend.transformation();
+            IntervalMap<int>& histogram = helper.histogram(beans, data.points(transformation,false));
+            int total = 0;
+            for (IntervalMap<int>::const_iterator  interval = histogram.begin(); interval != histogram.end(); ++interval){
+                total+=interval->second;
+            }
+            bool first = true;
+            for ( IntervalMap<Colour>::const_iterator interval = beans.begin(); interval != beans.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);
+                   BoxEntry* entry = new BoxEntry(min, max, box);
+                   int count = histogram.find(min, 0);
+                   entry->population(count);
+                   entry->totalPopulation(total);
+                   if (first) {
+                       entry->first();
+                       first = false;
+                   }
+
+
+                   legend.add(entry);
+
+            }
+
+            legend.last();
+        }
+    }
+
 }
 
 
  void NoIsoPlot::visit(Data& data, LegendVisitor& legend) {
 
     switch (legend.legendType())  {
-    		case LegendMethod::CONTINUOUS :
-    		case LegendMethod::DISJOINT: {
-    			(*shading_).visit(legend);
-    			break;
-    		}
-    		case LegendMethod::HISTOGRAM: {
-    			legend.newLegend();
-    			IntervalMap<Colour> beans;
-    			vector<double>::iterator from = levelSelection_->begin();
-    			vector<double>::iterator to = levelSelection_->begin();
-    			++to;
-    			for (;  to != levelSelection_->end(); ++to){
-    				Colour colour = *colour_;
-    				shading_->colour(*from, colour);
-    				beans.insert(make_pair(Interval(*from, *to), colour ));
-    				++from;
-    			}
-    			Histogram helper;
-    			IntervalMap<int>& histogram = helper.histogram(beans, data.points(legend.transformation(), true));
-    			int total = 0;
-    			for (IntervalMap<int>::const_iterator  interval = histogram.begin(); interval != histogram.end(); ++interval){
-    				total+=interval->second;
-    			}
-    			bool first = true;
-    			for ( IntervalMap<Colour>::const_iterator interval = beans.begin(); interval != beans.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);
-    				   BoxEntry* entry = new BoxEntry(min, max, box);
-    				   int count = histogram.find(min, 0);
-    				   entry->population(count);
-    				   entry->totalPopulation(total);
-    				   if (first) {
-    					   entry->first();
-    					   first = false;
-    				   }
-
-
-    				   legend.add(entry);
-
-    			}
-
-    			legend.last();
-    		}
-    	}
+            case LegendMethod::CONTINUOUS :
+            case LegendMethod::DISJOINT: {
+                (*shading_).visit(legend);
+                break;
+            }
+            case LegendMethod::HISTOGRAM: {
+                legend.newLegend();
+                IntervalMap<Colour> beans;
+                vector<double>::iterator from = levelSelection_->begin();
+                vector<double>::iterator to = levelSelection_->begin();
+                ++to;
+                for (;  to != levelSelection_->end(); ++to){
+                    Colour colour = *colour_;
+                    shading_->colour(*from, colour);
+                    beans.insert(make_pair(Interval(*from, *to), colour ));
+                    ++from;
+                }
+                Histogram helper;
+                IntervalMap<int>& histogram = helper.histogram(beans, data.points(legend.transformation(), true));
+                int total = 0;
+                for (IntervalMap<int>::const_iterator  interval = histogram.begin(); interval != histogram.end(); ++interval){
+                    total+=interval->second;
+                }
+                bool first = true;
+                for ( IntervalMap<Colour>::const_iterator interval = beans.begin(); interval != beans.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);
+                       BoxEntry* entry = new BoxEntry(min, max, box);
+                       int count = histogram.find(min, 0);
+                       entry->population(count);
+                       entry->totalPopulation(total);
+                       if (first) {
+                           entry->first();
+                           first = false;
+                       }
+
+
+                       legend.add(entry);
+
+                }
+
+                legend.last();
+            }
+        }
 }
 
 
@@ -1567,235 +1619,261 @@ void IsoPlot::visit(Data& data, PointsHandler& points, HistoVisitor& visitor)
 }
 
 CellArray::CellArray(MatrixHandler& data, IntervalMap<int>& range, const Transformation& transformation, int width, int height, float resol, const string& technique) :
-		data_(data), rangeFinder_(range)
+        data_(data), rangeFinder_(range)
 {
-	Timer timer("CellArray", "CellArray");
-	int r = height/resol;
-	int c = (int) width/resol;
-	rows_ = r;
-	columns_ = c;
-
-
-	points_.set(rows_+1, columns_+1);
-	reserve(rows_* columns_);
-
-//	int i = 0;
-
-	missing_ = data.missing();
-	double firstx = transformation.getMinPCX();
-	double firsty = transformation.getMinPCY();
-
-	double stepx =  ( transformation.getMaxPCX() -  transformation.getMinPCX() )/ (columns_);
-	double stepy =  ( transformation.getMaxPCY() -  transformation.getMinPCY() )/ (rows_);
-
-	{
-		Timer timer("matrix", "prepare");
-
-		vector< std::pair<double, double> > xypoints;
-		vector< std::pair<double, double> > geopoints;
-		double x = firstx, y = firsty;
-		xypoints.reserve(rows_+1 * columns_+1);
-		for (int row = 0; row <= rows_; row++) {
-			    x = firstx;
-				y = firsty + (row*stepy);    // multiplication here avoids accumulation of errors
-			    points_.rowsAxis().push_back(y);
-				for (int column = 0; column <= columns_; column++) {
-					x = firstx + (column*stepx);  // multiplication here avoids accumulation of errors
-					xypoints.push_back(make_pair(x, y));
-					if ( row == 0) {
-						points_.columnsAxis().push_back(x);
-					}
-				}
-		}
-		transformation.revert(xypoints, geopoints);
-		vector< std::pair<double, double> >::iterator geo= geopoints.begin();
-		double min =  data.min();
-		double max =  data.max();
-		double missing =  data.missing();
-
-		MagLog::dev() << "min = " << data.min() << "  max = " << data.max() << endl;
-		for (vector< std::pair<double, double> >::iterator xy = xypoints.begin(); xy != xypoints.end(); ++xy) {
-
-					double value;
-					if  ( geo->second == -1000) {
-
-						value = missing;
-					}
-					else {
-						value = (magCompare(technique, "nearest")) ?
-							data.nearest(geo->second, geo->first):data.interpolate(geo->second, geo->first);
-						//value =data.nearest(geo->second, geo->first);
-					}
-					if (value != missing) {
-						if (value < min)
-							value = min;
-						if (value > max)
-							value=max;
-					}
-					//else value = 0;
-
-
-
-					points_.push_back(value);
-					++geo;
-		}
-		points_.setMapsAxis();
-
-	}
-
-	for (int row = 0; row < rows_; row++)
-		for (int column = 0; column < columns_; column++) {
-			push_back(new Cell(*this, row, column));
-		}
-}
-
-
-CellArray::CellArray(MatrixHandler& data, IntervalMap<int>& range) : data_(data), rangeFinder_(range)
-{
-
-}
-
-GridArray::GridArray(MatrixHandler& data, IntervalMap<int>& range, const Transformation& transformation, int width, int height, float resol, const string& technique) : CellArray(data, range)
-{
-	Timer timer("GridArray", "GridArray");
-	if ( magCompare(technique, "middle") ) {
-		rows_ = data.rows();
-		columns_ = data.columns();
-	}
-	else {
-		rows_ = data.rows() -1;
-		columns_ = data.columns() -1;
-	}
-	reserve(rows_*columns_);
-	for (int row = 0; row < rows_; row++)
-		for (int column = 0; column < columns_; column++) {
-			push_back(new GridCell(*this, row, column, transformation, technique));
-		}
-}
-
-
-GridCell::GridCell(const CellArray& data, int row, int column, const Transformation& transformation, const string& technique):
-		Cell(data), transformation_(transformation)  {
-
-		row_ = row;
-		column_ = column;
-		int row1 = (row) ? row - 1 : 0;
-		int row2 = ( row == data.data_.rows() -1 ) ? row : row + 1;
-		missing_ = data.missing_;
-		value_ = data.data_(row_, column_);
-		min_ = max_ = value_;
-		int column1 = column ? column - 1 : 0;
-		int column2 = ( column == data.data_.columns() -1 ) ? column : column + 1;
+    Timer timer("CellArray", "CellArray");
+    int r = height/resol;
+    int c = (int) width/resol;
 
+    rows_ = r;
+    columns_ = c;
 
-		range_ = data.rangeFinder_.find(value_, -1);
-		min_ = max_ = range_;
-		if ( range_ == -1 )
-			outOfRange_ = 4;
 
-		if ( magCompare(technique, "middle")) {
+    points_.set(rows_+1, columns_+1);
+    reserve(rows_* columns_);
 
-	        double rc1 = data.data_.column(row, column1);
-	        double crc = data.data_.column(row, column);
-	        double rc2 = data.data_.column(row, column2);
-	        double r1c = data.data_.row(row1, column);
-	        double r2c = data.data_.row(row2, column);
-	        double rrc = data.data_.row(row, column);
-
-			columns_[0] = (rc1 + crc)/2;
-			columns_[1] = (crc + rc2)/2;
-			columns_[2] = (crc + rc2)/2;
-			columns_[3] = (rc1 + crc)/2;
-			rows_[0] = (r1c + rrc)/2;
-			rows_[1] = (r1c + rrc)/2;
-			rows_[2] = (rrc + r2c)/2;
-			rows_[3] = (rrc + r2c)/2;
-		}
-
-		else {
-
-			columns_[0] = data.data_.column(row, column);
-			columns_[1] = data.data_.column(row, column2);
-			columns_[2] = data.data_.column(row, column2);
-			columns_[3] = data.data_.column(row, column);
-			rows_[0] = data.data_.row(row, column);
-			rows_[1] = data.data_.row(row, column);
-			rows_[2] = data.data_.row(row2, column);
-			rows_[3] =  data.data_.row(row2, column);
-			}
-
-		for (int i = 0; i < 4; i++) {
-
-			transformation.fast_reproject(columns_[i], rows_[i]);
-
-
-		}
-
-	}
-void Shape::intersection(Shape& other) {
-
-	vector<Point > opoints = other.points_;
-
-		std::reverse(opoints.begin(), opoints.end());
+//  int i = 0;
 
+    missing_ = data.missing();
+    double firstx = transformation.getMinPCX();
+    double firsty = transformation.getMinPCY();
 
+    double stepx =  ( transformation.getMaxPCX() -  transformation.getMinPCX() )/ (columns_);
+    double stepy =  ( transformation.getMaxPCY() -  transformation.getMinPCY() )/ (rows_);
 
-	vector<Point  >::iterator p1= points_.begin();
+    {
+        Timer timer("matrix", "prepare");
+
+        vector< std::pair<double, double> > xypoints;
+        vector< std::pair<double, double> > geopoints;
+        double x = firstx, y = firsty;
+        xypoints.reserve(rows_+1 * columns_+1);
+        for (int row = 0; row <= rows_; row++) {
+                x = firstx;
+                y = firsty + (row*stepy);    // multiplication here avoids accumulation of errors
+                points_.rowsAxis().push_back(y);
+                for (int column = 0; column <= columns_; column++) {
+                    x = firstx + (column*stepx);  // multiplication here avoids accumulation of errors
+                    xypoints.push_back(make_pair(x, y));
+                    if ( row == 0) {
+                        points_.columnsAxis().push_back(x);
+                    }
+                }
+        }
+        transformation.revert(xypoints, geopoints);
+        vector< std::pair<double, double> >::iterator geo= geopoints.begin();
+        double min =  data.min();
+        double max =  data.max();
+        double missing =  data.missing();
+
+        MagLog::dev() << "min = " << data.min() << "  max = " << data.max() << endl;
+        for (vector< std::pair<double, double> >::iterator xy = xypoints.begin(); xy != xypoints.end(); ++xy) {
+
+                    double value;
+                    if  ( geo->second == -1000) {
+
+                        value = missing;
+                    }
+                    else {
+                        value = (magCompare(technique, "nearest")) ?
+                            data.nearest(geo->second, geo->first):data.interpolate(geo->second, geo->first);
+                        //value =data.nearest(geo->second, geo->first);
+                    }
+                    if (value != missing) {
+                        if (value < min)
+                            value = min;
+                        if (value > max)
+                            value=max;
+                    }
+                    //else value = 0;
+
+
+
+                    points_.push_back(value);
+                    ++geo;
+        }
+        points_.setMapsAxis();
 
-	Point top;
+    }
 
+    for (int row = 0; row < rows_; row++)
+        for (int column = 0; column < columns_; column++) {
+            push_back(new Cell(*this, row, column));
+        }
+}
 
-	while (p1!= points_.end() ) {
-		vector<Point  >::iterator p2= opoints.begin();
-		while ( p2!= opoints.end()) {
-			if ( *p1 == *p2) {
-				std::rotate(opoints.begin(), p2, opoints.end());
-				p1++;
 
-				points_.insert(p1, opoints.begin(), opoints.end());
+CellArray::CellArray(MatrixHandler& data, IntervalMap<int>& range) : data_(data), rangeFinder_(range)
+{
 
-				//now we need to take off the duplicates!
+}
 
-				stack<Point > helper;
-				vector<Point  >::const_iterator point = points_.begin();
+GridArray::GridArray(MatrixHandler& data, IntervalMap<int>& range, const Transformation& transformation, int width, int height, float resol, const string& technique) : CellArray(data, range)
+{
+    Timer timer("GridArray", "GridArray");
+    if ( magCompare(technique, "middle") ) {
+        rows_ = data.rows();
+        columns_ = data.columns();
+    }
+    else {
+        rows_ = data.rows() -1;
+        columns_ = data.columns() -1;
+    }
+    reserve(rows_*columns_);
+    for (int row = 0; row < rows_; row++)
+        for (int column = 0; column < columns_; column++) {
+            push_back(new GridCell(*this, row, column, transformation, technique));
+        }
+}
 
 
-				for (point = points_.begin();  point != points_.end(); ++point) {
-					if ( helper.empty() ) {
-						helper.push(*point);
-						continue;
-					}
+GridCell::GridCell(const CellArray& data, int row, int column, const Transformation& transformation, const string& technique):
+        Cell(data), transformation_(transformation)  {
+
+        row_ = row;
+        column_ = column;
+        int row1 = (row) ? row - 1 : 0;
+        int row2 = ( row == data.data_.rows() -1 ) ? row : row + 1;
+        missing_ = data.missing_;
+        value_ = data.data_(row_, column_);
+        min_ = max_ = value_;
+        int column1 = column ? column - 1 : 0;
+        int column2 = ( column == data.data_.columns() -1 ) ? column : column + 1;
+
+
+        range_ = data.rangeFinder_.find(value_, -1);
+        min_ = max_ = range_;
+        if ( range_ == -1 )
+            outOfRange_ = 4;
+
+        if ( magCompare(technique, "middle")) {
+
+            double rc1 = data.data_.column(row, column1);
+            double crc = data.data_.column(row, column);
+            double rc2 = data.data_.column(row, column2);
+            double r1c = data.data_.row(row1, column);
+            double r2c = data.data_.row(row2, column);
+            double rrc = data.data_.row(row, column);
+
+            columns_[0] = (rc1 + crc)/2;
+            columns_[1] = (crc + rc2)/2;
+            columns_[2] = (crc + rc2)/2;
+            columns_[3] = (rc1 + crc)/2;
+            rows_[0] = (r1c + rrc)/2;
+            rows_[1] = (r1c + rrc)/2;
+            rows_[2] = (rrc + r2c)/2;
+            rows_[3] = (rrc + r2c)/2;
+        }
 
-					top =  helper.top();
-					helper.pop();
+        else {
 
-					if ( !( top == *point ) ) {
-						helper.push(top);
-						helper.push(*point);
-					}
+            columns_[0] = data.data_.column(row, column);
+            columns_[1] = data.data_.column(row, column2);
+            columns_[2] = data.data_.column(row, column2);
+            columns_[3] = data.data_.column(row, column);
+            rows_[0] = data.data_.row(row, column);
+            rows_[1] = data.data_.row(row, column);
+            rows_[2] = data.data_.row(row2, column);
+            rows_[3] =  data.data_.row(row2, column);
+            }
 
-				}
-				clean();
+        double minx = transformation.getMinPCX();
+        double maxx = transformation.getMaxPCX();
+        double miny = transformation.getMinPCY();
+        double maxy = transformation.getMaxPCY();
+
+        bool clip = false;
+        static int count = 0;
+        count++;
+
+        for (int i = 0; i < 4; i++) {
+            double lon = columns_[i];
+            double lat =  rows_[i];
+            transformation.fast_reproject(columns_[i], rows_[i]);
+
+            if ( columns_[i] < minx ) {
+                columns_[i] = minx;
+                clip = true;
+               }
+            if ( columns_[i] > maxx ) {
+                columns_[i] = maxx ;
+                clip = true;
+                }
+            if( rows_[i] < miny ) {
+                rows_[i] = miny ;
+                clip = true;
+                }
+            if ( rows_[i] > maxy ) {
+                rows_[i] = maxy;
+                clip = true;
+                }
 
 
+        }
+        if ( clip) {
+            double xmin = std::min(columns_[0], columns_[2]);
+            double xmax = std::max(columns_[0], columns_[2]);
+            double ymin = std::min(rows_[0], rows_[2]);
+            double ymax = std::max(rows_[0], rows_[2]);
+            if ( xmin == xmax || ymin == ymax) {
+                range_ = -1;
+                outOfRange_ = 4;
+            }
 
-				while ( !helper.empty() ) {
-					push_back(helper.top().x_, helper.top().y_);
-					helper.pop();
-				}
+        }
 
-				if ( SegmentJoiner::isHole(points_) ) {
+    }
 
-				       std::reverse(points_.begin(), points_.end());
+void IsoPlot::setThicknessAndStyle()
+{
+    if ( rainbowThicknessList_.empty() )
+        rainbowThicknessList_.push_back(thickness_);
 
-				      }
+    vector<LineStyle> styles;
+    MagTranslator<string, LineStyle> translator;
+    for (vector<string>::iterator style = rainbowStyleList_.begin(); style != rainbowStyleList_.end(); ++style ) {
+        styles.push_back(translator(*style));
+    }
 
-				return;
-			}
-			p2++;
-		}
-		p1++;
-	}
+    if ( styles.empty() )
+        styles.push_back(style_);
+
+    vector<int>::iterator thickness = rainbowThicknessList_.begin();
+    vector<LineStyle>::iterator style = styles.begin();
+
+    for (vector<double>::iterator level = levelSelection_->begin(); level != levelSelection_->end(); ++level ) {
+        thickness_list_.insert(make_pair(*level, *thickness));
+        line_style_list_.insert(make_pair(*level, *style));
+        ++thickness;
+        if ( thickness == rainbowThicknessList_.end() ) {
+            if ( rainbowThicknessListPolicy_ == M_LASTONE)
+                --thickness;
+            else
+                thickness = rainbowThicknessList_.begin();
+        }
+        ++style;
+        if ( style == styles.end() ) {
+            if ( rainbowStyleListPolicy_ == M_LASTONE)
+                --style;
+            else
+                style = styles.begin();
+        }
 
+    }
+    //*levelSelection_
+}
 
+int IsoPlot::thickness(double level)
+{
+    map<double, int>::iterator thickness = thickness_list_.find(level);
+    if ( thickness !=  thickness_list_.end() )
+        return thickness->second;
+    return thickness_;
+}
+LineStyle IsoPlot::line_style(double level)
+{
+    map<double, LineStyle>::iterator style = line_style_list_.find(level);
+        if ( style !=  line_style_list_.end() )
+            return style->second;
+        return style_;
 }
diff --git a/src/visualisers/IsoPlot.h b/src/visualisers/IsoPlot.h
index f5e9df0..0ce9645 100644
--- a/src/visualisers/IsoPlot.h
+++ b/src/visualisers/IsoPlot.h
@@ -47,78 +47,6 @@ namespace magics {
 
 
 
-struct Shape
-{
-	Shape() : index_(-1),
-	minx_(numeric_limits<double>::max()), 
-	maxx_(-numeric_limits<double>::max()), 
-	miny_(numeric_limits<double>::max()), 
-	maxy_(-numeric_limits<double>::max()) {}
-
-	Shape(int index) :
-				index_(index),
-
-				minx_(numeric_limits<double>::max()), 
-				maxx_(-numeric_limits<double>::max()), 
-				miny_(numeric_limits<double>::max()), 
-				maxy_(-numeric_limits<double>::max()) {
-
-	}
-
-	int index_;
-	~Shape() {}
-
-
-	void push_back(double x, double y) {
-
-		points_.push_back(Point(x,y));
-
-
-		if ( x < minx_ ) minx_ = x;
-		if ( x > maxx_ ) maxx_ = x;
-		if ( y < miny_ ) miny_ = y;
-		if ( y > maxy_ ) maxy_ = y;
-	}
-
-
-	double minx_;
-	double maxx_;
-	double miny_;	
-	double maxy_;
-	vector<Point> points_;
-	
-
-	bool intersect(Shape& other) {
-		if ( minx_ > other.maxx_ ) return false;
-		if ( maxx_ < other.minx_ ) return false;
-		if ( miny_ > other.maxy_ ) return false;
-		if ( maxy_ < other.miny_ ) return false;
-		return true;
-	}
-	
-
-	void clean() {
-		points_.clear();
-
-		minx_ = numeric_limits<double>::max();
-		maxx_ = -numeric_limits<double>::max();
-		miny_ = numeric_limits<double>::max();
-		maxy_ = -numeric_limits<double>::max();
-	}
-
-
-	void intersection(Shape& other);
-
-	friend ostream& operator<<(ostream& s,const Shape& p) 
-	{
-	  s << "Shape[\n";
-
-	  s<< "]\n";
-	  return s; 
-	}
-};
-
-
 
 class Cell;
 
@@ -410,39 +338,44 @@ public:
 		return this->shading_->shadingIndex(value);
 	}
 
-	bool reshape(Shape&,Shape&);
-	void reshape(const Colour&, Shape&);
-	bool reduce( list<Shape>&, list<Shape>::iterator&);
+
 	void isoline(Cell&, CellBox* = 0) const;
 	virtual bool needIsolines() const { return true; }
 	void operator()(Data& data, BasicGraphicsObjectContainer& parent) {
 			(*this->shading_)(data, parent); 
 		}
 	virtual void visit(Data&, PointsHandler&, HistoVisitor&);
+	virtual bool method(ContourMethod* method) { return (*this->shading_).method(method);  }
 
 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&);
-	
+
 	double min_;
 	double max_;
 
-        vector<vector<Polyline* >* > lines_;
+	vector<vector<Polyline* >* > lines_;
 
-		double missing_;
-		vector<double>  levels_;
-		bool shadingMode_; 
-		
-		vector<IsoData*> segments_; 
-		
-		map<Colour, IsoData*> colourShapes_; 
-		int threads_;
+	double missing_;
+	vector<double>  levels_;
+	bool shadingMode_;
+
+	vector<IsoData*> segments_;
+
+	map<Colour, IsoData*> colourShapes_;
+	int threads_;
 		
+	map<double, int> thickness_list_;
+	map<double, LineStyle> line_style_list_;
 	
+	void setThicknessAndStyle();
+
+	int thickness(double);
+	LineStyle line_style(double);
 	
 
 private:
@@ -485,6 +418,7 @@ public:
 	}
 	bool needIsolines() { return this->label_->label(); }
     void visit(Data&, LegendVisitor&);
+    bool method(ContourMethod*) { return false; }
 protected:
  	void print(ostream& out) const 
  	{ out << "NoIsoPlot" << "\n"; }
diff --git a/src/visualisers/IsoShading.h b/src/visualisers/IsoShading.h
index cb51292..47b3929 100644
--- a/src/visualisers/IsoShading.h
+++ b/src/visualisers/IsoShading.h
@@ -39,8 +39,10 @@
 #include "Polyline.h"
 #include "MatrixHandler.h"
 #include "LegendVisitor.h"
+
 namespace magics {
 
+class ContourMethod;
 
 class NoIsoShading  {
 
@@ -78,6 +80,7 @@ public:
 	virtual void operator()(Polyline*) const {}
 	virtual void colour(double, Colour&) {};
 	virtual bool needClipping() { return false;}
+	virtual bool method(ContourMethod*) { return false; }
 	
 protected:
      //! Method to print string about this class on to a stream of type ostream (virtual).
@@ -146,6 +149,7 @@ public:
 		if ( icolour != colourMethod_->end() )
 			colour = icolour->second.right_;
 	}
+	virtual bool method(ContourMethod* method) { return (*this->technique_).method(method);  }
 
 protected:
 	//! Method to print string about this class on to a stream of type ostream (virtual).
diff --git a/src/visualisers/LegendMethod.cc b/src/visualisers/LegendMethod.cc
index 224db21..69b93d6 100644
--- a/src/visualisers/LegendMethod.cc
+++ b/src/visualisers/LegendMethod.cc
@@ -81,8 +81,9 @@ void ContinuousLegendMethod::row(LegendEntry& entry, double x, double y, Text& l
 	entry.rowBox(middle, task);
 
 	if ( entry.needContinuousText() ) {
-		legend.setJustification(MLEFT);		
-		legend.push_back(entry.leftTextBox(middle)); // WE attach the text on the bottom of the sumbol!
+		legend.setJustification(MLEFT);
+		middle.y_ -= 0.5;
+		legend.push_back(middle); // We attach the text on the top middle of the symbol!
 	}
 
 	labelCount_++;
diff --git a/src/visualisers/LevelListSelectionType.h b/src/visualisers/LevelListSelectionType.h
index 1c32e39..a3dd44d 100644
--- a/src/visualisers/LevelListSelectionType.h
+++ b/src/visualisers/LevelListSelectionType.h
@@ -62,7 +62,7 @@ public:
     	return object;
     }
 
-    double reference() const { return  empty() ? -9999:    front(); }
+    double reference(int) const { return  empty() ? -9999:    front(); }
 
     void copy(const LevelListSelectionType& from) {
     	 LevelListSelectionTypeAttributes::copy(from);
diff --git a/src/visualisers/LevelSelection.cc b/src/visualisers/LevelSelection.cc
index dc95bdf..98ca7db 100644
--- a/src/visualisers/LevelSelection.cc
+++ b/src/visualisers/LevelSelection.cc
@@ -51,7 +51,8 @@ void LevelSelection::print(ostream& out)  const
 }
 void LevelSelection::thinLevels(int frequency, vector<double>& out) const
 {
-	double ref = reference();
+	if ( empty() ) return;
+	double ref = reference(frequency);
 	int count = 0;
 	// Fisrt is the reference in the levels list?
 
@@ -97,7 +98,7 @@ void LevelSelection::thinLevels(int frequency, vector<double>& out) const
 	MagLog::dev() << "Level --->" << level.str() << endl << "selection(" << frequency << ")--->" << sel.str() << endl;
 }
 
-double LevelSelection::reference() const
+double LevelSelection::reference(int) const
 {
 	return empty() ? -9999: front();
 }
diff --git a/src/visualisers/LevelSelection.h b/src/visualisers/LevelSelection.h
index 1070a54..5eb8a71 100644
--- a/src/visualisers/LevelSelection.h
+++ b/src/visualisers/LevelSelection.h
@@ -68,7 +68,7 @@ public:
     virtual void set(const LevelSelectionInterface&) {}
     
 	virtual void calculate(double, double, bool) {};
-	virtual double reference() const;
+	virtual double reference(int) const;
 	virtual void thinLevels(int frequency, vector<double>&) const;
 protected:
 	//! Method to print string about this class on to a stream of type ostream (virtual).
diff --git a/src/visualisers/ObsItemFamily.cc b/src/visualisers/ObsItemFamily.cc
index 1c87e95..81be867 100644
--- a/src/visualisers/ObsItemFamily.cc
+++ b/src/visualisers/ObsItemFamily.cc
@@ -71,7 +71,7 @@ void ObsWind::operator()( CustomisedPoint& point, ComplexSymbol& symbol) const
 
 	FlagItem* flag = new FlagItem();
 	flag->setColour(colour);
-	flag->length(owner_->size_ * 1.5); // Size to be adjusted later!
+	flag->length(owner_->size_ * 2.5); // Size to be adjusted later!
 
 	const string origin = "circle";
 
@@ -133,7 +133,7 @@ void ObsCloudAndWind::operator()( CustomisedPoint& point, ComplexSymbol& symbol)
 
 	FlagItem* flag = new FlagItem();
 	flag->setColour(colour);
-	flag->length(owner_->size_ * 1.5); // Size to be adjusted later!
+	flag->length(owner_->size_ * 2.5); // Size to be adjusted later!
 
 	map<int, string>::const_iterator marker = origins_.find(int(point["cloud_amount"]));
 	const string origin = ( marker != origins_.end()) ? marker->second : "magics_13";
@@ -255,6 +255,8 @@ void ObsPressureTendency::operator()(CustomisedPoint& point, ComplexSymbol& symb
 	
 	// The Pressure tendancy is red if negative!
 	MagFont font("sansserif");
+	if ( value->second < 0 )
+		colour = Colour("red");
 	font.colour(( value->second < 0 ) ? Colour("red") :colour);
 
 	object->text(os.str());
diff --git a/src/visualisers/PolyShadingMethod.cc b/src/visualisers/PolyShadingMethod.cc
index 973a4e8..0323e00 100644
--- a/src/visualisers/PolyShadingMethod.cc
+++ b/src/visualisers/PolyShadingMethod.cc
@@ -43,12 +43,15 @@ void PolyShadingMethod::operator()(Polyline& poly) const
     {
        
 		int index = poly.index();
-		if (index < 0) 
+		if (index < 0  ) 
 			return;
         poly.setFilled(true);      
         poly.setStroke(false);
         poly.setFilled(true);
-        poly.setFillColour(colours_[index]);
+        if ( index >= colours_.size() )
+            poly.setFillColour(colours_.back());
+        else 
+            poly.setFillColour(colours_[index]);
         FillShadingProperties* shading = new FillShadingProperties();                      
         poly.setShading(shading);
     };
@@ -86,7 +89,8 @@ int PolyShadingMethod::leftIndex(double value)
 	if ( value < first_) return -1;
 	if ( same(value, first_) ) return -1;
 	if ( same(value, last_) )  return indexes_.size() -1;
-	return indexes_.find(value, -1) - 1;
+	int index = indexes_.find(value, -1);
+	return  ( index == -1 ) ? - 1 : index -1;
 
 }
 void PolyShadingMethod::prepare(const LevelSelection& levels, const ColourTechnique& colours)
diff --git a/src/visualisers/PolyShadingTechnique.h b/src/visualisers/PolyShadingTechnique.h
index 82d2fb0..679cc9d 100644
--- a/src/visualisers/PolyShadingTechnique.h
+++ b/src/visualisers/PolyShadingTechnique.h
@@ -38,7 +38,7 @@
 #include "DotPolyShadingMethod.h"
 #include "HatchPolyShadingMethod.h"
 #include "GridShadingAttributes.h"
-
+#include "ContourMethod.h"
 
 namespace magics {
     
@@ -118,11 +118,13 @@ public:
     	    		const Transformation& transformation, int width, int height,
     	    		float resolution, const string& technique);
     virtual bool needClipping() { return true; }
+    bool method(ContourMethod* method) { method = new ContourMethod(); return true; }
 protected:
      //! Method to print string about this class on to a stream of type ostream (virtual).
 	 void print(ostream&) const {}
 
 
+
 private:
     //! Copy constructor - No copy allowed
 	 GridShading(const GridShading&);
diff --git a/src/visualisers/SegmentJoiner.cc b/src/visualisers/SegmentJoiner.cc
index db4c76f..2ac413c 100644
--- a/src/visualisers/SegmentJoiner.cc
+++ b/src/visualisers/SegmentJoiner.cc
@@ -455,7 +455,7 @@ static double compute(SegmentJoiner::SegList& v,list<deque<Segment> >& lines)
     }
 #endif
     // For debugging
-    //if(true) check(lines);
+    if(true) SegmentJoiner::check(lines);
 
     //return total.elapsed();
     return 0;
@@ -510,6 +510,7 @@ double SegmentJoiner::computePolygonLines(vector<vector<Point> >& result)
         for(; j != p.end(); ++j) {
             w.push_back((*j).to_);
         }
+
     }
     return e;
 }
@@ -623,4 +624,39 @@ void SegmentJoiner::check(list<deque<Segment> >& lines)
 
 }
 
+class checker {
+    public:
+	checker(const Segment& seg ) : segment_(seg) {}
+       bool operator()(const Segment& other)
+       { return segment_.cancels(other); }
+    Segment segment_;
+};
+
+void SegmentJoiner::push_back(const Point& from, const Point& to)
+{
+	Segment add(from, to);
+	checker check(add);
+	deque<Segment>::iterator done =  std::remove_if(segments_.begin(), segments_.end(), check);
+
+	if ( done == segments_.end() )
+			 segments_.push_back(Segment(from,to));
+	else		{
+		segments_.erase(done, segments_.end());
+	}
+}
+
+void SegmentJoiner::push_back(const Segment& s)
+{
+	if((s.from_ == s.to_))
+		return;
+	checker check(s);
+   	deque<Segment>::iterator done =  std::remove_if(segments_.begin(), segments_.end(), check);
+
+	if ( done == segments_.end() )
+			 segments_.push_back(s);
+	else{
+
+		segments_.erase(done, segments_.end());
+	}
+}
 
diff --git a/src/visualisers/SegmentJoiner.h b/src/visualisers/SegmentJoiner.h
index a361e65..1d48938 100644
--- a/src/visualisers/SegmentJoiner.h
+++ b/src/visualisers/SegmentJoiner.h
@@ -111,14 +111,24 @@ public:
     size_t size() const
     { return segments_.size(); }
 
-    void push_back(const Segment& s)
+    void push_back(const Segment& s);
+
+    void add(const SegmentJoiner& other)
+    {
+    	for (SegList::const_iterator segment = other.segments_.begin(); segment != other.segments_.end(); ++segment)
+    	    push_back(*segment);
+    }
+    void print() const
     {
-        if(!(s.from_ == s.to_))
-            segments_.push_back(s);
+        cout << "---------Segment-----------" << endl;
+    	for (SegList::const_iterator segment = segments_.begin(); segment != segments_.end(); ++segment)
+    	   cout << *segment << " " << endl;
+        cout << "---------------------------" << endl;
     }
 
-    void push_back(const Point& from, const Point& to)
-    { segments_.push_back(Segment(from,to)); }
+
+    void push_back(const Point& from, const Point& to);
+
 
     void push_back(double x1, double y1, double x2, double y2)
     { segments_.push_back(Segment(Point(x1,y1),Point(x2,y2))); }
@@ -136,6 +146,7 @@ public:
 
     static bool pointInPoly(const Point&,const vector<Point>& p);
     static void check(list<deque<Segment> >& lines);
+    int index_;
 
 private:
 
diff --git a/src/visualisers/ShadingTechnique.h b/src/visualisers/ShadingTechnique.h
index 152ee1f..473359e 100644
--- a/src/visualisers/ShadingTechnique.h
+++ b/src/visualisers/ShadingTechnique.h
@@ -46,6 +46,7 @@ class BasicGraphicsObjectContainer;
 class Polyline;
 class CellArray;
 class Transformation;
+class ContourMethod;
 
 class ShadingTechnique  {
 
@@ -67,14 +68,14 @@ public:
     virtual void operator()(Polyline*) const {};
     virtual bool prepare(const LevelSelection&, const ColourTechnique&)  { return false; }   
     virtual void visit(LegendVisitor&, const ColourTechnique&) {}   
-    virtual int index(double) { assert(0); return -1; }
-    virtual int leftIndex(double) { assert(0); return -1; }
-    virtual int rightIndex(double) { assert(0); return -1; }
+    virtual int index(double) {  return -1; }
+    virtual int leftIndex(double) {  return -1; }
+    virtual int rightIndex(double) {  return -1; }
     virtual CellArray* array(MatrixHandler& matrix, IntervalMap<int>& range,
        		const Transformation& transformation, int width, int height,
-       		float resolution, const string& technique) { assert(0); }
+       		float resolution, const string& technique) { assert(0); return 0;}
     virtual bool needClipping() { return false; }
-   
+    virtual bool method(ContourMethod*) { return false; }
 protected:
      //! Method to print string about this class on to a stream of type ostream (virtual).
 	 virtual void print(ostream&) const {}
diff --git a/src/visualisers/SymbolAdvancedTableMode.cc b/src/visualisers/SymbolAdvancedTableMode.cc
index a551788..63b2f72 100644
--- a/src/visualisers/SymbolAdvancedTableMode.cc
+++ b/src/visualisers/SymbolAdvancedTableMode.cc
@@ -203,8 +203,8 @@ void SymbolAdvancedTableMode::visit(Data& data, LegendVisitor& legend)
 	legend.newLegend();
 	IntervalMap<SymbolProperties>::const_iterator last = map_.end();
 		    				--last;
-	IntervalMap<SymbolProperties>::reverse_iterator first = map_.rbegin();
-		    						    				++first;;
+	IntervalMap<SymbolProperties>::iterator first = map_.begin();
+
 	    	switch (legend.legendType())  {
 	    		case LegendMethod::CONTINUOUS:
 	    		{
@@ -226,7 +226,7 @@ void SymbolAdvancedTableMode::visit(Data& data, LegendVisitor& legend)
 	    		}
 	    		case LegendMethod::DISJOINT:
 	    		{
-	    			  for ( IntervalMap<SymbolProperties>::reverse_iterator interval = first; interval != map_.rend(); ++interval) {
+	    			  for ( IntervalMap<SymbolProperties>::iterator interval = first; interval != last; ++interval) {
 	    				Symbol* symbol = new Symbol();
 	    				(*symbol).setColour(interval->second.colour_);
 	    				(*symbol).setSymbol(interval->second.marker_);
diff --git a/src/visualisers/SymbolMode.cc b/src/visualisers/SymbolMode.cc
index 26c3d43..7e1ec7b 100644
--- a/src/visualisers/SymbolMode.cc
+++ b/src/visualisers/SymbolMode.cc
@@ -343,7 +343,7 @@ void SymbolTableMode::visit(Data& data, LegendVisitor& legend)
     		}
     		case LegendMethod::DISJOINT:
     		{
-    			  for ( IntervalMap<SymbolProperties>::reverse_iterator interval = map_.rbegin(); interval != map_.rend(); ++interval) {
+    			  for ( IntervalMap<SymbolProperties>::iterator interval = map_.begin(); interval != map_.end(); ++interval) {
     				Symbol* symbol = new Symbol();
     				(*symbol).setColour(interval->second.colour_);
     				(*symbol).setSymbol(interval->second.marker_);
diff --git a/src/visualisers/TephiGrid.cc b/src/visualisers/TephiGrid.cc
index d389cd3..02ef583 100644
--- a/src/visualisers/TephiGrid.cc
+++ b/src/visualisers/TephiGrid.cc
@@ -90,7 +90,7 @@ void TephiGrid::visit(DrawingVisitor& out)
 	const Transformation& tephi = out.transformation();
 	vector<double> tempe;
 	double maxpcx = (tephi.getMaxPCX() + (tephi.getMinPCX()*.25))/1.25;
-
+	double minpcx = tephi.getMinPCX();
 	PaperPoint lr(maxpcx, tephi.getMinPCY());
 	UserPoint xy;
 	tephi.revert(lr, xy);
@@ -114,8 +114,8 @@ void TephiGrid::visit(DrawingVisitor& out)
 
 	double thmin = magics::theta(tmin+273.15, pmin*100.)-237.15;
 	thmin = -100;
-	double thmax = magics::theta(tmax+273.15, pmax*100.) -237.15;
-	thmax = +200;
+	double thmax = magics::theta(tmin+273.15, pmax*100.) -237.15;
+	thmax = +450;
 
 
 
@@ -149,13 +149,14 @@ void TephiGrid::visit(DrawingVisitor& out)
 			if ( label == labels.end() )
 				continue;
 			UserPoint point(*t, pressureFromTheta(theta, *t+273.15)/100.);
-			if ( tephi.in(point) ) {
+			PaperPoint xy = tephi(point);
+			if ( tephi.in(xy) ) {
 				Text* text = new Text();
 
 				text->addText("T=" + tostring(*t), font);
 				text->setAngle(-3.14/4);
 				text->setBlanking(true);
-				text->push_back(tephi(point));
+				text->push_back(xy);
 				out.push_back(text);
 			}
 
@@ -217,11 +218,21 @@ void TephiGrid::visit(DrawingVisitor& out)
 				if ( label == labels.end() )
 					continue;
 				if (xy.x() >= maxpcx ) {
-					map<double, PaperPoint>::iterator label = pressureLabels_.find(*p);
-					if ( label == pressureLabels_.end() ) {
+					map<double, PaperPoint>::iterator label = pressureRightLabels_.find(*p);
+					if ( label == pressureRightLabels_.end() ) {
 						xy.x(tephi.getMinPCX()*0.75);
-						pressureLabels_.insert(make_pair(*p, xy));
+						pressureRightLabels_.insert(make_pair(*p, xy));
+					}
+				}
+				if (xy.x() <= minpcx ) {
+					xy.x(tephi.getMaxPCX()*0.85);
+					map<double, PaperPoint>::iterator label = pressureLeftLabels_.find(*p);
+					if ( label == pressureLeftLabels_.end() ) {
+						pressureLeftLabels_.insert(make_pair(*p, xy));
 					}
+					else
+						pressureLeftLabels_[*p] = xy;
+
 				}
 			}
 			tephi(poly, out.layout());
@@ -301,6 +312,7 @@ void TephiGrid::visit(DrawingVisitor& out)
 
 
 		for (std::set<double>::iterator  thetaw = sat.begin(); thetaw != sat.end(); ++thetaw ) {
+			if ( *thetaw > 65.) continue;
 			Polyline poly;
 			poly.setColour(*saturated_adiabatic_colour_);
 			poly.setLineStyle(saturated_adiabatic_style_);
@@ -308,7 +320,7 @@ void TephiGrid::visit(DrawingVisitor& out)
 			double s = thetaEq(*thetaw+273.15, *thetaw+273.15, 1000*100);
 
 			double pl = -1;
-			for ( double p = pmin; p < pmax; p += 1) {
+			for ( double p = 200; p < pmax; p += 1) {
 				double t = temperatureFromThetaEq(s, p*100)-273.15;
 				if (t >= -40 )
 					poly.push_back(tephi(UserPoint(t, p)));
@@ -345,8 +357,20 @@ void TephiGrid::print(ostream& out)  const
 }
 void TephiGrid::visit(LeftAxisVisitor& out)
 {
+	MagFont font(isobar_label_font_, isobar_label_style_, isobar_label_size_);
+
+		font.colour(*isobar_label_colour_);
 
+		for (map<double, PaperPoint>::iterator label = pressureLeftLabels_.begin(); label != pressureLeftLabels_.end(); ++label) {
 
+			Text *text= new Text();
+			text->setText(tostring(label->first));
+			text->setFont(font);
+			text->setBlanking(true);
+			text->setJustification(MRIGHT);
+			text->push_back(label->second);
+			out.push_back(text);
+		}
 }
 void TephiGrid::visit(RightAxisVisitor& out)
 {
@@ -354,7 +378,7 @@ void TephiGrid::visit(RightAxisVisitor& out)
 
 	font.colour(*isobar_label_colour_);
 
-	for (map<double, PaperPoint>::iterator label = pressureLabels_.begin(); label != pressureLabels_.end(); ++label) {
+	for (map<double, PaperPoint>::iterator label = pressureRightLabels_.begin(); label != pressureRightLabels_.end(); ++label) {
 
 		Text *text= new Text();
 		text->setText(tostring(label->first));
@@ -375,7 +399,7 @@ void TephiGrid::visit(BottomAxisVisitor& out)
 
 
 		Text *text= new Text();
-		text->setText(tostring(label->first));
+		text->setText(tostring(label->first*10.));
 		text->setFont(font);
 		text->setBlanking(true);
 
diff --git a/src/visualisers/TephiGrid.h b/src/visualisers/TephiGrid.h
index ff832a9..db7b1f6 100644
--- a/src/visualisers/TephiGrid.h
+++ b/src/visualisers/TephiGrid.h
@@ -59,7 +59,8 @@ public:
 protected:
      //! Method to print string about this class on to a stream of type ostream (virtual).
 	 virtual void print(ostream&) const; 
-	 map<double, PaperPoint> pressureLabels_;
+	 map<double, PaperPoint> pressureRightLabels_;
+	 map<double, PaperPoint> pressureLeftLabels_;
 	 map<double, PaperPoint> mixingLabels_;
 	 map<double, PaperPoint> isothermLabels_;
 	 map<double, PaperPoint> isothetaLabels_;
diff --git a/src/visualisers/WindPlotting.cc b/src/visualisers/WindPlotting.cc
index b0a0ae9..47d83a0 100644
--- a/src/visualisers/WindPlotting.cc
+++ b/src/visualisers/WindPlotting.cc
@@ -37,6 +37,7 @@ using namespace magics;
 map<string,  WindPlotting::AdvancedMethod > WindPlotting::methods_;
 map<string,  WindPlotting::ColouringMethod > WindPlotting::colouringMethods_;
 map<string,  WindPlotting::MinMaxMethod > WindPlotting::minMaxMethods_;
+map<string,  WindPlotting::SettingMethod > WindPlotting::settingMethods_;
 
 WindPlotting::WindPlotting() : legendOnly_(false)
 {
@@ -51,6 +52,11 @@ WindPlotting::WindPlotting() : legendOnly_(false)
 			minMaxMethods_["advanced"] =&WindPlotting::advancedMinMax;
 			minMaxMethods_["off"] = &WindPlotting::offMinMax;
 		}
+	if ( settingMethods_.empty() ) {
+			settingMethods_["on"] = &WindPlotting::setAdvanced;
+			settingMethods_["advanced"] =&WindPlotting::setAdvanced;
+			settingMethods_["off"] = &WindPlotting::setNormal;
+		}
 	if ( colouringMethods_.empty() ) {
 		colouringMethods_["speed"] = &WindPlotting::speed;
 		colouringMethods_["parameter"] = &WindPlotting::parameter; 
@@ -69,7 +75,28 @@ void WindPlotting::offMinMax(double& min, double& max)
 	if ( max > maxSpeed() )
 		max = maxSpeed();
 }
+void WindPlotting::setAdvanced(double& min, double& max)
+{
+
+	advancedMinMax(min, max);
+	levels_->set(*this);
+	colourMethod_->set(*this);
+	levels_->calculate(min, max, false);
+	LevelSelection::const_iterator level = levels_->begin();
+	colourMethod_->prepare(*levels_);
+	Colour last;
+	map_.clear();
+	while ( true) {
+		if (level+1 == levels_->end() ) break;
+		MagLog::debug() << "[" << *level << ", " << *(level+1) << "]=" << colourMethod_->right(*level) << endl;
+		map_[ Interval(*level, *(level+1)) ] = colourMethod_->right(*level);
+		last = colourMethod_->right(*level);
+		++level;
+	}
+	// we add a last small one for the maax
+	map_[ Interval(levels_->back(), levels_->back() + epsilon) ] = last;
 
+}
 
 void WindPlotting::adjust( CustomisedPointsList& points, const Transformation& transformation)
 {
@@ -87,31 +114,18 @@ void WindPlotting::adjust( CustomisedPointsList& points, const Transformation& t
 
 	double min = *std::min_element(values.begin(), values.end());
 	double max = *std::max_element(values.begin(), values.end());
-	if ( same(min, max) ) return;
+
 	string value = lowerCase(advanced_method_);
-	map<string,  MinMaxMethod >::const_iterator method = minMaxMethods_.find(value);
-	if  ( method ==  minMaxMethods_.end() ) {
-		MagLog::warning() << advanced_method_ << " is not valid value for  'wind_advanced_method': reset to default[off]" << endl;
-		offMinMax(min, max);
-	}
-	else
-		(this->*method->second)(min, max);
-	levels_->set(*this);	
-	colourMethod_->set(*this);
-	levels_->calculate(min, max, false);
-	LevelSelection::const_iterator level = levels_->begin();
-	colourMethod_->prepare(*levels_);
-	Colour last;
-	map_.clear();
-	 while ( true) {
-	    	if (level+1 == levels_->end() ) break;
-	    	MagLog::debug() << "[" << *level << ", " << *(level+1) << "]=" << colourMethod_->right(*level) << endl;
-	    	map_[ Interval(*level, *(level+1)) ] = colourMethod_->right(*level);
-	    	last = colourMethod_->right(*level);
-	    	++level;
-	 }
-	 // we add a last small one for the maax
-	 map_[ Interval(levels_->back(), levels_->back() + epsilon) ] = last;
+
+
+
+	map<string,  SettingMethod >::const_iterator set = settingMethods_.find(value);
+		if  ( set ==  settingMethods_.end() ) {
+			MagLog::warning() << advanced_method_ << " is not valid value for  'wind_advanced_method': reset to default[off]" << endl;
+			setNormal(min,max);
+		}
+		else
+			(this->*set->second)(min, max);
 
 }
 
@@ -130,11 +144,13 @@ Colour& WindPlotting::colour(Colour& colour, double x, double y, double col)
 
 double WindPlotting::parameter(double, double, double col)
 {
+
 	return col;
 }
 
 double WindPlotting::speed(double x, double y, double)
 {
+
 	return sqrt(x*x+y*y);
 }
 
@@ -153,6 +169,7 @@ double WindPlotting::value(double x, double y, double col)
 Colour& WindPlotting::advanced(Colour& colour, double u, double v, double col)
 {
 	static Colour x("red");
+
 	x = map_.find(value(u, v, col), colour);
 	return x;
 }
@@ -160,9 +177,14 @@ Colour& WindPlotting::advanced(Colour& colour, double u, double v, double col)
 void WindPlotting::visit(LegendVisitor& legend)
 {
 	if ( !legend_ )
-			return;
-	if (magCompare(advanced_method_, "advanced") ||  magCompare(advanced_method_, "on") ) {
+		return;
 
+	if (magCompare(advanced_method_, "advanced") ||  magCompare(advanced_method_, "on") ) {
+		legend.newLegend();
+		if   ( map_.empty() ) {
+			// no legend to plot
+			return;
+		}
 		IntervalMap<Colour>::const_iterator interval;
 		IntervalMap<Colour>::const_iterator last =  map_.end();
 		--last;
diff --git a/src/visualisers/WindPlotting.h b/src/visualisers/WindPlotting.h
index ebd8ed9..869a34f 100644
--- a/src/visualisers/WindPlotting.h
+++ b/src/visualisers/WindPlotting.h
@@ -94,12 +94,18 @@ protected:
 	 typedef Colour& (WindPlotting::*AdvancedMethod)(Colour&, double, double, double);
 	 typedef double (WindPlotting::*ColouringMethod)(double, double, double);
 	 typedef void (WindPlotting::*MinMaxMethod)(double&, double&);
+	 typedef void (WindPlotting::*SettingMethod)(double&, double&);
 	 static map<string,  WindPlotting::AdvancedMethod > methods_;
 	 static map<string,  WindPlotting::ColouringMethod > colouringMethods_;
 	 static map<string,  WindPlotting::MinMaxMethod > minMaxMethods_;
+	 static map<string,  WindPlotting::SettingMethod > settingMethods_;
+
+	 void setAdvanced(double&, double&);
+	 void setNormal(double&, double&) {}
+
 	 IntervalMap<Colour>  map_;
-	 virtual double minSpeed() { assert(false); }
-	 virtual double maxSpeed() { assert(false); }
+	 virtual double minSpeed() { assert(false); return 0;}
+	 virtual double maxSpeed() { assert(false); return 0;}
 	 
 
 private:
diff --git a/src/web/CMakeLists.txt b/src/web/CMakeLists.txt
index 2f30185..801fe1d 100644
--- a/src/web/CMakeLists.txt
+++ b/src/web/CMakeLists.txt
@@ -1,7 +1,8 @@
 set( _web_srcs
 MagJSon.cc   ObsJSon.cc   WrepJSon.h      json_spirit_reader.h   json_spirit_value.h
 MagConfig.cc    MagJSon.h    ObsJSon.h    json_spirit.h           json_spirit_utils.h    json_spirit_writer.cpp
-MagConfig.h     WrepJSon.cc  json_spirit_reader.cpp  json_spirit_value.cpp  json_spirit_writer.h
+MagConfig.h     WrepJSon.cc  json_spirit_reader.cpp  json_spirit_value.cpp  json_spirit_writer.h json_spirit_writer_options.h
+
  )
 
 foreach( file ${_web_srcs} )
diff --git a/src/web/WrepJSon.cc b/src/web/WrepJSon.cc
index 44beaa9..e1bed2a 100644
--- a/src/web/WrepJSon.cc
+++ b/src/web/WrepJSon.cc
@@ -42,6 +42,7 @@
 using namespace magics;
 using namespace json_spirit;
 
+static map<char, string> specials;
 
 WrepJSon::WrepJSon()  : missing_(-9999),
 		height_(-9999),
@@ -98,6 +99,85 @@ WrepJSon::WrepJSon()  : missing_(-9999),
 	xdate_ = false;
 	ydate_ = false;
 
+    if ( specials.empty() ) {
+        specials['\242'] = "¢"; 
+        specials['\243'] = "£"; 
+        specials['\244'] = "€"; 
+        specials['\245'] = "¥"; 
+        specials['\260'] = "°"; 
+        specials['\274'] = "&frac14;"; 
+        specials['\274'] = "Œ"; 
+        specials['\275'] = "&frac12;"; 
+        specials['\275'] = "œ"; 
+        specials['\276'] = "&frac34;"; 
+        specials['\276'] = "Ÿ"; 
+        specials['\241'] = "¡"; 
+        specials['\253'] = "«"; 
+        specials['\273'] = "»"; 
+        specials['\277'] = "¿"; 
+        specials['\300'] = "À"; 
+        specials['\301'] = "Á"; 
+        specials['\302'] = "Â"; 
+        specials['\303'] = "Ã"; 
+        specials['\304'] = "Ä"; 
+        specials['\305'] = "Å"; 
+        specials['\306'] = "Æ"; 
+        specials['\307'] = "Ç"; 
+        specials['\310'] = "È"; 
+        specials['\311'] = "É"; 
+        specials['\312'] = "Ê"; 
+        specials['\313'] = "Ë"; 
+        specials['\314'] = "Ì"; 
+        specials['\315'] = "Í"; 
+        specials['\316'] = "Î"; 
+        specials['\317'] = "Ï"; 
+        specials['\320'] = "Ð"; 
+        specials['\321'] = "Ñ"; 
+        specials['\322'] = "Ò"; 
+        specials['\323'] = "Ó"; 
+        specials['\324'] = "Ô"; 
+        specials['\325'] = "Õ"; 
+        specials['\326'] = "Ö"; 
+        specials['\330'] = "Ø"; 
+        specials['\331'] = "Ù"; 
+        specials['\332'] = "Ú"; 
+        specials['\333'] = "Û"; 
+        specials['\334'] = "Ü"; 
+        specials['\335'] = "Ý"; 
+        specials['\336'] = "Þ"; 
+        specials['\337'] = "ß"; 
+        specials['\340'] = "à"; 
+        specials['\341'] = "á"; 
+        specials['\342'] = "â"; 
+        specials['\343'] = "ã"; 
+        specials['\344'] = "ä"; 
+        specials['\345'] = "å"; 
+        specials['\346'] = "æ"; 
+        specials['\347'] = "ç"; 
+        specials['\350'] = "è"; 
+        specials['\351'] = "é"; 
+        specials['\352'] = "ê"; 
+        specials['\353'] = "ë"; 
+        specials['\354'] = "ì"; 
+        specials['\355'] = "í"; 
+        specials['\356'] = "î"; 
+        specials['\357'] = "ï"; 
+        specials['\360'] = "ð"; 
+        specials['\361'] = "ñ"; 
+        specials['\362'] = "ò"; 
+        specials['\363'] = "ó"; 
+        specials['\364'] = "ô"; 
+        specials['\365'] = "õ"; 
+        specials['\366'] = "ö"; 
+        specials['\370'] = "ø"; 
+        specials['\371'] = "ù"; 
+        specials['\372'] = "ú"; 
+        specials['\373'] = "û"; 
+        specials['\374'] = "ü"; 
+        specials['\375'] = "ý"; 
+        specials['\376'] = "þ"; 
+      }
+
 }
 
 WrepJSon::~WrepJSon()
@@ -407,7 +487,7 @@ void WrepJSon::profile()
 			}
 
 		}
-		// Test for tephigram
+		// Test for thermo
 		if ( (*point)["y"] > 100. )
 			points_.push_back(point);
 	}
@@ -525,12 +605,19 @@ void WrepJSon::location(const json_spirit::Value& value )
 }
 void WrepJSon::station_name(const json_spirit::Value& value )
 {
-
+    string station;
 	if  ( value.type() == str_type )
-		station_name_ = value.get_value<string>();
-
+		station = value.get_value<string>();
 
 
+    for ( string::iterator c = station.begin(); c != station.end(); ++c) {
+        map<char, string>::iterator s = specials.find(*c);
+        if ( s != specials.end()  ) {
+            station_name_ += s->second;
+        }
+        else 
+           station_name_ += *c;
+    }
 }
 void WrepJSon::epsz(const json_spirit::Value& value)
 {
@@ -611,6 +698,9 @@ void WrepJSon::parameter(const json_spirit::Value& value)
 	        		for (unsigned int i = 0; i < values.size(); i++) {
 
 	        			double val = values[i].get_value<double>();
+	        			if ( same(val, 0 ))  {
+                            val = 0;
+                        }
 	        			if ( val != missing_ ) {
 	        				val = (val * scaling_factor_) + offset_factor_;
 	        				if ( val < miny_) miny_ = val;
@@ -1155,7 +1245,8 @@ json_spirit::Value WrepJSon::height()
 }
 void WrepJSon::visit(TextVisitor& text)
 {
-
+	if ( !title_ )
+		return;
 	DateTime base(date_, time_);
 
 	if (param_info_ != "none")
diff --git a/src/web/json_spirit.h b/src/web/json_spirit.h
index 46f0936..2363ff6 100644
--- a/src/web/json_spirit.h
+++ b/src/web/json_spirit.h
@@ -1,12 +1,10 @@
-#ifndef JASON_SPIRIT
-#define JASON_SPIRIT
+#ifndef JSON_SPIRIT
+#define JSON_SPIRIT
 
-/* Copyright (c) 2007-2009 John W Wilkinson
+//          Copyright John W. Wilkinson 2007 - 2013
+// Distributed under the MIT License, see accompanying file LICENSE.txt
 
-   This source code can be used for any purpose as long as
-   this comment is retained. */
-
-// json spirit version 4.00
+// json spirit version 4.06
 
 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
 # pragma once
diff --git a/src/web/json_spirit.vcproj b/src/web/json_spirit.vcproj
new file mode 100644
index 0000000..0cbe0ef
--- /dev/null
+++ b/src/web/json_spirit.vcproj
@@ -0,0 +1,213 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="json_spirit_lib"
+	ProjectGUID="{BE262A86-CC26-4B25-A877-883ED2688CEC}"
+	RootNamespace="json_spirit"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions="&#x0D;&#x0A;"
+				Optimization="0"
+				PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="3"
+				DisableLanguageExtensions="false"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				EnableIntrinsicFunctions="false"
+				FavorSizeOrSpeed="0"
+				PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
+				RuntimeLibrary="2"
+				BufferSecurityCheck="false"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath=".\json_spirit_reader.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\json_spirit_writer.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+			<File
+				RelativePath=".\json_spirit.h"
+				>
+			</File>
+			<File
+				RelativePath=".\json_spirit_error_position.h"
+				>
+			</File>
+			<File
+				RelativePath=".\json_spirit_reader.h"
+				>
+			</File>
+			<File
+				RelativePath=".\json_spirit_reader_template.h"
+				>
+			</File>
+			<File
+				RelativePath=".\json_spirit_stream_reader.h"
+				>
+			</File>
+			<File
+				RelativePath=".\json_spirit_utils.h"
+				>
+			</File>
+			<File
+				RelativePath=".\json_spirit_value.h"
+				>
+			</File>
+			<File
+				RelativePath=".\json_spirit_writer.h"
+				>
+			</File>
+			<File
+				RelativePath=".\json_spirit_writer_options.h"
+				>
+			</File>
+			<File
+				RelativePath=".\json_spirit_writer_template.h"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
diff --git a/src/web/json_spirit_error_position.h b/src/web/json_spirit_error_position.h
new file mode 100644
index 0000000..6a97bf1
--- /dev/null
+++ b/src/web/json_spirit_error_position.h
@@ -0,0 +1,54 @@
+#ifndef JSON_SPIRIT_ERROR_POSITION
+#define JSON_SPIRIT_ERROR_POSITION
+
+//          Copyright John W. Wilkinson 2007 - 2013
+// Distributed under the MIT License, see accompanying file LICENSE.txt
+
+// json spirit version 4.06
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+#include <string>
+
+namespace json_spirit
+{
+    // An Error_position exception is thrown by the "read_or_throw" functions below on finding an error.
+    // Note the "read_or_throw" functions are around 3 times slower than the standard functions "read" 
+    // functions that return a bool.
+    //
+    struct Error_position
+    {
+        Error_position();
+        Error_position( unsigned int line, unsigned int column, const std::string& reason );
+        bool operator==( const Error_position& lhs ) const;
+        unsigned int line_;
+        unsigned int column_;
+        std::string reason_;
+    };
+
+    inline Error_position::Error_position()
+    :   line_( 0 )
+    ,   column_( 0 )
+    {
+    }
+
+    inline Error_position::Error_position( unsigned int line, unsigned int column, const std::string& reason )
+    :   line_( line )
+    ,   column_( column )
+    ,   reason_( reason )
+    {
+    }
+
+    inline bool Error_position::operator==( const Error_position& lhs ) const
+    {
+        if( this == &lhs ) return true;
+
+        return ( reason_ == lhs.reason_ ) &&
+               ( line_   == lhs.line_ ) &&
+               ( column_ == lhs.column_ ); 
+    }
+}
+
+#endif
diff --git a/src/web/json_spirit_reader.cpp b/src/web/json_spirit_reader.cpp
index 38c2e0c..ad4c40b 100644
--- a/src/web/json_spirit_reader.cpp
+++ b/src/web/json_spirit_reader.cpp
@@ -1,755 +1,137 @@
-/* Copyright (c) 2007-2009 John W Wilkinson
+//          Copyright John W. Wilkinson 2007 - 2013
+// Distributed under the MIT License, see accompanying file LICENSE.txt
 
-   This source code can be used for any purpose as long as
-   this comment is retained. */
-
-// json spirit version 4.00
+// json spirit version 4.06
 
 #include "json_spirit_reader.h"
-#include "json_spirit_value.h"
-
-//#define BOOST_SPIRIT_THREADSAFE  // uncomment for multithreaded use, requires linking to boost.thead
-
-#include <boost/bind.hpp>
-#include <boost/function.hpp>
-#include <boost/version.hpp>
-
-#if BOOST_VERSION >= 103800
-    #include <boost/spirit/include/classic_core.hpp>
-    #include <boost/spirit/include/classic_confix.hpp>
-    #include <boost/spirit/include/classic_escape_char.hpp>
-    #include <boost/spirit/include/classic_multi_pass.hpp>
-    #include <boost/spirit/include/classic_position_iterator.hpp>
-    using namespace boost::spirit::classic;
-#else
-    #include <boost/spirit/core.hpp>
-    #include <boost/spirit/utility/confix.hpp>
-    #include <boost/spirit/utility/escape_char.hpp>
-    #include <boost/spirit/iterator/multi_pass.hpp>
-    #include <boost/spirit/iterator/position_iterator.hpp>
-    using namespace boost::spirit;
-#endif
+#include "json_spirit_reader_template.h"
 
 using namespace json_spirit;
-using namespace std;
-using namespace boost;
-
-//
-
-Error_position::Error_position()
-:   line_( 0 )
-,   column_( 0 )
-{
-}
-
-Error_position::Error_position( unsigned int line, unsigned int column, const std::string& reason )
-:   line_( line )
-,   column_( column )
-,   reason_( reason )
-{
-}
-
-bool Error_position::operator==( const Error_position& lhs ) const
-{
-    if( this == &lhs ) return true;
-
-    return ( reason_ == lhs.reason_ ) &&
-           ( line_   == lhs.line_ ) &&
-           ( column_ == lhs.column_ );
-}
 
-//
-
-namespace
-{
-    const int_parser < int64_t >  int64_p  = int_parser < int64_t  >();
-    const uint_parser< uint64_t > uint64_p = uint_parser< uint64_t >();
-
-    template< class Iter_type >
-    bool is_eq( Iter_type first, Iter_type last, const char* c_str )
+#ifdef JSON_SPIRIT_VALUE_ENABLED
+    bool json_spirit::read( const std::string& s, Value& value )
     {
-        for( Iter_type i = first; i != last; ++i, ++c_str )
-        {
-            if( *c_str == 0 ) return false;
-
-            if( *i != *c_str ) return false;
-        }
-
-        return true;
+        return read_string( s, value );
     }
-
-    template< class Char_type >
-    Char_type hex_to_num( const Char_type c )
+    
+    void json_spirit::read_or_throw( const std::string& s, Value& value )
     {
-        if( ( c >= '0' ) && ( c <= '9' ) ) return c - '0';
-        if( ( c >= 'a' ) && ( c <= 'f' ) ) return c - 'a' + 10;
-        if( ( c >= 'A' ) && ( c <= 'F' ) ) return c - 'A' + 10;
-        return 0;
+        read_string_or_throw( s, value );
     }
 
-    template< class Char_type, class Iter_type >
-    Char_type hex_str_to_char( Iter_type& begin )
+    bool json_spirit::read( std::istream& is, Value& value )
     {
-        const Char_type c1( *( ++begin ) );
-        const Char_type c2( *( ++begin ) );
-
-        return ( hex_to_num( c1 ) << 4 ) + hex_to_num( c2 );
+        return read_stream( is, value );
     }
 
-    template< class Char_type, class Iter_type >
-    Char_type unicode_str_to_char( Iter_type& begin )
+    void json_spirit::read_or_throw( std::istream& is, Value& value )
     {
-        const Char_type c1( *( ++begin ) );
-        const Char_type c2( *( ++begin ) );
-        const Char_type c3( *( ++begin ) );
-        const Char_type c4( *( ++begin ) );
-
-        return ( hex_to_num( c1 ) << 12 ) +
-               ( hex_to_num( c2 ) <<  8 ) +
-               ( hex_to_num( c3 ) <<  4 ) +
-               hex_to_num( c4 );
+        read_stream_or_throw( is, value );
     }
 
-    template< class String_type >
-    void append_esc_char_and_incr_iter( String_type& s,
-                                        typename String_type::const_iterator& begin,
-                                        typename String_type::const_iterator end )
+    bool json_spirit::read( std::string::const_iterator& begin, std::string::const_iterator end, Value& value )
     {
-        typedef typename String_type::value_type Char_type;
-
-        const Char_type c2( *begin );
-
-        switch( c2 )
-        {
-            case 't':  s += '\t'; break;
-            case 'b':  s += '\b'; break;
-            case 'f':  s += '\f'; break;
-            case 'n':  s += '\n'; break;
-            case 'r':  s += '\r'; break;
-            case '\\': s += '\\'; break;
-            case '/':  s += '/';  break;
-            case '"':  s += '"';  break;
-            case 'x':
-            {
-                if( end - begin >= 3 )  //  expecting "xHH..."
-                {
-                    s += hex_str_to_char< Char_type >( begin );
-                }
-                break;
-            }
-            case 'u':
-            {
-                if( end - begin >= 5 )  //  expecting "uHHHH..."
-                {
-                    s += unicode_str_to_char< Char_type >( begin );
-                }
-                break;
-            }
-        }
+        return read_range( begin, end, value );
     }
 
-    template< class String_type >
-    String_type substitute_esc_chars( typename String_type::const_iterator begin,
-                                   typename String_type::const_iterator end )
+    void json_spirit::read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, Value& value )
     {
-        typedef typename String_type::const_iterator Iter_type;
-
-        if( end - begin < 2 ) return String_type( begin, end );
-
-        String_type result;
-
-        result.reserve( end - begin );
-
-        const Iter_type end_minus_1( end - 1 );
-
-        Iter_type substr_start = begin;
-        Iter_type i = begin;
-
-        for( ; i < end_minus_1; ++i )
-        {
-            if( *i == '\\' )
-            {
-                result.append( substr_start, i );
-
-                ++i;  // skip the '\'
-
-                append_esc_char_and_incr_iter( result, i, end );
-
-                substr_start = i + 1;
-            }
-        }
-
-        result.append( substr_start, end );
-
-        return result;
+        begin = read_range_or_throw( begin, end, value );
     }
+#endif
 
-    template< class String_type >
-    String_type get_str_( typename String_type::const_iterator begin,
-                       typename String_type::const_iterator end )
+#if defined( JSON_SPIRIT_WVALUE_ENABLED ) && !defined( BOOST_NO_STD_WSTRING )
+    bool json_spirit::read( const std::wstring& s, wValue& value )
     {
-        assert( end - begin >= 2 );
-
-        typedef typename String_type::const_iterator Iter_type;
-
-        Iter_type str_without_quotes( ++begin );
-        Iter_type end_without_quotes( --end );
-
-        return substitute_esc_chars< String_type >( str_without_quotes, end_without_quotes );
+        return read_string( s, value );
     }
 
-    string get_str( string::const_iterator begin, string::const_iterator end )
+    void json_spirit::read_or_throw( const std::wstring& s, wValue& value )
     {
-        return get_str_< string >( begin, end );
+        read_string_or_throw( s, value );
     }
 
-    wstring get_str( wstring::const_iterator begin, wstring::const_iterator end )
+    bool json_spirit::read( std::wistream& is, wValue& value )
     {
-        return get_str_< wstring >( begin, end );
+        return read_stream( is, value );
     }
 
-    template< class String_type, class Iter_type >
-    String_type get_str( Iter_type begin, Iter_type end )
+    void json_spirit::read_or_throw( std::wistream& is, wValue& value )
     {
-        const String_type tmp( begin, end );  // convert multipass iterators to string iterators
-
-        return get_str( tmp.begin(), tmp.end() );
+        read_stream_or_throw( is, value );
     }
 
-    // this class's methods get called by the spirit parse resulting
-    // in the creation of a JSON object or array
-    //
-    // NB Iter_type could be a std::string iterator, wstring iterator, a position iterator or a multipass iterator
-    //
-    template< class Value_type, class Iter_type >
-    class Semantic_actions
+    bool json_spirit::read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wValue& value )
     {
-    public:
-
-        typedef typename Value_type::Config_type Config_type;
-        typedef typename Config_type::String_type String_type;
-        typedef typename Config_type::Object_type Object_type;
-        typedef typename Config_type::Array_type Array_type;
-        typedef typename String_type::value_type Char_type;
-
-        Semantic_actions( Value_type& value )
-        :   value_( value )
-        ,   current_p_( 0 )
-        {
-        }
-
-        void begin_obj( Char_type c )
-        {
-            assert( c == '{' );
-
-            begin_compound< Object_type >();
-        }
-
-        void end_obj( Char_type c )
-        {
-            assert( c == '}' );
-
-            end_compound();
-        }
-
-        void begin_array( Char_type c )
-        {
-            assert( c == '[' );
-
-            begin_compound< Array_type >();
-       }
-
-        void end_array( Char_type c )
-        {
-            assert( c == ']' );
-
-            end_compound();
-        }
-
-        void new_name( Iter_type begin, Iter_type end )
-        {
-            assert( current_p_->type() == obj_type );
-
-            name_ = get_str< String_type >( begin, end );
-        }
-
-        void new_str( Iter_type begin, Iter_type end )
-        {
-            add_to_current( get_str< String_type >( begin, end ) );
-        }
-
-        void new_true( Iter_type begin, Iter_type end )
-        {
-            assert( is_eq( begin, end, "true" ) );
-
-            add_to_current( true );
-        }
-
-        void new_false( Iter_type begin, Iter_type end )
-        {
-            assert( is_eq( begin, end, "false" ) );
-
-            add_to_current( false );
-        }
-
-        void new_null( Iter_type begin, Iter_type end )
-        {
-            assert( is_eq( begin, end, "null" ) );
-
-            add_to_current( Value_type() );
-        }
-
-        void new_int( int64_t i )
-        {
-            add_to_current( i );
-        }
-
-        void new_uint64( uint64_t ui )
-        {
-            add_to_current( ui );
-        }
-
-        void new_real( double d )
-        {
-            add_to_current( d );
-        }
-
-    private:
-
-        Value_type* add_first( const Value_type& value )
-        {
-            assert( current_p_ == 0 );
-
-            value_ = value;
-            current_p_ = &value_;
-            return current_p_;
-        }
-
-        template< class Array_or_obj >
-        void begin_compound()
-        {
-            if( current_p_ == 0 )
-            {
-                add_first( Array_or_obj() );
-            }
-            else
-            {
-                stack_.push_back( current_p_ );
-
-                Array_or_obj new_array_or_obj;   // avoid copy by building new array or object in place
-
-                current_p_ = add_to_current( new_array_or_obj );
-            }
-        }
-
-        void end_compound()
-        {
-            if( current_p_ != &value_ )
-            {
-                current_p_ = stack_.back();
-
-                stack_.pop_back();
-            }
-        }
-
-        Value_type* add_to_current( const Value_type& value )
-        {
-            if( current_p_ == 0 )
-            {
-                return add_first( value );
-            }
-            else if( current_p_->type() == array_type )
-            {
-                current_p_->get_array().push_back( value );
-
-                return &current_p_->get_array().back();
-            }
-
-            assert( current_p_->type() == obj_type );
-
-            return &Config_type::add( current_p_->get_obj(), name_, value );
-        }
-
-        Value_type& value_;             // this is the object or array that is being created
-        Value_type* current_p_;         // the child object or array that is currently being constructed
-
-        vector< Value_type* > stack_;   // previous child objects and arrays
-
-        String_type name_;              // of current name/value pair
-    };
+        return read_range( begin, end, value );
+    }
 
-    template< typename Iter_type >
-    void throw_error( position_iterator< Iter_type > i, const std::string& reason )
+    void json_spirit::read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wValue& value )
     {
-        throw Error_position( i.get_position().line, i.get_position().column, reason );
+        begin = read_range_or_throw( begin, end, value );
     }
+#endif
 
-    template< typename Iter_type >
-    void throw_error( Iter_type i, const std::string& reason )
+#ifdef JSON_SPIRIT_MVALUE_ENABLED
+    bool json_spirit::read( const std::string& s, mValue& value )
     {
-       throw reason;
+        return read_string( s, value );
     }
 
-    // the spirit grammer
-    //
-    template< class Value_type, class Iter_type >
-    class Json_grammer : public grammar< Json_grammer< Value_type, Iter_type > >
+    void json_spirit::read_or_throw( const std::string& s, mValue& value )
     {
-    public:
-
-        typedef Semantic_actions< Value_type, Iter_type > Semantic_actions_t;
-
-        Json_grammer( Semantic_actions_t& semantic_actions )
-        :   actions_( semantic_actions )
-        {
-        }
-
-        static void throw_not_value( Iter_type begin, Iter_type end )
-        {
-    	    throw_error( begin, "not a value" );
-        }
-
-        static void throw_not_array( Iter_type begin, Iter_type end )
-        {
-    	    throw_error( begin, "not an array" );
-        }
-
-        static void throw_not_object( Iter_type begin, Iter_type end )
-        {
-    	    throw_error( begin, "not an object" );
-        }
-
-        static void throw_not_pair( Iter_type begin, Iter_type end )
-        {
-    	    throw_error( begin, "not a pair" );
-        }
-
-        static void throw_not_colon( Iter_type begin, Iter_type end )
-        {
-    	    throw_error( begin, "no colon in pair" );
-        }
-
-        static void throw_not_string( Iter_type begin, Iter_type end )
-        {
-    	    throw_error( begin, "not a string" );
-        }
-
-        template< typename ScannerT >
-        struct definition
-        {
-            definition( const Json_grammer& self )
-            {
-                typedef typename Value_type::String_type::value_type Char_type;
-
-                // first we convert the semantic action class methods to functors with the
-                // parameter signature expected by spirit
-
-                typedef boost::function< void( Char_type )            > Char_action;
-                typedef boost::function< void( Iter_type, Iter_type ) > Str_action;
-                typedef boost::function< void( double )               > Real_action;
-                typedef boost::function< void( int64_t )              > Int_action;
-                typedef boost::function< void( uint64_t )             > Uint64_action;
-
-                Char_action   begin_obj  ( bind( &Semantic_actions_t::begin_obj,   &self.actions_, _1 ) );
-                Char_action   end_obj    ( bind( &Semantic_actions_t::end_obj,     &self.actions_, _1 ) );
-                Char_action   begin_array( bind( &Semantic_actions_t::begin_array, &self.actions_, _1 ) );
-                Char_action   end_array  ( bind( &Semantic_actions_t::end_array,   &self.actions_, _1 ) );
-                Str_action    new_name   ( bind( &Semantic_actions_t::new_name,    &self.actions_, _1, _2 ) );
-                Str_action    new_str    ( bind( &Semantic_actions_t::new_str,     &self.actions_, _1, _2 ) );
-                Str_action    new_true   ( bind( &Semantic_actions_t::new_true,    &self.actions_, _1, _2 ) );
-                Str_action    new_false  ( bind( &Semantic_actions_t::new_false,   &self.actions_, _1, _2 ) );
-                Str_action    new_null   ( bind( &Semantic_actions_t::new_null,    &self.actions_, _1, _2 ) );
-                Real_action   new_real   ( bind( &Semantic_actions_t::new_real,    &self.actions_, _1 ) );
-                Int_action    new_int    ( bind( &Semantic_actions_t::new_int,     &self.actions_, _1 ) );
-                Uint64_action new_uint64 ( bind( &Semantic_actions_t::new_uint64,  &self.actions_, _1 ) );
-
-                // actual grammer
-
-                json_
-                    = value_ | eps_p[ &throw_not_value ]
-                    ;
-
-                value_
-                    = string_[ new_str ]
-                    | number_
-                    | object_
-                    | array_
-                    | str_p( "true" ) [ new_true  ]
-                    | str_p( "false" )[ new_false ]
-                    | str_p( "null" ) [ new_null  ]
-                    ;
-
-                object_
-                    = ch_p('{')[ begin_obj ]
-                    >> !members_
-                    >> ( ch_p('}')[ end_obj ] | eps_p[ &throw_not_object ] )
-                    ;
-
-                members_
-                    = pair_ >> *( ',' >> pair_ )
-                    ;
-
-                pair_
-                    = string_[ new_name ]
-                    >> ( ':' | eps_p[ &throw_not_colon ] )
-                    >> ( value_ | eps_p[ &throw_not_value ] )
-                    ;
-
-                array_
-                    = ch_p('[')[ begin_array ]
-                    >> !elements_
-                    >> ( ch_p(']')[ end_array ] | eps_p[ &throw_not_array ] )
-                    ;
-
-                elements_
-                    = value_ >> *( ',' >> value_ )
-                    ;
-
-                string_
-                    = lexeme_d // this causes white space inside a string to be retained
-                      [
-                          confix_p
-                          (
-                              '"',
-                              *lex_escape_ch_p,
-                              '"'
-                          )
-                      ]
-                    ;
-
-                number_
-                    = strict_real_p[ new_real   ]
-                    | int64_p      [ new_int    ]
-                    | uint64_p     [ new_uint64 ]
-                    ;
-            }
-
-            rule< ScannerT > json_, object_, members_, pair_, array_, elements_, value_, string_, number_;
-
-            const rule< ScannerT >& start() const { return json_; }
-        };
-
-        Semantic_actions_t& actions_;
-    };
-
-    template< class Iter_type, class Value_type >
-    Iter_type read_range_or_throw( Iter_type begin, Iter_type end, Value_type& value )
+        read_string_or_throw( s, value );
+    }
+    
+    bool json_spirit::read( std::istream& is, mValue& value )
     {
-        Semantic_actions< Value_type, Iter_type > semantic_actions( value );
-
-        const parse_info< Iter_type > info = parse( begin, end,
-                                                    Json_grammer< Value_type, Iter_type >( semantic_actions ),
-                                                    space_p );
-
-        if( !info.hit )
-        {
-            assert( false ); // in theory MagException should already have been thrown
-            throw_error( info.stop, "error" );
-        }
-
-        return info.stop;
+        return read_stream( is, value );
     }
 
-    template< class Iter_type, class Value_type >
-    void add_posn_iter_and_read_range_or_throw( Iter_type begin, Iter_type end, Value_type& value )
+    void json_spirit::read_or_throw( std::istream& is, mValue& value )
     {
-        typedef position_iterator< Iter_type > Posn_iter_t;
-
-        const Posn_iter_t posn_begin( begin, end );
-        const Posn_iter_t posn_end( end, end );
-
-        read_range_or_throw( posn_begin, posn_end, value );
+        read_stream_or_throw( is, value );
     }
 
-    template< class Iter_type, class Value_type >
-    bool read_range( Iter_type& begin, Iter_type end, Value_type& value )
+    bool json_spirit::read( std::string::const_iterator& begin, std::string::const_iterator end, mValue& value )
     {
-        try
-        {
-            begin = read_range_or_throw( begin, end, value );
-
-            return true;
-        }
-        catch( ... )
-        {
-            return false;
-        }
+        return read_range( begin, end, value );
     }
 
-    template< class String_type, class Value_type >
-    void read_string_or_throw( const String_type& s, Value_type& value )
+    void json_spirit::read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, mValue& value )
     {
-        add_posn_iter_and_read_range_or_throw( s.begin(), s.end(), value );
+        begin = read_range_or_throw( begin, end, value );
     }
+#endif
 
-    template< class String_type, class Value_type >
-    bool read_string( const String_type& s, Value_type& value )
+#if defined( JSON_SPIRIT_WMVALUE_ENABLED ) && !defined( BOOST_NO_STD_WSTRING )
+    bool json_spirit::read( const std::wstring& s, wmValue& value )
     {
-        typename String_type::const_iterator begin = s.begin();
-
-        return read_range( begin, s.end(), value );
+        return read_string( s, value );
     }
 
-    template< class Istream_type >
-    struct Multi_pass_iters
+    void json_spirit::read_or_throw( const std::wstring& s, wmValue& value )
     {
-        typedef typename Istream_type::char_type Char_type;
-        typedef istream_iterator< Char_type, Char_type > istream_iter;
-        typedef multi_pass< istream_iter > multi_pass_iter;
-
-        Multi_pass_iters( Istream_type& is )
-        {
-            is.unsetf( ios::skipws );
-
-            begin_ = make_multi_pass( istream_iter( is ) );
-            end_   = make_multi_pass( istream_iter() );
-        }
-
-        multi_pass_iter begin_;
-        multi_pass_iter end_;
-    };
+        read_string_or_throw( s, value );
+    }
 
-    template< class Istream_type, class Value_type >
-    bool read_stream( Istream_type& is, Value_type& value )
+    bool json_spirit::read( std::wistream& is, wmValue& value )
     {
-        Multi_pass_iters< Istream_type > mp_iters( is );
-
-        return read_range( mp_iters.begin_, mp_iters.end_, value );
+        return read_stream( is, value );
     }
 
-    template< class Istream_type, class Value_type >
-    void read_stream_or_throw( Istream_type& is, Value_type& value )
+    void json_spirit::read_or_throw( std::wistream& is, wmValue& value )
     {
-        const Multi_pass_iters< Istream_type > mp_iters( is );
-
-        add_posn_iter_and_read_range_or_throw( mp_iters.begin_, mp_iters.end_, value );
+        read_stream_or_throw( is, value );
     }
-}
-
-bool json_spirit::read( const std::string& s, Value& value )
-{
-    return read_string( s, value );
-}
-
-void json_spirit::read_or_throw( const std::string& s, Value& value )
-{
-    read_string_or_throw( s, value );
-}
-
-bool json_spirit::read( std::istream& is, Value& value )
-{
-    return read_stream( is, value );
-}
-
-void json_spirit::read_or_throw( std::istream& is, Value& value )
-{
-    read_stream_or_throw( is, value );
-}
-
-bool json_spirit::read( std::string::const_iterator& begin, std::string::const_iterator end, Value& value )
-{
-    return read_range( begin, end, value );
-}
-
-void json_spirit::read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, Value& value )
-{
-    begin = read_range_or_throw( begin, end, value );
-}
-
-#ifndef BOOST_NO_STD_WSTRING
-
-bool json_spirit::read( const std::wstring& s, wValue& value )
-{
-    return read_string( s, value );
-}
-
-void json_spirit::read_or_throw( const std::wstring& s, wValue& value )
-{
-    read_string_or_throw( s, value );
-}
-
-bool json_spirit::read( std::wistream& is, wValue& value )
-{
-    return read_stream( is, value );
-}
-
-void json_spirit::read_or_throw( std::wistream& is, wValue& value )
-{
-    read_stream_or_throw( is, value );
-}
-
-bool json_spirit::read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wValue& value )
-{
-    return read_range( begin, end, value );
-}
-
-void json_spirit::read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wValue& value )
-{
-    begin = read_range_or_throw( begin, end, value );
-}
 
-#endif
-
-bool json_spirit::read( const std::string& s, mValue& value )
-{
-    return read_string( s, value );
-}
-
-void json_spirit::read_or_throw( const std::string& s, mValue& value )
-{
-    read_string_or_throw( s, value );
-}
-
-bool json_spirit::read( std::istream& is, mValue& value )
-{
-    return read_stream( is, value );
-}
-
-void json_spirit::read_or_throw( std::istream& is, mValue& value )
-{
-    read_stream_or_throw( is, value );
-}
-
-bool json_spirit::read( std::string::const_iterator& begin, std::string::const_iterator end, mValue& value )
-{
-    return read_range( begin, end, value );
-}
-
-void json_spirit::read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, mValue& value )
-{
-    begin = read_range_or_throw( begin, end, value );
-}
-
-#ifndef BOOST_NO_STD_WSTRING
-
-bool json_spirit::read( const std::wstring& s, wmValue& value )
-{
-    return read_string( s, value );
-}
-
-void json_spirit::read_or_throw( const std::wstring& s, wmValue& value )
-{
-    read_string_or_throw( s, value );
-}
-
-bool json_spirit::read( std::wistream& is, wmValue& value )
-{
-    return read_stream( is, value );
-}
-
-void json_spirit::read_or_throw( std::wistream& is, wmValue& value )
-{
-    read_stream_or_throw( is, value );
-}
-
-bool json_spirit::read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wmValue& value )
-{
-    return read_range( begin, end, value );
-}
-
-void json_spirit::read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wmValue& value )
-{
-    begin = read_range_or_throw( begin, end, value );
-}
+    bool json_spirit::read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wmValue& value )
+    {
+        return read_range( begin, end, value );
+    }
 
+    void json_spirit::read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wmValue& value )
+    {
+        begin = read_range_or_throw( begin, end, value );
+    }
 #endif
diff --git a/src/web/json_spirit_reader.h b/src/web/json_spirit_reader.h
index a6bb306..b2594b8 100644
--- a/src/web/json_spirit_reader.h
+++ b/src/web/json_spirit_reader.h
@@ -1,76 +1,61 @@
-#ifndef JASON_SPIRIT_READER
-#define JASON_SPIRIT_READER
+#ifndef JSON_SPIRIT_READER
+#define JSON_SPIRIT_READER
 
-/* Copyright (c) 2007-2009 John W Wilkinson
+//          Copyright John W. Wilkinson 2007 - 2013
+// Distributed under the MIT License, see accompanying file LICENSE.txt
 
-   json spirit version 4.00
-
-   This source code can be used for any purpose as long as
-   this comment is retained. */
+// json spirit version 4.06
 
 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
 # pragma once
 #endif
 
 #include "json_spirit_value.h"
+#include "json_spirit_error_position.h"
 #include <iostream>
 
 namespace json_spirit
 {
-    // An Error_position MagException is thrown by the "read_or_throw" functions below on finding an error.
-    // Note the "read_or_throw" functions are around 3 times slower than the standard functions "read" 
-    // functions that return a bool.
-    //
-    struct Error_position
-    {
-        Error_position();
-        Error_position( unsigned int line, unsigned int column, const std::string& reason );
-        bool operator==( const Error_position& lhs ) const;
-        unsigned int line_;
-        unsigned int column_;
-        std::string reason_;
-    };
-
     // functions to reads a JSON values
 
+#ifdef JSON_SPIRIT_VALUE_ENABLED
     bool read( const std::string& s, Value& value );
-    bool read( std::istream&  is,    Value& value );
+    bool read( std::istream& is,     Value& value );
     bool read( std::string::const_iterator& begin, std::string::const_iterator end, Value& value );
 
     void read_or_throw( const std::string& s, Value& value );  
-    void read_or_throw( std::istream&  is,    Value& value );
+    void read_or_throw( std::istream& is,     Value& value );
     void read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, Value& value );
+#endif
 
-#ifndef BOOST_NO_STD_WSTRING
-
+#if defined( JSON_SPIRIT_WVALUE_ENABLED ) && !defined( BOOST_NO_STD_WSTRING )
     bool read( const std::wstring& s, wValue& value );
     bool read( std::wistream&  is,    wValue& value );
     bool read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wValue& value );    
 
     void read_or_throw( const std::wstring& s, wValue& value );
-    void read_or_throw( std::wistream&  is,    wValue& value );
+    void read_or_throw( std::wistream& is,     wValue& value );
     void read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wValue& value );
-
 #endif
 
+#ifdef JSON_SPIRIT_MVALUE_ENABLED
     bool read( const std::string& s, mValue& value );
-    bool read( std::istream&  is,    mValue& value );
+    bool read( std::istream& is,     mValue& value );
     bool read( std::string::const_iterator& begin, std::string::const_iterator end, mValue& value );
 
     void read_or_throw( const std::string& s, mValue& value );  
-    void read_or_throw( std::istream&  is,    mValue& value );
+    void read_or_throw( std::istream& is,     mValue& value );
     void read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, mValue& value );
+#endif
 
-#ifndef BOOST_NO_STD_WSTRING
-
+#if defined( JSON_SPIRIT_WMVALUE_ENABLED ) && !defined( BOOST_NO_STD_WSTRING )
     bool read( const std::wstring& s, wmValue& value );
-    bool read( std::wistream&  is,    wmValue& value );
+    bool read( std::wistream& is,     wmValue& value );
     bool read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wmValue& value );    
 
     void read_or_throw( const std::wstring& s, wmValue& value );
-    void read_or_throw( std::wistream&  is,    wmValue& value );
+    void read_or_throw( std::wistream& is,     wmValue& value );
     void read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wmValue& value );
-
 #endif
 }
 
diff --git a/src/web/json_spirit_reader.cpp b/src/web/json_spirit_reader_template.h
similarity index 61%
copy from src/web/json_spirit_reader.cpp
copy to src/web/json_spirit_reader_template.h
index 38c2e0c..a067970 100644
--- a/src/web/json_spirit_reader.cpp
+++ b/src/web/json_spirit_reader_template.h
@@ -1,14 +1,19 @@
-/* Copyright (c) 2007-2009 John W Wilkinson
+#ifndef JSON_SPIRIT_READER_TEMPLATE
+#define JSON_SPIRIT_READER_TEMPLATE
 
-   This source code can be used for any purpose as long as
-   this comment is retained. */
+//          Copyright John W. Wilkinson 2007 - 2013
+// Distributed under the MIT License, see accompanying file LICENSE.txt
 
-// json spirit version 4.00
+// json spirit version 4.06
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
 
-#include "json_spirit_reader.h"
 #include "json_spirit_value.h"
+#include "json_spirit_error_position.h"
 
-//#define BOOST_SPIRIT_THREADSAFE  // uncomment for multithreaded use, requires linking to boost.thead
+//#define BOOST_SPIRIT_THREADSAFE  // uncomment for multithreaded use, requires linking to boost.thread
 
 #include <boost/bind.hpp>
 #include <boost/function.hpp>
@@ -20,50 +25,20 @@
     #include <boost/spirit/include/classic_escape_char.hpp>
     #include <boost/spirit/include/classic_multi_pass.hpp>
     #include <boost/spirit/include/classic_position_iterator.hpp>
-    using namespace boost::spirit::classic;
+    #define spirit_namespace boost::spirit::classic
 #else
     #include <boost/spirit/core.hpp>
     #include <boost/spirit/utility/confix.hpp>
     #include <boost/spirit/utility/escape_char.hpp>
     #include <boost/spirit/iterator/multi_pass.hpp>
     #include <boost/spirit/iterator/position_iterator.hpp>
-    using namespace boost::spirit;
+    #define spirit_namespace boost::spirit
 #endif
 
-using namespace json_spirit;
-using namespace std;
-using namespace boost;
-
-//
-
-Error_position::Error_position()
-:   line_( 0 )
-,   column_( 0 )
-{
-}
-
-Error_position::Error_position( unsigned int line, unsigned int column, const std::string& reason )
-:   line_( line )
-,   column_( column )
-,   reason_( reason )
-{
-}
-
-bool Error_position::operator==( const Error_position& lhs ) const
-{
-    if( this == &lhs ) return true;
-
-    return ( reason_ == lhs.reason_ ) &&
-           ( line_   == lhs.line_ ) &&
-           ( column_ == lhs.column_ );
-}
-
-//
-
-namespace
+namespace json_spirit
 {
-    const int_parser < int64_t >  int64_p  = int_parser < int64_t  >();
-    const uint_parser< uint64_t > uint64_p = uint_parser< uint64_t >();
+    const spirit_namespace::int_parser < boost::int64_t >  int64_p  = spirit_namespace::int_parser < boost::int64_t  >();
+    const spirit_namespace::uint_parser< boost::uint64_t > uint64_p = spirit_namespace::uint_parser< boost::uint64_t >();
 
     template< class Iter_type >
     bool is_eq( Iter_type first, Iter_type last, const char* c_str )
@@ -94,7 +69,7 @@ namespace
         const Char_type c2( *( ++begin ) );
 
         return ( hex_to_num( c1 ) << 4 ) + hex_to_num( c2 );
-    }
+    }       
 
     template< class Char_type, class Iter_type >
     Char_type unicode_str_to_char( Iter_type& begin )
@@ -104,19 +79,19 @@ namespace
         const Char_type c3( *( ++begin ) );
         const Char_type c4( *( ++begin ) );
 
-        return ( hex_to_num( c1 ) << 12 ) +
-               ( hex_to_num( c2 ) <<  8 ) +
-               ( hex_to_num( c3 ) <<  4 ) +
+        return ( hex_to_num( c1 ) << 12 ) + 
+               ( hex_to_num( c2 ) <<  8 ) + 
+               ( hex_to_num( c3 ) <<  4 ) + 
                hex_to_num( c4 );
     }
 
     template< class String_type >
-    void append_esc_char_and_incr_iter( String_type& s,
-                                        typename String_type::const_iterator& begin,
+    void append_esc_char_and_incr_iter( String_type& s, 
+                                        typename String_type::const_iterator& begin, 
                                         typename String_type::const_iterator end )
     {
         typedef typename String_type::value_type Char_type;
-
+             
         const Char_type c2( *begin );
 
         switch( c2 )
@@ -129,19 +104,19 @@ namespace
             case '\\': s += '\\'; break;
             case '/':  s += '/';  break;
             case '"':  s += '"';  break;
-            case 'x':
+            case 'x':  
             {
                 if( end - begin >= 3 )  //  expecting "xHH..."
                 {
-                    s += hex_str_to_char< Char_type >( begin );
+                    s += hex_str_to_char< Char_type >( begin );  
                 }
                 break;
             }
-            case 'u':
+            case 'u':  
             {
                 if( end - begin >= 5 )  //  expecting "uHHHH..."
                 {
-                    s += unicode_str_to_char< Char_type >( begin );
+                    s += unicode_str_to_char< Char_type >( begin );  
                 }
                 break;
             }
@@ -149,7 +124,7 @@ namespace
     }
 
     template< class String_type >
-    String_type substitute_esc_chars( typename String_type::const_iterator begin,
+    String_type substitute_esc_chars( typename String_type::const_iterator begin, 
                                    typename String_type::const_iterator end )
     {
         typedef typename String_type::const_iterator Iter_type;
@@ -157,7 +132,7 @@ namespace
         if( end - begin < 2 ) return String_type( begin, end );
 
         String_type result;
-
+        
         result.reserve( end - begin );
 
         const Iter_type end_minus_1( end - 1 );
@@ -172,7 +147,7 @@ namespace
                 result.append( substr_start, i );
 
                 ++i;  // skip the '\'
-
+             
                 append_esc_char_and_incr_iter( result, i, end );
 
                 substr_start = i + 1;
@@ -185,7 +160,7 @@ namespace
     }
 
     template< class String_type >
-    String_type get_str_( typename String_type::const_iterator begin,
+    String_type get_str_( typename String_type::const_iterator begin, 
                        typename String_type::const_iterator end )
     {
         assert( end - begin >= 2 );
@@ -198,16 +173,16 @@ namespace
         return substitute_esc_chars< String_type >( str_without_quotes, end_without_quotes );
     }
 
-    string get_str( string::const_iterator begin, string::const_iterator end )
+    inline std::string get_str( std::string::const_iterator begin, std::string::const_iterator end )
     {
-        return get_str_< string >( begin, end );
+        return get_str_< std::string >( begin, end );
     }
 
-    wstring get_str( wstring::const_iterator begin, wstring::const_iterator end )
+    inline std::wstring get_str( std::wstring::const_iterator begin, std::wstring::const_iterator end )
     {
-        return get_str_< wstring >( begin, end );
+        return get_str_< std::wstring >( begin, end );
     }
-
+    
     template< class String_type, class Iter_type >
     String_type get_str( Iter_type begin, Iter_type end )
     {
@@ -222,7 +197,7 @@ namespace
     // NB Iter_type could be a std::string iterator, wstring iterator, a position iterator or a multipass iterator
     //
     template< class Value_type, class Iter_type >
-    class Semantic_actions
+    class Semantic_actions 
     {
     public:
 
@@ -255,9 +230,9 @@ namespace
         void begin_array( Char_type c )
         {
             assert( c == '[' );
-
+     
             begin_compound< Array_type >();
-       }
+        }
 
         void end_array( Char_type c )
         {
@@ -299,12 +274,12 @@ namespace
             add_to_current( Value_type() );
         }
 
-        void new_int( int64_t i )
+        void new_int( boost::int64_t i )
         {
             add_to_current( i );
         }
 
-        void new_uint64( uint64_t ui )
+        void new_uint64( boost::uint64_t ui )
         {
             add_to_current( ui );
         }
@@ -316,6 +291,9 @@ namespace
 
     private:
 
+        Semantic_actions& operator=( const Semantic_actions& ); 
+                                    // to prevent "assignment operator could not be generated" warning
+
         Value_type* add_first( const Value_type& value )
         {
             assert( current_p_ == 0 );
@@ -347,9 +325,9 @@ namespace
             if( current_p_ != &value_ )
             {
                 current_p_ = stack_.back();
-
+                
                 stack_.pop_back();
-            }
+            }    
         }
 
         Value_type* add_to_current( const Value_type& value )
@@ -362,9 +340,9 @@ namespace
             {
                 current_p_->get_array().push_back( value );
 
-                return &current_p_->get_array().back();
+                return &current_p_->get_array().back(); 
             }
-
+            
             assert( current_p_->type() == obj_type );
 
             return &Config_type::add( current_p_->get_obj(), name_, value );
@@ -373,13 +351,13 @@ namespace
         Value_type& value_;             // this is the object or array that is being created
         Value_type* current_p_;         // the child object or array that is currently being constructed
 
-        vector< Value_type* > stack_;   // previous child objects and arrays
+        std::vector< Value_type* > stack_;   // previous child objects and arrays
 
         String_type name_;              // of current name/value pair
     };
 
     template< typename Iter_type >
-    void throw_error( position_iterator< Iter_type > i, const std::string& reason )
+    void throw_error( spirit_namespace::position_iterator< Iter_type > i, const std::string& reason )
     {
         throw Error_position( i.get_position().line, i.get_position().column, reason );
     }
@@ -390,10 +368,10 @@ namespace
        throw reason;
     }
 
-    // the spirit grammer
+    // the spirit grammer 
     //
     template< class Value_type, class Iter_type >
-    class Json_grammer : public grammar< Json_grammer< Value_type, Iter_type > >
+    class Json_grammer : public spirit_namespace::grammar< Json_grammer< Value_type, Iter_type > >
     {
     public:
 
@@ -435,33 +413,37 @@ namespace
         }
 
         template< typename ScannerT >
-        struct definition
+        class definition
         {
+        public:
+
             definition( const Json_grammer& self )
             {
+                using namespace spirit_namespace;
+
                 typedef typename Value_type::String_type::value_type Char_type;
 
-                // first we convert the semantic action class methods to functors with the
+                // first we convert the semantic action class methods to functors with the 
                 // parameter signature expected by spirit
 
                 typedef boost::function< void( Char_type )            > Char_action;
                 typedef boost::function< void( Iter_type, Iter_type ) > Str_action;
                 typedef boost::function< void( double )               > Real_action;
-                typedef boost::function< void( int64_t )              > Int_action;
-                typedef boost::function< void( uint64_t )             > Uint64_action;
-
-                Char_action   begin_obj  ( bind( &Semantic_actions_t::begin_obj,   &self.actions_, _1 ) );
-                Char_action   end_obj    ( bind( &Semantic_actions_t::end_obj,     &self.actions_, _1 ) );
-                Char_action   begin_array( bind( &Semantic_actions_t::begin_array, &self.actions_, _1 ) );
-                Char_action   end_array  ( bind( &Semantic_actions_t::end_array,   &self.actions_, _1 ) );
-                Str_action    new_name   ( bind( &Semantic_actions_t::new_name,    &self.actions_, _1, _2 ) );
-                Str_action    new_str    ( bind( &Semantic_actions_t::new_str,     &self.actions_, _1, _2 ) );
-                Str_action    new_true   ( bind( &Semantic_actions_t::new_true,    &self.actions_, _1, _2 ) );
-                Str_action    new_false  ( bind( &Semantic_actions_t::new_false,   &self.actions_, _1, _2 ) );
-                Str_action    new_null   ( bind( &Semantic_actions_t::new_null,    &self.actions_, _1, _2 ) );
-                Real_action   new_real   ( bind( &Semantic_actions_t::new_real,    &self.actions_, _1 ) );
-                Int_action    new_int    ( bind( &Semantic_actions_t::new_int,     &self.actions_, _1 ) );
-                Uint64_action new_uint64 ( bind( &Semantic_actions_t::new_uint64,  &self.actions_, _1 ) );
+                typedef boost::function< void( boost::int64_t )       > Int_action;
+                typedef boost::function< void( boost::uint64_t )      > Uint64_action;
+
+                Char_action   begin_obj  ( boost::bind( &Semantic_actions_t::begin_obj,   &self.actions_, _1 ) );
+                Char_action   end_obj    ( boost::bind( &Semantic_actions_t::end_obj,     &self.actions_, _1 ) );
+                Char_action   begin_array( boost::bind( &Semantic_actions_t::begin_array, &self.actions_, _1 ) );
+                Char_action   end_array  ( boost::bind( &Semantic_actions_t::end_array,   &self.actions_, _1 ) );
+                Str_action    new_name   ( boost::bind( &Semantic_actions_t::new_name,    &self.actions_, _1, _2 ) );
+                Str_action    new_str    ( boost::bind( &Semantic_actions_t::new_str,     &self.actions_, _1, _2 ) );
+                Str_action    new_true   ( boost::bind( &Semantic_actions_t::new_true,    &self.actions_, _1, _2 ) );
+                Str_action    new_false  ( boost::bind( &Semantic_actions_t::new_false,   &self.actions_, _1, _2 ) );
+                Str_action    new_null   ( boost::bind( &Semantic_actions_t::new_null,    &self.actions_, _1, _2 ) );
+                Real_action   new_real   ( boost::bind( &Semantic_actions_t::new_real,    &self.actions_, _1 ) );
+                Int_action    new_int    ( boost::bind( &Semantic_actions_t::new_int,     &self.actions_, _1 ) );
+                Uint64_action new_uint64 ( boost::bind( &Semantic_actions_t::new_uint64,  &self.actions_, _1 ) );
 
                 // actual grammer
 
@@ -470,16 +452,16 @@ namespace
                     ;
 
                 value_
-                    = string_[ new_str ]
-                    | number_
-                    | object_
-                    | array_
-                    | str_p( "true" ) [ new_true  ]
-                    | str_p( "false" )[ new_false ]
+                    = string_[ new_str ] 
+                    | number_ 
+                    | object_ 
+                    | array_ 
+                    | str_p( "true" ) [ new_true  ] 
+                    | str_p( "false" )[ new_false ] 
                     | str_p( "null" ) [ new_null  ]
                     ;
 
-                object_
+                object_ 
                     = ch_p('{')[ begin_obj ]
                     >> !members_
                     >> ( ch_p('}')[ end_obj ] | eps_p[ &throw_not_object ] )
@@ -505,62 +487,104 @@ namespace
                     = value_ >> *( ',' >> value_ )
                     ;
 
-                string_
-                    = lexeme_d // this causes white space inside a string to be retained
+                string_ 
+                    = lexeme_d // this causes white space and what would appear to be comments inside a string to be retained
                       [
                           confix_p
-                          (
-                              '"',
+                          ( 
+                              '"', 
                               *lex_escape_ch_p,
                               '"'
-                          )
+                          ) 
                       ]
                     ;
 
                 number_
-                    = strict_real_p[ new_real   ]
+                    = strict_real_p[ new_real   ] 
                     | int64_p      [ new_int    ]
                     | uint64_p     [ new_uint64 ]
                     ;
             }
 
-            rule< ScannerT > json_, object_, members_, pair_, array_, elements_, value_, string_, number_;
+            spirit_namespace::rule< ScannerT > json_, object_, members_, pair_, array_, elements_, value_, string_, number_;
 
-            const rule< ScannerT >& start() const { return json_; }
+            const spirit_namespace::rule< ScannerT >& start() const { return json_; }
         };
 
+    private:
+
+        Json_grammer& operator=( const Json_grammer& ); // to prevent "assignment operator could not be generated" warning
+
         Semantic_actions_t& actions_;
     };
 
     template< class Iter_type, class Value_type >
-    Iter_type read_range_or_throw( Iter_type begin, Iter_type end, Value_type& value )
+    void add_posn_iter_and_read_range_or_throw( Iter_type begin, Iter_type end, Value_type& value )
     {
-        Semantic_actions< Value_type, Iter_type > semantic_actions( value );
+        typedef spirit_namespace::position_iterator< Iter_type > Posn_iter_t;
 
-        const parse_info< Iter_type > info = parse( begin, end,
-                                                    Json_grammer< Value_type, Iter_type >( semantic_actions ),
-                                                    space_p );
+        const Posn_iter_t posn_begin( begin, end );
+        const Posn_iter_t posn_end( end, end );
+     
+        read_range_or_throw( posn_begin, posn_end, value );
+    }
 
-        if( !info.hit )
+    template< class Istream_type >
+    struct Multi_pass_iters
+    {
+        typedef typename Istream_type::char_type Char_type;
+        typedef std::istream_iterator< Char_type, Char_type > istream_iter;
+        typedef spirit_namespace::multi_pass< istream_iter > Mp_iter;
+
+        Multi_pass_iters( Istream_type& is )
         {
-            assert( false ); // in theory MagException should already have been thrown
-            throw_error( info.stop, "error" );
+            is.unsetf( std::ios::skipws );
+
+            begin_ = spirit_namespace::make_multi_pass( istream_iter( is ) );
+            end_   = spirit_namespace::make_multi_pass( istream_iter() );
         }
 
-        return info.stop;
-    }
+        Mp_iter begin_;
+        Mp_iter end_;
+    };
 
+    // reads a JSON Value from a pair of input iterators throwing an exception on invalid input, e.g.
+    //
+    // string::const_iterator start = str.begin();
+    // const string::const_iterator next = read_range_or_throw( str.begin(), str.end(), value );
+    //
+    // The iterator 'next' will point to the character past the 
+    // last one read.
+    //
     template< class Iter_type, class Value_type >
-    void add_posn_iter_and_read_range_or_throw( Iter_type begin, Iter_type end, Value_type& value )
+    Iter_type read_range_or_throw( Iter_type begin, Iter_type end, Value_type& value )
     {
-        typedef position_iterator< Iter_type > Posn_iter_t;
+        Semantic_actions< Value_type, Iter_type > semantic_actions( value );
+     
+        const spirit_namespace::parse_info< Iter_type > info = 
+                            spirit_namespace::parse( begin, end, 
+                                                    Json_grammer< Value_type, Iter_type >( semantic_actions ), 
+                                                    spirit_namespace::space_p | 
+                                                    spirit_namespace::comment_p("//") | 
+                                                    spirit_namespace::comment_p("/*", "*/") );
 
-        const Posn_iter_t posn_begin( begin, end );
-        const Posn_iter_t posn_end( end, end );
+        if( !info.hit )
+        {
+            assert( false ); // in theory exception should already have been thrown
+            throw_error( info.stop, "error" );
+        }
 
-        read_range_or_throw( posn_begin, posn_end, value );
+        return info.stop;
     }
 
+    // reads a JSON Value from a pair of input iterators, e.g.
+    //
+    // string::const_iterator start = str.begin();
+    // const bool success = read_string( start, str.end(), value );
+    //
+    // The iterator 'start' will point to the character past the 
+    // last one read.
+    //
     template< class Iter_type, class Value_type >
     bool read_range( Iter_type& begin, Iter_type end, Value_type& value )
     {
@@ -576,12 +600,10 @@ namespace
         }
     }
 
-    template< class String_type, class Value_type >
-    void read_string_or_throw( const String_type& s, Value_type& value )
-    {
-        add_posn_iter_and_read_range_or_throw( s.begin(), s.end(), value );
-    }
-
+    // reads a JSON Value from a string, e.g.
+    //
+    // const bool success = read_string( str, value );
+    //
     template< class String_type, class Value_type >
     bool read_string( const String_type& s, Value_type& value )
     {
@@ -590,25 +612,20 @@ namespace
         return read_range( begin, s.end(), value );
     }
 
-    template< class Istream_type >
-    struct Multi_pass_iters
+    // reads a JSON Value from a string throwing an exception on invalid input, e.g.
+    //
+    // read_string_or_throw( is, value );
+    //
+    template< class String_type, class Value_type >
+    void read_string_or_throw( const String_type& s, Value_type& value )
     {
-        typedef typename Istream_type::char_type Char_type;
-        typedef istream_iterator< Char_type, Char_type > istream_iter;
-        typedef multi_pass< istream_iter > multi_pass_iter;
-
-        Multi_pass_iters( Istream_type& is )
-        {
-            is.unsetf( ios::skipws );
-
-            begin_ = make_multi_pass( istream_iter( is ) );
-            end_   = make_multi_pass( istream_iter() );
-        }
-
-        multi_pass_iter begin_;
-        multi_pass_iter end_;
-    };
+        add_posn_iter_and_read_range_or_throw( s.begin(), s.end(), value );
+    }
 
+    // reads a JSON Value from a stream, e.g.
+    //
+    // const bool success = read_stream( is, value );
+    //
     template< class Istream_type, class Value_type >
     bool read_stream( Istream_type& is, Value_type& value )
     {
@@ -617,6 +634,10 @@ namespace
         return read_range( mp_iters.begin_, mp_iters.end_, value );
     }
 
+    // reads a JSON Value from a stream throwing an exception on invalid input, e.g.
+    //
+    // read_stream_or_throw( is, value );
+    //
     template< class Istream_type, class Value_type >
     void read_stream_or_throw( Istream_type& is, Value_type& value )
     {
@@ -626,130 +647,4 @@ namespace
     }
 }
 
-bool json_spirit::read( const std::string& s, Value& value )
-{
-    return read_string( s, value );
-}
-
-void json_spirit::read_or_throw( const std::string& s, Value& value )
-{
-    read_string_or_throw( s, value );
-}
-
-bool json_spirit::read( std::istream& is, Value& value )
-{
-    return read_stream( is, value );
-}
-
-void json_spirit::read_or_throw( std::istream& is, Value& value )
-{
-    read_stream_or_throw( is, value );
-}
-
-bool json_spirit::read( std::string::const_iterator& begin, std::string::const_iterator end, Value& value )
-{
-    return read_range( begin, end, value );
-}
-
-void json_spirit::read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, Value& value )
-{
-    begin = read_range_or_throw( begin, end, value );
-}
-
-#ifndef BOOST_NO_STD_WSTRING
-
-bool json_spirit::read( const std::wstring& s, wValue& value )
-{
-    return read_string( s, value );
-}
-
-void json_spirit::read_or_throw( const std::wstring& s, wValue& value )
-{
-    read_string_or_throw( s, value );
-}
-
-bool json_spirit::read( std::wistream& is, wValue& value )
-{
-    return read_stream( is, value );
-}
-
-void json_spirit::read_or_throw( std::wistream& is, wValue& value )
-{
-    read_stream_or_throw( is, value );
-}
-
-bool json_spirit::read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wValue& value )
-{
-    return read_range( begin, end, value );
-}
-
-void json_spirit::read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wValue& value )
-{
-    begin = read_range_or_throw( begin, end, value );
-}
-
-#endif
-
-bool json_spirit::read( const std::string& s, mValue& value )
-{
-    return read_string( s, value );
-}
-
-void json_spirit::read_or_throw( const std::string& s, mValue& value )
-{
-    read_string_or_throw( s, value );
-}
-
-bool json_spirit::read( std::istream& is, mValue& value )
-{
-    return read_stream( is, value );
-}
-
-void json_spirit::read_or_throw( std::istream& is, mValue& value )
-{
-    read_stream_or_throw( is, value );
-}
-
-bool json_spirit::read( std::string::const_iterator& begin, std::string::const_iterator end, mValue& value )
-{
-    return read_range( begin, end, value );
-}
-
-void json_spirit::read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, mValue& value )
-{
-    begin = read_range_or_throw( begin, end, value );
-}
-
-#ifndef BOOST_NO_STD_WSTRING
-
-bool json_spirit::read( const std::wstring& s, wmValue& value )
-{
-    return read_string( s, value );
-}
-
-void json_spirit::read_or_throw( const std::wstring& s, wmValue& value )
-{
-    read_string_or_throw( s, value );
-}
-
-bool json_spirit::read( std::wistream& is, wmValue& value )
-{
-    return read_stream( is, value );
-}
-
-void json_spirit::read_or_throw( std::wistream& is, wmValue& value )
-{
-    read_stream_or_throw( is, value );
-}
-
-bool json_spirit::read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wmValue& value )
-{
-    return read_range( begin, end, value );
-}
-
-void json_spirit::read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wmValue& value )
-{
-    begin = read_range_or_throw( begin, end, value );
-}
-
 #endif
diff --git a/src/web/json_spirit_stream_reader.h b/src/web/json_spirit_stream_reader.h
new file mode 100644
index 0000000..0952f10
--- /dev/null
+++ b/src/web/json_spirit_stream_reader.h
@@ -0,0 +1,70 @@
+#ifndef JSON_SPIRIT_READ_STREAM
+#define JSON_SPIRIT_READ_STREAM
+
+//          Copyright John W. Wilkinson 2007 - 2013
+// Distributed under the MIT License, see accompanying file LICENSE.txt
+
+// json spirit version 4.06
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+#include "json_spirit_reader_template.h"
+
+namespace json_spirit
+{
+    // these classes allows you to read multiple top level contiguous values from a stream,
+    // the normal stream read functions have a bug that prevent multiple top level values 
+    // from being read unless they are separated by spaces
+
+    template< class Istream_type, class Value_type >
+    class Stream_reader
+    {
+    public:
+
+        Stream_reader( Istream_type& is )
+        :   iters_( is )
+        {
+        }
+
+        bool read_next( Value_type& value )
+        {
+            return read_range( iters_.begin_, iters_.end_, value );
+        }
+
+    private:
+
+        typedef Multi_pass_iters< Istream_type > Mp_iters;
+
+        Mp_iters iters_;
+    };
+
+    template< class Istream_type, class Value_type >
+    class Stream_reader_thrower
+    {
+    public:
+
+        Stream_reader_thrower( Istream_type& is )
+        :   iters_( is )
+        ,    posn_begin_( iters_.begin_, iters_.end_ )
+        ,    posn_end_( iters_.end_, iters_.end_ )
+        {
+        }
+
+        void read_next( Value_type& value )
+        {
+            posn_begin_ = read_range_or_throw( posn_begin_, posn_end_, value );
+        }
+
+    private:
+
+        typedef Multi_pass_iters< Istream_type > Mp_iters;
+        typedef spirit_namespace::position_iterator< typename Mp_iters::Mp_iter > Posn_iter_t;
+
+        Mp_iters iters_;
+        Posn_iter_t posn_begin_, posn_end_;
+    };
+}
+
+#endif
diff --git a/src/web/json_spirit_utils.h b/src/web/json_spirit_utils.h
index 73be8d0..3c20dc7 100644
--- a/src/web/json_spirit_utils.h
+++ b/src/web/json_spirit_utils.h
@@ -1,12 +1,10 @@
-#ifndef JASON_SPIRIT_UTILS
-#define JASON_SPIRIT_UTILS
+#ifndef JSON_SPIRIT_UTILS
+#define JSON_SPIRIT_UTILS
 
-/* Copyright (c) 2007-2009 John W Wilkinson
+//          Copyright John W. Wilkinson 2007 - 2013
+// Distributed under the MIT License, see accompanying file LICENSE.txt
 
-   This source code can be used for any purpose as long as
-   this comment is retained. */
-
-// json spirit version 4.00
+// json spirit version 4.06
 
 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
 # pragma once
@@ -39,9 +37,11 @@ namespace json_spirit
         }
     }
 
+#ifdef JSON_SPIRIT_VALUE_ENABLED
     typedef std::map< std::string, Value > Mapped_obj;
+#endif
 
-#ifndef BOOST_NO_STD_WSTRING
+#if defined( JSON_SPIRIT_WVALUE_ENABLED ) && !defined( BOOST_NO_STD_WSTRING )
     typedef std::map< std::wstring, wValue > wMapped_obj;
 #endif
 
diff --git a/src/web/json_spirit_value.h b/src/web/json_spirit_value.h
index c386d28..2e94ede 100644
--- a/src/web/json_spirit_value.h
+++ b/src/web/json_spirit_value.h
@@ -1,12 +1,10 @@
-#ifndef JASON_SPIRIT_VALUE
-#define JASON_SPIRIT_VALUE
+#ifndef JSON_SPIRIT_VALUE
+#define JSON_SPIRIT_VALUE
 
-/* Copyright (c) 2007-2009 John W Wilkinson
+//          Copyright John W. Wilkinson 2007 - 2013
+// Distributed under the MIT License, see accompanying file LICENSE.txt
 
-   This source code can be used for any purpose as long as
-   this comment is retained. */
-
-// json spirit version 4.00
+// json spirit version 4.06
 
 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
 # pragma once
@@ -16,14 +14,27 @@
 #include <map>
 #include <string>
 #include <cassert>
+#include <sstream>
+#include <stdexcept>
 #include <boost/config.hpp> 
 #include <boost/cstdint.hpp> 
 #include <boost/shared_ptr.hpp> 
+#include <boost/variant.hpp> 
+
+// comment out the value types you don't need to reduce build times and intermediate file sizes
+#define JSON_SPIRIT_VALUE_ENABLED
+#define JSON_SPIRIT_WVALUE_ENABLED
+#define JSON_SPIRIT_MVALUE_ENABLED
+#define JSON_SPIRIT_WMVALUE_ENABLED
 
 namespace json_spirit
 {
     enum Value_type{ obj_type, array_type, str_type, bool_type, int_type, real_type, null_type };
 
+    static std::string value_type_to_string( Value_type vtype );
+
+    struct Null{};
+    
     template< class Config >    // Config determines whether the value uses std::string or std::wstring and
                                 // whether JSON Objects are represented as vectors or maps
     class Value_impl
@@ -47,6 +58,12 @@ namespace json_spirit
         Value_impl( boost::uint64_t    value );
         Value_impl( double             value );
 
+        template< class Iter >
+        Value_impl( Iter first, Iter last );    // constructor from containers, e.g. std::vector or std::list
+
+        template< BOOST_VARIANT_ENUM_PARAMS( typename T ) >
+        Value_impl( const boost::variant< BOOST_VARIANT_ENUM_PARAMS(T) >& variant ); // constructor for compatible variant types
+
         Value_impl( const Value_impl& other );
 
         bool operator==( const Value_impl& lhs ) const;
@@ -77,21 +94,34 @@ namespace json_spirit
 
     private:
 
-        Value_type type_;
+        void check_type( const Value_type vtype ) const;
 
-        typedef boost::shared_ptr< Object > Object_ptr;
-        typedef boost::shared_ptr< Array > Array_ptr;
+        typedef boost::variant< boost::recursive_wrapper< Object >, boost::recursive_wrapper< Array >, 
+                                String_type, bool, boost::int64_t, double, Null, boost::uint64_t > Variant;
 
-        String_type str_;
-        Object_ptr obj_p_;
-        Array_ptr array_p_;
-        union
+        Variant v_;
+
+        class Variant_converter_visitor : public boost::static_visitor< Variant > 
         {
-           bool bool_;
-           boost::int64_t i_;
-           double d_;
+        public:
+         
+              template< typename T, typename A, template< typename, typename > class Cont >
+              Variant operator()( const Cont< T, A >& cont ) const 
+              {
+                  return Array( cont.begin(), cont.end() );
+              }
+             
+              Variant operator()( int i ) const 
+              {
+                  return static_cast< boost::int64_t >( i );
+              }
+           
+              template<class T>
+              Variant operator()( const T& t ) const 
+              {
+                  return t;
+              }
         };
-        bool is_uint64_;
     };
 
     // vector objects
@@ -102,6 +132,10 @@ namespace json_spirit
         typedef typename Config::String_type String_type;
         typedef typename Config::Value_type Value_type;
 
+        Pair_impl()
+        {
+        }
+
         Pair_impl( const String_type& name, const Value_type& value );
 
         bool operator==( const Pair_impl& lhs ) const;
@@ -110,6 +144,7 @@ namespace json_spirit
         Value_type value_;
     };
 
+#if defined( JSON_SPIRIT_VALUE_ENABLED ) || defined( JSON_SPIRIT_WVALUE_ENABLED )
     template< class String >
     struct Config_vector
     {
@@ -126,30 +161,32 @@ namespace json_spirit
             return obj.back().value_;
         }
                 
-        static String_type get_name( const Pair_type& pair )
+        static const String_type& get_name( const Pair_type& pair )
         {
             return pair.name_;
         }
                 
-        static Value_type get_value( const Pair_type& pair )
+        static const Value_type& get_value( const Pair_type& pair )
         {
             return pair.value_;
         }
     };
+#endif
 
     // typedefs for ASCII
 
+#ifdef JSON_SPIRIT_VALUE_ENABLED
     typedef Config_vector< std::string > Config;
 
     typedef Config::Value_type  Value;
     typedef Config::Pair_type   Pair;
     typedef Config::Object_type Object;
     typedef Config::Array_type  Array;
+#endif
 
     // typedefs for Unicode
 
-#ifndef BOOST_NO_STD_WSTRING
-
+#if defined( JSON_SPIRIT_WVALUE_ENABLED ) && !defined( BOOST_NO_STD_WSTRING )
     typedef Config_vector< std::wstring > wConfig;
 
     typedef wConfig::Value_type  wValue;
@@ -160,6 +197,7 @@ namespace json_spirit
 
     // map objects
 
+#if defined( JSON_SPIRIT_MVALUE_ENABLED ) || defined( JSON_SPIRIT_WMVALUE_ENABLED )
     template< class String >
     struct Config_map
     {
@@ -167,146 +205,135 @@ namespace json_spirit
         typedef Value_impl< Config_map > Value_type;
         typedef std::vector< Value_type > Array_type;
         typedef std::map< String_type, Value_type > Object_type;
-        typedef typename Object_type::value_type Pair_type;
+        typedef std::pair< const String_type, Value_type > Pair_type;
 
         static Value_type& add( Object_type& obj, const String_type& name, const Value_type& value )
         {
             return obj[ name ] = value;
         }
                 
-        static String_type get_name( const Pair_type& pair )
+        static const String_type& get_name( const Pair_type& pair )
         {
             return pair.first;
         }
                 
-        static Value_type get_value( const Pair_type& pair )
+        static const Value_type& get_value( const Pair_type& pair )
         {
             return pair.second;
         }
     };
+#endif
 
     // typedefs for ASCII
 
+#ifdef JSON_SPIRIT_MVALUE_ENABLED
     typedef Config_map< std::string > mConfig;
 
     typedef mConfig::Value_type  mValue;
     typedef mConfig::Object_type mObject;
     typedef mConfig::Array_type  mArray;
+#endif
 
     // typedefs for Unicode
 
-#ifndef BOOST_NO_STD_WSTRING
-
+#if defined( JSON_SPIRIT_WMVALUE_ENABLED ) && !defined( BOOST_NO_STD_WSTRING )
     typedef Config_map< std::wstring > wmConfig;
 
     typedef wmConfig::Value_type  wmValue;
     typedef wmConfig::Object_type wmObject;
     typedef wmConfig::Array_type  wmArray;
-
 #endif
 
     ///////////////////////////////////////////////////////////////////////////////////////////////
     //
     // implementation
 
+    inline bool operator==( const Null&, const Null& )
+    {
+        return true;
+    }
+
     template< class Config >
     const Value_impl< Config > Value_impl< Config >::null;
 
     template< class Config >
     Value_impl< Config >::Value_impl()
-    :   type_( null_type )
-    ,   is_uint64_( false )
+    :   v_( Null() )
     {
     }
 
     template< class Config >
     Value_impl< Config >::Value_impl( const Const_str_ptr value )
-    :   type_( str_type )
-    ,   str_( value )
-    ,   is_uint64_( false )
+    :  v_( String_type( value ) )
     {
     }
 
     template< class Config >
     Value_impl< Config >::Value_impl( const String_type& value )
-    :   type_( str_type )
-    ,   str_( value )
-    ,   is_uint64_( false )
+    :   v_( value )
     {
     }
 
     template< class Config >
     Value_impl< Config >::Value_impl( const Object& value )
-    :   type_( obj_type )
-    ,   obj_p_( new Object( value ) )
-    ,   is_uint64_( false )
+    :   v_( value )
     {
     }
 
     template< class Config >
     Value_impl< Config >::Value_impl( const Array& value )
-    :   type_( array_type )
-    ,   array_p_( new Array( value ) )
-    ,   is_uint64_( false )
+    :   v_( value )
     {
     }
 
     template< class Config >
     Value_impl< Config >::Value_impl( bool value )
-    :   type_( bool_type )
-    ,   bool_( value )
-    ,   is_uint64_( false )
+    :   v_( value )
     {
     }
 
     template< class Config >
     Value_impl< Config >::Value_impl( int value )
-    :   type_( int_type )
-    ,   i_( value )
-    ,   is_uint64_( false )
+    :   v_( static_cast< boost::int64_t >( value ) )
     {
     }
 
     template< class Config >
     Value_impl< Config >::Value_impl( boost::int64_t value )
-    :   type_( int_type )
-    ,   i_( value )
-    ,   is_uint64_( false )
+    :   v_( value )
     {
     }
 
     template< class Config >
     Value_impl< Config >::Value_impl( boost::uint64_t value )
-    :   type_( int_type )
-    ,   i_( static_cast< boost::int64_t >( value ) )
-    ,   is_uint64_( true )
+    :   v_( value )
     {
     }
 
     template< class Config >
     Value_impl< Config >::Value_impl( double value )
-    :   type_( real_type )
-    ,   d_( value )
-    ,   is_uint64_( false )
+    :   v_( value )
     {
     }
 
     template< class Config >
     Value_impl< Config >::Value_impl( const Value_impl< Config >& other )
-    :   type_( other.type() )
-    ,   is_uint64_( other.is_uint64_ )
+    :   v_( other.v_ )
+    {
+    }
+
+    template< class Config >
+    template< class Iter >
+    Value_impl< Config >::Value_impl( Iter first, Iter last )
+    :   v_( Array( first, last ) )
+    {
+    }
+
+    template< class Config >
+    template< BOOST_VARIANT_ENUM_PARAMS( typename T ) >
+    Value_impl< Config >::Value_impl( const boost::variant< BOOST_VARIANT_ENUM_PARAMS(T) >& variant )
+    :   v_( boost::apply_visitor( Variant_converter_visitor(), variant) )
     {
-        switch( type_ )
-        {
-            case str_type:   str_     = other.get_str();                               break;
-            case obj_type:   obj_p_   = Object_ptr( new Object( other.get_obj() ) );   break;
-            case array_type: array_p_ = Array_ptr ( new Array ( other.get_array() ) ); break;
-            case bool_type:  bool_    = other.get_bool();                              break;
-            case int_type:   i_       = other.get_int64();                             break;
-            case real_type:  d_       = other.get_real();                              break;
-            case null_type:                                                            break;
-            default: assert( false );
-        };
     }
 
     template< class Config >
@@ -314,19 +341,7 @@ namespace json_spirit
     {
         Value_impl tmp( lhs );
 
-        std::swap( type_, tmp.type_ );
-        str_    .swap( tmp.str_ );
-        obj_p_  .swap( tmp.obj_p_ );
-        array_p_.swap( tmp.array_p_ );
-        std::swap( is_uint64_, tmp.is_uint64_ );
-
-        switch( type_ )
-        {
-            case bool_type:  std::swap( bool_,      tmp.bool_ );      break;
-            case int_type:   std::swap( i_,         tmp.i_ );         break;
-            case real_type:  std::swap( d_,         tmp.d_ );         break;
-	    default:  break;
-        };
+        std::swap( v_, tmp.v_ );
 
         return *this;
     }
@@ -338,33 +353,24 @@ namespace json_spirit
 
         if( type() != lhs.type() ) return false;
 
-        switch( type_ )
-        {
-            case str_type:   return get_str()   == lhs.get_str();
-            case obj_type:   return get_obj()   == lhs.get_obj();
-            case array_type: return get_array() == lhs.get_array();
-            case bool_type:  return get_bool()  == lhs.get_bool();
-            case int_type:   return ( get_int64() == lhs.get_int64() ) &&
-                                    ( is_uint64() == lhs.is_uint64() );
-            case real_type:  return get_real()  == lhs.get_real();
-            case null_type:  return true;
-        };
-
-        assert( false );
-
-        return false; 
+        return v_ == lhs.v_; 
     }
 
     template< class Config >
     Value_type Value_impl< Config >::type() const
     {
-        return type_;
+        if( is_uint64() )
+        {
+            return int_type;
+        }
+
+        return static_cast< Value_type >( v_.which() );
     }
 
     template< class Config >
     bool Value_impl< Config >::is_uint64() const
     {
-        return is_uint64_;
+        return v_.which() == null_type + 1;
     }
 
     template< class Config >
@@ -374,59 +380,82 @@ namespace json_spirit
     }
 
     template< class Config >
+    void Value_impl< Config >::check_type( const Value_type vtype ) const
+    {
+        if( type() != vtype ) 
+        {
+            std::ostringstream os;
+
+            os << "get_value< " << value_type_to_string( vtype ) << " > called on " << value_type_to_string( type() ) << " Value";
+
+            throw std::runtime_error( os.str() );
+        }
+    }
+
+    template< class Config >
     const typename Config::String_type& Value_impl< Config >::get_str() const
     {
-        assert( type() == str_type );
+        check_type( str_type );
 
-        return str_;
+        return *boost::get< String_type >( &v_ );
     }
 
     template< class Config >
     const typename Value_impl< Config >::Object& Value_impl< Config >::get_obj() const
     {
-        assert( type() == obj_type );
+        check_type( obj_type );
 
-        return *obj_p_;
+        return *boost::get< Object >( &v_ );
     }
      
     template< class Config >
     const typename Value_impl< Config >::Array& Value_impl< Config >::get_array() const
     {
-        assert( type() == array_type );
+        check_type( array_type );
 
-        return *array_p_;
+        return *boost::get< Array >( &v_ );
     }
      
     template< class Config >
     bool Value_impl< Config >::get_bool() const
     {
-        assert( type() == bool_type );
+        check_type( bool_type );
 
-        return bool_;
+        return boost::get< bool >( v_ );
     }
      
     template< class Config >
     int Value_impl< Config >::get_int() const
     {
-        assert( type() == int_type );
+        check_type( int_type );
 
-        return static_cast< int >( i_ );
+        return static_cast< int >( get_int64() );
     }
     
     template< class Config >
     boost::int64_t Value_impl< Config >::get_int64() const
     {
-        assert( type() == int_type );
+        check_type( int_type );
+
+        if( is_uint64() )
+        {
+            return static_cast< boost::int64_t >( get_uint64() );
+        }
 
-        return i_;
+        return boost::get< boost::int64_t >( v_ );
     }
     
     template< class Config >
     boost::uint64_t Value_impl< Config >::get_uint64() const
     {
-        assert( type() == int_type );
+        check_type( int_type );
 
-        return static_cast< boost::uint64_t >( i_ );
+        if( !is_uint64() )
+        {
+            return static_cast< boost::uint64_t >( get_int64() );
+        }
+
+        return boost::get< boost::uint64_t >( v_ );
     }
 
     template< class Config >
@@ -438,25 +467,25 @@ namespace json_spirit
                                : static_cast< double >( get_int64() );
         }
 
-        assert( type() == real_type );
+        check_type( real_type );
 
-        return d_;
+        return boost::get< double >( v_ );
     }
 
     template< class Config >
     typename Value_impl< Config >::Object& Value_impl< Config >::get_obj()
     {
-        assert( type() == obj_type );
+        check_type( obj_type );
 
-        return *obj_p_;
+        return *boost::get< Object >( &v_ );
     }
 
     template< class Config >
     typename Value_impl< Config >::Array& Value_impl< Config >::get_array()
     {
-        assert( type() == array_type );
+        check_type( array_type );
 
-        return *array_p_;
+        return *boost::get< Array >( &v_ );
     }
 
     template< class Config >
@@ -553,6 +582,24 @@ namespace json_spirit
     {
         return internal_::get_value( *this, internal_::Type_to_type< T >() );
     }
+
+    static std::string value_type_to_string( const Value_type vtype )
+    {
+        switch( vtype )
+        {
+            case obj_type: return "Object";
+            case array_type: return "Array";
+            case str_type: return "string";
+            case bool_type: return "boolean";
+            case int_type: return "integer";
+            case real_type: return "real";
+            case null_type: return "null";
+        }
+
+        assert( false );
+
+        return "unknown type";
+    }
 }
 
 #endif
diff --git a/src/web/json_spirit_writer.cpp b/src/web/json_spirit_writer.cpp
index e8c75d7..dc18515 100644
--- a/src/web/json_spirit_writer.cpp
+++ b/src/web/json_spirit_writer.cpp
@@ -1,329 +1,96 @@
-/* Copyright (c) 2007-2009 John W Wilkinson
+//          Copyright John W. Wilkinson 2007 - 2013
+// Distributed under the MIT License, see accompanying file LICENSE.txt
 
-   This source code can be used for any purpose as long as
-   this comment is retained. */
-
-// json spirit version 4.00
+// json spirit version 4.06
 
 #include "json_spirit_writer.h"
-#include "json_spirit_value.h"
-
-#include <cassert>
-#include <sstream>
-#include <iomanip>
+#include "json_spirit_writer_template.h"
 
 using namespace json_spirit;
-using namespace std;
 
-namespace
-{
-    template< typename Char_type >
-    Char_type to_hex( Char_type c )
+#ifdef JSON_SPIRIT_VALUE_ENABLED
+    void json_spirit::write( const Value& value, std::ostream& os, unsigned int options )
     {
-        assert( c <= 0xF );
-
-        if( c < 10 ) return '0' + c;
-
-        return 'A' + c - 10;
+        write_stream( value, os, options );
     }
-
-    template< class String_type >
-    String_type non_printable_to_string( unsigned int c )
+    std::string json_spirit::write( const Value& value, unsigned int options )
     {
-        String_type result( 6, '\\' );
-
-        result[1] = 'u';
-
-        result[ 5 ] = to_hex( c & 0x000F ); c >>= 4;
-        result[ 4 ] = to_hex( c & 0x000F ); c >>= 4;
-        result[ 3 ] = to_hex( c & 0x000F ); c >>= 4;
-        result[ 2 ] = to_hex( c & 0x000F );
-
-        return result;
+        return write_string( value, options );
     }
 
-    template< typename Char_type, class String_type >
-    bool add_esc_char( Char_type c, String_type& s )
+    void json_spirit::write_formatted( const Value& value, std::ostream& os )
     {
-        switch( c )
-        {
-            case '"':  s += to_str< String_type >( "\\\"" ); return true;
-            case '\\': s += to_str< String_type >( "\\\\" ); return true;
-            case '\b': s += to_str< String_type >( "\\b"  ); return true;
-            case '\f': s += to_str< String_type >( "\\f"  ); return true;
-            case '\n': s += to_str< String_type >( "\\n"  ); return true;
-            case '\r': s += to_str< String_type >( "\\r"  ); return true;
-            case '\t': s += to_str< String_type >( "\\t"  ); return true;
-        }
-
-        return false;
+        write_stream( value, os, pretty_print );
     }
 
-    template< class String_type >
-    String_type add_esc_chars( const String_type& s )
+    std::string json_spirit::write_formatted( const Value& value )
     {
-        typedef typename String_type::const_iterator Iter_type;
-        typedef typename String_type::value_type     Char_type;
-
-        String_type result;
-
-        const Iter_type end( s.end() );
-
-        for( Iter_type i = s.begin(); i != end; ++i )
-        {
-            const Char_type c( *i );
-
-            if( add_esc_char( c, result ) ) continue;
-
-            const wint_t unsigned_c( ( c >= 0 ) ? c : 256 + c );
-
-            if( iswprint( unsigned_c ) )
-            {
-                result += c;
-            }
-            else
-            {
-                result += non_printable_to_string< String_type >( unsigned_c );
-            }
-        }
-
-        return result;
+        return write_string( value, pretty_print );
     }
+#endif
 
-    // this class generates the JSON text,
-    // it keeps track of the indentation level etc.
-    //
-    template< class Value_type, class Ostream_type >
-    class Generator
+#ifdef JSON_SPIRIT_MVALUE_ENABLED
+    void json_spirit::write( const mValue& value, std::ostream& os, unsigned int options )
     {
-        typedef typename Value_type::Config_type Config_type;
-        typedef typename Config_type::String_type String_type;
-        typedef typename Config_type::Object_type Object_type;
-        typedef typename Config_type::Array_type Array_type;
-        typedef typename String_type::value_type Char_type;
-        typedef typename Object_type::value_type Obj_member_type;
-
-    public:
-
-        Generator( const Value_type& value, Ostream_type& os, bool pretty )
-        :   os_( os )
-        ,   indentation_level_( 0 )
-        ,   pretty_( pretty )
-        {
-            output( value );
-        }
-
-    private:
-
-        void output( const Value_type& value )
-        {
-            switch( value.type() )
-            {
-                case obj_type:   output( value.get_obj() );   break;
-                case array_type: output( value.get_array() ); break;
-                case str_type:   output( value.get_str() );   break;
-                case bool_type:  output( value.get_bool() );  break;
-                case int_type:   output_int( value );         break;
-                case real_type:  os_ << showpoint << setprecision( 16 ) 
-                                     << value.get_real();     break;
-                case null_type:  os_ << "null";               break;
-                default: assert( false );
-            }
-        }
-
-        void output( const Object_type& obj )
-        {
-            output_array_or_obj( obj, '{', '}' );
-        }
-
-        void output( const Array_type& arr )
-        {
-            output_array_or_obj( arr, '[', ']' );
-        }
-
-        void output( const Obj_member_type& member )
-        {
-            output( Config_type::get_name( member ) ); space(); 
-            os_ << ':'; space(); 
-            output( Config_type::get_value( member ) );
-        }
-
-        void output_int( const Value_type& value )
-        {
-            if( value.is_uint64() )
-            {
-                os_ << value.get_uint64();
-            }
-            else
-            {
-               os_ << value.get_int64();
-            }
-        }
-
-        void output( const String_type& s )
-        {
-            os_ << '"' << add_esc_chars( s ) << '"';
-        }
-
-        void output( bool b )
-        {
-            os_ << to_str< String_type >( b ? "true" : "false" );
-        }
-
-        template< class T >
-        void output_array_or_obj( const T& t, Char_type start_char, Char_type end_char )
-        {
-            os_ << start_char; new_line();
-
-            ++indentation_level_;
-            
-            for( typename T::const_iterator i = t.begin(); i != t.end(); ++i )
-            {
-                indent(); output( *i );
-
-                typename T::const_iterator next = i;
-
-                if( ++next != t.end())
-                {
-                    os_ << ',';
-                }
-
-                new_line();
-            }
-
-            --indentation_level_;
-
-            indent(); os_ << end_char;
-        }
-        
-        void indent()
-        {
-            if( !pretty_ ) return;
-
-            for( int i = 0; i < indentation_level_; ++i )
-            { 
-                os_ << "    ";
-            }
-        }
-
-        void space()
-        {
-            if( pretty_ ) os_ << ' ';
-        }
-
-        void new_line()
-        {
-            if( pretty_ ) os_ << '\n';
-        }
-
-        Ostream_type& os_;
-        int indentation_level_;
-        bool pretty_;
-    };
+        write_stream( value, os, options );
+    }
 
-    template< class Value_type, class Ostream_type >
-    void write_( const Value_type& value, Ostream_type& os, bool pretty )
+    std::string json_spirit::write( const mValue& value, unsigned int options )
     {
-        Generator< Value_type, Ostream_type >( value, os, pretty );
+        return write_string( value, options );
     }
 
-    template< class Value_type >
-    typename Value_type::String_type write_( const Value_type& value, bool pretty )
+    void json_spirit::write_formatted( const mValue& value, std::ostream& os )
     {
-        typedef typename Value_type::String_type::value_type Char_type;
-
-        basic_ostringstream< Char_type > os;
-
-        write_( value, os, pretty );
-
-        return os.str();
+        write_stream( value, os, pretty_print );
     }
-}
-
-void json_spirit::write( const Value& value, std::ostream& os )
-{
-    write_( value, os, false );
-}
-
-void json_spirit::write_formatted( const Value& value, std::ostream& os )
-{
-    write_( value, os, true );
-}
-
-std::string json_spirit::write( const Value& value )
-{
-    return write_( value, false );
-}
-
-std::string json_spirit::write_formatted( const Value& value )
-{
-    return write_( value, true );
-}
-
-#ifndef BOOST_NO_STD_WSTRING
-
-void json_spirit::write( const wValue& value, std::wostream& os )
-{
-    write_( value, os, false );
-}
-
-void json_spirit::write_formatted( const wValue& value, std::wostream& os )
-{
-    write_( value, os, true );
-}
-
-std::wstring json_spirit::write( const wValue&  value )
-{
-    return write_( value, false );
-}
-
-std::wstring json_spirit::write_formatted( const wValue&  value )
-{
-    return write_( value, true );
-}
 
+    std::string json_spirit::write_formatted( const mValue& value )
+    {
+        return write_string( value, pretty_print );
+    }
 #endif
 
-void json_spirit::write( const mValue& value, std::ostream& os )
-{
-    write_( value, os, false );
-}
-
-void json_spirit::write_formatted( const mValue& value, std::ostream& os )
-{
-    write_( value, os, true );
-}
-
-std::string json_spirit::write( const mValue& value )
-{
-    return write_( value, false );
-}
+#if defined( JSON_SPIRIT_WVALUE_ENABLED ) && !defined( BOOST_NO_STD_WSTRING )
+    void json_spirit::write( const wValue& value, std::wostream& os, unsigned int options )
+    {
+        write_stream( value, os, options );
+    }
 
-std::string json_spirit::write_formatted( const mValue& value )
-{
-    return write_( value, true );
-}
+    std::wstring json_spirit::write( const wValue& value, unsigned int options )
+    {
+        return write_string( value, options );
+    }
 
-#ifndef BOOST_NO_STD_WSTRING
+    void json_spirit::write_formatted( const wValue& value, std::wostream& os )
+    {
+        write_stream( value, os, pretty_print );
+    }
 
-void json_spirit::write( const wmValue& value, std::wostream& os )
-{
-    write_( value, os, false );
-}
+    std::wstring json_spirit::write_formatted( const wValue& value )
+    {
+        return write_string( value, pretty_print );
+    }
+#endif
 
-void json_spirit::write_formatted( const wmValue& value, std::wostream& os )
-{
-    write_( value, os, true );
-}
+#if defined( JSON_SPIRIT_WMVALUE_ENABLED ) && !defined( BOOST_NO_STD_WSTRING )
+    void json_spirit::write_formatted( const wmValue& value, std::wostream& os )
+    {
+        write_stream( value, os, pretty_print );
+    }
 
-std::wstring json_spirit::write( const wmValue&  value )
-{
-    return write_( value, false );
-}
+    std::wstring json_spirit::write_formatted( const wmValue& value )
+    {
+        return write_string( value, pretty_print );
+    }
 
-std::wstring json_spirit::write_formatted( const wmValue&  value )
-{
-    return write_( value, true );
-}
+    void json_spirit::write( const wmValue& value, std::wostream& os, unsigned int options )
+    {
+        write_stream( value, os, options );
+    }
 
+    std::wstring json_spirit::write( const wmValue& value, unsigned int options )
+    {
+        return write_string( value, options );
+    }
 #endif
diff --git a/src/web/json_spirit_writer.h b/src/web/json_spirit_writer.h
index d76011c..5b1d757 100644
--- a/src/web/json_spirit_writer.h
+++ b/src/web/json_spirit_writer.h
@@ -1,51 +1,62 @@
-#ifndef JASON_SPIRIT_WRITER
-#define JASON_SPIRIT_WRITER
+#ifndef JSON_SPIRIT_WRITER
+#define JSON_SPIRIT_WRITER
 
-/* Copyright (c) 2007-2009 John W Wilkinson
+//          Copyright John W. Wilkinson 2007 - 2013
+// Distributed under the MIT License, see accompanying file LICENSE.txt
 
-   This source code can be used for any purpose as long as
-   this comment is retained. */
-
-// json spirit version 4.00
+// json spirit version 4.06
 
 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
 # pragma once
 #endif
 
 #include "json_spirit_value.h"
+#include "json_spirit_writer_options.h"
 #include <iostream>
 
 namespace json_spirit
 {
-    // functions to convert JSON Values to text, 
-    // the "formatted" versions add whitespace to format the output nicely
+    // these functions to convert JSON Values to text
 
-    void         write          ( const Value& value, std::ostream&  os );
-    void         write_formatted( const Value& value, std::ostream&  os );
-    std::string  write          ( const Value& value );
-    std::string  write_formatted( const Value& value );
+#ifdef JSON_SPIRIT_VALUE_ENABLED
+    void         write( const Value&  value, std::ostream&  os, unsigned int options = 0 );
+    std::string  write( const Value&  value, unsigned int options = 0 );
+#endif
 
-#ifndef BOOST_NO_STD_WSTRING
+#ifdef JSON_SPIRIT_MVALUE_ENABLED
+    void         write( const mValue& value, std::ostream&  os, unsigned int options = 0 );
+    std::string  write( const mValue& value, unsigned int options = 0 );
+#endif
 
-    void         write          ( const wValue& value, std::wostream& os );
-    void         write_formatted( const wValue& value, std::wostream& os );
-    std::wstring write          ( const wValue& value );
-    std::wstring write_formatted( const wValue& value );
+#if defined( JSON_SPIRIT_WVALUE_ENABLED ) && !defined( BOOST_NO_STD_WSTRING )
+    void         write( const wValue&  value, std::wostream& os, unsigned int options = 0 );
+    std::wstring write( const wValue&  value, unsigned int options = 0 );
+#endif
 
+#if defined( JSON_SPIRIT_WMVALUE_ENABLED ) && !defined( BOOST_NO_STD_WSTRING )
+    void         write( const wmValue& value, std::wostream& os, unsigned int options = 0 );
+    std::wstring write( const wmValue& value, unsigned int options = 0 );
 #endif
 
-    void         write          ( const mValue& value, std::ostream&  os );
+    // these "formatted" versions of the "write" functions are the equivalent of the above functions
+    // with option "pretty_print"
+    
+#ifdef JSON_SPIRIT_VALUE_ENABLED
+    void         write_formatted( const Value& value, std::ostream&  os );
+    std::string  write_formatted( const Value& value );
+#endif
+#ifdef JSON_SPIRIT_MVALUE_ENABLED
     void         write_formatted( const mValue& value, std::ostream&  os );
-    std::string  write          ( const mValue& value );
     std::string  write_formatted( const mValue& value );
+#endif
 
-#ifndef BOOST_NO_STD_WSTRING
-
-    void         write          ( const wmValue& value, std::wostream& os );
+#if defined( JSON_SPIRIT_WVALUE_ENABLED ) && !defined( BOOST_NO_STD_WSTRING )
+    void         write_formatted( const wValue& value, std::wostream& os );
+    std::wstring write_formatted( const wValue& value );
+#endif
+#if defined( JSON_SPIRIT_WMVALUE_ENABLED ) && !defined( BOOST_NO_STD_WSTRING )
     void         write_formatted( const wmValue& value, std::wostream& os );
-    std::wstring write          ( const wmValue& value );
     std::wstring write_formatted( const wmValue& value );
-
 #endif
 }
 
diff --git a/src/web/json_spirit_writer_options.h b/src/web/json_spirit_writer_options.h
new file mode 100644
index 0000000..b2a8581
--- /dev/null
+++ b/src/web/json_spirit_writer_options.h
@@ -0,0 +1,33 @@
+#ifndef JSON_SPIRIT_WRITER_OPTIONS
+#define JSON_SPIRIT_WRITER_OPTIONS
+
+//          Copyright John W. Wilkinson 2007 - 2013
+// Distributed under the MIT License, see accompanying file LICENSE.txt
+
+// json spirit version 4.06
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+namespace json_spirit
+{
+    enum Output_options{ pretty_print = 0x01,   // Add whitespace to format the output nicely.
+
+                         raw_utf8 = 0x02,       // This prevents non-printable characters from being escapted using "\uNNNN" notation.
+                                                // Note, this is an extension to the JSON standard. It disables the escaping of
+                                                // non-printable characters allowing UTF-8 sequences held in 8 bit char strings
+                                                // to pass through unaltered.
+
+                         remove_trailing_zeros = 0x04,
+                                                // outputs e.g. "1.200000000000000" as "1.2"
+                         single_line_arrays = 0x08,
+                                                // pretty printing except that arrays printed on single lines unless they contain
+                                                // composite elements, i.e. objects or arrays
+                         always_escape_nonascii = 0x10,
+                                                // all unicode wide characters are escaped, i.e. outputed as "\uXXXX", even if they are
+                                                // printable under the current locale, ascii printable chars are not escaped
+                       };
+}
+
+#endif
diff --git a/src/web/json_spirit_writer_template.h b/src/web/json_spirit_writer_template.h
new file mode 100644
index 0000000..7c1a62b
--- /dev/null
+++ b/src/web/json_spirit_writer_template.h
@@ -0,0 +1,387 @@
+#ifndef JSON_SPIRIT_WRITER_TEMPLATE
+#define JSON_SPIRIT_WRITER_TEMPLATE
+
+//          Copyright John W. Wilkinson 2007 - 2013
+// Distributed under the MIT License, see accompanying file LICENSE.txt
+
+// json spirit version 4.06
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+#include "json_spirit_value.h"
+#include "json_spirit_writer_options.h"
+
+#include <cassert>
+#include <sstream>
+#include <iomanip>
+#include <boost/io/ios_state.hpp>
+
+namespace json_spirit
+{
+    inline char to_hex_char( unsigned int c )
+    {
+        assert( c <= 0xF );
+
+        const char ch = static_cast< char >( c );
+
+        if( ch < 10 ) return '0' + ch;
+
+        return 'A' - 10 + ch;
+    }
+
+    template< class String_type >
+    String_type non_printable_to_string( unsigned int c )
+    {
+        typedef typename String_type::value_type Char_type;
+
+        String_type result( 6, '\\' );
+
+        result[1] = 'u';
+
+        result[ 5 ] = to_hex_char( c & 0x000F ); c >>= 4;
+        result[ 4 ] = to_hex_char( c & 0x000F ); c >>= 4;
+        result[ 3 ] = to_hex_char( c & 0x000F ); c >>= 4;
+        result[ 2 ] = to_hex_char( c & 0x000F );
+
+        return result;
+    }
+
+    template< typename Char_type, class String_type >
+    bool add_esc_char( Char_type c, String_type& s )
+    {
+        switch( c )
+        {
+            case '"':  s += to_str< String_type >( "\\\"" ); return true;
+            case '\\': s += to_str< String_type >( "\\\\" ); return true;
+            case '\b': s += to_str< String_type >( "\\b"  ); return true;
+            case '\f': s += to_str< String_type >( "\\f"  ); return true;
+            case '\n': s += to_str< String_type >( "\\n"  ); return true;
+            case '\r': s += to_str< String_type >( "\\r"  ); return true;
+            case '\t': s += to_str< String_type >( "\\t"  ); return true;
+        }
+
+        return false;
+    }
+
+    template< class String_type >
+    String_type add_esc_chars( const String_type& s, bool raw_utf8, bool esc_nonascii )
+    {
+        typedef typename String_type::const_iterator Iter_type;
+        typedef typename String_type::value_type     Char_type;
+
+        String_type result;
+
+        const Iter_type end( s.end() );
+
+        for( Iter_type i = s.begin(); i != end; ++i )
+        {
+            const Char_type c( *i );
+
+            if( add_esc_char( c, result ) ) continue;
+
+            if( raw_utf8 )
+            {
+                result += c;
+            }
+            else
+            {
+                const wint_t unsigned_c( ( c >= 0 ) ? c : 256 + c );
+
+                if( !esc_nonascii && iswprint( unsigned_c ) )
+                {
+                    result += c;
+                }
+                else
+                {
+                    result += non_printable_to_string< String_type >( unsigned_c );
+                }
+            }
+        }
+
+        return result;
+    }
+
+    template< class Ostream >
+    void append_double( Ostream& os, const double d, const int precision )
+    {
+        os << std::showpoint << std::setprecision( precision ) << d;
+    }
+
+    template< class String_type >
+    void erase_and_extract_exponent( String_type& str, String_type& exp )
+    {
+        const typename String_type::size_type exp_start= str.find( 'e' );
+
+        if( exp_start != String_type::npos )
+        {
+            exp = str.substr( exp_start );
+            str.erase( exp_start );
+        }
+    }
+
+    template< class String_type >
+    typename String_type::size_type find_first_non_zero( const String_type& str )
+    {
+        typename String_type::size_type result = str.size() - 1;
+
+        for( ; result != 0; --result )
+        {
+            if( str[ result ] != '0' )
+            {
+                break;
+            }
+        }
+
+        return result;
+    }
+
+    template< class String_type >
+    void remove_trailing( String_type& str )
+    {
+        String_type exp;
+
+        erase_and_extract_exponent( str, exp );
+
+        const typename String_type::size_type first_non_zero = find_first_non_zero( str );
+
+        if( first_non_zero != 0 )
+        {
+            const int offset = str[first_non_zero] == '.' ? 2 : 1;  // note zero digits following a decimal point is non standard
+            str.erase( first_non_zero + offset );
+        }
+
+        str += exp;
+    }
+
+    // this class generates the JSON text,
+    // it keeps track of the indentation level etc.
+    //
+    template< class Value_type, class Ostream_type >
+    class Generator
+    {
+        typedef typename Value_type::Config_type Config_type;
+        typedef typename Config_type::String_type String_type;
+        typedef typename Config_type::Object_type Object_type;
+        typedef typename Config_type::Array_type Array_type;
+        typedef typename String_type::value_type Char_type;
+        typedef typename Object_type::value_type Obj_member_type;
+
+    public:
+
+        Generator( const Value_type& value, Ostream_type& os, unsigned int options )
+        :   os_( os )
+        ,   indentation_level_( 0 )
+        ,   pretty_( ( options & pretty_print ) != 0 || ( options & single_line_arrays ) != 0 )
+        ,   raw_utf8_( ( options & raw_utf8 ) != 0 )
+        ,   esc_nonascii_( ( options & always_escape_nonascii ) != 0 )
+        ,   remove_trailing_zeros_( ( options & remove_trailing_zeros ) != 0 )
+        ,   single_line_arrays_( ( options & single_line_arrays ) != 0 )
+        ,   ios_saver_( os )
+        {
+            output( value );
+        }
+
+    private:
+
+        void output( const Value_type& value )
+        {
+            switch( value.type() )
+            {
+                case obj_type:   output( value.get_obj() );   break;
+                case array_type: output( value.get_array() ); break;
+                case str_type:   output( value.get_str() );   break;
+                case bool_type:  output( value.get_bool() );  break;
+                case real_type:  output( value.get_real() );  break;
+                case int_type:   output_int( value );         break;
+                case null_type:  os_ << "null";               break;
+                default: assert( false );
+            }
+        }
+
+        void output( const Object_type& obj )
+        {
+            output_array_or_obj( obj, '{', '}' );
+        }
+
+        void output( const Obj_member_type& member )
+        {
+            output( Config_type::get_name( member ) ); space(); 
+            os_ << ':'; space(); 
+            output( Config_type::get_value( member ) );
+        }
+
+        void output_int( const Value_type& value )
+        {
+            if( value.is_uint64() )
+            {
+                os_ << value.get_uint64();
+            }
+            else
+            {
+               os_ << value.get_int64();
+            }
+        }
+
+        void output( const String_type& s )
+        {
+            os_ << '"' << add_esc_chars( s, raw_utf8_, esc_nonascii_ ) << '"';
+        }
+
+        void output( bool b )
+        {
+            os_ << to_str< String_type >( b ? "true" : "false" );
+        }
+
+        void output( double d )
+        {
+            if( remove_trailing_zeros_ )
+            {
+                std::basic_ostringstream< Char_type > os;
+
+                append_double( os, d, 16 );  // note precision is 16 so that we get some trailing space that we can remove,
+                                             // otherwise, 0.1234 gets converted to "0.12399999..."
+
+                String_type str = os.str();
+
+                remove_trailing( str );
+
+                os_ << str;
+            }
+            else
+            {
+                append_double( os_, d, 17 );
+            }
+        }
+
+        static bool contains_composite_elements( const Array_type& arr )
+        {
+            for( typename Array_type::const_iterator i = arr.begin(); i != arr.end(); ++i )
+            {
+                const Value_type& val = *i;
+
+                if( val.type() == obj_type ||
+                    val.type() == array_type )
+                {
+                    return true;
+                }
+            }
+
+            return false;
+        }
+
+        template< class Iter >
+        void output_composite_item( Iter i, Iter last )
+        {
+            output( *i );
+
+            if( ++i != last )
+            {
+                os_ << ',';
+            }
+        }
+
+        void output( const Array_type& arr )
+        {
+            if( single_line_arrays_ && !contains_composite_elements( arr )  )
+            {
+                os_ << '['; space();
+               
+                for( typename Array_type::const_iterator i = arr.begin(); i != arr.end(); ++i )
+                {
+                    output_composite_item( i, arr.end() );
+
+                    space();
+                }
+
+                os_ << ']';
+            }
+            else
+            {
+                output_array_or_obj( arr, '[', ']' );
+            }
+        }
+
+        template< class T >
+        void output_array_or_obj( const T& t, Char_type start_char, Char_type end_char )
+        {
+            os_ << start_char; new_line();
+
+            ++indentation_level_;
+            
+            for( typename T::const_iterator i = t.begin(); i != t.end(); ++i )
+            {
+                indent();
+
+                output_composite_item( i, t.end() );
+
+                new_line();
+            }
+
+            --indentation_level_;
+
+            indent(); os_ << end_char;
+        }
+        
+        void indent()
+        {
+            if( !pretty_ ) return;
+
+            for( int i = 0; i < indentation_level_; ++i )
+            { 
+                os_ << "    ";
+            }
+        }
+
+        void space()
+        {
+            if( pretty_ ) os_ << ' ';
+        }
+
+        void new_line()
+        {
+            if( pretty_ ) os_ << '\n';
+        }
+
+        Generator& operator=( const Generator& ); // to prevent "assignment operator could not be generated" warning
+
+        Ostream_type& os_;
+        int indentation_level_;
+        bool pretty_;
+        bool raw_utf8_;
+        bool esc_nonascii_;
+        bool remove_trailing_zeros_;
+        bool single_line_arrays_;
+        boost::io::basic_ios_all_saver< Char_type > ios_saver_;  // so that ostream state is reset after control is returned to the caller
+    };
+
+    // writes JSON Value to a stream, e.g.
+    //
+    // write_stream( value, os, pretty_print );
+    //
+    template< class Value_type, class Ostream_type >
+    void write_stream( const Value_type& value, Ostream_type& os, unsigned int options = 0 )
+    {
+        os << std::dec;
+        Generator< Value_type, Ostream_type >( value, os, options );
+    }
+
+    // writes JSON Value to a stream, e.g.
+    //
+    // const string json_str = write( value, pretty_print );
+    //
+    template< class Value_type >
+    typename Value_type::String_type write_string( const Value_type& value, unsigned int options = 0 )
+    {
+        typedef typename Value_type::String_type::value_type Char_type;
+
+        std::basic_ostringstream< Char_type > os;
+
+        write_stream( value, os, options );
+
+        return os.str();
+    }
+}
+
+#endif
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index a46d742..e09246d 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -5,18 +5,20 @@ if ( ENABLE_PYTHON )
               TYPE PYTHON
               ARGS coast.py
               RESOURCES coast.py 
-              ENVIRONMENT PYTHONPATH=${MAG_PYTHON_PATH} )
+              ENVIRONMENT PYTHONPATH=${MAG_PYTHON_PATH} MAGPLUS_HOME=${CMAKE_SOURCE_DIR} )
 endif()
 
 if ( ENABLE_FORTRAN) 
     ecbuild_add_test( TARGET basic_fortran_shared
             SOURCES   coast.f90
-            LIBS      MagPlusSingle MagPlusShared
+            LIBS      MagPlusSingleShared MagPlusShared
+            ENVIRONMENT MAGPLUS_HOME=${CMAKE_SOURCE_DIR}
             LINKER_LANGUAGE Fortran )
     if ( ENABLE_STATIC_LIBRARY )
         ecbuild_add_test( TARGET basic_fortran_static
             SOURCES   coast.f90
-            LIBS      MagPlusSingle MagPlusStatic ${MAGICS_EXTRA_LIBRARIES} 
+            LIBS      MagPlusSingleStatic MagPlusStatic ${MAGICS_EXTRA_LIBRARIES} 
+            ENVIRONMENT MAGPLUS_HOME=${CMAKE_SOURCE_DIR}
             LINKER_LANGUAGE Fortran )       
      endif()
 endif()
@@ -27,19 +29,21 @@ if ( ENABLE_BUFR )
                   TYPE PYTHON
                   ARGS bufr.py
                   RESOURCES bufr.py data.bufr 
-                  ENVIRONMENT PYTHONPATH=${MAG_PYTHON_PATH} )
+                  ENVIRONMENT PYTHONPATH=${MAG_PYTHON_PATH} MAGPLUS_HOME=${CMAKE_SOURCE_DIR})
     endif()
     if ( ENABLE_FORTRAN) 
         ecbuild_add_test( TARGET bufr_fortran
                 SOURCES   bufr.f90
-                LIBS      MagPlusSingle MagPlusShared
+                LIBS      MagPlusSingleShared MagPlusShared
                 RESOURCES data.bufr
-                LINKER_LANGUAGE Fortran )
+                LINKER_LANGUAGE Fortran 
+                ENVIRONMENT MAGPLUS_HOME=${CMAKE_SOURCE_DIR})
         if ( ENABLE_STATIC_LIBRARY )
              ecbuild_add_test( TARGET bufr_fortran_static
                     SOURCES   bufr.f90
                     RESOURCES data.bufr
-                    LIBS      MagPlusSingle MagPlusStatic
+                    LIBS      MagPlusSingleStatic MagPlusStatic
+                    ENVIRONMENT MAGPLUS_HOME=${CMAKE_SOURCE_DIR}
                     LINKER_LANGUAGE Fortran )       
          endif()
     endif()
@@ -54,13 +58,14 @@ if ( ENABLE_GRIB )
                   TYPE PYTHON
                   ARGS grib.py
                   RESOURCES grib.py data.grib
-                  ENVIRONMENT PYTHONPATH=${MAG_PYTHON_PATH} )
+                  ENVIRONMENT PYTHONPATH=${MAG_PYTHON_PATH}  MAGPLUS_HOME=${CMAKE_SOURCE_DIR})
     endif()
     if ( ENABLE_FORTRAN) 
         ecbuild_add_test( TARGET grib_fortran
                 SOURCES   grib.f90
-                LIBS      MagPlusSingle MagPlusShared
+                LIBS      MagPlusSingleShared MagPlusShared
                 RESOURCES data.grib
+                ENVIRONMENT MAGPLUS_HOME=${CMAKE_SOURCE_DIR}
                 LINKER_LANGUAGE Fortran )
     endif()
 endif()
@@ -73,12 +78,13 @@ if ( ENABLE_CAIRO )
                   TYPE PYTHON
                   ARGS cairo.py
                   RESOURCES cairo.py 
-                  ENVIRONMENT PYTHONPATH=${MAG_PYTHON_PATH} )
+                  ENVIRONMENT PYTHONPATH=${MAG_PYTHON_PATH}  MAGPLUS_HOME=${CMAKE_SOURCE_DIR})
     endif()
       if ( ENABLE_FORTTAN )
         ecbuild_add_test( TARGET cairo_fortran
                 SOURCES   cairo.f90
-                LIBS      MagPlusSingle MagPlusShared
+                LIBS      MagPlusSingleShared MagPlusShared
+                ENVIRONMENT MAGPLUS_HOME=${CMAKE_SOURCE_DIR}
                 LINKER_LANGUAGE Fortran )
     endif()
 endif()
@@ -89,7 +95,7 @@ if ( ENABLE_ODB )
                   TYPE PYTHON
                   ARGS odb.py
                   RESOURCES odb.py test.odb
-                  ENVIRONMENT PYTHONPATH=${MAG_PYTHON_PATH} )
+                  ENVIRONMENT PYTHONPATH=${MAG_PYTHON_PATH} MAGPLUS_HOME=${CMAKE_SOURCE_DIR} )
     endif()
 endif()
 
diff --git a/test/grib.f90 b/test/grib.f90
index 39e0996..0048238 100644
--- a/test/grib.f90
+++ b/test/grib.f90
@@ -19,14 +19,15 @@
 	call preset('grib_id')
 	call preset('grib_input_file_name')
 
+	call psetc("contour_automatic_setting", "ecchart")
 	call pcont
 
+	call preset('contour_automatic_setting')
 
 	call psetc("map_grid_colour", "tan")
 	call psetc("map_grid", "on")
 	call psetc("map_coastline_colour", "tan")
 	call pcoast
-	call ptext
 
 	call preset('map_grid_colour')
 	call preset('map_grid')
diff --git a/test/grib.py b/test/grib.py
index 918fca2..d7c84d1 100644
--- a/test/grib.py
+++ b/test/grib.py
@@ -27,6 +27,8 @@ europe = mmap(
 
 coast = mcoast(map_grid='on', map_grid_colour='tan',
                map_coastline_colour='tan',
+               map_coastline_land_shade='on',
+               map_coastline_sea_shade='on',
                )
 
 # Import the z500 data
@@ -36,7 +38,7 @@ data = mgrib(grib_input_file_name='data.grib',
 
 
 
-cont = mcont()
+cont = mcont(contour_automatic_setting='ecchart')
 
 title = \
     mtext(text_lines=["<font size='1'>Grib Field</font>"
@@ -64,7 +66,6 @@ legend = mlegend(
 # To the plot
 
 print "plot"
-plot( output,  europe, data, cont, coast, )
-tofortran(ref, output,  europe, data, cont, coast, )
+plot( output,  europe, data, cont, coast, title)
 
 
diff --git a/tools/metview.py b/tools/metview.py
new file mode 100644
index 0000000..d656db0
--- /dev/null
+++ b/tools/metview.py
@@ -0,0 +1,17 @@
+
+from subprocess import call
+
+
+xmldir = "../src/params/"
+mvdir = "../metview_files/"
+icons = [ { "class" : "MTHERMOGRID", "file": "TephiGrid.xml" } ] 
+icons = [ { "class" : "MCONT", "file": "Contour.xml" } ] 
+
+
+for i in icons:
+    c = i["class"]
+    deffile = mvdir + c + "Def" 
+    rulesfile = mvdir + c + "Rules" 
+    call(["python", "xml2mv.py", xmldir + i["file"], deffile, c, rulesfile])
+
+
diff --git a/tools/x b/tools/x
index fca8244..c8e8a13 100644
--- a/tools/x
+++ b/tools/x
@@ -1,376 +1 @@
-<magics>
-<class xmltag="text" name="TextVisitor" xml_data="text_lines" directory="basic" prefix="text" xml_doc_inherits="XmlBasicNode" action="ptext">
-  	<documentation>	</documentation>
-  
-
- 	<parameter from="string" name="text_html" default="on" metview="no" member="html" to="bool">
-         		<release>2.0		</release>
-         		<release_info> Change the default value from off to on in Magics2.12		</release_info>
-         		<documentation> enable use of HTML convention 		</documentation>
-  	</parameter>
-
-
- 	<parameter member="count" to="int" default="1" from="int" name="text_line_count">
-         		<release>0.1		</release>
-         		<release_info>deprecated parameter : see text_lines 		</release_info>
-         		<documentation> The number of lines of text to be plotted 		</documentation>
-         		<set name="text_line_1" value="1/2/3/4/5/6/7/8/9/10">		</set>
-         		<set name="text_line_2" value="2/3/4/5/6/7/8/9/10">		</set>
-         		<set name="text_line_3" value="3/4/5/6/7/8/9/10">		</set>
-         		<set name="text_line_4" value="4/5/6/7/8/9/10">		</set>
-         		<set name="text_line_5" value="5/6/7/8/9/10">		</set>
-         		<set name="text_line_6" value="6/7/8/9/10">		</set>
-         		<set name="text_line_7" value="7/8/9/10">		</set>
-         		<set name="text_line_8" value="8/9/10">		</set>
-         		<set name="text_line_9" value="9/10">		</set>
-         		<set name="text_line_10" value="10">		</set>
- 	</parameter>
-
-  	<parameter member="line1" to="string" default="<magics_title/>" from="string" name="text_line_1">
-         		<release>0.1		</release>    
-         		<release_info>deprecated parameter : see text_lines 		</release_info>
-         		<documentation> Character string for holding lines of text (n=1,10) 		</documentation>
-  	</parameter>
-  
- 	<parameter member="line2" to="string" default="" from="string" name="text_line_2">
-         		<release>0.1		</release>    
-         		<release_info>deprecated parameter : see text_lines 		</release_info>
-         		<documentation> Character string for holding lines of text (n=1,10) 		</documentation>
-  	</parameter>
-  
-   	<parameter member="line3" to="string" default="" from="string" name="text_line_3">
-         		<release>0.1		</release>    
-         		<release_info>deprecated parameter : see text_lines 		</release_info>
-         		<documentation> Character string for holding lines of text (n=1,10) 		</documentation>
-  	</parameter>
-  
-   	<parameter member="line4" to="string" default="" from="string" name="text_line_4">
-         		<release>0.1		</release>    
-         		<release_info>deprecated parameter : see text_lines 		</release_info>
-         		<documentation> Character string for holding lines of text (n=1,10) 		</documentation>
-  	</parameter>
-  
-   	<parameter member="line5" to="string" default="" from="string" name="text_line_5">
-         		<release>0.1		</release>    
-         		<release_info>deprecated parameter : see text_lines 		</release_info>
-         		<documentation> Character string for holding lines of text (n=1,10) 		</documentation>
-  	</parameter>
-  
-   	<parameter member="line6" to="string" default="" from="string" name="text_line_6">
-         		<release>0.1		</release>    
-         		<release_info>deprecated parameter : see text_lines 		</release_info>
-         		<documentation> Character string for holding lines of text (n=1,10) 		</documentation>
-  	</parameter>
-
-   	<parameter member="line7" to="string" default="" from="string" name="text_line_7">
-         		<release>0.1		</release>    
-         		<release_info>deprecated parameter : see text_lines 		</release_info>
-         		<documentation> Character string for holding lines of text (n=1,10) 		</documentation>
-  	</parameter>
-  
-   	<parameter member="line8" to="string" default="" from="string" name="text_line_8">
-         		<release>0.1		</release>    
-         		<release_info>deprecated parameter : see text_lines 		</release_info>
-         		<documentation> Character string for holding lines of text (n=1,10) 		</documentation>
-  	</parameter>
-  
-   	<parameter member="line9" to="string" default="" from="string" name="text_line_9">
-         		<release>0.1		</release>    
-         		<release_info>deprecated parameter : see text_lines 		</release_info>
-         		<documentation> Character string for holding lines of text (n=1,10) 		</documentation>
-  	</parameter>
-  
-   	<parameter member="line10" to="string" default="" from="string" name="text_line_10">
-         		<release>0.1		</release>    
-         		<release_info>deprecated parameter : see text_lines 		</release_info>
-         		<documentation> Character string for holding lines of text (n=1,10) 		</documentation>
-  	</parameter>
-  
-
-  	<parameter from="int" name="text_first_line" default="1" metview="no" member="first" to="int">
-          		<release>0.1		</release>    
-         		<release_info>deprecated parameter : see text_lines 		</release_info>
-         		<documentation> The first line in the text block to be plotted 		</documentation>
-  	</parameter>
-  
-
-  	<parameter from="string" name="text_colour" default="blue" member="font_colour" to="Colour" metview_default="navy">
-			<documentation>Colour of text in text block (Full choice of colours)		</documentation>
-			<release>1.0		</release>
-  	</parameter>
-
-  	<parameter xml="font" from="string" name="text_font" default="sansserif" member="font" to="string">
-			<documentation>Font name - please make sure this font is installed!		</documentation>
-			<release>1.0		</release>
-			<release_info>Much improved in version 1.3.		</release_info>
-  	</parameter>
-  
-  	<parameter member="font_style" to="string" default="normal" from="string" name="text_font_style">
-			<documentation>Font style. Set this to an empty string in order to remove all styling.		</documentation>
-  	</parameter>
-  
-  	<parameter from="string" name="text_font_size" default="0.5" member="font_dimension" to="string" metview_default="0.3">
-			<documentation>Font size, specified in cm.		</documentation>
-  	</parameter>
-
-  	<parameter member="justification" to="Justification" default="centre" from="string" name="text_justification">
-			<release>Magisc++0.3		</release>
-			<documentation> How text is to be positioned in each line (LEFT/CENTRE/RIGHT)		</documentation>
-  	</parameter>
-
-
-   	<parameter from="string" name="text_automatic" visible="no" default="on" member="automatic" to="bool">
-			<release>Magisc++2.1		</release>
-			<documentation>How text is to be positioned in each line (LEFT/CENTRE/RIGHT)		</documentation>
-  	</parameter>
-
-  	<parameter member="lines" to="stringarray" default="stringarray()" from="stringarray" name="text_lines">
-         		<documentation> text block to be plotted 		</documentation>
-         		<migration> New Magics: Parameter text sent to new Magics[TextAction].  		</migration>
-  	</parameter>
- 	<parameter from="string" name="text_mode" default="title" member="mode" to="string" values="title/positional">
- 			<documentation>Whether text is to be a title or user positioned (TITLE/POSITIONAL)		</documentation>
-    		<set name="text_box_x_position" value="positional">		</set>
-    		<set name="text_box_y_position" value="positional">		</set>
-    		<set name="text_box_x_length" value="positional">		</set>
-    		<set name="text_box_y_length" value="positional">		</set>
-			<release>1.0		</release>
-  	</parameter>
-    	<parameter member="x" to="float" default="-1" from="float" name="text_box_x_position">
-         		<release>0.1		</release>
-         		<documentation> X coordinate of lower left corner of text box (Relative to PAGE_X_POSITION) 		</documentation>
-  	</parameter>
-
-  	<parameter member="y" to="float" default="-1" from="float" name="text_box_y_position">
-         		<release>0.1		</release>
-         		<documentation> Y coordinate of lower left corner of text box (Relative to PAGE_Y_POSITION) 		</documentation>
-  	</parameter>
-
-  	<parameter member="width" to="float" default="-1" from="float" name="text_box_x_length">
-         		<release>0.1		</release>
-         		<documentation> Length of text box in X direction 		</documentation>
-  	</parameter>
-
-  	<parameter xml="height" from="float" name="text_box_y_length" default="-1" member="height" to="float">
-         		<release>0.1		</release>
-         		<migration> New Magics: Parameter text_box_y_length sent to new Magics[TextBox].  		</migration>
-  	</parameter>
-
-  	<parameter member="blanking" to="bool" default="off" from="string" name="text_box_blanking">
-         		<release>0.1		</release>
-          		<release_info>Paremeter defined but not implemeted : expected for 0.6		</release_info>
-         		<documentation> All plotting in the text box previous to PTEXT call will be blanked out. Plotting after PTEXT call will not be affected. (ON/OFF) 		</documentation>
-  	</parameter>
-
-  	<parameter member="border" to="bool" default="off" from="string" name="text_border">
-         		<release>0.5		</release>    
-         		<documentation> Plot border around text box (ON/OFF) 		</documentation>
-         		<migration> New Magics: Parameter text_border sent to new Magics[TextBox].  		</migration>
-         		<set name="text_border_line_style" value="on">		</set>
-         		<set name="text_border_colour" value="on">		</set>
-         		<set name="text_border_thickness" value="on">		</set>
-      
-  	</parameter>
-  
-  	<parameter member="border_line_style" to="LineStyle" default="solid" from="string" name="text_border_line_style">
-          		<release>0.5		</release>    
-         		<documentation> Line style of border around text box (SOLID/DASH/DOT/CHAIN_DASH/CHAIN_DOT) 		</documentation>
-  	</parameter>
-
-  	<parameter member="border_colour" to="Colour" default="blue" from="string" name="text_border_colour">
-          		<release>0.5		</release>    
-         		<documentation> Colour of border around text box (Full choice of colours) 		</documentation>
-  	</parameter>
-
-  	<parameter member="border_thickness" to="int" default="1" from="int" name="text_border_thickness">
-          		<release>0.5		</release>    
-         		<documentation> Thickness of text box border 		</documentation>
-  	</parameter>
-  
-    
-   	<parameter from="string" name="text_character_1" default="" metview="no" member="character1" to="string">
-         		<documentation> 10 MAGICS parameters enabling users to store CHARACTER info for plotting in text lines (n=1,10) 		</documentation>
-  	</parameter>
-  
-  	<parameter from="string" name="text_character_2" default="" metview="no" member="character2" to="string">
-         		<documentation> 10 MAGICS parameters enabling users to store CHARACTER info for plotting in text lines (n=1,10) 		</documentation>
-  	</parameter>
-  	<parameter from="string" name="text_character_3" default="" metview="no" member="character3" to="string">
-         		<documentation> 10 MAGICS parameters enabling users to store CHARACTER info for plotting in text lines (n=1,10) 		</documentation>
-  	</parameter>
-  	<parameter from="string" name="text_character_4" default="" metview="no" member="character4" to="string">
-         		<documentation> 10 MAGICS parameters enabling users to store CHARACTER info for plotting in text lines (n=1,10) 		</documentation>
-  	</parameter>
-  	<parameter from="string" name="text_character_5" default="" metview="no" member="character5" to="string">
-         		<documentation> 10 MAGICS parameters enabling users to store CHARACTER info for plotting in text lines (n=1,10) 		</documentation>
-  	</parameter>
-  	<parameter from="string" name="text_character_6" default="" metview="no" member="character6" to="string">
-         		<documentation> 10 MAGICS parameters enabling users to store CHARACTER info for plotting in text lines (n=1,10) 		</documentation>
-  	</parameter>
-  	<parameter from="string" name="text_character_7" default="" metview="no" member="character7" to="string">
-         		<documentation> 10 MAGICS parameters enabling users to store CHARACTER info for plotting in text lines (n=1,10) 		</documentation>
-  	</parameter>
-  	<parameter from="string" name="text_character_8" default="" metview="no" member="character8" to="string">
-         		<documentation> 10 MAGICS parameters enabling users to store CHARACTER info for plotting in text lines (n=1,10) 		</documentation>
-  	</parameter>
-  	<parameter from="string" name="text_character_9" default="" metview="no" member="character9" to="string">
-         		<documentation> 10 MAGICS parameters enabling users to store CHARACTER info for plotting in text lines (n=1,10) 		</documentation>
-  	</parameter>
-  	<parameter from="string" name="text_character_10" default="" metview="no" member="character10" to="string">
-         		<documentation> 10 MAGICS parameters enabling users to store CHARACTER info for plotting in text lines (n=1,10) 		</documentation>
-  	</parameter>
-
-  	<parameter from="int" name="text_integer_1" default="0" metview="no" member="integer1" to="int">
-          		<release_info>Needs user input to see the possible evolution of this parameter		</release_info>
-         		<documentation> 10 MAGICS parameters enabling users to store INTEGER info for plotting in text lines (n=1,10) 		</documentation>
-  	</parameter>
-  
-  
-   	<parameter from="int" name="text_integer_2" default="0" metview="no" member="integer2" to="int">
-          		<release_info>Needs user input to see the possible evolution of this parameter		</release_info>
-         		<documentation> 10 MAGICS parameters enabling users to store INTEGER info for plotting in text lines (n=1,10) 		</documentation>
-  	</parameter>
-   	<parameter from="int" name="text_integer_3" default="0" metview="no" member="integer3" to="int">
-          		<release_info>Needs user input to see the possible evolution of this parameter		</release_info>
-         		<documentation> 10 MAGICS parameters enabling users to store INTEGER info for plotting in text lines (n=1,10) 		</documentation>
-  	</parameter>
-   	<parameter from="int" name="text_integer_4" default="0" metview="no" member="integer4" to="int">
-          		<release_info>Needs user input to see the possible evolution of this parameter		</release_info>
-         		<documentation> 10 MAGICS parameters enabling users to store INTEGER info for plotting in text lines (n=1,10) 		</documentation>
-  	</parameter>
-   	<parameter from="int" name="text_integer_5" default="0" metview="no" member="integer5" to="int">
-          		<release_info>Needs user input to see the possible evolution of this parameter		</release_info>
-         		<documentation> 10 MAGICS parameters enabling users to store INTEGER info for plotting in text lines (n=1,10) 		</documentation>
-  	</parameter>
-   	<parameter from="int" name="text_integer_6" default="0" metview="no" member="integer6" to="int">
-          		<release_info>Needs user input to see the possible evolution of this parameter		</release_info>
-         		<documentation> 10 MAGICS parameters enabling users to store INTEGER info for plotting in text lines (n=1,10) 		</documentation>
-  	</parameter>
-   	<parameter from="int" name="text_integer_7" default="0" metview="no" member="integer7" to="int">
-          		<release_info>Needs user input to see the possible evolution of this parameter		</release_info>
-         		<documentation> 10 MAGICS parameters enabling users to store INTEGER info for plotting in text lines (n=1,10) 		</documentation>
-  	</parameter>
-   	<parameter from="int" name="text_integer_8" default="0" metview="no" member="integer8" to="int">
-          		<release_info>Needs user input to see the possible evolution of this parameter		</release_info>
-         		<documentation> 10 MAGICS parameters enabling users to store INTEGER info for plotting in text lines (n=1,10) 		</documentation>
-  	</parameter>
-   	<parameter from="int" name="text_integer_9" default="0" metview="no" member="integer9" to="int">
-          		<release_info>Needs user input to see the possible evolution of this parameter		</release_info>
-         		<documentation> 10 MAGICS parameters enabling users to store INTEGER info for plotting in text lines (n=1,10) 		</documentation>
-  	</parameter>
-   	<parameter from="int" name="text_integer_10" default="0" metview="no" member="integer10" to="int">
-          		<release_info>Needs user input to see the possible evolution of this parameter		</release_info>
-         		<documentation> 10 MAGICS parameters enabling users to store INTEGER info for plotting in text lines (n=1,10) 		</documentation>
-  	</parameter>
-
-  	<parameter from="float" name="text_real_1" default="0" metview="no" member="real1" to="float">
-          		<release_info>Needs user input to see the possible evolution of this parameter		</release_info>
-         		<documentation> 10 MAGICS parameters enabling users to store REAL information for plotting in text lines (n=1,10) 		</documentation>
-  	</parameter>
-  
-   	<parameter from="float" name="text_real_2" default="0" metview="no" member="real2" to="float">
-          		<release_info>Needs user input to see the possible evolution of this parameter		</release_info>
-         		<documentation> 10 MAGICS parameters enabling users to store REAL information for plotting in text lines (n=1,10) 		</documentation>
-  	</parameter>
-   	<parameter from="float" name="text_real_3" default="0" metview="no" member="real3" to="float">
-          		<release_info>Needs user input to see the possible evolution of this parameter		</release_info>
-         		<documentation> 10 MAGICS parameters enabling users to store REAL information for plotting in text lines (n=1,10) 		</documentation>
-  	</parameter>
-   	<parameter from="float" name="text_real_4" default="0" metview="no" member="real4" to="float">
-          		<release_info>Needs user input to see the possible evolution of this parameter		</release_info>
-         		<documentation> 10 MAGICS parameters enabling users to store REAL information for plotting in text lines (n=1,10) 		</documentation>
-  	</parameter>
-   	<parameter from="float" name="text_real_5" default="0" metview="no" member="real5" to="float">
-          		<release_info>Needs user input to see the possible evolution of this parameter		</release_info>
-         		<documentation> 10 MAGICS parameters enabling users to store REAL information for plotting in text lines (n=1,10) 		</documentation>
-  	</parameter>
-   	<parameter from="float" name="text_real_6" default="0" metview="no" member="real6" to="float">
-          		<release_info>Needs user input to see the possible evolution of this parameter		</release_info>
-         		<documentation> 10 MAGICS parameters enabling users to store REAL information for plotting in text lines (n=1,10) 		</documentation>
-  	</parameter>
-   	<parameter from="float" name="text_real_7" default="0" metview="no" member="real7" to="float">
-          		<release_info>Needs user input to see the possible evolution of this parameter		</release_info>
-         		<documentation> 10 MAGICS parameters enabling users to store REAL information for plotting in text lines (n=1,10) 		</documentation>
-  	</parameter>
-   	<parameter from="float" name="text_real_8" default="0" metview="no" member="real8" to="float">
-          		<release_info>Needs user input to see the possible evolution of this parameter		</release_info>
-         		<documentation> 10 MAGICS parameters enabling users to store REAL information for plotting in text lines (n=1,10) 		</documentation>
-  	</parameter>
-   	<parameter from="float" name="text_real_9" default="0" metview="no" member="real9" to="float">
-          		<release_info>Needs user input to see the possible evolution of this parameter		</release_info>
-         		<documentation> 10 MAGICS parameters enabling users to store REAL information for plotting in text lines (n=1,10) 		</documentation>
-  	</parameter>
-   	<parameter from="float" name="text_real_10" default="0" metview="no" member="real10" to="float">
-          		<release_info>Needs user input to see the possible evolution of this parameter		</release_info>
-         		<documentation> 10 MAGICS parameters enabling users to store REAL information for plotting in text lines (n=1,10) 		</documentation>
-  	</parameter>
-  
-  	<parameter from="float" name="text_line_height_ratio_1" default="1" metview="no" member="height_ratio_1" to="float">
-         		<release_info>Needs user input to see the possible evolution of this parameter		</release_info>
-         		<documentation> Ratio of height of text lines to text reference character height (n=1,10). See main text 		</documentation>
-  	</parameter>
-  
-  	<parameter from="float" name="text_line_height_ratio_2" default="1" metview="no" member="height_ratio_2" to="float">
-         		<release_info>Needs user input to see the possible evolution of this parameter		</release_info>
-         		<documentation> Ratio of height of text lines to text reference character height (n=1,10). See main text 		</documentation>
-  	</parameter>
-  	<parameter from="float" name="text_line_height_ratio_3" default="1" metview="no" member="height_ratio_3" to="float">
-         		<release_info>Needs user input to see the possible evolution of this parameter		</release_info>
-         		<documentation> Ratio of height of text lines to text reference character height (n=1,10). See main text 		</documentation>
-  	</parameter>
-  	<parameter from="float" name="text_line_height_ratio_4" default="1" metview="no" member="height_ratio_4" to="float">
-         		<release_info>Needs user input to see the possible evolution of this parameter		</release_info>
-         		<documentation> Ratio of height of text lines to text reference character height (n=1,10). See main text 		</documentation>
-  	</parameter>
-  	<parameter from="float" name="text_line_height_ratio_5" default="1" metview="no" member="height_ratio_5" to="float">
-         		<release_info>Needs user input to see the possible evolution of this parameter		</release_info>
-         		<documentation> Ratio of height of text lines to text reference character height (n=1,10). See main text 		</documentation>
-  	</parameter>
-  	<parameter from="float" name="text_line_height_ratio_6" default="1" metview="no" member="height_ratio_6" to="float">
-         		<release_info>Needs user input to see the possible evolution of this parameter		</release_info>
-         		<documentation> Ratio of height of text lines to text reference character height (n=1,10). See main text 		</documentation>
-  	</parameter>
-  	<parameter from="float" name="text_line_height_ratio_7" default="1" metview="no" member="height_ratio_7" to="float">
-         		<release_info>Needs user input to see the possible evolution of this parameter		</release_info>
-         		<documentation> Ratio of height of text lines to text reference character height (n=1,10). See main text 		</documentation>
-  	</parameter>
-  	<parameter from="float" name="text_line_height_ratio_8" default="1" metview="no" member="height_ratio_8" to="float">
-         		<release_info>Needs user input to see the possible evolution of this parameter		</release_info>
-         		<documentation> Ratio of height of text lines to text reference character height (n=1,10). See main text 		</documentation>
-  	</parameter>
-  	<parameter from="float" name="text_line_height_ratio_9" default="1" metview="no" member="height_ratio_9" to="float">
-         		<release_info>Needs user input to see the possible evolution of this parameter		</release_info>
-         		<documentation> Ratio of height of text lines to text reference character height (n=1,10). See main text 		</documentation>
-  	</parameter>
-  
-  	<parameter from="float" name="text_line_height_ratio_10" default="1" metview="no" member="height_ratio_10" to="float">
-         		<release_info>Needs user input to see the possible evolution of this parameter		</release_info>
-         		<documentation> Ratio of height of text lines to text reference character height (n=1,10). See main text 		</documentation>
-  	</parameter>
-
- 
-  	<parameter from="string" name="text_instruction_shift_character" default="\" metview="no" member="text_instruction_shift_character" to="string" implemented="no">
-         		<documentation> Symbol or character for indicating that an Instruction String follows 		</documentation>
-  	</parameter>
-
-  	<parameter from="string" name="text_escape_character" default="#" member="text_escape_character" to="string" implemented="no">
-         		<documentation> Symbol or character followed by 3 octal numbers - see one of Figure XIV-1 to Figure XIV-3 		</documentation>
-  	</parameter>
-
-  	<parameter from="string" name="text_parameter_escape_character" default="@" metview="no" member="parameter_escape" to="string">
-         		<documentation> Symbol or character for indicating that a MAGICS parameter follows. The MAGICS parameter is also terminated by the same symbol or character 		</documentation>
-  	</parameter>
-  
-  	<parameter xml="line_height_ratios" from="floatarray" name="text_line_height_ratios" default="floatarray()" metview="no" member="height_ratios" to="floatarray">
-         		<release_info>Needs user input to see the possible evolution of this parameter		</release_info>
-         		<documentation> Ratio of height of text lines to text reference character height (n=1,10). See main text 		</documentation>
-  	</parameter>
-
-  	<parameter priory="0" from="float" name="text_line_space_ratio" default="1.5" member="text_line_space_ratio" to="float" implemented="no">
-         		<release_info>Needs user input to see the possible evolution of this parameter		</release_info>
-         		<documentation> Ratio of space above and below each line to text reference character height. See main text 		</documentation>
-  	</parameter>
-
-</class>
-</magics>
-
+DONE
diff --git a/tools/xml2mv.pl b/tools/xml2mv.pl
index 1fb7d0e..f73f118 100755
--- a/tools/xml2mv.pl
+++ b/tools/xml2mv.pl
@@ -398,7 +398,7 @@ EOF
     		"AxisAutomaticSetting" => 1,
             "ArrowPosition" =>1, 
 	        "Justification" => 1,
-	        "Position" => 1,
+		"Position" => 1,
             "ListPolicy" => 1,
             "stringarray" =>1,
             "bool" =>1,
@@ -483,7 +483,7 @@ EOF
          }
          else {
          	    print "\t\tstring $member\_s = request.countValues(\"$name\") ?  (string) request(\"$name\") : \"$mv_default\";\n";
-         	    print "\t\tMagLog::dev() << \" $name set to \" << $member\_s << endl;\n";
+         	    print "\t\tMagLog::debug() << \" $name set to \" << $member\_s << endl;\n";
          	   	print "\t\t$wrapper_t* $member\_w = 0;\n";
                 print "#ifdef MAGICS_EXCEPTION\n";
                 print "\t\ttry\n";
diff --git a/tools/xml2mv.py b/tools/xml2mv.py
old mode 100644
new mode 100755
index 6c9d2a5..5a072fe
--- a/tools/xml2mv.py
+++ b/tools/xml2mv.py
@@ -6,7 +6,7 @@ from types import *
 import sys
 
 
-if(len(sys.argv) != 5) :
+if(len(sys.argv) != 6) :
     print "\n\tYou need to give 4 input parameters:"
     print "\n\t  %s source.xml targetDef CLASS_NAME rulesDef\n" % sys.argv[0]
     sys.exit()
@@ -53,8 +53,6 @@ class ObjectHandler(ContentHandler):
 	ignore = False
 	mydef = []   # the growing list of parameters
 	param = ""
-	tag = ""
-	doc = "Documentation"
 	myoptions = []
 	optionalparams  = {}
 	optionalparams2 = {}  # see reorganiseOptionalParameters()
@@ -65,7 +63,6 @@ class ObjectHandler(ContentHandler):
 	classes = {}
 	#inheritedlast = ""
 	unset = {}
-	current = {}
 	filehistory = []  # a list of files we have opened (so that we don't open the same one twice)
 	debug = 0  # gives some output on stdout
 	toplevel = True
@@ -87,6 +84,10 @@ class ObjectHandler(ContentHandler):
 			return "-1.0E21"
 		if (val.upper() == "INT_MAX"):
 			return "1.0E21"
+		if (val.upper() == "-LLONG_MAX"):
+			return "-1.0E21"
+		if (val.upper() == "LLONG_MAX"):
+			return "1.0E21"
 		if (val == "floatarray()"):
 			return "''"
 		if (val == "intarray()"):
@@ -115,11 +116,8 @@ class ObjectHandler(ContentHandler):
 			self.file.write(" %s='%s'" % (key.upper() , attrs.getValue(key).upper()))
 		self.file.write(">\n")
 
-	def characters(self, content):
-		
-		if ( self.tag == "documentation" ) : 				
-				self.doc += content.lstrip();
-			
+	def characters(self, data):
+		pass
 	
 
 	# addhidden - if the appropriate flag is set in the attributes, return the text that will
@@ -131,7 +129,7 @@ class ObjectHandler(ContentHandler):
 			return ""
 
 	def toggle(self, attrs):
-		s = "\t%s [ help_text = '%s' ]\n %s\t{\n" % (attrs.get("name").upper(), self.doc.strip(), self.addhidden(attrs))
+		s = "\t%s\n%s\t{\n" % (attrs.get("name").upper(), self.addhidden(attrs))
 		s = s + "\t\tON;  ON\n"
 		s = s + "\t\tOFF; OFF\n"
 		s = s + "\t} = %s\n" % self.default(attrs).upper()
@@ -165,7 +163,7 @@ class ObjectHandler(ContentHandler):
 
 
 	def number(self, attrs):
-		s = "\t%s[ help_text = '%s' ]\n%s\t{\n" % (attrs.get("name").upper(), self.doc.strip(), self.addhidden(attrs))
+		s = "\t%s\n%s\t{\n" % (attrs.get("name").upper(), self.addhidden(attrs))
 		s = s + "\t\t*\n"
 		s = s + "\t} = %s\n" % self.default(attrs).upper()
 		return s
@@ -182,12 +180,12 @@ class ObjectHandler(ContentHandler):
 
 	def listofstrings(self, attrs):
 		if (attrs.get("colourlist") == "on" ) :
-			 s = "\t%s [ help = help_colour,interface = colour, help_text='%s' ]\n%s\t{ \n" % (attrs.get("name").upper(), self.doc.strip(), self.addhidden(attrs))
+			 s = "\t%s [ help = help_colour,interface = colour ]\n%s\t{ \n" % (attrs.get("name").upper(), self.addhidden(attrs))
 			 s = s + "\t\t&PARAMSHARE&COLOUR"
 			 s = s + "\t\t/\n"
 			 s = s + "\t} = %s\n" % self.default(attrs).upper()
 		elif (attrs.get("countrylist") == "on" ):
-			s = "\t%s [ help = help_multiple_selection, exclusive = False, help_text='%s']\n%s\t{\n" % (attrs.get("name").upper(), self.doc.strip(), self.addhidden(attrs) )
+			s = "\t%s [ help = help_multiple_selection, exclusive = False ]\n%s\t{\n" % (attrs.get("name").upper(),self.addhidden(attrs) )
 			countries = attrs.get("values").split("/")
 			for c in countries:
 				parts = c.split(':')
@@ -209,7 +207,7 @@ class ObjectHandler(ContentHandler):
 
 
 	def colour(self, attrs):
-		s = "\t%s [ help = help_colour,interface = colour, help_text='%s' ]\n%s\t{ \n" % (attrs.get("name").upper(), self.doc.strip(), self.addhidden(attrs))
+		s = "\t%s [ help = help_colour,interface = colour ]\n%s\t{ \n" % (attrs.get("name").upper(), self.addhidden(attrs))
 		s = s + "\t\t&PARAMSHARE&COLOUR\n"
 		mi = attrs.get("metview_interface")
 		if mi == "ColourWithExtra":
@@ -256,8 +254,7 @@ class ObjectHandler(ContentHandler):
 		return s.upper()
 	def font(self, attrs):
 		s = "\t%s\n%s\t{\n" % (attrs.get("name").upper(), self.addhidden(attrs))
-		s = s + "\t\tserif;serif\n"
-		s = s + "\t\tsansserif;sansserif\n"
+		s = s + "\t\t&PARAMSHARE&FONT\n"
 		s = s + "\t} = %s\n" % self.default(attrs).upper()
 		return s.upper()
 
@@ -513,7 +510,6 @@ class ObjectHandler(ContentHandler):
 
 
 	def startElement(self, name, attrs):
-		self.tag = name;
 		if (name == "magics") :
 			return
 
@@ -531,7 +527,7 @@ class ObjectHandler(ContentHandler):
 			if doc_inherits != 'no' and self.inherits != '' and self.inherits != None:
 				self.classes[self.classname]["inherits_params_from"].add(self.inherits)
 				self.classes[self.classname]["inherits_reqs_from"].add(self.inherits)
-				fname = "xml/%s.xml" % self.inherits
+				fname = "%s/%s.xml" % (sys.argv[1], self.inherits)
 				if not (fname in self.filehistory):  # don't open the same file twice
 					try:
 						file = open(fname, "r")
@@ -560,18 +556,32 @@ class ObjectHandler(ContentHandler):
 						pass
 
 		if (name == "parameter") or (name == "metview_parameter"):
-		
 			self.ignore = False
 			self.param = attrs.get("name")
-			self.current = attrs
 			if (self.debug) :
 				print("  param: " + self.param)
-		   
-			
-				
-		if (name == "documentation"):
-			self.doc = "";
-		
+			if (attrs.get("implemented") == 'no'):
+				return
+			if (attrs.get("metview") == 'no'):
+				return
+			if (attrs.get("visible") == 'no') or (attrs.get("visible") == 'off') or (attrs.get("visible") == 'false'):
+				return
+			if (attrs.get("inherit_parent_reqs") != 'no'):
+				docclass = attrs.get("doc_class", None)
+				if docclass <> None:
+					paramclass = docclass
+				else:
+					paramclass = self.classname
+				self.addParameterToClass(self.param, paramclass)
+			type = attrs.get("to")
+			metview_type = attrs.get("metview_interface")
+			if metview_type <> None:
+				type = metview_type
+			if (self.types.has_key(type)):
+				f = self.types[type]
+				self.newparam(self.param, f(self, attrs), self.default(attrs))
+			else:
+				self.last = self.last + self.options(attrs)
 
 		if (name == "set"):
 			setname = attrs.get("name")
@@ -596,9 +606,9 @@ class ObjectHandler(ContentHandler):
 					#	print "YClass " + attrs.get("name") + " inherits_reqs_from " + self.classname
 					if attrs.get("docdive") != 'no' and  attrs.get("doc_inherits") != 'no' :
 						if ( not(isinstance(attrs.get("xmlfile"), NoneType))):
-							fname = "xml/%s.xml" % attrs.get("xmlfile")
+							fname = "/%s.xml" % attrs.get("xmlfile")
 						else:
-							fname = "xml/%s.xml" % attrs.get("name")
+							fname = "%s/%s.xml" % (sys.argv[1], attrs.get("name"))
 						if not (fname in self.filehistory):  # don't open the same file twice
 							try:
 								file = open(fname, "r")
@@ -650,37 +660,10 @@ class ObjectHandler(ContentHandler):
 
 		if self.ignore:
 			return
-	
-	
-		if (name == "parameter" or name == "metview_parameter") :
+
+		if ((name == "parameter" or name == "metview_parameter") and len(self.myoptions) != 0) :
 		#if (name == "parameter") :
-			print "param"
-			print(self.current)
-			attrs = self.current;
-			
-			if (attrs.get("implemented") == 'no'):
-				return
-			if (attrs.get("metview") == 'no'):
-				return
-			if (attrs.get("visible") == 'no') or (attrs.get("visible") == 'off') or (attrs.get("visible") == 'false'):
-				return
-			if (attrs.get("inherit_parent_reqs") != 'no'):
-				docclass = attrs.get("doc_class", None)
-				if docclass <> None:
-					paramclass = docclass
-				else:
-					paramclass = self.classname
-				self.addParameterToClass(self.param, paramclass)
-			type = attrs.get("to")
-			metview_type = attrs.get("metview_interface")
-			if metview_type <> None:
-				type = metview_type
-			if (self.types.has_key(type)):
-				f = self.types[type]
-				self.newparam(self.param, f(self, attrs), self.default(attrs))
-			else:
-				self.last = self.last + self.options(attrs)
-				
+			#print(self.myoptions)
 			self.last = self.last + "\t} = %s\n" % self.defparam
 			self.newparam(self.param, self.last, self.defparam)
 			if (self.debug) :
@@ -725,7 +708,7 @@ class ObjectHandler(ContentHandler):
 			if self.toplevel:
 				#print "SL (end class): " + self.last
 				#print('opt: ', self.optionalparams)
-				definition = open(sys.argv[2], "w")
+				definition = open(sys.argv[3], "w")
 				definition.write("PARAMSHARE ; ParamShare; PARAMSHARE\n");
 				definition.write("{\n\tCOLOUR {\n\t\t%include MagicsColors.h\n\t}\n")
 				definition.write("\tSTYLE {\n")
@@ -735,8 +718,18 @@ class ObjectHandler(ContentHandler):
 				definition.write("\t\tCHAIN_DOT; CHAIN_DOT\n")
 				definition.write("\t\tCHAIN_DASH; CHAIN_DASH\n")
 				definition.write("\t}\n")
+				definition.write("\tFONT {\n")
+				definition.write("\t\tARIAL; ARIAL\n")
+				definition.write("\t\tCOURIER; COURIER\n")
+				definition.write("\t\tHELVETICA; HELVETICA\n")
+				definition.write("\t\tTIMES; TIMES\n")
+				definition.write("\t\tSERIF; SERIF\n")
+				definition.write("\t\tSANSSERIF; SANSSERIF\n")
+				definition.write("\t\tSYMBOL; SYMBOL\n")
+				definition.write("\t}\n")
 				definition.write("}\n\n")
-				definition.write("%s; Magics; Automatically generated\n{\n" % sys.argv[3])
+
+				definition.write("%s; Magics; Automatically generated\n{\n" % sys.argv[4])
 				for param in self.mydef:
 					#print('PARAM START')
 					#print(param[1])
@@ -774,7 +767,7 @@ class ObjectHandler(ContentHandler):
 
 				# two different ways to generate the rules
 				if False:
-					rules = open(sys.argv[4], "w")
+					rules = open(sys.argv[5], "w")
 					for optparam in self.optionalparams.keys():
 						rules.write("\n%if")
 						first = True
@@ -803,7 +796,7 @@ class ObjectHandler(ContentHandler):
 					#print "\n\n..............................\n"
 					#print self.optionalparams3
 
-					rules = open(sys.argv[4], "w")
+					rules = open(sys.argv[5], "w")
 					#for conditions in self.optionalparams2:
 					for clause in self.optionalparams3:
 						#print "CLAUSE"
@@ -850,6 +843,6 @@ object = ObjectHandler()
 saxparser = make_parser()
 saxparser.setContentHandler(object)
 
-datasource = open(sys.argv[1], "r")
+datasource = open(sys.argv[1] +"/" + sys.argv[2], "r")
 saxparser.parse(datasource)
 print "DONE"
diff --git a/version.sh b/version.sh
index 2151452..4c70c41 100644
--- a/version.sh
+++ b/version.sh
@@ -1,7 +1,7 @@
 #
 # Package name and versioning information for Magics
 #
-MAGICS_PACKAGE_NAME='Magics'
+MAGICS_PACKAGE_NAME='MagicsNew'
 MAGICS_PACKAGE_VERSION='2.20.2'
 MAGICS_PACKAGE_COPYRIGHT_YEAR='2013'
 MAGICS_PACKAGE_COPYRIGHT_PERIOD='2007-2013'

-- 
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