[Thread Prev][Thread Next][Index]

Re: [ferret_users] Size of an array in a crooked case



Le 29/09/2014 16:17, Olivier Marti a écrit :
Hi,

I have defined a variable from a list of files :

yes? list Liste_LMDZ
              VARIABLE : {SPAWN:"ls *_LMDZ_*.nc | sort -t '_' -k3 | sed 's/_LMDZ_..\.nc//'"   }
              SUBSET   : 25 points (X)
  1    /  1:"SISUTESW"
  2    /  2:"SIICECOV"
  3    /  3:"SIICTEMW"
  4    /  4:"SIICEALW"
  5    /  5:"CURRENTX"
  6    /  6:"CURRENTY"
  7    /  7:"CURRENTZ"
  8    /  8:"COTAUXXU"
  9    /  9:"COTAUYYU"
  10   / 10:"COTAUZZU"
  11   / 11:"COTAUXXV"
  12   / 12:"COTAUYYV"
  13   / 13:"COTAUZZV"
  14   / 14:"COWINDSP"
  15   / 15:"COTOTRAI"
  16   / 16:"COTOTSNO"
  17   / 17:"COTOTEVA"
  18   / 18:"COICEVAP"
  19   / 19:"COQSRMIX"
  20   / 20:"COQNSMIX"
  21   / 21:"COSHFICE"
  22   / 22:"CONSFICE"
  23   / 23:"CODFLXDT"
  24   / 24:"COCALVIN"
  25   / 25:"COLIQRUN"

Ferret seems to understand correctly the size of the array :

yes ? stat Liste_LMDZ

              {SPAWN:"ls *_LMDZ_*.nc | sort -t '_' -k3 | sed 's/_LMDZ_..\.nc//'"   }
              X: 0.5 to 25.5
              Y:  N/A
              Z:  N/A
              T:  N/A
              DATA SET: N/A
  Total # of strings: 25 (25*1*1*1)
  Maximum string length: 8

But not in all cases :

yes? say `Liste_LMDZ,return=isize`
  !-> MESSAGE/CONTINUE 2000
2000

How can I set a variable or a symbol to the actual size of the Liste_LMDZ array (the number of files). I need that to perform a repeat loop.

Thanks,

Olivier Marti

Hi,

Have a look to this thread.
http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2014/msg00255.html

So should be
yes? say `Liste_LMDZ[i=@ngd]`


Patrick

--
LSCE/IPSL, Laboratoire CEA-CNRS-UVSQ
Data Analysis and Visualization Engineer
ICMC - IPSL Climate Modelling Centre
--



[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement