BrianOBlanton / adcirc_util

Public matlab codes for dealing with ADCIRC model output
MIT License
4 stars 5 forks source link

adcirc_util

Draft public matlab codes for dealing with ADCIRC

MATLAB functions to contour, plot, etc triangular finite element model output (ADCIRC).

11 Nov 2022

Dependencies: None, but nctoolbox (https://github.com/nctoolbox/nctoolbox) will make life much easier. Nctoolbox greatly simplifies handling ADCIRC netCDF files.

Clone repo and then add /adcirc_util to the MATLAB function path, then execute

  AddAdcircPaths(/adcirc_util)

To add ADCIRC paths to the MATLAB MATLABPATH variable in the user's matlab/startup.m file, add:

  global ADCIRC
  ADCIRC='/adcirc_util';
  AddAdcircPaths(ADCIRC)

Basic commands

Load a grid

g=loadgrid('gridname');

or, using nctoolbox and a url to a ADCIRC netCDF "global" file:

  % locally available maxele file
  url='maxele.63.nc'; 

  % or: 
  % maxele file on a TDS
  url='http://tds.renci.org/thredds/dodsC/NCFS_CURRENT_SYNOPTIC/maxele.63.nc';

  nc=ncgeodataset(url);
  g=ExtractGrid(nc);

Draw grid elements, add contour

  helems=drawelems(g);
  hcont=lcontour(g,'z',0,'LineWidth',1,'color','r');
  axis('equal')