Я создаю исполняемую версию программы с использованием Visual Studio 2019 и Intel Parallel Studio XE 2020. Для этой программы требуется библиотека Fortran * stati c. Программа позволяет включать пользовательские макросы в сборку. Я пытаюсь включить пользовательский макрос, чтобы программа могла генерировать вывод TECPLOT. Пользовательский макрос для вывода TECPLOT был создан кем-то другим.
Когда я включаю пользовательский макрос, я получаю следующие ошибки:
Severity Code Description Project File Line Suppression State
Error Compilation Aborted (code 1) C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 1
Error error #5078: Unrecognized token '\' skipped C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 102
Error error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ( <IDENTIFIER> <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_CONSTANT> <INTEGER_CONSTANT> ... C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 102
Error error #5082: Syntax error, found ',' when expecting one of: <END-OF-STATEMENT> ; C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 102
Error error #5078: Unrecognized token '\' skipped C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 102
Error error #5082: Syntax error, found ''' when expecting one of: ) ( , : <END-OF-STATEMENT> ; % [ . = / => C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 102
Error error #5078: Unrecognized token '\' skipped C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 102
Error error #5078: Unrecognized token '\' skipped C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 102
Error error #5078: Unrecognized token '\' skipped C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 102
Error error #5078: Unrecognized token '\' skipped C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 103
Error error #5078: Unrecognized token '\' skipped C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 103
Error error #5078: Unrecognized token '\' skipped C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 103
Error error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ( <IDENTIFIER> <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_CONSTANT> <INTEGER_CONSTANT> ... C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 103
Error error #5078: Unrecognized token '\' skipped C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 103
Error error #5078: Unrecognized token '\' skipped C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 103
Error error #5078: Unrecognized token '\' skipped C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 103
Error error #5078: Unrecognized token '\' skipped C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 103
Error error #5078: Unrecognized token '\' skipped C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 103
Error error #5082: Syntax error, found '&' when expecting one of: <LABEL> <END-OF-STATEMENT> ; <IDENTIFIER> TYPE MODULE ELEMENTAL IMPURE NON_RECURSIVE ... C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 103
Error error #5078: Unrecognized token '\' skipped C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 104
Error error #5082: Syntax error, found '&' when expecting one of: <LABEL> <END-OF-STATEMENT> ; <IDENTIFIER> TYPE MODULE ELEMENTAL IMPURE NON_RECURSIVE ... C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 104
Error error #5120: Unterminated character constant C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 104
Error error #5082: Syntax error, found '&' when expecting one of: <LABEL> <END-OF-STATEMENT> ; <IDENTIFIER> TYPE MODULE ELEMENTAL IMPURE NON_RECURSIVE ... C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 115
Error error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ( <IDENTIFIER> <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_CONSTANT> <INTEGER_CONSTANT> ... C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 115
Error error #5082: Syntax error, found '&' when expecting one of: <LABEL> <END-OF-STATEMENT> ; <IDENTIFIER> TYPE MODULE ELEMENTAL IMPURE NON_RECURSIVE ... C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 116
Error error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ( <IDENTIFIER> <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_CONSTANT> <INTEGER_CONSTANT> ... C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 116
Error error #5082: Syntax error, found '&' when expecting one of: <LABEL> <END-OF-STATEMENT> ; <IDENTIFIER> TYPE MODULE ELEMENTAL IMPURE NON_RECURSIVE ... C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 117
Error error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ( <IDENTIFIER> <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_CONSTANT> <INTEGER_CONSTANT> ... C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 117
Error error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ( <IDENTIFIER> <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_CONSTANT> <INTEGER_CONSTANT> ... C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 118
Error error #5082: Syntax error, found '&' when expecting one of: <LABEL> <END-OF-STATEMENT> ; <IDENTIFIER> TYPE MODULE ELEMENTAL IMPURE NON_RECURSIVE ... C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 118
Error error #5082: Syntax error, found '&' when expecting one of: <LABEL> <END-OF-STATEMENT> ; <IDENTIFIER> TYPE MODULE ELEMENTAL IMPURE NON_RECURSIVE ... C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 119
Я считаю, что ошибки основаны на синтаксисе, в частности, на строке 102, где я пишу многострочный текст. Usermacro ниже:
subroutine umacr1(lct,ctl)
c-----[--.----+----.----+----.-----------------------------------------]
implicit none
include 'iofile.h'
include 'ioincl.h'
include 'counts.h'
include 'umac1.h'
include 'pointer.h'
include 'comblk.h'
include 'cdata.h'
include 'sdata.h'
include 'comfil.h'
c include 'pfeapb.h'
logical pcomp
integer j
character lct*15,dump*17
real*8 ctl(3)
save
c Set command word
if(pcomp(uct,'mac1',4)) then ! Usual form
uct = 'tecp' ! Specify 'name'
elseif(urest.eq.1) then ! Read restart data
elseif(urest.eq.2) then ! Write restart data
elseif(pcomp(lct,'init',4)) then ! open output unit; incl. counter
c Try to open file for later use (filename based on input file)
write(dump,1999) nstep
cc Identify parition in the parallel case
c if(pfeap_on) then
c dump = fplt(LEN_TRIM(fplt)-4:LEN_TRIM(fplt)) // dump
c endif
dump = 'tecout' // dump
open(unit=99, file=dump)
write(*,*) 'Saving TECPLOT data to ',dump
elseif(pcomp(lct,'close',4)) then ! close output unit
close(unit=99)
elseif(pcomp(lct,'write',4)) then ! output postprocessing data
c Write nodal postprocessing data
c 2D Data
if(ndm.eq.2) then
write(99,*) 'TITLE=\"FEM DATA, FEAP->TECPLOT\"'
write(99,*) 'VARIABLES=\"X\",\"Y\",\"DX\",\"DY\",\"UX\",
&\"UY\",\"FX\",\"FY\",\"1-PR\",\"2-PR\",\"3-PR\",\"I-1\",\"J-2\",
&\"J-3\"'
write(99,2001) numnp,numel
if(nen.eq.4) then
write(99,*) 'DATAPACKING=POINT, ZONETYPE=FEQUADRILATERAL'
elseif(nen.eq.3) then
write(99,*) 'DATAPACKING=POINT, ZONETYPE=FETRIANGLE'
endif
do j=0,numnp-1
write(99,2011)
& hr(np(43)+j*ndm),hr(np(43)+j*ndm+1), ! nodal coor X 43
& hr(np(40)+j*ndf),hp(np(40)+j*ndf+1), ! nodal disp U 40
& hr(np(43)+j*ndm),hr(np(40)+j*ndf), ! deformed nodal pos.
& hr(np(43)+j*ndm+1),hr(np(40)+j*ndf+1),
& hr(np(27)+j*ndm),hr(np(27)+j*ndm+1), ! forces, disp F 27
& hr(np(57)+numnp*1+j), ! principal stress 1
& hr(np(57)+numnp*2+j), ! principal stress 2
& hr(np(57)+numnp*3+j), ! principal stress 3
& hr(np(57)+numnp*4+j), ! I 1
& hr(np(57)+numnp*5+j), ! J 2
& hr(np(57)+numnp*6+j) ! J 3 (v. Mises-Stress)
end do
c 'Array 33 IX: Element Connections'
if(nen.eq.4) then !quadrilateral
do j=0,numel-1
write(99,2003) mr(np(33)+j*nen1),mr(np(33)+j*nen1+1),
& mr(np(33)+j*nen1+2)
end do
endif !nen
c 3D Data
elseif((ndm.eq.3).and.(ndf.eq.3)) then ! classic continuum elem.
write(99,*) 'TITLE=\"FEM DATA, FEAP->TECPLOT\"'
write(99,*) 'VARIABLES=\"X\",\"Y\",\"DX\",\"DY\",\"UX\",
&\"UY\",\"FX\",\"FY\",\"1-PR\",\"2-PR\",\"3-PR\",\"I-1\",\"J-2\",
&\"J-3\"'
write(99,2001) numnp,numel
if(nen.eq.8 .or. nen.eq.27 .or. nen.eq.20) then
write(99,*) 'DATAPACKING=POINT, ZONETYPE=FEBRICK'
elseif(nen.eq.4 .or. nen.eq.10 .or. nen.eq.11) then
write(99,*) 'DATAPACKING=POINT, ZONETYPE=FETETRAHEDRON'
endif
do j=0,numnp-1
write(99,2013)
& hr(np(43)+j*ndm),hr(np(43)+j*ndm+1),hr(np(43)+j*ndm+2),
& hr(np(40)+j*ndf),hp(np(40)+j*ndf+1),hp(np(40)+j*ndf+2),
& hr(np(43)+j*ndm),hr(np(40)+j*ndf), ! deformed nodal pos.
& hr(np(43)+j*ndm+1),hr(np(40)+j*ndf+1),
& hr(np(43)+j*ndm+2),hr(np(40)+j*ndf+2),
& hr(np(27)+j*ndf),hr(np(27)+j*ndf+1),hr(np(27)+j*ndf+2),
& hr(np(57)+numnp*1+j), ! principal stress 1
& hr(np(57)+numnp*2+j), ! principal stress 2
& hr(np(57)+numnp*3+j), ! principal stress 3
& hr(np(57)+numnp*4+j), ! I 1
& hr(np(57)+numnp*5+j), ! J 2
& hr(np(57)+numnp*6+j) ! J 3 (v. Mises-Stress)
end do
c 'Array 33 IX: Element Connections'
if(nen.eq.8 .or. nen.eq.27 .or. nen.eq.20) then !hexahedral
do j=0,numel-1
write(99,2014)
& mr(np(33)+j*nen1),mr(np(33)+j*nen1+1),
& mr(np(33)+j*nen1+2),mr(np(33)+j*nen1+3),
& mr(np(33)+j*nen1+4),mr(np(33)+j*nen1+5),
& mr(np(33)+j*nen1+6),mr(np(33)+j*nen1+7)
end do
elseif(nen.eq.4 .or. nen.eq.10 .or. nen.eq.11) then !tetrahedral
do j=0,numel-1
& mr(np(33)+j*nen1),mr(np(33)+j*nen1+1),
& mr(np(33)+j*nen1+2),mr(np(33)+j*nen1+3)
end do
endif
c
elseif((ndm.eq.3).and.(ndf.eq.6)) then ! micropolar continuum elem.
write(99,*) 'TITLE=\"FEM DATA, FEAP->TECPLOT\"'
write(99,*) 'VARIABLES=\"X\",\"Y\",\"DX\",\"DY\",\"DZ\",
&\"RX\",\"RY\",\"RZ\",
&\"FX\",\"FY\",\"FZ\",
&\"MX\",\"MY\",\"MZ\",
&\"sig11\",\"sig12\",\"sig13\",
&\"sig21\",\"sig22\",\"sig23\",
&\"sig31\",\"sig32\",\"sig33\",
&\"sigc11\",\"sigc12\",\"sigc13\",
&\"sigc21\",\"sigc22\",\"sigc23\",
&\"sigc31\",\"sigc32\",\"sigc33\"'
write(99,2001) numnp,numel
if(nen.eq.8 .or. nen.eq.27 .or. nen.eq.20) then
write(99,*) 'DATAPACKING=POINT, ZONETYPE=FEBRICK'
elseif(nen.eq.4 .or. nen.eq.10 .or. nen.eq.11) then
write(99,*) 'DATAPACKING=POINT, ZONETYPE=FETETRAHEDRON'
endif
do j=0,numnp-1
write(99,2016)
& hr(np(43)+j*ndm),hr(np(43)+j*ndm+1),hr(np(43)+j*ndm+2),
& hr(np(40)+j*ndf),hp(np(40)+j*ndf+1),hp(np(40)+j*ndf+2),
& hr(np(40)+j*ndf+3),hp(np(40)+j*ndf+4),hp(np(40)+j*ndf+5),
& hr(np(27)+j*ndf),hr(np(27)+j*ndf+1),hr(np(27)+j*ndf+2),
& hr(np(27)+j*ndf+3),hr(np(27)+j*ndf+4),hr(np(27)+j*ndf+4),
& hr(np(58)+numnp*1+j),hr(np(58)+numnp*2+j),
& hr(np(58)+numnp*3+j),hr(np(58)+numnp*4+j),
& hr(np(58)+numnp*5+j),hr(np(58)+numnp*6+j),
& hr(np(58)+numnp*7+j),hr(np(58)+numnp*8+j),
& hr(np(58)+numnp*9+j),
& hr(np(58)+numnp*10+j),hr(np(58)+numnp*11+j),
& hr(np(58)+numnp*12+j),hr(np(58)+numnp*13+j),
& hr(np(58)+numnp*14+j),hr(np(58)+numnp*15+j),
& hr(np(58)+numnp*16+j),hr(np(58)+numnp*17+j),
& hr(np(58)+numnp*18+j)
end do
c 'Array 33 IX: Element Connections'
if(nen.eq.8 .or. nen.eq.27 .or. nen.eq.20) then !hexahedral
do j=0,numel-1
write(99,2014)
& mr(np(33)+j*nen1),mr(np(33)+j*nen1+1),
& mr(np(33)+j*nen1+2),mr(np(33)+j*nen1+3),
& mr(np(33)+j*nen1+4),mr(np(33)+j*nen1+5),
& mr(np(33)+j*nen1+6),mr(np(33)+j*nen1+7)
end do
elseif(nen.eq.4 .or. nen.eq.10 .or. nen.eq.11) then !tetrahedral
do j=0,numel-1
& mr(np(33)+j*nen1),mr(np(33)+j*nen1+1),
& mr(np(33)+j*nen1+2),mr(np(33)+j*nen1+3)
end do
endif
endif
endif
c Modified filename format
1999 format('_',I4.4,'.dat')
2001 format('ZONE N=',I6,' E=',I6)
c 2D formats
2002 format(14(F16.8,4X))
2003 format(4(I6,4X))
2004 format(3(I6,4X))
c 3D formats
2011 format(16(F16.8,4X))
2012 format(18(F16.8,4X))
2013 format(22(F16.8,4X))
c
2014 format(8(I6,4X))
2015 format(4(I6,4X))
2016 format(33(F16.8,4X))
end
Обновление: я следовал за @steve и @francescalus, однако все еще получаю следующие ошибки:
Error error #5082: Syntax error, found '&' when expecting one of: <LABEL> <END-OF-STATEMENT> ; <IDENTIFIER> TYPE MODULE ELEMENTAL IMPURE NON_RECURSIVE ... C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 115
Error error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ( <IDENTIFIER> <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_CONSTANT> <INTEGER_CONSTANT> ... C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 115
Error error #5082: Syntax error, found '&' when expecting one of: <LABEL> <END-OF-STATEMENT> ; <IDENTIFIER> TYPE MODULE ELEMENTAL IMPURE NON_RECURSIVE ... C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 116
Error error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ( <IDENTIFIER> <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_CONSTANT> <INTEGER_CONSTANT> ... C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 116
Error error #5082: Syntax error, found '&' when expecting one of: <LABEL> <END-OF-STATEMENT> ; <IDENTIFIER> TYPE MODULE ELEMENTAL IMPURE NON_RECURSIVE ... C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 117
Error error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ( <IDENTIFIER> <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_CONSTANT> <INTEGER_CONSTANT> ... C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 117
Error error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ( <IDENTIFIER> <CHAR_CON_KIND_PARAM> <CHAR_NAM_KIND_PARAM> <CHARACTER_CONSTANT> <INTEGER_CONSTANT> ... C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 118
Error error #5082: Syntax error, found '&' when expecting one of: <LABEL> <END-OF-STATEMENT> ; <IDENTIFIER> TYPE MODULE ELEMENTAL IMPURE NON_RECURSIVE ... C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 118
Error error #5082: Syntax error, found '&' when expecting one of: <LABEL> <END-OF-STATEMENT> ; <IDENTIFIER> TYPE MODULE ELEMENTAL IMPURE NON_RECURSIVE ... C:\Users\ankit\Desktop\feapwtecplot\ver85\compile\umacr1.f 119
Эти ошибки ссылаются на следующие строки :
do j=0,numnp-1
write(99,2011)
& hr(np(43)+j*ndm),hr(np(43)+j*ndm+1), ! nodal coor X 43
& hr(np(40)+j*ndf),hp(np(40)+j*ndf+1), ! nodal disp U 40
& hr(np(43)+j*ndm),hr(np(40)+j*ndf), ! deformed nodal pos.
& hr(np(43)+j*ndm+1),hr(np(40)+j*ndf+1),
& hr(np(27)+j*ndm),hr(np(27)+j*ndm+1), ! forces, disp F 27
& hr(np(57)+numnp*1+j), ! principal stress 1
& hr(np(57)+numnp*2+j), ! principal stress 2
& hr(np(57)+numnp*3+j), ! principal stress 3
& hr(np(57)+numnp*4+j), ! I 1
& hr(np(57)+numnp*5+j), ! J 2
& hr(np(57)+numnp*6+j) ! J 3 (v. Mises-Stress)
end do
Я убедился, что амперсанд находится в правильном столбце.
TIA