It is not worth changing in my opinion. It is valid Fortran 95. Especially if your goal is the calculation time. Any "clever" tricks with subarrays can introduce array temporaries.
The obvious try is forall
or do concurrent
forall(i=1:dim, j=1:dim)
Snorm(i,j)=Sval(j)/Sval(i)
Bnorm(i,j)=Bval(j)/Bval(i)
Pnorm(i,j)=Pval(j)/Pval(i)
end forall
and the same with do concurrent
.
Notice, that your original order of the loops is probably not efficient.