-
Notifications
You must be signed in to change notification settings - Fork 2
/
LSDModelDriver.cpp
656 lines (602 loc) · 19.6 KB
/
LSDModelDriver.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//
// LSDModelDriver.cpp
// Land Surface Dynamics Model(s) Driver
//
// This object parses parameter files and drives the models:
//
// LSDRasterModel
// LSDCatchmentModel (coming soon to an svn-repo near you!)
//
// Its purpose is to stop having to write a bunch of .cpp driver functions and instead
// be able to write a parameter files without compiling
//
// Developed by:
// Simon M. Mudd
// Martin D. Hurst
// David T. Milodowski
// Stuart W.D. Grieve
// Declan A. Valters
// Fiona Clubb
//
// Copyright (C) 2014 Simon M. Mudd 2014
//
// Developer can be contacted by simon.m.mudd _at_ ed.ac.uk
//
// Simon Mudd
// University of Edinburgh
// School of GeoSciences
// Drummond Street
// Edinburgh, EH8 9XP
// Scotland
// United Kingdom
//
// This program 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 2 of the License, or (at your option) any later version.
//
// This program 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 this program;
// if not, write to:
// Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor,
// Boston, MA 02110-1301
// USA
//
///=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
///
/// This object is written by
/// @author Simon M. Mudd, University of Edinburgh
/// @author David T. Milodowski, University of Edinburgh
/// @author Martin D. Hurst, British Geological Survey
/// @author Fiona Clubb, University of Edinburgh
/// @author Stuart Grieve, University of Edinburgh
/// @author James Jenkinson, University of Edinburgh
/// @author Declan Valters, University of Manchester
///
///=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
///
/// Version 0.0.1 2015-01-15
///=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#include "LSDModelDriver.hpp"
#include "LSDRasterModel.hpp"
#include "LSDCatchmentModel.hpp"
#ifndef LSDModelDriver_CPP
#define LSDModelDriver_CPP
/// @brief This is a class to manage running LSDTopoTools. It parses a parameter
/// file and then manages running of analyses.
/// @details The intention of this object is to run analyses via parameter
/// files and not through numerous compiled driver functions. We eventually
/// will want some kind of 'recorder' so that any time this object
/// runs an analysis it gives a full report of what analyses were run so that
/// results are reproducable
// constructor and destructor functions
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// The default constructor. This asks the user for a pathname and
// param filename
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
void LSDModelDriver::create()
{
std::cout << "I need a model parameter file to run. Please enter the path: " << std::endl;
std::cin >> pathname;
check_pathname_for_slash();
std::cout << "Now I need a model parameter filename: " << std::endl;
std::cin >> param_fname;
//got_flowinfo = false;
//got_polyfit = false;
//got_JunctionNetwork = false;
ingest_data(pathname, param_fname);
}
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// This constructor runs with the path and filename
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
void LSDModelDriver::create(string pname, string fname)
{
pathname = pname;
check_pathname_for_slash();
param_fname = fname;
//got_flowinfo = false;
//got_polyfit = false;
//got_JunctionNetwork = false;
ingest_data(pathname, param_fname);
}
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// ingest data
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// This function gets all the data from a parameter file
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
void LSDModelDriver::ingest_data(string pname, string p_fname)
{
// the full name of the file
string full_name = pname+p_fname;
ifstream infile;
infile.open(full_name.c_str());
string parameter, value, lower, lower_val;
string bc;
cout << "Parameter filename is: " << full_name << endl;
// now ingest parameters
while (infile.good())
{
parse_line(infile, parameter, value);
lower = parameter;
if (parameter == "NULL")
continue;
for (unsigned int i=0; i<parameter.length(); ++i)
{
lower[i] = std::tolower(parameter[i]); // converts to lowercase
}
cout << "parameter is: " << lower << " and value is: " << value << endl;
// get rid of control characters
value = RemoveControlCharactersFromEndOfString(value);
if (lower == "dem read extension")
{
dem_read_extension = value;
// get rid of any control characters from the end (if param file was made in DOS)
dem_read_extension = RemoveControlCharactersFromEndOfString(dem_read_extension);
}
else if (lower == "dem write extension")
{
dem_write_extension = value;
// get rid of any control characters from the end (if param file was made in DOS)
dem_write_extension = RemoveControlCharactersFromEndOfString(dem_write_extension);
}
else if (lower == "write path")
{
write_path = value;
// get rid of any control characters from the end (if param file was made in DOS)
write_path = RemoveControlCharactersFromEndOfString(write_path);
}
else if (lower == "write fname")
{
write_fname = value;
// get rid of any control characters from the end (if param file was made in DOS)
write_fname = RemoveControlCharactersFromEndOfString(write_fname);
//cout << "Got the write name, it is: " << write_fname << endl;
}
else if (lower == "read path")
{
read_path = value;
// get rid of any control characters from the end (if param file was made in DOS)
read_path = RemoveControlCharactersFromEndOfString(read_path);
//cout << "Got the write name, it is: " << write_fname << endl;
}
else if (lower == "read fname")
{
read_fname = value;
// get rid of any control characters from the end (if param file was made in DOS)
read_fname = RemoveControlCharactersFromEndOfString(read_fname);
//cout << "Got the read name, it is: " << read_fname << endl;
}
//=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// parameters for landscape numerical modelling
// (LSDCatchmentModel: DAV 2015-01-14)
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// The File Information is read at the start of this method
// no need to duplicate it here
//=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Supplementary Input Files
//=-=-=-=-=-=-=-=-=-=-=-=-=-=
else if (lower == "hydroindex_file")
{
CM_support_file_names["hydroindex_file"] = atof(value.c_str());
}
else if (lower == "rainfall_data_file")
{
CM_support_file_names["rainfall_data_file"] = atof(value.c_str());
}
else if (lower == "grain_data_file")
{
CM_support_file_names["grain_data_file"] = atof(value.c_str());
}
else if (lower == "bedrock_data_file")
{
CM_support_file_names["bedrock_data_file"] = atof(value.c_str());
}
//=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Numerical
//=-=-=-=-=-=-=-=-=-=-=-=-=-=
else if (lower == "no_of_iterations")
{
CM_float_parameters["no_of_iterations"] = atof(value.c_str());
}
else if (lower == "min_time_step")
{
CM_float_parameters["min_time_step"] = atof(value.c_str());
}
else if (lower == "max_time_step")
{
CM_float_parameters["max_time_step"] = atof(value.c_str());
}
else if (lower == "run_time_start")
{
CM_float_parameters["run_time_start"] = atof(value.c_str());
}
else if (lower == "max_run_duration")
{
CM_float_parameters["max_run_duration"] = atof(value.c_str());
}
else if (lower == "memory_limit")
{
CM_float_parameters["memory_limit"] = atof(value.c_str());
}
else if (lower == "max_time_step")
{
CM_float_parameters["max_time_step"] = atof(value.c_str());
}
//=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Output and Save Options
//=-=-=-=-=-=-=-=-=-=-=-=-=-=
else if (lower == "save_interval")
{
CM_int_parameters["save_interval"] = atof(value.c_str());
}
else if (lower == "time_series_interval")
{
CM_int_parameters["time_series_interval"] = atof(value.c_str());
}
else if (lower == "elevation_file")
{
//bool temp_bool = (value == "true") ? true : false;
CM_model_switches["write_elevation_file"] = atof(value.c_str()); //temp_bool;
}
else if (lower == "grainsize_file")
{
CM_model_switches["write_grainsize_file"] = atof(value.c_str());
}
else if (lower == "parameters_file")
{
CM_model_switches["write_parameters_file"] = atof(value.c_str());
}
else if (lower == "flowvelocity_file")
{
CM_model_switches["write_flowvelocity_file"] = atof(value.c_str());
}
else if (lower == "waterdepth_file")
{
CM_model_switches["write_waterdepth_file"] = atof(value.c_str());
}
else if (lower == "timeseries_file")
{
CM_model_switches["write_timeseries_file"] = atof(value.c_str());
}
//=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Sediment
//=-=-=-=-=-=-=-=-=-=-=-=-=-=
else if (lower == "transport_law")
{
CM_method_map["transport_law"] = atof(value.c_str());
}
else if (lower == "max_tau_velocity")
{
CM_float_parameters["max_tau_velocity"] = atof(value.c_str());
}
else if (lower == "active_layer_thickness")
{
CM_float_parameters["active_layer_thickness"] = atof(value.c_str());
}
else if (lower == "recirculate_proportion")
{
CM_float_parameters["recirculate_proportion"] = atof(value.c_str());
}
else if (lower == "lateral_erosion_on")
{
CM_model_switches["lateral_erosion_on"] = atof(value.c_str());
}
else if (lower == "lateral_ero_rate")
{
CM_float_parameters["lateral_ero_rate"] = atof(value.c_str());
}
else if (lower == "edge_filter_passes")
{
CM_float_parameters["edge_filter_passes"] = atof(value.c_str());
}
else if (lower == "cells_shift_lat")
{
CM_float_parameters["cells_shift_lat"] = atof(value.c_str());
}
else if (lower == "max_diff_cross_chann")
{
CM_float_parameters["max_diff_cross_chan"] = atof(value.c_str());
}
//=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Grain Size Options
//=-=-=-=-=-=-=-=-=-=-=-=-=-=
else if (lower == "suspended_sediment_on")
{
CM_model_switches["suspended_sediment_on"] = atof(value.c_str());
}
else if (lower == "fall_velocity")
{
CM_float_parameters["fall_velocity"] = atof(value.c_str());
}
else if (lower == "grain_size_frac_file")
{
CM_support_file_names["grain_size_frac_file"] = atof(value.c_str());
}
//=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Hydrology and Flow
//=-=-=-=-=-=-=-=-=-=-=-=-=-=
else if (lower == "TOPMODEL_m_value")
{
CM_float_parameters["TOPMODEL_m_value"] = atof(value.c_str());
}
else if (lower == "rain_data_time_step")
{
CM_int_parameters["rain_data_time_step"] = atof(value.c_str());
}
else if (lower == "spatial_var_rain")
{
CM_model_switches["spatial_var_rain"] = atof(value.c_str());
}
else if (lower == "input_output_diff")
{
CM_float_parameters["input_output_diff"] = atof(value.c_str());
}
else if (lower == "min_Q_for_depth_calc")
{
CM_float_parameters["min_Q_for_depth_calc"] = atof(value.c_str());
}
else if (lower == "max_Q_for_depth_calc")
{
CM_float_parameters["max_Q_for_depth_calc"] = atof(value.c_str());
}
else if (lower == "depth_ero_threshold")
{
CM_float_parameters["depth_ero_threshold"] = atof(value.c_str());
}
else if (lower == "slope_on_edge_cell")
{
CM_float_parameters["slope_on_edge_cell"] = atof(value.c_str());
}
else if (lower == "evaporation_rate")
{
CM_float_parameters["evaporation_rate"] = atof(value.c_str());
}
else if (lower == "courant_number")
{
CM_float_parameters["courant_number"] = atof(value.c_str());
}
else if (lower == "hflow_threshold")
{
CM_float_parameters["hflow_threshold"] = atof(value.c_str());
}
else if (lower == "froude_num_limit")
{
CM_float_parameters["froude_num_limit"] = atof(value.c_str());
}
else if (lower == "mannings_n")
{
CM_int_parameters["mannings_n"] = atof(value.c_str());
}
//=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Vegetation
//=-=-=-=-=-=-=-=-=-=-=-=-=-=
else if (lower == "vegetation_on")
{
CM_model_switches["vegetation_on"] = atof(value.c_str());
}
else if (lower == "grass_grow_rate")
{
CM_float_parameters["grass_grow_rate"] = atof(value.c_str());
}
else if (lower == "vegetation_crit_shear")
{
CM_float_parameters["vegetation_crit_shear"] = atof(value.c_str());
}
else if (lower == "veg_erosion_prop")
{
CM_float_parameters["veg_erosion_prop"] = atof(value.c_str());
}
//=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Hillslope
//=-=-=-=-=-=-=-=-=-=-=-=-=-=
else if (lower == "creep_rate")
{
CM_float_parameters["creep_rate"] = atof(value.c_str());
}
else if (lower == "slope_failure_thresh")
{
CM_float_parameters["slope_failure_thresh"] = atof(value.c_str());
}
else if (lower == "soil_erosion_rate")
{
CM_float_parameters["soil_erosion_rate"] = atof(value.c_str());
}
else if (lower == "soil_j_mean_depends_on")
{
CM_model_switches["soil_j_mean_depends_on"] = atof(value.c_str());
}
else if (lower == "call_muddpile_model")
{
CM_model_switches["call_muddpile_model"] = atof(value.c_str());
}
//=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// parameters for LSD RASTER MODEL
// (LSDRasterModel: DAV 2015-01-14)
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// INITIAL AND BOUNDARY CONDITIONS
else if (lower == "NRows")
{
RM_int_parameters["NRows"] = atof(value.c_str());
}
else if (lower == "NCols")
{
RM_int_parameters["NCols"] = atof(value.c_str());
}
else if (lower == "Resolution")
{
RM_int_parameters["Resolution"] = atof(value.c_str());
}
else if (lower == "init_parabolic_surface")
{
RM_model_switches["init_parabolic_surface"] = atof(value.c_str());
}
else if (lower == "init_random_fractal_surface")
{
RM_model_switches["init_random_fractal_surface"] = atof(value.c_str());
}
else if (lower == "parabola_max_elev")
{
RM_float_parameters["parabola_max_elev"] = atof(value.c_str());
}
else if (lower == "surface_noise_value")
{
RM_float_parameters["surface_noise_value"] = atof(value.c_str());
}
else if (lower == "boundary_code")
{
RM_float_parameters["boundary_code"] = atof(value.c_str());
}
// NUMERICAL OPTIONS
else if (lower == "time_step")
{
RM_int_parameters["time_step"] = atof(value.c_str());
}
else if (lower == "end_time")
{
RM_int_parameters["end_time"] = atof(value.c_str());
}
else if (lower == "end_time_mode")
{
RM_method_map["end_time_mode"] = atof(value.c_str());
}
// UPLIFT OPTIONS
else if (lower == "uplift_mode")
{
RM_method_map["uplift_mode"] = atof(value.c_str());
}
else if (lower == "max_uplift")
{
RM_float_parameters["max_uplift"] = atof(value.c_str());
}
else if (lower == "tolerance")
{
RM_float_parameters["tolerance"] = atof(value.c_str());
}
else if (lower == "print_interval")
{
RM_int_parameters["print_interval"] = atof(value.c_str());
}
else if (lower == "periodicity")
{
RM_int_parameters["periodicity"] = atof(value.c_str());
}
// FLUVIAL
else if (lower == "fluvial_on")
{
RM_model_switches["fluvial_on"] = atof(value.c_str());
}
else if (lower == "K")
{
RM_float_parameters["K"] = atof(value.c_str());
}
else if (lower == "m")
{
RM_float_parameters["m"] = atof(value.c_str());
}
else if (lower == "n")
{
RM_float_parameters["n"] = atof(value.c_str());
}
else if (lower == "K_mode")
{
RM_method_map["K_mode"] = atof(value.c_str());
}
// HILLSLOPE
else if (lower == "hillslope_on")
{
RM_model_switches["hillslope_on"] = atof(value.c_str());
}
else if (lower == "non-linear")
{
RM_model_switches["non-linear"] = atof(value.c_str());
}
else if (lower == "threshold_drainage")
{
RM_float_parameters["threshold_drainage"] = atof(value.c_str());
}
else if (lower == "D")
{
RM_float_parameters["D"] = atof(value.c_str());
}
else if (lower == "S_c")
{
RM_float_parameters["S_c"] = atof(value.c_str());
}
else if (lower == "D_mode")
{
RM_method_map["D_mode"] = atof(value.c_str());
}
else if (lower == "D_amplitude")
{
RM_float_parameters["D_amplitude"] = atof(value.c_str());
}
// TECTONICS
else if (lower == "isostacy")
{
RM_model_switches["isostacy"] = atof(value.c_str());
}
else if (lower == "flexure")
{
RM_model_switches["flexure"] = atof(value.c_str());
}
else if (lower == "rigidity")
{
RM_float_parameters["rigidity"] = atof(value.c_str());
}
}
}
//=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Select the model type
// I.e. Catchment modelling or raster landscape (square)
//=-=-=-=-=-=-=-=-=-=-=-=-=-=
void LSDModelDriver::select_model_from_model_map()
{
if(model_map.find("LSDRasterModel") != model_map.end())
{
run_LSDRasterModel_components();
}
else if(model_map.find("LSDCatchmentModel") != model_map.end())
{
run_LSDCatchmentModel_components();
}
else
{
std::cout << "You did not choose a valid model in the parameter file!" << std::endl;
}
}
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// Run the appropriate model's components
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
void LSDModelDriver::run_LSDRasterModel_components()
{
// to do
}
void LSDModelDriver::run_LSDCatchmentModel_components()
{
// to do
}
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// this is a private function that makes sure the path has a slash at the end
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
void LSDModelDriver::check_pathname_for_slash()
{
string lchar = pathname.substr(pathname.length()-1,1);
string slash = "/";
//cout << "lchar is " << lchar << " and slash is " << slash << endl;
if (lchar != slash)
{
std::cout << "You forgot the frontslash at the end of the path. Appending." << std::endl;
pathname = pathname+slash;
}
std::cout << "The pathname is: " << pathname << std::endl;
}
#endif