/Users/huttone/Devel/sedflux-new/sedflux/trunk/ew/sed/sed_hydro.h File Reference

#include <stdio.h>
#include <stdlib.h>
#include <glib.h>
#include "utils/eh_types.h"
#include "datadir_path.h"
#include "sed_sediment.h"
#include "sed_cell.h"
#include "sed_hydrotrend.h"

Go to the source code of this file.

Defines

#define SED_HYDRO_ERROR   sed_hydro_error_quark()
#define SED_HYDRO_TEST_FILE   DATADIR "/sedflux/po_daily-be.river"
#define SED_HYDRO_PO_FILE   DATADIR "/sedflux/po_daily-be.river"
#define SED_HYDRO_EEL_FILE   DATADIR "/sedflux/eel_daily-be.river"
#define SED_HYDRO_TEST_INLINE_FILE   DATADIR "/sedflux/po_river.kvf"
#define HYDRO_BUFFER_LEN   (365)
#define HYDRO_N_SIG_VALUES   (10)

Typedefs

typedef Sed_hydrotrend_header *(*) Hydro_read_header_func (Sed_hydro_file)
typedef Sed_hydro(*) Hydro_read_record_func (Sed_hydro_file)
typedef double(*) Hydro_get_val_func (Sed_hydro)

Enumerations

enum  Sed_hydro_error { SED_HYDRO_ERROR_MISSING_LABEL, SED_HYDRO_ERROR_BAD_PARAMETER }
enum  Sed_hydro_file_type {
  SED_HYDRO_INLINE, SED_HYDRO_HYDROTREND, SED_HYDRO_HYDROTREND_BE, SED_HYDRO_HYDROTREND_LE,
  SED_HYDRO_UNKNOWN
}

Functions

 new_handle (Sed_hydro)
 new_handle (Sed_hydro_file)
