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

EPDECOL ERROR with COMPAQ VISUAL FORTRAN PROF. 6

mohdwong2003
Beginner
551 Views
I am trying to use EPDECOL code to solve PDEs. When I run the code with an exmaple driver provided with the code, I recive error msgs. I was told that the code is working well with others, but not with me. I didn't alter anything in the code . The error I get isas follow:
30,4 ====> [these are the values of NINT and KORD requested as READ]
NO. OF SUBINTERVALS = 30 KORD = 4 EPS = 0.10D-03
T = 0.100E-02 DT = 0.340E-03 TOTAL STEPS = 11
forrtl: severe (161): Program Exception - array bounds exceeded
Image PC Routine Line Source
EXAMPLE_EPDECOL_S 00415B71 Unknown Unknown Unknown
EXAMPLE_EPDECOL_S 0040156A Unknown Unknown Unknown
EXAMPLE_EPDECOL_S 0044B569 Unknown Unknown Unknown
EXAMPLE_EPDECOL_S 0043F514 Unknown Unknown Unknown
kernel32.dll 77E814C7 Unknown Unknown Unknown
Incrementally linked image--PC correlation disabled.
Hope some one have a clue
Thank you
0 Kudos
1 Reply
greldak
Beginner
551 Views


NO. OF SUBINTERVALS = 30 KORD = 4 EPS = 0.10D-03
T = 0.100E-02 DT = 0.340E-03 TOTAL STEPS = 11

Judging from the values of EPS & T I am guessing you are using EPS as the step variable in a DO loop (or are iteratively adding it) and testing for equality against T.

The problem here is that certain decimal values cannot be expressed exactly using binary so as an example the loop

DO i=0.1,1.0,0.1

end do

is likely to iterate 11 times and not 10 as might be expected - the 10th iteration will result in a value of something like 0.9999999 and not 1.0

A better loop would be

DO j=1,10

i=j/10.0

END DO

This will perform its terminating test on an integer variable which can be expressed exactly and will end on its 10th iteration
0 Kudos
Reply