ELEMENTAL FUNCTION get_parent(n) RESULT(parent) INTEGER, INTENT(IN) :: n INTEGER :: parent parent = INT(n/2) END FUNCTION get_parent