Sed_hydrotrend_headersed_hydro_read_header (FILE *fp)
Sed_hydrotrend_headersed_hydro_read_header_from_byte_order (FILE *fp, gint order)
Sed_hydro sed_hydro_read_record (FILE *fp, int n_grains)
Sed_hydro sed_hydro_read_record_from_byte_order (FILE *fp, int n_grains, gint order)
gssize sed_hydro_write_record (FILE *fp, Sed_hydro rec, gint order)
gssize sed_hydro_write_record_to_byte_order (FILE *fp, Sed_hydro rec, gint order)
gint sed_hydro_fprint_rec (FILE *fp, Sed_hydro rec, const gchar *label)
void sed_hydro_fprint_default_inline_file (FILE *fp)
gssize sed_hydro_array_fprint (FILE *fp, Sed_hydro *rec_a)
gssize sed_hydro_fprint (FILE *fp, Sed_hydro rec)
Sed_hydro * sed_hydro_scan (const gchar *file, GError **error)
Sed_hydro * sed_hydro_scan_n_records (const gchar *file, gint n_recs, GError **error)
Sed_hydrotrend_headersed_hydro_scan_inline_header (FILE *fp)
gssize sed_hydro_read_n_records (FILE *fp, Sed_hydro *rec, int n_grains, int n_recs)
Sed_hydro sed_hydro_new (gint n_grains)
Sed_hydro sed_hydro_new_from_table (Eh_symbol_table t, GError **error)
gboolean sed_hydro_check (Sed_hydro a, GError **err)
const gchar * sed_hydro_type_to_s (Sed_hydro_file_type t)
Sed_hydro_file_type sed_hydro_str_to_type (const gchar *type_s)
Sed_hydro_file_type sed_hydro_file_guess_type (const gchar *file, GError **error)
Sed_hydro sed_hydro_copy (Sed_hydro dest, Sed_hydro src)
Sed_hydro sed_hydro_dup (Sed_hydro src)
Sed_hydro * sed_hydro_array_dup (Sed_hydro *src)
gboolean sed_hydro_is_same (Sed_hydro a, Sed_hydro b)
Sed_hydro sed_hydro_resize (Sed_hydro a, gssize n)
gssize sed_hydro_size (Sed_hydro a)
Sed_hydro sed_hydro_destroy (Sed_hydro rec)
Sed_hydro * sed_hydro_array_destroy (Sed_hydro *arr)
gssize sed_hydro_write (FILE *fp, Sed_hydro a)
Sed_hydro sed_hydro_read (FILE *fp)
double * sed_hydro_copy_concentration (double *dest, Sed_hydro a)
double sed_hydro_nth_concentration (Sed_hydro a, gssize n)
Sed_hydro sed_hydro_adjust_mass (Sed_hydro a, double f)
double sed_hydro_flow_density (Sed_hydro a, double rho)
gboolean sed_hydro_is_hyperpycnal (Sed_hydro a)
double * sed_hydro_fraction (Sed_hydro a)
double sed_hydro_suspended_concentration (Sed_hydro a)
double sed_hydro_suspended_flux (Sed_hydro a)
double sed_hydro_suspended_volume_flux (Sed_hydro a)
double sed_hydro_water_flux (Sed_hydro a)
double sed_hydro_suspended_load (Sed_hydro a)
double sed_hydro_total_load (Sed_hydro a)
double sed_hydro_array_suspended_load (Sed_hydro *arr)
double sed_hydro_array_total_load (Sed_hydro *arr)
Sed_hydro sed_hydro_set_nth_concentration (Sed_hydro a, gssize n, double val)
Sed_hydro sed_hydro_set_velocity (Sed_hydro a, double val)
Sed_hydro sed_hydro_set_width (Sed_hydro a, double val)
Sed_hydro sed_hydro_set_depth (Sed_hydro a, double val)
Sed_hydro sed_hydro_set_bedload (Sed_hydro a, double val)
Sed_hydro sed_hydro_set_duration (Sed_hydro a, double val)
Sed_hydro sed_hydro_set_time (Sed_hydro a, double t_0)
Sed_hydro * sed_hydro_array_set_time (Sed_hydro *arr, double t_0)
double sed_hydro_duration_in_seconds (Sed_hydro a)
double sed_hydro_velocity (Sed_hydro a)
double sed_hydro_width (Sed_hydro a)
double sed_hydro_depth (Sed_hydro a)
double sed_hydro_bedload (Sed_hydro a)
double sed_hydro_duration (Sed_hydro a)
Sed_hydro sed_hydro_add_cell (Sed_hydro a, const Sed_cell s)
Sed_hydro sed_hydro_subtract_cell (Sed_hydro a, const Sed_cell s)
Sed_hydro sed_hydro_average_records (Sed_hydro *rec, gssize n_recs)
double sed_hydro_sum_durations (Sed_hydro *rec, gssize n_recs)
Sed_hydro * sed_hydro_array_eventize_number (Sed_hydro *rec_a, gssize n_events)
Sed_hydro * sed_hydro_array_eventize_fraction (Sed_hydro *rec_a, double f)
Sed_hydro * sed_hydro_array_eventize_conc (Sed_hydro *rec_a, double c)
Sed_hydro * sed_hydro_array_eventize (Sed_hydro *rec_a, double f, gboolean insert)
Sed_hydro * sed_hydro_process_records (Sed_hydro *rec_a, gssize n_recs, gssize n_sig_values, gboolean insert_mean_values)
Sed_hydro * sed_hydro_array_sort (Sed_hydro *rec_a, GCompareFunc f)
Sed_hydro * sed_hydro_array_sort_by_time (Sed_hydro *arr)
Sed_hydro * sed_hydro_array_sort_by_suspended_load (Sed_hydro *arr)
Sed_hydro * sed_hydro_array_sort_by_total_load (Sed_hydro *arr)
Sed_hydro_file sed_hydro_file_set_wrap (Sed_hydro_file fp, gboolean wrap_is_on)
Sed_hydro_file sed_hydro_file_set_buffer_length (Sed_hydro_file fp, gssize len)
Sed_hydro_file sed_hydro_file_set_sig_values (Sed_hydro_file fp, int n_sig_values)
Sed_hydrotrend_headersed_hydro_file_header (Sed_hydro_file fp)
Sed_hydro sed_hydro_file_read_record (Sed_hydro_file fp)
Sed_hydro_file sed_hydro_file_new (const char *filename, Sed_hydro_file_type type, gboolean buffer_is_on, gboolean wrap_is_on, GError **error)
Sed_hydro_file sed_hydro_file_destroy (Sed_hydro_file fp)
Sed_hydro * sed_hydro_file_fill_buffer (Sed_hydro_file fp)


Define Documentation

#define HYDRO_BUFFER_LEN   (365)

Definition at line 69 of file sed_hydro.h.

Referenced by sed_hydro_file_new().

#define HYDRO_N_SIG_VALUES   (10)

Definition at line 70 of file sed_hydro.h.

Referenced by sed_hydro_file_new().

#define SED_HYDRO_EEL_FILE   DATADIR "/sedflux/eel_daily-be.river"

Definition at line 51 of file sed_hydro.h.

#define SED_HYDRO_ERROR   sed_hydro_error_quark()

Definition at line 40 of file sed_hydro.h.

Referenced by sed_hydro_check().

#define SED_HYDRO_PO_FILE   DATADIR "/sedflux/po_daily-be.river"

Definition at line 50 of file sed_hydro.h.

#define SED_HYDRO_TEST_FILE   DATADIR "/sedflux/po_daily-be.river"

Definition at line 49 of file sed_hydro.h.

#define SED_HYDRO_TEST_INLINE_FILE   DATADIR "/sedflux/po_river.kvf"

Definition at line 52 of file sed_hydro.h.

Referenced by sed_hydro_scan_n_records().


Typedef Documentation

typedef double(*) Hydro_get_val_func(Sed_hydro)

Definition at line 95 of file sed_hydro.h.

typedef Sed_hydrotrend_header*(*) Hydro_read_header_func(Sed_hydro_file)

