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 

Wrong line numbers in error report

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



Joined: 31 Oct 2006
Posts: 1886

PostPosted: Sun Jan 14, 2024 2:10 am    Post subject: Wrong line numbers in error report Reply with quote

The test program below uses the array p_NQ on line 30 before it has been defined. The error is reported to occur on line 20 by SDBG64 and on line 23 by SDBG.

Breakpoints are not accepted on line 22 and 24 to 32. More generally, no breakpoints are allowed inside WHERE blocks.

Code:
program stest
implicit none
integer, parameter :: dbl = kind(0.0d0)

integer :: nx = 10, ny = 4, nz = 10
integer :: ix, ixyz, iy, iyz, iz, irep, ip(3), np(3)
real(dbl) :: R2, dp(3), t(3), p_min(3), p_max_(3), p_min_(3), p_NQ(3)
integer :: clipped(3),gclipped(3)

ixyz = 6
p_min = (/ -8.0_dbl, -2.0_dbl, -7.826364311586_dbl /)

iyz = 1+(ixyz-1)/nx
ix = ixyz-(iyz-1)*nx
iz = 1+(iyz-1)/ny
iy = iyz-(iz-1)*ny
ip = (/ ix,iy,iz /)
np = (/ nx,ny,nz /)
p_min_ = p_min+(ip-2)*2.0_dbl
p_max_ = p_min_+2.0_dbl              ! ref. to undef. variable reported here (SDBG64)

! Clip at borders, regardless of p_NQ values
where (ip == 1 )                     ! ref. to undef. variable reported here (SDBG)
   t = 1.0_dbl
   gclipped = -1
elsewhere (ip == np)
   t = 0.0_dbl
   gclipped = +1
elsewhere
   t = (p_NQ-p_min_)/(p_max_-p_min_) ! p_NQ is undefined, will be read from file below
   gclipped = 0
end where

open(10,file='pnq.dat',status='old')
rewind(10)

do
   read (10,*,end=100)p_nq

   clipped = gclipped
!clip based on p_NQ values
   t = 0.0_dbl
   where(clipped == 0)
      t = (p_NQ-p_min_)/(p_max_-p_min_)
      where (t < 0.0_dbl)
         t = 0.0_dbl
         clipped = -1
      end where
      where (t > 1.0_dbl)
         t = 1.0_dbl
         clipped = +1
      end where
   end where
   print '(1x,A,5x,3(I4:,9x))','Clipped',clipped

   where (t > 0.0_dbl)
      dp = p_NQ-(p_max_-p_min_)*t-p_min_
   elsewhere
      dp = 0.0_dbl
   end where
   print '(1x,A,2x,1p,3e13.5)','p_min_',p_min_,'p_max_',p_max_, &
      'p_NQ  ',p_NQ, 't     ',t,'dp    ',dp
   R2 = sum(dp*dp)

   print '(1x,A,2x,1p,e13.5,//)','R2 = ',R2
end do
100 close(10)

end program
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Mon Jan 15, 2024 8:00 am    Post subject: Reply with quote

mecj4

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


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

PostPosted: Wed Feb 07, 2024 3:20 pm    Post subject: Reply with quote

This failure has been fixed for the next release of FTN95. In the current release the report of an undefined variable occurs one line too early.

By design, FTN95 treats the debugging of a WHERE construct as a single statement and the same is true for other whole array constructs. This means that the embedded undefined value ought to be reported as you step over the WHERE construct and this has now been fixed.
Back to top
View user's profile Send private message AIM Address
DanRRight



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

PostPosted: Wed Feb 07, 2024 3:24 pm    Post subject: Reply with quote

Were missing breakpoints also fixed?
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Wed Feb 07, 2024 4:02 pm    Post subject: Reply with quote

Dan

If you are referring to a bug that was reported of a different thread then you should look there for a response.
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