Reported on clf
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/650b2eeeb8d76213#

w.f90:53.20:

  data(dft_water_nuc(i), i=1,n_nuc) /
&
                    1
Error: non-constant array in DATA statement (1) 

These seems to be variable - I can confirm it but others say that they do not
see it.

Source:
=============== w.f90 =================
module w

  implicit none
  save
  private

  real, parameter :: zero = 0.0

  type, public :: charge
     real :: q
     real :: C
     real :: A
  end type charge

  type, public :: multpol
     character*12  :: name
     real :: coor(3)  !!! COMMENT THIS TO MAKE IT COMPILE !!!
     real :: mass
     type(charge)  :: z
  end type multpol

  integer, public, parameter :: n_nuc=3

  type(multpol),      public :: dft_water_nuc(n_nuc)

  real, parameter :: C_i        =zero
  real, parameter :: A_i        =zero

  !names of multipole
  character*12, parameter :: mname1="O1          "
  character*12, parameter :: mname2="H2          "
  character*12, parameter :: mname3="H3          "

  !coordinates of multipole centers
  real, parameter :: mcoor1(3)=(/ zero,     zero, -0.119151/)
  real, parameter :: mcoor2(3)=(/-1.431042, zero,  0.945510/)
  real, parameter :: mcoor3(3)=(/ 1.431042, zero,  0.945510/)

  !mass
  real, parameter :: mass1=15.99491
  real, parameter :: mass2=1.007825
  real, parameter :: mass3=1.007825

  !charges
  real, parameter :: Zn1=8.0
  real, parameter :: Zn2=1.0
  real, parameter :: Zn3=1.0

  integer :: i

  !----------------------------------------------------------------
  data(dft_water_nuc(i), i=1,n_nuc) /
&
                                multpol
(                               &
                                        mname1, &
                                        mcoor1, &  !!! COMMENT THIS TO
MAKE IT COMPILE !!!
                                        mass1,           &
                                        charge(Zn1,C_i,A_i)
&
                                       ),
&
                                multpol
(                               &
                                        mname2, &
                                        mcoor2, &  !!! COMMENT THIS TO
MAKE IT COMPILE !!!
                                        mass2,           &
                                        charge(Zn2,C_i,A_i)
&
                                       ),
&
                                multpol
(                               &
                                        mname3, &
                                        mcoor3, &  !!! COMMENT THIS TO
MAKE IT COMPILE !!!
                                        mass3,           &
                                        charge(Zn3,C_i,A_i)
&
                                       )
&
                                /

end module w


-- 
           Summary: [Reg]  data statement with nested type constructors
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pault at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41807

Reply via email to