Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

subroutine utemp wont read data from a file 1

Status
Not open for further replies.

cooln

Mechanical
Jul 20, 2007
4
I am doing a simple analysis where the loading is due to thermal strain. I have created a job using CAE and I am using user subroutine utemp to supply nodal temperature values:

SUBROUTINE UTEMP(TEMP,MSECPT,KSTEP,KINC,TIME,NODE,COORDS)
C
INCLUDE 'ABA_PARAM.INC'
C
DIMENSION TEMP(MSECPT), TIME(2), COORDS(3)
C
OPEN(UNIT=1,FILE='temp-data.txt',STATUS='OLD',IOSTAT=IOS)
C
C read temp for node= NODE
C
CLOSE(1)
C
RETURN
END

--------------------------------------------------------
The trouble is that the subroutine somehow simply wont open the existing file. The execution command that I am using is:
abaqus job=jobname user=utemp_file.f

Thanks in advance for all help!
 
Replies continue below

Recommended for you

Do not use unit=1, it is probably used by the solver. To avoid conflicts you should use UNIT=101, 102 ..etc.

Also, it might help to supply the full path to the file.

Another remark:
UTEMP (as many other subroutines) it is called for each node/ each time increment. Therefore, your code will open and close the file each time UTEMP is called. If your model is small then it does not matter.

In this situation, personally, I prefer to build an interpolation function if possible. If not then, it would be better to read the file once at the beginning of the analysis and store the values in a common block. For example, you can do this directly in UTEMP by using a flag=1 in a common block, such that first time UTEMP is called you read the data, put it in an array and set the flag to 0.

 
Thanks xerf, it worked.
Your comment on using common was very useful as well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor