- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Recently I try to use submodule. But My compiler return a error of code 6122. There is a module and its sub module.
module nonuni
implicit none
interface
module function get_subarray(a,i,j)
implicit none
real,target::a(:)
integer::i,j
real,pointer::get_subarray(:)
endfunction
end interface
endmodule
submodule(nonuni) nonunis
implicit none
contains
module function get_subarray(a,i,j)
implicit none
real,target::a(:)
integer::i,j
real,pointer::get_subarray(:)
get_subarray=>a(i:j)
endfunction
end submodule
submodule(nonuni) nonunis
implicit none
contains
module function get_subarray(a,i,j)
implicit none
real,target::a(:)
integer::i,j
real,pointer::get_subarray(:)
get_subarray=>a(i:j)
endfunction
end submodule
Then the compiler returned
error #6122: The characteristics of the separate module procedure differ from those specified in the separate interface body. [GET_SUBARRAY].
Then I tried another form.
module nonuni
implicit none
interface
module function get_subarray(a,i,j) result(asub)
implicit none
real,target::a(:)
integer::i,j
real,pointer::asub(:)
endfunction
end interface
endmodule
submodule(nonuni) nonunis
implicit none
contains
module function get_subarray(a,i,j) result(asub)
implicit none
real,target::a(:)
integer::i,j
real,pointer::asub(:)
asub=>a(i:j)
endfunction
end submodule
It was compiled successfully.
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The bug described in this thread is fixed in the latest compiler release, 2021.3.0. I just tried it.
Please download it and confirm. Let me know what you find.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This looks like a bug in the Intel Fortran compiler. gfortran 10.2.0 accepts the code and I see no difference between the interface in the module and the actual code in the submodule.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I filed a bug report on this, CMPLRLLVM-25800. I'll post here when there's a fix.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The bug described in this thread is fixed in the latest compiler release, 2021.3.0. I just tried it.
Please download it and confirm. Let me know what you find.
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