The TELEMAC-MASCARET system  trunk
inclus.f
Go to the documentation of this file.
1 ! ***********************
2  LOGICAL FUNCTION inclus
3 ! ***********************
4 !
5  &( c1 , c2 )
6 !
7 !***********************************************************************
8 ! BIEF V6P1 21/08/2010
9 !***********************************************************************
10 !
11 !brief CHECKS IF A CHARACTER STRING IS COMPRISED IN ANOTHER.
12 !+ INCLUS=.TRUE. MEANS 'C2 IS COMPRISED IN C1'.
13 !
14 !history J.M. HERVOUET (LNH)
15 !+ 17/08/94
16 !+ V5P1
17 !+
18 !
19 !history N.DURAND (HRW), S.E.BOURBAN (HRW)
20 !+ 13/07/2010
21 !+ V6P0
22 !+ Translation of French comments within the FORTRAN sources into
23 !+ English comments
24 !
25 !history N.DURAND (HRW), S.E.BOURBAN (HRW)
26 !+ 21/08/2010
27 !+ V6P0
28 !+ Creation of DOXYGEN tags for automated documentation and
29 !+ cross-referencing of the FORTRAN sources
30 !
31 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32 !| C1 |-->| CHARACTER STRING WHERE C2 IS LOOKED FOR
33 !| C2 |-->| CHARACTER STRING LOOKED FOR INTO C1
34 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35 !
37  IMPLICIT NONE
38 !
39  CHARACTER(LEN=*) C1 , C2
40 !
41  INTEGER I,LC1,LC2
42 !
43  INTRINSIC len
44 !
45 !-----------------------------------------------------------------------
46 !
47  inclus = .false.
48 !
49  lc1 = len(c1)
50  lc2 = len(c2)
51  IF(lc2.GT.lc1) GO TO 1000
52 !
53  i = 0
54 10 i = i + 1
55  IF(i.GT.lc1-lc2+1) GO TO 1000
56 !
57  IF(c1(i:i+lc2-1).NE.c2(1:lc2)) GO TO 10
58 !
59  inclus = .true.
60 !
61 1000 CONTINUE
62 !
63 !-----------------------------------------------------------------------
64 !
65  RETURN
66  END
logical function inclus(C1, C2)
Definition: inclus.f:7