<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I have fixed the bug regarding the endian-ness of 2-byte signed/unsigned integers. As for the secondary issue that David Lorenz brought up, I have updated the documentation, which now states: "If there are multiple variables in the same file, they must all be the same type." This is for binary data only, and it is because the calculation of file offsets (i.e. where to move to in the file to read the requested data) requires that all x-y grids in the file are the same size in bytes. Variables of different sizes are easily handled in the netcdf interface -- if you require a mix of shorts, ints, and byte variables in one file, please use netcdf format instead of binary. <div>--Jennifer</div><div><br><div><br><div><br></div><div><br><div><div>On May 20, 2011, at 11:22 AM, Jennifer Adams wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I will take a look at this bug as soon as I can. Thanks for all the helpful diagnostic material. Although it doesn't say it explicitly in the documentation, I don't think the 'special format' codes in the units field of the variable declaration for non-standard binary data were ever intended to be used on a per-variable basis. When looking at this bug, I will make sure that is the case and update the documentation as appropriate. If you want to write out variables of different binary formats in the same file, I think netCDF is probably the better format for that. GrADS will handle a variety of data types in the same file automatically without any fuss or muss. --Jennifer<div><br><div><div>On May 20, 2011, at 11:06 AM, David Lorenz wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>I've run into the same problem in the GrADS binary for Mac. I sent a message to these forums a while back and didn't get a response.<br><br>There's also a problem when you mix two-byte and four-byte variables together in the same file. GrADS get confused and acts like all variables are the same size as the variable you are trying to display. <br><br><br>-Dave<br><br>On 05/19/11, Henrique Barbosa wrote:<br><blockquote type="cite">Dear all,<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I was trying to read a single variable written as 2-byte signed integer in a big endian file. Plain binary file, i.e. stream, with no header. Should be really simple, but it was not. For handling this, I had my CTL as:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">(...)<br></blockquote><blockquote type="cite">options big_endian<br></blockquote><blockquote type="cite">(...)<br></blockquote><blockquote type="cite">myvar 0 -1,40,2,-1 ** my variable<br></blockquote><blockquote type="cite">(...)<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">However, it did not work. The values were completely wrong. After a day trying to understand what as going on, I decided to force &#39;little_endian&#39; on the CTL despite the file being big-endian... and it worked!! and I could read the data. <br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">However, USGS claims gtopo30 to be big_endian. To make sure, I wrote a F90 program to read it. I could only get the correct data inside the program if I opened the file as big_endian. Therefore, as USGS and my program agree, I believe the data is big_endian.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Therefore the problem should be in grads. I made a series of tests, writing 1-byte, 2-byte and 4-byte integer binary files, and 4-byte float files, for both little and big endian types. The only problem I found was with 2-byte integers. I think that it is a bug in grads, actually, OpenGrads v2.0.a9.oga.1. The necessary data to reproduce the problem can be found here:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><<a href="http://www.fap.if.usp.br/~hbarbosa/file_format.tgz">http://www.fap.if.usp.br/~hbarbosa/file_format.tgz</a>><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Can some expert have a look in the source code? Arlindo? Jennifer? By the way, I am on x86-64 machine, runing ubuntu 64bits and using grads-2.0.a9.oga.1-bundle-x86_64-rhel5.5-linux-gnu.tar.gz.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Sincerely,<br></blockquote><blockquote type="cite">Henrique<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">_______________________________________________<br></blockquote><blockquote type="cite">gradsusr mailing list<br></blockquote><blockquote type="cite"><a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br></blockquote><blockquote type="cite"><a href="http://gradsusr.org/mailman/listinfo/gradsusr">http://gradsusr.org/mailman/listinfo/gradsusr</a><br></blockquote><br>_______________________________________________<br>gradsusr mailing list<br><a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br><a href="http://gradsusr.org/mailman/listinfo/gradsusr">http://gradsusr.org/mailman/listinfo/gradsusr</a><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></div>_______________________________________________<br>gradsusr mailing list<br><a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>http://gradsusr.org/mailman/listinfo/gradsusr<br></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></div></div></body></html>