<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Please have a look at the atot() function &nbsp;-- it was designed for this very purpose. Please see the second example in the doc page at&nbsp;<a href="http://iges.org/grads/gadoc/gradfuncatot.html">http://iges.org/grads/gadoc/gradfuncatot.html</a>. You have to use GrADS v2.0.2.&nbsp;<div>--Jennifer</div><div><br><div><br><div><div>On Apr 23, 2013, at 10:20 AM, Fernanda Casagrande wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div class="hmmessage" style="font-size: 12pt; font-family: Calibri; "><div dir="ltr"><span id="result_box" lang="en"><span class="hps">Dear All</span><span>,</span><br><br><span class="hps">I have a problem</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">with the calculation</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">of the area</span><span><span class="Apple-converted-space">&nbsp;</span>(million km2).</span><br><br><span class="hps">I have a file</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">of</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">sea ice</span><span class="Apple-converted-space">&nbsp;</span><span class="hps atn">(</span><span>ice concentration</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">data from</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">0-100</span><span>%</span><span>)</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">and</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">I need to create</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">a time series</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">with a total</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">extension</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">of</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">sea ice</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">in the</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">arctic</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">and</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">antartica</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">(million</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">km2</span><span>)</span><span>.</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">For this calculation</span><span>,</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">usually</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">consider only</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">areas with</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">ice concentration</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">equal to or</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">above 15</span><span>%,</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">so I used</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">the function</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">maskout</span><span>.</span><br><br><span class="hps">The</span><span>.</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">gs</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">is running</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">but the values</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">​​for the</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">Arctic</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">are wrong</span><span>,</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">can someone help me</span><span>?</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">Some other method to</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">calculate the area</span><span class="Apple-converted-space">&nbsp;</span><span class="hps atn">(</span><span>million</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">km2</span><span>)</span><br><br><span class="hps">these data are from</span><span class="Apple-converted-space">&nbsp;</span><span class="hps">satellite.</span></span><br><br><br>'sdfopen<span class="Apple-converted-space">&nbsp;</span><a href="http://X172.16.9.158.108.11.23.58.nc/" target="_blank">X172.16.9.158.108.11.23.58.nc</a>'<br>*calculate area (million km2)<br>'dx=2*3.1416*6371*cos(lat*3.1416/180)/360.0*cdiff(lon,x)/2 '<br><div>'dy=2*3.1416*6371/360.0*cdiff(<wbr>lat,y)/2'<br>'area=(dx*dy)'&nbsp;<span class="Apple-converted-space">&nbsp;</span><br>'fracao=area*(icec/100)'<br></div><div><br>say 'calcula a area'<br><br>'set lon 0 360'<br>'set lat -90 90'<br>'set t 1 last'<br><br>'define ones = const(const(maskout(icec,icec-<wbr>15),1),0,-u)'<span class="Apple-converted-space">&nbsp;</span><br>'set x 1'<br>'set y 1'<br></div><div><br></div>'define xx=tloop(asum(ones*area,lon=0,lon=360,lat=-90,lat=0))'<br><div>'d xx'<br><br>'ltrend xx a b c'<br>'set ccolor 2'<br>'d a';'d b'<br>trend=subwrd(result,4)<br>&nbsp;say 'trend='trend<br>' d c'<br>rmse=subwrd(result,4)<br>&nbsp;say 'rmse='rmse<br><br>'draw title Antarctic Sea Ice obs incl.'trend' rmse. 'rmse' '<br><br><br>regards<br></div><br><br><br><br><br><font face="Verdana">Fernanda</font></div>_______________________________________________<br>gradsusr mailing list<br><a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br><a href="http://gradsusr.org/mailman/listinfo/gradsusr">http://gradsusr.org/mailman/listinfo/gradsusr</a><br></div></span></blockquote></div><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div>--</div><div>Jennifer M. Adams</div><div>IGES/COLA</div><div>4041 Powder Mill Road, Suite 302</div><div>Calverton, MD 20705</div><div><a href="mailto:jma@cola.iges.org">jma@cola.iges.org</a></div><div><br class="khtml-block-placeholder"></div><br class="Apple-interchange-newline"></span></span></span>
</div>
<br></div></div></body></html>