-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmod_point_util.f90
33 lines (28 loc) · 995 Bytes
/
mod_point_util.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
module mod_point_util
use mod_read_gmsh, only: point
implicit none
interface operator(.eq.)
module procedure equal
end interface
contains
!----------------------------------------------------------------------
function equal(p1, p2) result(res)
implicit none
logical :: res
type(point), intent(in) :: p1, p2
if (abs(p1%x - p2%x) <= 1.0d-9 .and. abs(p1%y - p2%y) <= 1.0d-9 .and. abs(p1%z -p2%z) <= 1.0d-9) then
res = .true.
else
res = .false.
endif
end function equal
!----------------------------------------------------------------------
subroutine swap_point(p1,p2)
implicit none
type(point), intent(inout) :: p1, p2
type(point) :: temp
temp = p1
p1 = p2
p2 = temp
end subroutine swap_point
end module mod_point_util