@@ -125,8 +125,7 @@ def open_netcdf_file(self, data_shape):
125125 self .dataset .parcels_mesh = self .parcels_mesh
126126
127127 # Create ID variable according to CF conventions
128- self .id = self .dataset .createVariable ("trajectory" , "i4" , coords ,
129- fill_value = - 2 ** (31 )) # maxint32 fill_value
128+ self .id = self .dataset .createVariable ("trajectory" , "i8" , coords , fill_value = - 2 ** (63 )) # minint64 fill_value
130129 self .id .long_name = "Unique identifier for each particle"
131130 self .id .cf_role = "trajectory_id"
132131
@@ -253,8 +252,8 @@ def read_from_npy(self, file_list, time_steps, var):
253252 """
254253
255254 data = np .nan * np .zeros ((self .maxid_written + 1 , time_steps ))
256- time_index = np .zeros (self .maxid_written + 1 , dtype = int )
257- t_ind_used = np .zeros (time_steps , dtype = int )
255+ time_index = np .zeros (self .maxid_written + 1 , dtype = np . int64 )
256+ t_ind_used = np .zeros (time_steps , dtype = np . int64 )
258257
259258 # loop over all files
260259 for npyfile in file_list :
@@ -266,7 +265,7 @@ def read_from_npy(self, file_list, time_steps, var):
266265 '"parcels_convert_npydir_to_netcdf %s" to convert these to '
267266 'a NetCDF file yourself.\n To avoid this error, make sure you '
268267 'close() your ParticleFile at the end of your script.' % self .tempwritedir )
269- id_ind = np .array (data_dict ["id" ], dtype = int )
268+ id_ind = np .array (data_dict ["id" ], dtype = np . int64 )
270269 t_ind = time_index [id_ind ] if 'once' not in file_list [0 ] else 0
271270 t_ind_used [t_ind ] = 1
272271 data [id_ind , t_ind ] = data_dict [var ]
0 commit comments