<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi, Owen --<div>It sounds like you have a problem specifying the undef value in your data file. I can't help with the Matlab bit, but if you need help to figure out why GrADS can't read your file, you need to post: </div><div><br></div><div>1. The output from ncdump -c on your file (in case Matlab changes the metadata in some way)</div><div>2. Your descriptor file (if you are using 'open' with 'dtype netcdf' or 'xdfopen'). </div><div>3. The version of GrADS that you are using</div><div>4. The text from the GrADS session that illustrates the error. </div><div><br></div><div>Jennifer</div><div><br></div><div><br><div><div>On Jan 4, 2010, at 6:31 PM, Owen Doherty wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Dear Grads Users,<br><br>I am having difficulties creating and writing to a netcdf file that can be read by GrADS. The data is loaded into GrADS successfully, but when displayed looks similar to improperly written binary data (e.g. all data is in the range of 0 to 9e+36 interval 1e+36). Below are the steps I take to create a 4-D gridded netCDF, write to the netCDF and finally to read the file into GrADS.<br><br>First, I create an nc file using the ncgen utility. I have tried creating netCDF files with the variable both as "float" and "double" neither of which is successful and the errors from which appear to be similar. Below is my source code (.cdl file) for this step.<br><br>netcdf test_ncgen{<br>dimensions:<br> longitude=144;<br> latitude =73;<br> t=31;<br> z=9;<br><br>variables:<br> double longitude(longitude);<br> longitude:units = "degrees_east";<br><br> double latitude(latitude);<br> latitude:units = "degrees_north";<br> double t(t);<br> t:units = "seconds since 1970-1-1 00:00:00";<br> double z(z);<br> z:units = "lev";<br> z:valid_range = 200.,1000.;<br><br> float omejjam(longitude, latitude, t, z) ;<br> <br>data:<br>omejjam = 0;<br><br>Secondly, I write to the netCDF file using MATLAB. The write step is fairly simple and I suspect that I am missing something in here to have it write out as binary. I have tried outputting single precision (float) and double precision data from MATLAB both of which result in the same error. I am using MATLAB 2008b to do the writing. The write command is as follows:<br><br>nc=netcdf.open('test_ncgen.nc','nc_write');<br>[varname, xtype, dimids, numatts] = netcdf.inqVar(nc,4)% 0 - omejjam<br>netcdf.putVar(nc,4,omejjam);<br><br>Lastly, I read the data into GrADS. I have tried using sdfopen, xdfopen and the regular open command. Adding the OPTION little_endian to the control file does not solve the issue. All of the data looks erroneous, but consistent in between each different open command. If anyone has any advice as to how to solve this problem, I would be grateful for the insight.<br><br>Owen<br><br>-- <br>Owen Doherty<br>School of Marine and Atmospheric Science<br>Institute for Terrestrial and Planetary Atmospheres<br>103 Discovery Hall<br>Stony Brook University<br>Stony Brook, NY 11794<br>(631)-632-8682 (office)<br></div></blockquote></div><br><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div>--</div><div>Jennifer M. Adams</div><div>IGES/COLA</div><div>4041 Powder Mill Road, Suite 302</div><div>Calverton, MD 20705</div><div><a href="mailto:jma@cola.iges.org">jma@cola.iges.org</a></div><div><br class="khtml-block-placeholder"></div><br class="Apple-interchange-newline"></span></span></div></span> </div><br></div></body></html>