This function will create all working folders and regroup all info needed to run a T-NET simulation in one list.
Usage
TNET_initializeSim(
name_simu,
year_start,
year_end,
weather_model,
hydro_model,
shapefile,
path_Export,
path_TNET,
...
)Arguments
- name_simu
string Name of the simulation
- year_start
numeric Starting year for the simulation
- year_end
numeric Ending year for the simulation
- weather_model
string Name of the meteological model used ('SAFRAN')
- hydro_model
string Name of the hydrological model used ('J2000' or 'EROS')
- shapefile
string Path to the shapefile with rivers to use for TNET.
- path_Export
string Path where the simulation forlder will be created.
- path_TNET
string Path to the C++ TNET folder (must finish by "/sources" folder).
Details
Export Folder organisation
The organisation of the working folder created is the following:
path_Export
|______ name_simu
|_________ Constant (path_constant)
|_________ hydro (path_hydro)
|_________ Safran (path_safran)
|_________ Shape (path_shape)
|_________ tmp (path_tmp)
This folder organisation is what's expected in order to T-NET to work. More info on T-NET wiki
The tmp folder will be used for files created but not used by T-NET (such as all files created by TnetJ2K_readfiles() or TNET_readEROS())
Argument in returned list
All the arguments in the return list are the following:
| Argument name | Created with | TnetRUI function that use it | info |
| start_simu | year_start | TnetSAFRAN_readfilesNetCDF() TnetJ2K_readfiles() TNET_run() | Start of simulation in POSIXct format |
| end_simu | year_end | TnetSAFRAN_readfilesNetCDF() TnetJ2K_readfiles() TNET_run() | End of simulation in POSIXct format |
| hydro_model | hydro_model | - | |
| weather_model | weather_model | - | |
| shapefile | shapefile | TnetSAFRAN_readfilesNetCDF() TNET_computeQ() TNET_computeHydraulic() TNET_computeQlatSout() TNET_computeTnappe() TNET_modifyVeget() TNET_createShape() | Path to shapefile with all river segment info |
| path_simulation | path_Export | - | Folder where the simulation is saved. |
| path_tmp | path_Export | TnetJ2K_readfiles() TNET_computeQ() TNET_computeQlatSout() | Folder where temporary files will be exported. Those files are used by TnetRUI but will not be used for T-NET model |
| path_TNET | path_TNET | TNET_run() | Path to the T-NET C++ code (must finish by '/sources') |
| path_shape | path_Export | TNET_run() | Folder where shapefile use by T-NET will be exported. |
| path_constant | path_Export | TNET_run() | Folder where constant files use by T-NET will be exported. |
| path_safran | path_Export | TNET_run() TnetSAFRAN_readfilesNetCDF() | Folder where SAFRAN files use by T-NET will be exported. |
| path_hydro | path_Export | TNET_run() TNET_computeQ() TNET_computeHydraulic() TNET_computeQlatSout() TNET_computeTnappe() | Folder where Hydraulic and discharge files use by T-NET will be exported. |
| name_shape | name_simu, path_Export | TNET_run() | Name of the shapefile saved in path_safran |
Arguments needed by Hydrological model
J2000
All arguments to add in the TNET_initializeSim() function if the hydrological model used is J2000
| Argument name | TnetRUI function that use it | info |
path_J2KResult | TnetJ2K_readfiles() | mandatory Path to the folder containing J2K results (ReachLoop.dat and HRULoop.dat) |
path_J2Kparameter | TnetJ2K_readfiles() | optional Path to the folder with J2000 parameter files (.par). By default it's path_J2KResult. |
EROS
All arguments to add in the TNET_initializeSim() function if the hydrological model used is EROS
| Argument name | TnetRUI function that use it | info |
path_Qcontributif | TnetEROS_readfiles() | mandatory Path to the .txt file containing contributory flow of each EROS subwatershed. |
path_Qcum | TnetEROS_readfiles() | mandatory Path to the .txt file containing totalized flow of each EROS subwatershed. |
path_Qnappe | TnetEROS_readfiles() | mandatory Path to the .txt file containing underground flow of each EROS subwatershed. |
date_start_data | TnetEROS_readfiles() | mandatory - string Date of the first day of the data in the EROS files. (at the format %Y-%m-%d) |
| Arguments needed by the weather model | ||
| SAFRAN | ||
All arguments to add in the TNET_initializeSim() function if the weather model used is SAFRAN | ||
| Argument name | TnetRUI function that use it | info |
path_SAFRAN | TnetSAFRAN_readfilesNetCDF() | mandatory Path to the folder with all hourly SAFRAN NetCDF files. |
Examples
infoSimu <- TNET_initializeSim(name_simu = 'Present_2010_2021',
year_start = 2010,
year_end = 2021,
shapefile = "/home/ghevin/Documents/TempoVeget/Travail/1_Couplage_TopageJ2000V8/Result/Couplage_J2000V8_Topage.shp",
path_Export = "/home/ghevin/Documents/T-NET/Results/Rresults",
path_TNET = '/home/ghevin/Documents/T-NET/Code/TNET/sources',
path_J2KResult = "/home/ghevin/Documents/Projet_Saone/1_TOPAGE_T-NET/data/Pass_8/J2000/Final_1970_2021_V5",
path_safran_inputNetCDF = '/run/user/9109/gvfs/smb-share:server=ly-data.inra.local,share=ly-unites/Riverly/Hhly/Entrepothh_depot/SAFRAN/NEW/hourly_raw')
#> Error in TNET_initializeSim(name_simu = "Present_2010_2021", year_start = 2010, year_end = 2021, shapefile = "/home/ghevin/Documents/TempoVeget/Travail/1_Couplage_TopageJ2000V8/Result/Couplage_J2000V8_Topage.shp", path_Export = "/home/ghevin/Documents/T-NET/Results/Rresults", path_TNET = "/home/ghevin/Documents/T-NET/Code/TNET/sources", path_J2KResult = "/home/ghevin/Documents/Projet_Saone/1_TOPAGE_T-NET/data/Pass_8/J2000/Final_1970_2021_V5", path_safran_inputNetCDF = "/run/user/9109/gvfs/smb-share:server=ly-data.inra.local,share=ly-unites/Riverly/Hhly/Entrepothh_depot/SAFRAN/NEW/hourly_raw"): argument "weather_model" is missing, with no default