[Dart-dev] [4060] DART/trunk/models/POP/matlab: routines to help explore the ' test_dipole_interp' program.
nancy at ucar.edu
nancy at ucar.edu
Tue Sep 22 15:44:28 MDT 2009
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/dart-dev/attachments/20090922/65ac76f8/attachment.html
-------------- next part --------------
Added: DART/trunk/models/POP/matlab/plot_global_grid.m
===================================================================
--- DART/trunk/models/POP/matlab/plot_global_grid.m (rev 0)
+++ DART/trunk/models/POP/matlab/plot_global_grid.m 2009-09-22 21:44:28 UTC (rev 4060)
@@ -0,0 +1,52 @@
+function plot_global_grid(n)
+% plot_global_grid
+%
+% plot_global_grid(1); % to plot regular grid output
+% plot_global_grid(2); % to plot dipole x3 grid output
+% plot_global_grid(3); % to plot regular grid with same grid as x3 in SH
+
+% Data Assimilation Research Testbed -- DART
+% Copyright 2004-2009, Data Assimilation Research Section
+% University Corporation for Atmospheric Research
+% Licensed under the GPL -- www.gpl.org/licenses/gpl.html
+%
+% <next few lines under version control, do not edit>
+% $URL$
+% $Id$
+% $Revision$
+% $Date$
+
+if n == 1
+ str0 = 'regular grid';
+ u_out = load('regular_grid_u_out');
+ t_out = load('regular_grid_t_out');
+ nx = 111;
+ ny = 317;
+elseif n == 2
+ str0 = 'dipole grid';
+ u_out = load('dipole_x3_u_out');
+ t_out = load('dipole_x3_t_out');
+ nx = 100;
+ ny = 116;
+elseif n == 3
+ str0 = 'regular grid in NH, dipole in SH';
+ u_out = load('regular_griddi_u_out');
+ t_out = load('regular_griddi_t_out');
+ nx = 100;
+ ny = 97;
+end
+
+u = reshape(u_out(:,3),ny,nx);
+t = reshape(t_out(:,3),ny,nx);
+
+str1 = sprintf('min/max is %f %f',min(u(:)), max(u(:)));
+str2 = sprintf('min/max is %f %f',min(t(:)), max(t(:)));
+
+figure(1); clf
+imagesc(u); colorbar;
+title({'U Grid',str0,str1})
+
+figure(2); clf
+imagesc(t); colorbar;
+title({'T Grid',str0,str2})
+
Property changes on: DART/trunk/models/POP/matlab/plot_global_grid.m
___________________________________________________________________
Added: svn:mime-type
+ text/x-matlab
Added: svn:keywords
+ Date Rev Author URL Id
Added: svn:eol-style
+ native
Added: DART/trunk/models/POP/matlab/plot_globe_dif.m
===================================================================
--- DART/trunk/models/POP/matlab/plot_globe_dif.m (rev 0)
+++ DART/trunk/models/POP/matlab/plot_globe_dif.m 2009-09-22 21:44:28 UTC (rev 4060)
@@ -0,0 +1,72 @@
+function plot_globe_dif(n)
+% plot_globe_dif - script to examine the interpolation tests.
+%
+% plot_globe_dif(1) ; % difference regular grids
+% plot_globe_dif(2) ; % difference dipole x3 grids
+% plot_globe_dif(3) ; % regular grids with same grid as x3 in SH
+
+% Data Assimilation Research Testbed -- DART
+% Copyright 2004-2009, Data Assimilation Research Section
+% University Corporation for Atmospheric Research
+% Licensed under the GPL -- www.gpl.org/licenses/gpl.html
+%
+% <next few lines under version control, do not edit>
+% $URL$
+% $Id$
+% $Revision$
+% $Date$
+
+%n = input(['Input 1 to difference regular grids .\n' ...
+% 'Input 2 to difference dipole x3 grids . \n' ...
+% 'Input 3 to diffference regular grids with same grid as x3 in SH\n'])
+
+if n == 1
+ u_data = load('regular_grid_u_data');
+ t_data = load('regular_grid_t_data');
+ u_out = load('regular_grid_u_out');
+ t_out = load('regular_grid_t_out');
+ nx = 111;
+ ny = 317;
+elseif n == 2
+ u_data = load('dipole_x3_u_data');
+ t_data = load('dipole_x3_t_data');
+ u_out = load('dipole_x3_u_out');
+ t_out = load('dipole_x3_t_out');
+ nx = 100;
+ ny = 116;
+elseif n == 3
+ u_data = load('regular_griddi_u_data');
+ t_data = load('regular_griddi_t_data');
+ u_out = load('regular_griddi_u_out');
+ t_out = load('regular_griddi_t_out');
+ nx = 100;
+ ny = 97;
+else
+ error('Sorry, choices are only 1, 2, or 3 ... you entered %d',n)
+end
+
+u = reshape( u_out(:,3),ny,nx);
+ub = reshape(u_data(:,3),ny,nx);
+t = reshape( t_out(:,3),ny,nx);
+tb = reshape(t_data(:,3),ny,nx);
+
+dif = u - ub;
+tdif = t - tb;
+
+umin = min(dif(:));
+umax = max(dif(:));
+str1 = sprintf('min/max of difference is %f %f',umin,umax);
+
+tmin = min(tdif(:));
+tmax = max(tdif(:));
+str2 = sprintf('min/max of difference is %f %f',tmin,tmax);
+
+figure(1); clf;
+imagesc(dif)
+colorbar
+title({'U Difference',str1})
+
+figure(2); clf;
+imagesc(tdif)
+colorbar
+title({'T Difference',str2})
Property changes on: DART/trunk/models/POP/matlab/plot_globe_dif.m
___________________________________________________________________
Added: svn:mime-type
+ text/x-matlab
Added: svn:keywords
+ Date Rev Author URL Id
Added: svn:eol-style
+ native
More information about the Dart-dev
mailing list