Skip to content

Commit

Permalink
Bug-fix in QA_CORDEX.cpp: test 16_12 not for cell_methods='time: point'
Browse files Browse the repository at this point in the history
  • Loading branch information
h-dh committed Oct 7, 2015
1 parent a25a521 commit 174a8d5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
1 change: 1 addition & 0 deletions include/variable.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ class VariableMeta
bool isFixed; // isTime==false && isDataVar==true
bool isFillValue;
bool isFormulaTermsVar;
bool isInstant;
bool isLabel;
bool isMapVar;
bool isMissingValue;
Expand Down
9 changes: 7 additions & 2 deletions src/CF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7463,7 +7463,6 @@ CF::chap7_3(void)
if( (jx=var.getAttIndex(n_cell_methods)) == -1 )
continue;

// note that the loop is in fact gratuitous
std::string cm ;
for( size_t i=0 ; i < var.attValue[jx].size() ; ++i )
{
Expand Down Expand Up @@ -7902,7 +7901,8 @@ CF::chap7_3_cellMethods_Method(std::string &str0, Variable& var)
term.push_back("mid_range");
term.push_back("minimum");
term.push_back("mode");
term.push_back("point");
std::string point("point");
term.push_back(point);
term.push_back("standard_deviation");
term.push_back("sum");
term.push_back("variance");
Expand All @@ -7928,6 +7928,11 @@ CF::chap7_3_cellMethods_Method(std::string &str0, Variable& var)
return true;
}

// a time-line of instant values without boundaries?
std::vector<std::string> x_m_Items(x_methods.getItems());
if( hdhC::isAmong(point, x_m_Items) && time_ix > -1 )
pIn->variable[time_ix].isInstant=true;

// check valid mode
if( x_methods.size() > 1 )
{
Expand Down
16 changes: 10 additions & 6 deletions src/QA_CORDEX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2778,7 +2778,7 @@ QA::checkVarTableEntry_standardName(
{
if( tbl_entry.standardName != vMD.var->std_name
&& vMD.var->name != "evspsblpot" )
{ // note that evspsblpot had a different "valid" name in a former
{ // note that evspsblpot is not a standard_name definded by CF conventions
// CORDEX_variables_requirement table
std::string key("32_2");
if( notes->inq( key, vMD.var->name) )
Expand Down Expand Up @@ -5204,13 +5204,17 @@ QA::testPeriod(void)
isLeft_fT_not_tV = *tV_left != *fN_left ;
isRight_fT_not_tV = *tV_right != *fN_right ;

std::string key("16_12");
if( notes->inq( key, fVarname) )
if( qaTime.time_ix > -1 &&
! pIn->variable[qaTime.time_ix].isInstant )
{
std::string capt("Variable time_bnds is missing");
std::string key("16_12");
if( notes->inq( key, fVarname) )
{
std::string capt("Variable time_bnds is missing");

(void) notes->operate(capt) ;
notes->setCheckMetaStr( fail );
(void) notes->operate(capt) ;
notes->setCheckMetaStr(fail);
}
}
}

Expand Down
1 change: 1 addition & 0 deletions src/Variable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ VariableMeta::VariableMeta()
isFixed=false;
isFillValue=false;
isFormulaTermsVar=false;
isInstant=false;
isLabel=false;
isMapVar=false;
isMissingValue=false;
Expand Down

0 comments on commit 174a8d5

Please sign in to comment.