不可分类陈述的错误& fortran代码编译中名称中的字符无效

时间:2015-05-14 18:16:07

标签: fortran

我已经编写了附加的Fortran代码的一些部分。当我编译它时,我收到了错误。代码:

http://localhost:4243

错误:

! 
! This file is part of the SIESTA package.
!
! Copyright (c) Fundacion General Universidad Autonoma de Madrid:
! E.Artacho, J.Gale, A.Garcia, J.Junquera, P.Ordejon, D.Sanchez-Portal
! and J.M.Soler, 1996- .
! 
! Use of this software constitutes agreement with the full conditions
! given in the SIESTA license, as signed by all legitimate users.
!
      subroutine constr( cell, na, isa, amass, xa, stress, fa, ntcon )
c *****************************************************************
c User-written routine to implement specific geometric constraints,
c by orthogonalizing the forces and stress to undesired changes.
c Arguments:
c real*8  cell(3,3)    : input lattice vectors (Bohr)
c integer na           : input number of atoms
c integer isa(na)      : input species indexes
c real*8  amass(na)    : input atomic masses
c real*8  xa(3,na)     : input atomic cartesian coordinates (Bohr)
c real*8  stress( 3,3) : input/output stress tensor (Ry/Bohr**3)
c real*8  fa(3,na)     : input/output atomic forces (Ry/Bohr)
c integer ntcon        : total number of positions constr. imposed
c *****************************************************************
      implicit         none
      integer           na, isa(na), ntcon
      double precision  amass(na), cell(3,3), fa(3,na), fz
      double precision  stress(3,3), xa(3,na), tmass


       fz = fa(3,1)+fa(3,2)+fa(3,3)+fa(3,4)+fa(3,5)+fa(3,6)+fa(3,7)
      $ +fa(3,8)+fa(3,9)+fa(3,10)
      $ +fa(3,11)+fa(3,12)+fa(3,13)+fa(3,14)+fa(3,15)+fa(3,16)+fa(3,17)
      $ +fa(3,18)+fa(3,19)+fa(3,20)
      $ +fa(3,21)+fa(3,22)+fa(3,23)+fa(3,24)+fa(3,25)+fa(3,26)+fa(3,27)
      $ +fa(3,28)+fa(3,29)+fa(3,30)
      $ +fa(3,31)+fa(3,32)+fa(3,33)+fa(3,34)+fa(3,35)+fa(3,36)+fa(3,37)
      $ +fa(3,38)+fa(3,39)+fa(3,40)
      $ +fa(3,41)+fa(3,42)+fa(3,43)+fa(3,44)+fa(3,45)+fa(3,46)+fa(3,47)
      $ +fa(3,48)+fa(3,49)+fa(3,50)
      $ +fa(3,51)+fa(3,52)+fa(3,53)+fa(3,54)+fa(3,55)+fa(3,56)+fa(3,57)
      $ +fa(3,58)+fa(3,59)+fa(3,60)

       tmass=amass(1)+amass(2)+amass(3)+amass(4)+amass(5)+amass(6)
      $ +amass(7)+amass(8)+amass(9)+amass(10)
      $ +amass(11)+amass(12)+amass(13)+amass(14)+amass(15)+amass(16)
      $ +amass(17)+amass(18)+amass(19)+amass(20)
      $ +amass(21)+amass(22)+amass(23)+amass(24)+amass(25)+amass(26)
      $ +amass(27)+amass(28)+amass(29)+amass(30)
      $ +amass(31)+amass(32)+amass(33)+amass(34)+amass(35)+amass(36)
      $ +amass(37)+amass(38)+amass(39)+amass(40)
      $ +amass(41)+amass(42)+amass(43)+amass(44)+amass(45)+amass(46)
      $ +amass(47)+amass(48)+amass(49)+amass(50)
      $ +amass(51)+amass(52)+amass(53)+amass(54)+amass(55)+amass(56)
      $ +amass(57)+amass(58)+amass(59)+amass(60)

       fa(3,1) = fz * amass(1)/tmass
       fa(3,2) = fz * amass(2)/tmass
       fa(3,3) = fz * amass(3)/tmass
       fa(3,4) = fz * amass(4)/tmass
       fa(3,5) = fz * amass(5)/tmass
       fa(3,6) = fz * amass(6)/tmass
       fa(3,7) = fz * amass(7)/tmass
       fa(3,8) = fz * amass(8)/tmass
       fa(3,9) = fz * amass(9)/tmass
       fa(3,10) = fz * amass(10)/tmass
       fa(3,11) = fz * amass(11)/tmass
       fa(3,12) = fz * amass(12)/tmass
       fa(3,13) = fz * amass(13)/tmass
       fa(3,14) = fz * amass(14)/tmass
       fa(3,15) = fz * amass(15)/tmass
       fa(3,16) = fz * amass(16)/tmass
       fa(3,17) = fz * amass(17)/tmass
       fa(3,18) = fz * amass(18)/tmass
       fa(3,19) = fz * amass(19)/tmass
       fa(3,20) = fz * amass(20)/tmass
       fa(3,21) = fz * amass(21)/tmass
       fa(3,22) = fz * amass(22)/tmass
       fa(3,23) = fz * amass(23)/tmass
       fa(3,24) = fz * amass(24)/tmass
       fa(3,25) = fz * amass(25)/tmass
       fa(3,26) = fz * amass(26)/tmass
       fa(3,27) = fz * amass(27)/tmass
       fa(3,28) = fz * amass(28)/tmass
       fa(3,29) = fz * amass(29)/tmass
       fa(3,30) = fz * amass(30)/tmass
       fa(3,31) = fz * amass(31)/tmass
       fa(3,32) = fz * amass(32)/tmass
       fa(3,33) = fz * amass(33)/tmass
       fa(3,34) = fz * amass(34)/tmass
       fa(3,35) = fz * amass(35)/tmass
       fa(3,36) = fz * amass(36)/tmass
       fa(3,37) = fz * amass(37)/tmass
       fa(3,38) = fz * amass(38)/tmass
       fa(3,39) = fz * amass(39)/tmass
       fa(3,40) = fz * amass(40)/tmass
       fa(3,41) = fz * amass(41)/tmass
       fa(3,42) = fz * amass(42)/tmass
       fa(3,43) = fz * amass(43)/tmass
       fa(3,44) = fz * amass(44)/tmass
       fa(3,45) = fz * amass(45)/tmass
       fa(3,46) = fz * amass(46)/tmass
       fa(3,47) = fz * amass(47)/tmass
       fa(3,48) = fz * amass(48)/tmass
       fa(3,49) = fz * amass(49)/tmass
       fa(3,50) = fz * amass(50)/tmass
       fa(3,51) = fz * amass(51)/tmass
       fa(3,52) = fz * amass(52)/tmass
       fa(3,53) = fz * amass(53)/tmass
       fa(3,54) = fz * amass(54)/tmass
       fa(3,55) = fz * amass(55)/tmass
       fa(3,56) = fz * amass(56)/tmass
       fa(3,57) = fz * amass(57)/tmass
       fa(3,58) = fz * amass(58)/tmass
       fa(3,59) = fz * amass(59)/tmass
       fa(3,60) = fz * amass(60)/tmass

       fa(1,1) = 0.0d0
       fa(1,2) = 0.0d0
       fa(1,3) = 0.0d0
       fa(1,4) = 0.0d0
       fa(1,5) = 0.0d0
       fa(1,6) = 0.0d0
       fa(1,7) = 0.0d0
       fa(1,8) = 0.0d0
       fa(1,9) = 0.0d0
       fa(1,10) = 0.0d0
       fa(1,11) = 0.0d0
       fa(1,12) = 0.0d0
       fa(1,13) = 0.0d0
       fa(1,14) = 0.0d0
       fa(1,15) = 0.0d0
       fa(1,16) = 0.0d0
       fa(1,17) = 0.0d0
       fa(1,18) = 0.0d0
       fa(1,19) = 0.0d0
       fa(1,20) = 0.0d0
       fa(1,21) = 0.0d0
       fa(1,22) = 0.0d0
       fa(1,23) = 0.0d0
       fa(1,24) = 0.0d0
       fa(1,25) = 0.0d0
       fa(1,26) = 0.0d0
       fa(1,27) = 0.0d0
       fa(1,28) = 0.0d0
       fa(1,29) = 0.0d0
       fa(1,30) = 0.0d0
       fa(1,31) = 0.0d0
       fa(1,32) = 0.0d0
       fa(1,33) = 0.0d0
       fa(1,34) = 0.0d0
       fa(1,35) = 0.0d0
       fa(1,36) = 0.0d0
       fa(1,37) = 0.0d0
       fa(1,38) = 0.0d0
       fa(1,39) = 0.0d0
       fa(1,40) = 0.0d0
       fa(1,41) = 0.0d0
       fa(1,42) = 0.0d0
       fa(1,43) = 0.0d0
       fa(1,44) = 0.0d0
       fa(1,45) = 0.0d0
       fa(1,46) = 0.0d0
       fa(1,47) = 0.0d0
       fa(1,48) = 0.0d0
       fa(1,49) = 0.0d0
       fa(1,50) = 0.0d0
       fa(1,51) = 0.0d0
       fa(1,52) = 0.0d0
       fa(1,53) = 0.0d0
       fa(1,54) = 0.0d0
       fa(1,55) = 0.0d0
       fa(1,56) = 0.0d0
       fa(1,57) = 0.0d0
       fa(1,58) = 0.0d0
       fa(1,59) = 0.0d0
       fa(1,60) = 0.0d0

       fa(2,1) = 0.0d0
       fa(2,2) = 0.0d0
       fa(2,3) = 0.0d0
       fa(2,4) = 0.0d0
       fa(2,5) = 0.0d0
       fa(2,6) = 0.0d0
       fa(2,7) = 0.0d0
       fa(2,8) = 0.0d0
       fa(2,9) = 0.0d0
       fa(2,10) = 0.0d0
       fa(2,11) = 0.0d0
       fa(2,12) = 0.0d0
       fa(2,13) = 0.0d0
       fa(2,14) = 0.0d0
       fa(2,15) = 0.0d0
       fa(2,16) = 0.0d0
       fa(2,17) = 0.0d0
       fa(2,18) = 0.0d0
       fa(2,19) = 0.0d0
       fa(2,20) = 0.0d0
       fa(2,21) = 0.0d0
       fa(2,22) = 0.0d0
       fa(2,23) = 0.0d0
       fa(2,24) = 0.0d0
       fa(2,25) = 0.0d0
       fa(2,26) = 0.0d0
       fa(2,27) = 0.0d0
       fa(2,28) = 0.0d0
       fa(2,29) = 0.0d0
       fa(2,30) = 0.0d0
       fa(2,31) = 0.0d0
       fa(2,32) = 0.0d0
       fa(2,33) = 0.0d0
       fa(2,34) = 0.0d0
       fa(2,35) = 0.0d0
       fa(2,36) = 0.0d0
       fa(2,37) = 0.0d0
       fa(2,38) = 0.0d0
       fa(2,39) = 0.0d0
       fa(2,40) = 0.0d0
       fa(2,41) = 0.0d0
       fa(2,42) = 0.0d0
       fa(2,43) = 0.0d0
       fa(2,44) = 0.0d0
       fa(2,45) = 0.0d0
       fa(2,46) = 0.0d0
       fa(2,47) = 0.0d0
       fa(2,48) = 0.0d0
       fa(2,49) = 0.0d0
       fa(2,50) = 0.0d0
       fa(2,51) = 0.0d0
       fa(2,52) = 0.0d0
       fa(2,53) = 0.0d0
       fa(2,54) = 0.0d0
       fa(2,55) = 0.0d0
       fa(2,56) = 0.0d0
       fa(2,57) = 0.0d0
       fa(2,58) = 0.0d0
       fa(2,59) = 0.0d0
       fa(2,60) = 0.0d0

      fz = fa(3,151)+fa(3,152)+fa(3,153)+fa(3,154)+fa(3,155)+fa(3,156)
      $+fa(3,157)+fa(3,158)+fa(3,159)+fa(3,160)
      $+fa(3,161)+fa(3,162)+fa(3,163)+fa(3,164)+fa(3,165)+fa(3,166)
      $+fa(3,167)+fa(3,168)+fa(3,169)+fa(3,170)
      $+fa(3,171)+fa(3,172)+fa(3,173)+fa(3,174)+fa(3,175)+fa(3,176)
      $+fa(3,177)+fa(3,178)+fa(3,179)+fa(3,180)
      $+fa(3,181)+fa(3,182)+fa(3,183)+fa(3,184)+fa(3,185)+fa(3,186)
      $+fa(3,187)+fa(3,188)+fa(3,189)+fa(3,190)
      $+fa(3,191)+fa(3,192)+fa(3,193)+fa(3,194)+fa(3,195)+fa(3,196)
      $+fa(3,197)+fa(3,198)+fa(3,199)+fa(3,200)
      $+fa(3,201)+fa(3,202)+fa(3,203)+fa(3,204)+fa(3,205)+fa(3,206)
      $+fa(3,207)+fa(3,208)+fa(3,209)+fa(3,210)

      tmass=amass(151)+amass(152)+amass(153)+amass(154)+amass(155)
      $ +amass(156)+amass(157)+amass(158)+amass(159)+amass(160)
      $ +amass(161)+amass(162)+amass(163)+amass(164)+amass(165)
      $ +amass(166)+amass(167)+amass(168)+amass(169)+amass(170)
      $ +amass(171)+amass(172)+amass(173)+amass(174)+amass(175)
      $ +amass(176)+amass(177)+amass(178)+amass(179)+amass(180)
      $ +amass(181)+amass(182)+amass(183)+amass(184)+amass(185)
      $ +amass(186)+amass(187)+amass(188)+amass(189)+amass(190)
      $ +amass(191)+amass(192)+amass(193)+amass(194)+amass(195)
      $ +amass(196)+amass(197)+amass(198)+amass(199)+amass(200)
      $ +amass(201)+amass(202)+amass(203)+amass(204)+amass(205)
      $ +amass(206)+amass(207)+amass(208)+amass(209)+amass(210)

       fa(3,151) = fz * amass(151)/tmass
       fa(3,152) = fz * amass(152)/tmass
       fa(3,153) = fz * amass(153)/tmass
       fa(3,154) = fz * amass(154)/tmass
       fa(3,155) = fz * amass(155)/tmass
       fa(3,156) = fz * amass(156)/tmass
       fa(3,157) = fz * amass(157)/tmass
       fa(3,158) = fz * amass(158)/tmass
       fa(3,159) = fz * amass(159)/tmass
       fa(3,160) = fz * amass(160)/tmass
       fa(3,161) = fz * amass(161)/tmass
       fa(3,162) = fz * amass(162)/tmass
       fa(3,163) = fz * amass(163)/tmass
       fa(3,164) = fz * amass(164)/tmass
       fa(3,165) = fz * amass(165)/tmass
       fa(3,166) = fz * amass(166)/tmass
       fa(3,167) = fz * amass(167)/tmass
       fa(3,168) = fz * amass(168)/tmass
       fa(3,169) = fz * amass(169)/tmass
       fa(3,170) = fz * amass(170)/tmass
       fa(3,171) = fz * amass(171)/tmass
       fa(3,172) = fz * amass(172)/tmass
       fa(3,173) = fz * amass(173)/tmass
       fa(3,174) = fz * amass(174)/tmass
       fa(3,175) = fz * amass(175)/tmass
       fa(3,176) = fz * amass(176)/tmass
       fa(3,177) = fz * amass(177)/tmass
       fa(3,178) = fz * amass(178)/tmass
       fa(3,179) = fz * amass(179)/tmass
       fa(3,180) = fz * amass(180)/tmass
       fa(3,181) = fz * amass(181)/tmass
       fa(3,182) = fz * amass(182)/tmass
       fa(3,183) = fz * amass(183)/tmass
       fa(3,184) = fz * amass(184)/tmass
       fa(3,185) = fz * amass(185)/tmass
       fa(3,186) = fz * amass(186)/tmass
       fa(3,187) = fz * amass(187)/tmass
       fa(3,188) = fz * amass(188)/tmass
       fa(3,189) = fz * amass(189)/tmass
       fa(3,190) = fz * amass(190)/tmass
       fa(3,191) = fz * amass(191)/tmass
       fa(3,192) = fz * amass(192)/tmass
       fa(3,193) = fz * amass(193)/tmass
       fa(3,194) = fz * amass(194)/tmass
       fa(3,195) = fz * amass(195)/tmass
       fa(3,196) = fz * amass(196)/tmass
       fa(3,197) = fz * amass(197)/tmass
       fa(3,198) = fz * amass(198)/tmass
       fa(3,199) = fz * amass(199)/tmass
       fa(3,200) = fz * amass(200)/tmass
       fa(3,201) = fz * amass(201)/tmass
       fa(3,202) = fz * amass(202)/tmass
       fa(3,203) = fz * amass(203)/tmass
       fa(3,204) = fz * amass(204)/tmass
       fa(3,205) = fz * amass(205)/tmass
       fa(3,206) = fz * amass(206)/tmass
       fa(3,207) = fz * amass(207)/tmass
       fa(3,208) = fz * amass(208)/tmass
       fa(3,209) = fz * amass(209)/tmass
       fa(3,210) = fz * amass(210)/tmass

       fa(1,151) = 0.0d0
       fa(1,152) = 0.0d0
       fa(1,153) = 0.0d0
       fa(1,154) = 0.0d0
       fa(1,155) = 0.0d0
       fa(1,156) = 0.0d0
       fa(1,157) = 0.0d0
       fa(1,158) = 0.0d0
       fa(1,159) = 0.0d0
       fa(1,160) = 0.0d0
       fa(1,161) = 0.0d0
       fa(1,162) = 0.0d0
       fa(1,163) = 0.0d0
       fa(1,164) = 0.0d0
       fa(1,165) = 0.0d0
       fa(1,166) = 0.0d0
       fa(1,167) = 0.0d0
       fa(1,168) = 0.0d0
       fa(1,169) = 0.0d0
       fa(1,170) = 0.0d0
       fa(1,171) = 0.0d0
       fa(1,172) = 0.0d0
       fa(1,173) = 0.0d0
       fa(1,174) = 0.0d0
       fa(1,175) = 0.0d0
       fa(1,176) = 0.0d0
       fa(1,177) = 0.0d0
       fa(1,178) = 0.0d0
       fa(1,179) = 0.0d0
       fa(1,180) = 0.0d0
       fa(1,181) = 0.0d0
       fa(1,182) = 0.0d0
       fa(1,183) = 0.0d0
       fa(1,184) = 0.0d0
       fa(1,185) = 0.0d0
       fa(1,186) = 0.0d0
       fa(1,187) = 0.0d0
       fa(1,188) = 0.0d0
       fa(1,189) = 0.0d0
       fa(1,190) = 0.0d0
       fa(1,191) = 0.0d0
       fa(1,192) = 0.0d0
       fa(1,193) = 0.0d0
       fa(1,194) = 0.0d0
       fa(1,195) = 0.0d0
       fa(1,196) = 0.0d0
       fa(1,197) = 0.0d0
       fa(1,198) = 0.0d0
       fa(1,199) = 0.0d0
       fa(1,200) = 0.0d0
       fa(1,201) = 0.0d0
       fa(1,202) = 0.0d0
       fa(1,203) = 0.0d0
       fa(1,204) = 0.0d0
       fa(1,205) = 0.0d0
       fa(1,206) = 0.0d0
       fa(1,207) = 0.0d0
       fa(1,208) = 0.0d0
       fa(1,209) = 0.0d0
       fa(1,210) = 0.0d0

       fa(2,151) = 0.0d0
       fa(2,152) = 0.0d0
       fa(2,153) = 0.0d0
       fa(2,154) = 0.0d0
       fa(2,155) = 0.0d0
       fa(2,156) = 0.0d0
       fa(2,157) = 0.0d0
       fa(2,158) = 0.0d0
       fa(2,159) = 0.0d0
       fa(2,160) = 0.0d0
       fa(2,161) = 0.0d0
       fa(2,162) = 0.0d0
       fa(2,163) = 0.0d0
       fa(2,164) = 0.0d0
       fa(2,165) = 0.0d0
       fa(2,166) = 0.0d0
       fa(2,167) = 0.0d0
       fa(2,168) = 0.0d0
       fa(2,169) = 0.0d0
       fa(2,170) = 0.0d0
       fa(2,171) = 0.0d0
       fa(2,172) = 0.0d0
       fa(2,173) = 0.0d0
       fa(2,174) = 0.0d0
       fa(2,175) = 0.0d0
       fa(2,176) = 0.0d0
       fa(2,177) = 0.0d0
       fa(2,178) = 0.0d0
       fa(2,179) = 0.0d0
       fa(2,180) = 0.0d0
       fa(2,181) = 0.0d0
       fa(2,182) = 0.0d0
       fa(2,183) = 0.0d0
       fa(2,184) = 0.0d0
       fa(2,185) = 0.0d0
       fa(2,186) = 0.0d0
       fa(2,187) = 0.0d0
       fa(2,188) = 0.0d0
       fa(2,189) = 0.0d0
       fa(2,190) = 0.0d0
       fa(2,191) = 0.0d0
       fa(2,192) = 0.0d0
       fa(2,193) = 0.0d0
       fa(2,194) = 0.0d0
       fa(2,195) = 0.0d0
       fa(2,196) = 0.0d0
       fa(2,197) = 0.0d0
       fa(2,198) = 0.0d0
       fa(2,199) = 0.0d0
       fa(2,200) = 0.0d0
       fa(2,201) = 0.0d0
       fa(2,202) = 0.0d0
       fa(2,203) = 0.0d0
       fa(2,204) = 0.0d0
       fa(2,205) = 0.0d0
       fa(2,206) = 0.0d0
       fa(2,207) = 0.0d0
       fa(2,208) = 0.0d0
       fa(2,209) = 0.0d0
       fa(2,210) = 0.0d0

       ntcon=358

      end subroutine

1 个答案:

答案 0 :(得分:6)

您的程序是固定形式的Fortran源代码,但您将其放在后缀为newgeneration.append(BreedMostFit(FindMostFit(genFirstGen())))的文件中。该后缀用于自由格式的来源。将文件重命名为后缀.f90。另一种选择是传递给gfortran选项.f,它告诉它将文件视为固定格式,而不管文件后缀如何。

还要确保在第六列中包含所有续行-ffixed-form,否则您将收到其他错误。