Commit 696b882b authored by Pierre Cazenave's avatar Pierre Cazenave
Browse files

Update the documentation to include all the new utilities I created

parent 3707bb5c
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -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 Wed 02-Nov-2011 21:58:00 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 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>
</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_surface_plot</title>
<meta name="keywords" content="example_surface_plot">
<meta name="description" content="Sample script to extract and generate m_map contours of tracer variables">
<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_postproc</a> &gt; example_surface_plot.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_postproc&nbsp;<img alt=">" border="0" src="../right.png"></a></td></tr></table>-->
<h1>example_surface_plot
</h1>
<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>Sample script to extract and generate m_map contours of tracer variables</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"> Sample script to extract and generate m_map contours of tracer variables
Modify to suit your requirements
DESCRIPTION:
Extracts data from FVCOM and generates contour plots using m_map
INPUT:
OUTPUT:
EXAMPLE USAGE
See scripts and modify at will
Author(s):
Ricardo Torres and Pierre Cazenave (Plymouth Marine Laboratory)
Revision history
==============================================================================</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 <span class="comment">% Sample script to extract and generate m_map contours of tracer variables</span>
0002 <span class="comment">% Modify to suit your requirements</span>
0003 <span class="comment">%</span>
0004 <span class="comment">% DESCRIPTION:</span>
0005 <span class="comment">% Extracts data from FVCOM and generates contour plots using m_map</span>
0006 <span class="comment">%</span>
0007 <span class="comment">% INPUT:</span>
0008 <span class="comment">%</span>
0009 <span class="comment">%</span>
0010 <span class="comment">%</span>
0011 <span class="comment">% OUTPUT:</span>
0012 <span class="comment">%</span>
0013 <span class="comment">% EXAMPLE USAGE</span>
0014 <span class="comment">% See scripts and modify at will</span>
0015 <span class="comment">%</span>
0016 <span class="comment">% Author(s):</span>
0017 <span class="comment">% Ricardo Torres and Pierre Cazenave (Plymouth Marine Laboratory)</span>
0018 <span class="comment">%</span>
0019 <span class="comment">% Revision history</span>
0020 <span class="comment">%</span>
0021 <span class="comment">%==============================================================================</span>
0022 addpath ../utilities
0023 <span class="comment">%%-----------------------------------------------------------</span>
0024 <span class="comment">% set directories default values</span>
0025 <span class="comment">%</span>
0026 FVCOM_root = <span class="string">''</span>;
0027 FVCOM_data_dir=<span class="string">'/home_nfs/rito/models/FVCOM/runCO2_leak/output/'</span>;
0028 FVCOM_mat_dir=<span class="string">'../mat/'</span>;
0029 FVCOM_plot_dir=<span class="string">'../plots/'</span>;
0030 FVCOM_ =<span class="string">'./'</span>;
0031 <span class="comment">%</span>
0032 time_offset = 678942; <span class="comment">% from FVCOM time to matlab time</span>
0033 <span class="comment">%%</span>
0034 <span class="comment">%------------------------------------------------------------------------------</span>
0035 <span class="comment">% set casename specifics here</span>
0036 <span class="comment">%------------------------------------------------------------------------------</span>
0037 <span class="comment">%</span>
0038 casename=<span class="string">'co2_S5'</span>;
0039 experiment_name=<span class="string">'slowleak'</span>
0040 [plotOPTS.range_lat ,plotOPTS.range_lon] = deal([50.1 50.4],[ -4.5 -3.85]);
0041 base_year = datenum(2006,1,1,0,0,0);
0042 files_FVCOM =<span class="string">'co2_S5.1.2.1_0002.nc'</span><span class="comment">%</span>
0043 date_range={<span class="string">'30/01/06 00:00:00'</span>,<span class="string">'01/02/06 23:00:00'</span>}; <span class="comment">% -1 if all available data wanted</span>
0044 plotOPTS.fig_name = [casename <span class="string">'_'</span> experiment_name];
0045 var_2_xtractFVCOM = {<span class="string">'Itime'</span>,<span class="string">'Itime2'</span>,<span class="string">'xc'</span>,<span class="string">'yc'</span>,<span class="string">'h'</span>,<span class="string">'siglay'</span>,<span class="string">'siglev'</span>,<span class="string">'zeta'</span>,<span class="string">'salinity'</span>,<span class="string">'u'</span>,<span class="string">'v'</span>};
0046 dt=1/24; <span class="comment">% time step of output in days.</span>
0047 <span class="comment">% Time record to extract</span>
0048 <span class="comment">%</span>
0049 STnum = datenum(date_range{1},<span class="string">'dd/mm/yy HH:MM:SS'</span>);
0050 ENDnum = datenum(date_range{2},<span class="string">'dd/mm/yy HH:MM:SS'</span>);
0051 Time_record=STnum:dt:ENDnum;
0052 CD=pwd
0053 <span class="comment">%%</span>
0054 <span class="comment">%------------------------------------------------------------------------------</span>
0055 <span class="comment">% Specify What indices to read from FVCOM file</span>
0056 <span class="comment">%------------------------------------------------------------------------------</span>
0057 node_idx= -1 <span class="comment">% to extract all nodes from netcdf file</span>
0058 nele_idx=-1 <span class="comment">% to extract all elements from netcdf file</span>
0059 siglev_idx=-1 <span class="comment">% to extract all water levels from netcdf file</span>
0060 siglay_idx=-1 <span class="comment">% to extract all water levels from netcdf file</span>
0061
0062 <span class="comment">%%</span>
0063 <span class="comment">%------------------------------------------------------------------------------</span>
0064 <span class="comment">% load mesh information for current casename This is generated at preproc</span>
0065 <span class="comment">% stage (see %%%% matlab script)</span>
0066 <span class="comment">%------------------------------------------------------------------------------</span>
0067 load(fullfile(FVCOM_mat_dir, [casename, <span class="string">'mesh'</span>]));
0068 plotOPTS.mesh=mesh;
0069
0070 <span class="comment">%%</span>
0071 <span class="comment">%------------------------------------------------------------------------------</span>
0072 <span class="comment">% Specify variable and conditions of plot</span>
0073 <span class="comment">%------------------------------------------------------------------------------</span>
0074 <span class="comment">% if you have a coastline that can be directly used by m_map here is the</span>
0075 <span class="comment">% place to put it!</span>
0076 plotOPTS.coastline_file=[FVCOM_mat_dir <span class="string">'tamar3_0coast.mat'</span>];
0077 <span class="comment">% m_map projection information</span>
0078 plotOPTS.zone=30;
0079 plotOPTS.ell=<span class="string">'grs80'</span>;
0080 <span class="comment">% variable to plot</span>
0081 plotOPTS.var_plot = <span class="string">'PH'</span>;
0082 <span class="comment">% color limits for the colorbar</span>
0083 plotOPTS.clims=[6.0 8.0]
0084 plotOPTS.do_mesh=0; <span class="comment">% don't display mesh 1 to overlay mesh</span>
0085 plotOPTS.nz_plot=1;<span class="comment">% layer to plot</span>
0086 plotOPTS.Time_record=Time_record; <span class="comment">% time steps to make plots (1 for single or more for animation)</span>
0087 <span class="comment">%% ------------------------------------------------------------------------</span>
0088 <span class="comment">%%</span>
0089 <span class="comment">%------------------------------------------------------------------------------</span>
0090 <span class="comment">% read FVCOM data. See read_netCDF_FVCOM.m for help</span>
0091 <span class="comment">%------------------------------------------------------------------------------</span>
0092 <span class="comment">%</span>
0093 FVCOM_data=read_netCDF_FVCOM(<span class="string">'time'</span>,date_range,<span class="string">'data_dir'</span>,FVCOM_data_dir ,<span class="keyword">...</span>
0094 <span class="string">'file_netcdf'</span>,files_FVCOM,<span class="string">'node_idx'</span>,node_idx,<span class="string">'nele_idx'</span>,nele_idx,<span class="string">'siglev_idx'</span>,siglev_idx,<span class="keyword">...</span>
0095 <span class="string">'siglay_idx'</span>,siglay_idx,<span class="string">'varnames'</span>,var_2_xtractFVCOM)
0096 <span class="comment">% put variables into a strcuture variable</span>
0097 <span class="keyword">for</span> vv=1:length(var_2_xtractFVCOM)
0098 FVCOM.(var_2_xtractFVCOM{vv}) = FVCOM_data{vv};
0099 <span class="keyword">end</span>
0100
0101 <span class="comment">%%</span>
0102 <span class="comment">%------------------------------------------------------------------------------</span>
0103 <span class="comment">% Do surface contour plots</span>
0104 <span class="comment">%------------------------------------------------------------------------------</span>
0105 <span class="comment">% select figure to plot on</span>
0106 plotOPTS.figure=1;
0107 PLotoutS=do_surface_plot(plotOPTS,FVCOM)
0108 <span class="comment">% PLotoutS has the figure handles or last handle if a time series is being</span>
0109 <span class="comment">% plot</span>
0110 <span class="comment">%------------------------------------------------------------------------------</span>
0111 <span class="comment">% Do vector maps at single or multiple levels plots</span>
0112 <span class="comment">%------------------------------------------------------------------------------</span>
0113 plotOPTS.figure=2;
0114 <span class="comment">% plotOPTS.nz_plot_vec optional. If it exists, it will overlay vectors from</span>
0115 <span class="comment">% the specified layers, otherwise it uses layer from nz_plot</span>
0116 plotOPTS.nz_plot_vec=[1,10];
0117 plotOPTS.data_dec=5;
0118 plotOPTS.vel_sca=5; <span class="comment">% scaling for ploting vectors with m_map m_vec.</span>
0119 plotOPTS.pause=0.5 <span class="comment">% pause between generation of plots</span>
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 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>
</body>
</html>
\ No newline at end of file
......@@ -19,11 +19,13 @@
<h2>Matlab files in this directory:</h2>
<table>
<tr><td><img src="../matlabicon.gif" alt="" border="">&nbsp;<a href="README.html">README</a></td><td>README for FVCOM_postproc </td></tr></table>
<tr><td><img src="../matlabicon.gif" alt="" border="">&nbsp;<a href="README.html">README</a></td><td>README for FVCOM_postproc </td></tr><tr><td><img src="../matlabicon.gif" alt="" border="">&nbsp;<a href="example_surface_plot.html">example_surface_plot</a></td><td>Sample script to extract and generate m_map contours of tracer variables </td></tr></table>
<h2>Subsequent directories:</h2>
<ul style="list-style-image:url(../matlabicon.gif)">
<li>mat</li><li>plots</li><li>surface_plots</li><li>timeseries</li><li>transect_plots</li></ul>
<hr><address>Generated on Wed 02-Nov-2011 21:57: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 Tue 18-Dec-2012 12:37:29 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
......@@ -29,17 +29,19 @@
<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> README for the FVCOM preprocessing toolbox
This directory contains matlab scripts for preprocessing input files
for FVCOM 3.x. These include files which read a mesh in from SMS,
This directory contains matlab scripts for preprocessing input files
for FVCOM 3.x. These include files which read a mesh in from SMS,
files that allow you to select open boundary and river nodes and generate
river, tidal, and wind forcing. Template files for generating wind forcing
are also included.
are also included.
Author(s):
Author(s):
Geoff Cowles (University of Massachusetts Dartmouth)
Ricardo Torres (Plymouth Marine Laboratory)
Pierre Cazenave (Plymouth Marine Laboratory)
Revision history
==============================================================================</pre></div>
<!-- crossreference -->
......@@ -65,10 +67,12 @@ This function is called by:
0008 <span class="comment">%</span>
0009 <span class="comment">% Author(s):</span>
0010 <span class="comment">% Geoff Cowles (University of Massachusetts Dartmouth)</span>
0011 <span class="comment">%</span>
0012 <span class="comment">% Revision history</span>
0011 <span class="comment">% Ricardo Torres (Plymouth Marine Laboratory)</span>
0012 <span class="comment">% Pierre Cazenave (Plymouth Marine Laboratory)</span>
0013 <span class="comment">%</span>
0014 <span class="comment">%==============================================================================</span></pre></div>
<hr><address>Generated on Wed 02-Nov-2011 21:58:00 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
0014 <span class="comment">% Revision history</span>
0015 <span class="comment">%</span>
0016 <span class="comment">%==============================================================================</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>
</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 Wed 02-Nov-2011 21:58:00 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 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>
</body>
</html>
\ No newline at end of file
......@@ -24,7 +24,7 @@
<div class="box"><strong>Add a set of obc nodes comprising a single obc boundary 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_obc_nodes_screen(Mobj,ObcName,ObcType) </strong></div>
<div class="box"><strong>function [Mobj] = add_obc_nodes_graphic(Mobj,ObcName,ObcType) </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
......@@ -70,7 +70,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_screen(Mobj,ObcName,ObcType)</a>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [Mobj] = add_obc_nodes_graphic(Mobj,ObcName,ObcType)</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">% By clicking on points on the screen</span>
......@@ -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 Wed 02-Nov-2011 21:58:00 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 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>
</body>
</html>
\ No newline at end of file
......@@ -24,13 +24,13 @@
<div class="box"><strong>Add a set of obc nodes comprising a single obc boundary 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_obc_nodes_list(Mobj,Nlist,ObcName,ObcType) </strong></div>
<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
Using a list of nodes
[Mobj] = add_obc_nodes(Mobj)
[Mobj] = add_obc_nodes_list(Mobj,Nlist,ObcName,ObcType)
DESCRIPTION:
Select using ginput the set of nodes comprising an obc
......@@ -40,6 +40,7 @@
Nlist = List of nodes
ObcName = Name of the Open Boundary
ObcType = FVCOM Flag for OBC Type
plotFig = [optional] show a figure of the mesh (1 = yes)
OUTPUT:
Mobj = Matlab mesh object with an additional obc nodelist
......@@ -49,14 +50,13 @@
Author(s):
Geoff Cowles (University of Massachusetts Dartmouth)
Pierre Cazenave (Plymouth Marine Laboratory)
Note:
Uses ginput2 which allows zoom/pan before selecting points and displays
clicked points realtime
Revision history
Revision history:
2012-11-26 Add ability to turn off the figures.
==============================================================================</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>
......@@ -71,12 +71,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_obc_nodes_list(Mobj,Nlist,ObcName,ObcType) </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>
0005 <span class="comment">%</span>
0006 <span class="comment">% [Mobj] = add_obc_nodes(Mobj)</span>
0006 <span class="comment">% [Mobj] = add_obc_nodes_list(Mobj,Nlist,ObcName,ObcType)</span>
0007 <span class="comment">%</span>
0008 <span class="comment">% DESCRIPTION:</span>
0009 <span class="comment">% Select using ginput the set of nodes comprising an obc</span>
......@@ -86,74 +86,80 @@ This function is called by:
0013 <span class="comment">% Nlist = List of nodes</span>
0014 <span class="comment">% ObcName = Name of the Open Boundary</span>
0015 <span class="comment">% ObcType = FVCOM Flag for OBC Type</span>
0016 <span class="comment">%</span>
0017 <span class="comment">% OUTPUT:</span>
0018 <span class="comment">% Mobj = Matlab mesh object with an additional obc nodelist</span>
0019 <span class="comment">%</span>
0020 <span class="comment">% EXAMPLE USAGE</span>
0021 <span class="comment">% Mobj = add_obc_nodes_list(Mobj,Nlist,'OpenOcean')</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">% Note:</span>
0027 <span class="comment">% Uses ginput2 which allows zoom/pan before selecting points and displays</span>
0028 <span class="comment">% clicked points realtime</span>
0029 <span class="comment">%</span>
0030 <span class="comment">% Revision history</span>
0016 <span class="comment">% plotFig = [optional] show a figure of the mesh (1 = yes)</span>
0017 <span class="comment">%</span>
0018 <span class="comment">% OUTPUT:</span>
0019 <span class="comment">% Mobj = Matlab mesh object with an additional obc nodelist</span>
0020 <span class="comment">%</span>
0021 <span class="comment">% EXAMPLE USAGE</span>
0022 <span class="comment">% Mobj = add_obc_nodes_list(Mobj,Nlist,'OpenOcean')</span>
0023 <span class="comment">%</span>
0024 <span class="comment">% Author(s):</span>
0025 <span class="comment">% Geoff Cowles (University of Massachusetts Dartmouth)</span>
0026 <span class="comment">% Pierre Cazenave (Plymouth Marine Laboratory)</span>
0027 <span class="comment">%</span>
0028 <span class="comment">%</span>
0029 <span class="comment">% Revision history:</span>
0030 <span class="comment">% 2012-11-26 Add ability to turn off the figures.</span>
0031 <span class="comment">%</span>
0032 <span class="comment">%==============================================================================</span>
0032 <span class="comment">%==========================================================================</span>
0033 subname = <span class="string">'add_obc_nodes'</span>;
0034 <span class="keyword">global</span> ftbverbose
0035 <span class="keyword">if</span>(ftbverbose)
0036 fprintf(<span class="string">'\n'</span>)
0037 fprintf([<span class="string">'begin : '</span> subname <span class="string">'\n'</span>])
0038 <span class="keyword">end</span>;
0038 <span class="keyword">end</span>
0039
0040
0041 <span class="comment">%------------------------------------------------------------------------------</span>
0042 <span class="comment">% Get a unique list and make sure they are in the range of node numbers</span>
0043 <span class="comment">%------------------------------------------------------------------------------</span>
0044 Nlist = unique(Nlist);
0045
0046 <span class="keyword">if</span>(max(Nlist) &gt; Mobj.nVerts);
0047 fprintf(<span class="string">'your open boundary node number exceed the total number of nodes in the domain\n'</span>);
0048 error(<span class="string">'stopping...\n'</span>)
0049 <span class="keyword">end</span>;
0050
0051 <span class="comment">%------------------------------------------------------------------------------</span>
0052 <span class="comment">% Plot the mesh</span>
0053 <span class="comment">%------------------------------------------------------------------------------</span>
0040 <span class="comment">% Do we want a figure showing how we're getting along?</span>
0041 <span class="keyword">if</span> nargin == 4
0042 plotFig = 0;
0043 <span class="keyword">end</span>
0044
0045 <span class="comment">%--------------------------------------------------------------------------</span>
0046 <span class="comment">% Get a unique list and make sure they are in the range of node numbers</span>
0047 <span class="comment">%--------------------------------------------------------------------------</span>
0048 Nlist = unique(Nlist);
0049
0050 <span class="keyword">if</span>(max(Nlist) &gt; Mobj.nVerts);
0051 fprintf(<span class="string">'your open boundary node number exceed the total number of nodes in the domain\n'</span>);
0052 error(<span class="string">'stopping...\n'</span>)
0053 <span class="keyword">end</span>
0054
0055 <span class="keyword">if</span>(lower(Mobj.nativeCoords(1:3)) == <span class="string">'car'</span>)
0056 x = Mobj.x;
0057 y = Mobj.y;
0058 <span class="keyword">else</span>
0059 x = Mobj.lon;
0060 y = Mobj.lat;
0061 <span class="keyword">end</span>;
0062
0063 figure
0064 patch(<span class="string">'Vertices'</span>,[x,y],<span class="string">'Faces'</span>,Mobj.tri,<span class="keyword">...</span>
0065 <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>);
0066 hold on;
0067
0068 plot(x(Nlist),y(Nlist),<span class="string">'ro'</span>);
0069 title(<span class="string">'open boundary nodes'</span>);
0070
0071 <span class="comment">% add to mesh object</span>
0072 npts = numel(Nlist);
0073 Mobj.nObs = Mobj.nObs + 1;
0074 Mobj.nObcNodes(Mobj.nObs) = npts;
0075 Mobj.obc_nodes(Mobj.nObs,1:npts) = Nlist;
0076 Mobj.obc_name{Mobj.nObs} = ObcName;
0077 Mobj.obc_type(Mobj.nObs) = ObcType;
0078
0079
0080 <span class="keyword">if</span>(ftbverbose)
0081 fprintf([<span class="string">'end : '</span> subname <span class="string">'\n'</span>])
0082 <span class="keyword">end</span>;
0083</pre></div>
<hr><address>Generated on Wed 02-Nov-2011 21:58:00 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
0055 <span class="comment">%--------------------------------------------------------------------------</span>
0056 <span class="comment">% Plot the mesh</span>
0057 <span class="comment">%--------------------------------------------------------------------------</span>
0058 <span class="keyword">if</span> plotFig == 1
0059 <span class="keyword">if</span> strcmpi(Mobj.nativeCoords(1:3), <span class="string">'car'</span>)
0060 x = Mobj.x;
0061 y = Mobj.y;
0062 <span class="keyword">else</span>
0063 x = Mobj.lon;
0064 y = Mobj.lat;
0065 <span class="keyword">end</span>
0066
0067 figure
0068 patch(<span class="string">'Vertices'</span>,[x,y],<span class="string">'Faces'</span>,Mobj.tri,<span class="keyword">...</span>
0069 <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>);
0070 hold on;
0071 whos Nlist
0072 plot(x(Nlist),y(Nlist),<span class="string">'ro'</span>);
0073 axis(<span class="string">'equal'</span>,<span class="string">'tight'</span>)
0074 title(<span class="string">'open boundary nodes'</span>);
0075 <span class="keyword">end</span>
0076
0077 <span class="comment">% add to mesh object</span>
0078 npts = numel(Nlist);
0079 Mobj.nObs = Mobj.nObs + 1;
0080 Mobj.nObcNodes(Mobj.nObs) = npts;
0081 Mobj.obc_nodes(Mobj.nObs,1:npts) = Nlist;
0082 Mobj.obc_name{Mobj.nObs} = ObcName;
0083 Mobj.obc_type(Mobj.nObs) = ObcType;
0084
0085
0086 <span class="keyword">if</span>(ftbverbose)
0087 fprintf([<span class="string">'end : '</span> subname <span class="string">'\n'</span>])
0088 <span class="keyword">end</span>
0089</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>
</body>
</html>
\ No newline at end of file
......@@ -161,6 +161,6 @@ This function is called by:
0091 fprintf([<span class="string">'end : '</span> subname <span class="string">'\n'</span>])
0092 <span class="keyword">end</span>;
0093</pre></div>
<hr><address>Generated on Wed 02-Nov-2011 21:58:00 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 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>
</body>
</html>
\ No newline at end of file
......@@ -149,6 +149,6 @@ This function is called by:
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 Wed 02-Nov-2011 21:58:00 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 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>
</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 Wed 02-Nov-2011 21:58:00 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 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>
</body>
</html>
\ No newline at end of file
......@@ -121,41 +121,42 @@ This function is called by:
0049 figure
0050 patch(<span class="string">'Vertices'</span>,[x,y],<span class="string">'Faces'</span>,Mobj.tri,<span class="keyword">...</span>
0051 <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>);
0052 hold on;
0053
0054 <span class="comment">% use ginput2 (which allows zooming and plots points as they are clicked) to let</span>
0055 <span class="comment">% user select the boundary points</span>
0056 [xselect] = ginput2(true,<span class="string">'k+'</span>)
0057
0052 axis(<span class="string">'equal'</span>,<span class="string">'tight'</span>)
0053 hold on;
0054
0055 <span class="comment">% use ginput2 (which allows zooming and plots points as they are clicked) to let</span>
0056 <span class="comment">% user select the boundary points</span>
0057 [xselect] = ginput2(true,<span class="string">'k+'</span>)
0058
0059 [npts,jnk] = size(xselect);
0060
0061 <span class="keyword">if</span>(npts == 0)
0062 fprintf(<span class="string">'you didn''t select any points'</span>)
0063 fprintf([<span class="string">'end : '</span> subname <span class="string">'\n'</span>])
0064 <span class="keyword">return</span>
0065 <span class="keyword">end</span>;
0066 fprintf(<span class="string">'you selected %d points\n'</span>,npts)
0067
0068 <span class="comment">% snap to the closest vertices</span>
0069 <span class="keyword">for</span> i=1:npts
0070 [ipt(i),dist] = <a href="find_nearest_pt.html" class="code" title="function [Point,Distance] = find_nearest_pt(xloc,yloc,Mobj)">find_nearest_pt</a>(xselect(i,1),xselect(i,2),Mobj);
0071 <span class="keyword">end</span>;
0072
0073 <span class="comment">% replot domain with snapped vertices</span>
0074 plot(x(ipt),y(ipt),<span class="string">'ro'</span>);
0075
0076 <span class="comment">% add to mesh object</span>
0077 Mobj.nSponge = Mobj.nSponge + 1;
0078 Mobj.nSpongeNodes(Mobj.nSponge) = npts;
0079 Mobj.sponge_nodes(Mobj.nSponge,1:npts) = ipt;
0080 Mobj.sponge_name{Mobj.nSponge} = SpongeName;
0081 Mobj.sponge_rad(Mobj.nSponge) = SpongeRadius;
0082 Mobj.sponge_fac(Mobj.nSponge) = SpongeCoeff;
0083
0059
0060 npts = size(xselect,1);
0061
0062 <span class="keyword">if</span>(npts == 0)
0063 fprintf(<span class="string">'you didn''t select any points'</span>)
0064 fprintf([<span class="string">'end : '</span> subname <span class="string">'\n'</span>])
0065 <span class="keyword">return</span>
0066 <span class="keyword">end</span>;
0067 fprintf(<span class="string">'you selected %d points\n'</span>,npts)
0068