chk Subroutine

subroutine chk(modelout, name, rgb, other)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: modelout
character(len=*), intent(in) :: name
integer, intent(in) :: rgb(3)
integer, intent(in) :: other(3)

Contents

Source Code

chk

Variables

Type Visibility Attributes Name Initial
integer, public :: status
real, public :: val1
real, public :: val2
real, public :: val3

Source Code

        subroutine chk(modelout,name,rgb,other)
        ! given a color convert to MODELOUT and compare to expected values
        character(len=*),intent(in)   :: name
        integer,intent(in)            :: rgb(3), other(3)
        character(len=*),intent(in)   :: modelout
        real                          :: val1,val2,val3
        integer                       :: status
           ! convert RGB values to MODELOUT values
           call hue('rgb',REAL(rgb(1)),REAL(rgb(2)),REAL(rgb(3)),&
           & modelout,val1,val2,val3,status)
           ! left-justify name to 10 characters or more
           write(*,'(a,1x)',advance='no') &
           & [ character(len=max(10,len_trim(name))) ::' '//trim(name)]
           write(*,'(a,1x,3(i3,1x))',advance='no') &
           & modelout//' EXPECTED',other
           write(*,'(a,1x,3(i3,1x))',advance='no') &
           & 'GOT',int([val1+0.5,val2+0.5,val3+0.5])
           write(*,'(a,i0)')'STATUS ',status
        end subroutine chk