Funding agreed for 40 new Scottish flood protection schemes