Skip to content

Commit

Permalink
Merge pull request #1783 from dtcenter/bugfix_1782_point_stat_NCCF
Browse files Browse the repository at this point in the history
bugfix 1782 point_stat_NCCF
  • Loading branch information
hsoh-u authored May 7, 2021
2 parents a56f1ee + d0bd336 commit 6c9b78e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions met/src/libcode/vx_data2d_nccf/data2d_nccf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -365,16 +365,23 @@ LongArray MetNcCFDataFile::collect_time_offsets(VarInfo &vinfo) {
return(time_offsets);
}

int time_dim_slot = info->t_slot;
int time_dim_size = _file->ValidTime.n_elements();
if (0 < time_dim_size && time_dim_slot < 0) {
// The time dimension does not exist at the variable and the time
// variable exists. Stop time slicing and set the time offset to 0.
time_offsets.add(0);
return(time_offsets);
}

double time_lower = bad_data_double;
double time_upper = bad_data_double;
int error_code = error_code_no_error;
int time_dim_slot = info->t_slot;
int time_dim_size = _file->ValidTime.n_elements();
LevelInfo level = vinfo.level();
LongArray dimension = vinfo_nc->dimension();
bool is_time_range = (level.type() == LevelType_Time);
bool time_as_value = !level.is_time_as_offset();

long dim_offset = (time_dim_slot >= 0) ? dimension[time_dim_slot] : -1;
bool include_all_times = (dim_offset == vx_data2d_star);

Expand Down

0 comments on commit 6c9b78e

Please sign in to comment.