It sounds to me as: you want to deal with "asynchronous clocks".
You want to align a local clock (e.g. in MCU) with a master clock (GPS). And at the end - the MCU clock should adapt itself to run with the same clock.
In HW people call it "PLL" (phase lock loop).
I know this topic from audio applications: a sender (PC) sends audio frames but paying out results in a tiny drift (too fast or too slow).
Here, what I think do you need to check:
- can you "trim" a clock, a PLL, inside MCU, to adjust the clock (make it a bit faster or slower)?
- how fine granular can you do?
- is this just an INT clock divider or do you have option to use a factional setting?
- can you do a clock modification "on the fly", or do you have to reconfigure the PLL by stopping it, change it, start it again - this would be vary "bad" (but OK for second range to adjust)
As I know, GPS modules provide often a clock (from the atomic GPS clock), as 10 MHz or as 1 Hz.
Can you feed this clock, via external wires, as an clock input to a MCU, or a device on MCU (e.g. a TIM, INT, clock source, e.g. SAI external).
If you cannot "hard couple" the clock, e.g. not as a clock input. you have to do an "adaptive clock recovery": your local, free running clock tries to get in "sync" with the external (free running) clock. You have to adjust your own (local) clock.
This is a "control loop" (feedback): You need a PID algorithm (Parallel, Integrated, Differentiated), which will check for the difference in clock (a drift) and decide how to adjust your own clock.
I would check if you can bring the "GPS clock" as input to MCU. It could act immediately as source clock. If not possible:
Find if you can measure this input clock, find the relation with local MCU clock, based on difference and drift direction (also how fast it is drifting = acceleration) - derive aa parameter how to trim your local clock.
BTW: the "control loop", this "PID controller" sets how much your local clock is "breathing":
how much jitter, how are min. and max. to jitter in between, how fast a change happens ...
A complex topic, possible, but you have to think about how your "feedback loop" would behave.
Instead of "adaptive clock recovery" it might be better to check your HW if you can feed MCU with a GPS clock (and all derived from there). Than it is "hard locked", very accurate.