Statistiques
| Révision :

root / src / ReadGeom_siesta.f90

Historique | Voir | Annoter | Télécharger (2,43 ko)

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
!----------------------------------------------------------------------
10
!  Copyright 2003-2014 Ecole Normale Supérieure de Lyon, 
11
!  Centre National de la Recherche Scientifique,
12
!  Université Claude Bernard Lyon 1. All rights reserved.
13
!
14
!  This work is registered with the Agency for the Protection of Programs 
15
!  as IDDN.FR.001.100009.000.S.P.2014.000.30625
16
!
17
!  Authors: P. Fleurat-Lessard, P. Dayal
18
!  Contact: optnpath@gmail.com
19
!
20
! This file is part of "Opt'n Path".
21
!
22
!  "Opt'n Path" is free software: you can redistribute it and/or modify
23
!  it under the terms of the GNU Affero General Public License as
24
!  published by the Free Software Foundation, either version 3 of the License,
25
!  or (at your option) any later version.
26
!
27
!  "Opt'n Path" is distributed in the hope that it will be useful,
28
!  but WITHOUT ANY WARRANTY; without even the implied warranty of
29
!
30
!  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
31
!  GNU Affero General Public License for more details.
32
!
33
!  You should have received a copy of the GNU Affero General Public License
34
!  along with "Opt'n Path". If not, see <http://www.gnu.org/licenses/>.
35
!
36
! Contact The Office of Technology Licensing, valorisation@ens-lyon.fr,
37
! for commercial licensing opportunities.
38
!----------------------------------------------------------------------
39

    
40
  Use Path_module
41
  Use Io_module
42

    
43
  IMPLICIT NONE
44

    
45
  INTEGER(KINT) :: I, J
46
  LOGICAL :: Debug
47

    
48

    
49
  INTERFACE
50
     function valid(string) result (isValid)
51
       CHARACTER(*), intent(in) :: string
52
       logical                  :: isValid
53
     END function VALID
54
  END INTERFACE
55

    
56
  debug=valid('Read_geom').or.valid('ReadGeom_siesta')
57

    
58
 if (debug) Call Header("Entering ReadGeom_siesta")
59

    
60
 IF (.NOT.ALLOCATED(IdxSpecies)) ALLOCATE(IdxSpecies(NAt))
61

    
62
     DO I=1,NGeomI
63
        IF (DEBUG) WRITE(*,*) "Reading Geom :",I
64

    
65
        DO J=1,NAt
66
           READ(IOIN,*) XyzGeomI(I,1:3,J),IdxSpecies(J)
67
        END DO
68

    
69
        If (Debug) THEN
70
           WRITE(*,*) "Geom ",I
71
           DO J=1,NAt
72
              WRITE(*,'(1X,3(1X,F15.6),1X,I5)') XyzGeomI(I,1:3,J),IdxSpecies(J)
73
           END DO
74
        END IF
75
     END DO
76

    
77
  if (debug) Call Header("Exiting ReadGeom_siesta")
78

    
79
END SUBROUTINE ReadGeom_siesta