-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmod_pt_array_utils.f90
48 lines (35 loc) · 1.08 KB
/
mod_pt_array_utils.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
48
module mod_pt_array_utils
use mod_pt_array
implicit none
type :: obj_elem
type(element), pointer :: p
contains
procedure :: print_elem => print_element
end type
interface element
module procedure element_constructor
end interface
contains
subroutine print_element(this)
implicit none
class(obj_elem), intent(in) :: this
write(*,20), this%p%ident, this%p%value_elem
20 format(i5xf15.7)
end subroutine print_element
type(element) function element_constructor(i,x)
implicit none
integer, intent(in) :: i
real, intent(in) :: x
element_constructor%ident = i
element_constructor%value_elem = x
end function element_constructor
subroutine delete_elements_at_position(posi)
implicit none
integer, intent(in) :: posi
integer :: i
do i = posi, nbelements - 1
elements(i)%p => elements(i+1)%p
end do
nbelements = nbelements - 1
end subroutine delete_elements_at_position
end module