Remove MAX_LEN feature, upgrade TENSOR.f90

remove MAX_LEN, restore LEN in MODEL and stop passing it to
subroutines. upgrade TENSOR.f90 to deal with tensor array I/O.