Skip to content

Commit

Permalink
#1815 Use NcVarInfo members instead API calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Howard Soh committed Jul 1, 2022
1 parent f4d9706 commit 8e9d91c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/libcode/vx_nc_util/nc_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3805,8 +3805,8 @@ int get_index_for_dim(NcVarInfo *vars, const string dim_name,

// Find the variable with the same dimension name
for (int i=0; i<var_count; i++) {
if (1 != get_dim_count(vars[i].var)) continue;
if (!dim_name.compare(GET_NC_NAME_P(vars[i].var))) {
if (1 != vars[i].Ndims) continue;
if (!dim_name.compare(vars[i].name)) {
nc_var = vars[i].var;
break;
}
Expand All @@ -3815,9 +3815,9 @@ int get_index_for_dim(NcVarInfo *vars, const string dim_name,
if (IS_INVALID_NC_P(nc_var)) {
// Find 1D variable with the same dimension
for (int i=0; i<var_count; i++) {
if (1 != get_dim_count(vars[i].var)) continue;
NcDim dim = get_nc_dim(vars[i].var, 0);
if (IS_VALID_NC(dim) && !dim_name.compare(GET_NC_NAME(dim))) {
if (1 != vars[i].Ndims) continue;
NcDim *dim = vars[i].Dims[0];
if (IS_VALID_NC_P(dim) && !dim_name.compare(GET_NC_NAME_P(dim))) {
nc_var = vars[i].var;
break;
}
Expand Down

0 comments on commit 8e9d91c

Please sign in to comment.