- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am using intel Fortran 11 on Linux in order to develop ABAQUS user material (UMAT) subroutine (written in Fortran 90). I put a very simple function which returns an integer (e.g. 1 for simplicity). When I log the return value, surprisingly it returns 124 or 125! I didn't have this issue in windows and I am really confused by this strange action. I am wondering whether the problem/bug is because of the common variables I defined in another file which is also included or it's just a bug which has something to do with other parts of the code!?!? Here is the compile command I am using:
ifort -c -fPIC -auto -extend_source -w90 -w95 -WB Umat-Main-Mgr-Test-0025.f90
and here is the body of my function:
integer function testFunc()
!{
testFunc=1
return
!}
end function testFunc
Thanks,
Hamidreza,
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is too little information given to attempt a systematic hunt for the culprit. If you can construct an example that is independent of Abaqus, chances of success may improve.
Just a thought: does the caller know that testFunc is of type INTEGER? If there is no explicit declaration, the compiler may think that the function is REAL, and the return value may be expected to be in ST0 register instead of EAX/RAX. That would explain the surprising return values.
Just a thought: does the caller know that testFunc is of type INTEGER? If there is no explicit declaration, the compiler may think that the function is REAL, and the return value may be expected to be in ST0 register instead of EAX/RAX. That would explain the surprising return values.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page