我想访问一个名称等于我拥有的字符串的实际变量。像这样的东西(我将让这个例子尽可能干净): character(len=5) :: some_string
real :: value
value = 100.0
some_string = 'value'
在这一点上,我该如何创建字符数组value和我的真实变量的名称,值之间的关联,从而使我可以通过参考字符串some_string来写入10
我试图从fortran函数返回一个类型。这是代码。 module somemodule
implicit none
! define a simple type
type sometype
integer :: someint
end type sometype
! define an interface
interface
! define a function
下面列出的Fortran函数按照预期使用ifort 11.1进行编译和执行。然而GFortran 4.6返回编译器错误: THIS_NML => THIS Error: Different types in pointer assignment at (1); attempted assignment of CLASS(UNIT) to TYPE(UNIT). Fortran代码: FUNCTIO