使用其他程序单元的模块
要从另一个程序单元(模块,过程或程序)访问模块中声明的实体,该模块必须与 use 语句一起使用。
module shared_data
  implicit none
  integer::iarray(4) = [1, 2, 3, 4]
  real::rarray(4) = [1., 2., 3., 4.]
end module
program test
  !use statements most come before implicit none
  use shared_data
  implicit none
  print *, iarray
  print *, rarray
end program
use 语句仅支持导入选定的名称
program test
  !only iarray is accessible
  use shared_data, only: iarray
  implicit none
  print *, iarray
  
end program
也可以使用重命名列表以不同的名称访问实体 :
program test
  !only iarray is locally renamed to local_name, rarray is still acessible
  use shared_data, local_name => iarray
  implicit none
  print *, local_name
  print *, rarray
  
end program
此外,重命名可以与 only 选项结合使用
program test
  use shared_data, only : local_name => iarray
end program
这样只访问模块实体 iarray,但它的本地名称为 local_name。
如果选择将名称标记为私有,则无法将其导入程序。