<div dir="ltr">Hi, Will<div class="gmail_extra">Thank you so much! I haven&#39;t realised that <span style="color:rgb(0,0,0);font-family:Calibri,sans-serif;font-size:14px">getvaratts can be applied to files.  This really helps.</span></div>

<div class="gmail_extra"><font color="#000000" face="Calibri, sans-serif"><span style="font-size:14px"><br></span></font></div><div class="gmail_extra"><font color="#000000" face="Calibri, sans-serif"><span style="font-size:14px">Delia<br>

</span></font><br><div class="gmail_quote">2014-07-25 14:34 GMT+08:00 Will Hobbs <span dir="ltr">&lt;<a href="mailto:Will.Hobbs@utas.edu.au" target="_blank">Will.Hobbs@utas.edu.au</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">





<div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
<div>Delia</div>
<div><br>
</div>
<div>You can get the global atts. directly from a file, opened using add file():</div>
<div><br>
</div>
<div>&gt; f = addfile(&lt;filename&gt;,&quot;r&quot;) ;f can be treated as variable, with attributes the same as the files global atts</div>
<div><br>
</div>
<div>&gt; fAtts = getvaratts(f)  ; all the global attribute names</div>
<div><br>
</div>
<div>;print the attribute names</div>
<div>&gt; do i = 0, dimsizes(fAtts)-1</div>
<div>&gt;   print(f@$fAtts(i)$)</div>
<div>&gt; end do</div>
<div><br>
</div>
<div>Hope that helps</div>
<div><br>
</div>
<div>Will</div>
<div><br>
</div>
<div><br>
</div>
<span>
<div style="font-family:Calibri;font-size:11pt;text-align:left;color:black;border-width:1pt medium medium;border-style:solid none none;padding:3pt 0in 0in;border-top-color:rgb(181,196,223)">
<span style="font-weight:bold">From: </span>Delia &lt;<a href="mailto:deliajxm@gmail.com" target="_blank">deliajxm@gmail.com</a>&gt;<br>
<span style="font-weight:bold">Date: </span>Friday, 25 July 2014 4:27 PM<br>
<span style="font-weight:bold">To: </span>ncl-talk &lt;<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>&gt;<br>
<span style="font-weight:bold">Subject: </span>[ncl-talk] getting global attributes of nc files<br>
</div><div><div>
<div><br>
</div>
<div>
<div>
<div dir="ltr">HI NCL users,
<div><br>
</div>
<div><br>
</div>
<div>I&#39;m wondering if NCL has fuctions to get global attributes of nc files. I have found the following function to add global attributes:</div>
<table cellspacing="2" width="100%" border="1" style="margin:0px;padding:0px;color:rgb(0,0,0);font-family:verdana,sans-serif;font-size:13px;line-height:16px">
<tbody style="margin:0px;padding:0px">
<tr style="margin:0px;padding:0px">
<td valign="top" style="padding:5px"><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/fileattdef.shtml" style="margin:0px;padding:0px;text-decoration:none;color:rgb(133,45,133);font-family:verdana,sans-serif" target="_blank">fileattdef</a></td>


<td style="padding:5px">Defines global (file) attributes associated with a <a href="http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclFormatSupport.shtml" style="margin:0px;padding:0px;text-decoration:none;color:rgb(133,45,133);font-family:verdana,sans-serif" target="_blank">supported
 file</a>.</td>
</tr>
</tbody>
</table>
<div> </div>
<div>Are there any functions to or other methods to deal with the problems?</div>
<div><br>
</div>
<div>Thanks  a lot!</div>
<div><br>
</div>
<div>Xiaoman Jiang</div>
</div>
</div>
</div>
</div></div></span>
</div>

</blockquote></div><br></div></div>