dram.me

Fortran中的块结构

Fortran 2008中引入了块结构支持,通过合理使用,可以让代码的框架结构更为清晰,以下是一个不包含模块的示例:

program Main
  use ...

  implicit none

  interface and type declartions ...

  block
    use ...

    variable declartions ...

    code ...
  end block

contains

  function and subroutine definitions ...

end program Main