Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Access violation and rand()

tungsh
Beginner
552 Views
Dear All,
A piece of my subroutinelooks like this:
subroutine selecont (ngroup, gtake, kitem, itype)
integer iwork(6), icont(6)
do i=1, ngroup
iwork(i)=i
enddo
do i=1, ngroup
rnd = rand()
==> irnd = int(rnd*(ngroup - i + 1) + 1)
icont(i) = iwork(irnd)
iwork(irnd) = iwork(ngroup - i + 1)
enddo
I found that when the main program calls the subroutine the second time,
the line with ==> mark will cause a server error (157), access violation.
I ran the same program unmodified with g77 (under Windows), no problem
appeared.
Does any know how to fix the problem?
Thanks in advance!
S. Doong
0 Kudos
2 Replies
Steven_L_Intel1
Employee
552 Views
There's not enough code here to determine the problem's cause. You can, if you wish, submit a reproducible example to Intel Premier Support and we'll take a look.

Message Edited by sblionel on 04-25-2005 11:33 AM

0 Kudos
tungsh
Beginner
552 Views
Using the 'use ifport' statement solves the problem.
Thanks.
tungsh
0 Kudos
Reply