-
Notifications
You must be signed in to change notification settings - Fork 2
/
simSettings.py
77 lines (63 loc) · 2.93 KB
/
simSettings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import oceanState, oceanStateSplit
import json
class SimSettings:
def __init__(self):
configFile = "config/miniOceanConfig.txt"
with open(configFile) as json_data_file:
config = json.load(json_data_file)
self.config = config
self.scenario = config['scenario']
# Run duration:
self.tEnd = 10*24*3600#3600*24*10
# Save settings:
self.saveIntS = config['saveIntS']
self.saveFile = config['saveFile']
self.saveAvgIntS = 24*3600
self.saveAvgFile = 'C:/temp/aver1.nc'
self.saveSubsetFile = 'C:/temp/real_gin_subset.nc'
# Activate/deactivate features:
self.modeSplittingOn = True
self.useRk = True
self.freshwaterOn = False
self.coriolisOn = True
self.atmoOn = True
self.advectiveTermsOn = True # 1 to include advective terms in momentum equation, 0 to disable
self.biharmonic = False # 1 to use biharmonic friction of horizontal velocities. 0 to use Smagorinsky
self.trcVertMix = True
self.trcHorizMix = True
self.passiveTracer = True
self.recordAverages = False
self.implicitVerticalDiff = True # True to use implicit scheme for vertical diff og momentum in split
self.frsZone = 3
# Mixing parameters:
self.calcMixingInterval = 1
self.KBi = 1e11 # Biharmonic coefficient. Should be overridden by scenario since it is resolution dependent
self.A_z = 10*1e-2 # Vertical eddy viscosity used for vertical diffusion of momentum
self.Ri0 = 0.65 # Threshold Richardson number value. Taken from SINMOD
self.G_vmix = 30 # Shape parameter for Richardson number vertical mixing scheme
self.KVm = 3e-2 # [m2/s] Maximum vertical diffusivity
# Bottom friction:
self.C_b = 2.5e-3 # taken from SINMOD's splitt_v7
self.CM = 1.0 # For Smagorinsky
self.CH = 0.25*0.1 # 0.4 # For Smagorinsky
self.CM2D = 0.25*0.25 # 1.0 # For Smagorinsky
# Coriolis parameters:
self.omega = 0.7292e-4 # Earth rotational speed(rad / s)
self.latitude = 73
self.phi0 = self.latitude*3.1415/180.0
if not self.coriolisOn:
self.omega = 0
# Atmosphere / waves:
self.atmoUpdateInterval = 300 # Update interval for atmo data(s)
self.p_atm0 = 101000 # Atmospheric pressure(Pa)
self.H_wave = 0.5 # Wave height(m)
self.T_wave = 3 # Wave period(s)
self.windStressCoeff = 0.00015 #0.0002 # Multiply wind speed (m/s) by this coeff to get wind stress
self.rho_0 = 1023.6
# Instantiate ocean object. The type of ocean object is decided based on whether
# mode splitting is activated or not.
def getOcean(self, imax, jmax, kmax):
if self.modeSplittingOn:
return oceanStateSplit.OceanStateSplit(imax, jmax, kmax)
else:
return oceanState.OceanState(imax, jmax, kmax)