Internal compiler error with namelist

I’m using PGI Visual Fortran 12.5 on windows and i’ve faced with following problem. Compiling single source file with pgf95 produces internal compiler error.
Source:

module SYS
  save
  allocatable :: MINS(:,:),MBND(:,:)
  Integer :: IBND1L,IBND1R,IBND2L,IBND2U
  Integer :: IGEOME
  Real :: DX1,X1MIN,X1MAX,DX2,X2MIN,X2MAX
  Integer :: KK1,KK2,NREG,KKS,KKD,NMK,NSAZ,KX1,KX2&
            ,KS1,KS2,KV1,KV2,NN1,NN2,NX1,NX2,NS1,NS2,MM1,MM2&
            ,MX1,MX2,MS1,MS2,LL1,LL2,NIN,NSG,NPY,NSA,&
	     NBEXT,NEEXT,NCEXT,NCEXP,NWV,LNFFT,NBACK     
  Integer :: KKB1,KKB2,NNB1,NNB2,MMB1,MMB2,NN1M1,NN1M2 &
           ,NN2M1,NN2M2,MM1M1,MM1M2,MM2M1,MM2M2,KK1M1,KK1M2 &
           ,KK1S,KK1SO2,KK1D,KK1D02,KK2M1,KK2M2,KK12,KK1B &
           ,KK2B,KK1E,KK2E,KK1C,KK2C,LL1M1,LL1M2,LL2M1,LL2M2
  Real :: PI,PIO2,PITW
  Real :: VLIGHT
  Real :: TT,DT
  Integer :: IT,ITBMD2
  Real :: FBACK0,FBACK1,FBACK2,FBACK3
  Logical :: LNBACK, LCSUM
  Integer :: IUNIT,KUNIT,IUTTY
  logical :: LRESTR,LDUMPS,LVLTST,LFLTST,LFLVLS
  Integer :: IRESTR,IDUMPS,IVLTST,IFLTST,IFLVLS,NDUMPS
  Logical :: TRIAD0,TRIAD1,TRIAD2 &
                ,LCURT1,LCURT2,LCURT3,LSMTH(4)
  Logical :: LPRIOR
  Real :: PRIORI
  Logical :: LLOGDP,LOGADP
  Integer :: ILOGSZ,JLOGDP
  logical :: LABLNW

  logical :: MFLDIN,MFLDAN,MFLDPR,MFLDSM,MFLDDI,MFLDEN,&
				MFLDPY,MFLDJE,MVLSIN,MVLSNE,MVLSOR,MVLSDI,&
				MVLSEN,MVLSIP,MVLSEQ
  integer :: IVBIG,NSUB,IORMAX

  integer ::MINNER,MIDDLE,MOUTER,ITMAX

  logical :: LMASK0,LMASK1,LMASK2,LSIGM0,LSIGM1,LSIGM2,LSIGME,LINSUL
     
	NAMELIST/NLMAIN/TT,DT,IT &
				,DX1,X1MIN,DX2,X2MIN &
				,IGEOME,VLIGHT &
				,LFLTST,LVLTST,LFLVLS &
				,TRIAD0,TRIAD1,TRIAD2 &
				,IBND1L,IBND1R,IBND2L,IBND2U &
				,LCURT1,LCURT2,LCURT3,LSMTH &
				,LRESTR,LDUMPS,IRESTR,IDUMPS &
				,NDUMPS &
				,LLOGDP,LOGADP,ILOGSZ,JLOGDP &
				,LPRIOR,PRIORI,LABLNW &
				,LNBACK,FBACK0,FBACK1,FBACK2,FBACK3
     NAMELIST/NFLVLS/MFLDIN,MFLDAN,MFLDPR,MFLDSM,MFLDDI,MFLDEN,&
                     MFLDPY,MFLDJE,MVLSIN,MVLSNE,MVLSOR,MVLSDI,&
                    MVLSEN,MINNER,MIDDLE,MOUTER,MVLSIP,MVLSEQ,&
                     IVBIG,ITMAX,NSUB,IORMAX
	
	NAMELIST/NFLMSK/LMASK0,LMASK1,LMASK2,LINSUL,LMSK,MBND,MASKS&
                                               ,LINS,MINS,MINSM
end module

That is compiler output.

PGF90-S-0000-Internal compiler error. size_of: bad dtype 0 (system.f95: 60)
PGF90-S-0000-Internal compiler error. size_of: bad dtype 0 (system.f95: 60)
PGF90-S-0000-Internal compiler error. size_of: bad dtype 0 (system.f95: 60)
PGF90-S-0000-Internal compiler error. size_of: bad dtype 0 (system.f95: 60)
PGF90-S-0000-Internal compiler error. size_of: bad dtype 0 (system.f95: 60)
PGF90-S-0000-Internal compiler error. size_of: bad dtype 0 (system.f95: 60)
PGF90-S-0000-Internal compiler error. size_of: bad dtype 0 (system.f95: 60)
PGF90-S-0000-Internal compiler error. size_of: bad dtype 0 (system.f95: 60)
0 inform, 0 warnings, 8 severes, 0 fatal for sys

Can you tell me, is this error presents on the last versions of pgf95? Or i’ve found something new?

Hi Senya,

Can you tell me, is this error presents on the last versions of pgf95? Or i’ve found something new?

There’s an error in your code. It’s illegal to use allocatables (or other types where the size is not known at compile time) in a NAMELIST statement so you can’t have “MINS” or “MBND” as part of the list.

However, the compiler should be catching this error and not giving an ICE. I filed TPR#19396 requesting that we do a better job of catching this error,

  • Mat

I’ve used it before, but there was allocate in a one module,and namelist in another. It was working correctly.
Is that was because at the time of calling namelist containing subroutine array was allocated already?

Is that was because at the time of calling namelist containing subroutine array was allocated already?

I’m not sure, but possible. More likely, we accepted the syntax when we shouldn’t have and that it happened to work. It’s interesting that my Metcalf book explicitly say that allocatables in the variable list of a namelist is disallowed, but I can’t find case and verse in the F2003 standard. Let me talk with our language lawyers here and get a ruling.

  • Mat

Ok, it appears that this restriction was from F95, but was loosened in F2003. Not sure why the Metcalf book still lists is as illegal.

Engineering has already fixed the problem and should be available in the 13.7 release. It appears to only be a problem when the namelist is defined in a module. If the namelist is in a subroutine, then it would have worked.

Thanks,
Mat

Is that right, that the namelist in module case is fixed in 13.7?

Is that right, that the namelist in module case is fixed in 13.7?

Assuming that it passes QA, then yes, the fix will be available in next month’s 13.7 release.

  • Mat

Thank you.

Hello.
Is it now fixed in 13.7?

Hi Senya,

Yes, TPR#19396 was fixed in 13.7.

Thanks,
Mat

Thank you

Senya,

19396 - ICE “size_of: bad dtype” caused by illegal use of an allocatable in a NAMELIST statement

has been corrected in the current 13.7 release.

Thanks for the report.

regards,
dave