Statistics
| Revision:

root / src / ReadGeom_cart.f90 @ 7

History | View | Annotate | Download (1.4 kB)

1
SUBROUTINE ReadGeom_cart
2

    
3
  Use Path_module
4
  Use Io_module
5

    
6
  IMPLICIT NONE
7

    
8
  CHARACTER(132) :: Line
9

    
10
  INTEGER(KINT) :: I, J, NAtP
11
  LOGICAL :: Debug
12

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

    
20
  debug=valid('Read_geom').or.valid('ReadGeom_cart')
21

    
22
 if (debug) Call Header("Entering ReadGeom_cart")
23

    
24
     DO I=1,NGeomI
25
        IF (DEBUG) WRITE(*,*) "Reading Geom :",I
26
        READ(IOIN,*) NAtp
27
        if (NAtp.NE.Nat) THEN
28
           IF (I==1) THEN
29
              WRITE(IOOUT,*) 'WARNING Number of atoms not consistent between NAMELIST &path and First geom'
30
              WRITE(IOOUT,*) "Using:",Natp 
31
              DEALLOCATE(XyzGeomI, AtName)
32
              Nat=Natp 
33
              ALLOCATE(XyzGeomI(NGeomI,3,Nat), AtName(NAt))
34
           ELSE
35
              WRITE(IOOUT,*) 'Number of atoms not consistent between geometries. STOP'
36
              STOP
37
           END IF
38
        END IF
39
        READ(IOIN,'(A)') Line
40
        DO J=1,NAt
41
           READ(IOIN,*) AtName(J),XyzGeomI(I,1:3,J)
42
        END DO
43
        If (Debug) THEN
44
           WRITE(*,*) "Geom ",I
45
           DO J=1,NAt
46
              WRITE(*,'(1X,A2,3(1X,F15.6))') AtName(J),XyzGeomI(I,1:3,J)
47
           END DO
48
        END IF
49
     END DO
50

    
51

    
52
  if (debug) Call Header("Exiting ReadGeom_cart")
53

    
54
END SUBROUTINE ReadGeom_cart