Commit 87b7e002 authored by Veit Lüschow's avatar Veit Lüschow

restoring instead of fixed south north boundaries

parent 4d91eee3
......@@ -2,6 +2,7 @@ from .. import veros_method
from ..variables import allocate
from . import friction, isoneutral, streamfunction
from veros.core import utilities
@veros_method
def momentum(vs):
......@@ -71,12 +72,8 @@ def momentum(vs):
vs.dv[:, :, :, vs.tau] += vs.dv_adv
if vs.dwbc2:
print('linear at boundary')
# vs.du[:,:1,:,vs.tau] = vs.du[:,:1,:,vs.tau] - vs.du_adv[:,:1,:]
vs.du[:,:3,:,vs.tau] -= vs.du_adv[:,:3,:]
vs.du[:,-4:,:,vs.tau] -= vs.du_adv[:,-4:,:]
vs.dv[:,:3,:,vs.tau] -= vs.dv_adv[:,:3,:]
vs.dv[:,-4:,:,vs.tau] -= vs.dv_adv[:,-4:,:]
utilities.set_obc_momentum(vs)
"""
add momentum restoring that is computed in set_forcing
......
......@@ -55,11 +55,27 @@ def obc_boundaries(vs,arr):
@veros_method
def set_obc_temp_salt(vs):
print('do phase speed stuff')
vs.temp[:,2,:,vs.taup1] = vs.temp_ini[:,5,:].copy()
vs.temp[:,-4,:,vs.taup1] = vs.temp_ini[:,-5,:].copy()
# temp(:,j,:,taup1) = temp(:,j,:,taup1) + dt_tracer*maskT(:,j,:)*obc_tscl*(temp_wall_north - temp(:,j,:,tau) )
vs.temp[:,2,:,vs.taup1] = vs.temp[:,2,:,vs.taup1] + vs.dt_tracer \
* vs.tscl_tr * ( vs.temp_ini[:,5,:] - vs.temp[:,2,:,vs.tau] )
vs.temp[:,-4,:,vs.taup1] = vs.temp[:,-4,:,vs.taup1] + vs.dt_tracer \
* vs.tscl_tr * ( vs.temp_ini[:,-5,:] - vs.temp[:,-4,:,vs.tau] )
# vs.temp[:,2,:,vs.taup1] = vs.temp_ini[:,5,:].copy() # WORKS!
# vs.temp[:,-4,:,vs.taup1] = vs.temp_ini[:,-5,:].copy() # WORKS!
print('restore temp and salt')
@veros_method
def set_obc_momentum(vs):
print('linear momentum equation at boundaries')
vs.du[:,:3,:,vs.tau] -= vs.du_adv[:,:3,:]
vs.du[:,-4:,:,vs.tau] -= vs.du_adv[:,-4:,:]
vs.dv[:,:3,:,vs.tau] -= vs.dv_adv[:,:3,:]
vs.dv[:,-4:,:,vs.tau] -= vs.dv_adv[:,-4:,:]
print('danmping terms')
@veros_method(inline=True)
......
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