[ncl-talk] Error in calculating trend

Ipshita Majhi ipmajhi at alaska.edu
Thu Jul 31 17:36:56 MDT 2014


Hi,

I am interested in the following steps:-
1) I have a 2 D matrix where there are 133 rows and 12 columns called air
2) I want to c alculate trend between years which go row 1880:2012 and
eachcolumn of air.
3) Error is unidentified z


;======================================
; create year
;======================================

  years=ispan(1880,2012,1)

;======================================
; read data; add some meta data
;======================================

  diri   = "~/Documents/PhD_June_2015/Data_AIR/"
  fili   = "air.txt"
  air    =  readAsciiTable(diri+fili, nmos, "float",2)
  air at _FillValue = msg

  air at long_name = "All India Precip"
  air at units     = "mm"
                ;
  opt = True
  opt at fout = "all_india_data"

  write_matrix(air, nmos+"f7.2", opt)
;=========================================
;Doing trend analysis
;=========================================

do nmo=0,11
    z(nmo)=regline(years,air(:,nmo))
end do

;======================================
; create year
;======================================

  years=ispan(1880,2012,1)

;======================================
; read data; add some meta data
;======================================

  diri   = "~/Documents/PhD_June_2015/Data_AIR/"
  fili   = "air.txt"
  air    =  readAsciiTable(diri+fili, nmos, "float",2)
  air at _FillValue = msg

  air at long_name = "All India Precip"
  air at units     = "mm"
                ;
  opt = True
  opt at fout = "all_india_data"

  write_matrix(air, nmos+"f7.2", opt)
;=========================================
;Doing trend analysis
;=========================================

do nmo=0,11
    z(nmo)=regline(years,air(:,nmo))
end do
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140731/2defb625/attachment.html 


More information about the ncl-talk mailing list