[Wien] slab cal

Fred Nastos nastos at physics.utoronto.ca
Thu Sep 16 15:56:39 CEST 2004


On September 15, 2004 10:39 pm, R.K.Thapa wrote:
> Dear Fred,
> Thanks for the reply. Can you just help me with one example of structure
> file for surface calculation?
> RK Thapa

Attached is Si surface [001 cut, 2x1 reconstruction] struct file.

To make it, I first made a proper .xyz file, so I could easily view the 
structure and verify the coordinates.  I then modified the code xyz2struct, 
(in SRC_trig) to correctly read xyz files, and ask for lattice parameters.  
This allows to me to specify the amount of vaccuum I want.

I attach the xyz2struct.f90 file.

The resulting .struct file then needs to be hand-inspected, and analyzed by 
the init programs.  After the init programs are done with it, I always run 
struct2xyz to make sure everything is still OK (I am quite paranoid 
sometimes).The attachments are only meant to be a guide.  Any work I am doing 
with them has been very preliminary.

Good luck
-------------- next part --------------
Si001_2x1                                                                      
P   LATTICE,NONEQUIV.ATOMS: 12 10 P2/m                                         
             RELA                                                              
 43.529840 14.484820  7.242410 90.000000 90.000000 90.000000                   
ATOM  -1: X=0.19874377 Y=0.28216148 Z=0.00000000
          MULT= 2          ISPLIT= 8
      -1: X=0.80125623 Y=0.71783852 Z=0.00000000
Si1        NPT=  781  R0=0.00001000 RMT=    2.1500   Z: 14.0                   
LOCAL ROT MATRIX:    1.0000000 0.0000000 0.0000000
                     0.0000000 1.0000000 0.0000000
                     0.0000000 0.0000000 1.0000000
ATOM  -2: X=0.16801335 Y=0.56509430 Z=0.00000000
          MULT= 2          ISPLIT= 8
      -2: X=0.83198665 Y=0.43490570 Z=0.00000000
Si2        NPT=  781  R0=0.00001000 RMT=    2.1500   Z: 14.0                   
LOCAL ROT MATRIX:    1.0000000 0.0000000 0.0000000
                     0.0000000 1.0000000 0.0000000
                     0.0000000 0.0000000 1.0000000
ATOM  -3: X=0.23035483 Y=0.13897073 Z=0.49999997
          MULT= 2          ISPLIT= 8
      -3: X=0.76964517 Y=0.86102927 Z=0.49999997
Si3        NPT=  781  R0=0.00001000 RMT=    2.1500   Z: 14.0                   
LOCAL ROT MATRIX:    1.0000000 0.0000000 0.0000000
                     0.0000000 1.0000000 0.0000000
                     0.0000000 0.0000000 1.0000000
ATOM  -4: X=0.22745399 Y=0.61286260 Z=0.49999997
          MULT= 2          ISPLIT= 8
      -4: X=0.77254601 Y=0.38713740 Z=0.49999997
Si4        NPT=  781  R0=0.00001000 RMT=    2.1500   Z: 14.0                   
LOCAL ROT MATRIX:    1.0000000 0.0000000 0.0000000
                     0.0000000 1.0000000 0.0000000
                     0.0000000 0.0000000 1.0000000
ATOM  -5: X=0.29483644 Y=0.38589837 Z=0.49999997
          MULT= 2          ISPLIT= 8
      -5: X=0.70516356 Y=0.61410163 Z=0.49999997
Si5        NPT=  781  R0=0.00001000 RMT=    2.1500   Z: 14.0                   
LOCAL ROT MATRIX:    1.0000000 0.0000000 0.0000000
                     0.0000000 1.0000000 0.0000000
                     0.0000000 0.0000000 1.0000000
ATOM  -6: X=0.28398497 Y=0.87315457 Z=0.49999997
          MULT= 2          ISPLIT= 8
      -6: X=0.71601503 Y=0.12684543 Z=0.49999997
Si6        NPT=  781  R0=0.00001000 RMT=    2.1500   Z: 14.0                   
LOCAL ROT MATRIX:    1.0000000 0.0000000 0.0000000
                     0.0000000 1.0000000 0.0000000
                     0.0000000 0.0000000 1.0000000
ATOM  -7: X=0.35148841 Y=0.37472100 Z=0.00000000
          MULT= 2          ISPLIT= 8
      -7: X=0.64851159 Y=0.62527900 Z=0.00000000
