24小时热门版块排行榜    

查看: 1477  |  回复: 4

superrice

木虫 (正式写手)

[求助] Fortran90 编译不通过 已有2人参与

请问大神是什么情况,还有怎么能把那个讨厌的默认表情快捷键给去掉啊

subroutine laplacian(f, lapl)

  implicit none

  real(8), intent(in)  :: f(N, N)    ! function whose laplacian is to be taken
  real(8), intent(out) :: lapl(N, N) ! the laplacian


  lapl = 0.0_8


  integer :: ix, iy, k

  integer, parameter :: order = 4
  real(8), allocatable :: c(


  allocate(c(-orderrder))
  c(-orderrder) = (/ &  ! The coefficients of the laplacian...
      -1.785714d-3, 2.539683d-2, -0.2d0, 1.6d0,      &
      -2.847222d0,                                   &
      1.6d0, -0.2d0, 2.539683d-2, -1.785714d-3 /)


  do ix = 1, N
    do iy = 1, N
      lapl(ix, iy) = (0.0_8, 0.0_8)
      do k = -order, order
        if(iy+k>=1 .and. iy+k<=N) lapl(ix, iy) = lapl(ix, iy) + c(k)*f(ix, iy+k)
        if(ix+k>=1 .and. ix+k<=N) lapl(ix, iy) = lapl(ix, iy) + c(k)*f(ix+k, iy)
      end do
    end do
  end do

  lapl = lapl/delta**2


错误:
integer :: ix, iy, k
                      1
Error: Unexpected data declaration statement at (1)
mesh.f90:129.33:

  integer, parameter :: order = 4
                                 1
Error: Unexpected data declaration statement at (1)
mesh.f90:130.30:

  real(8), allocatable :: c(
                              1
Error: Unexpected data declaration statement at (1)
mesh.f90:133.12:

  allocate(c(-orderrder))
            1
Error: Syntax error in ALLOCATE statement at (1)
mesh.f90:134.2:

  c(-orderrder) = (/ &  ! The coefficients of the laplacian...
  1
Error: Unclassifiable statement at (1)
mesh.f90:181.22:

  integer :: ix, iy, k
                      1
Error: Unexpected data declaration statement at (1)
mesh.f90:183.33:

  integer, parameter :: order = 4
                                 1
Error: Unexpected data declaration statement at (1)
mesh.f90:184.30:

  real(8), allocatable :: c(
                              1
Error: Unexpected data declaration statement at (1)
mesh.f90:186.12:

  allocate(c(-orderrder))
            1
Error: Syntax error in ALLOCATE statement at (1)
mesh.f90:187.2:

  c(-orderrder) = (/ &  ! The coefficients of the laplacian...
  1
Error: Unclassifiable statement at (1)
mesh.f90:192.7:

  do ix = 1, N
       1
Error: Symbol 'ix' at (1) has no IMPLICIT type
mesh.f90:193.9:

    do iy = 1, N
         1
Error: Symbol 'iy' at (1) has no IMPLICIT type
mesh.f90:195.10:

      do k = -order, order
          1
Error: Symbol 'k' at (1) has no IMPLICIT type
mesh.f90:195.19:

      do k = -order, order
                   1
Error: Symbol 'order' at (1) has no IMPLICIT type
mesh.f90:140.7:

  do ix = 1, N
       1
Error: Symbol 'ix' at (1) has no IMPLICIT type
mesh.f90:141.9:

    do iy = 1, N
         1
Error: Symbol 'iy' at (1) has no IMPLICIT type
mesh.f90:143.10:

      do k = -order, order
          1
Error: Symbol 'k' at (1) has no IMPLICIT type
mesh.f90:143.19:

      do k = -order, order
                   1
Error: Symbol 'order' at (1) has no IMPLICIT type
make[2]: *** [mesh.o] Error 1
make[2]: Leaving directory `/public/home/qishengzhang/chaowang/script/qd-0.1.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/public/home/qishengzhang/chaowang/script/qd-0.1.0'
make: *** [all] Error 2
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

未岸亡灵

铁杆木虫 (著名写手)

暂时离开小木虫


【答案】应助回帖

感谢参与,应助指数 +1
你可以上传附件,帮你看看。这个表情也真逗
2楼2016-09-26 15:22:18
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
CODE:
...

3楼2016-09-26 16:00:26
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

漏网之渔

铁虫 (初入文坛)

【答案】应助回帖

N,delta没定义,语句顺序问题:

subroutine laplacian(f,lapl,N,delta)

   implicit none
   integer :: N,ix,iy,k
   real(8):: delta
   real(8),intent(in)  :: f(N,N)    ! function whose laplacian is to be taken
   real(8),intent(out) :: lapl(N,N) ! the laplacian

   integer,parameter :: order = 4
   real(8),allocatable:: C(

   lapl = 0.0_8

   allocate(c(order+order+1))

   c(-orderrder) = (/ &  ! The coefficients of the laplacian...
       -1.785714d-3,2.539683d-2,-0.2d0,1.6d0,     &
       -2.847222d0,                                  &
       1.6d0,-0.2d0,2.539683d-2,-1.785714d-3 /)


   do ix = 1,N
     do iy = 1,N
       lapl(ix,iy) = (0.0_8,0.0_8)
       do k = -order,order
         if(iy+k>=1 .and. iy+k<=N) lapl(ix,iy) = lapl(ix,iy) + c(k)*f(ix,iy+k)
         if(ix+k>=1 .and. ix+k<=N) lapl(ix,iy) = lapl(ix,iy) + c(k)*f(ix+k,iy)
       end do
     end do
   end do

   lapl = lapl/delta**2

end
4楼2016-10-02 11:25:05
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

漏网之渔

铁虫 (初入文坛)

【答案】应助回帖

系统把":"和"",以及":"与"o" 合并成表情符号了,在冒号后面加上空格就可避免。
subroutine laplacian(f,lapl,N,delta)

   implicit none
   integer :: N,ix,iy,k
   real(8):: delta
   real(8),intent(in)  :: f(N,N)    ! function whose laplacian is to be taken
   real(8),intent(out) :: lapl(N,N) ! the laplacian

   integer,parameter :: order = 4
   real(8),allocatable:: C(: )

   lapl = 0.0_8

   allocate(c(order+order+1))

   c(-order: order) = (/ &  ! The coefficients of the laplacian...
       -1.785714d-3,2.539683d-2,-0.2d0,1.6d0,     &
       -2.847222d0,                                  &
       1.6d0,-0.2d0,2.539683d-2,-1.785714d-3 /)


   do ix = 1,N
     do iy = 1,N
       lapl(ix,iy) = (0.0_8,0.0_8)
       do k = -order,order
         if(iy+k>=1 .and. iy+k<=N) lapl(ix,iy) = lapl(ix,iy) + c(k)*f(ix,iy+k)
         if(ix+k>=1 .and. ix+k<=N) lapl(ix,iy) = lapl(ix,iy) + c(k)*f(ix+k,iy)
       end do
     end do
   end do

   lapl = lapl/delta**2

end
5楼2016-10-02 11:39:58
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 superrice 的主题更新
信息提示
请填处理意见