1+ import copy
2+
13import numpy as np
24import os
35
4- os .chdir ("C:\\ Users\\ frank\\ OneDrive - University of North Carolina at Chapel Hill\\ Chapter 2\\ Cascade_Output_NPZ" )
5-
6+ # os.chdir("C:\\Users\\frank\\OneDrive - University of North Carolina at Chapel Hill\\Chapter 2\\Cascade_Output_NPZ")
7+ os . chdir ( 'E: \\ Chapter 2' )
68#island_names = ['Smith','Hog','Wreck','Metompkin_Marsh','Metompkin_Bay']
7- island_names = ['Wreck_Marsh ' ,'Metompkin_Marsh ' ]
8-
9+ island_names = ['Geom_1 ' ,'Geom_2' , 'Geom_3' , 'Geom_4' , 'Geom_5 ' ]
10+ #island_names = ['Geom_5']
911
10- Storm_Intensity = ['_Baseline_' ,'_Two_Percent_' ,'_Five_Percent_' ,'_Ten_Percent_' ]
11- Storm_Intensity_Hog = ['_Baseline_' ,'_2_Percent_' ,'_5_Percent_' ,'_10_Percent_' ]
12+ Storm_Intensity = ['_Baseline_' ,'_5_' ,'_10_' ]
1213
13- RSLR = ['Low' ,'Int' ,'High' ]
14+ Save_RSLR = ['IL' ,'I' ,'H' ]
15+ RSLR = ['IL' ,'I' ,'IH' ]
1416for j in range (len (island_names )):
1517 for k in range (len (RSLR )):
16- for z in range (len (Storm_Intensity )):
18+ for inten in range (len (Storm_Intensity )):
1719 bmft_elevation_TS = []
1820 marsh_offset_TS = []
1921 marsh_edge_TS = []
2022 forest_edge_TS = []
2123 shoreline_TS = []
2224 shoreline_toe_TS = []
2325 for i in range (0 ,50 ):
24- if island_names [j ] == 'Hog' :
25- run_name = (str (island_names [j ]) + str (Storm_Intensity_Hog [z ])+ str (
26- RSLR [k ]) + '_RSLR_' + str (i ) + '.npz' )
27- elif island_names [j ] == 'Metompkin_Bay' :
28- if Storm_Intensity [z ] == '_Baseline_' :
29- run_name = (str (island_names [j ]) + str (Storm_Intensity [z ])+ str (
30- RSLR [k ]) + '_RSLR_' + str (i ) + '.npz' )
31- else :
32- run_name = (str (island_names [j ]) + str (Storm_Intensity [z ]) + 'Storms_' + str (
33- RSLR [k ]) + '_RSLR_' + str (i ) + '.npz' )
34- else :
35- run_name = (str (island_names [j ])+ str (Storm_Intensity [z ])+ 'Storms_' + str (RSLR [k ])+ '_RSLR_' + str (i )+ '.npz' )
26+ run_name = (str (island_names [j ])+ '_' + str (RSLR [k ])+ str (Storm_Intensity [inten ])+ 'S' + str (i )+ '.npz' )
3627 output = np .load (run_name , allow_pickle = True )
3728 cascade = output ["cascade" ]
3829 cascade = cascade [0 ]
3930 b3d = cascade ._barrier3d [0 ]
40- shoreline_TS .append (b3d .x_s_TS )
41- shoreline_toe_TS .append (b3d .x_t_TS )
31+ shoreline_TS .append (copy . deepcopy ( b3d .x_s_TS ) )
32+ shoreline_toe_TS .append (copy . deepcopy ( b3d .x_t_TS ) )
4233 if cascade ._marsh_dynamics == True :
43- marsh_edge_TS .append (cascade ._bmft_coupler ._bmftc [0 ].Marsh_edge )
44- forest_edge_TS .append (cascade ._bmft_coupler ._bmftc [0 ].Forest_edge )
45- bmft_elevation_TS .append (cascade ._bmft_coupler ._bmftc [0 ].elevation )
46- marsh_offset_TS .append (cascade ._bmft_coupler ._x_s_offset_TS [0 ][0 ])
34+ marsh_edge_TS .append (copy . deepcopy ( cascade ._bmft_coupler ._bmftc [0 ].Marsh_edge ) )
35+ forest_edge_TS .append (copy . deepcopy ( cascade ._bmft_coupler ._bmftc [0 ].Forest_edge ) )
36+ bmft_elevation_TS .append (copy . deepcopy ( cascade ._bmft_coupler ._bmftc [0 ].elevation ) )
37+ marsh_offset_TS .append (copy . deepcopy ( cascade ._bmft_coupler ._x_s_offset_TS [0 ][0 ]) )
4738
48- save_name = 'C:\\ Users\\ frank\\ OneDrive - University of North Carolina at Chapel Hill\\ Chapter 2\\ Cascade_TS_Output\\ ' \
49- + str (island_names [j ])+ str (Storm_Intensity [z ])+ 'Storms_' + str (RSLR [k ])+ '_RSLR_'
39+ save_name = 'C:\\ Users\\ frank\\ OneDrive - University of North Carolina at Chapel Hill\\ Chapter 2\\ Cascade_TS_Output\\ ' + str (island_names [j ])+ '_' + str (Save_RSLR [k ])+ str (Storm_Intensity [inten ])+ 'RSD_'
5040 if cascade ._marsh_dynamics == True :
5141 Output_info = [
5242 shoreline_TS ,
6757 'forest_edge_TS' ,
6858 'BMFT_offset_TS'
6959 ]
70- for i in range (len (output_var_names )):
71- np .savez (file = save_name + output_var_names [i ],arr = Output_info [i ])
72- print ('Saved ' + str (island_names [j ])+ str (Storm_Intensity [ z ])+ 'Storms_' + str (RSLR [ k ]) + '_RSLR' )
60+ for i in range (len (Output_info )):
61+ np .savez (file = save_name + output_var_names [i ]+ '_NC' ,arr = Output_info [i ])
62+ print ('Saved ' + str (island_names [j ])+ '_' + str (Save_RSLR [ k ])+ str (Storm_Intensity [ inten ]) )
0 commit comments