aboutsummaryrefslogtreecommitdiff
path: root/src/Write.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Write.c')
-rw-r--r--src/Write.c47
1 files changed, 27 insertions, 20 deletions
diff --git a/src/Write.c b/src/Write.c
index c160321..a0c8d2d 100644
--- a/src/Write.c
+++ b/src/Write.c
@@ -24,12 +24,12 @@ static char *rcsid = "$Id$";
CCTK_FILEVERSION(AlphaThorns_IOHDF5_Write_c)
-/* local function prototypes */
+/* prototypes of routines defined in this source file */
static char *IOHDF5_GetFilename (cGH *GH,
- int index,
- ioHDF5Geo_t *slab,
- const char *name,
- int *is_new_file);
+ int vindex,
+ ioHDF5Geo_t *slab,
+ const char *name,
+ int *is_new_file);
/*@@
@@ -48,7 +48,7 @@ static char *IOHDF5_GetFilename (cGH *GH,
@vtype cGH *
@vio in
@endvar
- @var index
+ @var vindex
@vdesc index of variable
@vtype int
@vio in
@@ -60,7 +60,7 @@ static char *IOHDF5_GetFilename (cGH *GH,
@endvar
@@*/
void IOHDF5_Write (cGH *GH,
- int index,
+ int vindex,
const char *alias)
{
DECLARE_CCTK_PARAMETERS
@@ -78,9 +78,9 @@ void IOHDF5_Write (cGH *GH,
myGH = (ioHDF5GH *) CCTK_GHExtension (GH, "IOHDF5");
/* check if variable has storage assigned */
- if (! CCTK_QueryGroupStorageI (GH, CCTK_GroupIndexFromVarI (index)))
+ if (! CCTK_QueryGroupStorageI (GH, CCTK_GroupIndexFromVarI (vindex)))
{
- fullname = CCTK_FullName (index);
+ fullname = CCTK_FullName (vindex);
CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
"No IOHDF5 output for '%s' (no storage)", fullname);
free (fullname);
@@ -88,11 +88,11 @@ void IOHDF5_Write (cGH *GH,
}
/* get the filename for output */
- filename = IOHDF5_GetFilename (GH, index, &myGH->out_geo[index],
- alias, &is_new_file);
+ filename = IOHDF5_GetFilename (GH, vindex, myGH->out_geo[vindex],
+ alias, &is_new_file);
if (! filename)
{
- fullname = CCTK_FullName (index);
+ fullname = CCTK_FullName (vindex);
CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
"Unable to construct file name for '%s'", fullname);
free (fullname);
@@ -142,7 +142,7 @@ void IOHDF5_Write (cGH *GH,
}
/* get the current timelevel */
- timelevel = CCTK_NumTimeLevelsFromVarI (index) - 1;
+ timelevel = CCTK_NumTimeLevelsFromVarI (vindex) - 1;
if (timelevel > 0)
{
timelevel--;
@@ -162,8 +162,8 @@ void IOHDF5_Write (cGH *GH,
}
/* output the data */
- IOHDF5Util_DumpVar (GH, index, timelevel, &myGH->out_geo[index], file,
- myGH->check_exisiting_objects[index]);
+ IOHDF5Util_DumpVar (GH, vindex, timelevel, myGH->out_geo[vindex], file,
+ myGH->check_exisiting_objects[vindex]);
/* close the file */
if (file >= 0)
@@ -202,7 +202,7 @@ void IOHDF5_Write (cGH *GH,
@vtype cGH *
@vio in
@endvar
- @var index
+ @var vindex
@vdesc index of variable to output
@vtype int
@vio in
@@ -229,7 +229,7 @@ void IOHDF5_Write (cGH *GH,
@endreturndesc
@@*/
static char *IOHDF5_GetFilename (cGH *GH,
- int index,
+ int vindex,
ioHDF5Geo_t *slab,
const char *varname,
int *is_new_file)
@@ -243,11 +243,13 @@ static char *IOHDF5_GetFilename (cGH *GH,
/* FIXME: make these strings dynamic */
char extra[256]; /* Extra stuff in fname based on mode */
char extradir[256]; /* Extra stuff for an output dir */
- char *extrageo; /* Extra stuff for geometry information */
char *filename; /* the return value */
int result;
char *outputdir;
+#if 0
int idim;
+ char *extrageo; /* Extra stuff for geometry information */
+#endif
char name[128];
@@ -257,6 +259,8 @@ static char *IOHDF5_GetFilename (cGH *GH,
myGH = (ioHDF5GH *) CCTK_GHExtension (GH, "IOHDF5");
h5UtilGH = (ioHDF5UtilGH *) CCTK_GHExtension (GH, "IOHDF5Util");
+#if 0
+ /*** FIXME: use new filenaming scheme ***/
/* To identify the slab in a volume (if sdim<vdim)
build a string like: "012" (3d volume, spanned by xyz)
or "12" (2d volume, spanned by yz(!) and append this to the name:
@@ -280,6 +284,9 @@ static char *IOHDF5_GetFilename (cGH *GH,
varname, slab->sdim,slab->vdim);
return(NULL);
}
+#else
+ strcpy (name, varname);
+#endif
filename = (char *) GetNamedData (myGH->open_output_files, name);
if (filename != NULL)
@@ -294,7 +301,7 @@ static char *IOHDF5_GetFilename (cGH *GH,
myproc = CCTK_MyProc (GH);
- if (out2D_septimefiles)
+ if (out3D_septimefiles)
{
char *tmp = extra;
@@ -379,7 +386,7 @@ static char *IOHDF5_GetFilename (cGH *GH,
h5UtilGH->print_error_fn_arg));
if (! *is_new_file)
{
- myGH->check_exisiting_objects[index] = 1;
+ myGH->check_exisiting_objects[vindex] = 1;
}
}
else