R/interface_run.R
iw_gerris_interface.Rd
Convert data from infoworks output to gerris input format
iw_gerris_interface(
interface_input_folder,
interface_output_folder,
simulation_name,
return_after = "",
return_output_table = FALSE,
infoworks_time_format = "%d/%m/%Y %H:%M:%S",
gerris_time_format = "%d.%m.%Y %H:%M",
timestep_out = 15,
skip_hours = 0,
flow_threshold = 0.003,
flow_only = FALSE,
outlets_to_suppress = NULL
)
Folder in which the inforowks output files are located
Folder where the gerris input files are saved
Either the whole name of the simulation or a unique part regarding all simulations in the defined folder
if a number is given, the function returns the data after thata data processing step. For more information see details
If TRUE the output table is returned, otherwise it is only saved in the speficied table
The Inforworks time format default is
"%d/%m/%Y %H:%M:%S". For manual adaption see details of strptime()
The Gerris time format default is
"%d.%m.%Y %H:%M". For manual adaption see details of strptime()
The timesteps needed for Gerris in minutes (default is 15)
The hours to skip before Gerris input is needed. This is especially imnportant if infoworks needs a long start-up phase that should not be passed on the gerris
A threshold underneath which the flow is set to 0 to avoid negative flows (in m3/s)
If TRUE, a flow file is sufficient as interface input. All other available input files will also be processed but no total nitrogen is calculated that might lead to an error due to missing nitrogen input files
Character vector defining Infoworks outlet IDs for all outlets to be suppressed. For those outlets the flow will be constantly set to 0.
One table containing all water quality and overflow data per outlet and timestamp at which an overflow occurred plus there very first timestemp of the simulation. One table with statistics per outlet over the whole simulation time. A log file with messages of the data processing.
These are the steps within the function:
load data
set flow to 0 below threshold value
change timesteps
outlets that do not have an ID in Gerris are integrated into the closest vailable outlet in the model
calculating concentration by parameters mass flow and water flow
if TKN < NH4-N --> TKN = NH4-N (not done if floe_only = TRUE)
new table for total Nitrogen (sum of TKN NO2, and NO3) (not done if floe_only = TRUE)
Rename Parameters
Add all Parameters with constant values
Check if all parameters are within the gerris range between min and max and round to 3 significant digits
reshape the data from data per parameter to data per outlet
add a column with gerris id ("Randbedingung")
delete all rows without flow (except for the very first time step, and the event surrounding timesteps) After that data is aggregated for the "stats" output files
collect all data in one single table
change time format
Save table for use in gerris