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 

"Undefined Array"

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





PostPosted: Fri Nov 24, 2006 5:36 am    Post subject: "Undefined Array" Reply with quote

Dear Paul,

The program “Test_Undefined_Array” documents an “error” when the undefined array A is used in the statement

C = A + B

Since the array A as a whole is undefined, this statement should lead with the appropriate compiler option /CHECKMATE to an error message. This is not the case. However, a statement such as

C (1,2) = A (1,2) + B (1,2)

does give an error message.

I have run the case with

del comp.lis
del *.obj
del *.exe

ftn95 Test_Undefined_Array.f95 /checkmate /link >> comp.lis
sdbg Test_Undefined_Array.exe

This is of course a programming error, but it should be detected with the appropriate option /CHECKMATE.

Below is the test programme:


Winapp
Program Test_Undefined_Array

Implicit None
Real , Dimension (2,2) :: A, B, C

B = 2.
A (1,1) = 1.

write (*,*) A
write (*,*) B

! Since only the first element of A is defined,
! it is not allowed to use A as a whole array.
! A as a whole is undefined.

C = A + B

! The following statement leads to an error

! C (1,2) = A (1,2) + B (1,2)

write (*,*) C

End Program Test_Undefined_Array


Best regards,

Klaus Lassmann






Back to top
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Mon Nov 27, 2006 3:55 pm    Post subject: "Undefined Array" Reply with quote

I agree with Klaus, /undef does not apear to apply to array operations, such as "C = A + B" or "write (*,*) A", when using Ver 4.9.1. It does apply to variable expressions, such as "c(1,2) = a(1,2) + b(1,2)".
Has this always been the case ?
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue Nov 28, 2006 11:26 am    Post subject: "Undefined Array" Reply with quote

Klaus

This bug has now been fixed but the fix will not be included in the release that is about to go out.

Regards

Paul
Back to top
View user's profile Send private message AIM Address
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