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 

SDBG64 does not display correct values for automatic array

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



Joined: 31 Oct 2006
Posts: 1885

PostPosted: Mon Aug 31, 2020 10:45 am    Post subject: SDBG64 does not display correct values for automatic array Reply with quote

Please compile and link the test program below with /undef /64. Open the EXE with SDBG64, version 8.64, and run up to the indicated breakpoint on line 40.

Examine the values in the local automatic array BLK. They should all be UNDEFINED. What I see, however, is a mix of UNDEFINED, *Invalid*, .TRUE. and .FALSE.

Step to the next line. At this point, all values in BLK should be .FALSE., but SDBG64 shows the same mix of values as before.

The program appears to set the values correctly and the program does not enter the lines of code after IF (ANY... .

The problem does not occur with 32-bit FTN95.

Code:
program autobug
implicit none
integer a,b,nt,np,ib,jb
real p(2),ar,br
logical :: blki(3,3) = .FALSE.
logical, allocatable :: pop(:,:)
!
np = 150
allocate(pop(np,np))
call random_seed(put=[23,42])   ! not portable, seed size varies
nt = 0
pop = .false.
do while (nt < 4)
   call random_number(p)
   ar = (1.d0 + p(1) * (DBLE(np)))
   br = (1.d0 + p(2) * (DBLE(np)))
   a = floor(ar)
   b = floor(br)
   IF (.not. pop(a,b)) THEN
      pop(a,b) = .TRUE.
      nt = nt + 1
      ib = (a-1)/50+1; jb = (b-1)/50+1
      blki(ib,jb) = .TRUE.
   END IF
END DO
call prt_pop(pop,np,blki,3)
stop

contains

subroutine prt_pop(pop,n,blki,m)
implicit none
integer, intent(in) :: n, m
logical, intent(in) :: pop(n,n),blki(m,m)
logical :: blk(m,m)
integer :: a,b,i,j,k,as,bs
!
   k = 0
   as = n/m; bs = n/m
   blk = .FALSE.              ! <<== BREAKPOINT here
   do b = 1,n
      do a = 1,n
         if(pop(a,b))then
            i = (a-1)/as+1; j = (b-1)/bs+1
            blk(i,j) = .TRUE.
            k = k+1
            if(mod(k,10) == 0)then
               write(*,30)a,b,k
            else
               write(*,40, advance='no')a,b
            endif
         endif
   30 format(2x,'(',i3,',',i3,')',4x,i5)
   40 format(2x,'(',i3,',',i3,')')
      end do
   end do
   write(*,'(/,A)')' Checking for mismatches between BLK and BLKI'
   if(any(blk .neqv. blki)) then
      do i=1,3
         print '(1x,3L2,4x,3L2)',blki(i,:),blk(i,:)
      end do
      do b = 1,n
         do a = 1,n
            if(pop(a,b))then
               i = (a-1)/50+1; j = (b-1)/50+1
               if(.not. blki(i,j))print '(1x,2I4)',a,b
            endif
         end do
      end do
      stop 'BLK and BLKI do not match, stopping.'
   endif
   return
end subroutine

end program
Back to top
View user's profile Send private message
Robert



Joined: 29 Nov 2006
Posts: 444
Location: Manchester

PostPosted: Tue Sep 01, 2020 11:04 am    Post subject: Reply with quote

I will take a look at it
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit 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