aboutsummaryrefslogtreecommitdiff
path: root/src/Utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Utils.c')
-rw-r--r--src/Utils.c36
1 files changed, 22 insertions, 14 deletions
diff --git a/src/Utils.c b/src/Utils.c
index d1def3d..0b22bd9 100644
--- a/src/Utils.c
+++ b/src/Utils.c
@@ -321,19 +321,23 @@ int IOUtil_1DLines (const cGH *GH,
CCTK_REAL *const *const origin_phys,
int *const *slice_center)
{
- int dim, dir, coord_system_handle, have_coords, have_origin_index, len;
+ int dim, dir, coord_system_handle = -1, have_coords, have_origin_index, len;
char *coord_system_name;
- CCTK_INT *coord_handles;
+ CCTK_INT *coord_handles = NULL;
CCTK_REAL *lower, *upper, *delta;
/* get the default coordinate system associated with this grid dimension */
coord_system_name = NULL;
- coord_system_handle = Coord_GetDefaultSystem (GH, num_dims);
- coord_handles = malloc (num_dims * sizeof (CCTK_INT));
- have_coords = coord_system_handle >= 0 &&
- Util_TableGetIntArray (coord_system_handle, num_dims,
- coord_handles, "COORDINATES") >= 0;
+ have_coords = CCTK_IsFunctionAliased ("Coord_GetDefaultSystem");
+ if (have_coords)
+ {
+ coord_system_handle = Coord_GetDefaultSystem (GH, num_dims);
+ coord_handles = malloc (num_dims * sizeof (CCTK_INT));
+ have_coords = coord_system_handle >= 0 &&
+ Util_TableGetIntArray (coord_system_handle, num_dims,
+ coord_handles, "COORDINATES") >= 0;
+ }
if (have_coords)
{
len = Util_TableGetString (coord_system_handle, 0, NULL, "NAME");
@@ -500,19 +504,23 @@ int IOUtil_2DPlanes (const cGH *GH,
const CCTK_REAL *origin_phys,
int *slice_center)
{
- int have_coords, have_origin_index, len, coord_system_handle, dir;
+ int have_coords, have_origin_index, len, coord_system_handle = -1, dir;
char *coord_system_name;
- CCTK_INT *coord_handles;
+ CCTK_INT *coord_handles = NULL;
CCTK_REAL *lower, *upper, *delta;
/* get the default coordinate system associated with this grid dimension */
coord_system_name = NULL;
- coord_system_handle = Coord_GetDefaultSystem (GH, num_dims);
- coord_handles = malloc (num_dims * sizeof (CCTK_INT));
- have_coords = coord_system_handle >= 0 &&
- Util_TableGetIntArray (coord_system_handle, num_dims,
- coord_handles, "COORDINATES") >= 0;
+ have_coords = CCTK_IsFunctionAliased ("Coord_GetDefaultSystem");
+ if (have_coords)
+ {
+ coord_system_handle = Coord_GetDefaultSystem (GH, num_dims);
+ coord_handles = malloc (num_dims * sizeof (CCTK_INT));
+ have_coords = coord_system_handle >= 0 &&
+ Util_TableGetIntArray (coord_system_handle, num_dims,
+ coord_handles, "COORDINATES") >= 0;
+ }
if (have_coords)
{
len = Util_TableGetString (coord_system_handle, 0, NULL, "NAME");