diff options
author | allen <allen@b589c3ab-70e8-4b4d-a09f-cba2dd200880> | 2000-07-19 12:20:56 +0000 |
---|---|---|
committer | allen <allen@b589c3ab-70e8-4b4d-a09f-cba2dd200880> | 2000-07-19 12:20:56 +0000 |
commit | 5ef5219e049640848f134969fec13edf850606c7 (patch) | |
tree | 34d6f00ec5b9ae1600c7cb25eecb54a815b35faf /src/OutputInfo.c | |
parent | 4708b9c442dcf8919a614866d599e8a0a239ebcf (diff) |
Only output scalar's if their values have been successfully
calculated
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOBasic/trunk@63 b589c3ab-70e8-4b4d-a09f-cba2dd200880
Diffstat (limited to 'src/OutputInfo.c')
-rw-r--r-- | src/OutputInfo.c | 55 |
1 files changed, 40 insertions, 15 deletions
diff --git a/src/OutputInfo.c b/src/OutputInfo.c index 70bb8a1..b0d8c0e 100644 --- a/src/OutputInfo.c +++ b/src/OutputInfo.c @@ -20,7 +20,8 @@ #include "iobasicGH.h" /* extern prototypes */ -CCTK_REAL IOBasic_WriteInfo (cGH *GH, int index, const char *operator, +int IOBasic_WriteInfo (cGH *GH, CCTK_REAL *val,int index, + const char *operator, const char *alias); @@ -58,10 +59,12 @@ int IOBasic_OutputInfoGH (cGH *GH) DECLARE_CCTK_PARAMETERS int i; + int ierr1=-1; + int ierr2=-1; const char *name; iobasicGH *myGH; const cParamData *paramdata; - + CCTK_REAL val; /* Get the GH extensions for IOBasic */ myGH = (iobasicGH *) GH->extensions [CCTK_GHExtensionHandle ("IOBasic")]; @@ -69,7 +72,9 @@ int IOBasic_OutputInfoGH (cGH *GH) /* How often to output */ myGH->outInfo_every = out_every > 0 ? out_every : -1; if (outInfo_every > 0) + { myGH->outInfo_every = outInfo_every; + } /* Return if no output is required */ if (myGH->outInfo_every < 1 || @@ -168,29 +173,46 @@ int IOBasic_OutputInfoGH (cGH *GH) #endif /* Make the IO call */ - myGH->infovals[i][0] = IOBasic_WriteInfo (GH, i, "minimum", name); - myGH->infovals[i][1] = IOBasic_WriteInfo (GH, i, "maximum", name); + ierr1 = IOBasic_WriteInfo (GH, &val, i, "minimum", name); + myGH->infovals[i][0] = val; + ierr2 = IOBasic_WriteInfo (GH, &val, i, "maximum", name); + myGH->infovals[i][1] = val; /* Register GF as having info output this iteration */ myGH->outInfo_last [i] = GH->cctk_iteration; } - /* finally print out the stuff */ - if (USE_DECIMAL_NOTATION (myGH->infovals [i][0])) + if (ierr1 == 0) { - printf ("%12.8f |", myGH->infovals [i][0]); + /* finally print out the stuff */ + if (USE_DECIMAL_NOTATION (myGH->infovals [i][0])) + { + printf ("%12.8f |", myGH->infovals [i][0]); + } + else + { + printf ("%10.6e |", myGH->infovals [i][0]); + } } else { - printf ("%10.6e |", myGH->infovals [i][0]); + printf(" ----------- |"); } - if (USE_DECIMAL_NOTATION (myGH->infovals [i][1])) + + if (ierr2 == 0) { - printf ("%12.8f |", myGH->infovals [i][1]); + if (USE_DECIMAL_NOTATION (myGH->infovals [i][1])) + { + printf ("%12.8f |", myGH->infovals [i][1]); + } + else + { + printf ("%10.6e |", myGH->infovals [i][1]); + } } else { - printf ("%10.6e |", myGH->infovals [i][1]); + printf(" ----------- |"); } } /* end of loop over all variables */ @@ -322,7 +344,8 @@ int IOBasic_TriggerOutputInfo (cGH *GH, int variable) { const char *var; iobasicGH *myGH; - + int ierr1,ierr2; + CCTK_REAL val; /* Get the GH extension for IOBasic */ myGH = (iobasicGH *) GH->extensions [CCTK_GHExtensionHandle ("IOBasic")]; @@ -336,9 +359,11 @@ int IOBasic_TriggerOutputInfo (cGH *GH, int variable) printf(" Variable = -%s-\n",var); #endif - myGH->infovals[variable][0]=IOBasic_WriteInfo (GH, variable, "minimum",var); - myGH->infovals[variable][1]=IOBasic_WriteInfo (GH, variable, "maximum",var); - + ierr1=IOBasic_WriteInfo (GH, &val, variable, "minimum",var); + myGH->infovals[variable][0] = val; + ierr2=IOBasic_WriteInfo (GH, &val, variable, "maximum",var); + myGH->infovals[variable][1] = val; + /* Register GF as having Info output this iteration */ myGH->outInfo_last [variable] = GH->cctk_iteration; |