24小时热门版块排行榜    

查看: 2160  |  回复: 18

snoopyzhao

至尊木虫 (职业作家)

★ ★ ★
余泽成(金币+3): 辛苦了! 2012-03-11 23:27:47
引用回帖:
9楼: Originally posted by zhaohuxian at 2012-03-08 10:54:37:
谢谢您的热心帮助,根据帖子里的错误信息,我改了程序:
        program angle
        !Define the parameters

      parameter (x=1000)
      parameter (y=1000)
      parameter (radtodeg=57.29577951d0)

        in ...

把下面的错误更正了再说……
CODE:
C:\Documents and Settings\Administrator\Desktop>gfortran -Wall zf.f90
zf.f90:13.19:

      dimension dx(x,y), dy(x,y), dz(x,y)
                   1
Error: Expression at (1) must be of INTEGER type, found REAL
zf.f90:13.21:

      dimension dx(x,y), dy(x,y), dz(x,y)
                     1
Error: Expression at (1) must be of INTEGER type, found REAL
zf.f90:13.18:

      dimension dx(x,y), dy(x,y), dz(x,y)
                  1
Error: The module or main program array 'dx' at (1) must have constant shape
zf.f90:13.28:

      dimension dx(x,y), dy(x,y), dz(x,y)
                            1
Error: Expression at (1) must be of INTEGER type, found REAL
zf.f90:13.30:

      dimension dx(x,y), dy(x,y), dz(x,y)
                              1
Error: Expression at (1) must be of INTEGER type, found REAL
zf.f90:13.27:

      dimension dx(x,y), dy(x,y), dz(x,y)
                           1
Error: The module or main program array 'dy' at (1) must have constant shape
zf.f90:13.37:

      dimension dx(x,y), dy(x,y), dz(x,y)
                                     1
Error: Expression at (1) must be of INTEGER type, found REAL
zf.f90:13.39:

      dimension dx(x,y), dy(x,y), dz(x,y)
                                       1
Error: Expression at (1) must be of INTEGER type, found REAL
zf.f90:13.36:

      dimension dx(x,y), dy(x,y), dz(x,y)
                                    1
Error: The module or main program array 'dz' at (1) must have constant shape
zf.f90:9.22:

        integer iatom(x)
                      1
Error: Expression at (1) must be of INTEGER type, found REAL
zf.f90:9.24:

        integer iatom(x)
                        1
Error: The module or main program array 'iatom' at (1) must have constant shape
zf.f90:16.24:

      character*4 lable(x), latom(x,y)
                        1
Error: Expression at (1) must be of INTEGER type, found REAL
zf.f90:16.26:

      character*4 lable(x), latom(x,y)
                          1
Error: The module or main program array 'lable' at (1) must have constant shape
zf.f90:16.34:

      character*4 lable(x), latom(x,y)
                                  1
Error: Expression at (1) must be of INTEGER type, found REAL
zf.f90:16.36:

      character*4 lable(x), latom(x,y)
                                    1
Error: Expression at (1) must be of INTEGER type, found REAL
zf.f90:16.38:

      character*4 lable(x), latom(x,y)
                                      1
Error: The module or main program array 'latom' at (1) must have constant shape
zf.f90:106.22:

        open (11,file=opsition)
                      1
Error: FILE tag at (1) must be of type CHARACTER
zf.f90:117.14:

        close(con)
              1
Error: UNIT tag at (1) must be of type INTEGER

» 本帖已获得的红花(最新10朵)

11楼2012-03-08 12:47:36
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

sxf2012

木虫 (正式写手)

声明x,y为整数类型
integer,parameter :: x = 1000
integer,parameter :: y = 1000
12楼2012-03-09 08:58:31
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

sxf2012

木虫 (正式写手)

你的这句声明
"implicit real*8(a-h,o-z)
      parameter (x=10000)
      parameter (y=10000)
"
使得x和y为双精度了
13楼2012-03-09 09:03:48
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

zhaohuxian

木虫 (正式写手)

送鲜花一朵
引用回帖:
: Originally posted by snoopyzhao at 2012-03-08 12:47:36:
把下面的错误更正了再说……


C:\Documents and Settings\Administrator\Desktop>gfortran -Wall zf.f90
zf.f90:13.19:

      dimension dx(x,y), dy(x,y), dz(x,y)
                   1
Error: E ...

