subroutine utemp wont read data from a file
subroutine utemp wont read data from a file
(OP)
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!
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!





RE: subroutine utemp wont read data from a file
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.
RE: subroutine utemp wont read data from a file
Your comment on using common was very useful as well.