<html><body><div style="color:#000; background-color:#fff, font-family:garamond, new york, times, serif;font-size:14pt">Hi Zilore, <br>I know fprintf (and NOT Sprintf) used to write out binary data to ascii format. Depending on your requirement, you can use it to write out the whole data (lets say gridded binary data) and also write out the corresponding latitudes and longitudes on separate files. This procedure is demonstrated in the following link:<span style="font-style: italic; color: rgb(0, 96, 191);"> http://cookbooks.opengrads.org/index.php?title=Recipe-002:_Saving_GrADS_variable_data_to_a_text_file</span><br style="font-style: italic; color: rgb(0, 96, 191);"><br>You can also use it to write out data averaged over a particular domain or grid box as in the example of a .CTL file below:<br><br>'sdfopen H:/griddata/data.cdf'<br>'set lon 10'<br>'set lat 15'<br>'set t 1 516'<br>'define pc2sst = aave(sst,lon=-165,lon=-80,lat=-5,lat=5)'<br>'set t 1
 516'<br>'fprintf rain raingcpc.txt %g 12 1'<br><br>NB: In the last line, <span style="font-weight: bold;">rain </span>is the variable, <span style="font-weight: bold;">raingcpc.txt</span> is the outputfilename, <span style="font-weight: bold;">12</span> is the number of values in each line (i.e monthly data in this case so that each line is Jan to Dec for each year), and <span style="font-weight: bold;">1</span> is the number of spaces between the values in each row/ line.<br><br>Hope this will help<br><div>&nbsp;</div><div id="RTEContent"><div><div><b><em>===================================================</em></b></div><div><b><em><font color="#007f40" face="lucida console, sans-serif">ZABLONE OWITI<br></font><font face="garamond, new york, times, serif">GRADUATE STUDENT<br>Nanjing University of Information, Science and Technology<br>College of International Education<br>Add: 219 Ning Liu Rd, Nanjing, Jiangsu, 21004, P.R.
 China<br></font></em></b><font color="#333333" face="garamond, new york, times, serif">Tel: +86-25-58731402<br>Fax: +86-25-58731456</font></div><div><b><em><font face="garamond, new york, times, serif">Mob. 15077895632</font></em></b></div><div><b><em>Website: <a rel="nofollow" target="_blank" href="http://www.nuist.edu.cn/">www.nuist.edu.cn</a><br></em></b><i><strong>====================================================<br></strong><span class="yui_3_2_0_2_129697469716652" style="font-style: italic; font-family: inherit;"><div class="MsoNormal"><i><span style="color: rgb(227, 108, 10); font-size: 12pt;">"The real art of conversation is not only to say the right thing at the right time, but also to leave unsaid the wrong thing at the tempting moment."</span></i><i><span style="color: rgb(227, 108, 10); font-size: 12pt;"></span></i></div><div class="MsoNormal">&nbsp;</div></span></i><br></div></div></div><div style="font-family: inherit; font-size:
 14pt;"><br><div style="font-family: inherit; font-size: 12pt;"><font face="Arial" size="2"><div style="border: 1px solid rgb(204, 204, 204); line-height: 0pt; font-size: 0pt; margin: 5px 0px; padding: 0pt;" readonly="true" class="hr" contenteditable="false"></div><b><span style="font-weight: bold;">From:</span></b> Zilore Mumba &lt;zmumba@gmail.com&gt;<br><b><span style="font-weight: bold;">To:</span></b> gradsusr@gradsusr.org<br><b><span style="font-weight: bold;">Cc:</span></b> <br><b><span style="font-weight: bold;">Sent:</span></b> Saturday, 5 February 2011 7:31 PM<br><b><span style="font-weight: bold;">Subject:</span></b> [gradsusr] Sprintf to write binary to ascii<br></font><br> Hello Grads users,<br>I tohught there was a command like "sprintf" to write binary data in<br>grads to ascii.<br>Help will be appreciated<br>Zilore<br>_______________________________________________<br>gradsusr mailing list<br><a ymailto="mailto:gradsusr@gradsusr.org"
 href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br><a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br><br><br></div></div></div><br></body></html>