/[lmdze]/trunk/IOIPSL/find_str.f90
ViewVC logotype

Contents of /trunk/IOIPSL/find_str.f90

Parent Directory Parent Directory | Revision Log Revision Log


Revision 328 - (show annotations)
Thu Jun 13 14:40:06 2019 UTC (4 years, 11 months ago) by guez
File size: 1218 byte(s)
Change all `.f` suffixes to `.f90`. (The opposite was done in revision
82.)  Because of change of philosopy in GNUmakefile: we already had a
rewritten rule for `.f`, so it does not make the makefile longer to
replace it by a rule for `.f90`. And it spares us options of
makedepf90 and of the compiler. Also we prepare the way for a simpler
`CMakeLists.txt`.

1 module find_str_m
2
3 implicit none
4
5 contains
6
7 !=
8 SUBROUTINE find_str (nb_str,str_tab,str_len_tab,str,pos)
9 !---------------------------------------------------------------------
10 !- This subroutine looks for a string in a table
11 !---------------------------------------------------------------------
12 !- INPUT
13 !- nb_str : length of table
14 !- str_tab : Table of strings
15 !- str_len_tab : Table of string-length
16 !- str : Target we are looking for
17 !- OUTPUT
18 !- pos : -1 if str not found, else value in the table
19 !---------------------------------------------------------------------
20 IMPLICIT NONE
21 !-
22 INTEGER :: nb_str
23 CHARACTER(LEN=*),DIMENSION(nb_str) :: str_tab
24 INTEGER,DIMENSION(nb_str) :: str_len_tab
25 CHARACTER(LEN=*) :: str
26 INTEGER :: pos
27 !-
28 INTEGER :: i,il
29 !---------------------------------------------------------------------
30 pos = -1
31 il = LEN_TRIM(str)
32 IF ( nb_str > 0 ) THEN
33 DO i=1,nb_str
34 IF ( (INDEX(str_tab(i),str(1:il)) > 0) &
35 .AND.(str_len_tab(i) == il) ) THEN
36 pos = i
37 EXIT
38 ENDIF
39 ENDDO
40 ENDIF
41 !-------------------------
42 END SUBROUTINE find_str
43
44 end module find_str_m

  ViewVC Help
Powered by ViewVC 1.1.21