please consider the following demo program to test formatted and unformatted read/write of character arrays
>> cat charset.F90
character(len=1), dimension(5) :: c1,c2
c1(1) = 's'
c1(2) = 'u'
c1(3) = 'n'
c1(4) = 'n'
c1(5) = 'y'
print *, c2
character, dimension(:), intent(in) :: c
end subroutine write_char
character, dimension(:), intent(out) :: c
end subroutine read_char
end program chartest
1) If this code is compiled for formatted read/write
sunf90 -DUSE_FORMATTED chartest.F90
then the compilation process terminates successfully and the resulting binary program works correctly.
2) Trying to compile this code for unformatted read/write
leads to the following internal error
INTERNAL COMPILER ERROR near line 27 in chartest.F90 (phase ConcretizeProcs):
Assertion failed: array_type && array_type->num_elements(0)->is_computable()
[internal line 1229 /net/feeler/export/home2/spica_intel-Linux/111116/lang/f90/fe/srcme/compiler/phases/concretize/concretize_utl.cpp]
Line 27 is
in subroutine write_char. Interestingly enough, this code compiles well with other compilers such as gcc, g95, ifort, openf90 which makes me believe that the code complies with standard fortran.
Any help will be greatly appreciated.
The error message is given because of a defect in the compiler. The defect is not fixed in the latest patch. I shall file a bug report. If you have a support contract, you can have your support representative escalate the bug report.