Hello Everyone,<br> I am running into a very trivial problem that I just can not figure out. I am attempting to write some anomalous data out in Grads format, however my nested loop is not functioning properly. The second while-loop works just fine, but the "time" step while-loop is not functioning at all. Essentially after I run the script it goes through the first time and the first 24 levels and then stops. I do not understand why the first loop is not functioning correctly. Any help would be greatly appreciated. I have a feeling I am making a stupid mistake, but I just can't find it. I'm running grads v1.9 on Linux. The script works just fine with the exception of the first while-loop.<br>
Thanks,<br>Jim<br><br clear="all">*This is my script*<br><br>'open template.ctl'<br>'open salt.ctl'<br>'set lat 60 90'<br>'set lon 0 360'<br>'open arctic1900_2009.ctl'<br>'set fwrite saltanom.dat'<br>
'set gxout fwrite'<br>i = 1<br>p = 0<br>while(p<=1332) *<---------this loop is not functioning properly<br>while(i<=24)<br>'set z 'i''<br>'set t 1 12'<br>'tempseasonal = ave(salt.2,t+0,t+0)'<br>
'set t 1 1332'<br>'modify tempseasonal seasonal'<br>'set t 'p''<br>'anom=oacres(salt.1,salt.3-gr2stn(tempseasonal,salt.3),5,4,3,2,1)'<br>'d anom'<br>'undefine anom'<br>
i = i + 1<br>endwhile<br>p=p+1<br>endwhile<br>'disable fwrite'<br><br>