- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This problem has been solved. Thank U!
~~~~~~~~~~~~~~~~`
I called in two arraies
Type(EleLstTyp), Intent(In) :: EleLst(:)
Type(EleTyp), Intent(In) :: ETypLst(:)
~~
why I always met the error:
" forrtl: severe (157): Program Exception - access violation "
at this line:
Et = EleLst(Iel)%Etyp ;
Note that the error is only occur when I complied the code into release version, but
when I complied it into debug verion, I cannot encounter it.
The following is the part of my subroutine.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Subroutine EleSteer(Ndim, Nels, Ntn, Neq, Glob_Coord, ENconn, NfArr, &
EleLst, ETypLst, g_g)
Use FE_types ;
Implicit None
Integer(4), Intent(In) :: Ndim, Nels, Ntn, Neq
Integer(4), Intent(In) :: ENconn(:, :), NfArr(:, :)
Real(kind=8), Intent(In) :: Glob_Coord(:, :)
Type(EleLstTyp), Intent(In) :: EleLst(:)
Type(EleTyp), Intent(In) :: ETypLst(:)
Integer(4), Intent(InOut) :: g_g(:, :)
! Local Variables
Integer(4) :: NBand, Iel, Inc, I, K, Ndn, Et
Integer(4), Allocatable :: g(:)
Allocate( g(MaxEleDofs) )
!
NBand = 0 ;
Do Iel = 1, Nels
g = 0 ; Inc = 0 ;
print*," iel = "
Et = EleLst(Iel)%Etyp ;
print*," Et = ", Et
Ndn = ETypLst(Et)%NdnEle ;
~~~~~~~~~~~~~~~~~~~~~~
Thank you for any helps!
Donald
~~~~~~~~~~~~~~~~`
I called in two arraies
Type(EleLstTyp), Intent(In) :: EleLst(:)
Type(EleTyp), Intent(In) :: ETypLst(:)
~~
why I always met the error:
" forrtl: severe (157): Program Exception - access violation "
at this line:
Et = EleLst(Iel)%Etyp ;
Note that the error is only occur when I complied the code into release version, but
when I complied it into debug verion, I cannot encounter it.
The following is the part of my subroutine.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Subroutine EleSteer(Ndim, Nels, Ntn, Neq, Glob_Coord, ENconn, NfArr, &
EleLst, ETypLst, g_g)
Use FE_types ;
Implicit None
Integer(4), Intent(In) :: Ndim, Nels, Ntn, Neq
Integer(4), Intent(In) :: ENconn(:, :), NfArr(:, :)
Real(kind=8), Intent(In) :: Glob_Coord(:, :)
Type(EleLstTyp), Intent(In) :: EleLst(:)
Type(EleTyp), Intent(In) :: ETypLst(:)
Integer(4), Intent(InOut) :: g_g(:, :)
! Local Variables
Integer(4) :: NBand, Iel, Inc, I, K, Ndn, Et
Integer(4), Allocatable :: g(:)
Allocate( g(MaxEleDofs) )
!
NBand = 0 ;
Do Iel = 1, Nels
g = 0 ; Inc = 0 ;
print*," iel = "
Et = EleLst(Iel)%Etyp ;
print*," Et = ", Et
Ndn = ETypLst(Et)%NdnEle ;
~~~~~~~~~~~~~~~~~~~~~~
Thank you for any helps!
Donald
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Donald,
Insert some sanity checks into your code
if(.not. allocated(ETypLst)) then
write(*,*) 'Debug this' ! put breakpoint here
endif
Do Iel = 1, Nels
g = 0 ; Inc = 0 ;
print*," iel = "
Et = EleLst(Iel)%Etyp ;
print*," Et = ", Et
! assuming ETypLst(1:n)
if(Et .lt. 1) then
write(*,*) 'Debug this' ! put breakpoint here
endif
if(Et .gt. size(ETypLst)) then
write(*,*) 'Debug this' ! put breakpoint here
endif
Ndn = ETypLst(Et)%NdnEle ;
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Also,
If Subroutine EleSteer is compiled in a seperate project, and you are not using interfaces, then the caller may be calling using the address of the array as opposed to passing anarray descriptor.
Jim Dempsey

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page