Pregunta

I am porting from ifort to gfortran and having trouble with the following code:

MODULE test
IMPLICIT NONE

REAL*8 :: a

CONTAINS

SUBROUTINE load
  a = 0.0d0
  NAMELIST /materialProperties/ a
END SUBROUTINE load

END MODULE test

I will get a compiler error about the namelist. Anyhow, if the variable initialization is disabled (a=0.0d0 commented), than the error disappears. This is not in the Intel compiler and I am wondering why this is.

¿Fue útil?

Solución

The problem lies in defining the NAMELIST after giving the variable a a value. As you saw, deleting/commenting that line removes the error, but so does moving the declaration of a into SUBROUTINE load.

My guess is that ifort ignores that line while gfortran does not.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top