summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-06-15 09:03:57 +0000
committerallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-06-15 09:03:57 +0000
commit8970cf2d062b5650cd2ae764ded94769d8d027a7 (patch)
treea73838e0935bca6e4799a561241e4dfc6ba12e29
parent73c042453a8491a59c1e44965ec2a62440db04b8 (diff)
Double -> CCTK_REAL
REAL -> CCTK_REAL POINTER -> CCTK_POINTER VARIABLE_REAL -> CCTK_VARIABLE_REAL (etc) GH->iteration is now an int (not an unsigned long int) git-svn-id: http://svn.cactuscode.org/flesh/trunk@551 17b73243-c579-4c4c-a9d2-2d5706c11dac
-rw-r--r--lib/make/acconfig.h2
-rw-r--r--lib/make/config.h.in8
-rwxr-xr-xlib/make/configure2
-rw-r--r--lib/sbin/GridFuncStuff.pl6
-rw-r--r--lib/sbin/create_c_stuff.pl2
-rw-r--r--lib/sbin/create_fortran_stuff.pl4
-rw-r--r--src/comm/CactusDefaultComm.c4
-rw-r--r--src/comm/Reduction.c4
-rw-r--r--src/include/Groups.h7
-rw-r--r--src/include/cGH.h10
-rw-r--r--src/include/cctk.h21
-rw-r--r--src/main/Groups.c8
12 files changed, 38 insertions, 40 deletions
diff --git a/lib/make/acconfig.h b/lib/make/acconfig.h
index 25af63b7..ec0e93a2 100644
--- a/lib/make/acconfig.h
+++ b/lib/make/acconfig.h
@@ -12,4 +12,4 @@
#define CCTK_STRING POINTER
-#define Double double
+#define CCTK_REAL double
diff --git a/lib/make/config.h.in b/lib/make/config.h.in
index 23f9579b..79d3dd5c 100644
--- a/lib/make/config.h.in
+++ b/lib/make/config.h.in
@@ -30,17 +30,17 @@
typedef INTEGER4 Int;
-#define Double double
+#define CCTK_REAL double
#endif
#ifdef FCODE
-#define POINTER integer*SIZEOF_CHAR_P
+#define CCTK_POINTER integer*SIZEOF_CHAR_P
-#define CCTK_STRING POINTER
+#define CCTK_STRING CCTK_POINTER
-#define REAL double precision
+#define CCTK_REAL double precision
#endif
diff --git a/lib/make/configure b/lib/make/configure
index 63d47c1e..43ac0a4f 100755
--- a/lib/make/configure
+++ b/lib/make/configure
@@ -1349,7 +1349,7 @@ LD=$CXX
if test -r $srcdir/known-architectures/$host_os ; then
. $srcdir/known-architectures/$host_os
fi
-
+
# Deal with the Fortran compiler issues.
# If there's a Fortran 90 compiler use that for all the Fortran.
if test "x$F90" != "x" ; then
diff --git a/lib/sbin/GridFuncStuff.pl b/lib/sbin/GridFuncStuff.pl
index 86b52f0d..503358f9 100644
--- a/lib/sbin/GridFuncStuff.pl
+++ b/lib/sbin/GridFuncStuff.pl
@@ -316,7 +316,7 @@ sub CreateFortranArgumentDeclarations
}
elsif ($1 eq REAL)
{
- push(@declarations, "REAL $argument$suffix$2");
+ push(@declarations, "CCTK_REAL $argument$suffix$2");
}
elsif ($1 eq COMPLEX)
{
@@ -538,7 +538,7 @@ sub CreateCArgumentPrototype
}
elsif ($1 eq REAL)
{
- $prototype .="$sep". "Double *";
+ $prototype .="$sep". "CCTK_REAL *";
$sep = ",";
}
elsif ($1 eq COMPLEX)
@@ -621,7 +621,7 @@ sub CreateCArgumentList
}
elsif ($1 eq REAL)
{
- $arglist .= "$sep"."(Double *)((xGH)->data[CCTKARGNUM_$argument][$level-1])";
+ $arglist .= "$sep"."(CCTK_REAL *)((xGH)->data[CCTKARGNUM_$argument][$level-1])";
$sep = ",";
}
elsif ($1 eq COMPLEX)
diff --git a/lib/sbin/create_c_stuff.pl b/lib/sbin/create_c_stuff.pl
index 9f95205d..a2a7085d 100644
--- a/lib/sbin/create_c_stuff.pl
+++ b/lib/sbin/create_c_stuff.pl
@@ -337,7 +337,7 @@ sub get_c_type_string
}
elsif($type eq "REAL")
{
- $type_string = "Double ";
+ $type_string = "CCTK_REAL ";
}
else
{
diff --git a/lib/sbin/create_fortran_stuff.pl b/lib/sbin/create_fortran_stuff.pl
index f5a21e0a..ea4d7742 100644
--- a/lib/sbin/create_fortran_stuff.pl
+++ b/lib/sbin/create_fortran_stuff.pl
@@ -186,7 +186,7 @@ sub get_fortran_type_string
$type eq "SENTENCE")
{
$type_string = "CCTK_STRING ";
- }
+ }
elsif($type eq "LOGICAL" ||
$type eq "INTEGER")
{
@@ -194,7 +194,7 @@ sub get_fortran_type_string
}
elsif($type eq "REAL")
{
- $type_string = "REAL ";
+ $type_string = "CCTK_REAL ";
}
else
{
diff --git a/src/comm/CactusDefaultComm.c b/src/comm/CactusDefaultComm.c
index cca3d432..edc2f8bb 100644
--- a/src/comm/CactusDefaultComm.c
+++ b/src/comm/CactusDefaultComm.c
@@ -91,9 +91,9 @@ cGH *CactusDefaultSetupGH(tFleshConfig *config, int convergence_level)
thisGH->lower_bound = (int *)malloc(thisGH->dim*sizeof(int));
thisGH->upper_bound = (int *)malloc(thisGH->dim*sizeof(int));
thisGH->bbox = (int *)malloc(2*thisGH->dim*sizeof(int));
- thisGH->delta_space = (Double *)malloc(thisGH->dim*sizeof(Double));
+ thisGH->delta_space = (CCTK_REAL *)malloc(thisGH->dim*sizeof(CCTK_REAL));
/* FIXME : Next line goes when coords are done properly */
- thisGH->origin_space = (Double *)malloc(thisGH->dim*sizeof(Double));
+ thisGH->origin_space = (CCTK_REAL *)malloc(thisGH->dim*sizeof(CCTK_REAL));
thisGH->delta_time = 1;
thisGH->levfac = 1;
diff --git a/src/comm/Reduction.c b/src/comm/Reduction.c
index 7bd2f219..bf2ab770 100644
--- a/src/comm/Reduction.c
+++ b/src/comm/Reduction.c
@@ -11,6 +11,7 @@
/*#define DEBUG_REDUCTION*/
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#include <stdarg.h>
@@ -143,9 +144,10 @@ int CCTK_Reduce(cGH *GH, int retvartype, int retvarnum, void *retval,
/* Call the function providing the reduction, if it exists */
+ /* FIX ME : Generalise (GAB) */
if (function)
{
- function(GH,-1,VARIABLE_REAL,retvarnum,retval,invarnum,index_array);
+ function(GH,-1,CCTK_VARIABLE_REAL,retvarnum,retval,invarnum,index_array);
}
else
CCTK_Warn(1,"CCTK","Reduction operation is not registered and cannot be called");
diff --git a/src/include/Groups.h b/src/include/Groups.h
index e3383cc1..08b2492c 100644
--- a/src/include/Groups.h
+++ b/src/include/Groups.h
@@ -81,11 +81,4 @@ int CCTK_GetNumVarsInGroup_ByIndex(int group);
#define GROUP_GF 2
#define GROUP_ARRAY 3
-/* Variable Types */
-
-#define VARIABLE_CHAR 1
-#define VARIABLE_INTEGER 2
-#define VARIABLE_REAL 3
-#define VARIABLE_COMPLEX 4
-
#endif
diff --git a/src/include/cGH.h b/src/include/cGH.h
index 5bc75663..93a3ab18 100644
--- a/src/include/cGH.h
+++ b/src/include/cGH.h
@@ -22,7 +22,7 @@ typedef struct
typedef struct
{
int dim;
- unsigned long int iteration;
+ int iteration;
/* ...[dim]*/
int *global_shape;
@@ -31,11 +31,11 @@ typedef struct
int *upper_bound;
/* The grid spacings */
- Double delta_time;
- Double *delta_space;
+ CCTK_REAL delta_time;
+ CCTK_REAL *delta_space;
/* FIXME we want coordinate registration instead of this */
- Double *origin_space;
+ CCTK_REAL *origin_space;
/* The bounding box - 1 => a real boundary, 0 => a local grid boundary. */
/* bbox[2*dim] */
@@ -51,7 +51,7 @@ typedef struct
int nghostzones;
/* The coordinate time */
- Double time;
+ CCTK_REAL time;
/* data[var_num][TIMELEVEL][xyz]*/
/* TIMELEVEL I believe, xyz is linear */
diff --git a/src/include/cctk.h b/src/include/cctk.h
index 33b023d0..eaa58c34 100644
--- a/src/include/cctk.h
+++ b/src/include/cctk.h
@@ -36,13 +36,13 @@
#define _DECLARE_CCTK_FARGUMENTS INTEGER dim&&\
INTEGER global_sh(dim)&&\
INTEGER sh(dim), lb(dim), ub(dim), bbox(2*dim)&&\
- REAL delta_time, time, delta_space(dim)&&\
- REAL origin_space(dim)&&\
+ CCTK_REAL delta_time, time, delta_space(dim)&&\
+ CCTK_REAL origin_space(dim)&&\
INTEGER levfac&&\
INTEGER convlevel&&\
INTEGER nghostzones&&\
INTEGER iteration&&\
- POINTER GH&&\
+ CCTK_POINTER GH&&\
#endif /*FCODE*/
@@ -68,12 +68,12 @@
#define _CCTK_C2F_PROTO int *,\
int *,\
int *,int *, int *, int *,\
- Double *, Double *, Double *,\
- Double *,\
+ CCTK_REAL *, CCTK_REAL *, CCTK_REAL *,\
+ CCTK_REAL *,\
+ int *,\
int *,\
int *,\
int *,\
- unsigned long *,\
cGH *
#define CCTK_STORAGESIZE(xGH, group, dim) (CCTK_QueryGroupStorage(xGH,group) ?\
@@ -81,15 +81,18 @@
typedef struct
{
- Double Re;
- Double Im;
+ CCTK_REAL Re;
+ CCTK_REAL Im;
} Complex;
extern int _cctk_one;
#endif /*CCODE*/
-#define CCTK_REAL 3
+#define CCTK_VARIABLE_CHAR 1
+#define CCTK_VARIABLE_INTEGER 2
+#define CCTK_VARIABLE_REAL 3
+#define CCTK_VARIABLE_COMPLEX 4
/*#define CCTK_MAKESTRING(x) CCTK_REALSTRING(x)
#define CCTK_REALSTRING(x) #x
diff --git a/src/main/Groups.c b/src/main/Groups.c
index 63504df2..72feff46 100644
--- a/src/main/Groups.c
+++ b/src/main/Groups.c
@@ -662,22 +662,22 @@ int CCTK_VTypeNumber(const char *type)
if(!strcmp(type, "INTEGER"))
{
- retval = VARIABLE_INTEGER;
+ retval = CCTK_VARIABLE_INTEGER;
}
if(!strcmp(type, "REAL"))
{
- retval = VARIABLE_REAL;
+ retval = CCTK_VARIABLE_REAL;
}
if(!strcmp(type, "COMPLEX"))
{
- retval = VARIABLE_COMPLEX;
+ retval = CCTK_VARIABLE_COMPLEX;
}
if(!strcmp(type, "CHAR"))
{
- retval = VARIABLE_CHAR;
+ retval = CCTK_VARIABLE_CHAR;
}
return retval;