Closed jkingslake closed 2 years ago
The first edit sped up the simulation by a bit (using 100 space grid points and 1000 time steps, sped up by ~10 seconds). The second one somehow made it a tad slower (~15-20 seconds slower). The third one did speed it up and didn't change the results by much, but will not be included as the speedup was quite negligible (a second or two).
what was the baseline time (the simulation time before the changes)?
Baseline time was around 330 seconds. the fastest with the changes was around 320 seconds.
I would expect number 2 to speed things up. Maybe doing a few runs for each test and averaging the time would be a better way of testing the improvement.
But given that the changes are small maybe it's not important to pursue.
Switched to discrete solver in new repo: https://github.com/glugeorge/coupled_ice_hydrology
Try editing Nye_NQ.m to speed up simulations.
These are small potential speed ups, but because you call that function SO many times it might make an appreciable difference
1. add
and use these new variables in the calculations.
2. try changing how you deal with the sign of Q so that you can avoid dividing by S83 twice and see if it improves things:
obviously be really careful that this is actually exactly equivalent to the original by testing out the results of both versions.
3. More drastically, you could try neglecting terms including P.e, i.e.
this is a change to the model, but i think you will find that it only makes a very small difference to the results because P.e is very small generally.