Skip to content
Snippets Groups Projects
Commit f92439c9 authored by JakobDeutloff's avatar JakobDeutloff
Browse files

Timeframe added for TPhiS plots, os directory changes improved, exp_heat added

parent 29516032
Branches
No related tags found
No related merge requests found
Showing
with 511 additions and 639 deletions
...@@ -2,15 +2,10 @@ import json ...@@ -2,15 +2,10 @@ import json
from func_bound_values import * from func_bound_values import *
import os import os
# set wd to build_config_files folder # set wd to the directory of the script
wd = os.getcwd() abspath = os.path.abspath(__file__)
# check if already in correct wd dname = os.path.dirname(abspath)
if wd[-18:] == 'build_config_files': os.chdir(dname)
pass
# if not, change to build_config_files
else:
path = wd + '/Python_files/Code/build_config_files'
os.chdir(path)
# set constants # set constants
rho_l = 1028 rho_l = 1028
...@@ -34,6 +29,7 @@ file.close() ...@@ -34,6 +29,7 @@ file.close()
# ********************************************************************************************************************** # **********************************************************************************************************************
# Initial layer thickness, timestep, output time and simulation time # Initial layer thickness, timestep, output time and simulation time
# ********************************************************************************************************************** # **********************************************************************************************************************
config['start_time'] = '2022-01-01 00:00:00' # start time in YYYY-mm-dd HH:MM:SS
config['dt'] = 1 # time increment [s]] config['dt'] = 1 # time increment [s]]
config['time'] = 0.0 # initial value of time [s] config['time'] = 0.0 # initial value of time [s]
config['time_out'] = 3600 # time between outputs [s] config['time_out'] = 3600 # time between outputs [s]
......
...@@ -2,15 +2,10 @@ import json ...@@ -2,15 +2,10 @@ import json
from func_bound_values import * from func_bound_values import *
import os import os
# set wd to build_config_files folder # set wd to the directory of the script
wd = os.getcwd() abspath = os.path.abspath(__file__)
# check if already in correct wd dname = os.path.dirname(abspath)
if wd[-18:] == 'build_config_files': os.chdir(dname)
pass
# if not, change to build_config_files
else:
path = wd + '/Python_files/Code/build_config_files'
os.chdir(path)
# set constants # set constants
rho_l = 1028 rho_l = 1028
...@@ -34,6 +29,7 @@ file.close() ...@@ -34,6 +29,7 @@ file.close()
# ********************************************************************************************************************** # **********************************************************************************************************************
# Initial layer thickness, timestep, output time and simulation time # Initial layer thickness, timestep, output time and simulation time
# ********************************************************************************************************************** # **********************************************************************************************************************
config['start_time'] = '2022-01-01 00:00:00' # start time in YYYY-mm-dd HH:MM:SS
config['dt'] = 30 # time increment [s]] config['dt'] = 30 # time increment [s]]
config['time'] = 0.0 # initial value of time [s] config['time'] = 0.0 # initial value of time [s]
config['time_out'] = 3600 * 6 # time between outputs [s] config['time_out'] = 3600 * 6 # time between outputs [s]
......
...@@ -2,15 +2,10 @@ import json ...@@ -2,15 +2,10 @@ import json
from func_bound_values import * from func_bound_values import *
import os import os
# set wd to build_config_files folder # set wd to the directory of the script
wd = os.getcwd() abspath = os.path.abspath(__file__)
# check if already in correct wd dname = os.path.dirname(abspath)
if wd[-18:] == 'build_config_files': os.chdir(dname)
pass
# if not, change to build_config_files
else:
path = wd + '/Python_files/Code/build_config_files'
os.chdir(path)
# set constants # set constants
rho_l = 1028 rho_l = 1028
...@@ -34,6 +29,7 @@ file.close() ...@@ -34,6 +29,7 @@ file.close()
# ********************************************************************************************************************** # **********************************************************************************************************************
# Initial layer thickness, timestep, output time and simulation time # Initial layer thickness, timestep, output time and simulation time
# ********************************************************************************************************************** # **********************************************************************************************************************
config['start_time'] = '2022-01-01 00:00:00' # start time in YYYY-mm-dd HH:MM:SS
config['dt'] = 60 # time increment [s]] config['dt'] = 60 # time increment [s]]
config['time'] = 0.0 # initial value of time [s] config['time'] = 0.0 # initial value of time [s]
config['time_out'] = 86400 * 3.5 # time between outputs [s] config['time_out'] = 86400 * 3.5 # time between outputs [s]
......
...@@ -2,15 +2,10 @@ import json ...@@ -2,15 +2,10 @@ import json
from func_bound_values import * from func_bound_values import *
import os import os
# set wd to build_config_files folder # set wd to the directory of the script
wd = os.getcwd() abspath = os.path.abspath(__file__)
# check if already in correct wd dname = os.path.dirname(abspath)
if wd[-18:] == 'build_config_files': os.chdir(dname)
pass
# if not, change to build_config_files
else:
path = wd + '/Python_files/Code/build_config_files'
os.chdir(path)
# set constants # set constants
...@@ -35,6 +30,7 @@ file.close() ...@@ -35,6 +30,7 @@ file.close()
# ********************************************************************************************************************** # **********************************************************************************************************************
# Initial layer thickness, timestep, output time and simulation time # Initial layer thickness, timestep, output time and simulation time
# ********************************************************************************************************************** # **********************************************************************************************************************
config['start_time'] = '2022-01-01 00:00:00' # start time in YYYY-mm-dd HH:MM:SS
config['dt'] = 10 # time increment [s]] config['dt'] = 10 # time increment [s]]
config['time'] = 0.0 # initial value of time [s] config['time'] = 0.0 # initial value of time [s]
config['time_out'] = 86400 # time between outputs [s] config['time_out'] = 86400 # time between outputs [s]
......
import json
from func_bound_values import *
import os
# set wd to build_config_files folder
wd = os.getcwd()
# check if already in correct wd
if wd[-18:] == 'build_config_files':
pass
# if not, change to build_config_files
else:
path = wd + '/Python_files/Code/build_config_files'
os.chdir(path)
# set constants
rho_l = 1028
c_l = 3400
# **********************************************************************************************************************
# Initialize array containig all parameters and set path to its directory
# **********************************************************************************************************************
config = {}
path_config = r'../../../Run_specifics/'
path_input = '../../../input/'
# **********************************************************************************************************************
# Set description of run
# **********************************************************************************************************************
description = "Testcase_MOSAiC"
file = open(path_config + r"description.txt", "w")
file.write(description)
file.close()
# **********************************************************************************************************************
# Initial layer thickness, timestep, output time and simulation time
# **********************************************************************************************************************
config['dt'] = 20. # time increment [s]]
config['time'] = 0.0 # initial value of time [s]
config['time_out'] = 86400. # time between outputs [s]
config['time_total'] = 55468800. # total length of simulation [s]
# **********************************************************************************************************************
# Time settings needed when input is given
# **********************************************************************************************************************
config['timestep_data'] = 60 # timestep of input data [s]
config['length_input'] = config['time_total'] / 60. + 1 # Length of your input files. Must match with timestep_data
# **********************************************************************************************************************
# Layer settings and allocation
# **********************************************************************************************************************
config['thick_0'] = 0.02
config['Nlayer'] = 80
config['N_active'] = 1
config['N_top'] = 20
config['N_bottom'] = 20
config['N_middle'] = config['Nlayer'] - config['N_top'] - config['N_bottom']
# **********************************************************************************************************************
# Flags
# **********************************************************************************************************************
# ________________________top heat flux____________
config['boundflux_flag'] = 2
config['albedo_flag'] = 2
# ________________________brine_dynamics____________
config['grav_heat_flag'] = 1
config['flush_heat_flag'] = 1
config['flood_flag'] = 2
config['flush_flag'] = 5
config['grav_flag'] = 2
config['harmonic_flag'] = 2
# ________________________Salinity____________
config['prescribe_flag'] = 1
config['salt_flag'] = 1
# ________________________bottom setting______________________
config['turb_flag'] = 2 # was on two in 203
config['bottom_flag'] = 1
config['tank_flag'] = 1
# ________________________snow______________________
config['precip_flag'] = 1
config['freeboard_snow_flag'] = 0 # < Niels, 2017
config['snow_flush_flag'] = 1 # < Niels, 2017
config['styropor_flag'] = 0
config['lab_snow_flag'] = 0
# ________________________debugging_____________________
config['debug_flag'] = 1 # set to 2 for output of all ice layers each timestep
# ________________________bgc_______________________
config['bgc_flag'] = 1
# ________________________initial state_______________________
config['initial_state_flag'] = 1 # 2 if initial state is given
# **********************************************************************************************************************
# Tank and turbulent fluxes settings
# **********************************************************************************************************************
config['tank_depth'] = 0
config['alpha_flux_stable'] = 0
config['alpha_flux_instable'] = 0
# **********************************************************************************************************************
# BGC Settings
# **********************************************************************************************************************
config['N_bgc'] = 2
config['bgc_bottom_1'] = 400
config['bgc_bottom_2'] = 500
# **********************************************************************************************************************
# Construct Input files
# **********************************************************************************************************************
# Set constant inputs
const_inputs = {'T_bottom': -1.8, 'S_bu_bottom': 34,
'fl_q_bottom': 1., 'precip_s':0.}
for input in list(const_inputs.keys()):
data = np.ones(int(config['length_input'])) * const_inputs[input]
np.savetxt(path_input + input + '.txt', data)
# **********************************************************************************************************************
# setting the initial values of the top and only layer - not needed if initial ice properties are given - set to zero
# **********************************************************************************************************************
config['thick_1'] = config['thick_0']
config['m_1'] = config['thick_0'] * rho_l
config['S_abs_1'] = config['m_1'] * const_inputs['S_bu_bottom']
config['H_abs_1'] = config['m_1'] * const_inputs['T_bottom'] * c_l
# **********************************************************************************************************************
# Write init to .json file
# **********************************************************************************************************************
json_object = json.dumps(config, indent=4)
with open(path_config + "config.json", "w") as outfile:
outfile.write(json_object)
...@@ -2,15 +2,10 @@ import json ...@@ -2,15 +2,10 @@ import json
from func_bound_values import * from func_bound_values import *
import os import os
# set wd to build_config_files folder # set wd to the directory of the script
wd = os.getcwd() abspath = os.path.abspath(__file__)
# check if already in correct wd dname = os.path.dirname(abspath)
if wd[-18:] == 'build_config_files': os.chdir(dname)
pass
# if not, change to build_config_files
else:
path = wd + '/Python_files/Code/build_config_files'
os.chdir(path)
# set constants # set constants
rho_l = 1028 rho_l = 1028
...@@ -34,6 +29,7 @@ file.close() ...@@ -34,6 +29,7 @@ file.close()
# ********************************************************************************************************************** # **********************************************************************************************************************
# Initial layer thickness, timestep, output time and simulation time # Initial layer thickness, timestep, output time and simulation time
# ********************************************************************************************************************** # **********************************************************************************************************************
config['start_time'] = '2022-01-01 00:00:00' # start time in YYYY-mm-dd HH:MM:SS
config['dt'] = 1 # time increment [s]] config['dt'] = 1 # time increment [s]]
config['time'] = 0.0 # initial value of time [s] config['time'] = 0.0 # initial value of time [s]
config['time_out'] = 3600 # time between outputs [s] config['time_out'] = 3600 # time between outputs [s]
......
...@@ -2,15 +2,10 @@ import json ...@@ -2,15 +2,10 @@ import json
from func_bound_values import * from func_bound_values import *
import os import os
# set wd to build_config_files folder # set wd to the directory of the script
wd = os.getcwd() abspath = os.path.abspath(__file__)
# check if already in correct wd dname = os.path.dirname(abspath)
if wd[-18:] == 'build_config_files': os.chdir(dname)
pass
# if not, change to build_config_files
else:
path = wd + '/Python_files/Code/build_config_files'
os.chdir(path)
# set constants # set constants
...@@ -35,6 +30,7 @@ file.close() ...@@ -35,6 +30,7 @@ file.close()
# ********************************************************************************************************************** # **********************************************************************************************************************
# Initial layer thickness, timestep, output time and simulation time # Initial layer thickness, timestep, output time and simulation time
# ********************************************************************************************************************** # **********************************************************************************************************************
config['start_time'] = '2019-01-01 00:00:00' # start time in YYYY-mm-dd HH:MM:SS
config['dt'] = 20 # time increment [s]] config['dt'] = 20 # time increment [s]]
config['time'] = 0.0 # initial value of time [s] config['time'] = 0.0 # initial value of time [s]
config['time_out'] = 86400 # time between outputs [s] config['time_out'] = 86400 # time between outputs [s]
...@@ -108,7 +104,7 @@ config['bgc_bottom_2'] = 0 ...@@ -108,7 +104,7 @@ config['bgc_bottom_2'] = 0
# ********************************************************************************************************************** # **********************************************************************************************************************
# Set constant inputs # Set constant inputs
const_inputs = {'T_bottom': -1, 'S_bu_bottom': 34, const_inputs = {'T_bottom': -1, 'S_bu_bottom': 34,
'fl_q_bottom': 10, 'precip_s': 0} 'fl_q_bottom': 1, 'precip_s': 0}
for input in list(const_inputs.keys()): for input in list(const_inputs.keys()):
data = np.ones(config['length_input']) * const_inputs[input] data = np.ones(config['length_input']) * const_inputs[input]
np.savetxt(path_input + input + '.txt', data) np.savetxt(path_input + input + '.txt', data)
...@@ -120,7 +116,7 @@ for input in list(const_inputs.keys()): ...@@ -120,7 +116,7 @@ for input in list(const_inputs.keys()):
config['thick_1'] = config['thick_0'] config['thick_1'] = config['thick_0']
config['m_1'] = config['thick_0'] * rho_l config['m_1'] = config['thick_0'] * rho_l
config['S_abs_1'] = config['m_1'] * const_inputs['S_bu_bottom'] config['S_abs_1'] = config['m_1'] * const_inputs['S_bu_bottom']
config['H_abs_1'] = 0 config['H_abs_1'] = config['m_1'] * const_inputs['T_bottom'] * c_l
# ********************************************************************************************************************** # **********************************************************************************************************************
# Write init to .json file # Write init to .json file
......
...@@ -11,30 +11,26 @@ ...@@ -11,30 +11,26 @@
#Loading modules and setting fonts #Loading modules and setting fonts
import numpy import numpy
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
from matplotlib.dates import DateFormatter
from matplotlib import rc from matplotlib import rc
import matplotlib import matplotlib
#rc('text', usetex=True) import os
#rc('font', size='10') import json
#rc('font', family='serif') import pandas as pd
# Warnings: # Warnings:
# Contours are interpolated from the middle of each layer. This is most visible in thick layers, and in the snow layer where the contour lines only extend to the the middle. # Contours are interpolated from the middle of each layer. This is most visible in thick layers, and in the snow layer where the contour lines only extend to the the middle.
# Settings # Settings
dx = 0.5
timeunit = '[days]'
outputfile = 'pic_TPhiS' outputfile = 'pic_TPhiS'
outputformat = 'png' #e.g. png, jpg, pdf outputformat = 'png' #e.g. png, jpg, pdf
free_flag = 1 #1: freeboard is included, 0:freeboard is not included free_flag = 1 #1: freeboard is included, 0:freeboard is not included
#Contour levels # set wd to the directory of the script
levelsT = ([-10,-5,-3,-1]) abspath = os.path.abspath(__file__)
levelspsi = ([0.1, 0.2]) dname = os.path.dirname(abspath)
levelsS = ([3., 8.]) os.chdir(dname)
#
# Loading data # Loading data
...@@ -45,6 +41,23 @@ thick = numpy.loadtxt("../../../output/dat_thick.dat") ...@@ -45,6 +41,23 @@ thick = numpy.loadtxt("../../../output/dat_thick.dat")
snow = numpy.loadtxt("../../../output/dat_snow.dat") snow = numpy.loadtxt("../../../output/dat_snow.dat")
freeboard = numpy.loadtxt("../../../output/dat_freeboard.dat") freeboard = numpy.loadtxt("../../../output/dat_freeboard.dat")
# Load config file
with open('../../../Run_specifics/config.json') as json_file:
config = json.load(json_file)
# build time axis
offset = pd.DateOffset(seconds=config['time_out'])
time = pd.date_range(config['start_time'], freq=offset, periods=config['time_total']/config['time_out'] + 1).to_series()
dx = config['time_out']/(60*60*24) # get dx in days
timeunit = '[days]'
#Contour levels
levelsT = ([-10,-5,-3,-1])
levelspsi = ([0.1, 0.2])
levelsS = ([3., 8.])
#Setting freeboard to zero if free_flag = 0 #Setting freeboard to zero if free_flag = 0
if free_flag == 0: if free_flag == 0:
freeboard[:] = 0. freeboard[:] = 0.
...@@ -68,9 +81,6 @@ T = numpy.hstack((T_snow,T)) ...@@ -68,9 +81,6 @@ T = numpy.hstack((T_snow,T))
psi_l = numpy.hstack((psi_l_snow,psi_l)) psi_l = numpy.hstack((psi_l_snow,psi_l))
S = numpy.hstack((S_snow,S)) S = numpy.hstack((S_snow,S))
ylen = len(thick[0,:])
xlen = len(thick[:,0])
#Restructuring the data so it can be ploted by pcolor #Restructuring the data so it can be ploted by pcolor
depth = thick*1. depth = thick*1.
depth_contour = thick*1. depth_contour = thick*1.
...@@ -93,7 +103,11 @@ while (i<xlen): ...@@ -93,7 +103,11 @@ while (i<xlen):
j=0 j=0
ireal=ireal+dx ireal=ireal+dx
depth = numpy.column_stack((depth,depth[:,-1]-(depth[:,-1]-depth[:,-2])))
Xgrid = numpy.column_stack((Xgrid,Xgrid[:,-1]))
depth = numpy.vstack((depth, depth[-1,:]))
Xgrid = numpy.vstack((Xgrid, Xgrid[-1,:]))
#Custom colormaps #Custom colormaps
...@@ -202,7 +216,7 @@ c1 = plt.colorbar(pad=0.01) ...@@ -202,7 +216,7 @@ c1 = plt.colorbar(pad=0.01)
c1.set_label(r'T') c1.set_label(r'T')
plt.axis([Xgrid.min(), Xgrid.max(), ymin, ymax]) plt.axis([Xgrid.min(), Xgrid.max(), ymin, ymax])
#ax1.fill_between(Xaxis[:],freeboard[:], snow[:,0]+freeboard[:,],facecolor='white',edgecolor='white') #ax1.fill_between(Xaxis[:],freeboard[:], snow[:,0]+freeboard[:,],facecolor='white',edgecolor='white')
CS1 = plt.contour(Xgrid, depth_contour, T, levelsT,colors='k') CS1 = plt.contour(Xgrid[:-1,:-1], depth_contour, T, levelsT,colors='k')
plt.clabel(CS1, fontsize=9, inline=1,fmt='%1.0f') plt.clabel(CS1, fontsize=9, inline=1,fmt='%1.0f')
plt.plot(Xaxis[:],freeboard[:],'k--') plt.plot(Xaxis[:],freeboard[:],'k--')
plt.ylabel(r'depth [m]') plt.ylabel(r'depth [m]')
...@@ -223,7 +237,7 @@ plt.pcolor(Xgrid,depth,psi_l,cmap=psi_cmap,vmin=zmin,vmax=zmax) ...@@ -223,7 +237,7 @@ plt.pcolor(Xgrid,depth,psi_l,cmap=psi_cmap,vmin=zmin,vmax=zmax)
plt.axis([Xgrid.min(), Xgrid.max(), ymin, ymax]) plt.axis([Xgrid.min(), Xgrid.max(), ymin, ymax])
c2 = plt.colorbar(pad=0.01) c2 = plt.colorbar(pad=0.01)
c2.set_label(r'$\phi_l$') c2.set_label(r'$\phi_l$')
CS2 = plt.contour(Xgrid, depth_contour, psi_l, levelspsi, colors='k') CS2 = plt.contour(Xgrid[:-1,:-1], depth_contour, psi_l, levelspsi, colors='k')
plt.clabel(CS2, fontsize=9, inline=1,fmt='%1.1f') plt.clabel(CS2, fontsize=9, inline=1,fmt='%1.1f')
#ax2.fill_between(Xaxis[:],freeboard[:], snow[:,0]+freeboard[:,],facecolor='white',edgecolor='white') #ax2.fill_between(Xaxis[:],freeboard[:], snow[:,0]+freeboard[:,],facecolor='white',edgecolor='white')
plt.plot(Xaxis[:],freeboard[:],'k--') plt.plot(Xaxis[:],freeboard[:],'k--')
...@@ -244,14 +258,21 @@ plt.pcolor(Xgrid,depth,S,cmap=S_cmap,vmin=zmin,vmax=zmax) ...@@ -244,14 +258,21 @@ plt.pcolor(Xgrid,depth,S,cmap=S_cmap,vmin=zmin,vmax=zmax)
plt.axis([Xgrid.min(), Xgrid.max(), ymin, ymax]) plt.axis([Xgrid.min(), Xgrid.max(), ymin, ymax])
c3 = plt.colorbar(pad=0.01) c3 = plt.colorbar(pad=0.01)
c3.set_label(r'$S_{bu}$') c3.set_label(r'$S_{bu}$')
CS3 = plt.contour(Xgrid, depth_contour, S, levelsS,colors='k') CS3 = plt.contour(Xgrid[:-1,:-1], depth_contour, S, levelsS,colors='k')
plt.clabel(CS3, fontsize=9, inline=1,fmt='%2.0f') plt.clabel(CS3, fontsize=9, inline=1,fmt='%2.0f')
#ax3.fill_between(Xaxis[:],freeboard[:], snow[:,0]+freeboard[:,],facecolor='white',edgecolor='white') #ax3.fill_between(Xaxis[:],freeboard[:], snow[:,0]+freeboard[:,],facecolor='white',edgecolor='white')
plt.plot(Xaxis[:],freeboard[:],'k--') plt.plot(Xaxis[:],freeboard[:],'k--')
plt.ylabel(r'depth [m]') plt.ylabel(r'depth [m]')
plt.xlabel(r'time '+timeunit)
ax3.set_facecolor((0.5,0.5,0.5)) ax3.set_facecolor((0.5,0.5,0.5))
# Set x ticks with times
ticks = ax3.get_xticks() * (60*60*24)
index = (ticks / config['time_out']).astype(int)
times_plot = [str(time[idx].strftime(format='%Y-%m-%d %Hh')) for idx in index]
ax3.set_xticklabels(times_plot)
plt.xticks(rotation=20)
plt.tight_layout()
#Saving and exporting #Saving and exporting
plt.savefig('../../Plots/'+outputfile+'.'+outputformat, dpi=1000) plt.savefig('../../Plots/'+outputfile+'.'+outputformat, dpi=1000)
......
{ {
"dt": 20.0, "start_time": "2020-04-19 12:00:00",
"dt": 1,
"time": 0.0, "time": 0.0,
"time_out": 86400.0, "time_out": 3600,
"time_total": 55468800.0, "time_total": 259200,
"timestep_data": 60, "length_input": 259200.0,
"length_input": 924481.0, "timestep_data": 1,
"thick_0": 0.02, "thick_0": 0.002,
"Nlayer": 80, "Nlayer": 90,
"N_active": 1, "N_active": 1,
"N_top": 20, "N_top": 5,
"N_bottom": 20, "N_bottom": 5,
"N_middle": 40, "N_middle": 80,
"boundflux_flag": 2, "boundflux_flag": 1,
"albedo_flag": 2, "albedo_flag": 2,
"grav_heat_flag": 1, "grav_heat_flag": 1,
"flush_heat_flag": 1, "flush_heat_flag": 1,
"flood_flag": 2, "flood_flag": 2,
"flush_flag": 5, "flush_flag": 1,
"grav_flag": 2, "grav_flag": 2,
"harmonic_flag": 2, "harmonic_flag": 2,
"prescribe_flag": 1, "prescribe_flag": 1,
"salt_flag": 1, "salt_flag": 2,
"turb_flag": 2, "turb_flag": 1,
"bottom_flag": 1, "bottom_flag": 1,
"tank_flag": 1, "tank_flag": 1,
"precip_flag": 1, "precip_flag": 0,
"freeboard_snow_flag": 0, "freeboard_snow_flag": 0,
"snow_flush_flag": 1, "snow_flush_flag": 1,
"styropor_flag": 0, "styropor_flag": 0,
"lab_snow_flag": 0, "lab_snow_flag": 0,
"debug_flag": 1, "debug_flag": 1,
"bgc_flag": 1, "bgc_flag": 2,
"initial_state_flag": 1, "initial_state_flag": 1,
"tank_depth": 0, "tank_depth": 0,
"alpha_flux_stable": 0, "alpha_flux_stable": 0,
...@@ -38,8 +39,8 @@ ...@@ -38,8 +39,8 @@
"N_bgc": 2, "N_bgc": 2,
"bgc_bottom_1": 400, "bgc_bottom_1": 400,
"bgc_bottom_2": 500, "bgc_bottom_2": 500,
"thick_1": 0.02, "thick_1": 0.002,
"m_1": 20.56, "m_1": 2.056,
"S_abs_1": 699.04, "S_abs_1": 69.904,
"H_abs_1": -125827.19999999998 "H_abs_1": -6990.400000000001
} }
\ No newline at end of file
Testcase_MOSAiC Testcase_1
\ No newline at end of file \ No newline at end of file
...@@ -214,5 +214,6 @@ MODULE mo_data ...@@ -214,5 +214,6 @@ MODULE mo_data
INTEGER :: length_input_lab !< Niels, 2017 add: used to allocate lab testcase input arrays in mo_init, set value in testcases INTEGER :: length_input_lab !< Niels, 2017 add: used to allocate lab testcase input arrays in mo_init, set value in testcases
REAL(wp) :: grav_heat_flux_down = 0._wp !< output variable for heat loss at the ice bottom caused by gravity drainage (negative = gain) REAL(wp) :: grav_heat_flux_down = 0._wp !< output variable for heat loss at the ice bottom caused by gravity drainage (negative = gain)
REAL(wp) :: grav_heat_flux_up = 0._wp !< output variable for heat gain at the ice bottom caused by gravity drainage (sea water replacing brine, positive = loss) REAL(wp) :: grav_heat_flux_up = 0._wp !< output variable for heat gain at the ice bottom caused by gravity drainage (sea water replacing brine, positive = loss)
REAL(wp) :: exp_heat = 0._wp
END MODULE mo_data END MODULE mo_data
...@@ -171,7 +171,7 @@ CONTAINS ...@@ -171,7 +171,7 @@ CONTAINS
END IF END IF
END DO END DO
grav_salt = grav_salt - SUM(S_abs(:))
!Influence of summed up upward transport resulting from the downward drainage !Influence of summed up upward transport resulting from the downward drainage
fl_m(1)=0.0_wp fl_m(1)=0.0_wp
...@@ -188,6 +188,7 @@ CONTAINS ...@@ -188,6 +188,7 @@ CONTAINS
CALL mass_transfer (Nlayer,N_active,T,H_abs,S_abs,S_bu,T_bottom,S_bu_bottom,fl_m) CALL mass_transfer (Nlayer,N_active,T,H_abs,S_abs,S_bu,T_bottom,S_bu_bottom,fl_m)
grav_salt = grav_salt - SUM(S_abs(:))
grav_drain = grav_drain+fl_m(N_active+1) grav_drain = grav_drain+fl_m(N_active+1)
!Heatflux correction !Heatflux correction
......
...@@ -269,7 +269,7 @@ CONTAINS ...@@ -269,7 +269,7 @@ CONTAINS
melt_thick_snow = 0.0_wp !< Niels, 2017 add: melt_thick_snow melt_thick_snow = 0.0_wp !< Niels, 2017 add: melt_thick_snow
END IF END IF
exp_heat=exp_heat+SUM(H_abs(:))
!########################################################################################## !##########################################################################################
!Inner layer thermodynamics and Expulsion !Inner layer thermodynamics and Expulsion
!########################################################################################## !##########################################################################################
...@@ -297,7 +297,7 @@ CONTAINS ...@@ -297,7 +297,7 @@ CONTAINS
END DO END DO
END IF END IF
END IF END IF
exp_heat=exp_heat-SUM(H_abs(:))
!########################################################################################## !##########################################################################################
!Raw Output, if debug flag is set to 2 then all layer data is output !Raw Output, if debug flag is set to 2 then all layer data is output
...@@ -336,13 +336,14 @@ CONTAINS ...@@ -336,13 +336,14 @@ CONTAINS
grav_heat_flux_down = grav_heat_flux_down / time_out grav_heat_flux_down = grav_heat_flux_down / time_out
grav_heat_flux_up = grav_heat_flux_up / time_out grav_heat_flux_up = grav_heat_flux_up / time_out
exp_heat = exp_heat / time
!Calling standard output !Calling standard output
CALL output(Nlayer, T, psi_s, psi_l, thick, S_bu, ray, format_T, format_psi, & CALL output(Nlayer, T, psi_s, psi_l, thick, S_bu, ray, format_T, format_psi, &
format_thick, format_snow, freeboard, thick_snow, T_snow, psi_l_snow, psi_s_snow, & format_thick, format_snow, freeboard, thick_snow, T_snow, psi_l_snow, psi_s_snow, &
energy_stored, freshwater, total_resist, thickness, bulk_salin, & energy_stored, freshwater, total_resist, thickness, bulk_salin, &
grav_drain, grav_salt, grav_temp, T2m, T_top, perm, format_perm, flush_v, flush_h, psi_g, & grav_drain, grav_salt, grav_temp, T2m, T_top, perm, format_perm, flush_v, flush_h, psi_g, &
& melt_thick_output, grav_heat_flux_down, grav_heat_flux_up, format_melt) & melt_thick_output, grav_heat_flux_down, grav_heat_flux_up, exp_heat, format_melt)
IF (bgc_flag==2) THEN IF (bgc_flag==2) THEN
CALL output_bgc(Nlayer, N_active, bgc_bottom, N_bgc, bgc_abs, psi_l, thick, m, format_bgc) CALL output_bgc(Nlayer, N_active, bgc_bottom, N_bgc, bgc_abs, psi_l, thick, m, format_bgc)
...@@ -385,6 +386,7 @@ CONTAINS ...@@ -385,6 +386,7 @@ CONTAINS
grav_drain = 0.0_wp grav_drain = 0.0_wp
grav_salt = 0.0_wp grav_salt = 0.0_wp
grav_temp = 0.0_wp grav_temp = 0.0_wp
exp_heat =0.0_wp
grav_heat_flux_down = 0._wp grav_heat_flux_down = 0._wp
grav_heat_flux_up = 0._wp grav_heat_flux_up = 0._wp
melt_thick_output(:) = 0._wp melt_thick_output(:) = 0._wp
......
...@@ -115,14 +115,14 @@ CONTAINS ...@@ -115,14 +115,14 @@ CONTAINS
format_thick,format_snow,freeboard,thick_snow,T_snow,psi_l_snow,psi_s_snow, & format_thick,format_snow,freeboard,thick_snow,T_snow,psi_l_snow,psi_s_snow, &
energy_stored,freshwater,total_resist,thickness,bulk_salin, & energy_stored,freshwater,total_resist,thickness,bulk_salin, &
grav_drain,grav_salt,grav_temp,T2m,T_top,perm,format_perm,flush_v,flush_h,psi_g,melt_thick_output, & grav_drain,grav_salt,grav_temp,T2m,T_top,perm,format_perm,flush_v,flush_h,psi_g,melt_thick_output, &
grav_heat_flux_down, grav_heat_flux_up,format_melt) grav_heat_flux_down, grav_heat_flux_up, exp_heat, format_melt)
INTEGER, INTENT(in) :: Nlayer INTEGER, INTENT(in) :: Nlayer
REAL(wp), DIMENSION(Nlayer), INTENT(in) :: T,psi_s,psi_l,thick,S_bu,perm,flush_v,flush_h,psi_g REAL(wp), DIMENSION(Nlayer), INTENT(in) :: T,psi_s,psi_l,thick,S_bu,perm,flush_v,flush_h,psi_g
REAL(wp), DIMENSION(Nlayer-1), INTENT(in) :: ray REAL(wp), DIMENSION(Nlayer-1), INTENT(in) :: ray
REAL(wp), INTENT(in) :: freeboard,thick_snow,T_snow,psi_l_snow,psi_s_snow,energy_stored,& REAL(wp), INTENT(in) :: freeboard,thick_snow,T_snow,psi_l_snow,psi_s_snow,energy_stored,&
freshwater,thickness,bulk_salin, & freshwater,thickness,bulk_salin, &
total_resist,grav_drain,grav_salt,grav_temp,T2m,T_top, & total_resist,grav_drain,grav_salt,grav_temp,T2m,T_top, &
grav_heat_flux_down, grav_heat_flux_up grav_heat_flux_down, grav_heat_flux_up, exp_heat
REAL(wp), DIMENSION(3), INTENT(in) :: melt_thick_output !< Niels, 2017: 1: accumulated melt_thick, 2: accumulated melt_thick_snow, 3: accumulated top ice thickness variations (recheck 3: in mo_layer_dynamics) REAL(wp), DIMENSION(3), INTENT(in) :: melt_thick_output !< Niels, 2017: 1: accumulated melt_thick, 2: accumulated melt_thick_snow, 3: accumulated top ice thickness variations (recheck 3: in mo_layer_dynamics)
CHARACTER*12000, INTENT(in) :: format_T,format_psi,format_thick,format_snow,format_perm,format_melt CHARACTER*12000, INTENT(in) :: format_T,format_psi,format_thick,format_snow,format_perm,format_melt
...@@ -135,7 +135,7 @@ CONTAINS ...@@ -135,7 +135,7 @@ CONTAINS
WRITE(40,'(F9.3)') freeboard WRITE(40,'(F9.3)') freeboard
WRITE(41,format_snow) thick_snow,T_snow,psi_l_snow,psi_s_snow WRITE(41,format_snow) thick_snow,T_snow,psi_l_snow,psi_s_snow
WRITE(42,'(F15.1,2x,F10.5,2x,F10.5,2x,F10.5,2x,F10.5)')energy_stored,freshwater,total_resist,thickness,bulk_salin WRITE(42,'(F15.1,2x,F10.5,2x,F10.5,2x,F10.5,2x,F10.5)')energy_stored,freshwater,total_resist,thickness,bulk_salin
WRITE(43,'(F9.6,2X,F9.5,2X,F7.3)')grav_drain,grav_salt,grav_temp WRITE(43,'(F9.6,2X,F9.5,2X,F7.3,2X,F13.6)')grav_drain,grav_salt,grav_temp, exp_heat
WRITE(45,*) T2m,T_top WRITE(45,*) T2m,T_top
WRITE(46,format_perm) perm !< Niels, 2017 add: output permeability WRITE(46,format_perm) perm !< Niels, 2017 add: output permeability
WRITE(47,format_perm) flush_v !< Niels, 2017 add: output vertical flushing WRITE(47,format_perm) flush_v !< Niels, 2017 add: output vertical flushing
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment