²é¿´: 4067  |  »Ø¸´: 59
±¾Ìû²úÉú 3 ¸ö ³ÌÐòÇ¿Ìû £¬µã»÷ÕâÀï½øÐв鿴
µ±Ç°Ö»ÏÔʾÂú×ãÖ¸¶¨Ìõ¼þµÄ»ØÌû£¬µã»÷ÕâÀï²é¿´±¾»°ÌâµÄËùÓлØÌû

Gina88

ľ³æ (ÕýʽдÊÖ)

[ÇóÖú] дÁËÒ»¸öfortran90µÄС³ÌÐò£¬±àÒëͨ²»¹ý£¬Çë´óÏÀ°ïæ

program cell-POSCAR

!announcement begin***********************************
implicit none
real(8)::cellcon(3,3)       !lattice constance
real(8),allocatable::atomcoor(:,  !direct coordinate of atoms
integer,allocatable::type(
integer i,j,k,m,n           !m:atom number,n:type number
character(len=1) nonsense    !to contain something that will not be used
character(len=2) position   !to read %
character(len=2) element1,element2  
!End announcement************************************

!Begin reading data from "cell"****************************
open(unit=18,file="cell",status="old"
read(18,*)nonsense
do i=1,3  
  read(18,*)cellcon(i,1),cellcon(i,2),cellcon(i,3)
end do
read(18,*)position
read(18,*)nonsense
read(18,*)nonsense
n=0;m=0
read(18,*)element2
do while(position/=element2)
  n=n+1
  element1=element2
  do while(element1==element2)
    m=m+1
    read(18,*)element2
  end do
end do
close(18)

allocate(type(n))
allocate(atomcoor(m,3))

open(unit=28,file="cell",status="old"
read(28,*)nonsense
read(28,*)nonsense
read(28,*)nonsense
read(28,*)nonsense
read(28,*)nonsense
read(28,*)nonsense
read(28,*)nonsense
read(28,*)element2,atomcoor(1,1),atomcoor(1,2),atomcoor(1,3)
i=1;k=1
element1=element2
if (m==1) then
  type(1)=1
else if
  do j=2,m
    read(28,*)element2,atomcoor(j,1),atomcoor(j,2),atomcoor(j,3)
    if(element1==element2) then
      k=k+1
      if(m==j) type(i)=k
    else if
      type(i)=k
      i=i+1
      element1=element2
      k=1
      if(m==j) type(i)=k
    end if   
  end do
end if
close(28)
!End reading data from "cell"****************************

!Begin writing to "POSCAR"******************************
open(unit=38,file="POSCAR",status="replace"
write(38,10)System
write(38,100)cellcon(1,1)
do i=1,3
  write(38,200)(cellcon(i,j)/cellcon(1,1),j=1,3)
end do
write(38,60)(type(i),i=1,n)
write(38,20)Selective,dynamic
write(38,30)Direct
do i=1,m
  write(38,300)(atomcoor(i,j),j=1,3)
end do
10 FORMAT(1X,A6)
20 FORMAT(1X,A9,1X,A7)
30 FORMAT(1X,A6)
60 FORMAT(1X,n(I3,2X))
100 FORMAT(1X,F18.16)
200 FORMAT(1X,3(F18.16,3X))
300 FORMAT(1X,F18.16,2X,F18.16,2X,F18.16,2X,'T',2X,'T',2X,'T')
close(38)
!End writing to "POSCAR"********************************

end
»Ø¸´´ËÂ¥

» ²ÂÄãϲ»¶

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

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

Gina88

ľ³æ (ÕýʽдÊÖ)

ÄǸöЦÁ³£º£©ÊÇ
ðºÅ+ÓÒÀ¨ºÅ

ÄǸöºìÁ³¡±£©ÊÇ
ÓÒÀ¨ºÅ
3Â¥2011-05-04 17:56:30
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
²é¿´È«²¿ 60 ¸ö»Ø´ð

Gina88

ľ³æ (ÕýʽдÊÖ)

Õâ¸öÊÇcellµÄÄÚÈÝ
%BLOCK LATTICE_CART
      12.782529349912258      -0.000000000000028       0.000000000000001
      -0.000000000000000      13.529995000000000       0.000000000000001
       0.000000000000000       0.000000000000000      10.000000000000000
%ENDBLOCK LATTICE_CART

%BLOCK POSITIONS_FRAC
  H   0.0555000007152556   0.1666999995708470   0.5000000000000000
  H   0.2221666673819220   0.0666999995708464   0.5000000000000000
  H   0.1110555562708110   0.0666999995708466   0.5000000000000000
  H   0.1110555562708110   0.0666999995708466   0.5000000000000000
  C   0.2777222229374780   0.1666999995708470   0.5000000000000000
  C   0.3888333340485890   0.1666999995708470   0.5000000000000000
  C   0.5555000007152560   0.0666999995708465   0.5000000000000000
  S   0.4443888896041450   0.0666999995708466   0.5000000000000000
  S   0.6110555562708110   0.1666999995708470   0.5000000000000000
  si   0.6110555562708110   0.1666999995708470   0.5000000000000000
%ENDBLOCK POSITIONS_FRAC
2Â¥2011-05-04 17:52:59
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

Gina88

ľ³æ (ÕýʽдÊÖ)

program cell-POSCAR

!announcement begin***********************************
implicit none
real(8)::cellcon(3,3)       !lattice constance
real(8),allocatable::atomcoor(:,  !direct coordinate of atoms
integer,allocatable::type(
integer i,j,k,m,n           !m:atom number,n:type number
character(len=1) nonsense    !to contain something that will not be used
character(len=2) position   !to read %
character(len=2) element1,element2  
!End announcement************************************

!Begin reading data from "cell"****************************
open(unit=18,file="cell",status="old"
read(18,*)nonsense
do i=1,3  
  read(18,*)cellcon(i,1),cellcon(i,2),cellcon(i,3)
end do
read(18,*)position
read(18,*)nonsense
read(18,*)nonsense
n=0;m=0
read(18,*)element2
do while(position/=element2)
  n=n+1
  element1=element2
  do while(element1==element2)
    m=m+1
    read(18,*)element2
  end do
end do
close(18)

allocate(type(n))
allocate(atomcoor(m,3))

open(unit=28,file="cell",status="old"
read(28,*)nonsense
read(28,*)nonsense
read(28,*)nonsense
read(28,*)nonsense
read(28,*)nonsense
read(28,*)nonsense
read(28,*)nonsense
read(28,*)element2,atomcoor(1,1),atomcoor(1,2),atomcoor(1,3)
i=1;k=1
element1=element2
if (m==1) then
  type(1)=1
else if
  do j=2,m
    read(28,*)element2,atomcoor(j,1),atomcoor(j,2),atomcoor(j,3)
    if(element1==element2) then
      k=k+1
      if(m==j) type(i)=k
    else if
      type(i)=k
      i=i+1
      element1=element2
      k=1
      if(m==j) type(i)=k
    end if   
  end do
end if
close(28)
!End reading data from "cell"****************************

!Begin writing to "POSCAR"******************************
open(unit=38,file="POSCAR",status="replace"
write(38,10)System
write(38,100)cellcon(1,1)
do i=1,3
  write(38,200)(cellcon(i,j)/cellcon(1,1),j=1,3)
end do
write(38,60)(type(i),i=1,n)
write(38,20)Selective,dynamic
write(38,30)Direct
do i=1,m
  write(38,300)(atomcoor(i,j),j=1,3)
end do
10 FORMAT(1X,A6)
20 FORMAT(1X,A9,1X,A7)
30 FORMAT(1X,A6)
60 FORMAT(1X,n(I3,2X))
100 FORMAT(1X,F18.16)
200 FORMAT(1X,3(F18.16,3X))
300 FORMAT(1X,F18.16,2X,F18.16,2X,F18.16,2X,'T',2X,'T',2X,'T')
close(38)
!End writing to "POSCAR"********************************

end
4Â¥2011-05-04 17:58:28
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

Gina88

ľ³æ (ÕýʽдÊÖ)

·Ç³£·Ç³£¸Ðл´óÏÀÁË£¡£¡£¡£¡£¡£¡
5Â¥2011-05-04 17:59:54
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[¿¼ÑÐ] 0817 »¯Ñ§¹¤³Ì 299·ÖÇóµ÷¼Á ÓпÆÑо­Àú ÓжþÇøÎÄÕ +20 rare12345 2026-03-18 20/1000 2026-03-20 08:42 by Î޼ʵIJÝÔ­
[¿¼ÑÐ] 329Çóµ÷¼Á +5 ÏëÉÏѧ߹߹ 2026-03-19 5/250 2026-03-19 23:56 by 23Postgrad
[ÂÛÎÄͶ¸å] ÉêÇë»Ø¸åÑÓÆÚÒ»¸öÔ£¬±à¼­Í¬ÒâÁË¡£µ«ÏµÍ³ÉϵÄʱ¼äû±ä£¬¸ø±à¼­ÓÖдÓʼþÁË£¬Ã»»Ø¸´ 10+3 wangf9518 2026-03-17 4/200 2026-03-19 23:55 by babero
[¿¼ÑÐ] 320Çóµ÷¼Á0856 +3 ²»ÏëÆðÃû×Ö112 2026-03-19 3/150 2026-03-19 22:53 by ѧԱ8dgXkO
[¿¼ÑÐ] 288Çóµ÷¼Á£¬Ò»Ö¾Ô¸»ªÄÏÀí¹¤´óѧ071005 +5 ioodiiij 2026-03-17 5/250 2026-03-19 18:22 by zcl123
[¿¼ÑÐ] ±¾ÈË¿¼085602 »¯Ñ§¹¤³Ì ר˶ +17 ²»ÖªµÀ½Ðʲô£¡ 2026-03-15 19/950 2026-03-19 15:06 by ¾¡Ë´Ò¢1
[¿¼ÑÐ] 085600²ÄÁÏÓ뻯¹¤µ÷¼Á 324·Ö +10 llllkkkhh 2026-03-18 12/600 2026-03-19 14:33 by llllkkkhh
[¿¼ÑÐ] ²ÄÁÏ¿¼Ñе÷¼Á +3 xwt¡£ 2026-03-19 3/150 2026-03-19 11:22 by wãåÑôw
[¿¼ÑÐ] Ò»Ö¾Ô¸985£¬±¾¿Æ211£¬0817»¯Ñ§¹¤³ÌÓë¼¼Êõ319Çóµ÷¼Á +10 Liwangman 2026-03-15 10/500 2026-03-19 10:25 by Î޼ʵIJÝÔ­
[¿¼ÑÐ] 304Çóµ÷¼Á +6 ˾¿Õ. 2026-03-18 6/300 2026-03-18 23:03 by ÐÇ¿ÕÐÇÔÂ
[¿¼ÑÐ] 334Çóµ÷¼Á +3 Ö¾´æ¸ßÔ¶ÒâÔÚ»úÐ 2026-03-16 3/150 2026-03-18 08:34 by lm4875102
[¿¼ÑÐ] 293Çóµ÷¼Á +11 zjlµÄºÅ 2026-03-16 16/800 2026-03-18 08:10 by zhukairuo
[»ù½ðÉêÇë] ±»ÎÒÑÔÖУºÐÂÄ£°å²»Ç¿µ÷¸ñʽÁË£¬¼Ùר¼Ò¿ªÊ¼¹Ü¸ñʽÁË +4 beefly 2026-03-14 4/200 2026-03-17 22:04 by »ÆÄñÓÚ·ÉChao
[¿¼ÑÐ] ¿¼ÑÐÇóµ÷¼Á +3 éÙËÌ. 2026-03-17 4/200 2026-03-17 21:43 by ÓÐÖ»ÀêÅ«
[¿¼ÑÐ] 302Çóµ÷¼Á +4 С¼Öͬѧ123 2026-03-15 8/400 2026-03-17 10:33 by С¼Öͬѧ123
[¿¼ÑÐ] 333Çóµ÷¼Á +3 ÎÄ˼¿Í 2026-03-16 7/350 2026-03-16 18:21 by ÎÄ˼¿Í
[¿¼ÑÐ] 304Çóµ÷¼Á +3 ÂüÊâ2266 2026-03-14 3/150 2026-03-16 16:39 by houyaoxu
[¿¼ÑÐ] 326Çóµ÷¼Á +3 mlpqaz03 2026-03-15 3/150 2026-03-16 07:33 by Iveryant
[¿¼ÑÐ] 22408×Ü·Ö284Çóµ÷¼Á +3 InAspic 2026-03-13 3/150 2026-03-15 11:10 by zhq0425
[¿¼ÑÐ] ÕÐÊÕ0805£¨²ÄÁÏ£©µ÷¼Á +3 18595523086 2026-03-13 3/150 2026-03-14 00:33 by 123%¡¢
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û