Memory cleanup

Properly cleans up on call to BoutFinalise(). Nearly valgrind clean
Simple meshes created from options

No longer require a grid file to create simple grids. If no
grid file is specified then values are read from options
(by default the "mesh" section). A cartesian mesh can be created using

[mesh]

nx = 10  # X points including boundaries
ny = 10

dx = 0.1  # X grid spacing
dy = 0.1  # Y grid spacing

See examples/test-wave

The metric tensor components g_11, g11 etc could be set.

At the moment only scalars are allowed. Would like to extend this
to expressions using FieldFactory, but not yet.
Fixed initial output and MYG=0 cases. NXPE auto-select

o Initial output time needs to be written after solver->init.
  Moved into bout_solve routine from boutmain.hxx

o Small fixes to mesh and field3d so can run with MYG=0 for 2D problems.
  This allows ny = 1 cases

o If NXPE is not set in the options, BoutMesh tries to find an acceptable
  value automatically.
Improvements to Python DataFile

o Constructor can now be passed write and create flags

d = DataFile("somefile.nc", write=True)   # Append

o Checks if a file has been opened for writing, and raises
  exception if write() is attempted

o Catches opening for append with SciPy library, which doesn't currently support it.
Fixes to Field2D and BoutMesh

o Field2D data block handling changed to use STL::stack
  Fixes invalid frees on exit

o BoutMesh was being too strict in selecting NXPE, causing
  drift instability test to fail. Now fixed
Pruning includes, speed compilations

Trying to reduce the number of interdependencies
Fixing CVODE, IDA includes

Missed out boutcomm include (removed from globals)
Small changes to compile on Tornado

o Moved around includes in globals.hxx so mpi.h included first

o boutcomm.cxx used non-standard NULL. Changed to 0
Added test-laplace2 example

For testing different Laplacian inversion methods.
Creates two Laplacian inversion solvers by using
different options for each.

Size of the mesh is determined by settings in the BOUT.inp file
rather than a binary grid file. Makes changing mesh sizes straightforward.
Squash some warnings on HPC-FF

o Mesh::load() returns int
o Div_K_perp_Grad_perp operator not implemented so throws exception
NetCDF-4 new style library support

First version, still very much experimental. New NetCDF libraries
have incompatible C++ interface.
Merge branch 'master' of github.com:bendudson/BOUT
Tidied code
Merging changes
Small bugfix to NetCDF-4 code.

Copy-paste error: When disabled, incorrectly defined NcFormat as NullFormat
Some additions to the user manual

o New way to create simple meshes using options
  in BOUT++, without needing a grid file

o Some comments on Python routines in the appendix
Tidying up configure for NetCDF libraries

o Finds either old style or new style NetCDF libraries

o Currently new style libraries don't work properly.
  Fail with error:

  terminate called after throwing an instance of 'netCDF::exceptions::NcInDefineMode'
  what():  NcInDefineMode: Operation not allowed in define mode

  Even though the C++ interface is supposed to hide the distinction
  between modes.
Small(ish) updates to mesh generator

o Making initial division of the poloidal arcs into cells a bit more
  robust to noise, as this seems to be the original source of noise in hthe

o Catching cases where x-point index isn't found very accurately, messing
  up gridding of the core. Problem appeared for CMOD case.
NetCDF-4 compiles and runs with HDF5 output

Now detects netCDF 4.2.x versions with new-style C++ interface.
Previous problems were mainly due to broken support for "classic64" format,
so output must be in HDF5.

Problem: The IDL and Python routines are currently not set up to work with the
new format. Python may work if the netcdf4 library is available (scipy only supports
classic format for now), but IDL needs code writing to use the HDF5 routines.

Result: Code runs and produces data, but can't yet test if it's correct
Cylindrical equilibria generation

o Modified Cylindrical & Helimak generator to use either NetCDF or PDB files
  (set Format = "pdb" for PDB. Default is NetCDF)

o Modified bout_output.pro so /default keyword results in no prompts

o Added example script

  tools/cyl_and_helimak_grids/generate.pro