NLSL
ipsfind.f90
Go to the documentation of this file.
1 c NLSL Version 1.9.0 beta 2/7/15
2 c----------------------------------------------------------------------
3 c =========================
4 c function IPFIND
5 c =========================
6 c
7 c Search for the given token in one of the lists of the names of EPRLL
8 c spectral calculation parameters, which are defined in module lpnam.
9 c Function return values are as follows:
10 c
11 c -200 < ipfind < -100 Specified name was the (axial tensor) alias
12 c of a floating point parameter.
13 c Returned value is the negative of the index
14 c of the parameter in the fepr array, minus 100.
15 c
16 c -100 < ipfind < 0 Specified name was the (spherical tensor) alias
17 c of a floating point parameter.
18 c Returned value is the negative of the index of
19 c the parameter in the fepr array.
20 c
21 c 0 < ipfind < 100 Specified name was a floating point parameter.
22 c Returned value is the index of the parameter
23 c in the fepr array
24 c
25 c ipfind > 100 Specified name was an integer parameter.
26 c Returned value minus 100 is the index of the
27 c parameter in the iepr array
28 c
29 c
30 c NOTE: The order of names in this list MUST correspond to the order
31 c of parameters in modules eprprm and lpnam for this routine to work
32 c properly.
33 c
34 c----------------------------------------------------------------------
35  function ipfind(token,lth)
36 
37  use nlsdim
38  use parcom
39  use eprprm
40  use lpnam
41 
42  implicit none
43  integer :: ipfind,lth
44  character :: token*30
45 c
46  integer :: i
47 c
48 c----------------------------------------------------------------------
49 c Search the list of floating point parameter names
50 c----------------------------------------------------------------------
51  do i=1,nfprm
52  if (token(:lth).eq.parnam(i)(:lth)) then
53  ipfind=i
54  return
55  end if
56  end do
57 c
58 c----------------------------------------------------------------------
59 c Search both lists of floating point parameter aliases
60 c (these are all names of spherical tensor components)
61 c Return negative index if found in alias1
62 c Return negative index-100 if found in alias2
63 c----------------------------------------------------------------------
64  do i=1,nalias
65  if (token(:lth).eq.alias1(i)(:lth)) then
66  ipfind=1-(iwxx+i)
67  return
68  else if (token(:lth).eq.alias2(i)(:lth)) then
69  ipfind=-(99+iwxx+i)
70  return
71  end if
72  end do
73 c
74 c----------------------------------------------------------------------
75 c Search the list of integer parameter names
76 c----------------------------------------------------------------------
77  do i=1,niprm
78  if (token(:lth).eq.iprnam(i)(:lth)) then
79  ipfind=100+i
80  return
81  end if
82  end do
83 c
84 c----------------------------------------------------------------------
85 c Token was not found
86 c----------------------------------------------------------------------
87  ipfind=0
88  return
89  end function ipfind
90 
91 c----------------------------------------------------------------------
92 c =========================
93 c function ISFIND
94 c =========================
95 c
96 c Search for the given token in one of several lists of strings.
97 c Potential matches are stored in the arrays that hold the datafile,
98 c basisid, and symbolic names. Datafile and basisid names are defined
99 c via I/O within the datac and basisc routines. Symbolic names are
100 c defined in the initialization segment of module lpnam--formerly
101 c these were encoded in the block data section of nlstxt.f.
102 c
103 c If a match is found, ISFIND returns an index into the array which
104 c contains the match. The index is positive if the match is in the
105 c symbol array. The index is multipled by -1 if the match is in the
106 c datafile or basisid array. Otherwise, 0 is returned.
107 c----------------------------------------------------------------------
108  function isfind(token,lth)
109 c
110  use nlsdim
111  use expdat
112  use basis
113  use lpnam
114  use stdio
115  implicit none
116 c
117  integer :: isfind,lth
118  character :: token*30,tmpstr*30
119 c
120  integer :: i,nlth
121  integer, external :: itrim
122 c
123 c----------------------------------------------------------------------
124 c Search the list of datafile names
125 c----------------------------------------------------------------------
126  do i=1,nspc
127  tmpstr=dataid(i)
128  nlth=itrim(tmpstr)
129  if (nlth.ge.lth) then
130  if (token(:lth).eq.tmpstr(:lth)) then
131  isfind=-i
132  return
133  end if
134  end if
135  end do
136 c
137 c----------------------------------------------------------------------
138 c Search the list of basis set names
139 c----------------------------------------------------------------------
140  do i=1,nbas
141  tmpstr=basisid(i)
142  nlth=itrim(tmpstr)
143  if (nlth.ge.lth) then
144  if (token(:lth).eq.tmpstr(:lth)) then
145  isfind=-i
146  return
147  end if
148  end if
149  end do
150 c
151 c
152 c----------------------------------------------------------------------
153 c Search the list of symbolic names
154 c----------------------------------------------------------------------
155  tmpstr=token
156  call touppr(tmpstr,lth)
157  do i=1,nsymbl
158  if (tmpstr(:lth).eq.symbol(i)(:lth)) then
159  isfind=i
160  return
161  end if
162  end do
163 c
164  isfind=0
165  return
166  end
integer, parameter niprm
Definition: nlsdim.f90:57
character *30, dimension(mxtdm), save basisid
Definition: basis.f90:27
character *6, dimension(nalias), save alias1
Definition: lpnam.f90:45
Definition: stdio.f90:26
character *30, dimension(mxspc), save dataid
Definition: expdat.f90:51
subroutine touppr(string, lth)
Definition: strutl2.f90:22
Definition: basis.f90:19
integer function isfind(token, lth)
Definition: ipsfind.f90:109
character *10, dimension(nsymbl), save symbol
Definition: lpnam.f90:60
integer, save nspc
Definition: expdat.f90:45
integer function ipfind(token, lth)
Definition: ipsfind.f90:36
integer, parameter iwxx
Definition: eprprm.f90:92
Definition: lpnam.f90:18
integer, parameter nalias
Definition: nlsdim.f90:57
character *6, dimension(nfprm), save parnam
Definition: lpnam.f90:27
character *6, dimension(niprm), save iprnam
Definition: lpnam.f90:38
integer, save nbas
Definition: basis.f90:23
integer, parameter nfprm
Definition: nlsdim.f90:57
integer, parameter nsymbl
Definition: nlsdim.f90:57
character *6, dimension(nalias), save alias2
Definition: lpnam.f90:51