- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page