Fix bug in the identification of a suitable river node when the element is bounded on two sides by coast
Add support for restarting with u and v velocity components
Add support for exporting data which falls on the element centres (nele) rather than the nodes (node)
Add a check before clipping the data to the actual_range specified in the netCDF file so as to only perform the clipping when the actual_range has been specified
Pretty comprehensive overhaul of the code to:

    1) Make it faster
    2) Make it more readable

The loops over each line of the file (after the initial reading to find
the number of vertices (nodes), elements, header lines, node strings
etc.) have been replaced with much quicker textscans of the appropriate
number of lines. In addition to other improvements (using strcmpi
instead of using ==, for example), the overall runtime for a 250,000
node grid has been more than halved (from ~70 seconds to ~30 seconds).
Move a comment to a more sensible place
Add checks that the returned data arrays are the same shape as the position arrays. It turns out this is always the case, but no harm in checking (and warning if they are not)
Fix airly significant bug in which the position arrays were transposed relative to the data arrays.

The code now checks for the dimensions and warns if they have been flipped to match. There is no checking that the flip has worked because the xalt and yalt arrays complicate things too much for me to figure out today. If you want to implement that functionality, please do so!

I also added commented-out figure at the end to check the interpolation has worked properly, should you wish to check manually
Update the NCEP script to actually use the NCEP Reanalysis-2 data
(rather than the original reanalysis data).

The function now also downloads the geopotential height at the surface
used in the model. The original idea was that this would be able to mask
out the land data, but it turns out that the geopotential height does
not correlate with height above MSL very well, so it's difficult to mask
out the land areas. I've left the code in in case it's needed in the
future, for whatever reason.
Try to be clever about outputting the warning message when we are using the alternative grids
Move the topo to the start of the list of things to be downloaded so the longitude and latitude arrays are the right shape. Also select a non-topo field for the latitude and longitude arrays at the end
Add support for the new pressure field name
Change the way the level is identified and the way the position grids are stored.

Make the search for the appropriate level slightly more precise (change the target pressure to 1013 from 1000 mbar, not that this will make any difference as the closest levels are 1000 and 9000).

Also added a more robust method for finding an appropriately sized array by finding the index which is not from relative humidity, topogrphy or pressure.
Add a failback if the requested data are one of the alternatively gridded data sets
Improve error handling in instances where no alternative grid is included.

The code now checks that the alternative arrays exist and if they are missing, only checks against the normal position arrays.
Update the code to search for a sensible index for the position arrays.

It now works under the following conditions:

1) If no variables have been specified when calling the function.
2) If only oddly gridded data have been specified
3) If a combination of oddly and normally gridded data have been specified
4) If only normally gridded data have been specified

Hopefully that makes it relatively robust.
Update the code to write out pressure data if using either 'slp' or 'pres' as the variable name. Hopefully if the data have been obtained via get_NCEP_forcing, then it will always be 'pres', but better safe than sorry
Change the function to allow download of either reanalysis-1,
reanalysis-2 or 20th Century reanalysis 2 data.

Rather than have separate functions for each of the NCEP products, have
a single function which just downloads the relevant data depending on an
input argument.

So far, this supports the reanalysis-1, reanalysis-2 and 20th Century
reanalysis-2 data. All are the same resolution, but the variables are on
different grids (I think).

I've tested this with a combination of the three different sources and
with specific variables to extract, and it seems to work OK. I haven't
yet checked that the returned data from the 20th Century reanalysis-2
are sensible, but I'm pretty certain the reanalysis-1 and reanalysis-2
data are OK.
Fix the warning to only occur if any of the heat flux components have been supplied
Update the revision log to include the most recent changes.