Julia code becomes slower on running on supercomputers and does not scale well when parallelizing with Base.Threads

Isn’t that the Fortran code is faster?

Personally I would focus in improving the performance of the Julia code. Do you have profiled it to see where is it taking most of the time? If it is is in the LA calls, then one can focus in improving that.

You have some slices and non-constant global variables there, and they might be a problem. But, without a profile, these are just guesses.