Removes the least squares linear trend and estimates of the linear trend at all grid points.
Note: This function is only available in version 4.1.1 of NCL. If your site is licensed for version 4.1, then you can get version 4.1.1 for free. To get version 4.1.1 of NCAR Graphics software, please contact your site representative. If you don't know who your site representative is, then send email to ncarginf@ucar.edu or call (303) 497-1201.
function dtrend( x : float, return_slope : logical )
xnew = dtrend (x,False)will return an array xnew(lat,lon,time). xnew will contain the detrended data. The mean is also removed.
xnew = dtrend (x,True)will return an array xnew(lat,lon,time). xnew will contain the detrended data and the slopes as an attribute called slope containing nlat*mlon elements. Thus, if x contained temperatures [degrees K] and time was in months then the units of xnew@slope would be [K/month]. Since attributes can not be returned as two-dimensional arrays, the user should use the NCL function "onedtond" to create a two-dimensional array if it is desired for something like plotting purposes:
slope2D = onedtond(xnew@slope, (/nlat,mlon/) ) delete (xnew@slope) slope2D = slope2D*120 ; would give [K/decade]
xnew = dtrend (x(lat|:,lon|:,time|:), False)xnew will have dimension order (lat,lon,time).
NG4.1 Home, Index, Examples, Glossary, Feedback, Ref Contents, Ref WhereAmI?