cyh 发表于 2019-11-28 12:55:51

如何接受传递过来的常量值

这是主程序
program Console1
implicitnone
Integer,parameter::nm=100
call   start(nm)
end
!这是子例行程序
SUBROUTINE start(nm)
   implicitreal*8 ( a-h,o-z )
      integer*4       tv0001
common/area1/x0(nm)
    end
现在的问题是在子例行程序中怎么接受nm这个常量值,然后赋值给common中这个x0数组

necrohan 发表于 2019-11-28 14:40:49

既然nm是常数,在子程序重新定义一下不就行了?如果很多地方都用也可以单独生成一个include文件共同引用

li913 发表于 2019-11-28 15:57:28

SUBROUTINE start(nm)
   implicitreal*8 ( a-h,o-z )
      integer*4       nm

    common/area1/x0(nm)
x0=nm
    end

fcode 发表于 2019-11-29 09:28:45

都什么年代了,还用 common
页: [1]
查看完整版本: 如何接受传递过来的常量值