[gradsusr] Grib to FSL

claudiomet claudiomet at gmail.com
Fri Jan 20 07:37:52 EST 2012


Hi users !

I'm trying to create script to extract data from grib file and write
it into ascii file in FSL format (for Calmet inputs)
but I'dont know how to write "tabs" separators in the ascii file, my
script is something like that

function main(args)
archivo=subwrd(args,1)
'open ' archivo
say 'abriendo ' archivo
'set lon -70.00'
'set lat -20.00'
h=1
while (h < 28)
'set z ' h
'd hgtprs'
val0=subwrd(result,4)
'd tmpprs-273'
val1=subwrd(result,4)
'd rhprs'
val2=subwrd(result,4)
'd mag(ugrdprs,vgrdprs)'
val3=subwrd(ret,4)
'define direccion=180+atan2(ugrdprs,vgrdprs)*(180/3.14)'
'd direccion'
val4=subwrd(result,4)
'q dims'
linea1=sublin(result,4)
linea2=sublin(result,5)
nivel=subwrd(linea1,6)
fecha=subwrd(linea2,6)
valt=fecha ';' nivel ';' val0 ';' val1 ';' val2 ';' val3 ';' val4
* this semicolon will be replaced by tab
res=write(fecha'.txt', valt, append)
h=h+1
endwhile
return


Greetings and Thanks!

--
Claudio Cortes
+56 (2) 9275521

Meteorologo
Encargado de Informática Ambiental Aplicada (LIAA)
Unidad de Modelacion y Gestion de la Calidad del Aire (UMGCA)
Centro Nacional del Medio Ambiente (CENMA)
www.cenma.cl

--
Claudio Cortes
+56 (2) 9275521

Meteorologist
Applied Environmental Information Manager
Modeling and Air Quality Management Unit
National Enviroment Center, Chile (CENMA)
www.cenma.cl




More information about the gradsusr mailing list