15 integer,
intent(inout),
dimension(:) :: array
16 integer,
intent(in) :: arraySize
17 type(GlobalCellType),
dimension(:),
pointer :: idxToGlobal
19 integer :: QSORT_THRESHOLD = 8
20 include
"qsort_inline.inc"
28 function lessthan(n, m)
result(isLess)
29 integer(I4B),
intent(in) :: n
30 integer(I4B),
intent(in) :: m
31 logical(LGP) :: isLess
33 type(GlobalCellType),
pointer :: gcn, gcm
34 real(DP) :: xn, yn, zn, xm, ym, zm
35 real(DP),
dimension(:),
pointer,
contiguous :: dis_top_n, dis_bot_n, &
37 real(DP),
dimension(:),
pointer,
contiguous :: dis_xc_n, dis_yc_n, &
39 real(DP) :: xorigin_n, yorigin_n, angrot_n, &
40 xorigin_m, yorigin_m, angrot_m
43 gcn => idxtoglobal(array(n))
44 gcm => idxtoglobal(array(m))
48 dis_top_n => gcn%v_model%dis_top%get_array()
49 dis_bot_n => gcn%v_model%dis_bot%get_array()
50 dis_xc_n => gcn%v_model%dis_xc%get_array()
51 dis_yc_n => gcn%v_model%dis_yc%get_array()
52 xorigin_n = gcn%v_model%dis_xorigin%get()
53 yorigin_n = gcn%v_model%dis_yorigin%get()
54 angrot_n = gcn%v_model%dis_angrot%get()
56 dis_top_m => gcm%v_model%dis_top%get_array()
57 dis_bot_m => gcm%v_model%dis_bot%get_array()
58 dis_xc_m => gcm%v_model%dis_xc%get_array()
59 dis_yc_m => gcm%v_model%dis_yc%get_array()
60 xorigin_m = gcm%v_model%dis_xorigin%get()
61 yorigin_m = gcm%v_model%dis_yorigin%get()
62 angrot_m = gcm%v_model%dis_angrot%get()
65 call dis_transform_xy(dis_xc_n(gcn%index), dis_yc_n(gcn%index), &
66 xorigin_n, yorigin_n, angrot_n, &
68 zn = dhalf * (dis_top_n(gcn%index) + &
71 call dis_transform_xy(dis_xc_m(gcm%index), dis_yc_m(gcm%index), &
72 xorigin_m, yorigin_m, angrot_m, &
74 zm = dhalf * (dis_top_m(gcm%index) + &
78 if (.not. is_close(zn, zm, 10 * epsilon(zn)))
then
80 else if (.not. is_close(yn, ym, 10 * epsilon(yn)))
then
82 else if (.not. is_close(xn, xm, 10 * epsilon(xn)))
then
92 integer,
intent(in) :: a, b
102 subroutine rshift(left, right)
103 integer,
intent(in) :: left, right
107 array(left + 1:right) = array(left:right - 1)
logical(lgp) function lessthan(n, m)
subroutine rshift(left, right)