Bit manipulation in fortran

Thanks to your testing, I think I figured out the solution to my problem. Somehow it is not fast enough :thinking::thinking::thinking:

I think I have to try out equivalence and reshape to see which way of bit manipulation is the fastest.