1- from argparse import ArgumentParser
21from datetime import timedelta
3- from glob import glob
42
53import numpy as np
6- import pytest
4+
75import parcels
86
97# ptype = {"scipy": parcels.ScipyParticle, "jit": parcels.JITParticle}
108# advection = {"RK4": parcels.AdvectionRK4, "AA": parcels.AdvectionAnalytical}
119# path_nemo = "~/Documents/PhD/projects/2025-02_parcels_benchmarking/NemoCurvilinear_data"
1210path_nemo = parcels .download_example_dataset ("NemoCurvilinear_data" )
1311
12+
1413class NemoCurvilinearJIT :
1514 particle_type = parcels .JITParticle
1615
1716 def setup (self ):
1817 filenames = {
1918 "U" : {
20- "lon" : f"{ path_nemo } /mesh_mask.nc4" ,
21- "lat" : f"{ path_nemo } /mesh_mask.nc4" ,
22- "data" : f"{ path_nemo } /U_purely_zonal-ORCA025_grid_U.nc4" ,
23- },
24- "V" : {
25- "lon" : f"{ path_nemo } /mesh_mask.nc4" ,
26- "lat" : f"{ path_nemo } /mesh_mask.nc4" ,
27- "data" : f"{ path_nemo } /V_purely_zonal-ORCA025_grid_V.nc4" ,
28- },
29- }
19+ "lon" : f"{ path_nemo } /mesh_mask.nc4" ,
20+ "lat" : f"{ path_nemo } /mesh_mask.nc4" ,
21+ "data" : f"{ path_nemo } /U_purely_zonal-ORCA025_grid_U.nc4" ,
22+ },
23+ "V" : {
24+ "lon" : f"{ path_nemo } /mesh_mask.nc4" ,
25+ "lat" : f"{ path_nemo } /mesh_mask.nc4" ,
26+ "data" : f"{ path_nemo } /V_purely_zonal-ORCA025_grid_V.nc4" ,
27+ },
28+ }
3029 variables = {"U" : "U" , "V" : "V" }
3130
3231 dimensions = {"lon" : "glamf" , "lat" : "gphif" , "time" : "time_counter" }
3332
34- fieldset = parcels .FieldSet .from_nemo (
35- filenames , variables , dimensions , allow_time_extrapolation = True
36- )
37-
33+ fieldset = parcels .FieldSet .from_nemo (filenames , variables , dimensions , allow_time_extrapolation = True )
34+
3835 # Start 20 particles on a meridional line at 180W
3936 npart = 20
4037 lonp = - 180 * np .ones (npart )
@@ -43,17 +40,14 @@ def setup(self):
4340 self .pset = parcels .ParticleSet .from_list (fieldset , self .particle_type , lon = lonp , lat = latp )
4441 # pfile = parcels.ParticleFile("nemo_particles", pset, outputdt=timedelta(days=1))
4542
46-
47-
4843 def time_run_experiment (self ):
49-
50- self .pset .execute (
44+ self .pset .execute (
5145 parcels .AdvectionRK4 ,
5246 runtime = timedelta (days = 30 ),
5347 dt = timedelta (hours = 6 ),
5448 # output_file=pfile,
5549 )
5650
51+
5752class NemoCurvilinearScipy (NemoCurvilinearJIT ):
5853 particle_type = parcels .ScipyParticle
59-
0 commit comments