Variable::Shape() is not updated over timesteps

Created by: keichi

I have an application that writes a variable whose shape changes every timestep. However, the return value of Variable::Shape() is not updated when reading the file back.

Here is a small piece of code to reproduce this problem (run with one process):

https://gist.github.com/keichi/2afd215e9da0200d2dbf4bd142f1095a

Output:

Writing:
Step 1 shape (1, 3)
Step 2 shape (2, 3)
Step 3 shape (3, 3)
Step 4 shape (4, 3)
Step 5 shape (5, 3)
Step 6 shape (6, 3)
Step 7 shape (7, 3)
Step 8 shape (8, 3)
Step 9 shape (9, 3)
Step 10 shape (10, 3)
Reading:
Step 0 shape (1, 3)
Step 1 shape (1, 3)
Step 2 shape (1, 3)
Step 3 shape (1, 3)
Step 4 shape (1, 3)
Step 5 shape (1, 3)
Step 6 shape (1, 3)
Step 7 shape (1, 3)
Step 8 shape (1, 3)
Step 9 shape (1, 3)

bpls output:

$ bpls -d test.bp
  double   v     10*{1, 3}
    (0,0,0)    0 1 2 0 1 2
    (2,0,0)    0 1 2 0 1 2
    (4,0,0)    0 1 2 0 1 2
    (6,0,0)    0 1 2 0 1 2
    (8,0,0)    0 1 2 0 1 2