source: Roms_tools/Tides/plot_tide.m @ 1

Last change on this file since 1 was 1, checked in by cholod, 13 years ago

import Roms_Agrif

File size: 2.7 KB
Line 
1function plot_tide(grdname,frcname,k,cff,skp,coastfileplot)
2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3%
4%  Plot tidal ellipses
5%
6%  Further Information: 
7%  http://www.brest.ird.fr/Roms_tools/
8
9%  This file is part of ROMSTOOLS
10%
11%  ROMSTOOLS is free software; you can redistribute it and/or modify
12%  it under the terms of the GNU General Public License as published
13%  by the Free Software Foundation; either version 2 of the License,
14%  or (at your option) any later version.
15%
16%  ROMSTOOLS is distributed in the hope that it will be useful, but
17%  WITHOUT ANY WARRANTY; without even the implied warranty of
18%  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19%  GNU General Public License for more details.
20%
21%  You should have received a copy of the GNU General Public License
22%  along with this program; if not, write to the Free Software
23%  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
24%  MA  02111-1307  USA
25%
26%  Copyright (c) 2003-2006 by Patrick Marchesiello
27%
28%  Updated   5-Oct-2006 by Pierrick Penven
29%
30%
31%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
32rad=pi/180.0;
33deg=180.0/pi;
34
35niceplot=1;
36
37nc=netcdf(grdname);
38rlon=nc{'lon_rho'}(:);
39rlat=nc{'lat_rho'}(:);
40rmask=nc{'mask_rho'}(:);
41rangle=nc{'angle'}(:);
42close(nc)
43[M,L]=size(rlat);
44
45nc=netcdf(frcname);
46tide_Eamp(:,:)=nc{'tide_Eamp'}(k,:,:);
47tide_Cmax(:,:)=nc{'tide_Cmax'}(k,1:skp:M,1:skp:L);
48tide_Cmin(:,:)=nc{'tide_Cmin'}(k,1:skp:M,1:skp:L);
49tide_Cangle(:,:)=rad*nc{'tide_Cangle'}(k,1:skp:M,1:skp:L);
50cmpt=nc.components(:);
51disp(['Plot tidal component : ',cmpt(3*k-2:3*k)])
52close(nc)
53slon=rlon(1:skp:M,1:skp:L);
54slat=rlat(1:skp:M,1:skp:L);
55smask=rmask(1:skp:M,1:skp:L);
56rmask(rmask==0)=NaN;
57
58disp(['Max currents: ',num2str(max(max(tide_Cmax)),2),' m/s'])
59
60if niceplot==1
61
62  domaxis=[min(min(rlon)) max(max(rlon)) min(min(rlat)) max(max(rlat))];
63  m_proj('mercator',...
64         'lon',[domaxis(1) domaxis(2)],...
65         'lat',[domaxis(3) domaxis(4)]);
66  m_pcolor(rlon,rlat,rmask.*tide_Eamp)
67  shading flat
68  colorbar
69  hold on
70  m_ellipse(cff*smask.*tide_Cmax,cff*smask.*tide_Cmin,...
71           smask.*tide_Cangle,slon,slat,'k');
72  if ~isempty(coastfileplot)
73    m_usercoast(coastfileplot,'patch',[.9 .9 .9]);
74  end
75  hold off
76  title(['Amplitude [m] of tide : ',cmpt(3*k-2:3*k)])
77  m_grid('box','fancy',...
78         'xtick',5,'ytick',5,'tickdir','out',...
79         'fontsize',7);
80
81else
82
83  pcolor(rlon,rlat,rmask.*tide_Eamp)
84  shading flat
85  colorbar
86  hold on
87  ellipse(cff*smask.*tide_Cmax,cff*smask.*tide_Cmin,smask.*tide_Cangle,slon,slat,'k');
88  axis([min(min(rlon)) max(max(rlon)) min(min(rlat)) max(max(rlat))])
89  title(['Amplitude [m] of tide : ',cmpt(3*k-2:3*k)])
90  hold off
91
92end
93
Note: See TracBrowser for help on using the repository browser.