我正在尝试将假定的等级数组写到文件中:
subroutine write_dbl_gen(filename, array)
Implicit None
character(len=*), intent(in) :: filename
real(8), intent(in) :: array(..)
open(unit=p_un, file=filename, form="unformatted",&
access="stream")
write (p_un) array
close(unit=p_un)
end subroutine write_dbl_gen
然后,人们抱怨:
(base) > $ make [±master ●]
[ 25%] Building Fortran object CMakeFiles/npy.x.dir/src/npy.F90.o
/Users/redies/NPY-for-Fortran/src/npy.F90(835): error #8842: An I/O list item must not be an assumed rank object. [ARRAY]
write (p_un) array
---------------------^
compilation aborted for /Users/redies/NPY-for-Fortran/src/npy.F90 (code 1)
make[2]: *** [CMakeFiles/npy.x.dir/src/npy.F90.o] Error 1
make[1]: *** [CMakeFiles/npy.x.dir/all] Error 2
make: *** [all] Error 2
如何将假定的等级数组写入文件?我尝试重塑它,但是“重塑”功能不会采用假定的秩数组。我尝试使用“转移”进行类似的操作,但存在相同的问题。
假定等级的实体出现的位置非常有限。特殊约束(Fortran 2018,C837)说: