Hi netcdf folks,
I'm getting this error when changing the values of global attributes in
a netcdf4 file using the fortran interface:
HDF5: infinite loop closing library
D,G,A,S,T,F,FD,P,FD,P,FD,P,E,E,SL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL
Here is a little test program that illustrates the problem. It first
creates a netcdf file and writes some global attributes, then tries to
write them again after closing and re-opening the file. Interestingly,
if the number of attributes is less than 30, there is no error. If the
number is 30, the error occurs. I'm using netcdf 4.3.0, netcdf fortran
4.2 and hdf5 1.8.16 on Linux x86_64.
program tester
use netcdf
implicit none
integer, parameter :: n_attrs = 30
integer :: iok, ncid, varid, i
character*10 :: myattr
! Create the file and write global attrs
iok = nf90_create('tester.nc',NF90_HDF5,ncid)
print *,'create iok=',iok
do i=1,n_attrs
write(unit=myattr,fmt='(a6,i4.4)') 'myattr',i
iok = nf90_put_att(ncid,NF90_GLOBAL,myattr,i)
print *,i,' put iok=',iok
enddo
iok = nf90_close(ncid)
print *,'close iok=',iok
! Open the file again and re-write global attrs
iok = nf90_open('tester.nc',NF90_WRITE,ncid)
print *,'open iok=',iok
do i=1,n_attrs
write(unit=myattr,fmt='(a6,i4.4)') 'myattr',i
iok = nf90_put_att(ncid,NF90_GLOBAL,myattr,i)
print *,i,' put iok=',iok
enddo
iok = nf90_close(ncid)
print *,'close iok=',iok
end program tester
When I run this test program with 30 attributes I get this error result:
create iok= 0
1 put iok= 0
2 put iok= 0
3 put iok= 0
4 put iok= 0
5 put iok= 0
6 put iok= 0
7 put iok= 0
8 put iok= 0
9 put iok= 0
10 put iok= 0
11 put iok= 0
12 put iok= 0
13 put iok= 0
14 put iok= 0
15 put iok= 0
16 put iok= 0
17 put iok= 0
18 put iok= 0
19 put iok= 0
20 put iok= 0
21 put iok= 0
22 put iok= 0
23 put iok= 0
24 put iok= 0
25 put iok= 0
26 put iok= 0
27 put iok= 0
28 put iok= 0
29 put iok= 0
30 put iok= 0
close iok= 0
open iok= 0
1 put iok= 0
2 put iok= 0
3 put iok= 0
4 put iok= 0
5 put iok= 0
6 put iok= 0
7 put iok= 0
8 put iok= 0
9 put iok= 0
10 put iok= 0
11 put iok= 0
12 put iok= 0
13 put iok= 0
14 put iok= 0
15 put iok= 0
16 put iok= 0
17 put iok= 0
18 put iok= 0
19 put iok= 0
20 put iok= 0
21 put iok= 0
22 put iok= 0
23 put iok= 0
24 put iok= 0
25 put iok= 0
26 put iok= 0
27 put iok= 0
28 put iok= 0
29 put iok= 0
30 put iok= 0
close iok= 0
HDF5: infinite loop closing library
D,G,A,S,T,F,FD,P,FD,P,FD,P,E,E,SL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL,FL
Can anyone help me to understand why this error is occurring when
re-writing the attributes?is it a bug with netcdf/hdf or am I doing
something wrong?
Thanks,
Alison