Earthquake scientists on the West Coast would like to build a system that would give people a bit of warning before they get jolted with strong shaking from a distant quake.

Seismic waves take time to travel from the epicenter, which means such a warning system could issue alerts ranging from a few seconds to a few minutes. A prototype has been developed for the region, seismologists say, but the complete network still lacks funding, and has big gaps outside cities.

Meanwhile, Japan already has something like that up and running.

"They have a network of seismometers — about a thousand of them across the country — that detects earthquakes as they are happening," says Richard Allen, director of the seismology lab at the University of California, Berkeley. "They locate the earthquake, and they estimate the amount of shaking that you might expect." The system then pushes the message out to cellphones, TVs and "a whole variety of communications channels," Allen says.

Japan's high-speed trains put on their brakes. Delicate industrial processes shut down. Eye surgeons step away from their patients. And people take cover.

Allen — along with colleagues at the California Institute of Technology, the U.S. Geological Survey, and the University of Washington — figured, why not establish a system like that for the Pacific coast of the U.S?

Allen has a prototype on his computer simulating what would have happened if a system had been in place in 1989, when the deadly Loma Prieta quake struck California.

An alarm sound blares and a computerized voice warns, "Earthquake! Earthquake! Moderate shaking expected in 21 seconds." (Berkeley experienced moderate shaking from the Loma Prieta quake, which did much more damage elsewhere in the Bay Area.) A few seconds before the seismic waves are due to arrive at a user's location, the alarm sounds quicken.

Loma Prieta's epicenter was in the Santa Cruz Mountains, more than 60 miles from Berkeley. So this system would have given people in the central Bay Area good warning that they were about to be clobbered.

Of course, the system wouldn't help if the Hayward fault ruptured directly beneath the Berkeley campus, but there are plenty of other times when it would.

"The best-case scenario in California is about a minute of warning," Allen says. "In the Pacific Northwest you can get up to five minutes of warning," because the most dangerous fault there is far from cities. "The really big earthquakes," he says, "can give you a significant amount of warning, and that's when you would most want it."

This test system already has a few users trying it out, including Bay Area Rapid Transit. Kevin Copley, manager of computer systems engineering at BART, says when they test the system — or simply get a false alarm — the subway's trains all slow down to 26 mph to reduce the risk of a derailment.

"We do that systemwide, and we also institute a hold," Copley says. "Any train that happens to be at the platform at the time would [automatically be held] there — so it won't close its doors and depart."

It works, he says.

"I ride the system as a passenger every day, and [the early warning system] makes me feel a lot better about it," Copley says. "It's not a solution for every earthquake that's going to happen, but it will give us good warning for a lot of them."

But the current seismic monitoring network isn't complete.

"The network is very dense in San Francisco and Los Angeles, but there are gaps in between," Allen says. "And to be able to provide the most warning, you need to be able to rapidly detect the earthquake when it starts outside of the city so you can see it coming toward the city."

California's Legislature overwhelmingly voted to expand the network and provide the quake-proof infrastructure that would be required to send out the warnings.

"The catch is they didn't allocate any funding to do it," Allen says.

Allen figures it would cost $80 million to set up the network in California and run it for five years — or $120 million for a system that would cover the Pacific Northwest as well. The Pacific Northwest will someday experience the same kind of megathrust quake that struck Japan in 2011.

"If we have a quake this afternoon, the Legislature would find the money next week — and we would build this system next week," Allen says. "So the question becomes, why don't we just do it now?"

Copyright 2016 NPR. To see more, visit http://www.npr.org/.