Local [temporary] variables are visible only inside the function, call them whatever you like.
I modified this to reflect the other changes I mentioned.
/**********************************************************/
void read_sonar(int trigpin, int pulsepin, int* ary, int asiz)
{
pinMode(pulsepin, INPUT);
for(int i = 0; i < arraysizeL; i++) {
digitalWrite(trigpin, HIGH);
delay(20);
digitalWrite(trigpin, LOW);
ary[i] = pulseIn(pulsepin, HIGH) / 147;
delay(100);
}
}