From c7ce936dcb666f9e1552ece3295f569792974666 Mon Sep 17 00:00:00 2001 From: Pierre Cazenave Date: Mon, 1 Oct 2012 11:11:32 +0100 Subject: [PATCH] Add revision history to the estimated time step code --- fvcom_prepro/estimate_ts.m | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/fvcom_prepro/estimate_ts.m b/fvcom_prepro/estimate_ts.m index 22f5947..bb3c62e 100644 --- a/fvcom_prepro/estimate_ts.m +++ b/fvcom_prepro/estimate_ts.m @@ -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 -- GitLab