Skip to content

Commit

Permalink
Per #1020, in Ensemble-Stat, replace calls to name(), level_name(), a…
Browse files Browse the repository at this point in the history
…nd units() with calls to name_attr(), level_attr(), and units_attr().
  • Loading branch information
JohnHalleyGotway committed Jun 24, 2020
1 parent f09f799 commit 37a8303
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions met/src/tools/core/ensemble_stat/ensemble_stat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2195,8 +2195,8 @@ void track_counts(int i_vx, const DataPlane &dp) {
ConcatString get_ens_mn_var_name(int i_vx) {
ConcatString cs;

cs << conf_info.vx_opt[i_vx].vx_pd.fcst_info->name() << "_"
<< conf_info.vx_opt[i_vx].vx_pd.fcst_info->level_name()
cs << conf_info.vx_opt[i_vx].vx_pd.fcst_info->name_attr() << "_"
<< conf_info.vx_opt[i_vx].vx_pd.fcst_info->level_attr()
<< "_ENS_MEAN";
cs.replace(",", "_", false);
cs.replace("*", "all", false);
Expand Down Expand Up @@ -2717,8 +2717,8 @@ void write_ens_var_float(int i_ens, float *ens_data, DataPlane &dp,

// Construct the variable name
ens_var_name << cs_erase
<< conf_info.ens_info[i_ens]->name() << "_"
<< conf_info.ens_info[i_ens]->level_name()
<< conf_info.ens_info[i_ens]->name_attr() << "_"
<< conf_info.ens_info[i_ens]->level_attr()
<< var_str << "_" << type_str;

// Skip variable names that have already been written
Expand All @@ -2736,11 +2736,11 @@ void write_ens_var_float(int i_ens, float *ens_data, DataPlane &dp,
//
if(strcmp(type_str, "ENS_MEAN") == 0) {
name_str << cs_erase
<< conf_info.ens_info[i_ens]->name();
<< conf_info.ens_info[i_ens]->name_attr();
}
else {
name_str << cs_erase
<< conf_info.ens_info[i_ens]->name() << "_"
<< conf_info.ens_info[i_ens]->name_attr() << "_"
<< type_str;
}

Expand Down Expand Up @@ -2773,8 +2773,8 @@ void write_ens_var_int(int i_ens, int *ens_data, DataPlane &dp,

// Construct the variable name
ens_var_name << cs_erase
<< conf_info.ens_info[i_ens]->name() << "_"
<< conf_info.ens_info[i_ens]->level_name()
<< conf_info.ens_info[i_ens]->name_attr() << "_"
<< conf_info.ens_info[i_ens]->level_attr()
<< var_str << "_" << type_str;

// Skip variable names that have already been written
Expand All @@ -2789,7 +2789,7 @@ void write_ens_var_int(int i_ens, int *ens_data, DataPlane &dp,

// Construct the variable name attribute
name_str << cs_erase
<< conf_info.ens_info[i_ens]->name() << "_"
<< conf_info.ens_info[i_ens]->name_attr() << "_"
<< type_str;

// Add the variable attributes
Expand Down Expand Up @@ -2897,14 +2897,14 @@ void write_orank_var_float(int i_vx, int i_interp, int i_mask,

// Build the orank variable name
var_name << cs_erase
<< conf_info.vx_opt[i_vx].vx_pd.obs_info->name() << "_"
<< conf_info.vx_opt[i_vx].vx_pd.obs_info->level_name()
<< conf_info.vx_opt[i_vx].vx_pd.obs_info->name_attr() << "_"
<< conf_info.vx_opt[i_vx].vx_pd.obs_info->level_attr()
<< var_str << "_" << type_str << "_"
<< conf_info.vx_opt[i_vx].mask_name_area[i_mask];

// Construct the variable name attribute
name_str << cs_erase
<< conf_info.vx_opt[i_vx].vx_pd.obs_info->name() << "_"
<< conf_info.vx_opt[i_vx].vx_pd.obs_info->name_attr() << "_"
<< type_str << "_"
<< conf_info.vx_opt[i_vx].mask_name_area[i_mask];

Expand Down Expand Up @@ -2962,14 +2962,14 @@ void write_orank_var_int(int i_vx, int i_interp, int i_mask,

// Build the orank variable name
var_name << cs_erase
<< conf_info.vx_opt[i_vx].vx_pd.obs_info->name() << "_"
<< conf_info.vx_opt[i_vx].vx_pd.obs_info->level_name()
<< conf_info.vx_opt[i_vx].vx_pd.obs_info->name_attr() << "_"
<< conf_info.vx_opt[i_vx].vx_pd.obs_info->level_attr()
<< var_str << "_" << type_str << "_"
<< conf_info.vx_opt[i_vx].mask_name_area[i_mask];

// Construct the variable name attribute
name_str << cs_erase
<< conf_info.vx_opt[i_vx].vx_pd.obs_info->name() << "_"
<< conf_info.vx_opt[i_vx].vx_pd.obs_info->name_attr() << "_"
<< type_str << "_"
<< conf_info.vx_opt[i_vx].mask_name_area[i_mask];

Expand Down Expand Up @@ -3011,15 +3011,15 @@ void add_var_att_local(VarInfo *info, NcVar *nc_var, bool is_int, DataPlane &dp,

// Construct the long name
att_str << cs_erase
<< info->name() << " at "
<< info->level_name() << " "
<< info->name_attr() << " at "
<< info->level_attr() << " "
<< long_name_str;

// Add variable attributes
add_att(nc_var, "name", name_str);
add_att(nc_var, "long_name", (string)att_str);
add_att(nc_var, "level", (string)info->level_name());
add_att(nc_var, "units", (string)info->units());
add_att(nc_var, "level", (string)info->level_attr());
add_att(nc_var, "units", (string)info->units_attr());

if(is_int) add_att(nc_var, "_FillValue", bad_data_int);
else add_att(nc_var, "_FillValue", bad_data_float);
Expand Down

0 comments on commit 37a8303

Please sign in to comment.