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