############################################################################### # Pathname to location of main source code: source(paste0("P:/Research Tools/EMR-MRC-recharge/EMR-R/EMR_main_v34.8.r")) # Folders for input data and output: inputlocation <- "P:/current_development-EMR-MRC/inputs/" outputlocation = "P:/current_development-EMR-MRC/MRC/outputs/" # File names for input data and for output: inputfile <- "sampledata-masserNW95.csv" # units are h, m, mm outputfile <- "output-EMR.masserNW95.1.csv" # Labeling information (site or location name, and time period of record): probeloc = "Masser-NW" timeper = "1995" # Specification of master recession curve: # For an exponential-decline form of elevation E vs. time t, i.e. linear # dE/dt vs. E, the specification should be "polynomial" with two coefficients, # whose values are the intercept and slope of the line dE/dt vs. E. mrc_type <- "polynomial" mrc_coef <- c(1.68446, -0.00654403) # P[0] + P[1]*x + P[2]*x^2 + ... # Lag time between event at land surface and response at water table # (typically, the characteristic travel time of water through the UZ): lag_time = 5 # Fluctuation tolerance (the maximum dE/dt value allowable as system noise # rather than response to incoming water flux): fluc_tol = .005 # Specific yield (when data are with water-table levels) or other appropriate # measure of response sensitivity: capacity = .013 # For data-smoothing, number of data points to left and to right of the # selected point that will be averaged (weighted in proportion to proximity # to that point): N <- 17 ############################################################################### # Read data and convert labeling: rawdata <- read.csv(paste(inputlocation, inputfile, sep=""), header=TRUE) axislabels <- read.csv(paste(inputlocation, inputfile, sep=""), nrows = 1, header=FALSE) # Calculate: myEMR <- applyEMR(inputdata=rawdata, fluc_tol, lag_time, capacity=capacity, mrc_type, mrc_coef, N, save_file=paste(outputlocation, outputfile, sep=""), toplabel=toplabel) # Plot results: toplabel=paste(probeloc, timeper, fluc_tol, lag_time, N, paste(mrc_coef, collapse=" "), sep=" ") suppressWarnings( plot(myEMR, plot_type="mrc") ) suppressWarnings( plot(myEMR, plot_type="hydro") ) ###############################################################################