computer analysis of atomic absorption spectrophotometer generated data: basic and fortran 77...

30
Computers & Geosciences Vol. 14, No. 2, pp. 151-180, 1988 0098-3004/88 $3.00 + 0.00 Pnnted in Groat Britain. All rights reserved Copyright ~ 1988 Pergamon Presto pk COMPUTER ANALYSIS OF ATOMIC ABSORPTION SPECTROPHOTOMETER GENERATED DATA: BASIC AND FORTRAN 77 PROGRAMS UwE BRAND and EDWARD G. LOREK Department of Geological Sciences, Brock University, St. Catharines, Ontario, L2S 3AI Canada (Received 17 June 1987) Abstract--The atomic absorption SlX-ctrophotometer(AAS) programs (FORTRAN 77, v.2.0 and BASIC, v.2.1) allow for the efficient computation of chemical data generated by atomic absorption spectro- photometer. In the BASIC program, additional data. such as weight and insoluble residue, are entered directly into the program from a digital balance linked by RS-232C line to the minicomputer. In the FORTRAN 77 program weight, insoluble residue, and AAS are entered manually. Both programs have full editing facilities for easy error recovery, and the calculated data is printed in publishable table form. Also a terminal emulator program, in the BASIC version, is included to handle the efficient and automatic transfer of data to mainframe computers. Key Word~: Geochemistry, Chemical data (AAS) management. BASIC and FORTRAN 77 programs, Weight and insoluble residue manipulation. Error recovery. Publishable printout, Precision computation, Data transfer capabilities. INTRODUCTION In the past, rccalculation of raw chemical data was either done manually or by pocket calculator. Both of these methods are timc consuming and prone to errors. Time spent on inputting the raw data and calculating it can be reduced by one to three orders of magnitude over the conventional methods. This report describes a BASIC program that takes chemical numbers generated in concentration values (ppm or mg/ml) by atomic absorption analysis (Va- rian 1475rM), weight and insoluble residue data of powdered samples and calculates the chemical con- centrations in the rock; prints the results in publish- able table form; outputs 1000 St/Ca (wt), mSr/'*Ca, Sr/Na (wt), and *'St/tuNa ratios; and automatically transmits the recalculated data to the mainframe com- puter (Burrough's B7900) for further data handling, plotting, statistical analysis, and storage. This pro- gram is for use with Hewlett-Packard Series 80 mini- computers. The FORTRAN 77 version calculates concentra- tion values for solution using the absorbanc¢ readings and concentrations of user prepared reference (stan- dard) solutions analyzed on any atomic absorption spectrophotometer. The values are corrected for im- purities contained in the water, acids, and chemicals determined by analyzing "blank" solutions, which contain everything but sample material. Concentra- tions in rock and mineral powders are calculated after weights, insoluble residues, and absorbances of sam- ples are entered manually into the program. Com- puted data can be printed in table form and further analyzed using commercially available programs. This program was written with Microsoft* FOR- TRAN 77,v. 2.0. The ELECON programs consists of modules that handle the various tasks involved in recalculating chemical data. Also, programs contain edit and printout facilities at all stages for easy recov- ery of entered due to input or machine error. The programs have the capacity of handling up to 12 (10 in FORTRAN 77 version) different elements analyzed by atomic absorption spectrophotometer (AAS), and up to 500 samples for a total of 6000 (5000) data points. In addition, there are provisions for user- defined 6-digit sample numbers, and two 2-digit par- ameters (e.g., SP and LM, Table 2) for sample des- cription and identification. The programs require sys- tem configurations with a minimum of 128 K bytes of RAM memory and a single disk drive with 270 K bytes of formatted storage capacity. PROGRAM DESCRIPTION The BASIC program consists of seven program files that can be brought into computer memory selec- tively depending on the task. The FORTRAN 77 version consists of the main program and a subrout- ine which creates six sequential files for data entry. These program files are described individually. Autostart program ( BA SIC) When the HP-86B is turned on, after the disk drive has been loaded with disk ELECON, it searches the directory/catalog of this disk for a program file named Autost. When the file is located, the program is loaded automatically into computer memory and executed (Fig. I). This program contains the Master Index which lists the other files. Access to these files is 151

Upload: uwe-brand

Post on 25-Aug-2016

212 views

Category:

Documents


0 download

TRANSCRIPT

Computers & Geosciences Vol. 14, No. 2, pp. 151-180, 1988 0098-3004/88 $3.00 + 0.00 Pnnted in Groat Britain. All rights reserved Copyright ~ 1988 Pergamon Presto pk

COMPUTER ANALYSIS OF ATOMIC ABSORPTION SPECTROPHOTOMETER GENERATED DATA: BASIC AND

FORTRAN 77 PROGRAMS

UwE BRAND and EDWARD G. LOREK

Department of Geological Sciences, Brock University, St. Catharines, Ontario, L2S 3AI Canada

(Received 17 June 1987)

Abstract--The atomic absorption SlX-ctrophotometer (AAS) programs (FORTRAN 77, v.2.0 and BASIC, v.2.1) allow for the efficient computation of chemical data generated by atomic absorption spectro- photometer. In the BASIC program, additional data. such as weight and insoluble residue, are entered directly into the program from a digital balance linked by RS-232C line to the minicomputer. In the FORTRAN 77 program weight, insoluble residue, and AAS are entered manually. Both programs have full editing facilities for easy error recovery, and the calculated data is printed in publishable table form. Also a terminal emulator program, in the BASIC version, is included to handle the efficient and automatic transfer of data to mainframe computers.

Key Word~: Geochemistry, Chemical data (AAS) management. BASIC and FORTRAN 77 programs, Weight and insoluble residue manipulation. Error recovery. Publishable printout, Precision computation, Data transfer capabilities.

INTRODUCTION

In the past, rccalculation of raw chemical data was either done manually or by pocket calculator. Both of these methods are timc consuming and prone to errors. Time spent on inputting the raw data and calculating it can be reduced by one to three orders of magnitude over the conventional methods.

This report describes a BASIC program that takes chemical numbers generated in concentration values (ppm or mg/ml) by atomic absorption analysis (Va- rian 1475rM), weight and insoluble residue data of powdered samples and calculates the chemical con- centrations in the rock; prints the results in publish- able table form; outputs 1000 St/Ca (wt), mSr/'*Ca, Sr/Na (wt), and *'St/tuNa ratios; and automatically transmits the recalculated data to the mainframe com- puter (Burrough's B7900) for further data handling, plotting, statistical analysis, and storage. This pro- gram is for use with Hewlett-Packard Series 80 mini- computers.

The FORTRAN 77 version calculates concentra- tion values for solution using the absorbanc¢ readings and concentrations of user prepared reference (stan- dard) solutions analyzed on any atomic absorption spectrophotometer. The values are corrected for im- purities contained in the water, acids, and chemicals determined by analyzing "blank" solutions, which contain everything but sample material. Concentra- tions in rock and mineral powders are calculated after weights, insoluble residues, and absorbances of sam- ples are entered manually into the program. Com- puted data can be printed in table form and further analyzed using commercially available programs. This program was written with Microsoft* FOR-

TRAN 77,v. 2.0. The ELECON programs consists of modules that handle the various tasks involved in recalculating chemical data. Also, programs contain edit and printout facilities at all stages for easy recov- ery of entered due to input or machine error. The programs have the capacity of handling up to 12 (10 in FORTRAN 77 version) different elements analyzed by atomic absorption spectrophotometer (AAS), and up to 500 samples for a total of 6000 (5000) data points. In addition, there are provisions for user- defined 6-digit sample numbers, and two 2-digit par- ameters (e.g., SP and LM, Table 2) for sample des- cription and identification. The programs require sys- tem configurations with a minimum of 128 K bytes of RAM memory and a single disk drive with 270 K bytes of formatted storage capacity.

PROGRAM DESCRIPTION

The BASIC program consists of seven program files that can be brought into computer memory selec- tively depending on the task. The FORTRAN 77 version consists of the main program and a subrout- ine which creates six sequential files for data entry. These program files are described individually.

Autostart program ( BA SIC) When the HP-86B is turned on, after the disk drive

has been loaded with disk ELECON, it searches the directory/catalog of this disk for a program file named Autost. When the file is located, the program is loaded automatically into computer memory and executed (Fig. I). This program contains the Master Index which lists the other files. Access to these files is

151

152 U. BRASD and E.G. Lo~z

~M Autostort ~'~ ASTER IN DE x j

FUNCTION / KEYS /

<-) YES

~_~ STOP

d I) PARAM

PROGRAM

PROGRAM

3) IR

PROGRAM

5) PRINT

J61 TEP "

Figure I. Flowchart of "Autost" program (BASIC) which contains master index from which user can access other programs on disk "Data I". Entered data can be edited at all stages to allow for error recovery.

achieved through the use of function keys, which automatical ly loads the desired program into com- puter memory and executes it. A total of six function keys are needed to access all operating program files, and the seventh key terminates operat ion of the pro- gram.

Main program (FORTRAN 77) This program can be executed on all microcom-

puters which access the F O R T R A N 77 compiler, on a Macintosh the compiler opt ion ' U ' must be selected to set the screen default. After start-up, open the AAS

version 2.0 apl file, access to the data files is achieved by entering a name up to i0 characters long. After naming the file, the user has to decide whether to enter "new" data ( C R E A T E / A P P E N D ) or to edit existing data (MODIFY) .

Parameter program/file (BASIC-FORTRAN 77) In program P A R A M (BASIC version) the initial

sample parameters for a particular project are entered and subsequently saved on disk for later use (Fig. 2). The user is asked to make a selection from the follow- ing menu:

Computer analysis of AAS generated data 153

START ~11

J ~ ARAMETER /

, . o o o / /.,-.,,- 7

I \.:oo/--7''/'---- NO

. . ~ . . . . . . . ~ .AR..ETCR F .ARA.ETERS ~ / ~A~oES /

I "~S T

.ARA.~TER~\ [.,.R,NT 1

5] RETURN / TO MASTER F

@ I ,,°.x / Figure 2. Flowchart of program "'Param'" (BASICFORTRAN 77). User defines and enters parameters

that characterize samples. Printout of data can b¢ obtained for verification.

PARAMETER INDEX I. Enter Initial Sample Parameters 2. Enter Additional Parameters 3. Edit Parameters 4. Get Printout of Parameters 5. Return to MASTER INDEX 6. Stop the Program.

After selecting I from the menu, the program asks for the project name, the total number of samples, and the number of elements which will be analyzed. The project name appears on subsequent menus until the title is changed at a later date. The user also has the option, at a later stage, to change (increase or de- crease) the number of samples and elements of the

project. Subsequently, the user is asked to supply information for the three parameters which consist of SP, LM, SAMPLE*, These are preceded by an index number (counter) which keeps track of the number of parameters entered. Initially, not all 500 data points have to be assigned because the program can be up- dated and expanded until all available storage space has been exhausted: which is done by selecting 2 of the Parameter Index. SP and LM are two 2-digit par- ameters which can be used to identify and describe the individual samples. Selection 3 allows the user to correct any invalid entries. Selection 4 provides a printout of the previously entered parameters at user selected intervals, and thus allows the operator to keep track of the data currently residing on disk

CAGEO 14. Z-S

154 U. BRAND and E.G. LOREK

START *'~

T J YES ~ N= \ ~ NO J ~ I \ ,-500 / "

2 - 5OO ~" / T

N ~ ENTER / I

l / L

YES

I) ENTER WEIGHTS

2 ) A DDI TION A L/=F._.___. - / W E I G H T S /

31 EDIT L WEIGHTS

' BALANCE '

4) EDIT WEIGHTS 'KEYBOARD'

3

WEIGHTS

,.700 5) PRINT l

6) RETURN / (~ /To MASTER f ! ,NDEX /

Figure 3. Flowchart of program "Weight" (BASIC/FORTRAN 77). Data are entered into program via a RS-232C interface link between microcomputer and digital balance. Program has built-in editing and

printout facilities.

ELECON. Similar procedures are followed for enter- ing the identification information of the studied sam- ples in the FORTRAN program.

14,'eight program (BASIC-FORTRAN 77) Program/file WEIGHT records and stores the

weights of the sample powders in the minicomputer (Fig. 3). The program (BASIC) assumes that the weight data will be entered from a digital balance via

a RS-232 Serial line. If this feature is not desired, lines 80, 90, 120-180, 240, 650--660 can be deleted from the program. Also lines 640 and 670 have to be modified to reflect this change. In line 640 the HALT 10 should be removed, and line 670 ENTER 10; W(I) has to be changed to 670 INPUT W(I). Otherwise line 80 tells the user to turn on the balance, line 120 activates the RS-232C line connecting the computer and balance, and line 670 expects data input via a serial line. This feature is not available in the FORTRAN program, in

Computer analysis of AAS generated data

this situation the data have to be entered manually using the keyboard.

The Weight Index asks the user to make a selection from the following menu:

WEIGHT INDEX i. Enter NEW Sample Weights 2. Enter ADDITIONAL Weights 3. Edit Sample Weights using the BALANCE 4. Edit Weights using the KEYBOARD 5. Get Printout of the Weights 6. Return to MASTER INDEX 7. Stop the Program.

In this set-up, the initial (I) and additional weights (2) of samples are entered into the computer through a RS-232C linked digitial balance. Editing (3 or 4) of an erroneous value can be done either via the balance or the keyboard. Similar to the error recovery described in the PARAM program, the user has to remember and subsequently enter the index number (counter) to access the erroneous weight entered earlier and to enter the correct weight instead. A printout (selection 5) can be obtained of the entered weights to keep track of the procedure and to double check the values, in this situation, the weight limitations depending on the digestion proccss are shown after the menu. For car- bonates, three sets of weight ranges were selected according to sample size with corresponding volume of volumetric flask (10, 25, and 50ml; Brand and Veizer, 1980). This selection process limits problems otherwise encountered with over dilution of sample solutions for some elements.

htsoh,bh" residue progrwn ( BASIC-#DRTRAN 77) If the sample powders are digested by the total

rock method, program file IR (BASIC)can be deleted from the main program (Appendix). However, lines 1060-1330 of this program have to be incorporated into program ELEMENT. Also, the IR(I) [weight of crucible and ashed filtratel and IRV(I) [weight of empty crucible] in the equations on lines 1080-11 I0 have to be deleted. For those who want to determine the acid nonsoluble fraction (IR) of carbonates (Brand and Veizer. 1980; Morrison, Brand, and Roll- ins, 1985) program IR provides an efficient way of obtaining the necessary data (Fig. 4). Generally, the IR of carbonates is determined gravimetrically by ashing the filtrate and ashless filter paper (Brand and Veizer, 1980). This process involves the weighing of fired crucibles without the IR, and weighing of these same crucibles containing the IR after firing in a muffle furnace at 800 C for ! h. As before, this pro- gram asks the user to make a selection from the following menu:

INSOLUBLE RESIDUE INDEX I. Enter EMPTY Crucibles 2. Additional EMPTY Crucibles 3. Enter FULL Crucibles 4. Additional FULL Crucibles

155

5. Edit EMPTY Crucibles using KEYBOARD 6. Edit FULL Crucibles using KEYBOARD 7. Get Printout of IR 8. Return to MASTER INDEX 9. Edit VOLUME of Volumetric

10. Stop the Program.

This program enters an initial set of empty (I) and full (3) crucible weights which can be supplemented by additional (2 and 4) crucible weights, respectively. When the user selects 2 or 4 from the menu, the number of how many "'empty crucibles" or how many "empty" as well as "full" crucibles have been recor- ded is related. Selections 5 and 6 provide full editing of the two sets of entered crucible weights. When the number of full crucible weights entered equals the total number of samples entered in the PARAM pro- gram, the IR program automatically calculates the dissolution parameter and the percent IR and stores them into a databank for further computations. The dissolution parameter is calculated using the follow- ing equation:

V(l) = 10/(W(1) - 0R(I) - IRV(I))) (I)

where W(I) is the wcight of the powdered sample I (~< 0.1000 g); I R (I) is the weight of the crucible with the ashcd filtrate (l); IRV(1) is the weight of the empty crucible (!); and Vii) is the initial dissolution par- ameter of sample (I). If W(I) is >0.1000 and <0.2700g then 25 is substituted for the l0 in the

dissolution equation; if W(I) is t> 0.2700 g then 50 is substituted for either the 10 or 25 in the equation. The percent insoluble residue PER(1) is calculated using the following equation:

PER(l) -- (IR(I) - IRV(I))/W(I)* 100. (2)

The V(I) and PER(1) values will be used further in the ELEMENT and PRINTC programs, respectively. Further error recovery is achieved with selection 9, here the volume of the volumetric flask can be altered. .This is a necessary feature because the worker rinsing the solution through the filter into the volumetric may miss the meniscus mark, and corrections have to be made accordingly.

In the FORTRAN program, if the samples are to be calculated on a whole rock basis, then line 00044 can be deleted which clarifies the initial menu presen- ted to the user. To change the calculation procedure, line 00137 has to be modified to reflect the different sample conditions. Otherwise, the procedure follows the outline of the BASIC program.

Elemental calculations program (BASIC-FORTRAN 77)

In program ELEMENT (BASIC) geochemical data generated by atomic absorption spectro- photometer are combined with data entered in the WEIGHT and subsequently recalculated in the IR programs (Appendix), which is similar to to the ELE- MENT file of the FORTRAN 77 version. After this

156 U. BRASD and E.G. LOREK

START

INSOLUBLE / RESIDUE / INDEX /

N o @ Y E S

I~) STOP j.~

I ~ EMPTY \ ~) ENTER /

