/[MITgcm]/MITgcm_contrib/enderton/Diagnostics/DiagUtility/cube2latlon_fast.m
ViewVC logotype

Annotation of /MITgcm_contrib/enderton/Diagnostics/DiagUtility/cube2latlon_fast.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Mon Jan 31 15:43:28 2005 UTC (20 years, 5 months ago) by enderton
Branch: MAIN
CVS Tags: HEAD
 o Initial check in.

1 enderton 1.1 function [z] = cube2latlon_fast(del,c,varargin)
2     % z=cube2latlon_fast(del,c);
3     %
4     % A fast version of cube2latlon that uses pre-processed transformation data
5     % del is the preprocessed data returned by cube2latlon_preprocess
6     % c is a 2-D or 3-D scalar field
7     % z is the interpolated data
8     %
9     % e.g.
10     % >> x=rdmds('XC');
11     % >> y=rdmds('YC');
12     % >> t=rdmds('Ttave.0000513360');
13     % >> xi=-179:2:180;yi=-89:2:90;
14     % >> del=cube2latlon_preprocess(x,y,xi,yi);
15     % >> ti=cube2latlon_fast(del,t);
16     %
17     % $Header: /u/gcmpack/MITgcm/utils/matlab/cube2latlon_fast.m,v 1.1 2004/06/04 15:50:52 adcroft Exp $
18    
19     NN=size(c);
20     [nx ny nz]=size(c);
21    
22     for k=1:nz;
23     C=reshape(c(:,:,k),[1 nx*ny]);
24    
25     z(:,:,k)=griddata_fast(del,[C C(del.il) C(del.ig)],varargin{:});
26    
27     end % k
28    
29     % Split vertical and time dimensions
30     if size(NN,2)>2
31     z=reshape(z,[size(z,1) size(z,2) NN(3:end)]);
32     end

  ViewVC Help
Powered by ViewVC 1.1.22