I finally used the halt command successfully using command
timer loop
variable a equal time
fix 100 all halt 1000 v_a > 3
run 100000000
I think I could learn how to use several variable in LAMMPS.
I really appreciate for your advice.
But after jump to next loop, error occur again.
This is log content
thermo 1000
thermo_style custom c_PKA_rx c_PKA_ry c_PKA_rz
WARNING: New thermo_style command, previous thermo_modify settings will be lost (…/output.cpp:902)
run 0
variable shiftx equal -c_PKA_rx+ ( ${Lxbox}/2 )
variable shiftx equal -c_PKA_rx+(107.185762/2)
variable shifty equal -c_PKA_ry+(${Lybox}/2)
variable shifty equal -c_PKA_ry+(107.186759/2)
variable shiftz equal -c_PKA_rz+(${Lzbox}/2)
variable shiftz equal -c_PKA_rz+(107.181923/2)
displace_atoms all move {shiftx} {shifty} ${shiftz} units box
ERROR: Variable shiftx: Compute used in variable between runs is not current (…/variable.cpp:1403)
Last command: displace_atoms all move {shiftx} {shifty} ${shiftz} units box
I think this error is due to halt command because this error didn’t occur without halt command.
I guess halt command reset thermo_style and compute command and make this error.
This is input code.
Iteration
label loop
variable i loop 1000
#log log.shot${i}
reset_timestep 0
timestep ${dtPKA}
Selecting a random PKA
variable tempID equal ceil(random(0,{n_atoms}-1,{i}*23782+19772))
variable pkaID equal {tempID}
group PKA id {pkaID}
Atom Displacement (PKA to the center)
compute massPKA PKA property/atom mass
compute posPKA PKA property/atom x y z
compute PKA_rx all reduce sum c_posPKA[1]
compute PKA_ry all reduce sum c_posPKA[2]
compute PKA_rz all reduce sum c_posPKA[3]
variable PKAmass equal mass(PKA)
thermo 1000
thermo_style custom c_PKA_rx c_PKA_ry c_PKA_rz
run 0
variable shiftx equal -c_PKA_rx+(${Lxbox}/2)
Could you give me a advice to solve this error?