hello, does anyone know if it is possible to re-initialze a vector (array) in fortran?

I need to keep printing out this vector, it's in a loop statement, but I need to keep filling it with differents amount of data... sometimes 3 numbers sometimes 2 or 5....

when it prints out I only want it to display the numbers I put in

that means I can't just zero it out, because if there were previously 3 entries and I zero it out and next time I only have 2 entries for it well then I will have a zero as the last entry when I print it

does anyone know how I might be anle to re-initialize it?

Thank you