编译

时间:2017-10-08 10:42:29

标签: fortran

这是我正在使用的代码的一部分

      module bodyforce

      use shared_module

      contains
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

      subroutine openforcingprofile(fx,fy,fz)

c      integer   p1(0:NYforc),p2(0:NYforc),posy1,posy2
      complex*8  :: FXA(0:NY+1,1),FYA(0:NY+1),FZA(0:NY+1),ii,
     &              FXB(0:NY+1),FYB(0:NY+1),FZB(0:NY+1),
     &              FXB(0:NY+1),FYB(0:NY+1),FZB(0:NY+1),
     &              FX(0:NY+1),FY(0:NY+1),FZ(0:NY+1)
      real*8  :: k11real(0:NY_INT-1,0:NY_INT-1),k13real(0:NY_INT-1,0:NY_INT-1),
     &           k21real(0:NY_INT-1,0:NY_INT-1),k23real(0:NY_INT-1,0:NY_INT-1),
     &           k31real(0:NY_INT-1,0:NY_INT-1),k33real(0:NY_INT-1,0:NY_INT-1),
     &           k12real(0:NY_INT-1,0:NY_INT-1),k22real(0:NY_INT-1,0:NY_INT-1),
     &           k32real(0:NY_INT-1,0:NY_INT-1)
c
      real*8  :: k11imag(0:NY_INT-1,0:NY_INT-1),k13imag(0:NY_INT-1,0:NY_INT-1),
     &           k21imag(0:NY_INT-1,0:NY_INT-1),k23imag(0:NY_INT-1,0:NY_INT-1),
     &           k31imag(0:NY_INT-1,0:NY_INT-1),k33imag(0:NY_INT-1,0:NY_INT-1),
     &           k12imag(0:NY_INT-1,0:NY_INT-1),k22imag(0:NY_INT-1,0:NY_INT-1),k32imag(0:NY_INT-1,0:NY_INT-1)
      complex*16 k11(0:NY_INT-1,0:NY_INT-1),k13(0:NY_INT-1,0:NY_INT-1),
     & k21(0:NY_INT-1,0:NY_INT-1),k23(0:NY_INT-1,0:NY_INT-1),
     & k31(0:NY_INT-1,0:NY_INT-1),k33(0:NY_INT-1,0:NY_INT-1),
     & k12(0:NY_INT-1,0:NY_INT-1),k22(0:NY_INT-1,0:NY_INT-1),k32(0:NY_INT-1,0:NY_INT-1)

      ii=sqrt(cmplx(-1.d0,0))

CCCCCCCCC READ SUBMATRICES



      OPEN (91,file= 'inf/matrix_re.dat',form='formatted',status='old')   
      OPEN (92,file= 'inf/matrix_im.dat',form='formatted',status='old')   

       do i=0,NY_INT-1
           READ(91,*) k11real(i,0:NY_INT-1)
       READ(92,*) k11imag(i,0:NY_INT-1)
       end do

我收到一堆错误,包括以下内容:

bodyforce.f(19): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ) , : ] /)
     &           k32real(0:NY_INT-1,0:NY_INT-1)
-----------------------------------------------^
bodyforce.f(24): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ) , : ] /)
     &           k12imag(0:NY_INT-1,0:NY_INT-1),k22imag(0:NY_INT-1,0:NY_INT-1),k32imag(0:NY_INT-1,0:NY_INT-1)
-------------------------------------------------------------------------------------------------------------^
bodyforce.f(28): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ) ,
     & k12(0:NY_INT-1,0:NY_INT-1),k22(0:NY_INT-1,0:NY_INT-1),k32(0:NY_INT-1,0:NY_INT-1)
---------------------------------------------------------------------------------------^
bodyforce.f(73): error #5082: Syntax error, found ':' when expecting one of: )
           READ(91,*) k31real((i,0:NY_INT-1)
----------------------------------^
bodyforce.f(74): error #5082: Syntax error, found ':' when expecting one of: )
           READ(92,*) k31imag((i,0:NY_INT-1)
----------------------------------^
bodyforce.f(89): error #5149: Illegal character in statement label field  [D]
    DO JJ=JSTART,JEND
----^
bodyforce.f(89): error #5082: Syntax error, found ',' when expecting one of: <END-OF-STATEMENT> ;
    DO JJ=JSTART,JEND
----------------^

我坚信他们中的一些是由于空白行和空格的误用造成的,我在FORTRAN中并不是很清楚。你能给我一个见解吗?显然,还有一些其他语法错误。

0 个答案:

没有答案