Skip to content

Commit

Permalink
Per #1918, do not append the normalization type to the output variabl…
Browse files Browse the repository at this point in the history
…e names or attributes. Normalizing the input data is similar to converting it or censoring it and that information is not written to the NetCDF output files. The nc_var_str config option can be used to customize the output variable names as the user sees fit.
  • Loading branch information
JohnHalleyGotway committed Feb 19, 2022
1 parent 58cbb8f commit e2facf7
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions met/src/tools/other/gen_ens_prod/gen_ens_prod.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1074,14 +1074,7 @@ void write_ens_var_float(GenEnsProdVarInfo *ens_info, float *ens_data, const Dat
NcVar ens_var;
ConcatString ens_var_name, var_str, name_str, cs;

// Append the normalization info, if used
if(ens_info->normalize != NormalizeType_None &&
strcmp(type_str, "CLIMO_MEAN") != 0 &&
strcmp(type_str, "CLIMO_STDEV") != 0) {
var_str << "_" << normalizetype_to_string(ens_info->normalize);
}

// Append nc_var_str config file entry
// Append nc_var_str config file entry, if specified
cs = ens_info->nc_var_str;
if(cs.length() > 0) var_str << "_" << cs;

Expand Down Expand Up @@ -1137,12 +1130,7 @@ void write_ens_var_int(GenEnsProdVarInfo *ens_info, int *ens_data, const DataPla
NcVar ens_var;
ConcatString ens_var_name, var_str, name_str, cs;

// Append the normalization info, if used
if(ens_info->normalize != NormalizeType_None) {
var_str << "_" << normalizetype_to_string(ens_info->normalize);
}

// Append nc_var_str config file entry
// Append nc_var_str config file entry, if specified
cs = ens_info->nc_var_str;
if(cs.length() > 0) var_str << "_" << cs;

Expand Down Expand Up @@ -1226,11 +1214,6 @@ void add_var_att_local(GenEnsProdVarInfo *ens_info,
if(is_int) add_att(nc_var, "_FillValue", bad_data_int);
else add_att(nc_var, "_FillValue", bad_data_float);

if(ens_info->normalize != NormalizeType_None) {
add_att(nc_var, "normalize",
(string)normalizetype_to_string(ens_info->normalize));
}

// Write out times
write_netcdf_var_times(nc_var, dp);

Expand Down

0 comments on commit e2facf7

Please sign in to comment.