24小时热门版块排行榜    

北京石油化工学院2026年研究生招生接收调剂公告
查看: 1545  |  回复: 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 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 266分,一志愿电气工程,本科材料,求材料专业调剂 +8 哇呼哼呼哼 2026-04-01 8/400 2026-04-01 21:41 by cal0306
[考研] 材料专硕调剂 +17 椰椰。 2026-03-29 17/850 2026-04-01 20:44 by cq2548
[考研] 26考研调剂 +3 Wnz.20030617 2026-04-01 3/150 2026-04-01 17:22 by salamander`
[考研] 085600,材料与化工321分,求调剂 +11 大馋小子 2026-03-27 11/550 2026-04-01 16:10 by cymywx
[考研] 总分343,求生物学调剂 +6 深刻的凯撒 2026-03-26 6/300 2026-04-01 15:58 by 2007huanle
[考研] 085900土木水利336分求调剂 +3 Zhangjiangj 2026-03-31 5/250 2026-04-01 09:14 by Zhangjiangj
[考研] 299求调剂 +8 嗯嗯嗯嗯2 2026-03-27 8/400 2026-03-31 18:23 by lizhi8172
[考研] 学硕274求调剂 +17 Li李鱼 2026-03-26 17/850 2026-03-31 15:19 by 客尔美德
[考研] 22408 359分调剂 +4 Qshers 2026-03-27 8/400 2026-03-31 08:53 by Qshers
[考研] 一志愿北京化工大学材料与化工(085600)296求调剂 +25 稻妻小编 2026-03-26 25/1250 2026-03-30 20:11 by 滴滴上岸呀
[考研] 0703化学321分求调剂 +10 三dd. 2026-03-30 11/550 2026-03-30 19:24 by markhwc
[考研] 0703化学求调剂 +6 丹青奶盖 2026-03-26 8/400 2026-03-30 18:33 by 探123
[考研] 一志愿南开大学0710生物学359求调剂 +5 兔兔兔111223314 2026-03-29 7/350 2026-03-30 18:29 by 兔兔兔111223314
[考研] 一志愿中南大学化学0703总分337求调剂 +6 niko- 2026-03-27 6/300 2026-03-30 10:25 by herarysara
[考研] 295求调剂 +5 wei-5 2026-03-26 5/250 2026-03-30 08:34 by 探123
[考研] 279求调剂 +4 蝶舞轻绕 2026-03-29 4/200 2026-03-29 09:45 by laoshidan
[考研] 305求调剂 +8 RuiFairyrui 2026-03-28 8/400 2026-03-29 08:22 by fmesaito
[考研] 本科新能源科学与工程,一志愿华理能动285求调剂 +3 AZMK 2026-03-27 5/250 2026-03-28 16:19 by xxxsssccc
[考研] 265求调剂 +8 小木虫085600 2026-03-27 8/400 2026-03-27 22:16 by 无际的草原
[考研] 复试调剂,一志愿南农083200食品科学与工程 +5 XQTJZ 2026-03-26 5/250 2026-03-27 14:49 by 狂炫麦当当
信息提示
请填处理意见