1
에서 이름에 잘못된 문자가 나는 test.f로 저장 컴파일 오류 : (1)
program test
implicit none
integer, parameter :: N = 3
real(8), parameter :: &
A(N,N) = reshape((/1.5d0,1d0,1d0,1d0,1.5d0,2d0,1d0,1d0,3d0/), shape(A)) &
b(N) = (/ 5d0,-3d0,8d0 /)
print *, A
end program
을 쓰고,
gfortran -ffree-form -Wall -Werror -ffree-line-length-none test.f
으로 컴파일 오류가 발생했습니다.
test.f:6:24:
A(N,N) = reshape((/1.5d0,1d0,1d0,1d0,1.5d0,2d0,1d0,1d0,3d0/), shape(A)) &
1
Error: Invalid character in name at (1)
test.f:9:12:
print *, A
1
Error: Symbol ‘a’ at (1) has no IMPLICIT type
무엇이 잘못 되었습니까?
컴파일러는 GNU 포트란 (GCC) 버전 6.1.1입니다.
제안 : '교체 실제 (8)'명명 된 상수, 말,'사용하여, 고유 :: iso_fortran_env 만 : WP => REAL64'라고 선언 한 다음 real (wp) :: A (N, N)을 선언하십시오. 마지막으로 리터럴을'1.5_wp, 2.0e + 3_wp'라고 쓰십시오. – jlokimlin