Definition at line 93 of file sed_hydro.h.

typedef Sed_hydro(*) Hydro_read_record_func(Sed_hydro_file)

Definition at line 94 of file sed_hydro.h.


Enumeration Type Documentation

enum Sed_hydro_error

Enumerator:
SED_HYDRO_ERROR_MISSING_LABEL 
SED_HYDRO_ERROR_BAD_PARAMETER 

Definition at line 33 of file sed_hydro.h.

enum Sed_hydro_file_type

Enumerator:
SED_HYDRO_INLINE 
SED_HYDRO_HYDROTREND 
SED_HYDRO_HYDROTREND_BE 
SED_HYDRO_HYDROTREND_LE 
SED_HYDRO_UNKNOWN 

Definition at line 72 of file sed_hydro.h.


Function Documentation

new_handle ( Sed_hydro_file   ) 

new_handle ( Sed_hydro   ) 

Sed_hydro sed_hydro_add_cell ( Sed_hydro  a,
const Sed_cell  s 
)

Add a cell of sediment to river discharge

Add sediment to river discharge.

Parameters:
a A Sed_hydro discharge record
s A Sed_cell to add
volume_in_m3 Volume (in m^3) of the Sed_cell
Returns:
The input Sed_hydro record

Definition at line 1058 of file sed_hydro.c.

References eh_require, eh_return_val_if_fail, sed_cell_fraction(), sed_cell_n_types(), sed_cell_size(), sed_hydro_duration_in_seconds(), sed_hydro_size(), sed_sediment_env(), sed_sediment_n_types(), sed_sediment_type(), and sed_type_rho_sat().

Referenced by erode_river_profile(), and run_river().

Sed_hydro sed_hydro_adjust_mass ( Sed_hydro  a,
double  f 
)

Definition at line 943 of file sed_hydro.c.

References eh_lower_bound, and sed_hydro_size().

Referenced by sed_river_adjust_mass().

Sed_hydro* sed_hydro_array_destroy ( Sed_hydro *  arr  ) 

Definition at line 630 of file sed_hydro.c.

References eh_free, and sed_hydro_destroy().

Referenced by main(), and sed_hydro_file_guess_type().

Sed_hydro* sed_hydro_array_dup ( Sed_hydro *  src  ) 

Definition at line 543 of file sed_hydro.c.

References eh_new, and sed_hydro_dup().

Referenced by sed_hydro_array_eventize().

Sed_hydro* sed_hydro_array_eventize ( Sed_hydro *  rec_a,
double  f,
gboolean  insert_mean_values 
)

Reduce a Sed_hydro array to a number of events based on fraction of total sediment load

Parameters:
rec_a A NULL-terminated Sed_hydro array
f Fraction of total sediment load to retain
insert_mean_values If TRUE, mean values are inserted between events
Returns:
A newly-allocated, NULL-terminated Sed_hydro array

Definition at line 1324 of file sed_hydro.c.

References eh_compare_dbl(), eh_free, eh_require, sed_hydro_array_dup(), sed_hydro_array_sort_by_suspended_load(), sed_hydro_array_suspended_load(), sed_hydro_process_records(), and sed_hydro_suspended_load().

Sed_hydro* sed_hydro_array_eventize_conc ( Sed_hydro *  rec_a,
double  c 
)

Definition at line 1273 of file sed_hydro.c.

References sed_hydro_flow_density(), sed_hydro_process_records(), and sed_rho_fresh_water().

Referenced by main().

Sed_hydro* sed_hydro_array_eventize_fraction ( Sed_hydro *  rec_a,
double  fraction 
)

Reduce a Sed_hydro array to a number of events based on a fraction of the total events

Parameters:
rec_a A NULL-terminated Sed_hydro array
fraction Fraction of events to retain
Returns:
A newly-allocated, NULL-terminated Sed_hydro array

Definition at line 1252 of file sed_hydro.c.

References sed_hydro_process_records().

Sed_hydro* sed_hydro_array_eventize_number ( Sed_hydro *  rec_a,
gssize  n_events 
)

Reduce a Sed_hydro array to a number of events

Parameters:
rec_a A NULL-terminated Sed_hydro array
n_events Number of events to retain
Returns:
A newly-allocated, NULL-terminated Sed_hydro array

Definition at line 1234 of file sed_hydro.c.

References sed_hydro_process_records().

gssize sed_hydro_array_fprint ( FILE *  fp,
Sed_hydro *  rec_a 
)

Definition at line 81 of file sed_hydro.c.

References eh_return_val_if_fail, and sed_hydro_fprint().

Sed_hydro* sed_hydro_array_set_time ( Sed_hydro *  arr,
double  t_0 
)

Definition at line 998 of file sed_hydro.c.

References sed_hydro_duration(), and sed_hydro_set_time().

Referenced by sed_hydro_scan_n_records().

Sed_hydro* sed_hydro_array_sort ( Sed_hydro *  rec_a,
GCompareFunc  f 
)

