aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortradke <tradke@94b1c47f-dcfd-45ef-a468-0854c0e9e350>2002-05-10 11:10:08 +0000
committertradke <tradke@94b1c47f-dcfd-45ef-a468-0854c0e9e350>2002-05-10 11:10:08 +0000
commit6db3b7206278c0f506b6f18b9334d2ac00da1772 (patch)
tree4e955df26748f0f3943deb070b3c467c01a72116
parent3f658de50779cc63a6e4ccee9ae8a6e20b004090 (diff)
Bugfix when writing no label information to 1D output files. A blank line
was missing then. git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOASCII/trunk@115 94b1c47f-dcfd-45ef-a468-0854c0e9e350
-rw-r--r--src/Write1D.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/src/Write1D.c b/src/Write1D.c
index 60ab901..e9e1d3a 100644
--- a/src/Write1D.c
+++ b/src/Write1D.c
@@ -615,35 +615,33 @@ static void OpenFile (const cGH *GH,
fprintf (file[i], "%cx-label diagonal\n", comment_char);
}
fprintf (file[i], "%cy-label %s", comment_char, fullname);
- if (dir < 3)
+ if (dir < 3 && gdata->dim > 1)
{
- if (gdata->dim > 1)
+ /* output the physical coordinates of the 1D line */
+ if (coord_lower)
{
- /* output the physical coordinates of the 1D line */
- if (coord_lower)
- {
- fprintf (file[i], ylabel1_fmt_string, 'x' + lower,
- coord_lower[lower] + GH->cctk_delta_space[lower] *
- myGH->spxyz[gdata->dim-1][dir][lower]);
- if (gdata->dim > 2)
- {
- fprintf (file[i], ylabel2_fmt_string, 'x' + upper,
- coord_lower[upper] + GH->cctk_delta_space[upper] *
- myGH->spxyz[gdata->dim-1][dir][upper]);
- }
- fprintf (file[i], "),");
- }
- /* output the index coordinates of the 1D line */
- fprintf (file[i], " (%ci = %d", 'x' + lower,
+ fprintf (file[i], ylabel1_fmt_string, 'x' + lower,
+ coord_lower[lower] + GH->cctk_delta_space[lower] *
myGH->spxyz[gdata->dim-1][dir][lower]);
if (gdata->dim > 2)
{
- fprintf (file[i], ", %ci = %d", 'x' + upper,
+ fprintf (file[i], ylabel2_fmt_string, 'x' + upper,
+ coord_lower[upper] + GH->cctk_delta_space[upper] *
myGH->spxyz[gdata->dim-1][dir][upper]);
}
- fprintf (file[i], ") \n");
+ fputs ("),", file[i]);
+ }
+ /* output the index coordinates of the 1D line */
+ fprintf (file[i], " (%ci = %d", 'x' + lower,
+ myGH->spxyz[gdata->dim-1][dir][lower]);
+ if (gdata->dim > 2)
+ {
+ fprintf (file[i], ", %ci = %d", 'x' + upper,
+ myGH->spxyz[gdata->dim-1][dir][upper]);
}
+ fputs (") \n", file[i]);
}
+ fputc ('\n', file[i]);
}
StoreNamedData (&myGH->filenameList1D, filename, file[i]);