program angle
        !Define the parameters

      integer,parameter :: x = 1000
      integer,parameter :: y = 1000

      parameter (radtodeg=57.29577951d0)

        integer i, j, atomkind, lower, upper
        integer iatom(x)


      dimension rv(3,3),temp(6)
      dimension dx(x,y), dy(x,y), dz(x,y)

      character(len=132) line, system
      character*4 lable(x), latom(x,y)

      double precision lattice

      logical eof, con_ex, out_ex

        eof=.false.
        con_ex=.false.
        out_ex=.false.

        ! Check the required files
       
        inquire(file='OUTCAR',exist=out_ex)
        inquire(file='CONTCAR',exist=con_ex)

        if (.not. out_ex) then
        print *, "OUTCAR: file not exist."
        stop
        end if

        if (.not. con_ex) then
        print *, "CONTCAR: file not exist."
        stop
        end if

        ! Read the species in OUTCAR

        open(unit=11,file='OUTCAR',status='OLD')
        atomkind=0
        do while(.not.eof)
          read(11,*,end=10) line
          if(index(line,'VRHFIN').ne.0) then
            atomkind=atomkind+1
            upper=index(line,':')-1
            lower=index(line,'=')+1
            lable(atomkind)=line(lower:upper)
          end if
        end do
        close(11)
10        continue

      ! Read POSCAR to process lattice information and amount of each kind

        open(unit=12,file='CONTCAR',status='OLD')
        read(12,*,end=20) system
        read(12,*,end=20) lattice
        read(12,*,end=20) rv(1,1), rv(2,1), rv(3,1)
        read(12,*,end=20) rv(1,2), rv(2,2), rv(3,2)
        read(12,*,end=20) rv(1,3), rv(2,3), rv(3,3)
        read(12,*,end=20), (iatom(i), i=1,atomkind)
        close(12)

        ! Process the label list
        do i=1,atomkind
          do j=1,iatom(i)
             latom(j,i)=lable(i)
          end do
        end do

        do i=1,3
          temp(i)=0.0
          do j=1,3
            temp(i)=temp(i)+rv(j,i)**2
          end do
          temp(i)=sqrt(temp(i))
        end do
        a=temp(1)
        b=temp(2)
        c=temp(3)

        do i=1,3
          temp(3+i)=0.0
        end do

        do j=1,3
          temp(4)=temp(4)+rv(j,2)*rv(j,3)
          temp(5)=temp(5)+rv(j,1)*rv(j,3)
          temp(6)=temp(6)+rv(j,1)*rv(j,2)
        end do
        temp(4)=temp(4)/(temp(2)*temp(3))
        temp(5)=temp(5)/(temp(1)*temp(3))
        temp(6)=temp(6)/(temp(1)*temp(2))

        alpha=radtodeg*acos(temp(4))
        beta=radtodeg*acos(temp(5))
        gamma=radtodeg*acos(temp(6))

20    continue
      
      ! Open file for record, and write

        open (21,file=opsition)
        write(21,300) system
        write(21,300) "lattice lengths: "
        write(21,300) "a=", a
        write(21,300) "b=", b
        write(21,300) "c=", c
        write(21,300) "lattice angles: "
        write(21,300) "alpha=", alpha
        write(21,300) "beta=", beta
        write(21,300) "gamma=", gamma

        close(21)


        ! Read OUTCAR to process the coordinates

        open(unit=11,file='OUTCAR',status='OLD')
      open (21,file=opsition)
        do while(.not.eof)
          read(11,*,end=30) line
          if (index(line,'POSITION').ne.0) then
          read(11,*,end=30) line
          
            do i=1,atomkind
              do j=1,iatom(i)
                read(11,*,end=30) dx(j,i), dy(j,i), dz(j,i)
                write(21,300) latom(j,i), dx(j,i), dy(j,i), dz(j,i)
              end do
            end do

          end if
        end do
        close(11)
        close(21)
30    continue
      
300        format(a4,1x,3f15.9,1x,a4,1x,i4,2(1x,a2),1x,f8.4,1x,i4)

      stop
        end



谢谢,修改好了,x、y的声明错了
14楼2012-03-09 09:16:09
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

snoopyzhao

至尊木虫 (职业作家)

引用回帖:
14楼: Originally posted by zhaohuxian at 2012-03-09 09:16:09:
program angle
        !Define the parameters

      integer,parameter :: x = 1000
      integer,parameter :: y = 1000

      parameter (radtodeg=57.29577951d0)

        integer i, j, atomkind, lower, u ...

还有错误……
CODE:
zf.f90:108.22:

        open (21,file=opsition)
                      1
