set_clip Subroutine

private subroutine set_clip(this, clip_dict, clip_min, clip_max, clip_norm)

Set clipping information

Type Bound

clip_type

Arguments

Type IntentOptional Attributes Name
class(clip_type), intent(inout) :: this

Instance of the clip type

type(clip_type), intent(in), optional :: clip_dict

Clip dictionary

real(kind=real32), intent(in), optional :: clip_min

Minimum, maximum, and norm values for clipping

real(kind=real32), intent(in), optional :: clip_max

Minimum, maximum, and norm values for clipping

real(kind=real32), intent(in), optional :: clip_norm

Minimum, maximum, and norm values for clipping


Source Code

  subroutine set_clip(this, clip_dict, clip_min, clip_max, clip_norm)
    !! Set clipping information
    implicit none

    ! Arguments
    class(clip_type), intent(inout) :: this
    !! Instance of the clip type
    type(clip_type), optional, intent(in) :: clip_dict
    !! Clip dictionary
    real(real32), optional, intent(in) :: clip_min, clip_max, clip_norm
    !! Minimum, maximum, and norm values for clipping


    !---------------------------------------------------------------------------
    ! Set up clipping limits
    !---------------------------------------------------------------------------
    if(present(clip_dict))then
       this%l_min_max = clip_dict%l_min_max
       this%l_norm = clip_dict%l_norm
       this%min = clip_dict%min
       this%max = clip_dict%max
       this%norm = clip_dict%norm
       if(present(clip_min).or.present(clip_max).or.present(clip_norm))then
          write(*,*) "Multiple clip options provided"
          write(*,*) "Ignoring all except clip_dict"
       end if
    else
       if(present(clip_min))then
          this%l_min_max = .true.
          this%min = clip_min
       end if
       if(present(clip_max))then
          this%l_min_max = .true.
          this%max = clip_max
       end if
       if(present(clip_norm))then
          this%l_norm = .true.
          this%norm = clip_norm
       end if
    end if

  end subroutine set_clip