Skip to content

Commit

Permalink
undo mold to avoid ambiguity
Browse files Browse the repository at this point in the history
  • Loading branch information
wdeconinck committed Oct 31, 2024
1 parent e64f1b8 commit 3b89b9b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 148 deletions.
148 changes: 1 addition & 147 deletions pluto/src/pluto_f/pluto_module.F90
Original file line number Diff line number Diff line change
Expand Up @@ -72,22 +72,6 @@ subroutine c_pluto_scope_pop() bind(c)
procedure :: pluto_allocator_allocate_real64_r2
procedure :: pluto_allocator_allocate_real64_r3
procedure :: pluto_allocator_allocate_real64_r4
procedure :: pluto_allocator_allocate_mold_int32_r1
procedure :: pluto_allocator_allocate_mold_int32_r2
procedure :: pluto_allocator_allocate_mold_int32_r3
procedure :: pluto_allocator_allocate_mold_int32_r4
procedure :: pluto_allocator_allocate_mold_int64_r1
procedure :: pluto_allocator_allocate_mold_int64_r2
procedure :: pluto_allocator_allocate_mold_int64_r3
procedure :: pluto_allocator_allocate_mold_int64_r4
procedure :: pluto_allocator_allocate_mold_real32_r1
procedure :: pluto_allocator_allocate_mold_real32_r2
procedure :: pluto_allocator_allocate_mold_real32_r3
procedure :: pluto_allocator_allocate_mold_real32_r4
procedure :: pluto_allocator_allocate_mold_real64_r1
procedure :: pluto_allocator_allocate_mold_real64_r2
procedure :: pluto_allocator_allocate_mold_real64_r3
procedure :: pluto_allocator_allocate_mold_real64_r4

generic :: allocate => &
& pluto_allocator_allocate_int32_r1, &
Expand All @@ -105,24 +89,7 @@ subroutine c_pluto_scope_pop() bind(c)
& pluto_allocator_allocate_real64_r1, &
& pluto_allocator_allocate_real64_r2, &
& pluto_allocator_allocate_real64_r3, &
& pluto_allocator_allocate_real64_r4, &
& pluto_allocator_allocate_mold_int32_r1, &
& pluto_allocator_allocate_mold_int32_r2, &
& pluto_allocator_allocate_mold_int32_r3, &
& pluto_allocator_allocate_mold_int32_r4, &
& pluto_allocator_allocate_mold_int64_r1, &
& pluto_allocator_allocate_mold_int64_r2, &
& pluto_allocator_allocate_mold_int64_r3, &
& pluto_allocator_allocate_mold_int64_r4, &
& pluto_allocator_allocate_mold_real32_r1, &
& pluto_allocator_allocate_mold_real32_r2, &
& pluto_allocator_allocate_mold_real32_r3, &
& pluto_allocator_allocate_mold_real32_r4, &
& pluto_allocator_allocate_mold_real64_r1, &
& pluto_allocator_allocate_mold_real64_r2, &
& pluto_allocator_allocate_mold_real64_r3, &
& pluto_allocator_allocate_mold_real64_r4

& pluto_allocator_allocate_real64_r4

procedure :: pluto_allocator_deallocate_int32_r1
procedure :: pluto_allocator_deallocate_int32_r2
Expand Down Expand Up @@ -493,119 +460,6 @@ subroutine pluto_allocator_allocate_real64_r4(this, array, shape)
endif
end subroutine


subroutine pluto_allocator_allocate_mold_int32_r1(this, array, mold)
class(pluto_allocator) :: this
integer(c_int32_t), pointer, intent(out) :: array(:)
integer(c_int32_t), intent(in) :: mold(:)
call pluto_allocator_allocate_int32_r1(this, array, shape(mold))
end subroutine

subroutine pluto_allocator_allocate_mold_int32_r2(this, array, mold)
class(pluto_allocator) :: this
integer(c_int32_t), pointer, intent(out) :: array(:,:)
integer(c_int32_t), intent(in) :: mold(:,:)
call pluto_allocator_allocate_int32_r2(this, array, shape(mold))
end subroutine

subroutine pluto_allocator_allocate_mold_int32_r3(this, array, mold)
class(pluto_allocator) :: this
integer(c_int32_t), pointer, intent(out) :: array(:,:,:)
integer(c_int32_t), intent(in) :: mold(:,:,:)
call pluto_allocator_allocate_int32_r3(this, array, shape(mold))
end subroutine

subroutine pluto_allocator_allocate_mold_int32_r4(this, array, mold)
class(pluto_allocator) :: this
integer(c_int32_t), pointer, intent(out) :: array(:,:,:,:)
integer(c_int32_t), intent(in) :: mold(:,:,:,:)
call pluto_allocator_allocate_int32_r4(this, array, shape(mold))
end subroutine

