<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">You need to 'set e 1 last' before all your define statements -- e is fixed by default when you open a file, so none of your defined variables are varying in e, so your ensemble mean is not averaging over all members. <div>--Jennifer<br><div><br><div><div>On Dec 15, 2010, at 6:08 AM, eric delaere wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: 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: 10pt; font-family: Tahoma; ">hello<br>I still don't found a solution to fix this problem.<br>I'm able to make ensembles with some simple parameters (see<span class="Apple-converted-space"> </span><a href="http://users.fulladsl.be/spb4195/gfs.htm)">http://users.fulladsl.be/spb4195/gfs.htm)</a><span class="Apple-converted-space"> </span>but with parameters, derived from formula (like the wind chill), it doesn't work...<br>Anybody?<br><br><hr id="stopSpelling">From:<span class="Apple-converted-space"> </span><a href="mailto:karimhamid2@hotmail.com">karimhamid2@hotmail.com</a><br>To:<span class="Apple-converted-space"> </span><a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>Date: Fri, 10 Dec 2010 14:05:07 +0100<br>Subject: [gradsusr] ensemble windchill<br><br>Hi<br><br>I have problems with printing the ensemble meteogram for the wind chill (with whiskers & bars). No problem to make a ensemble for eg. T850 or so, but to calculate the wind chill, I need to use some formula & also some maskout & const stuff...<br>Therefore , the min, max,..etc aren't correct in the tloop formula...<br><br>Obviously I do something wrong in my script philosophy but what??<br>Thx<br><br>(I use grads 2.0)<br>***********<br>function main( args )<br>'reinit'<br>'sdfopen<span class="Apple-converted-space"> </span><a href="http://nomads.ncep.noaa.gov:9090/dods/gens_bc/gens'datum''mon''day'/gep_all_'run'z'">http://nomads.ncep.noaa.gov:9090/dods/gens_bc/gens'datum''mon''day'/gep_all_'run'z'</a><br><br>* Calculate the ensemble mean<span class="Apple-converted-space"> </span><br>* ---------------------------<br> 'set lon 4'<br> 'set lat 51'<br> 'set t 1 37'<br><br>'define wind = (mag(ugrd10m,vgrd10m))'<br>'define windH = const(const(maskout(wind,wind-1),1),0,-u)'<br>'define windL = const(const(maskout(wind,0.999-wind),1),0,-u)'<br>'define W = wind*2.2369363'<br>'define T = (9/5)*(tmp2m-273.15)+32'<br>'define chillf= 35.74+(0.6215*T)-(35.75*pow(W,0.16))+(0.4275*T*pow(W,0.16))'<br>'define chillC = (chillf-32)*(5/9)'<br>'define chill2 = (windL*(tmp2m-273.15))+(windH*chillC)'<br><br>'define ensmean=ave(chill2,e=1,e=21)'<br><br> 'set cmark 0'<br> 'set vrange -20 10'<br> 'set ylint 5'<br> 'set cstyle 2'<br> 'set ccolor 4'<br> 'set cthick 3'<br> 'display ensmean'<br> <br>* Calculate the variance<br>* ----------------------<br> diffsq = 'pow(chill2-ensmean,2)'<br><br>variance = 'ave('diffsq',e=1,e=21)'<br>'define stddev=sqrt('variance')'<br><br>* Calculate the min/max<br>* ---------------------<br> 'define ensmin=tloop(min(chill2,e=1,e=21))'<br><br> 'set cmark 0'<br> 'set vrange -20 10'<br> 'set ylint 5'<br> 'set cstyle 1'<br> 'set ccolor 4'<br> 'set cthick 3'<br> 'd ensmin'<br><br> 'define ensmax=tloop(max(chill2,e=1,e=21))'<br><br> 'set cmark 0'<br> 'set vrange -20 10'<br> 'set ylint 5'<br> 'set cstyle 1'<br> 'set ccolor 2'<br> 'set cthick 3'<br> 'd ensmax'<br> <br>* Plot the results<br>* ----------------<br> 'set t 1 37'<br> 'set lon 4'<br> 'set lat 51'<br> 'set vrange -20 10'<br> 'set ylint 5'<br><br>* Draw error bars for min/max<br>* ---------------------------<br> 'set gxout errbar'<br> 'set bargap 70'<br> 'set rgb 16 183 183 183'<br> 'set ccolor 16'<br> 'set cthick 3'<br> 'd ensmin;ensmax'<br><br>* Draw bars for +/- standard deviation<br>* ------------------------------------<br> plus = '(ensmean+stddev)'<br> minus = '(ensmean-stddev)'<br><br> 'set gxout bar'<br> 'set bargap 50'<br> 'set baropts filled'<br> 'set rgb 16 183 183 183'<br> 'set ccolor 16'<br> 'd 'minus';'plus<br><br>* Draw line for Ensemble mean<span class="Apple-converted-space"> </span><br>* ---------------------------<br> 'set gxout line'<br> 'set cmark 0'<br> 'set cthick 6'<br> 'set digsiz 0.05'<br> 'set ccolor 2'<br> 'd ensmean'<br><br>'printim c:\model\upload\test\ensemble.png'<br><br>*clear<br>'quit'<br><br>_______________________________________________ gradsusr mailing list<span class="Apple-converted-space"> </span><a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><span class="Apple-converted-space"> </span><a href="http://gradsusr.org/mailman/listinfo/gradsusr">http://gradsusr.org/mailman/listinfo/gradsusr</a><span><ATT00001.txt></span>_______________________________________________<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; "><div style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><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></div></span> </div><br></div></div></body></html>