<div dir="ltr">NCL team,<div><br></div><div>I found this problem with named dimensions in NCL 6.3.0 on both Linux and Mac OS.  The dimension name reference operator &quot;!&quot; gets the wrong dim name when used with a Netcdf-4 file variable, under some circumstances.  Can you please fix this for the next release?  Thank you.</div><br>Sample input file:<div><br><div>&gt; ncdump -hs <a href="http://test5.nc">test5.nc</a><br></div><div>netcdf test5 {<br>dimensions:<br>    lat = 3 ;<br>    lon = 4 ;<br>    time = 2 ;<br>variables:<br>    float time(time) ;<br>        time:_Storage = &quot;contiguous&quot; ;<br>    float lon(lon) ;<br>        lon:_Storage = &quot;contiguous&quot; ;<br>    float lat(lat) ;<br>        lat:_Storage = &quot;contiguous&quot; ;<br>    float precip(time, lat, lon) ;<br>        precip:_Storage = &quot;contiguous&quot; ;<br><br>// global attributes:<br>    :_Format = &quot;netCDF-4&quot; ;<br>}<div><br><div>Bug demonstration.  The correct answer, &quot;time&quot;, is obtained with the second and third methods shown:</div><div><br></div><div><div> NCAR Command Language Version 6.3.0<br>ncl 0&gt; f = addfile (&quot;<a href="http://test5.nc">test5.nc</a>&quot;, &quot;r&quot;)<br>ncl 1&gt; print (f-&gt;precip!0)</div><div>(0)     lat                    ******** WRONG RESULT</div><div>ncl 2&gt; x = f-&gt;precip</div><div>ncl 3&gt; print (x!0)</div><div>(0)     time</div><div>ncl 4&gt; dims = getfilevardims (f, &quot;precip&quot;)</div><div>ncl 5&gt; print (dims(0)+&quot;&quot;)</div><div>(0)     time</div></div><div><br></div><div>Notes:</div><div><br></div><div>1.  The problem seems specific to only the full Netcdf-4 format.  I did not see this problem with Netcdf-3 or Netcdf-4 classic.  My testing was limited.</div><div><br></div><div>2.  The problem depends on the order of dimensions as originally defined in the Netcdf-4 file.  In the demo above, notice that time is the first dimension in the data variable, but it is NOT the first defined dimension in the file.  When time is the first defined dimension, the problem goes away.</div><div><br></div><div>3.  It does not make any difference whether the storage mode is contiguous or chunked.</div><div><br></div><div>--Dave</div></div></div></div></div>