Revision to algorithm for tidal range, increase accuracy and robustness.