|
4 | 4 |
|
5 | 5 | import numpy as np |
6 | 6 |
|
7 | | -from parcels import AdvectionRK4, FieldSet, JITParticle, ParticleSet, ScipyParticle, StatusCode, Variable |
| 7 | +from parcels import AdvectionRK4, FieldSet, JITParticle, ParticleSet, StatusCode, Variable |
8 | 8 |
|
9 | | -def ArgoVerticalMovement(particle, fieldset, time): |
| 9 | + |
| 10 | +def ArgoVerticalMovement(particle, fieldset, time): |
10 | 11 | driftdepth = 1000 # maximum depth in m |
11 | 12 | maxdepth = 2000 # maximum depth in m |
12 | 13 | vertical_speed = 0.10 # sink and rise speed in m/s |
@@ -52,6 +53,7 @@ def ArgoVerticalMovement(particle, fieldset, time): |
52 | 53 | if particle.state == StatusCode.Evaluate: |
53 | 54 | particle.cycle_age += particle.dt # update cycle_age |
54 | 55 |
|
| 56 | + |
55 | 57 | class ArgoFloatJIT: |
56 | 58 | def setup(self): |
57 | 59 | xdim = ydim = zdim = 2 |
@@ -86,19 +88,10 @@ def setup(self): |
86 | 88 | ] |
87 | 89 | ) |
88 | 90 |
|
89 | | - self.pset=ParticleSet( |
90 | | - fieldset=fieldset, |
91 | | - pclass=ArgoParticle, |
92 | | - lon=[0], |
93 | | - lat=[0], |
94 | | - depth=[0] |
95 | | - ) |
| 91 | + self.pset = ParticleSet(fieldset=fieldset, pclass=ArgoParticle, lon=[0], lat=[0], depth=[0]) |
96 | 92 |
|
97 | 93 | # combine Argo vertical movement kernel with built-in Advection kernel |
98 | 94 | self.kernels = [ArgoVerticalMovement, AdvectionRK4] |
99 | | - |
| 95 | + |
100 | 96 | def time_run_single_timestep(self): |
101 | 97 | self.pset.execute(AdvectionRK4, runtime=timedelta(seconds=1 * 30), dt=timedelta(seconds=30)) |
102 | | - |
103 | | - |
104 | | - |
0 commit comments