<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title></title><style type="text/css">.felamimail-body-blockquote {margin: 5px 10px 0 3px;padding-left: 10px;border-left: 2px solid #000088;} </style></head><body><br>Hello<br> Using the given code, i attach the 2 pltos i get from doing trend analysis on T2m and getting the significance. IT seems really small and i am not convinced these are the right values.<br>Could someone please have a look at the script below which i used and confirm i use the right scripting for getting getting significance of and linear trends for plotting.<br>Much appreciated<br><br>Here is the part of my code that works:<br><br>yrStrt = 2020<br>yrLast = 2099<br>;===================================================================<br>f= addfile("T2M_45.nc", "r") ;<br>time = f->time<br>YYYY = cd_calendar(time,-1)/100 ; entire file<br>iYYYY = ind(YYYY.ge.yrStrt .and. YYYY.le.yrLast)<br>T2 = f->TREFHT(iYYYY,:,:)<br>printVarSummary(T2) ; (time, lat,lon)<br>T2=T2-273.15<br>T2@_FillValue = -9.96921e+36 <br>T2@units= "degC"<br>printVarSummary(T2) ; (time, lat,lon)<br><br>;=======================================================================<br>;Very important to give the year dimension its cordinates<br>;=======================================================================<br> yyyymm = cd_calendar(T2&time, -1)<br> yyyy = yyyymm/100<br><br> dimx = dimsizes(T2)<br> ntim = dimx(0) ; all years and months<br> nlat = dimx(1)<br> mlon = dimx(2)<br><br> year = ispan(yyyy(0), yyyy(ntim-1), 1)<br> nyrs = dimsizes(year)<br><br>;=========================================================================<br> T2mm = month_to_annual(T2, 1) <br> T2mm&year = year<br> printVarSummary(T2mm) <br>;=============================================================<br>; Calculate the regression coefficients (slopes) <br>;=============================================================<br> <br>tarr1 = T2mm(lat|:,lon|:,year|:) <br> printVarSummary(tarr1) <br> ; (time, lat,lon) <br>tttt1 = dtrend_msg(ispan(0,dimsizes(tarr1&year)-1,1),tarr1,True,True) <br> printVarSummary(tttt1) <br>finobs1 = tarr1(:,:,0) <br>finobs_rtt1 = finobs1 <br>finobs1 = (/ onedtond(tttt1@slope, (/dimsizes(tarr1&lat),dimsizes(tarr1&lon)/) ) /) ; reform the slope attribute to 2D (lat x lon) array. This will be used for plotting the trend<br> printVarSummary(finobs1) <br><br>tval1 = tarr1(:,:,0) <br>df1 = tarr1(:,:,0) <br>rc1 = regcoef(ispan(0,dimsizes(tarr1&year)-1,1),tarr1,tval1,df1) ; tval and df are filled in by regcoef<br><br>df1 = equiv_sample_size(tarr1,0.05,0) ; Optional! over rule df returned from regcoef. <br><br>df1 = df1-2 ;regcoef/equiv_sample_size return N, need N-2<br>beta_b1 = tval1<br>beta_b1 = 0.5<br><br>printVarSummary(df1) ;lat,lon <br>printVarSummary(tval1) ;lat,lon <br><br> finobs_rtt1 = (/ (1.-betainc(df1/(df1+tval1^2), df1/2.0, beta_b1))*100. /) ; significance of trends expressed from 0 to 100%<br>printVarSummary(finobs_rtt1) <br>;print(finobs_rtt1) ; (time, lat,lon)<br></body></html>