Skip to content

Commit

Permalink
Per #1908, ci-skip-unit work in progress. Doesn't actually compile yet.
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnHalleyGotway committed Sep 17, 2022
1 parent c183856 commit a5ec2a8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 100 deletions.
8 changes: 2 additions & 6 deletions src/tools/core/ensemble_stat/ensemble_stat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ using namespace std;
static void process_command_line (int, char **);
static void process_grid (const Grid &);
static void process_n_vld ();
static void process_ensemble ();
static void process_vx ();
static bool get_data_plane (const char *, GrdFileType, VarInfo *,
DataPlane &, bool do_regrid);
Expand Down Expand Up @@ -196,9 +195,6 @@ int met_main(int argc, char *argv[]) {
// Check for valid ensemble data
process_n_vld();

// Process the ensemble fields
process_ensemble();

// Perform verification
process_vx();

Expand Down Expand Up @@ -817,7 +813,7 @@ bool get_data_plane_array(const char *infile, GrdFileType ftype,
}

////////////////////////////////////////////////////////////////////////

/* JHG
void process_ensemble() {
int i_var, i_ens, j;
bool reset;
Expand Down Expand Up @@ -918,7 +914,7 @@ void process_ensemble() {
return;
}

*/
////////////////////////////////////////////////////////////////////////

void process_vx() {
Expand Down
92 changes: 5 additions & 87 deletions src/tools/core/ensemble_stat/ensemble_stat_conf_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ void EnsembleStatConfInfo::init_from_scratch() {

void EnsembleStatConfInfo::clear() {
int i;
vector<EnsVarInfo*>::const_iterator it = ens_input.begin();

// Initialize values
model.clear();
Expand All @@ -88,16 +87,9 @@ void EnsembleStatConfInfo::clear() {
// Deallocate memory
if(vx_opt) { delete [] vx_opt; vx_opt = (EnsembleStatVxOpt *) 0; }

for(; it != ens_input.end(); it++) {

if(*it) { delete *it; }

}
ens_input.clear();

// Reset counts
n_vx = 0;
max_hira_size = 0;
n_vx = 0;
max_hira_size = 0;

return;
}
Expand Down Expand Up @@ -130,12 +122,10 @@ void EnsembleStatConfInfo::process_config(GrdFileType etype,
int i, j, n_ens_files;
VarInfoFactory info_factory;
map<STATLineType,STATOutputType>output_map;
Dictionary *edict = (Dictionary *) 0;
Dictionary *fdict = (Dictionary *) 0;
Dictionary *odict = (Dictionary *) 0;
Dictionary i_edict, i_fdict, i_odict;
Dictionary i_fdict, i_odict;
InterpMthd mthd;
VarInfo * next_var;

// Dump the contents of the config file
if(mlog.verbosity_level() >= 5) conf.dump(cout);
Expand Down Expand Up @@ -201,9 +191,8 @@ void EnsembleStatConfInfo::process_config(GrdFileType etype,
// Only a single file should be provided if using ens_member_ids
if(ens_files->n() > 1) {
mlog << Error << "\nEnsembleStatConfInfo::process_config() -> "
<< "The \"" << conf_key_ens_member_ids << "\" "
<< "must be empty if more than "
<< "one file is provided.\n\n";
<< "the \"" << conf_key_ens_member_ids << "\" "
<< "must be empty if more than one file is provided.\n\n";
exit(1);
}

Expand Down Expand Up @@ -234,77 +223,6 @@ void EnsembleStatConfInfo::process_config(GrdFileType etype,
<< "dictionary has moved to the Gen-Ens-Prod tool." << "\n\n";
}

// Parse the ensemble field information
for(i=0; i<n_ens_var; i++) {

EnsVarInfo * ens_info = new EnsVarInfo();

// Get the current dictionary
i_edict = parse_conf_i_vx_dict(edict, i);

// get VarInfo magic string without substituted values
ens_info->raw_magic_str = raw_magic_str(i_edict, etype);

// Loop over ensemble member IDs to substitute
for(j=0; j<ens_member_ids.n(); j++) {

// set environment variable for ens member ID
setenv(met_ens_member_id, ens_member_ids[j].c_str(), 1);

// Allocate new VarInfo object
next_var = info_factory.new_var_info(etype);

// Set the current dictionary
next_var->set_dict(i_edict);

// Dump the contents of the current VarInfo
if(mlog.verbosity_level() >= 5) {
mlog << Debug(5)
<< "Parsed ensemble field number " << i+1
<< " (" << j+1 << "):\n";
next_var->dump(cout);
}

InputInfo input_info;
input_info.var_info = next_var;
input_info.file_index = 0;
input_info.file_list = ens_files;
ens_info->add_input(input_info);

// Add InputInfo to ens info list for each ensemble file provided
// set var_info to NULL to note first VarInfo should be used
for(int k=1; k<n_ens_files; k++) {
input_info.var_info = NULL;
input_info.file_index = k;
input_info.file_list = ens_files;
ens_info->add_input(input_info);
} // end for k
} // end for j

// Get field info for control member if set
if(!control_id.empty()) {

// Set environment variable for ens member ID
setenv(met_ens_member_id, control_id.c_str(), 1);

// Allocate new VarInfo object
next_var = info_factory.new_var_info(etype);

// Set the current dictionary
next_var->set_dict(i_edict);

ens_info->set_ctrl(next_var);
}

// Conf: ens_nc_var_str
ens_info->nc_var_str = parse_conf_string(&i_edict, conf_key_nc_var_str, false);

ens_input.push_back(ens_info);
} // end for i

// Unset MET_ENS_MEMBER_ID that was previously set
unsetenv(met_ens_member_id);

// Conf: ens.ens_thresh
vld_ens_thresh = conf.lookup_double(conf_key_ens_ens_thresh);

Expand Down
8 changes: 1 addition & 7 deletions src/tools/core/ensemble_stat/ensemble_stat_conf_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,6 @@ class EnsembleStatConfInfo {

void init_from_scratch();

// Ensemble processing
int n_ens_var; // Number of ensemble fields to be processed

// Ensemble verification
int n_vx; // Number of ensemble fields to be verified
int max_hira_size; // Maximum size of a HiRA neighborhoods
Expand All @@ -209,7 +206,6 @@ class EnsembleStatConfInfo {
ConcatString model; // Model name
ConcatString obtype; // Observation type

vector<EnsVarInfo *> ens_input; // Vector of EnsVarInfo pointers (allocated)
StringArray ens_member_ids; // Array of ensemble member ID strings
ConcatString control_id; // Control ID

Expand Down Expand Up @@ -252,8 +248,7 @@ class EnsembleStatConfInfo {
void set_vx_pd (const IntArray &, int);

// Dump out the counts
int get_n_ens_var() const;
int get_n_vx() const;
int get_n_vx() const;

// Compute the maximum number of output lines possible based
// on the contents of the configuration file
Expand All @@ -271,7 +266,6 @@ class EnsembleStatConfInfo {

////////////////////////////////////////////////////////////////////////

inline int EnsembleStatConfInfo::get_n_ens_var() const { return(n_ens_var); }
inline int EnsembleStatConfInfo::get_n_vx() const { return(n_vx); }
inline int EnsembleStatConfInfo::get_max_hira_size() const { return(max_hira_size); }
inline int EnsembleStatConfInfo::get_compression_level() { return(conf.nc_compression()); }
Expand Down

0 comments on commit a5ec2a8

Please sign in to comment.