aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortradke <tradke@4825ed28-b72c-4eae-9704-e50c059e567d>2004-06-09 09:22:28 +0000
committertradke <tradke@4825ed28-b72c-4eae-9704-e50c059e567d>2004-06-09 09:22:28 +0000
commit9b3d1b96285480ba6e7cada66d780a61e1da923d (patch)
treec3cf8c4c8fa849a9db4277f62fc5879c3f50d366
parent46a5709c8a2a0840cd7eed40f2d86a5396aa7c46 (diff)
Use default values for the "name", "iteration", and "timelevel"
attributes if a dataset doesn't have them attached. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOHDF5/trunk@195 4825ed28-b72c-4eae-9704-e50c059e567d
-rw-r--r--src/util/hdf5_convert_from_ieeeio.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/util/hdf5_convert_from_ieeeio.c b/src/util/hdf5_convert_from_ieeeio.c
index d829288..bd0d62c 100644
--- a/src/util/hdf5_convert_from_ieeeio.c
+++ b/src/util/hdf5_convert_from_ieeeio.c
@@ -117,11 +117,11 @@ int main (int argc, char **argv)
j = IOreadAttributeInfo (infile, attrName, &attrNumberType, &attrLen);
if (j < 0)
{
+ sprintf (ieeeDatasetName, "Dataset %d", i);
fprintf (stderr,
- "Cannot find name attribute of dataset %d, skipping ...\n", i);
- continue;
+ "Cannot find name attribute of dataset %d, using default name '%s' ...\n", i, ieeeDatasetName);
}
- if (IOreadAttribute (infile, j, ieeeDatasetName) < 0)
+ else if (IOreadAttribute (infile, j, ieeeDatasetName) < 0)
{
fprintf (stderr,
"Cannot read name attribute of dataset %d, skipping ...\n", i);
@@ -131,11 +131,11 @@ int main (int argc, char **argv)
j = IOreadAttributeInfo (infile, attrName, &attrNumberType, &attrLen);
if (j < 0)
{
+ iteration = 0;
fprintf (stderr, "Cannot find iteration attribute of dataset %d, "
- "skipping ...\n", i);
- continue;
+ "using default iteration number 0 ...\n", i);
}
- if (IOreadAttribute (infile, j, &iteration) < 0)
+ else if (IOreadAttribute (infile, j, &iteration) < 0)
{
fprintf (stderr, "Cannot read iteration attribute of dataset %d, "
"skipping ...\n", i);
@@ -145,10 +145,10 @@ int main (int argc, char **argv)
j = IOreadAttributeInfo (infile, attrName, &attrNumberType, &attrLen);
if (j < 0)
{
+ timelevel = 0;
fprintf (stderr, "Cannot find timelevel attribute of dataset %d,\n"
"assuming Cactus 3.x dataset with implicite timelevel 0 "
"...\n", i);
- timelevel = 0;
}
else if (IOreadAttribute (infile, j, &timelevel) < 0)
{