TheBoussinesqModel  3.2.1
 All Data Structures Files Functions Variables Typedefs Macros Pages
main.c File Reference
#include <sys/stat.h>
#include "turtle.h"
#include "license.h"
#include "get_filenames.h"
#include "rw_maps.h"
#include "linear_span.h"
#include "geometry.h"
#include "geometry_utilities.h"
#include "read_command_line.h"
#include "additional_read_functions.h"
#include "g_raster2plvector.h"
#include "bigcells2.h"
#include "geometry2.h"
#include "b_solver.h"
#include "b_readgrid.h"
#include "b_volumes.h"
#include "b_utilities.h"
#include "keywords_file_b.h"

Go to the source code of this file.

Macros

#define PRINT   print
 
#define VERBOSE_M   "-verbose"
 
#define CREATE_GRID   "-creates_the_grid"
 
#define WRITE_GRID   "-writes_the_grid"
 
#define MESH_M   "-only_mesh"
 
#define WPATH   "-wpath"
 
#define NOWPATH   ""
 
#define FLOAT_TYPE   0
 
#define MAP_FORMAT   3
 
#define BOUNDARY   -10
 
#define EWRES   1
 
#define NSRES   2
 
#define INTEGER_NULL   -99
 
#define D_INIT   -999.0
 
#define NO_OPTION   "missing_option"
 
#define ARITHMETIC_MEAN0   "--arithmetic-mean0"
 
#define MISSING_FILE   join_strings(wpath,NO_OPTION)
 
#define PROGRAM   "boussinesq"
 
#define FILE_LINES   "-lines-resume"
 
#define FILE_POLYGONS   "-polygons-resume"
 
#define FILE_CONNECTIONS   "-connections-resume"
 
#define RESULTS_FILES   "-results-rasters"
 
#define FILE_DATA   "data="
 
#define RFACTOR   param->max_error
 

Functions

int read_b_parameters_ft (char *filename_data, short print)
 
int main (int argc, char *argv[])
 

Variables

STRINGBINfilenames
 
DOUBLESQUARE_GRIDdsq
 
DOUBLE_GRIDdgrid
 
DOUBLERASTER_MAPdraster
 
DOUBLEVECTORelevation_bottom_fine
 
DOUBLEVECTORelevation_bottom_coarse
 
DOUBLEVECTORelevation_bottom_flines
 
DOUBLEVECTORelevation_bottom_bottom
 
DOUBLEVECTORelevation_terrain_fine
 
DOUBLEVECTORelevation_terrain_flines
 
DOUBLEVECTORporosity_fine
 
DOUBLEVECTORoutlet_coefficient
 
DOUBLEVECTORoutlet_coefficient_v_fine
 
DOUBLEVECTORoutlet_coefficient_surf
 
DOUBLEVECTORoutlet_coefficient_surf_v_fine
 
DOUBLEVECTORrunoff_coefficient
 
DOUBLEVECTORrunoff_coefficient_v_coarse
 
DOUBLEVECTORwater_surface_elevation
 extern DOUBLEVECTOR runoff_coefficient; /!<map of the coefficient of the rating curve in the outlet q_discharge=C*h_sup^m */ More...
 
DOUBLEVECTORwater_mass_error
 
DOUBLEVECTORwater_depth
 
DOUBLEVECTORsurface_water_velocity
 
DOUBLEVECTORF1_wet_vert_area
 
PARAMparam
 
FLAGflag
 
char * wpath
 

Detailed Description

Author
Emanuele Cordano
Attention

This file is part of Boussinesq.

Boussinesq is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Boussinesq is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Boussinesq. If not, see http://www.gnu.org/licenses/.

Definition in file main.c.

Macro Definition Documentation

#define ARITHMETIC_MEAN0   "--arithmetic-mean0"

Definition at line 106 of file main.c.

Referenced by main().

#define BOUNDARY   -10

Definition at line 98 of file main.c.

#define CREATE_GRID   "-creates_the_grid"

Definition at line 87 of file main.c.

Referenced by main().

#define D_INIT   -999.0

Definition at line 103 of file main.c.

#define EWRES   1

Definition at line 99 of file main.c.

#define FILE_CONNECTIONS   "-connections-resume"

Definition at line 112 of file main.c.

#define FILE_DATA   "data="

Definition at line 115 of file main.c.

#define FILE_LINES   "-lines-resume"

Definition at line 110 of file main.c.

#define FILE_POLYGONS   "-polygons-resume"

