Commit 9192160b authored by Pierre Cazenave's avatar Pierre Cazenave

Update the documentation following the new release.

parent 0ed5eb78
......@@ -59,6 +59,6 @@ This function is called by:
0007 <span class="comment">% Revision history</span>
0008 <span class="comment">%</span>
0009 <span class="comment">%==============================================================================</span></pre></div>
<hr><address>Generated on Tue 29-Jul-2014 15:11:16 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<hr><address>Generated on Thu 19-Mar-2015 12:20:56 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
......@@ -184,6 +184,6 @@ This function is called by:
0120 <span class="comment">% vector plots requires correct lat and lon for u and v positions: FVCOM.xc</span>
0121 <span class="comment">% and FVCOM.yc. Remember to extract them</span>
0122 PLotoutV=do_vector_plot(plotOPTS,FVCOM)</pre></div>
<hr><address>Generated on Tue 29-Jul-2014 15:11:16 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<hr><address>Generated on Thu 19-Mar-2015 12:20:56 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
......@@ -19,11 +19,11 @@
<center>
<img src="graph.png" usemap="#mainmap" alt="Dependency Graph for fvcom_postproc" border="2" style="color:#000;">
<map name="mainmap">
<area shape="poly" id="node1" href="README.html" title="README" alt="" coords="133,29,130,22,121,15,107,10,89,7,69,5,50,7,32,10,17,15,8,22,5,29,8,37,17,43,32,49,50,52,69,53,89,52,107,49,121,43,130,37">
<area shape="poly" id="node1" href="README.html" title="README" alt="" coords="134,29,130,22,121,15,107,10,89,7,69,5,50,7,32,10,18,15,8,22,5,29,8,37,18,43,32,49,50,52,69,53,89,52,107,49,121,43,130,37">
<area shape="poly" id="node2" href="example_surface_plot.html" title="example_surface_plot" alt="" coords="395,29,389,22,372,15,346,10,313,7,276,5,239,7,206,10,180,15,163,22,157,29,163,37,180,43,206,49,239,52,276,53,313,52,346,49,372,43,389,37">
</map>
</center>
<hr><address>Generated on Tue 29-Jul-2014 15:11:01 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<hr><address>Generated on Thu 19-Mar-2015 12:20:52 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
<area shape="poly" id="node1" href="README.html" title="README" alt="" coords="133,29,130,22,121,15,107,10,89,7,69,5,50,7,32,10,17,15,8,22,5,29,8,37,17,43,32,49,50,52,69,53,89,52,107,49,121,43,130,37">
<area shape="poly" id="node1" href="README.html" title="README" alt="" coords="134,29,130,22,121,15,107,10,89,7,69,5,50,7,32,10,18,15,8,22,5,29,8,37,18,43,32,49,50,52,69,53,89,52,107,49,121,43,130,37">
<area shape="poly" id="node2" href="example_surface_plot.html" title="example_surface_plot" alt="" coords="395,29,389,22,372,15,346,10,313,7,276,5,239,7,206,10,180,15,163,22,157,29,163,37,180,43,206,49,239,52,276,53,313,52,346,49,372,43,389,37">
doc/fvcom_postproc/graph.png

8.02 KB | W: | H:

doc/fvcom_postproc/graph.png

9.36 KB | W: | H:

