Bug Report

Pascal PERNOT pascal.pernot@lcp.u-psud.fr
Mon Oct 24 12:23:00 GMT 2005


Hi,

I encounter a strange problem with the following code  compiled with gfortran. 

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
      program bugged
      character*80 mc_sample
      namelist /BUG/ mc_sample

! Sequence without read of Namelist
      open(10,file='bug.in')
      !read(10,BUG)
      close(10)

      print *, 'Enter integer'
      read(*,*) nalt
      print *, nalt

! Same sequence with read of Namelist
      open(10,file='bug.in')
      read(10,BUG) 
      close(10)

      print *, 'Enter integer'
      read(*,*) nalt
      print *, nalt

      end
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Example "bug.in" data file :

$BUG
  mc_sample ='mcmc_run001'
$end
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

The second occurence of "read(*,*) nalt" produces an error message for any 
integer input

>> At line 20 of file bid.f
>> Fortran runtime error: Integer overflow while reading item 1

The only difference between the two calls is the "read(10,BUG)".


Thanks for your help


Pascal PERNOT




More information about the Fortran mailing list