forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

/FULL_UNDEF option and ELSEWHERE character array mask

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
ksg2012



Joined: 15 May 2012
Posts: 2

PostPosted: Fri Jun 08, 2012 6:48 pm    Post subject: /FULL_UNDEF option and ELSEWHERE character array mask Reply with quote

Hi:

I'm using ftn95 v6.2, personal edition. I've found that compiling with the /FULL_UNDEF option any code that contains an ELSEWHERE statement masked using a character array gives me the following error during compilation:

*** Error 163: Internal compiler error

Here's a program that will generate this error. I compiled it with the following options:

ftn95 /DREAL /BOUNDS_CHECK /ERROR_NUMBERS /FULL_UNDEF prog_check_elsewhere_full_undef.f90

Code:
PROGRAM prog_check_elsewhere_full_undef
!
! Declare variables.
!
IMPLICIT NONE
INTEGER, PARAMETER :: NN=4
INTEGER :: i
CHARACTER(LEN=1), DIMENSION(NN) :: fl_array
REAL, DIMENSION(NN) :: avl
!
! Set the character array fl_array.
!
fl_array(:NN/2) = 'F'
fl_array(NN/2+1:) = 'L'

print*
print*, 'fl_array:'
print*, '--------'
DO i=1, NN
  WRITE(*,'(I5, 5X, A)') i, fl_array(i)
END DO
!
! Use the character array as a mask in a WHERE/ELSEWHERE construct.
!
WHERE (fl_array == 'F')
  avl = 90.0
ELSEWHERE (fl_array == 'L')
  avl = -90.0
ELSEWHERE
  avl = 0.0
END WHERE

print*
print*, 'avl:'
print*, '---'
DO i=1, NN
  WRITE(*,'(I5, 5X, F8.2)') i, avl(i)
END DO

END


If I change the /FULL_UNDEF option to just /UNDEF, then the compilation succeeds. If I then link using

slink -file:prog_check_elsewhere_full_undef.exe prog_check_elsewhere_full_undef.obj

and then run the program, I get the following (expected) output:

Code:
fl_array:
--------
   1     F
   2     F
   3     L
   4     L

avl:
---
   1        90.00
   2        90.00
   3       -90.00
   4       -90.00


Also, if I comment out the lines

Code:
ELSEWHERE  (fl_array == 'L')
  avl = -90.0


and compile using /FULL_UNDEF, the compilation succeeds and the code runs. If I use an integer array as a mask instead of a character array, everything works as it should. That's why I suspect it's the character array mask in the ELSEWHERE statement that's the problem. I think it's a bug, but it's also possible that I have an error in my code...

Thanks for any help you can provide with this issue.
Back to top
View user's profile Send private message
davidb



Joined: 17 Jul 2009
Posts: 560
Location: UK

PostPosted: Fri Jun 08, 2012 10:16 pm    Post subject: Reply with quote

You will need to wait for confirmation from Silverfrost. But I would guess this is one of the issues that was fixed in 6.30 as I had similar issues comparing characters and arrays of characters and those have been fixed according to the release notes.
_________________
Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group