function get_id(compiler) result(id)
character(len=*), intent(in) :: compiler
integer(kind=compiler_enum) :: id
if (check_compiler(compiler, "gfortran")) then
id = id_gcc
return
end if
if (check_compiler(compiler, "f95")) then
id = id_f95
return
end if
if (check_compiler(compiler, "caf")) then
id = id_caf
return
end if
if (check_compiler(compiler, "ifort")) then
select case (get_os_type())
case default
id = id_intel_classic_nix
case (OS_MACOS)
id = id_intel_classic_mac
case (OS_WINDOWS, OS_CYGWIN)
id = id_intel_classic_windows
end select
return
end if
if (check_compiler(compiler, "ifx")) then
select case (get_os_type())
case default
id = id_intel_llvm_nix
case (OS_WINDOWS, OS_CYGWIN)
id = id_intel_llvm_windows
end select
return
end if
if (check_compiler(compiler, "nvfortran")) then
id = id_nvhpc
return
end if
if (check_compiler(compiler, "pgfortran") &
& .or. check_compiler(compiler, "pgf90") &
& .or. check_compiler(compiler, "pgf95")) then
id = id_pgi
return
end if
if (check_compiler(compiler, "nagfor")) then
id = id_nag
return
end if
if (check_compiler(compiler, "flang-new")) then
id = id_flang_new
return
end if
if (check_compiler(compiler, "f18")) then
id = id_f18
return
end if
if (check_compiler(compiler, "flang")) then
id = id_flang
return
end if
if (check_compiler(compiler, "xlf90")) then
id = id_ibmxl
return
end if
if (check_compiler(compiler, "crayftn")) then
id = id_cray
return
end if
if (check_compiler(compiler, "lfc")) then
id = id_lahey
return
end if
if (check_compiler(compiler, "lfortran")) then
id = id_lfortran
return
end if
id = id_unknown
end function get_id