Skip to content
Snippets Groups Projects
Commit 6ceac6ee authored by Brian Groenke's avatar Brian Groenke
Browse files

Minor changes to example script comments

parent 4c1ef9a0
No related branches found
No related tags found
No related merge requests found
...@@ -89,7 +89,7 @@ prob_func = make_prob_func(prior_ensemble) ...@@ -89,7 +89,7 @@ prob_func = make_prob_func(prior_ensemble)
ensprob = EnsembleProblem(prob; prob_func, output_func, safetycopy=true) ensprob = EnsembleProblem(prob; prob_func, output_func, safetycopy=true)
# solve each trajectory with LiteImplicitEuler and multithreading; # solve each trajectory with LiteImplicitEuler and multithreading;
# alternatively, one can specify EnsembleDistributed() for process or slurm parallelization or EnsembleSerial() for sequential execution. # alternatively, one can specify EnsembleDistributed() for process or slurm parallelization or EnsembleSerial() for sequential execution.
enssol = @time solve(ensprob, LiteImplicitEuler(), EnsembleThreads(), trajectories=size(prior_ensemble,2)) enssol = @time solve(ensprob, LiteImplicitEuler(), EnsembleThreads(), trajectories=size(prior_ensemble,2));
# Now we will extract permafrost temperatures at 20m depth and plot the ensemble. # Now we will extract permafrost temperatures at 20m depth and plot the ensemble.
T20m_ens = reduce(hcat, map(out -> out.T[Z(Near(20.0u"m"))], enssol)) T20m_ens = reduce(hcat, map(out -> out.T[Z(Near(20.0u"m"))], enssol))
...@@ -98,8 +98,8 @@ Plots.plot(T20m_ens, leg=nothing, c=:black, alpha=0.5, ylabel="Permafrost temper ...@@ -98,8 +98,8 @@ Plots.plot(T20m_ens, leg=nothing, c=:black, alpha=0.5, ylabel="Permafrost temper
alt_ens = reduce(hcat, map(out -> Diagnostics.active_layer_thickness(out.T), enssol)) alt_ens = reduce(hcat, map(out -> Diagnostics.active_layer_thickness(out.T), enssol))
Plots.plot(alt_ens, leg=nothing, c=:black, alpha=0.5, ylabel="Active layer thickness") Plots.plot(alt_ens, leg=nothing, c=:black, alpha=0.5, ylabel="Active layer thickness")
# Method 2: Simple (sequential) for-loop; this could also be parallelized with pmap or @distributed # Method 2: Simple (sequential) for-loop; this could also be parallelized with pmap or @distributed.
# multithreading with @threads is also possible, but in this case, one should call deepcopy(prob) to prevent cache collisions # Multithreading with @threads is also possible, but then it will be necessary to call `deepcopy(prob)` to prevent cache collisions
using ProgressMeter using ProgressMeter
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment