[Fortran] 纯文本查看 复制代码 module global_data
implicit none
Integer , parameter :: QP = Selected_real_kind( 18 )
real(kind=QP),allocatable::h(:),u(:)
Integer , parameter :: ne=100
contains
subroutine tvdd(t) !//把 tvdd 包含在module里,方便使用
real(kind=QP) :: t(:)
t=t+1
endsubroutine
end module
program main
use global_data
implicit none
integer::NERR
ALLOCATE(h(ne),u(ne),STAT=NERR)
IF(NERR>0)THEN
WRITE(6,*) 'ERROR IN ALLOCATE'
STOP
ENDIF
call tvdd(h)
call tvdd(u)
DEALLOCATE(h,u)
end |