Skip to content

Commit 33b871f

Browse files
authored
Merge pull request #1772 from knutfrode/dev
Major change: horizontal_diffusivity is not anymore a config setting …
2 parents 7cba87b + 95067da commit 33b871f

28 files changed

Lines changed: 94 additions & 51 deletions

examples/example_biodegradation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
# No motion is needed for this test
1616
o.set_config('environment:constant', {k: 0 for k in
1717
['x_wind', 'y_wind', 'x_sea_water_velocity', 'y_sea_water_velocity']})
18-
o.set_config('drift', {'current_uncertainty': 0, 'wind_uncertainty': 0, 'horizontal_diffusivity': 10})
18+
o.set_config('environment:constant:horizontal_diffusivity', 10)
19+
o.set_config('drift', {'current_uncertainty': 0, 'wind_uncertainty': 0})
1920

2021
#%%
2122
# Seeding some particles

examples/example_depth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#%%
1919
# Adding some diffusion
20-
o.set_config('drift:horizontal_diffusivity', 10) # m2/s
20+
o.set_config('environment:constant:horizontal_diffusivity', 10) # m2/s
2121

2222
#%%
2323
# Seed 1000 elements at random depths

examples/example_horizontal_diffusion.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
o2.add_reader([reader_norkyst, reader_arome])
4141
#o2.set_config('drift:current_uncertainty', .2) # Difference from first run
4242
#o2.set_config('drift:wind_uncertainty', 1) # Difference from first run
43-
o2.set_config('drift:horizontal_diffusivity', 10) # Difference from first run
43+
o2.set_config('environment:constant:horizontal_diffusivity', 10) # Difference from first run
4444
o2.seed_elements(lon, lat, radius=500, number=2000, time=time)
4545
o2.run(duration=timedelta(hours=24))
4646

@@ -50,7 +50,7 @@
5050
o3.add_reader([reader_norkyst, reader_arome])
5151
#o3.set_config('drift:current_uncertainty', .2) # Difference from first run
5252
#o3.set_config('drift:wind_uncertainty', 1) # Difference from first run
53-
o3.set_config('drift:horizontal_diffusivity', 10) # Difference from first run
53+
o3.set_config('environment:constant:horizontal_diffusivity', 10) # Difference from first run
5454
o3.seed_elements(lon, lat, radius=500, number=2000, time=time)
5555
o3.run(duration=timedelta(hours=24), time_step=300, time_step_output=3600)
5656

examples/example_huge_output.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#%%
1414
# First make a simulation with two seedings, marked by *origin_marker*
1515
o = OceanDrift(loglevel=10)
16-
o.set_config('drift:horizontal_diffusivity', 10)
16+
o.set_config('environment:constant:horizontal_diffusivity', 10)
1717
t1 = datetime.now()
1818
t2 = t1 + timedelta(hours=6)
1919
number = 10000

examples/example_lake.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
o.add_reader(reader_lakes)
2525
o.set_config('general:use_auto_landmask', False) # To use custom landmask instead
2626
o.set_config('environment:constant:x_sea_water_velocity', 1)
27-
o.set_config('drift:horizontal_diffusivity', 100)
27+
o.set_config('environment:constant:horizontal_diffusivity', 100)
2828
o.seed_elements(lon=48.819, lat=44.959, radius=5000, number=100, time=datetime.now())
2929

3030
o.run(steps=10)

examples/example_long_multiprocessing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def RunOceanDrift(pool_number):
4646
reader_topaz4 = reader_netCDF_CF_generic.Reader("https://thredds.met.no/thredds/dodsC/topaz/dataset-topaz4-arc-myoceanv2-be")
4747
o.add_reader(reader_topaz4, variables=['x_sea_water_velocity', 'y_sea_water_velocity','sea_water_temperature','sea_water_salinity','sea_floor_depth_below_sea_level'])
4848

49-
o.set_config('drift:horizontal_diffusivity', 50)
49+
o.set_config('environment:constant:horizontal_diffusivity', 50)
5050

5151
time = datetime(2023,1,1)
5252

examples/example_long_radionuclides.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
o.set_config('vertical_mixing:diffusivitymodel','environment') # apply vertical diffusivity from ocean model
2828
# Vertical mixing requires fast time step
2929
o.set_config('vertical_mixing:timestep', 600.) # seconds
30-
o.set_config('drift:horizontal_diffusivity', 10)
30+
o.set_config('environment:constant:horizontal_diffusivity', 10)
3131

3232
#%%
3333
o.set_config('radionuclide:particle_diameter',5.e-6) # m

examples/example_oil_ice.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
o.set_config('processes:dispersion', False)
2121
o.set_config('processes:evaporation', False)
2222
o.set_config('processes:emulsification', False)
23-
o.set_config('drift:horizontal_diffusivity', 10)
23+
o.set_config('environment:constant:horizontal_diffusivity', 10)
2424
o.set_config('drift:truncate_ocean_model_below_m', 3)
2525

2626
#%%

examples/example_oilspill_seafloor_biodegradation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
'https://tds.hycom.org/thredds/dodsC/FMRC_ESPC-D-V02_uv3z/FMRC_ESPC-D-V02_uv3z_best.ncd',
1919
'https://pae-paha.pacioos.hawaii.edu/thredds/dodsC/ncep_global/NCEP_Global_Atmospheric_Model_best.ncd'])
2020
o.set_config('environment:constant:ocean_mixed_layer_thickness', 20)
21-
o.set_config('drift', {'current_uncertainty': 0, 'wind_uncertainty': 0, 'horizontal_diffusivity': 20})
21+
o.set_config('environment:constant:horizontal_diffusivity', 20)
22+
o.set_config('drift', {'current_uncertainty': 0, 'wind_uncertainty': 0})
2223

2324
#%%
2425
# Configuration

examples/example_openberg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
# Simulating drift for 48 hours
3232
o = OpenBerg()
3333
o.set_config('drift:vertical_profile', False)
34-
o.set_config('drift:horizontal_diffusivity', 100)
34+
o.set_config('environment:constant:horizontal_diffusivity', 100)
3535
o.add_readers_from_list(forcing)
3636
o.seed_elements(**icebergs)
3737
o.run(duration=timedelta(hours=48))

0 commit comments

Comments
 (0)