Definition at line 1434 of file sed_hydro.c.

Referenced by sed_hydro_array_sort_by_suspended_load(), sed_hydro_array_sort_by_time(), and sed_hydro_array_sort_by_total_load().

Sed_hydro* sed_hydro_array_sort_by_suspended_load ( Sed_hydro *  arr  ) 

Definition at line 1465 of file sed_hydro.c.

References sed_hydro_array_sort(), and sed_hydro_cmp_suspended_load().

Referenced by sed_hydro_array_eventize().

Sed_hydro* sed_hydro_array_sort_by_time ( Sed_hydro *  arr  ) 

Definition at line 1459 of file sed_hydro.c.

References sed_hydro_array_sort(), and sed_hydro_cmp_time().

Sed_hydro* sed_hydro_array_sort_by_total_load ( Sed_hydro *  arr  ) 

Definition at line 1471 of file sed_hydro.c.

References sed_hydro_array_sort(), and sed_hydro_cmp_total_load().

double sed_hydro_array_suspended_load ( Sed_hydro *  arr  ) 

Definition at line 904 of file sed_hydro.c.

References sed_hydro_suspended_load().

Referenced by sed_hydro_array_eventize().

double sed_hydro_array_total_load ( Sed_hydro *  arr  ) 

Definition at line 919 of file sed_hydro.c.

References sed_hydro_total_load().

Sed_hydro sed_hydro_average_records ( Sed_hydro *  rec,
gssize  n_recs 
)

Definition at line 1147 of file sed_hydro.c.

References eh_free, eh_new0, eh_return_val_if_fail, sed_hydro_dup(), sed_hydro_new(), and sed_hydro_water_flux().

Referenced by sed_hydro_process_records().

double sed_hydro_bedload ( Sed_hydro  a  ) 

Definition at line 1030 of file sed_hydro.c.

Referenced by main(), run_river(), sed_hydro_check(), sed_hydrotrend_write_record_to_byte_order(), and sed_river_split_discharge().

gboolean sed_hydro_check ( Sed_hydro  a,
GError **  err 
)

Definition at line 303 of file sed_hydro.c.

References eh_check_to_s(), eh_dbl_array_each_ge(), eh_free, eh_return_val_if_fail, sed_hydro_bedload(), sed_hydro_depth(), sed_hydro_duration(), SED_HYDRO_ERROR, SED_HYDRO_ERROR_BAD_PARAMETER, sed_hydro_velocity(), and sed_hydro_width().

Referenced by inflow_flood_from_cell(), sakura_flood_from_cell(), and sed_hydro_scan_n_records().

Sed_hydro sed_hydro_copy ( Sed_hydro  dest,
Sed_hydro  src 
)

Definition at line 514 of file sed_hydro.c.

References eh_return_val_if_fail, sed_hydro_new(), sed_hydro_resize(), and sed_hydro_size().

Referenced by sed_hydro_dup(), sed_river_copy(), and sed_river_set_hydro().

double* sed_hydro_copy_concentration ( double *  dest,
Sed_hydro  a 
)

Copy the sdiment concentration from a Sed_hydro

Parameters:
dest A poiter to the location to put the concentration (or NULL)
a A Sed_hydro containing the concentrations to copy.
Returns:
A pointer to the copied data

Definition at line 750 of file sed_hydro.c.

References eh_new.

Referenced by plume_wrapper(), run_plume_hypo(), and sed_hydro_fraction().

double sed_hydro_depth ( Sed_hydro  a  ) 

Definition at line 1025 of file sed_hydro.c.

Referenced by inflow_set_flood_data(), main(), plume_centerline_deposit(), plume_width_averaged_deposit(), plume_width_averaged_deposit_num(), plume_wrapper(), run_plume_hypo(), run_river(), sakura_sed_set_flood_data(), sakura_set_flood_data(), sed_hydro_check(), sed_hydrotrend_write_record_to_byte_order(), and sed_river_depth().

Sed_hydro sed_hydro_destroy ( Sed_hydro  rec  ) 

Definition at line 618 of file sed_hydro.c.

References eh_free.

Referenced by erode_river_profile(), inflow_scan_flood_file(), main(), run_plume_hyper_inflow(), run_plume_hyper_sakura(), run_plume_hypo(), run_river(), sakura_scan_flood_file(), sed_hydro_array_destroy(), sed_hydro_file_destroy(), sed_hydro_file_fill_buffer(), sed_hydro_new_from_table(), sed_hydro_resize(), sed_hydro_scan_n_records(), and sed_river_destroy().

Sed_hydro sed_hydro_dup ( Sed_hydro  src  ) 

Definition at line 537 of file sed_hydro.c.

References sed_hydro_copy().

Referenced by sed_hydro_array_dup(), sed_hydro_average_records(), sed_hydro_process_records(), and sed_river_hydro().

double sed_hydro_duration ( Sed_hydro  a  ) 

Definition at line 1036 of file sed_hydro.c.

