[Fortran] 纯文本查看 复制代码
program test
implicit none
real(kind=8) :: a
type :: mytype
real :: kk
end type mytype
type(mytype) :: tt(2)
a=1
write(*,*) tt(1)
write(*,*) tt(2)
call funcs_syn(a,tt)
end program test
subroutine funcs_syn(wavei,AtmospherePara)
real(kind=8) wavei
type :: mytype
real :: kk
end type mytype
type(mytype) :: AtmospherePara(2)
return
end
[Fortran] 纯文本查看 复制代码
module mytype
implicit none
type m
real::a
end type m
end module mytype
program main
use mytype
implicit none
type(m)::b
b%a=2.0
call test(b)
end program main
subroutine test(b)
use mytype
implicit none
type(m)::b
write(*,*)b%a
end subroutine test