masscalc: Calculate mass based on MT3D Model Run

Description Usage Arguments Examples

Description

This function reads in a btn file, hds file, and ucn file to calculate the total mass (in units of lbs) in the model at each times step.

Usage

1
masscalc(BTN, HDS, UCN)

Arguments

BTN

This is the name of the .btn file (without the file extension)

HDS

This is the name of the .hds file (without the file extension)

UCN

This is the name of the .ucn file (without the file extension)

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
38
39
40
41
42
43
masscalc(BTN = "T04", HDS = "F95", UCN = "T041")

# A tibble: 32,325,120 x 7
   YEARS   LAY   ROW   COL THICK  CONC  MASS
   <dbl> <int> <int> <int> <dbl> <dbl> <dbl>
1      1     1     1     1     0     0     0
2      1     1     1     2     0     0     0
3      1     1     1     3     0     0     0
4      1     1     1     4     0     0     0
5      1     1     1     5     0     0     0
6      1     1     1     6     0     0     0
7      1     1     1     7     0     0     0
8      1     1     1     8     0     0     0
9      1     1     1     9     0     0     0
10     1     1     1    10     0     0     0
# ... with 32,325,110 more rows

# Determine the total mass in the top layer of model for each timestep:
m <- masscalc(BTN = "T04", HDS = "F95", UCN = "T041")
m %>% filter(LAY == 1) %>%
      group_by(YEARS) %>%
      summarise(TOT = sum(MASS))
# A tibble: 16 x 2
   YEARS      TOT
   <dbl>    <dbl>
1      1 4866.663
2      2 4896.831
3      3 4926.615
4      4 4954.909
5      5 4981.363
6      6 5005.803
7      7 5028.133
8      8 5048.347
9      9 5066.414
10    10 5082.366
11    11 5096.217
12    12 5107.996
13    13 5117.772
14    14 5125.564
15    15 5101.810
16   100 1442.831

# Note: the total mass is in units of lbs

dpphat/MFtools documentation built on May 15, 2019, 1:47 p.m.