Statistics
| Revision:

root / src / ReadGeom_cart.f90 @ 7

History | View | Annotate | Download (1.4 kB)

1 5 pfleura2
SUBROUTINE ReadGeom_cart
2 5 pfleura2
3 5 pfleura2
  Use Path_module
4 5 pfleura2
  Use Io_module
5 5 pfleura2
6 5 pfleura2
  IMPLICIT NONE
7 5 pfleura2
8 5 pfleura2
  CHARACTER(132) :: Line
9 5 pfleura2
10 5 pfleura2
  INTEGER(KINT) :: I, J, NAtP
11 5 pfleura2
  LOGICAL :: Debug
12 5 pfleura2
13 5 pfleura2
  INTERFACE
14 5 pfleura2
     function valid(string) result (isValid)
15 5 pfleura2
       CHARACTER(*), intent(in) :: string
16 5 pfleura2
       logical                  :: isValid
17 5 pfleura2
     END function VALID
18 5 pfleura2
  END INTERFACE
19 5 pfleura2
20 5 pfleura2
  debug=valid('Read_geom').or.valid('ReadGeom_cart')
21 5 pfleura2
22 5 pfleura2
 if (debug) Call Header("Entering ReadGeom_cart")
23 5 pfleura2
24 5 pfleura2
     DO I=1,NGeomI
25 5 pfleura2
        IF (DEBUG) WRITE(*,*) "Reading Geom :",I
26 5 pfleura2
        READ(IOIN,*) NAtp
27 5 pfleura2
        if (NAtp.NE.Nat) THEN
28 5 pfleura2
           IF (I==1) THEN
29 5 pfleura2
              WRITE(IOOUT,*) 'WARNING Number of atoms not consistent between NAMELIST &path and First geom'
30 5 pfleura2
              WRITE(IOOUT,*) "Using:",Natp
31 5 pfleura2
              DEALLOCATE(XyzGeomI, AtName)
32 5 pfleura2
              Nat=Natp
33 5 pfleura2
              ALLOCATE(XyzGeomI(NGeomI,3,Nat), AtName(NAt))
34 5 pfleura2
           ELSE
35 5 pfleura2
              WRITE(IOOUT,*) 'Number of atoms not consistent between geometries. STOP'
36 5 pfleura2
              STOP
37 5 pfleura2
           END IF
38 5 pfleura2
        END IF
39 5 pfleura2
        READ(IOIN,'(A)') Line
40 5 pfleura2
        DO J=1,NAt
41 5 pfleura2
           READ(IOIN,*) AtName(J),XyzGeomI(I,1:3,J)
42 5 pfleura2
        END DO
43 5 pfleura2
        If (Debug) THEN
44 5 pfleura2
           WRITE(*,*) "Geom ",I
45 5 pfleura2
           DO J=1,NAt
46 5 pfleura2
              WRITE(*,'(1X,A2,3(1X,F15.6))') AtName(J),XyzGeomI(I,1:3,J)
47 5 pfleura2
           END DO
48 5 pfleura2
        END IF
49 5 pfleura2
     END DO
50 5 pfleura2
51 5 pfleura2
52 5 pfleura2
  if (debug) Call Header("Exiting ReadGeom_cart")
53 5 pfleura2
54 5 pfleura2
END SUBROUTINE ReadGeom_cart