Back to home page

MITgcm

 
 

    


Warning, /utils/matlab/cs_grid/cube2latlon_fast.m is written in an unsupported language. File is not indexed.

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
a33039f58e Alis*0001 function [z] = cube2latlon_fast(del,c,varargin)
                0002 % z=cube2latlon_fast(del,c);
                0003 %
                0004 % A fast version of cube2latlon that uses pre-processed transformation data
                0005 %  del  is the preprocessed data returned by cube2latlon_preprocess
                0006 %  c    is a 2-D or 3-D scalar field
                0007 %  z    is the interpolated data
                0008 %
                0009 % e.g.
                0010 % >> x=rdmds('XC');
                0011 % >> y=rdmds('YC');
                0012 % >> t=rdmds('Ttave.0000513360');
                0013 % >> xi=-179:2:180;yi=-89:2:90;
                0014 % >> del=cube2latlon_preprocess(x,y,xi,yi);
                0015 % >> ti=cube2latlon_fast(del,t);
                0016 %
f8d374081f Jean*0017 % Written by adcroft@.mit.edu, 2004.
a33039f58e Alis*0018 NN=size(c);
                0019 [nx ny nz]=size(c);
                0020 
                0021 for k=1:nz;
                0022 C=reshape(c(:,:,k),[1 nx*ny]);
                0023 
                0024 z(:,:,k)=griddata_fast(del,[C C(del.il) C(del.ig)],varargin{:});
                0025 
                0026 end % k
                0027 
                0028 % Split vertical and time dimensions
                0029 if size(NN,2)>2
                0030 z=reshape(z,[size(z,1) size(z,2) NN(3:end)]);
                0031 end