使用抽象接口和声明的参数化类型时发生灾难性错误

时间:2019-01-29 14:00:23

标签: fortran intel-fortran

  module test2
     implicit none
     integer :: ts

  end module test2


  module test1
  implicit none

  type :: ty2(t_size )
      integer, len :: t_size
      real :: x(t_size )
  end type


  type :: ty1(t_size )
      integer, len :: t_size
      real :: x(t_size )
  end type


  abstract interface
  subroutine dummy( dat1 )
     use test2
     import ty1
     implicit none
     type(ty1(t_size=ts)), intent(inout) :: dat1

  end subroutine
  end interface


  end module

  program test

  use test2

  ts = 10




  end program

有人可以告诉我为什么这不起作用吗?

我可以告诉您触发错误的是type(ty1(t_size=ts)), intent(inout) :: dat1

如果我改为将ts声明为参数,它可以工作,但似乎不接受动态的其他方式?

预先感谢

0 个答案:

没有答案
相关问题