Skip to content

Commit 8775f92

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/main'
2 parents fc03b24 + 35d01fb commit 8775f92

File tree

3 files changed

+27
-5
lines changed

3 files changed

+27
-5
lines changed

swm_AMReX_Fkernels/inputs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Number of cells on each direction
2-
nx = 64
3-
ny = 64
2+
nx = 3
3+
ny = 3
44

55
# Cell size in each direction
66
dx = 100000
@@ -10,11 +10,11 @@ dy = 100000
1010
max_chunk_size = 100000
1111

1212
# Number of time steps to take
13-
n_time_steps = 4000
13+
n_time_steps = 1
1414

1515
# Size of time step
1616
dt = 90
1717

1818
# How often to write a plotfile
1919
# Optional. If left out no plot files will be written.
20-
plot_interval = 100
20+
plot_interval = 100

swm_AMReX_Fkernels/swm_fortran_amrex_kernels.F90

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ subroutine UpdateNewVariablesAmrexKernel(i,j,k,tdtsdx,tdtsdy,tdts8,pold,uold,vol
3131
real, dimension(:,:,:), intent(in) :: cu, cv, z, h
3232
real, dimension(:,:,:), pointer :: pold, uold, vold, pnew, unew, vnew
3333

34+
print *,'i,j,k: ',i,j,k
3435
unew(i+1,j,k) = uold(i+1,j,k) + &
3536
tdts8 * (z(i+1,j+1,k) + z(i+1,j,k)) * (cv(i+1,j+1,k) + cv(i,j+1,k) + cv(i,j,k) + cv(i+1,j,k)) - &
3637
tdtsdx * (h(i+1,j,k) - h(i,j,k))
@@ -58,4 +59,4 @@ subroutine UpdateOldVariablesAmrexKernel(i,j,k,alpha,pnew,unew,vnew,p,u,v,pold,u
5859

5960
end subroutine UpdateOldVariablesAmrexKernel
6061

61-
end module SWM_Fortran_Amrex_Kernels
62+
end module SWM_Fortran_Amrex_Kernels

swm_AMReX_Fkernels/swm_mini_app_utils.cpp

+21
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ void UpdateNewVariables(const double dx, const double dy, const double tdt, cons
376376
const double tdtsdy = tdt / dy;
377377
const double tdts8 = tdt / 8.0;
378378

379+
amrex::Print() << tdtsdx << " " << tdtsdy << " " << tdts8 << std::endl;
379380
for (amrex::MFIter mfi(p_old); mfi.isValid(); ++mfi)
380381
{
381382
const amrex::Box& bx = mfi.validbox();
@@ -403,6 +404,26 @@ void UpdateNewVariables(const double dx, const double dy, const double tdt, cons
403404
p_new_array, u_new_array, v_new_array);
404405

405406
});
407+
amrex::Print() << "p_old: " << std::endl;
408+
amrex::Print() << p_old[mfi] << std::endl;
409+
amrex::Print() << "u_old: " << std::endl;
410+
amrex::Print() << u_old[mfi] << std::endl;
411+
amrex::Print() << "v_old: " << std::endl;
412+
amrex::Print() << v_old[mfi] << std::endl;
413+
amrex::Print() << "cu: " << std::endl;
414+
amrex::Print() << cu[mfi] << std::endl;
415+
amrex::Print() << "cv: " << std::endl;
416+
amrex::Print() << cv[mfi] << std::endl;
417+
amrex::Print() << "h: " << std::endl;
418+
amrex::Print() << h[mfi] << std::endl;
419+
amrex::Print() << "z: " << std::endl;
420+
amrex::Print() << z[mfi] << std::endl;
421+
amrex::Print() << "p_new: " << std::endl;
422+
amrex::Print() << p_new[mfi] << std::endl;
423+
amrex::Print() << "u_new: " << std::endl;
424+
amrex::Print() << u_new[mfi] << std::endl;
425+
amrex::Print() << "v_new: " << std::endl;
426+
amrex::Print() << v_new[mfi] << std::endl;
406427
}
407428

408429
u_new.FillBoundary(geom.periodicity());

0 commit comments

Comments
 (0)