<div dir="ltr">Mark,<div><br></div><div>You can also read in the entirety of the file variable without specifying any colons at all; e.g.</div><div><br></div><div><span style="font-size:12.8000001907349px">data=fh-&gt;pr</span><br></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">is an acceptable and functional statement, assuming you would read in the entirety of each dimension. This is the closest thing I&#39;m aware of in NCL to what you&#39;re talking about. </span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">If you wanted to use this to create colons for less than all of the dimensions associated with a variable, then I think you&#39;d have to use getfilevardimsizes and if/else statements. It would be a relatively simple function to write if you intend to use it frequently and likely worth it compared to the wasted time of reading in unnecessary data from the file.</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">Kyle</span></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr">----------------------------------------<div>Kyle S. Griffin</div><div>Department of Atmospheric and Oceanic Sciences</div><div>University of Wisconsin - Madison</div><div>Room 1421</div><div>1225 W Dayton St, Madison, WI 53706</div><div>Email: <a href="mailto:ksgriffin2@wisc.edu" target="_blank">ksgriffin2@wisc.edu</a></div></div></div></div>
<br><div class="gmail_quote">On Sun, Feb 15, 2015 at 9:08 PM,  <span dir="ltr">&lt;<a href="mailto:Mark.Collier@csiro.au" target="_blank">Mark.Collier@csiro.au</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Jatin,<br>
the problem is being at to specify a range of colons, e.g.<br>
<br>
:,:,:<br>
<br>
:,:<br>
<br>
:<br>
<br>
without having to use if else if statements…some languages have a function for this, it may not be easy to implement in NCL.<br>
<br>
It would be a way of making certain code more compact and general.<br>
<br>
Regards, Mark.<br>
<div class="HOEnZb"><div class="h5"><br>
&gt; On 16 Feb 2015, at 1:22 pm, Jatin Kala &lt;<a href="mailto:jatin.kala.jk@gmail.com">jatin.kala.jk@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; Hi Mark,<br>
&gt; Maybe use something like getfilevardimsizes:<br>
&gt; <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/getfilevardimsizes.shtml" target="_blank">https://www.ncl.ucar.edu/Document/Functions/Built-in/getfilevardimsizes.shtml</a><br>
&gt; That should tell you the number of dims<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On 16/02/15 12:41 PM, Mark.Collier@csiro.au wrote:<br>
&gt;&gt; Hi,<br>
&gt;&gt; is it possible to reference an input variable dimension list with a variable, for example<br>
&gt;&gt;<br>
&gt;&gt; data=fh-&gt;pr(colons)<br>
&gt;&gt;<br>
&gt;&gt; where the variable pr is defined in the data file pointed to be the file handle fh.<br>
&gt;&gt;<br>
&gt;&gt; where colons is a list that could vary in length, e.g. “:,:,:” or “:,:” depending on whether it was a 3,2 or n dimensioned quantity?<br>
&gt;&gt;<br>
&gt;&gt; The reason for this, is sometimes it is necessary to specify the colon list without knowing the variables dimension, and without having to result to if, else if control flow for each dimension case…<br>
&gt;&gt;<br>
&gt;&gt; Ideally colons could be a function taking an integer argument to specify the list<br>
&gt;&gt;<br>
&gt;&gt; e.g. colons(3) would reflect “:,:,:”<br>
&gt;&gt;<br>
&gt;&gt; I’ve tried to do this but I guess the : are a unique quantity not able to be defined by a simple string argument…<br>
&gt;&gt;<br>
&gt;&gt; Thanks,<br>
&gt;&gt; Mark.<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; ncl-talk mailing list<br>
&gt;&gt; List instructions, subscriber options, unsubscribe:<br>
&gt;&gt; <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
&gt;<br>
<br>
_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</div></div></blockquote></div><br></div>