Allow for variance in netCDF4 behaviour.

A replacement for #1258.

@bjlittle - would you mind taking a quick look.
If only you could decorate the code with that comment ... :wink: