LCS Norkyst

from datetime import datetime, timedelta

from opendrift.readers import reader_netCDF_CF_generic
from opendrift.models.oceandrift import OceanDrift

o = OceanDrift(loglevel=20)  # Set loglevel to 0 for debug information

# Norkyst ocean model
reader_norkyst = reader_netCDF_CF_generic.Reader(o.test_data_folder() + '16Nov2015_NorKyst_z_surface/norkyst800_subset_16Nov2015.nc')

#o.add_reader([reader_norkyst, reader_arome])
o.add_reader([reader_norkyst])

Out:

13:44:22 INFO    opendrift.models.basemodel: OpenDriftSimulation initialised (version 1.7.1 / v1.7.1-87-g074c1d2)
13:44:22 INFO    opendrift.readers.reader_netCDF_CF_generic: Opening dataset: /root/project/tests/test_data/16Nov2015_NorKyst_z_surface/norkyst800_subset_16Nov2015.nc

Calculating attracting/backwards FTLE/LCS at 20 hours

lcs = o.calculate_ftle(
    time=reader_norkyst.start_time + timedelta(hours=20),
    time_step=timedelta(minutes=30),
    duration=timedelta(hours=5), delta=1000,
    RLCS=False)

Out:

13:44:22 INFO    opendrift.models.basemodel: No reader provided, using first available:
13:44:22 INFO    opendrift.models.basemodel: /root/project/tests/test_data/16Nov2015_NorKyst_z_surface/norkyst800_subset_16Nov2015.nc
13:44:22 INFO    opendrift.models.basemodel: Calculating LCS for 2015-11-16 20:00:00
13:44:22 INFO    opendrift.models.basemodel: Nothing to reset
13:44:23 INFO    opendrift.models.basemodel: Fallback values will be used for the following variables which have no readers:
13:44:23 INFO    opendrift.models.basemodel:    x_wind: 0.000000
13:44:23 INFO    opendrift.models.basemodel:    y_wind: 0.000000
13:44:23 INFO    opendrift.models.basemodel:    upward_sea_water_velocity: 0.000000
13:44:23 INFO    opendrift.models.basemodel:    ocean_vertical_diffusivity: 0.000000
13:44:23 INFO    opendrift.models.basemodel:    sea_surface_wave_significant_height: 0.000000
13:44:23 INFO    opendrift.models.basemodel:    sea_surface_wave_stokes_drift_x_velocity: 0.000000
13:44:23 INFO    opendrift.models.basemodel:    sea_surface_wave_stokes_drift_y_velocity: 0.000000
13:44:23 INFO    opendrift.models.basemodel:    sea_surface_wave_period_at_variance_spectral_density_maximum: 0.000000
13:44:23 INFO    opendrift.models.basemodel:    sea_surface_wave_mean_period_from_variance_spectral_density_second_frequency_moment: 0.000000
13:44:23 INFO    opendrift.models.basemodel:    surface_downward_x_stress: 0.000000
13:44:23 INFO    opendrift.models.basemodel:    surface_downward_y_stress: 0.000000
13:44:23 INFO    opendrift.models.basemodel:    turbulent_kinetic_energy: 0.000000
13:44:23 INFO    opendrift.models.basemodel:    turbulent_generic_length_scale: 0.000000
13:44:23 INFO    opendrift.models.basemodel:    sea_floor_depth_below_sea_level: 10000.000000
13:44:23 INFO    opendrift.models.basemodel: Backwards simulation, starting from last seeded element
13:44:23 INFO    opendrift.models.basemodel: Adding a dynamical landmask with max. priority based on assumed maximum speed of 1 m/s. Adding a customised landmask may be faster...
13:44:26 INFO    opendrift.models.basemodel: Using existing reader for land_binary_mask
13:44:26 INFO    opendrift.models.basemodel: Moving 12635 out of 38400 points from land to water
13:44:26 INFO    opendrift.models.basemodel: Backwards simulation, starting at time of last seeded element
13:44:27 INFO    opendrift.models.basemodel: 2015-11-17 01:00:00 - step 1 of 10 - 38400 active elements (0 deactivated)
13:44:27 INFO    opendrift.models.basemodel: 2015-11-17 00:30:00 - step 2 of 10 - 38400 active elements (0 deactivated)
13:44:28 INFO    opendrift.models.basemodel: 2015-11-17 00:00:00 - step 3 of 10 - 34842 active elements (3558 deactivated)
13:44:28 INFO    opendrift.models.basemodel: 2015-11-16 23:30:00 - step 4 of 10 - 32690 active elements (5710 deactivated)
13:44:29 INFO    opendrift.models.basemodel: 2015-11-16 23:00:00 - step 5 of 10 - 30255 active elements (8145 deactivated)
13:44:29 INFO    opendrift.models.basemodel: 2015-11-16 22:30:00 - step 6 of 10 - 28926 active elements (9474 deactivated)
13:44:29 INFO    opendrift.models.basemodel: 2015-11-16 22:00:00 - step 7 of 10 - 28004 active elements (10396 deactivated)
13:44:30 INFO    opendrift.models.basemodel: 2015-11-16 21:30:00 - step 8 of 10 - 27402 active elements (10998 deactivated)
13:44:30 INFO    opendrift.models.basemodel: 2015-11-16 21:00:00 - step 9 of 10 - 26984 active elements (11416 deactivated)
13:44:30 INFO    opendrift.models.basemodel: 2015-11-16 20:30:00 - step 10 of 10 - 26531 active elements (11869 deactivated)

