<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2873" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=899034421-07062006>Thank you everyone for your help,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=899034421-07062006></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=899034421-07062006>I am glad I understood better the script, their
function and use thanks to you (Diane particularly).</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=899034421-07062006>I have written one script then to export data and make
them readable in Excel.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=899034421-07062006>Hereunder the script:</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff
size=2></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff
size=2></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2>'sdfopen
data\mrso1.nc'<BR>'set lat 20'<BR>'set lon 55'<BR>'set z 1'<BR>'set t 1
12'<BR>filename='youyou'<BR>'set gxout print'<BR>'d
mrso'<BR>rc=write(filename,result)</FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff
size=2></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff
size=2></FONT> </DIV>
<DIV dir=ltr align=left><SPAN class=899034421-07062006><FONT face=Arial
color=#0000ff size=2>The youyou file does not create. It does though when I want
the average (see my attached excel results):</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=899034421-07062006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=899034421-07062006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=899034421-07062006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=899034421-07062006><FONT face=Arial
color=#0000ff size=2>'sdfopen data\mrso1.nc'<BR>'set lat 20 25'<BR>'set lon 52
55'<BR>'set z 1'<BR>'set t 1 12'<BR>'define m1 =
ave(mrso.1,t=1,t=601)'<BR>filename='testbis.xls'<BR>'set gxout print'<BR>'d
m1'<BR>rc=write(filename,result)</FONT></SPAN></DIV>
<DIV><SPAN class=899034421-07062006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=899034421-07062006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=899034421-07062006><FONT face=Arial color=#0000ff size=2>So, I
have 2 questions:</FONT></SPAN></DIV>
<DIV><SPAN class=899034421-07062006><FONT face=Arial color=#0000ff size=2>*1st
one related to the first script: why can't I have a file created when I ask to
export for each step of time. Indeed, I would like to have for each grid, a
monthly value during my period of time mentionned, do you know what I
mean?</FONT></SPAN></DIV>
<DIV><SPAN class=899034421-07062006><FONT face=Arial color=#0000ff size=2>*2nd
question: why in Excel the numbers are so big (x*e25, or so small x*e-17). What
are those numbers?</FONT></SPAN></DIV>
<DIV><SPAN class=899034421-07062006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=899034421-07062006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=899034421-07062006><FONT face=Arial color=#0000ff size=2>Thanks
a lot for your cooperation,</FONT></SPAN></DIV>
<DIV><SPAN class=899034421-07062006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=899034421-07062006><FONT face=Arial color=#0000ff
size=2>Loic.</FONT></SPAN></DIV>
<DIV><SPAN class=899034421-07062006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=899034421-07062006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=899034421-07062006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=899034421-07062006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=899034421-07062006><FONT face=Arial color=#0000ff
size=2> </DIV>
<DIV dir=ltr align=left><BR></DIV></FONT></SPAN>
<DIV dir=ltr align=left><SPAN class=899034421-07062006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=899034421-07062006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN><SPAN class=899034421-07062006><FONT
face=Arial color=#0000ff size=2></FONT></SPAN> </DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Diane Stokes
[mailto:Diane.Stokes@noaa.gov] <BR><B>Sent:</B> Thursday, June 01, 2006 1:26
PM<BR><B>To:</B> Cottet, Loic (IFPRI)<BR><B>Subject:</B> Re: your
explanations<BR></FONT><BR></DIV>
<DIV></DIV>Hi, Loic.<BR><BR>"clm" was an example variable name that a I chose to
"display".<BR><BR>If you 'set gxout print', then display some field, the values
are printed to the screen. When you are running a grads <B>script</B>,
text output from each command is stored in the variable "result". So, if
you want to trap that output to process it further, you have to grab
"result". In the example below, I'm copying the info from "result" into
the new variable "res". Then I write "res" to text file temp.txt using the
intrinsic function "write". Every time you call an function, a return code
is generated. I'm using variable "rc" to store these.<BR><BR>So, here's
the example one more time with additional comments in <FONT
color=purple>purple</FONT>:<BR><BR><FONT color=purple>* tell grads to generate
ascii output for display commands.<BR>* For more info see <A
class=moz-txt-link-freetext
href="http://grads.iges.org/grads/gadoc/gradcomdsetgxout.html">http://grads.iges.org/grads/gadoc/gradcomdsetgxout.html</A><BR>*
and <A class=moz-txt-link-freetext
href="http://grads.iges.org/grads/gadoc/gradcomdsetprnopts.html">http://grads.iges.org/grads/gadoc/gradcomdsetprnopts.html</A><BR></FONT>'set
gxout print'<BR><BR><FONT color=purple>*display field</FONT><BR>'d
clm'<BR><BR><FONT color=purple>*save ascii output in variable
"res"</FONT><BR>res=result<BR><BR><FONT color=purple>*write ascii output to file
temp.txt, saving return code in "rc".<BR>*For more info, see <A
class=moz-txt-link-freetext
href="http://grads.iges.org/grads/gadoc/script.html#intrinsic">http://grads.iges.org/grads/gadoc/script.html#intrinsic</A><BR></FONT>rc=write(temp.txt,res)<BR>say
'return code from write is: 'rc<BR>* depending on what you are doing,<BR>* you
may or may not want to close the file<BR><BR><FONT color=purple>*close output
file temp.txt, saving return code in "rc"<BR></FONT><FONT color=purple>*For more
info, see <A class=moz-txt-link-freetext
href="http://grads.iges.org/grads/gadoc/script.html#intrinsic">http://grads.iges.org/grads/gadoc/script.html#intrinsic</A></FONT><BR>rc=close(temp.txt)<BR>say
'return code from close is: 'rc<BR><BR><BR>For more info on the scripting
language, see:<BR> <A class=moz-txt-link-freetext
href="http://grads.iges.org/grads/gadoc/script.html">http://grads.iges.org/grads/gadoc/script.html</A><BR><BR>
Good luck.<BR> Diane<BR><BR><BR>PS. I know
you've been having trouble getting responses to some of your posts. In
some cases, your issues were windows related and there just aren't as many
people running grads under windows, so your knowledge pool is smaller than for
folks running under unix or linux. In the case of yesterday's msg ("read
stream format"), that wasn't so. Many of us could have answered. I
guess we were all busy and nobody got to it yet. Sorry! Good job
looking through the archives. You are on the right track with "set gxout
print".<BR><BR><BR>Cottet, Loic (IFPRI) wrote:
<BLOCKQUOTE cite=mid5C41B489BDE4614A9FA014D690BEB03F0214E7D3@IFPRIE
type="cite"><META content="MSHTML 6.00.2900.2873" name=GENERATOR>
<DIV><SPAN class=325353515-01062006>Hi Diane,</SPAN></DIV>
<DIV><SPAN class=325353515-01062006></SPAN> </DIV>
<DIV><SPAN class=325353515-01062006>After checking the archives I tried to
follow your steps to output data from Grads and make it readable (Clearly) in
Excel.</SPAN></DIV>
<DIV><SPAN class=325353515-01062006>There is just something that I do not
understand in your script:</SPAN></DIV>
<DIV><SPAN class=325353515-01062006></SPAN> </DIV>
<DIV><FONT size=+0><SPAN class=325353515-01062006>
<P><BR>'set gxout print'<BR>'d
clm'<BR>res=result<BR>rc=write(temp.txt,res)<BR>say 'return code from write
is: 'rc<BR>* depending on what you are doing,<BR>* you may or may not want to
close the file<BR>rc=close(temp.txt)<BR>say 'return code from close is:
'rc<BR></P>
<P><SPAN class=325353515-01062006></SPAN>I<SPAN class=325353515-01062006> am
using GradsNC and in the documetation I do not find anything about d clm and
the functions rc and res.</SPAN></P>
<P><FONT size=+0><SPAN class=325353515-01062006></SPAN><SPAN
class=325353515-01062006></SPAN>T<SPAN class=325353515-01062006>hanks a lot
for your help, I would appreciate it.</SPAN></FONT></P><FONT
size=+0><SPAN class=325353515-01062006></SPAN></FONT></SPAN></FONT></DIV>
<DIV><FONT size=+0><SPAN class=325353515-01062006><FONT size=+0><FONT
size=+0><SPAN class=325353515-01062006></SPAN>
<P><SPAN class=325353515-01062006></SPAN>L<SPAN
class=325353515-01062006>oic</SPAN><BR></P></FONT></FONT>
<P><BR></P></SPAN></FONT></DIV></BLOCKQUOTE><BR><PRE class=moz-signature cols="72">--
Diane Stokes
Environmental Modeling Center
National Weather Service/NOAA
</PRE></BODY></HTML>