- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the following example the parameter Bound is called by value and is optional. If Bound get a value of 2.0 then the function present(Bound) returns .false. and if Bound get a value of 2.1 then the function present(Bound) returns .true.
It seems that if Bound gets a value that is (near to) an integer value the internal function present() doesn't work correct
function func(X, Bound) result (l)
!DEC$ attributes dllexport, stdcall, alias : "func" :: func
!DEC$ attributes reference :: X
!DEC$ attributes dllexport, stdcall, alias : "func" :: func
!DEC$ attributes reference :: X
real(8) :: X
real(8), optional, intent(in) :: Bound
logical :: l
if (present(Bound)) then
l = .true
else
l = .false.
end if
real(8), optional, intent(in) :: Bound
logical :: l
if (present(Bound)) then
l = .true
else
l = .false.
end if
end function func
Is this a knownproblem or does someone know what I am doing wrong?
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The problem is that OPTIONAL is incompatible with VALUE attribute, and STDCALL implies VALUE attribute. To solve it, you should also declare REFERENCE for Bound.
IVF previously did not raise an error for code like that (it would if you spell out !DEC$ATTRIBUTES VALUE:: Bound); I submitted a bug report to Premier and it is either fixed in the latest release or is about to be (I'm lazy to check right now). Which version do you have?
IVF previously did not raise an error for code like that (it would if you spell out !DEC$ATTRIBUTES VALUE:: Bound); I submitted a bug report to Premier and it is either fixed in the latest release or is about to be (I'm lazy to check right now). Which version do you have?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your remarks.
I am using CVF 6.6.C

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