gfortran编译错误错误:(1)处无法分类的语句

时间:2019-01-07 07:55:17

标签: fortran gfortran

我正在编写Fortran代码以在Abaqus中输入用户子例程。 此示例代码用于UEL示例。

我想使UEL成为超弹性参数的子例程。 我首先要做Fortran,所以我无法解决错误。

这是我的代码。 错误是无法分类的陈述, 但我不知道Fortran方法。

Postgresql

这是我的错误。

    c
c Blankholder force contro element for deep drawing applications
c
     subroutine uel(rhs, amatrx, svars, energy, ndofel, nrhs, nsvars,
    1 props, nprops, coords, mcrd, nnode, u, du, v, a, jtype, time, dtime,
    2 kstep, kinc, jelem, params, nload, jdltyp, adlmag, predef, npredf,
    3 lfoags, mlvarx, ddlmag, mdload, pnewdt, jprops, njprop, period)
c
     include 'aba_param.inc'
c
     dimension rhs(mlvarx, *), amatrx(ndofel, ndofel), svars(*), props(*),
    1 energy(7), coord(mcrd, nnode), u(ndofel), du(mlvarx, *), v(ndofel),
    2 a(ndofel), time(2), params(*), jdltyp(mdload, *), adlmag(mdload, *),
    4 ddlag(mdload, *), predef(2, npredf, nnode), lflags(4), jprops(*)
c
c Pick up the input data
c
     sPunch         = props(1)      !Spring stiffness
     fPunchTarget = props(2)        ! Target punch force
     fHolderInit    = props(3)      ! Initial blankholder force
     fractHolder   = props(4)       ! Fractional change allowed
     tolPunch       = props(5)      ! Tolereance on punch force
c
c Calculate the punch force
c
     fPunchNew = sPunch * (u(1)-u(2))
c
c Generate force vector and
c
     rhs(1,1) = -fPunchNew
     rhs(2,1) = +fpunchNew
c
c Generate stiffness matris
c
     amatrx(1,1) = +sPunch
     amatrx(1,2) = -sPunch
     amatrx(2,1) = -sPunch
c
c The holder force is only applied during steps 2 and 3
c
     if(kstep.eq.2) teh
c
c Ramp the punch force to the desired starting value
c
    fHolder = time(1)*fHolderInit/period
    svars(2) = fHolder
    rhs(3,1) = -fHolder
    else if(kstep.eq.3) then
c
c Adjust the punch force to control the blankholder force
c
c Values of state variables at start of increment
c
    fPunchOld = svars(1)    !Punch force
    fHolderOld = svars(2)   !Blankholder force
    fPunchMax = svar(3) !Maximum blankholder force
c
c Allowed change in blankholer force
c
    dfHolderMax = fractHolder * fHolderOld
c
c Allowed tolerance in the targetforce
c
    dfPunchTol = tolPunch * fPunchTarget
c
c Calculate the holder force
c
    if (fPunchOld.gt.fPunchTarget+dfPunchTol) then
      fHolerNew = fHolderOld - dfHolderMax  !Decrease
    else if(fPunchMax.lt.fPunchTarget+dfPunchTol .or.
     1      fPunchOld.gt.fPunchTarget-dfPunchTol) then
      fHolderNew = fHolderOld
    else
      fHolderNew = fHolderOld + dfHolderMax !Increase
    end if
c
c Generate holer force vector
c
    rhs(3,1) = -fHolderNew
c
c Update state variables
c
    svars(1) = fPunchNew
    svars(2) = fPHolderNew
    svars(3) = max(fPunchMax, fPunchNew)
     end if
c
     return 
     end

如何解决此错误并使用Fortran方法?

1 个答案:

答案 0 :(得分:0)

您正在使用所谓的“固定格式” Fortran,其第6列中的字符表示连续的行,请参见Fortran Wiki page about this

从错误中看,如果问题中的格式正确,则显然您会在行的每个开头都缺少一个空格(错误位于行的字符6)。

确保“继续字符”(此处为1、2和3)位于第六列。

您还可以决定切换到“自由格式” Fortran,其中继续行的显示方式有所不同。