Read data file a time for Hetval subroutine
Read data file a time for Hetval subroutine
(OP)
I am not good in Abaquas. I am writing the subroutine Hetval, in this subroutine I read data file from my PC. Because I need data to give to Abaqus program. Result is good but it take me a long time because the program must read many times with same data. I want to read the data a time, then assign it to array and use array instead of read file . But I dont know what to do. Can You help me? Please, describe clearly for me.
Thank a lot.
My subroutine:
SUBROUTINE HETVAL(CMNAME, TEMP, TIME, DTIME, STATEV, FLUX,
1 PREDEF, DPRED)
.....
OPEN (UNIT =10, FILE ="...", STATUS="OLD", ACCESS="SEQUENTIAL", IOSTAT=OpenStatus)
...
READ (UNIT =10,FMT = 100, IOSTAT = InputStatus)...
...
close (10)
...
RETURN
END
Thank a lot.
My subroutine:
SUBROUTINE HETVAL(CMNAME, TEMP, TIME, DTIME, STATEV, FLUX,
1 PREDEF, DPRED)
.....
OPEN (UNIT =10, FILE ="...", STATUS="OLD", ACCESS="SEQUENTIAL", IOSTAT=OpenStatus)
...
READ (UNIT =10,FMT = 100, IOSTAT = InputStatus)...
...
close (10)
...
RETURN
END





RE: Read data file a time for Hetval subroutine
Put an ARRAY in a COMMON block, let's call it HIVALUES.
Then use UEXTERNALDB subroutine (see documentation for usage details) which is called at the beginning of the analysis (must check if LOP=0) to read the data from the external file and initiate the HIVALUES.
Declare HIVALUES in HETVAL , now you have the values without reading the external file each time HETVAL is called.
Variant 2:
Put a Boolean flag (TRUE/FALSE) in a COMMON block and set it to FALSE, let's call it FILE_READ=.FALSE.
In HETVAL declare FILE_READ and code something like this:
if FILE_READ=.FALSE. then
1. read the file
2. set FILE_READ=.TRUE.
Thus the file will be read only once!
Best.
RE: Read data file a time for Hetval subroutine