UFO
ufo::ProfileCheckValidator Class Reference

Profile QC check validator. More...

#include <ProfileCheckValidator.h>

Collaboration diagram for ufo::ProfileCheckValidator:

Public Member Functions

 ProfileCheckValidator (const ConventionalProfileProcessingParameters &options)
 
void validate (ProfileDataHandler &profileDataHandler, size_t commSize)
 Validate check results against OPS values. More...
 
int getMismatches () const
 Get number of mismatches between values produced in this code and the OPS equivalents. More...
 

Private Member Functions

template<typename T >
void compareOutput (const std::string &desc, const T val1, const T val2, const int offset, const float tol, int &n)
 Compare values with specified offset and tolerance. More...
 
template<typename T >
void compareOutput (const std::string &desc, const std::vector< T > &vec1, const std::vector< T > &vec2, const int offset, const float tol, int &n)
 Compare vectors of values with specified offset and tolerance. More...
 
template<typename T >
bool differenceWithinTol (const T A, const T B, const float tol=1e-10) const
 Determine difference between two values within a certain tolerance. More...
 

Private Attributes

const ConventionalProfileProcessingParametersoptions_
 Configurable parameters. More...
 
std::map< std::string, int > cumulativeCounters_
 Counters that are accumulated across profiles. More...
 
int nMismatches_
 Number of mismatches between this code and OPS (separate for each profile). More...
 
std::set< std::string > valuesToCompare_int_
 Integer values to compare. More...
 
std::set< std::string > valuesToCompare_float_
 Float values to compare. More...
 
std::map< std::string, int > comparison_offsets_
 

Detailed Description

Profile QC check validator.

Compares various values produced in this code to the equivalent values produced in the OPS code.

Definition at line 27 of file ProfileCheckValidator.h.

Constructor & Destructor Documentation

◆ ProfileCheckValidator()

ufo::ProfileCheckValidator::ProfileCheckValidator ( const ConventionalProfileProcessingParameters options)
explicit

Definition at line 23 of file ProfileCheckValidator.cc.

Here is the call graph for this function:

Member Function Documentation

◆ compareOutput() [1/2]

template<typename T >
void ufo::ProfileCheckValidator::compareOutput ( const std::string &  desc,
const std::vector< T > &  vec1,
const std::vector< T > &  vec2,
const int  offset,
const float  tol,
int &  n 
)
private

Compare vectors of values with specified offset and tolerance.

Comparison of vectors of values.

Definition at line 205 of file ProfileCheckValidator.cc.

Here is the call graph for this function:

◆ compareOutput() [2/2]

template<typename T >
void ufo::ProfileCheckValidator::compareOutput ( const std::string &  desc,
const T  val1,
const T  val2,
const int  offset,
const float  tol,
int &  n 
)
private

Compare values with specified offset and tolerance.

Comparison of single values.

Definition at line 189 of file ProfileCheckValidator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ differenceWithinTol()

template<typename T >
bool ufo::ProfileCheckValidator::differenceWithinTol ( const T  A,
const T  B,
const float  tol = 1e-10 
) const
inlineprivate

Determine difference between two values within a certain tolerance.

Definition at line 59 of file ProfileCheckValidator.h.

Here is the caller graph for this function:

◆ getMismatches()

int ufo::ProfileCheckValidator::getMismatches ( ) const
inline

Get number of mismatches between values produced in this code and the OPS equivalents.

Definition at line 36 of file ProfileCheckValidator.h.

Here is the caller graph for this function:

◆ validate()

void ufo::ProfileCheckValidator::validate ( ProfileDataHandler profileDataHandler,
size_t  commSize 
)

Validate check results against OPS values.

Special case: OPS counters have one value per profile level, and are in the MetaData rather than the Counters group. This avoids the (default) treatment which assumes that variables in the Counters group have one value per profile.

Definition at line 233 of file ProfileCheckValidator.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ comparison_offsets_

std::map<std::string, int> ufo::ProfileCheckValidator::comparison_offsets_
private

Values for which there is an offset between this code and OPS due to array indices starting at 0 in C++ and 1 in Fortran.

Definition at line 80 of file ProfileCheckValidator.h.

◆ cumulativeCounters_

std::map<std::string, int> ufo::ProfileCheckValidator::cumulativeCounters_
private

Counters that are accumulated across profiles.

Definition at line 67 of file ProfileCheckValidator.h.

◆ nMismatches_

int ufo::ProfileCheckValidator::nMismatches_
private

Number of mismatches between this code and OPS (separate for each profile).

Definition at line 70 of file ProfileCheckValidator.h.

◆ options_

const ConventionalProfileProcessingParameters& ufo::ProfileCheckValidator::options_
private

Configurable parameters.

Definition at line 64 of file ProfileCheckValidator.h.

◆ valuesToCompare_float_

std::set<std::string> ufo::ProfileCheckValidator::valuesToCompare_float_
private

Float values to compare.

Definition at line 76 of file ProfileCheckValidator.h.

◆ valuesToCompare_int_

std::set<std::string> ufo::ProfileCheckValidator::valuesToCompare_int_
private

Integer values to compare.

Definition at line 73 of file ProfileCheckValidator.h.


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