<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.5848" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=746213916-09122009><FONT face=Arial
color=#0000ff size=2>I'm lazier than that...</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=746213916-09122009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=746213916-09122009><FONT face=Arial
color=#0000ff 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 class=746213916-09122009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=746213916-09122009><FONT face=Arial
color=#0000ff 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 class=746213916-09122009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=746213916-09122009><FONT face=Arial
color=#0000ff 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 face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN lang=en-ca><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN lang=en-ca><FONT face=Arial color=#0000ff
size=2><SPAN
class=746213916-09122009>-------------------------------------------------------------------------------------------</SPAN></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN lang=en-ca><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV><SPAN lang=EN>
<DIV align=left><FONT face=Arial color=#0000ff size=2>*****bilinear
interpolation from 4 nearest gridpoints:</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>function bilinear(llat,
llon, myvar)</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>**_llat =
subwrd(myposition, 1)</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>**_llon =
subwrd(myposition, 2)</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>************say 'q w2gr
'llon' 'llat</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>'q w2gr 'llon'
'llat</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>*************say
result</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff
size=2>xdim=subwrd(result,3)</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>xdim=0.+xdim</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>if ( xdim <= 1.) ;
xdim=96.+xdim ; endif</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff
size=2>ydim=subwrd(result,6)</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>* nearest x dimensions
:</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>x1=
math_int(xdim)</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>x2 = x1 + 1</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>* the weights
are</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>xw1= xdim-x1</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>xw2= 1.-xw1</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>* nearest y dimensions
:</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>y1=
math_int(ydim)</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>y2 = y1 + 1</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>* the weights
are</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>yw1= ydim-y1</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>yw2= 1.-yw1</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>'set x ' x1</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>'set y ' y1 </FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>'d ' myvar</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>line2 =
sublin(result,2)</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>pointa =
subwrd(line2,4)</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>'set x ' x2</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>'set y ' y1 </FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>'d ' myvar</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>line2 =
sublin(result,2)</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>pointb =
subwrd(line2,4)</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>'set x ' x1</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>'set y ' y2 </FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>'d ' myvar</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>line2 =
sublin(result,2)</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>pointc =
subwrd(line2,4)</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>'set x ' x2</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>'set y ' y2 </FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>'d ' myvar</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>line2 =
sublin(result,2)</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>pointd =
subwrd(line2,4)</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>newtemp = pointa*xw2*yw2 +
pointb*xw1*yw2 + pointc*xw2*yw1 + pointd*xw1*yw1</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>return
newtemp</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>* station =
f(x1,y1)*xw2*yw2+</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>*
f(x2,y1)*xw1*yw2+</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>*
f(x1,y2)*xw2*yw1+</FONT></DIV>
<DIV align=left><FONT face=Arial color=#0000ff size=2>*
f(x2,y2)*xw1*yw1</FONT></DIV></SPAN>
<DIV><FONT face=Arial color=#0000ff size=2><BR></FONT> </DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> GRADSUSR@LIST.CINECA.IT
[mailto:GRADSUSR@LIST.CINECA.IT] <B>On Behalf Of </B>Guilherme
Martins<BR><B>Sent:</B> December 9, 2009 8:49 AM<BR><B>To:</B>
GRADSUSR@LIST.CINECA.IT<BR><B>Subject:</B> Re: Output data from grib for given
coordinates<BR></FONT><BR></DIV>
<DIV></DIV>Hi Nathan!<BR><BR>You can use the <A
href="http://lats4d.gs">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">nathan@nathancool.com</A>></SPAN><BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">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">guilherme.martins@cptec.inpe.br</A><BR>E-mail
alternativo: <A
href="mailto:jgmsantos@gmail.com">jgmsantos@gmail.com</A><BR>Homepage: <A
href="http://guilhermemartins.hd1.com.br/">http://guilhermemartins.hd1.com.br/</A><BR>-----------------------------------------------------------<BR>Sent
from Sao Jose Dos Campos, SP, Brazil </BODY></HTML>