Re: fatal:MultiDValDelParent when returning logical attribute

From: Wei Huang <huangwei_at_nyahnyahspammersnyahnyah>
Date: Sun, 4 Oct 2009 10:46:45 -0600

Alvaro,

If you change the way to use your defined procedure/function,
things will be probably easier.

Below is a modified script from yours.
I guess that should be the way you invoke your procedure/function.

Wei Huang
huangwei_at_ucar.edu
VETS/CISL
National Center for Atmospheric Research
P.O. Box 3000 (1850 Table Mesa Dr.)
Boulder, CO 80307-3000 USA
(303) 497-8924

-------------------------

; simplified version of get_res_value_keep
;-----------------
function get_att_value(res,resname[1]:string,default_val[1])
local return_val
begin
   if(isatt(res,resname)) then
     return_val = res@$resname$
   else
     return_val = default_val
   end if
   return(return_val)
end
;-----------------
;
;-----------------
procedure proc(res[1]:logical,resname[1]:string)
local aux
begin
   aux=False
   print(" "+res+"@"+get_att_value(res,resname,aux))
   aux=True
   print(" "+res+"@"+get_att_value(res,resname,aux))
   print(" "+res+"@"+get_att_value(res,resname,False))
   print(" "+res+"@"+get_att_value(res,resname,True))
end
;-----------------
;
;-----------------
begin
   a = True
   proc(a, "name")

   a = False
   a_at_att = True
   proc(a, "att")

   b = 1
   b_at_lon = 5
   b_at_name = "b"
   proc(b, "lon")
   proc(b, "name")
end

On Oct 4, 2009, at 8:52 AM, alvaro.valdebenito_at_met.no wrote:

> Dear all,
>
> I have found the most strange behaviour on a simple function
> returning a logical attribute (e.g. get_res_value).
> For different combinations of the values of the logical variable and
> the (default) logical attribute
> I get a fatal:MultiDValDelParent or even a Segmentation fault.
>
> The attached script is an minimal example.
> The example returns:
> True_at_False
> True_at_True
> True_at_False
> fatal:MultiDValDelParent: Attempt to delete parent from empty list
> True_at_True
> False_at_False
> False_at_True
> fatal:MultiDValDelParent: Attempt to delete parent from empty list
> False_at_False
> False_at_True
> fatal:Variable res is still undefined, can not continue
> Segmentation fault
>
> I am at lost here. Does any one else get the same error messages?
> Is if this a bug in NCL or there is something wrong with my local
> install?
>
> Thanks in advance,
> Álvaro.
>
> Álvaro M. Valdebenito B., Dr. rer. nat.
> alvaro.valdebenito_at_met.no
> Air Pollution Section/Research Department Tel. +47-2296 3397
> Norwegian Meteorological Institute http:\\www.met.no
> P.O. Box 43 Blindern, 0313 Oslo, NORWAY http:\\www.emep.int/CWF
> <crash_ex.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
Received on Sun Oct 04 2009 - 10:46:45 MDT

This archive was generated by hypermail 2.2.0 : Fri Oct 09 2009 - 08:29:22 MDT