int xfCreateMultiDatasetsGroup(xid ParentId, const char *Path, const char *Guid); int xfGetGroupPathsSizeForMultiDatasets(xid FileId, int *Num, int *MaxSize); int xfGetAllGroupPathsForMultiDatasets(xid FileId, int Num, int Maxsize, char *path); int xfGetDatasetsSdoGuid(xid MultiDatasetsGroup, char *GUID);
SUBROUTINE XF_CREATE_MULTI_DATASETS_GROUP(ParentId, Path, Guid, Error) INTEGER(XID), INTENT(IN) :: ParentId CHARACTER(LEN=*), INTENT(IN) :: Path, Guid INTEGER, INTENT(OUT) :: Error SUBROUTINE XF_GET_GRP_PTHS_SZ_MLT_DSETS (FileId, Num, Maxsize, Error) INTEGER(XID), INTENT(IN) :: FileId INTEGER, INTENT(OUT) :: Num, Maxsize, Error SUBROUTINE XF_GET_ALL_GRP_PATHS_MLT_DSETS (FileId, Num, Size, Paths, Error) INTEGER(XID), INTENT(IN) :: FileId INTEGER, INTENT(IN) :: Num, Size CHARACTER(len=Size), DIMENSION(Size, Num), INTENT(INOUT) :: Paths INTEGER, INTENT(OUT) :: Error SUBROUTINE XF_GET_DATASETS_SDO_GUID(MultiDatasetsGroup, Guid) INTEGER(XID), INTENT(IN) :: ParentId CHARACTER(LEN=XF_GUID_STRINGLENGTH), INTENT(OUT) :: Guid INTEGER, INTENT(OUT) :: Error
int xfOpenMultiDatasetsGroup(xid GridGroupId, xid *DatasetsGroupId);
SUBROUTINE XF_OPEN_MULTI_DATASETS_GROUP(GridGroupId, DatasetsGroupId, Error) INTEGER(XID), INTENT(IN) :: GroupId INTEGER(XID), INTENT(OUT):: DatasetsGroupId INTEGER, INTENT(OUT) :: Error
The arguments for xfSetupToWriteDatasets should be given to the model using an external text file or command line arguments. The arguments include the filename to save the datasets, the path to a special group called the multi-datasets group path, the path to start writing datasets in this path, the GUID for the spatial data object that all the datasets will be tied to, and the overwrite options. The overwrite options are listed below by number and the corresponding C/FORTRAN constant (either the number or the constant may be used).
int xfSetupToWriteDatasets(const char *Filename, const char *MultiDatasetsGroupPath, const char *PathInMultiDatasetsGroup, const char *SpatialDataObjectGuid, int OverwriteOptions, xid *FileId, xid *GroupId);
SUBROUTINE XF_SETUP_TO_WRITE_DATASETS (Filename, MultiDatasetsGroupPath, PathInMultiDatasetsGroup, SpatialDataObjectGuid, FileId, GroupId, Error) INTEGER(XID), INTENT(IN) :: GroupId CHARACTER(len=*), INTENT(IN) :: Filename, MultiDatasetsGroupPath CHARACTER(len=*), INTENT(IN) :: PathInMultiDatasetsGroup, SpatialDataObjectGuid INTEGER(XID), INTENT(OUT) :: FileId, GroupId INTEGER, INTENT(OUT) :: Error
Valid time units are identified using the constants TS_DAYS, TS_HOURS, TS_MINUTES, TS_SECONDS, or TS_NOTAPPLICABLE. The compression value is applied to all arrays in the data set.
int xfCreateScalarDataset(xid DatasetGroupId, const char *Path, const char *Units, const char *TimeUnits, int Compression, xid *DatasetId); int xfCreateVectorDataset(xid DatasetGroupId, const char *Path, const char *Units, const char *TimeUnits, int Compression, xid *DatasetId);
SUBROUTINE XF_CREATE_SCALAR_DATASET(DatasetsGroupId, Path, Units, TimeUnits, Compression, DatasetId, Error) INTEGER(XID), INTENT(IN) :: DatasetsGroupId CHARACTER(len=*), INTENT(IN) :: Path, Units, TimeUnits INTEGER, INTENT(IN) :: Compression INTEGER(XID), INTENT(OUT) :: DatasetId INTEGER, INTENT(OUT) :: Error SUBROUTINE XF_CREATE_VECTOR_DATASET(DatasetsGroupId, Path, Units, TimeUnits, Compression, DatasetId, Error) INTEGER(XID), INTENT(IN) :: DatasetsGroupId CHARACTER(len=*), INTENT(IN) :: Path, Units, TimeUnits INTEGER, INTENT(IN) :: Compression INTEGER(XID), INTENT(OUT) :: DatasetId INTEGER, INTENT(OUT) :: Error
int xfCalendarToJulian (xbool a_bBceEra, int a_yr, int a_mo, int a_day, int a_hr, int a_min, int a_sec, double *a_julian); int xfJulianToCalendar (xbool *a_bBceEra, int *a_yr, int *a_mo, int *a_day, int *a_hr, int *a_min, int *a_sec, double a_julian);
SUBROUTINE XF_CALENDAR_TO_JULIAN (era, yr, mo, day, hr, & min, sec, julian, error) INTEGER, INTENT(IN) :: era INTEGER, INTENT(IN) :: yr INTEGER, INTENT(IN) :: mo INTEGER, INTENT(IN) :: day INTEGER, INTENT(IN) :: hr INTEGER, INTENT(IN) :: min INTEGER, INTENT(IN) :: sec REAL(DOUBLE), INTENT(OUT) :: julian INTEGER, INTENT(OUT) :: error SUBROUTINE XF_JULIAN_TO_CALENDAR (era, yr, mo, day, hr, & min, sec, julian, error) INTEGER, INTENT(OUT) :: era INTEGER, INTENT(OUT) :: yr INTEGER, INTENT(OUT) :: mo INTEGER, INTENT(OUT) :: day INTEGER, INTENT(OUT) :: hr INTEGER, INTENT(OUT) :: min INTEGER, INTENT(OUT) :: sec REAL(DOUBLE), INTENT(IN) :: julian INTEGER, INTENT(OUT) :: error
int xfDatasetReftime(xid DatasetId, double Reftime);
SUBROUTINE XF_DATASET_REFTIME(DatasetId, Reftime, Error) INTEGER(XID), INTENT(IN) :: DatasetsGroupId REAL(DOUBLE), INTENT(IN) :: Reftime INTEGER, INTENT(OUT) :: Error
XMDF stores the minimum and maximum values for each timestep in the data set. The minimum and maximum values can be specified or they are determined automatically from the values arrays. For vector data sets the minimum and maximum values are the minimum and maximum values for vector magnitudes.
int xfWriteScalarTimestep(xid DatasetId, double Time, int NumValues, float *Values); int xfWriteScalarTimestepMinMax(xid DatasetId, double Time, int NumValues, float *Values, float Min, float Max); int xfWriteVectorTimestep(xid DatasetId, double Time, int NumValues, int NumComponents, float *Values); int xfWriteVectorTimestepMinMax(xid DatasetId, double Time, int NumValues, int NumComponents, float *Values, float Min, float Max);
SUBROUTINE XF_WRITE_SCALAR_TIMESTEP(DatasetId, Time, NumValues, Values, Error) INTEGER(XID), INTENT(IN) :: DatasetId REAL(DOUBLE), INTENT(IN) :: Time INTEGER, INTENT(IN) :: NumValues REAL, DIMESNION(NumValues), INTENT(IN) :: Values INTEGER, INTENT(OUT) :: Error SUBROUTINE XF_WRITE_SCALAR_TS_MIN_MAX (DatasetId, Time, NumValues, Values, Min, Max, Error) INTEGER(XID), INTENT(IN) :: DatasetId REAL(DOUBLE), INTENT(IN) :: Time INTEGER, INTENT(IN) :: NumValues REAL, DIMENSION(NumValues), INTENT(IN) :: Values REAL, INTENT(IN) :: Min, Max INTEGER, INTENT(OUT) :: Error SUBROUTINE XF_WRITE_VECTOR_TIMESTEP(DatasetId, Time, NumValues, Values, Error) INTEGER(XID), INTENT(IN) :: DatasetId REAL(DOUBLE), INTENT(IN) :: Time INTEGER, INTENT(IN) :: NumValues REAL, DIMESNION(NumComponents, NumValues), INTENT(IN) :: Values INTEGER, INTENT(OUT) :: Error SUBROUTINE XF_WRITE_VECTOR_TS_MIN_MAX (DatasetId, Time, NumValues, Values, Min,Max, Error) INTEGER(XID), INTENT(IN) :: DatasetId REAL(DOUBLE), INTENT(IN) :: Time INTEGER, INTENT(IN) :: NumValues REAL, DIMENSION(NumComponents, NumValues), INTENT(IN) :: Values REAL, INTENT(IN) :: Min, Max INTEGER, INTENT(OUT) :: Error
int xfWriteActivityTimestep(xid DatasetId, int NumActiveVals, xbool *Active);
SUBROUTINE XF_WRITE_ACTIVITY_TIMESTEP(DatasetId, NumActiveVals, ActiveVals, Error) INTEGER(XID), INTENT(IN) :: DatasetId INTEGER, INTENT(IN) :: NumActiveVals INTEGER, DIMENSION(NumActiveVals), INTENT(IN) :: ActiveVals INTEGER, INTENT(OUT) :: Error
int xfInitializeScalarTimestep(xid xScalarAId, double dTime, int nValues, float minvalue, float maxvalue, int *timestepId); int xfWriteScalarTimestepPortion(xid xScalarAId, int timestepId, int numValuesToWrite, int startIndex, const float *a_values); int xfInitializeVectorTimestep(xid a_Id, double dTime, int nValues, int nComponents, float minvalue, float maxvalue, int *timestepId); int xfWriteVectorTimestepPortion(xid a_Id, int timestepId, int numValuesToWrite, int nComponentsToWrite, int startIndex, int startComponent, const float *a_values); int xfInitializeActivityTimestep (xid a_Id, int a_NumActive, int *a_timestepId); int xfWriteActivityTimestepPortion(xid a_Id, int a_timestepId, int a_NumValuesToWrite, int a_startIndex, const unsigned char *a_activityValues);
SUBROUTINE XF_INITIALIZE_SCALAR_TIMESTEP (a_Id, a_Time, a_NumValues, a_Minimum,& a_Maximum, a_timestepId, error) INTEGER, INTENT(IN) :: a_Id REAL*8, INTENT(IN) :: a_Time INTEGER, INTENT(IN) :: a_NumValues REAL*4, INTENT(IN) :: a_Minimum, a_Maximum INTEGER, INTENT(OUT) :: a_timestepId INTEGER, INTENT(OUT) :: error SUBROUTINE XF_WRITE_SCALAR_TIMESTEP_PORTION (a_Id, a_timeStepId, & a_NumValuesToWrite, a_startIndex, a_Values, error) INTEGER, INTENT(IN) :: a_Id INTEGER, INTENT(IN) :: a_timeStepId INTEGER, INTENT(IN) :: a_NumValuesToWrite INTEGER, INTENT(IN) :: a_startIndex REAL*4, DIMENSION(*), INTENT(IN) :: a_Values INTEGER, INTENT(OUT) :: error SUBROUTINE XF_INITIALIZE_VECTOR_TIMESTEP(a_Id, a_Time, a_NumValues, a_NumComponents, & a_Minimum, a_Maximum, timeId, error) INTEGER, INTENT(IN) :: a_Id REAL*8, INTENT(IN) :: a_Time INTEGER, INTENT(IN) :: a_NumValues, a_NumComponents REAL*4, INTENT(IN) :: a_Minimum, a_Maximum INTEGER, INTENT(OUT) :: timeId INTEGER, INTENT(OUT) :: error SUBROUTINE XF_WRITE_VECTOR_TIMESTEP_PORTION(a_Id, a_TimeId, a_NumValuesToWrite, & a_NumComponentsToWrite, a_startIndex, a_startComponent, a_Values, error) INTEGER, INTENT(IN) :: a_Id INTEGER, INTENT(IN) :: a_TimeId INTEGER, INTENT(IN) :: a_NumValuesToWrite, a_NumComponentsToWrite INTEGER, INTENT(IN) :: a_startIndex, a_startComponent REAL*4, DIMENSION(*), INTENT(IN) :: a_Values INTEGER, INTENT(OUT) :: error SUBROUTINE XF_INITIALIZE_ACTIVITY_TIMESTEP (a_Id, a_NumActive, a_timestepId, error) INTEGER, INTENT(IN) :: a_Id INTEGER, INTENT(IN) :: a_NumActive INTEGER, INTENT(OUT) :: a_timestepId INTEGER, INTENT(OUT) :: error SUBROUTINE XF_WRITE_ACTIVITY_TIMESTEP_PORTION (a_Id, a_timeStepId, & a_NumValuesToWrite, a_startIndex, a_ActiveValues, error) INTEGER, INTENT(IN) :: a_Id INTEGER, INTENT(IN) :: a_timeStepId INTEGER, INTENT(IN) :: a_NumValuesToWrite INTEGER, INTENT(IN) :: a_startIndex INTEGER*1, dimension(*), INTENT(IN) :: a_ActiveValues INTEGER, INTENT(OUT) :: error
int xfSetDatasetNumTimes(xid DatasetId, int NumTimes);
SUBROUTINE XF_SET_DATASET_NUM_TIMES(DatasetsId, NumTimes, Error)INTEGER(XID), INTEGER(XID), INTENT(IN) :: DatasetsId INTEGER), INTENT(IN) :: NumTimes INTEGER, INTENT(OUT) :: Error
SUBROUTINE XF_GET_DATASET_GROUP_ID(EntityId, DatasetsGroupId, Error) INTEGER(XID), INTENT(IN) :: EntityId INTEGER(XID), INTENT(OUT) :: DatasetsGroupId INTEGER, INTENT(OUT) :: Error
int xfGetScalarDatasetsInfo(xid DatasetsId, int *Number, int *MaxPathLength);
SUBROUTINE XF_GET_SCALAR_DATASETS_INFO(DatasetsId, Number, MaxPathLength, Error) INTEGER(XID), INTENT(IN) :: DatasetsId INTEGER, INTENT(OUT) :: Number, MaxPathLength INTEGER, INTENT(OUT) :: Error
int xfGetScalarDatasetPaths(xid DatasetsId, NumDatasets, MaxPathLength, char *Paths);
SUBROUTINE XF_GET_SCALAR_DATASET_PATHS(DatasetsId, NumDatasets, MaxPathLength, Paths, Error) INTEGER(XID), INTENT(IN) :: DatasetsId INTEGER, INTENT(IN) :: NumDatasets, MaxPathLength CHARACTER(len=MaxPathLength), DIMENSION(NumDatasets) :: Paths INTEGER, INTENT(OUT) :: Error
int xfGetVectorDatasetsInfo(xid DatasetsId, int *Number, int *MaxPathLength); int xfGetVectorDatasetPaths(xid DatasetsId, int NumDatasets, int MaxPathLength, char *Paths);
SUBROUTINE XF_GET_VECTOR_DATASETS_INFO(DatasetsId, Number, MaxPathLength, Error) INTEGER(XID), INTENT(IN) :: DatasetsId INTEGER, INTENT(OUT) :: Number, MaxPathLength INTEGER, INTENT(OUT) :: Error SUBROUTINE XF_GET_VECTOR_DATASET_PATHS(DatasetsId, NumDatasets, MaxPathLength, Paths, Error) INTEGER(XID), INTENT(IN) :: DatasetsId INTEGER, INTENT(IN) :: NumDatasets, MaxPathLength CHARACTER(len=MaxPathLength), DIMENSION(NumDatasets) :: Paths INTEGER, INTENT(OUT) :: Error
int xfGetDatasetUnits(xid DatasetId, char *Units);
SUBROUTINE XF_GET_DATASET_UNITS(DatasetsId, Units, Error) INTEGER(XID), INTENT(IN) :: DatasetsId CHARACTER(len=100), INTENT(OUT) :: Units INTEGER, INTENT(OUT) :: Error
int xfGetDatasetReftime(xid DatasetId, double *Reftime); int xfGetDatasetNumTimes(xid DatasetId, int *NumTimes); int xfGetDatasetTimeUnits(xid DatasetId, UnitType *Units);
SUBROUTINE XF_GET_DATASET_REFTIME(DatasetsId, Reftime, Error) INTEGER(XID), INTENT(IN) :: DatasetsId REAL(DOUBLE), INTENT(OUT) :: Reftime INTEGER, INTENT(OUT) :: Error SUBROUTINE XF_GET_DATASET_NUMTIMES(DatasetsId, NumTimes, Error) INTEGER(XID), INTENT(IN) :: DatasetsId INTEGER), INTENT(OUT) :: NumTimes INTEGER, INTENT(OUT) :: Error SUBROUTINE XF_GET_DATASET_REFTIME(DatasetsId, Units, Error) INTEGER(XID), INTENT(IN) :: DatasetsId CHARACTER(len=100), INTENT(OUT) :: Units INTEGER, INTENT(OUT) :: Error
int xfReadDatasetTimes(xid DatasetId, int NumTimes, double *Times);
SUBROUTINE XF_READ_DATASET_TIMES(DatasetsId, NumTimes, Times, Error) INTEGER(XID), INTENT(IN) :: DatasetsId INTEGER, INTENT(IN) :: NumTimes REAL(DOUBLE), DIMENSION(NumTimes), INTENT(OUT) :: Times INTEGER, INTENT(OUT) :: Error
int xfGetDatasetMins(xid DatasetId, int a_NumTimes, float *Mins); int xfGetDatasetMaxs(xid DatasetId, int a_NumTimes, float *Maxs);
SUBROUTINE XF_GET_DATASET_MINS(DatasetsId, NumTimes, Mins, Error) INTEGER(XID), INTENT(IN) :: DatasetsId INTEGER, INTENT(IN) :: NumTimes REAL(DOUBLE), DIMENSION(NumTimes), INTENT(OUT) :: Mins INTEGER, INTENT(OUT) :: Error SUBROUTINE XF_GET_DATASET_MINS(DatasetsId, NumTimes, Maxs, Error) INTEGER(XID), INTENT(IN) :: DatasetsId INTEGER, INTENT(IN) :: NumTimes REAL(DOUBLE), DIMENSION(NumTimes), INTENT(OUT) :: Maxs INTEGER, INTENT(OUT) :: Error The following function is used to determine the number of values in each time step of a data set.
int xfGetDatasetNumVals(xid DatasetId, int *NumVals);
SUBROUTINE XF_GET_DATASET_NUM_VALS(DatasetsId, NumVals, Error) INTEGER(XID), INTENT(IN) :: DatasetsId INTEGER, INTENT(OUT) :: NumVals INTEGER, INTENT(OUT) :: Error
int xfGetDatasetNumActive(xid DatasetId, int *NumActiveVals);
SUBROUTINE XF_GET_DATASET_NUM_ACTIVE_VALS(DatasetsId, NumActiveVals, Error) INTEGER(XID), INTENT(IN) :: DatasetsId INTEGER, INTENT(OUT) :: NumActiveVals INTEGER, INTENT(OUT) :: Error
int xfReadActivityTimestep(xid DatasetId, int Timestep, int NumActive, xbool *Active);
SUBROUTINE XF_READ_ACTIVITY_TIMESTEP(DatasetsId, Timestep, NumActive, Active, Error) INTEGER(XID), INTENT(IN) :: DatasetsId INTEGER, INTENT(IN) :: Timestep, NumActive INTEGER, DIMENSION(NumActive), INTENT(OUT) :: Active INTEGER, INTENT(OUT) :: Error
int xfReadScalarValuesTimestep(xid DatasetId, int Timestep, int NumVals, float *Values); int xfReadVectorValuesTimestep(xid DatasetId, int Timestep, int NumVals, int NumComponents, float *Values);
SUBROUTINE XF_READ_SCALAR_VALUES_TIMESTEP(DatasetsId, Timestep, NumVals, Vals, Error) INTEGER(XID), INTENT(IN) :: DatasetsId INTEGER, INTENT(IN) :: Timestep, NumVals REAL, DIMENSION(NumVals), INTENT(OUT) :: Vals INTEGER, INTENT(OUT) :: Error SUBROUTINE XF_READ_VECTOR_VALUES_TIMESTEP(DatasetsId, Timestep, NumVals, NumComponents, Vals, Error) INTEGER(XID), INTENT(IN) :: DatasetsId INTEGER, INTENT(IN) :: Timestep, NumVals, NumComponents REAL, DIMENSION(NumVals), INTENT(OUT) :: Vals INTEGER, INTENT(OUT) :: Error
int xfReadScalarValuesAtIndex(xid DatasetId, int Index, int FirstTimestep, int NumTimesteps, float *Values); int xfReadVectorValuesAtIndex(xid DatasetId, int Index, int FirstTimestep, int NumTimesteps, int NumComponents, float *Values);
SUBROUTINE XF_READ_SCALAR_VALUES_AT_INDEX(DatasetsId, Index, FirstTimestep, NumTimesteps, Values, Error) INTEGER(XID), INTENT(IN) :: DatasetsId INTEGER, INTENT(IN) :: Index, FirstTimestep, NumTimesteps REAL, DIMENSION(NumTimesteps), INTENT(OUT) :: Values INTEGER, INTENT(OUT) :: Error SUBROUTINE XF_READ_VECTOR_VALUES_AT_INDEX(DatasetsId, Index, FirstTimestep, NumTimesteps, NumComponents, Values, Error) INTEGER(XID), INTENT(IN) :: DatasetsId INTEGER, INTENT(IN) :: Index, FirstTimestep, NumTimesteps REAL, DIMENSION(NumTimesteps, NumComponents), INTENT(OUT) :: Values INTEGER, INTENT(OUT) :: Error
int xfReadActivityValuesAtIndex(xid DatasetId, int Index, int FirstTimestep, int NumTimesteps, xbool *Activity);
SUBROUTINE XF_READ_ACTIVE_VALS_AT_INDEX (DatasetsId, Index, FirstTimestep, NumTimesteps, Activity, Error) INTEGER(XID), INTENT(IN) :: DatasetsId INTEGER, INTENT(IN) :: Index, FirstTimestep, NumTimesteps INTEGER, DIMENSION(NumTimesteps), INTENT(OUT) :: Activity INTEGER, INTENT(OUT) :: Error
The xfSetDatasetNumTimes function can be called after some number of timesteps have been written, i.e. after writing with any of the following xfWrite functions: xfWriteScalarTimestep, xfWriteScalarTimestepMinMax, xfWriteVectorTimestep, xfWriteVectorTimestepMinMax. For example, the xfSetDatasetNumTimes function, when called with an argument of 3, will delete all but the first 3 timesteps. Subsequent calls to the other xfWrite functions will append timesteps from the point of deletion.
If xfWriteActivityTimestep is to be called, then it must be called each time any of the other xfWrite functions are called. Failing to do this will cause the activity data to get out of sync with the rest of the timestep data.
int xfSetDatasetNumTimes(xid DatasetId, int NumTimes);
SUBROUTINE XF_SET_DATASET_NUMTIMES(DatasetsId, NumTimes, Error) INTEGER(XID), INTENT(IN) :: DatasetsId INTEGER), INTENT(IN) :: NumTimes INTEGER, INTENT(OUT) :: Error
int xfChangeScalarValuesTimestepFloat(xid a_Id, int a_TimestepIndex, int a_NumValsToEdit, int *a_Indices, float *a_NewValues)