Adding Fortran version of kernel_weights.