Simulation from beginning and up to 30 hours (time of LCS)

o.reset()
o.seed_elements(lon=4.4, lat=60.2, number=1000, radius=1000,
                time=reader_norkyst.start_time)
o.run(end_time=reader_norkyst.start_time+timedelta(hours=20),
      time_step=timedelta(minutes=30))

o.plot(lcs=lcs, vmin=1e-7, vmax=1e-4, colorbar=True, show_particles=True)
OpenDrift - OceanDrift 2015-11-16 00:00 to 2015-11-16 20:00 UTC (41 steps)

Out:

13:44:34 INFO    opendrift.models.basemodel: Fallback values will be used for the following variables which have no readers:
13:44:34 INFO    opendrift.models.basemodel:    x_wind: 0.000000
13:44:34 INFO    opendrift.models.basemodel:    y_wind: 0.000000
13:44:34 INFO    opendrift.models.basemodel:    upward_sea_water_velocity: 0.000000
13:44:34 INFO    opendrift.models.basemodel:    ocean_vertical_diffusivity: 0.000000
13:44:34 INFO    opendrift.models.basemodel:    sea_surface_wave_significant_height: 0.000000
13:44:34 INFO    opendrift.models.basemodel:    sea_surface_wave_stokes_drift_x_velocity: 0.000000
13:44:34 INFO    opendrift.models.basemodel:    sea_surface_wave_stokes_drift_y_velocity: 0.000000
13:44:34 INFO    opendrift.models.basemodel:    sea_surface_wave_period_at_variance_spectral_density_maximum: 0.000000
13:44:34 INFO    opendrift.models.basemodel:    sea_surface_wave_mean_period_from_variance_spectral_density_second_frequency_moment: 0.000000
13:44:34 INFO    opendrift.models.basemodel:    surface_downward_x_stress: 0.000000
13:44:34 INFO    opendrift.models.basemodel:    surface_downward_y_stress: 0.000000
13:44:34 INFO    opendrift.models.basemodel:    turbulent_kinetic_energy: 0.000000
13:44:34 INFO    opendrift.models.basemodel:    turbulent_generic_length_scale: 0.000000
13:44:34 INFO    opendrift.models.basemodel:    sea_floor_depth_below_sea_level: 10000.000000
13:44:34 INFO    opendrift.models.basemodel: Using existing reader for land_binary_mask
13:44:34 INFO    opendrift.models.basemodel: All points are in ocean
13:44:34 INFO    opendrift.models.basemodel: 2015-11-16 00:00:00 - step 1 of 40 - 1000 active elements (0 deactivated)
13:44:34 INFO    opendrift.models.basemodel: 2015-11-16 00:30:00 - step 2 of 40 - 1000 active elements (0 deactivated)
13:44:34 INFO    opendrift.models.basemodel: 2015-11-16 01:00:00 - step 3 of 40 - 1000 active elements (0 deactivated)
13:44:34 INFO    opendrift.models.basemodel: 2015-11-16 01:30:00 - step 4 of 40 - 1000 active elements (0 deactivated)
13:44:34 INFO    opendrift.models.basemodel: 2015-11-16 02:00:00 - step 5 of 40 - 1000 active elements (0 deactivated)
13:44:34 INFO    opendrift.models.basemodel: 2015-11-16 02:30:00 - step 6 of 40 - 1000 active elements (0 deactivated)
13:44:34 INFO    opendrift.models.basemodel: 2015-11-16 03:00:00 - step 7 of 40 - 1000 active elements (0 deactivated)
13:44:34 INFO    opendrift.models.basemodel: 2015-11-16 03:30:00 - step 8 of 40 - 1000 active elements (0 deactivated)
13:44:35 INFO    opendrift.models.basemodel: 2015-11-16 04:00:00 - step 9 of 40 - 1000 active elements (0 deactivated)
13:44:35 INFO    opendrift.models.basemodel: 2015-11-16 04:30:00 - step 10 of 40 - 1000 active elements (0 deactivated)
13:44:35 INFO    opendrift.models.basemodel: 2015-11-16 05:00:00 - step 11 of 40 - 1000 active elements (0 deactivated)
13:44:35 INFO    opendrift.models.basemodel: 2015-11-16 05:30:00 - step 12 of 40 - 1000 active elements (0 deactivated)
13:44:35 INFO    opendrift.models.basemodel: 2015-11-16 06:00:00 - step 13 of 40 - 1000 active elements (0 deactivated)
13:44:35 INFO    opendrift.models.basemodel: 2015-11-16 06:30:00 - step 14 of 40 - 1000 active elements (0 deactivated)
13:44:35 INFO    opendrift.models.basemodel: 2015-11-16 07:00:00 - step 15 of 40 - 1000 active elements (0 deactivated)
13:44:35 INFO    opendrift.models.basemodel: 2015-11-16 07:30:00 - step 16 of 40 - 1000 active elements (0 deactivated)
13:44:35 INFO    opendrift.models.basemodel: 2015-11-16 08:00:00 - step 17 of 40 - 1000 active elements (0 deactivated)
13:44:35 INFO    opendrift.models.basemodel: 2015-11-16 08:30:00 - step 18 of 40 - 1000 active elements (0 deactivated)
13:44:35 INFO    opendrift.models.basemodel: 2015-11-16 09:00:00 - step 19 of 40 - 1000 active elements (0 deactivated)
13:44:35 INFO    opendrift.models.basemodel: 2015-11-16 09:30:00 - step 20 of 40 - 1000 active elements (0 deactivated)
13:44:35 INFO    opendrift.models.basemodel: 2015-11-16 10:00:00 - step 21 of 40 - 1000 active elements (0 deactivated)
13:44:35 INFO    opendrift.models.basemodel: 2015-11-16 10:30:00 - step 22 of 40 - 1000 active elements (0 deactivated)
13:44:35 INFO    opendrift.models.basemodel: 2015-11-16 11:00:00 - step 23 of 40 - 1000 active elements (0 deactivated)
13:44:35 INFO    opendrift.models.basemodel: 2015-11-16 11:30:00 - step 24 of 40 - 1000 active elements (0 deactivated)
13:44:35 INFO    opendrift.models.basemodel: 2015-11-16 12:00:00 - step 25 of 40 - 1000 active elements (0 deactivated)
13:44:35 INFO    opendrift.models.basemodel: 2015-11-16 12:30:00 - step 26 of 40 - 1000 active elements (0 deactivated)
13:44:35 INFO    opendrift.models.basemodel: 2015-11-16 13:00:00 - step 27 of 40 - 1000 active elements (0 deactivated)
13:44:35 INFO    opendrift.models.basemodel: 2015-11-16 13:30:00 - step 28 of 40 - 1000 active elements (0 deactivated)
13:44:35 INFO    opendrift.models.basemodel: 2015-11-16 14:00:00 - step 29 of 40 - 1000 active elements (0 deactivated)
13:44:35 INFO    opendrift.models.basemodel: 2015-11-16 14:30:00 - step 30 of 40 - 1000 active elements (0 deactivated)
13:44:35 INFO    opendrift.models.basemodel: 2015-11-16 15:00:00 - step 31 of 40 - 1000 active elements (0 deactivated)
13:44:35 INFO    opendrift.models.basemodel: 2015-11-16 15:30:00 - step 32 of 40 - 1000 active elements (0 deactivated)
13:44:35 INFO    opendrift.models.basemodel: 2015-11-16 16:00:00 - step 33 of 40 - 1000 active elements (0 deactivated)
13:44:35 INFO    opendrift.models.basemodel: 2015-11-16 16:30:00 - step 34 of 40 - 1000 active elements (0 deactivated)
13:44:36 INFO    opendrift.models.basemodel: 2015-11-16 17:00:00 - step 35 of 40 - 1000 active elements (0 deactivated)
13:44:36 INFO    opendrift.models.basemodel: 2015-11-16 17:30:00 - step 36 of 40 - 1000 active elements (0 deactivated)
13:44:36 INFO    opendrift.models.basemodel: 2015-11-16 18:00:00 - step 37 of 40 - 1000 active elements (0 deactivated)
13:44:36 INFO    opendrift.models.basemodel: 2015-11-16 18:30:00 - step 38 of 40 - 1000 active elements (0 deactivated)
13:44:36 INFO    opendrift.models.basemodel: 2015-11-16 19:00:00 - step 39 of 40 - 1000 active elements (0 deactivated)
13:44:36 INFO    opendrift.models.basemodel: 2015-11-16 19:30:00 - step 40 of 40 - 1000 active elements (0 deactivated)

(<GeoAxesSubplot:title={'center':'OpenDrift - OceanDrift\n2015-11-16 00:00 to 2015-11-16 20:00 UTC (41 steps)'}>, <module 'matplotlib.pyplot' from '/opt/conda/envs/opendrift/lib/python3.9/site-packages/matplotlib/pyplot.py'>)

Total running time of the script: ( 0 minutes 36.636 seconds)

Gallery generated by Sphinx-Gallery