soccer jersey forums.silverfrost.com :: View topic - Transpose + reshape + array constructor + CMPLX real part
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 

Transpose + reshape + array constructor + CMPLX real part

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



Joined: 18 May 2012
Posts: 709
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Thu Feb 23, 2023 3:40 pm    Post subject: Transpose + reshape + array constructor + CMPLX real part Reply with quote

The following code runs correctly when compiled under Win32. A runtime error occurs when complied under x64.
Code:
program test
use iso_fortran_env
implicit none
complex  y(2,2)
integer :: m = 2, i, j
print*, compiler_version()
print*, compiler_options()
y = transpose(reshape([(1),(2),(3),(4)],shape(y)))   ! This line causes runtime error when compiled with X64
do i = 1, m
  print*, (y(i,j),j=1,m)
end do
end


If line 8 is changed to:
Code:
y = transpose(reshape([(1,0),(2,0),(3,0),(4,0)],shape(y)))

or
Code:
y = transpose(reshape([cmplx(1,0),cmplx(2,0),cmplx(3,0),cmplx(4,0)],shape(y)))


The run time error does not occur. (I using the most recent update i.e. FTN v 8.96
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Thu Feb 23, 2023 5:28 pm    Post subject: Reply with quote

Ken

Thank you for the bug report. I will make a note that this needs fixing.
Back to top
View user's profile Send private message AIM Address
Kenneth_Smith



Joined: 18 May 2012
Posts: 709
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Fri Feb 24, 2023 10:11 am    Post subject: Reply with quote

Paul,

This may assist. If line 8 is changed to:

Code:
y = transpose(reshape([1,2,3,4],[2,2]))


i.e. the call to shape(y) is removed, under X64 the program does not crash, but the results in y are incorrect.
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Wed Apr 19, 2023 11:13 am    Post subject: Reply with quote

This bug has now been fixed for the next release of clearwin64.dll.
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