Skip to content

Commit

Permalink
#2068 calls get_cf_conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
Howard Soh committed Oct 13, 2022
1 parent e842e5f commit a531011
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/libcode/vx_data2d_factory/is_netcdf_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ static const char netcdf_magic [] = "CDF";
static const char hdf_magic [] = "HDF";
static const int netcdf_magic_len = m_strlen(netcdf_magic);

static const string nccf_att_name = "Conventions";
static const string nccf_att_name_l = "conventions";
static const string nccf_att_name_U = "CONVENTIONS";
static const string nccf_att_value = "CF-";
static const string nccf_att_value2 = "CF ";
static const string nccf_att_value3 = "COARDS";
Expand Down Expand Up @@ -96,9 +93,7 @@ bool is_nccf_file(const char * filename)
NcFile *nc_file = open_ncfile(filename);

if (!IS_INVALID_NC_P(nc_file)) {
bool found = get_global_att(nc_file, nccf_att_name, att_val);
if (!found) found = get_global_att(nc_file, nccf_att_name_l, att_val);
if (!found) found = get_global_att(nc_file, nccf_att_name_U, att_val);
bool found = get_cf_conventions(nc_file, att_val); // "Conventions" attrribute
if (found) {
status = (att_val.compare(0, nccf_att_value.length(),
nccf_att_value) == 0 ||
Expand Down

0 comments on commit a531011

Please sign in to comment.