Sum of r largest components

Dear GAMS users,
I have a problem which I don’t know how to model in GAMS and here it is:
Assume x(i) is a variable. I want to find the sum of r largest components.
For instance, assume x(i)=(x1, x2, x3, x4, x5, x6, x7) and I wish to find the sum of 3 largest components (i.e., x2+x7+x5 where x2 is the largest component, x7 is the second largest and so on).
How to formulate and solve this problem in GAMS?
Is this problem convex or linear?
Best regards.