]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ISAJET/code/ordecr.F
Merging the VirtualMC branch to the main development branch (HEAD)
[u/mrichter/AliRoot.git] / ISAJET / code / ordecr.F
CommitLineData
0795afa3 1#include "isajet/pilot.h"
2 SUBROUTINE ORDECR(IA,IB,N)
3C----------------------------------------------------------------------
4C-
5C- Purpose and Methods :
6C- return an ordered array (by size of absolute values)
7C- Warning: input array is destroyed
8C-
9C- Inputs :
10C- IA(N) = input array
11C- Outputs :
12C- IB(N) = output ordered array
13C-
14C- Created 9-MAY-1988 Serban D. Protopopescu
15C-
16C----------------------------------------------------------------------
17#if defined(CERNLIB_IMPNONE)
18 IMPLICIT NONE
19#endif
20 INTEGER IA(*),IB(*),N,I,J,JSEL
21C----------------------------------------------------------------------
22 DO 2 I=1,N
23 JSEL=0
24 IB(I)=0
25 DO 1 J=1,N
26 IF(IABS(IA(J)).GT.IABS(IB(I))) THEN
27 IB(I)=IA(J)
28 JSEL=J
29 ENDIF
30 1 CONTINUE
31 IF(JSEL.GT.0) IA(JSEL)=0
32 2 CONTINUE
33 999 RETURN
34 END