Skip to content

Commit

Permalink
test c_ptr first
Browse files Browse the repository at this point in the history
  • Loading branch information
WeiqunZhang committed Aug 19, 2024
1 parent 439303c commit cb982df
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Src/F_Interfaces/Base/AMReX_boxarray_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,11 @@ end subroutine amrex_boxarray_maxsize_iv
pure function amrex_boxarray_nboxes (this) result(n)
class(amrex_boxarray), intent(in) :: this
integer(amrex_long) :: n
n = amrex_fi_boxarray_nboxes(this%p)
if (c_associated(this%p)) then
n = amrex_fi_boxarray_nboxes(this%p)
else
n = 0
end if
end function amrex_boxarray_nboxes

function amrex_boxarray_get_box (this, i) result(bx)
Expand Down Expand Up @@ -234,7 +238,11 @@ end function amrex_boxarray_nodal_type
pure function amrex_boxarray_num_pts (this) result(n)
class(amrex_boxarray), intent(in) :: this
integer(amrex_long) :: n
n = amrex_fi_boxarray_numpts(this%p)
if (c_associated(this%p)) then
n = amrex_fi_boxarray_numpts(this%p)
else
n = 0
end if
end function amrex_boxarray_num_pts

pure function amrex_boxarray_intersects_box (this, bx) result(r)
Expand Down

0 comments on commit cb982df

Please sign in to comment.