<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div class="">Following up on the loop I created, when I tried to add some criteria based on the slope of the linear trend and the regression coefficients in order to save them to a new array I got the error:
</div>
<div class=""><br class="">
</div>
<div class=""><i class="">fatal:divide: Division by 0, Can't continue<br class="">
fatal:Div: operator failed, can't continue</i></div>
<div class=""><br class="">
</div>
<div class="">I want to store the calculated value only when it meets one of the following criteria.</div>
<div class="">Any ideas on how to improve the syntax? Or ways to bypass the problem?</div>
<div class=""><br class="">
</div>
<div class="">I’ve read on the NCL website in the lazy evaluation section that: &quot;If the left operand is an array, you cannot depend on a left-hand side test to guard against possible error conditions resulting from evaluating an expression on the right side.
 For example, you cannot avoid&nbsp;division by 0 and the consequences of an error result…”</div>
<div class=""><br class="">
</div>
<div class="">The snippet of the code is:</div>
<div class=""><br class="">
</div>
<div class="">
<div class=""><i class="">finarr_nies = new((/22,22,1/),typeof(value_test))</i></div>
<div class=""><i class="">finarr_nies!0 = &quot;startyear&quot;</i></div>
<div class=""><i class="">finarr_nies&amp;startyear = ispan(1980,2001,1)</i></div>
<div class=""><i class="">finarr_nies!1 = &quot;endyear&quot;</i></div>
<div class=""><i class="">finarr_nies&amp;endyear = ispan(1989,2010,1)</i></div>
</div>
<div class=""><i class=""><br class="">
</i></div>
<div class=""><i class="">do i=1980,2001,1<br class="">
&nbsp; &nbsp;do j=1989,2010,1<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; ntimes3 &nbsp; &nbsp; &nbsp;= &nbsp;ispan(i,j,1)<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; start_date &nbsp; = i<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; end_date &nbsp; &nbsp;= j<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; test_rc_nies = regline_stats(ntimes3,value_test_nies({i:j}))</i></div>
<div class=""><i class="">&nbsp;if (j-i .ge. 9) then<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; finarr_nies({i},{j},0) = where(test_rc_nies@b(1) .gt. 0 .and. test_rc_nies@b95(0) .gt. 0 , finarr_nies({i},{j},0), value_test@_FillValue )<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; else&nbsp;<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; finarr_nies({i},{j},0) = where(test_rc_nies@b(1) .lt. 0 .and. test_rc_nies@b95(1) .lt. 0 , finarr_nies({i},{j},0), value_test@_FillValue )&nbsp;<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; end if<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; delete(ntimes3)<br class="">
&nbsp; &nbsp; end do<br class="">
end do</i></div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
Cheers,
<div class="">Andreas<br class="">
<div>
<blockquote type="cite" class="">
<div class="">On 6 Jun 2017, at 13:22, Andreas Chrysanthou &lt;<a href="mailto:eeac@leeds.ac.uk" class="">eeac@leeds.ac.uk</a>&gt; wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div class="">
<div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div class="">I really appreciate your help Adam and Dennis.</div>
<div class=""><br class="">
</div>
<div class="">I could manage to extract the one value I wanted from the slope and the regression coefficients, pass it on to the new array outside of the loop and improved the code by writing the loop with variables instead of constants.</div>
<div class=""><br class="">
</div>
<div class="">Thanks so much.</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""></div>
</div>
</div>
</div>
</div>
</div>
</div>
<br class="">
<div class="">
<blockquote type="cite" class="">
<div class="">On 6 Jun 2017, at 01:29, Dennis Shea &lt;<a href="mailto:shea@ucar.edu" class="">shea@ucar.edu</a>&gt; wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">
<div class="">
<div class="">I am not sure what is meant by: &quot;There was one not insignificant thing I didn’t mention&quot;<br class="">
<br class="">
---<br class="">
</div>
As you note:<br class="">
<br class="">
&quot;the regline_stats function for the b calculates &nbsp;both the b(0) &#43;b(1*)x of the linear regression, while the b95 calculates both the 2.5% and 97.5% regression coefficient confidence intervals. So when it tries to save to that cell, there are two values for the
 @b and @b95.&quot;<br class="">
