Exporting data from Grads to excel

Teddy Allen teddyallen at YAHOO.COM
Thu Jan 14 02:47:57 EST 2010


Davide.
What I typically do is to output GrADS data into an ASCII textfile and then read that directly into Excel. There are many resources on how to export ASCII textfiles from GrADS (cookbooks...),  let me know if you can't locate them.
Good Luck,
teddy
 
http://www.teddyallen.com
"To move quickly, go alone. To move far, go together." 
African Proverb




________________________________
From: Tononi Davide <Ext-Davide.Tononi at VTT.FI>
To: GRADSUSR at LIST.CINECA.IT
Sent: Wed, January 13, 2010 9:31:39 PM
Subject: Exporting data from Grads to excel

Dear users.
I need to export some data reconrd from grads to excel file but i'm not able to do this.
I have written this command line but doesn't work.
Say that there is a problems on this command:

'display rh2m'
filename='test.xls'
'set gxout print'
'd rh2m'
'rc=(test.xls,rh2m)'
 
That i've written to export.
Some of you can suggest to me how can i export the value of this variable rh2m.
Another question it's about the command IF that in my programme doesn't work.
I write some like this but says that it is not correct unknow command: 

'if (t2m>273.15)'
    'define eps1=exp((-6763.6/t2m)-4.9283*log(t2m)+54.23)'
'else'
    'define eps1=exp((-6141/t2m)+24.3)'
'endif'
 
Thank you so much
davide
 

* Statistics on 2m air temperature and relative humidity in Europe from
*  1/1/1999 to 31/12/2008
* The source data are ECMWF ERA Interim Reanalysis, provided by the European
*  Centre for Medium-Range Weather Forecast, in grib format, with spatial
*  resolution of 1,5deg x 1,5deg lat/lon, and temporal resolution of 6h (data
*  at 00, 06, 12, 18 UTC)
* There are 49x28 grid points (LON from -27 to 45, LAT from 33 to 73.5), and
* 14612 time steps
 
'reinit'
'open temperature_Europe_10y.ctl'
'set grads off'
'set t 1 14612'
'define t2m=no2tsfc.1'
 
'set t 1 1461'
'set lat 45'
'set lon 23'
'draw title 2mT at lat45 lon23'
'draw ylab 2m Temperature'
'set ccolor 2'
'set cmark 0'
*'display (t2m-273.15)'
*'set fwrite t2m_lat45_lon23.gif'
*'printim t2m_lat45_lon23.gif white gif'
 
'open dptemperature_Europe_10y.ctl'
'set t 1 1461'
'define tdp2m=no2dsfc.2'
 
*Calculation of saturated pressure of water vapour
 
    'define eps1=exp((-6763.6/t2m)-4.9283*log(t2m)+54.23)'
 
*Calculation of water vapour pressure
 
    'define eps2=exp((-6763.6/tdp2m)-4.9283*log(tdp2m)+54.23)'
 
*Calculation of relative humidity
 
'define rh2m=eps2/eps1'
'display rh2m'
filename='test.xls'
'set gxout print'
'd rh2m'
'rc=(test.xls,rh2m)'


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20100113/4a5766bf/attachment.html 


More information about the gradsusr mailing list