Skip to contents

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,
  TOPAGE_shape,
  path_J2KResult,
  path_J2Kparameter = path_J2KResult,
  path_SAFRAN,
  path_Export,
  calcul.Bm = "EK",
  Largeur_shape = NULL,
  quantile.Bm = NULL,
  TNET_path
)

Arguments

nameSimu

string Name of the simulation

yearStart

numeric Starting year for the simulation

yearEnd

numeric Ending year for the simulation

TOPAGE_shape

string Path to the shapefile with rivers to use for TNET.

path_J2KResult

string Path to the folder with J2000 outputs (.dat)

path_J2Kparameter

string Path to the folder with J2000 parameter files (.par). by default it's path_J2KResult.

path_SAFRAN

string Path to the folder with all hourly SAFRAN NetCDF files.

path_Export

string Path where the simulation forlder will be created.

calcul.Bm

string Method that will be use in TNET_computeHydraulic() to estimate river segments width. ('EK' or 'EKrecal').

Largeur_shape

string Path to the shapefile with some rivers mesured width. Used by TNET_computeHydraulic().

quantile.Bm

numeric Quantile of discharge where all width in Largeur_shape was mesured. Used by TNET_computeHydraulic().

TNET_path

string Path to the C++ TNET folder (must finish by "/sources" folder).

Value

a list of arguments detailed in details section

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 the files created by TNET_readJ2K())

Argument in returned list
All the arguments in the return list are the following:

Argument nameCreated withTnetRUI function that use itinfo
startSimuyearStartTNET_readSAFRAN() TNET_readJ2K() TNET_run()Start of simulation in POSIXct format
endSimuyearEndTNET_readSAFRAN() TNET_readJ2K() TNET_run()End of simulation in POSIXct format
path_J2KResultpath_J2KResultTNET_readJ2K() TNET_computeQlatSout()Path to the folder containing J2K results (ReachLoop.dat and HRULoop.dat)
path_J2Kparameterpath_J2KparameterTNET_readJ2K() TNET_computeQlatSout()Path to the folder containing J2K parameter files (hru.par)
path_SAFRANpath_SAFRANTNET_readSAFRAN()Path to all NetCDF hourly SAFRAN data
TOPAGE_shapeTOPAGE_shapeTNET_readSAFRAN() TNET_computeQ() TNET_computeHydraulic() TNET_computeQlatSout() TNET_computeTnappe() TNET_modifyVeget() TNET_createShape()Path to shapefile with all river segment info
Largeur_shapeLargeur_shapeTNET_computeHydraulic()Path to the shapefile with some rivers mesured width
Bm_methodcalcul.BmTNET_computeHydraulic()Method that will be use to estimate river segments width.
Bm_quantilequantile.BmTNET_computeHydraulic()Quantile of discharge where all width in Largeur_shape was mesured
path_Export_tmppath_ExportTNET_readJ2K() TNET_computeQ() TNET_computeQlatSout()Folder where temporary files will be exported.
path_Exportpath_Export-Folder where the simulation is saved.
shapePathpath_ExportTNET_run()Folder where shapefile use by T-NET will be exported.
constantPathpath_ExportTNET_run()Folder where constant files use by T-NET will be exported.
safranPathpath_ExportTNET_run() TNET_readSAFRAN()Folder where SAFRAN files use by T-NET will be exported.
hydroPathpath_ExportTNET_run() TNET_computeQ() TNET_computeHydraulic() TNET_computeQlatSout() TNET_computeTnappe()Folder where Hydraulic and discharge files use by T-NET will be exported.
shapeNamenameSimu, path_ExportTNET_run()Name of the shapefile saved in safranPath
TNET_pathTNET_pathTNET_run()Path to the T-NET C++ code (must finish by '/sources')
TNET_result_Pathpath_Export-Path created by T-NET with all T-NET results

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",     ): calcul.Bm must be "EK" or "EKrecal"