<div dir="ltr"><div>[1] Maybe<br></div><div><br>  coef = new((/nmon,nlat,nlon/),float)<br></div>  rstd  = new((/nmon,nlat,nlon/),float)<div><div>  do i =0,11</div>
<div>       coef(i,:,:) = regCoef(NAO(i,:),rTAS(i,:,:,:)<wbr>)<br></div><div>       rstd(i,:,:)   = onedtond(coef@rstd,(/nlat,mlon/))   ; make 2D<br></div>
<div>  end do</div><br><br>[2] If you have NCL 6.2.1 (9/2014), I&#39;d recommend looking at <br>    <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/regCoef_n.shtml">http://www.ncl.ucar.edu/Document/Functions/Built-in/regCoef_n.shtml</a><br><br><div>; TAS is (/nmon,nyrs,nlat,nlon/)</div>
<div>; NAO is (/nmon,nyrs/)<br><br>  coef = new((/nmon,nlat,nlon/),float)<br>  rstd  = new((/nmon,nlat,nlon/),float)<div>  do i =0,11</div>
<div>       coef(i,:,:) = regCoef_n(NAO(i,:), TAS(i,:,:,:)<wbr>, 0, 0)<br>       rstd(i,:,:)   = onedtond(coef@rstd,(/nlat,mlon/))</div>
<div>  end do</div><br></div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 10, 2017 at 2:47 PM, Lynch, Cary D <span dir="ltr">&lt;<a href="mailto:cary.lynch@pnnl.gov" target="_blank">cary.lynch@pnnl.gov</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
<div>NCL-talk,</div>
<div><br>
</div>
<div>I am using the function “regCoef” in a do-loop.  X is a 2 dimensional variable of size (/nmon,nyrs/).  Y is a 4 dimensional variable of size (/nmon,nyrs,nlat,nlon/).  The resulting regression coefficient is 3 dimensional of size (/nmon,nlat,nlon/):</div>
<div><br>
</div>
<div>
<div>; TAS is (/nmon,nyrs,nlat,nlon/)</div>
<div>; NAO is (/nmon,nyrs/)</div>
<div>; nmon = 12; yrs = 30</div>
<div><br>
</div>
<div>; reorder TAS</div>
<div>  rTAS = TAS(month|:,lat|:,lon|:,year|:<wbr>)</div>
<div><br>
</div>
<div>  coef = new((/nmon,nlat,nlon/),float)</div>
<div>  do i =0,11</div>
<div>  coef(i,:,:) = regCoef(NAO(i,:),rTAS(i,:,:,:)<wbr>)</div>
<div>  end do</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div>For each “i” I want to archive the <em>rstd</em> (standard error of the estimated regression coefficient), which will be in 1 dimension (nlat* nlon).</div>
<br>
<div>Using the <span class="m_7463815961761850637quotelev1">the special &quot;$” syntax in the loop, doesn’t work.  Is there some other special syntax I could use?</span></div>
<div><span class="m_7463815961761850637quotelev1"><br>
</span></div>
<div><span class="m_7463815961761850637quotelev1">Thank you</span></div>
</div>

<br>______________________________<wbr>_________________<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/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>