From 356ea7693dec23224b27a942d033e08b1dbcf6fb Mon Sep 17 00:00:00 2001 From: tradke Date: Wed, 4 Oct 2006 14:45:28 +0000 Subject: Make only optional use of aliased function Coord_GroupSystem(). git-svn-id: http://svn.cactuscode.org/arrangements/CactusIO/IOSDF/trunk@11 3af55ef0-e5e4-43b4-b020-ca5761ff09b2 --- interface.ccl | 2 +- src/Write1D.c | 10 +++++++--- src/Write2D.c | 10 +++++++--- src/Write3D.c | 10 +++++++--- 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/interface.ccl b/interface.ccl index 7f0609b..e0fa51e 100644 --- a/interface.ccl +++ b/interface.ccl @@ -43,4 +43,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 31073b4..60d855a 100644 --- a/src/Write1D.c +++ b/src/Write1D.c @@ -134,9 +134,13 @@ int IOSDF_Write1D (const cGH *GH, int vindex, const char *alias) } /* get the coordinate system associated with this grid variable */ - groupname = CCTK_GroupName (gindex); - coord_system_handle = Coord_GroupSystem (GH, groupname); - free (groupname); + coord_system_handle = -1; + if (CCTK_IsFunctionAliased ("Coord_GroupSystem")) + { + groupname = CCTK_GroupName (gindex); + coord_system_handle = Coord_GroupSystem (GH, groupname); + free (groupname); + } myproc = CCTK_MyProc (GH); diff --git a/src/Write2D.c b/src/Write2D.c index 2906c79..5681f7d 100644 --- a/src/Write2D.c +++ b/src/Write2D.c @@ -113,9 +113,13 @@ int IOSDF_Write2D (const cGH *GH, int vindex, const char *alias) 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); + coord_system_handle = -1; + if (CCTK_IsFunctionAliased ("Coord_GroupSystem")) + { + groupname = CCTK_GroupName (gindex); + coord_system_handle = Coord_GroupSystem (GH, groupname); + free (groupname); + } dir = gdata.dim < 3 ? gdata.dim : 3; diff --git a/src/Write3D.c b/src/Write3D.c index 314146b..3d4db78 100644 --- a/src/Write3D.c +++ b/src/Write3D.c @@ -100,9 +100,13 @@ int IOSDF_Write3D (const cGH *GH, int vindex, const char *alias) } /* get the coordinate system associated with this grid variable */ - groupname = CCTK_GroupName (gindex); - coord_system_handle = Coord_GroupSystem (GH, groupname); - free (groupname); + coord_system_handle = -1; + if (CCTK_IsFunctionAliased ("Coord_GroupSystem")) + { + groupname = CCTK_GroupName (gindex); + coord_system_handle = Coord_GroupSystem (GH, groupname); + free (groupname); + } /* get the total number of grid points to check for zero-sized variables */ /* set the extent vector (copy from 'int' to 'CCTK_INT') */ -- cgit v1.2.3