Dear all,<div><br></div><div>I want to calculate the area average of a variable over the globe. I have written the grads scripts as follows. It is giving output file, but for single grid at single level.</div><div><br></div>
<div><div>'reinit'</div><div>'sdfopen <a href="http://sample.nc">sample.nc</a>'</div><div>'set t 1 12'</div><div>lev=1</div><div>while(lev<15)</div><div>'set lev 'lev</div><div>lt1=-90</div>
<div>while(lt1<90)</div><div>lt2=lt1+10</div><div>ln1=0</div><div>while(ln1<360)</div><div>ln2=ln1+30</div><div>'define temp=aave(t,lon='ln1',lon='ln2',lat='lt1',lat='lt2')'</div>
<div>'set sdfwrite <a href="http://sample1.nc">sample1.nc</a>'</div><div>'sdfwrite temp'</div><div>ln1=ln1+30</div><div>endwhile</div><div>lt1=lt1+10</div><div>endwhile</div><div>lev=lev+1</div><div>endwhile</div>
</div><div><br></div><div>It is giving output file, but for single grid at single level.<br></div><div><br></div><div>Output file description is as follows...</div><div><br></div><div><div>Type = Gridded</div><div> Xsize = 1 Ysize = 1 Zsize = 1 Tsize = 12 Esize = 1</div>
<div> Number of Variables = 1</div><div> temp 0 t,y,x temp</div></div><div><br></div><div>It looks like there is problem in looping... Could you please help me fix this problem...</div><div><br></div><div>Your help will save a lot of time...</div>
<div><br></div><div>Thank you in advance..</div><div><br></div><div>Sincerely,</div><div><br></div><div>Kishore</div><div><br></div>