It seems that a bug in old gfortran 4.5.0 causes the problems, at least with 4.7.3 it seems to work after fixing the bugs in IO.f90