CRUC,BLES , , , " - ~ / EMPTY N:,-ooo/ / CRUO,BLES/

CRUC'BLES ~ A D D , T , O N A L - - N =2" 500 // / EMPTY

/ [ CRUCIBLES

CALCULATE . . . . . . / / DILUTION

< OF SOLUTION 5)

_ N O ~ / ENTER ' ( ' ~ T ' ~ R R E C T ION~ '~ ' - ' / 'NEW'

/ CRUC, BLES

FULL ~ . /3) ENTER / ~ CRUCIBLES / ~ ' ~ ' ~ FULL N=,-'O0 / /CRUCIBLES

CRUCIBLES ~_ . .~ / A DOITION A L / / FULL /

N = 2 - ~ o o / / CRUC,BLES /

EDIT EMPTY

CRUCIBLES

EDIT L FULL

CRUCIBLES I

N= ~ AND FULL L,, 1-500 / ............

ENTER NO ' NEW '

VOLUME

@

t 9) EDIT - - DISSOLUTION VOLUME I

/8, ETURN MASTER

INDEX

Figure 4. Flowchart of"lR" (BASIC FORTRAN 77). Crucible weights and filtrate are entered and initial dissolution volume and insoluble residue content (%) are calculated. These are stored for later use.

Computer analysis of AAS generated data 157

START )

ELEMENT / ALCULATION/

INDEX /

N O @ Y E S

I CALCULATE

I CONCENTRATtON

ROCK

VALUES N: I- 500 ~__/ ELE.~'NTAL [

VALUES C 'KEYBOARD'/

NEW / ~

I l YES T

/ " 1 ~ ~ / - \ AiELE'ENTAL/ ,o r

I - SO0 ' DISC' /

, \ . k,.oo,.,o..<l • C----TE,E VA,UE V

\ ,-SOD / / 'D,S:' /

2) EDIT

VALUES

/ I NEW / I 5) EDIT ELEMENTAL

VALUE VALUES

T

6) RETURN TJ / "ASTER

INDEX

T STOP )

Figure 5. Flowchart of program "Element'" (BASIC/FORTRAN 77). After entry or AAS data (concentra- tions), geochemical values in rock-fossil are calculated (Table I) and stored for printout.

program is loaded into computer memory (Fig. 5), the index asks the user to make a selection from the following menu:

ELEMENT CALCULATIONS INDEX I. Enter all ELEMENTAL values from Keyboard. 2. Edit ELEMENTAL values entered from Key-

board. (or all AAS values transferred from disk)

3. Transfer Initial ELEMENTAL values from AAS Disk.

4. Transfer Additional ELEMENTAL values from AAS Disk.

5. Edit AAS ELEMENTAL values using Keyboard. (before final reealculations)

6. Return to MASTER INDEX. 7. Stop the Program.

In this program, the data for all the different ele- ments are entered into computer memory, either from the keyboard (I) or directly by transfer from the AAS operating disk (3 and 4) to the ELECON disk. Upon input, the AAS data are combined with the dissolu-

158 U. BRANI) and E.G, LomEg

Table I, Example of data, calculations, and results for samples 116 and I 17 of project lrondequoit

Sample SP LM Weight lnsoluble residue Volume Dilution AAS value Final value {g) (g) (ml) factor {ppm) (ppm)

Ca I I 6 0.4773 0.1231 50 100 19.015 268420 Mg I 1 6 0.4773 0.1231 50 1000 0.537 75800

Ca 1 I 7 0.4699 0.0108 50 100 34.748 3784.10 Mg 1 I 7 0.4699 0.0108 50 100 0.163 1775

tion parameters calculated earlier (IR program), and any additional dilution factor which was required for analysis of a particular element. In addition, data values > 20 are calculated in increments of 5; chemi- cal values < 20 are reported in simple integers.

Table I is an example of parameter assignment. elemental calculations and interpretations. First sam- ple is assigned a 116 which identifies the rock unit sampled (SP, lrondequoit Formation = i) and gives the locality (LM, Kerns Road, Hamilton = 6). The other sample is identified by 117 corresponding to the lrondequoit (SP = I) but different locality (LM = 7). These parameters (SP and LM) clarify sample information and make it easier for later statis- tical analysis (e.g. SPSS). If for example analysis is required only for samples from one locality, these can be identified quickly by their LM number. A similar rationale is used in the assignment of the SP numbers which considers its subsequent use.

Samples of project "lrondcqt, oit" were each diss- olved in 50ml of 5% (v/v) HCI for 3h (Table I, volume; Brand and Veizer, 1980). Prior to dissolution, dried samples were weighed to four decimal places (Table I, weight) and then the amount of acid insol- uble residue (Table I, insoluble residue) was deter- mined by ashing the filtrate at 800C for I h. Con- centrations of elements in solution have to be within the linear working range of the specific element on atomic absorption spectrophotometers and for car- bonate samples and Ca analysis this usually requires a dilution of the sample solution by a factor of 100 (Table 1, dilution factor). Solution then is analyzed on AAS following manufacturer's recommended meth- ods; this gives the elemental concentration of the

solution (Table i, AAS value). The final concentra- tion of the element in the acid-soluble fraction of the rock (Table I, final value) is calculated with the fol- lowing equation:

Final value =

volume, dissolution factor i * AAS value (3)

(weight - insoluble residue)

where the dissolution factor can be deleted if no extra dissolution of sample solution is required. A complete printout of 13 samples for 9 elements is presented in Table 2.

Evaluation of the two samples, based on Ca and Mg data recalculated on an insoluble residue-free basis (Brand and Veizer, 1980), suggest that sample I of the Irondequoit Formation at Kerns Road is a calcareous dolostone, whereas the other sample of the formation from St. David Road is a limestone (Tables 1,2). The recalculated data then are stored for output by the PRINTC program.

Print program (BASIC-FORTRAN 77) Program PRINTC (BASIC) prints data for 5-12

elements of samples in table form (Fig. 6). The last 7 elements can be in any order, and also not all of them have to be used, but samples have to be analyzed for at least 5 elements. This table has I l /2in margins on the left and I in margins on the other sides (Table 2). The table is printed on legal size paper (8 I/2 x I I in) in compressed letters to accommodate all page size requirements. Headings are repeated for every page that is printed. Explanations for headings are printed

T a b l e 2. Printout of geochemical data for carbonate rocks of Irondequoit Formation APPENDIX. Geochemical data of project IRONDEQUOIT

Sample SP LM IR Ca Mg Sr Mn Na Fe Zn Cu Ni

I 2 3 4 5 6 7 8 9

10 I 2 3

6 25.8 268420 75800 225 2165 875 14190 3 I 0 6 25.5 251610 81530 290 1570 1150 2071D 6 17 0 6 226 257200 91470 250 1970 1180 16240 2 2 0 6 240 248700 95710 215 1540 455 22760 2 6 0 6 21,4 272830 70140 270 1420 530 18295 7 I 0 6 22.8 281530 71770 220 1580 630 14120 2 I 0 6 12,1 304310 55950 175 1810 440 11590 3 I 0 6 32.6 245800 80705 130 1790 410 24410 9 40 0 6 41.5 223570 95100 180 1630 1830 25200 3 3 13 6 44.9 242990 97920 165 1680 1880 20155 3 4 I0 7 2.3 3784-10 1775 150 2065 200 875 50 4 1 7 1.7 326470 25420 60 4130 265 3450 50 I 0 7 3.5 329030 20550 65 3225 225 3980 5 2 2

IR is the insoluble residue in percent. Al l elemental concentrations arc in ppm. Key for SP: I - lrondequoit Formation. Key for LM: 6 ~ Kerns Road (Hamilton), 7 ~ St. David Road (St. Catharincs).

Computer analysis of AAS generated data 159

START

I/=/ N O @ Y E S

~_ ) STOP

2) RETURN j /.To .ASTER INOEX

Figure 6. Flowchart of program "PrintC'" (BASIC). This program prints geochemical data (Table 2), and atomic and molar ratios of St/Ca and Sr/Na.

at the end of the table, and the content of them is user controlled by lines 270 and 280 of the program. Also the program allows the user to specify the number of copies desired: 290 DISP "Enter Number of Copies Desired" at INPUT 12. The FORTRAN version also includes precision information (in %) for all elements after the main data has been output. After all the tables have bccn printed, the program automatically prints a working table of the 1000 St/Ca (wt), "Sr/ inca, Sr/Na (wt), and mSr/=Ca ratios. These data are printed in conjunction with the sample number and the other two parameters identifying the samples. Upon completion of the printing task, the program returns to the Print Index and the printer beeps to alert the user that its task is completed.

The complete data set in the FORTRAN 77 ver- sion can be opened by Microsoft Word TM or by Apple MacWrite TM and modified prior to printing. To do this successfully the test has to be in Monaco 9 (font style and size). Furthermore, if the data are saved as a textfile and modified to include tab stops between the values, it can be imported into Graph TM by Crick- et Software for graphics presentation and into Stat- works TM for statistical analysis.

References file (FORTRAN 77) After entering 'R ' in the menu of the main pro-

gram, the user is requested to enter information re- garding the number of samples and how often the reference solutions were analyzed during the course of the analyzes. The number of samples is used by the

program to calculate a default reslope rate, however, if this rate is unsatisfactory, the user has the option to change. The user then is prompted to enter a value representing the number of solutions in reference set I and the absorbance for the 'blank' solution. This is followed by entering the concentration and absor- bance values for each refcrence solution and of each subsequent reference set. At the completion of this task the program calculates and displays the correla- tion coefficient (r) for each reference set using polyno- mial best-fit. If a value of a particular reference set is incorrect then the data for the whole set have to be reentered using the 'CREATE/APPEND" option of the main menu. Erroneous data can be deleted by accessing text-file RE.name and removing the incor- rect values.

Absorbance file (FORTRAN 77) After this file is created or subsequently accessed,

absorbance values of all the samples are entered into the program file in the order in which the elements were analyzed or are to be printed. Values can be modified by calling up incorrectly entered data through the 'MODIFY' option or by directly acces- sing the text file and making the required changes.

Print (main) program (FORTRAN 77) After all the data have been entered and the menu

is bypassed, the chemical concentrations of the sam- pies are calculated as well as of duplicate samples identified by the user. Values of the duplicate sam-

160 U. BRAND and E.G. LOREK

/ START )

T.E.P / INDEX

NO ~ Y E S

3) STOP )

N:I-12 SAMPLES ~ DATA N: I-SOO / / M,A,NFRAME

2) RETURN /

