|
9 | 9 |
|
10 | 10 | import time |
11 | 11 | from cascade.cascade import Cascade |
| 12 | +import os |
12 | 13 |
|
13 | 14 | # input datadir where the 100 storms are located |
14 | 15 | datadir = "C:/Users/Lexi/PycharmProjects/CASCADE/data/outwash_data/storms/slope0pt03/" |
15 | 16 |
|
16 | 17 | # ---------------------------------- set model parameters that change per run ------------------------------------------ |
17 | 18 | storm_interval = 20 # 20 or 10 years |
18 | | -r_dune_growth = 0.25 # 0.25 or 0.35 |
| 19 | +r_dune_growth = 0.35 # 0.25 or 0.35 |
19 | 20 | config = 4 # 1, 2, 3, or 4 |
20 | | -percent_washout_to_shoreface = 100 |
| 21 | +washout_array = [100, 50, 0] |
21 | 22 |
|
22 | 23 | # automatically set min and max r values based on dune growth rate selection |
23 | 24 | if r_dune_growth == 0.25: |
|
39 | 40 | elif config == 4: |
40 | 41 | beach_slope = 0.006 |
41 | 42 |
|
42 | | -# save to pycharm folder |
43 | | -save_dir = "C:/Users/Lexi/PycharmProjects/CASCADE/data/outwash_data/storms/slope0pt03/rerun_output/{0}/" \ |
44 | | - "outwash{1}/".format(rname, percent_washout_to_shoreface) |
| 43 | +for percent_washout_to_shoreface in washout_array: |
| 44 | + # save to pycharm folder |
| 45 | + save_dir = "C:/Users/Lexi/PycharmProjects/CASCADE/data/outwash_data/storms/slope0pt03/rerun_output/one_storm/{0}/" \ |
| 46 | + "outwash{1}/".format(rname, percent_washout_to_shoreface) |
45 | 47 |
|
46 | | -# --------------------------------- running overwash scenario with all 100 storms -------------------------------------- |
47 | | -for storm_num in range(1, 101): |
48 | | - print("\r", "Storm Number: ", storm_num, end="") |
49 | | - overwash_storm = "StormSeries_100yrs_inclusive_NCB_Berm1pt46m_Slope0pt03_{0}.npy".format(storm_num) |
| 48 | + # --------------------------------- running overwash scenario with all 100 storms -------------------------------------- |
| 49 | + for storm_num in range(1, 2): |
| 50 | + print("\r", "Storm Number: ", storm_num, end="") |
| 51 | + overwash_storm = "StormSeries_100yrs_inclusive_NCB_Berm1pt46m_Slope0pt03_{0}.npy".format(storm_num) |
50 | 52 |
|
51 | | - ### 0%, 50%, or 100% washout to shoreface ------------------------------------------------------------------------------------ |
52 | | - # initialize class |
53 | | - cascade_outwash = Cascade( |
54 | | - datadir, |
55 | | - name="config{0}_outwash{1}_startyr1_interval{2}yrs_Slope0pt03_{3}".format(config, percent_washout_to_shoreface, storm_interval, storm_num), |
56 | | - elevation_file="NCB-default-elevation-config{0}-damMHW.npy".format(config), |
57 | | - dune_file="NCB-default-dunes-config{0}-dam.npy".format(config), |
58 | | - parameter_file="outwash-parameters.yaml", |
59 | | - storm_file=overwash_storm, |
60 | | - num_cores=1, # cascade can run in parallel, can never specify more cores than that |
61 | | - roadway_management_module=False, |
62 | | - alongshore_transport_module=False, |
63 | | - beach_nourishment_module=False, |
64 | | - community_economics_module=False, |
65 | | - outwash_module=True, |
66 | | - alongshore_section_count=1, |
67 | | - time_step_count=101, |
68 | | - wave_height=1, # ---------- for BRIE and Barrier3D --------------- # |
69 | | - wave_period=7, |
70 | | - wave_asymmetry=0.8, |
71 | | - wave_angle_high_fraction=0.2, |
72 | | - bay_depth=3.0, |
73 | | - s_background=0.001, |
74 | | - berm_elevation=1.46, |
75 | | - MHW=0.36, |
76 | | - beta=beach_slope, |
77 | | - sea_level_rise_rate=0.004, |
78 | | - sea_level_rise_constant=True, |
79 | | - background_erosion=0.0, |
80 | | - min_dune_growth_rate=min_dune_r, |
81 | | - max_dune_growth_rate=max_dune_r, |
82 | | - road_ele=1.7, # ---------- roadway management --------------- # |
83 | | - road_width=30, |
84 | | - road_setback=30, |
85 | | - dune_design_elevation=3.7, |
86 | | - dune_minimum_elevation=2.2, |
87 | | - trigger_dune_knockdown=False, |
88 | | - group_roadway_abandonment=None, |
89 | | - nourishment_interval=None, # ---------- beach and dune ("community") management --------------- # |
90 | | - nourishment_volume=300.0, |
91 | | - overwash_filter=40, |
92 | | - overwash_to_dune=10, |
93 | | - number_of_communities=1, # ---------- coastal real estate markets (in development) --------------- # |
94 | | - sand_cost=10, |
95 | | - taxratio_oceanfront=1, |
96 | | - external_housing_market_value_oceanfront=6e5, |
97 | | - external_housing_market_value_nonoceanfront=4e5, |
98 | | - fixed_cost_beach_nourishment=2e6, |
99 | | - fixed_cost_dune_nourishment=2e5, |
100 | | - nourishment_cost_subsidy=10e6, |
101 | | - house_footprint_x=15, |
102 | | - house_footprint_y=20, |
103 | | - beach_full_cross_shore=70, |
104 | | - outwash_storms_file="outwash_storms_startyr_1_interval_{0}yrs.npy".format(storm_interval), # --------- outwasher (in development) ------------ # |
105 | | - percent_washout_to_shoreface=percent_washout_to_shoreface, |
106 | | - outwash_beach_file="NCB-default-beach-config{0}-damMHW.npy".format(config) |
107 | | - ) |
| 53 | + ### 0%, 50%, or 100% washout to shoreface ------------------------------------------------------------------------------------ |
| 54 | + # initialize class |
| 55 | + cascade_outwash = Cascade( |
| 56 | + datadir, |
| 57 | + name="config{0}_outwash{1}_startyr1_interval{2}yrs_Slope0pt03_{3}".format(config, percent_washout_to_shoreface, storm_interval, storm_num), |
| 58 | + elevation_file="NCB-default-elevation-config{0}-damMHW.npy".format(config), |
| 59 | + dune_file="NCB-default-dunes-config{0}-dam.npy".format(config), |
| 60 | + parameter_file="outwash-parameters.yaml", |
| 61 | + storm_file=overwash_storm, |
| 62 | + num_cores=1, # cascade can run in parallel, can never specify more cores than that |
| 63 | + roadway_management_module=False, |
| 64 | + alongshore_transport_module=False, |
| 65 | + beach_nourishment_module=False, |
| 66 | + community_economics_module=False, |
| 67 | + outwash_module=True, |
| 68 | + alongshore_section_count=1, |
| 69 | + time_step_count=101, |
| 70 | + wave_height=1, # ---------- for BRIE and Barrier3D --------------- # |
| 71 | + wave_period=7, |
| 72 | + wave_asymmetry=0.8, |
| 73 | + wave_angle_high_fraction=0.2, |
| 74 | + bay_depth=3.0, |
| 75 | + s_background=0.001, |
| 76 | + berm_elevation=1.46, |
| 77 | + MHW=0.36, |
| 78 | + beta=beach_slope, |
| 79 | + sea_level_rise_rate=0.004, |
| 80 | + sea_level_rise_constant=True, |
| 81 | + background_erosion=0.0, |
| 82 | + min_dune_growth_rate=min_dune_r, |
| 83 | + max_dune_growth_rate=max_dune_r, |
| 84 | + road_ele=1.7, # ---------- roadway management --------------- # |
| 85 | + road_width=30, |
| 86 | + road_setback=30, |
| 87 | + dune_design_elevation=3.7, |
| 88 | + dune_minimum_elevation=2.2, |
| 89 | + trigger_dune_knockdown=False, |
| 90 | + group_roadway_abandonment=None, |
| 91 | + nourishment_interval=None, # ---------- beach and dune ("community") management --------------- # |
| 92 | + nourishment_volume=300.0, |
| 93 | + overwash_filter=40, |
| 94 | + overwash_to_dune=10, |
| 95 | + number_of_communities=1, # ---------- coastal real estate markets (in development) --------------- # |
| 96 | + sand_cost=10, |
| 97 | + taxratio_oceanfront=1, |
| 98 | + external_housing_market_value_oceanfront=6e5, |
| 99 | + external_housing_market_value_nonoceanfront=4e5, |
| 100 | + fixed_cost_beach_nourishment=2e6, |
| 101 | + fixed_cost_dune_nourishment=2e5, |
| 102 | + nourishment_cost_subsidy=10e6, |
| 103 | + house_footprint_x=15, |
| 104 | + house_footprint_y=20, |
| 105 | + beach_full_cross_shore=70, |
| 106 | + outwash_storms_file="outwash_storms_startyr_1_interval_{0}yrs.npy".format(storm_interval), # --------- outwasher (in development) ------------ # |
| 107 | + percent_washout_to_shoreface=percent_washout_to_shoreface, |
| 108 | + outwash_beach_file="NCB-default-beach-config{0}-damMHW.npy".format(config) |
| 109 | + ) |
108 | 110 |
|
109 | | - # run the time loop/update function |
| 111 | + # run the time loop/update function |
110 | 112 |
|
111 | | - for time_step in range(cascade_outwash._nt - 1): |
112 | | - print("\r", "Time Step: ", time_step + 1, end="") |
113 | | - cascade_outwash.update() |
114 | | - if cascade_outwash.b3d_break: |
115 | | - break |
| 113 | + for time_step in range(cascade_outwash._nt - 1): |
| 114 | + print("\r", "Time Step: ", time_step + 1, end="") |
| 115 | + cascade_outwash.update() |
| 116 | + if cascade_outwash.b3d_break: |
| 117 | + break |
116 | 118 |
|
117 | | - # save variables |
118 | | - cascade_outwash.save(save_dir) |
| 119 | + # save variables |
| 120 | + if not os.path.exists(save_dir): |
| 121 | + os.makedirs(save_dir) |
| 122 | + cascade_outwash.save(save_dir) |
119 | 123 |
|
0 commit comments