Commit c7ce936d authored by Pierre Cazenave's avatar Pierre Cazenave

Add revision history to the estimated time step code

parent c4494c92
......@@ -20,6 +20,9 @@ function [Mobj] = estimate_ts(Mobj,u,zeta)
% Geoff Cowles (University of Massachusetts Dartmouth)
%
% Revision history
% 2012-07-14 Add great circle approximation if only provided with
% latitude and longitudes. Also add arguments to the function to define
% current velocity and tidal amplitudes.
%
%==============================================================================
......@@ -45,9 +48,9 @@ end;
%------------------------------------------------------------------------------
% Compute the time step estimate
%------------------------------------------------------------------------------
if Mobj.have_xy
x = Mobj.x;
y = Mobj.y;
if Mobj.have_xy
x = Mobj.x;
y = Mobj.y;
else
% Will convert to metres when calculating element edge length
x = Mobj.lon;
......@@ -87,9 +90,9 @@ end
function [km]=haversine(lat1,lon1,lat2,lon2)
% Haversine function to calculate first order distance measurement. Assumes
% spherical Earth surface. Lifted from:
%
%
% http://www.mathworks.com/matlabcentral/fileexchange/27785
%
%
R = 6371000; % Earth's mean radius in metres
delta_lat = lat2 - lat1; % difference in latitude
delta_lon = lon2 - lon1; % difference in longitude
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment