Whether there is a bool style variable in lammps?

Dear all,

Recently I met a problem when I tried to reset some environment settings during a single run. The input file is presented below.


run 10000 #for test
write_data Si.data
write_restart Restart.Si
variable myTemp equal temp
if “{myTemp} > 400" then & "variable bottem_top equal Bound(top,zmin)" & "fix wall middle all/reflect zhi v_bottem_top" & "variable ts equal timestep" & "print 'timestep {ts}’” &
“run 300000” &
“write_data Si_stretch.data” &
“write_restart Si_stretch.restart” &
“quit”
run 350000
write_data Si_stretch.data
write_restart Restart.Si_stretch

I want to execute the IF command for only once. The original idea came up to me is to set the command as ‘if "${myTemp} > 400 && once’" and change the numeric value of the once when the if command executed. But iI cannot find a suitable style variable to do this. So I am wondering if there is a suitable variable style to do this job?
Then i set the input file just as above, however, a new error came up with “Compute used in variable thermo keyword between runs is not current”, it seems that it is not allowed to reference to a thermo keyword in a new run while the old run has not yet finished. Is there any way to refer to it?

Regards,
Xiaoneng

Not fully clear what you are asking, but the top of the variable doc page explains
there are some variable styles where you cannot re-define their value, but others
where you can. So if you use the correct style you can re-define the variable once
to be 0 instead of 1 in the body of your if command. This has nothing to do
with thermo keywords that you mention.

Steve