Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CryoGrid.jl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CryoGrid
CryoGrid.jl
Commits
6ceac6ee
Commit
6ceac6ee
authored
4 months ago
by
Brian Groenke
Browse files
Options
Downloads
Patches
Plain Diff
Minor changes to example script comments
parent
4c1ef9a0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/cglite_parameter_ensembles.jl
+3
-3
3 additions, 3 deletions
examples/cglite_parameter_ensembles.jl
with
3 additions
and
3 deletions
examples/cglite_parameter_ensembles.jl
+
3
−
3
View file @
6ceac6ee
...
@@ -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.0
u
"m"
))],
enssol
))
T20m_ens
=
reduce
(
hcat
,
map
(
out
->
out
.
T
[
Z
(
Near
(
20.0
u
"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
.
#
m
ultithreading with @threads is also possible, but
in this case, one should
call deepcopy(prob) to prevent cache collisions
#
M
ultithreading with @threads is also possible, but
then it will be necessary to
call
`
deepcopy(prob)
`
to prevent cache collisions
using
ProgressMeter
using
ProgressMeter
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment