Critical current density distribution and magnetization loss in YBCO coated conductors