Syntax:
retstr = al_be_erosion_many_v2(ins)
The MATLAB web server calls this function when the erosion rate data input form is submitted. It takes as input a structure containing string variables, which is supplied by the MATLAB web server. It returns a text string consisting of an output HTML document containing the results of the exposure age calculation. The documentation for the MATLAB web server describes this process in more detail.
There is only one required argument, the input structure ins
. The fields are as follows:
ins.text_block | A text block containing sample information that follows the rules below. |
ins.requesting_IP | The IP address of the requesting page. This is only required when localFlag is not set to 1, that is, if the function is in use on the web server. |
The formatting rules for entering a text block containing data for multiple samples are as follows:
In most cases, pasting directly from an Excel spreadsheet should satisfy the rules. An example of an acceptable input text block appears below.
The thirteen elements are as follows. These are the same as the input parameters on the single-sample form.
skyline.m
.
Here is an example of an acceptable input text block:
FV-TOP-1 38.6139 -109.1878 2527 std 2 2.5 1 4.59e5 1.3e4 2.69e6 8.80e4 FV-TOP-2 38.6136 -109.1955 2580 std 2 2.5 1 202000 8000 1100000 49000 FV-TOP-3 38.6204 -109.2062 2592 std 2 2.5 1 1.02e6 2.60e4 6.05e6 1.31e5 O4-AV-PIT9-NEW -77.8282 160.9762 1300 ant 2 1.9 0.973 6710000 116000 0 0
The optional argument localFlag
turns off most of the server-specific system calls in this function. This option exists only for debugging the function externally to the web server, and is not very well generalized. If localFlag
is set to 1, the function returns a structure of string variables containing only the chunks of HTML that report results, not a single string variable containing the the entire output web page. In addition, plots are created locally, and all of them have names beginning with 'temp.' Of course, not only does this result in repeated overwriting of plots, it requires GMT and ImageMagick to be running locally. Thus, calls to the plotting functions will generate numerous errors on many systems. This aspect of the code would need to be rewritten for general use.
The majority of this function consists of routines that check the input data to make sure it is in the expected form and is within expected bounds, and convert string variables to numerical values. After the data checking is complete, the function then assembles the data sets needed for the Al and Be exposure age calculations, loads the data file containing values for physical constants, and passes data to the function get_al_be_erosion.m
, which actually carries out the erosion rate calculation and returns the result. Finally, this function assembles the output data, generates the required plots, inserts the output data into the output HTML template, and returns the completed results web page.
The only actual calculation that takes place inside this function is the calculation of the uncertainty in the Al Be ratio. Denote the Al/Be ratio by and its uncertainty by . Assuming linear, uncorrelated uncertainties:
(2) |
where is the concentration of nuclide and is its analytical uncertainty.