I'm following a tutorial, trying to blur the edges of water, but I'm getting weird jaggies which I just can't seem to get rid of:

This is caused by the depth texture ("depthMap") having a lower resolution than the screen, which I want for optimization. Here is the shader: http://pastebin.com/QfZHBttT
Noteable parts:
float depth = texture2D(depthMap, refractUV).r;
float floorDistance = 2.0 * near * far / (far + near - (2.0 * depth - 1.0) * (far - near));
if (depth >= 1.0)
discard; // This never works
depth = gl_FragCoord.z;
float waterDistance = 2.0 * near * far / (far + near - (2.0 * depth - 1.0) * (far - near));
float waterDepth = floorDistance - waterDistance;
FragColor.r = waterDepth; // using this to show what's going on.
I am not sure how to fix this. I just need those edge pixels to be invisible. They appear at any time the resolution of the depth texture is lower than the screen.
Any help is appreciated.