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/WriteGF.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/WriteGF.c')
-rw-r--r-- | src/WriteGF.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/WriteGF.c b/src/WriteGF.c index 6f02c63..aa3a1d9 100644 --- a/src/WriteGF.c +++ b/src/WriteGF.c @@ -28,6 +28,7 @@ void IOBasic_WriteGF (cGH *GH, int index, const char *alias) { DECLARE_CCTK_PARAMETERS + int ierr; int i; ioGH *ioUtilGH; iobasicGH *myGH; @@ -92,7 +93,8 @@ void IOBasic_WriteGF (cGH *GH, int index, const char *alias) /* get the reduction handle from the reduction operator */ reduction_handle = CCTK_ReductionHandle (reductions [i].operator); - if (reduction_handle < 0) { + if (reduction_handle < 0) + { CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING, "IOBasic_WriteGF: Invalid reduction operator '%s'", reductions [i].operator); @@ -100,11 +102,11 @@ void IOBasic_WriteGF (cGH *GH, int index, const char *alias) } /* do the reduction (all processors) */ - CCTK_Reduce (GH, 0, reduction_handle, 1, CCTK_VARIABLE_REAL, - &reduction_value, 1, index); + ierr = CCTK_Reduce (GH, 0, reduction_handle, 1, CCTK_VARIABLE_REAL, + &reduction_value, 1, index); /* dump the reduction value to file by processor 0 */ - if (CCTK_MyProc (GH) == 0) + if (ierr == 0 && CCTK_MyProc (GH) == 0) { /* build the filename */ |