Dear good users,<br>I have gone through almost all the mail on this topic but I don't seem to get an answer to my problem.<br>I want to write a number of output files to ASCII format. <br>The output of d m3.1 is overwritten by d m3.2 and so the last value I have is that of d m3.3. My script is below.<br><br>I will be glad if someone can be of help.<br>Thank you.<br><br>Nana Browne<br>University of Cape Town<br>South Africa<br><br>'reinit'<br>'open ECMW_M05_PRCP.ctl'<br>'set gxout print'<br>'set prnopts %12.3e 5 2'<br>'set lon 0 60'<br>'set lat -40 0'<br>'set t 22 25'<br>'d m3.1'<br>'set dfile 2'<br>'set lon 0 60'<br>'set lat -40 0'<br>'set t 22 25'<br>'d m3.2'<br>'set dfile 3'<br>'set lon 0 60'<br>'set lat -40 0'<br>'set t 12 15'<br>'d m3.3'<br>rc=write(ECMW2.txt,result)<br> rc=close(ECMW2.txt)<br><br><br><b><i></i></b><blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>> 'reinit'<br>>
'sdfopen /doma/horvath/uwnd.sig995.1961.nc'<br>> 'set t 1'<br>> 'set lon 15 25'<br>> 'set lat 38 48'<br>> 'set gxout print'<br>> 'set prnopts %10.3e 5 1'<br>> 'd uwnd'<br>> rc=write(ascii.txt,result)<br>> rc=close(ascii.txt)<br>> 'quit'<br>> return<br>><br>> The script works and the result is:<br>><br>> Printing Grid -- 30 Values -- Undef = 32766<br>> 3.100e+00 1.900e+00 1.400e+00 1.300e+00 -1.200e+00<br>> 1.400e+00 1.100e+00 2.000e-01 -6.000e-01 -2.100e+00<br>> 2.000e-01 -2.000e-01 -7.000e-01 -5.000e-01 -8.000e-01<br>> -1.900e+00 -2.100e+00 -2.500e+00 -1.800e+00 -8.000e-01<br>> 1.600e+00 1.400e+00 -1.000e-01 -8.000e-01 1.987e-06<br>> 5.700e+00 3.900e+00 1.700e+00 6.000e-01 7.000e-01<br>><br>> Now if I modify the script:<br>> 'set lon 15 25'<br>> 'set lat 38' ; result is<br>> Printing Grid -- 5 Values -- Undef = 32766<br>> 3.100e+00 1.900e+00 1.400e+00 1.300e+00 -1.200e+00
; which is ok.<br>><br>> and the second modification:<br>> 'set lon 15 25'<br>> 'set lat 48'<br>> Printing Grid -- 5 Values -- Undef = 32766<br>> 1.600e+00 1.400e+00 -1.000e-01 -8.000e-01 1.987e-06 ; which is<br>> not in accordance with the "area" example<br>><br>> What is the reason for the above discrepancy?<br>><br>> Thanks and regards,<br>> Kristian<br>><br>> At 23:05 22.2.2007, you wrote:<br>>> If you don't need the data in binary (which is what you have in file<br>>> yiki.dat), you can skip the "gxout fwrite" lines and use "gxout print"<br>>> instead. Eg, in a grads script:<br>>><br>>> 'set gxout print'<br>>> 'set t 613 697'<br>>> 'display tloop(mean(soilw,lon=95.5,lon=112.5,lat=31.5,lat=42.5))'<br>>> rc=write(yiki.txt,result)<br>>> say 'return code from write is: 'rc<br>>> rc=close(yiki.txt)<br>>> say 'return code from close is:
'rc<br>>><br>>> In the above, the output from the display command gets stored in<br>>> variable "result" and you write the contents of "result" to ascii file<br>>> yiki.txt.<br>>><br>>> See the doc for 'set prnopts' at<br>>> http://grads.iges.org/grads/gadoc/gradcomdsetprnopts.html<br>>> if you want to change the format of the text output.<br>>><br>>> Diane<br>>><br>>><br>>> Yitbarek Kifle wrote:<br>>>> Dear all,<br>>>><br>>>> As a new and inexperienced user of Grads,i have come with a problem of<br>>>> converting the Grads time series binary output to Ascii format.I have<br>>>> read<br>>>> almost all such problems on the users group list but that doesn't<br>>>> seem to<br>>>> help me. Here is the discription of what i did,<br>>>><br>>>> 'set gxout fwrite'<br>>>> 'set fwrite
yiki.dat'<br>>>> set t 613 697<br>>>> d tloop(mean(soilw,lon=95.5,lon=112.5,lat=31.5,lat=42.5))<br>>>> disable fwrite<br>>>><br>>>> i have the file Yiki.dat.<br>>>><br>>>> Would somebody please tell me what to do next in step by step<br>>>> basis,as I do<br>>>> not have a programming skill?<br>>>><br>>>> thanks in advance.<br>>><br>>><br>>> ________ Information from NOD32 ________<br>>> This message was checked by NOD32 Antivirus System for Linux Mail Server.<br>>> http://www.nod32.com<br>>><br>>> __________ NOD32 2072 (20070220) Information __________<br>>><br>>> This message was checked by NOD32 antivirus system.<br>>> http://www.eset.com<br>>><br>><br>> _________________________________<br>> Kristian Horvath email: horvath@cirus.dhz.hr<br>> Graduate Research
Associate tel:+385-1-4565752<br>> Meteorological and Hydrological Service www:<br>> http://www.dhmz.htnet.hr/index.php<br>> Gric 3, 10000 Zagreb, Croatia personal www:<br>> http://radar.dhz.hr/~horvath<br>><br></blockquote><br> <p> 
<hr size=1><a href="http://us.rd.yahoo.com/evt=48250/*http://searchmarketing.yahoo.com/arp/sponsoredsearch_v9.php?o=US2226&cmp=Yahoo&ctv=AprNI&s=Y&s2=EM&b=50">Pinpoint customers </a>who are looking for what you sell.