- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One of the external subroutines is like this:
subroutine InControl(cstruct) BIND(C,name='InControl')
INCLUDE 'link_fnl_static.h'
USE, INTRINSIC :: ISO_C_BINDING
use ModControl
implicit none
TYPE, BIND(C) :: MYFTYPE
logical(C_BOOL) :: c_fFinalStd
logical(C_BOOL) :: c_fSmartRunin
integer(C_INT) :: c_iCavitation
integer(C_INT) :: c_mIteration
integer(C_INT):: c_iEquationT(4)
integer(C_INT) :: c_iAccuracy
real(C_DOUBLE):: c_GridFactor
real(C_DOUBLE):: c_ToleranceA(5)
real(C_DOUBLE) :: c_ToleranceR(5)
real(C_DOUBLE):: c_ToleranceF
real(C_DOUBLE) :: c_ToleranceT
real(C_DOUBLE) :: c_Tfluid
character(kind = C_CHAR, LEN =32):: c_Fluid
END TYPE MYFTYPE
TYPE (MYFTYPE), intent(in) :: cstruct
fFinalStd = cstruct.c_fFinalStd
(more of the same)
This seems to be working, but if I look at cstruct in the debugger instead of seeing members like cstruct.c_fFinalStd I see this:
- cstruct {...} TYPE(MYFTYPE)
cstruct%C_TSTART
cstruct%C_TSTOP
cstruct%C_TSTARTG
cstruct%C_TSTOPG
cstruct%C_TSTEPG
cstruct%C_TSTEPT
cstruct%C_TSTEPF
Anyone know what's going on here?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
subroutine InTime(cstruct) BIND(C,name='InTime')
USE, INTRINSIC :: ISO_C_BINDING
use ModTime
implicit none
TYPE, BIND(C) :: MYFTYPE
real(C_DOUBLE):: c_TStart
real(C_DOUBLE):: c_TStop
real(C_DOUBLE) :: c_TStartG
real(C_DOUBLE):: c_TStopG
real(C_DOUBLE) :: c_TStepG
real(C_DOUBLE) :: c_TStepT
real(C_DOUBLE) :: c_TStepF
END TYPE MYFTYPE
TYPE (MYFTYPE) , intent(in) :: cstruct
When debugging within the original subroutine it seems to be picking up the type of cstruct from the other subroutine.
So it looks to melike either:
- The definition of MYTYPE is global, not local to the subroutine, but the compiler doesn't complain about the double definition
- The definition of MYTYPE is local to the subroutine, but the debugger is getting confused
Be grateful if you can confirm, and let me know if you still need a code example.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If I post here with a file attachement, and marking it private, will that do the trick?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- 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