This function will create all working folders and regroup all info needed by TnetRUI TNET set function in one list.
Usage
TNET_initializeSim(
nameSimu,
yearStart,
yearEnd,
hydro_model = "J2000",
weather_model = "SAFRAN",
shapefile,
path_Export,
TNET_path,
...
)
Arguments
- nameSimu
string Name of the simulation
- yearStart
numeric Starting year for the simulation
- yearEnd
numeric Ending year for the simulation
- hydro_model
string Name of the hydrological model used ('J2000' or 'EROS')
- weather_model
string Name of the meteological model used ('SAFRAN')
- shapefile
string Path to the shapefile with rivers to use for TNET.
- path_Export
string Path where the simulation forlder will be created.
- TNET_path
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
|______ nameSimu
|_________ Constant (constantPath)
|_________ hydro (hydroPath)
|_________ Safran (safranPath)
|_________ Shape (shapePath)
|_________ tmp (path_Export_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 TNET_readJ2K()
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 |
startSimu | yearStart | TNET_readSAFRAN() TNET_readJ2K() TNET_run() | Start of simulation in POSIXct format |
endSimu | yearEnd | TNET_readSAFRAN() TNET_readJ2K() TNET_run() | End of simulation in POSIXct format |
hydro_model | hydro_model | Path to the folder containing J2K results (ReachLoop.dat and HRULoop.dat) | |
weather_model | weather_model | Path to the folder containing J2K results (ReachLoop.dat and HRULoop.dat) | |
shapefile | shapefile | TNET_readSAFRAN() TNET_computeQ() TNET_computeHydraulic() TNET_computeQlatSout() TNET_computeTnappe() TNET_modifyVeget() TNET_createShape() | Path to shapefile with all river segment info |
path_Export | path_Export | - | Folder where the simulation is saved. |
path_Export_tmp | path_Export | TNET_readJ2K() TNET_computeQ() TNET_computeQlatSout() | Folder where temporary files will be exported. |
TNET_path | TNET_path | TNET_run() | Path to the T-NET C++ code (must finish by '/sources') |
shapePath | path_Export | TNET_run() | Folder where shapefile use by T-NET will be exported. |
constantPath | path_Export | TNET_run() | Folder where constant files use by T-NET will be exported. |
safranPath | path_Export | TNET_run() TNET_readSAFRAN() | Folder where SAFRAN files use by T-NET will be exported. |
hydroPath | 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. |
shapeName | nameSimu , path_Export | TNET_run() | Name of the shapefile saved in safranPath |
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 | TNET_readJ2K() TNET_computeQlatSout() | mandatory Path to the folder containing J2K results (ReachLoop.dat and HRULoop.dat) |
Bm_method | TNET_computeHydraulic() | mandatory Method that will be use to estimate river segments width. can be |
path_J2Kparameter | TNET_readJ2K() TNET_computeQlatSout() | optional Path to the folder with J2000 parameter files (.par). By default it's path_J2KResult . |
Largeur_shape | TNET_computeHydraulic() | optional Path to the shapefile with some rivers mesured width. Needed only when Bm_method = 'EKrecal' |
quantile.Bm | TNET_computeHydraulic() | optional Quantile of discharge where all width in Largeur_shape was mesured. Needed only when Bm_method = 'EKrecal' |
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 | TNET_readJ2K() TNET_computeQlatSout() | mandatory Path to the .txt file containing contributory flow of each EROS subwatershed. |
path_Qcum | TNET_computeHydraulic() | mandatory Path to the .txt file containing totalized flow of each EROS subwatershed. |
path_Qnappe | TNET_readJ2K() TNET_computeQlatSout() | mandatory Path to the .txt file containing underground flow of each EROS subwatershed. |
date_start_data | TNET_computeHydraulic() | 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 | TNET_readSAFRAN() | mandatory Path to the folder with all hourly SAFRAN NetCDF files. |
Examples
infoSimu <- TNET_initializeSim(nameSimu = 'Present_2010_2021',
yearStart = 2010,
yearEnd = 2021,
TOPAGE_shape = "/home/ghevin/Documents/TempoVeget/Travail/1_Couplage_TopageJ2000V8/Result/Couplage_J2000V8_Topage.shp",
path_J2KResult = "/home/ghevin/Documents/Projet_Saone/1_TOPAGE_T-NET/data/Pass_8/J2000/Final_1970_2021_V5",
path_SAFRAN = '/run/user/9109/gvfs/smb-share:server=ly-data.inra.local,share=ly-unites/Riverly/Hhly/Entrepothh_depot/SAFRAN/NEW/hourly_raw',
path_Export = "/home/ghevin/Documents/T-NET/Results/Rresults",
calcul.Bm = 'EKrecalc',
Largeur_shape = "/home/ghevin/Documents/Projet_Saone/1_TOPAGE_T-NET/data/Pass_8/Largeur_Herve_Pella/Largeur_troncons_hydrographique_decoup_OStrahler.shp",
quantile.Bm = 0.99,
TNET_path = '/home/ghevin/Documents/T-NET/Code/TNET/sources',)
#> Error in TNET_initializeSim(nameSimu = "Present_2010_2021", yearStart = 2010, yearEnd = 2021, TOPAGE_shape = "/home/ghevin/Documents/TempoVeget/Travail/1_Couplage_TopageJ2000V8/Result/Couplage_J2000V8_Topage.shp", path_J2KResult = "/home/ghevin/Documents/Projet_Saone/1_TOPAGE_T-NET/data/Pass_8/J2000/Final_1970_2021_V5", path_SAFRAN = "/run/user/9109/gvfs/smb-share:server=ly-data.inra.local,share=ly-unites/Riverly/Hhly/Entrepothh_depot/SAFRAN/NEW/hourly_raw", path_Export = "/home/ghevin/Documents/T-NET/Results/Rresults", calcul.Bm = "EKrecalc", Largeur_shape = "/home/ghevin/Documents/Projet_Saone/1_TOPAGE_T-NET/data/Pass_8/Largeur_Herve_Pella/Largeur_troncons_hydrographique_decoup_OStrahler.shp", quantile.Bm = 0.99, TNET_path = "/home/ghevin/Documents/T-NET/Code/TNET/sources", ): argument "shapefile" is missing, with no default