-
Notifications
You must be signed in to change notification settings - Fork 16
SHRIMP: Sub Tot68_82_fromA
The subroutine evaluates, on an analysis-by-analysis basis (and for SAMPLE spots only), the total (calibrated) values for both 206Pb/238U and 208Pb/232Th, using the values for both 206Pb/238U calibration constant and 208Pb/232Th calibration constant, evaluated using the "built-in" expressions specified by Task EqNum = -1 and EqNum = -2.
Note that this subroutine is not traversed unless Switch.DirectAltPD = TRUE and piNumDauPar = 2 (i.e. it applies to Sample analyses in Perm2 and Perm4 only)
Tot68_82_fromA(SpotRow)
SpotRow: Index number of the output-row, to which the value calculated by Tot68_82_fromA is to be written.
Values of type String
t1, t2, t3
Values of type Integer
DpNum, m, SpotRow, w
The function of the subroutine is paraphrased as follows (remembering that piNumDauPar is always 2 by the time we reach this point: it has been specified by the enclosing If statement (within 'Ludwig Q3' of Squid2.50 Procedural Framework: Part 3):
For DpNum = 1 To piNumDauPar
If (pbU = TRUE AND DpNum = 1) OR (pbTh = TRUE AND DpNum = 2)
w = 1
m = piPb6U8_totCol --i.e. write to column ["Total 206Pb/238U"]
Else
w = 2
m = piPb8Th2_totCol --i.e. write to column ["Total 208Pb/232Th"]
End If
There is a slight complication here, arising from the more restricted function of SQUID 2.50 relative to that envisaged/ implemented for SQUID 3.0. You will recall that for SQUID 3.0, I requested all the permissible index-isotope ratio-combinations to be calculated for each permutation (e.g. ["206Pb/238U calibration constant"] in Perm1 can have 204corr-, 207corr-, and 208corr- variants; whereas the range of calibration constants calculated in Perm2, Perm3 and Perm4 can only have 204corr- and 207corr- variants: see the set of Cases in the Intro of the Procedural Framework Part 3).
The issue is that SQUID 2.50 calculates only one (pre-specified by 'index isotope') variant of each calibration constant, so there is never any ambiguity when performing calculations on those values, and using the outputs of those calculations in other expressions downstream. Obviously, such ambiguity does exist in our SQUID 3.0 implementation, so we need to resolve it (at least in a preliminary way) via a similar user-specified control (which would live on the same screen as the controls for SBM-normalisation and SpotAvg vs LinReg) called 'Preferred index isotope', with options 204Pb, 207Pb, 208Pb (strictly, the availability of 208Pb on this list should hinge on whether the selected Task is Perm1-type or not; something to look at later). Down the track, it would be good if there was scope for the user to switch 'preferred index isotope' after the StandardData and SampleData sheets are produced, but we can talk about that later too.
This is only a minor change - I still want you to "calculate everything" as you have been doing. The aim of the control is solely to specify which specific permutation should be propagated to downstream calculations, in a bid to minimise the number of pointless permutations we generate downstream.
The (paraphrased) code continues:
If w = 1 --then we are dealing with the 206Pb/238U system, and
--t1 and t2 refer to calculations that use 'preferred' index
--isotope X to generate ["X-corr206Pb/238Ucalibr.const"]:
t1 = StandardData!WtdMeanA1 --calculated by Sub WtdMeanAcalc
t2 = StandardData!ExtPerr1 --calculated by Sub WtdMeanAcalc
--t3 has NO dependence on index isotope; it is an intrinsic property
--of the 206Pb/238U reference material (see Intro to Part 3):
t3 = StandardData!StdUPbRatio
--Now fill column ["Total 206Pb/238U"] i.e. the VALUE column:
PlaceFormulae "=["UncorrPb/Uconst"] / t1 * t3", SpotRow, m
--Now fill column ["Total 206Pb/238U %err"] i.e. the UNCERTAINTY
--in the adjacent column to the right (i.e. m + 1):
PlaceFormulae "=SQRT( ["UncorrPb/Uconst %err"]^2 + (t2)^2 )", SpotRow, m + 1
Else --we are dealing with the 208Pb/232Th system, and
--t1 and t2 refer to calculations that use 'preferred' index
--isotope X to generate ["X-corr208Pb/232Thcalibr.const"]:
t1 = StandardData!WtdMeanA2 --calculated by Sub WtdMeanAcalc
t2 = StandardData!ExtPerr2 --calculated by Sub WtdMeanAcalc
--t3 has NO dependence on index isotope; it is an intrinsic property
--of the 208Pb/232Th reference material (see Intro to Part 3):
t3 = StandardData!StdThPbRatio
--Now fill column ["Total 208Pb/232Th"] i.e. the VALUE column:
PlaceFormulae "=["UncorrPb/Thconst"] / t1 * t3", SpotRow, m
--Now fill column ["Total 208Pb/232Th %err"] i.e. the UNCERTAINTY
--in the adjacent column to the right (i.e. m + 1):
PlaceFormulae "=SQRT( ["UncorrPb/Thconst %err"]^2 + (t2)^2 )", SpotRow, m + 1
End If
Next DpNum
End Sub