FishMet: Fish feeding and appetite model, OPEN EDITION
0.1
FishMet: Fish feeding and appetite model, OPEN EDITION
|
Module that defines the runtime behaviour of the model. More...
Data Types | |
type | output_arrays_step_def |
This data structure keeps the output values for each time step. It should normally be instantiated as an allocatable array of the size equal to the total number of time steps in the model run. More... | |
type | output_stats_total_def |
Overall output statistics that are output from the model. More... | |
Functions/Subroutines | |
pure integer(long) function | total_timesteps (hours) |
Calculate the total number of time steps in the model from the number of hours. This in fact converts hours to seconds. More... | |
impure subroutine | output_arrays_init (time_steps) |
Allocate model output arrays output_arrays. More... | |
impure subroutine | output_arrays_update_step (this_fish, time_step, temperature) |
Update model output arrays output_arrays. More... | |
impure subroutine | output_arrays_add_ingested (is_given, is_eaten, time_step, add_eaten) |
Update the cumulative count of food items ingested. This cannot normally be done in output_arrays_update_step() and requires an input argument. More... | |
impure subroutine | output_arrays_save_csv (file_name, is_gui_dialog, is_write_error) |
Save the model output arrays to a CSV data file. More... | |
impure subroutine | output_arrays_save_rate_data_csv (file_name, is_gui_dialog, is_write_error) |
Save the rate data arrays to a CSV data file. More... | |
impure subroutine | csv_file_error_report (csv_handle, is_gui_dialog) |
Report CSV file write error. More... | |
impure subroutine | stomach_transport_save_csv (csv_file) |
Save the stomach transport data pattern for a single food item. More... | |
impure subroutine | appetite_function_save_csv (csv_file) |
Save the appetite function the_fish::appetite_func() pattern for plotting, testing or analysis. More... | |
pure character(len=:) function, allocatable | model_output_stats_txt () |
Produce a text string containing general model output statistics. More... | |
character(len=:) function, allocatable | model_output_stats_row_csv (show_header) |
Produce a text string containing general model output statistics. More... | |
impure subroutine | test_run () |
The procedure below is TEMPORARY, for testing and debugging. More... | |
impure subroutine | init_provisioning (time_steps) |
Initialise the food provisioning schedule / pattern. More... | |
impure integer function, dimension(:), allocatable | get_food_schedule_display () |
Determine the food schedule array for separate display and analysis The primary role of this function is to plan (produce and display) the food provisioning pattern before simulation in GUI. More... | |
real(srp) function, dimension(:), allocatable | get_ingestion_ratio_waste (rate_unit) |
calculate the array of the consumption ratio, i.e. eaten/provided, so it is also easy to calculate the waste rate More... | |
Variables | |
logical, parameter | is_extended_logging_debug_test = .FALSE. |
Flag for extended/detailed debug logging. More... | |
logical, parameter, private | is_urinal_branchial_kj_day = .TRUE. |
Flag that defines how urinal and branchial energy loss (UE+ZE) is calculated for model output arrays. If TRUE, UE+ZE is computed in kJ per kg per day (default), otherwise, in O2 equivalent unit: mg O2 / kg/hour. More... | |
integer, public | gui_idx_progress |
Progress bar widget ID for the GUI mode, needed to update at runtime. More... | |
type(output_arrays_step_def), dimension(:), allocatable, public | output_arrays |
output_arrays instantiates the global data structure that keeps the model output arrays. More... | |
type(output_stats_total_def) | output_stats |
output_stats instantiates non-array global data structure that keeps total model output statistics, that are not arrays by time step. More... | |
Module that defines the runtime behaviour of the model.
pure integer(long) function simulate::total_timesteps | ( | integer, intent(in), optional | hours | ) |
Calculate the total number of time steps in the model from the number of hours. This in fact converts hours to seconds.
[in] | hours | Optional hours to be converted to seconds. If absent, the default value is obtained from the global parameter commondata::global_run_model_hours. |
Definition at line 115 of file m_simulate.f90.
impure subroutine simulate::output_arrays_init | ( | integer(long), intent(in), optional | time_steps | ) |
Allocate model output arrays output_arrays.
[in] | time_steps | Optional overall number of time steps of the model |
pure
because it allocates a global module-scope array. Definition at line 131 of file m_simulate.f90.
impure subroutine simulate::output_arrays_update_step | ( | class(fish), intent(in) | this_fish, |
integer(long), intent(in), optional | time_step, | ||
real(srp), intent(in), optional | temperature | ||
) |
Update model output arrays output_arrays.
[in] | this_fish | The fish that is participating in the simulation run. |
[in] | time_step | Optional time step, which coincides with the index of the model output arrays. The default value used if the argument is not given is defined by the global time step commondata::global_time_step. |
[in] | temperature | Optional temperature |
Update oxygen uptake, convert to mg O2 per kg of body mass per hour
Update baseline meabolic rate, mg O2 per kg per hour
Update Active metabolic rate, mg O2 per kg per hour
Update SDA, mg O2 per hour per kg
Update urinal and branchial energy in kJ/kg per day
Alternatively, urinal and branchial energy is output as equivalent mg O2 per kg per hour
Definition at line 181 of file m_simulate.f90.
impure subroutine simulate::output_arrays_add_ingested | ( | logical, intent(in) | is_given, |
logical, intent(in) | is_eaten, | ||
integer(long), intent(in), optional | time_step, | ||
integer, intent(in), optional | add_eaten | ||
) |
Update the cumulative count of food items ingested. This cannot normally be done in output_arrays_update_step() and requires an input argument.
[in] | is_given | Logical indicator whether a fod item is ingested at the current time step (TRUE) or not (FALSE). The cumulative number of food items consumed is updated (added) only if this parameter is TRUE. |
[in] | is_eaten | Logical indicator whether a fod item is ingested at the current time step (TRUE) or not (FALSE). The cumulative number of food items consumed is updated (added) only if this parameter is TRUE. |
[in] | time_step | Optional time step, which coincides with the index of the model output arrays. The default value used if the argument is not given is defined by the global time step commondata::global_time_step. |
[in] | add_eaten | Optional number of food items ingested, default value is 1. |
To update the cumulative count of food items ingested, the number of items ingested at this time step is added to the value at the previous time step. At the first step the counter is set to zero.
To update the cumulative count of food items not ingested, the number of items not ingested at this time step is added to the value at the previous time step. At the first step the counter is set to zero.
Definition at line 293 of file m_simulate.f90.
impure subroutine simulate::output_arrays_save_csv | ( | character(len=*), intent(in) | file_name, |
logical, intent(in), optional | is_gui_dialog, | ||
logical, intent(out), optional | is_write_error | ||
) |
Save the model output arrays to a CSV data file.
[in] | file_name | The name of the CSV file to save the data into. |
[in] | is_gui_dialog | Optional indicator that error should report to GUI. |
[out] | is_write_error | Optional file error indicator flag, if TRUE, reports error |
handle_csv
is the CSV file handle object defining the file name, Fortran unit and error descriptor, see HEDTOOLS manual for details.csv_record
is the temporary character string that keeps the whole record of the file, i.e. the whole row of the spreadsheet table.COLUMNS
is a parameter array that keeps all column headers; its size is equal to the total number of variables (columns) in the data spreadsheet file.Definition at line 374 of file m_simulate.f90.
impure subroutine simulate::output_arrays_save_rate_data_csv | ( | character(len=*), intent(in) | file_name, |
logical, intent(in), optional | is_gui_dialog, | ||
logical, intent(out), optional | is_write_error | ||
) |
Save the rate data arrays to a CSV data file.
[in] | file_name | The name of the CSV file to save the data into. |
[in] | is_gui_dialog | Optional indicator that error should report to GUI. |
[out] | is_write_error | Optional file error indicator flag, if TRUE, reports error |
handle_csv
is the CSV file handle object defining the file name, Fortran unit and error descriptor, see HEDTOOLS manual for details.csv_record
is the temporary character string that keeps the whole record of the file, i.e. the whole row of the spreadsheet table.Definition at line 506 of file m_simulate.f90.
impure subroutine simulate::csv_file_error_report | ( | type(csv_file), intent(inout) | csv_handle, |
logical, intent(in), optional | is_gui_dialog | ||
) |
Report CSV file write error.
[in] | is_gui_dialog | Optional indicator that error should report to GUI. |
Definition at line 626 of file m_simulate.f90.
impure subroutine simulate::stomach_transport_save_csv | ( | character(len=*), intent(in) | csv_file | ) |
Save the stomach transport data pattern for a single food item.
[in] | csv_file | The name of the CSV file is given as the argument. |
Definition at line 638 of file m_simulate.f90.
impure subroutine simulate::appetite_function_save_csv | ( | character(len=*), intent(in) | csv_file | ) |
Save the appetite function the_fish::appetite_func() pattern for plotting, testing or analysis.
[in] | csv_file | The name of the CSV file is given as the argument. |
Definition at line 661 of file m_simulate.f90.
pure character(len=:) function, allocatable simulate::model_output_stats_txt |
Produce a text string containing general model output statistics.
Definition at line 690 of file m_simulate.f90.
character(len=:) function, allocatable simulate::model_output_stats_row_csv | ( | logical, intent(in), optional | show_header | ) |
Produce a text string containing general model output statistics.
[in] | show_header | Optional flag indicating that variable names header is included as the first line of the string |
Definition at line 768 of file m_simulate.f90.
impure subroutine simulate::test_run |
The procedure below is TEMPORARY, for testing and debugging.
Maximum number of food items to show, this should never be greater than commondata::max_food_items_index.
Definition at line 934 of file m_simulate.f90.
impure subroutine simulate::init_provisioning | ( | integer(long), intent(in), optional | time_steps | ) |
Initialise the food provisioning schedule / pattern.
[in] | time_steps | Optional overall number of time steps of the model |
pure
because it allocates a global module-scope array. Definition at line 1251 of file m_simulate.f90.
impure integer function, dimension(:), allocatable simulate::get_food_schedule_display |
Determine the food schedule array for separate display and analysis The primary role of this function is to plan (produce and display) the food provisioning pattern before simulation in GUI.
Definition at line 1299 of file m_simulate.f90.
real(srp) function, dimension(:), allocatable simulate::get_ingestion_ratio_waste | ( | integer, intent(in), optional | rate_unit | ) |
calculate the array of the consumption ratio, i.e. eaten/provided, so it is also easy to calculate the waste rate
[in] | rate_unit | Optional rate parameter, the rate is calculated per this number of seconds, the default is per minute |
Definition at line 1324 of file m_simulate.f90.
logical, parameter simulate::is_extended_logging_debug_test = .FALSE. |
Flag for extended/detailed debug logging.
Definition at line 26 of file m_simulate.f90.
|
private |
Flag that defines how urinal and branchial energy loss (UE+ZE) is calculated for model output arrays. If TRUE, UE+ZE is computed in kJ per kg per day (default), otherwise, in O2 equivalent unit: mg O2 / kg/hour.
Definition at line 32 of file m_simulate.f90.
integer, public simulate::gui_idx_progress |
Progress bar widget ID for the GUI mode, needed to update at runtime.
Definition at line 35 of file m_simulate.f90.
type(output_arrays_step_def), dimension(:), allocatable, public simulate::output_arrays |
output_arrays instantiates the global data structure that keeps the model output arrays.
Definition at line 96 of file m_simulate.f90.
type(output_stats_total_def) simulate::output_stats |
output_stats instantiates non-array global data structure that keeps total model output statistics, that are not arrays by time step.
Definition at line 109 of file m_simulate.f90.