ultrasonic sensor, soil moisture sensor, sim800l gprs gsm module and neo 6m modu

hi im having a problem if my code everythig works fine when they are uploaded solo but when i combine my code gsm and gps wont work can you help me here is my code:

#include <SoftwareSerial.h>
#include <TinyGPS++.h>
float latitude, longitude;
float a[2];
float *p;
SoftwareSerial gpsSerial(52,53);
SoftwareSerial gsmSerial(A14,A15);
TinyGPSPlus gps;
int trigPin1 = 11; //Trig1 ultrasonic
int echoPin1 = 10; //Echo1 ultrasonic
long duration1,duration2, cm1,cm2 ,inches1, inches2;
int buzzer1  = 9; //buzzer violet
void setup() {
  // put your setup code here, to run once:
  Serial.begin (9600);
  gpsSerial.begin(9600);
  gsmSerial.begin(9600);
  gsmSerial.println("AT+CNMI=2,2,0,0,0");// AT Command to receive a live SMS
  Serial.println("AT+CNMI=2,2,0,0,0");
  //Define inputs and outputs
  pinMode(trigPin1, OUTPUT);
  pinMode(echoPin1, INPUT);
  pinMode(buzzer1, OUTPUT);
  digitalWrite(buzzer1, LOW);
}

void loop() {

  // put your main code here, to run repeatedly:
 digitalWrite(trigPin1, LOW);
  delayMicroseconds(5);
  digitalWrite(trigPin1, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin1, LOW);


  // Read the signal from the sensor: a HIGH pulse whose
  // duration is the time (in microseconds) from the sending
  // of the ping to the reception of its echo off of an object.

  duration1 = pulseIn(echoPin1, HIGH);
  // convert the time into a distance
  cm1 = (duration1 / 2) / 29.1;
  inches1 = (duration1 / 2) / 74;
  Serial.print(inches1);
  Serial.print("in, ");
  Serial.print(cm1);
  Serial.print("cm");
  Serial.println();

  //ultrasonic sensor code
  if (cm1 <= 5) { //buzzer distance
    digitalWrite(buzzer1, HIGH);
    
    for (int i = cm1; i > 0; i--)
      delay(1000);
    digitalWrite(buzzer1, LOW);

    for (int i = cm1; i > 0; i--)
      delay(1000);
  
  } else {
    digitalWrite(buzzer1, LOW);
    
  }
  

 while(gsmSerial.available()){
    gsmSerial.read();
  }
  while(Serial.available()){
    Serial.read();
  }
  get_gsm();
  }

 float *get_gps()
 {
   gpsSerial.listen();
   while(1)
   {
    while(gpsSerial.available()>0)
    {gps.encode(gpsSerial.read());}

    if (gps.location.isUpdated())
    {
    latitude = gps.location.lat();
    longitude = gps.location.lng();
    break;
    }
   }
a[0]=latitude;
a[1]=longitude;
return a;
 }

 void get_gsm()
 {
  gsmSerial.listen();


  while(gsmSerial.available()>0)
  {

  if(gsmSerial.find("Where The Fuck Are You?!!"))
  {Serial.println("Sending Coordinate");
  gsmSerial.println("AT+CMGF=1");    //Sets the GSM Module in Text Mode
     delay(1000);  // Delay of 1 second
     gsmSerial.println("AT+CMGS=\"+639435797714\"\r"); // Replace x with mobile number
     delay(1000);
     p=get_gps();
     gsmSerial.listen();
     gsmSerial.print("www.google.com/maps/place/" + String(*p, 6) + "," + String(*(p+1), 6));// The SMS text you want to send
     Serial.print("www.google.com/maps/place/" + String(*p, 6) + "," + String(*(p+1), 6));
     delay(100);
     gsmSerial.println((char)26);// ASCII code of CTRL+Z for saying the end of sms to  the module 
 }
  }
  }