summaryrefslogtreecommitdiff
path: root/lib/sbin
diff options
context:
space:
mode:
authoreschnett <eschnett@17b73243-c579-4c4c-a9d2-2d5706c11dac>2011-11-09 13:15:43 +0000
committereschnett <eschnett@17b73243-c579-4c4c-a9d2-2d5706c11dac>2011-11-09 13:15:43 +0000
commitead15be71b6009004b07c9c2013b8c2e066fa02b (patch)
tree508c580a46aa82626dffe69769a9a44af2fd8e29 /lib/sbin
parent3f89ecd574c49e23692bbbdb57ab9d52abc41b77 (diff)
Pass unallocated arrays to Fortran as NULL pointers
The deleted comment is wrong. We should always pass unallocated arrays to Fortran to catch allocation errors. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4768 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin')
-rw-r--r--lib/sbin/GridFuncStuff.pl23
1 files changed, 0 insertions, 23 deletions
diff --git a/lib/sbin/GridFuncStuff.pl b/lib/sbin/GridFuncStuff.pl
index f564d954..20081246 100644
--- a/lib/sbin/GridFuncStuff.pl
+++ b/lib/sbin/GridFuncStuff.pl
@@ -98,25 +98,8 @@ sub CreateVariableBindings
push(@data, '#define PASS_GROUPLEN(thorn, group) CCTKGROUPNUM_##group >= 0 ? \\');
push(@data, ' CCTKi_GroupLengthAsPointer(#thorn "::" #group) : &_cctk_zero');
push(@data, '');
- push(@data, '/*');
- push(@data, ' * References to non-existing or non-allocated variables should be passed');
- push(@data, ' * as NULL pointers in order to catch any invalid access immediately');
- push(@data, ' * However, this runtime debugging feature may cause problems');
- push(@data, ' * with some fortran compilers which require all fortran routine arguments');
- push(@data, ' * to refer to a valid memory location (eg. to enable the code optimizer');
- push(@data, ' * to generate conditional load/store instructions if applicable).');
- push(@data, ' * For this reason, we pass NULL pointers only for debugging configurations,');
- push(@data, ' * and a pointer to a user-accessable memory location (a local dummy variable)');
- push(@data, ' * otherwise.');
- push(@data, ' */');
- push(@data, '#ifdef CCTK_DEBUG');
push(@data, '#define PASS_REFERENCE(var, level) CCTKARGNUM_##var >= 0 ? \\');
push(@data, ' GH->data[CCTKARGNUM_##var][level] : 0');
- push(@data, '#else');
- push(@data, '#define PASS_REFERENCE(var, level) CCTKARGNUM_##var >= 0 && \\');
- push(@data, ' GH->data[CCTKARGNUM_##var][level] ? \\');
- push(@data, ' GH->data[CCTKARGNUM_##var][level] : _cctk_dummy_var');
- push(@data, '#endif');
push(@data, '');
push(@data, '#define CCTK_ARGUMENTS CCTK_CARGUMENTS');
@@ -225,16 +208,10 @@ sub CreateVariableBindings
push(@data, '{');
push(@data, ' cGH *GH = _GH;');
push(@data, ' const int _cctk_zero = 0;');
- push(@data, '#ifndef CCTK_DEBUG');
- push(@data, ' CCTK_COMPLEX _cctk_dummy_var[4];');
- push(@data, '#endif');
push(@data, " void (*function)(\U$thorn\E_C2F_PROTO);");
push(@data, " DECLARE_\U$thorn\E_C2F");
push(@data, " INITIALISE_\U$thorn\E_C2F");
push(@data, ' (void) (_cctk_zero + 0);');
- push(@data, '#ifndef CCTK_DEBUG');
- push(@data, ' (void) (_cctk_dummy_var + 0);');
- push(@data, '#endif');
push(@data, '');
push(@data, " function = (void (*) (\U$thorn\E_C2F_PROTO)) fpointer;");
push(@data, " function (PASS_\U$thorn\E_C2F (GH));");