Si7        NPT=  781  R0=0.00001000 RMT=    2.1500   Z: 14.0                   
LOCAL ROT MATRIX:    1.0000000 0.0000000 0.0000000
                     0.0000000 1.0000000 0.0000000
                     0.0000000 0.0000000 1.0000000
ATOM  -8: X=0.34494610 Y=0.87594821 Z=0.00000000
          MULT= 2          ISPLIT= 8
      -8: X=0.65505390 Y=0.12405179 Z=0.00000000
Si8        NPT=  781  R0=0.00001000 RMT=    2.1500   Z: 14.0                   
LOCAL ROT MATRIX:    1.0000000 0.0000000 0.0000000
                     0.0000000 1.0000000 0.0000000
                     0.0000000 0.0000000 1.0000000
ATOM  -9: X=0.40625000 Y=0.12499998 Z=0.00000000
          MULT= 2          ISPLIT= 8
      -9: X=0.59375000 Y=0.87500002 Z=0.00000000
Si9        NPT=  781  R0=0.00001000 RMT=    2.1500   Z: 14.0                   
LOCAL ROT MATRIX:    1.0000000 0.0000000 0.0000000
                     0.0000000 1.0000000 0.0000000
                     0.0000000 0.0000000 1.0000000
ATOM -10: X=0.40625000 Y=0.62500000 Z=0.00000000
          MULT= 2          ISPLIT= 8
     -10: X=0.59375000 Y=0.37500000 Z=0.00000000
Si10       NPT=  781  R0=0.00001000 RMT=    2.1500   Z: 14.0                   
LOCAL ROT MATRIX:    1.0000000 0.0000000 0.0000000
                     0.0000000 1.0000000 0.0000000
                     0.0000000 0.0000000 1.0000000
ATOM -11: X=0.46874997 Y=0.12499998 Z=0.49999997
          MULT= 2          ISPLIT= 8
     -11: X=0.53125003 Y=0.87500002 Z=0.49999997
Si11       NPT=  781  R0=0.00001000 RMT=    2.1500   Z: 14.0                   
LOCAL ROT MATRIX:    1.0000000 0.0000000 0.0000000
                     0.0000000 1.0000000 0.0000000
                     0.0000000 0.0000000 1.0000000
ATOM -12: X=0.46874997 Y=0.62500000 Z=0.49999997
          MULT= 2          ISPLIT= 8
     -12: X=0.53125003 Y=0.37500000 Z=0.49999997
Si12       NPT=  781  R0=0.00001000 RMT=    2.1500   Z: 14.0                   
LOCAL ROT MATRIX:    1.0000000 0.0000000 0.0000000
                     0.0000000 1.0000000 0.0000000
                     0.0000000 0.0000000 1.0000000
   4      NUMBER OF SYMMETRY OPERATIONS
 1 0 0 0.0000000
 0 1 0 0.0000000
 0 0 1 0.0000000
       1
-1 0 0 0.0000000
 0-1 0 0.0000000
 0 0 1 0.0000000
       2
-1 0 0 0.0000000
 0-1 0 0.0000000
 0 0-1 0.0000000
       3
 1 0 0 0.0000000
 0 1 0 0.0000000
 0 0-1 0.0000000
       4
-------------- next part --------------
PROGRAM xyz2struct
!!!        (spos,mult,isplit,name,rotloc,iatnr,gt)
!!!      IMPLICIT REAL*8 (A-H,O-Z)
  IMPLICIT NONE
  INTEGER :: ndif
  DOUBLE PRECISION, ALLOCATABLE :: x(:), y(:), z(:)
  INTEGER, ALLOCATABLE :: mult(:)
  CHARACTER(LEN=10), ALLOCATABLE :: label(:)
  CHARACTER(LEN=20) :: name
  CHARACTER(LEN=40) :: filename
  CHARACTER*2 :: gt
  CHARACTER(LEN=1) :: unitLabel
  INTEGER :: i, iatnr, ieq, m, nat
  LOGICAL, PARAMETER :: debug = .true.
  REAL :: unitCellParam(1:3)
  REAL :: angstrom2bohr = 1.d0/0.529177249d0
