<div dir="ltr">Greg,<div><br></div>CF conventions section 5.6 does not explain that attribute holders such as "crs" in their examples are scalar variables that actually hold a single value. The examples in 5.6 show only the netcdf headers. If the netcdf data section was also excerpted, you might see something like crs = 1 or crs = -999, where these are simply dummy scalar values. CF does not care what the data value of an attribute holder is, or even whether it is scalar or array.<div><br></div><div>There are two ways to create true scalar file variables in NCL. Here is one way:</div><div><br></div><div> crs = 1</div><div> crs!0 = "ncl_scalar"<br> crs@grid_mapping_name = "latitude_longitude"<br></div><div> (etc.)</div><div><br></div><div> f->crs = crs</div><div><br></div><div>Please see this FAQ for the full explanation:</div><div><a href="http://www.ncl.ucar.edu/FAQ/#file_io_007" target="_blank">http://www.ncl.ucar.edu/FAQ/#<wbr>file_io_007</a><br></div><div><br></div><div>If you skipped ' crs!0 = "ncl_scalar" ', you would get a dummy dimension such as "ncl3", and crs would still be a legal CF grid mapping variable.</div><div><br></div><div>--Dave</div><div><br></div><div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 18, 2016 at 5:31 PM, Greg Deemer <span dir="ltr"><<a href="mailto:greg.deemer@nsidc.org" target="_blank">greg.deemer@nsidc.org</a>></span> wrote:<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">NCL Talk,<br>
<br>
I’m wanting to define and write a variable that holds attributes about my dataset projection. An example of the CF conventions for defining the latitude and longitude on a spherical Earth following section 5.6 in the CF metadata conventions handbook is as follows:<br>
<br>
**********************<br> dimensions:<br>
lat = 18 ;<br>
lon = 36 ;<br>
<br>
variables:<br>
double lat(lat) ;<br>
double lon(lon) ;<br>
float temp(lat, lon) ;<br>
<br>
temp:long_name = "temperature" ;<br>
temp:units = "K" ;<br>
temp:grid_mapping = "crs" ;<br>
<br>
int crs ;<br>
crs:grid_mapping_name = "latitude_longitude";<br>
crs:longitude_of_prime_meridia<wbr>n = 0.0 ;<br>
crs:semi_major_axis = 6378137.0 ;<br>
crs:inverse_flattening = 298.257223563;”<br>
***********************<br>
<br>
My question is simply: “How do I define crs as int, without assigning values?”<br>
<br>
I tried:<br>
Crs = 1, which returns "int crs(ncl3) ;” in the NetCDF header.<br>
Crs = integer, which returns an error<br>
<br>
Thanks,<br>
Greg<br></blockquote></div></div></div></div></div></div>