Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

segmentation fault

ananth_mg
Beginner
873 Views
when i tried to run program compiled using ifortv8.0,i'm getting segmentation fault.

It is first issuing this warning many times and then giving segmentation fault:
forrtl: warning (402): fort: (1): In call to QNEG3, an array temporary was created for argument #8
Part of the calling routine is:

! Allocate memory for temporary arrays
allocate ( arr3d(plon,plev,plat) )
.
.
.
.
do lat=1,plat
call qneg3('INIDAT ', lat, nlon(lat), plon, plev, 1, &
qmin(m), arr3d(:plon,:plev,lat))
end do

The called routine has:
subroutine qneg3 (subnam ,idx ,ncol ,ncold ,lver ,lconst , &
qmin ,q )

.
.
.
!Input arguments
character*(*), intent(in) :: subnam ! name of calling routine

integer, intent(in) :: idx ! chunk/latitude index
integer, intent(in) :: ncol ! number of atmospheric columns
integer, intent(in) :: ncold ! declared number of atmospheric columns
integer, intent(in) :: lver ! number of vertical levels in column
integer, intent(in) :: lconst ! number of constituents

real(r8), intent(in) :: qmin(lconst) ! Global minimum constituent concentration

!
! Input/Output arguments
!
real(r8), intent(inout) :: q(ncold,lver,lconst) ! moisture/tracer field
0 Kudos
3 Replies
Steven_L_Intel1
Employee
873 Views
What's the declaration of qmin?
You probably need to raise your stack limit.
0 Kudos
ananth_mg
Beginner
873 Views
I've increased stacksize using ulimit.I'm not doing any optimizations also.Options I've given are:
-i4 -r8 -align -g -C -fpstkchk -fp -save -check all.Environment variables are all properly set.
Declaration of qmin is in qneg3.F90 file as:
real(r8), intent(in) :: qmin(lconst)
as I said in previous thread.
Any help is appreciated.
0 Kudos
florinm1982
Beginner
873 Views
make sure you don't deallocate temporary arrays and after that try to use them... If you do so you would probably obtain the same type of error you report.

Florin M.
0 Kudos
Reply