doc/fvcom_postproc/graph.png
doc/fvcom_postproc/graph.png
doc/fvcom_postproc/graph.png
doc/fvcom_postproc/graph.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -29,6 +29,6 @@
<ul style="list-style-image:url(../simulinkicon.gif)">
<li>View the <a href="graph.html">Graph</a>.</li>
</ul>
<hr><address>Generated on Tue 29-Jul-2014 15:10:59 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<hr><address>Generated on Thu 19-Mar-2015 12:20:50 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
......@@ -73,6 +73,6 @@ This function is called by:
0014 <span class="comment">% Revision history</span>
0015 <span class="comment">%</span>
0016 <span class="comment">%==============================================================================</span></pre></div>
<hr><address>Generated on Tue 29-Jul-2014 15:11:16 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<hr><address>Generated on Thu 19-Mar-2015 12:20:56 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
......@@ -144,6 +144,6 @@ This function is called by:
0074
0075
0076</pre></div>
<hr><address>Generated on Tue 29-Jul-2014 15:11:16 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<hr><address>Generated on Thu 19-Mar-2015 12:20:56 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
......@@ -160,6 +160,6 @@ This function is called by:
0088 fprintf([<span class="string">'end : '</span> subname <span class="string">'\n'</span>])
0089 <span class="keyword">end</span>;
0090</pre></div>
<hr><address>Generated on Tue 29-Jul-2014 15:11:16 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<hr><address>Generated on Thu 19-Mar-2015 12:20:56 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
......@@ -27,7 +27,7 @@
<div class="box"><strong>function [Mobj] = add_obc_nodes_list(Mobj,Nlist,ObcName,ObcType,plotFig) </strong></div>
<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> Add a set of obc nodes comprising a single obc boundary to Mesh structure
<div class="fragment"><pre class="comment"> Add a set of obc nodes comprising a single obc boundary to Mesh structure
Using a list of nodes
[Mobj] = add_obc_nodes_list(Mobj,Nlist,ObcName,ObcType)
......@@ -48,7 +48,7 @@
EXAMPLE USAGE
Mobj = add_obc_nodes_list(Mobj,Nlist,'OpenOcean')
Author(s):
Author(s):
Geoff Cowles (University of Massachusetts Dartmouth)
Pierre Cazenave (Plymouth Marine Laboratory)
Karen Amoudry (National Oceanography Centre, Liverpool)
......@@ -58,7 +58,8 @@
2013-01-02 KJA bug fix: amended usage of 'unique' in line 53 to
prevent it from sorting the values it returns. Amended by Pierre to
support pre-2012 versions of MATLAB whilst giving the same result.
2015-02-23 Output number of nodes if the verbose flag is set.
==========================================================================</pre></div>
<!-- crossreference -->
......@@ -74,7 +75,7 @@ This function is called by:
<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [Mobj] = add_obc_nodes_list(Mobj,Nlist,ObcName,ObcType,plotFig) </a>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [Mobj] = add_obc_nodes_list(Mobj,Nlist,ObcName,ObcType,plotFig)</a>
0002
0003 <span class="comment">% Add a set of obc nodes comprising a single obc boundary to Mesh structure</span>
0004 <span class="comment">% Using a list of nodes</span>
......@@ -107,68 +108,72 @@ This function is called by:
0031 <span class="comment">% 2013-01-02 KJA bug fix: amended usage of 'unique' in line 53 to</span>
0032 <span class="comment">% prevent it from sorting the values it returns. Amended by Pierre to</span>
0033 <span class="comment">% support pre-2012 versions of MATLAB whilst giving the same result.</span>
0034 <span class="comment">%</span>
0035 <span class="comment">%==========================================================================</span>
0036 subname = <span class="string">'add_obc_nodes'</span>;
0037 <span class="keyword">global</span> ftbverbose
0038 <span class="keyword">if</span>(ftbverbose)
0039 fprintf(<span class="string">'\n'</span>)
0040 fprintf([<span class="string">'begin : '</span> subname <span class="string">'\n'</span>])
0041 <span class="keyword">end</span>
0042
0043 <span class="comment">% Do we want a figure showing how we're getting along?</span>
0044 <span class="keyword">if</span> nargin == 4
0045 plotFig = 0;
0046 <span class="keyword">end</span>
0047
0048 <span class="comment">%--------------------------------------------------------------------------</span>
0049 <span class="comment">% Get a unique list and make sure they are in the range of node numbers</span>
0050 <span class="comment">%--------------------------------------------------------------------------</span>
0051 <span class="comment">% Make this works in versions of MATLAB older than 2012a (newer versions</span>
0052 <span class="comment">% can just use unique(A, 'stable'), but checking versions is a pain).</span>
0053 [~, Nidx] = unique(Nlist);
0054 Nlist = Nlist(sort(Nidx));
0055
0056 <span class="keyword">if</span> max(Nlist) &gt; Mobj.nVerts
0057 fprintf(<span class="string">'your open boundary node number exceed the total number of nodes in the domain\n'</span>);
0058 error(<span class="string">'stopping...'</span>)
0059 <span class="keyword">end</span>
0060
0061 <span class="comment">%--------------------------------------------------------------------------</span>
0062 <span class="comment">% Plot the mesh</span>
0063 <span class="comment">%--------------------------------------------------------------------------</span>
0064 <span class="keyword">if</span> plotFig == 1
0065 <span class="keyword">if</span> strcmpi(Mobj.nativeCoords(1:3), <span class="string">'car'</span>)
0066 x = Mobj.x;
0067 y = Mobj.y;
0068 <span class="keyword">else</span>
0069 x = Mobj.lon;
0070 y = Mobj.lat;
0071 <span class="keyword">end</span>
0072
0073 figure
0074 patch(<span class="string">'Vertices'</span>,[x,y],<span class="string">'Faces'</span>,Mobj.tri,<span class="keyword">...</span>
0075 <span class="string">'Cdata'</span>,Mobj.h,<span class="string">'edgecolor'</span>,<span class="string">'k'</span>,<span class="string">'facecolor'</span>,<span class="string">'interp'</span>);
0076 hold on;
0077 whos Nlist
0078 plot(x(Nlist),y(Nlist),<span class="string">'ro'</span>);
0079 axis(<span class="string">'equal'</span>,<span class="string">'tight'</span>)
0080 title(<span class="string">'open boundary nodes'</span>);
0081 <span class="keyword">end</span>
0082
0083 <span class="comment">% add to mesh object</span>
0084 npts = numel(Nlist);
0085 Mobj.nObs = Mobj.nObs + 1;
0086 Mobj.nObcNodes(Mobj.nObs) = npts;
0087 Mobj.obc_nodes(Mobj.nObs,1:npts) = Nlist;
0088 Mobj.obc_name{Mobj.nObs} = ObcName;
0089 Mobj.obc_type(Mobj.nObs) = ObcType;
0090
0034 <span class="comment">% 2015-02-23 Output number of nodes if the verbose flag is set.</span>
0035 <span class="comment">%</span>
0036 <span class="comment">%==========================================================================</span>
0037 subname = <span class="string">'add_obc_nodes_list'</span>;
0038
0039 <span class="keyword">global</span> ftbverbose
0040 <span class="keyword">if</span> ftbverbose
0041 fprintf(<span class="string">'\nbegin : %s\n'</span>, subname)
0042 <span class="keyword">end</span>
0043
0044 <span class="comment">% Do we want a figure showing how we're getting along?</span>
0045 <span class="keyword">if</span> nargin == 4
0046 plotFig = 0;
0047 <span class="keyword">end</span>
0048
0049 <span class="comment">%--------------------------------------------------------------------------</span>
0050 <span class="comment">% Get a unique list and make sure they are in the range of node numbers</span>
0051 <span class="comment">%--------------------------------------------------------------------------</span>
0052 <span class="comment">% Make this works in versions of MATLAB older than 2012a (newer versions</span>
0053 <span class="comment">% can just use unique(A, 'stable'), but checking versions is a pain).</span>
0054 [~, Nidx] = unique(Nlist);
0055 Nlist = Nlist(sort(Nidx));
0056
0057 <span class="keyword">if</span> max(Nlist) &gt; Mobj.nVerts
0058 fprintf(<span class="string">'Your open boundary node number exceed the total number of nodes in the domain\n'</span>);
0059 error(<span class="string">'stopping...'</span>)
0060 <span class="keyword">end</span>
0061
0062 <span class="comment">%--------------------------------------------------------------------------</span>
0063 <span class="comment">% Plot the mesh</span>
0064 <span class="comment">%--------------------------------------------------------------------------</span>
0065 <span class="keyword">if</span> plotFig == 1
0066 <span class="keyword">if</span> strcmpi(Mobj.nativeCoords(1:3), <span class="string">'car'</span>)
0067 x = Mobj.x;
0068 y = Mobj.y;
0069 <span class="keyword">else</span>
0070 x = Mobj.lon;
0071 y = Mobj.lat;
0072 <span class="keyword">end</span>
0073
0074 figure
0075 patch(<span class="string">'Vertices'</span>, [x, y] , <span class="string">'Faces'</span>, Mobj.tri, <span class="keyword">...</span>
0076 <span class="string">'Cdata'</span>, Mobj.h, <span class="string">'edgecolor'</span>, <span class="string">'k'</span>, <span class="string">'facecolor'</span>, <span class="string">'interp'</span>)
0077 hold on
0078 whos Nlist
0079 plot(x(Nlist), y(Nlist), <span class="string">'ro'</span>);
0080 axis(<span class="string">'equal'</span>, <span class="string">'tight'</span>)
0081 title(<span class="string">'open boundary nodes'</span>);
0082 <span class="keyword">end</span>
0083
0084 <span class="comment">% add to mesh object</span>
0085 npts = numel(Nlist);
0086 Mobj.nObs = Mobj.nObs + 1;
0087 Mobj.nObcNodes(Mobj.nObs) = npts;
0088 Mobj.obc_nodes(Mobj.nObs,1:npts) = Nlist;
0089 Mobj.obc_name{Mobj.nObs} = ObcName;
0090 Mobj.obc_type(Mobj.nObs) = ObcType;
0091
0092 <span class="keyword">if</span>(ftbverbose)
0093 fprintf([<span class="string">'end : '</span> subname <span class="string">'\n'</span>])
0092 <span class="keyword">if</span> ftbverbose
0093 fprintf(<span class="string">'found %d open boundary nodes'</span>, npts)
0094 <span class="keyword">end</span>
0095</pre></div>
<hr><address>Generated on Tue 29-Jul-2014 15:11:16 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
0095
0096 <span class="keyword">if</span> ftbverbose
0097 fprintf(<span class="string">'\nend : %s\n'</span>, subname)
0098 <span class="keyword">end</span>
0099</pre></div>
<hr><address>Generated on Thu 19-Mar-2015 12:20:56 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
......@@ -166,6 +166,6 @@ This function is called by:
0094 fprintf([<span class="string">'end : '</span> subname <span class="string">'\n'</span>])
0095 <span class="keyword">end</span>;
0096</pre></div>
<hr><address>Generated on Tue 29-Jul-2014 15:11:16 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<hr><address>Generated on Thu 19-Mar-2015 12:20:56 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
......@@ -175,6 +175,6 @@ This function is called by:
0096 fprintf([<span class="string">'end : '</span> subname <span class="string">'\n'</span>])
0097 <span class="keyword">end</span>
0098</pre></div>
<hr><address>Generated on Tue 29-Jul-2014 15:11:16 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<hr><address>Generated on Thu 19-Mar-2015 12:20:56 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
......@@ -91,6 +91,6 @@ This function is called by:
0045 nc = close(nc);
0046
0047</pre></div>
<hr><address>Generated on Tue 29-Jul-2014 15:11:16 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<hr><address>Generated on Thu 19-Mar-2015 12:20:56 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
......@@ -157,6 +157,6 @@ This function is called by:
0085
0086 fprintf([<span class="string">'end : '</span> subname <span class="string">'\n'</span>])
0087</pre></div>
<hr><address>Generated on Tue 29-Jul-2014 15:11:16 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<hr><address>Generated on Thu 19-Mar-2015 12:20:56 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
......@@ -169,6 +169,6 @@ This function is called by:
0094 fprintf([<span class="string">'end : '</span> subname <span class="string">'\n'</span>])
0095 <span class="keyword">end</span>
0096</pre></div>
<hr><address>Generated on Tue 29-Jul-2014 15:11:16 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<hr><address>Generated on Thu 19-Mar-2015 12:20:56 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
......@@ -172,6 +172,6 @@ This function is called by:
0098 fprintf([<span class="string">'end : '</span> subname <span class="string">'\n'</span>])
0099 <span class="keyword">end</span>;
0100</pre></div>
<hr><address>Generated on Tue 29-Jul-2014 15:11:16 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<hr><address>Generated on Thu 19-Mar-2015 12:20:56 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
......@@ -170,6 +170,6 @@ This function is called by:
0094 fprintf([<span class="string">'end : '</span> subname <span class="string">'\n'</span>])
0095 <span class="keyword">end</span>
0096</pre></div>
<hr><address>Generated on Tue 29-Jul-2014 15:11:16 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<hr><address>Generated on Thu 19-Mar-2015 12:20:56 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
......@@ -123,6 +123,6 @@ This function is called by:
0057
0058 <span class="comment">%fprintf(['end : ' subname '\n'])</span>
0059</pre></div>
<hr><address>Generated on Tue 29-Jul-2014 15:11:16 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<hr><address>Generated on Thu 19-Mar-2015 12:20:56 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
......@@ -171,6 +171,6 @@ This function is called by:
0101 c = 2 * atan2(sqrt(a), sqrt(1-a));
0102 km = R * c; <span class="comment">% distance in metres</span>
0103</pre></div>
<hr><address>Generated on Tue 29-Jul-2014 15:11:16 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<hr><address>Generated on Thu 19-Mar-2015 12:20:56 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
......@@ -185,6 +185,6 @@ This function is called by:
0118 <a href="write_FVCOM_cor.html" class="code" title="function write_FVCOM_cor(Mobj,filename)">write_FVCOM_cor</a>(Mobj,<span class="string">'tst_cor.dat'</span>)
0119
0120</pre></div>
<hr><address>Generated on Tue 29-Jul-2014 15:11:16 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<hr><address>Generated on Thu 19-Mar-2015 12:20:56 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
......@@ -107,6 +107,6 @@ This function is called by:
0040 <span class="comment">% dump bathymetry</span>
0041 <a href="write_FVCOM_bath.html" class="code" title="function write_FVCOM_bath(Mobj,filename)">write_FVCOM_bath</a>(Mobj,<span class="string">'skg4.3_dep_smoothed.dat'</span>)
0042</pre></div>
<hr><address>Generated on Tue 29-Jul-2014 15:11:16 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<hr><address>Generated on Thu 19-Mar-2015 12:20:56 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
......@@ -123,6 +123,6 @@ This function is called by:
0062 VarUnits = <span class="string">'kgm^-3'</span>;
0063 VarData = .333*sedload;
0064 <a href="add_var_FVCOM_river.html" class="code" title="function add_var_FVCOM_river(RiverFile,VarName,VarLongName,VarUnits,VarData)">add_var_FVCOM_river</a>(RiverFile,VarName,VarLongName,VarUnits,VarData)</pre></div>
<hr><address>Generated on Tue 29-Jul-2014 15:11:16 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<hr><address>Generated on Thu 19-Mar-2015 12:20:56 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
......@@ -276,6 +276,6 @@ This function is called by:
0206 netcdf.close(nc);
0207
0208 <span class="keyword">if</span>(ftbverbose); fprintf([<span class="string">'end : '</span> subname <span class="string">'\n'</span>]);<span class="keyword">end</span>;</pre></div>
<hr><address>Generated on Tue 29-Jul-2014 15:11:16 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<hr><address>Generated on Thu 19-Mar-2015 12:20:56 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
......@@ -182,6 +182,6 @@ This function is called by:
0114
0115
0116</pre></div>
<hr><address>Generated on Tue 29-Jul-2014 15:11:16 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<hr><address>Generated on Thu 19-Mar-2015 12:20:56 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
......@@ -171,6 +171,6 @@ This function is called by:
0103
0104
0105</pre></div>
<hr><address>Generated on Tue 29-Jul-2014 15:11:16 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<hr><address>Generated on Thu 19-Mar-2015 12:20:56 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
......@@ -154,6 +154,6 @@ This function is called by:
0110 nc{<span class="string">'mark'</span>}(:) = 0;
0111 nc{<span class="string">'pathlength'</span>}(:) = 0.0;
0112 close(nc);</pre></div>
<hr><address>Generated on Tue 29-Jul-2014 15:11:16 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<hr><address>Generated on Thu 19-Mar-2015 12:20:56 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
......@@ -135,6 +135,6 @@ This function is called by:
0091 out_north = lat;
0092 <span class="keyword">end</span>;
0093</pre></div>
<hr><address>Generated on Tue 29-Jul-2014 15:11:16 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<hr><address>Generated on Thu 19-Mar-2015 12:20:56 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
......@@ -138,6 +138,6 @@ This function is called by:
0069 <span class="comment">% end</span>
0070
0071</pre></div>
<hr><address>Generated on Tue 29-Jul-2014 15:11:16 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<hr><address>Generated on Thu 19-Mar-2015 12:20:56 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>
\ No newline at end of file
......@@ -35,11 +35,14 @@
Find nearest point to (xloc,yloc) in the domain of Mobj
using native coordinates of Mobj
INPUT:
INPUT:
xloc = x location of point (in native Mobj coordinates)
yloc = y location of point (in native Mobj coordinates)
Mobj = Mesh object
Mobj = Mesh object with the following fields:
- nativeCoords = grid type (cartesian or spherical)
- x, y and/or lon, lat = coordinates (dependent on
nativeCoords).
OUTPUT:
Point = index of nearest vertex in the mesh
Distance = Distance from x,y to Point in Mobj native coordinates
......@@ -49,9 +52,12 @@
Author(s):
Geoff Cowles (University of Massachusetts Dartmouth)
Pierre Cazenave (Plymouth Marine Laboratory)
Revision history
2015-01-14 Tidy up the code a bit and add extra information to the
help.
==============================================================================</pre></div>
<!-- crossreference -->
......@@ -68,66 +74,75 @@ This function is called by:
<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [Point,Distance] = find_nearest_pt(xloc,yloc,Mobj) </a>
0002
0003 <span class="comment">% Find nearest point in Mesh structure to (x,y)</span>
0004 <span class="comment">%</span>
0005 <span class="comment">% function [Point,Distance] = find_nearest_pt(xloc,yloc,Mobj)</span>
0006 <span class="comment">%</span>
0007 <span class="comment">% DESCRIPTION:</span>
0008 <span class="comment">% Find nearest point to (xloc,yloc) in the domain of Mobj</span>
0009 <span class="comment">% using native coordinates of Mobj</span>
0010 <span class="comment">%</span>
0011 <span class="comment">% INPUT:</span>
0012 <span class="comment">% xloc = x location of point (in native Mobj coordinates)</span>
0013 <span class="comment">% yloc = y location of point (in native Mobj coordinates)</span>
0014 <span class="comment">% Mobj = Mesh object</span>
0015 <span class="comment">%</span>
0016 <span class="comment">% OUTPUT:</span>
0017 <span class="comment">% Point = index of nearest vertex in the mesh</span>
0018 <span class="comment">% Distance = Distance from x,y to Point in Mobj native coordinates</span>
0019 <span class="comment">%</span>
0020 <span class="comment">% EXAMPLE USAGE</span>
0021 <span class="comment">% [Point,Distance] = find_nearest_point(50.1,100.2,Mobj)</span>
0022 <span class="comment">%</span>
0023 <span class="comment">% Author(s):</span>
0024 <span class="comment">% Geoff Cowles (University of Massachusetts Dartmouth)</span>
0025 <span class="comment">%</span>
0026 <span class="comment">% Revision history</span>
0027 <span class="comment">%</span>
0028 <span class="comment">%==============================================================================</span>
0029
0030 subname = <span class="string">'find_nearest_pt'</span>;
0031 <span class="comment">%fprintf('\n')</span>
0032 <span class="comment">%fprintf(['begin : ' subname '\n'])</span>
0033
0034 <span class="comment">%------------------------------------------------------------------------------</span>
0035 <span class="comment">% Parse input arguments</span>
0036 <span class="comment">%------------------------------------------------------------------------------</span>
0037 <span class="keyword">if</span>(exist(<span class="string">'xloc'</span>)*exist(<span class="string">'yloc'</span>)*exist(<span class="string">'Mobj'</span>) == 0)
0038 error(<span class="string">'arguments to find_nearest_pt are missing'</span>)
0039 <span class="keyword">end</span>;
0002 <span class="comment">% Find nearest point in Mesh structure to (x,y)</span>
0003 <span class="comment">%</span>
0004 <span class="comment">% function [Point,Distance] = find_nearest_pt(xloc,yloc,Mobj)</span>
0005 <span class="comment">%</span>
0006 <span class="comment">% DESCRIPTION:</span>
0007 <span class="comment">% Find nearest point to (xloc,yloc) in the domain of Mobj</span>
0008 <span class="comment">% using native coordinates of Mobj</span>
0009 <span class="comment">%</span>
0010 <span class="comment">% INPUT:</span>
0011 <span class="comment">% xloc = x location of point (in native Mobj coordinates)</span>
0012 <span class="comment">% yloc = y location of point (in native Mobj coordinates)</span>
0013 <span class="comment">% Mobj = Mesh object with the following fields:</span>
0014 <span class="comment">% - nativeCoords = grid type (cartesian or spherical)</span>
0015 <span class="comment">% - x, y and/or lon, lat = coordinates (dependent on</span>
0016 <span class="comment">% nativeCoords).</span>
0017 <span class="comment">%</span>
0018 <span class="comment">% OUTPUT:</span>
0019 <span class="comment">% Point = index of nearest vertex in the mesh</span>
0020 <span class="comment">% Distance = Distance from x,y to Point in Mobj native coordinates</span>
0021 <span class="comment">%</span>
0022 <span class="comment">% EXAMPLE USAGE</span>
0023 <span class="comment">% [Point,Distance] = find_nearest_point(50.1,100.2,Mobj)</span>
0024 <span class="comment">%</span>
0025 <span class="comment">% Author(s):</span>
0026 <span class="comment">% Geoff Cowles (University of Massachusetts Dartmouth)</span>
0027 <span class="comment">% Pierre Cazenave (Plymouth Marine Laboratory)</span>
0028 <span class="comment">%</span>
0029 <span class="comment">% Revision history</span>
0030 <span class="comment">% 2015-01-14 Tidy up the code a bit and add extra information to the</span>
0031 <span class="comment">% help.</span>
0032 <span class="comment">%</span>
0033 <span class="comment">%==============================================================================</span>
0034
0035 <span class="comment">% global ftbverbose</span>
0036 subname = <span class="string">'find_nearest_pt'</span>;
0037 <span class="comment">% if ftbverbose</span>
0038 <span class="comment">% fprintf('\nbegin : %s\n', subname)</span>
0039 <span class="comment">% end</span>
0040
0041 <span class="comment">%------------------------------------------------------------------------------</span>
0042 <span class="comment">% Set native coordinates</span>
0042 <span class="comment">% Parse input arguments</span>
0043 <span class="comment">%------------------------------------------------------------------------------</span>
0044 <span class="keyword">if</span>(lower(Mobj.nativeCoords(1:3)) == <span class="string">'car'</span>)
0045 x = Mobj.x;
0046 y = Mobj.y;
0047 <span class="keyword">else</span>
0048 x = Mobj.lon;
0049 y = Mobj.lat;
0050 <span class="keyword">end</span>;
0051
0052 <span class="comment">%------------------------------------------------------------------------------</span>
0053 <span class="comment">% Find the nearest point</span>
0054 <span class="comment">%------------------------------------------------------------------------------</span>
0055 radvec = sqrt( (xloc-x).^2 + (yloc-y).^2);
0056 [Distance,Point] = min(radvec);
0057
0058
0059 <span class="comment">%fprintf(['end : ' subname '\n'])</span>
0044 <span class="keyword">if</span> ~exist(<span class="string">'xloc'</span>, <span class="string">'var'</span>) || ~exist(<span class="string">'yloc'</span>, <span class="string">'var'</span>) || ~exist(<span class="string">'Mobj'</span>, <span class="string">'var'</span>)
0045 error(<span class="string">'arguments to %s are missing'</span>, subname)
0046 <span class="keyword">