validate_os_name Subroutine

public pure elemental subroutine validate_os_name(os_name, is_valid)

Check if os_name is a valid name of a supported OS

Arguments

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

Name of an operating system

logical, intent(out) :: is_valid

Boolean value of whether os_name is valid or not


Source Code

    pure elemental subroutine validate_os_name(os_name, is_valid)

       !> Name of an operating system
       character(len=*), intent(in) :: os_name

       !> Boolean value of whether os_name is valid or not
       logical, intent(out) :: is_valid

       select case (lower(os_name))
         case ("linux", "macos", "windows", "cygwin", "solaris", "freebsd", &
                         & "openbsd", "all")
           is_valid = .true.
         case default
           is_valid = .false.
       end select

    end subroutine validate_os_name