Skip to content

Commit

Permalink
#1581 Cleanup for Fortify (removed unused variables)
Browse files Browse the repository at this point in the history
  • Loading branch information
Howard Soh committed Apr 22, 2021
1 parent 9c86845 commit 2f9bfb8
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 23 deletions.
2 changes: 0 additions & 2 deletions met/src/libcode/vx_nc_obs/nc_point_obs2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,6 @@ void MetNcPointObs2Write::write_arr_headers() {
&& !IS_INVALID_NC(obs_vars.hdr_prpt_typ_var);
data_buffer.hdr_buf_size = buf_size;
data_buffer.hdr_data_idx = hdr_data_idx;
int pb_raw_hdr_cnt = raw_hdr_cnt;
if (0 == pb_raw_hdr_cnt) pb_raw_hdr_cnt = obs_vars.raw_hdr_cnt;
for (int index=0; index<cur_hdr_idx; index++) {
// Message type
data_buffer.hdr_typ_buf[hdr_data_idx] = header_data.typ_idx_array[index];
Expand Down
9 changes: 4 additions & 5 deletions met/src/tools/other/ioda2nc/ioda2nc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,8 @@ void open_netcdf() {
////////////////////////////////////////////////////////////////////////

void process_ioda_file(int i_pb) {
int npbmsg, npbmsg_total, hdr_cnt;
int idx, i_msg, i_read, n_file_obs, i_ret, n_hdr_obs;
int npbmsg, npbmsg_total;
int idx, i_msg, i_read, n_file_obs, n_hdr_obs;
int rej_typ, rej_sid, rej_vld, rej_grid, rej_poly;
int rej_elv, rej_nobs;
double x, y;
Expand Down Expand Up @@ -538,7 +538,6 @@ void process_ioda_file(int i_pb) {
ConcatString unit_attr;
ConcatString desc_attr;
map<ConcatString,ConcatString> name_map = conf_info.getObsVarMap();
hdr_cnt = 0;
for(idx=0; idx<raw_var_names.n(); idx++ ) {
int *qc_data = new int[nlocs];
float *obs_data = new float[nlocs];
Expand Down Expand Up @@ -566,7 +565,7 @@ void process_ioda_file(int i_pb) {
}

// Initialize counts
i_ret = n_file_obs = i_msg = 0;
n_file_obs = i_msg = 0;
rej_typ = rej_sid = rej_vld = rej_grid = rej_poly = 0;
rej_elv = rej_nobs = 0;

Expand Down Expand Up @@ -595,7 +594,7 @@ void process_ioda_file(int i_pb) {
for(int idx=0; idx<OBS_ARRAY_LEN; idx++) obs_arr[idx] = 0;

// Loop through the IODA messages from the input file
for(i_read=0; i_read<npbmsg && i_ret == 0; i_read++) {
for(i_read=0; i_read<npbmsg; i_read++) {

if(mlog.verbosity_level() > 0) {
if(bin_count > 0 && (i_read+1)%bin_count == 0) {
Expand Down
20 changes: 8 additions & 12 deletions met/src/tools/other/madis2nc/madis2nc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1145,18 +1145,16 @@ void process_madis_metar(NcFile *&f_in) {
// Snow Cover
obs_arr[2] = bad_data_float;
obs_arr[4] = snowCover[i_idx];
//count += process_obs(66, conversion, obs_arr, snowCoverQty[i_idx],
// snowCover_var, hdr_typ, hdr_sid, hdr_vld,
// hdr_arr[0], hdr_arr[1], hdr_arr[2]);
process_obs(66, conversion, obs_arr, snowCoverQty[i_idx],
snowCover_var, hdr_typ, hdr_sid, hdr_vld,
hdr_arr[0], hdr_arr[1], hdr_arr[2]);
count += process_obs(66, conversion, obs_arr, snowCoverQty[i_idx],
snowCover_var, hdr_typ, hdr_sid, hdr_vld,
hdr_arr[0], hdr_arr[1], hdr_arr[2]);

}

} // end for i_hdr

print_rej_counts();
mlog << Debug(5) << " Added " << count << "data\n";

//
// Cleanup
Expand Down Expand Up @@ -2600,18 +2598,16 @@ void process_madis_maritime(NcFile *&f_in) {
// APCP_24
obs_arr[2] = 86400;
obs_arr[4] = precip24Hour_arr[i_idx];
//count += process_obs(61, conversion, obs_arr, precip24HourQty_arr[i_idx],
// in_precip24Hour_var, hdr_typ, hdr_sid, hdr_vld,
// hdr_arr[0], hdr_arr[1], hdr_arr[2]);
process_obs(61, conversion, obs_arr, precip24HourQty_arr[i_idx],
in_precip24Hour_var, hdr_typ, hdr_sid, hdr_vld,
hdr_arr[0], hdr_arr[1], hdr_arr[2]);
count += process_obs(61, conversion, obs_arr, precip24HourQty_arr[i_idx],
in_precip24Hour_var, hdr_typ, hdr_sid, hdr_vld,
hdr_arr[0], hdr_arr[1], hdr_arr[2]);

}

} // end for i_hdr

print_rej_counts();
mlog << Debug(5) << " Added " << count << "data\n";

//
// Cleanup
Expand Down
3 changes: 1 addition & 2 deletions met/src/tools/other/pb2nc/pb2nc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3215,7 +3215,7 @@ void interpolate_pqtzuv(float *prev_pqtzuv, float *cur_pqtzuv, float *next_pqtzu
void merge_records(float *first_pqtzuv, map<float, float*> pqtzuv_map_pivot,
map<float, float*> pqtzuv_map_aux, map<float, float*> &pqtzuv_map_merged) {

float cur_pres, next_pres;
float cur_pres;
float *cur_pqtzuv, *next_pqtzuv, *prev_pqtzuv;
float *pqtzuv_merged;
std::map<float,float*>::iterator it_pivot, it_aux;
Expand All @@ -3235,7 +3235,6 @@ void merge_records(float *first_pqtzuv, map<float, float*> pqtzuv_map_pivot,
for (; it_aux!=pqtzuv_map_aux.end(); ++it_aux) {
// Skip the records below the first mathcing/interpolated level
if (it_pivot->first < it_aux->first) {
next_pres = it_aux->first;
break;
}
prev_pqtzuv = (float *)it_aux->second;
Expand Down
2 changes: 0 additions & 2 deletions met/src/tools/other/point2grid/point2grid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1119,14 +1119,12 @@ void process_point_nccf_file(NcFile *nc_in, MetConfig &config,
usage();
}

bool is_2d_time = false;
unixtime valid_time = bad_data_int;
valid_beg_ut = valid_end_ut = conf_info.valid_time;

NcVar time_var = get_nc_var_time(nc_in);
if( IS_VALID_NC(time_var) ) {
if( 1 < get_dim_count(&time_var) ) {
is_2d_time = true;
double max_time = bad_data_double;
skip_times = new bool[from_size];
valid_times = new double[from_size];
Expand Down

0 comments on commit 2f9bfb8

Please sign in to comment.