Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28597 Discussions

iso varying string versus allocatable character

skinner__karl
New Contributor I
805 Views
Sorry if this isa daft question, but whyisthe ISO_VARYING_STRING type promoted as a solutionwhen you can do the following?

character(len=:), allocatable :: some_string

regards
karl skinner - CVF user but Intel newcomer
0 Kudos
1 Solution
Steven_L_Intel1
Employee
805 Views
Actually, ISO_VARYING_STRING was never "promoted". The version attached to the Fortran 90 standard had many known flaws, and it was removed from Fortran 2003. Allocatable deferred-length character variables are the way to go now.

View solution in original post

0 Kudos
2 Replies
mecej4
Honored Contributor III
805 Views
I have the impression that ISO_VARYING_STRING is no longer being promoted. That module was a useful solution when only Fortran-95 compilers were available. For example, a Fortran-95 compiler will not accept this program, because reallocation on assignment was not provided for:

[fortran]program tstrng
character(len=:), allocatable :: str1,str2,str3

str1='~First String~'; str2='~Second String~'
str3=str1//str2
print *,str3
end program tstrng
[/fortran]
0 Kudos
Steven_L_Intel1
Employee
806 Views
Actually, ISO_VARYING_STRING was never "promoted". The version attached to the Fortran 90 standard had many known flaws, and it was removed from Fortran 2003. Allocatable deferred-length character variables are the way to go now.
0 Kudos
Reply