[ncl-talk] Overwrite rstd in loop with regCoef

Lynch, Cary D cary.lynch at pnnl.gov
Fri Feb 10 14:47:39 MST 2017


NCL-talk,

I am using the function “regCoef” in a do-loop.  X is a 2 dimensional variable of size (/nmon,nyrs/).  Y is a 4 dimensional variable of size (/nmon,nyrs,nlat,nlon/).  The resulting regression coefficient is 3 dimensional of size (/nmon,nlat,nlon/):

; TAS is (/nmon,nyrs,nlat,nlon/)
; NAO is (/nmon,nyrs/)
; nmon = 12; yrs = 30

; reorder TAS
  rTAS = TAS(month|:,lat|:,lon|:,year|:)

  coef = new((/nmon,nlat,nlon/),float)
  do i =0,11
  coef(i,:,:) = regCoef(NAO(i,:),rTAS(i,:,:,:))
  end do


For each “i” I want to archive the rstd (standard error of the estimated regression coefficient), which will be in 1 dimension (nlat* nlon).

Using the the special "$” syntax in the loop, doesn’t work.  Is there some other special syntax I could use?

Thank you
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170210/a25653be/attachment.html 


More information about the ncl-talk mailing list