I would like to create a type to contain an array of strings in Fortran without explicitly assigning lengths so I can return it from a function.
The following is my type:
type returnArr
Character (*), dimension(4) :: array
end type returnArr
The following is the function's signature:
type(returnArr) FUNCTION process(arr, mean, stdDev) result(j)
The following is where I try set the result:
j%array(1)= "Test"
But all I get is the following error:
Error: Character length of component ‘array’ needs to be a constant specification expression at (1)
How can I declare the type so that the strings may be of different length?