<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.5848" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=861395821-02102009>I thought fwrite was for binary
files.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=861395821-02102009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=861395821-02102009>Anyway I just use
something like</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=861395821-02102009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=861395821-02102009>MyFile = "MyFileName"</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=861395821-02102009>'set gxout print'</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=861395821-02102009>'set prnopts %6.1f 17' (these are just examples
.. change to whatever format with however many values per line you want
..)</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=861395821-02102009>'d wind'</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=861395821-02102009>rc = write(MyFile, result)</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=861395821-02102009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=861395821-02102009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=861395821-02102009>That will put your ascii values in the file
"MyFileName". There will be the 2 grads header lines before the data
you'll have to strip out. There will be 17 values per lines, since that
was what was specified in the prnopts. It probably makes more sense to set
that equal to the number of elements along X.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=861395821-02102009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=861395821-02102009>ron</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=861395821-02102009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=861395821-02102009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=861395821-02102009></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=861395821-02102009></SPAN></FONT> </DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2>
<HR SIZE=1>
<B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Wansang Ryu <<A
href="mailto:wansryu@GMAIL.COM"
target=_blank>wansryu@GMAIL.COM</A>><BR><B><SPAN
style="FONT-WEIGHT: bold">To:</SPAN></B> <A
href="mailto:GRADSUSR@LIST.CINECA.IT"
target=_blank>GRADSUSR@LIST.CINECA.IT</A><BR><B><SPAN
style="FONT-WEIGHT: bold">Sent:</SPAN></B> Friday, October 2, 2009 3:51:11
PM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> How to save
variables to ASCII<BR></FONT></DIV>
<DIV class=gmail_quote>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV>
<DIV
style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman,new york,times,serif">
<DIV
style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman,new york,times,serif">
<DIV
style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman,new york,times,serif">
<DIV>
<DIV></DIV>
<DIV class=h5><BR>Dear users,<BR><BR>I am a beginner of GRADS, so I have lots
of questions.<BR>One of them is that I want to save a variable (or variables)
to an ASCII file.<BR>I read that fwrite would work, but I don't know how to
use it.<BR><BR>I define a variable named 'wind' as below.<BR><BR>define wind =
ave(mag(uwind,vwind),t+0,t=360,12)<BR><BR>I want to save the variable 'wind'
to ASCII.<BR>I just used 'set fwrite' command, but I don't see any new file in
my directory.<BR><BR>Anybody can help me?<BR><BR>Wansang<BR
clear=all><BR>---<BR>College Station, TX 77843-3147<BR>Office: 305A CSA
(Teague) Bldg<BR>(979)
845-2719<BR></DIV></DIV></DIV></DIV></DIV><BR></DIV></BLOCKQUOTE></DIV><BR><BR
clear=all><BR>-- <BR>Ph.D. Candidate<BR>Department of Geography<BR>Texas A&M
University<BR>College Station, TX 77843-3147<BR>Office: 305A CSA (Teague)
Bldg<BR>(979) 845-2719<BR></BODY></HTML>