aboutsummaryrefslogtreecommitdiff
path: root/src/Output.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Output.c')
-rw-r--r--src/Output.c49
1 files changed, 16 insertions, 33 deletions
diff --git a/src/Output.c b/src/Output.c
index 467fd22..e18615d 100644
--- a/src/Output.c
+++ b/src/Output.c
@@ -23,7 +23,7 @@
/* the rcs ID and its dummy funtion to use it */
static const char *rcsid = "$Header$";
-CCTK_FILEVERSION(BetaThorns_IOPanda_Output_c)
+CCTK_FILEVERSION(CactusPUGHIO_IOPanda_Output_c)
/********************************************************************
@@ -46,9 +46,8 @@ static void AddChunkAttributes (const cGH *GH, const ioRequest *request,
Loops over all variables and outputs them if necessary
@enddesc
- @calls CheckSteerableParameters
- IOPanda_TimeFor
- IOPanda_OutputVarAs
+ @calls IOPanda_TimeFor
+ DumpVar
@var GH
@vdesc pointer to CCTK GH
@@ -65,42 +64,26 @@ static void AddChunkAttributes (const cGH *GH, const ioRequest *request,
int IOPanda_OutputGH (const cGH *GH)
{
int vindex, retval;
- pandaGH *myGH;
- char *fullname;
- const char *name;
- DECLARE_CCTK_PARAMETERS
-
+ const pandaGH *myGH;
- CheckSteerableParameters (GH);
- myGH = (pandaGH *) CCTK_GHExtension (GH, "IOPanda");
+ myGH = (const pandaGH *) CCTK_GHExtension (GH, "IOPanda");
if (myGH->out_every <= 0)
{
return (0);
}
+ retval = 0;
+
/* loop over all variables */
- for (vindex = retval = 0; vindex < CCTK_NumVars (); vindex++)
+ for (vindex = CCTK_NumVars () - 1; vindex >= 0; vindex--)
{
- if (IOPanda_TimeFor (GH, vindex))
+ if (IOPanda_TimeFor (GH, vindex) &&
+ DumpVar (GH, myGH->requests[vindex], CCTK_VarName (vindex)) == 0)
{
- name = CCTK_VarName (vindex);
- fullname = CCTK_FullName (vindex);
-
- if (verbose)
- {
- CCTK_VInfo (CCTK_THORNSTRING, "IOPanda_OutputGH: "
- "(fullname, name) = (%s, %s)", fullname, name);
- }
-
- if (IOPanda_OutputVarAs (GH, fullname, name) == 0)
- {
- /* register variable as having output this iteration */
- myGH->out_last[vindex] = GH->cctk_iteration;
- retval++;
- }
-
- free (fullname);
+ /* register variable as having output this iteration */
+ myGH->out_last[vindex] = GH->cctk_iteration;
+ retval++;
}
}
@@ -150,7 +133,7 @@ int IOPanda_OutputVarAs (const cGH *GH, const char *fullname, const char *alias)
vindex = CCTK_VarIndex (fullname);
- if (verbose)
+ if (CCTK_Equals (verbose, "full"))
{
CCTK_VInfo (CCTK_THORNSTRING, "IOPanda_OutputVarAs: (fullname, alias, "
"index) = (%s, %s, %d)", fullname, alias, vindex);
@@ -207,8 +190,8 @@ int IOPanda_OutputVarAs (const cGH *GH, const char *fullname, const char *alias)
int IOPanda_TimeFor (const cGH *GH, int vindex)
{
int retval;
- const pandaGH *myGH;
char *fullname;
+ const pandaGH *myGH;
CheckSteerableParameters (GH);
@@ -270,7 +253,7 @@ int IOPanda_TriggerOutput (const cGH *GH, int vindex)
varname = CCTK_VarName (vindex);
- if (verbose)
+ if (CCTK_Equals (verbose, "full"))
{
CCTK_VInfo (CCTK_THORNSTRING, "TriggerOutput: "
"name, index = %s, %d", varname, vindex);