source: trunk/SRC/ToBeReviewed/CALCULS/level2index.pro @ 325

Last change on this file since 325 was 325, checked in by pinsard, 16 years ago

modification of some headers (+some corrections) to prepare usage of the new idldoc

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.1 KB
Line 
1;+
2;
3; @file_comments
4; We want, from a 3d matrix, to extract a 2d (x,y) array whose each element
5; has been extract from a level specified by the 2d level array (typically,
6; we want to obtain the salinity along an isopycn we have repered by its level).
7; level2index is a function who give, in function of level, a 2d indexes array
8; which will allow to extract the 2d array from the 3d array...
9;
10; @categories
11; Without loop
12;
13; @param LEVEL {in}{required}{type=2d array}
14; A 2d level array
15;
16; @returns
17; a 2d indexes array
18;
19; @history
20; Sebastien Masson (smasson\@lodyc.jussieu.fr)
21;                      24/11/1999
22;
23; @version
24; $Id$
25;
26;-
27FUNCTION level2index, level
28; An element of 3d array (whose the two first dimensions are nx and ny) whose
29; coordinates are i, j and k have for index in the same 3d array i + j*nx + k*(nx*ny)
30; level given, for  each point of level, we know i, j et k,
31; so we can calculate the index
32;
33  compile_opt idl2, strictarrsubs
34;
35   taille = size(level)
36   nx = taille[1]
37   ny = taille[2]
38; array k*(nx*ny)
39   tabknxny = (nx*ny)*long(level)
40;
41;
42   return, lindgen(nx, ny)+tabknxny
43end
Note: See TracBrowser for help on using the repository browser.