Commit bc9ca6d1 authored by Veit Lüschow's avatar Veit Lüschow

found new configuration with meridional flow

parent 86cb7ee8
......@@ -73,8 +73,6 @@ def momentum(vs):
"""
add momentum restoring that is computed in set_forcing
"""
vs.du[:, :, :, vs.tau] += vs.du_rest
vs.dv[:, :, :, vs.tau] += vs.dv_rest
with vs.timers['friction']:
"""
......@@ -120,6 +118,9 @@ def momentum(vs):
"""
external mode
"""
vs.du_mix += vs.du_rest
vs.dv_mix += vs.dv_rest
with vs.timers['pressure']:
streamfunction.solve_streamfunction(vs)
......
......@@ -17,6 +17,7 @@ SETTINGS = OrderedDict([
# Logical switches for general model setup
('coord_degree', Setting(False, bool, 'either spherical (True) or cartesian (False) coordinates')),
('enable_cyclic_x', Setting(False, bool, 'enable cyclic boundary conditions')),
('enable_rotate_f', Setting(False, bool, 'change coriolis gradient to zonal')),
('eq_of_state_type', Setting(1, int, 'equation of state: 1: linear, 3: nonlinear with comp., 5: TEOS')),
('enable_implicit_vert_friction', Setting(False, bool, 'enable implicit vertical friction')),
('enable_explicit_vert_friction', Setting(False, bool, 'enable explicit vertical friction')),
......
......@@ -136,7 +136,7 @@ class ACCSetup(VerosSetup):
vs.diagnostics['averages'].output_variables = (
'salt', 'temp', 'u', 'v', 'w', 'psi', 'surface_taux', 'surface_tauy','rho'
)
vs.diagnostics['averages'].output_frequency = 365 * 86400.
vs.diagnostics['averages'].output_frequency = 50 * 86400.
vs.diagnostics['averages'].sampling_frequency = vs.dt_tracer * 10
vs.diagnostics['overturning'].output_frequency = 365 * 86400. / 48.
vs.diagnostics['overturning'].sampling_frequency = vs.dt_tracer * 10
......
from veros.setup.merjet.merjet import merjet
This diff is collapsed.
#%%
import xarray as xr
import matplotlib.pyplot as plt
import numpy as np
from IPython import get_ipython
get_ipython().magic('reset -sf')
import matplotlib
get_ipython().magic('matplotlib inline')
class section:
def __init__(self, filename, varname):
self.filename = filename
self.varname = varname
try:
self.var = self.load()[varname]
except KeyError:
print('Variable does not exist, choose new from:')
print(self.load().data_vars)
self.data = 'something'
def load(self):
return xr.open_dataset(self.filename)
def select(self, timestep, axis, position):
try:
self.var[axis]
if axis == 'xu':
self.data = self.var.isel(xu=position).isel(Time=timestep)
elif axis == 'yt':
self.data = self.var.isel(yt=position).isel(Time=timestep)
elif axis == 'zt':
self.data = self.var.isel(zt=position).isel(Time=timestep)
elif axis == 'xt':
self.data = self.var.isel(xt=position).isel(Time=timestep)
except KeyError:
print('Axis does not exist, choose new from: \n', self.var.coords)
return self.data
def figure(self):
pass
def fileinfo(self):
print('Info: ', self.load())
try:
del p
except NameError:
pass
# p = section('../acc/acc.averages.nc','u')
# p = section('good/20200401_1.averages.nc', 'u')
p = section('merjet.snapshot.nc', 'u')
#%%
p.select(2,'zt',30).plot.contourf(levels=15)
#%%
p = section('merjet.averages.nc', 'u')
step = 3
xpos = 5
plt.figure()
p.select(step,'xu',xpos).plot.contour(levels=15,vmin=-0.6,vmax=0.6,colors="black")
#
p = section('merjet.averages.nc', 'rho')
p.select(step,'xt',xpos).plot.contourf(levels=16,cmap='RdBu_r')
"""
Analyze transports
"""
p = section('merjet.snapshot.nc', 'u')
trans = np.sum(p.var.isel(xu=1),axis=(1,2))
plt.figure()
plt.plot(p.var.Time,trans)
plt.figure()
trans = np.sum(p.var,axis=(1,2))
plt.contourf(trans)
plt.colorbar()
# plt.show()
......@@ -242,7 +242,7 @@ class NorthAtlanticSetup(VerosSetup):
vs.diagnostics['averages'].output_frequency = 3600. * 24 * 10
vs.diagnostics['averages'].sampling_frequency = vs.dt_tracer
vs.diagnostics['averages'].output_variables = ['temp', 'salt', 'u', 'v', 'w',
'surface_taux', 'surface_tauy', 'psi']
'surface_taux', 'surface_tauy', 'rest_tscl']
vs.diagnostics['cfl_monitor'].output_frequency = vs.dt_tracer * 10
@veros_method
......
......@@ -43,7 +43,7 @@ class section:
print('Axis does not exist, choose new from: \n', self.var.coords)
return self.data
......@@ -59,9 +59,10 @@ try:
except NameError:
pass
p = section('zonjet.averages.nc','rho')
# p = section('../acc/acc.averages.nc','u')
p = section('zonjet.averages.nc', 'temp')
p.fileinfo()
p.select(0,'xt',13).plot.contourf(levels=11)
p.select(6,'zt',14).plot.contourf(levels=100)
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment