Note
Go to the end to download the full example code.
Model landmask
Comparing two simulation runs, with landmask from ocean model and GSHHG
from datetime import timedelta
from opendrift.readers import reader_ROMS_native
from opendrift.models.oceandrift import OceanDrift
lon = 14.75; lat = 68.1
o = OceanDrift(loglevel=20)
reader_nordic = reader_ROMS_native.Reader(o.test_data_folder() +
'2Feb2016_Nordic_sigma_3d/Nordic-4km_SLEVELS_avg_00_subset2Feb2016.nc')
13:20:32 INFO opendrift.models.basemodel:515: OpenDriftSimulation initialised (version 1.11.13 / v1.11.13-99-gd2132d3)
13:20:32 INFO opendrift.readers.reader_ROMS_native:148: Opening dataset: /root/project/tests/test_data/2Feb2016_Nordic_sigma_3d/Nordic-4km_SLEVELS_avg_00_subset2Feb2016.nc
13:20:32 INFO opendrift.readers.reader_ROMS_native:165: Opening file with Dataset
13:20:32 INFO opendrift.readers.reader_ROMS_native:246: Read GLS parameters from file.
13:20:32 WARNING opendrift.readers.reader_ROMS_native:297: Duplicate variables for latitude, selecting lat_psi, and discarding lat_rho
13:20:32 WARNING opendrift.readers.reader_ROMS_native:297: Duplicate variables for latitude, selecting lat_psi, and discarding lat_u
13:20:32 WARNING opendrift.readers.reader_ROMS_native:297: Duplicate variables for latitude, selecting lat_psi, and discarding lat_v
13:20:32 WARNING opendrift.readers.reader_ROMS_native:297: Duplicate variables for longitude, selecting lon_psi, and discarding lon_rho
13:20:32 WARNING opendrift.readers.reader_ROMS_native:297: Duplicate variables for longitude, selecting lon_psi, and discarding lon_u
13:20:32 WARNING opendrift.readers.reader_ROMS_native:297: Duplicate variables for longitude, selecting lon_psi, and discarding lon_v
13:20:32 WARNING opendrift.readers.reader_ROMS_native:297: Duplicate variables for land_binary_mask, selecting mask_psi, and discarding mask_rho
13:20:32 WARNING opendrift.readers.reader_ROMS_native:297: Duplicate variables for ocean_s_coordinate_g2, selecting s_rho, and discarding s_w
13:20:32 INFO opendrift.readers.reader_ROMS_native:304: The following variables without standard_name are discarded: ['AICEnudass', 'Akk_bak', 'Akp_bak', 'Akt_bak', 'Akv_bak', 'Charnok_alpha', 'CrgBan_cw', 'Cs_r', 'Cs_w', 'FSobc_in', 'FSobc_out', 'Falpha', 'Fbeta', 'Fgamma', 'LtracerSrc', 'M2nudg', 'M2obc_in', 'M2obc_out', 'M3nudg', 'M3obc_in', 'M3obc_out', 'Tcline', 'Tnudg', 'Tobc_in', 'Tobc_out', 'Vstretching', 'Vtransform', 'Znudg', 'Zob', 'Zos', 'Zos_hsig_alpha', 'angle', 'dstart', 'dt', 'dtfast', 'el', 'f', 'gamma2', 'gls_Kmin', 'gls_Pmin', 'gls_c1', 'gls_c2', 'gls_c3m', 'gls_c3p', 'gls_cmu0', 'gls_m', 'gls_n', 'gls_p', 'gls_sigk', 'gls_sigp', 'hc', 'mask_u', 'mask_v', 'nAVG', 'nHIS', 'nRST', 'nSTA', 'ndefAVG', 'ndefHIS', 'ndtfast', 'ntimes', 'ntsAVG', 'ocean_time', 'pm', 'pn', 'rdrg', 'rdrg2', 'rho0', 'spherical', 'swrad', 'sz_alpha', 'theta_b', 'theta_s', 'ubar', 'vbar', 'xl', 'zeta_detided']
13:20:32 WARNING opendrift.readers.basereader.structured:50: No proj string or projection could be derived, using 'fakeproj'. This assumes that the variables are structured and gridded approximately equidistantly on the surface (i.e. in meters). This must be guaranteed by the user. You can get rid of this warning by supplying a valid projection to the reader.
13:20:32 INFO opendrift.readers.basereader.structured:90: Making interpolator for lon,lat to x,y conversion...
First run, with default GSHHG vector landmask
o.add_reader([reader_nordic])
time = reader_nordic.start_time
o.set_config('general:use_auto_landmask', True)
o.seed_elements(lon, lat, radius=3000, number=1000, time=time)
o.run(end_time=reader_nordic.end_time, time_step=1800, time_step_output=3*3600)
13:20:32 INFO opendrift.models.basemodel.environment:218: Adding a dynamical landmask with max. priority based on assumed maximum speed of 2.0 m/s. Adding a customised landmask may be faster...
13:20:36 INFO opendrift.models.basemodel.environment:245: Fallback values will be used for the following variables which have no readers:
13:20:36 INFO opendrift.models.basemodel.environment:248: x_wind: 0.000000
13:20:36 INFO opendrift.models.basemodel.environment:248: y_wind: 0.000000
13:20:36 INFO opendrift.models.basemodel.environment:248: upward_sea_water_velocity: 0.000000
13:20:36 INFO opendrift.models.basemodel.environment:248: ocean_vertical_diffusivity: 0.000000
13:20:36 INFO opendrift.models.basemodel.environment:248: sea_surface_wave_significant_height: 0.000000
13:20:36 INFO opendrift.models.basemodel.environment:248: sea_surface_wave_stokes_drift_x_velocity: 0.000000
13:20:36 INFO opendrift.models.basemodel.environment:248: sea_surface_wave_stokes_drift_y_velocity: 0.000000
13:20:36 INFO opendrift.models.basemodel.environment:248: sea_surface_wave_period_at_variance_spectral_density_maximum: 0.000000
13:20:36 INFO opendrift.models.basemodel.environment:248: sea_surface_wave_mean_period_from_variance_spectral_density_second_frequency_moment: 0.000000
13:20:36 INFO opendrift.models.basemodel.environment:248: sea_surface_swell_wave_to_direction: 0.000000
13:20:36 INFO opendrift.models.basemodel.environment:248: sea_surface_swell_wave_peak_period_from_variance_spectral_density: 0.000000
13:20:36 INFO opendrift.models.basemodel.environment:248: sea_surface_swell_wave_significant_height: 0.000000
13:20:36 INFO opendrift.models.basemodel.environment:248: sea_surface_wind_wave_to_direction: 0.000000
13:20:36 INFO opendrift.models.basemodel.environment:248: sea_surface_wind_wave_mean_period: 0.000000
13:20:36 INFO opendrift.models.basemodel.environment:248: sea_surface_wind_wave_significant_height: 0.000000
13:20:36 INFO opendrift.models.basemodel.environment:248: surface_downward_x_stress: 0.000000
13:20:36 INFO opendrift.models.basemodel.environment:248: surface_downward_y_stress: 0.000000
13:20:36 INFO opendrift.models.basemodel.environment:248: turbulent_kinetic_energy: 0.000000
13:20:36 INFO opendrift.models.basemodel.environment:248: turbulent_generic_length_scale: 0.000000
13:20:36 INFO opendrift.models.basemodel.environment:248: ocean_mixed_layer_thickness: 50.000000
13:20:37 INFO opendrift.models.basemodel:936: Using existing reader for land_binary_mask
13:20:38 INFO opendrift.models.basemodel:949: Moving 3 out of 1000 points from land to water
13:20:38 WARNING opendrift.models.basemodel:730: Seafloor check not being run because environment is missing. This will happen the first time the function is run but if it happens subsequently there is probably a problem.
13:20:38 INFO opendrift.models.basemodel:2038: 2016-02-02 12:00:00 - step 1 of 96 - 1000 active elements (0 deactivated)
13:20:38 INFO opendrift.readers.reader_ROMS_native:354: Using mask_rho for mask_rho
13:20:38 INFO opendrift.readers.reader_ROMS_native:375: Using mask_u for mask_u
13:20:38 INFO opendrift.readers.reader_ROMS_native:396: Using mask_v for mask_v
13:20:38 INFO opendrift.readers.reader_ROMS_native:419: Using angle from Dataset.
/root/project/opendrift/readers/interpolation/interpolators.py:17: RuntimeWarning: overflow encountered in cast
data[mask] = np.finfo(np.float64).min
13:20:38 INFO opendrift.models.basemodel:2038: 2016-02-02 12:30:00 - step 2 of 96 - 1000 active elements (0 deactivated)
/root/project/opendrift/readers/interpolation/interpolators.py:17: RuntimeWarning: overflow encountered in cast
data[mask] = np.finfo(np.float64).min
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-02 13:00:00 - step 3 of 96 - 996 active elements (4 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-02 13:30:00 - step 4 of 96 - 995 active elements (5 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-02 14:00:00 - step 5 of 96 - 995 active elements (5 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-02 14:30:00 - step 6 of 96 - 994 active elements (6 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-02 15:00:00 - step 7 of 96 - 994 active elements (6 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-02 15:30:00 - step 8 of 96 - 993 active elements (7 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-02 16:00:00 - step 9 of 96 - 992 active elements (8 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-02 16:30:00 - step 10 of 96 - 992 active elements (8 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-02 17:00:00 - step 11 of 96 - 992 active elements (8 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-02 17:30:00 - step 12 of 96 - 989 active elements (11 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-02 18:00:00 - step 13 of 96 - 988 active elements (12 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-02 18:30:00 - step 14 of 96 - 988 active elements (12 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-02 19:00:00 - step 15 of 96 - 988 active elements (12 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-02 19:30:00 - step 16 of 96 - 987 active elements (13 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-02 20:00:00 - step 17 of 96 - 986 active elements (14 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-02 20:30:00 - step 18 of 96 - 986 active elements (14 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-02 21:00:00 - step 19 of 96 - 986 active elements (14 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-02 21:30:00 - step 20 of 96 - 986 active elements (14 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-02 22:00:00 - step 21 of 96 - 986 active elements (14 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-02 22:30:00 - step 22 of 96 - 986 active elements (14 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-02 23:00:00 - step 23 of 96 - 986 active elements (14 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-02 23:30:00 - step 24 of 96 - 986 active elements (14 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-03 00:00:00 - step 25 of 96 - 986 active elements (14 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-03 00:30:00 - step 26 of 96 - 986 active elements (14 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-03 01:00:00 - step 27 of 96 - 986 active elements (14 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-03 01:30:00 - step 28 of 96 - 986 active elements (14 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-03 02:00:00 - step 29 of 96 - 986 active elements (14 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-03 02:30:00 - step 30 of 96 - 986 active elements (14 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-03 03:00:00 - step 31 of 96 - 986 active elements (14 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-03 03:30:00 - step 32 of 96 - 986 active elements (14 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-03 04:00:00 - step 33 of 96 - 986 active elements (14 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-03 04:30:00 - step 34 of 96 - 986 active elements (14 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-03 05:00:00 - step 35 of 96 - 986 active elements (14 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-03 05:30:00 - step 36 of 96 - 986 active elements (14 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-03 06:00:00 - step 37 of 96 - 986 active elements (14 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-03 06:30:00 - step 38 of 96 - 986 active elements (14 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-03 07:00:00 - step 39 of 96 - 986 active elements (14 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-03 07:30:00 - step 40 of 96 - 986 active elements (14 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-03 08:00:00 - step 41 of 96 - 986 active elements (14 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-03 08:30:00 - step 42 of 96 - 985 active elements (15 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-03 09:00:00 - step 43 of 96 - 985 active elements (15 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-03 09:30:00 - step 44 of 96 - 984 active elements (16 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-03 10:00:00 - step 45 of 96 - 984 active elements (16 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-03 10:30:00 - step 46 of 96 - 982 active elements (18 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-03 11:00:00 - step 47 of 96 - 982 active elements (18 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-03 11:30:00 - step 48 of 96 - 980 active elements (20 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-03 12:00:00 - step 49 of 96 - 979 active elements (21 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-03 12:30:00 - step 50 of 96 - 977 active elements (23 deactivated)
/root/project/opendrift/readers/interpolation/interpolators.py:17: RuntimeWarning: overflow encountered in cast
data[mask] = np.finfo(np.float64).min
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-03 13:00:00 - step 51 of 96 - 976 active elements (24 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-03 13:30:00 - step 52 of 96 - 975 active elements (25 deactivated)
13:20:40 INFO opendrift.models.basemodel:2038: 2016-02-03 14:00:00 - step 53 of 96 - 975 active elements (25 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-03 14:30:00 - step 54 of 96 - 975 active elements (25 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-03 15:00:00 - step 55 of 96 - 974 active elements (26 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-03 15:30:00 - step 56 of 96 - 971 active elements (29 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-03 16:00:00 - step 57 of 96 - 969 active elements (31 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-03 16:30:00 - step 58 of 96 - 964 active elements (36 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-03 17:00:00 - step 59 of 96 - 958 active elements (42 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-03 17:30:00 - step 60 of 96 - 956 active elements (44 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-03 18:00:00 - step 61 of 96 - 953 active elements (47 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-03 18:30:00 - step 62 of 96 - 945 active elements (55 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-03 19:00:00 - step 63 of 96 - 942 active elements (58 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-03 19:30:00 - step 64 of 96 - 939 active elements (61 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-03 20:00:00 - step 65 of 96 - 935 active elements (65 deactivated)
/root/project/opendrift/readers/interpolation/interpolators.py:17: RuntimeWarning: overflow encountered in cast
data[mask] = np.finfo(np.float64).min
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-03 20:30:00 - step 66 of 96 - 931 active elements (69 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-03 21:00:00 - step 67 of 96 - 930 active elements (70 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-03 21:30:00 - step 68 of 96 - 928 active elements (72 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-03 22:00:00 - step 69 of 96 - 924 active elements (76 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-03 22:30:00 - step 70 of 96 - 918 active elements (82 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-03 23:00:00 - step 71 of 96 - 913 active elements (87 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-03 23:30:00 - step 72 of 96 - 908 active elements (92 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-04 00:00:00 - step 73 of 96 - 899 active elements (101 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-04 00:30:00 - step 74 of 96 - 890 active elements (110 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-04 01:00:00 - step 75 of 96 - 882 active elements (118 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-04 01:30:00 - step 76 of 96 - 877 active elements (123 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-04 02:00:00 - step 77 of 96 - 870 active elements (130 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-04 02:30:00 - step 78 of 96 - 863 active elements (137 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-04 03:00:00 - step 79 of 96 - 859 active elements (141 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-04 03:30:00 - step 80 of 96 - 847 active elements (153 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-04 04:00:00 - step 81 of 96 - 845 active elements (155 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-04 04:30:00 - step 82 of 96 - 840 active elements (160 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-04 05:00:00 - step 83 of 96 - 833 active elements (167 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-04 05:30:00 - step 84 of 96 - 823 active elements (177 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-04 06:00:00 - step 85 of 96 - 810 active elements (190 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-04 06:30:00 - step 86 of 96 - 799 active elements (201 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-04 07:00:00 - step 87 of 96 - 789 active elements (211 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-04 07:30:00 - step 88 of 96 - 777 active elements (223 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-04 08:00:00 - step 89 of 96 - 772 active elements (228 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-04 08:30:00 - step 90 of 96 - 757 active elements (243 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-04 09:00:00 - step 91 of 96 - 751 active elements (249 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-04 09:30:00 - step 92 of 96 - 747 active elements (253 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-04 10:00:00 - step 93 of 96 - 740 active elements (260 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-04 10:30:00 - step 94 of 96 - 738 active elements (262 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-04 11:00:00 - step 95 of 96 - 731 active elements (269 deactivated)
13:20:41 INFO opendrift.models.basemodel:2038: 2016-02-04 11:30:00 - step 96 of 96 - 723 active elements (277 deactivated)
Second run, with landmask from ocean model
o2 = OceanDrift(loglevel=20)
o2.add_reader([reader_nordic])
lon = 14.75; lat = 68.1
o2.set_config('general:use_auto_landmask', False)
o2.seed_elements(lon, lat, radius=3000, number=1000, time=time)
o2.run(end_time=reader_nordic.end_time, time_step=1800, time_step_output=3*3600)
13:20:42 INFO opendrift.models.basemodel:515: OpenDriftSimulation initialised (version 1.11.13 / v1.11.13-99-gd2132d3)
13:20:42 INFO opendrift.models.basemodel.environment:245: Fallback values will be used for the following variables which have no readers:
13:20:42 INFO opendrift.models.basemodel.environment:248: x_wind: 0.000000
13:20:42 INFO opendrift.models.basemodel.environment:248: y_wind: 0.000000
13:20:42 INFO opendrift.models.basemodel.environment:248: upward_sea_water_velocity: 0.000000
13:20:42 INFO opendrift.models.basemodel.environment:248: ocean_vertical_diffusivity: 0.000000
13:20:42 INFO opendrift.models.basemodel.environment:248: sea_surface_wave_significant_height: 0.000000
13:20:42 INFO opendrift.models.basemodel.environment:248: sea_surface_wave_stokes_drift_x_velocity: 0.000000
13:20:42 INFO opendrift.models.basemodel.environment:248: sea_surface_wave_stokes_drift_y_velocity: 0.000000
13:20:42 INFO opendrift.models.basemodel.environment:248: sea_surface_wave_period_at_variance_spectral_density_maximum: 0.000000
13:20:42 INFO opendrift.models.basemodel.environment:248: sea_surface_wave_mean_period_from_variance_spectral_density_second_frequency_moment: 0.000000
13:20:42 INFO opendrift.models.basemodel.environment:248: sea_surface_swell_wave_to_direction: 0.000000
13:20:42 INFO opendrift.models.basemodel.environment:248: sea_surface_swell_wave_peak_period_from_variance_spectral_density: 0.000000
13:20:42 INFO opendrift.models.basemodel.environment:248: sea_surface_swell_wave_significant_height: 0.000000
13:20:42 INFO opendrift.models.basemodel.environment:248: sea_surface_wind_wave_to_direction: 0.000000
13:20:42 INFO opendrift.models.basemodel.environment:248: sea_surface_wind_wave_mean_period: 0.000000
13:20:42 INFO opendrift.models.basemodel.environment:248: sea_surface_wind_wave_significant_height: 0.000000
13:20:42 INFO opendrift.models.basemodel.environment:248: surface_downward_x_stress: 0.000000
13:20:42 INFO opendrift.models.basemodel.environment:248: surface_downward_y_stress: 0.000000
13:20:42 INFO opendrift.models.basemodel.environment:248: turbulent_kinetic_energy: 0.000000
13:20:42 INFO opendrift.models.basemodel.environment:248: turbulent_generic_length_scale: 0.000000
13:20:42 INFO opendrift.models.basemodel.environment:248: ocean_mixed_layer_thickness: 50.000000
13:20:42 INFO opendrift.models.basemodel:936: Using existing reader for land_binary_mask
13:20:42 INFO opendrift.models.basemodel:947: All points are in ocean
13:20:42 WARNING opendrift.models.basemodel:730: Seafloor check not being run because environment is missing. This will happen the first time the function is run but if it happens subsequently there is probably a problem.
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-02 12:00:00 - step 1 of 96 - 1000 active elements (0 deactivated)
/root/project/opendrift/readers/interpolation/interpolators.py:17: RuntimeWarning: overflow encountered in cast
data[mask] = np.finfo(np.float64).min
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-02 12:30:00 - step 2 of 96 - 1000 active elements (0 deactivated)
/root/project/opendrift/readers/interpolation/interpolators.py:17: RuntimeWarning: overflow encountered in cast
data[mask] = np.finfo(np.float64).min
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-02 13:00:00 - step 3 of 96 - 1000 active elements (0 deactivated)
/root/project/opendrift/readers/interpolation/interpolators.py:17: RuntimeWarning: overflow encountered in cast
data[mask] = np.finfo(np.float64).min
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-02 13:30:00 - step 4 of 96 - 999 active elements (1 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-02 14:00:00 - step 5 of 96 - 998 active elements (2 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-02 14:30:00 - step 6 of 96 - 998 active elements (2 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-02 15:00:00 - step 7 of 96 - 997 active elements (3 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-02 15:30:00 - step 8 of 96 - 995 active elements (5 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-02 16:00:00 - step 9 of 96 - 992 active elements (8 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-02 16:30:00 - step 10 of 96 - 991 active elements (9 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-02 17:00:00 - step 11 of 96 - 989 active elements (11 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-02 17:30:00 - step 12 of 96 - 986 active elements (14 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-02 18:00:00 - step 13 of 96 - 981 active elements (19 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-02 18:30:00 - step 14 of 96 - 975 active elements (25 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-02 19:00:00 - step 15 of 96 - 970 active elements (30 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-02 19:30:00 - step 16 of 96 - 964 active elements (36 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-02 20:00:00 - step 17 of 96 - 957 active elements (43 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-02 20:30:00 - step 18 of 96 - 953 active elements (47 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-02 21:00:00 - step 19 of 96 - 949 active elements (51 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-02 21:30:00 - step 20 of 96 - 947 active elements (53 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-02 22:00:00 - step 21 of 96 - 944 active elements (56 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-02 22:30:00 - step 22 of 96 - 933 active elements (67 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-02 23:00:00 - step 23 of 96 - 926 active elements (74 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-02 23:30:00 - step 24 of 96 - 920 active elements (80 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-03 00:00:00 - step 25 of 96 - 912 active elements (88 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-03 00:30:00 - step 26 of 96 - 906 active elements (94 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-03 01:00:00 - step 27 of 96 - 894 active elements (106 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-03 01:30:00 - step 28 of 96 - 889 active elements (111 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-03 02:00:00 - step 29 of 96 - 881 active elements (119 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-03 02:30:00 - step 30 of 96 - 875 active elements (125 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-03 03:00:00 - step 31 of 96 - 864 active elements (136 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-03 03:30:00 - step 32 of 96 - 856 active elements (144 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-03 04:00:00 - step 33 of 96 - 848 active elements (152 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-03 04:30:00 - step 34 of 96 - 843 active elements (157 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-03 05:00:00 - step 35 of 96 - 836 active elements (164 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-03 05:30:00 - step 36 of 96 - 829 active elements (171 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-03 06:00:00 - step 37 of 96 - 826 active elements (174 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-03 06:30:00 - step 38 of 96 - 818 active elements (182 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-03 07:00:00 - step 39 of 96 - 815 active elements (185 deactivated)
13:20:42 INFO opendrift.models.basemodel:2038: 2016-02-03 07:30:00 - step 40 of 96 - 814 active elements (186 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-03 08:00:00 - step 41 of 96 - 809 active elements (191 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-03 08:30:00 - step 42 of 96 - 806 active elements (194 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-03 09:00:00 - step 43 of 96 - 797 active elements (203 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-03 09:30:00 - step 44 of 96 - 792 active elements (208 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-03 10:00:00 - step 45 of 96 - 786 active elements (214 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-03 10:30:00 - step 46 of 96 - 780 active elements (220 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-03 11:00:00 - step 47 of 96 - 774 active elements (226 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-03 11:30:00 - step 48 of 96 - 771 active elements (229 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-03 12:00:00 - step 49 of 96 - 765 active elements (235 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-03 12:30:00 - step 50 of 96 - 762 active elements (238 deactivated)
/root/project/opendrift/readers/interpolation/interpolators.py:17: RuntimeWarning: overflow encountered in cast
data[mask] = np.finfo(np.float64).min
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-03 13:00:00 - step 51 of 96 - 756 active elements (244 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-03 13:30:00 - step 52 of 96 - 752 active elements (248 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-03 14:00:00 - step 53 of 96 - 751 active elements (249 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-03 14:30:00 - step 54 of 96 - 749 active elements (251 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-03 15:00:00 - step 55 of 96 - 747 active elements (253 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-03 15:30:00 - step 56 of 96 - 743 active elements (257 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-03 16:00:00 - step 57 of 96 - 742 active elements (258 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-03 16:30:00 - step 58 of 96 - 741 active elements (259 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-03 17:00:00 - step 59 of 96 - 739 active elements (261 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-03 17:30:00 - step 60 of 96 - 738 active elements (262 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-03 18:00:00 - step 61 of 96 - 732 active elements (268 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-03 18:30:00 - step 62 of 96 - 732 active elements (268 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-03 19:00:00 - step 63 of 96 - 732 active elements (268 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-03 19:30:00 - step 64 of 96 - 730 active elements (270 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-03 20:00:00 - step 65 of 96 - 730 active elements (270 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-03 20:30:00 - step 66 of 96 - 729 active elements (271 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-03 21:00:00 - step 67 of 96 - 728 active elements (272 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-03 21:30:00 - step 68 of 96 - 726 active elements (274 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-03 22:00:00 - step 69 of 96 - 724 active elements (276 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-03 22:30:00 - step 70 of 96 - 724 active elements (276 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-03 23:00:00 - step 71 of 96 - 724 active elements (276 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-03 23:30:00 - step 72 of 96 - 724 active elements (276 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-04 00:00:00 - step 73 of 96 - 724 active elements (276 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-04 00:30:00 - step 74 of 96 - 723 active elements (277 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-04 01:00:00 - step 75 of 96 - 721 active elements (279 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-04 01:30:00 - step 76 of 96 - 721 active elements (279 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-04 02:00:00 - step 77 of 96 - 719 active elements (281 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-04 02:30:00 - step 78 of 96 - 719 active elements (281 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-04 03:00:00 - step 79 of 96 - 719 active elements (281 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-04 03:30:00 - step 80 of 96 - 718 active elements (282 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-04 04:00:00 - step 81 of 96 - 718 active elements (282 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-04 04:30:00 - step 82 of 96 - 718 active elements (282 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-04 05:00:00 - step 83 of 96 - 717 active elements (283 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-04 05:30:00 - step 84 of 96 - 717 active elements (283 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-04 06:00:00 - step 85 of 96 - 716 active elements (284 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-04 06:30:00 - step 86 of 96 - 716 active elements (284 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-04 07:00:00 - step 87 of 96 - 716 active elements (284 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-04 07:30:00 - step 88 of 96 - 715 active elements (285 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-04 08:00:00 - step 89 of 96 - 715 active elements (285 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-04 08:30:00 - step 90 of 96 - 715 active elements (285 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-04 09:00:00 - step 91 of 96 - 715 active elements (285 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-04 09:30:00 - step 92 of 96 - 715 active elements (285 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-04 10:00:00 - step 93 of 96 - 715 active elements (285 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-04 10:30:00 - step 94 of 96 - 714 active elements (286 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-04 11:00:00 - step 95 of 96 - 714 active elements (286 deactivated)
13:20:43 INFO opendrift.models.basemodel:2038: 2016-02-04 11:30:00 - step 96 of 96 - 714 active elements (286 deactivated)
from matplotlib.colors import ListedColormap
import cartopy.feature as cfeature
cmap = ListedColormap([cfeature.COLORS['water'],
cfeature.COLORS['land']])
To only show the landmask from the model, hide the coastline landmask by doing:
o2.plot(background='land_binary_mask', hide_landmask=True, cmap=cmap)
(<GeoAxes: title={'center': 'OpenDrift - OceanDrift\n2016-02-02 12:00 to 2016-02-04 12:00 UTC (17 steps)'}>, <Figure size 1100x1014.38 with 2 Axes>)
Animation illustrating that red particles strand at ocean model land cells, and black particles strand at GSHHG land polygons
o.animation(compare=o2, background='land_binary_mask', cmap=cmap,
legend=['Default GSHHG landmask', 'Ocean model landmask'])
/opt/conda/envs/opendrift/lib/python3.11/site-packages/cartopy/mpl/geoaxes.py:1692: UserWarning: No data for colormapping provided via 'c'. Parameters 'cmap' will be ignored
result = super().scatter(*args, **kwargs)
13:21:20 INFO opendrift.models.basemodel:4613: Saving animation to /root/project/docs/source/gallery/animations/example_model_landmask_0.gif...
13:22:22 INFO opendrift.models.basemodel:3037: Time to make animation: 0:01:29.712596
o.plot(compare=o2, background='land_binary_mask', cmap=cmap,
legend=['Default GSHHG landmask', 'Ocean model landmask'])
(<GeoAxes: title={'center': 'OpenDrift - OceanDrift\n2016-02-02 12:00 to 2016-02-04 12:00 UTC (17 steps)'}>, <Figure size 1100x1074.35 with 2 Axes>)
Total running time of the script: (2 minutes 10.824 seconds)