Thie atot function (in GrADS version 2.0.2+) duplicates the summing capability of asum but adds the latitude-weighting feature of aave. The syntax is:
atot(expr, xdim1, xdim2, ydim1, ydim2)
Please see the reference page for asum for details on the command syntax and usage notes.
An instructive sanity check is to calculate the total area over globe on any grid of data that has a constant value of 1 and no missing values:
ga-> d atot(const(temp,1,-a),global)
Result value = 12.5664
The answer we get is 4*pi, and the unit of the result is steradians.
atot result by the square of the radius of the Earth in km:
ga-> d atot(sic/100,lon=0,lon=360,lat=40,lat=90)*6371*6371*1e-6
Result value = 11.289