-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
31 lines (25 loc) · 714 Bytes
/
main.py
File metadata and controls
31 lines (25 loc) · 714 Bytes
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
#!/usr/bin/python
# Study to make a shallow water model following a video of youtube.
# Video: https://www.youtube.com/watch?v=7_kcM8Yfv3A
import parameters as param
import initialization as init
import dataIO as dio
import swe_rk4
import varGlobal as var
def main():
'''
i: Iterating variable
nt: Maximum timesteps
'''
print("Reading parameters and variables")
init.init()
print("Initialization finished. Start calculation.")
#print(var.h[:,:,0])
for i in range(1,param.nt):
print("Integrating for timesstep t = "+str(i)+" of "+str(param.nt-1))
swe_rk4.__init__()
swe_rk4.swe_rk4(i)
dio.output_netcdf()
print("Simulation all completed. Enjoy your work!")
if __name__ == '__main__':
main()