<div dir="ltr"><div><div>NCL &#39;list&#39; Variables<br><br><a href="http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclVariables.shtml" target="_blank">http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclVariables.shtml</a><br><br></div>See Section: List variables<br><br>===<br><br></div>The syntax [/ ... /] can be used to create a list.<br><div><br><pre> i = (/ (/1,2,3/), (/4,5,6/), (/7,8,9/) /)   ; 2-dimensioal integer array
 x = 5.0                                     ; scalar of type float
 d = (/100000.d, 283457.23d/)                ; 1-dimensional double array
 s = &quot;abcde&quot;                                 ; string
 c = stringtochar(&quot;abcde&quot;)                   ; character
 var = <b>[/</b>i, x, d, c, s<b>/]</b>                     ; construct list via [/.../]<br><br></pre><pre>variables with list may have meta data attached to them. <br></pre>  print(var)<br><br></div><div>  C = var[3]]                 ; explicitly extract a variable from the list; <br></div><div>                                    ; not required but helps with clarity<br></div><div><br></div><div>   delete( var )              ; delete a list<br><br></div><div>Some &#39;list&#39; functions<br><br></div><div><p>
<a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/ListAppend.shtml" target="_blank"><b>ListAppend</b></a>,
<a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/ListCount.shtml" target="_blank"><b>ListCount</b></a>,
<a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/ListGetType.shtml" target="_blank"><b>ListGetType</b></a>,
<a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/ListIndex.shtml" target="_blank"><b>ListIndex</b></a>,
<a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/ListIndexFromName.shtml" target="_blank"><b>ListIndexFromName</b></a>,
<a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/ListPop.shtml" target="_blank"><b>ListPop</b></a>,
<a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/ListPush.shtml" target="_blank"><b>ListPush</b></a>,
<b>ListSetType</b>,
<a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/NewList.shtml" target="_blank"><b>NewList</b></a>
</p>======<br></div><div>Vraiables of type list are sometimes used to returm multiple variables from a function.<br><br></div><div>    function FOO(....)<br></div><div>    begin<br></div><div>        a = ...<br></div><div>        b = ...<br></div><div>        c = ...<br></div><div>        return( [/ a, b, c /] )<br></div><div>     end<br><br></div><div>Regards<br></div><div>D<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 11, 2016 at 3:22 AM, franz <span dir="ltr">&lt;<a href="mailto:f.trotta@sincem.unibo.it" target="_blank">f.trotta@sincem.unibo.it</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear ncl-team<br>
    I’m using the nil 6.3.0<br>
    In my NCL program, I define all file name of datasets that I use like<br>
in the follow way:<br>
<br>
    file_extrapdataOce_temp_less1 = new((/nnest/),string,&quot;&quot;)<br>
    file_extrapdataOce_temp       = new((/nnest,ndays_max/),string,&quot;&quot;)<br>
    file_extrapdataOce_temp_plus1 = new((/nnest/),string,&quot;&quot;)<br>
    file_extrapdataOce_sal_less1  = new((/nnest/),string,&quot;&quot;)<br>
    file_extrapdataOce_sal        = new((/nnest,ndays_max/),string,&quot;&quot;)<br>
    file_extrapdataOce_sal_plus1  = new((/nnest/),string,&quot;&quot;)<br>
    file_extrapdataOce_ssh_less1  = new((/nnest/),string,&quot;&quot;)<br>
    file_extrapdataOce_ssh        = new((/nnest,ndays_max/),string,&quot;&quot;)<br>
    file_extrapdataOce_ssh_plus1  = new((/nnest/),string,&quot;&quot;)<br>
    file_extrapdataOce_curx_less1 = new((/nnest/),string,&quot;&quot;)<br>
    file_extrapdataOce_curx       = new((/nnest,ndays_max/),string,&quot;&quot;)<br>
    file_extrapdataOce_curx_plus1 = new((/nnest/),string,&quot;&quot;)<br>
    file_extrapdataOce_cury_less1 = new((/nnest/),string,&quot;&quot;)<br>
    file_extrapdataOce_cury       = new((/nnest,ndays_max/),string,&quot;&quot;)<br>
    file_extrapdataOce_cury_plus1 = new((/nnest/),string,&quot;&quot;)<br>
<br>
<br>
set_files_extrapdataOce(nnest,ndays,runMan_date_less1,runMan_date_plus1,runMan_date,<br>
\<br>
<br>
file_extrapdataOce_temp_less1,file_extrapdataOce_temp,file_extrapdataOce_temp_plus1,<br>
\<br>
<br>
file_extrapdataOce_sal_less1,file_extrapdataOce_sal,file_extrapdataOce_sal_plus1,<br>
\<br>
<br>
file_extrapdataOce_ssh_less1,file_extrapdataOce_ssh,file_extrapdataOce_ssh_plus1,<br>
\<br>
<br>
file_extrapdataOce_curx_less1,file_extrapdataOce_curx,file_extrapdataOce_curx_plus1,<br>
\<br>
<br>
file_extrapdataOce_cury_less1,file_extrapdataOce_cury,file_extrapdataOce_cury_plus1)<br>
<br>
    All these file name belong to subgroup ‘file_extrapdataOce’ and I<br>
would like to define something like ‘C language structures’<br>
    Is it possible to define in NCL groups of variables of different size<br>
and type?<br>
<br>
thanks<br>
Francesco T.<br>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div><br></div>