Previously FORTRAN

One of the first programming language ever created, and the oldest one which is currently in use. Fortran still be using particularly by physics. Why?

Frotran was made for and by mathematicians, physics and engineers, that in the 50's in IBM. Becuase of that, for example, we start to count by one and not in zero, as usual in computer science, that "to be" consistens with the typical math notation in sums or products, etc.

Some of my programs in this awesome and powerfull language program are in the buttons bellow with documentation, and also a little program about Quadratic Equation is showed, it just to display how is the sintaxis in FORTRAN.


Quadratic Equation

Here we have a simple code for solving a quadratic equation using only real variables in the code. As we know, the genalizated solution for quadratic equations are described by: $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$ Therefore, to compute the value for any QE we need:
PROGRAM QuadraticEquation
IMPLICIT NONE

REAL*8:: a, b, c                        !Real, for ax^2 + bx + c = 0
REAL*8:: d                              !Discriminant
REAL*8:: root1, root2, root3, root4     !Roots, for sqrt(-1) we'll use the character 'i'

WRITE (UNIT=*, FMT='(/A/)') 'Write down coeficients as: ax^2 + bx + c = 0:'

WRITE (UNIT=*, FMT='(a)', ADVANCE='NO') ' a = '
READ(*,*) a

WRITE (UNIT=*, FMT='(a)', ADVANCE='NO') ' b = '
READ(*,*) b

WRITE (UNIT=*, FMT='(a)', ADVANCE='NO') ' c = '
READ(*,*) c

!Can we compute?

IF (a == 0.0) THEN
  IF (b == 0.0) THEN
    IF (c == 0.0) THEN
      !0=0 tautology
      WRITE (*,*) 'Come on, dude. All the numbers are roots! LOL'
    ELSE
      !Rlly?
      WRITE (*,*) 'Unsolve Equation, bist du blau? LMAO'
    ENDIF
  ELSE
    !not coefficient for x^2
    WRITE(*,*) 'It was a Linear Equation, but the root is: ', -c/b
  ENDIF

ELSE 

!Here we go with the chicharronera

  d = b*b - 4.d0*a*c                !Discriminant
  IF ( d .GE. 0.0 ) THEN            !We'll have real roots
    d     = DSQRT(d)
    root1 = (-b + d)/(2.d0*a)       ! first root
    root2 = (-b - d)/(2.d0*a)       ! second root
    WRITE(*,FMT="(A,F9.5,A,F9.5)")  'Roots are: ', root1, ' and ', root2
  ELSE                              !We'll have complex roots
    d     = SQRT(-d)
    root3 = -b/(2.d0*a)             !roots as parts of whole root
    root4 =  d/(2.d0*a)
    WRITE(*,*)  'The roots are:'
    WRITE(*,FMT="(F9.5,A3,F9.5,A)")  root3,'  +', root4,'i'
    WRITE(*,FMT="(F9.5,A3,F9.5,A)")  root3,'  -', root4,'i'
  ENDIF
ENDIF

ENDPROGRAM QuadraticEquation

Miscellaneous programs

In the next buttons are some programs written by me, some of them has also a documentation file, some others just the code. However, don't be shy to send me a message to know more about the code that I've wrote.

Only source code:

Hückel Method Linear Regression Polynomial Regression Determinant by LU Gauss Jordan Diagonalize Gaussian Inversion Helium Monte Carlo F90 parallelization

Documented source:

Integration Monte Carlo Integration Optimization in 2D

Poyects

Nika HartreeFockRoothaan