Timusop
Mechanical
- Sep 23, 2011
- 58
I would like to write results to a .txt file through a subroutine, but can not find the code to include into my subroutine. Can anyone help? I have provide my current subroutine below. Thanks.
SUBROUTINE USDFLD (FIELD,STATEV,PNEWDT,DIRECT,T,CELENT,TIME,DTIME,CMNAME,ORNAME,NFIELD,NSTATV,NOEL,NPT,LAYER,KSPT,KSTEP,KINC,NDI,NSHR,COORD,JMAC,JMATYP,MATLAYO,LACCFLA)
c
INCLUDE 'ABA_PARAM.INC'
c
CHARACTER*80
CMNAME,ORNAME
CHARACTER*3 FLGRAY(15)
DIMENSION FIELD(NFIELD),STATEV(NSTATV),DIRECT(3,3),T(3,3),TIME
DIMENSION ARRAY(15),JARRAY(15),JMAC(*),JMATYP(*),COORD(*)
c
CALL GETVRM ('E',ARRAY,JARRAY,FLGRAY,JRCD,JMAC,JMATYP,MATLAYO,LACCFLA) EPS=ABS(ARRAY(1))
c
FIELD(1)=EPS
c
STATEV(1)=FIELD(1)
c
OPEN (unit=1, file='STATEV.txt')
WRITE (1),STATEV(1)
c
RETURN
END
SUBROUTINE USDFLD (FIELD,STATEV,PNEWDT,DIRECT,T,CELENT,TIME,DTIME,CMNAME,ORNAME,NFIELD,NSTATV,NOEL,NPT,LAYER,KSPT,KSTEP,KINC,NDI,NSHR,COORD,JMAC,JMATYP,MATLAYO,LACCFLA)
c
INCLUDE 'ABA_PARAM.INC'
c
CHARACTER*80
CMNAME,ORNAME
CHARACTER*3 FLGRAY(15)
DIMENSION FIELD(NFIELD),STATEV(NSTATV),DIRECT(3,3),T(3,3),TIME
DIMENSION ARRAY(15),JARRAY(15),JMAC(*),JMATYP(*),COORD(*)
c
CALL GETVRM ('E',ARRAY,JARRAY,FLGRAY,JRCD,JMAC,JMATYP,MATLAYO,LACCFLA) EPS=ABS(ARRAY(1))
c
FIELD(1)=EPS
c
STATEV(1)=FIELD(1)
c
OPEN (unit=1, file='STATEV.txt')
WRITE (1),STATEV(1)
c
RETURN
END