[xcrysden] Exciting dft package

Tone Kokalj xcrysden@democritos.it
Wed, 22 Mar 2006 11:27:40 +0100


--=-4htjfTFtoJC25ELApVWc
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

On Wed, 2006-03-22 at 08:06 +0100, Michael Gurnett wrote:
> Hello
> 
> Would it be possible for xcrysden to be able to read geometry data from
> the exciting GEOMETRY.OUT file.

This is a FAQ #8 ( http://www.xcrysden.org/doc/FAQ.html#Q6 ). 

Read also this: 
http://www.xcrysden.org/doc/custom.html#__toc__8

The GEOMETRY.OUT file needs to be tranformed to XSF file. This could be
done easily as GEOMETRY.OUT is a simple file. I attach a fortran
template, kind of myformat2xsf. You need to patch the first part of the
file: the reading of the GEOMETRY.OUT.

When the converter (filter) is working well you can add something as
follows to the end of $HOME/.xcrysden/custom-definitions file:

# Usage: 
#       addOption option converterProgram description
#
# Arguments:
#       option           ... option to add to XCRYSDEN options
#
#       converterProgram ... program that converts from an "unknown"
#                            to XSF format; this program must be
#                            supplied by the user !!!
#
#       description      ... description of the options that will
#                            appear in the help message 
#                            (i.e. xcrysden --help).
#
# 

addOption --exciting /path/to/exiting2xsf {
                    load structure from Exciting GEOMETRY.OUT file format
}
# EOF

Now you can do: xcrysden --exciting GEOMETRY.OUT

When the exciting2xsf filter is well working, you can (if you wish so) send the filter to me
and I will add it to xcrysden.

Regards, Tone

--=-4htjfTFtoJC25ELApVWc
Content-Disposition: attachment; filename=myformat2xsf.f
Content-Type: text/x-fortran; name=myformat2xsf.f; charset=us-ascii
Content-Transfer-Encoding: 7bit

c     ******************************************************
      program MyFormat2XSF
c     Usage: myformat2xsf myformat_file 
c
c     The program reads the myformat file from myformat_file
c     and writes the XSF file to standard output
c     ******************************************************
      implicit none
      integer MAXATOMS
      PARAMETER (MAXATOMS = 1000)
      character*256 my_file
      real*8
     $     primvec(3,3),        ! primitive lattice vectors
     $     convvec(3,3),        ! conventional lattice vectors
     $     coor(3,MAXATOMS)     ! atomic coordinates
      integer
     $     iargc,
     $     nat(MAXATOMS),       ! atomic numbers
     $     iat, i, j, len       ! counters

      if (iargc().ne.1)
     $     stop 'Usage: myformat2xcr myformat_infile'
      
      call getarg(1,my_file)
      len = index(my_file,' ') - 1
      open(unit=1, file=my_file(1:len), status='old')

c     ***
c     *** READ MyFormat file
c     ***
          ... insert code here ...

c     ***
c     *** WRITE XSF file
c     ***

c     ***  lets suppose it is a CRYSTAL structure
c     ***  other posibilites are (SLAB,POLYMER,MOLECULE)

      write(*,*) 'CRYSTAL'
      write(*,*) 'PRIMVEC'
      write(*,1000) primvec
      write(*,*) 'CONVVEC'
      write(*,1000) convvec
      write(*,*) 'PRIMCOORD'
      write(*,*) iat, 1
      do i=1,iat
         write(*,1001) nat(i), (coor(j,i), j=1,3)
      enddo

 1000 format(2(3(F15.9,2X),/),3(F15.9,2X))
 1001 format(I5,3(F15.9,2X))
      END

--=-4htjfTFtoJC25ELApVWc--