Error: NAMELIST attribute conflicts with ALLOCATABLE attribute

447 views
Skip to first unread message

Hash

unread,
Nov 8, 2012, 4:14:17 PM11/8/12
to gg...@googlegroups.com
Dear all,

The following piece of code generate an error with g95 v0.93 :

> cat bug.f90

program main
  real, dimension(:), allocatable :: a
  namelist /nmlst/ a
end program main

The error ;

~/g95-install/bin/x86_64-unknown-linux-gnu-g95 bug.f90
In file bug.f90:3

  namelist /nmlst/ a
                   1
Error: NAMELIST attribute conflicts with ALLOCATABLE attribute in 'a' at (1)


The code compile correclty with gfortran.

Is there a way to deal with allocatable arrays in namelist with g95?

Best regards,

jfh

unread,
Nov 26, 2012, 3:34:05 PM11/26/12
to gg...@googlegroups.com

The f95 standard forbids having allocatable arrays as namelist group objects. The f2003  standard allows it. The problem is that g95 is a f95 compiler with some f2003 features but not including that one. Gfortran gives you the choice. With the -std=f95 option you get an error message equivalent to g95's, with -std=f2003 (or with no -std option at all) the program compiles.

-- John Harper

Julien Hillairet

unread,
Nov 27, 2012, 3:45:30 AM11/27/12
to gg...@googlegroups.com
Thank your for these additional informations.

Best regards


2012/11/26 jfh <john....@vuw.ac.nz>

--
You received this message because you are subscribed to the Google Groups "gg95" group.
To view this discussion on the web visit https://groups.google.com/d/msg/gg95/-/KoZPcsDj2dYJ.
To post to this group, send email to gg...@googlegroups.com.
To unsubscribe from this group, send email to gg95+uns...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gg95?hl=en.

Reply all
Reply to author
Forward
0 new messages