Statistiques
| Révision :

root / src / WriteInput_siesta.f90 @ 7

Historique | Voir | Annoter | Télécharger (1,63 ko)

1
 SUBROUTINE WriteInput_siesta(GeomCart,FileUnit)
2

    
3
! This routine writes an input for Siesta
4

    
5
  use VarTypes
6
  use Path_module
7
  use Io_module
8

    
9
  IMPLICIT NONE
10

    
11
  INTERFACE
12
     function valid(string) result (isValid)
13
       CHARACTER(*), intent(in) :: string
14
       logical                  :: isValid
15
     END function VALID
16

    
17

    
18
     SUBROUTINE WriteList(Input,Unit)
19
        ! This routine reads an input template for Siesta
20

    
21
       use VarTypes
22
       use Io_module
23

    
24
       IMPLICIT NONE
25

    
26
     ! Input
27
       TYPE (Input_line), POINTER, INTENT(IN) :: Input
28
       INTEGER(KINT), OPTIONAL, INTENT(IN) :: Unit
29
       
30
     END SUBROUTINE WriteList
31

    
32
  END INTERFACE
33

    
34
!Input
35
 ! Geometry in cartesian coordinates
36
  REAL(KREAL), INTENT (IN) :: geomcart(Nat,3)
37
! Unit to write to
38
  INTEGER(KINT), INTENT(IN) :: FileUnit
39
  
40
  LOGICAL :: Debug
41
  INTEGER(KINT) :: I,Iat
42

    
43
  Debug=Valid("WriteInput").OR.Valid("WriteInput_siesta")
44

    
45
  if (debug) Call Header("Entering WriteInput_Siesta")
46

    
47

    
48
  Call WriteList(Siesta_input,Unit=FileUnit)
49

    
50
  WRITE(FileUnit,*) 
51

    
52
  WRITE(FileUnit,'(1X,A)')  '%block AtomicCoordinatesAndAtomicSpecies' 
53

    
54
  DO I=1,Nat
55
     If (renum) THEN
56
        Iat=Order(I)
57
        WRITE(FileUnit,'(1X,3(1X,F15.8),1X,I5,1X,A)') GeomCart(Iat,:)/Siesta_Unit_Read, IdxSpecies(Iat),TRIM(Siesta_Paste(I))
58
     ELSE
59
        Iat=OrderInv(I)
60
        WRITE(FileUnit,'(1X,3(1X,F15.8),1X,I5,1X,A)') GeomCart(I,:)/Siesta_Unit_Read, IdxSpecies(Iat), TRIM(Siesta_Paste(Iat))
61
     END IF
62
  END DO
63

    
64
  WRITE(FileUnit,'(1X,A)')  '%endblock AtomicCoordinatesAndAtomicSpecies'
65
  WRITE(FileUnit,*) 
66

    
67

    
68

    
69
  if (debug) Call Header("Exiting WriteInput_Siesta")
70
  
71
END SUBROUTINE WRITEINPUT_SIESTA