<div dir="ltr"><div>I have 6.2.0 NCL version<br><br></div>I tried with <br>  <br>rc   = <b>regCoef</b>(x, y(lat|:,lon|:,time|:) )<br><pre></pre><pre>but still getting some error<br><b>fatal:regCoef: The rightmost dimension of x must be <br>equal to the rightmost dimension of y</b><br><br></pre><br><div><br></div><div class="gmail_extra">regards<br clear="all"></div><div class="gmail_extra"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Kunal Bali<br></div><br><div><br></div><div><br></div><div><br></div><div><p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;border-collapse:collapse;font-family:Tahoma,Verdana;font-size:12px"><font color="#1F497D"><br></font></p></div></div></div></div></div></div>
<br><div class="gmail_quote">On Mon, Jan 2, 2017 at 9:24 PM, Dennis Shea <span dir="ltr">&lt;<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>&gt;</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><div><div><div>I would recommend:<br></div><div><br><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/regCoef_n.shtml" target="_blank">http://www.ncl.ucar.edu/<wbr>Document/Functions/Built-in/<wbr>regCoef_n.shtml</a><br><br></div><div>This is the most recent version. As noted in the documentation:<br>Note: with NCL V6.2.1 or later, you can use <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/regCoef_n.shtml" target="_blank"><b>regCoef_n</b></a>
to avoid having to reorder the arrays first:

<pre>   rc   = <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/regCoef_n.shtml" target="_blank"><b>regCoef_n</b></a>(x, y, 0, 0)
</pre>===<br></div><div><br></div>****PLease See: Example 2***<br><br><pre>rc   = <b>regCoef_n</b>(time, ts, 0, 0) ; <b>rc(nlat,mlon)</b></pre>copy_VarCoords(ts(0,:,),rc)<br></div>printVarSummary(rc)<br><br>=====<br></div>Using the original regCoef rather than regCoef_n may require the arrays to be reordered.<br><br><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/regCoef-1.shtml" target="_blank">http://www.ncl.ucar.edu/<wbr>Document/Functions/Built-in/<wbr>regCoef-1.shtml</a><br><br></div>****See: Examples 2 and 3***<br><br><pre>   rc   = <b>regCoef</b>(x, y(lat|:,lon|:,time|:) )    
</pre>If <i>y</i> has <a href="http://www.ncl.ucar.edu/Document/Language/cv.shtml" target="_blank">coordinate variables</a>
these may readily be assigned via NCL syntax: 
<pre>   rc!0   = &quot;lat&quot;    ; name dimensions
   rc!1   = &quot;lon&quot;
   rc&amp;lat = y&amp;lat    ; assign coordinate values to named dimensions
   rc&amp;lon = y&amp;lon
</pre><br><br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Mon, Jan 2, 2017 at 3:01 AM, Kunal Bali <span dir="ltr">&lt;<a href="mailto:kunal.bali9@gmail.com" target="_blank">kunal.bali9@gmail.com</a>&gt;</span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div><div><div><div>Dear NCL users,<br><br></div>I have the data with time steps &gt; 1000<br><br></div>I want to plot the spatial map of trend analysis of the given dataset. <br></div>So I tried the script given below for getting the desired plot but couldn&#39;t successed.<br><br></div><div>the given error is <br><b>fatal:regCoef: The rightmost dimension of x must be at least 2<br>fatal:[&quot;Execute.c&quot;:8567]:Execu<wbr>te: Error occurred at or near line 32 in file trend.ncl<br></b><br> <br></div><div>Could anyone please help me out<br></div><br><br>  <br>   tmp  = a-&gt;SWTNTCLR<br>   ts   = tmp(time|:,lat|:,lon|:)       <wbr>        ; reorder variable<br><br>   delete(tmp)                   <wbr>               ; no longer needed<br><br>;*****************************<wbr>*******************<br>; create x and calculate the regression coefficients (slopes, trends)    <br>;*****************************<wbr>*******************<br>   time         = ts&amp;time                       ; days since 1850-01-01<br>   rc           = regCoef(time,ts)             <br>   <br>   rc@long_name = &quot;regression coefficient (trend)&quot;<br>   rc@units     = ts@units+&quot;/day&quot;    <br>;   copy_VarCoords(ts(:,:,0), rc)                ; copy lat,lon coords<br><br><br>;*****************************<wbr>*******************<br>; plotting parameters <br>;*****************************<wbr>*******************<br>   wks  = gsn_open_wks(&quot;ps&quot; ,&quot;regress&quot;) <br>   gsn_define_colormap(wks,&quot;ViBlG<wbr>rWhYeOrRe&quot;)    ; choose colormap<br>   <br>   res                       = True     <br>   res@gsnMaximize           = True             ; make large<br><br>   res@cnFillOn              = True             ; turn on color<br>   res@cnLinesOn             = False            ; turn off contour lines<br>   res@cnLineLabelsOn        = False            ; turn off contour line labels<br> ;;res@cnFillMode            = &quot;RasterFill&quot;<br><br>;   res@cnLevelSelectionMode  = &quot;ManualLevels&quot;   ; set manual contour levels<br>;   res@cnMinLevelValF        =  -1.00           ; set min contour level<br>;   res@cnMaxLevelValF        =   1.00           ; set max contour level<br>   res@cnLevelSpacingF       =   0.10           ; set contour interval<br>;<br>   res@mpFillOn              = False            ; turn off default background gray<br> ;  res@mpCenterLonF          = 210<br>   <br>   res@tiMainString          = fili<br>   plot = gsn_csm_contour_map_ce(wks,rc,<wbr>res)    <br>  end<br><br><br>  <br><div><div><div><div><br><br><br><br><br></div><div>Regards<span class="m_-4635776282400146547HOEnZb"><font color="#888888"><br clear="all"></font></span></div><span class="m_-4635776282400146547HOEnZb"><font color="#888888"><div><div><div><div class="m_-4635776282400146547m_6420530442664993331gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Kunal Bali<br></div><br><div><br></div><div><br></div><div><p style="margin:0px;border-collapse:collapse;font-family:tahoma,verdana;font-size:12px"><font color="#1F497D"><br></font></p></div></div></div></div></div></div>
</div></div></font></span></div></div></div></div>
<br></div></div>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">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/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div></div>