24小时热门版块排行榜    

查看: 1705  |  回复: 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 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 关于filecode,很负责任的告诉大家 +6 爱看书的可乐 2026-08-08 7/350 2026-08-08 22:13 by a_niu
[考博] 【2027博士申请】纳米药物递送方向 20+3 13586093586 2026-08-03 5/250 2026-08-08 21:54 by 13586093586
[基金申请] 2026国自然放榜时间 +3 布布和一二 2026-08-08 3/150 2026-08-08 18:15 by Lightingo
[基金申请] 国基金的申报应该改成非等额制,评价高的钱多评价低的钱少,但是增加资助率 +7 a089 2026-08-07 7/350 2026-08-08 18:05 by gltch
[基金申请] 售SCI一区T0P文章,我:8.O.55.1.O.54,科目齐全,可+急 +3 qTvzQBRAHjCi 2026-08-07 5/250 2026-08-08 17:02 by oEVWOejN9taj
[基金申请] 售SCI文章,我:8O.5.5.1O.54,科目全,可十急 +3 Vi50GxzrFcSG 2026-08-07 5/250 2026-08-08 16:27 by oEVWOejN9taj
[基金申请] 售SCI-T0P文章,我:8O.5.5.1.O.54,科目齐全,可+急 +3 Vi50GxzrFcSG 2026-08-07 4/200 2026-08-08 16:19 by oEVWOejN9taj
[博后之家] 售SCI一区文章,我:8.O.551.O.5.4,科目全,可伽急 +3 Vi50GxzrFcSG 2026-08-07 4/200 2026-08-08 16:02 by oEVWOejN9taj
[公派出国] 售SCI一区T0P文章,我:8O.55.1.O.5.4,科目齐全,可+急 +3 Vi50GxzrFcSG 2026-08-07 5/250 2026-08-08 15:59 by oEVWOejN9taj
[论文投稿] 售SCI一区文章,我:8.O.55.1.O.54,科目齐全,可伽急 +3 Vi50GxzrFcSG 2026-08-07 6/300 2026-08-08 15:07 by oEVWOejN9taj
[硕博家园] 售SCI一区文章,我:8.O.55.1.O.54,科目齐全,可伽急 +4 HEQlVqMTIA7d 2026-08-07 6/300 2026-08-08 14:47 by oEVWOejN9taj
[博后之家] 售SCI一区T0P文章,我:8O.55.1.O.54,科目全,可伽急 +3 HEQlVqMTIA7d 2026-08-07 6/300 2026-08-08 14:42 by oEVWOejN9taj
[公派出国] 售SCI文章,我:8O5.5.1.O.54,科目齐全,可+急 +3 HEQlVqMTIA7d 2026-08-07 6/300 2026-08-08 14:39 by oEVWOejN9taj
[教师之家] 售SCI一区T0P文章,我:8.O.55.1.O54,科目全,可伽急 +4 HEQlVqMTIA7d 2026-08-07 5/250 2026-08-08 14:27 by oEVWOejN9taj
[论文投稿] 售SCI一区T0P文章,我:8O.55.1.O.5.4,科目齐全,可+急 +3 HEQlVqMTIA7d 2026-08-07 5/250 2026-08-08 14:22 by oEVWOejN9taj
[基金申请] 化学口download_prp&amp;fileCode的固定段好像这几天一直没变,有变的大神么? +3 Tide man 2026-08-07 4/200 2026-08-07 22:39 by Tide man
[基金申请] filecode变化情况 +6 布布和一二 2026-08-07 22/1100 2026-08-07 14:45 by 且听虎啸
[基金申请] filecode +14 等待解的谜 2026-08-06 19/950 2026-08-07 12:20 by wlwhappy
[基金申请] 好消息?这个有何含义??? +8 Tide man 2026-08-05 10/500 2026-08-05 16:14 by xmuxiaoyu
[基金申请] 纯娱乐,不喜欢勿喷 +7 Tide man 2026-08-04 10/500 2026-08-04 15:10 by loufangrui
信息提示
请填处理意见