Statistics
| Revision:

root / src / ReadGeom_siesta.f90 @ 5

History | View | Annotate | Download (1.1 kB)

1
SUBROUTINE ReadGeom_siesta
2
! We read geometries given in siesta format
3
! Here we just read the equivalent of %block AtomicCoordinatesAndAtomicsLabel
4
! i.e. x,y,z,species
5
! we know nothing about:
6
! - the format and units
7
! - the significations of species
8

    
9
  Use Path_module
10
  Use Io_module
11

    
12
  IMPLICIT NONE
13

    
14
  INTEGER(KINT) :: I, J
15
  LOGICAL :: Debug
16

    
17

    
18
  INTERFACE
19
     function valid(string) result (isValid)
20
       CHARACTER(*), intent(in) :: string
21
       logical                  :: isValid
22
     END function VALID
23
  END INTERFACE
24

    
25
  debug=valid('Read_geom').or.valid('ReadGeom_siesta')
26

    
27
 if (debug) Call Header("Entering ReadGeom_siesta")
28

    
29
 IF (.NOT.ALLOCATED(IdxSpecies)) ALLOCATE(IdxSpecies(NAt))
30

    
31
     DO I=1,NGeomI
32
        IF (DEBUG) WRITE(*,*) "Reading Geom :",I
33

    
34
        DO J=1,NAt
35
           READ(IOIN,*) XyzGeomI(I,1:3,J),IdxSpecies(J)
36
        END DO
37

    
38
        If (Debug) THEN
39
           WRITE(*,*) "Geom ",I
40
           DO J=1,NAt
41
              WRITE(*,'(1X,3(1X,F15.6),1X,I5)') XyzGeomI(I,1:3,J),IdxSpecies(J)
42
           END DO
43
        END IF
44
     END DO
45

    
46
  if (debug) Call Header("Exiting ReadGeom_siesta")
47

    
48
END SUBROUTINE ReadGeom_siesta