Bug in NCL 6.0.0?

From: Christian Pagé <page.christian_at_nyahnyahspammersnyahnyah>
Date: Thu Jul 07 2011 - 03:05:56 MDT

Hi all,

I have encountered a weird behavior of NCL 6.0.0, which cannot be reproduced
in NCL 5.2.0 in the tests I have done.

I have the following NCL script, which reads input NetCDF files to perform
some post-processing (I have only kept what is essential to experience the
bug) :

model_list = (/"arpege1", "arpege2", "arpege3", "arpege4",
"cccma_cgcm3_1_t63", "csiro_mk3_0", "gfdl_cm2_1", "giss_model_e_r",
"ingv_echam4", "miroc3_2_medres", "mpi_echam5", "ncar_ccsm3_0", "cnrm_cm3",
"gfdl_cm2_0", "giss_aom", "ipsl_cm4", "miub_echo_g", "mri_cgcm2_3_2a",
"arpege_a2", "arpege_a1b", "arpege_b1"/)
nm = dimsizes(model_list)


do model=0,nm-1

  curmodel = model_list(model)

  print("Processing: model " + curmodel)

  infilett = systemfunc("ls " + indir + "/" + curmodel +
  printVarSummary(infilett) ; infilett is always ok

  fileintt = addfiles(infilett, "r")
  printVarSummary(fileintt) ; fileintt is always ok here with the correct
number of elements

  filein = fileintt ; fileintt gets emptied here from the 2nd iteration.
Problem doesn't occur if I don't do this assignment.

  time = fileintt[:]->time ; bug occurs here since fileintt gets emptied
from the 2nd iteration, since there are no longer any element in the list

; delete(filein) ; The problem only occurs if I don't delete this

end do


The problem occurs if I don't delete the filein variable in the do loop, as
This is the line where the problem occurs :
filein = fileintt
At the second iteration in the do loop, the variable fileintt gets emptied,
it goes from 150 elements to 0 when the assignment is performed (in my case
I have 150 NetCDF files).
The assignment should not modify the fileintt variable...

If I uncomment the delete(filein) line it works ok.
If I comment the filein = fileintt assignment it also works ok.

It is not possible to reproduce this behavior in NCL 5.2.0.

Thanks for any input and comment on this,

Christian Page
CERFACS, Toulouse, France

ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Thu Jul 7 03:06:27 2011

This archive was generated by hypermail 2.1.8 : Tue Jul 12 2011 - 15:03:53 MDT