aboutsummaryrefslogtreecommitdiff
path: root/src/WriteGF.c
diff options
context:
space:
mode:
authorlanfer <lanfer@b589c3ab-70e8-4b4d-a09f-cba2dd200880>2000-03-02 15:44:41 +0000
committerlanfer <lanfer@b589c3ab-70e8-4b4d-a09f-cba2dd200880>2000-03-02 15:44:41 +0000
commitb32ca03ec667173fef1c91928059de98912e0b15 (patch)
treebc7c8a335d79b1c43a073e555053fdb00324fca8 /src/WriteGF.c
parent5bbae845df0f9f1202ad7ac5cc788d2291294a8e (diff)
allow exponential format in output
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOBasic/trunk@39 b589c3ab-70e8-4b4d-a09f-cba2dd200880
Diffstat (limited to 'src/WriteGF.c')
-rw-r--r--src/WriteGF.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/WriteGF.c b/src/WriteGF.c
index 8c7ed8c..b9cb1e5 100644
--- a/src/WriteGF.c
+++ b/src/WriteGF.c
@@ -30,6 +30,8 @@ void IOBasic_WriteGF (cGH *GH, int index, const char *alias)
char *filename;
char title_start_char;
int reduction_handle;
+ int decnot;
+
CCTK_REAL reduction_value;
/* add more reductions to this table if you want, telling it
- the reduction operator
@@ -45,8 +47,11 @@ void IOBasic_WriteGF (cGH *GH, int index, const char *alias)
{"norm1", "norm1", "nm1"},
{"norm2", "norm2", "nm2"},
};
+
#define NUM_REDUCTIONS (sizeof (reductions) / sizeof (reductions [0]))
+ /* check if decimal or exponential format desired */
+ decnot = CCTK_Equals(out_format,"f")?1:0;
/* first, check if variable has storage assigned */
if (! CCTK_QueryGroupStorageI (GH, CCTK_GroupIndexFromVarI (index))) {
@@ -116,7 +121,10 @@ void IOBasic_WriteGF (cGH *GH, int index, const char *alias)
}
/* write the data and close the file */
- fprintf (file, "%f %25.13f\n", GH->cctk_time, reduction_value);
+ if (decnot)
+ fprintf (file, "%f %25.13f\n", GH->cctk_time, reduction_value);
+ else
+ fprintf (file, "%e %25.13e\n", GH->cctk_time, reduction_value);
fclose (file);
}
}