Skip to content

Commit

Permalink
Work around bug in netcdf-cxx4. See: Unidata/netcdf-cxx4#30
Browse files Browse the repository at this point in the history
  • Loading branch information
citibeth committed Mar 28, 2016
1 parent 4c33d8d commit a7bacff
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions slib/icebin/GCMCoupler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ std::unique_ptr<IceModel> new_ice_model(NcIO &ncio, std::string vname,
GCMCoupler const *_coupler, IceRegridder *_sheet)
{
std::string vn(vname + ".info");
auto info_v = get_or_add_var(ncio, vn, netCDF::ncInt64, {});
auto info_v = get_or_add_var(ncio, vn, "int64", {});

IceModel::Type type;
get_or_put_att_enum(info_v, ncio.rw, "ice_model", type);
Expand Down Expand Up @@ -236,7 +236,7 @@ void GCMCoupler::ncread(
// Read gcm_out_file, an optional variable telling the GCM-specific
// part of IceBin to write out exactly what it sees coming from the GCM
// (so it can be replayed later with desm)
auto info_v = get_or_add_var(ncio, vname + ".info", netCDF::ncInt64, {});
auto info_v = get_or_add_var(ncio, vname + ".info", "int64", {});

gcm_out_file = "";
get_or_put_att(info_v, ncio.rw, "gcm_out_file", gcm_out_file, false);
Expand Down
6 changes: 3 additions & 3 deletions slib/icebin/GCMRegridder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void IceRegridder::ncio(NcIO &ncio, std::string const &vname)
exgrid = new_grid(ncio, vname + ".exgrid");
}

auto info_v = get_or_add_var(ncio, vname + ".info", netCDF::ncInt64, {});
auto info_v = get_or_add_var(ncio, vname + ".info", "int64", {});
get_or_put_att(info_v, ncio.rw, "name", _name);
get_or_put_att_enum(info_v, ncio.rw, "interp_style", interp_style);

Expand Down Expand Up @@ -138,7 +138,7 @@ std::unique_ptr<IceRegridder> new_ice_regridder(IceRegridder::Type type)
std::unique_ptr<IceRegridder> new_ice_regridder(NcIO &ncio, std::string vname)
{
std::string vn(vname + ".gridI.info");
auto gridI_info_v = get_or_add_var(ncio, vn, netCDF::ncInt64, {});
auto gridI_info_v = get_or_add_var(ncio, vn, "int64", {});

Grid::Parameterization parameterization;
get_or_put_att_enum(gridI_info_v, ncio.rw, "parameterization", parameterization);
Expand All @@ -158,7 +158,7 @@ void GCMRegridder::clear()

void GCMRegridder::ncio(NcIO &ncio, std::string const &vname)
{
auto info_v = get_or_add_var(ncio, vname + ".info", netCDF::ncInt64, {});
auto info_v = get_or_add_var(ncio, vname + ".info", "int64", {});

if (ncio.rw == 'r') {
clear();
Expand Down
4 changes: 2 additions & 2 deletions slib/icebin/Grid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,15 +258,15 @@ std::unique_ptr<Grid> new_grid(Grid::Type type)
std::unique_ptr<Grid> new_grid(NcIO &ncio, std::string const &vname)
{
Grid::Type type;
auto info_v = get_or_add_var(ncio, vname + ".info", netCDF::ncInt64, {});
auto info_v = get_or_add_var(ncio, vname + ".info", "int64", {});
get_or_put_att_enum(info_v, ncio.rw, "type", type);
return new_grid(type);
}

void Grid::ncio(NcIO &ncio, std::string const &vname)
{
// ------ Attributes
auto info_v = get_or_add_var(ncio, vname + ".info", netCDF::ncInt64, {});
auto info_v = get_or_add_var(ncio, vname + ".info", "int64", {});

get_or_put_att(info_v, ncio.rw, "name", name);

Expand Down
2 changes: 1 addition & 1 deletion slib/icebin/IceRegridder_L0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ void IceRegridder_L0::GvAp(spsparse::SparseTriplets<SparseMatrix> &ret) const
void IceRegridder_L0::ncio(NcIO &ncio, std::string const &vname)
{
IceRegridder::ncio(ncio, vname);
auto info_v = get_or_add_var(ncio, vname + ".info", netCDF::ncInt64, {});
auto info_v = get_or_add_var(ncio, vname + ".info", "int64", {});
get_or_put_att_enum(info_v, ncio.rw, "interp_grid", interp_grid);
}

Expand Down

0 comments on commit a7bacff

Please sign in to comment.