Skip to content

Commit

Permalink
Merge pull request #1319 from magnesim/magnesim/radionuclide
Browse files Browse the repository at this point in the history
Magnesim/radionuclide
  • Loading branch information
knutfrode authored Jun 17, 2024
2 parents 25a02ff + 9ddab2e commit c196bbc
Show file tree
Hide file tree
Showing 3 changed files with 402 additions and 335 deletions.
54 changes: 7 additions & 47 deletions examples/example_radionuclides.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,50 +22,27 @@

# Adjusting some configuration
o.set_config('drift:vertical_mixing', True)
#o.set_config('environment:constant:ocean_vertical_diffusivity', 0)
#o.set_config('vertical_mixing:diffusivitymodel','constant') # include settling without vertical turbulent mixing
o.set_config('vertical_mixing:diffusivitymodel','environment') # include settling without vertical turbulent mixing
o.set_config('vertical_mixing:diffusivitymodel','environment') # apply vertical diffusivity from ocean model
# Vertical mixing requires fast time step
o.set_config('vertical_mixing:timestep', 600.) # seconds
o.set_config('drift:horizontal_diffusivity', 10)

#%%
# Activate the desired species
#o.set_config('radionuclide:species:LMM', True)
#o.set_config('radionuclide:species:LMMcation', True)
#o.set_config('radionuclide:species:LMManion', True)
#o.set_config('radionuclide:species:Colloid', True)
#o.set_config('radionuclide:species:Humic_colloid', True)
#o.set_config('radionuclide:species:Polymer', True)
#o.set_config('radionuclide:species:Particle_reversible', True)
#o.set_config('radionuclide:species:Particle_irreversible', True)
#o.set_config('radionuclide:species:Particle_slowly_reversible', True)

#o.set_config('radionuclide:species:Sediment_reversible', True)
#o.set_config('radionuclide:species:Sediment_irreversible', True)
#o.set_config('radionuclide:species:Sediment_slowly_reversible', True)

o.set_config('radionuclide:particle_diameter',5.e-6) # m
#o.set_config('radionuclide:particle_diameter_uncertainty',1.e-7) # m
o.set_config('radionuclide:transformations:Kd',2.e0) # (m3/kg)
#o.set_config('radionuclide:transformations:slow_coeff',1.e-6)

o.set_config('radionuclide:sediment:resuspension_depth',2.)
o.set_config('radionuclide:sediment:resuspension_depth_uncert',0.1)
o.set_config('radionuclide:sediment:resuspension_critvel',0.15)


#
#o.set_config('radionuclide:transfer_setup','custom')
o.set_config('radionuclide:transfer_setup','Bokna_137Cs')
#o.set_config('radionuclide:transfer_setup','137Cs_rev')
#o.set_config('radionuclide:transfer_setup','Sandnesfj_Al')
o.set_config('radionuclide:isotope', '137Cs')
o.set_config('radionuclide:specie_setup','LMM + Rev')

# By default, radionuclides do not strand towards coastline
o.set_config('general:coastline_action', 'previous')
o.set_config('general:seafloor_action','lift_to_seafloor')
#o.set_config('general:seafloor_action','previous')
#o.set_config('general:use_auto_landmask',False)


o.set_config('seed:LMM_fraction',.45)
Expand All @@ -80,20 +57,13 @@
td=datetime.today()
time = datetime(td.year, td.month, td.day, 0)

#latseed= 61.2; lonseed= 4.3 # Sognesjen
#latseed= 59.0; lonseed= 10.75 # Hvaler/Koster
#latseed= 57.5; lonseed= 9.3 # Kattegat
latseed= 60.0; lonseed= 4.5 # Bergen (?)
latseed= 60.0; lonseed= 4.5

ntraj=5000
iniz=np.random.rand(ntraj) * -10. # seeding the radionuclides in the upper 10m

o.seed_elements(lonseed, latseed, z=iniz, radius=1000,number=ntraj,
time=time,
# LMM_fraction=0.25,
# particle_fraction=0.75
# diameter=99.e-6#diam,
#specie=init_speciation
)


Expand Down Expand Up @@ -137,17 +107,7 @@



# Postprocessing: write to concentration netcdf file
o.conc_lat = reader_norkyst.get_variables('latitude',
x=[reader_norkyst.xmin,reader_norkyst.xmax],
y=[reader_norkyst.ymin,reader_norkyst.ymax])['latitude'][:]
o.conc_lon = reader_norkyst.get_variables('longitude',
x=[reader_norkyst.xmin,reader_norkyst.xmax],
y=[reader_norkyst.ymin,reader_norkyst.ymax])['longitude'][:]
o.conc_topo = reader_norkyst.get_variables('sea_floor_depth_below_sea_level',
x=[reader_norkyst.xmin,reader_norkyst.xmax],
y=[reader_norkyst.ymin,reader_norkyst.ymax])['sea_floor_depth_below_sea_level'][:]
#o.conc_mask = reader_norkyst.land_binary_mask
# # Postprocessing: write to concentration netcdf file

#%%
#
Expand All @@ -160,8 +120,8 @@
smoothing_cells=1,
time_avg_conc=True,
deltat=2., # hours
llcrnrlon=4.4, llcrnrlat=59.9,
urcrnrlon=4.8, urcrnrlat=60.2,
# llcrnrlon=4.4, llcrnrlat=59.9,
# urcrnrlon=4.8, urcrnrlat=60.2,
)


Expand Down
Loading

0 comments on commit c196bbc

Please sign in to comment.