<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Starting with version 2.0.a6, the undef value of GrADS output (including fwrite files) is -9.99e8 BY DEFAULT unless you explicitly set the undef value with the 'set undef' command. Please read the documentation:&nbsp;</div><div><a href="http://iges.org/grads/gadoc/gradcomdsetundef.html">http://iges.org/grads/gadoc/gradcomdsetundef.html</a></div><div><br></div><div>More comments inline below ...</div><div><br></div><br><div><div>On Jul 6, 2009, at 10:57 AM, Muhammad Rahiz wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>I did a test run with fwrite, got an ouput but the display gives me<br>junk. Does anyone know why?<br><br>This was what I did;<br><br>'open sample.file.ctl'<br>'set fwrite output.bin'<br>'set gxout fwrite'<br>'define var.new = ave(var,t=1,t=124)<br>'d var.new'</div></blockquote>There is no need to use define here. Just display your expression:&nbsp;</div><div>'d ave(var,t=1,t=124)'</div><div><blockquote type="cite"><div><br>'disable fwrite'<br><br>I created the descriptor file (output.ctl) which contains the following,<br><br>DSET ^output.bin<br>UNDEF -1.e34</div></blockquote>here you need to change -1.e34 to -9.99e8&nbsp;</div><div>or&nbsp;</div><div>leave it as is and add a 'set undef file 1' command to the script fragment above</div><div><br><blockquote type="cite"><div>XDEF 303 LINEAR 46.25 0.225198675496689<br>YDEF 226 LINEAR -5.07 0.2252<br>ZDEF 1 LEVELS 1008.23<br>TDEF 1 LINEAR 00Z01JAN1961 1mo</div></blockquote>note that your new data set has only one time step; that's all you've written out. In another post you mentioned you were trying to display other time steps ...&nbsp;</div><div><br><blockquote type="cite"><div>VARS 1<br>var.new 0 99 var.new<br>ENDVARS<br><br>Opened the file for display;<br><br>'open output.ctl'<br>'d var.new'<br><br>Data file sample.file.bin is open as file 1<br>LON set to 46.25 114.26<br>LAT set to -5.07 45.6<br>LEV set to 1008.23 1008.23<br>Time values set: 1960:10:1:0 1960:10:1:0<br>E set to 1 1<br>Notice: Implied interpolation for file output.ctl<br>Interpolation will be performed on any data displayed from this file</div></blockquote>You're clearly using pdef, although you haven't included that information in your email. If you want useful answers to your questions, please present complete information, including which version of GrADS you are using and which OS you are running on.&nbsp;</div><div>--Jennifer</div><div><br><div><br></div><div><br></div><blockquote type="cite"><div><br><br><br>--<br>Muhammad Rahiz &nbsp;| &nbsp;Doctoral Student in Regional Climate Modeling<br>Climate Research Laboratory, School of Geography &amp; the Environment<br>Oxford University Centre for the Environment<br>South Parks Road, Oxford, OX1 3QY, United Kingdom<br>Tel: +44 (0)1865-285194 &nbsp;Mobile: +44 (0)7854-625974<br>Email: <a href="mailto:muhammad.rahiz@ouce.ox.ac.uk">muhammad.rahiz@ouce.ox.ac.uk</a><br><br><br><br><span>&lt;Picture1.jpg></span></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>