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

Undefined address when trying to assign a value to matrix

kim__jung_hwan
Beginner
447 Views

Hello.

I have recently began learning and using Fortran90. Below is a code that I get an error from..

integer(ik):: jnum, e_num, anum, ia, ie
real(rk):: ssrr, r, wl, sigma, agrid(anum), vl(jnum,e_num,anum),aval, yval, vltemp(anum)

intent(in):: jnum,e_num, anum, ssrr, r, wl, sigma, agrid,vltemp
intent(inout):: vl


do ie = 1, e_num
do ia = 1, anum
        aval = agrid(ia)
        yval = (1+r)*aval + ssrr*wl
        vltemp(ia) = (yval**(1.0_rk-sigma))/(1.0_rk-sigma)
        vl(jnum, ie, ia) = vltemp(ia)
    end do
end do

To explain, I have tried to store a value into each element of the matrix, and I get an error undefined address. I was wondering if anyone has an idea of where the mistake is arising from.

Thank you very much!

0 Kudos
1 Solution
gib
New Contributor II
447 Views

You really need to show the array declarations.  To see exactly where the error occurs, you could trying turning on run-time checking:

Properties > Fortran > Run-time

then Generate Traceback Information

and Runtime Error Checking > Custom, select Check Array and String Bounds.

View solution in original post

0 Kudos
3 Replies
gib
New Contributor II
448 Views

You really need to show the array declarations.  To see exactly where the error occurs, you could trying turning on run-time checking:

Properties > Fortran > Run-time

then Generate Traceback Information

and Runtime Error Checking > Custom, select Check Array and String Bounds.

0 Kudos
jimdempseyatthecove
Honored Contributor III
447 Views

Without seeing the SUBROUTINE or FUNCTION source line, we cannot tell which variables are arguments (aka dummies) and which are local to the procedure.

Also, unknown is what the actual arguments are at the point of the CALL.

In addition to (prior to) runtime checking, I suggest using the interface checking option (listed under the diagnostic property page).

Jim Dempsey

0 Kudos
kim__jung_hwan
Beginner
447 Views

Thank you very much for your reply.

Before, I assigned the size for each matrix in "real(rk)", and I changed them and made it allocatable and it works now! :D

0 Kudos
Reply