Ich habe folgende Fortran-Code, der mit pre 2017 ifort kompiliert:Wie kompiliere ich diesen Fortran Code mit dem neuen 2017 ifort?
program parallel_m
contains
character(500) function PARALLEL_message(i_ss)
character(50) :: Short_Description = " "
integer :: i_s =0
integer :: n_threads = 0
!
PARALLEL_message=" "
!
if (i_s>0) then
if (len_trim("test this ")==0) return
endif
!
if (i_s==0) then
PARALLEL_message=trim("10")//"(CPU)"
if (n_threads>0) PARALLEL_message=trim(PARALLEL_message)//"-"//trim("200")//"(threads)"
else
PARALLEL_message=trim("a")//"(environment)-"//&
& trim("a")//"(CPUs)-"//&
& trim("a")//"(ROLEs)"
endif
!
end function
end program parallel_m
durch den Präprozessor Going:
icc -ansi -E example.F > test.f90
Welche produziert:
# 1 "mod.F"
program parallel_m
contains
character(500) function PARALLEL_message(i_ss)
character(50) :: Short_Description = " "
integer :: i_s =0
integer :: n_threads = 0
!
PARALLEL_message=" "
!
if (i_s>0) then
if (len_trim("test this ")==0) return
endif
!
if (i_s==0) then
PARALLEL_message=trim("10")
if (n_threads>0) PARALLEL_message=trim(PARALLEL_message)
else
PARALLEL_message=trim("a")
& trim("a")
& trim("a")
endif
!
end function
end program parallel_m
dies leider mit Intel 2017 tut nicht kompilieren, gleich Ausgabe kompiliert, ohne Beschwerde auf 2016 und 2015 ifort Releases. dies ist der Fehler, die ich bekomme:
mod.F(19): error #5082: Syntax error, found '&' when expecting one of: <LABEL> <END-OF-STATEMENT> ; TYPE INTEGER REAL COMPLEX BYTE CHARACTER CLASS DOUBLE ...
& trim("a")
------------------------^
mod.F(20): error #5082: Syntax error, found '&' when expecting one of: <LABEL> <END-OF-STATEMENT> ; TYPE INTEGER REAL COMPLEX BYTE CHARACTER CLASS DOUBLE ...
& trim("a")
------------------------^
compilation aborted for test.f90 (code 1)
Ihr Präprozessor ist das Problem, es ist die Fortführung des Ampersands. – agentp