set_cpu_scaling_min_freq Subroutine

private impure elemental subroutine set_cpu_scaling_min_freq(this, min_freq)

Type Bound

linux_cpu

Arguments

Type IntentOptional Attributes Name
class(linux_cpu), intent(inout) :: this
integer, intent(in) :: min_freq

Contents


Source Code

   elemental impure subroutine set_cpu_scaling_min_freq(this,min_freq)
      class(linux_cpu), intent(inout) :: this
      integer, intent(in)             :: min_freq
      integer                         :: nunit, stat
      logical                         :: ex
      character(len=:), allocatable   :: file_name

      this%scaling_min_freq = min_freq

      file_name = this%path_cpu//"/cpufreq/scaling_min_freq"
      inquire(file=file_name, exist=ex)
      if (ex) then
         open(newunit=nunit, file=file_name, iostat=stat)
         write(nunit, '(i0)') this%scaling_min_freq
         close(nunit)
      else
         ! error stop "file not found: "//file_name
      endif
   end subroutine set_cpu_scaling_min_freq