Re: Replacing type of dimension within subroutine (in NCL 5.2)

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Fri May 07 2010 - 17:34:00 MDT

HI Oli,

I have found and fixed this bug. It will be part of our bug-fix
release 5.2.1. If you'd like to test it out let Mary Haley know.
  -dave

On Apr 29, 2010, at 1:49 AM, <Oliver.Fuhrer@meteoswiss.ch> <Oliver.Fuhrer@meteoswiss.ch
> wrote:

> Hi NCL-team,
>
> I think I've stumbled over a bug. Since the introduction of NCL 5.2 I
> get an error message if I change the type of a dimension within a
> subroutine. If not done within a subroutine (set True to False in
> example script below) everything works fine. Also, in version 5.1 this
> also worked without problems. It seems that upon returning NCL tries
> to
> replace the variable of the caller with the temporary variable within
> the subroutine and runs into a type conflict.
>
> Cheers,
> Oli
>
> PS. Data file for script can be found here
> https://twiki.cscs.ch/twiki/pub/Main/OliverFuhrerDownloads/lfff00000000p
>
>
> ------------ example script ----------------------
>
> undef("replace_dim")
> procedure replace_dim( var:numeric )
> local s
> begin
> print("replace_dim: start")
> delete(var&lv_ISBL0)
> var&lv_ISBL0 = fspan(0.,19.,20)
> print("replace_dim: end")
> return
> end
>
> begin
> print("main: start")
>
> ; read some data
> f = addfile("../data/example/lfff00000000p.grb","r")
> var = f->FI_GDS10_ISBL
> printVarSummary(var&lv_ISBL0)
>
> ; replace first named dimension from array of integers to array of
> floats
> if (True) then
> replace_dim(var)
> else
> delete(var&lv_ISBL0)
> var&lv_ISBL0 = fspan(0.,19.,20)
> end if
>
> printVarSummary(var&lv_ISBL0)
>
> print("main: end")
>
> end
>
>
> ________________________________________
>
> 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@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 Fri May 7 17:34:39 2010

This archive was generated by hypermail 2.1.8 : Thu May 13 2010 - 10:03:00 MDT