Thanks Ron, that worked like a charm!<br><br>Thanks again to everyone taking the time to help me on this. I sure do appreciate it. <br><br>Best,<br><br>-Nathan<br><br><br><div class="gmail_quote">On Thu, Dec 10, 2009 at 8:12 AM, Goodson,Ron [Edm] <span dir="ltr"><<a href="mailto:Ron.Goodson@ec.gc.ca">Ron.Goodson@ec.gc.ca</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div><span><font color="#0000ff" face="Arial" size="2">There
are a number of options ..</font></span></div>
<div><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div><span><font color="#0000ff" face="Arial" size="2">the
simplest is to set gxout print ... display the data which will go into the
"result" variable .. and then use subwrd /sublin to grab and print
(say) the variable.</font></span></div>
<div><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div><span><font color="#0000ff" face="Arial" size="2">Attached is a script I use with my data which reads a file of lat/lon
points.. and prints out a bit of data for each point. This was just for
testing so you will have to modify. If you can't understand the program
flow -- you can contact me directly if you wish.</font></span></div>
<div><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div><span><font color="#0000ff" face="Arial" size="2">ron</font></span></div>
<div><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div><span><font color="#0000ff" face="Arial" size="2"></font></span> </div><br>
<div dir="ltr" align="left" lang="en-us">
<hr>
<font face="Tahoma" size="2"><b>From:</b> <a href="mailto:GRADSUSR@LIST.CINECA.IT" target="_blank">GRADSUSR@LIST.CINECA.IT</a>
[mailto:<a href="mailto:GRADSUSR@LIST.CINECA.IT" target="_blank">GRADSUSR@LIST.CINECA.IT</a>] <b>On Behalf Of </b>Nathan Cool<br><b>Sent:</b>
December 9, 2009 3:55 PM<div><div></div><div class="h5"><br><b>To:</b>
<a href="mailto:GRADSUSR@LIST.CINECA.IT" target="_blank">GRADSUSR@LIST.CINECA.IT</a><br><b>Subject:</b> Re: Output data from grib for given
coordinates<br></div></div></font><br></div><div><div></div><div class="h5">
<div></div>Thanks everyone. <br><br>I was able to do this by manually entering
in each command, but I need to run this in batch mode, if possible.<br><br>A
simple script I have now is:<br><br>'open nww3.ctl'<br>'set lon 206'<br>'set lat
33'<br>'set t 3'<br>'d HTSGWsfc'<br><br>Grads is then executed using the
following arguments:<br><br> gradsc -lbxc <a href="http://point.gs" target="_blank">point.gs</a><br><br>...where <a href="http://point.gs" target="_blank">point.gs</a> is the script above.<br><br>In batch mode, I
don't see the result output. Is there a way to run this in batch mode, or
perhaps a GRADS command to output the result into a
file?<br><br>-Nathan<br><br><br>On Wed, Dec 9, 2009 at 8:49 AM, Goodson,Ron
[Edm] <span dir="ltr"><<a href="mailto:Ron.Goodson@ec.gc.ca" target="_blank">Ron.Goodson@ec.gc.ca</a>></span>
wrote:<br>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">I'm lazier
than that...</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">I just set
lat lon to be the coordinates I want, then print out the result of displaying
the data.</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">This is
only useful if you don't mind getting the nearest grid point to your
lat/lon. Otherwise - simply use the GrADS
"bilinear".</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">Hmmm ..
thought that was in the script library but don't see it .. so here is a copy I
have buried in one of my scripts. Haven't used this script in many
years, so no warrantly expressed or implied. You will probably have to
modify it as it looks like it was hardwired for a specific-sized grid.
And it looks like it would run pretty slow.</font></span></div>
<div dir="ltr" align="left"><span lang="en-ca"><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div dir="ltr" align="left"><span lang="en-ca"><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div dir="ltr" align="left"><span lang="en-ca"><font color="#0000ff" face="Arial" size="2"><span>-------------------------------------------------------------------------------------------</span></font></span></div>
<div dir="ltr" align="left"><span lang="en-ca"><font color="#0000ff" face="Arial" size="2"></font></span> </div><span lang="EN">
<div align="left"><font color="#0000ff" face="Arial" size="2">*****bilinear
interpolation from 4 nearest gridpoints:</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">function bilinear(llat,
llon, myvar)</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">**_llat =
subwrd(myposition, 1)</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">**_llon =
subwrd(myposition, 2)</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">************say 'q w2gr
'llon' 'llat</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">'q w2gr 'llon'
'llat</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">*************say
result</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">xdim=subwrd(result,3)</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">xdim=0.+xdim</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">if ( xdim <= 1.) ;
xdim=96.+xdim ; endif</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">ydim=subwrd(result,6)</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">* nearest x dimensions
:</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">x1=
math_int(xdim)</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">x2 = x1 + 1</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">* the weights
are</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">xw1=
xdim-x1</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">xw2= 1.-xw1</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">* nearest y dimensions
:</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">y1=
math_int(ydim)</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">y2 = y1 + 1</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">* the weights
are</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">yw1=
ydim-y1</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">yw2= 1.-yw1</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">'set x ' x1</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">'set y ' y1
</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">'d ' myvar</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">line2 =
sublin(result,2)</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">pointa =
subwrd(line2,4)</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">'set x ' x2</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">'set y ' y1
</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">'d ' myvar</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">line2 =
sublin(result,2)</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">pointb =
subwrd(line2,4)</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">'set x ' x1</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">'set y ' y2
</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">'d ' myvar</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">line2 =
sublin(result,2)</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">pointc =
subwrd(line2,4)</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">'set x ' x2</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">'set y ' y2
</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">'d ' myvar</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">line2 =
sublin(result,2)</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">pointd =
subwrd(line2,4)</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">newtemp = pointa*xw2*yw2
+ pointb*xw1*yw2 + pointc*xw2*yw1 + pointd*xw1*yw1</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">return
newtemp</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">* station =
f(x1,y1)*xw2*yw2+</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">*
f(x2,y1)*xw1*yw2+</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">*
f(x1,y2)*xw2*yw1+</font></div>
<div align="left"><font color="#0000ff" face="Arial" size="2">*
f(x2,y2)*xw1*yw1</font></div></span>
<div><font color="#0000ff" face="Arial" size="2"><br></font> </div>
<div dir="ltr" align="left" lang="en-us">
<hr>
<font face="Tahoma" size="2"><b>From:</b> <a href="mailto:GRADSUSR@LIST.CINECA.IT" target="_blank">GRADSUSR@LIST.CINECA.IT</a> [mailto:<a href="mailto:GRADSUSR@LIST.CINECA.IT" target="_blank">GRADSUSR@LIST.CINECA.IT</a>] <b>On Behalf Of </b>Guilherme
Martins<br><b>Sent:</b> December 9, 2009 8:49 AM<br><b>To:</b> <a href="mailto:GRADSUSR@LIST.CINECA.IT" target="_blank">GRADSUSR@LIST.CINECA.IT</a><br><b>Subject:</b> Re: Output data
from grib for given coordinates<br></font><br></div>
<div>
<div></div>
<div>
<div></div>Hi Nathan!<br><br>You can use the <a href="http://lats4d.gs" target="_blank">lats4d.gs</a>. You can extract levels, variables, specific times
and coordinates. The output format can be, .nc, .bin,
.grb.<br><br>Guilherme.<br><br>
<div class="gmail_quote">2009/12/9 Nathan Cool <span dir="ltr"><<a href="mailto:nathan@nathancool.com" target="_blank">nathan@nathancool.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Good
morning everyone,<br><br>I'm working on a project where I need to extract
data from a grib file for specific coordinates only. Is there a way, using
GRADS, where I can specify a given coordinate (lon, lat), and retrieve data
just for that coordinate for each time series in a grib file? Or is GRADS
not the tool to do this; I was thinking of just dumping the grib using wgrib
and text parsing it, but thought GRADS might have an easier
way.<br><br>Thanks in advance,<br><font color="#888888"><br clear="all">-Nathan<br></font></blockquote></div><br><br clear="all"><br>--
<br>-----------------------------------------------------------<br>José
Guilherme Martins dos Santos<br>Grupo de Modelagem da Atmosfera e Interfaces -
GMAI<br>Divisão de Modelagem e Desenvolvimento - DMD<br>Centro de Previsão de
Tempo e Estudos Climáticos - INPE<br>Rodovia Presidente Dutra, km 39 - CEP
12630-000<br>Cachoeira Paulista, SP, Brasil<br>Telefone(CP): +55 12 3186
8502<br>Celular(SJC): +55 12 91678770 / +55 12 81528580<br>E-mail: <a href="mailto:guilherme.martins@cptec.inpe.br" target="_blank">guilherme.martins@cptec.inpe.br</a><br>E-mail alternativo: <a href="mailto:jgmsantos@gmail.com" target="_blank">jgmsantos@gmail.com</a><br>
Homepage: <a href="http://guilhermemartins.hd1.com.br/" target="_blank">http://guilhermemartins.hd1.com.br/</a><br>-----------------------------------------------------------<br>Sent
from Sao Jose Dos Campos, SP, Brazil
</div></div></div></blockquote></div><br></div></div></div>
</blockquote></div><br>