Kk thanks for the heads up, I didn't even notice that the indentation had completely disappeared. I hope it looks better like this:
[
/////subroutine harmonics(max,theta,phi,Yr,Yi)
/////implicit none
/////integer max,k,nn,n,grens
/////double precision x,theta,phi,ct,nphi,pi...