Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPA spin-up #12

Open
mdekauwe opened this issue Feb 6, 2017 · 0 comments
Open

SPA spin-up #12

mdekauwe opened this issue Feb 6, 2017 · 0 comments

Comments

@mdekauwe
Copy link
Owner

mdekauwe commented Feb 6, 2017

If you're using SPA then the time involved to spin-up the model is pretty costly.

Test case: model spin-up & then a 12 year simulation at a 30 minute timestep for Tumbarumba

First, the impact of SAS on simulation time = ~57% improvement using the SAS spin-up.
SPA off, brute force spin-up (i.e. our classic GDAY just at 30 mins): 2m 20
SPA off, SAS spin-up: 0 m 59

But turning SPA on, leads to a ridiculously long simulation time.
SPA on, SAS spin-up: 17 m 46

Causes?

  1. Drainage through the soil water profile, this involves all the costly calls to numerical recipes for the integration funcs (odein, rkck, rkqs).
  2. Calculating a new rooting distribution at the end of the year, this involves a call to zbrent to do a minimisation.
  3. Using 20 soil layers, obviously that also impacts on (1) as well.
  4. Potentially too strict a stopping criteria for the passive pool.

Solution 1

Assume a fixed drainage rate, I took an average across 10,000 SPA iterations for the Tumbarumba soil, finding a rate ~7%. So I tested the assumption that 10% of water in a layer can drain during a step for the spin-up (obviously one would test for a more robust value!). Then for the actual simulations I go back to using the SPA calculations for drainage. This gets you a total run time of:

SPA on, SAS spin-up, fast drainage: 3 m 43.6

Solution 2

Either (1) assume a fixed rooting distribution as in CABLE, or (2) fix the slope term in the rooting distribution function from SPA, to remove the call to zbrent. I tested 2 and it makes things a few seconds faster, so this is a small issue.

Solution 3

A bit arbitrary...We could play with a few different soil layers numbers and see at what point we lose important resolution.

I tested using 6 layers instead of 20:

SPA on, SAS spin-up, 6 layers: 5 m 56

Solution 4

Relax the stopping criteria. Currently we stop once the change in the passive pool is < 0.05 t/ha, if I make that 0.5 t/ha

SPA on, SAS spin up, delta passive < 0.5: 8 m 3

Moving to the impact on simulated fluxes ...

Solution 1: Drainage

Here EXP is the fixed rate drainage and CTRL is standard GDAY-SPA. NB. the fixed drainage rate is only used during spin-up, during the actual simulation we switch back.

Dry down 1

tumbarumba_spa_comparison_20020801_20030801

Dry down 2

tumbarumba_spa_comparison_20040101_20040101

Makes no differences, so I think that is a viable spin-up assumption?

Solution 2: 6 layers vs. 20

As you'd expect this has more of an impact, not sure what the right balance is here. For this test I just made 6 equal sized layers, clearly a few smaller ones and a single larger one might be preferable.

Dry down 1

tumbarumba_spa_comparison_20020801_20030801

Dry down 2

tumbarumba_spa_comparison_20040101_20040101

Solution 4: relaxed stopping criteria

Dry down 1

tumbarumba_spa_comparison_20020801_20030801

Dry down 2

tumbarumba_spa_comparison_20040101_20040101

How fast could we go?

Fixed drainage, relaxed stopping criteria: 1 m 42s
Fixed drainage, relaxed stopping criteria, 6 layers: 0 m 48s

@mdekauwe mdekauwe changed the title SPA spinup SPA spin-up Feb 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant