Source: https://www.aber.ac.uk/en/media/departmental/imaps/pdfs/laboratoryfiles/ph25520_fortran90.pdf