-
Notifications
You must be signed in to change notification settings - Fork 16
SHRIMP: Sub StdElePpm
The subroutine evaluates, on an analysis-by-analysis basis, the concentration of the 'primary' parent element (usually U, but can be Th, and it is also possible for the user to specify 'No U or Th concentration', whereupon this subroutine is exited).
StdElePpm(Std, SpotRow)
Std: Boolean input which dictates, for each specific invocation of StdElePpm, 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 StdElePpm is to be written.
Values of type Boolean
Std
Values of type Integer
c, p, SpotRow
Values of type Double
v, pdMeanParentEleA, pdConcStdPpm
Vectors comprising values of type Double
BkrdCPS, count_time_sec, NetCps, TotCps
Arrays comprising values of type Double
AbsNetPkCps, NetPkCps, PkCounts, PkCps, PkFerr, SBMCounts, SBMCps, time_stamp_sec, TrimMass, TrimTime
Arrays comprising values of type String
psaSpotNames, psaSpotDateTime
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
p = -Std
If pbUconcstd = TRUE --if user-defined primary element is U
c = piaPpmUcol[p]
Else
c = piaPpmThcol[p]
End If
--Note that if user selected "No U or Th Std", then c = 0:
If c = 0
Exit Sub
End If
If the code reaches this point, then the arithmetic is performed by reference to pdMeanParentEleA, which was calculated in Sq2.50 Procedure Pt 1. Note that piLwrIndx simply refers to the EqNum with the lowest numeric value i.e. piLwrIndx = - 4 (corresponding to the expression for the 'primary parent' concentration constant) for SQUID 2.50 Tasks for U-Th-Pb geochronology. (Ludwig uses the variable piLwrIndx because SQUID 2.50 allows 'non-geochronology' Tasks, which are characterised by the absence of all 'built-in' expressions; in those Tasks (which are outside our scope), all user-defined expressions are 'custom' and piLwrIndx = 1). The code proceeds:
If pdMeanParentEleA > 0 AND pdMeanParentEleA <> SQUID_Error_Value
--define the address for the output:
piSpotOutputCol = piaEqCol[Std, piLwrIndx]
EqnInterp Task.Eqns[piLwrIndx], piLwrIndx, v, 0, 1, 0
--Note that Calamari already does this arithmetic, without context
If v = SQUID_Error_Value
Exit Sub
End If
--pdConcStdPpm is the reference/model ppm value for the primary element,
--in the concentration reference material. In our demo XML, that material
--has the prefix 'M257', and its model U value is 840 ppm.
v = v / pdMeanParentEleA * pdConcStdPpm
End If
If v > 0
--CFs fills the target cell
--fsS converts double-precision number to string (not sure why)
CFs SpotRow, c, fsS(v)
End If
End Sub