Re: Buggy warning still present

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue, 5 May 2009 08:56:08 -0600 (MDT)

Hi Oliver,

Thanks for providing a nice short script to illustrate the problem.
It does the same thing on my system.

One possible word of caution: I don't think you want to declare
variables that are passed into a subroutine as "local". I'm not sure
it is clearly defined what this means, but I thought that variables
declared local were "cleaned up" before leaving the
subroutine. Removing these "local var"s from your script doesn't
change anything, so we still need to deal with the problem at hand.

We are actually planning a 5.1.1 release in about a month, so
maybe we can get this fixed by then.

--Mary

On Tue, 5 May 2009 Oliver.Fuhrer_at_meteoswiss.ch wrote:

> Hi ncl-talk,
>
> In 5.0 there was a erroneous warning when the dimension name of a
> variable was changed in a subroutine and returned to the caller. As NCL
> passes variables by reference, there should be no warning. This warning
> has been removed in 5.1. But obviously it is still present, if a
> subroutine calls a subroutine. The warning is the following...
>
> warning:VarVarWrite: Dimension names for dimension number (0) don't
> match, assigning name of rhs dimension to lhs, use "(/../)" if this
> change is not desired
>
> The example below illustrates the problem. The problem only arises,
> since the dimension name is changed in sub2 called from sub1. If the
> call of sub1 on the main script level is replaced with sub2, no warning
> is issued.
>
> This might seem a detail, but as we have a library build around the
> COSMO model which changes quite frequently the names of dimensions, we
> have warnings issued all over the place which clutters the useful output
> considerably.
>
> Kind regards,
> Oli
>
> ------------ dimname_problem.ncl ---------------
>
> undef("sub2")
> procedure sub2( var:numeric )
> local var, s
> begin
> delete(var!0)
> var!0 = "two"
> end
>
> undef("sub1")
> procedure sub1( var:numeric )
> local var
> begin
> sub2(var)
> end
>
> a = (/1,2,3,4/)
> a!0 = "one"
> sub1(a)
>
>
> ________________________________________
>
> Oliver Fuhrer
> Numerical Models
>
> Federal Departement of Home Affairs FDHA
> Federal Office of Meteorology and Climatology MeteoSwiss
>
> Kraehbuehlstrasse 58, P.O. Box 514, CH-8044 Zurich, Switzerland
>
> Tel. +41 44 256 93 59
> Fax +41 44 256 92 78
> oliver.fuhrer_at_meteoswiss.ch
> www.meteoswiss.ch - First-hand information
>
> _______________________________________________
> 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 May 05 2009 - 08:56:08 MDT

This archive was generated by hypermail 2.2.0 : Wed May 06 2009 - 16:48:59 MDT