From 9b4131139b24b62c4c1081fe8648068eed9081c9 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Wed, 19 Apr 2017 15:44:24 +0200 Subject: [PATCH] Fixed selection sort --- src/Utils/sort.irp.f | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Utils/sort.irp.f b/src/Utils/sort.irp.f index 1e271fc0..f31627f0 100644 --- a/src/Utils/sort.irp.f +++ b/src/Utils/sort.irp.f @@ -318,13 +318,11 @@ BEGIN_TEMPLATE xtmp = x(i) i0 = iorder(i) j = i-1_8 - do j=i-1_8,1_8,-1_8 - if ( x(j) > xtmp ) then - x(j+1_8) = x(j) - iorder(j+1_8) = iorder(j) - else - exit - endif + do while (x(j)