Skip to contents

TnetRUI is a R package to prepare all needed data in order to run T-NET.

Installation

The package can be installed using the following way:

remotes::install_gitlab(repo = 'guillaume.hevin/tnet_rui', host = 'forge.inrae.fr')

It can be loaded using library(TnetRUI) as any other package.

Use of TnetRUI for T-NET

TnetRUI is a R package that create all the time related input data in order to launch a T-NET modelisation.

Input models

T-NET relly on hydrological and meteorological models in input. For now, the models implemented are the following:

Meteorological models

Meteorological models are needed by T-NET to have meteorological information on the watershed. The needed data from those models are the following:

  • Air temperature
  • Air humidity
  • Wind velocity
  • Long wave radiation
  • Short wave radiation

The data needs to be at the hourly time step, on each SAFRAN cell grid.

Additional information and how to use them in a T-NET modelisation can be found on the descriptive page of each implemented meteorological models:

Hydrological models

Hydrological models are needed by T-NET to have rivers discharge. The needed data from those models are the following:

  • Surface discharge
  • Underground lateral flow
  • Underground water temperature

The data needs to be at the daily time step, on each T-NET segment.

Additional information and how to use them in a T-NET modelisation can be found on the descriptive page of each implemented hydrological models:

Hydraulic models

Hydraulic models are needed in T-NET to have an idea of the shape of each T-NET segments. For know, only approximation coming from discharge or observations are implemented. The needed data for T-NET computation are the following:

  • river width
  • river depth
  • water travel time in the river

The data needs to be at the daily time step, on each T-NET segment.

Additional information on how each of those variables are computed can be found on the following function documentations:

Hydraugraphic network

An hydraugraphic network is needed in Input of TnetRUI and T-NET. This shapefile can completed using different function TNETShape in the TnetRUI package, but in the future all the computation on the hydraugraphic network will be created on the TnetShape QGIS plugin.

The information needed for now are the the following:

  • gid: segment ID
  • ND_INI: ID of the initial node
  • ND_FIN: ID of the final node

Files organisation

T-NET use a specific folder organisation for the input data. The needed files needs to be in the following folders:

  • Constant
    • file with segment ID to export
  • hydro
    • Bm.nc
    • H.nc
    • Qaval.nc
    • Qlat_ms.nc
    • Tg.nc
    • TPS.nc
  • Safran
    • LWdown.nc
    • Qair.nc
    • SWdown.nc
    • Tair.nc
    • Wind.nc
  • Shape
    • Shapefile with the hydraugraphic network

All those folder are created by TNET_initializeSim(). For all temporaries file created by TnetRUI and not needed by T-NET, a tmp folder created by TNET_initializeSim().

Dependances

TnetRUI will use the following packages:

  • data.table for data.frame computation

  • ncdf4 for file export and import

  • lubridate for all date manipulation

  • stringr for string manipulations

  • rlist for list manipulation

  • sf for shapefile manipulation

  • raster for raster manipulation

  • whitebox for drain area computation

Whitebox specification

whitebox is used in the function TNETshape_computeAreaDrain() and need some external installation to work.

  1. Download the whitebox binary

  2. Link the binary to the whitebox package

    • The binary needs to be linked to the package using the following sentence
wbt_init(exe_path='/home/user/path/to/whitebox_tools')