<div style="color:rgb(34,34,34);font-family:verdana,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Hi</div><div style="color:rgb(34,34,34);font-family:verdana,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:verdana,sans-serif;font-size:13px;background-color:rgb(255,255,255)">I am not sure whether this delayed replay is of any to help to you.</div><div style="color:rgb(34,34,34);font-family:verdana,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="background-color:rgb(255,255,255)"><span style="color:rgb(34,34,34);font-family:verdana,sans-serif;font-size:13px">I made some modifications to your script to enable it to plot data using 30 input file. Here I am making following </span><span style="background-color:transparent"><font color="#222222" face="verdana, sans-serif">assumptions</font></span></div>
<div style="color:rgb(34,34,34);font-family:verdana,sans-serif;font-size:13px;background-color:rgb(255,255,255)"> </div><div style="background-color:rgb(255,255,255)"><span style="color:rgb(34,34,34);font-family:verdana,sans-serif;font-size:13px">1) The input file names are </span><span style="background-color:transparent"><font color="#222222" face="verdana, sans-serif">media2_01.ctl, </font></span><font color="#222222" face="verdana, sans-serif">media2_02.ctl, </font><span style="background-color:transparent"><font color="#222222" face="verdana, sans-serif">media2_03.ctl, ....,</font></span><span style="background-color:transparent"><font color="#222222" face="verdana, sans-serif">media2_30.ctl</font></span></div>
<div style="background-color:rgb(255,255,255)"><span style="background-color:transparent"><font color="#222222" face="verdana, sans-serif">2) Output figure names are '</font></span><span style="color:rgb(34,34,34);font-family:verdana,sans-serif;font-size:13px"> </span><span style="background-color:transparent"><font color="#222222" face="verdana, sans-serif">/data/climat_6190_2/Lluvia6190_01.gmf',......,'</font></span><span style="background-color:transparent"><font color="#222222" face="verdana, sans-serif">/data/climat_6190_2/Lluvia6190_30.gmf'</font></span></div>
<div style="background-color:rgb(255,255,255)"><span style="background-color:transparent"><font color="#222222" face="verdana, sans-serif">3) Variable names are the same in all files</font></span></div><div style="background-color:rgb(255,255,255)">
<span style="background-color:transparent"><font color="#222222" face="verdana, sans-serif">If this assumptions are not right, you have to use compound variables to get the job done. </font></span></div><div style="background-color:rgb(255,255,255)">
<span style="background-color:transparent"><font color="#222222" face="verdana, sans-serif"><br></font></span></div><div style="background-color:rgb(255,255,255)"><span style="background-color:transparent"><font color="#222222" face="verdana, sans-serif">The modified script is as follows</font></span></div>
<div style="background-color:rgb(255,255,255)"><span style="background-color:transparent"><font face="verdana, sans-serif" color="#ff6666"><b><br></b></font></span></div><div style="background-color:rgb(255,255,255)"><div>
<font face="verdana, sans-serif" color="#ff6666">'reinit'</font></div><div><font face="verdana, sans-serif" color="#ff6666"><br></font></div><div><font face="verdana, sans-serif" color="#ff6666">infile1a='/data/climat_6190_2/media2_'</font></div>
<div><font face="verdana, sans-serif" color="#ff6666">infile1b='0'</font></div><div><font face="verdana, sans-serif" color="#ff6666">infile1c='.ctl'</font></div><div><font face="verdana, sans-serif" color="#ff6666"><br>
</font></div><div><font face="verdana, sans-serif" color="#ff6666">opfile1a='/data/climat_6190_2/Lluvia6190_'</font></div><div><font face="verdana, sans-serif" color="#ff6666">opfile1b='0'</font></div><div>
<font face="verdana, sans-serif" color="#ff6666">opfile1c='.gmf'</font></div><div><font face="verdana, sans-serif" color="#ff6666">opfile1d='.gif'</font></div><div><font face="verdana, sans-serif" color="#ff6666"><br>
</font></div><div><font face="verdana, sans-serif" color="#ff6666">MaxFig=30;</font></div><div><font face="verdana, sans-serif" color="#ff6666"><br></font></div><div><font face="verdana, sans-serif" color="#ff6666">figs=1</font></div>
<div><font face="verdana, sans-serif" color="#ff6666">while(figs<=MaxFig) ;*This loop will run until maximum no of figures is reached.</font></div><div><font face="verdana, sans-serif" color="#ff6666"><br></font></div>
<div><font face="verdana, sans-serif" color="#ff6666">* Generating i/p file name</font></div><div><font face="verdana, sans-serif" color="#ff6666">if figs<10</font></div><div><font face="verdana, sans-serif" color="#ff6666">InFileCnt=infile1b%figs</font></div>
<div><font face="verdana, sans-serif" color="#ff6666">opFileCnt=opfile1b%figs</font></div><div><font face="verdana, sans-serif" color="#ff6666"><br></font></div><div><font face="verdana, sans-serif" color="#ff6666">else ;* if figs<10</font></div>
<div><font face="verdana, sans-serif" color="#ff6666">InFileCnt=figs</font></div><div><font face="verdana, sans-serif" color="#ff6666">opFileCnt=figs</font></div><div><font face="verdana, sans-serif" color="#ff6666">endif ;* if figs<10</font></div>
<div><font face="verdana, sans-serif" color="#ff6666"><br></font></div><div><font face="verdana, sans-serif" color="#ff6666">infile=infile1a%InFileCnt% infile1c</font></div><div><font face="verdana, sans-serif" color="#ff6666"><br>
</font></div><div><font face="verdana, sans-serif" color="#ff6666">* Generating o/p figure name</font></div><div><font face="verdana, sans-serif" color="#ff6666"> figname=opfile1a%opFileCnt%opfile1c</font></div><div><font face="verdana, sans-serif" color="#ff6666"> outfig=opfile1a%opFileCnt%opfile1d ;* % is used to concatenate strings</font></div>
<div><div><font face="verdana, sans-serif" color="#ff6666"><br></font></div><div><font face="verdana, sans-serif" color="#ff6666">'open 'infile</font></div><div><font face="verdana, sans-serif" color="#3333ff"><br>
</font></div><div><font face="verdana, sans-serif" color="#3333ff">'set display color white'</font></div><div><font face="verdana, sans-serif" color="#3333ff">'c'</font></div><div><font face="verdana, sans-serif" color="#3333ff">'enable print 'figname</font></div>
<div><font face="verdana, sans-serif" color="#3333ff"><br></font></div><div><font face="verdana, sans-serif" color="#3333ff">'set gxout shaded'</font></div><div><font face="verdana, sans-serif" color="#3333ff">'set mpdset hires'</font></div>
<div><font face="verdana, sans-serif" color="#3333ff">'set lat 7.5 11.5'</font></div><div><font face="verdana, sans-serif" color="#3333ff">'set lon -86.5 -82.5'</font></div><div><font face="verdana, sans-serif" color="#3333ff">'set cmin 1'</font></div>
<div><font face="verdana, sans-serif" color="#3333ff">'d prec*1000*4'</font></div><div><font face="verdana, sans-serif" color="#3333ff">'draw title Precipitaci`6p`0n media diaria 1961-1990 enero'</font></div>
<div><font face="verdana, sans-serif" color="#3333ff">'run /opt/grads30d/scripts/<a href="http://cbarn.gs">cbarn.gs</a>'</font></div><div><font face="verdana, sans-serif" color="#3333ff">'print'</font></div>
<div><font face="verdana, sans-serif" color="#3333ff">'disable print'</font></div><div><font face="verdana, sans-serif" color="#ff6666">'close 1'</font></div><div><font face="verdana, sans-serif" color="#ff6666"><br>
</font></div><div><font face="verdana, sans-serif" color="#ff6666">'!/opt/grads30d/scripts/gxgif -r -i 'figname' -o 'outfig</font></div><div><font face="verdana, sans-serif" color="#ff6666">'!rm -f 'figname</font></div>
<div><font face="verdana, sans-serif" color="#ff6666"><br></font></div><div><font face="verdana, sans-serif" color="#ff6666">figs=figs+1 ;*Figure increment for the next figure</font></div><div><font face="verdana, sans-serif" color="#ff6666">endwhile;*while(figs<=MaxFig)</font></div>
<div><font face="verdana, sans-serif" color="#3333ff"><br></font></div><div><font face="verdana, sans-serif" color="#3333ff">'q pos'</font></div><div><font face="verdana, sans-serif" color="#3333ff">'quit'</font></div>
<div style="font-family:verdana,sans-serif;font-size:13px"><br></div></div></div><div><div>Hope this will help you. Contact me if you need any help in using compound variable in this script</div><div><br></div><div>Regards</div>
<div><br></div><div>Martin</div><div style="font-weight:bold"><br></div></div><div class="gmail_quote">On 5 February 2013 23:03, Estefanía Jiménez <span dir="ltr"><<a href="mailto:estefaniajimenez.r@gmail.com" target="_blank">estefaniajimenez.r@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><font face="verdana,sans-serif">this the script for only one file</font><div><font face="verdana,sans-serif"><b><br>
</b></font></div><div><font face="verdana,sans-serif"><div><b>'reinit'</b></div><div>
<b>'open /data/climat_6190_2/media2_01.ctl'</b></div><div><b>'set display color white'</b></div><div><b>'c'</b></div><div><b>'enable print /data/climat_6190_2/Lluvia6190_01.gmf'</b></div><div>
<b>'set gxout shaded'</b></div><div><b>'set mpdset hires'</b></div><div><b>'set lat 7.5 11.5'</b></div><div><b>'set lon -86.5 -82.5'</b></div><div><b>'set cmin 1'</b></div><div><b>'d prec*1000*4'</b></div>
<div><b>'draw title Precipitaci`6p`0n media diaria 1961-1990 enero'</b></div><div><b>'run /opt/grads30d/scripts/<a href="http://cbarn.gs" target="_blank">cbarn.gs</a>'</b></div><div><b>'print'</b></div>
<div><b>'disable print'</b></div>
<div><b>'!/opt/grads30d/scripts/gxgif -r -i /data/climat_6190_2/Lluvia6190_01.gmf -o /data/climat_6190_2/Lluvia6190_01.gif'</b></div><div><b>'!rm /data/climat_6190_2/Lluvia6190_01.gmf'</b></div><div><b>'q pos'</b></div>
<div><b>'quit'</b></div><div><br></div></font></div></div><div class="gmail_extra"><div><div class="h5"><br><br><div class="gmail_quote">2013/2/5 Estefanía Jiménez <span dir="ltr"><<a href="mailto:estefaniajimenez.r@gmail.com" target="_blank">estefaniajimenez.r@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><font face="verdana,sans-serif">Hi all! How can I do to do a script that plots and saves the same image for several files? For example, I have 30 files that I need to get the rain in an image and save it... I have the script for one file but how can I change it to make it work for all the 30 files? So I don't have to run the script 30 times... </font><div>
<font face="verdana,sans-serif"><br></font></div><div><font face="verdana,sans-serif">Thanks! <span><font color="#888888"><br clear="all"></font></span></font><span><font color="#888888"><div>
<br></div>-- <br><div dir="ltr"><a name="13cab6d364e9ff8f_13cab1d259015a6d_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter__MailAutoSig"><i><span lang="ES-CR" style="font-size:10.0pt;font-family:"Lucida Fax","serif";color:#1f497d">Estefanía Jiménez R.</span></i></a><br>
<br></div>
</font></span></div></div>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div dir="ltr"><a name="13cab6d364e9ff8f_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter_SafeHtmlFilter__MailAutoSig"><i><span lang="ES-CR" style="font-size:10.0pt;font-family:"Lucida Fax","serif";color:#1f497d">Estefanía Jiménez R.</span></i></a><br>
<span style="color:rgb(31,73,125);font-family:'Lucida Fax',serif;font-size:13px">Meteoróloga</span><br><span style="color:rgb(31,73,125);font-family:'Lucida Fax',serif;font-size:13px">Departamento de Climatología e Investigaciones Aplicadas</span><br>
<span style="color:rgb(31,73,125);font-family:'Lucida Fax',serif;font-size:13px">Instituto Meteorológico Nacional</span><br><span style="color:rgb(31,73,125);font-family:'Lucida Fax',serif;font-size:13px">MINAET</span><div>
<span style="color:rgb(31,73,125);font-family:'Lucida Fax',serif;font-size:10pt">Tel: +506 2222 5616 ext 131</span>
</div></div>
</font></span></div>
<br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Martin V. Mathew<br>Research scholar<br>Centre for Oceans, Rivers, Atmosphere and Land Sciences (CORAL)<br>IIT Kharagpur<br>India.<br>