Sophie

Sophie

distrib > Fedora > 18 > i386 > by-pkgid > dcaf9bd555d1ce386641f56c6523d3ed > files > 241

grads-2.0.2-1.fc18.i686.rpm

<!--Copyright (C) 1988-2005 by the Institute of Global Environment and Society (IGES). See file COPYRIGHT for more information.-->

<html>
<title>GrADS Function: asum</title>
<style type="text/css">
.red {
	color: #900;
}
body {
	background-color: #e0f0ff;
}
</style>
<body text="#000000">

<H2><b>asum()</b></H2>
<p>
This function takes a sum over an X-Y region. The syntax is:
<p>
<code>asum(<i>expr, xdim1, xdim2, ydim1, ydim2</i>)</code>

<p>
where:
<ul>
<code><i>expr</i>&nbsp;&nbsp;&nbsp;&nbsp;</code>- any valid GrADS expression <br>
<code><i>xdim1</i>&nbsp;&nbsp;&nbsp;</code>- starting X dimension expression <br>
<code><i>xdim2</i>&nbsp;&nbsp;&nbsp;</code>- ending X dimension expression <br>
<code><i>ydim1</i>&nbsp;&nbsp;&nbsp;</code>- starting Y dimension expression <br>
<code><i>ydim2</i>&nbsp;&nbsp;&nbsp;</code>- ending Y dimension expression <br>
</ul>
<p>
For global summing, a shorthand may be used:

<ul>
<code>asum(<i>expr</i>, global)</code> or <br>
<code>asum(<i>expr</i>, g)</code>
</ul>
is the same as
<ul>
<code>asum(<i>expr</i>, lon=0, lon=360, lat=-90, lat=90)</code>
</ul> 

<p>
<H3>Usage Notes</H3>
<ol>
<li>The <code>asum</code> function always does its average to the
exact boundaries specified, in world coordinates. If the boundaries
specified via the dimension expressions do not fall on grid box
boundaries, then the  values in the boundary grid boxes are weighted in the sum according to the length of the partial grid box in world coordinates. <br>
  <br>
<li>If grid coordinates are used in the dimensions expressions,
then they are converted to world coordinates to determine the exact boundary values. This conversion is done using the scaling of the default
file. Note that the conversion is done using the outside grid
box boundary, rather than the grid box center. For example: <p><code>asum(expr,x=1,x=72,y=1,y=46)</code>
<p>
  Here the boundary would be determined by using the X grid values ranging from 0.5 to 
  72.5 and Y grid values ranging from 0.5 to 46.5. These four grid boundary values would be converted to world coordinates using the scaling information from the default file. If
  we assume that <code>x=1</code> is 0 degrees longitude and
  <code>x=72</code> is 355 degrees longitude, then the averaging
  boundary would be -2.5 to 357.5 degrees, which would cover the
  earth. In the Y dimension, when the boundary is beyond the pole, the
  <code>asum</code> function recognizes this and weights
  appropriately. To calculate a sum without any weighting of partial grid boxes at the domain boundaries, use the
  <code><a href="gradfuncasumg.html">asumg</a></code> function.
  
  
<li>There is no latitude-weighting of grid box values in <code>asum</code>. The <code><a href="gradfuncatot.html">atot</a></code> function (in <span class="red">GrADS version 2.0.2+</span>) will calculate a sum over an area and weight the grid box values according to the difference in the sine of the latitude at the northern and southern boundaries of each grid box. 
</ol>
<p>


 
</body>
</html>