ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
pm_arrayStrip::getSIL Interface Reference

Generate and return index, the index of the first element of the input array such that array(1:index-1) contains only full repetitions of the user-specified pattern. More...

Detailed Description

Generate and return index, the index of the first element of the input array such that array(1:index-1) contains only full repetitions of the user-specified pattern.

Parameters
[in]array: The input contiguous vector of either
  • type character of kind any supported by the processor (e.g., SK, SKA, SKD , or SKU), or
  • type logical of kind any supported by the processor (e.g., LK), or
  • type integer of kind any supported by the processor (e.g., IK, IK8, IK16, IK32, or IK64), or
  • type complex of kind any supported by the processor (e.g., CK, CK32, CK64, or CK128), or
  • type real of kind any supported by the processor (e.g., RK, RK32, RK64, or RK128),
or,
  • a scalar assumed-length character of kind any supported by the processor (e.g., SK, SKA, SKD , or SKU),
[in]pattern: The input object of the same type and kind as the input array, of rank similar to or lower than that of array, whose value is to be stripped from the beginning of array.
iseq: The external user-specified function that takes either two input assumed-length character arguments (if the input array is also an assumed-length character) or two array-valued explicit-shape arguments of the same type and kind as the input array.
It must return a scalar of type logical of default kind LK that is .true. if all elements of the two input arguments are equivalent (e.g., equal) according to the user-defined criterion, otherwise, it is .false..
The the input array is array-valued, then the last argument to iseq is the length of the input pattern.
The following illustrates the generic interface of iseq where pattern is array-valued,
function iseq(Segment, pattern, lenPattern) result(equivalent)
use pm_kind, only: IK, LK
integer(IK) , intent(in) :: lenPattern
TYPE(KIND) , intent(in) :: Segment(lenPattern), pattern(lenPattern)
logical(LK) :: equivalent
end function
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
Definition: pm_kind.F90:268
integer, parameter LK
The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(....
Definition: pm_kind.F90:541
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
Definition: pm_kind.F90:540
where TYPE(KIND) represents the type and kind of the input argument array, which can be one of the following,
character(*, SK), intent(in) :: Segment(lenPattern), pattern(lenPattern)
integer(IK) , intent(in) :: Segment(lenPattern), pattern(lenPattern)
logical(LK) , intent(in) :: Segment(lenPattern), pattern(lenPattern)
complex(CK) , intent(in) :: Segment(lenPattern), pattern(lenPattern)
real(RK) , intent(in) :: Segment(lenPattern), pattern(lenPattern)
where the kinds SKG, IKG, LKG, CKG, RK, can refer to any kind type parameter that is supported by the processor.
The following illustrates the generic interface of iseq where pattern is scalar-valued (including Fortran scalar strings),
function iseq(segment, pattern) result(equivalent)
use pm_kind, only: LK
TYPE(KIND) , intent(in) :: segment, pattern
logical(LK) :: equivalent
end function
where TYPE(KIND) represents the type and kind of the input argument array, which can be one of the following,
use pm_kind, only: SK, IK, LK, CK, RK
character(*, SK), intent(in) :: segment, pattern
integer(IK) , intent(in) :: segment, pattern
logical(LK) , intent(in) :: segment, pattern
complex(CK) , intent(in) :: segment, pattern
real(RK) , intent(in) :: segment, pattern
integer, parameter RK
The default real kind in the ParaMonte library: real64 in Fortran, c_double in C-Fortran Interoperati...
Definition: pm_kind.F90:543
integer, parameter CK
The default complex kind in the ParaMonte library: real64 in Fortran, c_double_complex in C-Fortran I...
Definition: pm_kind.F90:542
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
Definition: pm_kind.F90:539
where the kinds SK, IK, LK, CK, RK, can refer to any kind type parameter that is supported by the processor.
This user-defined equivalence check is extremely useful where an equivalence test other than exact identity is needed, for example, when the array segments should match the input pattern only within a given threshold or, when the case-sensitivity in character comparisons do not matter.
In such cases, user can define a custom equivalence criterion within the user-defined external function iseq to achieve the goal.
(optional, the default equivalence operator is .eqv. if the input array is logical, otherwise ==.)
Returns
index : The output scalar integer of default kind IK representing the index of the first element of the input array such that array(1:index-1) contains only full repetitions of the user-specified pattern.


Possible calling interfaces

use pm_kind, only: IK
integer(IK) :: index
index = getSIL(array, pattern) ! scalar strings
index = getSIL(array(:), pattern) ! all intrinsic types
index = getSIL(array(:), pattern(:)) ! all intrinsic types
index = getSIL(array, pattern, iseq) ! scalar strings
index = getSIL(array(:), pattern, iseq) ! all intrinsic types
index = getSIL(array(:), pattern(:), iseq) ! all intrinsic types
!
Generate and return index, the index of the first element of the input array such that array(1:index-...
This module contains procedures and generic interfaces for stripping a given pattern from the left an...
Warning
The procedures under this generic interface are impure when the user-specified external procedure iseq is specified as input argument.
Note that in Fortran, trailing blanks are ignored in character equivalence checks, that is, "Fortran" == "Fortran " yields .true..
The pure procedure(s) documented herein become impure when the ParaMonte library is compiled with preprocessor macro CHECK_ENABLED=1.
By default, these procedures are pure in release build and impure in debug and testing builds.
See also
getSIL
getSIR
getStripped
setReplaced
getReplaced
setInserted
setSplit
setLoc
getLoc


Example usage

1program example
2
3 use pm_kind, only: SK, IK, LK, CK, RK
4 use pm_io, only: display_type
5 use pm_arrayStrip, only: getSIL
6
7 implicit none
8
9 integer(IK) :: index
10
11 type(display_type) :: disp
12
13 disp = display_type(file = "main.out.F90")
14
15 call disp%skip()
16 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
17 call disp%show("! Strip pattern from the beginning of a string.")
18 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
19 call disp%skip()
20
21 block
22 character(:) , allocatable :: string, pattern
23
24 call disp%skip()
25 call disp%show("string = ''")
26 string = ''
27 call disp%show("pattern = ''")
28 pattern = ''
29 call disp%show("index = getSIL(string, pattern)")
30 index = getSIL(string, pattern)
31 call disp%show("string(index:)")
32 call disp%show( string(index:), deliml = """" )
33 call disp%show("index")
34 call disp%show( index )
35 call disp%skip()
36
37 call disp%skip()
38 call disp%show("string = 'aaabb'")
39 string = 'aaabb'
40 call disp%show("pattern = ''")
41 pattern = ''
42 call disp%show("index = getSIL(string, pattern)")
43 index = getSIL(string, pattern)
44 call disp%show("string(index:)")
45 call disp%show( string(index:), deliml = """" )
46 call disp%show("index")
47 call disp%show( index )
48 call disp%skip()
49
50 call disp%skip()
51 call disp%show("string = 'aaabb'")
52 string = 'aaabb'
53 call disp%show("pattern = 'a'")
54 pattern = 'a'
55 call disp%show("index = getSIL(string, pattern)")
56 index = getSIL(string, pattern)
57 call disp%show("string(index:)")
58 call disp%show( string(index:), deliml = """" )
59 call disp%show("index")
60 call disp%show( index )
61 call disp%skip()
62
63 call disp%skip()
64 call disp%show("string = 'aaabb'")
65 string = 'aaabb'
66 call disp%show("pattern = 'b'")
67 pattern = 'b'
68 call disp%show("index = getSIL(string, pattern)")
69 index = getSIL(string, pattern)
70 call disp%show("string(index:)")
71 call disp%show( string(index:), deliml = """" )
72 call disp%show("index")
73 call disp%show( index )
74 call disp%skip()
75
76 call disp%skip()
77 call disp%show("string = 'aaabb'")
78 string = 'aaabb'
79 call disp%show("pattern = 'aaabb '")
80 pattern = 'aaabb '
81 call disp%show("index = getSIL(string, pattern)")
82 index = getSIL(string, pattern)
83 call disp%show("string(index:)")
84 call disp%show( string(index:), deliml = """" )
85 call disp%show("index")
86 call disp%show( index )
87 call disp%skip()
88
89 call disp%skip()
90 call disp%show("string = 'aAbb'")
91 string = 'aAbb'
92 call disp%show("pattern = 'aa'")
93 pattern = 'aa'
94 call disp%show("index = getSIL(string, pattern)")
95 index = getSIL(string, pattern)
96 call disp%show("string(index:)")
97 call disp%show( string(index:), deliml = """" )
98 call disp%show("index")
99 call disp%show( index )
100 call disp%show("index = getSIL(string, pattern, iseqScalar_SK)")
101 index = getSIL(string, pattern, iseqScalar_SK)
102 call disp%show("string(index:)")
103 call disp%show( string(index:), deliml = """" )
104 call disp%show("index")
105 call disp%show( index )
106 call disp%skip()
107
108 end block
109
110 call disp%skip()
111 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
112 call disp%show("! Strip pattern from the beginning of a string array.")
113 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
114 call disp%skip()
115
116 block
117 character(2), allocatable :: array(:)
118 character(:), allocatable :: scalarPattern
119 character(:), allocatable :: arrayPattern(:)
120
121 call disp%skip()
122 call disp%show("array = [character(2) :: ]")
123 array = [character(2) :: ]
124 call disp%show("scalarPattern = ''")
125 scalarPattern = ''
126 call disp%show("index = getSIL(array, scalarPattern)")
127 index = getSIL(array, scalarPattern)
128 call disp%show("array(index:)")
129 call disp%show( array(index:), deliml = """" )
130 call disp%show("index")
131 call disp%show( index )
132 call disp%skip()
133
134 call disp%skip()
135 call disp%show("array = [character(2) :: ]")
136 array = [character(2) :: ]
137 call disp%show("arrayPattern = [character(1) :: ]")
138 arrayPattern = [character(1) :: ]
139 call disp%show("index = getSIL(array, arrayPattern)")
140 index = getSIL(array, arrayPattern)
141 call disp%show("array(index:)")
142 call disp%show( array(index:), deliml = """" )
143 call disp%show("index")
144 call disp%show( index )
145 call disp%skip()
146
147 call disp%skip()
148 call disp%show("array = ['a ', 'a ', 'bb']")
149 array = ['a ', 'a ', 'bb']
150 call disp%show("arrayPattern = [character(1) :: ]")
151 arrayPattern = [character(1) :: ]
152 call disp%show("index = getSIL(array, arrayPattern)")
153 index = getSIL(array, arrayPattern)
154 call disp%show("array(index:)")
155 call disp%show( array(index:), deliml = """" )
156 call disp%show("index")
157 call disp%show( index )
158 call disp%skip()
159
160 call disp%skip()
161 call disp%show("array = ['a ', 'a ', 'bb']")
162 array = ['a ', 'a ', 'bb']
163 call disp%show("scalarPattern = 'a'")
164 scalarPattern = 'a'
165 call disp%show("index = getSIL(array, scalarPattern)")
166 index = getSIL(array, scalarPattern)
167 call disp%show("array(index:)")
168 call disp%show( array(index:), deliml = """" )
169 call disp%show("index")
170 call disp%show( index )
171 call disp%skip()
172
173 call disp%skip()
174 call disp%show("array = ['a ', 'a ', 'bb']")
175 array = ['a ', 'a ', 'bb']
176 call disp%show("arrayPattern = ['a', 'a']")
177 arrayPattern = ['a', 'a']
178 call disp%show("index = getSIL(array, arrayPattern)")
179 index = getSIL(array, arrayPattern)
180 call disp%show("array(index:)")
181 call disp%show( array(index:), deliml = """" )
182 call disp%show("index")
183 call disp%show( index )
184 call disp%skip()
185
186 call disp%skip()
187 call disp%show("array = ['a ', 'a ', 'bb']")
188 array = ['a ', 'a ', 'bb']
189 call disp%show("arrayPattern = 'bbb'")
190 arrayPattern = 'bbb'
191 call disp%show("index = getSIL(array, arrayPattern)")
192 index = getSIL(array, arrayPattern)
193 call disp%show("array(index:)")
194 call disp%show( array(index:), deliml = """" )
195 call disp%show("index")
196 call disp%show( index )
197 call disp%skip()
198
199 call disp%skip()
200 call disp%show("array = ['a ', 'a ', 'bb']")
201 array = ['a ', 'a ', 'bb']
202 call disp%show("arrayPattern = [array, ' ']")
203 arrayPattern = [array, ' ']
204 call disp%show("index = getSIL(array, arrayPattern)")
205 index = getSIL(array, arrayPattern)
206 call disp%show("array(index:)")
207 call disp%show( array(index:), deliml = """" )
208 call disp%show("index")
209 call disp%show( index )
210 call disp%skip()
211
212 call disp%skip()
213 call disp%show("array = ['a ', 'A ', 'bb']")
214 array = ['a ', 'A ', 'bb']
215 call disp%show("scalarPattern = 'A '")
216 scalarPattern = 'A '
217 call disp%show("index = getSIL(array, scalarPattern)")
218 index = getSIL(array, scalarPattern)
219 call disp%show("array(index:)")
220 call disp%show( array(index:), deliml = """" )
221 call disp%show("index")
222 call disp%show( index )
223 call disp%show("index = getSIL(array, scalarPattern, iseqScalar_SK)")
224 index = getSIL(array, scalarPattern, iseqScalar_SK)
225 call disp%show("array(index:)")
226 call disp%show( array(index:), deliml = """" )
227 call disp%show("index")
228 call disp%show( index )
229 call disp%skip()
230
231 call disp%skip()
232 call disp%show("array = ['a ', 'A ', 'bb']")
233 array = ['a ', 'A ', 'bb']
234 call disp%show("arrayPattern = ['A ', 'a ']")
235 arrayPattern = ['A ', 'a ']
236 call disp%show("index = getSIL(array, arrayPattern)")
237 index = getSIL(array, arrayPattern)
238 call disp%show("array(index:)")
239 call disp%show( array(index:), deliml = """" )
240 call disp%show("index")
241 call disp%show( index )
242 call disp%show("index = getSIL(array, arrayPattern, iseqVector_SK)")
243 index = getSIL(array, arrayPattern, iseqVector_SK)
244 call disp%show("array(index:)")
245 call disp%show( array(index:), deliml = """" )
246 call disp%show("index")
247 call disp%show( index )
248 call disp%skip()
249
250 end block
251
252 call disp%skip()
253 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
254 call disp%show("! Strip pattern from the beginning of a integer array.")
255 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
256 call disp%skip()
257
258 block
259 integer, allocatable :: array(:)
260 integer, allocatable :: scalarPattern
261 integer, allocatable :: arrayPattern(:)
262
263 call disp%skip()
264 call disp%show("array = [integer :: ]")
265 array = [integer :: ]
266 call disp%show("arrayPattern = [integer :: ]")
267 arrayPattern = [integer :: ]
268 call disp%show("index = getSIL(array, arrayPattern)")
269 index = getSIL(array, arrayPattern)
270 call disp%show("array(index:)")
271 call disp%show( array(index:) )
272 call disp%show("index")
273 call disp%show( index )
274 call disp%skip()
275
276 call disp%skip()
277 call disp%show("array = [1, 1, 2]")
278 array = [1, 1, 2]
279 call disp%show("arrayPattern = [integer :: ]")
280 arrayPattern = [integer :: ]
281 call disp%show("index = getSIL(array, arrayPattern)")
282 index = getSIL(array, arrayPattern)
283 call disp%show("array(index:)")
284 call disp%show( array(index:) )
285 call disp%show("index")
286 call disp%show( index )
287 call disp%skip()
288
289 call disp%skip()
290 call disp%show("array = [1, 1, 2]")
291 array = [1, 1, 2]
292 call disp%show("scalarPattern = 1")
293 scalarPattern = 1
294 call disp%show("index = getSIL(array, scalarPattern)")
295 index = getSIL(array, scalarPattern)
296 call disp%show("array(index:)")
297 call disp%show( array(index:) )
298 call disp%show("index")
299 call disp%show( index )
300 call disp%skip()
301
302 call disp%skip()
303 call disp%show("array = [1, 1, 2]")
304 array = [1, 1, 2]
305 call disp%show("arrayPattern = [1, 1]")
306 arrayPattern = [1, 1]
307 call disp%show("index = getSIL(array, arrayPattern)")
308 index = getSIL(array, arrayPattern)
309 call disp%show("array(index:)")
310 call disp%show( array(index:) )
311 call disp%show("index")
312 call disp%show( index )
313 call disp%skip()
314
315 call disp%skip()
316 call disp%show("array = [1, 1, 2]")
317 array = [1, 1, 2]
318 call disp%show("arrayPattern = 3")
319 arrayPattern = 3
320 call disp%show("index = getSIL(array, arrayPattern)")
321 index = getSIL(array, arrayPattern)
322 call disp%show("array(index:)")
323 call disp%show( array(index:) )
324 call disp%show("index")
325 call disp%show( index )
326 call disp%skip()
327
328 call disp%skip()
329 call disp%show("array = [1, 1, 2]")
330 array = [1, 1, 2]
331 call disp%show("arrayPattern = array")
332 arrayPattern = array
333 call disp%show("index = getSIL(array, arrayPattern)")
334 index = getSIL(array, arrayPattern)
335 call disp%show("array(index:)")
336 call disp%show( array(index:) )
337 call disp%show("index")
338 call disp%show( index )
339 call disp%skip()
340
341 call disp%skip()
342 call disp%show("array = [1, 1, 2]")
343 array = [1, 1, 2]
344 call disp%show("arrayPattern = [array, 0]")
345 arrayPattern = [array, 0]
346 call disp%show("index = getSIL(array, arrayPattern)")
347 index = getSIL(array, arrayPattern)
348 call disp%show("array(index:)")
349 call disp%show( array(index:) )
350 call disp%show("index")
351 call disp%show( index )
352 call disp%skip()
353
354 call disp%skip()
355 call disp%show("array = [1, -1, 2]")
356 array = [1, -1, 2]
357 call disp%show("scalarPattern = 1")
358 scalarPattern = 1
359 call disp%show("index = getSIL(array, scalarPattern)")
360 index = getSIL(array, scalarPattern)
361 call disp%show("array(index:)")
362 call disp%show( array(index:) )
363 call disp%show("index")
364 call disp%show( index )
365 call disp%show("index = getSIL(array, scalarPattern, iseqScalar_IK)")
366 index = getSIL(array, scalarPattern, iseqScalar_IK)
367 call disp%show("array(index:)")
368 call disp%show( array(index:) )
369 call disp%show("index")
370 call disp%show( index )
371 call disp%skip()
372
373 call disp%skip()
374 call disp%show("array = [1, -1, 2]")
375 array = [1, -1, 2]
376 call disp%show("arrayPattern = [-1, 1]")
377 arrayPattern = [-1, 1]
378 call disp%show("index = getSIL(array, arrayPattern)")
379 index = getSIL(array, arrayPattern)
380 call disp%show("array(index:)")
381 call disp%show( array(index:) )
382 call disp%show("index")
383 call disp%show( index )
384 call disp%show("index = getSIL(array, arrayPattern, iseqVector_IK)")
385 index = getSIL(array, arrayPattern, iseqVector_IK)
386 call disp%show("array(index:)")
387 call disp%show( array(index:) )
388 call disp%show("index")
389 call disp%show( index )
390 call disp%skip()
391
392 end block
393
394 call disp%skip()
395 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
396 call disp%show("! Strip pattern from the beginning of a logical array.")
397 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
398 call disp%skip()
399
400 block
401 logical, allocatable :: array(:)
402 logical, allocatable :: scalarPattern
403 logical, allocatable :: arrayPattern(:)
404
405 call disp%skip()
406 call disp%show("array = [logical :: ]")
407 array = [logical :: ]
408 call disp%show("arrayPattern = [logical :: ]")
409 arrayPattern = [logical :: ]
410 call disp%show("index = getSIL(array, arrayPattern)")
411 index = getSIL(array, arrayPattern)
412 call disp%show("array(index:)")
413 call disp%show( array(index:) )
414 call disp%show("index")
415 call disp%show( index )
416 call disp%skip()
417
418 call disp%skip()
419 call disp%show("array = [.false., .false., .true.]")
420 array = [.false., .false., .true.]
421 call disp%show("arrayPattern = [logical :: ]")
422 arrayPattern = [logical :: ]
423 call disp%show("index = getSIL(array, arrayPattern)")
424 index = getSIL(array, arrayPattern)
425 call disp%show("array(index:)")
426 call disp%show( array(index:) )
427 call disp%show("index")
428 call disp%show( index )
429 call disp%skip()
430
431 call disp%skip()
432 call disp%show("array = [.false., .false., .true.]")
433 array = [.false., .false., .true.]
434 call disp%show("scalarPattern = .false.")
435 scalarPattern = .false.
436 call disp%show("index = getSIL(array, scalarPattern)")
437 index = getSIL(array, scalarPattern)
438 call disp%show("array(index:)")
439 call disp%show( array(index:) )
440 call disp%show("index")
441 call disp%show( index )
442 call disp%skip()
443
444 call disp%skip()
445 call disp%show("array = [.false., .false., .true.]")
446 array = [.false., .false., .true.]
447 call disp%show("arrayPattern = [.false., .false.]")
448 arrayPattern = [.false., .false.]
449 call disp%show("index = getSIL(array, arrayPattern)")
450 index = getSIL(array, arrayPattern)
451 call disp%show("array(index:)")
452 call disp%show( array(index:) )
453 call disp%show("index")
454 call disp%show( index )
455 call disp%skip()
456
457 call disp%skip()
458 call disp%show("array = [.false., .false., .true.]")
459 array = [.false., .false., .true.]
460 call disp%show("arrayPattern = [.true., .true.]")
461 arrayPattern = [.true., .true.]
462 call disp%show("index = getSIL(array, arrayPattern)")
463 index = getSIL(array, arrayPattern)
464 call disp%show("array(index:)")
465 call disp%show( array(index:) )
466 call disp%show("index")
467 call disp%show( index )
468 call disp%skip()
469
470 call disp%skip()
471 call disp%show("array = [.false., .false., .true.]")
472 array = [.false., .false., .true.]
473 call disp%show("arrayPattern = array")
474 arrayPattern = array
475 call disp%show("index = getSIL(array, arrayPattern)")
476 index = getSIL(array, arrayPattern)
477 call disp%show("array(index:)")
478 call disp%show( array(index:) )
479 call disp%show("index")
480 call disp%show( index )
481 call disp%skip()
482
483 call disp%skip()
484 call disp%show("array = [.false., .false., .true.]")
485 array = [.false., .false., .true.]
486 call disp%show("arrayPattern = [array, .false.]")
487 arrayPattern = [array, .false.]
488 call disp%show("index = getSIL(array, arrayPattern)")
489 index = getSIL(array, arrayPattern)
490 call disp%show("array(index:)")
491 call disp%show( array(index:) )
492 call disp%show("index")
493 call disp%show( index )
494 call disp%skip()
495
496 call disp%skip()
497 call disp%show("array = [.false., .true., .true.]")
498 array = [.false., .true., .true.]
499 call disp%show("scalarPattern = .false.")
500 scalarPattern = .false.
501 call disp%show("index = getSIL(array, scalarPattern)")
502 index = getSIL(array, scalarPattern)
503 call disp%show("array(index:)")
504 call disp%show( array(index:) )
505 call disp%show("index")
506 call disp%show( index )
507 call disp%show("index = getSIL(array, scalarPattern, iseqScalar_LK)")
508 index = getSIL(array, scalarPattern, iseqScalar_LK)
509 call disp%show("array(index:)")
510 call disp%show( array(index:) )
511 call disp%show("index")
512 call disp%show( index )
513 call disp%skip()
514
515 call disp%skip()
516 call disp%show("array = [.false., .true., .true.]")
517 array = [.false., .true., .true.]
518 call disp%show("arrayPattern = [.true., .false.]")
519 arrayPattern = [.true., .false.]
520 call disp%show("index = getSIL(array, arrayPattern)")
521 index = getSIL(array, arrayPattern)
522 call disp%show("array(index:)")
523 call disp%show( array(index:) )
524 call disp%show("index")
525 call disp%show( index )
526 call disp%show("index = getSIL(array, arrayPattern, iseqVector_LK)")
527 index = getSIL(array, arrayPattern, iseqVector_LK)
528 call disp%show("array(index:)")
529 call disp%show( array(index:) )
530 call disp%show("index")
531 call disp%show( index )
532 call disp%skip()
533
534 end block
535
536 call disp%skip()
537 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
538 call disp%show("! Strip pattern from the beginning of a complex array.")
539 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
540 call disp%skip()
541
542 block
543 complex, allocatable :: array(:)
544 complex, allocatable :: scalarPattern
545 complex, allocatable :: arrayPattern(:)
546
547 call disp%skip()
548 call disp%show("array = [complex :: ]")
549 array = [complex :: ]
550 call disp%show("arrayPattern = [complex :: ]")
551 arrayPattern = [complex :: ]
552 call disp%show("index = getSIL(array, arrayPattern)")
553 index = getSIL(array, arrayPattern)
554 call disp%show("array(index:)")
555 call disp%show( array(index:) )
556 call disp%show("index")
557 call disp%show( index )
558 call disp%skip()
559
560 call disp%skip()
561 call disp%show("array = [1, 1, 2]")
562 array = [1, 1, 2]
563 call disp%show("arrayPattern = [complex :: ]")
564 arrayPattern = [complex :: ]
565 call disp%show("index = getSIL(array, arrayPattern)")
566 index = getSIL(array, arrayPattern)
567 call disp%show("array(index:)")
568 call disp%show( array(index:) )
569 call disp%show("index")
570 call disp%show( index )
571 call disp%skip()
572
573 call disp%skip()
574 call disp%show("array = [1, 1, 2]")
575 array = [1, 1, 2]
576 call disp%show("scalarPattern = 1")
577 scalarPattern = 1
578 call disp%show("index = getSIL(array, scalarPattern)")
579 index = getSIL(array, scalarPattern)
580 call disp%show("array(index:)")
581 call disp%show( array(index:) )
582 call disp%show("index")
583 call disp%show( index )
584 call disp%skip()
585
586 call disp%skip()
587 call disp%show("array = [1, 1, 2]")
588 array = [1, 1, 2]
589 call disp%show("arrayPattern = [1, 1]")
590 arrayPattern = [1, 1]
591 call disp%show("index = getSIL(array, arrayPattern)")
592 index = getSIL(array, arrayPattern)
593 call disp%show("array(index:)")
594 call disp%show( array(index:) )
595 call disp%show("index")
596 call disp%show( index )
597 call disp%skip()
598
599 call disp%skip()
600 call disp%show("array = [1, 1, 2]")
601 array = [1, 1, 2]
602 call disp%show("arrayPattern = 3")
603 arrayPattern = 3
604 call disp%show("index = getSIL(array, arrayPattern)")
605 index = getSIL(array, arrayPattern)
606 call disp%show("array(index:)")
607 call disp%show( array(index:) )
608 call disp%show("index")
609 call disp%show( index )
610 call disp%skip()
611
612 call disp%skip()
613 call disp%show("array = [1, 1, 2]")
614 array = [1, 1, 2]
615 call disp%show("arrayPattern = array")
616 arrayPattern = array
617 call disp%show("index = getSIL(array, arrayPattern)")
618 index = getSIL(array, arrayPattern)
619 call disp%show("array(index:)")
620 call disp%show( array(index:) )
621 call disp%show("index")
622 call disp%show( index )
623 call disp%skip()
624
625 call disp%skip()
626 call disp%show("array = [1, 1, 2]")
627 array = [1, 1, 2]
628 call disp%show("arrayPattern = [array, cmplx(0)]")
629 arrayPattern = [array, cmplx(0)]
630 call disp%show("index = getSIL(array, arrayPattern)")
631 index = getSIL(array, arrayPattern)
632 call disp%show("array(index:)")
633 call disp%show( array(index:) )
634 call disp%show("index")
635 call disp%show( index )
636 call disp%skip()
637
638 call disp%skip()
639 call disp%show("array = [1, -1, 2]")
640 array = [1, -1, 2]
641 call disp%show("scalarPattern = 1")
642 scalarPattern = 1
643 call disp%show("index = getSIL(array, scalarPattern)")
644 index = getSIL(array, scalarPattern)
645 call disp%show("array(index:)")
646 call disp%show( array(index:) )
647 call disp%show("index")
648 call disp%show( index )
649 call disp%show("index = getSIL(array, scalarPattern, iseqScalar_CK)")
650 index = getSIL(array, scalarPattern, iseqScalar_CK)
651 call disp%show("array(index:)")
652 call disp%show( array(index:) )
653 call disp%show("index")
654 call disp%show( index )
655 call disp%skip()
656
657 call disp%skip()
658 call disp%show("array = [1, -1, 2]")
659 array = [1, -1, 2]
660 call disp%show("arrayPattern = [-1, 1]")
661 arrayPattern = [-1, 1]
662 call disp%show("index = getSIL(array, arrayPattern)")
663 index = getSIL(array, arrayPattern)
664 call disp%show("array(index:)")
665 call disp%show( array(index:) )
666 call disp%show("index")
667 call disp%show( index )
668 call disp%show("index = getSIL(array, arrayPattern, iseqVector_CK)")
669 index = getSIL(array, arrayPattern, iseqVector_CK)
670 call disp%show("array(index:)")
671 call disp%show( array(index:) )
672 call disp%show("index")
673 call disp%show( index )
674 call disp%skip()
675
676 end block
677
678 call disp%skip()
679 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
680 call disp%show("! Strip pattern from the beginning of a real array.")
681 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
682 call disp%skip()
683
684 block
685 real, allocatable :: array(:)
686 real, allocatable :: scalarPattern
687 real, allocatable :: arrayPattern(:)
688
689 call disp%skip()
690 call disp%show("array = [real :: ]")
691 array = [real :: ]
692 call disp%show("arrayPattern = [real :: ]")
693 arrayPattern = [real :: ]
694 call disp%show("index = getSIL(array, arrayPattern)")
695 index = getSIL(array, arrayPattern)
696 call disp%show("array(index:)")
697 call disp%show( array(index:) )
698 call disp%show("index")
699 call disp%show( index )
700 call disp%skip()
701
702 call disp%skip()
703 call disp%show("array = [1, 1, 2]")
704 array = [1, 1, 2]
705 call disp%show("arrayPattern = [real :: ]")
706 arrayPattern = [real :: ]
707 call disp%show("index = getSIL(array, arrayPattern)")
708 index = getSIL(array, arrayPattern)
709 call disp%show("array(index:)")
710 call disp%show( array(index:) )
711 call disp%show("index")
712 call disp%show( index )
713 call disp%skip()
714
715 call disp%skip()
716 call disp%show("array = [1, 1, 2]")
717 array = [1, 1, 2]
718 call disp%show("scalarPattern = 1")
719 scalarPattern = 1
720 call disp%show("index = getSIL(array, scalarPattern)")
721 index = getSIL(array, scalarPattern)
722 call disp%show("array(index:)")
723 call disp%show( array(index:) )
724 call disp%show("index")
725 call disp%show( index )
726 call disp%skip()
727
728 call disp%skip()
729 call disp%show("array = [1, 1, 2]")
730 array = [1, 1, 2]
731 call disp%show("arrayPattern = [1, 1]")
732 arrayPattern = [1, 1]
733 call disp%show("index = getSIL(array, arrayPattern)")
734 index = getSIL(array, arrayPattern)
735 call disp%show("array(index:)")
736 call disp%show( array(index:) )
737 call disp%show("index")
738 call disp%show( index )
739 call disp%skip()
740
741 call disp%skip()
742 call disp%show("array = [1, 1, 2]")
743 array = [1, 1, 2]
744 call disp%show("arrayPattern = 3")
745 arrayPattern = 3
746 call disp%show("index = getSIL(array, arrayPattern)")
747 index = getSIL(array, arrayPattern)
748 call disp%show("array(index:)")
749 call disp%show( array(index:) )
750 call disp%show("index")
751 call disp%show( index )
752 call disp%skip()
753
754 call disp%skip()
755 call disp%show("array = [1, 1, 2]")
756 array = [1, 1, 2]
757 call disp%show("arrayPattern = array")
758 arrayPattern = array
759 call disp%show("index = getSIL(array, arrayPattern)")
760 index = getSIL(array, arrayPattern)
761 call disp%show("array(index:)")
762 call disp%show( array(index:) )
763 call disp%show("index")
764 call disp%show( index )
765 call disp%skip()
766
767 call disp%skip()
768 call disp%show("array = [1, 1, 2]")
769 array = [1, 1, 2]
770 call disp%show("arrayPattern = [array, real(0)]")
771 arrayPattern = [array, real(0)]
772 call disp%show("index = getSIL(array, arrayPattern)")
773 index = getSIL(array, arrayPattern)
774 call disp%show("array(index:)")
775 call disp%show( array(index:) )
776 call disp%show("index")
777 call disp%show( index )
778 call disp%skip()
779
780 call disp%skip()
781 call disp%show("array = [1, -1, 2]")
782 array = [1, -1, 2]
783 call disp%show("scalarPattern = 1")
784 scalarPattern = 1
785 call disp%show("index = getSIL(array, scalarPattern)")
786 index = getSIL(array, scalarPattern)
787 call disp%show("array(index:)")
788 call disp%show( array(index:) )
789 call disp%show("index")
790 call disp%show( index )
791 call disp%show("index = getSIL(array, scalarPattern, iseqScalar_RK)")
792 index = getSIL(array, scalarPattern, iseqScalar_RK)
793 call disp%show("array(index:)")
794 call disp%show( array(index:) )
795 call disp%show("index")
796 call disp%show( index )
797 call disp%skip()
798
799 call disp%skip()
800 call disp%show("array = [1, -1, 2]")
801 array = [1, -1, 2]
802 call disp%show("arrayPattern = [-1, 1]")
803 arrayPattern = [-1, 1]
804 call disp%show("index = getSIL(array, arrayPattern)")
805 index = getSIL(array, arrayPattern)
806 call disp%show("array(index:)")
807 call disp%show( array(index:) )
808 call disp%show("index")
809 call disp%show( index )
810 call disp%show("index = getSIL(array, arrayPattern, iseqVector_RK)")
811 index = getSIL(array, arrayPattern, iseqVector_RK)
812 call disp%show("array(index:)")
813 call disp%show( array(index:) )
814 call disp%show("index")
815 call disp%show( index )
816 call disp%skip()
817
818 end block
819
820contains
821
822 pure function iseqScalar_SK(segment, pattern) result(equivalent)
823 use pm_strASCII, only: getStrLower
824 character(*), intent(in) :: segment, pattern
825 logical(LK) :: equivalent
826 equivalent = getStrLower(segment) == getStrLower(pattern)
827 end
828
829 pure function iseqVector_SK(Segment, pattern, sizePattern) result(equivalent)
830 use pm_strASCII, only: getStrLower
831 integer(IK) , intent(in) :: sizePattern
832 character(*), intent(in) :: Segment(sizePattern), pattern(sizePattern)
833 logical(LK) :: equivalent
834 equivalent = all(getStrLower(Segment) == getStrLower(pattern))
835 end
836
837 pure function iseqScalar_IK(segment, pattern) result(equivalent)
838 integer , intent(in) :: segment, pattern
839 logical(LK) :: equivalent
840 equivalent = abs(segment) == abs(pattern)
841 end
842
843 pure function iseqVector_IK(Segment, pattern, sizePattern) result(equivalent)
844 integer(IK) , intent(in) :: sizePattern
845 integer , intent(in) :: Segment(sizePattern), pattern(sizePattern)
846 logical(LK) :: equivalent
847 equivalent = all(abs(Segment) == abs(pattern))
848 end
849
850 pure function iseqScalar_LK(segment, pattern) result(equivalent)
851 logical , intent(in) :: segment, pattern
852 logical(LK) :: equivalent
853 equivalent = segment .eqv. .not. pattern
854 end
855
856 pure function iseqVector_LK(Segment, pattern, sizePattern) result(equivalent)
857 integer(IK) , intent(in) :: sizePattern
858 logical , intent(in) :: Segment(sizePattern), pattern(sizePattern)
859 logical(LK) :: equivalent
860 equivalent = all(Segment .eqv. .not. pattern)
861 end
862
863 pure function iseqScalar_CK(segment, pattern) result(equivalent)
864 complex , intent(in) :: segment, pattern
865 logical(LK) :: equivalent
866 equivalent = abs(segment%re) == abs(pattern%re)
867 end
868
869 pure function iseqVector_CK(Segment, pattern, sizePattern) result(equivalent)
870 integer(IK) , intent(in) :: sizePattern
871 complex , intent(in) :: Segment(sizePattern), pattern(sizePattern)
872 logical(LK) :: equivalent
873 equivalent = all(abs(Segment%re) == abs(pattern%re))
874 end
875
876 pure function iseqScalar_RK(segment, pattern) result(equivalent)
877 real , intent(in) :: segment, pattern
878 logical(LK) :: equivalent
879 equivalent = abs(segment) == abs(pattern)
880 end
881
882 pure function iseqVector_RK(Segment, pattern, sizePattern) result(equivalent)
883 integer(IK) , intent(in) :: sizePattern
884 real , intent(in) :: Segment(sizePattern), pattern(sizePattern)
885 logical(LK) :: equivalent
886 equivalent = all(abs(Segment) == abs(pattern))
887 end
888
889end program example
This is a generic method of the derived type display_type with pass attribute.
Definition: pm_io.F90:11726
This is a generic method of the derived type display_type with pass attribute.
Definition: pm_io.F90:11508
Generate and return the input string where the uppercase English alphabets are all converted to lower...
This module contains classes and procedures for input/output (IO) or generic display operations on st...
Definition: pm_io.F90:252
type(display_type) disp
This is a scalar module variable an object of type display_type for general display.
Definition: pm_io.F90:11393
This module contains the uncommon and hardly representable ASCII characters as well as procedures for...
Definition: pm_strASCII.F90:61
Generate and return an object of type display_type.
Definition: pm_io.F90:10282

Example Unix compile command via Intel ifort compiler
1#!/usr/bin/env sh
2rm main.exe
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example Windows Batch compile command via Intel ifort compiler
1del main.exe
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
4main.exe

Example Unix / MinGW compile command via GNU gfortran compiler
1#!/usr/bin/env sh
2rm main.exe
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example output
1
2!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3! Strip pattern from the beginning of a string.
4!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5
6
7string = ''
8pattern = ''
9index = getSIL(string, pattern)
10string(index:)
11""
12index
13+1
14
15
16string = 'aaabb'
17pattern = ''
18index = getSIL(string, pattern)
19string(index:)
20"aaabb"
21index
22+1
23
24
25string = 'aaabb'
26pattern = 'a'
27index = getSIL(string, pattern)
28string(index:)
29"bb"
30index
31+4
32
33
34string = 'aaabb'
35pattern = 'b'
36index = getSIL(string, pattern)
37string(index:)
38"aaabb"
39index
40+1
41
42
43string = 'aaabb'
44pattern = 'aaabb '
45index = getSIL(string, pattern)
46string(index:)
47"aaabb"
48index
49+1
50
51
52string = 'aAbb'
53pattern = 'aa'
54index = getSIL(string, pattern)
55string(index:)
56"aAbb"
57index
58+1
59index = getSIL(string, pattern, iseqScalar_SK)
60string(index:)
61"bb"
62index
63+3
64
65
66!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
67! Strip pattern from the beginning of a string array.
68!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
69
70
71array = [character(2) :: ]
72scalarPattern = ''
73index = getSIL(array, scalarPattern)
74array(index:)
75
76index
77+1
78
79
80array = [character(2) :: ]
81arrayPattern = [character(1) :: ]
82index = getSIL(array, arrayPattern)
83array(index:)
84
85index
86+1
87
88
89array = ['a ', 'a ', 'bb']
90arrayPattern = [character(1) :: ]
91index = getSIL(array, arrayPattern)
92array(index:)
93"a ", "a ", "bb"
94index
95+1
96
97
98array = ['a ', 'a ', 'bb']
99scalarPattern = 'a'
100index = getSIL(array, scalarPattern)
101array(index:)
102"bb"
103index
104+3
105
106
107array = ['a ', 'a ', 'bb']
108arrayPattern = ['a', 'a']
109index = getSIL(array, arrayPattern)
110array(index:)
111"bb"
112index
113+3
114
115
116array = ['a ', 'a ', 'bb']
117arrayPattern = 'bbb'
118index = getSIL(array, arrayPattern)
119array(index:)
120"a ", "a ", "bb"
121index
122+1
123
124
125array = ['a ', 'a ', 'bb']
126arrayPattern = [array, ' ']
127index = getSIL(array, arrayPattern)
128array(index:)
129"a ", "a ", "bb"
130index
131+1
132
133
134array = ['a ', 'A ', 'bb']
135scalarPattern = 'A '
136index = getSIL(array, scalarPattern)
137array(index:)
138"a ", "A ", "bb"
139index
140+1
141index = getSIL(array, scalarPattern, iseqScalar_SK)
142array(index:)
143"bb"
144index
145+3
146
147
148array = ['a ', 'A ', 'bb']
149arrayPattern = ['A ', 'a ']
150index = getSIL(array, arrayPattern)
151array(index:)
152"a ", "A ", "bb"
153index
154+1
155index = getSIL(array, arrayPattern, iseqVector_SK)
156array(index:)
157"bb"
158index
159+3
160
161
162!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
163! Strip pattern from the beginning of a integer array.
164!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
165
166
167array = [integer :: ]
168arrayPattern = [integer :: ]
169index = getSIL(array, arrayPattern)
170array(index:)
171
172index
173+1
174
175
176array = [1, 1, 2]
177arrayPattern = [integer :: ]
178index = getSIL(array, arrayPattern)
179array(index:)
180+1, +1, +2
181index
182+1
183
184
185array = [1, 1, 2]
186scalarPattern = 1
187index = getSIL(array, scalarPattern)
188array(index:)
189+2
190index
191+3
192
193
194array = [1, 1, 2]
195arrayPattern = [1, 1]
196index = getSIL(array, arrayPattern)
197array(index:)
198+2
199index
200+3
201
202
203array = [1, 1, 2]
204arrayPattern = 3
205index = getSIL(array, arrayPattern)
206array(index:)
207+1, +1, +2
208index
209+1
210
211
212array = [1, 1, 2]
213arrayPattern = array
214index = getSIL(array, arrayPattern)
215array(index:)
216
217index
218+4
219
220
221array = [1, 1, 2]
222arrayPattern = [array, 0]
223index = getSIL(array, arrayPattern)
224array(index:)
225+1, +1, +2
226index
227+1
228
229
230array = [1, -1, 2]
231scalarPattern = 1
232index = getSIL(array, scalarPattern)
233array(index:)
234-1, +2
235index
236+2
237index = getSIL(array, scalarPattern, iseqScalar_IK)
238array(index:)
239+2
240index
241+3
242
243
244array = [1, -1, 2]
245arrayPattern = [-1, 1]
246index = getSIL(array, arrayPattern)
247array(index:)
248+1, -1, +2
249index
250+1
251index = getSIL(array, arrayPattern, iseqVector_IK)
252array(index:)
253+2
254index
255+3
256
257
258!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
259! Strip pattern from the beginning of a logical array.
260!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
261
262
263array = [logical :: ]
264arrayPattern = [logical :: ]
265index = getSIL(array, arrayPattern)
266array(index:)
267
268index
269+1
270
271
272array = [.false., .false., .true.]
273arrayPattern = [logical :: ]
274index = getSIL(array, arrayPattern)
275array(index:)
276F, F, T
277index
278+1
279
280
281array = [.false., .false., .true.]
282scalarPattern = .false.
283index = getSIL(array, scalarPattern)
284array(index:)
285T
286index
287+3
288
289
290array = [.false., .false., .true.]
291arrayPattern = [.false., .false.]
292index = getSIL(array, arrayPattern)
293array(index:)
294T
295index
296+3
297
298
299array = [.false., .false., .true.]
300arrayPattern = [.true., .true.]
301index = getSIL(array, arrayPattern)
302array(index:)
303F, F, T
304index
305+1
306
307
308array = [.false., .false., .true.]
309arrayPattern = array
310index = getSIL(array, arrayPattern)
311array(index:)
312
313index
314+4
315
316
317array = [.false., .false., .true.]
318arrayPattern = [array, .false.]
319index = getSIL(array, arrayPattern)
320array(index:)
321F, F, T
322index
323+1
324
325
326array = [.false., .true., .true.]
327scalarPattern = .false.
328index = getSIL(array, scalarPattern)
329array(index:)
330T, T
331index
332+2
333index = getSIL(array, scalarPattern, iseqScalar_LK)
334array(index:)
335F, T, T
336index
337+1
338
339
340array = [.false., .true., .true.]
341arrayPattern = [.true., .false.]
342index = getSIL(array, arrayPattern)
343array(index:)
344F, T, T
345index
346+1
347index = getSIL(array, arrayPattern, iseqVector_LK)
348array(index:)
349T
350index
351+3
352
353
354!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
355! Strip pattern from the beginning of a complex array.
356!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
357
358
359array = [complex :: ]
360arrayPattern = [complex :: ]
361index = getSIL(array, arrayPattern)
362array(index:)
363
364index
365+1
366
367
368array = [1, 1, 2]
369arrayPattern = [complex :: ]
370index = getSIL(array, arrayPattern)
371array(index:)
372(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+2.00000000, +0.00000000)
373index
374+1
375
376
377array = [1, 1, 2]
378scalarPattern = 1
379index = getSIL(array, scalarPattern)
380array(index:)
381(+2.00000000, +0.00000000)
382index
383+3
384
385
386array = [1, 1, 2]
387arrayPattern = [1, 1]
388index = getSIL(array, arrayPattern)
389array(index:)
390(+2.00000000, +0.00000000)
391index
392+3
393
394
395array = [1, 1, 2]
396arrayPattern = 3
397index = getSIL(array, arrayPattern)
398array(index:)
399(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+2.00000000, +0.00000000)
400index
401+1
402
403
404array = [1, 1, 2]
405arrayPattern = array
406index = getSIL(array, arrayPattern)
407array(index:)
408
409index
410+4
411
412
413array = [1, 1, 2]
414arrayPattern = [array, cmplx(0)]
415index = getSIL(array, arrayPattern)
416array(index:)
417(+1.00000000, +0.00000000), (+1.00000000, +0.00000000), (+2.00000000, +0.00000000)
418index
419+1
420
421
422array = [1, -1, 2]
423scalarPattern = 1
424index = getSIL(array, scalarPattern)
425array(index:)
426(-1.00000000, +0.00000000), (+2.00000000, +0.00000000)
427index
428+2
429index = getSIL(array, scalarPattern, iseqScalar_CK)
430array(index:)
431(+2.00000000, +0.00000000)
432index
433+3
434
435
436array = [1, -1, 2]
437arrayPattern = [-1, 1]
438index = getSIL(array, arrayPattern)
439array(index:)
440(+1.00000000, +0.00000000), (-1.00000000, +0.00000000), (+2.00000000, +0.00000000)
441index
442+1
443index = getSIL(array, arrayPattern, iseqVector_CK)
444array(index:)
445(+2.00000000, +0.00000000)
446index
447+3
448
449
450!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
451! Strip pattern from the beginning of a real array.
452!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
453
454
455array = [real :: ]
456arrayPattern = [real :: ]
457index = getSIL(array, arrayPattern)
458array(index:)
459
460index
461+1
462
463
464array = [1, 1, 2]
465arrayPattern = [real :: ]
466index = getSIL(array, arrayPattern)
467array(index:)
468+1.00000000, +1.00000000, +2.00000000
469index
470+1
471
472
473array = [1, 1, 2]
474scalarPattern = 1
475index = getSIL(array, scalarPattern)
476array(index:)
477+2.00000000
478index
479+3
480
481
482array = [1, 1, 2]
483arrayPattern = [1, 1]
484index = getSIL(array, arrayPattern)
485array(index:)
486+2.00000000
487index
488+3
489
490
491array = [1, 1, 2]
492arrayPattern = 3
493index = getSIL(array, arrayPattern)
494array(index:)
495+1.00000000, +1.00000000, +2.00000000
496index
497+1
498
499
500array = [1, 1, 2]
501arrayPattern = array
502index = getSIL(array, arrayPattern)
503array(index:)
504
505index
506+4
507
508
509array = [1, 1, 2]
510arrayPattern = [array, real(0)]
511index = getSIL(array, arrayPattern)
512array(index:)
513+1.00000000, +1.00000000, +2.00000000
514index
515+1
516
517
518array = [1, -1, 2]
519scalarPattern = 1
520index = getSIL(array, scalarPattern)
521array(index:)
522-1.00000000, +2.00000000
523index
524+2
525index = getSIL(array, scalarPattern, iseqScalar_RK)
526array(index:)
527+2.00000000
528index
529+3
530
531
532array = [1, -1, 2]
533arrayPattern = [-1, 1]
534index = getSIL(array, arrayPattern)
535array(index:)
536+1.00000000, -1.00000000, +2.00000000
537index
538+1
539index = getSIL(array, arrayPattern, iseqVector_RK)
540array(index:)
541+2.00000000
542index
543+3
544
545
Test:
test_pm_arrayStrip


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Amir Shahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas Austin

Definition at line 5003 of file pm_arrayStrip.F90.


The documentation for this interface was generated from the following file: