SUBROUTINE set_conf_par_int(this, integer_val)
CLASS(CONF_PAR_INT), INTENT(INOUT) :: this
INTEGER, INTENT(IN), OPTIONAL :: integer_val
INTEGER :: my_integer_val
IF (this%env_value(my_integer_val)) RETURN
! Use User-code value
IF (PRESENT(integer_val) .AND. this%source .NE. 'E') THEN
my_integer_val = integer_val
this%source = 'U'
END IF
IF (PRESENT(integer_val) .OR. this%source .EQ. 'E') THEN
! Set default if the number is negative
IF (this%ensure_positive .AND. my_integer_val < 0) THEN
this%val = this%defval
this%source = 'D'
ELSE
this%val = my_integer_val
END IF
END IF
END SUBROUTINE set_conf_par_int