Skip to content

Commit 984704e

Browse files
committed
Goddamn I hate Deltf3d
1 parent 46025fc commit 984704e

20 files changed

+1535
-3035
lines changed

Delft3D_NetCDF_Output_overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,5 +122,5 @@ These can be toggled in the morphology file under output with `StatVelocity: min
122122
|VICWW | Vertical eddy viscosity-3D in sigma point|(time, KMAXOUT, M, N)|
123123
|DICWW | Vertical eddy diffusivity-3D in sigma point|(time, KMAXOUT, M, N)|
124124
|RICH | Richardson number|(time, KMAXOUT, M, N)|
125-
|VICUV | horizontal eddy viscosity in sigma point|(time, KMAXOUT_RESTR, M, N)|
125+
|VICUV | horizontal eddy viscosity in zeta point |(time, KMAXOUT_RESTR, M, N)|
126126
|RCA | Near-bed reference concentration of sediment|(time, LSED, M, N)|

GenerateDepthAndGridFile.ipynb

Lines changed: 11 additions & 1462 deletions
Large diffs are not rendered by default.

GenerateMultipleFlows.ipynb

Lines changed: 138 additions & 47 deletions
Large diffs are not rendered by default.

GenerateMultipleFlowsReplenishment.ipynb

Lines changed: 20 additions & 313 deletions
Large diffs are not rendered by default.

JulesD3D/multiplerunsreplenish.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def makeMultipleRunsReplenishment(template_folder=None, number_of_runs=2, restId
183183
new_mdf_dict['Runtxt'] = diff_comp_run_text
184184

185185
# change the records of the bcc file to have a different composition
186-
with open(replenish_bcc_template_filepath, 'r') as different_compo_bcc_template, open(new_bcc_filename, 'w') as new_bcc_file:
186+
with open(replenish_bcc_template_filepath, 'r') as different_compo_bcc_template, open(new_bcc_filepath, 'w') as new_bcc_file:
187187
lines = different_compo_bcc_template.readlines()
188188
records_line_nrs = []
189189

OverwriteTransportLayer.ipynb

Lines changed: 98 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
{
1111
"cell_type": "code",
12-
"execution_count": 1,
12+
"execution_count": 3,
1313
"metadata": {},
1414
"outputs": [
1515
{
@@ -1253,7 +1253,20 @@
12531253
"text/html": [
12541254
"\n",
12551255
"<link rel=\"stylesheet\" href=\"https://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css\">\n",
1256-
"<style>div.hololayout {\n",
1256+
"<style>div.bk-hbox {\n",
1257+
" display: flex;\n",
1258+
" justify-content: center;\n",
1259+
"}\n",
1260+
"\n",
1261+
"div.bk-hbox div.bk-plot {\n",
1262+
" padding: 8px;\n",
1263+
"}\n",
1264+
"\n",
1265+
"div.bk-hbox div.bk-data-table {\n",
1266+
" padding: 20px;\n",
1267+
"}\n",
1268+
"\n",
1269+
"div.hololayout {\n",
12571270
" display: flex;\n",
12581271
" align-items: center;\n",
12591272
" margin: 0;\n",
@@ -1346,19 +1359,6 @@
13461359
" margin-left: 0.5em;\n",
13471360
" margin-right: 0.5em;\n",
13481361
"}\n",
1349-
"\n",
1350-
"div.bk-hbox {\n",
1351-
" display: flex;\n",
1352-
" justify-content: center;\n",
1353-
"}\n",
1354-
"\n",
1355-
"div.bk-hbox div.bk-plot {\n",
1356-
" padding: 8px;\n",
1357-
"}\n",
1358-
"\n",
1359-
"div.bk-hbox div.bk-data-table {\n",
1360-
" padding: 20px;\n",
1361-
"}\n",
13621362
"</style>\n",
13631363
"\n"
13641364
]
@@ -2234,7 +2234,7 @@
22342234
},
22352235
{
22362236
"cell_type": "code",
2237-
"execution_count": 3,
2237+
"execution_count": 4,
22382238
"metadata": {},
22392239
"outputs": [
22402240
{
@@ -2262,7 +2262,7 @@
22622262
},
22632263
{
22642264
"cell_type": "code",
2265-
"execution_count": 4,
2265+
"execution_count": 19,
22662266
"metadata": {},
22672267
"outputs": [],
22682268
"source": [
@@ -2762,7 +2762,7 @@
27622762
"\n",
27632763
"## `LYRFRAC`: Volume fraction of sediment in layer\n",
27642764
"* Show stuff happening at first layer, opposite of DP_BEDLYR, not sure if it's supposed to be like that. Do thicknesses get pushed to bottom underlayers?\n",
2765-
"* ALL next underlayers have **all zeroes** for all underlayers for all timesteps\n",
2765+
"* ALL next underlayers have **all zeros** for all underlayers for all timesteps\n",
27662766
"\n",
27672767
"## `MSED`: Mass of sediment in layer\n",
27682768
"* The mass depends on the **thickness** of the layer of course! So divide accordingly when moving transport layer into an underlayers\n",
@@ -3020,25 +3020,16 @@
30203020
"# trim.LYRFRAC[last_timestep, silt, slice(-12,-2)].values = ten_stacked_underlayer_volcomp_silt"
30213021
]
30223022
},
3023-
{
3024-
"cell_type": "markdown",
3025-
"metadata": {},
3026-
"source": [
3027-
"# If i \"create\" underlayers, then I need to increase DP_bedlayer too!\n",
3028-
"# If i change DP_BEDLAYER i need to change DPS.isel(time=last_timestep) too\n",
3029-
"Add 5cm to all of DP_BEDLAYER, except 0th of course?\n"
3030-
]
3031-
},
30323023
{
30333024
"cell_type": "code",
30343025
"execution_count": 44,
30353026
"metadata": {},
30363027
"outputs": [],
30373028
"source": [
3038-
"# trim.DPS.isel(time=-1)\n",
3039-
"ten_by_M_by_N = trim.DP_BEDLYR.isel(time=-1, nlyrp1=slice(0,10)).shape\n",
3040-
"ten_by_M_by_N\n",
3041-
"addad_DP_BEDLYRS = np.ones(ten_by_M_by_N) * 0.05"
3029+
"# # trim.DPS.isel(time=-1)\n",
3030+
"# ten_by_M_by_N = trim.DP_BEDLYR.isel(time=-1, nlyrp1=slice(0,10)).shape\n",
3031+
"# ten_by_M_by_N\n",
3032+
"# added_DP_BEDLYRS = np.ones(ten_by_M_by_N) * 0.05"
30423033
]
30433034
},
30443035
{
@@ -3079,7 +3070,7 @@
30793070
}
30803071
],
30813072
"source": [
3082-
"(initial_silt_mass, initial_sand_mass)"
3073+
"# (initial_silt_mass, initial_sand_mass)"
30833074
]
30843075
},
30853076
{
@@ -3203,22 +3194,22 @@
32033194
}
32043195
],
32053196
"source": [
3206-
"# time=last_timestep\n",
3207-
"# 'datashade': True,\n",
3208-
"trim.MSED.isel(LSEDTOT=silt, time=-1).hvplot.quadmesh('XZ', 'YZ',\n",
3209-
" cmap='cividis',\n",
3210-
" clabel=trim.MSED.attrs['units'],\n",
3211-
"# clim=(initial_silt_mass, initial_sand_mass),\n",
3212-
" title=\"SILT\",\n",
3213-
" **plot_settings\n",
3214-
" ) + \\\n",
3215-
"trim.MSED.isel(LSEDTOT=sand, time=-1).hvplot.quadmesh('XZ', 'YZ',\n",
3216-
" cmap='cividis',\n",
3217-
" clabel=trim.MSED.attrs['units'],\n",
3218-
"# clim=(initial_silt_mass, initial_sand_mass),\n",
3219-
" title=\"SAND\",\n",
3220-
" **plot_settings\n",
3221-
" ) "
3197+
"# # time=last_timestep\n",
3198+
"# # 'datashade': True,\n",
3199+
"# trim.MSED.isel(LSEDTOT=silt, time=-1).hvplot.quadmesh('XZ', 'YZ',\n",
3200+
"# cmap='cividis',\n",
3201+
"# clabel=trim.MSED.attrs['units'],\n",
3202+
"# # clim=(initial_silt_mass, initial_sand_mass),\n",
3203+
"# title=\"SILT\",\n",
3204+
"# **plot_settings\n",
3205+
"# ) + \\\n",
3206+
"# trim.MSED.isel(LSEDTOT=sand, time=-1).hvplot.quadmesh('XZ', 'YZ',\n",
3207+
"# cmap='cividis',\n",
3208+
"# clabel=trim.MSED.attrs['units'],\n",
3209+
"# # clim=(initial_silt_mass, initial_sand_mass),\n",
3210+
"# title=\"SAND\",\n",
3211+
"# **plot_settings\n",
3212+
"# ) "
32223213
]
32233214
},
32243215
{
@@ -3230,20 +3221,72 @@
32303221
},
32313222
{
32323223
"cell_type": "code",
3233-
"execution_count": 13,
3224+
"execution_count": 24,
32343225
"metadata": {},
32353226
"outputs": [],
32363227
"source": [
3228+
"\n",
32373229
"zeros_interfaces_shape = trim.W.isel(time=last_timestep).shape\n",
32383230
"zeros_centers_shape = trim.V1.isel(time=last_timestep).shape\n",
32393231
"\n",
3240-
"all_zeroes_centers = np.zeros(zeros_centers_shape)\n",
3241-
"all_zeroes_interfaces = np.zeros(zeros_interfaces_shape)\n",
3232+
"all_zeros_centers = np.zeros(zeros_centers_shape)\n",
3233+
"all_zeros_interfaces = np.zeros(zeros_interfaces_shape)\n",
3234+
"\n",
3235+
"trim['V1'][last_timestep] = all_zeros_centers \n",
3236+
"trim['U1'][last_timestep] = all_zeros_centers\n",
3237+
"trim['WPHY'][last_timestep] = all_zeros_centers\n",
3238+
"trim['W'][last_timestep] = all_zeros_interfaces\n",
3239+
"\n",
3240+
"trim['VICWW'][last_timestep] = all_zeros_interfaces # Vertical eddy viscosity-3D\n",
3241+
"trim['DICWW'][last_timestep] = all_zeros_interfaces # Vertical eddy diffusivity-3D\n",
3242+
"trim['VICUV'][last_timestep] = all_zeros_centers # Horizontal eddy viscosity\n",
3243+
"trim['VICWW'][last_timestep] = all_zeros_interfaces # Vertical eddy viscosity-3D "
3244+
]
3245+
},
3246+
{
3247+
"cell_type": "code",
3248+
"execution_count": 17,
3249+
"metadata": {},
3250+
"outputs": [
3251+
{
3252+
"data": {
3253+
"text/plain": [
3254+
"(132, 182)"
3255+
]
3256+
},
3257+
"execution_count": 17,
3258+
"metadata": {},
3259+
"output_type": "execute_result"
3260+
}
3261+
],
3262+
"source": [
3263+
"water_level_shape = trim.S1.isel(time=0).shape\n",
3264+
"reset_water_level = np.zeros(water_level_shape)\n",
3265+
"\n",
3266+
"trim['S1'][last_timestep] = reset_water_level"
3267+
]
3268+
},
3269+
{
3270+
"cell_type": "code",
3271+
"execution_count": 16,
3272+
"metadata": {},
3273+
"outputs": [
3274+
{
3275+
"data": {
3276+
"text/plain": [
3277+
"(191, 2, 81, 132, 182)"
3278+
]
3279+
},
3280+
"execution_count": 16,
3281+
"metadata": {},
3282+
"output_type": "execute_result"
3283+
}
3284+
],
3285+
"source": [
3286+
"turb_shape = trim.RTUR1.shape\n",
3287+
"reset_turb = np.zeros(turb_shape)\n",
32423288
"\n",
3243-
"trim['V1'][last_timestep] = all_zeroes_centers\n",
3244-
"trim['U1'][last_timestep] = all_zeroes_centers\n",
3245-
"trim['WPHY'][last_timestep] = all_zeroes_centers\n",
3246-
"trim['W'][last_timestep] = all_zeroes_interfaces"
3289+
"trim['RTUR1'][last_timestep] = reset_turb"
32473290
]
32483291
},
32493292
{

0 commit comments

Comments
 (0)