Closed judithmarinaewald closed 5 years ago
ParticleSet
created as:
pset = ParticleSet.from_line(fieldset=fieldset_nemo, pclass=JITParticle,
size=10, # releasing 10 particles
start=(-10, 45), # releasing on a line: the start longitude and latitude
finish=(-11, 40)) # releasing on a line: the end longitude and latitude
with fieldset
ddir = '/data2/imau/oceanparcels/hydrodynamic_data/NEMO-MEDUSA/ORCA0083-N006/'
ufiles = sorted(glob(ddir+'means/ORCA0083-N06_2010????d05U.nc'))
vfiles = [u.replace('05U.nc', '05V.nc') for u in ufiles]
meshfile = glob(ddir+'domain/coordinates.nc')
filenames = {'U': {'lon': meshfile, 'lat': meshfile, 'data': ufiles},
'V': {'lon': meshfile, 'lat': meshfile, 'data': vfiles}}
variables = {'U': 'uo', 'V': 'vo'}
dimensions = {'lon': 'glamf', 'lat': 'gphif', 'time': 'time_counter'}
indices = {'lon': range(2365, 3325), 'lat': range(1500, 3000)}
fieldset_nemo = FieldSet.from_nemo(filenames, variables, dimensions, indices = indices)
particle.u
and particle.v
do not unless you specify those variables.
See cell 2 in the Argo tutorial, where some variables are created in the ArgoParticle
class.
The custom kernel
TrackVelocity2D
is to track 2D particle velocities in m/s instead of degree/s.with
TrackVelocity2D
:gives attribute error:
With
{particle_type}
replaced forPType<JITParticle>::[PVar<time|<class 'numpy.float64'>>, PVar<cxi|uint64>, PVar<cyi|uint64>, PVar<czi|uint64>, PVar<cti|uint64>, PVar<lon|<class 'numpy.float32'>>, PVar<lat|<class 'numpy.float32'>>, PVar<depth|<class 'numpy.float32'>>, PVar<id|<class 'numpy.int32'>>, PVar<fileid|<class 'numpy.int32'>>, PVar<dt|<class 'numpy.float32'>>, PVar<state|<class 'numpy.int32'>>]