<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 &#39;d variable&#39; 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;">&#39;reinit&#39;</span><br style="font-weight: bold;"><span style="font-weight: bold;">&#39;open /home/Rafael/DOMAINS/Venezuela/postprd/wrfnmm_d01_24.ctl&#39;
</span><br style="font-weight: bold;"><span style="font-weight: bold;">&#39;q dims&#39;</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;">&nbsp;&nbsp;&nbsp;&nbsp; say &#39;lonmin &#39;lonmin &#39;lonmax &#39;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;">&nbsp;&nbsp;&nbsp;&nbsp; say &#39;latmin &#39;latmin &#39;latmax &#39;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;">&nbsp;&nbsp;&nbsp;&nbsp; say &#39;Imax &#39;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;">&nbsp;&nbsp;&nbsp;&nbsp; say &#39;Jmax &#39;Jmax
</span><br style="font-weight: bold;"><span style="font-weight: bold;">&#39;set gxout shaded&#39;</span><br style="font-weight: bold;"><span style="font-weight: bold;">&#39;d rhprs&#39;</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;">&nbsp;&nbsp;&nbsp;&nbsp; say &#39;dLon &#39;dLon &#39;dLat &#39;dLat </span><br style="font-weight: bold;"><span style="font-weight: bold;">rc = write(&#39;/home/Rafael/Desktop/test_xy2w_2.txt&#39;,&#39;lat lon&nbsp; var&#39;)
</span><br style="font-weight: bold;"><span style="font-weight: bold;">lon=lonmin</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp; while (lon &lt;= lonmax+dLon)</span><br style="font-weight: bold;">
<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lat=latmin</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while (lat &lt;= latmax)</span><br style="font-weight: bold;"><span style="font-weight: bold;">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#39;set lat &#39;lat</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#39;set lon &#39;lon</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#39;d rhprs&#39;
</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var = subwrd(result,4)</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lonval = math_format(&#39;%6.3f&#39;,lon)
</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; latval = math_format(&#39;%6.3f&#39;,lat)</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; say &#39;latval &#39;latval &#39;lonval &#39;lonval &#39;var &#39;var
</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rc = write(&#39;/home/Rafael/Desktop/test_xy2w_2.txt&#39;,&#39;&#39;latval&#39; &#39;lonval&#39; &#39;var&#39;&#39;)</span><br style="font-weight: bold;">
<span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#39;clear&#39;</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lat=lat+dLat</span><br style="font-weight: bold;"><span style="font-weight: bold;">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; endwhile</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lon=lon+dLon</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp; endwhile</span><br style="font-weight: bold;">
<span style="font-weight: bold;">rc = close(&#39;/home/Rafael/Desktop/test_xy2w_2.txt&#39;)&nbsp;</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 &lt;<a href="mailto:geom06005@geo.aegean.gr">geom06005@geo.aegean.gr</a>&gt;:</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&nbsp;&nbsp;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.