From 76f1cf4ce470de3d55ce4fdae85116af3658c457 Mon Sep 17 00:00:00 2001 From: delandmeter Date: Mon, 19 Mar 2018 17:37:21 +0100 Subject: [PATCH] Parcels does not need (and does not support) 'indexed' nc files for particle output --- experiment_scripts/example_corefootprintparticles.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/experiment_scripts/example_corefootprintparticles.py b/experiment_scripts/example_corefootprintparticles.py index 28a4ce1..ecd0a2a 100644 --- a/experiment_scripts/example_corefootprintparticles.py +++ b/experiment_scripts/example_corefootprintparticles.py @@ -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 @@ -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 @@ -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)