- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm getting this error message:
Error: A kind type parameter must be a compile-time constant.
I'm setting up Kind in a module:
INTEGER, PARAMETER :: dbl_kind=KIND(1.0D0)
INTEGER, PARAMETER :: default_prec=dbl_kind
this works fine except in INTERFACE statements:
INTERFACE
SUBROUTINE ShowRecurringContinueErrorAtEnd(Message,Index,ReportMaxOf,ReportMinOf,ReportSumOf, &
ReportMaxUnits,ReportMinUnits,ReportSumUnits)
! Use when "continuing" a recurring error messages (shown once at end of simulation)
! over several lines with optional max, min, sum
CHARACTER(len=*) :: Message ! Message automatically written to "error file" at end of simulation
INTEGER, INTENT(INOUT) :: Index ! Recurring message index, if zero, next available index is assigned
REAL(KIND=dbl_kind), INTENT(IN), OPTIONAL :: ReportMaxOf ! Track and report the max of the values passed to this argument
REAL(KIND=dbl_kind), INTENT(IN), OPTIONAL :: ReportMinOf ! Track and report the min of the values passed to this argument
REAL(KIND=dbl_kind), INTENT(IN), OPTIONAL :: ReportSumOf ! Track and report the sum of the values passed to this argument
CHARACTER(len=*), INTENT(IN), OPTIONAL :: ReportMaxUnits ! optional char string (<=15 length) of units for max value
CHARACTER(len=*), INTENT(IN), OPTIONAL :: ReportMinUnits ! optional char string (<=15 length) of units for min value
CHARACTER(len=*), INTENT(IN), OPTIONAL :: ReportSumUnits ! optional char string (<=15 length) of units for sum value
END SUBROUTINE
END INTERFACE
There it doesn't like it and issues the compile error message.
Is there any clean way around this?
Linda
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you, Steve. Just the answer I was looking for!
Linda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i have the same bug with an extremely simple program:
Module toto
integer, parameter :: mykind = 4
Interface
function Myfunction(x)
integer(kind=mykind) :: x
end function Myfunction
end Interface
end Module toto
I think this is a bug from Intel. The only way i found to get rid of it is to declare "mykind" in a dummy separated module:
Module Dummy
integer, parameter :: mykind = 4
end Module Dummy
Module toto
Interface
function Myfunction(x)
use Dummy
integer(kind=mykind) :: x
end function Myfunction
end Interface
end Module toto
It is has if "parameter" was missing.
Jerome
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is not a compiler bug. Please read the article I linked to above - it explains this in complete detail.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page