Skip to main content

User subroutine in fortran 90 for abaqus

Submitted by BrianBak on

Hi Abaqus experts



I am hoping that you can help me getting a element user subroutine writen in fortran f90 to work in Abaqus. I have made the simplest 8 noded brick element element that i can think of. I has a zero thickness and only has some simple definitions of the parameters ESTIFF,RHS,SVARS and PNEWDT. I have made a model with one single element of this user element where the upper part is displaced from the lower part which are fixed.



When I try to run the model I get the following message in the log file:



"Abaqus Error: The executable C:\SIMULIA\Abaqus\6.10-2\exec\standard.exe

aborted with system error code 5.

Please check the .dat, .msg, and .sta files for error messages if the files

exist.  If there are no error messages and you cannot resolve the problem,

please run the command "abaqus job=support information=support" to report and

save your system information.  Use the same command to run Abaqus that you

used when the problem occurred.  Please contact your local Abaqus support

office and send them the input file, the file support.log which you just

created, the executable name, and the error code.

Abaqus/Analysis exited with errors"



I can not find any information of what this "error code 5" means. Earlier I have used a similar user element written in fortran 77 with succes so i do not think that there is any thing wrong with the linking between the compiler and Abaqus.



Below is a description of my sytem, abaqus settings, model file and the fortran user element file.



My system:

Windows 7 32 bit ultimate

Intel(R) Visual Fortran Compiler Proffesionel 11.1

Microsoft Visual Studio 2008 professionel edition

Abaqus 6.10



The invironment file:

C:\SIMULIA\Abaqus\6.10-2\site\abaqus_v6.env

...

compile_fortran=['ifort', '/c', '/Gm', '/recursive', '/nologo',

                 '/heap-arrays:1', '/include:%I', '/free',

                 '/Od', '/Zi']

...

Note that it has been changed to free form format with /free.





Single user element abaqus model:

**----------------------------------------------------------

*HEADING

**

** Job name: SingleCEelement1

**

** *Preprint, echo=NO, model=NO, history=NO, contact=NO

**

**

*NODE

      1,           1.,           0.,           1.

      2,           0.,           0.,           1.

      3,           1.,           0.,           0.

      4,           0.,           0.,           0.

      5,           1.,           0.,           1.

      6,           0.,           0.,           1.

      7,           1.,           0.,           0.

      8,           0.,           0.,           0.

**

****************************

**

**         SETS           **

**

****************************

**Nodes at the top element face

*NSET,NSET=TOP,GEN

 5,8,1

**Nodes at the bottom element face

*NSET,NSET=BOT,GEN

 1,4,1

**

****************************

**

** GENERATION OF ELEMENTS **

**

****************************

*USER ELEMENT,TYPE=U1,NODES=8,UNSYMM,COORDINATES=3,

 I PROPERTIES=1, PROPERTIES=7,VARIABLES=4

 1,2,3

*ELEMENT,TYPE=U1,ELSET=CEelem

1, 3, 4, 2, 1, 7, 8, 6, 5

*UEL PROPERTY,ELSET=CEelem

 0.9, 1.5, 80.0, 110.0, 1.E+6, 2.0,  0.0, 1

**

****************************

**

**  BOUNDARY CONDITIONS   **

**

****************************

** Name: BC-1 Type: Displacement/Rotation. All DOF fixed

*BOUNDARY

 BOT,1,3

** Name: BC-2 Type: Displacement/Rotation. All DOF except y fixed

*BOUNDARY

 TOP,1,1

 TOP,3,3

**

************************

**

** STEP: Displacement **

**

************************

*STEP, name=Displacement, nlgeom=YES, inc=1000

*STATIC

0.01, 1., 1e-08, 0.01

** Name: BC-3 Type: Displacement/Rotation. Pull in the element

*BOUNDARY,TYPE=DISP

TOP,2,2,0.1

**

** OUTPUT REQUESTS

**

*EL PRINT,FREQUENCY=0

 S

