15 integer,
intent(inout),
dimension(:) :: array
16 integer,
intent(in) :: arraysize
19 integer :: qsort_threshold = 8
20 include
"qsort_inline.inc"
29 integer(I4B),
intent(in) :: n
30 integer(I4B),
intent(in) :: m
31 logical(LGP) :: isless
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()
66 xorigin_n, yorigin_n, angrot_n, &
68 zn =
dhalf * (dis_top_n(gcn%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
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)
subroutine, public dis_transform_xy(x, y, xorigin, yorigin, angrot, xglo, yglo)
Get global (x, y) coordinates from cell-local coordinates.
This module contains simulation constants.
real(dp), parameter dhalf
real constant 1/2
subroutine, public quicksortgrid(array, arraySize, idxToGlobal)
This module defines variable data types.
pure logical function, public is_close(a, b, rtol, atol, symmetric)
Check if a real value is approximately equal to another.
Data structure to hold a global cell identifier, using a pointer to the model and its local cell.