problem with dump in loop

Hi Dear users Lammps
I want to make variable j loop 100 and then dump 20 per each 5 steps .I try so much but I have problem. Is there anyway to dump 20 after 5 steps in loop?
This is my program on Argon :

Argon: NVE simulation

dimension 3

boundary p p p
units metal

atom_style full

create box

region box block -100 100 -100 100 -100 100 units box

create_box 1 box

create geometry

lattice sc 2.0

region cube block -2 2 -2 2 -2 2 units box
create_atoms 1 region cube
mass 1 39.95
group argon type 1
set group argon charge -1
velocity all create 300 4928459 mom yes rot yes dist uniform
pair_style lj/cut 10
pair_coeff * * 0.0104 3.4
fix 1 all nve
thermo 100
timestep 0.001
label LOOP_RESTARTj
variable j loop 100
variable i equal round($j/5)
label LOOP_RESTART
variable COS_J equal cos($j*6)*200
print ā€œ-------------------------------- j = j , {COS_J} ---------------------ā€
fix 11 all efield 0.0 0.0 ${COS_J}
run 1
dump 2 all xyz $i dump.xyz
dump_modify 2 append yes
undump 2
next j
jump in.example1 LOOP_RESTARTj

Iā€™m looking forward to hearing from you soon,
sincerely yours,
Mahbub

Hi Dear users Lammps
I want to make variable j loop 100 and then dump 20 per each 5 steps .I try
so much but I have problem. Is there anyway to dump 20 after 5 steps in
loop?

why don't you just define your dump command outside the loop?

axel.