The TELEMAC-MASCARET system
trunk
sources
utils
bief
sd_strtri.f
Go to the documentation of this file.
1
! ********************
2
SUBROUTINE
sd_strtri
3
! ********************
4
!
5
&(is,n,ind)
6
!
7
!***********************************************************************
8
! BIEF V6P0 21/08/2010
9
!***********************************************************************
10
!
11
!brief SORTS IN ASCENDING ORDER THE INTEGER ARRAY 'IS'.
12
!+ OUTPUT : IS(IND(I+1) >= IS(IND(I).
13
!
14
!note IMPORTANT: INSPIRED FROM N3S 3.3 22/04/92 B.THOMAS
15
!
16
!history E. RAZAFINDRAKOTO (LNH)
17
!+ 20/11/06
18
!+ V5P7
19
!+
20
!
21
!history N.DURAND (HRW), S.E.BOURBAN (HRW)
22
!+ 13/07/2010
23
!+ V6P0
24
!+ Translation of French comments within the FORTRAN sources into
25
!+ English comments
26
!
27
!history N.DURAND (HRW), S.E.BOURBAN (HRW)
28
!+ 21/08/2010
29
!+ V6P0
30
!+ Creation of DOXYGEN tags for automated documentation and
31
!+ cross-referencing of the FORTRAN sources
32
!
33
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
34
!| IND |<--| PERMUTATION ARRAY FOR ASCENDING ORDER IS
35
!| IS |-->| INTEGER ARRAY TO SORT IN ASCENDING ORDER
36
!| N |-->| LENGTH OF IS
37
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38
!
39
USE
bief
, ex_sd_strtri =>
sd_strtri
40
!
41
USE
declarations_special
42
IMPLICIT NONE
43
!
44
!+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
45
!
46
INTEGER
,
INTENT(IN)
:: N
47
INTEGER
,
INTENT(IN)
:: IS(n)
48
INTEGER
,
INTENT(INOUT)
:: IND(n)
49
!
50
!+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
51
!
52
INTEGER
I,I1,K
53
!
54
!-----------------------------------------------------------------------
55
!
56
ind(1) = 1
57
!
58
DO
i = 2 , n
59
!
60
!---> IS(1:I-1) IS SORTED
61
!
62
i1 = i-1
63
DO
k = i1 , 1 , -1
64
!
65
!---> FOR L > K+1 IS(IND(L)) > IS(I)
66
!
67
IF
(is(ind(k)).GT.is(i))
THEN
68
ind(k+1) = ind(k)
69
ELSE
70
EXIT
71
ENDIF
72
!
73
ENDDO
! K
74
!
75
!---> ASSERTION : IS(IND(K))
76
!
77
ind(k+1)=i
78
!
79
ENDDO
! I
80
!
81
!-----------------------------------------------------------------------
82
!
83
RETURN
84
END
declarations_special
Definition:
declarations_special.F:3
sd_strtri
subroutine sd_strtri(IS, N, IND)
Definition:
sd_strtri.f:7
bief
Definition:
bief.f:3