Calculate daily totals updating the soil moisture until equilibrium.

spin_up(mdat, dtot)

Arguments

mdat

list with meteorological data (see the details section).

dtot

list with daily totals (see the details section).

Value

list, daily totals

Details

The list with meteorological data, mdat, should have the following components:

  • num_lines ..... double, length of meteorol. variable lists

  • lat_deg ....... double latitude (degrees)

  • elv_m ......... double, elevation (m)

  • year .......... double, year

  • sf ............ list, fraction of sunshine hours

  • tair .......... list, mean daily air temperature (deg. C)

  • pn ............ list, precipitation (mm/d)

The list with daily totals, dtot, should have the following component:

  • wm ............ list, daily soil moisture (mm)

Examples

daily_totals <- matrix(data = rep(0, 366), nrow = 366, ncol = 1)
daily_totals <- as.data.frame(daily_totals)
names(daily_totals) <- c("wn")
my_file <- system.file("extdata/example_data.csv", package = "splash")
my_data <- splash::read_csv(my_file, 2000)
my_data$lat_deg <- 37.7
my_data$elv_m <- 142
daily_totals <- splash::spin_up(my_data, daily_totals)
#> Spun 2 years
cat(sprintf("Spin-Up:\n"))
#> Spin-Up:
for (i in seq(from = 1, to = my_data$num_lines, by = 1)) {
  if (i == 1) cat(sprintf("Day\tWn (mm)\n"))
  cat(sprintf("%d\t%0.6f\n", i, daily_totals$wn[i]))
}
#> Day	Wn (mm)
#> 1	54.619772
#> 2	54.087045
#> 3	53.536283
#> 4	55.306694
#> 5	54.731537
#> 6	54.188802
#> 7	53.605105
#> 8	52.983214
#> 9	52.768340
#> 10	53.174901
#> 11	65.120096
#> 12	65.086380
#> 13	65.795967
#> 14	67.469915
#> 15	73.145848
#> 16	86.227233
#> 17	85.509462
#> 18	104.831503
#> 19	107.973813
#> 20	107.864185
#> 21	110.751404
#> 22	112.406138
#> 23	135.885480
#> 24	150.000000
#> 25	150.000000
#> 26	149.134389
#> 27	148.250522
#> 28	147.368029
#> 29	146.466003
#> 30	150.000000
#> 31	150.000000
#> 32	150.000000
#> 33	148.924898
#> 34	150.000000
#> 35	150.000000
#> 36	150.000000
#> 37	149.003068
#> 38	147.795242
#> 39	146.589334
#> 40	149.020987
#> 41	150.000000
#> 42	150.000000
#> 43	150.000000
#> 44	150.000000
#> 45	150.000000
#> 46	149.150830
#> 47	150.000000
#> 48	150.000000
#> 49	148.662780
#> 50	147.242169
#> 51	150.000000
#> 52	150.000000
#> 53	150.000000
#> 54	150.000000
#> 55	148.895879
#> 56	149.628050
#> 57	150.000000
#> 58	150.000000
#> 59	149.393890
#> 60	150.000000
#> 61	148.391305
#> 62	150.000000
#> 63	148.540796
#> 64	147.645532
#> 65	150.000000
#> 66	149.162043
#> 67	148.276081
#> 68	150.000000
#> 69	150.000000
#> 70	148.358736
#> 71	147.834670
#> 72	145.771665
#> 73	143.658587
#> 74	141.458491
#> 75	139.135607
#> 76	136.823471
#> 77	134.610197
#> 78	132.222750
#> 79	129.882281
#> 80	127.692012
#> 81	125.289153
#> 82	122.789788
#> 83	120.765904
#> 84	118.414058
#> 85	116.101224
#> 86	113.719623
#> 87	111.365679
#> 88	108.990383
#> 89	106.553135
#> 90	103.902858
#> 91	101.056938
#> 92	97.879204
#> 93	94.561686
#> 94	91.274783
#> 95	88.321891
#> 96	85.453009
#> 97	82.546335
#> 98	79.522307
#> 99	76.578809
#> 100	73.696838
#> 101	70.676186
#> 102	67.481244
#> 103	64.510371
#> 104	65.838844
#> 105	66.378334
#> 106	63.581292
#> 107	70.749648
#> 108	87.415950
#> 109	84.978605
#> 110	81.843171
#> 111	78.593939
#> 112	75.208419
#> 113	72.035721
#> 114	68.849893
#> 115	65.518110
#> 116	62.203157
#> 117	58.877554
#> 118	55.673514
#> 119	52.696427
#> 120	49.778971
#> 121	46.906695
#> 122	44.171984
#> 123	41.575137
#> 124	39.124863
#> 125	36.801058
#> 126	34.617305
#> 127	32.565250
#> 128	44.436003
#> 129	49.165135
#> 130	46.261031
#> 131	43.528812
#> 132	40.947017
#> 133	38.472821
#> 134	36.132308
#> 135	46.181249
#> 136	55.031939
#> 137	55.052717
#> 138	51.786046
#> 139	48.597291
#> 140	45.545916
#> 141	42.628105
#> 142	39.856289
#> 143	37.252668
#> 144	34.821215
#> 145	32.571986
#> 146	30.500920
#> 147	28.574018
#> 148	26.775746
#> 149	25.101510
#> 150	23.551271
#> 151	22.115514
#> 152	20.784740
#> 153	19.606270
#> 154	18.517272
#> 155	17.510840
#> 156	16.581531
#> 157	15.721598
#> 158	14.933631
#> 159	14.206447
#> 160	17.741658
#> 161	16.777084
#> 162	15.891389
#> 163	15.081070
#> 164	14.341396
#> 165	13.671794
#> 166	13.057260
#> 167	12.496875
#> 168	11.986290
#> 169	11.517073
#> 170	11.079280
#> 171	10.681119
#> 172	10.325391
#> 173	10.001563
#> 174	9.705514
#> 175	9.430134
#> 176	9.177511
#> 177	8.948350
#> 178	8.744328
#> 179	8.562080
#> 180	8.396358
#> 181	8.244475
#> 182	8.101343
#> 183	8.074342
#> 184	8.047322
#> 185	8.018086
#> 186	7.993862
#> 187	7.969863
#> 188	7.945927
#> 189	7.924267
#> 190	7.912136
#> 191	7.914105
#> 192	7.922384
#> 193	7.931438
#> 194	7.939779
#> 195	7.945331
#> 196	7.956974
#> 197	7.973129
#> 198	7.981937
#> 199	7.983415
#> 200	7.989997
#> 201	8.011655
#> 202	8.036719
#> 203	8.060022
#> 204	8.080322
#> 205	8.112888
#> 206	8.150661
#> 207	8.185929
#> 208	8.213560
#> 209	8.231881
#> 210	8.263972
#> 211	8.302234
#> 212	8.342837
#> 213	8.387138
#> 214	8.399131
#> 215	10.197046
#> 216	10.057713
#> 217	9.926424
#> 218	9.809987
#> 219	9.707896
#> 220	9.612056
#> 221	9.521972
#> 222	9.441714
#> 223	9.370780
#> 224	9.321525
#> 225	9.289184
#> 226	9.260466
#> 227	9.241201
#> 228	9.226706
#> 229	9.222017
#> 230	9.219429
#> 231	9.213360
#> 232	9.206454
#> 233	9.203571
#> 234	9.211203
#> 235	9.221234
#> 236	9.228649
#> 237	9.239379
#> 238	9.266407
#> 239	9.294172
#> 240	9.323723
#> 241	9.355048
#> 242	9.379814
#> 243	9.401295
#> 244	13.104287
#> 245	13.963352
#> 246	13.647484
#> 247	13.362226
#> 248	13.101440
#> 249	12.871676
#> 250	12.678947
#> 251	12.511144
#> 252	12.359704
#> 253	12.217959
#> 254	12.092126
#> 255	11.987116
#> 256	11.896515
#> 257	12.201166
#> 258	13.046478
#> 259	12.890259
#> 260	12.752722
#> 261	12.642457
#> 262	12.549298
#> 263	12.469152
#> 264	12.400976
#> 265	12.333803
#> 266	12.531516
#> 267	12.457176
#> 268	12.396439
#> 269	12.351165
#> 270	12.314857
#> 271	12.280115
#> 272	12.246832
#> 273	12.232679
#> 274	12.240852
#> 275	12.121668
#> 276	12.012512
#> 277	11.909714
#> 278	11.817294
#> 279	11.736146
#> 280	11.667722
#> 281	11.608357
#> 282	11.561181
#> 283	14.571315
#> 284	19.374614
#> 285	19.566341
#> 286	19.038907
#> 287	18.552463
#> 288	18.107811
#> 289	17.695328
#> 290	17.316699
#> 291	16.970352
#> 292	16.650003
#> 293	16.355925
#> 294	16.554861
#> 295	16.273301
#> 296	16.020844
#> 297	15.791348
#> 298	15.582710
#> 299	20.215958
#> 300	36.437669
#> 301	36.937090
#> 302	44.927075
#> 303	53.468496
#> 304	58.211508
#> 305	57.088153
#> 306	55.800070
#> 307	54.507216
#> 308	53.194826
#> 309	51.910301
#> 310	50.703269
#> 311	49.528669
#> 312	48.360095
#> 313	47.211408
#> 314	47.289925
#> 315	47.954440
#> 316	47.070367
#> 317	46.196037
#> 318	50.878405
#> 319	51.360085
#> 320	51.020908
#> 321	51.603264
#> 322	50.810448
#> 323	50.011971
#> 324	49.215872
#> 325	48.456286
#> 326	51.612659
#> 327	50.879924
#> 328	50.157486
#> 329	49.401714
#> 330	48.663324
#> 331	48.182395
#> 332	47.706723
#> 333	46.987040
#> 334	56.043609
#> 335	55.381375
#> 336	54.755990
#> 337	54.145134
#> 338	53.526016
#> 339	52.888155
#> 340	52.250660
#> 341	51.624160
#> 342	53.126789
#> 343	52.834463
#> 344	52.362429
#> 345	51.764073
#> 346	52.867257
#> 347	54.775500
#> 348	57.065474
#> 349	59.349375
#> 350	60.562902
#> 351	59.999987
#> 352	59.425155
#> 353	58.897302
#> 354	58.343770
#> 355	57.793554
#> 356	59.574062
#> 357	59.437600
#> 358	58.934698
#> 359	58.705614
#> 360	58.201413
#> 361	57.706341
#> 362	57.179062
#> 363	56.665640
#> 364	56.160188
#> 365	55.668054
#> 366	55.151466