After doing the following additions, it works in compiler explorer with gfortran 13.2 and produces the following output:
use, intrinsic :: iso_fortran_env
integer(int64) :: iwgt, idx
real(real64) :: wgt
wgt = 0.73980422705616400_real64
iwgt = transfer(wgt, iwgt)
write(*, '(b64)') iwgt
idx = 1_int64
call mvbits(idx, 4, 4, iwgt, 4)
write(*, '(b64)') iwgt
! iwgt after mvbits is the same as original iwgt
end
11111111100111101011000111100111101010000101001100001011010100
11111111100111101011000111100111101010000101001100001000000100