-
Notifications
You must be signed in to change notification settings - Fork 11
/
main.py
39 lines (25 loc) · 794 Bytes
/
main.py
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
import argparse
import json
def main():
# Parse information from the command line
parser = argparse.ArgumentParser(prog='SCAMPy')
parser.add_argument("namelist")
parser.add_argument("paramlist")
args = parser.parse_args()
file_namelist = open(args.namelist).read()
namelist = json.loads(file_namelist)
del file_namelist
file_paramlist = open(args.paramlist).read()
paramlist = json.loads(file_paramlist)
del file_paramlist
main1d(namelist, paramlist)
return
def main1d(namelist, paramlist):
import Simulation1d
Simulation = Simulation1d.Simulation1d(namelist, paramlist)
Simulation.initialize(namelist)
Simulation.run()
print('The simulation has completed.')
return
if __name__ == "__main__":
main()