Skip to content

Commit

Permalink
QA_CMIP5: just to make all buildable again
Browse files Browse the repository at this point in the history
  • Loading branch information
h-dh committed Oct 22, 2015
1 parent c7038f6 commit 2c7cb3d
Show file tree
Hide file tree
Showing 2 changed files with 3,294 additions and 3,120 deletions.
85 changes: 57 additions & 28 deletions include/qa_CMIP5.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,39 @@ are performed. Annotations are supplied via the Annotation class
linked by a pointer.
*/

struct DRS_Filename
{
DRS_Filename(QA*, std::vector<std::string>&);

void applyOptions(std::vector<std::string>&);
void checkFilename(void);
void checkFilenameEncoding(void);
void checkMIP_tableName(Split& fileName);

std::string
getEnsembleMember(void);

void run(void);

//! Test the time-period of the input file.
/*! If the end-date in the filename and the last time value
match within the uncertainty of 0.75% of the time-step, then
the file is assumed to be completely qa-processed.
Syntax of date ranges as given in CORDEX DRS Syntax.*/
bool testPeriod(void);
bool testPeriodAlignment(std::vector<std::string> &sd, Date** pDates, bool b[]) ;
void testPeriodCut(std::vector<std::string> &sd) ;
bool testPeriodCut_CMOR_isGOD(std::vector<std::string> &sd, Date**);
void testPeriodCutRegular(std::vector<std::string> &sd,
std::vector<std::string>& text);
bool testPeriodFormat(std::vector<std::string> &sd) ;

bool enabledCompletenessCheck;

Annotation* notes;
QA* pQA;
};

//! Struct containing dimensional properties to cross-check with table information.
struct DimensionMetaData
{
Expand Down Expand Up @@ -73,13 +106,14 @@ class VariableMetaData
QA* pQA ;
QA_Data qaData;

//! Verify units % or 1 by data range
void verifyPercent(void);

int finally(int errCode=0);
void forkAnnotation(Annotation *p);
void setAnnotation(Annotation *p);
void setParent(QA *p){pQA=p;}
void setParent(QA* p){pQA=p;}

//! Verify units % or 1 by data range
void verifyPercent(void);

};

class QA_Exp
Expand Down Expand Up @@ -174,10 +208,6 @@ class QA_Exp
struct DimensionMetaData& nc,
struct DimensionMetaData& tbl);

//! Match filename components and global attributes of the file.
void checkFilename(std::vector<std::string>&,
std::string& stdSubTables_table);

//! Checks meta-data
void checkMetaData(InFile& ) ;

Expand Down Expand Up @@ -252,19 +282,19 @@ class QA_Exp

//! Get the MIP table name from the global attributes
std::string
getTableSheet(std::vector<std::string>&);
getTableSheet(void);

//! get and check MIP table name
void
getTableSheet(VariableMetaData& );
//! get and check MIP table name; s would indicate a name to be tried
std::string
getMIP_tableName(std::string s="");

// std::string
// getVarReqTable(void){ return varReqTable.file ; }

// std::string
// getTablePath(void){ return tablePath; }

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

//! Check the path to the tables;
bool inqTables(void);
Expand All @@ -291,22 +321,11 @@ class QA_Exp
//! Connect this with the object to be checked
// void setInFilePointer(InFile *p) { pIn = p; }

void setParent(QA*);

//! Set properties of variable from netcdf file
void setVarMetaData(VariableMetaData& );

//! Test the time-stamp of the input file.
/*! If the end-date in the filename and the last time value
match within the uncertainty of 0.75% of the time-step, then
the file is assumed to be completely qa-processed.
Syntax of date ranges as given in CMIP% DRS Syntax.*/
bool testPeriod(void);
bool testPeriodAlignment(std::vector<std::string>& sd, Date** pDates, bool b[]) ;
void testPeriodCut(std::vector<std::string>& sd) ;
bool testPeriodCut_CMOR_isGOD(std::vector<std::string>& sd, Date**);
void testPeriodCutRegular(std::vector<std::string>& sd,
std::vector<std::string>& text);
bool testPeriodFormat(std::vector<std::string>& sd) ;

//! Name of the netCDF file with results of the quality control
struct hdhC::FileSplit varReqTable;
struct hdhC::FileSplit table_DRS_CV;
Expand All @@ -322,7 +341,6 @@ class QA_Exp
size_t bufferSize;

// init for test about times
bool enabledCompletenessCheck;
bool isUseStrict;
bool isCaseInsensitiveVarName;
bool isCheckParentExpID;
Expand All @@ -336,10 +354,11 @@ class QA_Exp
std::vector<std::string> fillValueOption;

std::string cfStndNames;
std::string MIP_tableName;
std::string currMIP_tableName;
std::string frequency;
std::string parentExpID;
std::string parentExpRIP;
static std::vector<std::string> MIP_tableNames;

std::string experiment_id;

Expand All @@ -348,9 +367,19 @@ class QA_Exp
std::string getSubjectsIntroDim(VariableMetaData& vMD,
struct DimensionMetaData& nc_entry,
struct DimensionMetaData& tbl_entry);
std::string getVarnameFromFilename(void);
std::string getVarnameFromFilename(std::string str);
bool not_equal(double x1, double x2, double epsilon);
void pushBackVarMeDa(Variable*);
};

const char* CMIP5_MIPS[] = {
"fx", "Oyr", "Oclim", "Amon", "Omon", "Lmon",
"LImon", "OImon", "aero", "day", "6hrLev", "6hrPlev",
"3hr", "cfMon", "cfDay", "cf3hr", "cfSites"
};

std::vector<std::string> QA_Exp::MIP_tableNames(CMIP5_MIPS, CMIP5_MIPS + 17);

#endif

0 comments on commit 2c7cb3d

Please sign in to comment.