Commit e8d720fd authored by Pierre Cazenave's avatar Pierre Cazenave

Update the documentation to reflect new functions. Also add a dependency graph...

Update the documentation to reflect new functions. Also add a dependency graph for the functions in the toolbox
parent 4032b7ca
/* Created by mdot for Matlab */
digraph m2html {
README [URL="README.html"];
example_surface_plot [URL="example_surface_plot.html"];
}
\ No newline at end of file
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>Dependency Graph for fvcom_postproc</title>
<meta name="keywords" content="dependency, graph, dependence, fvcom_postproc">
<meta name="description" content="Dependency graph for fvcom_postproc">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="generator" content="m2html v1.5 &copy; 2003-2005 Guillaume Flandin">
<meta name="robots" content="index, follow">
<link type="text/css" rel="stylesheet" href="../m2html.css">
</head>
<body>
<a name="_top"></a>
<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png">&nbsp;Master index</a></td>
<td align="right"><a href="index.html">Index for fvcom_postproc&nbsp;<img alt=">" border="0" src="../right.png"></a></td></tr></table>
<h1>Dependency Graph for fvcom_postproc</h1>
<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="144,31 141,23 131,16 116,10 96,6 75,5 53,6 34,10 18,16 8,23 5,31 8,39 18,46 34,51 53,55 75,56 96,55 116,51 131,46 141,39">
<area shape="poly" id="node2" href="example_surface_plot.html" title="example_surface_plot" alt="" coords="426,31 420,23 402,16 373,10 337,6 297,5 257,6 221,10 193,16 174,23 168,31 174,39 193,46 221,51 257,55 297,56 337,55 373,51 402,46 420,39">
</map>
</center>
<hr><address>Generated on Tue 04-Jun-2013 12:12: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
<area shape="poly" id="node1" href="README.html" title="README" alt="" coords="144,31 141,23 131,16 116,10 96,6 75,5 53,6 34,10 18,16 8,23 5,31 8,39 18,46 34,51 53,55 75,56 96,55 116,51 131,46 141,39">
<area shape="poly" id="node2" href="example_surface_plot.html" title="example_surface_plot" alt="" coords="426,31 420,23 402,16 373,10 337,6 297,5 257,6 221,10 193,16 174,23 168,31 174,39 193,46 221,51 257,55 297,56 337,55 373,51 402,46 420,39">
......@@ -25,7 +25,10 @@
<h2>Subsequent directories:</h2>
<ul style="list-style-image:url(../matlabicon.gif)">
<li>plots</li><li>surface_plots</li><li>transect_plots</li></ul>
<hr><address>Generated on Mon 04-Feb-2013 14:22:26 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
<h2>Dependency Graph</h2>
<ul style="list-style-image:url(../simulinkicon.gif)">
<li>View the <a href="graph.html">Graph</a>.</li>
</ul>
<hr><address>Generated on Tue 04-Jun-2013 12:12:54 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
......@@ -24,13 +24,13 @@
<div class="box"><strong>Add a set of river nodes comprising a single river to Mesh structure</strong></div>
<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function [Mobj] = add_river_nodes(Mobj,Nlist,RiverName) </strong></div>
<div class="box"><strong>function [Mobj] = add_river_nodes_list(Mobj,Nlist,RiverName) </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 river nodes comprising a single river to Mesh structure
Using a set of user-defined nodes
[Mobj] = add_river_nodes(Mobj)
[Mobj] = add_river_nodes(Mobj,Nlist,RiverName)
DESCRIPTION:
Select using ginput the set of nodes comprising a river
......@@ -43,7 +43,7 @@
Mobj = Matlab mesh object with an additional river nodelist
EXAMPLE USAGE
Mobj = add_river_nodes(Mobj,'Potomac')
Mobj = add_river_nodes(Mobj, [146, 3004], 'Potomac')
Author(s):
Geoff Cowles (University of Massachusetts Dartmouth)
......@@ -54,7 +54,7 @@
Revision history
==============================================================================</pre></div>
==========================================================================</pre></div>
<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
......@@ -69,12 +69,12 @@ 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_river_nodes(Mobj,Nlist,RiverName)</a>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [Mobj] = add_river_nodes_list(Mobj,Nlist,RiverName)</a>
0002
0003 <span class="comment">% Add a set of river nodes comprising a single river to Mesh structure</span>
0004 <span class="comment">% Using a set of user-defined nodes</span>
0005 <span class="comment">%</span>
0006 <span class="comment">% [Mobj] = add_river_nodes(Mobj)</span>
0006 <span class="comment">% [Mobj] = add_river_nodes(Mobj,Nlist,RiverName)</span>
0007 <span class="comment">%</span>
0008 <span class="comment">% DESCRIPTION:</span>
0009 <span class="comment">% Select using ginput the set of nodes comprising a river</span>
......@@ -87,7 +87,7 @@ This function is called by:
0016 <span class="comment">% Mobj = Matlab mesh object with an additional river nodelist</span>
0017 <span class="comment">%</span>
0018 <span class="comment">% EXAMPLE USAGE</span>
0019 <span class="comment">% Mobj = add_river_nodes(Mobj,'Potomac')</span>
0019 <span class="comment">% Mobj = add_river_nodes(Mobj, [146, 3004], 'Potomac')</span>
0020 <span class="comment">%</span>
0021 <span class="comment">% Author(s):</span>
0022 <span class="comment">% Geoff Cowles (University of Massachusetts Dartmouth)</span>
......@@ -98,57 +98,57 @@ This function is called by:
0027 <span class="comment">%</span>
0028 <span class="comment">% Revision history</span>
0029 <span class="comment">%</span>
0030 <span class="comment">%==============================================================================</span>
0031 subname = <span class="string">'add_river_nodes'</span>;
0030 <span class="comment">%==========================================================================</span>
0031 subname = <span class="string">'add_river_nodes_list'</span>;
0032 <span class="keyword">global</span> ftbverbose
0033 <span class="keyword">if</span>(ftbverbose)
0034 fprintf(<span class="string">'\n'</span>)
0035 fprintf([<span class="string">'begin : '</span> subname <span class="string">'\n'</span>])
0036 <span class="keyword">end</span>;
0033 <span class="keyword">if</span> ftbverbose
0034 fprintf(<span class="string">'\n'</span>)
0035 fprintf([<span class="string">'begin : '</span> subname <span class="string">'\n'</span>])
0036 <span class="keyword">end</span>
0037
0038 <span class="comment">%------------------------------------------------------------------------------</span>
0038 <span class="comment">%--------------------------------------------------------------------------</span>
0039 <span class="comment">% Get a unique list and make sure they are in the range of node numbers</span>
0040 <span class="comment">%------------------------------------------------------------------------------</span>
0040 <span class="comment">%--------------------------------------------------------------------------</span>
0041 Nlist = unique(Nlist);
0042
0043 <span class="keyword">if</span>(max(Nlist) &gt; Mobj.nVerts);
0044 fprintf(<span class="string">'your river node number(s) exceed the total number of nodes in the domain\n'</span>);
0045 fprintf(<span class="string">'stop screwing around\n'</span>);
0046 error(<span class="string">'stopping...\n'</span>)
0047 <span class="keyword">end</span>;
0043 <span class="keyword">if</span> max(Nlist) &gt; Mobj.nVerts
0044 fprintf(<span class="string">'your river node number(s) exceed the total number of nodes in the domain\n'</span>);
0045 fprintf(<span class="string">'stop screwing around\n'</span>);
0046 error(<span class="string">'stopping...\n'</span>)
0047 <span class="keyword">end</span>
0048
0049 <span class="comment">%------------------------------------------------------------------------------</span>
0049 <span class="comment">%--------------------------------------------------------------------------</span>
0050 <span class="comment">% Plot the mesh</span>
0051 <span class="comment">%------------------------------------------------------------------------------</span>
0051 <span class="comment">%--------------------------------------------------------------------------</span>
0052
0053 <span class="keyword">if</span>(lower(Mobj.nativeCoords(1:3)) == <span class="string">'car'</span>)
0054 x = Mobj.x;
0055 y = Mobj.y;
0053 <span class="keyword">if</span> strcmpi(Mobj.nativeCoords(1:3), <span class="string">'car'</span>)
0054 x = Mobj.x;
0055 y = Mobj.y;
0056 <span class="keyword">else</span>
0057 x = Mobj.lon;
0058 y = Mobj.lat;
0059 <span class="keyword">end</span>;
0057 x = Mobj.lon;
0058 y = Mobj.lat;
0059 <span class="keyword">end</span>
0060
0061 figure
0062 patch(<span class="string">'Vertices'</span>,[x,y],<span class="string">'Faces'</span>,Mobj.tri,<span class="keyword">...</span>
0063 <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>);
0064 hold on;
0062 patch(<span class="string">'Vertices'</span>, [x,y], <span class="string">'Faces'</span>, Mobj.tri,<span class="keyword">...</span>
0063 <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>);
0064 hold on
0065
0066 plot(x(Nlist),y(Nlist),<span class="string">'ro'</span>);
0067 title(<span class="string">'river nodes'</span>);
0066 plot(x(Nlist), y(Nlist), <span class="string">'ro'</span>)
0067 title(<span class="string">'river nodes'</span>)
0068
0069 <span class="comment">% add to mesh object</span>
0070 npts = numel(Nlist);
0071 Mobj.nRivers = Mobj.nRivers + 1;
0072 Mobj.nRivNodes(Mobj.nRivers) = npts;
0073 Mobj.riv_nodes(Mobj.nRivers,1:npts) = Nlist;
0073 Mobj.riv_nodes(Mobj.nRivers, 1:npts) = Nlist;
0074 Mobj.riv_name{Mobj.nRivers} = RiverName;
0075
0076
0077 <span class="keyword">if</span>(ftbverbose)
0078 fprintf([<span class="string">'end : '</span> subname <span class="string">'\n'</span>])
0079 <span class="keyword">end</span>;
0077 <span class="keyword">if</span> ftbverbose
0078 fprintf([<span class="string">'end : '</span> subname <span class="string">'\n'</span>])
0079 <span class="keyword">end</span>
0080</pre></div>
<hr><address>Generated on Tue 18-Dec-2012 12:37:31 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 Tue 04-Jun-2013 12:12:57 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
......@@ -159,7 +159,7 @@ This function is called by:
0084 Mobj.sponge_name{Mobj.nSponge} = SpongeName;
0085 Mobj.sponge_fac(Mobj.nSponge) = SpongeCoeff;
0086
0087 <span class="keyword">if</span> max(size(SpongeRadius))==1 <span class="comment">% if you have a constant sponge radius</span>
0087 <span class="keyword">if</span> numel(unique(SpongeRadius)) == 1 <span class="comment">% if you have a constant sponge radius</span>
0088 Mobj.sponge_rad(Mobj.nSponge) = SpongeRadius;
0089 <span class="keyword">else</span> <span class="comment">% if you have a variable sponge radius</span>
0090 Mobj.sponge_rad(Mobj.nSponge,1:npts) = SpongeRadius;
......@@ -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 Mon 04-Feb-2013 14:22:28 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 Tue 04-Jun-2013 12:12:57 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,7 +169,14 @@ This function is called by:
0090 inc = inc + 1;
0091 <span class="keyword">end</span>
0092
0093 Mobj.stations = out;</pre></div>
<hr><address>Generated on Tue 18-Dec-2012 12:37:31 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
0093 <span class="keyword">if</span> ~isempty(out)
0094 Mobj.stations = out;
0095 <span class="keyword">else</span>
0096 Mobj.stations = [];
0097 <span class="keyword">if</span> ftbverbose
0098 fprintf(<span class="string">'No stations found within the model domain.\n'</span>)
0099 <span class="keyword">end</span>
0100 <span class="keyword">end</span></pre></div>
<hr><address>Generated on Tue 04-Jun-2013 12:12:57 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
......@@ -105,7 +105,7 @@ This function is called by:
0031 <span class="comment">%</span>
0032 <span class="comment">%==============================================================================</span>
0033
0034 warning off
0034 <span class="comment">%warning off</span>
0035
0036 subname = <span class="string">'add_var_FVCOM_river'</span>;
0037 <span class="keyword">global</span> ftbverbose;
......@@ -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 18-Dec-2012 12:37:31 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 Tue 04-Jun-2013 12:12:57 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.
......@@ -50,7 +50,7 @@
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../matlabicon.gif)">
<li><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> add time dependent scalar variable to a Riverfile</li><li><a href="write_FVCOM_river.html" class="code" title="function write_FVCOM_river(RiverFile,RiverName,nRivnodes,time,flux,temp,salt,RiverInfo1,RiverInfo2)">write_FVCOM_river</a> write FVCOM 3.x NetCDF river file</li></ul>
<li><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> add time dependent scalar variable to a Riverfile</li><li><a href="write_FVCOM_river.html" class="code" title="function write_FVCOM_river(RiverFile,RiverName,time,flux,temp,salt,RiverInfo1,RiverInfo2)">write_FVCOM_river</a> Write FVCOM 3.x NetCDF river file</li></ul>
This function is called by:
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="example.html" class="code" title="">example</a> example demonstrating reading in a 2DM file and constructing a model</li></ul>
......@@ -103,7 +103,7 @@ This function is called by:
0042 RiverName = <span class="string">'tstRiver'</span>;
0043
0044
0045 <a href="write_FVCOM_river.html" class="code" title="function write_FVCOM_river(RiverFile,RiverName,nRivnodes,time,flux,temp,salt,RiverInfo1,RiverInfo2)">write_FVCOM_river</a>(RiverFile,RiverName,nRivnodes,time,flux,temp,salt,RiverInfo1,RiverInfo2)
0045 <a href="write_FVCOM_river.html" class="code" title="function write_FVCOM_river(RiverFile,RiverName,time,flux,temp,salt,RiverInfo1,RiverInfo2)">write_FVCOM_river</a>(RiverFile,RiverName,nRivnodes,time,flux,temp,salt,RiverInfo1,RiverInfo2)
0046
0047 <span class="comment">% add sediment to the file</span>
0048 VarName = <span class="string">'fine_sand'</span>;
......@@ -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 18-Dec-2012 12:37:31 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 Tue 04-Jun-2013 12:12:57 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
......@@ -97,7 +97,7 @@ This function is called by:
0027 <span class="comment">%</span>
0028 <span class="comment">%==============================================================================</span>
0029
0030 warning off;
0030 <span class="comment">%warning off;</span>
0031
0032
0033 subname = <span class="string">'example_FVCOM_tsobc'</span>;
......@@ -197,7 +197,7 @@ This function is called by:
0127 netcdf.putAtt(nc,netcdf.getConstant(<span class="string">'NC_GLOBAL'</span>),<span class="string">'type'</span>,<span class="string">'FVCOM RIVER FORCING FILE'</span>)
0128 netcdf.putAtt(nc,netcdf.getConstant(<span class="string">'NC_GLOBAL'</span>),<span class="string">'title'</span>,<span class="string">'simple open boundary hydrography test'</span>)
0129 netcdf.putAtt(nc,netcdf.getConstant(<span class="string">'NC_GLOBAL'</span>),<span class="string">'type'</span>,<span class="string">'FVCOM TIME SERIES OBC TS FILE'</span>)
0130 netcdf.putAtt(nc,netcdf.getConstant(<span class="string">'NC_GLOBAL'</span>),<span class="string">'history'</span>,<span class="string">'generated using the fvcom-toolbox'</span>)
0130 netcdf.putAtt(nc,netcdf.getConstant(<span class="string">'NC_GLOBAL'</span>),<span class="string">'history'</span>,<span class="string">'File generated using example_FVCOM_tsobc.m from the MATLAB fvcom-toolbox'</span>)
0131
0132
0133 <span class="comment">% define dimensions</span>
......@@ -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 18-Dec-2012 12:37:31 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 Tue 04-Jun-2013 12:12:57 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
......@@ -50,7 +50,8 @@
Revision history
==============================================================================</pre></div>
==============================================================================
warning off</pre></div>
<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
......@@ -91,7 +92,7 @@ This function is called by:
0024 <span class="comment">% Revision history</span>
0025 <span class="comment">%</span>
0026 <span class="comment">%==============================================================================</span>
0027 warning off
0027 <span class="comment">%warning off</span>
0028 subname = <span class="string">'example_FVCOM_wind_ts'</span>;
0029 <span class="keyword">global</span> ftbverbose;
0030 <span class="keyword">if</span>(ftbverbose);
......@@ -181,6 +182,6 @@ This function is called by:
0114
0115
0116</pre></div>
<hr><address>Generated on Tue 18-Dec-2012 12:37:31 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 Tue 04-Jun-2013 12:12:57 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
......@@ -50,7 +50,8 @@
Revision history
==============================================================================</pre></div>
==============================================================================
warning off</pre></div>
<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
......@@ -91,7 +92,7 @@ This function is called by:
0024 <span class="comment">% Revision history</span>
0025 <span class="comment">%</span>
0026 <span class="comment">%==============================================================================</span>
0027 warning off
0027 <span class="comment">%warning off</span>
0028 subname = <span class="string">'example_FVCOM_wind_ts'</span>;
0029 fprintf(<span class="string">'\n'</span>)
0030 fprintf([<span class="string">'begin : '</span> subname <span class="string">'\n'</span>])
......@@ -170,6 +171,6 @@ This function is called by:
0103
0104
0105</pre></div>
<hr><address>Generated on Tue 18-Dec-2012 12:37:31 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 Tue 04-Jun-2013 12:12:57 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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>Description of example_init_lag</title>
<meta name="keywords" content="example_init_lag">
<meta name="description" content="">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="generator" content="m2html v1.5 &copy; 2003-2005 Guillaume Flandin">
<meta name="robots" content="index, follow">
<link type="text/css" rel="stylesheet" href="../m2html.css">
</head>
<body>
<a name="_top"></a>
<div><a href="../index.html">Home</a> &gt; <a href="index.html">fvcom_prepro</a> &gt; example_init_lag.m</div>
<!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png">&nbsp;Master index</a></td>
<td align="right"><a href="index.html">Index for fvcom_prepro&nbsp;<img alt=">" border="0" src="../right.png"></a></td></tr></table>-->
<h1>example_init_lag
</h1>
<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong></strong></div>
<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>This is a script file. </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"></pre></div>
<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="plot_field.html" class="code" title="function plot_field(Mobj,PlotField,varargin)">plot_field</a> Plot the mesh, user defined field, open boundary nodes, and river points</li><li><a href="read_fvcom_bath.html" class="code" title="function [h] = read_fvcom_bath(bathfile)">read_fvcom_bath</a> Read fvcom bathymetry file</li><li><a href="read_fvcom_mesh.html" class="code" title="function [Mobj] = read_fvcom_mesh(gridfile)">read_fvcom_mesh</a> Read fvcom mesh file into Matlab mesh object</li><li><a href="setup_metrics.html" class="code" title="function [Mobj] = setup_metrics(Mobj)">setup_metrics</a> Setup metrics for mesh object Mesh</li></ul>
This function is called by:
<ul style="list-style-image:url(../matlabicon.gif)">
</ul>
<!-- crossreference -->
<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre>0001 clear all; close all;
0002
0003 <span class="comment">% example script:</span>
0004 <span class="comment">% initialize the online Lagrangian tracking for Julian day (realtime) forcing</span>
0005 <span class="comment">%</span>
0006 <span class="comment">% Author(s):</span>
0007 <span class="comment">% Geoff Cowles (University of Massachusetts Dartmouth)</span>
0008 <span class="comment">%</span>
0009 <span class="comment">% Revision history</span>
0010 <span class="comment">%</span>
0011 <span class="comment">%==============================================================================</span>
0012 <span class="comment">%warning off</span>
0013 type = 2;
0014
0015 <span class="comment">% set mesh/bathymetry files</span>
0016 meshfile = <span class="string">'../Model_Maker/coos01_grd.dat'</span>;
0017 bathfile = <span class="string">'../Model_Maker/coos01_dep.dat'</span>;
0018 lagfile = <span class="string">'test_lag.nc'</span>;
0019
0020 <span class="comment">% start/end time for particles</span>
0021 tbeg = greg2mjulian(2008,01,01,0,0,0);
0022 tend = greg2mjulian(2008,02,01,0,0,0);
0023
0024 <span class="comment">% read in mesh and bathymetry</span>
0025 Mobj = <a href="read_fvcom_mesh.html" class="code" title="function [Mobj] = read_fvcom_mesh(gridfile)">read_fvcom_mesh</a>(meshfile);
0026 Mobj.h = <a href="read_fvcom_bath.html" class="code" title="function [h] = read_fvcom_bath(bathfile)">read_fvcom_bath</a>(bathfile); Mobj.have_bath = true;
0027 Mobj = <a href="setup_metrics.html" class="code" title="function [Mobj] = setup_metrics(Mobj)">setup_metrics</a>(Mobj);
0028
0029
0030 <span class="keyword">if</span>(type==1) <span class="comment">%initialize at all elements</span>
0031
0032 xc = Mobj.xc;
0033 yc = Mobj.yc;
0034 nLag = Mobj.nElems;
0035
0036 <span class="keyword">elseif</span>(type==2) <span class="comment">%initialize along a line of interest</span>
0037 nLag = 10;
0038 p1 = [1.188363e6,194497];
0039 p2 = [1.188548e6,194996];
0040 xp = p1(1):(p2(1)-p1(1))/(nLag-1):p2(1);
0041 yp = p1(2):(p2(2)-p1(2))/(nLag-1):p2(2);
0042
0043 <span class="keyword">end</span>;
0044
0045
0046 <span class="comment">% plot to check</span>
0047 <a href="plot_field.html" class="code" title="function plot_field(Mobj,PlotField,varargin)">plot_field</a>(Mobj,Mobj.h,<span class="string">'title'</span>,<span class="string">'domain'</span>,<span class="string">'withextra'</span>,false,<span class="string">'showgrid'</span>,false); hold on;
0048 plot(xp,yp,<span class="string">'ro'</span>);
0049
0050
0051 <span class="comment">% dump the initial particle position file</span>
0052 nc = netcdf(lagfile,<span class="string">'clobber'</span>);
0053 nc.references = <span class="string">'http://fvcom.smast.umassd.edu'</span>;
0054 nc.source = <span class="string">'lag_init.m'</span>;
0055 nc.info = <span class="string">'debugging '</span>;
0056
0057
0058
0059
0060
0061
0062 <span class="comment">% dimensions</span>
0063 nc(<span class="string">'nparticles'</span>) = nLag;
0064
0065 <span class="comment">% particle vars</span>
0066 nc{<span class="string">'x'</span>} = ncfloat(<span class="string">'nparticles'</span>);
0067 nc{<span class="string">'x'</span>}.long_name = <span class="string">'particle x position'</span>;
0068 nc{<span class="string">'x'</span>}.units = <span class="string">'m'</span>;
0069
0070 nc{<span class="string">'y'</span>} = ncfloat(<span class="string">'nparticles'</span>);
0071 nc{<span class="string">'y'</span>}.long_name = <span class="string">'particle y position'</span>;
0072 nc{<span class="string">'y'</span>}.units = <span class="string">'m'</span>;
0073
0074 nc{<span class="string">'z'</span>} = ncfloat(<span class="string">'nparticles'</span>);
0075 nc{<span class="string">'z'</span>}.long_name = <span class="string">'particle z position'</span>;
0076 nc{<span class="string">'z'</span>}.units = <span class="string">'m'</span>;
0077
0078 nc{<span class="string">'pathlength'</span>} = ncfloat(<span class="string">'nparticles'</span>);
0079 nc{<span class="string">'pathlength'</span>}.long_name = <span class="string">'particle integrated path length'</span>;
0080 nc{<span class="string">'pathlength'</span>}.units = <span class="string">'m'</span>;
0081
0082 nc{<span class="string">'tbeg'</span>} = ncfloat(<span class="string">'nparticles'</span>);
0083 nc{<span class="string">'tbeg'</span>}.long_name = <span class="string">'particle release time'</span>;
0084 nc{<span class="string">'tbeg'</span>}.units = <span class="string">'days since 1858-11-17 00:00:00'</span>;
0085 nc{<span class="string">'tbeg'</span>}.format = <span class="string">'modified julian day (MJD)'</span>;
0086 nc{<span class="string">'tbeg'</span>}.time_zone = <span class="string">'UTC'</span>;
0087
0088 nc{<span class="string">'tend'</span>} = ncfloat(<span class="string">'nparticles'</span>);
0089 nc{<span class="string">'tend'</span>}.long_name = <span class="string">'particle freeze time'</span>;
0090 nc{<span class="string">'tend'</span>}.units = <span class="string">'days since 1858-11-17 00:00:00'</span>;
0091 nc{<span class="string">'tend'</span>}.format = <span class="string">'modified julian day (MJD)'</span>;
0092 nc{<span class="string">'tend'</span>}.time_zone = <span class="string">'UTC'</span>;
0093
0094
0095 nc{<span class="string">'group'</span>} = ncint(<span class="string">'nparticles'</span>);
0096 nc{<span class="string">'group'</span>}.long_name = <span class="string">'particle group'</span>;
0097 nc{<span class="string">'group'</span>}.units = <span class="string">'-'</span>;
0098
0099 nc{<span class="string">'mark'</span>} = ncint(<span class="string">'nparticles'</span>);
0100 nc{<span class="string">'mark'</span>}.long_name = <span class="string">'particle mark'</span>;
0101 nc{<span class="string">'mark'</span>}.units = <span class="string">'-'</span>;
0102
0103 <span class="comment">% dump vars</span>
0104 nc{<span class="string">'x'</span>}(:) = xp;
0105 nc{<span class="string">'y'</span>}(:) = yp;
0106 nc{<span class="string">'z'</span>}(:) = 0.0;
0107 nc{<span class="string">'tbeg'</span>}(:) = tbeg;
0108 nc{<span class="string">'tend'</span>}(:) = tend;
0109 nc{<span class="string">'group'</span>}(:) = 1;
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 04-Jun-2013 12:12:57 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.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>Description of get_POLCOMS_river_discharge</title>
<meta name="keywords" content="get_POLCOMS_river_discharge">
<meta name="description" content="Parse the POLCOMS rivers data file.">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="generator" content="m2html v1.5 &copy; 2003-2005 Guillaume Flandin">
<meta name="robots" content="index, follow">
<link type="text/css" rel="stylesheet" href="../m2html.css">
</head>
<body>
<a name="_top"></a>
<div><a href="../index.html">Home</a> &gt; <a href="index.html">fvcom_prepro</a> &gt; get_POLCOMS_river_discharge.m</div>
<!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png">&nbsp;Master index</a></td>
<td align="right"><a href="index.html">Index for fvcom_prepro&nbsp;<img alt=">" border="0" src="../right.png"></a></td></tr></table>-->
<h1>get_POLCOMS_river_discharge
</h1>
<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>Parse the POLCOMS rivers data file.</strong></div>
<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function Mobj = get_POLCOMS_river_discharge(Mobj, polcoms_flow) </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"> Parse the POLCOMS rivers data file.
get_POLCOMS_rivers(Mobj, polcoms_file, polcoms_grid, polcoms_ij)
DESCRIPTION:
Takes POLCOMS grid and index files and returns the positions and names
of the rivers within the index file.
INPUT:
Mobj - MATLAB mesh object into which the outputs will be added.
polcoms_flow - flow data file(s) from POLCOMS. For multiple files, give
in chronological order as a cell array of file names.
OUTPUT:
Mobj.river_discharge - array of discharges for the rivers in the
POLCOMS river flow file(s).
EXAMPLE USAGE:
Mobj = get_POLCOMS_river_discharge(Mobj, 'polcoms.flw')
Author(s):
Pierre Cazenave (Plymouth Marine Laboratory)
Revision history:
2013-04-15 - First version from the original get_POLCOMS_rivers.m.
==========================================================================</pre></div>
<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../matlabicon.gif)">
</ul>
This function is called by:
<ul style="list-style-image:url(../matlabicon.gif)">
</ul>
<!-- crossreference -->
<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 = get_POLCOMS_river_discharge(Mobj, polcoms_flow)</a>
0002 <span class="comment">% Parse the POLCOMS rivers data file.</span>
0003 <span class="comment">%</span>
0004 <span class="comment">% get_POLCOMS_rivers(Mobj, polcoms_file, polcoms_grid, polcoms_ij)</span>
0005 <span class="comment">%</span>
0006 <span class="comment">% DESCRIPTION:</span>
0007 <span class="comment">% Takes POLCOMS grid and index files and returns the positions and names</span>
0008 <span class="comment">% of the rivers within the index file.</span>
0009 <span class="comment">%</span>
0010 <span class="comment">% INPUT:</span>
0011 <span class="comment">% Mobj - MATLAB mesh object into which the outputs will be added.</span>
0012 <span class="comment">% polcoms_flow - flow data file(s) from POLCOMS. For multiple files, give</span>
0013 <span class="comment">% in chronological order as a cell array of file names.</span>
0014 <span class="comment">%</span>
0015 <span class="comment">% OUTPUT:</span>
0016 <span class="comment">% Mobj.river_discharge - array of discharges for the rivers in the</span>
0017 <span class="comment">% POLCOMS river flow file(s).</span>
0018 <span class="comment">%</span>
0019 <span class="comment">% EXAMPLE USAGE:</span>
0020 <span class="comment">% Mobj = get_POLCOMS_river_discharge(Mobj, 'polcoms.flw')</span>
0021 <span class="comment">%</span>
0022 <span class="comment">% Author(s):</span>
0023 <span class="comment">% Pierre Cazenave (Plymouth Marine Laboratory)</span>
0024 <span class="comment">%</span>
0025 <span class="comment">% Revision history:</span>
0026 <span class="comment">% 2013-04-15 - First version from the original get_POLCOMS_rivers.m.</span>
0027 <span class="comment">%</span>
0028 <span class="comment">%==========================================================================</span>
0029
0030 subname = <span class="string">'get_POLCOMS_river_discharge'</span>;
0031
0032 <span class="keyword">global</span> ftbverbose;
0033 <span class="keyword">if</span> ftbverbose
0034 fprintf([<span class="string">'\nbegin : '</span> subname <span class="string">'\n'</span>])
0035 <span class="keyword">end</span>
0036
0037 <span class="comment">% Check inputs</span>
0038 <span class="keyword">if</span> exist(polcoms_flow, <span class="string">'file'</span>) ~= 2
0039 error(<span class="string">'file: %s does not exist or is not readable.'</span>, polcoms_grid)
0040 <span class="keyword">end</span>
0041
0042 <span class="comment">% The POLCOMS river file has a pretty straightforward format of a 2D array</span>
0043 <span class="comment">% of river along x and time along y. Since it's a simple text file with no</span>
0044 <span class="comment">% weird format, we'll just read it in with load.</span>
0045 <span class="keyword">if</span> iscell(polcoms_flow)
0046 pc_riv = [];
0047 <span class="keyword">for</span> rr = 1:length(polcoms_flow)
0048 pc_riv = [pc_riv; load(polcoms_flow{rr})];
0049 <span class="keyword">end</span>
0050 clear rr
0051 <span class="keyword">else</span>
0052 pc_riv = load(polcoms_flow);
0053 <span class="keyword">end</span>
0054 [pc_nt, pc_nr] = size(pc_riv);
0055
0056 <span class="comment">% Return the number of river and the number of times along with the actual</span>
0057 <span class="comment">% discharge data.</span>
0058 Mobj.rivers.num = pc_nr;
0059 Mobj.rivers.num_time = pc_nt;
0060 Mobj.rivers.discharge = pc_riv;
0061
0062 <span class="keyword">if</span> ftbverbose
0063 fprintf([<span class="string">'end : '</span> subname <span class="string">'\n'</span>])
0064 <span class="keyword">end</span></pre></div>