Definition at line 111 of file main.c.

#define FLOAT_TYPE   0

Definition at line 95 of file main.c.

Referenced by main().

#define INTEGER_NULL   -99

Definition at line 102 of file main.c.

#define MAP_FORMAT   3

Definition at line 96 of file main.c.

Referenced by main().

#define MESH_M   "-only_mesh"

Definition at line 90 of file main.c.

#define MISSING_FILE   join_strings(wpath,NO_OPTION)

Definition at line 107 of file main.c.

#define NO_OPTION   "missing_option"

Definition at line 105 of file main.c.

#define NOWPATH   ""

Definition at line 92 of file main.c.

Referenced by main().

#define NSRES   2

Definition at line 100 of file main.c.

#define PRINT   print

Definition at line 84 of file main.c.

Referenced by read_map().

#define PROGRAM   "boussinesq"

Definition at line 108 of file main.c.

Referenced by main().

#define RESULTS_FILES   "-results-rasters"

Definition at line 113 of file main.c.

#define RFACTOR   param->max_error

Definition at line 117 of file main.c.

#define VERBOSE_M   "-verbose"

Definition at line 86 of file main.c.

Referenced by main().

#define WPATH   "-wpath"

Definition at line 91 of file main.c.

Referenced by main().

#define WRITE_GRID   "-writes_the_grid"

Definition at line 88 of file main.c.

Referenced by main().

Function Documentation

int main ( int  argc,
char *  argv[] 
)
Author
Emanuele Cordano
Date
April 2009

coefficient F1 for surface flow as reported in Casulli,2008

Definition at line 153 of file main.c.

References A_FLAG, FLAG::arithmetic_mean0, ARITHMETIC_MEAN0, DOUBLESQUARE_GRID::big, bubble_sort_elevation_in_longbin(), DOUBLERASTER_MAP::coarse, CREATE_GRID, doublemap_from_longmap(), DTM_MASK, DOUBLE_GRID::fine, DOUBLESQUARE_GRID::fine, DOUBLERASTER_MAP::fine, FLOAT_TYPE, free_DOUBLE_GRID(), free_doubleraster_map(), free_doublesquare_grid(), free_doublevector(), free_stringbin(), get_doubleraster_map(), get_doublesquare_grid(), get_filenames_from_keys(), SQUARE_GRID::grid, H_MASK, I_INITCOND_WATERDEPTH, I_INITCOND_WATERSURFACE_ELEVATION, I_INITIAL_VELOCITY_FT_ARRAY, I_MORPHO_ELEVATION_COARSE, I_MORPHO_ELEVATION_FINE, I_MORPHO_ELEVATION_TERRAINSURFACE_FINE, I_OUTLET_COEFFICIENT_FINE, I_OUTLET_COEFFICIENT_SURF_FINE, I_PARAM_FT_FILE, I_POROSITY_FINE, I_RUNOFF_COEFFICIENT_COARSE, index_pixel_from_a_bin(), SQUARE_GRID::indices_horizontal_lines, SQUARE_GRID::indices_pixel, SQUARE_GRID::indices_vertical_lines, interpolete_volume2lines(), RASTER_MAP::layer, GRID::lines, MAP_FORMAT, min_elevation(), N_MAPS, DOUBLEMATRIX::nch, new_double_grid_from_doublesquare_grid(), new_doublevector(), LINEVECTOR::nh, POLYGONVECTOR::nh, DOUBLEVECTOR::nh, SQUARE_GRID::nhorizontal_lines, DOUBLEVECTOR::nl, SQUARE_GRID::novalue, NOWPATH, O_COARSEMAP_INDEX_CELLS, O_COARSEMAP_INDEX_LINES, O_FINEMAP_INDEX_CELLS, O_FINEMAP_INDEX_LINES, O_RESUME_FILES, GRID::polygons, PROGRAM, read_b_parameters_ft(), read_doublevector_from_a_ft_format_single_file(), read_doublevector_from_raster(), read_flag(), read_option_string(), DOUBLE_GRID::small_line_content, DOUBLE_GRID::small_polygon_content, t_error(), time_loop(), RASTER_MAP::UV, T_INIT::V, V_MASK, VERBOSE_M, wpath, WPATH, write_cell(), write_doublesquare_grid(), WRITE_GRID, write_lines(), and write_map_results().

int read_b_parameters_ft ( char *  filename_data,
short  print 
)
Author
Emanuele Cordano
Date
21 April 2009
Parameters
filename(char*) -
printshort integer

