How to create a character array whose each element is just the right length based on its content?

@FortranFan May I ask, what is string_t ?