<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div>You can look at the code for the {clm,std}MonTLL functions. They are located in the contributed.ncl <br><br></div>%> less $NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl<br><br></div>These were (I think) the 1st application functions introduced to NCL (~1998 or so).<br><br></div><div>Perhaps, I misunderstand <br></div><div>===<br></div>[1] Maybe square the results from stdMonTLL ===> variances <== add meta data<br></div>[2] Compute average of variances: <i>dim_avg_n_Wrap(monVar,(/1,2/))</i>; then take the square root<br><i><br>==<br></i></div>Maybe the following<i>, ...</i> extract the<i> </i>code for function <br><br>function calculate_monthly_values (x:numeric, arith:string, nDim[1]:integer, opt[1]:logical)<br><br><br></div>[SNIP]<br> if (.not.(arith.eq."ave" .or. arith.eq."avg" .or. arith.eq."sum" \<br> .or. arith.eq."min" .or. arith.eq."max") ) then<br> print("calculate_monthly_values: unrecognizezed 'arith' argument="+arith)<br> exit<br> end if<br></div>[SNIP]<br><br></div>add, (s) "var" and/or "stddev"<br><br> if (.not.(arith.eq."ave" .or. arith.eq."avg" .or. arith.eq."sum" \<br> .or. arith.eq."min" .or. arith.eq."max" \<br> or. arith.eq."var" .or. arith.eq."stddev") ) then<br><br><br></div>then, later, add<br><br> if (arith.eq."var") then<br> if (nit.gt.1) then ; work around for NCL's dimension reduction<br> xStat(nt) = dim_variance_n( x(it), nDim)<br> else ; one 'it'<br> xStat(nt) = 0.0 ; variance for one observation<br> end if<br> end if<br><br></div>and/or<br><br> if (arith.eq."stddev") then<br> if (nit.gt.1) then ; work around for NCL's dimension reduction<br> xStat(nt) = dim_stddev_n( x(it), nDim)<br> else ; one 'it'<br> xStat(nt) = 0.0 ; std dev for one observation<br> end if<br> end if<br><br>===<br><br></div><div>HTH<br></div><div><br><div><br><br><br><div><br><br><div><div><div><i><br><br></i><div><div><div><div><div><div><div><br><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 30, 2016 at 10:36 AM, Samar Min Allah <span dir="ltr"><<a href="mailto:minallah@umich.edu" target="_blank">minallah@umich.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="color:rgb(7,55,99)"><br></div><div class="gmail_default" style="color:rgb(7,55,99)">Hi,<br><br></div><div class="gmail_default" style="color:rgb(7,55,99)">I have daily data (time, lat, lon) that I am first converting to monthly using <i>calculate_monthly_values </i>and then finding monthly climatology from <i>clmMonTLL </i>and std from <i>stdMonTLL.<br><br></i></div><div class="gmail_default" style="color:rgb(7,55,99)">The daily data is over a sub-basin for which I take an average later using <i>dim_avg_n_Wrap(monclim,(/1,2/)) </i>over all lats and lons.<br></div><br><div class="gmail_default" style="color:rgb(7,55,99)">This works for the mean climatology but I cannot take a mean for the standard deviation this way so is there a function or example that can compute composite standard deviation.</div><br><div class="gmail_default" style="color:rgb(7,55,99)">Alternatively, is there a function clmMon and stdMon that can work on 1 dimension data (does not require lat lon).</div><div class="gmail_default" style="color:rgb(7,55,99)"><br><br clear="all"></div><div><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><div><div><div><br><font size="2"><span style="font-family:courier new,monospace"><span style="color:rgb(153,153,153)">--<br></span></span></font></div><font size="2"><span style="font-family:courier new,monospace"><span style="color:rgb(153,153,153)">Samar</span></span></font><br><div><div><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>