Znn3bq.jpeg
²é¿´: 2195  |  »Ø¸´: 18
µ±Ç°Ö»ÏÔʾÂú×ãÖ¸¶¨Ìõ¼þµÄ»ØÌû£¬µã»÷ÕâÀï²é¿´±¾»°ÌâµÄËùÓлØÌû

zhaohuxian

ľ³æ (ÕýʽдÊÖ)

[ÇóÖú] Çë´óÏÀ°ïæ¿´Ò»ÏÂÏÂÃæµÄ ³ÌÐò

program angle

        !Define the parameters

      implicit real*8(a-h,o-z)
      parameter (x=10000)
      parameter (y=10000)
      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, out

        eof=.false.
        con=.false.
        out=.false.

        ! Check the required files
       
        inquire(file='OUTCAR',exist=out)
        inquire(file='CONTCAR',exist=con)

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

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

        ! Read the species in OUTCAR

        open(unit=out,file='OUTCAR',status='OLD')
        atomkind=0
        do while(.not.eof)
          read(out,*,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(out)
10        continue

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

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

        ! 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)*tem(3))
        temp(5)=temp(5)/(temp(1)*tem(3))
        temp(6)=temp(6)/(temp(1)*tem(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 (11,file=opsition)
        write(11,300) system
        write(11,300) "lattice lengths: "
        write(11,300) "a=", a
        write(11,300) "b=", b
        write(11,300) "c=", c
        write(11,300) "lattice angles: "
        write(11,300) "alpha=", alpha
        write(11,300) "beta=", beta
        write(11,300) "gamma=", gamma

        close(con)


        ! Read OUTCAR to process the coordinates

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

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

        stop
      end

±àÒëͨ¹ýÁË£¬µ«ÊÇÔÆÐĵÄʱºò±¨´í£º

--------------------Configuration: adf - Win32 Debug--------------------
Linking...
main.obj : error LNK2001: unresolved external symbol _TEM@4
Debug/adf.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

ÀàËÆµÄÁíÍâÒ»¸ö³ÌÐòÔËÐÐûÓÐÎÊÌâ
»Ø¸´´ËÂ¥

» ²ÂÄãϲ»¶

» ±¾Ö÷ÌâÏà¹Ø¼ÛÖµÌùÍÆ¼ö£¬¶ÔÄúͬÑùÓаïÖú:

ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

uboat

Òø³æ (³õÈëÎÄ̳)

¡¾´ð°¸¡¿Ó¦Öú»ØÌû

¡ï
¸Ðл²ÎÓ룬ӦÖúÖ¸Êý +1
jjdg(½ð±Ò+1): ¸ÐлӦÖú 2012-03-08 01:56:28
temp(4)=temp(4)/(temp(2)*tem(3))
        temp(5)=temp(5)/(temp(1)*tem(3))
        temp(6)=temp(6)/(temp(1)*tem(2))

¿´×îºóµÄ´íÎóÌáʾ Ó¦¸ÃÊÇÕâÀïµÄ´íÎó
ÀïÃæÃ»Óж¨ÒåtemµÄ±äÁ¿
Â¥Ö÷ºÃºÃµÄ¿´¿´
4Â¥2012-03-07 22:25:17
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
²é¿´È«²¿ 19 ¸ö»Ø´ð

lurencyj

ľ³æ (ÖøÃûдÊÖ)

¡¾´ð°¸¡¿Ó¦Öú»ØÌû

¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï ¡ï
¸Ðл²ÎÓ룬ӦÖúÖ¸Êý +1
jjdg(½ð±Ò+1): ¸ÐлӦÖú 2012-03-08 01:56:17
zhaohuxian(½ð±Ò+30): ¡ïÓаïÖú 2 2012-03-08 09:01:51
²»ÖªµÀÂ¥Ö÷ÊÇÔõôдµÄ³ÌÐò£¬gfortran±àÒ룬һ´ó¶ÑError£¡
ºÜÅ®×Ӻܹ­Ëä´ó
2Â¥2012-03-07 21:23:48
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

zhaohuxian

ľ³æ (ÕýʽдÊÖ)

ÒýÓûØÌû:
Â¥: Originally posted by lurencyj at 2012-03-07 21:23:48:
²»ÖªµÀÂ¥Ö÷ÊÇÔõôдµÄ³ÌÐò£¬gfortran±àÒ룬һ´ó¶ÑError£¡

²»ºÃÒâ˼£¬ÎÒÒ²ÊǵÚÒ»´Îд³ÌÐò£¬ÎÒÊÇÓÃCVF 6.5±àÒëͨ¹ýµÄ
²»ÖªµÀÄÄÀïÓÐÎÊÌ⣬лл
3Â¥2012-03-07 21:29:07
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

snoopyzhao

ÖÁ×ðľ³æ (Ö°Òµ×÷¼Ò)

¡¾´ð°¸¡¿Ó¦Öú»ØÌû

¡ï ¡ï
¸Ðл²ÎÓ룬ӦÖúÖ¸Êý +1
jjdg(½ð±Ò+2): ¸ÐлӦÖú 2012-03-08 01:56:40
ÒýÓûØÌû:
3Â¥: Originally posted by zhaohuxian at 2012-03-07 21:29:07:
²»ºÃÒâ˼£¬ÎÒÒ²ÊǵÚÒ»´Îд³ÌÐò£¬ÎÒÊÇÓÃCVF 6.5±àÒëͨ¹ýµÄ
²»ÖªµÀÄÄÀïÓÐÎÊÌ⣬лл

ÄãµÄ cvf ºÃÇ¿°¡¡­¡­

Äã¿´Ò»ÏÂÏÂÃæµÄ±àÒë´íÎóÌáʾ£º
CODE:
C:\Documents and Settings\Administrator\Desktop>gfortran -Wall -Wextra zf.f90
zf.f90:15.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:15.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:15.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:15.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:15.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:15.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:15.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:15.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:15.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:11.22:

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

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

      character*4 lable(x), latom(x,y)
                        1
Error: Expression at (1) must be of INTEGER type, found REAL
zf.f90:18.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:18.34:

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

      character*4 lable(x), latom(x,y)
                                    1
Error: Expression at (1) must be of INTEGER type, found REAL
zf.f90:18.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:45.18:

        open(unit=out,file='OUTCAR',status='OLD')
                  1
Error: UNIT tag at (1) must be of type INTEGER
zf.f90:48.15:

          read(out,*,end=10) line
               1
Error: UNIT specification at (1) must be an INTEGER expression or a CHARACTER va
riable
zf.f90:56.14:

        close(out)
              1
Error: UNIT tag at (1) must be of type INTEGER
zf.f90:61.18:

        open(unit=con,file='CONTCAR',status='OLD')
                  1
Error: UNIT tag at (1) must be of type INTEGER
zf.f90:62.13:

        read(con,*,end=20) system
             1
Error: UNIT specification at (1) must be an INTEGER expression or a CHARACTER va
riable
zf.f90:63.13:

        read(con,*,end=20) lattice
             1
Error: UNIT specification at (1) must be an INTEGER expression or a CHARACTER va
riable
zf.f90:64.13:

        read(con,*,end=20) rv(1,1), rv(2,1), rv(3,1)
             1
Error: UNIT specification at (1) must be an INTEGER expression or a CHARACTER va
riable
zf.f90:65.13:

        read(con,*,end=20) rv(1,2), rv(2,2), rv(3,2)
             1
Error: UNIT specification at (1) must be an INTEGER expression or a CHARACTER va
riable
zf.f90:66.13:

        read(con,*,end=20) rv(1,3), rv(2,3), rv(3,3)
             1
Error: UNIT specification at (1) must be an INTEGER expression or a CHARACTER va
riable
Fatal Error: Error count reached limit of 25.

» ±¾ÌûÒÑ»ñµÃµÄºì»¨£¨×îÐÂ10¶ä£©

5Â¥2012-03-07 23:17:32
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[¿¼ÑÐ] Çóµ÷¼Á +5 Ñ©·ê¶¬ 2026-04-10 5/250 2026-04-10 09:17 by LHGeng
[¿¼ÑÐ] 273Çóµ÷¼Á +43 ÂóС¶£µ± 2026-04-06 50/2500 2026-04-10 09:11 by qzxyhcsy
[¿¼²©] ²©Ê¿×Ô¼ö +7 ¿É¿ÉСÅÖ 2026-04-08 7/350 2026-04-10 08:28 by kimhero
[¿¼ÑÐ] ¿¼Ñе÷¼Á +21 ˶ÐǸ° 2026-04-09 22/1100 2026-04-10 08:07 by Sammy2
[¿¼ÑÐ] һ־Ը˫·Ç085400µç×ÓÐÅÏ¢344 Çóµ÷¼Á£¬¶Ô²ÄÁϺͻ¯Ñ§·½ÏòÒ²¸ÐÐËȤ +7 ÎÞÇéµÄСÑò 2026-04-09 8/400 2026-04-09 21:22 by wwwbobobo
[¿¼ÑÐ] Ò»Ö¾Ô¸ÖпÆÔº105500רҵ×Ü·Ö315Çóµ÷¼Á +6 lallalh 2026-04-09 7/350 2026-04-09 17:51 by lallalh
[¿¼ÑÐ] 0860004 Çóµ÷¼Á 309·Ö +6 Yin DY 2026-04-09 6/300 2026-04-09 10:19 by °¡Àî999
[¿¼ÑÐ] »úе¹¤³Ì313·ÖÕÒ¹¤¿Æµ÷¼Á +3 ˫һÁ÷±¾¿Æ»úе 2026-04-08 3/150 2026-04-08 20:41 by ÍÁľ˶ʿÕÐÉú
[¿¼ÑÐ] Ò»Ö¾Ô¸»ª¶«Àí¹¤085601²ÄÁϹ¤³Ì303·ÖÇóµ÷¼Á +15 a1708 2026-04-06 15/750 2026-04-08 16:23 by luoyongfeng
[¿¼ÑÐ] Çóµ÷¼Á£¬ÏÖÔÚ»¹ÄÜÌîµÄ +3 Éϰ¶Ð¡Ó¨¼ÓÓÍ 2026-04-08 3/150 2026-04-08 14:30 by zhq0425
[¿¼ÑÐ] Ò»Ö¾Ô¸Î÷µç085401Çóµ÷¼Á +4 sunw1306 2026-04-07 4/200 2026-04-07 16:40 by à£à£à£0119
[¿¼ÑÐ] 322Çóµ÷¼Á +3 àźߺߺã 2026-04-05 3/150 2026-04-05 19:52 by nepu_uu
[¿¼ÑÐ] 277Çóµ÷¼Á +5 ¿¼Ñе÷¼Álxh 2026-04-05 5/250 2026-04-05 19:03 by chy09050039
[¿¼ÑÐ] µ÷¼Á +3 Àî¹ã»ð 2026-04-05 3/150 2026-04-05 18:57 by À¶ÔÆË¼Óê
[¿¼ÑÐ] ÉúÎïѧ308·ÖÇóµ÷¼Á£¨Ò»Ö¾Ô¸»ª¶«Ê¦´ó£© +8 ÏàÐűػá¹ââÍòÕ 2026-04-05 10/500 2026-04-05 12:19 by Hdyxbekcb
[¿¼ÑÐ] Ò»Ö¾Ô¸½­ÄÏ´óѧ085501»úе¹¤³Ìר˶326·Ö£¬±¾¿Æ¼Ñľ˹´óѧ +5 ¹ËÈô¸¡Éú 2026-04-03 9/450 2026-04-05 09:57 by 1753564080
[¿¼ÑÐ] 341Çóµ÷¼Á +3 ѧÎÞÖ¹¾³£¬³å 2026-04-05 3/150 2026-04-05 09:40 by lbsjt
[¿¼ÑÐ] Ò»Ö¾Ô¸»¦985£¬326·ÖÇóµ÷¼Á +3 Áõīī 2026-04-03 3/150 2026-04-04 11:16 by ±¯É˵ÄÓóÍ·
[¿¼ÑÐ] 278Çóµ÷¼Á +6 Yy7400 2026-04-03 6/300 2026-04-04 09:53 by zhangdingwa
[¿¼ÑÐ] 357Çóµ÷¼Á +13 1050389037 2026-04-03 13/650 2026-04-03 22:27 by Î޼ʵIJÝÔ­
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û