How to avoid multiple type definitions due to different kinds?

@FortranFan, thanks for your suggestions. You are absolutely right.