|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
ksg2012
Joined: 15 May 2012 Posts: 2
|
Posted: Wed Jun 06, 2012 12:54 am Post subject: possible bug |
|
|
Hi:
I've found a possible bug in ftn95 v6.2 (personal edition) regarding sizes and shapes of arrays of derived data types. I'm running on cygwin under Win7 (output of uname is CYGWIN_NT-6.1-WOW64). Here's some code that prints out the output of the SIZE function from various references to an array of derived data types:
Code: | PROGRAM prog1
!
! Declare variables.
!
IMPLICIT NONE
INTEGER, PARAMETER :: VN=6
TYPE vel_pt_1Dstncl
REAL, DIMENSION(-VN/2+1:VN/2) :: alpha_a
CHARACTER(LEN=2), DIMENSION(-VN/2+1:VN/2-1) :: FL_code2_aph
END TYPE
INTEGER, PARAMETER :: NN=25
TYPE(vel_pt_1Dstncl), DIMENSION(NN) :: u_stncl
!
! Print out sizes of various arrays/ways of referring to arrays.
!
print*
print*, 'NN = ', NN
print*
WRITE(*,'(A,I19)') 'SIZE(u_stncl) = ', SIZE(u_stncl)
WRITE(*,'(A,I8)') 'SIZE(u_stncl%alpha_a(0)) = ', SIZE(u_stncl%alpha_a(0))
WRITE(*,'(A,I3)') 'SIZE(u_stncl%FL_code2_aph(0)) = ', SIZE(u_stncl%FL_code2_aph(0))
WRITE(*,'(A,I8)') 'SIZE(u_stncl(1)%alpha_a) = ', SIZE(u_stncl(1)%alpha_a)
WRITE(*,'(A,I3)') 'SIZE(u_stncl(1)%FL_code2_aph) = ', SIZE(u_stncl(1)%FL_code2_aph)
WRITE(*,'(A,I8)') 'SIZE(u_stncl(1:NN)%alpha_a(0)) = ', SIZE(u_stncl(1:NN)%alpha_a(0))
WRITE(*,'(A,I3)') 'SIZE(u_stncl(1:NN)%FL_code2_aph(0)) = ', SIZE(u_stncl(1:NN)%FL_code2_aph(0))
print*
print*, 'Done'
END
|
I used the following command to compile this code:
ftn95 /DREAL /BOUNDS_CHECK /ERROR_NUMBERS prog1.f90
Running the executable generates the following output:
NN = 25
SIZE(u_stncl) = 25
SIZE(u_stncl%alpha_a(0)) = 6
SIZE(u_stncl%FL_code2_aph(0)) = 5
SIZE(u_stncl(1)%alpha_a) = 6
SIZE(u_stncl(1)%FL_code2_aph) = 5
SIZE(u_stncl(1:NN)%alpha_a(0)) = 6
SIZE(u_stncl(1:NN)%FL_code2_aph(0)) = 5
I also compiled and ran this code with Intel's ifort compiler (version 10.0, 64bit) under linux. The output of that run is as follows:
NN = 25
SIZE(u_stncl) = 25
SIZE(u_stncl%alpha_a(0)) = 25
SIZE(u_stncl%FL_code2_aph(0)) = 25
SIZE(u_stncl(1)%alpha_a) = 6
SIZE(u_stncl(1)%FL_code2_aph) = 5
SIZE(u_stncl(1:NN)%alpha_a(0)) = 25
SIZE(u_stncl(1:NN)%FL_code2_aph(0)) = 25
Done
We can see that the second, third, sixth, and seventh SIZE commands give different results with ftn95 vs. with ifort. I think ifort is correct in this case since according to my understanding, e.g. u_stncl%alpha_a(0) represents the alpha_a(0) member of all elements of the array u_stncl, and since u_stncl has dimension 25, u_stncl%alpha_a(0) should also have dimension 25 (regardless of the dimension of alpha_a). I also used gfortran on cygwin to test out this code, and the results were identical to those of ifort.
This bug of course causes other problems in the code. I found this bug while trying to create a mask in a WHERE statement.
I'm not sure if this bug is fixed in ftn95 version 6.3 because I was not able to download the personal edition of v6.3 (the latest available for download is v6.2).
Thanks for your help. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7933 Location: Salford, UK
|
Posted: Wed Jun 06, 2012 7:55 am Post subject: |
|
|
I have logged this for investigation. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7933 Location: Salford, UK
|
Posted: Mon May 06, 2019 5:15 pm Post subject: |
|
|
This bug has finally been fixed. The fix will be in the next release of FTN95. |
|
Back to top |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1892
|
Posted: Tue May 07, 2019 3:13 am Post subject: |
|
|
Paul, the example code made be curious, and I find that the 8.40 compiler fails to compile the following variation of the same code:
Code: | PROGRAM prog1
IMPLICIT NONE
!
INTEGER, PARAMETER :: VN=6
TYPE vel_pt_1Dstncl
REAL, DIMENSION(-VN/2+1:VN/2) :: alpha_a
END TYPE
!
INTEGER, PARAMETER :: NN=5
TYPE(vel_pt_1Dstncl), DIMENSION(NN) :: u_stncl
integer i
!
u_stncl%alpha_a(0)=[ (i*0.5,i=1,size(u_stncl%alpha_a(0))) ]
WRITE(*,'(ES12.4)') u_stncl%alpha_a(0)
!
END |
The expected output is
Code: | 5.0000E-01
1.0000E+00
1.5000E+00
2.0000E+00
2.5000E+00 |
FTN95 says
Code: | [FTN95/Win32 Ver. 8.40.1 Copyright (c) Silverfrost Ltd 1993-2018]
0013) u_stncl%alpha_a(0)=[ (i*0.5,i=1,size(u_stncl%alpha_a(0))) ]
*** Compilation abandoned |
|
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7933 Location: Salford, UK
|
Posted: Tue May 07, 2019 7:55 am Post subject: |
|
|
Thanks. I will see if this now works with the latest fix. |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2390 Location: Yateley, Hants, UK
|
Posted: Tue May 07, 2019 3:05 pm Post subject: |
|
|
For a moment I thought "Wow, this guy is using really old stuff!", then I realised that the original post was 7 years ago. Some bugs really do take some tracking down.
Is this a record?
Eddie |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7933 Location: Salford, UK
|
Posted: Tue May 07, 2019 8:39 pm Post subject: |
|
|
In some way it could be. |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2826 Location: South Pole, Antarctica
|
Posted: Tue May 07, 2019 9:38 pm Post subject: |
|
|
As to record, the crash of property sheet could be one. Crash disappearing when you run the program under debugger, if i make a small demo, and if you give the code to somebody else. Go figure what it is and how to debug... |
|
Back to top |
|
|
John-Silver
Joined: 30 Jul 2013 Posts: 1520 Location: Aerospace Valley
|
Posted: Wed May 08, 2019 7:13 am Post subject: |
|
|
In the almost 5 years or so I've been on the forums ...
Some of the longer 'multi-paged' posts have 'lasted' quite a while (2, 3, ... maybe 4 years) but often they have evolved over time to cover several (arguably loosely related) topics/discrepancies, so difficult to pin down any particular 'length of existence before fix' of any particular gub-bins.
Although I'm sure Paul could write a bit of swishy, object oriented C- code to track them down and record them automatically if he wasn't already so snowed under and resource-limited with his workload towards advancing ftn95 capabilities to keep it ahead of the pack.
It's already good that your 'needs looking into list' is always being checked and acted upon Paul. Even after such a break.
Many software support would conveniently 'forget' them after a certain time.
Dan's quoted Pavlov-esque example is a good one, I remember that well. _________________ ''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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7933 Location: Salford, UK
|
Posted: Thu May 23, 2019 10:17 am Post subject: |
|
|
mecej4
Your code runs successfully under v8.50.
Dan
The list of bugs that need fixing makes no reference to property sheets. Please send me some sample code so that I can confirm that it is a ClearWin+ bug and (if it is) add it on the list. |
|
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
|