<span style="color: rgb(0, 0, 0); font-family: Tahoma,sans-serif; font-size:
13px;">Hi everybody<br>
<br>
I'd done some calculations using both GRADS and Fortran, and I realised
that the spatial average using GRADS (aave) differs by a ratio of
approximately 0.787 from the spatial average using Fortran. By this I
mean that if I multiply the Fortran's values by 0.787, they ALWAYS
match with the GRADS' values (with small errors).<br>
<br>
Can anyone explain the reason for this "magic number" (0.787)?<br>
<br>
A part of the program using GRADS and Fortran respectively are given bellow.
<br>
<br>
I would appreciate any kind of commentaries.<br>
<br>
Sandra Saad<br>
<br>
<br>
### Spatial Average using GRADS ########<br>
<br>
set t 1 last<br>
d aave(h,x=26,x=35,y=43,y=50)<br>
<br>
<br>
###&nbsp; Spatial Average using Fortran (90) ########<br>
&nbsp;<br>
&nbsp;do i=1,it<br>
&nbsp; do ny=43,50<br>
&nbsp;&nbsp; do nx=26,35<br>
&nbsp;&nbsp;&nbsp; mh(i)=mh(i)+h(i,nx,ny)<br>
&nbsp;&nbsp; enddo<br>
&nbsp; enddo<br>
&nbsp;mh(i)=mh(i)/((35-26)*(50-43))<br>
&nbsp;enddo<br>
&nbsp;<br>
&nbsp;do i=1,it <br>
&nbsp; write(3,*)i,mh(i)<br>
&nbsp;enddo<br>
<br>
</span>