REMORA
Regional Modeling of Oceans Refined Adaptively
Loading...
Searching...
No Matches
REMORAErrorTag Class Referencefinal

#include <REMORA_ErrorTag.H>

Inheritance diagram for REMORAErrorTag:
Collaboration diagram for REMORAErrorTag:

Public Member Functions

void SetModelTimeWindow (double min_time, double max_time) noexcept
 
bool ActiveAt (double t) const noexcept
 Whether this criterion applies at model time t, in seconds on the model clock.
 
void operator() (amrex::TagBoxArray &tba, const amrex::MultiFab *mf, const amrex::MultiFab *mskr3d, char clearval, char tagval, amrex::Real time, int level, const amrex::Geometry &geom, const amrex::IntVect &mask_lo=amrex::IntVect::TheZeroVector(), const amrex::IntVect &mask_hi=amrex::IntVect::TheZeroVector()) const
 

Private Attributes

double m_min_model_time = std::numeric_limits<double>::lowest()
 
double m_max_model_time = std::numeric_limits<double>::max()
 

Detailed Description

An amrex::AMRErrorTag that does not let the coastline drive refinement.

AMReX writes each data-dependent test twice: a plain form, and an embedded-boundary form that skips a covered cell and differences only across a face EBCellFlag reports as open. REMORA's land/sea mask plays the part of that connectivity – tracers on the land side are zeroed every step, so a difference taken across a coast measures the coast, not the flow. This class is that EB form with mskr in place of the flags.

REMORA used to suppress the same spurious tags afterwards instead, by appending two derefine criteria that cleared every land cell and every cell beside one. Running after the user's own criteria, they also cleared tags a static in_box_lo/in_box_hi region had deliberately set, so a box drawn across a coast came back refined only on its water part. Guarding each criterion as it is evaluated leaves every other criterion's tags alone.

The inheritance is private on purpose: AMRErrorTag::operator() is not virtual, so converting a criterion back to the base would compile and quietly run the unguarded test on masked data. Private inheritance makes that ill-formed while still granting access to the protected m_test, m_value and m_info. Only the constructors and Field() are re-exported; the base's seven-argument operator() deliberately is not, so a call that forgets the mask will not compile.

Definition at line 32 of file REMORA_ErrorTag.H.

Member Function Documentation

◆ ActiveAt()

bool REMORAErrorTag::ActiveAt ( double  t) const
inlinenoexcept

Whether this criterion applies at model time t, in seconds on the model clock.

Definition at line 54 of file REMORA_ErrorTag.H.

◆ operator()()

void REMORAErrorTag::operator() ( amrex::TagBoxArray &  tba,
const amrex::MultiFab *  mf,
const amrex::MultiFab *  mskr3d,
char  clearval,
char  tagval,
amrex::Real  time,
int  level,
const amrex::Geometry &  geom,
const amrex::IntVect &  mask_lo = amrex::IntVect::TheZeroVector(),
const amrex::IntVect &  mask_hi = amrex::IntVect::TheZeroVector() 
) const

Apply this criterion to tba, skipping land.

Only GRAD, LESS and GREATER consult the mask. BOX and PARSER tag on position alone, USER hands the whole decision to a functor, and VORT and RELGRAD are unreachable from REMORA's inputs; all of those go to amrex::AMRErrorTag::operator() unchanged.

Parameters
[in,out]tbatags to update
[in]mfsingle-component field this criterion tests, with one ghost cell when the test is GRAD
[in]mskr3dland/sea mask on mf's BoxArray and DistributionMap, with enough lateral ghost cells for mask_lo/mask_hi plus one more for GRAD. nullptr evaluates exactly as amrex::AMRErrorTag would, which is what a criterion keyed on the mask itself wants, and what a run with no mask wants since every value is then clean anyway.
[in]clearvalvalue marking an untagged cell
[in]tagvalvalue marking a tagged cell
[in]timecurrent time
[in]levellevel being tagged
[in]geomgeometry of that level
[in]mask_lolowest offset, in rho-cells relative to a value's own index, of the cells whose wet/dry state that value depends on – not always the cell it is stored in, since a face velocity is masked by both cells sharing its face and vorticity by a 3x3 block. Testing a value where it is not clean tags the coast just as differencing across the coast would. ErrorEst sets these per field and says why. Zero, the default, means the value is its own cell alone; the vertical component must be zero, the mask being column-constant.
[in]mask_hihighest such offset; see mask_lo.

Apply this criterion to tba, skipping values the land/sea mask makes meaningless. The parameters are documented on the declaration in REMORA_ErrorTag.H.

The one thing to know when reading the body: a cell this declines to test is left exactly as it was found, not cleared. That is what lets a static box keep the tags it set over a coast, and it is the whole difference from the derefine criteria this replaced.

Definition at line 97 of file REMORA_Tagging.cpp.

Here is the call graph for this function:

◆ SetModelTimeWindow()

void REMORAErrorTag::SetModelTimeWindow ( double  min_time,
double  max_time 
)
inlinenoexcept

Restrict this criterion to model times in [min_time, max_time], in seconds on the model clock. Held here in double rather than in AMRErrorTagInfo, whose Real would round a calendar-scale time in a single-precision build, and whose times would have to be elapsed ones, fixed against whatever remora.start_time was when the inputs were read.

Definition at line 47 of file REMORA_ErrorTag.H.

Here is the call graph for this function:

Member Data Documentation

◆ m_max_model_time

double REMORAErrorTag::m_max_model_time = std::numeric_limits<double>::max()
private

Definition at line 103 of file REMORA_ErrorTag.H.

Referenced by ActiveAt(), and SetModelTimeWindow().

◆ m_min_model_time

double REMORAErrorTag::m_min_model_time = std::numeric_limits<double>::lowest()
private

Definition at line 102 of file REMORA_ErrorTag.H.

Referenced by ActiveAt(), and SetModelTimeWindow().


The documentation for this class was generated from the following files: