Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
fvcom-toolbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
FVCOM
fvcom-toolbox
Commits
c7ce936d
Commit
c7ce936d
authored
Oct 01, 2012
by
Pierre Cazenave
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add revision history to the estimated time step code
parent
c4494c92
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
fvcom_prepro/estimate_ts.m
fvcom_prepro/estimate_ts.m
+8
-5
No files found.
fvcom_prepro/estimate_ts.m
View file @
c7ce936d
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment