Do loop in input file

Dear LAMMPS users ,

Greetings .
I have two different results let’s say T(i) and H(i) ( thermo_style outputs )
Now I want to calculate third result with doing this do loop :

S = 0.0
Do I = 1 ,N -1
S = S + ( H(I+1) - H(I) ) / T(i)
End do

Can you please let me know How I can write this in input file ?
I could not find a sample so I decided to ask this from you .

Thanks for your attention.
Best ,
Saeed.

I don’t know. Someone may be clever enough to do

that with LAMMPS variables, but the script syntax isn’t really

a programming language. You don’t say why you can’t just

print h,t every iteration to the screen/logfile and just post-calculate

it yourself. You could also look at python-style variables (variable doc page)

and write some python code to do it (in your input script).

Steve