Please read the mini-Language Manual at
http://www.ncl.ucar.edu/Document/Manuals/
Also, peruse the Reference manual
---
As described in the manuals:
(1) NCL indexing (subscripts) are 0-based like C, C++, ...
(2) Using [...] is not correct ($vNames[1]$ ==> $vNames(1)$ )
(3) When using strings via -> you must enclose the string with $
nNames = dimsizes (vNames)
do i=0,nNames-1
flvar = gbfile->$vNames(i)$
printVarSummary(flvar)
delete(flvar) ; size and shape may change
end do ; space between 'end' and 'do'
On 11/5/11 3:07 AM, haohao Tsing wrote:
> further more
> I tried :
> flvar=gbfile->$vNames[1]$
> but still failed with such a error message:
> fatal:List subscripting used on non-list variable, can't continue
>
> fatal:Execute: Error occurred at or near line 41 in file file.ncl
>
> 在 2011年11月5日 下午4:53,haohao Tsing <haohaorain@gmail.com
> <mailto:haohaorain@gmail.com>>写道:
>
> hi ,ncl users:
> I want to read the variables by arrays
http://www.ncl.ucar.edu/Document/Manuals/> this script failed for
“gbfile->vNames" ,vNames should be the name
> of the variable in gbfile.
> Here, how can I indice the variables data in gbfile by a array or a
> some variable?
> thank you .
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sat Nov 5 07:31:13 2011
This archive was generated by hypermail 2.1.8 : Tue Nov 08 2011 - 15:54:50 MST