20 if (amrex::ParallelDescriptor::IOProcessor())
23 amrex::Print() <<
"Trying to read attribute " <<
attr_name <<
" from variable " <<
var_name <<
" that does not exist!" << std::endl;
26 amrex::Print() <<
"Trying to read attribute " <<
attr_name <<
" that does not exist from variable " <<
var_name <<
"!" << std::endl;
47 if (amrex::ParallelDescriptor::IOProcessor())
50 amrex::Print() <<
"Trying to check for attribute " <<
attr_name <<
" from variable " <<
var_name <<
" that does not exist!" << std::endl;
55 int ioproc = amrex::ParallelDescriptor::IOProcessorNumber();
56 amrex::ParallelDescriptor::Bcast(&has_var, 1,
ioproc);
57 return (has_var != 0);
71 const amrex::Vector<std::string>&
var_names)
76 if (amrex::ParallelDescriptor::IOProcessor())
83 amrex::ParallelDescriptor::Bcast(&
has_all, 1, amrex::ParallelDescriptor::IOProcessorNumber());
mf_h setVal(geomdata.ProbHi(2))
bool QueryNetCDFHasVars(const std::string &fname, const amrex::Vector< std::string > &var_names)
Helper function for testing whether a file carries every named variable.
bool QueryNetCDFVarAttrStr(const std::string &fname, const std::string &var_name, const std::string &attr_name)
Helper function for testing for the presence of a single variable attribute.
std::string ReadNetCDFVarAttrStr(const std::string &fname, const std::string &var_name, const std::string &attr_name)
Helper function for reading a single variable attribute.
static NCFile open(const std::string &name, const int cmode=NC_NOWRITE, MPI_Comm comm=MPI_COMM_WORLD, MPI_Info info=MPI_INFO_NULL)
Open an existing file.