From 0619e579c3e52414c7173b957d1c409dc5708518 Mon Sep 17 00:00:00 2001 From: Patrik Tesarik Date: Thu, 6 Sep 2018 23:10:07 +0200 Subject: [PATCH 1/8] Delete monte_carlo_pi.f90 --- contents/monte_carlo_integration/code/fortran/monte_carlo_pi.f90 | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 contents/monte_carlo_integration/code/fortran/monte_carlo_pi.f90 diff --git a/contents/monte_carlo_integration/code/fortran/monte_carlo_pi.f90 b/contents/monte_carlo_integration/code/fortran/monte_carlo_pi.f90 deleted file mode 100644 index e69de29bb..000000000 From 3e86449900be9d6007506ae341ae17e20f3d7022 Mon Sep 17 00:00:00 2001 From: depate Date: Wed, 12 Sep 2018 22:50:19 +0200 Subject: [PATCH 2/8] init --- contents/bubble_sort/code/fortran/bubble.f90 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 contents/bubble_sort/code/fortran/bubble.f90 diff --git a/contents/bubble_sort/code/fortran/bubble.f90 b/contents/bubble_sort/code/fortran/bubble.f90 new file mode 100644 index 000000000..1031a3617 --- /dev/null +++ b/contents/bubble_sort/code/fortran/bubble.f90 @@ -0,0 +1,15 @@ +SUBROUTINE bubblesort(array) + IMPLICIT NONE + INTEGER :: len_array + REAL(8), ALLOCATABLE, DIMENSION(:,:) :: array + + + for i +END SUBROUTINE bubblesort + +PROGRAM + IMPLICIT NONE + INTEGER :: cols, rows + + +END PROGRAMM From 5d1602aa2c4e38df55f2e5f3adaad5761751b18d Mon Sep 17 00:00:00 2001 From: Patrik Tesarik Date: Sun, 23 Sep 2018 02:52:46 +0200 Subject: [PATCH 3/8] further implementation --- contents/bubble_sort/code/fortran/bubble.f90 | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/contents/bubble_sort/code/fortran/bubble.f90 b/contents/bubble_sort/code/fortran/bubble.f90 index 1031a3617..bf28f4dd0 100644 --- a/contents/bubble_sort/code/fortran/bubble.f90 +++ b/contents/bubble_sort/code/fortran/bubble.f90 @@ -1,15 +1,18 @@ SUBROUTINE bubblesort(array) IMPLICIT NONE - INTEGER :: len_array + INTEGER :: len_array REAL(8), ALLOCATABLE, DIMENSION(:,:) :: array - for i + DO + + END DO END SUBROUTINE bubblesort -PROGRAM - IMPLICIT NONE - INTEGER :: cols, rows +PROGRAM main + +IMPLICIT NONE +INTEGER :: cols, rows END PROGRAMM From 1ea8e186748cadef359def352046566145838660 Mon Sep 17 00:00:00 2001 From: Patrik Tesarik Date: Sun, 23 Sep 2018 16:36:06 +0200 Subject: [PATCH 4/8] next --- contents/bubble_sort/code/fortran/bubble.f90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contents/bubble_sort/code/fortran/bubble.f90 b/contents/bubble_sort/code/fortran/bubble.f90 index bf28f4dd0..9e6733bb1 100644 --- a/contents/bubble_sort/code/fortran/bubble.f90 +++ b/contents/bubble_sort/code/fortran/bubble.f90 @@ -1,8 +1,9 @@ SUBROUTINE bubblesort(array) IMPLICIT NONE - INTEGER :: len_array + INTEGER :: array_length, array_shape REAL(8), ALLOCATABLE, DIMENSION(:,:) :: array + len_array = size(array) DO From bad6359ce34d61a179873dd7239b302110de44da Mon Sep 17 00:00:00 2001 From: depate Date: Tue, 2 Oct 2018 12:31:07 +0200 Subject: [PATCH 5/8] fix wrong fortran syntax highlight declaration --- contents/euclidean_algorithm/euclidean_algorithm.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contents/euclidean_algorithm/euclidean_algorithm.md b/contents/euclidean_algorithm/euclidean_algorithm.md index 81860ae5f..6cac82567 100644 --- a/contents/euclidean_algorithm/euclidean_algorithm.md +++ b/contents/euclidean_algorithm/euclidean_algorithm.md @@ -139,7 +139,7 @@ The Euclidean Algorithm is truly fundamental to many other algorithms throughout {% sample lang="nim" %} [import, lang="nim" %](code/nim/euclid_algorithm.nim) {% sample lang="f90" %} -[import, lang="Fortran"](code/fortran/euclidean.f90) +[import, lang="fortran"](code/fortran/euclidean.f90) {% endmethod %} From 7b9eb97eaafedc1b2f0445a19bc5fa945dd59345 Mon Sep 17 00:00:00 2001 From: depate Date: Tue, 2 Oct 2018 12:36:46 +0200 Subject: [PATCH 6/8] fix that merge thing in bubble.f90 again... --- contents/bubble_sort/code/fortran/bubble.f90 | 21 -------------------- 1 file changed, 21 deletions(-) diff --git a/contents/bubble_sort/code/fortran/bubble.f90 b/contents/bubble_sort/code/fortran/bubble.f90 index 001ce6f94..3c19f7aee 100644 --- a/contents/bubble_sort/code/fortran/bubble.f90 +++ b/contents/bubble_sort/code/fortran/bubble.f90 @@ -1,24 +1,3 @@ -<<<<<<< HEAD -SUBROUTINE bubblesort(array) - IMPLICIT NONE - INTEGER :: array_length, array_shape - REAL(8), ALLOCATABLE, DIMENSION(:,:) :: array - - len_array = size(array) - - DO - - END DO -END SUBROUTINE bubblesort - -PROGRAM main - -IMPLICIT NONE -INTEGER :: cols, rows - - -END PROGRAMM -======= PROGRAM main IMPLICIT NONE From 554518d7a74119b10013724f27463fb7ddfee245 Mon Sep 17 00:00:00 2001 From: depate Date: Tue, 2 Oct 2018 12:38:14 +0200 Subject: [PATCH 7/8] fix that merge thing in bubble.f90 again... --- contents/bubble_sort/code/fortran/bubble.f90 | 1 - 1 file changed, 1 deletion(-) diff --git a/contents/bubble_sort/code/fortran/bubble.f90 b/contents/bubble_sort/code/fortran/bubble.f90 index 3c19f7aee..fb903f0d3 100644 --- a/contents/bubble_sort/code/fortran/bubble.f90 +++ b/contents/bubble_sort/code/fortran/bubble.f90 @@ -40,4 +40,3 @@ SUBROUTINE bubblesort(array) END SUBROUTINE bubblesort END PROGRAM main ->>>>>>> 44181dc533101507167ae8fe2c97329100941098 From c5f97fe32a5a73d52b5f8ead1a2a96d004d82aa2 Mon Sep 17 00:00:00 2001 From: depate Date: Tue, 2 Oct 2018 23:27:39 +0200 Subject: [PATCH 8/8] fix the fix --- contents/euclidean_algorithm/euclidean_algorithm.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contents/euclidean_algorithm/euclidean_algorithm.md b/contents/euclidean_algorithm/euclidean_algorithm.md index 6cac82567..8620fa1ee 100644 --- a/contents/euclidean_algorithm/euclidean_algorithm.md +++ b/contents/euclidean_algorithm/euclidean_algorithm.md @@ -40,7 +40,7 @@ The algorithm is a simple way to find the *greatest common divisor* (GCD) of two {% sample lang="nim" %} [import:13-24, lang="nim"](code/nim/euclid_algorithm.nim) {% sample lang="f90" %} -[import:1-19, lang="Fortran"](code/fortran/euclidean.f90) +[import:1-19, lang="fortran"](code/fortran/euclidean.f90) {% endmethod %} Here, we simply line the two numbers up every step and subtract the lower value from the higher one every timestep. Once the two values are equal, we call that value the greatest common divisor. A graph of `a` and `b` as they change every step would look something like this: @@ -87,7 +87,7 @@ Modern implementations, though, often use the modulus operator (%) like so {% sample lang="nim" %} [import:1-11, lang="nim"](code/nim/euclid_algorithm.nim) {% sample lang="f90" %} -[import:21-34, lang="Fortran"](code/fortran/euclidean.f90) +[import:21-34, lang="fortran"](code/fortran/euclidean.f90) {% endmethod %} Here, we set `b` to be the remainder of `a%b` and `a` to be whatever `b` was last timestep. Because of how the modulus operator works, this will provide the same information as the subtraction-based implementation, but when we show `a` and `b` as they change with time, we can see that it might take many fewer steps: