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 

problems with variable subscripts

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



Joined: 23 Aug 2005
Posts: 46
Location: Berlin, Germany

PostPosted: Thu Oct 05, 2006 5:16 pm    Post subject: problems with variable subscripts Reply with quote

Hi Paul!

A customer sent me the following program which shows a problem with variable subscripts.
He owns 5 licences of FTN95 4.80. I have tested his program with v4.91 and proofed his results.
I have also checked with CVF 6.6 and IVF 9.0. They did not not accept the line
b (1:2) = a (6:2) ! stride is default = 1; the extend is 0
After making this a comment, the program they created failed too.
Although it appears to me that the problems are some kind of "academic", I thought you might
want to see the customer's program and have a comment.
Thank you.

Kind regards,

Joerg
QT software


Winapp
Program Test_ArraySections

Real , Dimension (10) :: a
Real , Dimension ( 2) :: b
Integer :: i,k,l

Do i = 1,10
a (i) = i
End Do

k = 6
l = 5

write (*,*) ' Results of Program Test_ArraySections'
write (*,*) ' ====================================='
write (*,*)

write (*,*) ' k = ', k
write (*,*) ' l = ', l

! Assignment statement 1 is correct
write (*,*) ' Assignment statement 1:'


b = 0.
b (1:2) = a (5:6)
write (*,*) b (1:2), ' the result should be 5 6 ',' OK'
write (*,*)


! Assignment statement 2 should do nothing
write (*,*) ' Assignment statement 2:'

b = 0.
b (1:2) = a (6:2) ! stride is default = 1; the extend is 0
write (*,*) b (1:2), ' the result should be 0 0 ',' OK'
write (*,*)


! Assignment statement 3 should do nothing
write (*,*) ' Assignment statement 3:'

b = 0.
b (1:2) = a (k:2) ! stride is default = 1; the extend is 0
write (*,*) b (1:2), ' the result should be 0 0 ',' !!!!! Error !!!!!'
write (*,*)


! Assignment statement 4 should do nothing
write (*,*) ' Assignment statement 4:'

b = 0.
b (1:2) = a (k:l) ! stride is default = 1; the extend is 0
write (*,*) b (1:2), ' the result should be 0 0 ',' !!!!! Error !!!!!'
write (*,*)


! Assignment statement 5 should do nothing
write (*,*) ' Assignment statement 5:'

b = 0.
b (1:2) = a (k:l:1) ! stride is = 1; the extend is 0
write (*,*) b (1:2), ' the result should be 0 0 ',' !!!!! Error !!!!!'
write (*,*)


! Assignment statement 6 should be illegal
write (*,*) ' Assignment statement 6:'

b = 0.
b (1:2) = a (k:k) ! the extend is 1
write (*,*) b (1:2), ' this is an illegal operation since the shapes are different'
write (*,*) ' !!!!! Error !!!!!'
write (*,*)


! Assignment statement 7 should be the same as 1
write (*,*) ' Assignment statement 7:'

b = 0.
b (1:2) = a (l:l+1)
write (*,*) b (1:2), ' the result should be 5 6 ',' OK'
write (*,*)


! Assignment statement 8
write (*,*) ' Assignment statement 8:'

b = 0.
b (1:2) = a (k:l:-1) ! subscript triplet mechanism
write (*,*) b (1:2), ' the result should be 6 5 ',' OK' ! lower bound:upper bound:stride
write (*,*)

End Program Test_ArraySections

Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7928
Location: Salford, UK

PostPosted: Fri Oct 06, 2006 2:06 pm    Post subject: problems with variable subscripts Reply with quote

Joerg

I can confirm that this is a bug that needs to be fixed.

Regards

Paul
Back to top
View user's profile Send private message AIM Address
KL
Guest





PostPosted: Mon Dec 18, 2006 10:16 am    Post subject: Problem “Test_ArraySections” Reply with quote

This is simply to inform you, that I have rerun this problem with FTN95 v5.0 and the error still exists. I consider this problem as serious.

Best regards

Klaus Lassmann
Back to top
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support 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