News:

SMF - Just Installed!

Main Menu

Recent posts

#83
Fortran / sample fotran code
Last post by Mark Barkey - June 08, 2017, 06:10:10 PM
sample fortran code


      Program Examples
c     
c  Every Fortran program must start with the statement "program"
c


c  It is a good idea to identify the author, date, and purpose
c  of your program


c
c      Fortran Examples
c      M. E. Barkey
c      18 August 2009
c      This program will give some basic examples of Fortran Statements
c
c

c  In fixed-format fortran, where things are is important.


c23456789012345678901234567890123456789012345678901234567890123456789012
c
c     comments are any lines that have a character in position 1
c
c     columns 2-5 are for reference numbers or statement numbers
c
c     column 6 is reservered for a continuation character
c     any character except "0" (zero) can be used
C     !CAUTION!  DO NOT USE TAB to get over to column 6  use spaces!
c
c     in Fortran 77 (fixed format), programming statements must be at
c     column 7 or later and must not extend past column 72


c  The next section is for variable declarations.
c     Good programming practice is to declare ALL variables.
c     If a variable is not declared, it is assumed that
c     a-h and o-z are reals
c     i-n are integers (notice interger strates with i and n)
c     variables in F77 must start with a character, and be
c     no longer than 6 characters/numbers


      Real a, b(10), c(10), a1, a2, a3, a4, a5, k, k2
      Double Precision d(10)
      Character eChar*25
      Integer i, j, e(10)




c  Sample of how to write to screen

Write (*,*) 'This is a screen print' 





a = 10.78
a1 = a*1.0
j = a1*1.0

C making something an integer will TRUNCATE, not round the number
C in strict F77, mulitplying a real with an integer will result
c in truncation

c It is good practice to always use real numbers when multiplying
c real variables, e.g. a1 = a * 1.0, NOT a1 = a * 1


write (*,*) a, a1, j


c to take a number to a power, use two stars (**)
c addition, multiplication, subtraction, division are as usual

a2 = a**2.0
a3 = a + a
a4 = 2.0*a - 0.5*a
a5 = a2/a3


write (*,*) a2, a3, a4, a5







c  Do Loop to intialize an array
c  500 is reference line number
c  i is index, 1, 10 is go from 1 to 10
c  the last 1 is the step

write (*,*)
write (*,*)
write (*,*) 'this is the do loop'

c  it is good practice to indent the items
c  inside the do loop

Do 500, i = 1, 10, 1

b(i) = a*real(i)
c(i) = a*i
d(i) = a*2.0*real(i)
e(i) = int (d(i))

write (*,*) i, b(i), c(i), d(i), e(i)

500    Continue


k = 4.7
write (*,*)
write (*,*) k

c comparisons are done with .lt. .gt. .le. .ge. .eq.

if (k.le.3.0) then

   write (*,*) 'less than or equal to 3.0'

else

           write (*,*) 'must be greater than or equal to 3.0'

end if


c boolean operators are .AND. .OR. .NOT.

         if ((k.gt.4.0).AND.(k.lt.6.0)) then

           write (*,*) 'must be greater than 4.0'
   write (*,*) 'and less than 6.0'

end if


C file input/output

open (12, file = 'sample.dat')

echar = 'this is a string'

write (12, *) 'unformatted output'
write (12, *) k

write (12, *) 'formatted output'
write (12, 900) k, k, int(k), echar

close (12)






       open (14, file = 'sample.dat', status = 'old')

        read (14, *) echar
        read (14, *) k2

write (*,*) 'part of file'
        write (*,*) echar, k2
       
       close (14)





c      f is floating point, 6.2 means 6 total spots, 2 decimal
c      10x is ten spaces
c      i5 is 5 spot integer
c      a5 is 5 character string


900   format (f6.2, 10x, f6.1, i5, 5x, a5)


       End
#84
Helpful Information / Windows 7 Start Menu Location
Last post by Mark Barkey - May 28, 2017, 02:57:54 PM
https://superuser.com/questions/86078/where-do-start-menu-all-programs-shortcuts-reside

28
down vote
accepted
   

As you edited -

Any users start menu is located at:

    C:\Users\USER-NAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\

So for your example, it would be:

    C:\Users\Administrator\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\

And the Global / All users Start Menu is located at:

    C:\ProgramData\Microsoft\Windows\Start Menu\Programs

All users / Default Desktop is now a hidden folder located at:

    C:\Users\Public\Desktop

Any users desktop is located at

    C:\Users\USER-NAME\Desktop\

So for your example, if the user is administrator, it would be:

    C:\Users\Administrator\Desktop\

But if it is the current logged on user, a quicker way is simply to type this in to run or the explorer bar:

    %userprofile%\desktop

#85
AEM class related files / HW-11
Last post by Mark Barkey - May 02, 2017, 04:27:24 PM

student comment

I would appreciate some speedy explanations of some of the finer details of the
analysis as we went through it, For example, what was the purpose of setting a max principal
stress, and how would making it larger/smaller affect the analysis? I know these topics are in the
user guide, but a quick 20-second fly-by during the analysis could be helpful as a starter
#86
Misc Files / Cracked Plate in Compression
Last post by Mark Barkey - May 02, 2017, 01:42:28 AM
Cracked Plate in Compression

http://forums.mbarkey.com/index.php?action=downloads;sa=view;down=24

Here is an image attached that shows a that -1 MPa was applied to the model and all the stresses are nearly -1 MPa in the y-direction.
#87
AEM class related files / HW-13 Buckling Analysis of Con...
Last post by Mark Barkey - April 08, 2017, 12:10:24 AM
#88
AEM class related files / HW-12 Composite Layup and IGES...
Last post by Mark Barkey - April 05, 2017, 11:00:48 PM
#90
AEM class related files / Re: AEM 535 HW-8 Drawing of Bi...
Last post by Mark Barkey - March 26, 2017, 02:10:58 AM
The wire slows down during contact, I may try moving the die along the wire.