concept compiler version in category fortran

appears as: compiler version, compiler version, compiler versions
Modern Fortran: Building efficient parallel applications

This is an excerpt from Manning's book Modern Fortran: Building efficient parallel applications.

In this section, you’ll learn how to import from Fortran modules by tackling two tasks: getting the compiler version and options, and accessing type kind parameters for declaring variables in a portable way. Why would you care about these things in practice? They’ll both become important if you ever develop your code in multiple environments (computers, operating systems, or compiler vendors), if you need your code to produce exactly the same results no matter where you run it, or if you distribute your compiled code to your colleagues or customers. Once you understand how to work with a built-in module, you’ll be ready to learn how to write your own.

Listing 4.1. A program that prints the compiler version and options at runtime
language="fortran" linenumbering="unnumbered">program print_compiler_info
  use iso_fortran_env #1
  implicit none
  print *, 'Compiler version: ', compiler_version() #2
  print *, 'Compiler options: ', compiler_options() #3
end program print_compiler_info