There seems to be a small gain on my machine (11th Gen Intel® Core™ i7-11850H @ 2.50GHz × 16, 32GB RAM), while the solution is exactly the same as Matlab's one.
Elapsed time for the Matlab Riccati update is: 0.17915 (N=5000). Elapsed time for the Fortran Riccati update is: 0.13226 (N=5000). Fortran Riccati update is 1.35 times faster than its Matlab counterpart. After 1 update using the Riccati formula, the norm-1 discrepancy is 0. After 50 updates using the Riccati formula, the norm-1 discrepancy is 0. FAILED tests: 0