TABLE OF CONTENTS


ABINIT/graph [ Functions ]

[ Top ] [ Functions ]

NAME

 graph

FUNCTION

 Writing  of the gnuplot script to show the computed part
 of Bader surface with lines

COPYRIGHT

 Copyright (C) 2002-2017 ABINIT group (PCasek,FF,XG)
 This file is distributed under the terms of the
 GNU General Public License, see ~abinit/COPYING
 or http://www.gnu.org/copyleft/gpl.txt .
 For the initials of contributors, see ~abinit/doc/developers/contributors.txt .

INPUTS

  untg = unit number of the file on which the info is written
  unts = unit number of the file from which the Bader surface is read

OUTPUT

  (written in the untg file)

PARENTS

      drvaim

CHILDREN

SOURCE

31 #if defined HAVE_CONFIG_H
32 #include "config.h"
33 #endif
34 
35 #include "abi_common.h"
36 
37 subroutine graph(unts,untg)
38 
39  use m_profiling_abi
40 
41  use defs_basis
42 
43 !This section has been created automatically by the script Abilint (TD).
44 !Do not modify the following lines by hand.
45 #undef ABI_FUNC
46 #define ABI_FUNC 'graph'
47 !End of the abilint section
48 
49  implicit none
50 
51 !Arguments ------------------------------------
52 !scalars
53  integer,intent(in) :: untg,unts
54 
55 !Local variables ------------------------------
56 !scalars
57  integer :: ii,indx,jj,nphi,nth
58  real(dp),parameter :: snull=1.d-6
59  real(dp) :: phimax,phimin,ss,thmax,thmin
60 !arrays
61  real(dp) :: xorig(3)
62  real(dp),allocatable :: phi(:),rr(:,:),th(:)
63 
64 ! *********************************************************************
65 
66  rewind(unts)
67  read(unts,*) indx, xorig(1:3)
68  read(unts,*) nth, thmin, thmax
69  read(unts,*) nphi, phimin, phimax
70  ABI_ALLOCATE(th,(nth))
71  ABI_ALLOCATE(phi,(nphi))
72  ABI_ALLOCATE(rr,(nth,nphi))
73  do ii=1,nth
74    do jj=1,nphi
75      read(unts,*) th(ii),phi(jj),rr(ii,jj),ss
76    end do
77  end do
78 
79 !end of reading
80 
81  write(untg,*) 'reset'
82  write(untg,*) 'set st d l'
83  write(untg,*) 'set ticslevel 0'
84  write(untg,*) 'set title ''Bader surface'' '
85  write(untg,*) 'splot ''-'' using ($3*sin($1)*cos($2)):($3*sin($1)*sin($2)):($3*cos($1)) notitle'
86  do ii=1,nth
87    do jj=1,nphi
88      write(untg,'(2F12.8,E16.8)') th(ii),phi(jj),rr(ii,jj)
89    end do
90    if ((ii==nth).and.(jj==nphi)) then
91      cycle
92    else
93      write(untg,*)
94    end if
95  end do
96 
97 end subroutine graph