## Learning Fortran

### 1.- Printing the Hello world

The hello world itself has not much explanation: Then we need to compile it and run it:

```gfortran hello.f90 -o hello
./hello
Hello World!```

### 2.- Converting degrees to radians

In this case we are going to write a module called trig which contains two functions:degtorad and radtodeg. degtorad should be a function which converts angles from degrees to radians,radtodeg should perform the inverse operation. Then to read in 3 angles (in degrees) from the screen. The program should use module trig to convert the 3 angles from degrees to radians and then back to degrees again. Trig.f90: ```module load intel-compilers-17

ifort trig.f90 angleconv.f90 -o angleconv

./angleconv ```

3.- Calculating root squares

Having three inputs: a, b and c, calculate the two root squares considering a determinant ```gfortran quadraticeq.f90 -o quadratic

4.- Calculating complex square roots Now we can use subroutines and module called mod_roots.f90 and the main program that will use the module and subroutines ```gfortran mod_roots.f90 quadra3b.f90 -o qua

./qua```

5.- Solving discontinuous functions like this:

`1 ≤ x < 400 : y = x ∗ x ∗ x + C1`

400 ≤ x < 1000 : y = x ∗ x + C2

`1000 ≤ x ≤ 10000 :y = x`

This can be a solution using arrays: We can use also the structure WHERE to handle arrays: The game of Life

I can only show the output of this code because involves a challenge we have in the University of Edinburgh. It was compile with gnu and intel. Thanks to my teacher Fiona!  