Statistics
| Revision:

root / src / NoString.f90 @ 10

History | View | Annotate | Download (638 Bytes)

1 10 pfleura2
      SUBROUTINE noString(String)
2 10 pfleura2
3 10 pfleura2
! This subroutine suppress the content of string variable
4 10 pfleura2
! strings can be delimited by ' or "
5 10 pfleura2
! example:
6 10 pfleura2
! Progexe='./siesta', -> Progexe=,
7 10 pfleura2
8 10 pfleura2
        use VarTypes
9 10 pfleura2
10 10 pfleura2
        IMPLICIT NONE
11 10 pfleura2
12 10 pfleura2
        CHARACTER(*), INTENT(INOUT) :: String
13 10 pfleura2
        CHARACTER(VLCHARS) :: Result
14 10 pfleura2
        INTEGER(KINT) :: i
15 10 pfleura2
        CHARACTER(2), PARAMETER :: Del='"' // "'"
16 10 pfleura2
17 10 pfleura2
        DO WHILE (scan(String,Del)/=0)
18 10 pfleura2
           I=Scan(String,Del)
19 10 pfleura2
           Result=String(:I-1)
20 10 pfleura2
           String=String(I+1:)
21 10 pfleura2
           I=Scan(String,Del)
22 10 pfleura2
           String=TRIM(Result) // String(I+1:)
23 10 pfleura2
        END DO
24 10 pfleura2
25 10 pfleura2
      END SUBROUTINE NoString