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
314 {
315  // *****************************************************************************
316  // Test for negative (rho theta)
317  // *****************************************************************************
318  for (MFIter mfi(S_old); mfi.isValid(); ++mfi)
319  {
320  Box bx = mfi.tilebox();
321  const Array4<Real> &cell_data = S_old.array(mfi);
322  ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
323  {
324 #ifdef AMREX_USE_GPU
325  if (cell_data(i,j,k,RhoTheta_comp) <= 0.) AMREX_DEVICE_PRINTF("BAD THETA AT %d %d %d %e %e \n",
326  i,j,k,cell_data(i,j,k,RhoTheta_comp),cell_data(i,j,k+1,RhoTheta_comp));
327 #else
328  if (cell_data(i,j,k,RhoTheta_comp) <= 0.) {
329  printf("BAD THETA AT %d %d %d %e %e \n",
330  i,j,k,cell_data(i,j,k,RhoTheta_comp),cell_data(i,j,k+1,RhoTheta_comp));
331  amrex::Abort("Bad theta in check_for_negative_theta");
332  }
333 #endif
334  });
335  } // mfi
336 }
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:37

Referenced by ERF::Advance().

Here is the caller graph for this function: