From 35c85a91626352d648e60837e211238d3cc173a4 Mon Sep 17 00:00:00 2001 From: eschnett Date: Mon, 12 Dec 2011 02:53:50 +0000 Subject: Allow zero timelevels in STORAGE timelevels This allows to simply set timelevels=0 to turn off storage without having to put an "if (do_something timelevels > 0)" into schedule.ccl files. It is also the only way to turn off storage inside of a GROUP of SCHEDULE statement based on a condition (other than scheduling the item twice, once with STORAGE, once without). git-svn-id: http://svn.cactuscode.org/flesh/trunk@4774 17b73243-c579-4c4c-a9d2-2d5706c11dac --- lib/sbin/CreateScheduleBindings.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/sbin/CreateScheduleBindings.pl b/lib/sbin/CreateScheduleBindings.pl index b2b1f7c4..045b5d7a 100644 --- a/lib/sbin/CreateScheduleBindings.pl +++ b/lib/sbin/CreateScheduleBindings.pl @@ -569,10 +569,10 @@ sub ScheduleBlock # add check on number of timelevels in case we were using a parameter for($i=0; $i < @$tlist; $i++) { - $buffer .= " if(!($$tlist[$i] > 0 && $$tlist[$i] <= CCTK_MaxTimeLevels(\"$$mem_groups[$i]\")))\n"; + $buffer .= " if(!($$tlist[$i] >= 0 && $$tlist[$i] <= CCTK_MaxTimeLevels(\"$$mem_groups[$i]\")))\n"; $buffer .= " CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING,\n"; $buffer .= " \"Tried to schedule %d timelevels for group '%s' in schedule.ccl.\\n\"\n"; - $buffer .= " \"Value must be between 1 and %d (inclusive)\",\n"; + $buffer .= " \"Value must be between 0 and %d (inclusive)\",\n"; $buffer .= " $$tlist[$i], \"$$mem_groups[$i]\", CCTK_MaxTimeLevels(\"$$mem_groups[$i]\"));\n"; $buffer .= "\n"; } @@ -703,10 +703,10 @@ sub ScheduleStatement # add check on number of timelevels in case we were using a parameter for($i=0; $i < @$groups; $i++) { - $buffer .= " if(!($$misc[$i] > 0 && $$misc[$i] <= CCTK_MaxTimeLevels(\"$$groups[$i]\")))\n"; + $buffer .= " if(!($$misc[$i] >= 0 && $$misc[$i] <= CCTK_MaxTimeLevels(\"$$groups[$i]\")))\n"; $buffer .= " CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING,\n"; $buffer .= " \"Tried to schedule %d timelevels for group '%s' in schedule.ccl.\\n\"\n"; - $buffer .= " \"Value must be between 1 and %d (inclusive)\",\n"; + $buffer .= " \"Value must be between 0 and %d (inclusive)\",\n"; $buffer .= " $$misc[$i], \"$$groups[$i]\", CCTK_MaxTimeLevels(\"$$groups[$i]\"));\n"; $buffer .= "\n"; } -- cgit v1.2.3