[ncl-talk] Regression produces fatal error: regCoef_n: The input array y must have as many or more dimensions than x

Adam Phillips asphilli at ucar.edu
Fri Sep 1 08:03:33 MDT 2017


Hi Andreas,
I think the error message is trying to tell you that you should switch your
two input arrays. (The 2nd input array must have as many or more dimensions
as the 1st one.) If switching the two arrays doesn't help let ncl-talk
know..
Adam

On Fri, Sep 1, 2017 at 7:06 AM, Andreas Chrysanthou <eeac at leeds.ac.uk>
wrote:

> Hi NCL users,
>
> I want to calculate the regression coefficients of variable with 1
> dimension (y= mass_flux)  against another which has 3 dimensions (x =
> acceldivf_).
>
> Typically, according to the description of the regCoef_n (x, y, dims_x,
> dims_y) NCL function x and y can be arrays of any dimensionality but the
> dims_x and dims_x and dims_y is an integer indicating which dimension of
> x/y to do the calculation on, as long as it has the same number of elements.
>
> The error I’m getting is the following: *fatal:regCoef_n: The input array
> y must have as many or more dimensions than x *
>
> PrintVarSummary of both variables follows:
>
>
>
>
>
>
>
>
>
>
> *Variable: mass_flux Type: float Total Size: 564 bytes             141
> values Number of Dimensions: 1 Dimensions and sizes: [time | 141]
> Coordinates:              time: [1960..2100] Number Of Attributes: 1
>   _FillValue : 1e+20*
>
> *Variable: acceldivf_*
>
>
>
>
>
>
>
>
> *Type: float Total Size: 839232 bytes             209808 values Number of
> Dimensions: 3 Dimensions and sizes: [time | 141] x [lev | 31] x [lat | 48]
> Coordinates:              time: [1960..2100]             lev: [1000.. 0.1]
>             lat: [-87.15909445302286..87.15909445302286]*
>
> So it fails with the above fatal error when I try:
>
> rc= regCoef_n (acceldivf_, mass_flux, 0, 0)
>
>
> Any ideas please?
>
> Cheers,
> Andreas
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>


-- 
Adam Phillips
Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
www.cgd.ucar.edu/staff/asphilli/   303-497-1726

<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170901/f64495b1/attachment.html>


More information about the ncl-talk mailing list