Replacing type of dimension within subroutine (in NCL 5.2)

From: <Oliver.Fuhrer_at_nyahnyahspammersnyahnyah>
Date: Thu Apr 29 2010 - 01:49:12 MDT

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
Received on Thu Apr 29 01:49:37 2010

This archive was generated by hypermail 2.1.8 : Thu Apr 29 2010 - 08:05:27 MDT