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
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
"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
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
RE: Understanding a User Subroutine
RE: Understanding a User Subroutine
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/