<br>Hi, Giannakos if your files are .ctl for GrADS, it can help you... <br><span style="font-weight: bold;">*****************************************************************</span><br style="font-weight: bold;"><span style="font-weight: bold;">
****Este SCRIPT genera Archivos .txt de cualquier variables, simplemente hay que cambiar el nombre del .ctl a abrir, ***cambiar la variable por la que se desea en 'd variable' y cambiar la ruta del archivo donde se va a guardar los datos
</span><br style="font-weight: bold;"><span style="font-weight: bold;">***by: Ing. Rafael Mundaray</span><br style="font-weight: bold;"><span style="font-weight: bold;">*****************************************************************
</span><br style="font-weight: bold;"><span style="font-weight: bold;">'reinit'</span><br style="font-weight: bold;"><span style="font-weight: bold;">'open /home/Rafael/DOMAINS/Venezuela/postprd/wrfnmm_d01_24.ctl'
</span><br style="font-weight: bold;"><span style="font-weight: bold;">'q dims'</span><br style="font-weight: bold;"><span style="font-weight: bold;">rec=sublin(result,2)</span><br style="font-weight: bold;"><span style="font-weight: bold;">
lonmin=subwrd(rec,6)</span><br style="font-weight: bold;"><span style="font-weight: bold;">lonmax=subwrd(rec,8)</span><br style="font-weight: bold;"><span style="font-weight: bold;"> say 'lonmin 'lonmin 'lonmax 'lonmax
</span><br style="font-weight: bold;"><span style="font-weight: bold;">rec=sublin(result,3)</span><br style="font-weight: bold;"><span style="font-weight: bold;">latmin=subwrd(rec,6)</span><br style="font-weight: bold;"><span style="font-weight: bold;">
latmax=subwrd(rec,8)</span><br style="font-weight: bold;"><span style="font-weight: bold;"> say 'latmin 'latmin 'latmax 'latmax</span><br style="font-weight: bold;"><span style="font-weight: bold;">rec=sublin(result,2)
</span><br style="font-weight: bold;"><span style="font-weight: bold;">Imax=subwrd(rec,13)</span><br style="font-weight: bold;"><span style="font-weight: bold;"> say 'Imax 'Imax </span><br style="font-weight: bold;">
<span style="font-weight: bold;">rec=sublin(result,3)</span><br style="font-weight: bold;"><span style="font-weight: bold;">Jmax=subwrd(rec,13)</span><br style="font-weight: bold;"><span style="font-weight: bold;"> say 'Jmax 'Jmax
</span><br style="font-weight: bold;"><span style="font-weight: bold;">'set gxout shaded'</span><br style="font-weight: bold;"><span style="font-weight: bold;">'d rhprs'</span><br style="font-weight: bold;">
<span style="font-weight: bold;">dLon = (math_abs(lonmin)-math_abs(lonmax))/Imax</span><br style="font-weight: bold;"><span style="font-weight: bold;">dLat = math_abs(math_abs(latmin)-math_abs(latmax))/Jmax</span><br style="font-weight: bold;">
<span style="font-weight: bold;"> say 'dLon 'dLon 'dLat 'dLat </span><br style="font-weight: bold;"><span style="font-weight: bold;">rc = write('/home/Rafael/Desktop/test_xy2w_2.txt','lat lon var')
</span><br style="font-weight: bold;"><span style="font-weight: bold;">lon=lonmin</span><br style="font-weight: bold;"><span style="font-weight: bold;"> while (lon <= lonmax+dLon)</span><br style="font-weight: bold;">
<span style="font-weight: bold;"> lat=latmin</span><br style="font-weight: bold;"><span style="font-weight: bold;"> while (lat <= latmax)</span><br style="font-weight: bold;"><span style="font-weight: bold;">
'set lat 'lat</span><br style="font-weight: bold;"><span style="font-weight: bold;"> 'set lon 'lon</span><br style="font-weight: bold;"><span style="font-weight: bold;"> 'd rhprs'
</span><br style="font-weight: bold;"><span style="font-weight: bold;"> var = subwrd(result,4)</span><br style="font-weight: bold;"><span style="font-weight: bold;"> lonval = math_format('%6.3f',lon)
</span><br style="font-weight: bold;"><span style="font-weight: bold;"> latval = math_format('%6.3f',lat)</span><br style="font-weight: bold;"><span style="font-weight: bold;"> say 'latval 'latval 'lonval 'lonval 'var 'var
</span><br style="font-weight: bold;"><span style="font-weight: bold;"> rc = write('/home/Rafael/Desktop/test_xy2w_2.txt',''latval' 'lonval' 'var'')</span><br style="font-weight: bold;">
<span style="font-weight: bold;"> 'clear'</span><br style="font-weight: bold;"><span style="font-weight: bold;"> lat=lat+dLat</span><br style="font-weight: bold;"><span style="font-weight: bold;">
endwhile</span><br style="font-weight: bold;"><span style="font-weight: bold;"> lon=lon+dLon</span><br style="font-weight: bold;"><span style="font-weight: bold;"> endwhile</span><br style="font-weight: bold;">
<span style="font-weight: bold;">rc = close('/home/Rafael/Desktop/test_xy2w_2.txt') </span> <br><br>It is mine i made for change the grads information in ASCII format... For example: if you make a graphic of PRECIPITATION you can obtain a ASCII with the information of the image...
<br><br><br><div><span class="gmail_quote">2007/6/5, Giannakos Apostolos <<a href="mailto:geom06005@geo.aegean.gr">geom06005@geo.aegean.gr</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi list<br><br>I have a grib file and i want to write it to an ascii does anyone know what<br>should i do? Also i want to be able to extract several grib files to ascii<br>format.<br><br>I would appreciate any assistance
<br><br>Thanks in advance<br></blockquote></div><br><br clear="all"><br>-- <br>Ing. Rafael E. Mundaray M.