A short CIPW norm program

A short CIPW norm program

('omputerv & GeosciencesVol. 10. No. 4. pp. 449-450, 1984 0098-3004/84 $3.00 + .00 PergamonPressLtd. Printedin the U.S.A. SHORT NOTE A SHORT CIPW N...

132KB Sizes 8 Downloads 47 Views

('omputerv & GeosciencesVol. 10. No. 4. pp. 449-450, 1984

0098-3004/84 $3.00 + .00 PergamonPressLtd.

Printedin the U.S.A.

SHORT NOTE A SHORT CIPW NORM PROGRAM ALLEN F. GLAZNER Department o f Geology, University of North Carolina, Chapel Hill, N C 27514, U.S.A.

(Received 3 April 1983; revised 25 May 1983)

INTRODUCTION

The CIPW norm is a useful algorithm for taking the chemical composition of an igneous rock and computing the anhydrous mineral assemblage that could crystallize from that composition at low pressure. Computing the norm is a simple yet tedious task that is perfectly suited to computer automation. However, few norm programs have been published, and those that are in print are generally lengthy (hundreds of lines). This note presents a short (33-line) APL function for computing the CIPW normative composition of an igneous rock. Although the function follows the standard rules for computing the norm (Cross and others, 1902, as restated by Kelsey, 1965). it is considerably shorter than other norm programs (for example, Mclntyre, 1969; Bickel, 1979) because it avoids half of the bookkeeping and most of the branching inherent in the original algorithm.

This economy is accomplished by use of the APL "floor" function (L), which, when given two arguments, selects the lesser of the two. Thus, line 9 of the function can be read as, "Apatite is set equal to P205; ilmenite is set equal to FeO or TiO2, whichever is smaller; orthoclase is set equal to K20 or A1203, whichever is smaller; potassium metasilicate is set equal to K20 minus the amount of orthoclase already made; albite is set equal to Na20 or A1203 minus the orthoclase already made, whichever is smaller" and so on. In this manner, the amount of each oxide remaining after each step need not be calculated, and no testing and branching need be performed. No branching occurs until the desilication steps. The function takes as its argument an 11-element vector containing the composition of the rock, in the order SiO2, TiO~, A1203, Fe203, FeO, MnO, MgO, CaO, Na20, K20, and P205. Minor constituents such

Table 1. Examples of the use of the function CIPW THOL ÷ 49.58 1.98 14.79 3.38 8.03 .18 7.3 10.36 2,37

.43 .24

(thole~te an~ys~ ] CIPW THOL

QZ OR AB AN DI HY MT IL AP TOT

2.26 2.54 20.06 28.43 17.32 18.80 4.90 3.76 .56 98.62

KAT

+

35.37 3.87 6.5 7.23 5 .24 14.08 16.79 1.32 4.09 .74

(k ~ n g i t e CIPW LC NE AC DI OL CS MT IL HAl AP TOT

a~ysis

)

~T

18.95 5.77 .46 11.86 20.71 19.57 5.68 7.35 3.15 1.71 95.22

449

450

Short Notes

as CO2 and ZrO2 are not included, although they could easily be added. Table 1 gives two examples of the use of the function. The function is written in standard APL except for the diamond statement separator (O), which allows more than one statement to appear on a single line. Readers using a version of APL that does not allow use of the diamond will have to put each statement on a separate line. The function was written on a Radio Shack TRS-80 Model III microcomputer using a version of APL supplied by STSC, Inc. (2115 East Jefferson St., Rockville, MD 20852, U.S.A.). BRIEF DESCRIPTION OF THE FUNCTION

Line 3: divides the vector of oxide weight percents (V) by the molecular weights of the oxides (from Barker, 1983, p. 66), to convert to mole numbers. Line 4: defines the variables S, T, A, etc. as the mole numbers of SiO2, TiO2, A1203, etc., and adds the amount of MnO to that of FeO. Lines 9 - 1 h compute the amounts of saturated minerals. Line 13: determines the amount ofMgO + FeO left to make pyroxenes. Line 14: makes pyroxenes. Line 16: determines the amount of silica used. Lines 17-24: successive desilication steps; branch to output when the silica deficiency has been reduced to zero.

Line 26: determines the formula weights of hypersthene, diopside, and olivine. Line 28: shapes the mole numbers of the normative minerals into a vector Z. Lines 29-30: define the vector F W as the molecular weights of the minerals in Z (weights from Barker, 1983, p. 66, except for apatite, which is defined fluorite-free). Line 31: redefines Z as the mineral weight percents and catenates the total onto the end of Z. Line 32: defines N A M as a 23 x 2 character matrix of mineral names. Line 33: catenates formatted Z onto NAM and compresses out the rows corresponding to minerals that are present in a zero amount. REFERENCES

Barker, D. S., 1983, Igneous rocks: Prentice-Hall, Englewood Cliffs, New Jersey, 417 p. Bickel, C. E., 1979, The CIPW normative calculation: Jour. Geol. Education, v. 27, no. 2, p. 80-82. Cross, W., Iddings, J. P., Pirsson, L. V., and Washington, H. S., 1902, A quantitative chemico-mineralogical classification and nomenclature of igneous rocks: Jour. Geology, v. 10, no. 6, p. 555-690. Kelsey, C. H., 1965, Calculation of the C.I.P.W. norm: Mineral. Mag., v. 34, p. 276-282. McIntyre, D. B., 1969, Introduction to the study of data matrices, in Fennel P., ed., Models of geologic processes--an introduction to mathematical geology: Am. Geol. Inst., Washington, D.C., unpaginated.

APPENDIX

Program listing V Z+CIPW V [ i] . O R D E R O F THE O X I D E S IN V IS SI02 TI02 AL203 FE203 FED [2] . M N O M G O CAD N A 2 0 K20 P205 [3] V÷V" 6 0 . 0 9 79.9 102 159.7 7 1 . 8 5 70.94 40.32 56.08 51.98 94.2 142 [4] S÷V[I] O T÷V[2] O A÷V[3] <> F3+V[4] <> F 2 ÷ V [ 5 ] + V [ 6 ] [5] M ÷ V [ 7 ] 0 C + V [ 8 ] 0 N÷V[9] 0 K+V[IO] 0 P ÷ V [ I I ] [6] * I N I T I A L I Z E U N D E R S A T U R A T E D M I N E R A L S T H A T M A Y N O T BE D E F I N E D [7 ] OL÷PF÷NE÷LC+KP+CS÷O [8] * MAKE SATURATED MINERALS [9] A P ÷ P <> I L + F 2 t T 0 O R ÷ K [ A O K S ÷ K - O R <> A H ÷ N [ A - O R <> A N + ( C - A P ÷ O . 3 ) [ A - O R + A B [10] TN÷(T-IL)tC-AN+AP÷0.3 <> R U ÷ T - T N ÷ I L 0 C O ÷ A - O R + A B + A N [ii] A C ÷ F 3 [ N - A B <> N S ÷ N - A C ÷ A B <> M T ÷ ( F 2 - I L ) L F 3 ° A C <> HM+F3-AC+3!T [12] m M A K E P Y R O X E N E S [ 13] MF÷M+F2-MT+IL [ ig] DI+MF[C-AN÷TN+AP÷0.3 <> W O ÷ C - A N + T N + D I + A P ÷ 0 . 3 O HY÷MF-DI [15] m C O M P U T E TOTAL S I L I C A USED AND P E R F O R M N E C E S S A R Y D E S I L I C A T I O N S [16] Y÷ I 4 I I 6 6 2 2 i i + . x T N , A C , K S , N S , O R , A B , A N , D I , W O , H Y [•7] Q Z ÷ O [ S - Y 0 ~ ( Q Z > O ) / O U T <> D + Y - S [18] O L + D [ H Y ' 2 <> H Y ÷ O [ H Y - 2 × D <> - * ( O = D ÷ D - O L ) / O U T [19] P F ÷ D L T N O T N ÷ O [ T N - D <> ÷ ( O = D ÷ D ' P F ) / O U T [20] N E ÷ A B [ D ÷ 4 0 A B ÷ O [ A B - D ÷ 4 <> * ( O = D ÷ D - 4 × N E ) / O U T [21] L C + O R [ D ÷ 2 <> O R ÷ O [ O R - D ÷ 2 0 - ~ ( O = D ÷ D - 2 x L C ) / O U T [22] C S ÷ D [ W O ÷ 2 0 W O ÷ O [ W O - 2 x D <> - ~ ( O = D ÷ D - C S ) / O U T [23] -~(D>-DI)/LI <> CS÷CS+D~.2 <> O L ÷ O L + D ' 2 <> D I ÷ D I - D <> ÷ O U T [24] L I : C S ÷ C S ÷ D I ÷ 2 <> O L ÷ O L + D I ÷ 2 0 D ÷ D ' D I ¢ OI+O <> KP÷D÷2 <> L C ÷ L C - D ' 2 [25] OUT: m C O M P U T E F O R M U L A W E I G H T O F ( M G , F E ) - B E A ~ I N G M I N E R A L S [26] FWFE÷ 248.1 131.9 2 0 3 . 8 - ( M ÷ M F ) × 31.55 31.55 63.1 [27] ~ F O R M A T AND P R I N T O U T P U T [28] Z÷QZ,CO,OR,AB,AN,LC.NE,KP,AC,NS,KS,WO.DI,HY,OL,CS,MT.IL,HM,TN,PF,RU,AP [29] FW÷ 50.09 102 556.7 524.5 278.2 4 3 6 . 5 284.1 316.3 462 122.1 154.3 116.2 [30] F W ÷ F W , F W F E , 172.2 231.5 151.8 159.7 196.1 136 79.9 328.9 [31] Z ÷ Z x F W <> Z ÷ Z , + / Z [ 32] ,YAM+ 23 2 O' Q Z C 0 0 R A R A N L C N E K P A C N S K S W O D I H Y O L C S M T I L H M T N P F R U A P ' [33] Z÷(Z>O)~((NAM,' '),[I] 'TOT'), 7 2 v 24 I pZ V