Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
30 Views

Undefined address when trying to assign a value to matrix

Jump to solution

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

Accepted Solutions
Highlighted
New Contributor II
30 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
Highlighted
New Contributor II
31 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
Highlighted
30 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
Highlighted
Beginner
30 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