![forums.silverfrost.com Forum Index](templates/subSilver/images/logo_phpBB.gif) |
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
mecej4
Joined: 31 Oct 2006 Posts: 1886
|
Posted: Thu Jun 04, 2015 2:45 pm Post subject: FTN95 bug: array valued functions in expressions |
|
|
FTN95 7.1 has problems processing expressions that contain array constructors and functions that return arrays. Some of these problems surfaced in a recent thread ( http://forums.silverfrost.com/viewtopic.php?t=3095 ), and here is a simple reproducer.
Code: | program getdiag
implicit none
real matrix(2,2),d4(4)
!
matrix=reshape((/ 2.,4.,5.,3. /),(/2,2/))
d4 = (/ 1.0, diagf(matrix), 4.0 /) ! FTN95 bug here
print*,d4
contains
function diagf(A)
real :: A(2,2),diagf(2)
diagf = (/ A(1,1), A(2,2) /)
return
end function
end program
|
The compiler says
Code: | 0006) d4 = (/ 1.0, diagf(matrix), 4.0 /) ! FTN95 bug here
*** Non-conformant array shapes in first rank of an array expression (4 and 3)
|
which suggests that it does not recognize that diagf() is of size 2, not 1.
If the array constructor is used in an I/O list, compilation goes through, but the resulting program attempts to read from address zero.
Code: | program getdiag
implicit none
real matrix(2,2)
!
matrix=reshape((/ 2.,4.,5.,3. /),(/2,2/))
print *, (/ 1.0, diagf(matrix), 4.0 /) ! FTN95 bug here
contains
function diagf(A)
real :: A(2,2),diagf(2)
diagf = (/ A(1,1), A(2,2) /)
return
end function
end program
|
[P.S. 6/15/2015]Same bugs also present in FTN95-7.20.
Last edited by mecej4 on Mon Jun 15, 2015 10:58 pm; edited 2 times in total |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Fri Jun 05, 2015 9:22 am Post subject: |
|
|
Thanks for the information. I have logged this for investigation. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Mon Jul 06, 2020 10:33 am Post subject: |
|
|
This bug has now been fixed for the next release of FTN95. |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
John-Silver
![](http://i.postimg.cc/K8HMTnXq/Bart-Unrivalled-Native-Plotting256.jpg)
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Mon Jul 06, 2020 5:58 pm Post subject: |
|
|
now that's what i call (organized) dedication. Your Bob the Builder list must be very long Paul if you're still churning out fixes from 2015 ! Well done ! _________________ ''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... " |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
|
|
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
|