aboutsummaryrefslogtreecommitdiff
path: root/src/Output.c
diff options
context:
space:
mode:
authortradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a>2002-05-28 14:56:04 +0000
committertradke <tradke@ebee0441-1374-4afa-a3b5-247f3ba15b9a>2002-05-28 14:56:04 +0000
commit0a49e670920c838a1d5dae66073eebdda3931ada (patch)
tree855d64a51c0857d1dc78ed7751696f0e270c17ff /src/Output.c
parentcb9c627a662b3f77d9dbc61a413165f67ac8ec13 (diff)
Allow the 'out_every' option in option strings to set the output frequency
for individual variables. Allow hyperslab options 'origin', 'direction', 'extent', and 'downsample' in option strings to specify hyperslab selections for individual variables. You also need to update CactusBase/IOUtil now. See the thornguide for a description and an example. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOFlexIO/trunk@249 ebee0441-1374-4afa-a3b5-247f3ba15b9a
Diffstat (limited to 'src/Output.c')
-rw-r--r--src/Output.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/Output.c b/src/Output.c
index e74949d..4a6178d 100644
--- a/src/Output.c
+++ b/src/Output.c
@@ -130,7 +130,8 @@ int IOFlexIO_OutputVarAs (const cGH *GH, const char *fullname, const char*alias)
oneshot = myGH->requests[vindex] == NULL;
if (oneshot)
{
- IOUtil_ParseVarsForOutput (GH, fullname, myGH->requests);
+ IOUtil_ParseVarsForOutput (GH, CCTK_THORNSTRING, "IOFlexIO::out_vars",
+ fullname, 1, myGH->requests);
}
/* do the output */
@@ -184,8 +185,8 @@ int IOFlexIO_TimeFor (const cGH *GH, int vindex)
/* check if this variable should be output */
myGH = (const flexioGH *) CCTK_GHExtension (GH, "IOFlexIO");
- retval = myGH->out_every_default > 0 && myGH->requests[vindex] &&
- GH->cctk_iteration % myGH->out_every_default == 0;
+ retval = myGH->requests[vindex] && myGH->requests[vindex]->out_every > 0 &&
+ GH->cctk_iteration % myGH->requests[vindex]->out_every == 0;
if (retval)
{
/* check if variable was not already output this iteration */
@@ -282,7 +283,7 @@ int IOFlexIO_TriggerOutput (const cGH *GH, int vindex)
@@*/
static void CheckSteerableParameters (const cGH *GH)
{
- int i, num_vars;
+ int i, vindex, num_vars;
flexioGH *myGH;
char *fullname, *msg;
DECLARE_CCTK_PARAMETERS
@@ -310,7 +311,9 @@ static void CheckSteerableParameters (const cGH *GH)
/* re-parse the 'IOFlexIO::out_vars' parameter if it was changed */
if (strcmp (out_vars, myGH->out_vars) || myGH->out_every_default != i)
{
- IOUtil_ParseVarsForOutput (GH, out_vars, myGH->requests);
+ IOUtil_ParseVarsForOutput (GH, CCTK_THORNSTRING, "IOFlexIO::out_vars",
+ out_vars, myGH->out_every_default,
+ myGH->requests);
/*** FIXME: IEEEIO doesn't provide a COMPLEX datatype
so we should map CCTK_COMPLEX to two REALs here.
@@ -318,28 +321,29 @@ static void CheckSteerableParameters (const cGH *GH)
is created and nothing is written to it, it will crash
at re-opening. ***/
num_vars = CCTK_NumVars ();
- for (i = 0; i < num_vars; i++)
+ for (vindex = 0; vindex < num_vars; vindex++)
{
- if (myGH->requests[i] && strncmp (CCTK_VarTypeName (CCTK_VarTypeI (i)),
- "CCTK_VARIABLE_COMPLEX", 21) == 0)
+ if (myGH->requests[vindex] &&
+ strncmp (CCTK_VarTypeName (CCTK_VarTypeI (vindex)),
+ "CCTK_VARIABLE_COMPLEX", 21) == 0)
{
- fullname = CCTK_FullName (i);
+ fullname = CCTK_FullName (vindex);
CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
"IOFlexIO output for complex variable '%s' not yet "
"supported", fullname);
free (fullname);
- IOUtil_FreeIORequest (&myGH->requests[i]);
+ IOUtil_FreeIORequest (&myGH->requests[vindex]);
}
}
if (myGH->out_every_default == i || ! CCTK_Equals (verbose, "none"))
{
msg = NULL;
- for (i = 0; i < num_vars; i++)
+ for (vindex = 0; vindex < num_vars; vindex++)
{
- if (myGH->requests[i])
+ if (myGH->requests[vindex])
{
- fullname = CCTK_FullName (i);
+ fullname = CCTK_FullName (vindex);
if (! msg)
{
Util_asprintf (&msg, "IOFlexIO: Periodic output requested for '%s'",