Read Namelist problem, version 13.7


I recently updated my pgi complier to 13.7 and I got a very strange problem. There are no problem to compile the Fortran-based model. However, when I run the model, it will stop at mo_inirun.F90 where it reads the namelist file. It is not working even if I removed most or all the variables in the namelist file. The only message is:

Segmentation fault

There is no problem to compile and run the model with pgi10.x or pgi7.x. So I’d like to know how to deal with this errors.

In addition, I have another question. When I use the pretty old version pgi7.x, if there is an error reading namelist file it will print out the error message ‘inirun: Failed to open namelist file’ in the log file (see the code below). However, since I use version 10.xx or newer, iostat=iret doesn’t work. It always gives me the meaningless “Segmentation fault”. Is there any compiler flags option to turn this error information on. Otherwise it is very difficult to figure out where is the error. I am running a chemical transport model with hundreds of modules and I really need these code generated error information.

Thank you for your help in advance.


Below is the code and namelist file

file = 26
open( unit = file, file = trim(nml_file),iostat=iret )
if( iret /= 0 ) then
write(,) ‘inirun: Failed to open namelist file’
call endrun
end if
read(file,nlist,iostat=iret) !!! the code stops at here
if( iret /= 0 ) then
write(,) 'inirun: Failed to read namelist file ‘,trim(nml_file),’; error = ',iret
call endrun
end if
close( file )

aa = 1.0

Hi Lui,

Can you either post or send to PGI Customer Support ( a reproducing example?


Hi Mat:

May I send the whole model and input data or just the mo_inirun.F90 and the namelist file to the customer support?



Sure, so long as you send everything we need to build the full code and instructions on how to reproduce the error.

  • Mat