Hello
I am using gfortran and INtel I did this:
Module variables
character(len=:), dimension(:), allocatable, array
end module variables
Sub test
use variables
integer (max_len)
max_len=len_trim("something here")
if(.not.allocated(array)) &
allocate(character = max_len :: array(3))
array = (/'jonas', 'sssssssssssssss','q' /)
end sub test
gfortran compilation gives this errors:
- max_len can not be used in this context:
allocate(character = max_len :: array(3)) allocate(character = max_len :: array(3))
- Different character lenghts in array constructor: array = (/'jonas', 'sssssssssssssss','q' /)
I solved this using a number instead of max_len for the first error;
The second error can only be solved if all strings have the same lenght but this is not desired.
with intel compiler no error is displayed. Why does gfortran report these errors?




