OpenBergOld - statistical mode

from datetime import datetime, timedelta
from opendrift.readers import reader_netCDF_CF_generic
from opendrift.readers import reader_current_from_track
from opendrift.models.openberg_old import OpenBergOld

Create observation of iceberg track

obslon = [3.1, 3.123456]
obslat = [61.1, 61.132198]
obstime = [datetime(2015, 11, 16, 0), datetime(2015, 11, 16, 6)]

Initialize model

steps = 60   # This is the number of forecast steps
o = OpenBergOld(loglevel=30)  # Basic drift model suitable for icebergs

Preparing Readers

reader_wind = reader_netCDF_CF_generic.Reader(o.test_data_folder() +

reader_current = reader_current_from_track.Reader(
    obslon, obslat, obstime, wind_east=0, wind_north=0,
    windreader=reader_wind, wind_factor=0.018)

o.add_reader([reader_current, reader_wind])
/opt/conda/envs/opendrift/lib/python3.11/site-packages/pyproj/crs/ UserWarning: You will likely lose important projection information when converting to a PROJ string from another format. See:
  proj = self._crs.to_proj4(version=version)

Seeding elements

Icebergs are moved with the ocean current as per Barker et al (2004), in addition to a fraction of the wind speed (wind_drift_factor). This factor depends on the properties of the elements. Default empirical values are: - Wind drift fraction: 0.018 (1.8 %) (Garret 1985) - Iceberg size: Keel dept = 60m Waterline length = 90.5m NB! Iceberg size is irrelevant for current_reader with 1D z-profile

o.seed_elements(3.3, 61.3, radius=3000, number=500,

Run model

print('Starting free run .../n')

print('Start time: ' + str(o.start_time)), steps=steps)
Starting free run .../n
Start time: 2015-11-16 07:00:00

Print and plot results

OpenDrift - OpenBergOld 2015-11-16 07:00 to 2015-11-18 19:00 UTC (61 steps)
08:36:38 WARNING opendrift.models.basemodel:2379: Plotting fast. This will make your plots less accurate.
08:36:41 WARNING opendrift.models.basemodel:2379: Plotting fast. This will make your plots less accurate.
/opt/conda/envs/opendrift/lib/python3.11/site-packages/cartopy/mpl/ UserWarning: No data for colormapping provided via 'c'. Parameters 'cmap' will be ignored
  result = super().scatter(*args, **kwargs)

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

Gallery generated by Sphinx-Gallery