ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_Advance.cpp File Reference
#include <ERF.H>
#include <ERF_Utils.H>
Include dependency graph for ERF_Advance.cpp:

Functions

void check_for_negative_theta (amrex::MultiFab &S_old)
 

Function Documentation

◆ check_for_negative_theta()

void check_for_negative_theta ( amrex::MultiFab &  S_old)

Function that advances the solution at one level for a single time step – this does some preliminaries then calls erf_advance

Parameters
[in]levlevel of refinement (coarsest level is 0)
[in]timestart time for time advance
[in]dt_levtime step for this time advance
319 {
320  // *****************************************************************************
321  // Test for negative (rho theta)
322  // *****************************************************************************
323  for (MFIter mfi(S_old); mfi.isValid(); ++mfi)
324  {
325  Box bx = mfi.tilebox();
326  const Array4<Real> &cell_data = S_old.array(mfi);
327  ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
328  {
329 #ifdef AMREX_USE_GPU
330  if (cell_data(i,j,k,RhoTheta_comp) <= 0.) AMREX_DEVICE_PRINTF("BAD THETA AT %d %d %d %e %e \n",
331  i,j,k,cell_data(i,j,k,RhoTheta_comp),cell_data(i,j,k+1,RhoTheta_comp));
332 #else
333  if (cell_data(i,j,k,RhoTheta_comp) <= 0.) {
334  printf("BAD THETA AT %d %d %d %e %e \n",
335  i,j,k,cell_data(i,j,k,RhoTheta_comp),cell_data(i,j,k+1,RhoTheta_comp));
336  amrex::Abort("Bad theta in check_for_negative_theta");
337  }
338 #endif
339  });
340  } // mfi
341 }
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:37

Referenced by ERF::Advance().

Here is the caller graph for this function: