function [tri,lon,lat,depth,amp,pha]=tide_view_maj(con,coast); % TIDE_VIEW_MAJ plots major axis amplitude and phase from ADCIRC % % Usage: [tri,lon,lat,depth,amp,pha]=tide_view_maj(con,coast) % % This function plots major axis tidal amplitude and phase of a particular % constituent from a finite element tidal model (ADCIRC run). % % On Input: % % con Tidal constituent to plot (stream): % con => 'Steady', 'O1', 'K1', 'N2', 'M2', 'S2', 'M4', 'M6' % (Steady for tidal residual elevation) % coast 'EAST' (Atlantic and Gulf of Mexico) % 'WEST' (West Coast, Hawaii and Alaska) % % On Output: % % tri Triangular mesh 3D face matrix. % lon Longitude ot triangle vertexes. % lat Latitude ot triangle vertexes. % depth Depth of the mesh. % % To plot the mesh use: % % trimesh(tri,lon,lat,depth); view(2); shading('flat'); colorbar; % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Load ADCIRC data. if nargin==1, coast='EAST'; end switch upper(coast) case 'EAST' ; load adcirc_ec2001v2e_fix case 'WEST' ; load adcirc_enpac2003_tide.mat end % Determine index of tidal constituent to plot. [m,n]=size(names); iconst=0; for i=1:m, if (strcmp(names(i,1:length(con)),upper(con))), iconst=i; end, end , if (iconst==0), disp(sprintf('The %s constituent is not valid',con)) return end, u=u(:,iconst); v=v(:,iconst); [sema,ecc,inc,pha]=ap2ep(abs(u),angled(u),abs(v),angled(v)); %---------------------------------------------------------------------------- % Plot amplitude. %---------------------------------------------------------------------------- if (strcmp(con,'Steady')), amp=sema; pha=[]; trisurf(tri,lon,lat,amp); view(2); shading('flat'); colorbar; else amp=sema; subplot(211); trisurf(tri,lon,lat,amp); view(2); shading('flat'); colorbar; end, title(['Major Axis Amplitude of ' names(iconst,:) ' (m/s)']); dasp(mean(lat(:))); % set aspect ratio %axis([-119 -118 33.3 33.9]);caxis([0 .1]); colorbar %---------------------------------------------------------------------------- % Plot phase. %---------------------------------------------------------------------------- if (~strcmp(con,'Steady')), subplot(212); ind=find(pha<50); pha(ind)=pha(ind)+360; pha=pha-360; trisurf(tri,lon,lat,pha); view(2); shading('flat'); colorbar; title(['Greenwich Phase of ' names(iconst,:) ' (degrees)']); dasp(mean(lat(:))); % set aspect ratio end, % if you want to restrict the lon/lat range %axis([-119 -118 33.3 33.9]);caxis([-90 30]); colorbar return