<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;"><div><div>Dear David, </div><div><br></div><div>Thank you for such a helpful explanation in addition to a code example. I’ve been able to incorporate this into my script and it works properly. I will check out the FAQ page for more info. </div><div><br></div><div>Best regards,</div><div>Greg Deemer</div><div>NSIDC User Services</div><div><div id="MAC_OUTLOOK_SIGNATURE"></div></div></div><div><br></div><span id="OLK_SRC_BODY_SECTION"><div style="font-family:Calibri; font-size:12pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><span style="font-weight:bold">From: </span> Dave Allured - NOAA Affiliate <<a href="mailto:dave.allured@noaa.gov">dave.allured@noaa.gov</a>><br><span style="font-weight:bold">Date: </span> Thursday, August 18, 2016 at 8:02 PM<br><span style="font-weight:bold">To: </span> Greg Deemer <<a href="mailto:greg.deemer@nsidc.org">greg.deemer@nsidc.org</a>><br><span style="font-weight:bold">Cc: </span> <<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a>><br><span style="font-weight:bold">Subject: </span> Re: [ncl-talk] Defining an arbitrary variable that holds no data<br></div><div><br></div><span style="mso-bookmark:_MailOriginalBody"><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></span></span></body></html>