Hi Jackie,<br><br>thanks for the reply. but it does not working..the error is<br><br>mv: cannot stat `pnew.dat': No such file or directory<br>mv: cannot stat `pnew.dat': No such file or directory<br><br><br>Mahesh<br>
<br><div class="gmail_quote">On Thu, Aug 4, 2011 at 6:31 PM, Jackie Yip <span dir="ltr"><<a href="mailto:zheng.yip@mcgill.ca">zheng.yip@mcgill.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi Mahesh, <br><br>I just moved your open file loopend to the end of the script. Give it a try. <br><br>Jackie<div class="im"><br><br>'reinit'<br>'clear'<br><br>year_st=1951<br>year_end=1953<br>yidx=year_st<br>
while(yidx<=year_end)<br>'open /home/mahesh/data/ncep/ctl/precip_'yidx'.ctl' <br></div><div class="im"><div><br>tt=1 <br>yrid=1951<br>fst=1<br>fend=3<br>fnum=fst<br>while(fnum<=fend)<br> while(tt<=30) <br>
'set t 'tt <br> 'define arn=aave(precip.'fnum',lon=0,lon=40,lat=25,lat=55)' <br> 'd arn' <br> lrn=subwrd(result,4) <br> w=write(pnew.dat,lrn) <br>
tt=tt+1 <br> endwhile<br> fnum=fnum+1<br> yrid=yrid+1<br>'!mv pnew.dat pdata_'yrid'.dat' <br>endwhile</div><br></div>yidx=yidx+1 <br>endwhile<br><br><div class="gmail_quote"><div><div></div><div class="h5">
On 4 August 2011 03:14, Mahesh Shinde <span dir="ltr"><<a href="mailto:mashinde05@gmail.com" target="_blank">mashinde05@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div></div><div class="h5">Dear Grads users,<br><br>I am trying to write ascii data from ctl files. I need output data files like pdata_1951, pdata_1952 and so on.<br>
It works for first year. but not for the rest of the years . It gives following error msg.<br>
<br>No hardcopy metafile open<br>All files closed; all defined objects released;<br>All GrADS attributes have been reinitialized<br>mv: cannot stat `pnew.dat': No such file or directory<br>mv: cannot stat `pnew.dat': No such file or directory<br>
<br><br>Here i am pasting my script. <br><br>--------------------------------------------------------------------------------------------<br>'reinit'<br>'clear'<br><br>year_st=1951<br>year_end=1953<br>yidx=year_st<br>
while(yidx<=year_end)<br>'open /home/mahesh/data/ncep/ctl/precip_'yidx'.ctl'<br>yidx=yidx+1 <br>endwhile <br><br>tt=1 <br>yrid=1951<br>fst=1<br>fend=3<br>fnum=fst<br>while(fnum<=fend)<br> while(tt<=30) <br>
'set t 'tt <br> 'define arn=aave(precip.'fnum',lon=0,lon=40,lat=25,lat=55)' <br> 'd arn' <br> lrn=subwrd(result,4) <br> w=write(pnew.dat,lrn) <br>
tt=tt+1 <br> endwhile<br> fnum=fnum+1<br> yrid=yrid+1<br>'!mv pnew.dat pdata_'yrid'.dat' <br>endwhile<br clear="all">--------------------------------------------------------------------------------------------------------<br>
<br>so please tell me where it goes wrong.<br><br>thanking you<br><br>regards<br>Mahesh<br><br><br>-- <br><div>----------------------------------------------------------------------------------------------------------------------</div>
<div style="color: rgb(102, 102, 102);">(Permanent Affiliaiton)</div><span style="color: rgb(102, 102, 102);">Mr. Mahesh Shinde</span><div><font color="#666666"></font><span style="color: rgb(102, 102, 102);">Climate and Global Modeling Division,</span><br style="color: rgb(102, 102, 102);">
<span style="color: rgb(102, 102, 102);">Indian Institute of Tropical Meteorology,</span><br style="color: rgb(102, 102, 102);"><span style="color: rgb(102, 102, 102);">NCL POST, Dr. Homi Bhabha Road,</span><br style="color: rgb(102, 102, 102);">
<span style="color: rgb(102, 102, 102);">Pashan, Pune-411008, INDIA </span><br style="color: rgb(102, 102, 102);"><span style="color: rgb(102, 102, 102);">email: </span><a style="color: rgb(102, 102, 102);" href="mailto:samurai@tropmet.res.in" target="_blank">samurai@tropmet.res.in</a><br style="color: rgb(102, 102, 102);">
<span style="color: rgb(102, 102, 102);">cell: <a href="tel:%2B91-9822050959" value="+919822050959" target="_blank">+91-9822050959</a></span><br style="color: rgb(102, 102, 102);"><span style="color: rgb(102, 102, 102);">skype : mshinde2k9</span><br>
----------------------------------------------------------------------------------------------------------------------<br>
</div><br>
<br></div></div>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">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>_______________________________________________<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"><br>-- <br><div>----------------------------------------------------------------------------------------------------------------------</div><div style="color: rgb(102, 102, 102);">
(Permanent Affiliaiton)</div><span style="color: rgb(102, 102, 102);">Mr. Mahesh Shinde</span><div><font color="#666666"></font><span style="color: rgb(102, 102, 102);">Climate and Global Modeling Division,</span><br style="color: rgb(102, 102, 102);">
<span style="color: rgb(102, 102, 102);">Indian Institute of Tropical Meteorology,</span><br style="color: rgb(102, 102, 102);"><span style="color: rgb(102, 102, 102);">NCL POST, Dr. Homi Bhabha Road,</span><br style="color: rgb(102, 102, 102);">
<span style="color: rgb(102, 102, 102);">Pashan, Pune-411008, INDIA </span><br style="color: rgb(102, 102, 102);"><span style="color: rgb(102, 102, 102);">email: </span><a style="color: rgb(102, 102, 102);" href="mailto:samurai@tropmet.res.in" target="_blank">samurai@tropmet.res.in</a><br style="color: rgb(102, 102, 102);">
<span style="color: rgb(102, 102, 102);">cell: +91-9822050959</span><br style="color: rgb(102, 102, 102);"><span style="color: rgb(102, 102, 102);">skype : mshinde2k9</span><br>----------------------------------------------------------------------------------------------------------------------<br>
</div><br>