Lets adopt a simpler example to illustrate. Suppose we have a variable with four timesteps (l=4), and we want to plot each timestep in a viewport. We do
vplist = {"ul", "ur", "ll", "lr"}
repeat/range=1:4/name=m ( \
set viewport `vplist[i=m]`; \
fill variable[l=`m`]; \
)
If you have more than four viewports, you'll have to define those viewports before use it. In this case, you can use numbered-sequenced viewport names, such as vp1, vp2, vp3, ..., vpN. This makes your life easier if you have to use these viewports inside a repeat loop, and you should simply use something like the example below.
repeat/range=1:N/name=m ( \
set viewport vp`m`; \
<plot commands>; \
)
Hope it helps.