@@ -135,6 +135,8 @@ class LSDCatchmentModel: public LSDRaster
135135 // / @details Actually, this is a generic function for printing a 2D vector
136136 void print_rainfall_data ();
137137
138+ void print_reach_data ();
139+
138140 // / @brief Calls the various save functions depending on the data types to be saved (Raster Output)
139141 // / @author DAV
140142 // / @details dependent on the LSDRaster class calling the overloaded write_raster func. If you are looking
@@ -337,6 +339,11 @@ class LSDCatchmentModel: public LSDRaster
337339 // / object.
338340 void catchment_water_input_and_hydrology ( double flow_timestep, runoffGrid& runoff);
339341
342+ // / @brief Calculates the hydrological inputs using just reach mode
343+ void reach_water_and_sediment_input ();
344+
345+ std::vector<std::vector<float > > read_reachfile (std::string REACHINPUTFILE);
346+
340347 // / @brief Gets the number of catchment cells that have water input to them
341348 // / @detail Calculates which cells contain a discharge greater than MIN_Q
342349 // / and lower than MIN_Q_MAXVAL multiplies by a parameter related to the
@@ -428,7 +435,8 @@ class LSDCatchmentModel: public LSDRaster
428435 const std::array<int , 9 > deltaY = {{0 , -1 , -1 , 0 , 1 , 1 , 1 , 0 , -1 }};
429436
430437 double water_depth_erosion_threshold = 0.01 ;
431- int input_time_step = 60 ;
438+ int reach_input_data_timestep = 60 ;
439+ int stage_reach_input_data_timestep = 60 ;
432440 int number_of_points = 0 ;
433441 double globalsediq = 0 ;
434442 double time_1 = 1 ;
@@ -462,9 +470,11 @@ class LSDCatchmentModel: public LSDRaster
462470 unsigned rfnum = 1 ;
463471
464472 // / set by ncols and nrows
465- unsigned int jmax, imax;
466- double xll, yll;
467- double no_data_value;
473+ unsigned int jmax = 0 ;
474+ unsigned int imax = 0 ;
475+ double xll = 0 ;
476+ double yll = 0 ;
477+ double no_data_value = -9999.9 ;
468478
469479 int maxcycle = 1000 ;
470480
@@ -478,7 +488,7 @@ class LSDCatchmentModel: public LSDRaster
478488 double CREEP_RATE=0.0025 ;
479489 double SOIL_RATE = 0.0025 ;
480490 double active=0.2 ;
481- int grain_array_tot =1 ;
491+ int grain_array_tot =1 ;
482492
483493 // / Number of passes for edge smoothing filter
484494 double edge_smoothing_passes = 100.0 ;
@@ -598,8 +608,34 @@ class LSDCatchmentModel: public LSDRaster
598608 TNT::Array2D<int > down_scan;
599609 TNT::Array2D<int > rfarea;
600610
611+ // Reach input cell flag switches
612+ bool reach1_input_on = false ;
613+ bool reach2_input_on = false ;
614+ bool reach3_input_on = false ;
615+
616+ std::string reach1_input_file;
617+ std::string reach2_input_file;
618+ std::string reach3_input_file;
619+
620+ int reach1_x;
621+ int reach1_y;
622+ int reach2_x;
623+ int reach2_y;
624+ int reach3_x;
625+ int reach3_y;
626+
627+ // Arrays for reach mode input points
628+ TNT::Array2D<int > inpoints;
601629 TNT::Array2D<bool > inputpointsarray;
602630
631+ std::vector< std::vector<float > > hourly_rain_data;
632+ std::vector<std::vector<std::vector<float > > > inputfile;
633+ // TNT::Array3D<double> inputfile;
634+ std::vector<double > stage_inputfile;
635+ // TODO above these all need initialising from read ins.
636+
637+ double stage_input_time_step = 1 ;
638+
603639 std::vector<int > catchment_input_x_coord;
604640 std::vector<int > catchment_input_y_coord;
605641
@@ -608,7 +644,7 @@ class LSDCatchmentModel: public LSDRaster
608644
609645 std::vector<double > hourly_m_value;
610646 std::vector<double > temp_grain;
611- std::vector< std::vector< float > > hourly_rain_data;
647+
612648 TNT::Array3D<double > veg;
613649 TNT::Array2D<double > edge, edge2; // TJC 27/1/05 array for edges
614650 std::vector<double > old_j_mean_store;
@@ -681,21 +717,21 @@ class LSDCatchmentModel: public LSDRaster
681717 bool write_elevdiff_file = false ;
682718
683719 // / input file names
684- std::string rainfall_data_file;
685- std::string grain_data_file;
686- std::string bedrock_data_file;
720+ std::string rainfall_data_file = " " ;
721+ std::string grain_data_file = " " ;
722+ std::string bedrock_data_file = " " ;
687723
688724 // / output file names
689- std::string elev_fname;
690- std::string grainsize_fname;
691- std::string params_fname;
692- std::string waterdepth_fname;
693- std::string flowvel_fname;
694- std::string hydroindex_fname;
695- std::string timeseries_fname;
696- std::string elevdiff_fname;
697- std::string raingrid_fname;
698- std::string runoffgrid_fname;
725+ std::string elev_fname = " " ;
726+ std::string grainsize_fname = " " ;
727+ std::string params_fname = " " ;
728+ std::string waterdepth_fname = " " ;
729+ std::string flowvel_fname = " " ;
730+ std::string hydroindex_fname = " " ;
731+ std::string timeseries_fname = " " ;
732+ std::string elevdiff_fname = " " ;
733+ std::string raingrid_fname = " " ;
734+ std::string runoffgrid_fname = " " ;
699735
700736 bool DEBUG_print_cycle_on = false ;
701737 bool DEBUG_write_raingrid = false ;
0 commit comments