- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
I am new to Visual Fortran, although I did use Fortran back in college MANY years ago. In any cae, I have inherited a whole bunch of code most of which I have managed to build and execute with no problem. However, I am getting an error in one routine that has to do with uninitialized memory. I looks like the following:
...
REAL*8
...
TEMP1(3,3), TEMP2(3,3), TEMP3(3,3), TEMP4(3,3)
CALL
MAKMAT ( BRG, 3, DEG$, TEMP1 )...
SUBROUTINE MAKMAT ( ANGLE, IAXIS, UNIT$, ROTMAT )
DIMENSION ROTMAT(3,3)
...
When I inspect the parameters that are passed to MAKMAT everything looks good except for ROTMAT. It shows a 3 by 3 array where all 9 values have "Undefined address". When I inspect TEMP1 before calling MAKMAT it shows a 3 by 3 array initialized to zero. I have enabled all compiler and runtimeerror checks (bounds, etc) and nothing shows up.
Any ideas?
TIA,
Bill
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
CALL
SUBROUTINE MAKMAT ( ANGLE, IAXIS, UNIT$, ROTMAT )
DIMENSION ROTMAT(3,3)
MAKMAT ( BRG, 3, DEG$, TEMP1 )unless otherwise specified :
Implicit typing means BRG and ANGLEwill be REAL*4 that's ok
3 and IAXIS by the same will be INTEGER that's ok.
BUT TEMP1 is REAL*8 and implicit typing means ROTMAT is REAL*4 so they don't match.
The usual advice at this point is to
(a) in the debug configuration under Project->Properties->Fortran->Diagnostics
turn on "Generate Interface Blocks"
and "Check Routine Interfaces"
(You could also turn on warnings for undeclared & unused variables)
(b)put IMPLICIT NONE in all of your routines.
Les
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page