kperp_array(ikx,iky,iz)=sqrt(gxx(iz)*kx**2+2._dp*gxy(iz)*kx*ky+gyy(iz)*ky**2)!! / hatB( iz) ! there is a factor 1/B from the normalization; important to match GENE
! kperp_array(ikx, iky, iz) = sqrt( gxx(iz)*kx**2 + 2._dp* gxy(iz) * kx*ky + gyy(iz)* ky**2) !! / hatB( iz) ! there is a factor 1/B from the normalization; important to match GENE