/[MITgcm]/MITgcm_contrib/high_res_cube/matlab-grid-generator/bin/cube2latlon_fast.m
ViewVC logotype

Contents of /MITgcm_contrib/high_res_cube/matlab-grid-generator/bin/cube2latlon_fast.m

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


Revision 1.1.1.1 - (show annotations) (download) (vendor branch)
Tue Nov 11 18:08:08 2003 UTC (21 years, 8 months ago) by cnh
Branch: MAIN, initial
CVS Tags: baseline, HEAD
Changes since 1.1: +0 -0 lines
Checking in work done with Dimitri on high-resolution cube gridding and parallel 
communications. 
   o code is in a contrib experiment for now so we can continue collaborating
     on it. However most code is general and will be moved into main branch once 
     it is fully hardened.
   o There are README files in the contrib root and in the subdirectories that
     explain the contents

1 function [z] = cube2latlon(del,c,varargin)
2 % z=cube2latlon(x,y,c,xi,yi);
3 %
4 % Re-grids model output on expanded spherical cube to lat-lon grid.
5 % x,y are 2-D arrays of the cell-centered coordinates
6 % c is a 2-D or 3-D scalar field
7 % xi,yi are vectors of the new regular lat-lon grid to interpolate to.
8 % z is the interpolated data with dimensions of size(xi) by size(yi).
9 %
10 % e.g.
11 % >> x=rdmds('XC');
12 % >> y=rdmds('YC');
13 % >> t=rdmds('Ttave.0000513360');
14 % >> xi=-179:2:180;yi=-89:2:90;
15 % >> ti=cube2latlon(x,y,t,xi,yi);
16 %
17 % $Header: /u/gcmpack/models/MITgcmUV/utils/matlab/cube2latlon.m,v 1.3 2001/08/28 17:58:03 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