[lammps-users] loop, next, jump question

Dear all:
Any ideas why the following loop structure fails with:

LAMMPS (22 Jun 2007)
p is 1
p is 2
p is 3
p is 4
p is 5
p is 6
p is 7
p is 8
p is 9
p is 10
p is 11
p is 12
l is 1 t is 1
ERROR on proc 0: Substitution for undefined variable

for the code (see in.test):

variable p loop 12
label ploop
print p is $p
next p
jump in.test ploop
variable t loop 10
label tloop
variable l loop 3
label lloop
print l is $l t is $t
next l
jump in.test lloop
next t
jump in.test tloop

whereas if i exclude the first loop statement the script runs to completion (see in.test_works)? In particualar, is there any reason why a regular loop before or after a nested loop fails?


in.test (212 Bytes)

fail.out (188 Bytes)

in.test_works (140 Bytes)

works.out (89 Bytes)

Just posted a patch on this. It was a bug.