错误:" data-ref中最左边的部分-ref不能是函数引用。"

时间:2016-08-25 17:29:28

标签: fortran subroutine flow abaqus

我正在尝试为ABAQUS写一个FORTRAN子程序,它会修改渗透系数,从而根据表面上是否有接触来修改流量。为此,我需要2个子程序URDFIL来检索节点数据,FLOW来修改渗透系数。

但是,当我编译子程序时,我收到以下错误:

flow_us.for(81): error #6837: The leftmost part-ref in a data-ref can not be a function reference. [K_ELE_DETAILS]
       IF(K_ELE_DETAILS(E_INDX)%IS_CONT(N_INDX).EQ.0)THEN
----------^
flow_us.for(81): error #6158: The structure-name is invalid or is missing. [K_ELE_DETAILS]
       IF(K_ELE_DETAILS(E_INDX)%IS_CONT(N_INDX).EQ.0)THEN

显然,对于包含这种结构(81,8和89)的3行(如果&#39)重复这一过程。

请找到下面的代码,希望有人能够提供帮助

****************************************************************************************
***SUBROUTINE FOR ADAPTIVE FLUID FLOW
****************************************************************************************
****************************************************************************************
**
**
**
*USER SUBROUTINE
    SUBROUTINE URDFIL(LSTOP,LOVRWRT, KSTEP, KINC, DTIME, TIME)
    INCLUDE 'ABA_PARAM.INC'
C
    DIMENSION ARRAY(513),JRRAY(NPRECD,513),TIME(2)
    EQUIVALENCE (ARRAY(1),JRRAY(1,1))
C DECLARATIONS
    TYPE ELE_DATA
        SEQUENCE
        DOUBLE PRECISION :: NODE_COORD(9)
        DOUBLE PRECISION :: OPP_NODE_COORD(9)
        DOUBLE PRECISION :: IPT_COORD(9)
        DOUBLE PRECISION :: POR(3)
        DOUBLE PRECISION :: OPP_POR(3)
        INTEGER :: ELE_NUM
        INTEGER :: OPP_ELE_NUM
        INTEGER :: NODE_NUM(3)
        INTEGER :: OPP_NODE_NUM(3)
        INTEGER :: IPT_NUM(3)
        INTEGER :: OPP_IS_CONT(3)           
    END TYPE ELE_DATA

    TYPE(ELE_DATA)::K_ELE_DETAILS(500)
    COMMON K_ELE_DETAILS
    PARAMETER (THRESHOLD_CSTRESS=1.0E-6)
*******************************************************
    INTEGER :: NO_OF_NODES
    INTEGER :: NO_OF_ELEMENTS
    INTEGER :: NO_OF_DIM
    COMMON NO_OF_DIM, NO_OF_NODES, NO_OF_ELEMENTS
********************************************************
C INITIALIZE   
    LSTOP=0
    LOVRWRT=1
    LOP=0
    NO_OF_NODES=10000
    NO_OF_ELEMENTS=10000
    NO_OF_DIM=2

        DO K1=1,999999
            CALL DBFILE(0, ARRAY,JRCD)
            IF (JCRD.NE.0) GO TO 110
            KEY=JRRAY(1,2)
*******************************************************
C THE KEYS USED IN THE FOLLOWING LINES REFER
C TO INFORMATION ON THE SURFACE, NODES, CONTACT ETC
            IF (KEY.EQ.1501) THEN
            ELSE IF (KEY.EQ.1502)THEN
            ELSE IF(KEY.EQ.1911) THEN
            ELSE IF(KEY.EQ.108.AND.SURFACE_N_SET.EQ.'N_TOP') THEN
            ELSE IF(KEY.EQ.107.AND.SURFACE_N_SET.EQ.'N_TOP') THEN
            ELSE IF(KEY.EQ.1503)THEN
            ELSE IF(KEY.EQ.1504.AND.K_NODE_SET.EQ.'N_TOP')THEN
            ELSE IF(KEY.EQ.1511.AND.K_NODE_SET.EQ.'N_TOP')THEN
C IS THE NODE IN CONTACT?
120  CONTINUE
        END IF
        END DO 
110  CONTINUE
            RETURN
            END

**********************************************************
**********************************************************
*USER SUBROUTINE
    SUBROUTINE FLOW(H, SINK, KSTEP, KINC, TIME, NOEL, NPT, COORDS,
    1 JLTYP,SNAME)
    INCLUDE 'ABA_PARAM.INC'
C
    DIMENSION TIME(2), COORDS(3)
    CHARACTER*80 SNAME

    MIN_DIST=10E-20
    DO K25=1,NO_OF_ELEMENTS
        DO K26=1,NO_OF_NODES
C FINDS THE CLOSEST NODE TO THE INTEGRATION POINT NPT
        END DO
    END DO
C NOT IN CONTACT
    IF(K_ELE_DETAILS(E_INDX)%IS_CONT(N_INDX).EQ.0)THEN
        IF(K_ELE_DETAILS(E_INDX)%POR(N_INDX).GE.0) THEN
            SINK=0
            H=0.001
        ELSE
            SINK=0
            H=1
        END IF
    ELSE IF(K_ELE_DETAILS(E_INDX)%IS_CONT(N_INDX).EQ.1)THEN
C IF THERE IS CONTACT
        SINK=0
        H=0
    END IF
    RETURN
    END

1 个答案:

答案 0 :(得分:0)

我认为你打算写

IF(K_ELE_DETAILS(E_INDX)%OPP_IS_CONT(N_INDX).EQ.0) THEN

而不是

IF(K_ELE_DETAILS(E_INDX)%IS_CONT(N_INDX).EQ.0)THEN

此外,如果您打算使用类型绑定过程扩展此代码,则无法在没有适当接口的情况下引用派生数据类型的函数结果的组件。如果类型声明仅限于module,则很少遇到此类问题。 module将自动为类型绑定过程生成正确的接口。