×
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

Understanding a User Subroutine

Understanding a User Subroutine

Understanding a User Subroutine

(OP)
Hi all,
I am going through a simple exmaple to try and understand how user subroutines work with abaqus at the same time as trying to understand the Fortran language.  Can anyone provide a

      SUBROUTINE DLOAD(F,KSTEP,KINC,TIME,NOEL,NPT,LAYER,KSPT,COORDS,
     1                 JLTYP,SNAME)
      INCLUDE 'ABA_PARAM.INC'
      DIMENSION COORDS(3)
      CHARACTER*80 SNAME
C NOTE THAT COORDS(3) IS THE ANGULAR COORD IN DEGREES
      PI=2.*ASIN(1.D0)
      THETA=PI*COORDS(3)/180.
      F=-COORDS(1)*COS(THETA)
C      WRITE(6,9991)NOEL,NPT,JLTYP,F,PI,THETA,COORDS
C9991  FORMAT(' NOEL,NPT,JLTYP,F,PI,THETA,COORDS',3I5,1P6G10.3)
      RETURN
      END

Can anyone who understands subrotuines and the fortran language provide an explanation of this subroutine, to give you an exmaple of what I am looking for... for example what does PI=2.*ASIN(1.D0) mean?

Thanks

RE: Understanding a User Subroutine

PI=2.*ASIN(1.D0)   : A clumsy way of specifying PI=3.14159...
"ASIN()" is "arcsine" of the function in brackets. The resulting angle is given in radians.

THETA=PI*COORDS(3)/180.  : COORDS() is an array passed in giving  the coordinates of the current integration station. As it says, COORDS(3) is the angular coordinate in degrees, so this statement converts it to radians.

F=-COORDS(1)*COS(THETA)   :  This works out the pressure to apply to the current integration station as the first coordinate, (radial position r) times the cosine of the angular position, theta.

C      WRITE(6,9991)NOEL,NPT,JLTYP,F,PI,THETA,COORDS  : this is a statement used for initial checking. It writes out the element number, integration point number in element,...the distributed load worked out here and so on. The "C" in front makes the statement a comment, so inactivates it once the analyst was satisfied that the subroutine worked OK.

C9991  FORMAT(' NOEL,NPT,JLTYP,F,PI,THETA,COORDS',3I5,1P6G10.3)  : this specifies the format for the above write statement. Again, it's now a comment so inactive.



  

RE: Understanding a User Subroutine

(OP)
Thanks for your valuable input, just a few more small questions please:

CHARACTER*80 SNAME
1a)For the above statement, why is there a "*", what does that mean?
1b) What does "SNAME" mean, and why is it needed?

PI=2.*ASIN(1.D0)
2) What function is 1.D0?

Thanks again
 

RE: Understanding a User Subroutine

(OP)
Also I could not find the definition of COORDS(1)

RE: Understanding a User Subroutine

(OP)
sorry one more thing.... why WRITE(6,9991), why those numbers? Thanks.

RE: Understanding a User Subroutine

I know the 1.D0 is a way of writing a double precision number in scientific notation in Fortran. The D is like E, but E is single precision. So 1.D0 actually means 1*10^0, or the value 1. Arcsign of 1=pi/2

I think COORDS was assigned a value by the first line. Abaqus will pass in a line of arguments, and this Fortran code will catch that line of arguments and assign them to the variables F, KSTEP, etc. in the order it receives them.

The first write number is the unit number and the second is the format. The 6 is a tag to say which specific file to write to I think. The format number 9991 links that output to the formatting tagged with the label 9991 (the line with that number in the columns 2-5.

Go here. This site rocks. I picked up Fortran pretty quickly with these pages. Short and to the point.
http://folk.uio.no/steikr/doc/f77/tutorial/

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