Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No specific subroutine for the generic 'sort_index' #719

Closed
Xeno-Hypster opened this issue Jun 10, 2023 · 2 comments · Fixed by #829
Closed

No specific subroutine for the generic 'sort_index' #719

Xeno-Hypster opened this issue Jun 10, 2023 · 2 comments · Fixed by #829
Labels
bug Something isn't working

Comments

@Xeno-Hypster
Copy link

Xeno-Hypster commented Jun 10, 2023

Description

I have been returning this error when trying to call the sort_index subroutine. I have no issues calling sort or ord_sort using the below steps

Steps to reproduce:

program test_sort
use stdlib_sorting
implicit none
integer, dimension(3) :: idx
integer :: i
double precision, dimension(3) :: A
A(1) = 3.0d0
A(2) = 2.0d0
A(3) = 1.5d0
call sort_index(A, idx) ! does not work
! call sort(A) ! works
do i = 1,3
print *, A(i), idx(i)
end do
end program test_sort

compiled with
gfortran -o test_sort test_sort.f90 $(STDLIB64)/libfortran_stdlib.a -I$(STDLIBINC)
returns

test_sort.f90:11:25
   11 |    call sort_index(A, idx)
      |                          1
Error: There is no specific subroutine for the generic 'sort index' at (1) 

### Expected Behaviour

I would expect this at stdout:

1.50000000 3
2.00000000 2
3.00000000 1

### Version of stdlib

Master branch, commit: 7143c086a4bac2b0f23660c4a7092d9561b3399a

### Platform and Architecture

GNU/Linux, 64 bit

### Additional Information

_No response_
@Xeno-Hypster Xeno-Hypster added the bug Something isn't working label Jun 10, 2023
@jvdp1
Copy link
Member

jvdp1 commented Jun 10, 2023 via email

@Xeno-Hypster
Copy link
Author

Ah, that works. Turns out too that I should have declared it as integer(int_size). That was a rookie mistake on my end. Thanks, closing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants