Skip to content

Commit

Permalink
consistency check: rearranged
Browse files Browse the repository at this point in the history
  • Loading branch information
h-dh committed Jan 13, 2016
1 parent 3162325 commit a40ebff
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 46 deletions.
4 changes: 3 additions & 1 deletion include/qa_CMIP5.h
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,8 @@ class QA_Exp
//! Check the path to the tables;
bool inqTables(void);

void init(std::vector<std::string>&);

//! Initialisation of flushing gathered results to netCDF file.
/*! Parameter indicates the number of variables. */
void initDataOutputBuffer(void);
Expand All @@ -482,7 +484,7 @@ class QA_Exp
//! Connect this with the object to be checked
// void setInFilePointer(InFile *p) { pIn = p; }

void run(std::vector<std::string>&);
void run(void);

void setParent(QA*);

Expand Down
6 changes: 3 additions & 3 deletions include/qa_CORDEX.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,11 @@ class QA_Exp
std::string
getTableEntryID(std::string vN="");

void init(std::vector<std::string>&);

//! Initialisation of flushing gathered results to netCDF file.
/*! Parameter indicates the number of variables. */
void initDataOutputBuffer(void);

//! Set default values.
void initDefaults(void);

//! Initialisiation of a resumed session.
Expand All @@ -297,7 +297,7 @@ class QA_Exp
void reqAttCheckGlobal(Variable&);
void reqAttCheckVariable(Variable&);

void run(std::vector<std::string>&);
void run(void);

void setParent(QA*);

Expand Down
4 changes: 3 additions & 1 deletion include/qa_NONE.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ class QA_Exp
std::string
getTableEntryID(std::string vName);

void init(std::vector<std::string>&);

//! Initialisation of flushing gathered results to netCDF file.
/*! Parameter indicates the number of variables. */
void initDataOutputBuffer(void);
Expand All @@ -116,7 +118,7 @@ class QA_Exp
//! Check the path to the tables;
void inqTables(void){return;}

void run(std::vector<std::string>&);
void run(void);

void setParent(QA*);

Expand Down
17 changes: 9 additions & 8 deletions src/QA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -534,15 +534,16 @@ QA::init(void)

qaTime.init(optStr);

// check consistency between sub-sequent files Oor experiments
if( checkConsistency(*pIn) )
{
// DRS and CV specifications
drs_cv_table.read(table_DRS_CV);
qaExp.init(optStr);

// experiment specific obj: set parent, pass over options
qaExp.run(optStr);
}
// check consistency between sub-sequent files or experiments
(void) checkConsistency(*pIn) ;

// DRS and CV specifications
drs_cv_table.read(table_DRS_CV);

// experiment specific obj: set parent, pass over options
qaExp.run();

// check existance of any data at all
if( (qaTime.isTime || isCheckData )
Expand Down
30 changes: 18 additions & 12 deletions src/QA_CMIP5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4318,6 +4318,23 @@ QA_Exp::getVarnameFromFilename(std::string fName)
return fName;
}

void
QA_Exp::init(std::vector<std::string>& optStr)
{
// apply parsed command-line args
applyOptions(optStr);

fVarname = getVarnameFromFilename(pQA->pIn->file.filename);
getFrequency();

notes->setCheckMetaStr("PASS");

// Create and set VarMetaData objects.
createVarMetaData() ;

return;
}

void
QA_Exp::initDataOutputBuffer(void)
{
Expand Down Expand Up @@ -4514,19 +4531,8 @@ QA_Exp::pushBackVarMeDa(Variable *var)
}

void
QA_Exp::run(std::vector<std::string>& optStr)
QA_Exp::run(void)
{
// apply parsed command-line args
applyOptions(optStr);

notes->setCheckMetaStr("PASS");

fVarname = getVarnameFromFilename(pQA->pIn->file.filename);
getFrequency();

// Create and set VarMetaData objects.
createVarMetaData() ;

if( inqTables() )
{
QA::tableSheet = getMIP_tableName() ;
Expand Down
32 changes: 19 additions & 13 deletions src/QA_CORDEX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3963,6 +3963,24 @@ QA_Exp::getVarnameFromFilename(std::string fName)
return fName;
}

void
QA_Exp::init(std::vector<std::string>& optStr)
{
// apply parsed command-line args
applyOptions(optStr);

fVarname = getVarnameFromFilename();
getFrequency();
getSubTable() ;

notes->setCheckMetaStr("PASS");

// Create and set VarMetaData objects.
createVarMetaData() ;

return;
}

void
QA_Exp::initDataOutputBuffer(void)
{
Expand Down Expand Up @@ -4729,17 +4747,8 @@ QA_Exp::reqAttCheckVariable(Variable &var)
}

void
QA_Exp::run(std::vector<std::string>& optStr)
QA_Exp::run(void)
{
// apply parsed command-line args
applyOptions(optStr);

notes->setCheckMetaStr("PASS");

fVarname = getVarnameFromFilename();
getFrequency();
getSubTable() ;

bool isNoTable = inqTables() ;

if( pQA->table_DRS_CV.is )
Expand All @@ -4748,9 +4757,6 @@ QA_Exp::run(std::vector<std::string>& optStr)
drsFN.run();
}

// Create and set VarMetaData objects.
createVarMetaData() ;

// check variable type; uses DRS_CV_Table
checkVariableType();

Expand Down
20 changes: 13 additions & 7 deletions src/QA_NONE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,18 @@ QA_Exp::getTableEntryID(std::string vName)
return vName + ",";
}

void
QA_Exp::init(std::vector<std::string>& optStr)
{
// apply parsed command-line args
applyOptions(optStr);

// Create and set VarMetaData objects.
createVarMetaData() ;

return ;
}

void
QA_Exp::initDataOutputBuffer(void)
{
Expand Down Expand Up @@ -170,14 +182,8 @@ QA_Exp::pushBackVarMeDa(Variable *var)
}

void
QA_Exp::run(std::vector<std::string>& optStr)
QA_Exp::run(void)
{
// apply parsed command-line args
applyOptions(optStr);

// Create and set VarMetaData objects.
createVarMetaData() ;

return ;
}

Expand Down
2 changes: 1 addition & 1 deletion src/QA_PT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ Consistency::getMetaData(Variable &dataVar,

// dimensions
md += "dims=";
md += dataVar.getDimNameStr();
md += dataVar.getDimNameStr(false, ' ');

// get attributes of the data variable
getAtts(dataVar, md);
Expand Down

0 comments on commit a40ebff

Please sign in to comment.