rmacroliteDiffCoef-methods: Fetch or set the substance diffusion coefficient [m2/s] in an...

Description Usage Arguments Value Examples

Description

Fetch or set the substance diffusion coefficient [m2/s] in an imported MACRO par-file. The diffusion coefficient is DIFF in MACRO par-files.

Usage

1
2
3
4
5
6
7
8
9
rmacroliteDiffCoef(x, ...)

## S3 method for class 'macroParFile'
rmacroliteDiffCoef(x, ...)

rmacroliteDiffCoef( x, ... ) <- value

## S3 replacement method for class 'macroParFile'
rmacroliteDiffCoef(x, ...) <- value

Arguments

x

A macroParFile, as imported with rmacroliteImportParFile-methods

...

Additional parameters passed to specific methods. Currently not used.

value

Single numeric-value. New value of the substance diffusion coefficient [m2/s] to be set in the imported par-file (x).

Value

Single numeric-value. Current value of the substance diffusion coefficient [m2/s] in the imported par-file (x).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
library( "rmacrolite" ) 

# # Setup MACRO directory (if needed)
# rmacroliteSetModelVar( "C:/swash/macro" )



#   Path to an example par-file
par_file_path <- system.file( "par-files", 
    "chat_winCer_GW-X_900gHa_d182.par", 
    package = "rmacrolite" ) 

#   Import the example par-file
par_file <- rmacroliteImportParFile( 
    file = par_file_path ) 



#   Fetch the current parametrization
rmacroliteDiffCoef( x = par_file ) 
    # [1] 5.2e-10

#   Modify the parameter
par_file2 <- par_file
rmacroliteDiffCoef( x = par_file2 ) <- 5.00E-10

#   Check the result
dc <- rmacroliteDiffCoef( x = par_file2 )
dc 
    # [1] 5e-10

#   Internal control
if(dc != 5.00E-10 ){ 
    stop( "Test of rmacroliteDiffCoef() failed" ) } 

#   Clean-up
rm( par_file_path, par_file, par_file2, dc  )

julienmoeys/rmacrolite documentation built on May 22, 2019, 6:31 p.m.