<div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Dear all,</div><div>I have the following script, which prints to file pressure  values at a point, from the GrADS tutorial data set model.dat. Each time I run the script, I was expecting GrADS to open a new output file, since my first write statement does not append. However what I get is that each time, I run the script, the output is appended to earlier output.</div><div>My questin 1 is how do I rewind my output file? From GrADS documentation open(filename) acts as a rewind command. But trying to open the file before I start writing to it does not work.</div><div>My second question (if allowed) is, for temperature I want to write temp=temp-273,15. When the temperature is a missing value, I get -999000273.15.</div><div>How do I filter out missing values? Alternatively I can write temperature as is and do the subtraction outside the script.<br></div><div>Help will be appreciated.</div><div>'open model.ctl'<br>************************<br>header='Pressure'<br>field='ps'<br><br>str2='********'<br><br>'set lon 30.03'<br>'set lat -1.95'<br><br>i=1<br>count = 1<br>while (count <= 5)<br>   if(count=1)<br>      rc=write('model_ps.txt', header)<br>      rc=write('model_ps.txt', str2,append)<br>   endif<br><br>   plot=subwrd(field,i)<br>   'set t 'count<br>   'd ' plot<br>   press=subwrd(result,4)<br><br>* Save data to file<br>  rc=write('model_ps.txt', press, append)<br>  count = count + 1<br>endwhile<br><br>rc = close('model_ps.txt')<br>'close 1'<br><br></div></div></div></div>