monarchs.core.driver.main
- monarchs.core.driver.main(model_setup, grid)
Main loop function. This calls loop_over_grid, which in turn calls timestep_loop and the other functions (vertical, lake, and lid), a total of <t_steps_per_day> times per <day>. This then calls lateral_movement (i.e. water movement) once per <day>.
This also handles input/output via netCDF.
- Parameters:
model_setup (module) – The model setup module imported by
configuration.py. This contains the following arguments used in this function:- row_amountint
number of rows in the model grid.
- col_amountint
number of columns in the model grid.
- met_output_filepathstr
path to netCDF file containing the meteorological data used to drive the model.
- daysint
Number of days to run in total. [days]
- t_stepsint
Number of hours to run in each day. This should most likely be 24. [h]
- lat_grid_sizefloat
Size of each lateral grid cell, used to determine the lateral flow of water [m]
- timestepint
Amount of seconds to run in each t_step, most likely 3600. [s]
- output_filenamestr, optional
Name of the netCDF file used to save model output, if applicable.
- vars_to_save: tuple, optional
Tuple containing the variables that you want to save from your model grid. These will be added to the output netCDF file defined in output_filename.
grid (numpy structured array) – Model grid, containing the data specified in get_spec() of monarchs.core.model_grid.
- Returns:
grid – Model grid at the end of the run.
- Return type:
numpy structured array