Skip to content

Instantly share code, notes, and snippets.

View szaghi's full-sized avatar

Stefano Zaghi szaghi

View GitHub Profile
@szaghi
szaghi / bench_select_if_goto.md
Last active October 16, 2016 19:41
Fortran benchmark: select case/if elseif/goto comparison

Aims

Compare the performance of select case, if elseif and goto branching flows.

Benchmark program

program bench_select_if_goto
  use iso_fortran_env
  implicit none
@jshahbazi
jshahbazi / djb_hash.f90
Last active April 3, 2020 19:27
Daniel J. Bernstein's hash algorithm written in Fortran
integer function djb_hash(str) result(hash)
implicit none
character(len=*),intent(in) :: str
integer :: hash
integer :: i
hash = 5381
do i=1,len(str)