Ranks initial population. Calls external sort routine to produce key index and rank order of input array arrin (which is not altered).
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(pikaia_class), | intent(inout) | :: | me | |||
real(kind=wp), | intent(in), | dimension(me%np) | :: | arrin | ||
integer, | intent(out), | dimension(me%np) | :: | indx | ||
integer, | intent(out), | dimension(me%np) | :: | rank |
subroutine rnkpop(me,arrin,indx,rank) implicit none class(pikaia_class),intent(inout) :: me real(wp),dimension(me%np),intent(in) :: arrin integer,dimension(me%np),intent(out) :: indx integer,dimension(me%np),intent(out) :: rank integer :: i !Compute the key index call rqsort(me%np,arrin,indx) !and the rank order do i=1,me%np rank(indx(i)) = me%np-i+1 end do end subroutine rnkpop