aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortradke <tradke@94b1c47f-dcfd-45ef-a468-0854c0e9e350>2001-06-29 13:05:56 +0000
committertradke <tradke@94b1c47f-dcfd-45ef-a468-0854c0e9e350>2001-06-29 13:05:56 +0000
commit0aba37b0ee16e6c7c885035b347a501d1f6b4a35 (patch)
treea75f82f6d606d29376916db2534d906e9846184a
parent7f9e034f62fda469836c2dad6df78f100039ad72 (diff)
In the label information, output both the physical grid coordinates and the
grid integer indices of the 1D line or 2D slice resp. git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOASCII/trunk@67 94b1c47f-dcfd-45ef-a468-0854c0e9e350
-rw-r--r--src/Write1D.c29
-rw-r--r--src/Write2D.c10
2 files changed, 16 insertions, 23 deletions
diff --git a/src/Write1D.c b/src/Write1D.c
index e25960a..071f7bf 100644
--- a/src/Write1D.c
+++ b/src/Write1D.c
@@ -398,33 +398,30 @@ void IOASCII_Write1D (cGH *GH, int vindex, const char *alias)
{
if (group_static_data.dim > 1)
{
+ /* output the physical coordinates of the 1D line */
if (have_coords)
{
fprintf (file[i], ylabel1_fmt, 'x' + lower,
coord_lower[lower] + GH->cctk_delta_space[lower] *
myGH->spxyz[group_static_data.dim-1][dir][lower]);
+ if (group_static_data.dim > 2)
+ {
+ fprintf (file[i], ylabel2_fmt, 'x' + upper,
+ coord_lower[upper] + GH->cctk_delta_space[upper] *
+ myGH->spxyz[group_static_data.dim-1][dir][upper]);
+ }
+ fprintf (file[i], "),");
}
- else
- {
- fprintf (file[i], " (%ci = %d", 'x' + lower,
- myGH->spxyz[group_static_data.dim-1][dir][lower]);
- }
- }
- if (group_static_data.dim > 2)
- {
- if (have_coords)
- {
- fprintf (file[i], ylabel2_fmt, 'x' + upper,
- coord_lower[upper] + GH->cctk_delta_space[upper] *
- myGH->spxyz[group_static_data.dim-1][dir][upper]);
- }
- else
+ /* output the index coordinates of the 1D line */
+ fprintf (file[i], " (%ci = %d", 'x' + lower,
+ myGH->spxyz[group_static_data.dim-1][dir][lower]);
+ if (group_static_data.dim > 2)
{
fprintf (file[i], ", %ci = %d", 'x' + upper,
myGH->spxyz[group_static_data.dim-1][dir][upper]);
}
+ fprintf (file[i], ") \n");
}
- fprintf (file[i], ") \n");
}
}
}
diff --git a/src/Write2D.c b/src/Write2D.c
index 20119c9..6e5c987 100644
--- a/src/Write2D.c
+++ b/src/Write2D.c
@@ -161,7 +161,7 @@ void IOASCII_Write2D (cGH *GH, int vindex, const char *alias)
/* set header and data format strings */
sprintf (header_fmt_string, "\n\n#Time = %%%s\n", out_format);
- sprintf (zlabel_fmt_string, "#z-label %%s (%%c = %%%s)\n", out_format);
+ sprintf (zlabel_fmt_string, "#z-label %%s (%%c = %%%s), ", out_format);
sprintf (out_real_format, "%%%s", out_format);
sprintf (data_fmt_string_int, "%s\t\t%s\t\t%%d",
out_real_format, out_real_format);
@@ -302,12 +302,8 @@ void IOASCII_Write2D (cGH *GH, int vindex, const char *alias)
coord_lower[dir] + GH->cctk_delta_space[dir] *
myGH->sp2xyz[groupinfo.dim-1][dir]);
}
- else
- {
- fprintf (fdset_2D[dir], "#z-label %s (%c = %d)\n",
- advertised_file.varname, 'x' + dir,
- myGH->sp2xyz[groupinfo.dim-1][dir]);
- }
+ fprintf (fdset_2D[dir], "(%ci = %d)\n",
+ 'x' + dir, myGH->sp2xyz[groupinfo.dim-1][dir]);
}
free (advertised_file.varname);