-
Notifications
You must be signed in to change notification settings - Fork 16
SHRIMP: Sub ThUfromFormula
sbodorkos edited this page Oct 18, 2017
·
1 revision
The subroutine evaluates, on an analysis-by-analysis basis, the 232Th/238U, using the "built-in" expression for 232Th/238U specified by Task EqNum = -3.
ThUfromFormula(Std, SpotRow)
Std: Boolean input which dictates, for each specific invocation of ThUfromFormula, whether the analysis is that of a 'primary-ratio' reference material, or not.
SpotRow: Index number of the output-row, to which the value calculated by ThUfromFormula is to be written.
Values of type Boolean
Std
Values of type Integer
c, p, SpotRow
Values of type Double
MeanV, MeanVferr
The function of the subroutine is paraphrased as follows:
--Recalling that Std = -1 if TRUE, 0 if FALSE, use
--p and c to define sheet/column for output, and then
p = -Std
c = piaTh2U8col[p]
piSpotOutputCol = piaEqCol[Std, -3]
The code proceeds, apparently without any error-check on the calculated value of MeanV:
EqnInterp Task.Eqns[-3], -3, MeanV, MeanVferr, 1, 1
--Note that Calamari already does this arithmetic, without context
--CFs fills the target cell
--fsS converts double-precision number to string (not sure why)
CFs SpotRow, c, fsS(MeanV)
There is, however, an error-check on MeanVferr, as follows:
If (Std = FALSE OR piaTh2U8ecol[1] > 0) AND
(MeanV <> SQUID_Error_Value) AND
(MeanVferr <> SQUID_Error_Value)
--CFs fills the target cell
--fsS converts double-precision number to string (not sure why)
CFs SpotRow, c + 1, fsS(100 * MeanVferr)
End If
End Sub