<div dir="ltr"><div class="gmail_default" style="font-size:small">Mark,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">1) You can do it directly on the variable on the file, as long as you open the file in &quot;w&quot; mode when you call addfile:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><font face="monospace">a = addfile(&quot;......&quot;,&quot;w&quot;)</font></div><div class="gmail_default"><font face="monospace">a-&gt;tas@coordinates = <span style="color:rgb(0,0,0)">&quot;lon lat height&quot;</span></font></div><div class="gmail_default"><font face="monospace"><span style="color:rgb(0,0,0)"><br></span></font></div><div class="gmail_default"><span style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif">2) and 3) can be answered together. Whenever NCL writes variables to a NetCDF file, it *always* forces variables to have a dimension name, even scalars. If you don&#39;t provide a name when you write the variable to a NetCDF file using NCL, then NCL will assign names &quot;ncl1&quot;, &quot;ncl2&quot;, &quot;ncl3&quot;, etc.  </font></span></div><div class="gmail_default"><span style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif"><br></font></span></div><div class="gmail_default"><font color="#000000" face="arial, helvetica, sans-serif">When writing scalar variables to a file, we recommend using &quot;ncl_scalar&quot; as a dimension name:</font></div><div class="gmail_default"><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font color="#000000" face="arial, helvetica, sans-serif">p0 =1000.</font></div><div class="gmail_default"><font color="#000000" face="arial, helvetica, sans-serif">p0!0 = &quot;ncl_scalar&quot;</font></div><div class="gmail_default"><font color="#000000" face="arial, helvetica, sans-serif">a-&gt;p0 = p0</font></div><div class="gmail_default"><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font color="#000000" face="arial, helvetica, sans-serif">For variables containing characters, like your rotated pole variable, it&#39;s up to you to decide on a dimension name. ou might want to use something that indicates a string length, like &quot;nchar&quot;:</font></div><div class="gmail_default"><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font color="#000000" face="arial, helvetica, sans-serif">a-&gt;rotated_pole!0 = &quot;nchar&quot;</font></div><div class="gmail_default"><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font color="#000000" face="arial, helvetica, sans-serif">--Mary</font></div><div class="gmail_default"><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 4, 2014 at 12:42 PM, Mark Chan <span dir="ltr">&lt;<a href="mailto:cym263@yahoo.com" target="_blank">cym263@yahoo.com</a>&gt;</span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:16px"><div dir="ltr">Dear NCL users,</div><div dir="ltr"><br></div><div dir="ltr">In the below is about the metadata of a netCDF file, generated by using NCL script. I would like to do some modification about the metadata. Can one give any suggestion how to do it?</div><div dir="ltr"><br></div><div dir="ltr">(1) modifying the coordinates from (tas:coordinates = &quot;lon lat&quot;) to (tas:coordinates = &quot;lon lat height&quot;)</div><div>(2) the rotated_pole is a
variable without a dimension, because it is a variable without any
data. How can I improve it here?</div><div dir="ltr">(3) what is the meaning of ncl3 and ncl5? how to remove them from the metadata?</div><div dir="ltr"><br></div><div dir="ltr">Thanks so much in advance.</div><div dir="ltr"><br></div><div dir="ltr">Cheers,</div><div dir="ltr">Mark<br></div><div dir="ltr"></div><div><br></div><br><div></div><div dir="ltr">===metadata below=========<br></div><div>ncdump -h tas_AFR-44_NCC-NorESM1-M_historical_r1i1p1_BCCR-WRF331C_v1_mon_195001-195012.nc <br></div><div><br></div><div>netcdf tas_AFR-44_NCC-NorESM1-M_historical_r1i1p1_BCCR-WRF331C_v1_mon_195001-195012 {<br>dimensions:<br>    time = UNLIMITED ; // (12 currently)<br>    rlon = 213 ;<br>    rlat = 220 ;<br>    ncl3 = 9 ;<br>    bnds = 2 ;<br>    ncl5 = 1 ;<br>variables:<br>    double time(time) ;<br>        time:long_name = &quot;time&quot; ;<br>        time:standard_name = &quot;time&quot; ;<br>        time:units = &quot;days since 1949-12-01 00:00:00&quot; ;<br>        time:calendar = &quot;standard&quot; ;<br>        time:axis = &quot;T&quot; ;<br>        time:bounds = &quot;time_bnds&quot; ;<br>    double rlon(rlon) ;<br>        rlon:long_name = &quot;longitude in rotated pole grid&quot; ;<br>        rlon:standard_name = &quot;grid_longitude&quot; ;<br>        rlon:units = &quot;degrees&quot; ;<br>        rlon:axis = &quot;X&quot; ;<br>    double rlat(rlat) ;<br>        rlat:long_name = &quot;latitude in rotated pole grid&quot; ;<br>        rlat:standard_name = &quot;grid_latitude&quot; ;<br>        rlat:units = &quot;degrees&quot; ;<br>        rlat:axis = &quot;Y&quot; ;<br>    char rotated_pole(ncl3) ;<br>        rotated_pole:grid_mapping_name = &quot;rotated_latitude_longitude&quot; ;<br>        rotated_pole:grid_north_pole_latitude = 90.f ;<br>        rotated_pole:grid_north_pole_longitude = -180.f ;<br>    float tas(time, rlat, rlon) ;<br>        tas:long_name = &quot;Near-Surface Air Temperature&quot; ;<br>        tas:standard_name = &quot;air_temperature&quot; ;<br>        tas:units = &quot;K&quot; ;<br>        tas:cell_methods = &quot;time: mean&quot; ;<br>        tas:_FillValue = 1.e+20f ;<br>        tas:missing_value = 1.e+20f ;<br>        tas:coordinates = &quot;lon lat&quot; ;<br>    double time_bnds(time, bnds) ;<br>        time_bnds:long_name = &quot;Time Bounds&quot; ;<br>        time_bnds:standard_name = &quot;time bounds&quot; ;<br>        time_bnds:coordinates = &quot;time bnds&quot; ;<br>    double height(ncl5) ;<br>        height:long_name = &quot;height&quot; ;<br>        height:standard_name = &quot;height&quot; ;<br>        height:units = &quot;m&quot; ;<br>        height:positive = &quot;up&quot; ;<br>        height:axis = &quot;Z&quot; ;<br>    double lon(rlat, rlon) ;<br>        lon:long_name = &quot;longitude&quot; ;<br>        lon:standard_name = &quot;longitude&quot; ;<br>        lon:units = &quot;degrees_east&quot; ;<br>        lon:bounds = &quot;lon_bnds&quot; ;<br>        lon:coordinates = &quot;lon lat&quot; ;<br>    double lat(rlat, rlon) ;<br>        lat:long_name = &quot;latitude&quot; ;<br>        lat:standard_name = &quot;latitude&quot; ;<br>        lat:units = &quot;degrees_north&quot; ;<br>        lat:bounds = &quot;lat_bnds&quot; ;<br>        lat:coordinates = &quot;lon lat&quot; ;<br>    double lon_bnds(rlat, rlon, bnds) ;<br>        lon_bnds:long_name = &quot;Longitude Bounds&quot; ;<br>        lon_bnds:standard_name = &quot;longitude bounds&quot; ;<br>        lon_bnds:coordinates = &quot;lon lat bnds&quot; ;<br>    double lat_bnds(rlat, rlon, bnds) ;<br>        lat_bnds:long_name = &quot;Latitude Bounds&quot; ;<br>        lat_bnds:standard_name = &quot;latitude bounds&quot; ;<br>        lat_bnds:coordinates = &quot;lon lat bnds&quot; ;<br><br></div><div><br></div></div></div><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>
<br></blockquote></div></div>