aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--interface.ccl2
-rw-r--r--src/Write1D.c20
-rw-r--r--src/Write2D.c20
-rw-r--r--src/Write3D.c20
4 files changed, 37 insertions, 25 deletions
diff --git a/interface.ccl b/interface.ccl
index 38c8a4d..cb95317 100644
--- a/interface.ccl
+++ b/interface.ccl
@@ -52,4 +52,4 @@ CCTK_INT FUNCTION Coord_GroupSystem \
(CCTK_POINTER_TO_CONST IN GH, \
CCTK_STRING IN groupname)
-REQUIRES FUNCTION Coord_GroupSystem
+USES FUNCTION Coord_GroupSystem
diff --git a/src/Write1D.c b/src/Write1D.c
index 999e583..7779c86 100644
--- a/src/Write1D.c
+++ b/src/Write1D.c
@@ -191,16 +191,20 @@ int IOASCII_Write1D (const cGH *GH, int vindex, const char *alias)
return (0);
}
- /* 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 */
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 */
diff --git a/src/Write3D.c b/src/Write3D.c
index d4304f5..52fe554 100644
--- a/src/Write3D.c
+++ b/src/Write3D.c
@@ -157,15 +157,19 @@ int IOASCII_Write3D (const cGH *GH, int vindex, const char *alias)
return (-1);
}
- /* get the coordinate system associated with this grid variable */
vindices[0] = vindex;
- groupname = CCTK_GroupName (gindex);
- coord_system_handle = Coord_GroupSystem (GH, groupname);
- free (groupname);
-
- have_coords = coord_system_handle >= 0 &&
- Util_TableGetIntArray (coord_system_handle, 3,
- 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, 3,
+ coord_handles, "COORDINATES") >= 0;
+ }
if (have_coords)
{
/* get the coordinate functions and coordinate physical minimum */