PySDM_examples.Arabas_et_al_2015.example

 1from open_atmos_jupyter_utils import TemporaryFile
 2from PySDM_examples.Arabas_et_al_2015 import Settings, SpinUp
 3from PySDM_examples.Szumowski_et_al_1998 import Simulation, Storage
 4from PySDM_examples.utils import DummyController
 5
 6from PySDM import Formulae
 7from PySDM.exporters import NetCDFExporter
 8from PySDM.physics import si
 9
10
11def main():
12    settings = Settings(Formulae())
13
14    settings.n_sd_per_gridbox = 25
15    settings.grid = (25, 25)
16    settings.simulation_time = 5400 * si.second
17
18    storage = Storage()
19    simulation = Simulation(settings, storage, SpinUp)
20    simulation.reinit()
21    simulation.run()
22    temp_file = TemporaryFile(".nc")
23    exporter = NetCDFExporter(storage, settings, simulation, temp_file.absolute_path)
24    exporter.run(controller=DummyController())
25
26
27if __name__ == "__main__":
28    main()
def main():
12def main():
13    settings = Settings(Formulae())
14
15    settings.n_sd_per_gridbox = 25
16    settings.grid = (25, 25)
17    settings.simulation_time = 5400 * si.second
18
19    storage = Storage()
20    simulation = Simulation(settings, storage, SpinUp)
21    simulation.reinit()
22    simulation.run()
23    temp_file = TemporaryFile(".nc")
24    exporter = NetCDFExporter(storage, settings, simulation, temp_file.absolute_path)
25    exporter.run(controller=DummyController())