Example of a Fortran program using Higher-order functions in a FP style