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
329 {
330  // *****************************************************************************
331  // Test for negative (rho theta)
332  // *****************************************************************************
333  for (MFIter mfi(S_old); mfi.isValid(); ++mfi)
334  {
335  Box bx = mfi.tilebox();
336  const Array4<Real> &cell_data = S_old.array(mfi);
337  ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
338  {
339 #ifdef AMREX_USE_GPU
340  if (cell_data(i,j,k,RhoTheta_comp) <= 0.) AMREX_DEVICE_PRINTF("BAD THETA AT %d %d %d %e %e \n",
341  i,j,k,cell_data(i,j,k,RhoTheta_comp),cell_data(i,j,k+1,RhoTheta_comp));
342 #else
343  if (cell_data(i,j,k,RhoTheta_comp) <= 0.) {
344  printf("BAD THETA AT %d %d %d %e %e \n",
345  i,j,k,cell_data(i,j,k,RhoTheta_comp),cell_data(i,j,k+1,RhoTheta_comp));
346  amrex::Abort("Bad theta in check_for_negative_theta");
347  }
348 #endif
349  });
350  } // mfi
351 }
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:37

Referenced by ERF::Advance().

Here is the caller graph for this function: