|
kind的参数必须要编译时确定,不能假定
len的参数可以假定。
所以,多个kind,就要写多个函数。
[Fortran] 纯文本查看 复制代码 06 | real ( kind = p ) , dimension ( q ) :: x |
08 | procedure :: barsub = > barsub 4 , barsub 8 |
13 | subroutine barsub 4 ( this ) |
14 | type ( bar ( p = 4 , q = * ) ) , intent ( in ) :: this |
15 | write ( * , * ) this % q , this % p |
16 | end subroutine barsub 4 |
18 | subroutine barsub 8 ( this ) |
19 | type ( bar ( p = 8 , q = * ) ) , intent ( in ) :: this |
20 | write ( * , * ) this % q , this % p |
21 | end subroutine barsub 8 |
27 | type ( bar ( 4 , 30 ) ) :: x 4 _ 30 |
28 | type ( bar ( 4 , 20 ) ) :: x 4 _ 20 |
29 | type ( bar ( 8 , 30 ) ) :: x 8 _ 30 |
30 | type ( bar ( 8 , 20 ) ) :: x 8 _ 20 |
|
|