read the scalar data from a suitable ascii files writen in a Fluidturtle Formalism

block 1 - SCALAR DATA

Definition at line 396 of file main.c.

References PARAM::deta, PARAM::dt, PARAM::dt_print, PARAM::exp_dirichlet, free_doublevector(), get_value_from_doublevector(), PARAM::gravity, PARAM::Ks, PARAM::max_errors, DOUBLEVECTOR::nh, PARAM::null_dirichlet, PARAM::p_outlet, PARAM::p_outlet_surf, PARAM::p_runoff, read_doublearray(), read_index(), PARAM::t, PARAM::t_end, t_error(), t_fclose(), t_fopen(), PARAM::t_start, and PARAM::x_temp_adm.

Referenced by main().

Variable Documentation

DOUBLE_GRID* dgrid

Definition at line 126 of file main.c.

Referenced by new_double_grid_from_doublesquare_grid().

DOUBLERASTER_MAP* draster

Definition at line 128 of file main.c.

Referenced by get_doubleraster_map().

Definition at line 125 of file main.c.

Referenced by get_doublesquare_grid(), and read_doublesquare_grid().

DOUBLEVECTOR* elevation_bottom_bottom

map of the bottom elevation defined in the lines of the fine grid

Definition at line 134 of file main.c.

DOUBLEVECTOR* elevation_bottom_coarse

map of the bottom elevation (fine grid)

Definition at line 132 of file main.c.

DOUBLEVECTOR* elevation_bottom_fine

Definition at line 131 of file main.c.

DOUBLEVECTOR* elevation_bottom_flines

map of the bottom elevation (coarse grid)

Definition at line 133 of file main.c.

DOUBLEVECTOR* elevation_terrain_fine

map of the elvetion of the bottom of he coarse cells

Definition at line 135 of file main.c.

DOUBLEVECTOR* elevation_terrain_flines

map of the surface terrain elevation (fine grid)

Definition at line 136 of file main.c.

DOUBLEVECTOR* F1_wet_vert_area

map of the (wet area) surface velocity defined in the lines (velocity is positive when going kp1 to kp2 polygons with kp1>kp2 )

Definition at line 147 of file main.c.

STRINGBIN* filenames

Definition at line 124 of file main.c.

FLAG* flag

Definition at line 149 of file main.c.

DOUBLEVECTOR* outlet_coefficient

map of porosity defined on the pixels of the fine grid

Definition at line 138 of file main.c.

DOUBLEVECTOR* outlet_coefficient_surf

map of the coefficient of the rating curve in the outlet (surface flow) q_discharge=C*h_sup^m

Definition at line 139 of file main.c.

DOUBLEVECTOR * outlet_coefficient_surf_v_fine

map of the coefficient of the rating curve in the outlet (surface flow) q_discharge=C*h_sup^m

Definition at line 139 of file main.c.

DOUBLEVECTOR * outlet_coefficient_v_fine

map of the coefficient of the rating curve in the outlet (subsurface/groundwater flow) q_discharge=C*h_sup^m

Definition at line 138 of file main.c.

PARAM* param

coefficient F1 for surface flow as reported in Casulli,2008

Definition at line 148 of file main.c.

DOUBLEVECTOR* porosity_fine

map of the surface terrain elevation (fine grid lines)

Definition at line 137 of file main.c.

DOUBLEVECTOR* runoff_coefficient

map of porosity defined on the pixels of the fine grid map of the coefficient of the dissipation runoff coefficient C*(velocity)^p ,

Definition at line 140 of file main.c.

DOUBLEVECTOR * runoff_coefficient_v_coarse

map of the coefficient of the dissipation runoff coefficient C*(velocity)^p ,

Definition at line 140 of file main.c.

DOUBLEVECTOR* surface_water_velocity

map of instantaneous water mass error

Definition at line 146 of file main.c.

DOUBLEVECTOR* water_depth

map of instantaneous water mass error

Definition at line 144 of file main.c.

DOUBLEVECTOR* water_mass_error

map of instantaneous water surface on the pixels of the coarse grid

Definition at line 143 of file main.c.

DOUBLEVECTOR* water_surface_elevation

extern DOUBLEVECTOR runoff_coefficient; /!<map of the coefficient of the rating curve in the outlet q_discharge=C*h_sup^m */

map of porosity defined on the pixels of the fine grid

Definition at line 142 of file main.c.

char* wpath

Definition at line 151 of file main.c.

Referenced by main(), and Newton_convergence().