CliMA / LandHydrology.jl

The CliMA land hydrology model, including soil, snow, and surface processes
6 stars 0 forks source link

Code Performance #32

Open kmdeck opened 3 years ago

kmdeck commented 3 years ago

Look through code for issues that could lead to poorer performance.

kmdeck commented 3 years ago

This past version of the sand vG simulation takes, for the solve command: 2.537 s (24020029 allocations: 4.37 GiB) richards_vg.txt (save as .jl file to run) The latest version takes (outside of test environment, declaring FT as constant): 5.258 s (108634258 allocations: 10.52 GiB)

The main changes are that we have the model types & dispatch on them, the boundary condition types (and computing some energy pieces even though not needed b/c prescribed, ice is also carried along for the ride in the 2nd version compared with the first). Parameters, soil water functions are the same. we also added a layer of wrapping around the domain object, and set up the initial conditions in a different way. Lastly, we are using a ClimaCore.Fields.FieldVector type instead of just Field as the state vector.