aboutsummaryrefslogtreecommitdiff
path: root/src/Write2D.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Write2D.c')
-rw-r--r--src/Write2D.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/Write2D.c b/src/Write2D.c
index c72e9cf..fa8246f 100644
--- a/src/Write2D.c
+++ b/src/Write2D.c
@@ -170,16 +170,20 @@ int IOASCII_Write2D (const cGH *GH, int vindex, const char *alias)
/* in general: maxdir = gdata.dim * (gdata.dim - 1) / 2; */
maxdir = gdata.dim == 2 ? 1 : 3;
- /* get the coordinate system associated with this grid variable */
- groupname = CCTK_GroupName (gindex);
- coord_system_handle = Coord_GroupSystem (GH, groupname);
- free (groupname);
-
dir = gdata.dim < 3 ? gdata.dim : 3;
- have_coords = coord_system_handle >= 0 &&
- Util_TableGetIntArray (coord_system_handle, dir,
- coord_handles, "COORDINATES") >= 0;
+ have_coords = CCTK_IsFunctionAliased ("Coord_GroupSystem");
+ if (have_coords)
+ {
+ /* get the coordinate system associated with this grid variable */
+ groupname = CCTK_GroupName (gindex);
+ coord_system_handle = Coord_GroupSystem (GH, groupname);
+ free (groupname);
+
+ have_coords = coord_system_handle >= 0 &&
+ Util_TableGetIntArray (coord_system_handle, dir,
+ coord_handles, "COORDINATES") >= 0;
+ }
if (have_coords)
{
/* get the coordinate functions and coordinate physical minimum */