|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
KL Guest
|
Posted: Fri Nov 24, 2006 5:35 am Post subject: “Test_Intent_out”: |
|
|
Dear Paul,
The program “Test_Intent_out” documents an “error” when the undefined array A is used in the statement
C = A + B
The FTN95 manual says that when the option /CHECKMATE is used, INTENT(OUT) arguments are initialised as undefined on entry to a procedure. In the case of an array argument this is obviously only the case for the elements, but not for the whole array argument. Otherwise the above 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.
The demonstration program is “Test_Intent_out.f95” and can be run with the batch file “run.bat”:
del comp.lis
del *.obj
del *.exe
ftn95 Test_Intent_out.f95 /checkmate /link >> comp.lis
sdbg Test_Intent_out.exe
This is of course a programming error (similar to Test Undefined_Array), but it should be detected with the appropriate option /CHECKMATE. Here is the test programme:
Winapp
Program Test_Intent_out
Implicit None
Real , Dimension (2,2) :: A, B, C
B = 2.
write (*,*) B
Call Sub1 ( A )
! The FTN95 manual says that when the option
! /CHECKMATE is used, INTENT(OUT) arguments are
! initialised as undefined on entry to a procedure;
! In the case of an array argument this is obviously
! only the case for the elements,
! but not for the whole array argument.
C = A + B
! The following statement leads to an error
! C (1,2) = A (1,2) + B (1,2)
write (*,*) C
Contains
Subroutine Sub1 (A)
Real , Dimension (:,, Intent (out) :: A
A (1,1) = 1.
End Subroutine Sub1
End Program Test_Intent_out
Best regards,
Klaus Lassmann
|
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Tue Nov 28, 2006 11:27 am Post subject: “Test_Intent_out”: |
|
|
Klaus
This bug has now been fixed but the fix will not be included in the next release that is about to go out.
Regards
Paul |
|
Back to top |
|
|
|
|
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
|