function init_forced_end_semistart_weight(csf_i, sOrb, pOrb, negSwitches, posSwitches, bVal) &
result(forced_semistart)
type(CSF_Info_t), intent(in) :: csf_i
integer, intent(in) :: sOrb, pOrb
real(dp), intent(in) :: negSwitches, posSwitches, bVal
type(WeightObj_t) :: forced_semistart
! TODO(@Oskar): I think this is invalid code
type(WeightObj_t), target, save :: double
forced_semistart%dat%F = endFx(csf_i, sorb)
forced_semistart%dat%G = endGx(csf_i, sorb)
double = init_forced_end_exchange_weight(csf_i, porb)
forced_semistart%ptr => double
forced_semistart%dat%minus = double%proc%minus(negSwitches, bVal, double%dat)
forced_semistart%dat%plus = double%proc%plus(posSwitches, bVal, double%dat)
forced_semistart%dat%zero = double%proc%zero(negSwitches, posSwitches, bVal, double%dat)
forced_semistart%proc%minus => getMinus_semiStart
forced_semistart%proc%plus => getPlus_semiStart
forced_semistart%initialized = .true.
end function init_forced_end_semistart_weight