Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions experiment_scripts/example_corefootprintparticles.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from parcels import (FieldSet, ParticleSet, JITParticle, AdvectionRK4_3D,
ErrorCode, ParticleFile, Variable, convert_IndexedOutputToArray)
ErrorCode, ParticleFile, Variable)
from datetime import timedelta as delta
from progressbar import ProgressBar
import numpy as np
Expand Down Expand Up @@ -63,7 +63,7 @@ class ForamParticle(JITParticle):
pset = ParticleSet(fieldset=fieldset, pclass=ForamParticle, lon=corelon, lat=corelat,
depth=coredepth, time=fieldset.U.time[-1],
repeatdt=delta(days=3)) # the new argument 'repeatdt' means no need to call pset.add() anymore in for-loop
pfile = ParticleFile(outfile, pset, type="indexed", outputdt=delta(days=1)) # `interval` argument has changed to `outputdt`
pfile = ParticleFile(outfile, pset, outputdt=delta(days=1)) # `interval` argument has changed to `outputdt`

kernels = pset.Kernel(AdvectionRK4_3D) + Sink + SampleTemp + Age

Expand Down Expand Up @@ -114,7 +114,6 @@ def load_particles_file(fname, varnames):
plt.show()


outfile = "corefootprint_particles"
outfile = "corefootprint_particles.nc"
run_corefootprintparticles(outfile)
convert_IndexedOutputToArray(file_in=outfile+".nc", file_out=outfile+"_array.nc")
make_plot(outfile+"_array.nc")
make_plot(outfile)