Following work done in 2.83, the resolution control is now a real level-of-detail parameter. It is now useful to be able to set the resolution for display independently from render, for mesh generation.
In an attempt to limit the work involved, I derived the approach from the subsurf modifier code (checking for render). I am having some issues with backward compatibility so this patch shims values to avoid 0 being set as the ocean_resolution value. Prior blender files have resolution (which is treated as render resolution with this patch), but somehow the evaluation of ocean_resolution is missed (hence the shims) when old blender files are loaded in. The checks for values less than 1 attempt to work around this, but don't feel correct or robust.
I could do with some expert guidance on the compatibility handling post-load. For example, the display resolution UI control is set to 0 and I don't get the default value I'm attempt to set in this case (3). Likewise, ocean_resolution ends up 0 without the conditionals to catch and correct it.