Error: FILE tag at (1) must be of type CHARACTER
zf.f90:125.20:

      open (21,file=opsition)
                    1
Error: FILE tag at (1) must be of type CHARACTER

» 本帖已获得的红花(最新10朵)

15楼2012-03-09 10:04:21
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

zhaohuxian

木虫 (正式写手)

送鲜花一朵
引用回帖:
: Originally posted by snoopyzhao at 2012-03-09 10:04:21:
还有错误……


zf.f90:108.22:

        open (21,file=opsition)
                      1
Error: FILE tag at (1) must be of type CHARACTER
zf.f90:125.20:

      open (21,file=opsition)
    ...

program angle
      !Define the parameters

      integer,parameter :: x = 1000
      integer,parameter :: y = 1000

      parameter (radtodeg=57.29577951d0)

        integer i, j, atomkind, lower, upper
        integer iatom(x)


      dimension rv(3,3),temp(6)
      dimension dx(x,y), dy(x,y), dz(x,y)

      character(len=132) line, system, opsition
      character*4 lable(x), latom(x,y)

      double precision lattice

      logical eof, con_ex, out_ex

        eof=.false.
        con_ex=.false.
        out_ex=.false.

        ! Check the required files
        
        inquire(file='OUTCAR',exist=out_ex)
        inquire(file='CONTCAR',exist=con_ex)

        if (.not. out_ex) then
        print *, "OUTCAR: file not exist."
        stop
        end if

        if (.not. con_ex) then
        print *, "CONTCAR: file not exist."
        stop
        end if

        ! Read the species in OUTCAR

        open(unit=11,file='OUTCAR',status='OLD')
        atomkind=0
        do while(.not.eof)
          read(11,*,end=10) line
          if(index(line,'VRHFIN').ne.0) then
            atomkind=atomkind+1
            upper=index(line,':')-1
            lower=index(line,'=')+1
            lable(atomkind)=line(lower:upper)
          end if
        end do
        close(11)
10        continue

      ! Read POSCAR to process lattice information and amount of each kind

        open(unit=12,file='CONTCAR',status='OLD')
        read(12,*,end=20) system
        read(12,*,end=20) lattice
        read(12,*,end=20) rv(1,1), rv(2,1), rv(3,1)
        read(12,*,end=20) rv(1,2), rv(2,2), rv(3,2)
        read(12,*,end=20) rv(1,3), rv(2,3), rv(3,3)
        read(12,*,end=20), (iatom(i), i=1,atomkind)
        close(12)

        ! Process the label list
        do i=1,atomkind
          do j=1,iatom(i)
             latom(j,i)=lable(i)
          end do
        end do

        do i=1,3
          temp(i)=0.0
          do j=1,3
            temp(i)=temp(i)+rv(j,i)**2
          end do
          temp(i)=sqrt(temp(i))
        end do
        a=temp(1)
        b=temp(2)
        c=temp(3)

        do i=1,3
          temp(3+i)=0.0
        end do

        do j=1,3
          temp(4)=temp(4)+rv(j,2)*rv(j,3)
          temp(5)=temp(5)+rv(j,1)*rv(j,3)
          temp(6)=temp(6)+rv(j,1)*rv(j,2)
        end do
        temp(4)=temp(4)/(temp(2)*temp(3))
        temp(5)=temp(5)/(temp(1)*temp(3))
        temp(6)=temp(6)/(temp(1)*temp(2))

        alpha=radtodeg*acos(temp(4))
        beta=radtodeg*acos(temp(5))
        gamma=radtodeg*acos(temp(6))

20    continue
      
      ! Open file for record, and write

        open (21,file=opsition)
        write(21,300) system
        write(21,300) "lattice lengths: "
        write(21,300) "a=", a
        write(21,300) "b=", b
        write(21,300) "c=", c
        write(21,300) "lattice angles: "
        write(21,300) "alpha=", alpha
        write(21,300) "beta=", beta
        write(21,300) "gamma=", gamma

        close(21)


        ! Read OUTCAR to process the coordinates

        open(unit=11,file='OUTCAR',status='OLD')
      open (21,file=opsition)
        do while(.not.eof)
          read(11,*,end=30) line
          if (index(line,'POSITION').ne.0) then
          read(11,*,end=30) line
         
            do i=1,atomkind
              do j=1,iatom(i)
                read(11,*,end=30) dx(j,i), dy(j,i), dz(j,i)
                write(21,300) latom(j,i), dx(j,i), dy(j,i), dz(j,i)
              end do
            end do

          end if
        end do
        close(11)
        close(21)
