Mark the "c" array as intent(out)

And zero it in the populate_weights() subroutine.