Skip to content

Commit

Permalink
F_interfaces: fix bug in setval and parallelcopy; note that the compo…
Browse files Browse the repository at this point in the history
…nent index starts with 1 in Fortran
  • Loading branch information
WeiqunZhang committed Jun 26, 2017
1 parent 4b3c080 commit 6ed367b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Src/Base/AMReX_fort_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ module amrex_fort_module

implicit none

integer, parameter :: bl_spacedim = BL_SPACEDIM
integer, parameter :: amrex_spacedim = BL_SPACEDIM
integer, parameter :: bl_spacedim = AMREX_SPACEDIM
integer, parameter :: amrex_spacedim = AMREX_SPACEDIM

#ifdef BL_USE_FLOAT
integer, parameter :: amrex_real = c_float
Expand Down
4 changes: 2 additions & 2 deletions Src/F_Interfaces/Base/AMReX_multifab_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ subroutine amrex_multifab_setval (this, val, icomp, ncomp, nghost)
real(amrex_real), intent(in) :: val
integer, intent(in), optional :: icomp, ncomp, nghost
integer :: ic, nc, ng
ic = 0; if (present(icomp)) ic = icomp
ic = 0; if (present(icomp)) ic = icomp-1
nc = this%nc; if (present(ncomp)) nc = ncomp
ng = this%ng; if (present(nghost)) ng = nghost
call amrex_fi_multifab_setval(this%p, val, ic, nc, ng)
Expand All @@ -502,7 +502,7 @@ subroutine amrex_multifab_parallel_copy (this, srcmf, geom)
class(amrex_multifab) :: this
type(amrex_multifab), intent(in) :: srcmf
type(amrex_geometry), intent(in) :: geom
call amrex_fi_multifab_parallelcopy(this%p, srcmf%p, 0, 0, this%nc, 0, 0, geom%p)
call amrex_fi_multifab_parallelcopy(this%p, srcmf%p, 1, 1, this%nc, 0, 0, geom%p)
end subroutine amrex_multifab_parallel_copy

subroutine amrex_multifab_parallel_copy_c (this, srcmf, srccomp, dstcomp, nc, geom)
Expand Down

0 comments on commit 6ed367b

Please sign in to comment.