Re: regcoef mismatch on argument, can not coerce

From: William Daniel Scheftic <scheftic_at_nyahnyahspammersnyahnyah>
Date: Tue Apr 29 2014 - 16:23:47 MDT

nht_win_xy should be initialized as an "integer"

On 4/29/2014 3:18 PM, burakows@ucar.edu wrote:
> I am trying to follow example 3 for regcoef.ncl:
>
> http://www.ncl.ucar.edu/Document/Functions/Built-in/regcoef.shtml
>
> I have a 4 dimension array nht_win (time, ensemble, lat, lon) for which I
> would like to use regcoef. However, I keep getting an error
>
> fatal:Argument type mismatch on argument (3) of (regcoef) can not coerce
>
> when I try to use regcoef. I have verified that nht_win, nht_win_v, and
> nht_win_xy are the correct dimensions according example 3, so I'm not sure
> to what the error is referring.
>
> The relevant pieces of my code are below.
>
> Thanks,
> Liz.
>
> printVarSummary(nht_win)
>
> Variable: nht_win
> Type: float
> Total Size: 551632896 bytes
> 137908224 values
> Number of Dimensions: 4
> Dimensions and sizes: [time | 86] x [ensemble | 29] x [lat | 192] x [lon |
> 288]
> Coordinates:
> time: [31..31056]
> ensemble: [1..29]
> lat: [-90..90]
> lon: [ 0..358.75]
> Number Of Attributes: 6
> _FillValue : 1e+36
> cell_methods : time: mean
> units : K
> long_name : DJF: 2m air temperature
> missing_value : 1e+36
> NMO : 0
>
>
> ;---Calculate the linear regression on seasonal temps
> dimx = dimsizes(nht_win)
> ntim = dimx(0)
> print(ntim)
> nens = dimx(1)
> nlat = dimx(2)
> nlon = dimx(3)
> x = ispan(1,ntim,1)
> print(x)
> print(dimx)
> nht_win_v = new((/nens,nlat,nlon/),"float")
> nht_win_xy = new((/nens,nlat,nlon/),"float")
> nht_rc =
> regcoef(x,nht_win(ensemble|:,lat|:,lon|:,time|:),nht_win_v,nht_win_xy)
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Apr 29 16:24:41 2014

This archive was generated by hypermail 2.1.8 : Sun May 04 2014 - 12:38:56 MDT