Home > fvcom_prepro > example2.m

example2

PURPOSE ^

example demonstrating reading in an FVCOM mesh and smoothing the bathymetry

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 example demonstrating reading in an FVCOM mesh and smoothing the bathymetry

 function example

 DESCRIPTION:
    Read in FVCOM mesh
    Read in FVCOM bathymetry
    Smooth bathymetry
    Dump new bathymetry

 INPUT
   
 OUTPUT:
    Smoothed Bathymetry File

 EXAMPLE USAGE
    example2

 Author(s):  
    Geoff Cowles (University of Massachusetts Dartmouth)

 Revision history
   
==============================================================================

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % example demonstrating reading in an FVCOM mesh and smoothing the bathymetry
0002 %
0003 % function example
0004 %
0005 % DESCRIPTION:
0006 %    Read in FVCOM mesh
0007 %    Read in FVCOM bathymetry
0008 %    Smooth bathymetry
0009 %    Dump new bathymetry
0010 %
0011 % INPUT
0012 %
0013 % OUTPUT:
0014 %    Smoothed Bathymetry File
0015 %
0016 % EXAMPLE USAGE
0017 %    example2
0018 %
0019 % Author(s):
0020 %    Geoff Cowles (University of Massachusetts Dartmouth)
0021 %
0022 % Revision history
0023 %
0024 %==============================================================================
0025 
0026 clear all; close all;
0027 
0028 % read the Mesh from an FVCOM grid file
0029 Mobj = read_fvcom_mesh('skg4.3_grd.dat');
0030 
0031 % read the bathymetry from an FVCOM grid file
0032 Mobj.h = read_fvcom_bath('skg4.3_dep.dat');  Mobj.have_bath = true;
0033 
0034 % smooth bathymetry with 4 iterations of explicit smoother
0035 plot_field(Mobj,Mobj.h,'title','original bathymetry')
0036 Mobj = setup_metrics(Mobj);
0037 [Mobj.h] = smoothfield(Mobj.h,Mobj,0.5,4);
0038 plot_field(Mobj,Mobj.h,'title','smoothed bathymetry');
0039 
0040 % dump bathymetry
0041 write_FVCOM_bath(Mobj,'skg4.3_dep_smoothed.dat')
0042

Generated on Thu 19-Mar-2015 12:20:56 by m2html © 2005