<div dir="ltr"><div><div>The summarty shows <br><br><b>Variable: y<br>Type: float<br>Total Size: 169148736 bytes<br> 42287184 values<br>Number of Dimensions: 3<br>Dimensions and sizes: [time | 13149] x [lat | 67] x [lon | 48]<br>Coordinates: <br> time: [1080..18934200]<br> lat: [ 5.. 38]<br> lon: [68.125..97.5]<br>Number Of Attributes: 7<br> vmin : -1e+15<br> vmax : 1e+15<br> fmissing_value : 1e+15<br> _FillValue : 1e+15<br> units : W m-2<br> long_name : toa_net_downward_shortwave_flux_assuming_clear_sky<br> standard_name : toa_net_downward_shortwave_flux_assuming_clear_sky</b><br><br>Variable: x<br>Type: double<br>Total Size: 105192 bytes<br> 13149 values<br>Number of Dimensions: 1<br>Dimensions and sizes: [time | 13149]<br>Coordinates: <br>Number Of Attributes: 3<br> standard_name : time<br> units : minutes since 1980-01-01 00:30:00<br> calendar : standard<br>fatal:regCoef: The rightmost dimension of x must be equal to the rightmost dimension of y<br>fatal:["Execute.c":8567]:Execute: Error occurred at or near line 37 in file trend.ncl<br><br><br><br></div>And the script is <br><br> <b> tmp = a->SWTNTCLR<br> y = tmp(time|:,lat|:,lon|:) ; reorder variable<br><br> delete(tmp) ; no longer needed<br><br><br>;************************************************<br>; create x and calculate the regression coefficients (slopes, trends) <br>;************************************************<br> x = y&time <br> printVarSummary(y)<br> printVarSummary(x)<br> <br> rc = regCoef(x,y) <br><br><br></b></div><b>So how to set the x (which is time) with y (which is time|lat|lon)<br></b><div><b> </b><br><div><div><br></div></div></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Kunal Bali<br></div><div>Research Scholar <br></div><div>Radio & Atmospheric Science Division <br></div><div>CSIR - National Physical Laboratory<br></div><div>New Delhi - 110012<br></div><div>India<br></div><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 11:38 PM, Dennis Shea <span dir="ltr"><<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.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><div><div><div>I believe ncl-talk has been down his raod with you before. Please look at the error messages and *always* include printVarSummary of the the variables used. Place the <b>**before**</b> the line where the error occurs.<br></div><br></div>printVarSummary(x)<br></div>printVarSummary(y)<br></div>or <br>printVarSummary(y<span class="m_-2949817932421431838gmail-im">(lat|:,lon|:,<wbr>time|:) )<br><br></span><span class=""><span class="m_-2949817932421431838gmail-im">rc = <b>regCoef</b>(x, y(lat|:,lon|:,time|:) )</span><br></span><div><div><div><span class="m_-2949817932421431838gmail-im"> <br>The error message state:</span><span class=""><br><pre><b><span class="m_-2949817932421431838gmail-im">fatal:regCoef: The rightmost dimension of x must be <br></span>equal to the rightmost dimension of y<br><br></b></pre></span><pre>Please look ....<b><br></b></pre><pre>What are the sizes of 'x' and the rightmost dimension of 'y' ?<b><br><br></b></pre><br></div></div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 2, 2017 at 10:45 AM, Kunal Bali <span dir="ltr"><<a href="mailto:kunal.bali9@gmail.com" target="_blank">kunal.bali9@gmail.com</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>I have 6.2.0 NCL version<br><br></div>I tried with <br><span> <br>rc = <b>regCoef</b>(x, y(lat|:,lon|:,time|:) )<br><pre></pre></span><pre>but still getting some error<br><b><span>fatal:regCoef: The rightmost dimension of x must be <br></span>equal to the rightmost dimension of y</b><br><br></pre><br><div><br></div><div class="gmail_extra">regards<span class="m_-2949817932421431838HOEnZb"><font color="#888888"><br clear="all"></font></span></div><div class="gmail_extra"><span class="m_-2949817932421431838HOEnZb"><font color="#888888"><div><div class="m_-2949817932421431838m_-6920874904743519709gmail_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></font></span><div><div class="m_-2949817932421431838h5">
<br><div class="gmail_quote">On Mon, Jan 2, 2017 at 9:24 PM, Dennis Shea <span dir="ltr"><<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.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><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/Docume<wbr>nt/Functions/Built-in/regCoef_<wbr>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/Docume<wbr>nt/Functions/Built-in/regCoef-<wbr>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 = "lat" ; name dimensions
rc!1 = "lon"
rc&lat = y&lat ; assign coordinate values to named dimensions
rc&lon = y&lon
</pre><br><br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_-2949817932421431838m_-6920874904743519709h5">On Mon, Jan 2, 2017 at 3:01 AM, Kunal Bali <span dir="ltr"><<a href="mailto:kunal.bali9@gmail.com" target="_blank">kunal.bali9@gmail.com</a>></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="m_-2949817932421431838m_-6920874904743519709h5"><div dir="ltr"><div><div><div><div>Dear NCL users,<br><br></div>I have the data with time steps > 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'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:["Execute.c":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->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&time ; days since 1850-01-01<br> rc = regCoef(time,ts) <br> <br> rc@long_name = "regression coefficient (trend)"<br> rc@units = ts@units+"/day" <br>; copy_VarCoords(ts(:,:,0), rc) ; copy lat,lon coords<br><br><br>;*****************************<wbr>*******************<br>; plotting parameters <br>;*****************************<wbr>*******************<br> wks = gsn_open_wks("ps" ,"regress") <br> gsn_define_colormap(wks,"ViBlG<wbr>rWhYeOrRe") ; 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 = "RasterFill"<br><br>; res@cnLevelSelectionMode = "ManualLevels" ; 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_-2949817932421431838m_-6920874904743519709m_-4635776282400146547HOEnZb"><font color="#888888"><br clear="all"></font></span></div><span class="m_-2949817932421431838m_-6920874904743519709m_-4635776282400146547HOEnZb"><font color="#888888"><div><div><div><div class="m_-2949817932421431838m_-6920874904743519709m_-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></div></div>
<br>______________________________<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>
</div></div></blockquote></div><br></div>