- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
character(len=:), allocatable :: some_string
regards
karl skinner - CVF user but Intel newcomer
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page