Referenced by main(), plume_centerline_deposit(), plume_width_averaged_deposit(), plume_width_averaged_deposit_num(), sed_hydro_array_set_time(), sed_hydro_check(), sed_hydro_duration_in_seconds(), sed_inflow(), and sed_sakura().

double sed_hydro_duration_in_seconds ( Sed_hydro  a  ) 

Definition at line 1042 of file sed_hydro.c.

References S_SECONDS_PER_DAY, and sed_hydro_duration().

Referenced by inflow_set_flood_data(), run_river(), sakura_sed_set_flood_data(), sakura_set_flood_data(), sed_hydro_add_cell(), sed_hydro_subtract_cell(), sed_hydro_suspended_load(), and sed_hydro_total_load().

Sed_hydro_file sed_hydro_file_destroy ( Sed_hydro_file  fp  ) 

Destroy a Sed_hydro_file

Parameters:
fp A Sed_hydro_file to destroy
Returns:
NULL.

Definition at line 1759 of file sed_hydro.c.

References eh_free, eh_return_val_if_fail, and sed_hydro_destroy().

Referenced by destroy_river(), and main().

Sed_hydro* sed_hydro_file_fill_buffer ( Sed_hydro_file  fp  ) 

Definition at line 1872 of file sed_hydro.c.

References eh_new, sed_hydro_destroy(), and sed_hydrotrend_read_next_rec().

Sed_hydro_file_type sed_hydro_file_guess_type ( const gchar *  file,
GError **  error 
)

Definition at line 385 of file sed_hydro.c.

References eh_fopen_error(), eh_return_val_if_fail, sed_hydro_array_destroy(), SED_HYDRO_HYDROTREND_BE, SED_HYDRO_HYDROTREND_LE, SED_HYDRO_INLINE, sed_hydro_scan_n_records(), SED_HYDRO_UNKNOWN, and sed_hydrotrend_read_n_recs().

Referenced by init_river().

Sed_hydrotrend_header* sed_hydro_file_header ( Sed_hydro_file  fp  ) 

Definition at line 1637 of file sed_hydro.c.

Sed_hydro_file sed_hydro_file_new ( const char *  filename,
Sed_hydro_file_type  type,
gboolean  buffer_is_on,
gboolean  wrap_is_on,
GError **  error 
)

Create a new Sed_hydro_file

Parameters:
filename The name of the Sed_hydro_file
type The file type.
wrap_is_on If TRUE, when EOF is encountered, the file is rewound
Returns:
A new Sed_hydro_file. Use sed_hydro_file_destroy to free.

Definition at line 1657 of file sed_hydro.c.

References eh_fopen_error(), eh_free, eh_new0, eh_require, eh_require_not_reached, HYDRO_BUFFER_LEN, HYDRO_N_SIG_VALUES, NEW_OBJECT, SED_HYDRO_HYDROTREND, SED_HYDRO_HYDROTREND_BE, SED_HYDRO_HYDROTREND_LE, and SED_HYDRO_INLINE.

Referenced by init_river_data(), and main().

Sed_hydro sed_hydro_file_read_record ( Sed_hydro_file  fp  ) 

Definition at line 1643 of file sed_hydro.c.

Referenced by main(), and run_river().

Sed_hydro_file sed_hydro_file_set_buffer_length ( Sed_hydro_file  fp,
gssize  len 
)

Definition at line 1619 of file sed_hydro.c.

Referenced by main().

Sed_hydro_file sed_hydro_file_set_sig_values ( Sed_hydro_file  fp,
int  n_sig_values 
)

Definition at line 1631 of file sed_hydro.c.

Referenced by main().

Sed_hydro_file sed_hydro_file_set_wrap ( Sed_hydro_file  fp,
gboolean  wrap_is_on 
)

Definition at line 1613 of file sed_hydro.c.

double sed_hydro_flow_density ( Sed_hydro  a,
double  rho 
)

The fluid density including suspended sediment

Parameters:
a A Sed_hydro
rho Density of the fluid without sediment
Returns:
The density of the fluid (kg/m^3)

Definition at line 776 of file sed_hydro.c.

References sed_hydro_suspended_concentration().

Referenced by inflow_set_flood_data(), sakura_sed_set_flood_data(), sakura_set_flood_data(), sed_hydro_array_eventize_conc(), sed_hydro_is_hyperpycnal(), and sed_river_concentration().

gssize sed_hydro_fprint ( FILE *  fp,
Sed_hydro  rec 
)

Definition at line 104 of file sed_hydro.c.

References eh_return_val_if_fail.

Referenced by main(), sed_hydro_array_fprint(), and sed_river_fprint().

void sed_hydro_fprint_default_inline_file ( FILE *  fp  ) 

Definition at line 72 of file sed_hydro.c.

References DEFAULT_HYDRO_INLINE_FILE.

gint sed_hydro_fprint_rec ( FILE *  fp,
Sed_hydro  rec,
const gchar *  label 
)

Definition at line 687 of file sed_hydro.c.

References eh_return_val_if_fail.

double* sed_hydro_fraction ( Sed_hydro  a  ) 

Definition at line 797 of file sed_hydro.c.

References eh_dbl_array_mult(), eh_return_val_if_fail, sed_hydro_copy_concentration(), sed_hydro_size(), and sed_hydro_suspended_concentration().

Referenced by inflow_set_flood_data(), sakura_sed_set_flood_data(), and sakura_set_flood_data().

gboolean sed_hydro_is_hyperpycnal ( Sed_hydro  a  ) 

Definition at line 782 of file sed_hydro.c.

References eh_require, sed_hydro_flow_density(), sed_rho_fresh_water(), and sed_rho_sea_water().

Referenced by sed_river_is_hyperpycnal().

gboolean sed_hydro_is_same ( Sed_hydro  a,
Sed_hydro  b 
)

Compare two Sed_hydro values

Note that this does not compare the times of the Sed_hydro values.

Parameters:
a A Sed_hydro
b A Sed_hydro
Returns:
TRUE if both values are the same

Definition at line 572 of file sed_hydro.c.

References eh_compare_dbl(), and eh_return_val_if_fail.

Sed_hydro sed_hydro_new ( gint  n_grains  ) 

Create a new Sed_hydro

Parameters:
n_grains The number of suspended grain sizes
Returns:
A newly-created Sed_hydro. Use sed_hydro_destroy to free.

Definition at line 491 of file sed_hydro.c.

References eh_new0, and NEW_OBJECT.

Referenced by discharge_to_hydro_record(), inflow_flood_from_cell(), sakura_flood_from_cell(), sed_hydro_average_records(), sed_hydro_copy(), sed_hydro_new_from_table(), sed_hydro_read(), sed_hydro_resize(), and sed_hydrotrend_read_next_rec_from_byte_order().

Sed_hydro sed_hydro_new_from_table ( Eh_symbol_table  t,
GError **  error 
)

Create a Sed_hydro, initializing it with a symbol table

Parameters:
t An Eh_symbol_table with the initialization data.
error A return location for errors.
Returns:
A newly-created Sed_hydro.

Definition at line 259 of file sed_hydro.c.

References eh_free, eh_return_val_if_fail, eh_symbol_table_dbl_array_value(), eh_symbol_table_dbl_value(), eh_symbol_table_require_labels(), eh_symbol_table_time_value(), S_DAYS_PER_YEAR, sed_hydro_destroy(), SED_HYDRO_LABEL_BEDLOAD, SED_HYDRO_LABEL_DEPTH, SED_HYDRO_LABEL_DURATION, SED_HYDRO_LABEL_SUSPENDED_CONC, SED_HYDRO_LABEL_VELOCITY, SED_HYDRO_LABEL_WIDTH, and sed_hydro_new().

Referenced by sed_hydro_scan_n_records().

double sed_hydro_nth_concentration ( Sed_hydro  a,
gssize  n 
)

Definition at line 759 of file sed_hydro.c.

References eh_return_val_if_fail.

Referenced by plume_centerline_deposit(), plume_width_averaged_deposit(), plume_width_averaged_deposit_num(), run_plume_hypo(), run_river(), and sed_hydrotrend_write_record_to_byte_order().

Sed_hydro* sed_hydro_process_records ( Sed_hydro *  rec_a,
gssize  n_recs,
gssize  n_sig_values,
gboolean  insert_mean_values 
)

Definition at line 1477 of file sed_hydro.c.

References cmp_hydro_sort_inds(), cmp_hydro_sort_vals(), eh_free, eh_free_slist_data(), eh_new, eh_return_val_if_fail, eh_strv_append(), Hydro_sort_st::ind, sed_hydro_average_records(), sed_hydro_dup(), sed_hydro_suspended_flux(), and Hydro_sort_st::val.

Referenced by sed_hydro_array_eventize(), sed_hydro_array_eventize_conc(), sed_hydro_array_eventize_fraction(), and sed_hydro_array_eventize_number().

Sed_hydro sed_hydro_read ( FILE *  fp  ) 

Definition at line 717 of file sed_hydro.c.

References sed_hydro_new(), and sed_hydro_resize().

Sed_hydrotrend_header* sed_hydro_read_header ( FILE *  fp  ) 

Sed_hydrotrend_header* sed_hydro_read_header_from_byte_order ( FILE *  fp,
gint  order 
)

gssize sed_hydro_read_n_records ( FILE *  fp,
Sed_hydro *  rec,
int  n_grains,
int  n_recs 
)

Sed_hydro sed_hydro_read_record ( FILE *  fp,
int  n_grains 
)

Sed_hydro sed_hydro_read_record_from_byte_order ( FILE *  fp,
int  n_grains,
gint  order 
)

Sed_hydro sed_hydro_resize ( Sed_hydro  a,
gssize  n 
)

Definition at line 586 of file sed_hydro.c.

References eh_renew, sed_hydro_destroy(), and sed_hydro_new().

Referenced by sed_hydro_copy(), and sed_hydro_read().

Sed_hydro* sed_hydro_scan ( const gchar *  file,
GError **  error 
)

Scan the hydro records from a file.

Parameters:
file The name of the file to scan
error A return location for errors.
Returns:
A NULL-terminated array of Sed_hydro's.

Definition at line 160 of file sed_hydro.c.

References sed_hydro_scan_n_records().

Referenced by avulsion_full(), inflow_scan_flood_file(), main(), and sakura_scan_flood_file().

Sed_hydrotrend_header* sed_hydro_scan_inline_header ( FILE *  fp  ) 

Sed_hydro* sed_hydro_scan_n_records ( const gchar *  file,
gint  n_recs,
GError **  error 
)

Definition at line 166 of file sed_hydro.c.

References eh_free, eh_key_file_destroy(), eh_key_file_pop_group(), eh_key_file_scan(), eh_key_file_size(), eh_new0, eh_require, eh_symbol_table_destroy(), sed_hydro_array_set_time(), sed_hydro_check(), sed_hydro_destroy(), sed_hydro_new_from_table(), and SED_HYDRO_TEST_INLINE_FILE.

Referenced by sed_hydro_file_guess_type(), and sed_hydro_scan().

Sed_hydro sed_hydro_set_bedload ( Sed_hydro  a,
double  val 
)

Definition at line 975 of file sed_hydro.c.

Referenced by discharge_to_hydro_record(), inflow_flood_from_cell(), sakura_flood_from_cell(), sed_hydrotrend_read_next_rec_from_byte_order(), sed_river_set_bedload(), and sed_river_split_discharge().

Sed_hydro sed_hydro_set_depth ( Sed_hydro  a,
double  val 
)

Definition at line 969 of file sed_hydro.c.

Referenced by discharge_to_hydro_record(), inflow_flood_from_cell(), sakura_flood_from_cell(), sed_hydrotrend_read_next_rec_from_byte_order(), and sed_river_set_depth().

Sed_hydro sed_hydro_set_duration ( Sed_hydro  a,
double  val 
)

Definition at line 982 of file sed_hydro.c.

References eh_require.

Referenced by inflow_flood_from_cell(), main(), and sakura_flood_from_cell().

Sed_hydro sed_hydro_set_nth_concentration ( Sed_hydro  a,
gssize  n,
double  val 
)

Definition at line 931 of file sed_hydro.c.

References eh_return_val_if_fail.

Referenced by discharge_to_hydro_record(), inflow_flood_from_cell(), sakura_flood_from_cell(), and sed_hydrotrend_read_next_rec_from_byte_order().

Sed_hydro sed_hydro_set_time ( Sed_hydro  a,
double  t_0 
)

Definition at line 990 of file sed_hydro.c.

References eh_require.

Referenced by sed_hydro_array_set_time().

Sed_hydro sed_hydro_set_velocity ( Sed_hydro  a,
double  val 
)

Definition at line 957 of file sed_hydro.c.

Referenced by discharge_to_hydro_record(), inflow_flood_from_cell(), sakura_flood_from_cell(), sed_hydrotrend_read_next_rec_from_byte_order(), and sed_river_set_velocity().

Sed_hydro sed_hydro_set_width ( Sed_hydro  a,
double  val 
)

Definition at line 963 of file sed_hydro.c.

Referenced by discharge_to_hydro_record(), inflow_flood_from_cell(), sakura_flood_from_cell(), sed_hydrotrend_read_next_rec_from_byte_order(), sed_river_set_width(), and sed_river_split_discharge().

gssize sed_hydro_size ( Sed_hydro  a  ) 

Definition at line 612 of file sed_hydro.c.

References eh_require.

Referenced by inflow_flood_from_cell(), inflow_set_flood_data(), plume_wrapper(), run_river(), sakura_flood_from_cell(), sakura_sed_set_flood_data(), sakura_set_flood_data(), sed_hydro_add_cell(), sed_hydro_adjust_mass(), sed_hydro_copy(), sed_hydro_fraction(), sed_hydro_subtract_cell(), sed_hydrotrend_write(), and sed_hydrotrend_write_record_to_byte_order().

Sed_hydro_file_type sed_hydro_str_to_type ( const gchar *  type_s  ) 

Definition at line 366 of file sed_hydro.c.

References SED_HYDRO_HYDROTREND, SED_HYDRO_INLINE, and SED_HYDRO_UNKNOWN.

Referenced by init_river().

Sed_hydro sed_hydro_subtract_cell ( Sed_hydro  a,
const Sed_cell  s 
)

Definition at line 1100 of file sed_hydro.c.

References eh_lower_bound, eh_require, eh_return_val_if_fail, sed_cell_n_types(), sed_cell_nth_fraction(), sed_cell_size(), sed_hydro_duration_in_seconds(), sed_hydro_size(), sed_sediment_env(), sed_sediment_n_types(), sed_sediment_type(), and sed_type_rho_sat().

Referenced by run_river().

double sed_hydro_sum_durations ( Sed_hydro *  rec,
gssize  n_recs 
)

Definition at line 1200 of file sed_hydro.c.

References eh_return_val_if_fail.

double sed_hydro_suspended_concentration ( Sed_hydro  a  ) 

Definition at line 827 of file sed_hydro.c.

References eh_return_val_if_fail.

Referenced by get_paola_diffusion(), sed_hydro_flow_density(), sed_hydro_fraction(), and sed_hydro_nth_fraction().

double sed_hydro_suspended_flux ( Sed_hydro  a  ) 

Mass flux of suspended sediment

Parameters:
a A Sed_hydro
Returns:
The mass flux in units of kg/s

Definition at line 849 of file sed_hydro.c.

References eh_return_val_if_fail.

Referenced by inflow_flood_from_cell(), main(), run_plume_hypo(), run_river(), sakura_flood_from_cell(), sed_hydro_process_records(), and sed_hydro_suspended_load().

double sed_hydro_suspended_load ( Sed_hydro  a  ) 

Definition at line 890 of file sed_hydro.c.

References eh_return_val_if_fail, sed_hydro_duration_in_seconds(), and sed_hydro_suspended_flux().

Referenced by main(), run_plume_hyper_inflow(), run_plume_hyper_sakura(), run_plume_hypo(), sed_hydro_array_eventize(), sed_hydro_array_suspended_load(), sed_hydro_cmp_suspended_load(), sed_hydro_total_load(), and sed_river_suspended_load().

double sed_hydro_suspended_volume_flux ( Sed_hydro  a  ) 

Definition at line 865 of file sed_hydro.c.

References eh_return_val_if_fail, sed_sediment_env(), sed_sediment_type(), and sed_type_rho_sat().

double sed_hydro_total_load ( Sed_hydro  a  ) 

Definition at line 897 of file sed_hydro.c.

References eh_return_val_if_fail, sed_hydro_duration_in_seconds(), and sed_hydro_suspended_load().

Referenced by run_river(), sed_hydro_array_total_load(), sed_hydro_cmp_total_load(), and sed_river_sediment_load().

const gchar* sed_hydro_type_to_s ( Sed_hydro_file_type  t  ) 

Definition at line 349 of file sed_hydro.c.

References __hydro_hydrotrend_be_type_s, __hydro_hydrotrend_le_type_s, __hydro_hydrotrend_type_s, __hydro_inline_type_s, __hydro_unknown_type_s, SED_HYDRO_HYDROTREND, SED_HYDRO_HYDROTREND_BE, SED_HYDRO_HYDROTREND_LE, and SED_HYDRO_INLINE.

Referenced by init_river().

double sed_hydro_velocity ( Sed_hydro  a  ) 

Definition at line 1015 of file sed_hydro.c.

Referenced by inflow_set_flood_data(), main(), plume_centerline_inv(), plume_inv(), plume_non_dim_lambda(), plume_width_averaged_inv(), plume_wrapper(), run_plume_hypo(), run_river(), sakura_sed_set_flood_data(), sakura_set_flood_data(), sed_hydro_check(), sed_hydrotrend_write_record_to_byte_order(), sed_river_bedload(), and sed_river_velocity().

double sed_hydro_water_flux ( Sed_hydro  a  ) 

Definition at line 883 of file sed_hydro.c.

References eh_return_val_if_fail.

Referenced by get_paola_diffusion(), inflow_set_flood_data(), main(), plume_wrapper(), run_plume_hypo(), sakura_sed_set_flood_data(), sakura_set_flood_data(), sed_hydro_average_records(), and sed_river_water_flux().

double sed_hydro_width ( Sed_hydro  a  ) 

Definition at line 1020 of file sed_hydro.c.

Referenced by diffuse_profile(), get_paola_diffusion(), inflow_set_flood_data(), main(), plume_centerline_deposit(), plume_centerline_inv(), plume_inv(), plume_non_dim_distance(), plume_non_dim_lambda(), plume_width_averaged_deposit(), plume_width_averaged_deposit_num(), plume_width_averaged_inv(), plume_wrapper(), run_plume_hypo(), run_river(), sakura_sed_set_flood_data(), sakura_set_flood_data(), sed_hydro_check(), sed_hydrotrend_write_record_to_byte_order(), sed_river_split_discharge(), and sed_river_width().

gssize sed_hydro_write ( FILE *  fp,
Sed_hydro  a 
)

Definition at line 681 of file sed_hydro.c.

References sed_hydro_write_to_byte_order().

gssize sed_hydro_write_record ( FILE *  fp,
Sed_hydro  rec,
gint  order 
)

gssize sed_hydro_write_record_to_byte_order ( FILE *  fp,
Sed_hydro  rec,
gint  order 
)


Generated on Fri Jan 4 18:04:18 2008 for sedflux by  doxygen 1.5.2