×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

subroutine utemp wont read data from a file

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!

RE: subroutine utemp wont read data from a file

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.

RE: subroutine utemp wont read data from a file

(OP)
Thanks xerf, it worked.
Your comment on using common was very useful as well.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources