G.I. Rees,
Phase Transformations Group,
Department of Materials Science and Metallurgy,
University of Cambridge,
Cambridge, U.K.
Sorts the elements of a two dimensional array.
Language: | FORTRAN |
Product form: | Source code |
An array LST(I,J) is sorted so that the second column is ordered to give LST(IVAR,J) in ascending order, where IVAR is the dimension of the first column.
None.
No information supplied.
None.
INTEGER IVAR, IVAL, J1, J2 PARAMETER (IVAR = 2, IVAL = 12) DOUBLE PRECISION LST(IVAR, IVAL) DO 10 J1=1,IVAL READ (5,*) LST(1, J1), LST(2, J1) 10 CONTINUE CALL MAP_UTIL_SORT3(IVAR, IVAL, LST) DO 20 J2=1,IVAL WRITE (6,30) LST(1,J2), LST(2,J2) 20 CONTINUE 30 FORMAT(2F8.3) STOP END
1.00 0.5 2.00 0.2 3.00 0.8 4.00 2.0 5.00 1.0 6.00 3.0 7.00 0.4 8.00 0.5 9.00 10.0 10.00 3.0 11.00 1.0 12.00 0.3
2.00 0.2 12.00 0.3 7.00 0.4 1.00 0.5 8.00 0.5 3.00 0.8 5.00 1.0 11.00 1.0 4.00 2.0 6.00 3.0 10.00 3.0 9.00 10.0
None.
sort
MAP originated from a joint project of the National Physical Laboratory and the University of Cambridge.
MAP Website administration / map@msm.cam.ac.uk