30    continue
      
300        format(a4,1x,3f15.9,1x,a4,1x,i4,2(1x,a2),1x,f8.4,1x,i4)

      stop
      end

增加文件名的字符定义
谢谢
16楼2012-03-09 10:24:50
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

snoopyzhao

至尊木虫 (职业作家)

现在还有问题吗?至少我这里编译没有什么问题了……

» 本帖已获得的红花(最新10朵)

17楼2012-03-09 10:38:04
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

zhaohuxian

木虫 (正式写手)

送鲜花一朵
引用回帖:
: Originally posted by snoopyzhao at 2012-03-09 10:38:04:
现在还有问题吗?至少我这里编译没有什么问题了……

Loaded 'ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.


编译是通过了,但是运行的时候出现了这个debug信息,想问一下为啥,谢谢
18楼2012-03-09 10:48:48
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

snoopyzhao

至尊木虫 (职业作家)


余泽成(金币+1): 谢谢参与应助! 2012-03-11 23:28:34
引用回帖:
18楼: Originally posted by zhaohuxian at 2012-03-09 10:48:48:
Loaded 'ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.


编译是通过了,但是运行的时候出现了这个debug信息 ...

这是你编译器的问题吧,至少在我这里没有任何问题,当然,我没有办法运用它,毕意缺少必要的输入文件……
19楼2012-03-09 12:14:43
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 zhaohuxian 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 346求调剂[0856] +4 WayneLim327 2026-03-16 7/350 2026-03-21 04:02 by JourneyLucky
[考研] 一志愿天津大学化学工艺专业(081702)315分求调剂 +12 yangfz 2026-03-17 12/600 2026-03-21 03:30 by JourneyLucky
[考研] 265求调剂 +3 Jack?k?y 2026-03-17 3/150 2026-03-21 03:17 by JourneyLucky
[考研] 301求调剂 +10 yy要上岸呀 2026-03-17 10/500 2026-03-21 03:14 by JourneyLucky
[考研] 初始318分求调剂(有工作经验) +3 1911236844 2026-03-17 3/150 2026-03-21 02:33 by JourneyLucky
[考研] 265求调剂 +9 梁梁校校 2026-03-17 9/450 2026-03-21 02:17 by JourneyLucky
[考研] 294求调剂材料与化工专硕 +15 陌の森林 2026-03-18 15/750 2026-03-20 23:28 by JourneyLucky
[考研] 329求调剂 +9 想上学吖吖 2026-03-19 9/450 2026-03-20 22:01 by luoyongfeng
[考研] 一志愿武理材料工程348求调剂 +3  ̄^ ̄゜汗 2026-03-19 4/200 2026-03-20 21:01 by zhukairuo
[考研] 环境工程调剂 +9 大可digkids 2026-03-16 9/450 2026-03-20 17:38 by 醉在风里
[考研] 一志愿福大288有机化学,求调剂 +3 小木虫200408204 2026-03-18 3/150 2026-03-19 13:31 by houyaoxu
[考研] 0817调剂 +3 没有答案_ 2026-03-14 3/150 2026-03-19 09:51 by Xu de nuo
[考研] 本科郑州大学物理学院,一志愿华科070200学硕,346求调剂 +4 我不是一根葱 2026-03-18 4/200 2026-03-19 09:11 by 浮云166
[考研] 312求调剂 +8 陌宸希 2026-03-16 9/450 2026-03-18 12:39 by Linda Hu
[考研] 0854,计算机类招收调剂 +3 胡辣汤放糖 2026-03-15 6/300 2026-03-18 12:09 by 上岸上岸……..
[考研] 326求调剂 +5 上岸的小葡 2026-03-15 6/300 2026-03-17 17:26 by ruiyingmiao
[考研] 一志愿苏州大学材料工程(085601)专硕有科研经历三项国奖两个实用型专利一项省级立项 +6 大火山小火山 2026-03-16 8/400 2026-03-17 15:05 by 无懈可击111
[考研] 一志愿南京大学,080500材料科学与工程,调剂 +4 Jy? 2026-03-16 4/200 2026-03-17 11:02 by gaoqiong
[考研] 283求调剂 +3 听风就是雨; 2026-03-16 3/150 2026-03-17 07:41 by 热情沙漠
[考研] 085601材料工程315分求调剂 +3 yang_0104 2026-03-15 3/150 2026-03-15 10:58 by peike
信息提示
请填处理意见