The UK and Welsh governments will fund a research programme investigating pollution in the river.