Fix variable naming bug in generate_models.f90.