#ifndef __IONIO_H__ #define __IONIO_H__ #include "SimulationManager.h" class ION; #ifdef LC_UNSC #define IONDUMP_CLOSE iondump_close_ #define IONTAKE_CLOSE iontake_close_ #define ION_OPEN_WRITE_HDF ion_open_write_hdf_ #define ION_OPEN_READ_HDF ion_open_read_hdf_ #define ION2D_DUMP_VAR ion2d_dump_var_ #define ION2D_TAKE_VAR ion2d_take_var_ #define FLOP_Y flop_y_ #define UNFLOP_Y unflop_y_ #elif LC_NOUNSC #define IONDUMP_CLOSE iondump_close #define IONTAKE_CLOSE iontake_close #define ION_OPEN_WRITE_HDF ion_open_write_hdf #define ION_OPEN_READ_HDF ion_open_read_hdf #define ION2D_DUMP_VAR ion2d_dump_var #define ION2D_TAKE_VAR ion2d_take_var #define FLOP_Y flop_y #define UNFLOP_Y unflop_y #endif #define fcharred(A) A /// Defined in iondump-para.F extern "C" int ION_OPEN_WRITE_HDF(char*, char *, char *, double *, int *, double *); /// Defined in iontake-para.F extern "C" int ION_OPEN_READ_HDF(char*, char *, char *, double *, int *, double *); /// Defined in iondump-para.F extern "C" int ION2D_DUMP_VAR(char *, FLoaT *, int *, int *, int *, double *); /// Defined in iontake-para.F extern "C" int ION2D_TAKE_VAR(char *, FLoaT *, int *, int *, int *, double *); /// Defined in iondump-para.F extern "C" int IONDUMP_CLOSE(); /// Defined in iontake-para.F extern "C" int IONTAKE_CLOSE(); /// Defined in curinterp.F extern "C" void FLOP_Y(); /// Defined in curinterp.F extern "C" void UNFLOP_Y(); /// Abstract Base Class for the LFM Ionosphere /** * Abstract base class for managing LFM Ionosphere input/output * (I/O). Timestep managment is handled by the MHDManager class, * which must be instantiated in order for the IonIO class to work. * * The protected members of this class wrap FORTRAN HDF I/O routines * * @note - IonIO should not be confused with the ION class, * which is the C++ interface to FORTRAN ionosphere data structures. * * @seealso SimulationManager, MHDManager, UTIonIO, TimestepIonIO */ class IonIO : public SimulationManager { public: /// Write data for a single timestep to file virtual int dump_step(char *base, ION *ion) = 0; /// Read data for a single timestep from file virtual int read_step(char *base, ION *ion) = 0; protected: bool open_write_hdf(char *prefix, char *suffix_1, char *suffix_2, double *mjd, int *iStep, double *Time); bool write_data(ION *ion, int *iStep, double *Time); bool open_read_hdf(char *prefix, char *suffix_1, char *suffix_2, double *mjd, int *iStep, double *Time); bool read_data(ION *ion, int *iStep, double *Time); bool close_hdf(void); private: }; #endif