Re: a question for svdstd

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue, 13 Jan 2009 06:57:21 -0700 (MST)

Hi Lolita,

I am not very familiar with this function, and the error message
is a little confusing.

What it's trying to tell you is that your output homlft, hetlft
arrays are not the right size. (And probably, the homrgt and
hetrgt arrays may not be correct either.)

If x (nx_sl) is dimensioned ncolx x ntime, and y (nx_uw) is
dimensioned ncoly x ntime, then the h* arrays must be dimensioned:

    homlft: nsvd x ncolx
    hetlft: nsvd x ncolx
    homrgt: nsvd x ncoly
    hetrgt: nsvd x ncoly

As the documentation states, you must allocate space for these
arrays beforehand, so make sure they are being allocated correctly

Your code should look something like this:

   dimsx = dimsizes(nx_sl)
   dimsy = dimsizes(nx_uw)
   ncolx = dimsx(0)
   ncoly = dimsy(0)
   ntime = dimsx(1) ; Must be the same as dimsy(1)

   homlft = new((/nsvd,ncolx/),float) ; or double
   hetlft = new((/nsvd,ncolx/),float)
   homrgt = new((/nsvd,ncoly/),float)
   hetrgt = new((/nsvd,ncoly/),float)

   x = svdstd(nx_sl,nx_uw,nsvd,homlft,hetlft,homrgt,hetrgt)

I will improve the error messages in the code.

--Mary

On Tue, 13 Jan 2009, [BIG5] 呂小雯 wrote:

> Hi
> I want to use a function--svdstd
> my code is
> x = svdstd(nx_sl,nx_uw,nsvd,homlft,hetlft,homrgt,hetrgt)
>
> and my error message is
>
> Variable: nx_sl
> Type: float
> Total Size: 8468 bytes
> 2117 values
> Number of Dimensions: 2
> Dimensions and sizes: [lat | 29] x [lon | 73]
> Coordinates:
> lat: [15..85]
> lon: [-60..120]
> Number Of Attributes: 17
> long_name : Wgt: Sea Level Pressure
> valid_range : <ARRAY>
> actual_range : <ARRAY>
> units : millibars
> add_offset : 0
> scale_factor : 1
> missing_value : -9.96921e+36
> precision : 1
> least_significant_digit : 1
> var_desc : Sea Level Pressure
> P
> dataset : CDC Derived NCEP Reanalysis Products
> AC
> level_desc : Sea Level
> I
> statistic : Mean
> M
> parent_stat : Other
> -
> _FillValue : -9.96921e+36
> lonFlip : longitude coordinate variable has been reordered via lonFlip
> average_op_ncl : dim_avg over dimension: time
>
> fatal:svdstd: The second dimension of the homlft/hetlft arrays must be
> the same as the first dimension of x, and the first dimension must be
> nsvx
>
> How to correct my code?
> Thanks in advance.
>
> Lolita
> _______________________________________________
> 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 Jan 13 2009 - 06:57:21 MST

This archive was generated by hypermail 2.2.0 : Fri Jan 16 2009 - 14:05:56 MST