Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Fortran interface for FillPatch for face variables #3541

Merged
merged 1 commit into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Src/F_Interfaces/AmrCore/AMReX_fillpatch_fi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ extern "C"
Vector<Array<MultiFab*, AMREX_SPACEDIM> > va_fmf(nf);
for (int i = 0; i < nc; ++i) {
for (int d = 0; d < AMREX_SPACEDIM; ++d)
{ va_cmf[i][d] = cmf[i+d*AMREX_SPACEDIM]; }
{ va_cmf[i][d] = cmf[i*AMREX_SPACEDIM+d]; }
}
for (int i = 0; i < nf; ++i) {
for (int d = 0; d < AMREX_SPACEDIM; ++d)
{ va_fmf[i][d] = fmf[i+d*AMREX_SPACEDIM]; }
{ va_fmf[i][d] = fmf[i*AMREX_SPACEDIM+d]; }
}

Array<FPhysBC, AMREX_SPACEDIM> cbc{ AMREX_D_DECL( FPhysBC(cfill[0], cgeom),
Expand Down
36 changes: 18 additions & 18 deletions Src/F_Interfaces/AmrCore/AMReX_fillpatch_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ subroutine amrex_fillpatch_single (mf, told, mfold, tnew, mfnew, geom, fill_phys
type(c_ptr) :: smf(2)
integer :: ns

teps = 1.e-4_amrex_real * (tnew - told)
if (abs(time-tnew) .lt. teps) then
teps = 1.e-4_amrex_real * abs(tnew - told)
if (abs(time-tnew) .le. teps) then
ns = 1
smf (1) = mfnew%p
stime(1) = tnew
else if (abs(time-told) .lt. teps) then
else if (abs(time-told) .le. teps) then
ns = 1
smf (1) = mfold%p
stime(1) = told
Expand Down Expand Up @@ -142,12 +142,12 @@ subroutine amrex_fillpatch_two (mf, told_c, mfold_c, tnew_c, mfnew_c, geom_c, fi
integer :: ncrse, nfine, i

! coarse level
teps = 1.e-4_amrex_real * (tnew_c - told_c)
if (abs(time-tnew_c) .lt. teps) then
teps = 1.e-4_amrex_real * abs(tnew_c - told_c)
if (abs(time-tnew_c) .le. teps) then
ncrse= 1
c_mf (1) = mfnew_c%p
c_time(1) = tnew_c
else if (abs(time-told_c) .lt. teps) then
else if (abs(time-told_c) .le. teps) then
ncrse= 1
c_mf (1) = mfold_c%p
c_time(1) = told_c
Expand All @@ -160,12 +160,12 @@ subroutine amrex_fillpatch_two (mf, told_c, mfold_c, tnew_c, mfnew_c, geom_c, fi
end if

! fine level
teps = 1.e-4_amrex_real * (tnew_f - told_f)
if (abs(time-tnew_f) .lt. teps) then
teps = 1.e-4_amrex_real * abs(tnew_f - told_f)
if (abs(time-tnew_f) .le. teps) then
nfine= 1
f_mf (1) = mfnew_f%p
f_time(1) = tnew_f
else if (abs(time-told_f) .lt. teps) then
else if (abs(time-told_f) .le. teps) then
nfine= 1
f_mf (1) = mfold_f%p
f_time(1) = told_f
Expand Down Expand Up @@ -256,14 +256,14 @@ subroutine amrex_fillpatch_two_faces(mf, told_c, mfold_c, tnew_c, mfnew_c, geom_
end do

! coarse level
teps = 1.e-4_amrex_real * (tnew_c - told_c)
if (abs(time-tnew_c) .lt. teps) then
teps = 1.e-4_amrex_real * abs(tnew_c - told_c)
if (abs(time-tnew_c) .le. teps) then
ncrse= 1
c_time(1) = tnew_c
do dim = 1, amrex_spacedim
c_mf(dim) = mfnew_c(dim)%p
end do
else if (abs(time-told_c) .lt. teps) then
else if (abs(time-told_c) .le. teps) then
ncrse= 1
c_time(1) = told_c
do dim = 1, amrex_spacedim
Expand All @@ -280,14 +280,14 @@ subroutine amrex_fillpatch_two_faces(mf, told_c, mfold_c, tnew_c, mfnew_c, geom_
end if

! fine level
teps = 1.e-4_amrex_real * (tnew_f - told_f)
if (abs(time-tnew_f) .lt. teps) then
teps = 1.e-4_amrex_real * abs(tnew_f - told_f)
if (abs(time-tnew_f) .le. teps) then
nfine= 1
f_time(1) = tnew_f
do dim = 1, amrex_spacedim
f_mf(dim) = mfnew_f(dim)%p
enddo
else if (abs(time-told_f) .lt. teps) then
else if (abs(time-told_f) .le. teps) then
nfine= 1
f_time(1) = told_f
do dim = 1, amrex_spacedim
Expand Down Expand Up @@ -353,10 +353,10 @@ subroutine amrex_fillcoarsepatch (mf, told_c, mfold_c, tnew_c, mfnew_c, &
integer :: i

! coarse level
teps = 1.e-4_amrex_real * (tnew_c - told_c)
if (abs(time-tnew_c) .lt. teps) then
teps = 1.e-4_amrex_real * abs(tnew_c - told_c)
if (abs(time-tnew_c) .le. teps) then
c_mf = mfnew_c%p
else if (abs(time-told_c) .lt. teps) then
else if (abs(time-told_c) .le. teps) then
c_mf = mfold_c%p
else
call amrex_abort("amrex_fillcoarsepatch: how did this happen?")
Expand Down