summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-07-04 13:02:52 +0000
committerallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>1999-07-04 13:02:52 +0000
commitabc32c63feddff44aef3c3ed60e92aa789bd9892 (patch)
tree9713fd7c5e9e08a98958049ccca7ad55110c23b0 /src
parentd1176bdab5ecd201e26641600694e4e598f5a734 (diff)
Fortran interface for reduction nearly finished, now it
works for one in field. I need to find if it is possible to pass on a variable argument list or if I need to parse it first. git-svn-id: http://svn.cactuscode.org/flesh/trunk@635 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src')
-rw-r--r--src/comm/Reduction.c44
1 files changed, 42 insertions, 2 deletions
diff --git a/src/comm/Reduction.c b/src/comm/Reduction.c
index 20646eb6..4984680a 100644
--- a/src/comm/Reduction.c
+++ b/src/comm/Reduction.c
@@ -18,6 +18,7 @@
#include "cctk.h"
#include "flesh.h"
+#include "FortranString.h"
#include "Groups.h"
#include "StoreHandledData.h"
#include "Reduction.h"
@@ -86,6 +87,20 @@ int CCTK_RegisterReductionOperator(void (*function)(REGISTER_ARGLIST),
}
+ /*@@
+ @routine CCTK_GetReductionHandle
+ @date April 28 1999
+ @author Gabrielle Allen
+ @desc
+ Returns the handle of a given reduction operator
+ @enddesc
+ @var reduction
+ @vdesc String containing name of reduction operator
+ @vtype const char *
+ @vio in
+ @vcomment
+ @endvar
+@@*/
int CCTK_GetReductionHandle(const char *reduction)
{
@@ -96,11 +111,11 @@ int CCTK_GetReductionHandle(const char *reduction)
handle = CCTK_GetHandle(ReductionOperators, reduction, data);
#ifdef DEBUG_REDUCTION
- printf("----------------------------------------------------------------\n");
+ CCTK_PRINTSEPARATOR
printf("In CCTK_GetReductionHandle\n");
printf("--------------------------\n");
printf(" Got handle %d for %s\n",handle,reduction);
- printf("----------------------------------------------------------------\n");
+ CCTK_PRINTSEPARATOR
#endif
if (handle < 0)
@@ -110,6 +125,15 @@ int CCTK_GetReductionHandle(const char *reduction)
}
+void FMODIFIER FORTRAN_NAME(CCTK_GetReductionHandle)(int *handle, ONE_FORTSTRING_ARG)
+{
+ ONE_FORTSTRING_CREATE(reduction)
+ *handle = CCTK_GetReductionHandle(reduction);
+ free(reduction);
+}
+
+
+
int CCTK_Reduce( cGH *GH,
int proc,
@@ -160,6 +184,22 @@ int CCTK_Reduce( cGH *GH,
}
+void FMODIFIER FORTRAN_NAME(CCTK_Reduce)(cGH *GH,
+ int *fortranreturn,
+ int *proc,
+ int *operation_handle,
+ int *num_out_vals,
+ int *type_out_vals,
+ void *out_vals,
+ int *num_in_fields,
+ int *index )
+{
+ int retval;
+ retval = CCTK_Reduce(GH,*proc,*operation_handle,
+ *num_out_vals,*type_out_vals,
+ out_vals,*num_in_fields,*index);
+ fortranreturn = &retval;
+}