我想知道將數組從Fortran傳遞到C的正確方法。它返回的結果是iso_c_binding只有C_F_pointer但沒有F_C_pointer。我嘗試使用c_loc,但是第二個元素得到了-6.04639e-264。 我的Fortran代碼是: SUBROUTINE SIMULATION(ARRAY) BIND(C)
USE ISO_C_BINDING
IMPLICIT NON
我知道Fortran中的「轉置」是一種在其對角線上翻轉矩陣的運算符。但是,在下面的代碼中,我遇到了一個錯誤,不知道爲什麼。 的代碼是: program main
implicit none
real(8)::a(3,2),b(2,1)
a=reshape((/1.0,2.0,3.0,4.0,5.0,6.0/),(/3,2/))
b=reshape((/1.
我是新來的Fortran,我不明白這行: write(*,'(a35)', advance='no')
在: program democonvertion
implicit none
real :: tc, tf, tr, tk
write(*,'(a35)', advance='no')
& "Enter the temperature in Celc
我讀過Fortran派生類型的手動深度複製是可能的,但下面的簡單測試程序在運行時失敗;程序與PGI v16.10完全編譯。什麼出錯? program Test
implicit none
type dt
integer :: n
real, dimension(:), allocatable :: xm
end type dt