soccer jersey forums.silverfrost.com :: View topic - Error reported on wrong line with /64 /undef
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 

Error reported on wrong line with /64 /undef

 
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: 1896

PostPosted: Sat Aug 13, 2022 3:35 am    Post subject: Error reported on wrong line with /64 /undef Reply with quote

The following test program uses an undefined value on line 54. When compiled with /undef and run, the resulting 32-bit program correctly indicates this line in the debugger or in the traceback.

When /64 /undef is used, however, it is line 53 that is flagged as the one in which an undefined variable is used. When I first ran into this error, I was quite baffled because line 53 contains

Code:
sBeamIN%Nodes(2) = MCON2


and the value of MCON2 was read in the fifth preceding line.

The test program source needed to be moved to a separate post because of the line limit.
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1896

PostPosted: Sat Aug 13, 2022 3:37 am    Post subject: Reply with quote

[continuation: the source code of the test program]

Code:
Module Base
   INTEGER, PARAMETER :: dp = selected_real_kind(15, 307)
   INTEGER, PARAMETER :: sw = 32, sa = 33, nta = 100
   REAL (KIND=dp), PARAMETER :: ZERO = 0.0_DP
end module Base

Module Elements
   use base
   implicit none
   integer, parameter ::   L = 3 !, nt = 120
   INTEGER astat
   Type Model
      Integer             id, NumTrias, NumBeams, ThicknessFlag
      Character*70        Description
      Real (kind = dp)    asm(6,6,18)
      Integer             ism(6,6,18)
      integer, allocatable ::  indexM(:,:), nodes(:), offsetnodes(:)
      integer             i,j,k,N,NodeCount,MaxNodeNumber,LoadedNodes
      integer        ::      flag = 0
      REAL (KIND=dp)      H, density
      REAL (KIND=dp), allocatable :: sk(:,:), xf(:), skI(:,:),b(:)
   END TYPE
   TYPE sbeam
      INTEGER id
      integer acad
      REAL (KIND=dp) width, depth, Ix, Iy, Iz, Area, Ratio, E, G1, &
         Beta1, Beta2,rho,t,b,d,density
      character*8 name
   END TYPE
   Type aBeam
      INTEGER             id, nodes(2), restraint(2), nodetype(2,6)
      integer :: flag   = 0
      REAL (KIND=dp)      x(2), y(2), z(2), mass(2), H(2)
      REAL (KIND=dp)      nu, em, x21, area2, esm(12,12), Ix,Iy,Iz,G, &
         Area, E, Beta1, Beta2, length, gamma
   end type
contains
   subroutine Read_beams(sBeamIN, sBeams)
      implicit none
      TYPE (aBeam),    TARGET :: sBeamIN
      TYPE (sbeam), TARGET :: sBeams(nta)
      Integer IV, MCON1, MCON2, beamid
      REAL (KIND=dp) gammaa
      TYPE (sbeam), POINTER :: beam => null()
      CHARACTER (4)        af
      CHARACTER (120)      iline
      iline = 'BEAM   1  1  2  0.0 43'
      READ(iline,*)af, IV, MCON1, MCON2,GAMMAA,beamID
      beam => sbeams(beamID)
      sBeamIN%ID = IV
      sBeamIN%ESM = ZERO
      sBeamIN%Nodes(1) = MCON1
      sBeamIN%Nodes(2) = MCON2
      sBeamIN%Iy = beam%iy     ! undefined, should stop here
      sBeamIN%Ix = beam%ix
      sBeamIN%IZ = beam%IZ
      return
   end subroutine
   Subroutine SetModel(ModelA, I, beams)
      implicit none
      TYPE (Model),       TARGET :: ModelA        !   holds the model data
      Integer I
      Integer Beams
      ModelA%ID = 1
      ModelA%NumTrias = 0
      ModelA%NumBeams = 65
      ModelA%MaxNodeNumber = 65
      ModelA%LoadedNodes = 67
      ModelA%Description = 'Dutch Bridge Goor'
      ModelA%ThicknessFlag = 2
      ModelA%H = 0.6
      ModelA%density = 2400
      I = 0
      Beams = 65
      return
   end Subroutine
End module

program Borr
   use Elements
   implicit none
   Integer             Triangles, BeamNum, I
   TYPE (Model),       TARGET :: ModelA
   TYPE (sbeam),       allocatable,   TARGET :: sBeams(:)
   TYPE (aBeam),       allocatable,   TARGET :: saBeams(:)
   Call SetModel(ModelA, Triangles, BeamNum)
   ALLOCATE (ModelA%indexM(3,1), ModelA%nodes(1),ModelA%offsetnodes(1),&
      sBeams(NTA), saBeams(Beamnum))
   ModelA%nodes = -1
   Do I = 1, Beamnum
      print *,'Calling Read_beams with I = ',i
      call Read_Beams(saBeams(I), sBeams)
      stop 'Read_Beams done'
   end do
end program Borr
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Sat Aug 13, 2022 7:15 am    Post subject: Reply with quote

mecej4

Thank you for the feedback. I have made a note of this fault.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


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

PostPosted: Thu Nov 17, 2022 2:43 pm    Post subject: Reply with quote

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