[gradsusr] gr2stn doesn't work

Ricardo Hallak ricardo.hallak at iag.usp.br
Tue Aug 19 09:42:35 EDT 2014


Hi Dj, 
there are some tricks in building this procedure. I tested here with a GFS file and it worked (opengrads 2.0.a7.oga.3, but I think that the version is not a problem): 

'open gfs.ctl' 

* An area around your points. Note that, at least with the gfs model, the longitude have to be set in the positive way (0 to 360, or some range in between that) : 
'set lat 0 40' 
'set lon 0 60' 

'define dx = 6.371e3 * cos(lat * 3.14159/180) * cdiff(lon * 3.14159/180, x)' 
'define dy = 6.371e3 * cdiff(lat * 3.14159/180, y)' 
'define pg = mag(cdiff(prmslmsl/100,x)/dx, cdiff(prmslmsl/100, y)/dy)' 

*Below are three necessary steps: 
'set x 1' 
'set y 1' 
'set gxout print' 

* Here, longitude comes before latitude: 
'd gr2stn(pg,44.8167,20.4667)' 
* to print the result on the terminal or, 
* alternatively in a gs script, you can capture the result: 
resline=sublin(result,3) 
pgvar=subwrd(resline,1) 
say 'PGrad = 'pgvar 

Hope this can solve your problem . 

Regards, 
Ricardo 

----- Mensagem original -----

> De: "Djordje Romanic" <djordje8 at gmail.com>
> Para: "GrADS Users Forum" <gradsusr at gradsusr.org>
> Enviadas: Segunda-feira, 18 de Agosto de 2014 20:02:52
> Assunto: Re: [gradsusr] gr2stn doesn't work

> Hi Ricardo,

> It didn't help. If I do that (or I set x and y to any other value), I
> get the following error message:
> 'Invalid station data dimension environment'.

> I also tried to set station coordinates to a grid point (say lon = 20
> and lat = 45), but it didn't work either.

> By the way, my version of GrADS is v2.1.a1. Could that be an issue?

> Thanks,
> Djordje

> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20140819/5f68eaae/attachment-0001.html 


More information about the gradsusr mailing list