Thanks for your reply FJacq, but when i try using your solutions i get these errors, and from what I've researched online it seems that fortran is not compiling the matrix_module file in time.
In file perverse.f95:10
real, dimension(:, :), allocatable, Intent(in out ) :: Matrix...