Gridgen fix, improvements

o Small fix to process_grid in finding midplane index

o Added parameter to control poloidal spacing of mesh points.
  Setting to 1 spaces points equally along a field-line (at given radial index),
  whilst setting to 0 (default) spaces points equally in poloidal distance as
  done previously
BoutMesh: Bugfix for DND targets

Wasn't adding upper target boundaries. Now inserts additional target plates.
Reverted accidental change to BoutMesh::GlobalX

Slight change to definition of X used in FieldFactory. Broke
many of the test suites as the inputs changed.
Fix bug in handling command-line arguments

Found by Ilon Joseph and Bill Meyer: argc and argv were being copied
by BoutComm, PetscLib and Solver. MPI_Init can modify arguments,
leaving argc inconsistent with argv.

BoutComm, PetscLib and Solver all changed to store pointers to argc, argv
rather than copies.
Tidying up PETSc solvers

o Removing no-longer used ::setup function

o Fixed  PETSc-3.3 which had an old version of the ::init function
Small fix to where(Field2D, Field2D, BoutReal)

Header where.hxx had reference BoutReal&, but source where.cxx
had value BoutReal. Caused linker error.
Bug fixed to relax boundary, Field3D::min and max

o The relax() boundary condition modifier didn't have the
  default relaxation rate set, so "relax(neumann, 10)"
  would work fine, but "relax(neumann)" used an uninitialised
  rate.

o Field3D::min and max functions were modified to improve OpenMP
  performance, but meant they also included guard cells, boundary
  regions etc. Changed back to only include the core cells
Updated lapd-drift test case

Now working again. Reduced Z resolution to 32 for shorter
test runs. Should be increased for production runs.
Bugfix in argument passing

argc,argv were passed by value to BoutInitialise, so
pointers to these copies were stored in Solver, PetscLib etc.
Caused segfault when initialising PETSc solver.
Small fixes and additions

o BoundaryFactory initialisation moved to constructor
  rather than bout++.cxx

o Added Field2D::applyBoundary(region, condition)
  Applies a boundary condition to the given region only

o Fixed small bug in zerolaplace boundary condition for Field2D variables

o Added gyroPade1(Field2D) function for gyro-averaging
IDL tools improvements

o Fix to contour2 color bar, so should display scale more accurately

o grid_contour now works for unbalanced double null cases

o Showdata has /loop keyword to loop an animation

o Small fix to process_grid (part of Hypnotoad), to correct
  the midplane index
Added option to change BoutMesh::GlobalX definition

For reconnection tests, a symmetric input is needed. The default
definition of "x" used to construct initial profiles is not quite
symmetric. To change to a symmetric definition, set:

[mesh]
symmetricGlobalX = true
User can now add custom solver monitor functions

To calculate diagnostics or output custom quantities, a user
can specify a function which will be called every output timestep
(as opposed to internal timestep like physics_run).

Details in the user manual, and toy code in examples/monitor
Reverted change to gyro-averaging flags

Default flags have boundary region width of 1. Changing this
broke the test case, so have reverted.
Fixed BoutMesh::GlobalY for double-null plasmas

Doesn't affect most cases, only where equilibrium is double null.
Now provides a continuous y in [0,2pi] for constructing initial conditions.

In the lower PF region y jumps from 0 to 2pi across the branch cut.
Error handling improvements

o BoutInitialise calls BoutComm:cleanup() on failure, which in turn should
  call MPI_Finalize()

o In the default main() defined in boutmain.hxx, BoutFinalise() is called
  if the physics initialisation fails
BoutMesh finds correct NXPE with branch cuts

previous code to automatically find NXPE didn't take into
account branch-cuts. Now updated to work for single or double null.
Merge branch 'master' of https://github.com/bendudson/BOUT