<div dir="ltr"><div>Hello everyone,</div><div><br></div><div>I was trying to read netCDF 4 files with groups.</div><div>I have 6 groups.</div><div>They all have a variable named &#39;snd&#39; inside.</div><div>The 6 &#39;snd&#39; are different (I used ncdump to check) but they look the same using NCL.</div>

<div><br></div><div>Here is my script:</div><div><br></div><div><div>; Complied by Wang Wenshan 2013-09-19 Thursday 12:06:55</div><div>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl&quot;</div><div>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;</div>

<div>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl&quot;</div><div>;*************************************************************</div><div>; check NCL group reading</div><div>;************************************************************</div>

<div>begin</div><div>;setfileoption(&quot;nc&quot;, &quot;usenewhlfs&quot;, True)</div><div><br></div><div>drc = &quot;/media/grele_data/wenshan/cesm/historical-exp/nco_grp/&quot;</div><div>fn = &quot;<a href="http://snd_time.nc">snd_time.nc</a>&quot;</div>

<div><br></div><div>fin = addfile(drc+fn,&quot;r&quot;)</div><div>setfileoption(&quot;nc&quot;, &quot;Format&quot;,  &quot;NetCDF4Classic&quot;)</div><div><br></div><div>nn = getfilevarnames(fin)</div><div>;print(nn)</div>

<div>v1 = &quot;/CCSM4_historical/snd&quot;</div><div>v2 = &quot;/CESM1-BGC_esmHistorical/snd&quot;</div><div>v3 = &quot;/CESM1-CAM5_historical/snd&quot;</div><div>v4 = &quot;/CESM1-FASTCHEM_historical/snd&quot;</div><div>

v5 = &quot;/CESM1-WACCM_historical/snd&quot;</div><div><br></div><div>d1 = fin-&gt;$v1$</div><div>d2 = fin-&gt;$v2$</div><div>d3 = fin-&gt;$v3$</div><div>d4 = fin-&gt;$v4$</div><div>d5 = fin-&gt;$v5$</div><div><br></div>
<div>
;------------------------------------------------------------</div><div>; second way</div><div>;g5 = fin=&gt;/CESM1-WACCM_historical</div><div>;d5_2 = g5-&gt;snd</div><div>;------------------------------------------------------------</div>

<div><br></div><div>print(d1+&quot;  &quot;+d2+&quot; &quot;+d3+&quot;  &quot;+d4+&quot;  &quot;+d5)</div><div>;print(d1+&quot;  &quot;+d2+&quot; &quot;+d3+&quot;  &quot;+d4+&quot;  &quot;+d5+&quot; &quot;+d5_2)</div><div>

<br></div><div>print(&quot;done!&quot;)</div><div>end</div></div><div><br></div><div><br></div><div>The first way gave me the same &#39;snd&#39;.</div><div>The second way gave error msg: </div><div>file: Execute.c, line:8105</div>

<div>stop *ptr: 104</div><div>stop FILE_GROUPVAL_OP: 104</div><div><br></div><div>I am using NCL 6.1.2</div><div>Linux grele 3.5.0-40-generic #62~precise1-Ubuntu SMP Fri Aug 23 17:38:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux<br>

</div><div><br></div><div>I put my script (grp_reading.ncl) and the testing file (<a href="http://snd_time.nc">snd_time.nc</a>) on ftp/incoming.</div><div><br></div><div>Thank you very much!</div><div><br></div><br clear="all">

<div><div dir="ltr"><div><div><div><div>Best,<br></div>Wenshan<br>------------------------------------------------------------------------------<br></div>Graduate Student Researcher<br></div>Earth System Science<br></div>

University of California, Irvine<br></div></div>
</div>