[ncl-talk] variable dimension name problem

Dennis Shea shea at ucar.edu
Wed Jul 6 08:18:19 MDT 2016


Since name_n1 and name_n2 are variables of type string, you must use
additional syntax

Change

   > VAR&name_n1 = Var_n1

   > VAR&name_n2 = Var_n2


To

   > VAR&$name_n1$ = Var_n1

   > VAR&$name_n2$ = Var_n2

==

http://www.ncl.ucar.edu/Document/Manuals/language_man.pdf

See section 3.1.3:  When to use the $ syntax






On Wed, Jul 6, 2016 at 6:50 AM, Zhuxiao Li <zhuxiao.li at spire.com> wrote:

> Hi there,
>
> I am trying to name the variable dimensions(1,2) with the string variables
> (name_n1, name_n2) with the following NCL code:
>
>    > VAR!0 = "time"
>
>    > VAR!1 = name_n1
>
>    > VAR!2 = name_n2
>
>    > time = ispan(0,nh,1)
>
>    > VAR&time = time
>
>    > ; exit
>
>    > VAR&name_n1 = Var_n1
>
>    > VAR&name_n2 = Var_n2
>
>    > printVarSummary(VAR)
>
>    >  ; exit
>  Have got the following error message:
>
> >fatal:(name_n1) is not a named dimension in variable (VAR).
> I bet this error message due to the quotation sign of the string variable
> in 'VAR&name_n1 = Var_n1' ? Could you help me to solve this problem?
>
> Thanks very much in advance!
> Jasmine
>
>
>
>
>
>
>
> --
>
> *Zhuxiao Li*
>
> Numerical Modeling Prediction
>
> *Spire Global, Inc.*
>
> 1320 Pearl Street, Suite 210, Boulder, CO 80302 USA
>
> *+1-415-356-3400x379 <%2B1-415-356-3400x379>*
>
> *+1-303-359-0495 <%2B1-303-359-0495>*
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160706/1eab7ca9/attachment.html 


More information about the ncl-talk mailing list