<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On May 21, 2009, at 7:58 PM, P.R. wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Im trying to setup a perl script to create a grads binary file.<br><br>Based on the documentation, the grads binary files are in sequential<br>(unformatted) fortran binary format.</div></blockquote><blockquote type="cite"><div><br>So, they should contain a record header, record, &amp; record trailer.</div></blockquote>Grads will handle binary data in sequential or stream format. The stream format has no header or trailer. It is easier to just write out stream and skip the headers and trailers -- why make your file unnecessarily large?&nbsp;</div><div><br><blockquote type="cite"><div><br><br>Example for a record containing a 32bit single-precision float ('REAL*4' in<br>fortan).<br>4byte/32bit header:<br>Value='4'<br><br>4byte/32bit record:<br>Value='3.23343'<br><br>4byte/32bit trailer:<br>Value='4'<br><br>I have a few questions on how GrADS reads (fortran unformatted) binary<br>files:<br><br>1) how many bytes should the record header&amp;trailer be?<br>Is this platform-specific, or does GrADS expect a specific size?</div></blockquote>The header and trailer for sequential format are always 4 bytes.&nbsp;<br><blockquote type="cite"><div><br><br>2) grads expects each record to contain a REAL (float) value, correct?</div></blockquote>yes<br><blockquote type="cite"><div><br><br>3) if question #2 is correct, does grads expect "REAL" values in the binary<br>file to be 4 bytes or 8?</div></blockquote>4 bytes per value</div><div><br><blockquote type="cite"><div><br>So, if my data is a 'double' data-type, should it be forced to 'REAL*8',<br>i.e. 64bit double-precision float?<br>Or, does it need to be 'REAL*4', 32bit single precision float?</div></blockquote>you have to convert your REAL*8 doubles to REAL*4 floats and then write them out. Although internally GrADS converts everything to double, we don't yet have an interface for reading (or writing out) double precision binary data.&nbsp;</div><div><br></div><div>Jennifer</div><div><br><blockquote type="cite"><div><br><br>Please help,<br>Thanks,<br>P.Romero<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></body></html>