Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read data file a time for Hetval subroutine 1

Status
Not open for further replies.

truongthinhs

Mechanical
Jul 12, 2007
18
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
 
Replies continue below

Recommended for you

Variant 1:

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.
 
I finished the new program based on your reply. Analysis time is short and algorithm You gave is good. Thank Xerf very much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor