#include <stdio.h>
#include <string.h>
#include <glib.h>
#include "squall.h"
#include <math.h>
Go to the source code of this file.
Classes | |
struct | Eh_histogram |
struct | Hist_data |
Functions | |
Eh_histogram ** | eh_create_histogram (double dx, gssize n) |
void | eh_destroy_histogram (Eh_histogram **h) |
Eh_histogram ** | make_depth_histogram (double *x, int n_x, double dz, gssize n_z) |
double | get_weibull_deposition_rate (double x, double alpha, double beta) |
double | get_threshold_depth (double wave_length, double wave_height, double wave_period, double grain_size) |
gboolean | squall (Sed_cube p, double time_step_in_years) |
void | add_to_hist (Eh_histogram **hist, gssize bin, double f, gssize ind) |
double | get_erosion_rate_from_profile (Sed_cube p, int i, double h_c, double h_w) |
double | get_shoreface_slope (Sed_cube p, int i_c, int i_w) |
double | get_erosion_rate (double h, double h_w, double h_c, double alpha_sf, double h_wave, double h_wave_fair) |
double | get_erosion_efficiency (double h, double h_w, double h_c) |
double | get_coastal_dissipation (double alpha_sf) |
double | get_coastal_wave_energy (double wave_height_actual, double wave_height_fair) |
double | get_wave_base (double wave_length) |
double | get_breaking_wave_base (double wave_height) |
double | get_deep_water_wave_base (double wave_height) |
int * | get_zone_boundaries (Sed_cube p, double h_w, double h_c) |
double | get_travel_dist (double grain_size_in_m, double depth, double dx) |
double | get_non_dim_travel_dist (double grain_size_in_m) |
double * | get_moveable_grains (double water_depth, double wave_height, double wave_period, Sed_sediment sed, double *is_moveable) |
void add_to_hist | ( | Eh_histogram ** | hist, | |
gssize | bin, | |||
double | f, | |||
gssize | ind | |||
) |
Definition at line 580 of file squall.c.
References Eh_histogram::count, Eh_histogram::data, eh_watch_dbl, eh_watch_int, Eh_histogram::lower_edge, and Eh_histogram::upper_edge.
Referenced by make_depth_histogram().
Eh_histogram ** eh_create_histogram | ( | double | dx, | |
gssize | n | |||
) |
Definition at line 452 of file squall.c.
References Eh_histogram::count, Eh_histogram::data, eh_new, Eh_histogram::lower_edge, and Eh_histogram::upper_edge.
Referenced by make_depth_histogram().
void eh_destroy_histogram | ( | Eh_histogram ** | h | ) |
double get_breaking_wave_base | ( | double | wave_height | ) |
Get the depth of the wave base for a breaking wave.
As per usual, the wave base is taken to be half of the wavelength of a wave. The wave length is assumed to be 7 times its height.
wave_height | The height of incoming waves. |
Definition at line 755 of file squall.c.
References get_wave_base().
double get_coastal_dissipation | ( | double | alpha_sf | ) |
Get the coastal dissipation.
alpha_sf | The slope of the shoreface. |
Definition at line 714 of file squall.c.
References SQUALL_DEFAULT_ALPHA_REF.
Referenced by get_erosion_rate().
double get_coastal_wave_energy | ( | double | wave_height_actual, | |
double | wave_height_fair | |||
) |
double get_deep_water_wave_base | ( | double | wave_height | ) |
Get the depth of the wave base for a deep water wave.
As per usual, the wave base is taken to be half of the wavelength of a wave. The wave length is assumed to be 25 times the wave height.
wave_height | The height of incoming waves. |
Definition at line 769 of file squall.c.
References get_wave_base().
Referenced by squall().
double get_erosion_efficiency | ( | double | h, | |
double | h_w, | |||
double | h_c | |||
) |
Get the erosion efficiency.
h | Water depth. | |
h_w | Water depth of the wave base. | |
h_c | Maximum coastal elevation that is acted on by waves. |
Definition at line 687 of file squall.c.
References eh_require, eh_watch_dbl, and SQUALL_DEFAULT_M.
Referenced by get_erosion_rate().
double get_erosion_rate | ( | double | h, | |
double | h_w, | |||
double | h_c, | |||
double | alpha_sf, | |||
double | h_wave, | |||
double | h_wave_fair | |||
) |
Calculate the rate of erosion.
h | Water depth. | |
h_w | Water depth of the wave base. | |
h_c | Maximum coastal elevation that is acted on by waves. | |
alpha_sf | The slope of the shoreface. | |
h_wave | The current wave height of incoming waves. | |
h_wave_fair | The wave height of waves during calm conditions. |
Definition at line 662 of file squall.c.
References get_coastal_dissipation(), get_erosion_efficiency(), and SQUALL_DEFAULT_C_E.
Referenced by get_erosion_rate_from_profile().
double get_erosion_rate_from_profile | ( | Sed_cube | p, | |
int | i, | |||
double | h_c, | |||
double | h_w | |||
) |
Calculate the erosion rate from a Sed_cube.
p | A pointer to a Sed_cube. | |
i | Index to a column of a Sed_cube. | |
h_c | Maximum coastal elevation that is acted on by waves | |
h_w | Wave height |
Definition at line 622 of file squall.c.
References get_erosion_rate(), sed_cube_water_depth(), and sed_cube_wave_height().
double* get_moveable_grains | ( | double | water_depth, | |
double | wave_height, | |||
double | wave_period, | |||
Sed_sediment | sed, | |||
double * | is_moveable | |||
) |
Determine which grain types are able to move under given ocean conditions.
Use relations of orbital velocity to grain diameter to determine which grain types are able to move at some depth and wave conditions. If a grain type can be moved, its corresponding element in the output array is set to 1, otherwise 0. Currently, only zeros and ones are written to the output array.
This is taken from,
Komar, P.D., 1976. Beach Processes and Sedimentation. Prentice Hall Inc, NJ.
water_depth | Water depth in meters. | |
wave_height | Wave height in meters. | |
wave_period | Wave period in seconds. | |
sed | Type of sediment of the sea bed. | |
is_moveable | Array to store the fraction of each grain type that is able to be moved. If NULL, a newly allocated array is used. |
Definition at line 893 of file squall.c.
References eh_free, eh_new0, M_PI, sed_gravity(), sed_rho_quartz(), sed_rho_sea_water(), sed_sediment_env_n_types(), sed_sediment_n_types(), sed_sediment_property(), and sed_type_grain_size_in_meters().
Referenced by squall().
double get_non_dim_travel_dist | ( | double | grain_size_in_m | ) |
Get the non-dimensional travel distance for a grain size.
Calculate the non-dimensional travel distance for a grain size using the formula of Storms 2003.
grain_size_in_m | Grain diameter in units of meters. |
Definition at line 857 of file squall.c.
References SQUALL_DEFAULT_C_H.
Referenced by get_travel_dist().
double get_shoreface_slope | ( | Sed_cube | p, | |
int | i_c, | |||
int | i_w | |||
) |
Calculate the slope of the shoreface.
p | A pointer to a Sed_cube. | |
i_c | Index to the maximum landward extent of the waves. | |
i_w | Index to the location of the wave base. |
Definition at line 642 of file squall.c.
References sed_cube_col_y(), and sed_cube_water_depth().
double get_threshold_depth | ( | double | wave_length, | |
double | wave_height, | |||
double | wave_period, | |||
double | grain_size | |||
) |
Definition at line 958 of file squall.c.
References M_PI, sed_gravity(), sed_rho_quartz(), and sed_rho_sea_water().
Referenced by squall().
double get_travel_dist | ( | double | grain_size_in_m, | |
double | depth, | |||
double | dx | |||
) |
Get the travel distance for a grain.
The travel distance is clalculated using the equations of Storms 2003. The equation used is dependant on the grid resolution that is used and so a correction is used if the grid spacing is anything other than 50 meters.
grain_size_in_m | Grain diameter in meters. | |
depth | Water depth in meters. | |
dx | Grid spacing in meters. |
Definition at line 832 of file squall.c.
References get_non_dim_travel_dist(), SQUALL_DEFAULT_A, and SQUALL_DEFAULT_Z_L.
Referenced by squall().
double get_wave_base | ( | double | wave_length | ) |
Get the depth of the wave base.
As per usual, the wave base is taken to be half of the wavelength of a wave.
wave_length | The wavelength of incoming waves. |
Definition at line 741 of file squall.c.
Referenced by get_breaking_wave_base(), and get_deep_water_wave_base().
double get_weibull_deposition_rate | ( | double | x, | |
double | alpha, | |||
double | beta | |||
) |
int* get_zone_boundaries | ( | Sed_cube | p, | |
double | h_w, | |||
double | h_c | |||
) |
Get the indices to the zone boundaries from a Sed_cube.
Given a Sed_cube, calculate the indices that mark the boundaries of the six zones in the squall model. The five boundaries are, (1) h_w - Wave base. (2) h_s - Sea level. (3) h_c - Maximum landward extent of wave action. (4) h_l - Seaward extend of lagoon. (5) h_m - Landward extent of lagoon. If a barrier does not exist, then there will be no lagoon and boundaries (4) and (5) will not exist. In such a case, their indices will be zero.
p | A pointer to a Sed_cube. | |
h_w | The water depth of the wave base. | |
h_c | The maximum elevation a wave can act on. |
Definition at line 792 of file squall.c.
References eh_new, sed_cube_col_y(), sed_cube_n_y(), and sed_cube_water_depth().
Referenced by squall().
Eh_histogram ** make_depth_histogram | ( | double * | x, | |
int | n_x, | |||
double | dz, | |||
gssize | n_z | |||
) |
Definition at line 485 of file squall.c.
References add_to_hist(), eh_create_histogram(), eh_require, floor, swap_dbl, and swap_int.
Referenced by squall().
gboolean squall | ( | Sed_cube | p, | |
double | time_step_in_years | |||
) |
Calculate erosion/deposition of a Sed_cube due to waves.
Run the Storms 2003 wave model.
p | A pointer to a Sed_cube. | |
time_step_in_years | The length of time (in years) to run the model for. |
Definition at line 63 of file squall.c.
References Eh_histogram::count, eh_destroy_histogram(), eh_free, eh_free_2, eh_new, eh_new0, eh_new_2, get_deep_water_wave_base(), get_moveable_grains(), get_threshold_depth(), get_travel_dist(), get_weibull_deposition_rate(), get_zone_boundaries(), make_depth_histogram(), S_FACIES_WAVE, sed_cell_add(), sed_cell_add_amount(), sed_cell_destroy(), sed_cell_dup(), sed_cell_fraction(), sed_cell_list_destroy(), sed_cell_list_new(), sed_cell_move(), sed_cell_new(), sed_cell_resize(), sed_cell_separate_fraction(), sed_cell_set_age(), sed_cell_set_facies(), sed_cell_size(), sed_column_add_cell(), sed_column_extract_top(), sed_cube_age_in_years(), sed_cube_col(), sed_cube_n_y(), sed_cube_water_depth(), sed_cube_wave_height(), sed_cube_wave_length(), sed_cube_wave_period(), sed_cube_y_res(), sed_cube_z_res(), sed_sediment_env_n_types(), sed_sediment_property(), sed_type_grain_size_in_meters(), SQUALL_DEFAULT_C_E, and SQUALL_DEFAULT_C_V.
Referenced by main(), and run_squall().