Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个带有许多子例程的模块,这些子例程都使用相同的输出格式集。现在,我必须在每个子程序中声明格式。有没有办法在模块中声明它们以便所有子例程都可以访问它们?
您可以将格式存储为模块级别的字符。例如
module foo implicit none character(len=20), parameter :: form = "(1X,A)" contains subroutine bar ... write(my_unit, form) "Hello, World" end subroutine bar end module foo