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 

possible bug

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



Joined: 15 May 2012
Posts: 2

PostPosted: Wed Jun 06, 2012 12:54 am    Post subject: possible bug Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Wed Jun 06, 2012 7:55 am    Post subject: Reply with quote

I have logged this for investigation.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


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

PostPosted: Mon May 06, 2019 5:15 pm    Post subject: Reply with quote

This bug has finally been fixed. The fix will be in the next release of FTN95.
Back to top
View user's profile Send private message AIM Address
mecej4



Joined: 31 Oct 2006
Posts: 1885

PostPosted: Tue May 07, 2019 3:13 am    Post subject: Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue May 07, 2019 7:55 am    Post subject: Reply with quote

Thanks. I will see if this now works with the latest fix.
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Tue May 07, 2019 3:05 pm    Post subject: Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Tue May 07, 2019 8:39 pm    Post subject: Reply with quote

In some way it could be.
Back to top
View user's profile Send private message AIM Address
DanRRight



Joined: 10 Mar 2008
Posts: 2813
Location: South Pole, Antarctica

PostPosted: Tue May 07, 2019 9:38 pm    Post subject: Reply with quote

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
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Wed May 08, 2019 7:13 am    Post subject: Reply with quote

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 ... Smile "
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Thu May 23, 2019 10:17 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General 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