Skip to contents

Write "ATMOSPH.IN" input file

Usage

write_atmosphere(
  atm,
  MaxAL = nrow(atm),
  DailyVar = FALSE,
  SinusVar = FALSE,
  lLai = FALSE,
  lBCCycles = FALSE,
  lInterc = FALSE,
  hCritS = 0,
  round_digits = 2,
  remove_scientific = TRUE
)

Arguments

atm

tibble of input data as defined in prepare_atmospherice_input

MaxAL

Number of meteorological records (default: nrow(atm))

DailyVar

TRUE if HYDRUS-1D is to generate daily variations in evaporation and transpiration (see section 2.7.2.)., otherwise: FALSE (default: FALSE)

SinusVar

TRUE if HYDRUS-1D is to generate sinusoidal variations in precipitation (see section 2.7.2.), otherwise: FALSE(default: FALSE)

lLai

Logical variable indicating that potential evapotranspiration is to be divided into potential evaporation and potential transpiration using eq. (2.75). (default: FALSE)

lBCCycles

TRUE if a set of boundary conditions is to be repeated multiple times, otherwise FALSE(default: FALSE)

lInterc

TRUE if interception is considered using eq. (2.78), otherwise FALSE (default: FALSE)

hCritS

Maximum allowed pressure head at the soil surface (L). (default: 0)

round_digits

digits used for rounding values (default: 2) of all columns besides "tAtm"

remove_scientific

if TRUE scientific notation of numbers is removed, otherwise not (default: TRUE)

Value

Creates ATMOSPH.IN input textfile

Examples

inputs <- tibble::tibble(tAtm = 1:10, Prec = 10, rSoil = 0.4)
atm <- prepare_atmosphere_input(inputs)
atm
#> # A tibble: 10 × 13
#>     tAtm  Prec rSoil rRoot hCritA    rB    hB    ht  tTop  tBot  Ampl  cTop
#>    <int> <dbl> <dbl> <int>  <int> <int> <int> <int> <int> <int> <int> <int>
#>  1     1    10   0.4     0 100000     0     0     0     0     0     0     0
#>  2     2    10   0.4     0 100000     0     0     0     0     0     0     0
#>  3     3    10   0.4     0 100000     0     0     0     0     0     0     0
#>  4     4    10   0.4     0 100000     0     0     0     0     0     0     0
#>  5     5    10   0.4     0 100000     0     0     0     0     0     0     0
#>  6     6    10   0.4     0 100000     0     0     0     0     0     0     0
#>  7     7    10   0.4     0 100000     0     0     0     0     0     0     0
#>  8     8    10   0.4     0 100000     0     0     0     0     0     0     0
#>  9     9    10   0.4     0 100000     0     0     0     0     0     0     0
#> 10    10    10   0.4     0 100000     0     0     0     0     0     0     0
#> # ℹ 1 more variable: cBot <int>
atm_string <- write_atmosphere(atm = atm, MaxAL = nrow(atm))
cat(atm_string)
#> Pcp_File_Version=4
#> *** BLOCK I: ATMOSPHERIC INFORMATION  **********************************
#>    MaxAL                    (MaxAL = number of atmospheric data-records)
#>      10
#>  DailyVar  SinusVar  lLay  lBCCycles lInterc lDummy  lDummy  lDummy  lDummy  lDummy
#>       f      f      f      f      f       f       f       f       f       f
#>  hCritS                 (max. allowed pressure head at the soil surface)
#>       0
#>         tAtm        Prec       rSoil       rRoot      hCritA          rB          hB          ht        tTop        tBot        Ampl        cTop        cBot   RootDepth
#>           1          10         0.4           0      100000           0           0           0           0           0           0           0           0
#>           2          10         0.4           0      100000           0           0           0           0           0           0           0           0
#>           3          10         0.4           0      100000           0           0           0           0           0           0           0           0
#>           4          10         0.4           0      100000           0           0           0           0           0           0           0           0
#>           5          10         0.4           0      100000           0           0           0           0           0           0           0           0
#>           6          10         0.4           0      100000           0           0           0           0           0           0           0           0
#>           7          10         0.4           0      100000           0           0           0           0           0           0           0           0
#>           8          10         0.4           0      100000           0           0           0           0           0           0           0           0
#>           9          10         0.4           0      100000           0           0           0           0           0           0           0           0
#>          10          10         0.4           0      100000           0           0           0           0           0           0           0           0
#> end*** END OF INPUT FILE 'ATMOSPH.IN' **********************************