编辑代码

program main
implicit none

    module module_test
    implicit none
      real,parameter :: a = 10
      real,parameter :: b = 20
    end module_test

    subroutine add
    implicit none
       use module_test
       real :: c,d,e
       d = module_test%a
       e = module_test%b
       c = d + e
       print*, c
    end subroutine add

    call add
end program main