Insertion sort bug fix.
Insertion sort bug fix.

Boolean operators are *not* short-circuit operators in Fortran.  This means that

x .and. y

could easily test y even if x is false.  Thus if y is not a valid
operation (e.g. due to array bounds) if x is false, errors can occur.
The only solution is to split the tests into separate statements.

hande-qmc/hande,hande-qmc/hande,hande-qmc/hande,hande-qmc/hande,ruthfranklin/hande,hande-qmc/hande