subroutine pluto_allocator_allocate_mold_int64_r1(this, array, mold)
class(pluto_allocator) :: this
integer(c_int64_t), pointer, intent(out) :: array(:)
integer(c_int64_t), intent(in) :: mold(:)
call pluto_allocator_allocate_int64_r1(this, array, shape(mold))
end subroutine

subroutine pluto_allocator_allocate_mold_int64_r2(this, array, mold)
class(pluto_allocator) :: this
integer(c_int64_t), pointer, intent(out) :: array(:,:)
integer(c_int64_t), intent(in) :: mold(:,:)
call pluto_allocator_allocate_int64_r2(this, array, shape(mold))
end subroutine

subroutine pluto_allocator_allocate_mold_int64_r3(this, array, mold)
class(pluto_allocator) :: this
integer(c_int64_t), pointer, intent(out) :: array(:,:,:)
integer(c_int64_t), intent(in) :: mold(:,:,:)
call pluto_allocator_allocate_int64_r3(this, array, shape(mold))
end subroutine

subroutine pluto_allocator_allocate_mold_int64_r4(this, array, mold)
class(pluto_allocator) :: this
integer(c_int64_t), pointer, intent(out) :: array(:,:,:,:)
integer(c_int64_t), intent(in) :: mold(:,:,:,:)
call pluto_allocator_allocate_int64_r4(this, array, shape(mold))
end subroutine

subroutine pluto_allocator_allocate_mold_real32_r1(this, array, mold)
class(pluto_allocator) :: this
real(c_float), pointer, intent(out) :: array(:)
real(c_float), intent(in) :: mold(:)
call pluto_allocator_allocate_real32_r1(this, array, shape(mold))
end subroutine

subroutine pluto_allocator_allocate_mold_real32_r2(this, array, mold)
class(pluto_allocator) :: this
real(c_float), pointer, intent(out) :: array(:,:)
real(c_float), intent(in) :: mold(:,:)
call pluto_allocator_allocate_real32_r2(this, array, shape(mold))
end subroutine

subroutine pluto_allocator_allocate_mold_real32_r3(this, array, mold)
class(pluto_allocator) :: this
real(c_float), pointer, intent(out) :: array(:,:,:)
real(c_float), intent(in) :: mold(:,:,:)
call pluto_allocator_allocate_real32_r3(this, array, shape(mold))
end subroutine

subroutine pluto_allocator_allocate_mold_real32_r4(this, array, mold)
class(pluto_allocator) :: this
real(c_float), pointer, intent(out) :: array(:,:,:,:)
real(c_float), intent(in) :: mold(:,:,:,:)
call pluto_allocator_allocate_real32_r4(this, array, shape(mold))
end subroutine

subroutine pluto_allocator_allocate_mold_real64_r1(this, array, mold)
class(pluto_allocator) :: this
real(c_double), pointer, intent(out) :: array(:)
real(c_double), intent(in) :: mold(:)
call pluto_allocator_allocate_real64_r1(this, array, shape(mold))
end subroutine

subroutine pluto_allocator_allocate_mold_real64_r2(this, array, mold)
class(pluto_allocator) :: this
real(c_double), pointer, intent(out) :: array(:,:)
real(c_double), intent(in) :: mold(:,:)
call pluto_allocator_allocate_real64_r2(this, array, shape(mold))
end subroutine

subroutine pluto_allocator_allocate_mold_real64_r3(this, array, mold)
class(pluto_allocator) :: this
real(c_double), pointer, intent(out) :: array(:,:,:)
real(c_double), intent(in) :: mold(:,:,:)
call pluto_allocator_allocate_real64_r3(this, array, shape(mold))
end subroutine

subroutine pluto_allocator_allocate_mold_real64_r4(this, array, mold)
class(pluto_allocator) :: this
real(c_double), pointer, intent(out) :: array(:,:,:,:)
real(c_double), intent(in) :: mold(:,:,:,:)
call pluto_allocator_allocate_real64_r4(this, array, shape(mold))
end subroutine

subroutine pluto_allocator_deallocate_int32_r1(this, array)
class(pluto_allocator) :: this
integer(c_int32_t), pointer, intent(inout) :: array(:)
Expand Down
2 changes: 1 addition & 1 deletion pluto/tests/test_pluto_f.F90
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ program pluto_test_pluto_f
call host_allocator%deallocate(array4d)

call host_allocator%allocate(iarray1d, shape=[20])
call host_allocator%allocate(jarray1d, mold=iarray1d)
call host_allocator%allocate(jarray1d, shape=shape(iarray1d))
call host_allocator%deallocate(iarray1d)
call host_allocator%deallocate(jarray1d)

Expand Down

0 comments on commit 3b89b9b

Please sign in to comment.