할당 가능한 배열을 서브 루틴으로 전달하는 프로그램이 필요하며, 내가하는 방식이 표준인지 아닌지를 알아야합니다.fortran, 할당 할 수있는 배열을 오른쪽 경계를 가진 서브 루틴에 전달
내가 포트란 표준을 검색 할 수있는 위치를 알고 있다면 알려주십시오. 여기
, 나는 그래서 세 가지 방법이 있습니다================================
666.000000000000 214.000000000000 558.000000000000
================================
214.000000000000 558.000000000000 332.000000000000
================================
558.000000000000 332.000000000000 -521.000000000000
================================
를 얻을 더 나은 모듈 화면에 modt99
module modt99
contains
subroutine test3(v1,v2,v3)
real(pr), dimension(:), intent(in) :: v1
real(pr), dimension(0:), intent(in) :: v2
real(pr), dimension(:), allocatable, intent(in) :: v3
print*,'================================'
print*,v1(1:3)
print*,'================================'
print*,v2(1:3)
print*,'================================'
print*,v3(1:3)
print*,'================================'
end subroutine test3
end module modt99
와 단어보다
program test
use modt99
implicit none
real(pr), dimension(:), allocatable :: vx
allocate(vx(-1:6))
vx=(/666,214,558,332,-521,-999,120,55/)
call test3(vx,vx,vx)
deallocate(vx)
end program test
을 설명하는 작은 코드 test3 서브 루틴의 임시 인수 (포트란의 어떤 버전에서, 90, 95, 2003?)와 그들의 행동 표준?
답장을 보내 주셔서 감사합니다. 당신이주는 링크에서, 그것은 f95에서도 괜찮은 것 같지 않습니까? – user2910558
* 모든 * 표준 문서는 IBM Fortran for IBM 704 * (1957!)에서 시작하여 제공됩니다. –