From c974dad7f4fb853e82e62fddea12c23839ddf630 Mon Sep 17 00:00:00 2001 From: schnetter <> Date: Mon, 14 Jul 2003 13:41:00 +0000 Subject: Copy the HDF5 changes from CarpetIOFlexIO to this thorn. darcs-hash:20030714134108-07bb3-16cf289bbbcce29b28e5ce127f67624fd6e51896.gz --- CarpetAttic/CarpetIOFlexIOCheckpoint/README | 4 +- CarpetAttic/CarpetIOFlexIOCheckpoint/interface.ccl | 14 ++++++- .../src/checkpointrestart.cc | 29 +++++++------- .../CarpetIOFlexIOCheckpoint/src/ioflexio.cc | 45 ++++++++++++++-------- 4 files changed, 57 insertions(+), 35 deletions(-) (limited to 'CarpetAttic') diff --git a/CarpetAttic/CarpetIOFlexIOCheckpoint/README b/CarpetAttic/CarpetIOFlexIOCheckpoint/README index f45645401..d9385ccff 100644 --- a/CarpetAttic/CarpetIOFlexIOCheckpoint/README +++ b/CarpetAttic/CarpetIOFlexIOCheckpoint/README @@ -1,6 +1,6 @@ Cactus Code Thorn CarpetIOFlexIO -Authors : Erik Schnetter -CVS info : $Header: /home/eschnett/C/carpet/Carpet/CarpetAttic/CarpetIOFlexIOCheckpoint/README,v 1.1 2003/05/16 14:02:18 hawke Exp $ +Authors : Erik Schnetter , Christian Ott +CVS info : $Header: /home/eschnett/C/carpet/Carpet/CarpetAttic/CarpetIOFlexIOCheckpoint/README,v 1.2 2003/07/14 15:41:08 schnetter Exp $ -------------------------------------------------------------------------- Purpose of the thorn: diff --git a/CarpetAttic/CarpetIOFlexIOCheckpoint/interface.ccl b/CarpetAttic/CarpetIOFlexIOCheckpoint/interface.ccl index 48f2fee82..426624a49 100644 --- a/CarpetAttic/CarpetIOFlexIOCheckpoint/interface.ccl +++ b/CarpetAttic/CarpetIOFlexIOCheckpoint/interface.ccl @@ -1,9 +1,11 @@ # Interface definition for thorn CarpetIOFlexIO -# $Header: /home/eschnett/C/carpet/Carpet/CarpetAttic/CarpetIOFlexIOCheckpoint/interface.ccl,v 1.2 2003/06/18 18:28:07 schnetter Exp $ +# $Header: /home/eschnett/C/carpet/Carpet/CarpetAttic/CarpetIOFlexIOCheckpoint/interface.ccl,v 1.3 2003/07/14 15:41:08 schnetter Exp $ implements: IOFlexIO -inherits: CarpetLib driver Hyperslab +inherits: CarpetLib driver Hyperslab FlexIO + + uses include header: carpet.hh @@ -14,3 +16,11 @@ uses include header: data.hh uses include header: gdata.hh uses include header: ggf.hh + +# FlexIO header files +uses include header: IO.hh +uses include header: IEEEIO.hh +uses include header: HDFIO.hh +uses include header: H5IO.hh +uses include header: AMRwriter.hh +uses include header: AmrGridReader.hh diff --git a/CarpetAttic/CarpetIOFlexIOCheckpoint/src/checkpointrestart.cc b/CarpetAttic/CarpetIOFlexIOCheckpoint/src/checkpointrestart.cc index 93b08ef47..5836b194c 100644 --- a/CarpetAttic/CarpetIOFlexIOCheckpoint/src/checkpointrestart.cc +++ b/CarpetAttic/CarpetIOFlexIOCheckpoint/src/checkpointrestart.cc @@ -13,23 +13,24 @@ -#include -#include -#include -#include -#include -#include - -// Hack to stop FlexIO type clash - -#undef BYTE -#undef CHAR - - #include "cctk.h" #include "cctk_Parameters.h" #include "cctk_Version.h" +#include "AMRwriter.hh" +#include "AmrGridReader.hh" +#ifdef HDF4 +# include "HDFIO.hh" +#endif +#ifdef HDF5 +# include "H5IO.hh" +#endif +#include "IEEEIO.hh" +#include "IO.hh" + +// Hack to stop FlexIO type clash +#undef BYTE +#undef CHAR #include "CactusBase/IOUtil/src/ioGH.h" #include "CactusBase/IOUtil/src/ioutil_CheckpointRecovery.h" @@ -47,7 +48,7 @@ #include "ioflexio.hh" extern "C" { - static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/CarpetAttic/CarpetIOFlexIOCheckpoint/src/checkpointrestart.cc,v 1.4 2003/06/18 18:28:07 schnetter Exp $"; + static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/CarpetAttic/CarpetIOFlexIOCheckpoint/src/checkpointrestart.cc,v 1.5 2003/07/14 15:41:08 schnetter Exp $"; CCTK_FILEVERSION(Carpet_CarpetIOFlexIO_checkpointrestart_cc); } diff --git a/CarpetAttic/CarpetIOFlexIOCheckpoint/src/ioflexio.cc b/CarpetAttic/CarpetIOFlexIOCheckpoint/src/ioflexio.cc index fa572180d..c760012eb 100644 --- a/CarpetAttic/CarpetIOFlexIOCheckpoint/src/ioflexio.cc +++ b/CarpetAttic/CarpetIOFlexIOCheckpoint/src/ioflexio.cc @@ -13,23 +13,24 @@ -#include -#include -#include -#include -#include -#include +#include "cctk.h" +#include "cctk_Parameters.h" +#include "AMRwriter.hh" +#include "AmrGridReader.hh" +#ifdef HDF4 +# include "HDFIO.hh" +#endif +#ifdef HDF5 +# include "H5IO.hh" +#endif +#include "IEEEIO.hh" +#include "IO.hh" // Hack to stop FlexIO type clash - #undef BYTE #undef CHAR - -#include "cctk.h" -#include "cctk_Parameters.h" - #include "CactusBase/IOUtil/src/ioGH.h" #include "bbox.hh" @@ -43,7 +44,7 @@ #include "ioflexio.hh" extern "C" { - static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/CarpetAttic/CarpetIOFlexIOCheckpoint/src/ioflexio.cc,v 1.3 2003/06/18 18:28:07 schnetter Exp $"; + static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/CarpetAttic/CarpetIOFlexIOCheckpoint/src/ioflexio.cc,v 1.4 2003/07/14 15:41:08 schnetter Exp $"; CCTK_FILEVERSION(Carpet_CarpetIOFlexIO_ioflexio_cc); } @@ -339,9 +340,11 @@ namespace CarpetIOFlexIO { const char* extension = 0; if (CCTK_Equals(out3D_format, "IEEE")) { extension = ".raw"; -#ifdef HDF5 +#ifdef HDF4 } else if (CCTK_Equals(out3D_format, "HDF4")) { extension = ".hdf"; +#endif +#ifdef HDF5 } else if (CCTK_Equals(out3D_format, "HDF5")) { extension = ".h5"; #endif @@ -369,9 +372,11 @@ namespace CarpetIOFlexIO { writer = 0; if (CCTK_Equals(out3D_format, "IEEE")) { writer = new IEEEIO(filename, IObase::Create); -#ifdef HDF5 +#ifdef HDF4 } else if (CCTK_Equals(out3D_format, "HDF4")) { writer = new HDFIO(filename, IObase::Create); +#endif +#ifdef HDF5 } else if (CCTK_Equals(out3D_format, "HDF5")) { writer = new H5IO(filename, IObase::Create); #endif @@ -386,9 +391,11 @@ namespace CarpetIOFlexIO { // Open the file if (CCTK_Equals(out3D_format, "IEEE")) { writer = new IEEEIO(filename, IObase::Append); -#ifdef HDF5 +#ifdef HDF4 } else if (CCTK_Equals(out3D_format, "HDF4")) { writer = new HDFIO(filename, IObase::Append); +#endif +#ifdef HDF5 } else if (CCTK_Equals(out3D_format, "HDF5")) { writer = new H5IO(filename, IObase::Append); #endif @@ -522,9 +529,11 @@ namespace CarpetIOFlexIO { const char* extension = 0; if (CCTK_Equals(in3D_format, "IEEE")) { extension = ".raw"; -#ifdef HDF5 +#ifdef HDF4 } else if (CCTK_Equals(in3D_format, "HDF4")) { extension = ".hdf"; +#endif +#ifdef HDF5 } else if (CCTK_Equals(in3D_format, "HDF5")) { extension = ".h5"; #endif @@ -555,9 +564,11 @@ namespace CarpetIOFlexIO { if (verbose) CCTK_VInfo (CCTK_THORNSTRING, "Opening file \"%s\"", filename); if (CCTK_Equals(in3D_format, "IEEE")) { reader = new IEEEIO(filename, IObase::Read); -#ifdef HDF5 +#ifdef HDF4 } else if (CCTK_Equals(in3D_format, "HDF4")) { reader = new HDFIO(filename, IObase::Read); +#endif +#ifdef HDF5 } else if (CCTK_Equals(in3D_format, "HDF5")) { reader = new H5IO(filename, IObase::Read); #endif -- cgit v1.2.3