- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[fortran]module keywords implicit none type keyword character(:), allocatable :: c(:) end type keyword type(keyword) :: kw(10) end module keywords !****************************************************** module settings use keywords implicit none contains subroutine save_kw implicit none allocate(character(len=80) :: kw(1)%c(10)) kw(1)%c(1) = 'abcd' if (kw(1)%c(1)(1:1).eq.'a') then ! problem here with substring print *, 'yes' else print *, 'no' endif end subroutine save_kw end module settings !***************************************************** program ice use settings implicit none call save_kw end program ice[/fortran]Is the above valid? In any case, it gives an ICE. The problem is the (1:1) substring reference. It works fine without it and also works if the c() array length is not declared allocatable, iecharacter(80), allocatable:: c(:)array is ok.using w_fcompxe_2011.8.278 : todays update
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The code is valid. Interestingly it only gives an ICE if the substring is the same length as the string it is being compared to. I will escalate this to the developers.
Regards,
Annalee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regards,
Annalee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page