I believe the following is a valid Fortran 2008 program and it works fine on genuine macOS, Linux, and Windows operating systems with both Intel and GNU Fortran compilers.