The TELEMAC-MASCARET system
trunk
sources
utils
damocles
next.f
Go to the documentation of this file.
1
! *********************
2
INTEGER
FUNCTION
next
3
! *********************
4
!
5
&( icol , ligne )
6
!
7
!***********************************************************************
8
! DAMOCLES V6P0 21/08/2010
9
!***********************************************************************
10
!
11
!brief RETURNS THE INDEX OF THE 1ST NON-WHITE, NON-TABULATION
12
!+ AND NON-COMMENT CHARACTER OF THE LINE, STARTING FROM
13
!+ COLUMN ICOL.
14
!+ IF THERE ARE NONE, SCANS THE NEXT LINE
15
!+ IF CANNOT FIND ANY, NEXT = LONGLI + 1
16
!
17
!note PORTABILITY : IBM,CRAY,HP,SUN
18
!
19
!history O. QUIQUEMPOIX (LNH)
20
!+ 15/12/1993
21
!+
22
!+
23
!
24
!history J.M. HERVOUET (LNH); A. YESSAYAN
25
!+ 16/08/1994
26
!+ V5P1
27
!+
28
!
29
!history N.DURAND (HRW), S.E.BOURBAN (HRW)
30
!+ 13/07/2010
31
!+ V6P0
32
!+ Translation of French comments within the FORTRAN sources into
33
!+ English comments
34
!
35
!history N.DURAND (HRW), S.E.BOURBAN (HRW)
36
!+ 21/08/2010
37
!+ V6P0
38
!+ Creation of DOXYGEN tags for automated documentation and
39
!+ cross-referencing of the FORTRAN sources
40
!
41
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
42
!| ICOL |<->| POSITION COURANTE DU POINTEUR DANS LA LIGNE
43
!| LIGNE |<->| LIGNE EN COURS DE DECODAGE
44
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
45
!
46
USE
declarations_damocles
47
USE
declarations_special
48
IMPLICIT NONE
49
!
50
INTEGER
ICOL
51
CHARACTER(LEN=*)
LIGNE*(*)
52
!
53
!-----------------------------------------------------------------------
54
!
55
INTEGER
I,J
56
CHARACTER(LEN=1)
TABUL
57
!
58
!-----------------------------------------------------------------------
59
!
60
INTRINSIC
char
61
!
62
!***********************************************************************
63
! RCS AND SCCS MARKING
64
!
65
!***********************************************************************
66
!
67
tabul = char(9)
68
next
=
longli
+ 1
69
i = icol -1
70
!
71
100
CONTINUE
72
i = i + 1
73
!
74
IF
(i.GT.
longli
)
THEN
75
99
nlign
=
nlign
+ 1
76
READ
(
nfic
,end=900,err=998,fmt=
'(A)'
) ligne
77
! DOES NOT CONSIDER A LINE STARTING WITH '/'
78
IF
(ligne(1:1).EQ.
'/'
)
GO TO
99
79
i = 0
80
GO TO
100
81
ENDIF
82
!
83
!
84
! CASE OF A WHITE OR TABULATION CHARACTER
85
IF
(ligne(i:i).EQ.
' '
.OR.ligne(i:i).EQ.tabul)
GOTO
100
86
!
87
!-----------------------------------------------------------------------
88
!
89
! DOES NOT CONSIDER THE COMMENTED LINES:
90
!
91
! IF ( LIGNE(I:I).NE.'/'.OR.I.GE.LONGLI ) THEN
92
IF
(ligne(i:i).NE.
'/'
)
THEN
93
next
= i
94
GO TO
1000
95
ELSE
96
DO
j = i+1 ,
longli
97
IF
( ligne(j:j).EQ.
'/'
)
THEN
98
i = j
99
GO TO
100
100
ENDIF
101
ENDDO
! J
102
i =
longli
103
GO TO
100
104
ENDIF
105
!
106
!-----------------------------------------------------------------------
107
!
108
998
CONTINUE
109
WRITE
(
lu
,1999)
nfic
,
nlign
110
1999
FORMAT
(1x,
'LOGICAL UNIT '
,1i2,
' ERROR LINE '
,1i6)
111
900
CONTINUE
112
retour
= .true.
113
!
114
1000
CONTINUE
115
!
116
!-----------------------------------------------------------------------
117
!
118
RETURN
119
END
declarations_special
Definition:
declarations_special.F:3
next
integer function next(ICOL, LIGNE)
Definition:
next.f:7
declarations_special::lu
integer lu
Definition:
declarations_special.F:45
declarations_damocles::retour
logical retour
Definition:
declarations_damocles.f:28
declarations_damocles::nlign
integer nlign
Definition:
declarations_damocles.f:30
declarations_damocles::nfic
integer nfic
Definition:
declarations_damocles.f:33
declarations_damocles::longli
integer longli
Definition:
declarations_damocles.f:31
declarations_damocles
Definition:
declarations_damocles.f:3