-
Notifications
You must be signed in to change notification settings - Fork 0
/
mod_qsort.F90
47 lines (36 loc) · 889 Bytes
/
mod_qsort.F90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
module mod_qsort
use iso_fortran_env
implicit none
interface qsort
module procedure qsort_real64, qsort_real32, &
qsort_int64, qsort_int32, qsort_int16, qsort_int8
end interface qsort
public :: qsort
private :: qsort_real64, qsort_real32, &
qsort_int64, qsort_int32, qsort_int16, qsort_int8
private :: swap_real64, swap_real32, &
swap_int64, swap_int32, swap_int16, swap_int8
contains
#define VAR_TYPE real
#define VAR_KIND real64
#include "qsort.inc"
#undef VAR_KIND
#define VAR_KIND real32
#include "qsort.inc"
#undef VAR_KIND
#undef VAR_TYPE
#define VAR_TYPE integer
#define VAR_KIND int64
#include "qsort.inc"
#undef VAR_KIND
#define VAR_KIND int32
#include "qsort.inc"
#undef VAR_KIND
#define VAR_KIND int16
#include "qsort.inc"
#undef VAR_KIND
#define VAR_KIND int8
#include "qsort.inc"
#undef VAR_KIND
#undef VAR_TYPE
end module mod_qsort