<br class="">
</div>
Change: <br class="">
<div class="">
<div class="">
<div class=""><font size="3" face="Calibri, Arial, Helvetica, sans-serif" class="">&nbsp; &nbsp; &nbsp; &nbsp; trend_slope=test_rc@b*10 &nbsp;; prints slope of the linear trend for the selected range of years</font></div>
<div class=""><font size="3" face="Calibri, Arial, Helvetica, sans-serif" class="">&nbsp; &nbsp; &nbsp; &nbsp; reg_coeff=test_rc@b95 &nbsp; &nbsp; &nbsp; &nbsp; ; prints 2.5% and 97.5% regression coefficient confidence intervals
<br class="">
<br class="">
</font></div>
<div class=""><font size="3" face="Calibri, Arial, Helvetica, sans-serif" class="">To extract only one value<br class="">
</font></div>
<div class=""><font size="3" face="Calibri, Arial, Helvetica, sans-serif" class="">&nbsp; &nbsp; &nbsp; &nbsp; trend_slope=test_rc@b(1) *10 &nbsp;; prints slope of the linear trend for the selected range of years</font></div>
<font size="3" face="Calibri, Arial, Helvetica, sans-serif" class="">&nbsp; &nbsp; &nbsp; &nbsp; reg_coeff=test_rc@b95(1) &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; ; prints 2.5% and 97.5% regression coefficient confidence intervals
<br class="">
<br class="">
---<br class="">
<br class="">
&quot;</font>4 different columns (start_date, end_date,trend_slope,reg_<wbr class="">coeff)<br class="">
<br class="">
---<br class="">
</div>
<div class="">The following create 4 (well 3) different columns. I may give you an idea how to proceed.
<br class="">
</div>
<div class="">Also, good programming practice is to use variables and not constants.<br class="">
</div>
<div class=""><br class="">
nyrSpan&nbsp;&nbsp; = 10<br class="">
nyrCrit&nbsp;&nbsp; = 10<br class="">
nyrStrt1&nbsp; = 1980<br class="">
nyrStrt2&nbsp; = 2001<br class="">
nyrLast1&nbsp; = nyrStrt1&#43;nyrSpan-1<br class="">
nyrLast2&nbsp; = 2010<br class="">
<br class="">
NTIM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 1000&nbsp;&nbsp;&nbsp; ; arbitrary max possible # elements<br class="">
strtYear&nbsp; = new( NTIM, &quot;integer&quot;)<br class="">
lastYear&nbsp; = new( NTIM, &quot;integer&quot;)<br class="">
trend&nbsp;&nbsp;&nbsp;&nbsp; = new( NTIM, &quot;float&quot;)<br class="">
rc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = new( NTIM, &quot;float&quot;)<br class="">
<br class="">
nt&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = -1<br class="">
do nyrStrt=nyrStrt1,nyrStrt2<br class="">
&nbsp;&nbsp; do nyrLast=nyrLast1,nyrLast2<br class="">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nyrs = nyrLast-nyrStrt&#43;1<br class="">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (nyrs.ge.nyrCrit) then<br class="">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; test_rc = regline_stats(tofloat(ispan(1,nyrSpan,1)),random_normal(-1,1,nyrSpan))<br class="">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nt = nt&#43;1<br class="">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; strtYear(nt) = nyrStrt<br class="">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lastYear(nt) = nyrLast<br class="">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; spanYear&nbsp;&nbsp;&nbsp;&nbsp; = nyrLast-nyrStrt&#43;1<br class="">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rc(nt)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = (/ test_rc /)&nbsp;&nbsp; ; (/.../) no meta data ; same as b(1)<br class="">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;trend(nt)&nbsp;&nbsp;&nbsp; = ?????<br class="">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print(strtYear(nt)&#43;&quot;&nbsp; &quot;&#43;lastYear(nt)&#43;&quot;&nbsp; &quot;&#43;spanYear&#43;&quot;&nbsp; &quot;&#43;rc(nt))<br class="">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end if<br class="">
&nbsp;&nbsp; end do<br class="">
end do<br class="">
<br class="">
&nbsp;print(&quot;=================================================&quot;)<br class="">
&nbsp;ntim = nt&#43;1&nbsp;&nbsp;&nbsp; ; # of elements<br class="">
&nbsp;print(&quot;ntim=&quot;&#43;ntim)<br class="">
<br class="">
</div>
<div class=""><br class="">
</div>
</div>
</div>
<div class="gmail_extra"><br class="">
<div class="gmail_quote">On Mon, Jun 5, 2017 at 11:10 AM, Andreas Chrysanthou <span dir="ltr" class="">
&lt;<a href="mailto:eeac@leeds.ac.uk" target="_blank" class="">eeac@leeds.ac.uk</a>&gt;</span> wrote:<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word" class="">There was one not insignificant thing I didn’t mention.
<div class=""><br class="">
</div>
<div class="">the regline_stats function for the b calculates &nbsp;both the b(0) &#43;b(1*)x of the linear regression, while the b95 calculates both the 2.5% and 97.5% regression coefficient confidence intervals.</div>
<div class="">So when it tries to save to that cell, there are two values for the @b and @b95.&nbsp;</div>
<div class=""><br class="">
</div>
<div class="">That’s why I got the error of : &quot;fatal:Dimension sizes on right hand side of assignment do not match dimension sizes of left hand side&quot;</div>
<div class=""><br class="">
</div>
<div class="">I only want the slope of the liner trend (b(1)) and my criterion if I need to save these values is that the confidence intervals should not be negative (that would probably need to be included in the if loop).&nbsp;</div>
<div class="">But I don’t know how to keep only one value of those pair of calculated stats.</div>
<div class=""><br class="">
</div>
<div class="">Cheers,</div>
<div class="">Andreas</div>
<div class="">
<div class="h5">
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">
<blockquote type="cite" class="">
<div class="">On 5 Jun 2017, at 17:17, Adam Phillips &lt;<a href="mailto:asphilli@ucar.edu" target="_blank" class="">asphilli@ucar.edu</a>&gt; wrote:</div>
<br class="m_-1930109600680038890Apple-interchange-newline">
<div class="">
<div dir="ltr" class=""><font face="arial, helvetica, sans-serif" class="">Hi Andreas,</font>
<div class=""><font face="arial, helvetica, sans-serif" class="">As there are singular values for reg_coef and trend_slope for each start and end time, I think it would be best to simply create a 3D array dimensioned&nbsp;(start_date, end_date,2), with the last
 dimension (0) = trend_slope and (1) representing reg_coeff. If you <i class="">must</i>&nbsp;have a 4-dimensional array then you should create an array that is dimensioned 22 x 22 x 2 x 2, but (:,:,1,0) and (:,:,0,1) will be missing. In the example below I show
 how to create both types of arrays:</font></div>
<div class=""><font face="arial, helvetica, sans-serif" class=""><br class="">
</font></div>
<div class=""><font face="arial, helvetica, sans-serif" class="">finarr = new((/22,22,2/),typeof(value_<wbr class="">test))</font></div>
<div class=""><font face="arial, helvetica, sans-serif" class="">finarr!0 = &quot;startyear&quot;</font></div>
<div class=""><font face="arial, helvetica, sans-serif" class="">finarr&amp;startyear = ispan(1980,2001,1)</font></div>
<div class=""><font face="arial, helvetica, sans-serif" class="">finarr!1 = &quot;endyear&quot;</font></div>
<div class=""><font face="arial, helvetica, sans-serif" class="">finarr&amp;endyear = ispan(1989,2010,1)</font></div>
<div class="">
<div class=""><font face="arial, helvetica, sans-serif" class="">finarrZ = new((/22,22,2,2/),</font><span style="font-family:arial,helvetica,sans-serif" class="">typeof(<wbr class="">value_test))</span></div>
<div class=""><font face="arial, helvetica, sans-serif" class="">finarrZ!0 = &quot;startyear&quot;</font></div>
<div class=""><font face="arial, helvetica, sans-serif" class="">finarrZ&amp;startyear = ispan(1980,2001,1)</font></div>
<div class=""><font face="arial, helvetica, sans-serif" class="">finarrZ!1 = &quot;endyear&quot;</font></div>
<div class=""><font face="arial, helvetica, sans-serif" class="">finarrZ&amp;endyear = ispan(1989,2010,1)</font></div>
<div class=""><font face="arial, helvetica, sans-serif" class=""><br class="">
</font></div>
<div class=""><font face="arial, helvetica, sans-serif" class="">do i=1980,2001,1</font></div>
<div class=""><font face="arial, helvetica, sans-serif" class="">&nbsp; &nbsp;do j=1989,2010,1</font></div>
<div class=""><font face="arial, helvetica, sans-serif" class="">&nbsp; &nbsp; &nbsp; &nbsp; ntimes=ispan(i,j,1)</font></div>
<div class=""><font face="arial, helvetica, sans-serif" class="">&nbsp; &nbsp; &nbsp; &nbsp; if (j-i .ge. 9 ) then</font></div>
<div class=""><font face="arial, helvetica, sans-serif" class="">&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;test_rc=regline_stats(ntimes,<wbr class="">value_test({i:j}))</font></div>
<div class=""><font face="arial, helvetica, sans-serif" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;print(test_rc)</font></div>
<div class=""><font face="arial, helvetica, sans-serif" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;start_date=i</font></div>
<div class=""><font face="arial, helvetica, sans-serif" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end_date=j</font></div>
<div class=""><font face="arial, helvetica, sans-serif" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;finarr({i},{j},0) = test_rc@b*10 &nbsp;; prints slope of the linear trend for the selected range of years</font></div>
<div class=""><font face="arial, helvetica, sans-serif" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;finarr({i},{j},1)&nbsp;= test_rc@b95 &nbsp; &nbsp; &nbsp; &nbsp; ; prints 2.5% and 97.5% regression coefficient confidence intervals&nbsp;</font></div>
<div class=""><font face="arial, helvetica, sans-serif" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;finarrZ(</font><span style="font-family:arial,helvetica,sans-serif" class="">{i},{j},0,0) = test_rc@b*10</span><span style="font-family:arial,helvetica,sans-serif" class="">&nbsp;</span></div>
<div class=""><span style="font-family:arial,helvetica,sans-serif" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</span><font face="arial, helvetica, sans-serif" class="">&nbsp;finarrZ(</font><span style="font-family:arial,helvetica,sans-serif" class="">{i},{j},1,1) = &nbsp;</span><span style="font-family:arial,helvetica,sans-serif" class="">test_rc@b95 &nbsp;</span></div>
<div class=""><font face="arial, helvetica, sans-serif" class="">&nbsp; &nbsp; &nbsp; &nbsp;else&nbsp;</font></div>
<div class=""><font face="arial, helvetica, sans-serif" class="">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;print(“this age range has not been selected, since its less than 9 years&quot;)</font></div>
<div class=""><font face="arial, helvetica, sans-serif" class="">&nbsp; &nbsp; &nbsp; &nbsp;end if&nbsp;</font></div>
<div class=""><font face="arial, helvetica, sans-serif" class="">&nbsp; &nbsp; &nbsp; &nbsp;delete(ntimes)</font></div>
<div class=""><font face="arial, helvetica, sans-serif" class="">&nbsp; &nbsp;end do</font></div>
<div class=""><font face="arial, helvetica, sans-serif" class="">end do&nbsp;</font></div>
</div>
<div class=""><br class="">
</div>
<div class="">Hope that helps. If you have any further questions please respond to the ncl-talk email list.</div>
<div class="">Adam</div>
<div class=""><br class="">
</div>
</div>
<div class="gmail_extra"><br class="">
<div class="gmail_quote">On Mon, Jun 5, 2017 at 9:48 AM, Andreas Chrysanthou <span dir="ltr" class="">
&lt;<a href="mailto:eeac@leeds.ac.uk" target="_blank" class="">eeac@leeds.ac.uk</a>&gt;</span> wrote:<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word" class="">
<div id="m_-1930109600680038890m_5767769911056133050divtagdefaultwrapper" dir="ltr" class="">
<p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt" class="">
Hi NCL users,</p>
<p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt" class="">
<br class="">
</p>
<p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt" class="">
I created a loop for calculating a linear trend sensitivity for different start and end dates.&nbsp;</p>
<p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt" class="">
My timeseries span over 1980-2010 and I want to calculate the linear trend of the timeseries for when the start - end date are more than &gt;= 9years.
<br class="">
</p>
<p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt" class="">
(1980-1989, 1980-1990, 1980-1991,..., 1980-2010</p>
<p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt" class="">
1981-1990, 1981-1991, ..., 1981-2010</p>
<p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt" class="">
...</p>
<p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt" class="">
...</p>
<p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt" class="">
...</p>
<p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt" class="">
2000-2009, 2001-2010<br class="">
</p>
<p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt" class="">
2001-2010)</p>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt" class="">
I’ve created the loops that calculate those values but I need to save them in an array as 4 different columns (start_date, end_date,trend_slope,reg_coeff<wbr class="">)</div>
<div style="margin-top:0px;margin-bottom:0px;font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt" class="">
<span style="font-size:12pt" class="">My aim is to plot those as a a contour box plot with x axis the start date and y axis the end date, and the calculated (i’m gonna filter out those values with some criteria) trend values based on a colormap.</span></div>
</div>
<div style="margin-top:0px;margin-bottom:0px;font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt" class="">
<span style="font-size:12pt" class=""><br class="">
</span></div>
<div style="margin-top:0px;margin-bottom:0px" class=""><font size="3" face="Calibri, Arial, Helvetica, sans-serif" class="">Can you help me in&nbsp;order to save the values to that new array so I can plot it?</font></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt" class="">
<br class="">
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt" class="">
A snippet of the code follows:</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt" class="">
<br class="">
</div>
<div class="">
<div class=""><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:inherit" class="">do i=1980,2001,1</span></div>
<div class=""><font size="3" face="Calibri, Arial, Helvetica, sans-serif" class="">&nbsp; &nbsp;</font><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:inherit" class="">do j=1989,2010,1</span></div>
<div class=""><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:inherit" class="">&nbsp; &nbsp; &nbsp; &nbsp; ntimes=ispan(i,j,1)</span></div>
<div class=""><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:inherit" class="">if (j-i .ge. 9 ) then</span></div>
<div class=""><font size="3" face="Calibri, Arial, Helvetica, sans-serif" class="">&nbsp;
</font><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:inherit" class="">&nbsp; &nbsp; &nbsp; test_rc=regline_stats(ntimes,v<wbr class="">alue_test({i:j}))</span></div>
<div class=""><font size="3" face="Calibri, Arial, Helvetica, sans-serif" class="">&nbsp; &nbsp; &nbsp; &nbsp; print(test_rc)</font></div>
<div class=""><font size="3" face="Calibri, Arial, Helvetica, sans-serif" class="">&nbsp; &nbsp; &nbsp; &nbsp; start_date=i</font></div>
<div class=""><font size="3" face="Calibri, Arial, Helvetica, sans-serif" class="">&nbsp; &nbsp; &nbsp; &nbsp; end_date=j</font></div>
<div class=""><font size="3" face="Calibri, Arial, Helvetica, sans-serif" class="">&nbsp; &nbsp; &nbsp; &nbsp; trend_slope=test_rc@b*10 &nbsp;; prints slope of the linear trend for the selected range of years</font></div>
<div class=""><font size="3" face="Calibri, Arial, Helvetica, sans-serif" class="">&nbsp; &nbsp; &nbsp; &nbsp; reg_coeff=test_rc@b95 &nbsp; &nbsp; &nbsp; &nbsp; ; prints 2.5% and 97.5% regression coefficient confidence intervals&nbsp;</font></div>
<div class=""><font size="3" face="Calibri, Arial, Helvetica, sans-serif" class="">else print(“this age range has not been selected, since its less than 9 years&quot;)</font></div>
<div class=""><font size="3" face="Calibri, Arial, Helvetica, sans-serif" class="">&nbsp; &nbsp; end if&nbsp;</font></div>
<div class=""><font size="3" face="Calibri, Arial, Helvetica, sans-serif" class="">&nbsp; &nbsp; &nbsp; delete(ntimes)</font></div>
<div class=""><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:inherit" class="">end do</span></div>
<div class=""><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:inherit" class="">end do&nbsp;</span></div>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt" class="">
<br class="">
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt" class="">
Cheers,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt" class="">
Andreas</div>
<span class="m_-1930109600680038890HOEnZb"><font color="#888888" class="">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt" class="">
<br class="">
</div>
<p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt" class="">
<br class="">
</p>
<p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt" class="">
<br class="">
</p>
<p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt" class="">
<br class="">
</p>
<p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt" class="">
<br class="">
</p>
<p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt" class="">
<br class="">
</p>
<p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt" class="">
<br class="">
</p>
<p style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt" class="">
<br class="">
</p>
<div id="m_-1930109600680038890m_5767769911056133050Signature" style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt" class="">
<div id="m_-1930109600680038890m_5767769911056133050divtagdefaultwrapper" dir="ltr" style="font-size:12pt;font-family:Calibri,Arial,Helvetica,sans-serif" class="">
<font size="1" face="HelveticaNeue-Light" class=""><span style="font-size:13px;font-weight:normal;text-transform:none" class="">
<div class="">
<div style="white-space:normal" class="">
<div style="white-space:normal" class="">
<div style="white-space:normal" class="">
<div style="white-space:normal" class="">
<div class="">Andreas</div>
<br class="">
</div>
</div>
</div>
</div>
</div>
</span></font>
<p class=""><br class="">
</p>
</div>
</div>
</font></span></div>
</div>
<br class="">
______________________________<wbr class="">_________________<br class="">
ncl-talk mailing list<br class="">
<a href="mailto:ncl-talk@ucar.edu" target="_blank" class="">ncl-talk@ucar.edu</a><br class="">
List instructions, subscriber options, unsubscribe:<br class="">
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank" class="">http://mailman.ucar.edu/mailma<wbr class="">n/listinfo/ncl-talk</a><br class="">
<br class="">
</blockquote>
</div>
<br class="">
<br clear="all" class="">
<div class=""><br class="">
</div>
-- <br class="">
<div class="m_-1930109600680038890gmail_signature" data-smartmail="gmail_signature">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div class="">
<div class="">
<div class=""><span class=""><font color="#888888" class="">Adam Phillips <br class="">
</font></span></div>
<span class=""><font color="#888888" class="">Associate Scientist,&nbsp; </font></span><span class=""><font color="#888888" class="">Climate and Global Dynamics Laboratory, NCAR<br class="">
</font></span></div>
</div>
<div class=""><span class=""><font color="#888888" class=""><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank" class="">www.cgd.ucar.edu/staff/<wbr class="">asphilli/</a>&nbsp;&nbsp;
</font></span><span class=""><font color="#888888" class=""><a href="tel:(303)%20497-1726" value="&#43;13034971726" target="_blank" class="">303-497-1726</a>
</font></span></div>
<span class=""><font color="#888888" class=""></font></span>
<div class="">
<div class=""><span class=""><font color="#888888" class=""><br class="">
</font></span>
<div class=""><span class=""><font color="#888888" class=""><a href="http://www.cgd.ucar.edu/staff/asphilli" target="_blank" class=""></a></font></span></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</div>
<br class="">
______________________________<wbr class="">_________________<br class="">
ncl-talk mailing list<br class="">
<a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a><br class="">
List instructions, subscriber options, unsubscribe:<br class="">
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank" class="">http://mailman.ucar.edu/<wbr class="">mailman/listinfo/ncl-talk</a><br class="">
<br class="">
</blockquote>
</div>
<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>