xyMin = 0.
IF ( xyMin.EQ.0. _d 0 ) THEN
xyMin = xyLoc
xyMin = MIN( xyMin, xyLoc )
IF ( xyMin.EQ.0. _d 0 ) xyMin = xyLoc
xyMin = -xyMin
_GLOBAL_MAX_RL( xyMin, myThid )
& 'DIAGNOSTICS_SET_CALC: d2Min=',d2Min, ', ijMin=',xyMin
IF ( xyMin.EQ.xyLoc ) THEN
d2Loc = ABS( xyLoc - xyMin )
_RL xLine, xy0, xyLoc, xyMin