NGEET / fates

repository for the Functionally Assembled Terrestrial Ecosystem Simulator (FATES)
Other
95 stars 91 forks source link

update the default hydraulics solver? #773

Open rgknox opened 3 years ago

rgknox commented 3 years ago

@pnlfang has introduced a 2D solver for hydraulics as an alternative to the original 1D solver that first rolled out with FATES-HYDRO. The 2D solver simultaneously calculates the fluxes through the above-ground plant, root and soil compartments, whereas the 1D solve will iteratively perform solve on the plant and 1 soil layer at a time (assuming that each root layer has a partial share of the stem/leaf conduit above ground).

Could we use this space to make some decisions?

1) Should we update default solver to be the 2D?

2) Should we move the switch controlling the solver from a hard-code logical to the parameter file? We have the choice of solver as a hard-coded logical constant, shown here:

https://github.com/NGEET/fates/blob/8f28a6d978f78ef08cc1f5797abd5ef0c9fd39f9/main/FatesHydraulicsMemMod.F90#L13

3) What type of simulation(s) and benchmarks would help us decide which solution should be the default?

4) There are other hard-coded parameters controlling both 2D and 1D solves that we may impact this decision that we want to consider. For instance, we use 5 concentric soil shells around the root, are those needed and does one solver excel in one environment over the other?

pnlfang commented 3 years ago
  1. The 1D and 2D are solving the same discretized form in the following eq (n is time step, m is iteration number).
  2. 1D has no iteration within a time step, i.e., the last term in the RHS of the eq is 0, where 2D allows iteration.
  3. 1D solves multiple layers, introducing artifact of top boundary flux. 2D solves the eq altogether. image

Adding an external file for solver related parameters would be helpful. One can then specify 1D or 2D, how many layer or shells to include in the simulation. Solver can then be selected by the code like this in the image below: image

pnlfang commented 3 years ago

agb npp sw

pnlfang commented 3 years ago

Figure showing comparison among different solvers.

ckoven commented 3 years ago

@pnlfang thanks! Do you have a timing comparison to evaluate the relative computational costs?

pnlfang commented 3 years ago

@ckoven Looking at the restart file time stamps, for one year simulation it took 12 min, 18 min, and 24 min for the particular 1D test using 1D, picard, and newton, respectively. Global simulation using 2D picard is feasible.