<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 "w" 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("......","w")</font></div><div class="gmail_default"><font face="monospace">a->tas@coordinates = <span style="color:rgb(0,0,0)">"lon lat height"</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't provide a name when you write the variable to a NetCDF file using NCL, then NCL will assign names "ncl1", "ncl2", "ncl3", 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 "ncl_scalar" 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 = "ncl_scalar"</font></div><div class="gmail_default"><font color="#000000" face="arial, helvetica, sans-serif">a->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's up to you to decide on a dimension name. ou might want to use something that indicates a string length, like "nchar":</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->rotated_pole!0 = "nchar"</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"><<a href="mailto:cym263@yahoo.com" target="_blank">cym263@yahoo.com</a>></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 = "lon lat") to (tas:coordinates = "lon lat height")</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 = "time" ;<br> time:standard_name = "time" ;<br> time:units = "days since 1949-12-01 00:00:00" ;<br> time:calendar = "standard" ;<br> time:axis = "T" ;<br> time:bounds = "time_bnds" ;<br> double rlon(rlon) ;<br> rlon:long_name = "longitude in rotated pole grid" ;<br> rlon:standard_name = "grid_longitude" ;<br> rlon:units = "degrees" ;<br> rlon:axis = "X" ;<br> double rlat(rlat) ;<br> rlat:long_name = "latitude in rotated pole grid" ;<br> rlat:standard_name = "grid_latitude" ;<br> rlat:units = "degrees" ;<br> rlat:axis = "Y" ;<br> char rotated_pole(ncl3) ;<br> rotated_pole:grid_mapping_name = "rotated_latitude_longitude" ;<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 = "Near-Surface Air Temperature" ;<br> tas:standard_name = "air_temperature" ;<br> tas:units = "K" ;<br> tas:cell_methods = "time: mean" ;<br> tas:_FillValue = 1.e+20f ;<br> tas:missing_value = 1.e+20f ;<br> tas:coordinates = "lon lat" ;<br> double time_bnds(time, bnds) ;<br> time_bnds:long_name = "Time Bounds" ;<br> time_bnds:standard_name = "time bounds" ;<br> time_bnds:coordinates = "time bnds" ;<br> double height(ncl5) ;<br> height:long_name = "height" ;<br> height:standard_name = "height" ;<br> height:units = "m" ;<br> height:positive = "up" ;<br> height:axis = "Z" ;<br> double lon(rlat, rlon) ;<br> lon:long_name = "longitude" ;<br> lon:standard_name = "longitude" ;<br> lon:units = "degrees_east" ;<br> lon:bounds = "lon_bnds" ;<br> lon:coordinates = "lon lat" ;<br> double lat(rlat, rlon) ;<br> lat:long_name = "latitude" ;<br> lat:standard_name = "latitude" ;<br> lat:units = "degrees_north" ;<br> lat:bounds = "lat_bnds" ;<br> lat:coordinates = "lon lat" ;<br> double lon_bnds(rlat, rlon, bnds) ;<br> lon_bnds:long_name = "Longitude Bounds" ;<br> lon_bnds:standard_name = "longitude bounds" ;<br> lon_bnds:coordinates = "lon lat bnds" ;<br> double lat_bnds(rlat, rlon, bnds) ;<br> lat_bnds:long_name = "Latitude Bounds" ;<br> lat_bnds:standard_name = "latitude bounds" ;<br> lat_bnds:coordinates = "lon lat bnds" ;<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>