[Thread Prev][Thread Next][Index]

Re: How to do loop in ferret?

I do not know much about using the new string
variables in Ferret, but I know that when doing a
repeat loop, the index that you use to repeat on can
make a big difference.  I have done this kind of thing
before and I used it to make this example.  

Say these commands are in the script run_it.jnl

   use coads_climatology
   plot($1) sst[x=180]

Then I would use the K index to run this, since the
coads_climatology data has no depth axis.  Maybe your
I index in the repeat/i=   is causing confusion with
an I or an x axis inside your script.

You can use these commands to run the script for
different regions.

let name = zsequence({"/l=4/x=150:180/y=20:80",
repeat/k=1:2 (go t5 `name`; pause)

--- Xin Jin <xjin@igpp.ucla.edu> wrote:
> Hi Ferreters,
> I have a question about  how to do loop in ferret.
> For example:
> I have defined four regions and assigned them to a
> string array,
> Name[i=1:4] and I want to do the same things in each
> region.  But How to
> do it?
> It seems I cannot use repeat command to do it.
> repeat/i=1:4  (go  sub_scrib Name).
> Howhever I can do it one by one as
> go sub_scrib Name[i=1]
> go sub_scrib Name[i=2]
> go sub_scrib Name[i=3]
> go sub_scrib Name[i=4]
> Thanks
> Xin
> ________________________________________
> Xin Jin
> Inst.of Geophysics and Planetary Physics
> University of California Los Angeles
> 5845 Slichter Hall
> Los Angeles, CA 90095-4996, USA
> phone: (310) 825 4526
> fax  : (310) 206 3051
> email: xjin@igpp.ucla.edu

Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax

[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement