Re: Undefined values returned by NclReturnValue

From: Li Dong <dongli_at_nyahnyahspammersnyahnyah>
Date: Wed Oct 30 2013 - 03:31:44 MDT

Dear NCL team,

I have printed the address of my array in the wrapper function, and in another C code that will be called from NCL:

---> 1: 0x7fb7060e3a30
---> 2: 0x7fb7060e3a50

As you can see, there is a 32 bits shift in the address! What is wrong?

Best,

Li

On 2013年10月30日, at 上午9:41, Li Dong <dongli@lasg.iap.ac.cn> wrote:

> Dear NCL team,
>
> After solve the linking problem for the EEMD codes, I tried to test it in NCL. I printed the result in the wrapper function before return, and it is correct. But when I printed it in NCL script, there are undefined values as:
>
> CORRECT ONE (printed in wrapper function):
> Mode 0:
> 0.000000
> 0.642792
> 0.984796
> 0.866018
> 0.342024
> -0.342024
> -0.866018
> -0.984796
> -0.642792
> 0.000000
>
> WRONG ONE (printed in NCL script):
> (0) -9.671524e+09
> (1) 4.574539e-41
> (2) -9.671574e+09
> (3) 4.574539e-41
> (4) -9.671623e+09
> (5) 4.574539e-41
> (6) -9.671672e+09
> (7) 4.574539e-41
> (8) 0
> (9) 0.6427915
>
> The return part of my wrapper function is:
>
> ng_size_t dimsizes_imf[2] = { nm, ns };
>
> return NclReturnValue(
> (void*)imf,
> 2,
> dimsizes_imf,
> NULL,
> NCL_float,
> 0
> );
>
> In this case, nm = 4, ns = 10, and imf is “float **". Where is wrong? Thank you in advance!
>
> Best regards,
>
> Li

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Oct 30 03:31:59 2013

This archive was generated by hypermail 2.1.8 : Fri Nov 01 2013 - 08:58:14 MDT