I’m using a simple while-loop to read namelists records from a file.
Turning “-i8” compiler option on causes segfault during reading
a namelist. I haven’t noticed such a problem with a previous realeses.
Changing read ‘iostatus’ to integer*4 solves the problem.
Example code:
program nml_readloop
Implicit none
Integer :: Num_Items
Integer :: ierr
Integer :: Section
Integer :: Item
Namelist /ITEMS/ Section, Item
num_items = 0
ierr = 0
Open( Unit=10, File='Items', Iostat=ierr )
If ( ierr .ne. 0) Then
Stop
End If
Do While ( ierr == 0 )
Read( Unit=10, Nml=items, Iostat=ierr )
If ( ierr == 0 ) Then
num_items = num_items + 1
End If
End Do
write (0,*) 'num_items ', num_items
end
Compiler version: pgf90 10.9-0 64-bit target on x86-64 Linux[/code]
Open( Unit=10, File=‘Items’, Iostat=ierr )
If ( ierr .ne. 0) Then
Stop
End If
Do While ( ierr == 0 )
Read( Unit=10, Nml=items, Iostat=ierr )
If ( ierr == 0 ) Then
num_items = num_items + 1
print *,“Section=”,Section
print *,“Item=”,Item
End If
End Do