Re: MultiDValDelParent

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed Mar 17 2010 - 12:49:17 MDT

Rob,

You are right, array_append_record is trying to modify the first
argument, and the documentation as much:

    Return value

    A multi-dimensional array. The rightmost dimensions will be the
same as on input. The left dimension will have additional records
appended to the x1 array.

You are calling array_append_record with:

             x = array_append_record( (/m/), (/1,2/), 0 )

When you do the "(/m/)", you are effectively just passing in a bunch
of values, rather than a variable.

The array_append_record function wants to change that first argument
by attaching some dimension names
to it. Since you passed in a bunch of values and not a variable,
there's nothing to attach the dimension
names to. It would be like trying to do this:

    3.14!0 = "lat"

So, yes, the fix is to use "m" instead of "(/m/)".

--Mary

On Mar 16, 2010, at 11:38 AM, Rob Nicholas wrote:

> Hi NCLers,
>
> Could anyone explain (in a general sense) what's going on when NCL
> generates a
>
> fatal:MultiDValDelParent: Attempt to delete parent from
> empty list
>
> error? To get NCL to throw the error, I first define the following
> two simple procedures:
>
> undef("test_foo")
> procedure test_foo( m:integer )
> local x
> begin
> x = array_append_record( (/m/), (/1,2/), 0 )
> end
>
> undef("wrap_foo")
> procedure wrap_foo( n )
> begin
> test_foo( n )
> end
>
> So defined, "test_foo(5)" executes without a problem, but
> "wrap_foo(5)" throws the fatal error. I've been able to replicate the
> behavior with NCL 5.1.0 on RHEL and NCL 5.1.1 on Snow Leopard.
>
> I've found two different ways to eliminate the error. One is simply
> changing "(/m/)" to "m" in test_foo(). The other fix is to redefine
> wrap_foo() as follows:
>
> undef("wrap_foo")
> procedure wrap_foo( n )
> local nn
> begin
> nn = n
> test_foo( nn )
> end
>
> Could any of the developers explain what's going on here? It seems
> like array_append_record() may be trying to modify its first argument
> -- should it be doing that?
>
> Thanks,
> Rob
> _______________________________________________
> 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 Wed Mar 17 12:50:20 2010

This archive was generated by hypermail 2.1.8 : Wed Mar 17 2010 - 13:00:16 MDT