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

Annotation of /MITgcm_contrib/high_res_cube/matlab-grid-generator/bin/xyzv.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 (23 years 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 [ijk] = xyzv(N,iii)
2     % Converts a vector index into an n-dimensional array index.
3     % eg. xyzv( size(a) , find(a < -1) )
4    
5     ijk=[];
6     for j=1:prod(size(iii)),
7    
8     ii=iii(j)-1;
9     ijkk=[];
10    
11     for k=1:prod(size(N)),
12     nn=N(k);
13     ij=rem( ii , nn );
14     ijkk=[ijkk ij];
15     ii=ii-ij;
16     ii=ii/nn;
17     end
18    
19     ijk=[ijk ijkk'];
20     end

  ViewVC Help
Powered by ViewVC 1.1.22