!!!c
  IF (debug) WRITE(*,*) "Entering xyz2struct"
  WRITE(*,*) " "
  WRITE(*,*) "Enter xyz filename.  File should have positions in Angstroms."
  READ(*,*) filename
  OPEN(1,FILE=filename)
  WRITE(*,*) " "
  WRITE(*,*) "Now you need to enter the unit cell paramaters"
  DO
     WRITE(*,*) "Bohr (b) or Angstroms (a)?"
     READ(*,*) unitLabel
     IF ((unitLabel.EQ."a").OR.(unitLabel.EQ."b")) EXIT
  END DO
  WRITE(*,*) "Enter unit cell parameters"
  WRITE(*,*) "a = "
  READ(*,*) unitcellparam(1)
  WRITE(*,*) "b = "
  READ(*,*) unitcellparam(2)
  WRITE(*,*) "c = "
  READ(*,*) unitcellparam(3)
  
  IF (unitLabel.EQ."a") THEN
     unitcellparam(1:3) = unitcellparam(1:3) * angstrom2bohr
  END IF
  
!!! First read top line of xyz file.
!!! This should be the number of atoms in the xyz file.
  READ(1,'(I5)') ndif
  IF (debug) WRITE(*,*) "Number of atoms to be parsed =", ndif
  ALLOCATE ( x(ndif), y(ndif), z(ndif), label(ndif), mult(ndif) )
  READ(1,'(a10)') label(1)
  IF (debug) WRITE(*,*) "Title of xyz file = ", label(1)
  
!  i=1
!  ieq=1
!  mult(ieq)=1
  
!!!c.....the format may need adaption for each case, would need lineparser
  
  ieq=0
  DO i=1,ndif
!!!10    CONTINUE
!!!      read(5,'(a10,f7.4,2x,f7.4,1x,f7.4)',err=99,end=99) &
!!!     READ(1,*,err=99,end=99) label(i), x(i), y(i), z(i)
     READ(1,*) label(i), x(i), y(i), z(i)
     IF (debug) WRITE(*,*) label(i), x(i), y(i), z(i)
     
     IF (x(i).LT.0.0) THEN
        WRITE(*,*) "At atom ", i, " x was negative"
        STOP
     ELSE IF (y(i).LT.0.0) THEN
        WRITE(*,*) "At atom ", i, " x was negative"
        STOP
     ELSE IF (z(i).LT.0.0) THEN
        WRITE(*,*) "At atom ", i, " x was negative"
        STOP
     END IF
     x(i) = x(i)*angstrom2bohr/unitcellparam(1)
     y(i) = y(i)*angstrom2bohr/unitcellparam(2)
     z(i) = z(i)*angstrom2bohr/unitcellparam(3)
     IF (debug) WRITE(*,'(A,3F10.8)') label(i), x(i), y(i), z(i)
     
     !        IF (i.gt.1) THEN
     !           IF (label(i).eq.label(i-1)) THEN
     !              mult(ieq)=mult(ieq)+1
     !           ELSE
     ieq=ieq+1
     mult(ieq)=1
     !           END IF
     !        END IF
!!!      i=i+1
!!!      GOTO 10
  END DO
  
99 nat=ieq
  
  WRITE(21,'(a)') 'xyz2struct'
  WRITE(21,'(a1,26x,i3)') 'P',nat
  WRITE(21,'(a)') 'MODE OF CALC=RELA'
  WRITE(21,'(6f10.5)') unitcellparam(1:3), 90.0, 90.0, 90.0
!!!c
  i=0
  DO iatnr=1,ieq
     i=i+1
     WRITE(21,1010) iatnr ,x(i), y(i), z(i)
     !c       write(21,1010) iatnr, x(i), z(i), y(i)
     WRITE(21,1012) mult(iatnr), 8
1010 FORMAT('ATOM',I4,': X=',F10.8,' Y=',F10.8,' Z=',F10.8)            
1011 FORMAT(4X,I4,': X=',F10.8,' Y=',F10.8,' Z=',F10.8)                
1012 FORMAT('          MULT=',i2,'          ISPLIT=',i2)
     DO m=2,MULT(iatnr)              
        i=i+1
        WRITE(21,1011) iatnr, x(i), y(i), z(i)
     END DO
     WRITE(21,1510) label(i)
     WRITE(21,1013) 1.,0.,0.,0.,1.,0.,0.,0.,1.          
1013 FORMAT('LOCAL ROT MATRIX:   ',3f10.7,/,20x,3f10.7,/,20x,3f10.7)
1510 FORMAT(A10,' NPT=  781  R0=0.00001000 RMT=    2.0000   Z: 14.0')  
  END DO
!!!c
  WRITE(21,*) 0                                          
!!!c
  DEALLOCATE ( x, y, z, label, mult )

END PROGRAM xyz2struct


More information about the Wien mailing list