StarkLee
22
6
0
入门
使用道具 举报
100
专家
01
module
matmul_int
02
INTERFACE
OPERATOR
(
.mm.
)
03
procedure
fc
04
END
05
contains
06
07
function
a
,
b
08
real
intent
IN
::
:
09
size
dim
=
1
2
10
matmul
11
end
12
13
14
program
main
15
use
16
x
3
y
4
17
;
18
write
*
x .mm. y
19
查看全部评分
838
大宗师
百事可乐 发表于 2014-12-6 16:13 我这里有一个重载 matmul 的代码,给你当例子吧 [Fortran] 纯文本查看 复制代码查看代码打印?01module matmul_int02[/quote]03[mw_shl_code=fortran,true] program main04 implicit none05 06 interface07 subroutine random_arr(a)08 implicit none09 integer(4),intent(out),allocatable ::a(:)10 end11 end interface12 13 interface operator(.U.)14 Function addy(c1, c2)15 implicit none16 integer, intent(in) :: c1(:), c2(:)17 integer, intent(out):: addy(20) 错误: Function addy(c1, c2) 1 错误: (1)处的符号不是一个 DUMMY 变量 /Users/StarkLee/Desktop/EQU2.F90:33.1: function addy(c1,c2) 1 错误: (1)处的符号不是一个 DUMMY 变量 Jarvis:~ StarkLee$ 什么原因啊==
[
/
quote
]
mw_shl_code
fortran
true
implicit
none
interface
subroutine
random_arr
integer
out
allocatable
operator
.U.
Function
addy
c
in
20
li913 发表于 2014-12-6 19:10 普通的 + - * / 都是可以运用于数组的。 real a(3,4), b(3,4), c(3,4)
臭石头雪球
2038
5
论坛跑堂
Module
S
Interface
Operator
Procedure
Addy
End
Contains
C
Implicit
None
Integer
Intent
In
Arry
I
Len
Logical
Flg
Size
-1
Do
-2
21
23
-3
24
All
.Eq.
25
Print
26
Merge
27
28
29
Program
Main
30
Use
31
32
33
34
Subroutine
Random_arr
A
35
36
Kind
Out
Allocatable
37
38
39
40
41
42
B
43
Lena
Lenb
44
45
Call
Init_random_seed
46
47
48
49
50
'A'
51
Write
52
'B'
53
54
Format
55
56
fcode 发表于 2014-12-7 00:31 照猫画虎还不会? [mw_shl_code=fortran,true]Module S
955
大师
本版积分规则 发表回复 回帖后跳转到最后一页
颁发给完成“有规有矩”任务的网友
颁发给论坛注册3年以上的网友
颁发给在娱乐版上传了真实照片的女性网友
颁发给论坛热心帮助他人的网友
颁发给经认证的具有特殊贡献和地位的名人
颁发给注册后积极发言的新人
颁发给对本站有突出贡献的朋友
颁发给本站版主和管理
颁发给在娱乐版上传了真实照片的男性网友
颁发给为Fcode网站捐赠的网友
颁发给发帖量超过一定数量的坛友
捐赠本站|Archiver|关于我们 About Us|小黑屋|Fcode ( 京ICP备18005632-2号 )
GMT+8, 2025-4-28 15:49
Powered by Discuz! X3.4
© 2013-2025 Comsenz Inc.