Re: Problem with reshape

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue Dec 11 2012 - 07:31:22 MST

Dave is right, this is a bug. reshape should work on any type.

Meanwhile, you can work around this by using ndtooned and onedtond.

For example, to reshape an array from 10 x 20 x 30 x 40 to 200 x 30 x 40, you would use:

    xreshape = onedtond(ndtooned(x),(/200,30,40/)))

--Mary

On Dec 10, 2012, at 5:34 PM, David Brown wrote:

> Hi Claire,
> It looks like the function definition is unnecessarily restrictive. Without changing the actual implementation of the function, I changed the definition (the function registration code) and it worked fine. So I would say this is a bug. By the way it also does not allow for the newer numeric types such as "int64". This is a very easy fix and we will definitely have it in our bug fix release (6.1.1) which should be available within a month or so.
> -dave
>
>
> On Dec 10, 2012, at 5:04 PM, Claire Carouge wrote:
>
>> Hi,
>>
>> I am trying to use the reshape function using NCL v6.1.0-beta.
>> I want to reshape an array of strings and I get the following error message:
>> fatal:Argument type mismatch on argument (0) of (reshape) can not coerce
>> fatal:["Execute.c":7556]:Execute: Error occurred at or near line 4 in file test.ncl
>>
>> See the toy program attached.
>>
>> So I'm not sure if this is a bug or if the manual needs to be modified to restrict to numeric types, since the manual says:
>> val
>> A multi-dimensional array of any type.
>>
>>
>> Regards,
>> Claire Carouge
>>
>> --
>> Dr Claire Carouge
>> Research Associate
>> Climate Change Research Centre (UNSW)
>>
>> Postal address:
>> Research School of Earth Sciences
>> Bldg 61, Mills Road
>> Acton, ACT, 0200
>> Australia
>>
>> Tel +61 2 6125 9961
>>
>>
>>
>>
>>
>>
>> <test.ncl>_______________________________________________
>> 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

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Dec 11 23:31:32 2012

This archive was generated by hypermail 2.1.8 : Wed Dec 12 2012 - 19:07:01 MST