Figure 7. Flowchart of program "TEP" (BASIC). After logging on to mainframe computer (Burrough's B7900 TM ) and assigning file name to data. it is transferred automatically and saved in main frame's memory.

Subsequently program logs-off and returns to index Ibr another selection

pie(s) are used to calculate the precision (percent error) for each clement analyzed for these sets (Kretz, 1985). Error calculations are made on the values prior to integer conversion. This information is displayed after the concentrations of the samples on the screen as well as in the text file for later printout.

The elemental values calculated for samples of project lrondequoit using absorbance readings and the FORTRAN 77 program, and concentration read- ings with the BASIC program shows that they are similar for the two procedures at the 95*/0 confidence level.

es a data file in tile mainframe computer, which is followed by the transfer of the data from the mini- computer to the mainframe computer. Also, each line of data is assigned automatically a lead number upon transfer. Upon completion of this task, the data are saved in the mainframe, and the minicomputer signs- off and returns to the TEP index for further instruc- tions. Commercially available communications pro- grams can be used to transmit data recalculated with the FORTRAN program.

SUMMARY

Terminal Emulator Program (BASIC) With the TEP program, the HP-86B computer

emulates a terminal and allows the user to log-on to a mainframe computer (Fig. 7). To log-on the HP-86B to the Burroughs B7900, press any key on the key- board to assert control of the line, set the buffers and call the data switch of the mainframe. Input through the HP-86B computer is achieved through the fun- ction keys. Key No. ! is for input of commands and data; key No. 2 is the automatic SEND command for the recalculated data residing on disk ELECON; key No. 3 initiates a PAUSE in the system; and key No. 4 transmits a carriage return CHR$ (32), to the main- frame computer.

Pressing key No. 2 initiates the transfer of the calculated chemical data to the mainframe computer. It asks the user to specify a file name for the project (line 430). Then the program automatically establish-

Further data handling and statistical analysis can

be performed on the data with standard statistical packages such as SPSS (e.g., Nie and others, 1975) available on mainframe computers. All programs have extensive editing facilities to allow for error recovery. A copy of the computer program can be obtained from the senior author for a nominal fee or from the Computer Oriented Geological Society, P.O. Box 1317, Denver, CO 80201, U.S.A.

CONCLUSIONS

Implementation of computer programs (BASIC and FORTRAN 77 versions) in handling AAS generated data, results in great time-savings for the user. Also errors caused by manual manipulation of large amounts of data are minimized. When errors do occur, editing facilities allow for easy data recovery.

Computer analysis of AAS generated data 161

Furthermore. the data are printed in publishable table form. and can be transmitted to mainframe com- puters for further handling, plotting, and statistical analysis.

Acknowledgments--A special thank you to Dr. M.H. Ram- sey (Imperial College of Science and Technology, London) and the anonymous reviewer for their critical comments on the manuscript. Thanks to P. Brown for drafting the flow- charts. This work was supported by operating and equip- ment grants from the Natural Sciences and Engineering Research Council of Canada.

REFERENCES

Brand, U., and Veizer. J.. 1980. Chemical diagenesis of a multicomponent carbonate system--I: trace elements: Jour. Sed. Petrology, v. 50, no. 4.p. 1219-1236.

Kretz. R.. 1985. Calculation and illustration of uncertainty in geochemical analyses: Jour. Geol. Education, v. 33. no. I. p. 40-44.

Morrison. J.O.. Brand. U.. and Rollins. H.B.. 1985. Paleoen- vironmental and chemical analysis of the Pennsylvanian Brush Creek fossil allochems, Pennsylvania. U.S.A.: 10th International Carboniferous Congress, Madrid. Compte Rendu (Madrid). v. 2. p. 271-280.

Nie, NH. , Hull. C.H.. Jenkins, J.A.. Steinbrenner. K.. and Bent. DH. . 1975. Statistical package for the social scien- ces (2nd ed.): McGraw-Hilt, Book Co. New York, 675 p.

APPENDIX

ELECON Program

10 ! ELECON PROGRAM WRITTEN BY UWE BRAND~ BROCK UNIVERSITY, 1986 20 ! ~ $ t ~ * t $ * * * * ~ S * MASTER INDEX $~*t***~$~***$$S~$t~$$$t**~***t$***$t 30 ! PROGRAM CONTAINS MASTER INDEX AND HAS A u t o s t a r t FEATURE 40 ! VOLUME NAME OF DISC IS "DATA1" 50 MASS STORAGE IS ":D710" @ PAGESIZE 16 @ CLEAR 60 ! SELECTION IS MADE AND PROGRAMS BROUGHT INTO MEMORY AND EXECUTED 70 ON KEY# 1 , " I N I T PAR I " GOTO 200 80 ON KEY# 2,"WEIGHT 90 ON KEY# ~,"CALC IR 100 ON KEY# 4~"ELEMENT 110 ON ~EY# 7,"STOP 120 ON }(EY# 5j"PRINT C 130 ON KEY# 6,"TEP 140 CLEAR ~ KEY LABEL 150 DISP USING lbO 160 IMAGE 5 / , " 170 DISP USING 180 180 IMAGE 3/~ " mmence 190 GOTO 190 200 CHAIN "PARAM" 210 CHAIN "WEIGHT" 220 CHAIN " IR" 230 CHAIN "ELEMENT" 240 CLEAR @ DISP " END

2" GOTO 210 3" GOTO 220

4" GOTO 230 7" GOTO 240 5" GOTO 254: 6" GOTO 260

MASTER INDEX "

Press one o f the SPECIAL FUNCTION KEYS t o co data i npu t and/or ou tpu t "

250 CHAIN "PRINTC" 2bO CHAIN "TEF"

Press RUN t o r e s t a r t Program" @ END

170 180 19~.~ CLEAR @ DISP " P r o j e c t 200 DISP ~i' DISP " d " L ~ INPUT N

10 OPTION BASE I 20 ! THIS PROGRAM STORES tHE INITIAL SAMPLE PARAMETERS * * * * * * * $ $ ~ * * $ * * * * 30 CLEAR ~ MASS STORAGE IS ":D710" @ PAGESIZE 16 40 ! NAME OF PROGRAM IS 'RARAM" 50 I=O @ N=O @ EI=O ~ J=O • NS=O @ NSI=O @ AS="" @ SHORT I N ( 5 0 0 ~ ) 60 ! N-# OF SAMPLES; E l - # OF ELEMENTS; I~J-COUNTERSI AS-PROJECT TITLE 7c) ! IN(5OO~)-SAMPLE PARAMETERS [# OF SAMPLES,SP,LM] 80 ! NS-INITIAL # OF SAMPLES; NSI-ADDITIONAL # OF SAMPLES 90 CLEAR ~ DISP " PARAMETER INDEX" I00 DISP @ DISP " I . En te r I n i t i a l Sample Parameters

2. Enter A d d : t i o n a l Parameters" 110 DISP " 3. E d i t Parameters " 120 DISP " 4. Get P r l n t - o u t o f Parameters

5. Return to MASTER INDEX" 130 DISP " 6. Stop the Program" @ INPUT X 140 ON X GOTO 170,370p450,560,150,160 150 CHAIN "MASTER" 160 CLEAR @ DISP " END

Press RUN t o r e s t a r t Program " @ END CLEAR ~ DISP @ DISP " Enter t he PROJECT name" @ INPUT A$ ASSIGN# 1 TO "DATA T" ~ PRINT# I ; A$ @ ASSIGN# 1 TO

This Program Stores The I n l t i a l Sample Parameters Of ";AS

Enter the TOTAL NUMBER [max 500] Of Samples t o be compute

162 U. BRAND and E.G. Lo~K

210 ASSIGN# 2 TO "DATA N" @ PRINT# 2 ! N @ ASSIGN# 2 TO 220 DISP @ DISP " Enter t he Number o f ELEMENTS t o be computed " @ IN

PUT E1 230 ASSIGN# 3 TO "DATA W" @ PRINT# 3 : El @ ASSIGN# 3 TO 240 DISR @ DISP " Only e d i t i n g TOTAL NUMBER o~ samples : Yes/No? " @ INPUT Y$ 250 ! USER CAN CHANGE THE PREVIOUSLY ENTERED TOTAL NUMBER OF SAMPLES 260 IF Y$="Y" THEN GOTO 160 270 ! INITIAL PARAMETERS ~¢$ i¢¢¢¢ ,¢$ i¢ i¢$$$ I$¢¢¢¢$$¢¢I¢¢ :¢ :¢ i *¢ I¢m¢ 280 ! SUBROUTINE TO ENTER + STORE THE SAMPLE PARAMETERS 290 ! WHOLE OR PARTIAL DATA LIST IS ENTERED HERE 300 CLEAR @ DISP @ DISP " Enter t he INITIAL NUMBER of Samples t o be compute d " @ INPUT NS 310 FOR I=1 TO NS @ GOSUB 720 @ NEXT I 320 CLEAR @ DISP @ DISP " INPUT FINISHED" 330 DISP " Please w a i t a moment " 340 ASSIGN# 4 TO "DATA IN IT" @ FOR I=1 TO NS @ FOR J= l TO 3 @ PRINT# 4 ! I N ( I . J ) @ NEXT J @ NEXT I @ ASSIGN# 4 TO $ 350 GOSUB 700 360 DISP " Parameters have been s t o r e d " @ BEEP @ WAIT 1000 @ GOTO 30 370 ! ENTER ADDITIONAL PARAMETERS $ * ¢ I ¢ I ~ S $ ~ ¢ * * ~ * * ¢ ~ $ I * I $ * $ I * : ¢ ¢ ¢ * ¢ * * ¢ 380 ! ADDITIONAL SAMPLE PARAMETERS ARE ADDED TO THE DATA BANK 390 CLEAR @ ASSIGN# 1 TO "DATA T" @ READ# I ; AS@ ASSIGN# 1 TO * 400 DISP @ DISP " Th is Program s t o r e s A d d i t i o n a l Sample Parameters o f P r o j e c t ";AS 410 DISP @ DISP " Enter the A d d i t i o n a l NUMBER of Samples t o be computed" @ INPUT NSI 420 GOSUB 710 @ DISP @ DISP " P r e v i o u s l y " INS ; " Samples were en te red" @ GOS UB 680 430 FOR I=I+NS TO NS+NS1 @ GOSUB 720 @ NEXT I 440 NS=NS+NS1 @ GOSUB 700 @ GOTO 320 450 ! EDIT PARAMETERS *¢$$$¢¢¢¢¢$1SI~$¢¢$¢~$$1$$Z~¢I¢¢¢¢¢$$¢IS$¢S¢$$$¢¢ 460 ! PROGRAM TO HANDLE EDITING OF DATA ENTERED BY THE PREVIOUS PROGRAMS 470 GOSUB 710 @ GOSUB 680 480 CLEAR @ DISP " Enter INDEX o f C o r r e c t i o n " @ INPUT I 490 ! INDEX OF CORRECTION IS THE VALUE IN [ ] DISPLAYED ON SCREEN 500 IF I>500 THEN 480 510 DISP " [ " I I ; " ] " . " OLD PARAMETERS SP LM SAMPLE#" 520 DISP I N ( I , I ) , I N ( I , 2 ) , I N ( I , 3 ) 5~0 GOSUB 720 @ DISP " Any C o r r e c t l o n s : Yes/No (Y /N) " @ INPUT C$ 540 IF C$="Y" THEN 480 550 IF C$-"N" THEN 320 560 ! PRINT PARAMETERS I ¢ $ I ¢ $ ¢ ¢ ~ I ¢ ¢ I ¢ ¢ * , 1 ¢ I $ ¢ ¢ * * * ¢ I ¢ ¢ I * * $ * ¢ I ¢ * * ¢ ¢ $ * * ¢ ¢ ¢ 570 ! SUBROUTINE FOR OBTAINING A HARD COPY OF ENTERED DATA 580 ! STARTING AND FINAL DATA SET IS USER SPECIFIED 590 CLEAR @ DISP @ DISP " Th is Program p r i n t s the Sample Parameters" 600 DISP @ DISP " Enter the INITIAL Sample Number ( I - 4 9 9 ) " @ INPUT X 610 DISP " Enter the LAST Sample Number (2-500) " @ INPUT Y 620 GOSUB 710 @ GOSUB 680 630 PRINTER IS 702.80 @ PRINT CHR$ (27)&"&ILL" 640 ASSIGN# 1 TO "DATA T" @ READ# 1 I AS@ ASSIGN# 1 TO ¢ 650 PRINT "PROJECT ";AS @ PRINT 660 PRINT " COUNTER SP LM Sample# a,

670 680

690 70(') 710 72(1)

FOR I=X TO Y @ PRINT I , I N ( I , I ) , I N ( I , 2 ) , I N ( I , 3 ) @ NEXT I @ GOTO 30 ASSIGN# 6 TO "DATA INIT" @ FOR I= I TO NS @ FOR J= l TO 3 @ READ# b ; I N ( I , J )

NEXT J @ NEXT I @ ASSIGN# b TO ¢ @ RETURN ASSIGN# 3 TO "DATA NI" @ PRINT# 3 ; NS @ ASSIGN# 3 TO * @ RETURN ASSIGN# 8 TO "DATA NI" @ READ# 8 ; NS@ ASSIGN# 8 TO ~ @ RETURN DISP " Enter PARAMETERS SP LM Sample# [ " ; I ; " ] "

730 INPUT I N ( I , I ) , I N ( I , 2 ) , I N ( I , 3 ) @ RETURN 10 ! PROGRAM STORES THE WEIGHT OF SAMPLE POWDER ¢ , ,¢¢$¢ I ,¢¢*¢*$¢¢*$¢¢*¢¢*~ 20 OPTION BASE 1 30 CLEAR @ MASS STORAGE IS ":D710" @ PAGESIZE 16 40 ! NAME OF PROGRAM IS " WEIGHT' 50 I=O @ P=O @ N=O @ Q=O @ SN-O @ LN-O @ J=O @ SHORT IN(5OO.3).W(500) 60 ! N . P . O . I . J . L N . S N - COUNTERS! W(500) - WEIGHTS OF SAMPLES 70 ! I N ( 5 0 0 . 3 ) - SAMPLE PARAMETERS 80 DISP @ DISP " TURN ON THE BALANCE ~ Set S e r i a l s w i t c h t o "1" " 90 ! IF MORE THAN ONE PERIPHERAL IS ON LINE USER IS ALERTED TO MAKE SELECTION 100 ASSIGN# I TO "DATA T" @ READ# I ! AS@ CLEAR @ ASSIGN# 1 TO 110 DISP @ DISP " THIS PROGRAM STORES THE WEIGHTS OF PROJECT ";A$ 120 RESET 10 @ CONTROL 10.2 ; 1@ CONTROL 10.3 | b@ CONTROL 10.4 ; 10 1 3 0 ! PARAMETERS ARE SET FOR THE SERIAL INTERFACE 140 ! RESET 10 - SETS DEFAULT CONDITIONS OF LINK 150 ! CONTROL 1(G2;1 - ACTIVATES THE ' REQUEST TO SEND OPTION' MODEM SIGNAL 160 ! CONTROL 10.3;6 - SETS THE BAUD RATE TO ' 300 ' 170 ! CONTROL 10.4;10 - LINE CHARACTERISTICS 1 STOP BIT. 7 BITS/CHARACTER

Computer analysis of AAS generated data 163

180 ! ODD PARITY 190 ASSIGN# 4 TO "DATA N I " @ READ# 4 | N1e ASSIGN# 4 TO $ 200 ASSIGN# 3 TO "DATA IN IT " @ FOR I = I TO NI @ FOR 0=1 TO 3 210 READ# 3 ! I N ( I , J ) @ NEXT J ~ NEXT I @ ASSIGN# 3 TO ¢ 220 DISP @ DISP " WEIGHT INDEX" 230 DISP @ DISP " 1. En te r NEW Sample Weights

2. En te r ADDITIONAL Weights" 240 DISP " 3. E d i t Sample Weights us i ng t he BALANCE" 250 DISP " 4. E d i t Weights us ing t he KEYBOARD

5. Get P r i n t - o u t o f t h e Weights" 260 DISP " 6. Re tu rn t o MASTER INDEX

7. Stop t he Program" 270 DISP @ DISP " Use lOmL V o l u m e t r i c f o r <=0.1000 g

Use 25mL V o l u m e t r i c f o r > 0 .1000 and < 0 .2700 g" 280 DISP " USE 50 mL V o l u m e t r i c f o r =>0.2700 g" 290 ! DEPENDING ON SAMPLE WEIGHT, USER SELECTS BETWEEN 3 SAMPLE SOLUTION 300 ! VOLUMES TO OPTIMIZE I N I T I A L DILUTIONS 310 INPUT X@ ON X GOTO 3 4 0 , 4 4 0 , 5 3 0 , 6 9 0 , 8 7 0 , 3 2 0 , 3 3 0 320 CHAIN "MASTER" 330 CLEAR ~ DISP " END

Press RUN t o r e s t a r t Program" @ END 340 ! NEW WEIGHTS * $ $ $ * * * * * * * t * t l ¢ $ S * * * * ¢ ¢ ¢ * l * l l * ¢ l * l * l * ¢ t l * l $ l l l $ l l l l l l $ * ¢ 350 CLEAR @ DISP @ DISP " En te r t he Number o f WEIGHTS t o be r e c o r d e d " @ INP UT P 360 ! SUBROUTINE TO ENTER ALL OR PARTIAL LIST OF SAMPLE WEIGHTS 370 ASSIGN# 2 TO "DATA P" @ PRINT# 2 ~ P @ ASSIGN# 2 TO $ 380 FOR I=1 TO P ~ GOSUB 650 @ NEXT I 39(; CLEAR ~ DISP @ OISP " I n p u t F i n i s h e d " 400 DISP @ DISP " Any C o r r e c t i o n s : Yes/No (Y /N) " @ INPUT C$ 410 IF C$="Y" THEN 560 420 IF C$="N" THEN 620 ELSE 400 430 GOTO 10 440 f ADDITIONAL WEIGHTS * * * * * * * * ¢ ¢ * * * ¢ t $ * $ * $ $ $ z * * * t * t $ * $ * $ * * * * * * $ $ $ * * * * ¢ * * 450 CLEAR @ GOSUB 8~0 460 DISP @ DISP " P r e v i o u s l y " | P : " Weights have been r e c o r d e d " 47(; DISF @ DISP " En te r t he number o~ WEIGHTS to be e n t e r e d t h i s t~me" @ INP UT 0 48(; ! ADDITIONAL SAMPLE WEIGHTS ( IF NECESSARY) ARE ENTERED HERE 490 FOR I = P * I TO P+O 500 GOSUB bSO @ NEXT I 51(; P=P+Q @ ASSIGN# & TO "DATA P" @ PRINT# & ; P @ ASSIGN# b TO l 520 GOTO 39,) 530 ! EDIT OLD WEIGHTS $* BALANCE $ ¢ ¢ * * ¢ * $ * * * * ¢ * * ¢ * * ¢ * * * * ¢ ¢ ¢ ¢ ¢ * ¢ * * $ * t * * * ¢ 540 GOSUB 8~0 55(; ! CORRECTION OF ENTERED DATA USING THE BALANCE 560 CLEAR @ DISP @ DISP " En te r Index o~ C o r r e c t i o n " R INPUT I 570 IF I>1000 THEN 400 580 DISP " [ ' ° ; I ; " ] " ; " OLD Weight" 590 DISP W(1) bOO GOSUB 650 610 GOTO 390 b20 CLEAR @ DISP @ DISP " P lease ~ a i t a moment" @ ASSIGN# 10 TO "DATA DW" 630 FOR I = I TO P R PRINT# 10 I W(I) R NEXT I @ ASSIGN# 10 TO ¢ b40 HALT 10 @ DISP " The WEIGHTS have been s t o r e d " @ BEEP @ WAIT 1000 @ GOT 0 30 b50 DISP @ DISP " Press PRINT KEY when ready t o En te r WEIGHT " ; " [ " | I ; " ] " b60 ! "PRINT KEY' BUTTON ON BALANCE TO SEND WEIGHT DATA TO COMPUTER b70 ENTER 10 ; W(1) b80 DISP @ DISP " Weight o~ Sample " ; I N ( I , 3 ) I " i s " ; W ( I ) @ WAIT 1000 @ RETUR N b?O ! EDIT OLD WEIGHTS *~* KEYBOARD *t$$*$***¢$$*$*******¢¢¢**$***$*$¢**

700 ! CORRECTION OF ENTERED DATA USING THE KEYBOARD 710 GOSUB 830 720 CLEAR ~ DISP @ DISP " En te r Inde~ o~ C o r r e c t i o n " @ INPUT I 730 IF I > I 0 0 0 THEN 800 740 DISP " [ " I I l " ] " l " OLD Weight" 750 DISP W(1) 760 DISP @ DISP " En te r NEW Weight" 770 INPUT W(1)@ WAIT 1000 780 GOTO 790 790 CLEAR @ DISP @ DISP '° INPUT FINISHED" 800 DISP @ DISP " Any C o r r e c t i o n s : Yes/No (Y /N) " • INPUT C$ 810 IF C I="Y" THEN 720 820 IF C$-"N" THEN ~20 ELSE 800 830 ASSIGN# 7 TO "DATA P" @ READ# 7 ; P@ ASSIGN# 7 TO l 840 ASSIGN# 1 TO "DATA DW" @ FOR I = I TO P 850 READ# I ; W(I)@ NEXT I @ ASSIGN# 1 TO l 860 RETURN 870 ! PRINT-OUT OF DATA tt*t¢¢*¢¢ll*¢*$¢¢i$lltllCtl¢$$l$*$llt*$*¢¢¢¢¢¢*¢¢¢

U. BRAND and E.G. LO~K

880 890 SN 900 910 92(, 930 940 950 PRINT " [ " ; J ; " ] ~ample # " ; I N ( I , 3 ) ; " ( " ; W ( 1 ) ; " ) " ; I N ( I + I , 3 ) ! " ( " I W ( I + l ) ; ") " 960 J=J+2 • NEXT I L~ BEEP • PRINT CHR$ (12) @ GOTO 30

! PROGRAM GIVES USER A HARD COPY OF DATA FOR VERIFICATION CLEAR @ DISP @ DISP " Enter STARTING Number o f Samples ( I - 499 " @ INPUT

DISP " Enter LAST Number o f Samples (2 -500) " • INPUT LN GOSUB 830 PRINTER IS 702~80 @ PRINT CHR$ ( 2 7 ) & " & I I L " PRINT " PROJECT ";AS @ PRINT @ J=4 FOR I=SN TO LN STEP 2

[ " ; J + l ; " ] Sample #

10 ! THIS PROGRAM STORES THE INSOLUBLE RESIDUE t i t IR s t t $ $ t t t t t $ * t t t t t t t t 20 MASS STORAGE IS ":D710" @ PAGESIZE 16 30 ! NAME OF PROGRAM IS ' IR • 40 I=O @ P=O @ N=O @ Q=O @ SN=O @ LN=O • SHORT W(500>~V<500),PER(500) 50 REAL IR(500)01RV(500) 60 ~ W(1)-WEIGHT OF SAMPLE: V < I ) - I N I T I A L DISSOLUTION OF SAMPLE (10,25,50 mL) 70 ~ PER( I ) - INSOLUBLE RESIDUE OF SAMPLE IN % 80 ! I R ( 1 ) - WEIGHT OF CRUCIBLE AND IR; I R V ( I ) - WEIGHT OF EMPTY CRUCIBLE

9(, CLEAR ~ DISP • DISP " TURN ON THE BALANCE !! Set the S e r i a l Swi tch t o ~ I ' " 14,(, ASSIGN# 1 TO "DATA T" ~ READ# I ; A$e CLEAR ~ ASSIGN# 1 TO $ 11{, DISP @ DISP " THIS PROGRAM STORES THE INSOLUBLE RESIDUE OF PROJE CT "|AS 12(, RESET 10 @ CONTROL 10,2 ; I@ CONTROL 10,3 ; b@ CONTROL 10w4 ! 10 13(, ! FOR SERIAL LINE CHARACTERISTICS SEE WEIGHT PROGRAM 140 DISP @ DISP " INSOLUBLE RESIDUE INDEX " 150 DISP @ DISP " 1. Enter EMPTY C r u c i b l e s

2. A d d i t i o n a l EMPTY C r u c i b l e s " 16{, DISP @ DISP " 3. Enter FULL C r u c i b l e s

4. A d d i t i o n a l FULL C r u c i b l e s " 174, DISP @ DISP " 5. E d i t EMPTY C r u c i b l e s us ing KEYBOARD

6. E d i t FULL C r u c i b l e s us ing KEYBOARD" 180 DISP @ DISP " 7. Get P r i n t - o u t o f IR

8. Return t o MASTER INDEX" 190 DISP " 9. E d i t VOLUME of Vo lume t r i c

10. Stop the Program" 200 INPUT X@ ON X GOTO 230,300,380t470,550,650,780,210,1150~220 210 CHAIN "MASTER" 220 CLEAR @ DISP " END

Press RUN t o r e s t a r t Program" @ END 230 ! EMPTY CRUCIBLES S t t t t ¢ t t t t t t t S t t S t t S t t S t S t t t t t C t t t S t t t $ $ $ $ $ $ $ $ $ $ $ t t ¢ 240 ! THE INSOLUBLE RESIDUE IS MEASURED BY FIRST WEIGHING FIRED CRUCIBLES 250 CLEAR @ DISP @ DISP " Enter the Number o f EMPTY CRUCIBLES t o be reco rde d" • INPUT Q 260 ASSIGN# 2 TO "DATA 0" @ PRINT# 2 ; Q @ ASSIGN# 2 TO $ 270 FOR I=1 TO Q @ GOSUB 750 @ NEXT I 280 CLEAR @ DISP ~ DISP " INPUT FINISHED" 290 GOTO 890 300 ! ADDITIONAL EMPTY CRUCIBLES t , t $ , t t t t S t t t t t t t t t , $ t t t t s t t t t t t t t t t t t t s $ 310 CLEAR @ GOSUB 920 320 DISP @ DISP " P r e v i o u s l y " ! Q I " Empty C r u c i b l e s have been reco rded " 330 DISP @ DISP " Enter the number o f C r u c i b l e s to be en te red t h i s t ime " @ I NPUT P 340 FOR I=Q+I TO O+P 350 GOSUB 750 @ NEXT I 3&O Q=Q÷P @ ASSIGN# b TO "DATA Q" @ PRINT# b ! 0 @ ASSIGN# b TO t 370 GOTO 280 38(, ! F U L L CRUCIBLES s t * t t m t t t $ * t t t t s t t t t t $ $ t s t s t t $ $ $ t t t t ¢ ¢ t t t s t t t t t t t t t c t t t t 390 ! WEIGHT OF CRUCIBLE PLUS THE ASHED FILTRATE OF SAMPLE 400 CLEAR ~ ASSIGN# I TO "DATA 0" • READ# 1 ; Q@ ASSIGN# 1 TO $ 410 DISP • DISP '° P r e v i o u s l y " ; Q I " EMPTY C r u c i b l e s have been recorded " 420 DISP @ DISP " Enter the number o f FULL C r u c i b l e s t o be en te red " 430 INPUT QI@ ASSIGN# 2 TO "DATA 01" @ PRINT# 2 ! 01 @ ASSIGN# 2 TO 440 FOR I= I TO Q1 @ GOSUB 95(, ~ NEXT I 450 CLEAR @ DISP ~ DISP " INPUT FINISHED" 460 GOTO 1000 470 ~ ADDITIONAL FULL CRUCIBLES $ $ t I $ $ t s t t $ $ t s t $ $ $ t t t ~ t t t t t t t $ $ $ t s t t t t s t I t t ~ 480 ASSIGN# 1 TO "DATA Q" @ READ# 1 l Q~ ASSIGN# 1 TO t 490 CLEAR ~ GOSUB 980 500 DISP " P r e v i o u s l y " ; Q ; " EMPTY C r u c i b l e s have been r e c o r d e d " 510 DISP @ DISP " P r e v i o u s l y " ; Q I ; " FULL C r u c i b l e s have been reco rded" 520 DISP ~ DISP " Enter the number o f FULL C r u c i b l e s t o be en te red t h i s t i me " @ INPUT P 530 FOR I=01+1 TO QI+P @ GOSUB 950 ~ NEXT I 540 O1=O1+P ~ ASSIGN# 1 TO "DATA 01" ~ PRINT# I ; Q1 @ ASSIGN# 1 TO $ 6' GOTO 4 54,

Computer anMysis of AAS gen~ated dam

550 ~ EDIT EMPTY CRUCIBLES *$* KEYBOARD ¢ ¢ ¢ * * * ¢ . 8 5 . * * $ $ * ¢ * $ * $ ¢ * * * * * $ $ * $ 8 ¢ ¢ 560 ! ENTERED EMPTY CRUCIBLE WEIGHTS ARE CORRECTED HERE 570 GOSUB 920 580 CLEAR ~ DISP @ DISP " Enter Index of Co r rec t i on " @ INPUT I 590 IF I>500 THEN 580 600 DISP " [ " I I ; ' ] " ; " OLD EMPTY CRUCIBLE" @ DISP IRV(1) 610 DISP " Enter NEW Empty C r u c i b l e " • INPUT IRV( I ) 620 CLEAR ~ DISP @ DISP " Any Co r rec t i ons : Yes/No (Y/N)" • INPUT C$ 630 IF C$="Y" THEN 580 640 IF C$-"N" THEN 890 ELSE 620 650 ! EDIT FULL CRUCIBLES 8e8 KEYBOARD t t * 8 $ $ t ¢ l G * t G l l * * t ¢ ¢ I t t t G l G $ $ $ G t t 660 ! ENTERED FULL (FILTRATE) CRUCIBLE WEIGHTS ARE COORECTED HERE 670 GOSUB 980 680 CLEAR • DISP @ DISP " Enter Index of Co r rec t i on " @ INPUT I 690 IF I>500 THEN 680 700 DISP " [ " ; I ; " ] " ; " OLD PULL CRUCIBLE" @ DISP IR(1) 710 DISP " Enter NEW Fu l l C r u c i b l e " @ INPUT I R ( I ) 720 CLEAR @ DISP • DISP " Any Co r rec t i ons l Yes/No (Y/N)" R INPUT C$ 730 IF C$="Y '° THEN 680 740 IF C$="N" THEN 1000 ELSE 720 750 DISP @ DISP " Press PRINT KEY when ready t o Enter WEIGHT " ; " [ " I I ; " ] " 760 ENTER 10 ; IRV(1) 770 DISP @ DISP ~ Weight of C r u c i b l e i s " ; I R V ( I ) @ WAIT 1000 @ RETURN 780 ! P r i n t - o u t of IR 8 * $ $ $ $ 8 $ $ $ t * t S t $ $ $ t t $ $ $ * $ $ $ * $ * * ¢ * ¢ $ $ $ $ $ * $ $ ¢ $ * $ $ $ $ $ ¢ ¢ $ 790 ! PRINT-OUT OF CRUCIBLE DATA FOR VERIFICATION 800 CLEAR ~ DISP " Enter S t a r t i n g Number of C ruc i b l es " @ INPUT SN 810 DISP " Enter Last Number of C ruc i b l es " @ INPUT LN 820 GOSUB 980 830 GOSUB 920 840 PRINTER IS 702,80 @ PRINT CHR$ ( 2 7 ) & " & I I L " 850 PRINT " PROJECT ";AS @ PRINT 860 FOR I=SN TO LN 870 PRINT " [ " ; I ; " ] Empty C r u c . - " ; I R V ( 1 ) l " Fu l l C r u c . - " ; I R ( 1 ) ; " I . R . - " I IR(1 ) - IRV(1) 880 NEXT I @ SEEP @ GOTO 20 890 DISP @ DISP " Please wa i t a moment" @ ASSIGN# 10 TO "DATA IRV" 900 FOR I - I TO Q @ PRINT# 10 1 IRV(1) @ NEXT I @ ASSIGN# 10 TO $ 910 HALT I0 @ DISP " The EMPTY c r u c i b l e s have been recorded" @ SEEP @ WAIT 1000 @ GOTO 90 920 ASSIGN# 7 TO "DATA Q" @ READ# 7 ; QR ASSIGN# 7 TO t 930 ASSIGN# 1 TO "DATA IRV" @ FOR I - I TO Q R READ# I I IRV(1)@ NEXT I 940 ASSIGN# I TO * • RETURN 950 DISP @ DISP " Press PRINT KEY when ready t o en ter ASH weight " ; " [ " ; I ; " ] , ,

960 ENTER I0 I IR(1) 970 DISP @ DISP " Weight o~ FULL C r u c i b l e i s " ; I R ( I ) @ WAIT 1000 @ RETURN 980 ASSIGN# 7 TO "DATA QI" @ READ# 7 ; QI@ ASSIGN# 7 TO t @ ASSIGN# 6 TO "DAT AIRW" 990 FOR I - I TO QI @ READ# 6 ; IR(I)@ NEXT I @ ASSIGN# 6 TO $ @ RETURN 1000 DISP @ DISP " Please wa i t a moment" @ ASSIGN# 5 TO "DATA IRW" @ ASSI ON# I TO "DATA N" @ READ# 1 ; N@ ASSIGN# I TO l 1010 FOR I= I TO Q1 @ PRINT# 5 I IR(1) @ NEXT I @ ASSIGN# 5 TO l 1020 HALT 10 @ DISP " The FULL Cruc ib l es have been recorded" @ SEEP • WAIT

1000 @ IF QI=N THEN GOTO 1060 ELSE GOTO 90 1030 ! THE INITIAL DISSOLUTION VALUES AND IR (%) ARE CALCULATED * * $ t * * S * I t t I t * 1040 ! THIS IS DONE AFTER ALL THE CRUCIBLE WEIGHTS HAVE BEEN ENTERED 1050 ! OIHERWISE THE CRUCIBLE DATA IS STORED WITHOUT RE-CALCULATION I060 ASSIGN# I TO "DATA DW" @ ASSIGN# 2 TO "DATA IRW" @ ASSIGN# 3 TO "DATA IR V" @ ASSIGN# 4 TO "DATA DV" @ ASSIGN# 5 TO "DATA IR" 1070 FOR I= I TO N @ READ# I ; W(1)@ READ# 2 ; IR(1)@ READ# 3 ; IRV(1)@ NEXT I 1080 FOR I= I TO N @ IF W(1)<= .1 THEN V ( 1 ) = I O / ( W ( 1 ) - ( I R ( 1 ) - I R V ( 1 ) ) ) 1090 I f W(I)~,.I AND W(1)<.27 THEN V ( 1 ) = 2 5 / ( W ( 1 ) - ( I R ( I ) - I R V ( I ) ) ) 1100 IF W(1)>- .27 THEN V ( I } - 5 0 / ( W ( I ) - ( I R ( I ) - I R V ( I ) } ) 1110 P E R ( 1 ) - ( I R ( 1 ) - I R V ( I ) ) / W ( 1 ) t I 0 0 @ NEXT I 1120 FOR I - l TO N @ PRINT# 4 ; V(1) @ PRINT# 5 ; PER(I} @ NEXT I 1130 ASSIGN# I TO ¢ • ASSIGN# 2 TO * @ ASSIGN# ~ TO ¢ @ ASSIGN# 4 TO t @ ASS ION# 5 TO l 1140 DISP " D i s s o l u t i o n Parameters and IR % have been recorded" e BEEP@ W AIT 3000 @ GOTO I0 1150 ! EDIT VOLUME OF VOLUMETRIC (OVERFLOW) $ * l * ¢ l ¢ * l l l t * l l l t t l t l ¢ * l $ ¢ * ¢ $ l l * ¢ 1160 CLEAR @ VV=O @ MA=O 1170 ASSIGN# 1 TO "DATA N" ~ READ# I ; N 1180 ASSIGN# 2 TO "DATA DV" @ ASSIGN# 3 TO "DATA DW" 1190 FOR I -1 TO N @ READ# 2 I V(1)~ READ# 3 1W(1)@ NEXT I 1200 DISP " Enter INDEX o~ C o r r e c t i o n " @ INPUT I 1210 IF I>500 THEN 1200 1220 IF W(1)<= . I THEN VV=IO 1230 IF W(1)>.I AND W(I)<.27 THEN VV=25

165

1 6 6

1240 1250 1260 1270 1280 1290 1300 1310 132(, 1330

U. B~.~o and E.G. L o n g

IF W(I)>= .27 THEN VV=50 DISP @ DISP " INCORRECT Volume was ";VV DISP " Enter CORRECT Volume of Vo lumet r i c " @ INPUT MA V(1)=VV/V(1) V(1)=MA/V(1) DISP " Any Co r rec t i ons : Yes/No [ Y / N ] " @ INPUT C$ IF C$="Y" THEN 1200 IF C$="N" THEN 1320 FOR I= i TO N @ PRINT# 2 ; V (1 ) @ NEXT I ASSIGN# 1 TO ¢ @ ASSIGN# 2 TO ¢ @ ASSIGN# 3 TO ¢ @ GOTO 1140

10 ! THIS PROGRAM CALCULATES THE ELEMENTAL CONCENTRATIONS ¢ ¢ ¢ ¢ ¢ ¢ * ¢ ¢ $ $ $ ¢ 20 CLEAR @ PAGESIZE 16 30 WN=O @ NS=O @ N81=0 @ I=O @ N=O @ W=O @ Y=O 40 ! W- ORDER OF ELEMENT; AN(1), AN1(1)- CHEMICAL DATA ON AAS OPERATING DISC 5(' SHORT AN1(100),DV(500),IN(500,3),AN(500) 60 ! NAME OF PROGRAM IS "ELEMENT ~. 70 CLEAR @ DISP " ELEMENT CALCULATIONS INDEX" 80 DISP @ DISP " 1. Enter ALL ELEMENTAL values from Keyboard

2. Ed i t ELEMENTAL va lues entered from Keyboard" 90 DISP " (or a l l AAS va lues transferred from d i s c ) " 1 0 0 DISP @ DISP " 3. Transfer I n i t i a l ELEMENTAL va lues from AAS Diec

4. Transfer A d d i t i o n a l ELEMENTAL va lues from AAS Disc

110 DISP " 5. Ed i t AAS ELEMENTAL va lues using Keyboard" 120 DISP " (before f i n a l r e - c a l c u l a t i o n s ) " 130 DISP @ DISP " 6. Return to Master Inde>:

7. Stop the Program" 140 INPUT X@ ON X GOTO 170~280,590,750~920~150,160 150 CHAIN "MASTER:D710" 16(, CLEAR @ DISP " END

Press RUN to r e s t a r t Program " @ END 17(, ! ENTER ALL ELEMENTAL VALUES ~ , ~ ¢ ~ KEYBOARD ¢ $ * ¢ ¢ ~ ¢ ~ , $ $ ~ $ ¢ ¢ $ ¢ $ 180 ! CHEMICAL VALUES IN "PPM" (AAS) ARE ENTERED MANUALLY 190 GOSUB 1070 @ GOSUB 1180 200 FOR I= I TO N @ GOSUB 38(' @ NEXT I 210 CLEAR @ DISP " Please wa i t a moment " 220 GOSUB 1310 230 FOR I=1 TO N @ PRINT# 4 ; AN(1) @ NEXT I 240 GOSUB 1300 25(, DISP " Values have been s to red " @ BEEP @ WAIT 1000 @ GOTO 7(, 260 ! EDIT VALUES ¢ $ ¢ ¢ ¢ $ ¢ ¢ $ $ $ ¢ ¢ * * ¢ ¢ * ¢ ¢ $ * ¢ $ $ ¢ ¢ ¢ ¢ ¢ ¢ ¢ , $ ¢ ¢ * * * * ¢ ¢ ¢ $ ¢ , ¢ $ $ , ¢

270 ! EDIT ENTERED DATA AFTER RECALCULAFION 280 GOSUB 1070 @ GOSUB 1180 @ CLEAR 290 GOSU~ 1310 300 FOR I= I TO N @ READ# 4 ; AN(1)@ NEXT I 310 DISP " Enter Index of Correction " @ INPUT I@ IF I>1000 THEN 70 32,:, DISP " [ " | I ; " ] " , " OLD VALUE" @ AN( I )=AN(1) / (Y tDV(1) ) @ DISP AN(1) 330 34t~ 350 360

70 ~80 390 400 410 420 43O 440 450 460 4 7 0 480 490 500 510 520 53(, 54(, 550 5bO 5 70 580 59L~ b00 b 1 0

GOSUB 380 @ CLEAR @ DISP " Any Co r rec t i ons " Yes/No (Y/N)" @ INPUT C$ IF C$="Y" THEN 310 IF C$="N" THEN GOSUB 1300 ELSE 330 GOTO 220 ! CALCULATE THE ELEMENTAL CONCENTRATION IN THE ROCK ¢~¢¢~$¢~¢$1¢$~ DISP " Enter Value f o r Sample # " ; I N ( I , 3 ) ; " [ " ; I ; " ] " INPUT AN(1) AN(1)=IP (AN(1)¢YCDV(1)) IF AN(I)>20 THEN 420 ELSE 450 IF FP (AN(1) /10)> .3 AND FP ( A N ( I ) / I O ) < . 7 THEN 430 ELSE 440 AN( I }= IP ( A N ( I ) / 1 0 ) ¢ I 0 + 5 @ GOTO 450 AN( I )= IP (AN(1)/10+.5)~10 RETURN ! END OF CALCULATION $$¢¢¢¢$~S$~¢¢¢,¢$$~¢$~¢$~¢¢¢$$¢~,~¢$, ASSIGN# 4 TO "DATA A:D710" @ ASSIGN# 7 TO "DATA NSI:D710" @ RETURN ASSIGN# 4 TO "DATA B:D710" @ ASSIGN# 7 TO ASSIGN# 4 TO "DATA C:D710" @ ASSIGN# 7 TO ASSIGN# 4 TO "DATA D:D710" @ ASSIGN# 7 TO ASSIGN# 4 TO "DATA E:D710" @ ASSIGN# 7 TO ASSIGN# 4 TO "DATA F:D710" @ ASSIGN# 7 TO ASSIGN# 4 TO "DATA G:D710" @ ASSIGN# 7 TO ASSIGN# 4 TO "DATA H:D710" @ ASSIGN# 7 TO ASSIGN# 4 TO "DATA I :D710" @ ASSIGN# 7 TO ASSIGN# 4 TO "DATA J:D710" @ ASSIGN# 7 TO ASSIGN# 4 TO "DATA K:D710" @ ASSIGN# 7 TO

"DATA NS2:D710" @ RETURN "DATA NS3:D710" @ RETURN "DATA NS4:D710" @ RETURN "DATA NS5:D710" @ RETURN "DATA NSb:D710" @ RETURN "DATA NS7:D710" @ RETURN "DATA NS8:D710" @ RETURN "DATA NSg:D710" @ RETURN "DATA NS10:D710" @ RETURN "DATA NS11sD710" @ RETURN

ASSIGN# 4 TO "DATA L:D710" @ ASSIGN# 7 TO "DATA NS12:D710" @ RETURN EN[ER INITIAL ELE VALUES FROM DISC *~1¢¢¢¢$¢¢*~$$¢$¢*~¢¢$$1,$t1¢,~

! CHEMICAL DATA IS AUTOMATICALLY TRANSFERRED FROM THE AAS DISC GOSUB 1070 @ CLEAR @ GOSUB 1260

Computer analysis of AAS generated data 167

620 DISP @ DISP " E n t e r which ELEMENTAL Va lues are t o be t ransferred" @ INPU T WN 630 DISP '° En te r t he NUMBER o f Samples t h a t a re t o be t ransferred" ~ INPUT N S 640 CLEAR @ DISP " P lease w a l t a moment" @ ON WN GOSUB I020 , I030 ,1040 ,1050p 1060 650 FOR I=1 TO NS @ READ# 6 ; AN(1)@ NEXT I 660 ASSIGN# 6 TO ¢ 670 IF N=NS THEN 680 ELSE 710 680 GOSUB 1180 @ FOR I=1 TO NS @ GOSUB 400 @ NEXT I 690 GOSUB 730 @ FOR I=1 TO NS @ PRINT# 4 ; AN( I t @ NEXT I 700 CLEAR @ DISP " P lease w a i t a moment" @ GOTO 240 710 GOSUB 730 @ FOR I=1 TO NS @ PRINT# 4 ; AN( I t @ NEXT I 720 PRINT# 7 ; NS @ GOTO 240 730 GOSUB 1310 740 RETURN 750 ! ENTER ADD VALUES FROM AAS DISC : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 760 GOSUB 1070 @ CLEAR @ GOSUB 1260 770 DISP @ DISP " En te r whlch ELEMENTAL Values are t o be t r a n s f e r r e d " @ INPU T WN 780 GOSUB 1310 790 READ# 7 ; NS@ DISP @ DISP " P r e v i o u s l y " ; N S | " number o f samples were t r a n s f e r r e d " 800 DISP " En te r the NUMBER of Samples t h a t a re t o be t r a n s f e r r e d t h i s Time"

@ INPUT 0 810 CLEAR @ FOR I = I TO NS 6' READ# 4 ; AN(1)@ NEXT I 820 ASSIGN# 4 TO $ 830 ON WN GOSUB 1020 ,1030 ,1040 ,1050 ,1060 840 FOR I = I TO O @ READ# 6 ; ANt ( I }@ AN(I÷NS)=ANI(1) @.~EXT I 850 ASSIGN# 6 TO 860 IF N=NS+Q THEN 870 ELSE 880 070 GOSUB 1180 @ FOR I=1 TO N @ GOSUB 400 ~ NEXT I 880 GOSUB 1310 890 FOR I = I TO NS+O @ PRINT# 4 ; AN( I t ~ NEXT I 900 NS=NS+O @ PRINT# 7 ! NS 910 CLEAR @ DISP " P lease w a i t a moment" @ GOTO 240 920 ' EDIT ELE VALUES FROM AAS =¢¢¢$$$¢$$¢¢$¢¢¢¢¢$$$8¢$~$¢$$~$SS=$S$$~$~ 930 ! EDIT AAS VALUES BEFORE THEY HAVE BEEN RECALCULATED 940 CLEAR @ 80SUB 1070 @ GOSUB 1310 950 READ# 7 ; NS@ FOR I=1 TO NS @ READ# 4 1 AN(It@ NEXT I 960 CLEAR @ DISP " En te r the Inde>c o f C o r r e c t i o n " @ INPUT I 970 DISP " OLD E lementa l v a l u e " ;AN(1) 980 DISP @ DISP " En te r NEW Elementa l v a l u e " @ INPUT AN(1) 990 CLEAR @ DISP " Any Co r rec t i ons= Yes/No (Y /N ) " @ INPUT C$ 1000 IF C$="Y" THEN 960 1010 IF C$="N" THEN 1230 ELSE 960 1020 ASSIGN# 6 TO "DATA11:D700" @ RETURN 1030 ASSIGN# 6 TO "DATA12:D700" @ RETURN 1040 ASSIGN# 6 TO "DATAI~tD700" @ RETURN 1050 ASSIGN# 6 TO "DATA14:D700" @ RETURN 1060 ASSIGN# 6 TO "DATA15:D700" @ RETURN 1070 ASSIGN# 5 TO "DATA T:D710" @ READ# 5 ; A$@ ASSIGN# 5 TO ¢ 1080 ! MENU PROGRAM FOR TRANFERRING DATA FROM THE AAS DISC 1090 ! THE ORDER FOR THE FIRST 5 ELEMENTS IS FIXED : Ca, Mg, S t , Mn, Na 1100 ! ORDER OF THE OTHER ELEMENTS IS SET BY THE USER 1110 CLEAR @ DISP @ DISP " Th ls Program C a l c u l a t e s The E lementa l Concen t r a t l o n s For P r o j e c t " ;AS 1123 DISP @ DISP " The Order f o r t he Elements i s I " 1130 DISP " I . Ca 2. Mg 3. Sr

4. Mn 5. Na 6. A1 " 1140 DISP " 7. Fe 8. Zn 9. Cu

10. Ni 11. V 12. ~b " 1150 DISP " I I o f them I160 DISP @ DISP "

The o r d e r f o r t he l a s t 7 e lements can be changed. A l s o no t a have t o be r e c o r d e d ! "

En te r the ORDER o f Element computed ( I - 1 2 1 " @ INPUT W

1170 ASSIGN# I TO "DATA N:D710" @ READ# I ! N@ ASSIGN# I TO ¢ @ RETURN 1180 ASSIGN# 2 TO "DATA INIT :D710" ~ ASSIGN# 3 TO "DATA DV:D710" 1190 FOR I=1 TO N @ READ# 3 ; DV(1)@ FOR de1 TO 3 @ READ# 2 ; I N ( I , J } @ NEXT J NEXT I 1200 DISP @ DISP '° A d d i t i o n a l DILUTION F a c t o r " @ INPUT Y 1210 IF Y=O ]HEN Y=! @ ASSIGN# 2 TO ¢ @ ASSIGN# ~ TO 1220 RETURN 1230 CLEAR @ DISP " P lease w a i t a moment" 1240 GOSUB 1300 @ GOSUB 1310 1250 FOR I = I TO NS @ PRINT# 4 ; AN( I t @ NEXT I @ GOTO 240 1260 DISP @ DISP " ORDER of Elements on A .A .S . Disc i s : " 1270 DISP @ DISP " 1 2 3 4

168 U. BRAND and E G LogEg

1280 DISP " Disc I Ca Mg Zn Cu Nl Disc 2 Sr Fe Na Mn A l "

1290 DISP " Disc 3 Ba Pb V Cd" @ RETURN 1~00 ASSIGN# 4 TO * @ ASSIGN# 7 TO * @ RETURN I~I'~ ON W ~i~cll~ 4~,~,48f, 49,'~.500,510,520,5~0~540,550,560,570.580 @ RETIJRN

10 ! THIS PROGRAM PRINTS THE DATA (COMPRESSED) ¢¢¢*¢¢¢$$$$¢~$~¢¢*~¢~¢~*$*$$* 20 F'RINTER IS 702•132 30 CLEAR @ MASS STORAGE IS " :D710" 40 ' NAME OF PROGRAM IS PRINTC 50 SHORI IN(500,3),A(500),B(500),C(500),D(500),E(500),F(500),G(500),H(500).I(500 ),J(500),K(500),L(51)O),IR(500) 60 ! A(1) TO L(1) ARE DATA STORAGE BANKS; IN(I,3)- SAMPLE PARAMETERS 70 KS= .... @ L$= .... @ DIM SI$[160],LI$[160]

80 ! $I$, LI$ LISTING OF SAMPLE DESCRIPTIONS; E.G. LOCALITY, ETC. 90 CP=O @ Q=O @ P=O @ A$="Ca" @ ~$="Mg" @ C$="Sr " @ D$="Mn" @ E$="Na" @ F$="" @ G$ ="" @ H$="" @ IS="" @ d$= ....

100 N=O @ EI=O @ N=O @ II=O @ 12=0 @ SRI=O @ SR2=0 @ NAI=O @ NA2=O 110 CLEAR @ DISP " PRINT INDEX" 12,) DISP @ DISP " I . PRINT DATA (Compressed)

2. Re tu rn t o MASTER INDEX" 130 DISP " 3. Stop the Program 140 INPUT K@ ON K GOTO 170,150 ,160 150 CHAIN "MASTER" 160 CLEAR @ DISP "

170 ASSIGN# 9 TO 180 ASSIGN# 10 TO 190 CLEAR @ DISP " OJECT 200 DISP @ DISP "

END Press RUN t o r e s t a r t Program " @ END

"DATA T" @ READ# 9 ; WI$@ ASSIGN# 9 TO $ "DATA W" @ READ# 10 ! El@ ASSIGN# 10 TO ¢

THIS PROGRAM PRINTS THE CALCULATED ELEMENTAL VALUES FOR PR " ;WI$

The f i r s t f l v e (5) e lements are se t a t : Ca, Mg, Sr , Mn, Na"

210 DISP 220 ON El 230 INPUT 240 INPUT 250 INPUT 260 INPUT 270 INPUT 280 INPUT

" En te r the a d d z t i o n a l " ; E I - 5 ; " c o m p u t e d Elements in o rde r (max 7 ) " GOTO 2 1 0 , 2 1 0 , 2 1 0 . 2 1 0 , 3 1 0 , 2 3 0 , 2 4 0 , 2 5 0 , 2 6 0 . 2 7 U , 2 8 0 , 2 9 0 F$@ GOTO 310 F$,G$@ GOTO 310 F$,G$.H$@ GOTO 310 F$,G$,H$, I$@ GOTO 310 F$ ,G$ ,H$ , I$ ,J$@ GOTO 310 F$ ,G$ ,H$ , I$ ,J$ ,K$@ GOTO 310

290 INF'UT F$.O$,H$, I $ , JSpK$ .L$ 300 ' TEXT FOR "SP ' , 'LM" IS LIMITED TO 160 CHARACTERS ~10 DISF' " ENTER KEY FOR SP (max 160)" @ INPUT $15@ DISP 320 DISP " ENTER KEY FOR LM (max 160) " @ INPUT LI$@ DISP 330 DISP " ENTER NUMBER OF COPIES DESIRED" @ INPUT 12 340 ASSIGN# I TO "DATA N" @ ASSIGN# 2 TO "DATA IN IT " @ ASSIGN# 3 TO "DATA IR"

@ READ# I ; N 350 FOR I = l TO N @ READ# 3 ; IR ( I )@ FOR d=l TO 3 @ READ# 2 ; I N ( ; , J ) @ NEXT J @ N EXT I 360 FOR O=l TO El @ ON O GOSUB 1080 ,1090 ,1100 ,1110 ,1120 ,1130 ,114c } ,1150 ,1160 ,1170 • 1180, 1190 @ NEXT O 370 ! PAGE SET-UP FOR PRINTING OF CHEMICAL DATA 380 FOR 11=I TO 12 390 PRINT CHR$ <27)&"&k2S" @ CP=O 400 PRINT " APPENDIX. Geochemical da ta of p r o j e c t "&W 15 410 PRINT @ GOSUB 1060 42,) GOSUB 950 @ PRINT 43(. GOSUB 1060 440 PRINT CHR$ (15) 450 ON El GOSUB 920, 920, 920, 920, 650, 680, 71(), 740, 770, 800, 830, 860 460 PRINT @ GOSUB 1060 470 PP, INT @ PRINT " IR i s t he I n s o l u b l e Residue in per cen t A l l E lementa l C o n c e n t r a t i o n s are I n ppm" 48(, PRINT USING 490 ; $15 490 IMAGE / , 2 6 X , " Key f o r SP: " ,120X,160A 500 PRINT USING 510 ; L15 510 IMAGE / , 2 b X , " Key f o r LM: " ,120X,160A 520 PRINT CHR$ (12) @ NEXT 11 530 ! THIS CALCULATES THE Sr/Ca AND Sr /Na RAT IOS$¢*$ * *~¢¢$* * *¢$ *$$*$¢$* *$$ * 540 CP=O @ PRINT CHR$ (27)&"&kgS" 550 PRINT . . . . ;WI$ @ PRINT CHR$ (27)&"&k2S" 560 PRINT @ GOSUB 1060 570 PRINT @ GOSUB 1220 @ PRINT 580 GOSUB 106,) 590 GOSUB 1240 bOO PRINT @ GOSUB 1060

Computer analysis of AAS generated data

610 ASSIGN# I TO 620 ASSIGN# 2 TO $ 630 ASSIGN# 3 TO 640 PRINT CHR$ (12) ~' PRINT CHR$ (12) @ PRINT CHR$ (7) ~ GOTO 110 650 FOR P=I TO N 660 PRINT USING 890 ; I N ( P , 3 ) , I N ( P , I ) , I N ( P , 2 ) , I R ( P ) , A ( P ) , B ( P ) t C ( P ) , D ( P ) t E t P ) 670 GOSUB 9~0 ~ NEXT P t~ RETURN 680 FOR F=1 TO N 690 PRINT USING 890 ! I N ( P , 3 ) , I N ( P , I ) , I N ( P , 2 ) , I R ( P ) I A ( P ) t B ( P ) , C ( P ) , D ( P ) P E ( P ) , F ( P ) 700 GOSUB 9_xO ~ NEXT P L ~ RETURN 710 FOR P=I TO N 720 PRINT USING 900 ; I N ( P , 3 ) , I N ( P o l ) , I N ( P , 2 ) p I R ( P ) p A ( P ) p B ( P ) , C ( P ) m D ( P ) ~ E ( P ) t F ( P ) ,G(P) 730 GOSUB 930 @ NEXT P @ RETURN 740 FOR P=I TO N 750 PRINT USING 900 ; I N ( P , 3 ) w I N ( P , 1 ) , I N ( P , 2 ) , I R ( P ) , A ( P ) , B ( P ) , C ( P ) , D ( P ) , E ( P ) , F ( P ) ,G(P) .H(P) 760 GOSUB 930 @ NEXT P @ RETURN 770 FOR P=I TO N 780 PRINT USING 900 | I N ( P , 3 ) ~ I N ( P , I ) , I N ( P ~ 2 ) ~ I R ( P A ~ A ( P ) , B ( P ) , C ( P ) , D ( P ) , E ( P ) ~ F ( P ) . G ( P ) . H ( P ) , I (P) 790 GOSUB 930 @ NEXT P @ RETURN 800 FOR P=I TO N 810 PRINT USING 910 ! I N ( P , 3 ) , I N ( P , 1 ) ~ I N ( P ~ 2 ) , I R ( P ) , A ( P ) , B ( P ) ~ C ( P ) , D ( P ) , E ( P ) ~ F ( P ) , G ( P ) . H ( P ) , I ( P ) , J ( P ) 820 80SUB 930 L~ NEXT P @ RETURN 830 FOR F'=I TO N 840 PRINT USING 910 ; IN (F ' , 3 )~ IN (P , 1 ) , I N ( P , 2 ) , I R ( P ) , A ( P ) , B ( P ) , C ( P ) , D ( P ) , E ( P ) , F ( P ) .G(P) , H (F') , I (P) ,O (P) ,I~i (P) B50 GOSUB 930 @ NEXT F' @ RETURN 8au FOR P=I TO N 870 PRINT USING 91U I I N ( P , 3 ) , I N ( P , I ) ~ I N ( F ' , 2 ) , I R ( P ) , A ( P ) , B ( P ) , C ( P ) , D ( P ) , E ( P ) , P ( P ) , G ( P ) . H ( P ) , I ( P ) , J ( P ) , K ( P ) , L ( P ) 880 GOSUB 930 @' NEXT P L ~ RETURN 89,> IMAGE / , 3 3 X . 6 D , 2 ( 4 D ) , 3 D . D , X , 6 ( B D ) ~i~0 IMAGE / , 2 7 X . 6 D , 2 ( 4 D ) , ~ D . D , X , 9 ( 7 D ) 910 IMAGE / , 3 t D , 2 ( 3 D ) , 3 D . D , 7 ( 7 D ) , 5 ( 5 D ) ~20 GO'gO 110 930 IF F'=CF' THEN 94~:~ ELSE RETURN 940 PRINT CHR$ (12) ~ PRINT CHR$ (10) @ PRINT CHR$ (10) 95u ON El GOSUB 9 7 0 , 9 7 c ~ . 9 7 0 . 9 7 0 . 9 8 0 , 9 9 0 , 1 0 0 0 , 1 0 1 0 , 1 0 2 0 , 1 0 3 0 , 1 0 4 0 , 1 0 5 0 960 CF'=CP~-22 o~, RETURN 97,1~ RETURN '~BC~ PRINT USING 1320 : A$.B$,C$°D$,E$ @ RETURN ~90 PRINT USING I.~20 ; A$ .B$ ,C$ .D$ .E$ .F$ • RETURN I(i.]0 PRINT USING I~30 ; A$ ,B$ ,C$.D$,E$,F$ ,G$ • RETURN t,,1', F'g:INF LIf~IP,I(., t3".'.(, : A$.R$,C$.D$.E$°F$~G$,H$ @ RETURN 1020 PRINT USING 1330 ; A $ , B $ , C $ , D t , E t , F $ , G $ , H $ , I $ ~ RETURN 1030 PRINT USING 1340 ; A $ , B $ , C $ , D $ , E $ , F $ , G $ , N $ , I $ , 3 $ @ RETURN 1040 PRINT USING 1340 I A $ , B $ , C $ , D $ ~ E $ , F $ , G $ , H $ , I $ , ~ $ , K $ @ RETURN 105(') PRINT USING 1340 ! A$ ,B$ ,C$ ,D$~E~ ,F$ ,G$ ,H$ , I $~d$ ,K$ ,L$ ~ RETURN 1060 PRINT " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ,,

1070 RETURN 1080 ASSIGN# 5 TO TO S ~ RETURN 1090 ASSIGN# 5 TO TO $ @ RETURN 1100 ASSIGN# 5 TO TO ~ @ RETURN 1110 ASSIGN# 5 TO TO $ ~ RETURN 1120 ASSIGN# 5 TO TO * @ RETURN 1130 ASSIGN# 5 TO TO * ~ RETURN 1140 ASSIGN# 5 TO TO s ~ RETURN 1150 ASSIGN# 5 TO TO $ ~ RETURN 1160 ASSIGN# 5 TO TO $ @ RETURN 1170 ASSIGN# 5 TO TO * @ RETURN 1180 ASSIGN# 5 TO TO = @ RETURN 1190 ASSIGN# 5 TO TO $ ~ RETURN

"DATA A" @ FOR P-1 TO N • READ# 5 ! A(P)@ NEXT P @ ASSIGN# 5

"DATA B" @ FOR P=I TO N @ READ# 5 ; B(P)~ NEXT P • ASSIGN# 5

"DATA C" @ FOR P=I TO N • READ# 5 ! C(P)@ NEXT P • ASSIGN# 5

"DATA D" • FOR P=I TO N • READ# 5 ; D(P)~ NEXT P @ ASSIGN# 5

"DATA E" @ FOR P=I TO N @ READ# 5 ! E(P)~ NEXT P • ASSIGN# 5

"DATA F" • FOR P=I TO N @ READ# 5 ; F(P)@ NEXT P @ ASSIGN# 5

"DATA G" @ FOR P - I TO N @ READ# 5 ; G{P)@ NEXT P • ASSIGN# 5

"DATA H" • FOR P=I TO N ~ READ# 5 ! H(P)@ NEXT P @ ASSIGN# 5

"DATA I " @ FOR P-1 TO N @ READ# 5 ; I(P)@ NEXT P B ASSIGN# 5

"DATA d" @ FOR P - I TO N @ READ# 5 ; d(P)@ NEXT P • ASSIGN# 5

"DATA K" @ FOR P=I TO N • READ# 5 ; K(P)@ NEXT P • ASSIGN# 5

"DATA L" @ FOR P=I TO N • READ# 5 ; L(P)@ NEXT P • ASSIGN# 5

169

CAGEO ~4:2-C

170 U. BJLA~D and E.G. LO~EK

1200 IF P=CP THEN 1210 ELSE RETURN 1210 PRINT CHR$ (121 1220 PRINT "

mSr/mCa Mn Sr/Na (wt) 1230 1240 1250 12b0 1270 1280 IZ90 1300 131(I 1320 1330 1340

CP=CP+22 • RETURN FOR P=I TO N SRI=C(P)/A(P)$IO00 SR2=C(P) /87.62/ (A(PI /40.081 NAI=C(P)/E(P) NAZ=C(P)/87.62/(E(P) /22.98977)

SAMPLE SP LM 1000 St/Ca (wt) mSr/mNa"

PRINT USING 1310 | IN (P ,3 ) , IN (P , I ) , IN (P~2) ,SR1 ,SR2 ,D(P) ,NA1 ,NA2 SOSUB 1200 @ NEXT P @ RETURN IMAGE / ,35D,2(bD),11D.4D,10D.4D, 10D,2(8D.3DI IMAGE I / , 3 3 X , " S a m p l e " , 2 X , " S P " , 2 X , " L M " , 2 X ~ " I R " , X , & ( b X , 2 A I IMAGE 1 / , 2 7 X , " S a m p l e " , 2 X , " S P " , 2 X , " L M " , 2 X , " I R " , X , 9 ( 5 X , 2 A ) IMAGE 1 / ,25X , "Samp le " ,X , "SP" ,X , "LM"~2X, " IR" ,7 (5X ,2A) ,4X~2A,4 (3X ,2A)

It~ ! F'ROGRAM STORES THE DATA IN BURROUGHS MAINFRAME * * * I Z $ * ~ 1 5 5 I * $ I 20 CLEAR @ MASS STORAGE IS ":D710" ~0 ! NAME OF PROGRAM IS 'TEP' WHICH CAN BE USED TO AUTOMATICALLY TRANSFER 4r~ ! DATA TO MAINFRAME, CAN ALSO BE USED FOR COMMUNICATION ALONE 50 F'AGESIZE 24 ! SIZ'E OF SCREEN IS INCREASED 60 FI=0 ~' W=O @ Q=O @ K=O @ N=O 70 SHORT A(500)~B(500),C(5(I(1),D(SCO) ~E(500).F(5001,G(5001tH(500), I (500) ,J (500) ,K (5001 . L (500~, IN (5"W , 31 , IR (500) 80 DIM AS[4000 ] ,B$ [4000 ] ,R$ [4000 ] ,S$E200 ] ,T$ [4000 ] .US [110 ] .W$ [ I10 ] ,X$ [50 ] 9,) CLEAR @ DISF' " Set the Se r i a l I n t e r f a c e Switch to '2" "

110

120 130 140 150

IbO 170 180 190 2(10 211"1 220 230 240 250 240 27O 280 290 300 310 320 330 34O 350 361"I 37O 380 39(I 400 410 42Cl 43O 440 45O 4bO 47O 480 490 5')0 510 520 530 54(I 550 560 57O 580

DISP @ DISF' " T.E.P. INDEX" DISP @ DISP " I . Transfer DATA to B7900

2. Return t o MASTER INDEX" DISP " 3. Stop the Program" INPUT K@ ON K GOTO 160,140,150 CHAIN "MASTER" CLEAR @ DISP " END

Press RUN to r e s t a r t Program " @ END CLEAR @ ON KEY# I , " INPUT" GOTO 420 ON KEY# 4,"<CR>" GOTO 460 ON KEY# 3, "PAUSE" GOTO 500 ON KEY# 2, "SEND" GOTO 540 CLEAR @ DISP @ DISP " LOG HP-86B ON TO THE B7900 [any Key ] " ! ANY KEY OF THE KEYBOARD PROVIDES LINK-UP INPUT BI$@ CLEAR ~ KEY LABEL RESET 10 • ASSERT 1017 @ ENABLE KBD 255 ! SETS DEFAULT CONDITIONS AND TAKES CONTROL OF LINE CONTROL 10,1 ; 11@ CONTROL 10,3 ; 139 CONTROL 10,4 i 58

PROGRAM REQUIRES THAT THE MODEM SIGNAL IS SET TO HALF DUPLEX "#,#K" DATA SEND BY FREE-FIELD FORMAT + NO LINE FEED IS NEEDED TO END TRANSMISSION CONTROL 10,1311 SETS THE CLEAR TO SEND (INTERRUPT MASK) CONTROL 10 ,3313 SETS THE BAUD RATE TO 4800 (MODEM CONTROL SIGNAL) CONTROL 10,4|58 SETS 7 BITS/CHARACTER, 0 PARITY, 1 STOP BIT CONTROL 10, I ;11 SETS THE CLEAR TO SEND (INTERRUPT MASK)

IF FI=O THEN OUTPUT 10 ;CHR$ (13) IOBUFFER T$ @ IOBUFFER R$ ! SETS UP INPUT-OUTPUT BUFFER OF 4000 CHARACTERS FOR TRANSMITTING AND ! RECEIVING OF DATA TRANSFER 10 TO R$ INTR GOSUB 1080 IF F1=I THEN 700 ENABLE KBD 33 GOTO 380 INPUT T$ TRANSFER T$ TO 10 INTR IF T$="BYE" THEN F1=1 GOTO 381:1 T$=CHR$ (32) TRANSFER T$ TO 10 INTR GOSUB 1080 GOTO 380 ENABLE KBD 15 DISP " PAUSED " HALT 10 @ PAUSE GOTO 420 ASSIGN# 7 TO "DATA T" • READ# 7 ; W15@ ASSIGN# 7 TO * DISP " ENTER FILENAME FOR PROJECT " jWI$ @ INPUT X$ T$="MAKE "&X$&" DATA" TRANSFER T$ TO 10 INTR GOSUB 1080

Computer analysis of AAS generated data 171

590 CLEAR bOO ASSIGN# I TO "DATA N" • READ# 1 ! N@ ASSIGN# 1 TO $ 610 ASSIGN# 4 TO "DATA IR" @ FOR I=1 TO N ~ READ# 4 ; IRiI)@ NEXT I @ ASSIGN# 4

TO $ b20 ASSIGN# 2 TO "DATA INIT" @ FOR I=1 TO N ~ FOR ,]=1 TO 3 a30 READ# 2 ; IN( I ,J)@ NEXT J @ NEXT I @ ASSIGN# 2 TO b40 ASSIGN# 3 TO "DATA W" ~ READ# 3 = EI~ ASSIGN# 3 TO = 6,50 FOR 0=I TO E1 @ ON Q GOSUB 1260• 1270, 1280, 1290, 1300, 1310, 1320, 1330, 1340, 135o • 13b0,1370 @ NEXT 0 660 ON El GOSUB 1250, 1250o 1250,1250, 730, 770, 810, 850• 890, 930, 970, 1010 670 DISP " TRANSFER FINISHED" • T$="SAVE" b80 TRANSFER T$ TO 10 INTR ~ GOSUB 1080 b?O DISP • DISP " DATA SAVED IN 87900" ~ T$="BYE" 700 GOSUB 1080 710 HALT 10 ~ NAIT 3000 • ENABLE KBD 255 @ CLEAR @ GOTO 110 720 ! FORMAT FOR THE DATA TO BE SEND TO MAINFRAME 730 FOR W=I TO N 740 U$=VAL$ iN+99)& . . . . &VAL$ (INiW,3))&"j"&VAL$ (IN(W,I))&","&VAL$ (INiW,2))&"m"& VAL$ (IR(W))&","&VAL$ (A(W))&","&VAL$ (B(W))&","&VAL$ (C(W)) 750 W$=VAL$ (DiW))&'°,"&VAL$ (EiW)) 760 GOSUB 1050 @ NEXT W 9 RETURN 770 FOR W=I TO N 780 U$=VAL$ (W+99)&" "&VAL$ (INiW, 3))&","&VAL$ (IN(W,1))&"t"&VAL$ (INiWp2))&"w"& VAL$ (IR(W))&","&VAL$ (A(N))&","&VAL$ (B(W))&","&VAL$ (CiW)) 790 W$=VAL$ (D(W))&"m"&VAL$ (E(W))&","&VAL$ (FIN)) 800 GOSUB 1050 @ NEXT W ~ RETURN 810 FOR W=I TO N 820 U$=,VAL$ (W+99)&" "&VAL$ (INiW, 3) )&", "&VAL$ (INiW, I))&","&VAL$ (IN(W,2))&'°, "& VAL$ (IR(W))&","&VAL$ (A(W))&","&VAL$ (B(W))&","&VAL$ (CiW)) 830 W$=,VAL$ (DiN))&","&VAL$ (E(W))&","&VAL$ (F(W))&","&VAL$ (G(W)) 840 GOSUB 1050 • NEXT W ~ RETURN 850 FOR W=I TO N 860 U$=VAL$ (W+99)&" "&VAL$ iIN(W,3))&","&VAL$ (IN(W,I))&","&VAL$ ( IN iW,2) )&" , "& VAL$ (IRiW))&","&VAL$ (AiW))&","&VAL$ (B(W))&","&VAL$ (C(N)) 870 W$=VAL$ (D(W))&"9"&VAL$ (EiW))&","&VAL$ (FiW))&","&VAL$ (G(W))&"m"&VAL$ (H(W )) 880 GOSUB 1050 @ NEXT W @ RETURN 890 FOR W=I TO N 900 U$=VAL$ (W*99)&" °'&VAL$ (INiW, 3) )&'°, "&VAL$ (IN(W,I))&","&VAL$ ( IN(W,2))&","& VAL$ (IR(W))&","&VAL$ (AiW))&'°,"&VAL$ (B(W))&","&VAL$ (C(W)) 910 W$=VAL$ (D(W))&"t"&VAL$ (E(W))&","&VAL$ (F(W))&°°,"&VAL$ (G(W))&","&VAL$ (H(W ) )&", "&VAL$ ( I (W)) c)20 GOSUB 1050 6' NEXT W ~ RETURN 930 FOR W=I TO N 940 Ug=VAL$ iW+99)&" "&VAL$ (IN(W,3))&°°,"&VAL$ (IN(Wpl))&","&VAL# (IN(Wm2))&","& VAL$ (IR(W))&","&VAL$ (A(W))&"m"&VAL$ (B(W))&","&VAL$ (C(W)) 950 W$=VAL$ (DiW))&°'t"&VAL$ (E(W))&","&VAL$ (F(W))&'°w"&VAL$ (G(W))&","&VAL$ (H(W ))&","&VAL$ (I iW))&","&VAL$ (QtW)) 9bO GOSUB 1050 @ NEXT W @ RETURN ~770 FOR W=I TO N 980 U$=VAL$ (W÷99)& . . . . &VAL$ (INiW,3))&","&VAL$ (IN(W,1))&","&VAL$ ( IN(W,2)}&","& VAL$ (IR(W))&","&VAL$ (A(W))&","&VAL$ (BiW))&","&VAL$ (C(W)) 990 W$=VAL$ (D(W))&"="&VAL$ (E(W))&","&VAL$ iF(W))&","&VAL$ (G(W))&'°w"&VAL$ (H(W ))&","&VAL$ ( I (W) )&", "&VAL$ (J(W))&","&VAL$ iK(W)) 1000 GOSUB 1050 Q) NEXT W @ RETURN I~;JI0 FOR W=I TO N "1020 U$=VAL$ (bJ+99)&" '°&VAL$ (INiW,3))&","&VAL$ (IN(W,I))&"t"&VAL$ (IN(Wm2))&"," &VAL$ (IR(W))&","&VAL$ (A(W))&"m"&VAL$ (BiW))&","&VAL$ (C(W)) 1030 W$=VAL$ (D(W))&","&VAL$ (E(W))&","&VAL$ (F(W))&","&VAL$ (G(W))&"u"&VAL$ iHi W) )&", "&VAL$ ( I (W) )&"m "&VAL$ (J(W))&","&VAL$ (K(W))&","&VAL$ (L(W)) 1040 GOSUB 1050 @ NEXT W 6' RETURN 105,7 T$,,U$.'.,", "&W$ 1060 TRANSFER T$ TO 10 INTR 1070 GOSUB 1080 @ RETURN 1080 AS=, .... 1090 STATUS R$•0 ; TO,TI,T2, T3 11~'K) IF TI=O THEN 1090 ! 11<, ENABLE KBD Ib0 112¢'~ ENTER R$ USING "#~#K" ! B$ 1:3,) E=LEN (B$)+I 114r, J=1 @ B$[E,E+I]"CHR$ (10) ~ E=E÷I 1150 FOR I"1 TO E 1160 IF B$[I,I ]=CHR$ (7) THEN 1170 ELSE 1180 1170 BEEP 45.120 @ GOTO 1240 118c': IF B$[I01]=CHR$ (10) THEN 1220 1190 A $ [ J , J ] = B $ [ I , I ] 1200 J=J+l 1210 GOTO 1240

172 U. BRA~D and E.GI LOKEK

1220 DISP A$ 1231, AS=" " @ J - I 1240 NEXT I @ RETURN 1250 GOTO 110 1260 ASSIGN# 5 TO TO i @ RETURN 1270 ASSIGN# 5 TO TO X @ RETURN 1280 ASSIGN# 5 TO TO Z @ RETURN 1290 ASSIGN# 5 TO TO S @ RETURN 1300 ASSIGN# 5 TO TO ~ @ RETURN 1310 ASSIGN# 5 TO TO Z @ RETURN I~20 ASSIGN# 5 TO TO ~ @ RETURN 13~0 ASSIGN# 5 TO TO ~ @ RETURN 1~40 ASSIGN# 5 TO TO * @ RETURN I~50 ASSIGN# 5 TO TO * @ RETURN 1360 ASSIGN# 5 TO FO m @ RETURN 1370 ASSIGN# 5 TO TO $ @ RETURN

"DATA A" @ FOR P=I TO N @ READ# 5 ; A(P)@ NEXT P @ ASSIGN# 5

"DATA B" @ FOR P=I TO N @ READ# 5 ; B(P)~ NEXT P @ ASSIGN# 5

"DATA C" @ FOR P=I TO N @ READ# 5 ; C(F')@ NEXT P @ ASSIGN# 5

"DATA D" @ FOR F'=I TO N @ READ# 5 ; D(F')@ NEXT P @ ASSIGN# 5

"DATA E" • FOR P=I TO N @ READ# 5 ; E(P)@ NEXT P @ ASSIGN# 5

"DATA F" @ FOR P=I TO N @ READ# 5 ; F(P)@ NEXT P ~' ASSIGN# 5

"DATA G" @ FOR F'=I TO N @ READ# 5 ; G(F')up NEXT P @ ASSIGN# 5

"DATA H" @ FOR P=I TO N ~ READ# 5 ; H(F')@ NEXT P @ ASSIGN# 5

"DATA I " @ FOR P=I TO N @ READ# 5 : I(F')@ NEXT F' m~ ASSIGN# 5

"DATA J" @ FOR P=I TO N @ READ# 5 ; J(P)@ NEXT P @ ASSIGN# 5

"DATA K" @ FOR P=I TO N @ READ# 5 ; K(F')@ NEXT P @ ASSIGN# 5

"DATA L" @ FOR P=I TO N @ READ# 5 ; L(F')a~, NEXT P @ ASSIGN#

Program Unit." A/I S

00001 0O0O2 0OO03 00004 00005 00006 00007 00008 00009

00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 v0020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 00041 00042 00043 00044 00045 00046

!e*****m* This program presents both p rec i s ion and elemental concent ra t ions der ived erom data obtained wi th an AAS.

! This vers ion (P~SAJER 2.1) was w r i t t e n by Ed Lorek and ! LlWe Brand in June 1987 at Brock U n i v e r s i t y , ! St . Cathar ines Ont. Canada. This program p lo t s values on ! a semi- log scale, ensure your data are compat ib le.

INTEGER NR,VOL,DL,X,Z,Y,NS,O,P,FILENO,UNIT,NUMSAMP REAL RE,RS,CONC,IR,IRE,IRF,AB,ED DIMENSION B(150),A(I50),PREC(10,500) DIMENSION ROCK(10,500) ,WT(500) ,BL(150) CNed~CTER RESP*3,SAM*5,SP~PI(10,252),5,SAMP2(10,252)*5 CHARACTER EL(10)aI0tFILe13mCOND*2,FILLL*13 CHARACTER NNtEe31TITLE*50 CHARACTER SA(500)e5,LMI(500)* I ,SPI (500)* I PARAMETER (EOF-- I )

] F01~IAT (A2) 6 F01~tAT (AI 3) 2 F01~AT (AS, IX tAI t i X t A I ) 7 F 0Rt',AT (AS) 52 FORHAT ( A I / )

PRINTst 'aaeemaeeamaHHeHuH',mmHHumlem*mHtm~HaaleaemJHeHae t S J II.|U a ~***m e*~ Q a.ll w, B, e oil. | s

PRINTs t ' AAS I~TA NtALYSES' PRINTs," BY ED LOREK #~10 UWE BRAND' PRINT*," " PRINTe," BROCK UNIVERSITY ST CATHARINES 0NTARI

PRINTe m" OCTOBER 1986" PRINT*, ' e*******'.maaamm****ma*m**emm*mmm.m mm*mm**m**e,m,a*****e, m,

m , l l a , , , , e , , a , l lM , , , * * , , e ,M , •

URITE (9~52) 4' ' , N - I , 7 ) PAUSE ' PRESS RETURN" RESP" " i F I L - " " IZ=0 PRINT, PRINT*," ONLY ONE FILE NP~tE CAN BE ACCESSED PER SESSION.' PRINT*," ENTER THE NO~IE OF THE DATA FILE TO BE ACCESSED." READ (9,6) FIL PRINT*

150 PRINTe," WHICH FILE 00 YOU WISH TO CREATE OR MODIFY ?" PRINT* PRINT*," PARNtEXER FILE . . . . . . . . . . . . . ENTER S" PRINT*, " WEIGHT FILE . . . . . . . . . . . . . ENTER W" PRINT*," RESIDUE FILE . . . . . . . . . . . . . ENTER I " PRINT*, " ELEHENT FILE . . . . . . . . . . . . . ENTER E"

00047 00048 00049 00050 00051 00052 00053 00054 00055 00056 00057 0005l) 00059 00060 00061 00062 00063 00064 00065 00066 00067 00068 00069 00070 00071 00072 00073 00074 00075 00076 00077 00078 00079 00080 00081 00062 00083 00084 00005 00086 00087 0008l) 00009 00090 0009I 00092 00093 00094 00095 00096 00097 00098 00099 00100 O010I 00102 00103 00104 00105 00106 00107 O010l) 00109 00110 00111 00112 00113 00114 00115 00116 00117 O011l) 00119 00120 00121 00122 00123 00124 00125

Computer analysis o f AAS generated data

62 61

!

PRINTe,' REFERENCE FILE . . . . . . . . . . . . . ENTER R" PRIHTt," AI)SORI)~HCE FILE . . . . . . . . . . . . . ENTER A" PRINTm PRINTI, 'T0 CGqTINUE MITHOUT ACCESSING ANY FILES PRESS RETURN." READ (9 ,1 ) RESP

! ! e H e e CALL SUBROUTINE TO ACCESS FILES !

IF (RESP"E ' ) CALL FILES ( e l S 0 , I 0 , ' E L . ' , ' E L E ' , F I L ) IF (RESI~ 'S ' ) CALL FILES ( t l S 0 , 1 1 t ' S A . ' , ' S P t t " , F I L ) IF (RESP,, ' I ' ) CALL FILES ( m l S O , 1 2 , ' i R . ' , ' i S R ' D F I L ) IF (RESP,.'W') CALL FILES ( l lS0 ,13 , ' t b r r . ' ,%JHT ' ,F IL ) IF (RESPm'A') CALL FILES ( e l S O , 1 4 , ' A I ) . ' , ' A I ) S ' , F I L ) IF (RESI~"R') CALL FILES (m150 ,15 , 'RE . ' , 'REF ' ,F IL )

PRINTw PRIH're,'CONCEHTRATIONS ARE POSSll)LE ONLY IF I)~TA FILES FOR EACH

,ELENEHT IS C01qPLETE." IPRIHTI," " PRINTe,'HOM IqNqV ELENI-3TrS DO YOU MISH TO NqALYSE ? (PRESS ZERO

, [ 0 ] TO EXIT)." X=l IY ' I ;RESP"' " IL=I I IO S'=O INS'=I READe ,Y IF (Y=0) STOP OPEN (ONIT"IO,FILE,.'EL.'//FIL,POSITlOH''REMIHO',ERR"999) OPEN (UHIT"I I ,FILE" 'S~. ' / /FIL,POSITIOI~ 'REMINO" ,ERR"999) OPEN (UHIT"14tFILE" 'AB. ' / /FIL,POSIT|Oiq" 'REMIND" ,ERR"999) READ (IO,m,ERR-888) (EL (X ) ,X " I ,Y ) CLOSE ( 10, ERR"999) PRIHTm PRINTe,'HOIJ tIWIY S~tPLES 00 YOU WISH TO N4ALYSE ? ( PRESS [ - ! )

,FOR ALL S#ItPLE8)" READe ,NS

! !eeeem READ I)~TA FILES FOR CONCENTRATION CALCULATION

MHILE (lOS .NE. EOF) REAl) ( 11 ,e, 10STAT"II)S,ERRu8I)8) SA(L) LuL * I REPEAT NLI4SNtP-L-2 IF (NS" - I ) THEN NS"L-2 ENDIF

NUH SN4pmNuI,1Sd~Ip -NS i RE Sp~, • OPEN (ONIT"I3tFILE-'t.JT.'//FIL,POSITION"'REMIND" tERR-999) READ (13,e,ERR'888) (t4T(K),K=I ,NS) CLOSE (13,ERR'999) ICLOSE ( 11 .ER1~999) OPEN (ONIT"IS,FILE"'RE.'//FIL,POSITIOH"'REI,JIND" ,ER1~'999)

DO 61 N i l ,Y DO 62 K-I ,NS

PREC(N, K)"O COHT ! NUE CONT INUE

! * u * * * RECALLS REFERENCES FOR CONCENTRATION CALCULATIONS NqO ALLOWS ! HO~IFICATIOH OF RESLOPE t~tt.UE !

DO 70 × " I , Y OPEN (UNITal 2,FILE=" IR. " / /FIL,POSITi0N"REMINO" ,ERR-999) READ (15, I ,ERR'888) RStRE READ (ISt*,ERR',B8I)) (A(J) i l ) (J ) ,BL(J) , J " ! oRS) WRITE (9 ,52) ( ' " , lq~ l ,13)

PRIHTe t" DEFAULT RESLOPE I~e~TE IS * ,RE," (SATISFACTORY (Y /H) ) * READ 1 ,RESP

IF (RESP .EO. "N ' ) THEN PRINTe PRIHTmI"ENTER NEU RESLOPE VALUE ! ° READe, RE

ENDIF PRINTe,'EHTER A NON-ZER0 ADOITION~L DILUTION FACTOR FOR "

, ,EL(X) READe, DL RESP-" ' PRINTeo'AI.TERI~IeITE DILUTIONS REOUIRED FOR A PARTICULAR

, S~tPLE (Y/HIT" READe, RESP Jul t lml IK ' I 110S~0

! !Hmee CONCENTI~TION CALCULATIONS !

173

174

00126 00127 00120 00129 00130 00131 00132 00133 00134 00135 00136 00137 00130 00139 00140 00141 00142 00143 00144 00145 00146 00147 00146 00149 00150 00151 00152 00153 00154 00155 00156 00157 00158 00159 00160 00161 00162 00163 00164 00165 00166 00167 00168 00169 00170 00171 00172 00173 00174 00175 00176 00177 00178 00179 00100 00181 00162 00163 00164 00185 00186 00187 00188 00189 00190 00191 00192 00193 00194 00195 00196 00197 00190 00199 00200 00201 00202 00203

U. BIL~.,~D and E.G. L o ~ K

DO 27 K-I ,HS COHC,.0 I ~ 0 tVOL'0 READ (12,u,10STAT,,10S) IRE,IRF RF.40 (14,m,IOSTAT"10S) AB

]F (IOSmEOF) EXIT ! !emmH UOLUI'tE DETEI~IIH~TIOHS OF EITHER 10, 25, OR 50 ml

IF (Mr(K) .ST. .27) VOL=50 IF (Mr(K) . S T . . 1 .N,10. Mr(K) . L E . . 2 7 ) UOL-25 IF (Mr(K) . L E . . I ) UOL=IO

PRIHTm PRIHTtl I'CURRENTLY ACCESSING " PRINTi, * ELE~I~I" . . . . . . . . . . " ,EL(X) PR|NT~, "S#~PLE . . . . . . . . . . . " ,S~(K) PRIHTm IF (RESP',"Y") THEN

PR INTt PR]NTm,'EHTER'AODITIONAL DILUTION FACTOR !" READ (9, ' * ) DL

ENDIF IR ' IRF- IRE COHC" I Om.(((AB-BL(J) ) - B ( J ) ) / A ( J ) ) IF (COHC .LT. O) THEN ROCK(X,K).'O ELSE ROCK (X ,K).'(VOLmOL mCOHC)/(Mr (K) -1 R) EHOIF 1"I+1

IF ( I .8T. RE) THEN J'J'* I 1,,,1

END 1 F 27 COHT INUE

CLOSE (12,ERR',999) tl4=1 UH|LE (N .HE. N U t t ~ P e l )

IF (NUIISAttP,.0) EXIT READ (14,1,IOSTAT=|0S) AB N'N*I

REPEAT RESP"' ° WRITE (9,521 ( " ' , l ~ l , t 3 )

! !memH PRECISION OF GEOCHEMICAL I)~TA

PRIHTI PRIHTmt'EI'TTER (Y/HI TO CALCULATE THE PRECISION " READ I ,RESP

IF (RESP-,"Y") THEN OPEN (UNIT,,.I 1 ,FILE..'SA.'//FILtERR',.999) Z-t 1S¢~-' ZXLC"

!H ,am PRECISION IS BASED ON DATA OF USER SPECIFIED SPf4PLE PAIRS !

DO PR IN'T*

! !e=m=m CHEMICAL PAI~e~ETERS ARE ENI"EREO ALITOI~TICALLY

45 PRIHT=I'EHTER THE FIRST SNtPLE NUMBER (PRESS RETUI~I 1"0 EXIT)" 0-'0 REMINO ( 11 ~ERR"P991 READ(9,71 SPNPI(X, Z)

IF (S~MPI(X,Z) .EO. " " ) EXIT WHILE (SPel .NE. S#~IPI(X,Z))

READ (11 oT,IOSTAT"IOS,ERR~'888) SPtt IF (IOS"EOF) THBN

PRIHTe,'FIRST SAttPLE NOT FOUND" 1001"0 45 EHOIF

0=,0+ 1 REPEAT

!

; . . , i . . PRO01~ott INF01~IS THE USER OF UNRECOGNIZED S#/tPLES !

140 PRINTmI 'EI 'TTER THE SECONO SIMPLE NLINOER" P"O i ~ t ~ " ~XCL" REWIND ( I I ,ERR'999) READ< 9 ,7 ) SPttP2(X, Z)

01204 00205 01206 00207 00208 00209 O02IO O02I! 00212 00213 00214 00215 00216 00217 00218 00219 00220 00221 00222 00223 00224 00225 00226 00227 00228 00229 00230 00231 00232 00233 00234 00235 00236 00237 00238 00239 00240 00241 00242 00243 00244 00245 00246 00247 00248 00249 00250 00251 00252 00253 00254 00255 00256 00257 00258 00259 00260 00261 00262 00263 00264 00265 00266 00267 00268 00269 00270 00271 00272 00273 00274 00275 00276 00277 00278 00279 00280

Computer analysis of AAS generated data

MHILE (SNt .NE. $NIP2(X,Z)) REAl) 411,7,10STAT-IOS,ERIt.,BO0) S~t

IF (|0S,.EOF) THEN Pfl|NTm,•SIEC(]HD ~V~PLE NOT F0tlND'IC=A)TO 148

BtOIF P:Pt |

REPEAT PREC(X, Z ) " (ABS( ROCK (X, Q)-ROCK(X ,P) ) /2) / ( (ROCK(X,Q) 4ROCK(X, P) ) /

,200) Z-Z*!

REPEAT CLOSE (UN]T,.I 1 ,ERR.,999)

ENOIF 70 CONTINUE

! e H e e PRINTS RESULTS OF GEOCHE}IlCAL #t~LYSIS IN TA8LE F01~t~T ! THE USER IS ALLOWED TO ENTER A T|TLE BEFORE PRINT-0UT

CLOSE ( 12, ERI~.999) ! CLOSE ( 13, ERR,.999) CLOSE (14,ER1~999) ;CLOSE ( 1 5 , E R I ~ 9 ) OPEN (UNIT.,I I , F I LE , . 'S~ . ' / / F I L pPOSIT! 0N-'REMINO • ,ERR-999) READ ( I I ,2 ,ERK~888) ( S R ( | ) , L I I | ( | ) , S P I ( I ) , I . , I , N S ) PRINTe PRINTe,•0UTPUT IS S~)ED ON A FILE, ENTER THE I'k~tE." READ (9 ,6 ) FILLL PRINTe PRINTe,•EHTER A CONTINUOUS TITLE OF UP T0 50 CHA~CTERS" REA0 ( 9 , e ) TITLE OPEN (UNIT=I6,FILE'FILLL,POSITI01~'APPEHD • ,ERR"999) UN IT,=9 IH-,I WRITE 49,52) ( • • ,N . ' l , 13 ) DO

PRINTe = • PRINTe ," " WRITE (UHIT,e) " APPENDIX. OEOCHEMICRL DATA OF PROJECT

, ! • ,TITLE t/RITE (UNIT ,e ) ' • t/RITE (UNIT,e) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

t/RITE (UNIT ,e ) ' • URITE (UNIT,30) "SNIPLE " , "SP " , ' l J | • ,(EL(X) ,X" l ,Y)

30 FORI~T ( 1X,AB, IX,A2, IX ,A2,2X ,A2,6X,A2, ~X ,A2,4X,A2,4X ,A2, ,4X,A2,4X,A2,4X,A2,4X,A2,4X ,A2)

t/RITE (UNIT,e)" ' URITE (UNIT,e) " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - . , '

t/RITE (UNIT,e) " * O0 29 K=I,HS MRITE (UNIT ,31 ) SACK) ,SPi (K) ,IJt l (K) , (NINT(ROCK(J,K)) , J " l ,Y)

31 FOI~"tqT ( I X t A S , 2 X , A I t 2 X , A I , I X , 1 6 , I X , I 6 t l X ~ I S , I X , I S , I X , 1 5 , , IX, 15, IX, 15, IX ,15,1X,15, IXt 15)

29 CONTINUE t/RITE (UNIT ,e ) ' "

! ! e e e H PRINTS PRECISION AFTER THE GEOCHIDliCAL DATA !

IF 42 .NE. O)'THEN I,JRITE (UNIT , ' ) " "

t/RITE (UNIT , , ) " PRECISION SNtPLE DUPLICATE ELEMENT" DO 19 X=I ,Y

DO 20 K"I t2-1 IF (PREC(X,K)"O) OOTO 20

URITE(UNIT,41 ) PREC(X ,K) ,SNIPI (X,K) ,SN'IP2(X,K) tEL(X) 41 FORIIRT (2X, FB. 3,9X,AS, 4X,AS, 7X ,A2) 20 CONTINUE 19 COHT INUE

ENOIF t/RITE (UNIT,e) " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

t/RITE (UNIT , , ) " ELEPIEHTAL CONCENTRATIONS ARE IN PPH , PRECISIOH IS IN PERCENT"

IF (h -2 ) EXIT 1t..1t* 1 UNIT'16 REPEAT PAUSE "PROGRNt COHPLETEO, PRESS RETUI~I" STOP

175

176 U. BKA.~D and E.G. L o ~ K

00281 00282 00283 O0294 O0285 00286 00287

00280 00289 00290 00291 00292 00293 00294 00295 00296 00297 00298 00299 00300 00,301 00302 00303 00304 00305 00306 00307 00308 00309 00310 00311 00312 00313 00314 00315 00316 00317 00318 00319 00320 00321 00322 00323 00324 00325 O0326 00327 00328 08329 00330 00331 00332 00333 00334 00335 00336 00337 00338 00339 00340 00341 00342 00343 00344 00345 00346 00347 00340 00349 00350 00351 00352 00353 00354

! * H e * ERROR HESEAGES f

888 PRINT*,'SYSTEH ERROR IN I /O, PROGR.,ePI TEI~IINATED [CR]';PAUSE;STTOP 999 PRINTet'SYSTEH ERROR I,Jl'rH EX'rERi'~k~L FILES. ALL POSSIBLE ENTRIES S

,RUED [CRI" ;PAUSE ;STOP END

P r o g r a m Unit." F I L E S

! ! ! J l l l l t l l SUBROUTINE FOR CREATING AND HODIFING DATA FILES * * t * * * * *

SUBROUTINE F]LES (",FILEH01,PRE,HPt'IE,FIL)

CHARACTER PRE*3 tl',k~tE*3, F ]LL* 13, RESP*3, F I L* 13, ELL*2, SAHP',e5 CI'~RACTER LH*! ,SP*I jCONID*9 DIHI~ISION R(150) ,AR(500) pCR(500) REAL 1 RE t I RF tw'r tAB ,NUH,A, B, BL, SCR, S~R, SSCR, SCA tACR ,~4<~R BNAR REAL NCR, SS~R, C0NC, RS tNS t RE INTEGER FI LEN0 ,NR PARAHETER (EOF,,,-I)

1 FOI~'IAT (A21 2 F01~AT (AS, IXtAI t IX ,A I ) 3 FORI'IAT (F7.4 , IX ,F7.4) 4 F 01~HAT (F7.41 7 FOR~T (AS) 8 FORI~T (F9.6 , IX ,F9.6, IX ,F6.4) 9 F 01~qT (F3.0 , IX ,F3.0)

RESP'" " ICOND'" " INUH'9999 FI LL-PRE//F 1L OPEN (UN I T-F 1LEN0, ERR'999 ,F i LE"F 1LL, POSI T ! 0N-'APPEND" ) PRINT*

120 PRINT*, ' CREATE / APPEND [C1 OR HODIFY IH] FILES ?' READ 49,7) RESP

! m** * * * * * m* * * * * * * ~***z.**** SERIES OF CASE 8LOCKS FOR CREAT]NG FILES * * * * * ' * *

IF (RESP oEO. "C') THEN SELECT CASE (NN4E)

! ! * * * * * UP TO 10 ELEHEHT SYHBOLS ARE .SAUED ]NT0 A FILE f

CASE ( ' E L E ' ) PRINT* PRINT*," ENTER A HAX OF 10 ELEHEHT NN'IES' DO

PRINT* PRIhrI"*,'ENTER ELEHENT SYHBOL (PRESS [E) TO EXIT)" READ ( 9 , ! ,ERR-,9?9) ELL IF (ELLm'E ") EXIT I,dR]TE ( i0 , I ,ERR=9?9) ELL

REPEAT CLOSE (UNIT=I0 ,ERR=999)

! ! . 4 . * * USER DEF]NED SAHPLE NPt'IES AND PAR.'e~E'fERS ARE SAUED INTO A FILE !

CASE ( "SN't" ) DO

PRINT* PRIN'fm,'ENTER NAHE, SP AND I.H I SEPARATED BY A

,SPACE (PRESS [E] TO EXIT)" READ (91**ERR'999) SAHPtSPtLH IF (S~'IP,- 'E') EXIT WRITE ( I I , 2 ,ERR '999 ) SPttP,SPtI.H

REPEAT CLOSE (UNITT"I 1 ,ERR"999)

! ! 4 . * * * INSOLUBLE RESIDUE IS DETEI~INEO FROH CRUCIBLE WEIGHTS !

CASE ( ' I S R ' ) DO

PRINT* PRINT*t'ENTER EHPTY AND FULL CRUCIBLE MEIGHTS,

00355 00356 00357 00358 00359 00360 00361 00362 00363 00364 00365 00366 00367 00368 OO369 00370 0037| 00372 00373 00374 00375 00376 00377 00376 00379 00380 00381 00382 00383 00384 00365 00386 00307 00388 00389 00390 00391 00392 00393 00394 00395 00396 00397 00398 00399 00400 00401 00402 00403 00404 00405 00406 00407 00408 00409 00410 O041J 00412 00413 00414 00415 00416 00417 00418 00419 00420 00421 00422 00423 00424 00425 00426 00427 00428 00429 00430 00431 00432 00433

Computer analysis of AAS generated data

,SEI~I~TEO BY A SPACE (PRESS ( - 1 ) TO EXIT)" READ (?,.,ERR,.9?9) IRE,IRF IF ( I R E - - I ) EXIT WRITE (12,3,ERRm999) IRE,IRF

REPEAT CLOSE (UH] T.. 12,ERlq,.999)

! .Hmu POWDER WEIGHTS ARE SAUED INTO A FILE !

CASE ( 'MHT") DO

PRINT. PRINTu~'ENTER WEIGHTS (PRESS ( - I ) TO EXIT)" READ (9 , . ,ERR'99?) MT IF ( t~T- - l ) EXIT WRITE (13,4,ERR"999) MT

REPEAT CLOSE (UNIT'.I 3, ERR"999)

! u e . s . ENTER AESOREP~ICE READINGS, OF SP/'IPLES, FR(3tt THE ~ S

CASE ( 'ABS") 00

PRINTs PRINTe,'E]~TER THE ABS UALUE PER ELEHENT PER

,S~HPLE (PRESS [ - I ] TO EXIT)" READ (9,e,ERR=999) A8 IF ( A B ' - I ) EXIT WRITE (14,4,ERR=999) A8

RE PEAT CLOSE (UNIT,. 14,ERR-999)

!eeeu. REFERE]qCE O~TA; SETs THE GEOCHEMICAL PARAMETERS OF THE ! REFERENCE SOLUTIONS USED TO CALIBRATE THE ~ S

CASE ( 'REF ' ) RE=I ;RSJ.I ;RESP-' ' INR-I ;8L=OINS"I 00

PRINT. PRINX.,'ENTER THE NLJHBER OF REFERENCE SETS

, <PRESS (-11 TO EXIT)" READe, RS IF (RS- - I ) EXIT PRINT.

PRINT.,'EHTER THE NUHBER OF SPttPLES YOU WISH TO N~LYSE. ' PR INT"

PRINT.,'SHOULD THiS UALUE CHI~IGEI THE RESLOPE RATE HUST BE .ALTERED IN THE PLAIN PROGRAH"

READe INS RE..NINT(NS/RS) IF (RE .LT. I ) RE-I PRINT,

! !eee.e RESLOPE ~ BE ALTERED BY USER !

PRINTe,'DEFAULT RESLOPE RATE iS ",RE, ° SATISFACTORY {Y/N) ?" READ I p RIESP

IF (RESP .EQ. "N ' ) THEN PRINT. PRINTet'E]CI'ER NEW RESLOPE UALUE ° READs i RE

ENDIF WRITE (15,9,ERR'.999) RS,RE B"O iP~0 t RESF~" "

00 25 J-.I,RS PRINT.

! !see.e ENTER THE NUHBER OF REFERENCE SOLUTIONS USED !

PRINTm,'E]~TER THE NUHBER OF REFERENCES FOR SET "oJ READ. oNR

PRINTs,'ENTER THE ABS U~LUE OF THE BLANK FOR REFERENCE SET ' , J REAOe,SL

PRINT. 00 IO I ' I , N R

AR( I ) -OICR( I ) -O 10 . CONTINUE

SCI~01 ~R-01SSAR-01SSCI~01S CA~0 IACR"0 t~R"01PUN~0 D0 26 | ' I , N R

177

178

00434 00435 00436 00437 00438 00439 00440 00441 00442 00443 00444 00445 00446 00447 00448 00449 00450 00451 00452 00453 00454 00455 00456 00457 00458 00459 00460 00461 00462 00463 00464 00465 00466 00467 00468 00469 00470 00471 0O472 00473 00474 00475 00476 00477 00478 00479 00400 00481 00402 00483 00484 00485 00486 00487 00480 00409 00490 00491 00492 00493 00494 00495 00496 00497 00498 00499 00500 00501 00502 00503 00504 00505 00506 00507 00508 00509 00510 00511 00512

U. BI~ND and E.G. LOREK

PRINTI

: m . . H ENTER THE ABSORBNqCE AND CONCB'TI'I~TION ~LUES FROM THE U S

PRINT., 'ENTER ABS AND CONC F0R REFERENCE NIJHBER • ,1 , " I ,N SET " ,J

PRIN'rm,'U~LUES LESS TI~N t OR EQUAL TO, ZERO ARE PROH]BITED" READ., CR(I ) ,AR( | ) CR( 1 )"CR( 1 )-EL

SCR=SCR+CR( I ) I EAR=,T~R + (ALOG 10 (AR ( I ) ) ) SS~R'= SSAR't (ALOGI 0(AR( 1 ) ) "(ALOGI 0(AR( I ) ) ) ) SSCR=SSCR+ ( CR( I ) mCR( I ) ) ; SCA" SCA+ ( (ALOG I 0 (AR ( I ) ) ) "CR ( ! ) )

26 CONTINUE ACR'~SSCR-( (SCR'SCR)A"IR) ;P~I~SSAR- ( ( ~ R I,S~R)/NR) PUt~SCA- ((SAR'SCR)/IqR) I).=PUN/AAR A'(SCR-(BeSAR) )/NR 14RITE (15,8,ERR=999) A,B,BL

R ( J ) - PLI'4/( SOITT ( AAR,oACR ) ) 25 CONTINUE

PRINT. , " " PRINT.,'REFERENCE SET R UALUE" WRITE (m,17) ( J , R ( J ) , J = I , R S )

17 F O I ~ T (8X, 12 ,25X,F6 .4 ) REPEAT

CLOSE ( 15, ERR=999) !

• om.! DEFAULT

CASE DEFAULT PRINT.,'PROBLEHS IgITH DATA FILE, ~ 0 " ~ CREATE"

END SELECT

f . l . . . . , , . SERIES OF CASE BLOCKS FOR MOOIFIN8 FILES i ' ' ' J ' J J

ELSEXF (RESP .EO. ' M ' ) THEN 110 REWIND (UNIT-FILENO,ERR=999)

PR1NT,," LISTINO" SELECT CASE (NAHE)

! ! H m H EDITS ELEHENTAL DATA

CASE ( ' E L E ' ) DO

READ (FILEN0o ! o lOSTAT='IOS,ERR=999) ELL IF (10S~EOF) EXIT MRITE (9 ,1 oERR=999) ELL

REPEAT PRINT.

135 PRINT', 'ENTER AN IDE]'TI'ICAL COPY ELEHENT SYHBOL TO BE CI'i~IOED" REMIND (10,ERR'999) READ ( 9 , 1 ) COND ELL"" "

IJHILE (ELL .NE. COND) READ (10,1,10STAT-10S,ERR.,999) ELL IF (10S"EOF) 80"1"0 135

REPEAT PRIH'T'I'ENTER CORRECT SYHBOL" BACKSPACE (10,ERR=999) READ (9 ,1 ,ERR'999) ELL WRITE 410,1,ERR~999) ELL CLOSE (UNIT" I 0, ERR=999)

! !muHm EDITS SAHPLE AND PARAHETER DATA

CASE ( "SP~" ) DO

READ (FILENDt2w10STAT=IOSDERR-999) SAHP,SPpLH IF (10S,,EOF) EXIT URITE (9 ,2 ,ERR-999) SAHP,SP,LH

REPEAT PRINT,

136 PRINTm.'E]CI'ER A FORt'fATTED COPY OF THE NAHE TO BE Cl'~qGED" REWIND ( ! | oERR'=999) READ ( 9 , . ) COND SAHP-' '

14HILE (SAf~P .NE. CONO) READ (11 j7tIOSTAT='iOSpERR=999) SP~P IF (10SJEOF) GOTO 136

00513 00514 00515 00515 00517 00518 00519 00520 00521 00522 00523 00524 00525 00526 00527 00528 00529 00530 00531 00532 00533 00534 00535 00536 00537 00538 00539 00540 00541 00542 00543 00544 00545 00546 00547 00548 00549 00550 00551 00552 00553 00554 00555 00556 00557 00558 00559 00560 00561 00562 00563 00564 00565 00566 00567 00568 00569 00570 00571 00572 00573 00574 00575 00576 00577 00578 00579 00500 00581 00582 00583 00584 00585 00586 00587 00588 00589 00590 00591 00592

Computer analysis of AAS generated data

REPEAT PR|NTe,'B~TER, SEPARATED BY A SPACE, THE I ~ E , SP NqD I.H"

BACKSPACE ( I I ,ERR'999) READ (9,I ,ERR,'999) SANP,SP,LH WRXTE ( I 1,2,ERRa999) S~'IP,SP,I.H CLOSE(UNIT"I ! , ERR'999)

! , I .eme EDITS INSOLUBLE RESIDUE DATA ?

CASE ( ' I S R ' ) DO

READ (F|LEHO,3,IOS*I"AT,,IOS,ERR"999) IRE,IRF IF (IOS"EOF) EXIT WRITE (9,3,ERR"999) IREBIRF

REPEAT 137 PRINT.,'E]ITER A FOI~IATTED COPY OF THE EHPTY CRUCIBLE WEIGHT"

REWIND ( ! 2, ERRs999) READ <9 , , ) NUll

WHILE (IRE .NE. HUM) READ ( ! 2 ,4 , ] OSTAT" I OS, ERR= 999) ! RE IF (IOS"EOF) GOTO 137

REPEAT PRINT.,'ENTER CORRECT EHPTY PI, ID FULL CRUCIBLE WEIGHTS' BACKSPACE ( 12, ERR-999) READ (9,'tERf~999) IRE,IRF WRITE (12,3,ERR"999) ]RE,IRF CLOSE (UNIT"I 2,ER1~999)

! ! ' ' ' ' " EDITS SAMPLE WEIGHT DATA !

CASE ("WHT') 00

READ (FILENO,4,105TAT=IOS,ERI~999) WT IF (iOS,',EOF) EXIT WRITE (9t4oERR"9?9) WT

REPEAT 138 PRINT't'ENTER A FORHATTED COPY OF THE WEIOHT TO BE CHANGED"

REWING (13,ER1~999) READ ( 9 , . ) HUH

WHILE (IJl" .NE. NUM) READ ( 13 o 4, I OSTAT m I OS, ERRs999) UT IF (IOS',EOF) OOTO 138

REPEAT PRINT.,'ENTER CORRECT WEIGHT" BACKSPACE ( I 3,ERR,.999) READ (9 , ' ,ER1~999) t i t WRITE (13,4tERR~999) bIT CLOSE (UHIT-I 3,ERR.,999)

! . H r . EDITS ABSORBP.'~CE DATA

CASE ( "ASS" ) DO

READ (FILEHO,4, IOSTAT=lOS,ERR"999) AB IF (IOS"EOF) EXIT WRITE (9,4,ERR-999) AB

REPEAT 139 PRINT.t'ENTER A FOI~'~TTED COPY OF THE ABS TO BE CI'~t4GED"

REbJIND ( 14 o ERR-999) READ (B t l ) NUM

WHILE (AS .NE. NUM) READ (14,4,10STAT"IOS,ERI~999) AB IF (IOS'.EOF) GOTO 139

REPEAT PRINT., ' ENTER CORRECT ABSORBPI4CE" BACKSPACE (14,ERR"999) READ (9,.,ERR,"999) AB WRITE (14,4,ER1~999) AB CL0SE ( UN ! T,,, 14, ERR'999)

! : . . H . REFERENCE DATA ( IN CASE OF CORRECTIONS, REFERENCE FILE HUST ! DELETED #~lO RECREATEO FROM MAIN MENU, OR EDITED EXTEI~LLY)

CASE ( 'REF ' ) PRINTw, PRINT., 'REFERENCES CANNOT BE MODIFIED" IPRINT. CLOSE ( 15, ERR'=999)

! ! , u H DEFAULT !

179

180

00~93 00594 00~95 00596 00597 00598 00599 00600 00601 00602

999 131

U. B~.~D and E.G. LO~EK

CASE DEFAULT PRINT%'PROBLE]"IS MITH I~TA FILE, CAHHOT HOOIFY"

END SELECT ELSE

PRIH'I'mI'ENTRY ERROR" ;GO'TO 120 I~IDIF 60TO 13! PRINT%'SYSTEH ERROR IN ACCESSING FILES" REXUI~I I EHD