How to receive gps location by sending sms to arduino?

How to solve this problem?

The reading of the SMS needs to be COMPLETELY independent of reading from the GPS.

You need to read from the GPS, and store the results in GLOBAL variables, NOT local variables, and NOT Strings.

You need, on every pass through loop(), see if there is an SMS requesting the location. If there is, AND there is stored data, send the stored data.