DEHam/src/desort.irp.f

34 lines
1.1 KiB
FortranFixed
Raw Permalink Normal View History

2016-12-19 23:26:16 +01:00
subroutine desort()
2018-01-29 00:10:47 +01:00
use iso_c_binding
2016-12-19 23:26:16 +01:00
implicit none
integer::i,j,ord,ordh
2018-01-29 00:10:47 +01:00
integer(C_SIZE_T)::add,addh,deti,dethi,addt
2016-12-19 23:26:16 +01:00
do i=1,detfound-1
do j=i+1,detfound
if(foundaddh(i,3).gt.foundaddh(j,3))then
dethi = foundaddh(i,1)
2016-12-19 23:26:16 +01:00
foundaddh(i,1) = foundaddh(j,1)
foundaddh(j,1) = dethi
2016-12-19 23:26:16 +01:00
addh = foundaddh(i,2)
foundaddh(i,2) = foundaddh(j,2)
foundaddh(j,2) = addh
ordh = foundaddh(i,3)
foundaddh(i,3) = foundaddh(j,3)
foundaddh(j,3) = ordh
endif
if(foundadd(i,3).gt.foundadd(j,3))then
deti = foundadd(i,1)
2016-12-19 23:26:16 +01:00
foundadd(i,1) = foundadd(j,1)
foundadd(j,1) = deti
2016-12-19 23:26:16 +01:00
add = foundadd(i,2)
foundadd(i,2) = foundadd(j,2)
foundadd(j,2) = add
ord = foundadd(i,3)
foundadd(i,3) = foundadd(j,3)
foundadd(j,3) = ord
endif
enddo
enddo
end