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

Annotation of /MITgcm_contrib/high_res_cube/matlab-grid-generator/bin/cube2latlon_preprocess.m

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


Revision 1.1.1.1 - (hide 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 cnh 1.1 function [del] = cube2latlon(x,y,xi,yi,varargin)
2     % z=cube2latlon(x,y,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     % >> del=cube2latlon(x,y,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(x);
20     [nx ny nz]=size(x);
21    
22     X=reshape(x,[1 nx*ny]);
23     Y=reshape(y,[1 nx*ny]);
24     ig=find(X>90);
25     il=find(X<-90);
26     del=griddata_preprocess([Y Y(il) Y(ig)],[X X(il)+360 X(ig)-360],yi,xi',varargin{:});
27    
28     del.ig=ig;
29     del.il=il;

  ViewVC Help
Powered by ViewVC 1.1.22