validate_compiler_name Subroutine

public pure elemental subroutine validate_compiler_name(compiler_name, is_valid)

Check if compiler name is a valid compiler name

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: compiler_name

Name of a compiler

logical, intent(out) :: is_valid

Boolean value of whether compiler_name is valid or not


Variables

Type Visibility Attributes Name Initial
character(len=:), public, allocatable :: lname

Source Code

pure elemental subroutine validate_compiler_name(compiler_name, is_valid)

    !> Name of a compiler
    character(len=*), intent(in) :: compiler_name

    !> Boolean value of whether compiler_name is valid or not
    logical, intent(out) :: is_valid
    
    character(:), allocatable :: lname
    
    lname = lower(compiler_name)
    
    select case (lname)
      case("gfortran", "ifort", "ifx", "pgfortran", &
           "nvfortran", "flang", "caf", &
           "f95", "lfortran", "lfc", "nagfor",&
           "crayftn", "xlf90", "ftn95", "all")
        is_valid = .true.
      case default
        is_valid = .false.
    end select
    
end subroutine validate_compiler_name