[ncl-talk] Creating variables automatically

Mateus da Silva Teixeira mateusstex at gmail.com
Mon Oct 8 15:07:21 MDT 2018


Hi,

Can I use string reference to create different variables in NCL?

I'm trying it

*do i = 1, 5*
*   varname = "cases_"+sprinti("%i",i)+"days"*
*   $varname$ = new( (/ nlat, nlon /), "float" )*

*   $varname$ = dim_avg_n(  slp( idxCases, :, : ), 0 )*
*end do*

But NCL is giving syntax error. It seems that I can't use string references
that way. So, would there be a way to do this?

Thanks.

Mateus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20181008/9e3bfcac/attachment.html>


More information about the ncl-talk mailing list