*NODE PRINT,FREQUENCY=50,TOTALS=YES,NSET=TOP

 RF,U

*NODE PRINT,FREQUENCY=50,TOTALS=YES,NSET=BOT

 RF,U

*NODE FILE,FREQ=1

 U

*OUTPUT,HISTORY,FREQUENCY=1

*NODE OUTPUT,NSET=TOP

 U3,RF3

*NODE OUTPUT,NSET=BOT

 RF3,U3

** *NODE OUTPUT,NSET=TOP

** *OUTPUT,FIELD,FREQUENCY=2

** S

** *NODE OUTPUT

** U

*END STEP

**----------------------------------------------------------







User Subroutine for the element:

!------------------------------------------------------------

  SUBROUTINE UEL(RHS,ESTIF,SVARS,ENERGY,NEVAB,NRHS,NSVARS,&

                 PROPS,NPROPS,COORDS,NDIME,NNODE,U,DU,VEL,A,&

                 JTYPE,TIME,DTIME,KSTEP,KINC,IELEM,PARAMS,&

                 NDLOAD,JDLTYPE,ADLMAG,PREDEF,NPREDF,LFLAGS,&

                 MLVARX,DDLMAG,MDLOAD,PNEWDT,JPROPS,NJPROP,&

                 PERIOD)



    

    INCLUDE 'ABA_PARAM.INC'       



  !--------------------------------------------

  ! Declare variable spaces

  !--------------------------------------------

  !**** Abaqus specific UEL variables

    integer,            intent(in    )   :: MLVARX,&

                                            NEVAB,&  

                                            NDIME,&

                                            NNODE,&

                                            MDLOAD,&

                                            NPREDF,&

                                            IELEM,&

                                            NSVARS,&

                                            NRHS,&

                                            NPROPS,&

                                            KSTEP,&

                                            NJPROP

                                            

    integer,            intent(in out)   :: KINC

    

    real(8),allocatable,intent(in out)   :: PREDEF(:,:,:),&

                                            JDLTYPE(:,:), &

                                            ADLMAG(:,:),&

                                            DDLMAG(:,:),&

                                            COORDS(:,:),&

                                            DU(:,:), &

                                            U(:),&

                                            VEL(:),&

                                            A(:),&

                                            PARAMS(:),&

                                            JPROPS(:),&

                                            PROPS(:)



    real(8),allocatable,intent(in out)   :: ESTIF(:,:),&

                                            RHS(:,:),&

                                            SVARS(:),&

                                            LFLAGS(:)



    real(8)            ,intent(in    )   :: JTYPE,&

                                            TIME(2),&

                                            DTIME,&

                                            NDLOAD,&

                                            PERIOD,&

                                            ENERGY(8)

                                            

                                           

    real(8)            ,intent(in out)   :: PNEWDT



                                       

  !**** CE element specific variables

    real(8),allocatable                  :: TAU(:,:),&

                                            POSGP(:),&

                                            ASDIS(:,:),&

                                            DERIV(:,:),&

                                            SHAPEs(:),&

                                            V(:,:),&

                                            BMATX(:,:),&

                                            DBMAT(:,:),&

                                            DMATX(:,:,:),&

                                            XJACM(:,:),&

                                            KF(:),&

                                            SCALAR(:),&

                                            WEIGP(:),&

                                            ESTIFsum(:,:)



    real(8)                              :: DAREA,&

                                            PEN,&

                                            T1,&

                                            T2,&

                                            GIC,&

                                            GIIC,&

                                            ETA

                

  !**** integration specific variables

    real(8)                              :: R,&

                                            S,&

                                            DNORMA3,&

                                            THICK,&

                                            StrainE

                                            

    integer                              :: KGASP,&

                                            NLGEOM,&

                                            IGAUS,&

                                            JGAUS,&

                                            NGAUS

    

  !**** other variables

    integer                              :: M,&

                                            N,&

                                            I,&

                                            J,&

                                            ERR,&

                                            ISTRE,&

                                            IEVAB,&

                                            JEVAB,&

                                            IOError

                                            

    character(len=50)                    :: titel,&

                                            title1

 

    real(8)                              :: debugVar

 

  !--------------------------------------------

  ! Allocate varibles

  !--------------------------------------------

    NGAUS  = 2

    ERR = 0   

    write(*,*),NEVAB

    write(*,*),RHS

    allocate(RHS(NEVAB,1)           ,STAT=ERR);if (err /= 0) STOP " **ERROR in ALLOCATE(RHS)!"

    allocate(DU(MLVARX,24)          ,STAT=ERR);if (err /= 0) STOP " **ERROR in ALLOCATE(DU)!"

    allocate(PARAMS(10)             ,STAT=ERR);if (err /= 0) STOP " **ERROR in ALLOCATE(PARAMS)!"

    allocate(LFLAGS(10)             ,STAT=ERR);if (err /= 0) STOP " **ERROR in ALLOCATE(LFLAGS)!"

    allocate(JPROPS(NJPROP)         ,STAT=ERR);if (err /= 0) STOP " **ERROR in ALLOCATE(JPROPS)!"

    allocate(PROPS(NPROPS)          ,STAT=ERR);if (err /= 0) STOP " **ERROR in ALLOCATE(PROPS)!"

    allocate(JDLTYPE(MDLOAD,10)     ,STAT=ERR);if (err /= 0) STOP " **ERROR in ALLOCATE(JDLTYPE)!"      

    allocate(ADLMAG(MDLOAD,10)      ,STAT=ERR);if (err /= 0) STOP " **ERROR in ALLOCATE(ADLMAG)!"

    allocate(DDLMAG(MDLOAD,10)      ,STAT=ERR);if (err /= 0) STOP " **ERROR in ALLOCATE(DDLMAG)(!"

    allocate(ESTIF(NEVAB,NEVAB)     ,STAT=ERR);if (err /= 0) STOP " **ERROR in ALLOCATE(ESTIF)!"

    allocate(SVARS(NGAUS**2)        ,STAT=ERR);if (err /= 0) STOP " **ERROR in ALLOCATE(SVARS)!"

    allocate(PREDEF(2,NPREDF,NNODE) ,STAT=ERR);if (err /= 0) STOP " **ERROR in ALLOCATE(PREDEF)!"

    allocate(COORDS(NDIME,NNODE)    ,STAT=ERR);if (err /= 0) STOP " **ERROR in ALLOCATE(COORDS)!"

    allocate(U(NEVAB)               ,STAT=ERR);if (err /= 0) STOP " **ERROR in ALLOCATE(U)!"

    allocate(VEL(NEVAB)             ,STAT=ERR);if (err /= 0) STOP " **ERROR in ALLOCATE(VEL)!"

    allocate(A(NEVAB)               ,STAT=ERR);if (err /= 0) STOP " **ERROR in ALLOCATE(A)!"

    allocate(TAU(NGAUS**2,NDIME)    ,STAT=ERR);if (err /= 0) STOP " **ERROR in ALLOCATE(TAU)!"

    allocate(POSGP(NGAUS)           ,STAT=ERR);if (err /= 0) STOP " **ERROR in ALLOCATE(POSGP)!"

    allocate(ASDIS(NGAUS**2,NDIME)  ,STAT=ERR);if (err /= 0) STOP " **ERROR in ALLOCATE(ASDIS)!"

    allocate(DERIV(NDIME-1,NNODE)   ,STAT=ERR);if (err /= 0) STOP " **ERROR in ALLOCATE(DERIV)!"

    allocate(SHAPEs(NNODE)          ,STAT=ERR);if (err /= 0) STOP " **ERROR in ALLOCATE(SHAPEs)!"

    allocate(V(NDIME,NDIME)         ,STAT=ERR);if (err /= 0) STOP " **ERROR in ALLOCATE(V)!"

    allocate(BMATX(NDIME,NEVAB)     ,STAT=ERR);if (err /= 0) STOP " **ERROR in ALLOCATE(BMATX)!"

    allocate(DBMAT(NDIME,NEVAB)     ,STAT=ERR);if (err /= 0) STOP " **ERROR in ALLOCATE(DBMAT)!"

    allocate(DMATX(NGAUS**2,NDIME,NDIME),STAT=ERR);if (err /= 0) STOP " **ERROR in ALLOCATE(DMATX)!"

    allocate(XJACM(NDIME-1,NDIME)   ,STAT=ERR);if (err /= 0) STOP " **ERROR in ALLOCATE(XJACM)!"

    allocate(KF(NGAUS**2)           ,STAT=ERR);if (err /= 0) STOP " **ERROR in ALLOCATE(KF)!"

    allocate(SCALAR(NGAUS**2)       ,STAT=ERR);if (err /= 0) STOP " **ERROR in ALLOCAT(SCALAR)!"

    allocate(WEIGP(NGAUS)           ,STAT=ERR);if (err /= 0) STOP " **ERROR in ALLOCATE(WEIGP)!"

 



    ESTIF = 0.0D0  ! Stiffness is later piecewise integrated in a summation

    RHS = 0.0D0    ! Residual is later piecewise integrated in a summation



    DO I = 1,NGAUS

      POSGP(IGASH) = 1.0D0

    ENDDO

    DO I = 1,NGAUS

      WEIGP(IGASH) = 1.0D0

    ENDDO

    KGASP   = 0

    DO IGAUS=1,NGAUS    !IGAUS

      DO JGAUS=1,NGAUS  !JGAUS

        KGASP=KGASP+1

        R=POSGP(IGAUS)

        S=POSGP(JGAUS)

        

        do i=1,NDIME    !i

          ASDIS(KGASP,i)=0.0D0

          do j=1,NEVAB  !j

            ASDIS(KGASP,i)=ASDIS(KGASP,i)+(U(j))

          enddo    !j

        enddo      !i



        DO I=1,NDIME

          DO J=1,NDIME

            DMATX(KGASP,I,J)=0.D0

          ENDDO

            DMATX(KGASP,I,I)= PEN

        ENDDO

        

        DO i=1,NDIME   

          TAU(KGASP,i)=DMATX(KGASP,i,i)*ASDIS(KGASP,i)

        ENDDO     



        DO j=1,NEVAB/2      !j

          DO i=1,NDIME      !i

            RHS(j,1)=RHS(j,1)-BMATX(i,j)*TAU(KGASP,i)

          ENDDO             !i      

          RHS(j+NEVAB/2,1)=-RHS(j,1)

        ENDDO               !j

        

      DO I=1,NEVAB

        DO J=1,NEVAB

           ESTIF(I,J)= 0.0D0

        ENDDO     !J

        ESTIF(I,I)= 1.0D0

      ENDDO       !I



      SVARS(KGASP)= 0.0D0

      pnewdt = 1.0d0

      

     ENDDO !IGAUS

  ENDDO !JGAUS



 

  deallocate(ASDIS)

  deallocate(DERIV)

  deallocate(SHAPEs)

  deallocate(V)

  deallocate(BMATX)

  deallocate(DBMAT)

  deallocate(DMATX)

  deallocate(XJACM)

  deallocate(KF)

  deallocate(ADLMAG)       

  deallocate(DDLMAG)       

  deallocate(ESTIF)

  deallocate(SVARS)

  deallocate(PREDEF)

  deallocate(COORDS)

  deallocate(U)

  deallocate(VEL)

  deallocate(A)

  deallocate(TAU)

  deallocate(RHS)         

  deallocate(DU)           

  deallocate(PARAMS)       

  deallocate(LFLAGS)       

  deallocate(JPROPS)

  deallocate(PROPS)

  deallocate(JDLTYPE)      

  deallocate(WEIGP)

  deallocate(POSGP)

  deallocate(SCALAR)





    RETURN

  END

 

Thanks in advance 

Best regards

Brian Bak