<div dir="ltr">GrADS users,<div><br></div><div>I have come across a strange problem while running a gradscript. I am using this script to output average monthly data of different regions to a text file. Each block of commands contains a different mask, but uses the same datafile. The first block of commands is shown below:</div><div><br></div><div> 'reinit'<div>'open /data2/control/Region00_WLD_mask_GLDAS.nc'</div><div>'set t 1 756'</div><div>'set dfile 1'</div><div>'set lon -179.5 179.5'</div><div>'set lat -89.5 89.5'</div><div>'sdfopen /data2/control/<a href="http://GLDAS_NOAH10_M.020.ctl_1Deg_RainfallRateSfc.nc">GLDAS_NOAH10_M.020.ctl_1Deg_RainfallRateSfc.nc</a>'</div><div>'set dfile 2'</div><div>'set lon -179.5 179.5'</div><div>'set lat -89.5 89.5'</div><div>'set time 00Z01JAN1948'</div><div>'set dfile 1'</div><div> nmonths=756</div><div> i=1</div><div> while (i<=nmonths)</div><div> 'set t 'i</div><div>'q file 1'</div><div>region = sublin(result,2)</div><div>region = subwrd(region,2)</div><div>'q file 2'</div><div>dataset = sublin(result,2)</div><div>dataset = subwrd(dataset,2)</div><div> 'q dims'</div><div> rectime = sublin(result,5)</div><div> recdate = subwrd(rectime,6) </div><div>'d aave(maskout(rainfsfc.2*86400,lterp(mask.1(time=00Z01JAN1948),rainfsfc.2)),lon=-179.5,lon=179.5,lat=-89.5,lat=89.5)' </div><div> say 't='i </div><div> say result</div><div> rainfsfc = sublin(result,1)</div><div> rainfsfc = subwrd(rainfsfc,4)</div><div> string = dataset' 'region' 'rectime' 'rainfsfc</div><div> rc=write('GLDAS_MASK_DATA.txt' , string ,'append')</div><div> i = i + 1</div><div> endwhile</div><div><br></div><div>I repeat these commands in the same script over and over, only changing the second line (ex. the next one would read 'open /data2/control/Region01_ART_mask_GLDAS.nc'). The data is output perfectly when I have six masks in the script, but when I include the seventh, the data output from the third mask / block of commands is altered, and I get the following error:</div><div><br></div><div><div>QUERY FILE Error: file 2 not open</div><div>Data Request Error: File number out of range </div><div> Variable = rainfsfc.2 </div><div>Operation Error: Error from maskout function</div><div>Operation Error: Error from aave function</div><div> Error ocurred at column 1</div><div>DISPLAY error: Invalid expression </div><div> Expression = aave(maskout(rainfsfc.2*86400,lterp(mask.1(time=00z01jan1948),rainfsfc.2)),lon=-179.5,lon=179.5,lat=-89.5,lat=89.5)</div><div>t=703</div><div>Data Request Error: File number out of range </div><div> Variable = rainfsfc.2 </div><div>Operation Error: Error from maskout function</div><div>Operation Error: Error from aave function</div><div> Error ocurred at column 1</div><div>DISPLAY error: Invalid expression </div><div> Expression = aave(maskout(rainfsfc.2*86400,lterp(mask.1(time=00z01jan1948),rainfsfc.2)),lon=-179.5,lon=179.5,lat=-89.5,lat=89.5)</div><div><br></div><div><br></div><div>I don't believe the error lies within the third mask file itself because it plots fine when it is run independently from the other masks. I also get the same output issue when I run, for example, masks 50-56 (one or two of these will come up with the error, but running masks 50-55 will yield no problems). </div><div><br></div><div>Any help would be appreciated to me solve this issue, as I'm baffled. </div><div><br></div><div>-Justin</div>-- </div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><span style="font-size:12.8px"><span style="font-size:10pt;font-family:"times new roman",serif;background-image:initial;background-repeat:initial"><font color="#000000"><b>Justin Hicks</b></font></span></span><br></div><div><i style="font-size:12.8px"><span style="font-size:10pt;font-family:"times new roman",serif;background-image:initial;background-repeat:initial"><font color="#000000">Undergraduate<br>Atmospheric Sciences Major</font></span></i></div><div><i style="font-size:12.8px"><span style="font-size:10pt;font-family:"times new roman",serif;background-image:initial;background-repeat:initial"><font color="#000000">GIS Minor<br>University of Maryland-College Park</font></span></i><font color="#000000" face="arial, helvetica, sans-serif" size="2"><b><br></b></font></div></div></div></div></div>
</div></div>