summaryrefslogtreecommitdiff
path: root/lib/sbin/GridFuncStuff.pl
diff options
context:
space:
mode:
authorallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>2000-07-10 10:11:34 +0000
committerallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>2000-07-10 10:11:34 +0000
commit9f2a76a2b4c97080c3b3948d6516bd8aacba4fa3 (patch)
treeeda98beedf3bd7b29c5a9c1c2d204d0b8acee141 /lib/sbin/GridFuncStuff.pl
parent6953e994523c03726b56d6784917c74d1ba62a86 (diff)
Check that an array has the same number of sizes as dimensions. There might
be a better way to organise these checks git-svn-id: http://svn.cactuscode.org/flesh/trunk@1719 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/GridFuncStuff.pl')
-rw-r--r--lib/sbin/GridFuncStuff.pl18
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/sbin/GridFuncStuff.pl b/lib/sbin/GridFuncStuff.pl
index 3290eeae..e9dfad4d 100644
--- a/lib/sbin/GridFuncStuff.pl
+++ b/lib/sbin/GridFuncStuff.pl
@@ -1277,12 +1277,28 @@ sub CreateThornGroupInitialisers
my($group, @variables);
my($line);
my(@definitions);
-
+ my ($dim,$string,$numsize,$message,$type);
$imp = $rhinterface_db->{"\U$thorn\E IMPLEMENTS"};
foreach $group (split(" ", $rhinterface_db->{"\U$thorn $block GROUPS"}))
{
+
+ $type = $rhinterface_db->{"\U$thorn GROUP $group\E GTYPE"};
+
+ # Check consistency for arrays
+ if ($type eq "ARRAY")
+ {
+ $dim = $rhinterface_db->{"\U$thorn GROUP $group\E DIM"};
+ $string = $rhinterface_db->{"\U$thorn GROUP $group\E SIZE"};
+ $numsize = ($string =~ s/,//g)+1;
+ if ($dim != $numsize)
+ {
+ $message = "Array dimension $dim doesn't match array sizes for $group in $thorn";
+ &CST_error(0,$message,__LINE__,__FILE__);
+ }
+ }
+
@variables = split(" ", $rhinterface_db->{"\U$thorn GROUP $group\E"});
$line = " CCTKi_CreateGroup(\"\U$group\",\"$thorn\",\"$imp\",\n"