[Thread Prev][Thread Next][Index]

Re: dummy index with REPEAT command ?



Hi Emilie,

> I would like to know if it is possible to use a "dummy" index with the 
> REPEAT command instead of x, y, z, t, i, j, k or l.

    As far as I know, it is not possible to use "dummy index" with
REPEAT command.

> But if I want to use variables of file.nc that are defined on i-, j-,
> k- and l-axis, how can I do ?

   The trick is to specify "explicitly" the abstract axis value for the 
concerned 
variables( thanks to Arindam Chakraborty ), whatever may be its state 
(wether it is constant or changing related to repeat loop index).

Here is an example
Let us take 4D variable case; 

	define axis/x=1:10:1 xax ; define axis/y=1:10:1 yax
        define axis/z=1:10:1 zax ; define axis/t=1:10:1 tax
        define grid/x=xax/y=yax/z=zax/t=tax grd

    ! define a 4D variable "var"      

        let var = sin(X[G=grd]) + cos(Y[G=grd]) + sin(5*Z[G=grd]) + sin(T[G=grd])

    ! we choose the repeat index as "l" but we don't want to vary the 
    !      "l" index for the variale "var" inside the repeat loop.
    !  In that case ( "messgae" is to get a stop for checking T and Z 
    !        valueson the plot), with an increment 2 for the index 
 
     repeat/l=1:10:2 (fill var[l=1,k=`l`]; message) ! 

See, T remains constant (T=1), but Z varies....... 
 
Like this you can do "repeat" with any of the index i,j,k,l 
provided if variabe have a dimension along that abstract axis you 
must specify what range/value of that particular abstract axis you
need using square brackets. 


Hope this helps

With Regards 




> 
> I use the REPEAT command to execute a script several times for 
> different values ranging from 1 to 20. Let's say :
> 
> REPEAT/l=1:20 (GO my_script data.nc `l`)
> 
> It works here if my_script.jnl only uses the variables of data.nc that 
> are not defined along the l-axis.

  
> 
> But if I want to use variables of file.nc that are defined on i-, j-, 
> k- and l-axis, how can I do ?
> If I use one of their axis (i, j, k or l) as here above, the script 
> will crash because of  **ERROR: dimensions improperly specified: must 
> be a 2D region when using the FILL command, of course.
> 
> Does anyone have any idea ? Thanks in advance !
> 
> Emilie V.
> 

-- 
___________________________________________________

    Jaison Kurian                           
    Centre for Atmospheric and Oceanic Sciences
    Indian Institute of Science
    B A N G A L O R E   560 012
    Ph: +91-80-3942505
        +91-80-3600450
    Fax:+91-80-3600865
___________________________________________________





[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement