1 |
C $Header: $ |
2 |
C $Name: $ |
3 |
|
4 |
!======================================================================= |
5 |
integer function mitcplr_match_comp( carg ) |
6 |
implicit none |
7 |
! Predefined constants/arrays |
8 |
#include "CPLR_SIG.h" |
9 |
! Arguments |
10 |
character*(*) carg |
11 |
! Local |
12 |
integer j,jmatch |
13 |
! ------------------------------------------------------------------ |
14 |
|
15 |
if ( carg .EQ. coupler_Name ) then |
16 |
mitcplr_match_comp=-1 |
17 |
stop 'mitcplr_match_comp: I should not reach this point' |
18 |
else |
19 |
|
20 |
! Search through list of components |
21 |
jmatch=0 |
22 |
do j=1,num_components |
23 |
if ( carg .EQ. component_List(j) ) then |
24 |
if ( jmatch .NE. 0 ) then |
25 |
if (DEBUG) write(0,*) 'mitcplr_match_comp: String arg = ',carg |
26 |
stop 'mitcplr_match_comp: More than one match to string' |
27 |
else |
28 |
jmatch=j |
29 |
endif |
30 |
endif |
31 |
enddo |
32 |
|
33 |
! If no matches, create entry in list |
34 |
if ( jmatch .EQ. 0) then |
35 |
if ( num_components .EQ. MAX_COMPONENTS ) then |
36 |
stop 'mitcplr_match_comp: Too many components types entered' |
37 |
endif |
38 |
num_components=num_components+1 |
39 |
jmatch=num_components |
40 |
call mitcplr_initcomp( jmatch, carg ) |
41 |
endif |
42 |
|
43 |
! Return index within list |
44 |
mitcplr_match_comp=jmatch |
45 |
|
46 |
endif |
47 |
|
48 |
! ------------------------------------------------------------------ |
49 |
return |
50 |
end |
51 |
!======================================================================= |