From 9384d5ead61eeb13ff4be9f182d328081e3af018 Mon Sep 17 00:00:00 2001 From: schnetter Date: Tue, 28 Oct 2003 13:48:26 +0000 Subject: Change the way in which pointers are passed to and from Fortran. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3446 17b73243-c579-4c4c-a9d2-2d5706c11dac --- lib/make/force-rebuild | 3 +- lib/sbin/CreateFunctionBindings.pl | 39 +++---- src/IO/FortranBindingsIO.c | 6 +- src/IO/IOMethods.c | 24 ++--- src/comm/CactusDefaultComm.c | 2 + src/comm/CactusSync.c | 18 ++-- src/comm/Interp.c | 18 ++-- src/comm/OverloadComm.c | 66 ++++++------ src/comm/Reduction.c | 48 ++++----- src/include/cGH.h | 7 +- src/include/cctk.h | 4 +- src/main/Coord.c | 30 +++--- src/main/GroupsOnGH.c | 205 +++++++++++++++++++++---------------- src/main/Termination.c | 6 +- 14 files changed, 254 insertions(+), 222 deletions(-) diff --git a/lib/make/force-rebuild b/lib/make/force-rebuild index 8977e5e2..6593fe26 100644 --- a/lib/make/force-rebuild +++ b/lib/make/force-rebuild @@ -5,7 +5,7 @@ # @desc # Timestamp file for forcing rebuilds of configurations # @enddesc -# @version $Id: force-rebuild,v 1.6 2003-10-27 17:23:10 schnetter Exp $ +# @version $Id: force-rebuild,v 1.7 2003-10-28 13:48:25 schnetter Exp $ # @@*/ 6 March 2003: minor changes to CreateFunctionBindings.pl @@ -15,3 +15,4 @@ 4 September 2003: Parse information in thorns' configuration.ccl files 13 October 2003: Add support for CCTK_INT1. 27 October 2003: Provide function prototypes for both Fortran and C +28 October 2003: Correct passing of pointers between C and Fortran. diff --git a/lib/sbin/CreateFunctionBindings.pl b/lib/sbin/CreateFunctionBindings.pl index 469918d9..626139dd 100644 --- a/lib/sbin/CreateFunctionBindings.pl +++ b/lib/sbin/CreateFunctionBindings.pl @@ -561,8 +561,7 @@ sub ParseArgument if ($DummyArgument =~ /FPTRARGS/) { - ($type,$name) = split(' ',$DummyArgument); - $intent = "IN"; + ($type,$intent,$name) = split(' ',$DummyArgument); # QUERY: is $fpointer supposed to be set here? $fpointer = 1; &debug_print("$Thorn--ParseArgument: (fn pointer) type=$type name=$name"); @@ -624,9 +623,9 @@ sub ParseArgument { $Argument->{"Function Pointer"} = 0; } - if ($type !~ /(\bCCTK_INT$)|(\bCCTK_REAL$)|(\bCCTK_POINTER$)|(\bCCTK_STRING$)/) + if ($type !~ /(\bCCTK_INT$)|(\bCCTK_REAL$)|(\bCCTK_POINTER$)|(\bCCTK_POINTER_TO_CONST$)|(\bCCTK_STRING$)/) { - my $message = "Thorn $Thorn, Function $Function:\nAn argument in an aliased function must be one of the allowed CCTK types.\nThese are CCTK_INT, CCTK_REAL, CCTK_POINTER or CCTK_STRING.\nThe argument ".$Argument->{"Name"}." has type \"$type\"."; + my $message = "Thorn $Thorn, Function $Function:\nAn argument in an aliased function must be one of the allowed CCTK types.\nThese are CCTK_INT, CCTK_REAL, CCTK_POINTER, CCTK_POINTER_TO_CONST, or CCTK_STRING.\nThe argument ".$Argument->{"Name"}." has type \"$type\"."; if ($type =~ /:/) { $message .= "\n(The older \"${type}ARRAY\" should be replaced with \"$type ARRAY\".)"; @@ -2178,7 +2177,7 @@ sub printCallArg { $prefix = ""; } - elsif ( ($calltype eq "Fortran")&&( !(($Arg{"Is Array"})||($Arg{"String"})||($Arg{"Intent"}=~/OUT/)||($Arg{"Type"} =~ /CCTK_POINTER/)) ) ) + elsif ( ($calltype eq "Fortran")&&( !(($Arg{"Is Array"})||($Arg{"String"})||($Arg{"Intent"}=~/OUT/)) ) ) { $prefix = "*"; } @@ -2324,6 +2323,17 @@ sub printArg my $suffix = ""; my $prefix = ""; + if ( (($type eq "Fortran")&&(!$Arg{"Function pointer"})) || + (($type eq "C")&&(($Arg{"Is Array"})||($Arg{"Intent"}=~/OUT/))) ) + { + &debug_print($Arg{"Name"}." needs a *"); + $suffix = "*"; + } + if ( ($Arg{"Intent"}=~/IN/) && (!($Arg{"Intent"}=~/OUT/)) ) + { + $prefix = "const "; + } + if ($Arg{"Function pointer"}) { # It's a FPOINTER @@ -2335,28 +2345,11 @@ sub printArg push(@data,$vartype); my @fptrargs = &printArgList($type,$Arg{"Name"}{"Arguments"}); # print "\n@fptrargs\n\n"; - push(@data,"(*".$Arg{"Name"}{"Name"}.")(@fptrargs)"); + push(@data,"(*".$prefix.$suffix.$Arg{"Name"}{"Name"}.")(@fptrargs)"); } else { # print "Argument: ".$Arg{"Name"}." ".$Arg{"Is Array"}." ".$Arg{"Intent"}."\n"; - if ( (($type eq "Fortran")&&(!$Arg{"Function"})) || - (($type eq "C")&&(($Arg{"Is Array"})||(($Arg{"Intent"}=~/OUT/)&&($vartype !~ "CCTK_POINTER")))) ) - { - &debug_print($Arg{"Name"}." needs a *"); - $suffix = "*"; - } - if ( ($Arg{"Intent"}=~/IN/) && (!($Arg{"Intent"}=~/OUT/)) ) - { - $prefix = "const "; - # const CCTK_POINTER is read by C as a constant pointer, rather - # that a pointer to constant data, so treat this case separately: - if ($vartype eq "CCTK_POINTER" && ! $Arg{"Is Array"}) - { - $prefix = ""; - $vartype = "CCTK_POINTER_TO_CONST"; - } - } push(@data,$prefix.$vartype.$suffix); diff --git a/src/IO/FortranBindingsIO.c b/src/IO/FortranBindingsIO.c index e3e72426..bf644ea9 100644 --- a/src/IO/FortranBindingsIO.c +++ b/src/IO/FortranBindingsIO.c @@ -27,7 +27,7 @@ CCTK_FILEVERSION(IO_FortranBindingsIO_c); ********************************************************************/ void CCTK_FCALL CCTK_FNAME (CCTK_OutputGH) - (int *istat, const cGH *GH); + (int *istat, const cGH **GH); void CCTK_FCALL CCTK_FNAME (CCTKi_RegisterIOMethod) (int *handle, TWO_FORTSTRING_ARG); @@ -63,9 +63,9 @@ void CCTK_FCALL CCTK_FNAME (CCTKi_RegisterIOMethod) @endreturndesc @@*/ void CCTK_FCALL CCTK_FNAME (CCTK_OutputGH) - (int *istat, const cGH *GH) + (int *istat, const cGH **GH) { - *istat = CCTK_OutputGH (GH); + *istat = CCTK_OutputGH (*GH); } /*@@ diff --git a/src/IO/IOMethods.c b/src/IO/IOMethods.c index e4a4462e..9eb91bb4 100644 --- a/src/IO/IOMethods.c +++ b/src/IO/IOMethods.c @@ -49,13 +49,13 @@ int CactusDefaultOutputVarAsByMethod (const cGH *GH, const char *alias); void CCTK_FCALL CCTK_FNAME (CCTK_OutputVarAsByMethod) - (int *ierr, const cGH *GH, THREE_FORTSTRING_ARG); + (int *ierr, const cGH **GH, THREE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_OutputVarByMethod) - (int *ierr, const cGH *GH, TWO_FORTSTRING_ARG); + (int *ierr, const cGH **GH, TWO_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_OutputVar) - (int *istat, const cGH *GH, ONE_FORTSTRING_ARG); + (int *istat, const cGH **GH, ONE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_OutputVarAs) - (int *istat, const cGH *GH, TWO_FORTSTRING_ARG); + (int *istat, const cGH **GH, TWO_FORTSTRING_ARG); int CCTKi_TriggerSaysGo (const cGH *GH, int variable); @@ -391,10 +391,10 @@ int CCTK_OutputVarAs (const cGH *GH, const char *var, const char *alias) } void CCTK_FCALL CCTK_FNAME (CCTK_OutputVarAs) - (int *istat, const cGH *GH, TWO_FORTSTRING_ARG) + (int *istat, const cGH **GH, TWO_FORTSTRING_ARG) { TWO_FORTSTRING_CREATE (var,as); - *istat = CCTK_OutputVarAs (GH, var,as); + *istat = CCTK_OutputVarAs (*GH, var,as); free (var); free (as); } @@ -436,10 +436,10 @@ int CCTK_OutputVar (const cGH *GH, const char *var) } void CCTK_FCALL CCTK_FNAME (CCTK_OutputVar) - (int *istat, const cGH *GH, ONE_FORTSTRING_ARG) + (int *istat, const cGH **GH, ONE_FORTSTRING_ARG) { ONE_FORTSTRING_CREATE (var); - *istat = CCTK_OutputVar (GH, var); + *istat = CCTK_OutputVar (*GH, var); free (var); } @@ -487,10 +487,10 @@ int CCTK_OutputVarByMethod (const cGH *GH, const char *var, const char *method) } void CCTK_FCALL CCTK_FNAME (CCTK_OutputVarByMethod) - (int *ierr, const cGH *GH, TWO_FORTSTRING_ARG) + (int *ierr, const cGH **GH, TWO_FORTSTRING_ARG) { TWO_FORTSTRING_CREATE (var, method); - *ierr = CCTK_OutputVarByMethod (GH, var, method); + *ierr = CCTK_OutputVarByMethod (*GH, var, method); free (var); free (method); } @@ -758,11 +758,11 @@ int CactusDefaultOutputVarAsByMethod (const cGH *GH, } void CCTK_FCALL CCTK_FNAME (CCTK_OutputVarAsByMethod) - (int *ierr, const cGH *GH, THREE_FORTSTRING_ARG) + (int *ierr, const cGH **GH, THREE_FORTSTRING_ARG) { THREE_FORTSTRING_CREATE (var, methodname, alias); - *ierr = CCTK_OutputVarAsByMethod (GH, var, methodname, alias); + *ierr = CCTK_OutputVarAsByMethod (*GH, var, methodname, alias); free (var); free (methodname); diff --git a/src/comm/CactusDefaultComm.c b/src/comm/CactusDefaultComm.c index b8afeecf..ce2c1c83 100644 --- a/src/comm/CactusDefaultComm.c +++ b/src/comm/CactusDefaultComm.c @@ -152,6 +152,8 @@ cGH *CactusDefaultSetupGH(tFleshConfig *config, int convergence_level) thisGH = malloc(sizeof(cGH)); if(thisGH) { + thisGH->self = thisGH; + thisGH->cctk_dim = CCTK_MaxDim(); /* Need this to be at least one otherwise the memory allocation will fail */ diff --git a/src/comm/CactusSync.c b/src/comm/CactusSync.c index 7afb0e19..102d91d1 100644 --- a/src/comm/CactusSync.c +++ b/src/comm/CactusSync.c @@ -31,11 +31,11 @@ CCTK_FILEVERSION(comm_CactusSync_c); /* prototypes for external C routines are declared in header cctk_Groups.h here only follow the fortran wrapper prototypes */ void CCTK_FCALL CCTK_FNAME (CCTK_SyncGroupI) - (int *ierror, const cGH *GH, const int *group); + (int *ierror, const cGH **GH, const int *group); void CCTK_FCALL CCTK_FNAME (CCTK_SyncGroupWithVar) - (int *ierror, const cGH *GH, ONE_FORTSTRING_ARG); + (int *ierror, const cGH **GH, ONE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_SyncGroupWithVarI) - (int *ierror, const cGH *GH, const int *var); + (int *ierror, const cGH **GH, const int *var); /*@@ @@ -88,9 +88,9 @@ int CCTK_SyncGroupI (const cGH *GH, int group) } void CCTK_FCALL CCTK_FNAME (CCTK_SyncGroupI) - (int *ierror, const cGH *GH, const int *group) + (int *ierror, const cGH **GH, const int *group) { - CCTK_SyncGroupI (GH, *group); + CCTK_SyncGroupI (*GH, *group); *ierror = 0; } @@ -134,10 +134,10 @@ int CCTK_SyncGroupWithVar (const cGH *GH, const char *varname) } void CCTK_FCALL CCTK_FNAME (CCTK_SyncGroupWithVar) - (int *ierror, const cGH *GH, ONE_FORTSTRING_ARG) + (int *ierror, const cGH **GH, ONE_FORTSTRING_ARG) { ONE_FORTSTRING_CREATE (varname); - *ierror = CCTK_SyncGroupWithVar (GH, varname); + *ierror = CCTK_SyncGroupWithVar (*GH, varname); free (varname); } @@ -179,9 +179,9 @@ int CCTK_SyncGroupWithVarI (const cGH *GH, int var) } void CCTK_FCALL CCTK_FNAME (CCTK_SyncGroupWithVarI) - (int *ierror, const cGH *GH, const int *var) + (int *ierror, const cGH **GH, const int *var) { - *ierror = CCTK_SyncGroupWithVarI (GH, *var); + *ierror = CCTK_SyncGroupWithVarI (*GH, *var); } diff --git a/src/comm/Interp.c b/src/comm/Interp.c index a31cbfb3..53c9001a 100644 --- a/src/comm/Interp.c +++ b/src/comm/Interp.c @@ -58,7 +58,7 @@ void CCTK_FCALL CCTK_FNAME (CCTK_InterpHandle) ONE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_InterpGV) (int *fortranreturn, - cGH *GH, + cGH **GH, const int *operator_handle, const int *coord_system_handle, const int *num_points, @@ -67,7 +67,7 @@ void CCTK_FCALL CCTK_FNAME (CCTK_InterpGV) ...); void CCTK_FCALL CCTK_FNAME (CCTK_InterpLocal) (int *fortranreturn, - cGH *GH, + cGH **GH, const int *operator_handle, const int *num_points, const int *num_dims, @@ -76,7 +76,7 @@ void CCTK_FCALL CCTK_FNAME (CCTK_InterpLocal) ...); void CCTK_FCALL CCTK_FNAME (CCTK_InterpGridArrays) (int *ierror, - const cGH *GH, + const cGH **GH, const int *N_dims, const int *local_interp_handle, const int *param_table_handle, @@ -757,7 +757,7 @@ int CCTK_InterpGV (cGH *GH, void CCTK_FCALL CCTK_FNAME (CCTK_InterpGV) (int *fortranreturn, - cGH *GH, + cGH **GH, const int *operator_handle, const int *coord_system_handle, const int *num_points, @@ -815,7 +815,7 @@ void CCTK_FCALL CCTK_FNAME (CCTK_InterpGV) VARARGS_TO_ARRAY (out_array_types, int *, *, *num_out_arrays, indices); va_end (indices); - retcode = operator->interp_operator_GV (GH, coord_system, *num_points, + retcode = operator->interp_operator_GV (*GH, coord_system, *num_points, *num_in_array_indices, *num_out_arrays, interp_coord_arrays, @@ -1014,7 +1014,7 @@ int CCTK_InterpLocal (cGH *GH, void CCTK_FCALL CCTK_FNAME (CCTK_InterpLocal) (int *fortranreturn, - cGH *GH, + cGH **GH, const int *operator_handle, const int *num_points, const int *num_dims, @@ -1072,7 +1072,7 @@ void CCTK_FCALL CCTK_FNAME (CCTK_InterpLocal) VARARGS_TO_ARRAY (out_array_types, int *, *, *num_out_arrays, indices); va_end (indices); - retcode = operator->interp_operator_local (GH, *num_points, *num_dims, + retcode = operator->interp_operator_local (*GH, *num_points, *num_dims, *num_in_arrays, *num_out_arrays, coord_dims, coord_arrays, coord_array_types, @@ -1189,7 +1189,7 @@ void CCTK_FCALL CCTK_FNAME (CCTK_InterpLocal) @@*/ void CCTK_FCALL CCTK_FNAME (CCTK_InterpGridArrays) (int *ierror, - const cGH *GH, + const cGH **GH, const int *N_dims, const int *local_interp_handle, const int *param_table_handle, @@ -1203,7 +1203,7 @@ void CCTK_FCALL CCTK_FNAME (CCTK_InterpGridArrays) const CCTK_INT output_array_types[], void *const output_arrays[]) { - *ierror = CCTK_InterpGridArrays (GH, *N_dims, *local_interp_handle, + *ierror = CCTK_InterpGridArrays (*GH, *N_dims, *local_interp_handle, *param_table_handle, *coord_system_handle, *N_interp_points, *interp_coords_type, interp_coords, diff --git a/src/comm/OverloadComm.c b/src/comm/OverloadComm.c index 1b4aa34d..eeb1c253 100644 --- a/src/comm/OverloadComm.c +++ b/src/comm/OverloadComm.c @@ -145,84 +145,84 @@ int CCTKi_SetupCommFunctions(void) /* Fortran bindings prototypes for the comm functions */ -int CCTK_FCALL CCTK_FNAME (CCTK_nProcs) (const cGH *GH); -int CCTK_FCALL CCTK_FNAME (CCTK_MyProc) (const cGH *GH); -void CCTK_FCALL CCTK_FNAME (CCTK_Barrier) (int *ierror, const cGH *GH); -void CCTK_FCALL CCTK_FNAME (CCTK_Exit) (int *ierror, cGH *GH, const int *retval); -void CCTK_FCALL CCTK_FNAME (CCTK_Abort) (int *ierror, cGH *GH, const int *retval); -void CCTK_FCALL CCTK_FNAME (CCTK_SyncGroup) (int *ierror, cGH *GH, ONE_FORTSTRING_ARG); -void CCTK_FCALL CCTK_FNAME (CCTK_EnableGroupComm) (int *ierror, const cGH *GH, ONE_FORTSTRING_ARG); -void CCTK_FCALL CCTK_FNAME (CCTK_DisableGroupComm) (int *ierror, const cGH *GH, ONE_FORTSTRING_ARG); -void CCTK_FCALL CCTK_FNAME (CCTK_EnableGroupStorage) (int *ierror, const cGH *GH, ONE_FORTSTRING_ARG); -void CCTK_FCALL CCTK_FNAME (CCTK_DisableGroupStorage) (int *ierror, const cGH *GH, ONE_FORTSTRING_ARG); -void CCTK_FCALL CCTK_FNAME (CCTK_QueryGroupStorage) (int *ierror, const cGH *GH, ONE_FORTSTRING_ARG); +int CCTK_FCALL CCTK_FNAME (CCTK_nProcs) (const cGH **GH); +int CCTK_FCALL CCTK_FNAME (CCTK_MyProc) (const cGH **GH); +void CCTK_FCALL CCTK_FNAME (CCTK_Barrier) (int *ierror, const cGH **GH); +void CCTK_FCALL CCTK_FNAME (CCTK_Exit) (int *ierror, cGH **GH, const int *retval); +void CCTK_FCALL CCTK_FNAME (CCTK_Abort) (int *ierror, cGH **GH, const int *retval); +void CCTK_FCALL CCTK_FNAME (CCTK_SyncGroup) (int *ierror, cGH **GH, ONE_FORTSTRING_ARG); +void CCTK_FCALL CCTK_FNAME (CCTK_EnableGroupComm) (int *ierror, const cGH **GH, ONE_FORTSTRING_ARG); +void CCTK_FCALL CCTK_FNAME (CCTK_DisableGroupComm) (int *ierror, const cGH **GH, ONE_FORTSTRING_ARG); +void CCTK_FCALL CCTK_FNAME (CCTK_EnableGroupStorage) (int *ierror, const cGH **GH, ONE_FORTSTRING_ARG); +void CCTK_FCALL CCTK_FNAME (CCTK_DisableGroupStorage) (int *ierror, const cGH **GH, ONE_FORTSTRING_ARG); +void CCTK_FCALL CCTK_FNAME (CCTK_QueryGroupStorage) (int *ierror, const cGH **GH, ONE_FORTSTRING_ARG); /* Fortran bindings definitions for the comm functions */ -int CCTK_FCALL CCTK_FNAME (CCTK_nProcs) (const cGH *GH) +int CCTK_FCALL CCTK_FNAME (CCTK_nProcs) (const cGH **GH) { - return (CCTK_nProcs (GH)); + return (CCTK_nProcs (*GH)); } -int CCTK_FCALL CCTK_FNAME (CCTK_MyProc) (const cGH *GH) +int CCTK_FCALL CCTK_FNAME (CCTK_MyProc) (const cGH **GH) { - return (CCTK_MyProc (GH)); + return (CCTK_MyProc (*GH)); } -void CCTK_FCALL CCTK_FNAME (CCTK_Barrier) (int *ierror, const cGH *GH) +void CCTK_FCALL CCTK_FNAME (CCTK_Barrier) (int *ierror, const cGH **GH) { - *ierror = CCTK_Barrier (GH); + *ierror = CCTK_Barrier (*GH); } -void CCTK_FCALL CCTK_FNAME (CCTK_Exit) (int *ierror, cGH *GH, const int *retval) +void CCTK_FCALL CCTK_FNAME (CCTK_Exit) (int *ierror, cGH **GH, const int *retval) { - *ierror = CCTK_Exit (GH, *retval); + *ierror = CCTK_Exit (*GH, *retval); } -void CCTK_FCALL CCTK_FNAME (CCTK_Abort) (int *ierror, cGH *GH, const int *retval) +void CCTK_FCALL CCTK_FNAME (CCTK_Abort) (int *ierror, cGH **GH, const int *retval) { - *ierror = CCTK_Abort (GH, *retval); + *ierror = CCTK_Abort (*GH, *retval); } -void CCTK_FCALL CCTK_FNAME (CCTK_SyncGroup) (int *ierror, cGH *GH, ONE_FORTSTRING_ARG) +void CCTK_FCALL CCTK_FNAME (CCTK_SyncGroup) (int *ierror, cGH **GH, ONE_FORTSTRING_ARG) { ONE_FORTSTRING_CREATE (group_name) - *ierror = CCTK_SyncGroup (GH, group_name); + *ierror = CCTK_SyncGroup (*GH, group_name); free (group_name); } -void CCTK_FCALL CCTK_FNAME (CCTK_EnableGroupComm) (int *ierror, const cGH *GH, ONE_FORTSTRING_ARG) +void CCTK_FCALL CCTK_FNAME (CCTK_EnableGroupComm) (int *ierror, const cGH **GH, ONE_FORTSTRING_ARG) { ONE_FORTSTRING_CREATE (group_name) - *ierror = CCTK_EnableGroupComm (GH, group_name); + *ierror = CCTK_EnableGroupComm (*GH, group_name); free (group_name); } -void CCTK_FCALL CCTK_FNAME (CCTK_DisableGroupComm) (int *ierror, const cGH *GH, ONE_FORTSTRING_ARG) +void CCTK_FCALL CCTK_FNAME (CCTK_DisableGroupComm) (int *ierror, const cGH **GH, ONE_FORTSTRING_ARG) { ONE_FORTSTRING_CREATE (group_name) - *ierror = CCTK_DisableGroupComm (GH, group_name); + *ierror = CCTK_DisableGroupComm (*GH, group_name); free (group_name); } -void CCTK_FCALL CCTK_FNAME (CCTK_EnableGroupStorage) (int *ierror, const cGH *GH, ONE_FORTSTRING_ARG) +void CCTK_FCALL CCTK_FNAME (CCTK_EnableGroupStorage) (int *ierror, const cGH **GH, ONE_FORTSTRING_ARG) { ONE_FORTSTRING_CREATE (group_name) - *ierror = CCTK_EnableGroupStorage (GH, group_name); + *ierror = CCTK_EnableGroupStorage (*GH, group_name); free (group_name); } -void CCTK_FCALL CCTK_FNAME (CCTK_DisableGroupStorage) (int *ierror, const cGH *GH, ONE_FORTSTRING_ARG) +void CCTK_FCALL CCTK_FNAME (CCTK_DisableGroupStorage) (int *ierror, const cGH **GH, ONE_FORTSTRING_ARG) { ONE_FORTSTRING_CREATE (group_name) - *ierror = CCTK_DisableGroupStorage (GH, group_name); + *ierror = CCTK_DisableGroupStorage (*GH, group_name); free (group_name); } -void CCTK_FCALL CCTK_FNAME (CCTK_QueryGroupStorage) (int *ierror, const cGH *GH, ONE_FORTSTRING_ARG) +void CCTK_FCALL CCTK_FNAME (CCTK_QueryGroupStorage) (int *ierror, const cGH **GH, ONE_FORTSTRING_ARG) { extern int CCTK_QueryGroupStorage (const cGH *, const char *); ONE_FORTSTRING_CREATE (group_name) - *ierror = CCTK_QueryGroupStorage (GH, group_name); + *ierror = CCTK_QueryGroupStorage (*GH, group_name); free (group_name); } diff --git a/src/comm/Reduction.c b/src/comm/Reduction.c index 8d68ad3b..186fc9f5 100644 --- a/src/comm/Reduction.c +++ b/src/comm/Reduction.c @@ -39,7 +39,7 @@ void CCTK_FCALL CCTK_FNAME(CCTK_ReductionArrayHandle) (int *operation_handle, ONE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME(CCTK_Reduce) (int *fortranreturn, - const cGH *GH, + const cGH **GH, const int *proc, const int *operation_handle, const int *num_out_vals, @@ -49,7 +49,7 @@ void CCTK_FCALL CCTK_FNAME(CCTK_Reduce) ... ); void CCTK_FCALL CCTK_FNAME(CCTK_ReduceArray) (int *fortran_return, - const cGH *GH, + const cGH **GH, const int *proc, const int *operation_handle, const int *num_out_vals, @@ -63,7 +63,7 @@ void CCTK_FCALL CCTK_FNAME(CCTK_ReduceArray) /* FIXME: OLD INTERFACE */ void CCTK_FCALL CCTK_FNAME(CCTK_ReduceLocalScalar) (int *fortran_return, - const cGH *GH, + const cGH **GH, const int *proc, const int *operation_handle, const void *in_scalar, @@ -71,7 +71,7 @@ void CCTK_FCALL CCTK_FNAME(CCTK_ReduceLocalScalar) const int *data_type); void CCTK_FCALL CCTK_FNAME(CCTK_ReduceLocScalar) (int *fortran_return, - const cGH *GH, + const cGH **GH, const int *proc, const int *operation_handle, const void *in_scalar, @@ -79,7 +79,7 @@ void CCTK_FCALL CCTK_FNAME(CCTK_ReduceLocScalar) const int *data_type); void CCTK_FCALL CCTK_FNAME(CCTK_ReduceLocalArray1D) (int *fortran_return, - const cGH *GH, + const cGH **GH, const int *proc, const int *operation_handle, const void *in_array1d, @@ -88,7 +88,7 @@ void CCTK_FCALL CCTK_FNAME(CCTK_ReduceLocalArray1D) const int *data_type); void CCTK_FCALL CCTK_FNAME(CCTK_ReduceLocArrayToArray1D) (int *fortran_return, - const cGH *GH, + const cGH **GH, const int *proc, const int *operation_handle, const void *in_array1d, @@ -96,7 +96,7 @@ void CCTK_FCALL CCTK_FNAME(CCTK_ReduceLocArrayToArray1D) const int *num_in_array1d, const int *data_type); void CCTK_FCALL CCTK_FNAME(CCTK_ReduceLocArrayToArray2D) - (int *fortran_return, const cGH *GH, + (int *fortran_return, const cGH **GH, const int *proc, const int *operation_handle, const void *in_array2d, @@ -104,7 +104,7 @@ void CCTK_FCALL CCTK_FNAME(CCTK_ReduceLocArrayToArray2D) const int *xsize, const int *ysize, const int *data_type); void CCTK_FCALL CCTK_FNAME(CCTK_ReduceLocArrayToArray3D) - (int *fortran_return, const cGH *GH, + (int *fortran_return, const cGH **GH, const int *proc, const int *operation_handle, const void *in_array3d, @@ -340,7 +340,7 @@ int CCTK_Reduce(const cGH *GH, void CCTK_FCALL CCTK_FNAME(CCTK_Reduce) (int *fortranreturn, - const cGH *GH, + const cGH **GH, const int *proc, const int *operation_handle, const int *num_out_vals, @@ -389,7 +389,7 @@ void CCTK_FCALL CCTK_FNAME(CCTK_Reduce) } va_end(indices); - retval = operator->reduce_operator (GH, *proc, *num_out_vals, + retval = operator->reduce_operator (*GH, *proc, *num_out_vals, *type_out_vals, out_vals, *num_in_fields,in_fields); @@ -624,7 +624,7 @@ int CCTK_ReduceArray(const cGH *GH, void CCTK_FCALL CCTK_FNAME(CCTK_ReduceArray) (int *fortran_return, - const cGH *GH, + const cGH **GH, const int *proc, const int *operation_handle, const int *num_out_vals, @@ -683,7 +683,7 @@ void CCTK_FCALL CCTK_FNAME(CCTK_ReduceArray) va_end (varargs); - *fortran_return = data->function (GH, *proc, *num_dims, dims, + *fortran_return = data->function (*GH, *proc, *num_dims, dims, *num_in_arrays, in_arrays, *type_in_arrays, *num_out_vals, out_vals, *type_out_vals); free (in_arrays); @@ -742,14 +742,14 @@ int CCTK_ReduceLocalScalar (const cGH *GH, int proc, int operation_handle, /*** FIXME: OLD INTERFACE gerd ***/ void CCTK_FCALL CCTK_FNAME(CCTK_ReduceLocalScalar) (int *fortran_return, - const cGH *GH, + const cGH **GH, const int *proc, const int *operation_handle, const void *in_scalar, void *out_scalar, const int *data_type) { - *fortran_return = CCTK_ReduceArray (GH, *proc, *operation_handle, + *fortran_return = CCTK_ReduceArray (*GH, *proc, *operation_handle, 1, *data_type, out_scalar, 1, 1, *data_type, 1, in_scalar); } @@ -765,14 +765,14 @@ int CCTK_ReduceLocScalar (const cGH *GH, int proc, int operation_handle, void CCTK_FCALL CCTK_FNAME(CCTK_ReduceLocScalar) (int *fortran_return, - const cGH *GH, + const cGH **GH, const int *proc, const int *operation_handle, const void *in_scalar, void *out_scalar, const int *data_type) { - *fortran_return = CCTK_ReduceArray (GH, *proc, *operation_handle, + *fortran_return = CCTK_ReduceArray (*GH, *proc, *operation_handle, 1, *data_type, out_scalar, 1, 1, *data_type, 1, in_scalar); } @@ -813,7 +813,7 @@ int CCTK_ReduceLocArrayToArray1D(const cGH *GH, int proc, int operation_handle, /*** FIXME: OLD INTERFACE gerd ***/ void CCTK_FCALL CCTK_FNAME(CCTK_ReduceLocalArray1D) (int *fortran_return, - const cGH *GH, + const cGH **GH, const int *proc, const int *operation_handle, const void *in_array1d, @@ -821,7 +821,7 @@ void CCTK_FCALL CCTK_FNAME(CCTK_ReduceLocalArray1D) const int *num_in_array1d, const int *data_type) { - *fortran_return = CCTK_ReduceArray (GH, *proc, *operation_handle, + *fortran_return = CCTK_ReduceArray (*GH, *proc, *operation_handle, *num_in_array1d, *data_type, out_array1d, 1, 1, *data_type, *num_in_array1d, in_array1d); @@ -841,7 +841,7 @@ void CCTK_FCALL CCTK_FNAME(CCTK_ReduceLocalArray1D) void CCTK_FCALL CCTK_FNAME(CCTK_ReduceLocArrayToArray1D) (int *fortran_return, - const cGH *GH, + const cGH **GH, const int *proc, const int *operation_handle, const void *in_array1d, @@ -849,7 +849,7 @@ void CCTK_FCALL CCTK_FNAME(CCTK_ReduceLocArrayToArray1D) const int *num_in_array1d, const int *data_type) { - *fortran_return = CCTK_ReduceArray (GH, *proc, *operation_handle, + *fortran_return = CCTK_ReduceArray (*GH, *proc, *operation_handle, *num_in_array1d, *data_type, out_array1d, 1, 1, *data_type, *num_in_array1d, in_array1d); @@ -881,7 +881,7 @@ int CCTK_ReduceLocArrayToArray2D(const cGH *GH, int proc, int operation_handle, } void CCTK_FCALL CCTK_FNAME(CCTK_ReduceLocArrayToArray2D) - (int *fortran_return, const cGH *GH, + (int *fortran_return, const cGH **GH, const int *proc, const int *operation_handle, const void *in_array2d, @@ -890,7 +890,7 @@ void CCTK_FCALL CCTK_FNAME(CCTK_ReduceLocArrayToArray2D) const int *data_type) { int lin_size = (*xsize)*(*ysize); - *fortran_return = CCTK_ReduceArray (GH, *proc, *operation_handle, + *fortran_return = CCTK_ReduceArray (*GH, *proc, *operation_handle, lin_size, *data_type, out_array2d, 2, 1, *data_type, @@ -924,7 +924,7 @@ int CCTK_ReduceLocArrayToArray3D(const cGH *GH, int proc, int operation_handle, } void CCTK_FCALL CCTK_FNAME(CCTK_ReduceLocArrayToArray3D) - (int *fortran_return, const cGH *GH, + (int *fortran_return, const cGH **GH, const int *proc, const int *operation_handle, const void *in_array3d, @@ -933,7 +933,7 @@ void CCTK_FCALL CCTK_FNAME(CCTK_ReduceLocArrayToArray3D) const int *data_type) { int lin_size = (*xsize)*(*ysize)*(*zsize); - *fortran_return = CCTK_ReduceArray (GH, *proc, *operation_handle, + *fortran_return = CCTK_ReduceArray (*GH, *proc, *operation_handle, lin_size, *data_type, out_array3d, 3, 1, *data_type, diff --git a/src/include/cGH.h b/src/include/cGH.h index 0fa98a9c..2ff557d6 100644 --- a/src/include/cGH.h +++ b/src/include/cGH.h @@ -21,8 +21,13 @@ typedef struct char comm; } cGHGroupData; -typedef struct +typedef struct _cGH { + /* Pointer to self. This is a temporary measure to provide a safety + net while the passing of pointers to and from Fortran is + changed. */ + struct _cGH *self; + int cctk_dim; int cctk_iteration; diff --git a/src/include/cctk.h b/src/include/cctk.h index 22f0fe20..74924b47 100644 --- a/src/include/cctk.h +++ b/src/include/cctk.h @@ -244,7 +244,7 @@ inline int CCTK_GFINDEX4D (const cGH *GH, int i, int j, int k, int l) &((xGH)->cctk_convlevel),\ (xGH)->cctk_nghostzones,\ &((xGH)->cctk_iteration),\ - (xGH) + &(xGH) #define _CCTK_C2F_PROTO int *,\ int *,\ int *,int *, int *, int *, int *,int *,int *,\ @@ -257,7 +257,7 @@ inline int CCTK_GFINDEX4D (const cGH *GH, int i, int j, int k, int l) int *,\ int *,\ int *,\ - cGH * + cGH ** #define CCTK_EQUALS(a,b) (CCTK_Equals((a),(b))) diff --git a/src/main/Coord.c b/src/main/Coord.c index 1e9cc6f8..2dc4fded 100644 --- a/src/main/Coord.c +++ b/src/main/Coord.c @@ -87,14 +87,14 @@ void CCTK_FCALL CCTK_FNAME (CCTK_CoordRegisterData) (int *handle,const int *dir,THREE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_CoordRegisterRange) (int *ierr, - const cGH *GH, + const cGH **GH, const CCTK_REAL *lower, const CCTK_REAL *upper, const int *dir, TWO_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_CoordRegisterRangePhysIndex) (int *ierr, - const cGH *GH, + const cGH **GH, const int *lower, const int *upper, const int *dir, @@ -109,21 +109,21 @@ void CCTK_FCALL CCTK_FNAME (CCTK_CoordDir) (int *dir, TWO_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_CoordRange) (int *ierr, - const cGH *GH, + const cGH **GH, CCTK_REAL *lower, CCTK_REAL *upper, const int *dir, TWO_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_CoordRangePhysIndex) (int *ierr, - const cGH *GH, + const cGH **GH, int *lower, int *upper, const int *dir, TWO_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_CoordLocalRange) (int *ierr, - const cGH *GH, + const cGH **GH, CCTK_REAL *lower, CCTK_REAL *upper, const int *dir, @@ -494,14 +494,14 @@ int CCTK_CoordRegisterRange (const cGH *GH, void CCTK_FCALL CCTK_FNAME (CCTK_CoordRegisterRange) (int *ierr, - const cGH *GH, + const cGH **GH, const CCTK_REAL *lower, const CCTK_REAL *upper, const int *dir, TWO_FORTSTRING_ARG) { TWO_FORTSTRING_CREATE (name, systemname) - *ierr = CCTK_CoordRegisterRange (GH, *lower, *upper, *dir, name, systemname); + *ierr = CCTK_CoordRegisterRange (*GH, *lower, *upper, *dir, name, systemname); free (name); free (systemname); } @@ -667,14 +667,14 @@ int CCTK_CoordRegisterRangePhysIndex (const cGH *GH, void CCTK_FCALL CCTK_FNAME (CCTK_CoordRegisterRangePhysIndex) (int *ierr, - const cGH *GH, + const cGH **GH, const int *lower, const int *upper, const int *dir, TWO_FORTSTRING_ARG) { TWO_FORTSTRING_CREATE (name, systemname) - *ierr = CCTK_CoordRegisterRangePhysIndex (GH, *lower, *upper, *dir, name, systemname); + *ierr = CCTK_CoordRegisterRangePhysIndex (*GH, *lower, *upper, *dir, name, systemname); free (name); free (systemname); } @@ -1136,14 +1136,14 @@ int CCTK_CoordRange (const cGH *GH, void CCTK_FCALL CCTK_FNAME (CCTK_CoordRange) (int *ierr, - const cGH *GH, + const cGH **GH, CCTK_REAL *lower, CCTK_REAL *upper, const int *dir, TWO_FORTSTRING_ARG) { TWO_FORTSTRING_CREATE (name, systemname) - *ierr = CCTK_CoordRange (GH, lower, upper, *dir, name, systemname); + *ierr = CCTK_CoordRange (*GH, lower, upper, *dir, name, systemname); free (name); free (systemname); } @@ -1313,14 +1313,14 @@ int CCTK_CoordRangePhysIndex (const cGH *GH, void CCTK_FCALL CCTK_FNAME (CCTK_CoordRangePhysIndex) (int *ierr, - const cGH *GH, + const cGH **GH, int *lower, int *upper, const int *dir, TWO_FORTSTRING_ARG) { TWO_FORTSTRING_CREATE (name, systemname) - *ierr = CCTK_CoordRangePhysIndex (GH, lower, upper, *dir, name, systemname); + *ierr = CCTK_CoordRangePhysIndex (*GH, lower, upper, *dir, name, systemname); free (name); free (systemname); } @@ -1394,14 +1394,14 @@ int CCTK_CoordLocalRange(const cGH *GH, void CCTK_FCALL CCTK_FNAME (CCTK_CoordLocalRange) (int *ierr, - const cGH *GH, + const cGH **GH, CCTK_REAL *lower, CCTK_REAL *upper, const int *dir, TWO_FORTSTRING_ARG) { TWO_FORTSTRING_CREATE (name, systemname) - *ierr = CCTK_CoordLocalRange (GH, lower, upper, *dir, name, systemname); + *ierr = CCTK_CoordLocalRange (*GH, lower, upper, *dir, name, systemname); free (name); free (systemname); } diff --git a/src/main/GroupsOnGH.c b/src/main/GroupsOnGH.c index 9fa6c8db..49f71272 100644 --- a/src/main/GroupsOnGH.c +++ b/src/main/GroupsOnGH.c @@ -26,160 +26,171 @@ static const char *rcsid = "$Header$"; CCTK_FILEVERSION(main_GroupsOnGH_c); +void CCTK_FCALL CCTK_FNAME(CCTK_VarDataPtr) + (CCTK_POINTER *res, + const cGH **cctkGH, + const int *timelevel, + ONE_FORTSTRING_ARG); +void CCTK_FCALL CCTK_FNAME(CCTK_VarDataPtrI) + (CCTK_POINTER *res, + const cGH **cctkGH, + const int *timelevel, + const int *vindex); + void CCTK_FCALL CCTK_FNAME (CCTK_GrouplbndGI) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *lbnd, const int *groupindex); void CCTK_FCALL CCTK_FNAME (CCTK_GrouplbndGN) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *lbnd, ONE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_GrouplbndVI) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *lbnd, const int *varindex); void CCTK_FCALL CCTK_FNAME (CCTK_GrouplbndVN) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *lbnd, ONE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_GroupubndGI) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *ubnd, const int *groupindex); void CCTK_FCALL CCTK_FNAME (CCTK_GroupubndGN) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *ubnd, ONE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_GroupubndVI) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *ubnd, const int *varindex); void CCTK_FCALL CCTK_FNAME (CCTK_GroupubndVN) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *ubnd, ONE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_GrouplshGI) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *lsh, const int *groupindex); void CCTK_FCALL CCTK_FNAME (CCTK_GrouplshGN) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *lsh, ONE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_GrouplshVI) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *lsh, const int *varindex); void CCTK_FCALL CCTK_FNAME (CCTK_GrouplshVN) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *lsh, ONE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_GroupgshGI) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *gsh, const int *groupindex); void CCTK_FCALL CCTK_FNAME (CCTK_GroupgshGN) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *gsh, ONE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_GroupgshVI) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *gsh, const int *varindex); void CCTK_FCALL CCTK_FNAME (CCTK_GroupgshVN) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *gsh, ONE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_GroupnghostzonesGI) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *nghostzones, const int *groupindex); void CCTK_FCALL CCTK_FNAME (CCTK_GroupnghostzonesGN) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *nghostzones, ONE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_GroupnghostzonesVI) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *nghostzones, const int *varindex); void CCTK_FCALL CCTK_FNAME (CCTK_GroupnghostzonesVN) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *nghostzones, ONE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_GroupbboxGI) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *size, int *bbox, const int *groupindex); void CCTK_FCALL CCTK_FNAME (CCTK_GroupbboxGN) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *size, int *bbox, ONE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_GroupbboxVI) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *size, int *bbox, const int *varindex); void CCTK_FCALL CCTK_FNAME (CCTK_GroupbboxVN) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *size, int *bbox, ONE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_ActiveTimeLevelsVI) - (int *num, const cGH *cctkGH, const int *var); + (int *num, const cGH **cctkGH, const int *var); void CCTK_FCALL CCTK_FNAME (CCTK_ActiveTimeLevelsVN) - (int *num, const cGH *cctkGH, ONE_FORTSTRING_ARG); + (int *num, const cGH **cctkGH, ONE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_ActiveTimeLevelsGI) - (int *num, const cGH *cctkGH, const int *var); + (int *num, const cGH **cctkGH, const int *var); void CCTK_FCALL CCTK_FNAME (CCTK_ActiveTimeLevelsGN) - (int *num, const cGH *cctk, ONE_FORTSTRING_ARG); + (int *num, const cGH **cctkGH, ONE_FORTSTRING_ARG); void CCTK_FCALL CCTK_FNAME (CCTK_ActiveTimeLevels) - (int *num, const cGH *cctkGH, ONE_FORTSTRING_ARG); + (int *num, const cGH **cctkGH, ONE_FORTSTRING_ARG); @@ -250,6 +261,17 @@ void *CCTK_VarDataPtr(const cGH *GH, int timelevel, const char *varname) return retval; } +void CCTK_FCALL CCTK_FNAME(CCTK_VarDataPtr) + (CCTK_POINTER *res, + const cGH **cctkGH, + const int *timelevel, + ONE_FORTSTRING_ARG) +{ + ONE_FORTSTRING_CREATE (varname); + *res = CCTK_VarDataPtr (*cctkGH, *timelevel, varname); + free (varname); +} + /*@@ @routine CCTK_VarDataPtrI @date Tue 6th April 1999 @@ -313,6 +335,15 @@ void *CCTK_VarDataPtrI(const cGH *GH, int timelevel, int vindex) return retval; } +void CCTK_FCALL CCTK_FNAME(CCTK_VarDataPtrI) + (CCTK_POINTER *res, + const cGH **cctkGH, + const int *timelevel, + const int *vindex) +{ + *res = CCTK_VarDataPtrI (*cctkGH, *timelevel, *vindex); +} + /*@@ @routine CCTK_VarDataPtrB @date Tue 6th April 1999 @@ -506,11 +537,11 @@ int CCTK_ActiveTimeLevels(const cGH *GH, const char *groupname) } void CCTK_FCALL CCTK_FNAME (CCTK_ActiveTimeLevels) (int *timelevels, - const cGH *cctkGH, + const cGH **cctkGH, ONE_FORTSTRING_ARG) { ONE_FORTSTRING_CREATE (groupname) - *timelevels = CCTK_ActiveTimeLevels (cctkGH, groupname); + *timelevels = CCTK_ActiveTimeLevels (*cctkGH, groupname); free (groupname); } @@ -532,11 +563,11 @@ int CCTK_ActiveTimeLevelsGN(const cGH *GH, const char *groupname) } void CCTK_FCALL CCTK_FNAME (CCTK_ActiveTimeLevelsGN) (int *timelevels, - const cGH *cctkGH, + const cGH **cctkGH, ONE_FORTSTRING_ARG) { ONE_FORTSTRING_CREATE (groupname) - *timelevels = CCTK_ActiveTimeLevels (cctkGH, groupname); + *timelevels = CCTK_ActiveTimeLevels (*cctkGH, groupname); free (groupname); } @@ -559,10 +590,10 @@ int CCTK_ActiveTimeLevelsGI(const cGH *GH, int gindex) } void CCTK_FCALL CCTK_FNAME (CCTK_ActiveTimeLevelsGI) (int *timelevels, - const cGH *cctkGH, + const cGH **cctkGH, const int *gindex) { - *timelevels = CCTK_ActiveTimeLevelsGI (cctkGH, *gindex); + *timelevels = CCTK_ActiveTimeLevelsGI (*cctkGH, *gindex); } @@ -587,11 +618,11 @@ int CCTK_ActiveTimeLevelsVN(const cGH *GH, const char *varname) } void CCTK_FCALL CCTK_FNAME (CCTK_ActiveTimeLevelsVN) (int *timelevels, - const cGH *cctkGH, + const cGH **cctkGH, ONE_FORTSTRING_ARG) { ONE_FORTSTRING_CREATE (varname) - *timelevels = CCTK_ActiveTimeLevelsVN (cctkGH, varname); + *timelevels = CCTK_ActiveTimeLevelsVN (*cctkGH, varname); free (varname); } @@ -616,10 +647,10 @@ int CCTK_ActiveTimeLevelsVI(const cGH *GH, int vindex) } void CCTK_FCALL CCTK_FNAME (CCTK_ActiveTimeLevelsVI) (int *timelevels, - const cGH *cctkGH, + const cGH **cctkGH, const int *vindex) { - *timelevels = CCTK_ActiveTimeLevelsVI (cctkGH, *vindex); + *timelevels = CCTK_ActiveTimeLevelsVI (*cctkGH, *vindex); } @@ -700,12 +731,12 @@ int CCTK_GrouplbndGI(const cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GrouplbndGI) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *lbnd, const int *groupindex) { - *ierr = CCTK_GrouplbndGI (cctkGH, *dim, lbnd, *groupindex); + *ierr = CCTK_GrouplbndGI (*cctkGH, *dim, lbnd, *groupindex); } @@ -734,13 +765,13 @@ int CCTK_GrouplbndGN(const cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GrouplbndGN) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *lbnd, ONE_FORTSTRING_ARG) { ONE_FORTSTRING_CREATE (groupname) - *ierr = CCTK_GrouplbndGN (cctkGH, *dim, lbnd, groupname); + *ierr = CCTK_GrouplbndGN (*cctkGH, *dim, lbnd, groupname); free (groupname); } @@ -771,12 +802,12 @@ int CCTK_GrouplbndVI(const cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GrouplbndVI) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *lbnd, const int *varindex) { - *ierr = CCTK_GrouplbndVI (cctkGH, *dim, lbnd, *varindex); + *ierr = CCTK_GrouplbndVI (*cctkGH, *dim, lbnd, *varindex); } @@ -805,13 +836,13 @@ int CCTK_GrouplbndVN(const cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GrouplbndVN) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *lbnd, ONE_FORTSTRING_ARG) { ONE_FORTSTRING_CREATE (varname) - *ierr = CCTK_GrouplbndVN (cctkGH, *dim, lbnd, varname); + *ierr = CCTK_GrouplbndVN (*cctkGH, *dim, lbnd, varname); free (varname); } @@ -875,12 +906,12 @@ int CCTK_GroupubndGI(const cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GroupubndGI) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *ubnd, const int *groupindex) { - *ierr = CCTK_GroupubndGI (cctkGH, *dim, ubnd, *groupindex); + *ierr = CCTK_GroupubndGI (*cctkGH, *dim, ubnd, *groupindex); } @@ -909,13 +940,13 @@ int CCTK_GroupubndGN(const cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GroupubndGN) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *ubnd, ONE_FORTSTRING_ARG) { ONE_FORTSTRING_CREATE (groupname) - *ierr = CCTK_GroupubndGN (cctkGH, *dim, ubnd, groupname); + *ierr = CCTK_GroupubndGN (*cctkGH, *dim, ubnd, groupname); free (groupname); } @@ -946,12 +977,12 @@ int CCTK_GroupubndVI(const cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GroupubndVI) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *ubnd, const int *varindex) { - *ierr = CCTK_GroupubndVI (cctkGH, *dim, ubnd, *varindex); + *ierr = CCTK_GroupubndVI (*cctkGH, *dim, ubnd, *varindex); } @@ -980,13 +1011,13 @@ int CCTK_GroupubndVN(const cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GroupubndVN) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *ubnd, ONE_FORTSTRING_ARG) { ONE_FORTSTRING_CREATE (varname) - *ierr = CCTK_GroupubndVN (cctkGH, *dim, ubnd, varname); + *ierr = CCTK_GroupubndVN (*cctkGH, *dim, ubnd, varname); free (varname); } @@ -1050,12 +1081,12 @@ int CCTK_GrouplshGI(const cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GrouplshGI) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *lsh, const int *groupindex) { - *ierr = CCTK_GrouplshGI (cctkGH, *dim, lsh, *groupindex); + *ierr = CCTK_GrouplshGI (*cctkGH, *dim, lsh, *groupindex); } @@ -1084,13 +1115,13 @@ int CCTK_GrouplshGN(const cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GrouplshGN) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *lsh, ONE_FORTSTRING_ARG) { ONE_FORTSTRING_CREATE (groupname) - *ierr = CCTK_GrouplshGN (cctkGH, *dim, lsh, groupname); + *ierr = CCTK_GrouplshGN (*cctkGH, *dim, lsh, groupname); free (groupname); } @@ -1121,12 +1152,12 @@ int CCTK_GrouplshVI(const cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GrouplshVI) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *lsh, const int *varindex) { - *ierr = CCTK_GrouplshVI (cctkGH, *dim, lsh, *varindex); + *ierr = CCTK_GrouplshVI (*cctkGH, *dim, lsh, *varindex); } @@ -1155,13 +1186,13 @@ int CCTK_GrouplshVN(const cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GrouplshVN) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *lsh, ONE_FORTSTRING_ARG) { ONE_FORTSTRING_CREATE (varname) - *ierr = CCTK_GrouplshVN (cctkGH, *dim, lsh, varname); + *ierr = CCTK_GrouplshVN (*cctkGH, *dim, lsh, varname); free (varname); } @@ -1225,12 +1256,12 @@ int CCTK_GroupgshGI(const cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GroupgshGI) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *gsh, const int *groupindex) { - *ierr = CCTK_GroupgshGI (cctkGH, *dim, gsh, *groupindex); + *ierr = CCTK_GroupgshGI (*cctkGH, *dim, gsh, *groupindex); } @@ -1259,13 +1290,13 @@ int CCTK_GroupgshGN(const cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GroupgshGN) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *gsh, ONE_FORTSTRING_ARG) { ONE_FORTSTRING_CREATE (groupname) - *ierr = CCTK_GroupgshGN (cctkGH, *dim, gsh, groupname); + *ierr = CCTK_GroupgshGN (*cctkGH, *dim, gsh, groupname); free (groupname); } @@ -1296,12 +1327,12 @@ int CCTK_GroupgshVI(const cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GroupgshVI) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *gsh, const int *varindex) { - *ierr = CCTK_GroupgshVI (cctkGH, *dim, gsh, *varindex); + *ierr = CCTK_GroupgshVI (*cctkGH, *dim, gsh, *varindex); } @@ -1330,13 +1361,13 @@ int CCTK_GroupgshVN(const cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GroupgshVN) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *gsh, ONE_FORTSTRING_ARG) { ONE_FORTSTRING_CREATE (varname) - *ierr = CCTK_GroupgshVN (cctkGH, *dim, gsh, varname); + *ierr = CCTK_GroupgshVN (*cctkGH, *dim, gsh, varname); free (varname); } @@ -1401,12 +1432,12 @@ int CCTK_GroupnghostzonesGI(const cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GroupnghostzonesGI) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *nghostzones, const int *groupindex) { - *ierr = CCTK_GroupnghostzonesGI (cctkGH, *dim, nghostzones, *groupindex); + *ierr = CCTK_GroupnghostzonesGI (*cctkGH, *dim, nghostzones, *groupindex); } @@ -1435,13 +1466,13 @@ int CCTK_GroupnghostzonesGN(const cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GroupnghostzonesGN) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *nghostzones, ONE_FORTSTRING_ARG) { ONE_FORTSTRING_CREATE (groupname) - *ierr = CCTK_GroupnghostzonesGN (cctkGH, *dim, nghostzones, groupname); + *ierr = CCTK_GroupnghostzonesGN (*cctkGH, *dim, nghostzones, groupname); free (groupname); } @@ -1472,12 +1503,12 @@ int CCTK_GroupnghostzonesVI(const cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GroupnghostzonesVI) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *nghostzones, const int *varindex) { - *ierr = CCTK_GroupnghostzonesVI (cctkGH, *dim, nghostzones, *varindex); + *ierr = CCTK_GroupnghostzonesVI (*cctkGH, *dim, nghostzones, *varindex); } @@ -1506,13 +1537,13 @@ int CCTK_GroupnghostzonesVN(const cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GroupnghostzonesVN) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *dim, int *nghostzones, ONE_FORTSTRING_ARG) { ONE_FORTSTRING_CREATE (varname) - *ierr = CCTK_GroupnghostzonesVN (cctkGH, *dim, nghostzones, varname); + *ierr = CCTK_GroupnghostzonesVN (*cctkGH, *dim, nghostzones, varname); free (varname); } @@ -1575,12 +1606,12 @@ int CCTK_GroupbboxGI(const cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GroupbboxGI) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *size, int *bbox, const int *groupindex) { - *ierr = CCTK_GroupbboxGI (cctkGH, *size, bbox, *groupindex); + *ierr = CCTK_GroupbboxGI (*cctkGH, *size, bbox, *groupindex); } @@ -1609,13 +1640,13 @@ int CCTK_GroupbboxGN(const cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GroupbboxGN) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *size, int *bbox, ONE_FORTSTRING_ARG) { ONE_FORTSTRING_CREATE(groupname) - *ierr = CCTK_GroupbboxGN(cctkGH, *size, bbox, groupname); + *ierr = CCTK_GroupbboxGN(*cctkGH, *size, bbox, groupname); free(groupname); } @@ -1646,12 +1677,12 @@ int CCTK_GroupbboxVI(const cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GroupbboxVI) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *size, int *bbox, const int *varindex) { - *ierr = CCTK_GroupbboxVI (cctkGH, *size, bbox, *varindex); + *ierr = CCTK_GroupbboxVI (*cctkGH, *size, bbox, *varindex); } @@ -1680,12 +1711,12 @@ int CCTK_GroupbboxVN(const cGH *cctkGH, void CCTK_FCALL CCTK_FNAME (CCTK_GroupbboxVN) (int *ierr, - const cGH *cctkGH, + const cGH **cctkGH, const int *size, int *bbox, ONE_FORTSTRING_ARG) { ONE_FORTSTRING_CREATE (varname) - *ierr = CCTK_GroupbboxVN (cctkGH, *size, bbox, varname); + *ierr = CCTK_GroupbboxVN (*cctkGH, *size, bbox, varname); free (varname); } diff --git a/src/main/Termination.c b/src/main/Termination.c index 47f4f1bd..adb2567a 100644 --- a/src/main/Termination.c +++ b/src/main/Termination.c @@ -23,7 +23,7 @@ static int termination_reached = 0; /******************************************************************** ********************* External Routines ********************** ********************************************************************/ -void CCTK_FCALL CCTK_FNAME (CCTK_TerminateNext) (const cGH *GH); +void CCTK_FCALL CCTK_FNAME (CCTK_TerminateNext) (const cGH **GH); /*@@ @@ -72,7 +72,7 @@ void CCTK_TerminateNext (const cGH *GH) termination_reached = 1; } -void CCTK_FCALL CCTK_FNAME (CCTK_TerminateNext) (const cGH *GH) +void CCTK_FCALL CCTK_FNAME (CCTK_TerminateNext) (const cGH **GH) { - CCTK_TerminateNext (GH); + CCTK_TerminateNext (*GH); } -- cgit v1.2.3