Computers & Geosciences, VoL 3, pp. 107 113. Pergamon Press, 1977. Printed in Great Britain
MODES: A FORTRAN IV PROGRAM TO CALCULATE MODAL ANALYSES FROM RAW POINT-COUNT DATA R. J. KORSCH Department of Geology, University of New England, Armidale, N.S.W. 2351, Australia (Received 5 June 1976; revised 17 August 1976)
Abstract--Program MODES is a FORTRAN 1V program to calculate modal analyses of thin sections from raw data obtained by any normal point-countingtechnique. The program provides a table listing the modal analyses, quartz-feldspar-rock fragments (QFR) ratios, matrix-labiles-quartz (MLQ) ratios, ratios of plagioclase to total feldspar (P/F), ratios of volcanic lithic fragments to total lithic fragments (V/L), frequency, estimate, and confidence limits for each sample, and calculates the means and standard deviations for each component in a group of samples. It also prints a triangular diagram of the QFR or MLQ ratios. The program is useful where large numbers of modal analyses are determined because it requires no manual calculations, but it also has been determined useful when only a few samples are involved. Key Words: Modal analysis, Point counting, FORTRAN, Sedimentology.
iNTRODUCTION
The development of MODES arose out of a need to calculate the mineral compositions (i.e. modal analyses as used by Griffiths 1967, p. 175) for numerous thin sections of sedimentary rocks from eastern Australia, and to recalculate these results in order to plot triangular diagrams. The advantage of this program is that it allows rapid, accurate computations of the modal analyses without manual calculations. The program presented here was used only for immature sandstones but it has limited usefulness also for mature sandstones. It has been modified to calculate modal analyses for other rocks such as acid platonic rocks. DESCRIPTION OF THE PROGRAM
MODES was designed to calculate percentages of components in sandstones using the raw scores obtained from point counting in thin sections. For each sample three input data cards are required, with thirteen pieces of data on each of the first two cards. The first card contains the commencing values read from the windows of the point counter and the second card contains the final values after point counting has been completed. At the University of New England a Swift Automatic Point Counter is used normally but in situations where only raw are obtained, the first data card is blank and the second data card contains the number of points counted for each component. Thirteen pieces of data are required for each card but if some components are not counted or some data need to be eliminated, then the relevant positions on both cards are recorded as zeros or blanks. The third card contains the sample number. Figure 1 is a flowchart of the major steps involved in MODES and the order of the components to be counted is as shown in the comments at the beginning of the program listing (Appendix A). However, the components can be altered easily if the components to be counted differ from those used here.
As well as calculating percentages of the components point counted, MODES uses the statistics devised by Kelley (1971) to calculate the frequency, estimate and confidence limits for each component in each sample. Two detrital-grain parameters listed by Dickinson (1970), namely the ratios of plagioclase to total feldspar (P/F) and of volcanic lithic fragments to total lithic fragments (V/L) are determined along with data for two triangular schemes. Data for the MLQ (matrix-labiles-quartz) scheme proposed by Krynine (1948) and the QFR (quartz-feldspar-rock fragments) scheme developed by Folk (1974) are provided by recalculating the relevant totals to 100 percent. Only one of the triangular schemes is plotted on a diagram but the program can be converted readily to print the other triangular diagram if required. The triangular plot is based on parts of subroutine TRIGDIG developed by Henley (1972). Means and standard deviations for components in a group of samples were calculated using the formulae of Koch and Link (1970). The output from MODES consists of a table listing modal analyses, MLQ, QFR, P/F, V/L, frequency, estimate and confidence limits for each sample, means and standard deviations for each component in the group of samples, and a triangular diagram. The sample of output figured here (Appendix B) shows the modal analyses of five greywackes from the Girrakool Formation in eastern Australia, along with the positions the greywackes occupy on a QFR diagram, Acknowledgments--MODES has been run successfully on the University of New England ICL 1904A machine since 1972 and the assistance of the staff of the Computer Centre is gratefully acknowledged. REFERENCES
Dickinson,W. R,, 1970,Interpreting detrital modes of greywacke and arkose: Jour. Sed. Pet., v. 40, no. 2, p. 165-174. Folk, R. L.. 1974, Petrology of sedimentary rocks: Hemphill's, Austin, Texas, 170p. 107
108
R.J. KORSCH
Grifliths, J. C., 1967, Scientific method in analysis of sediments: McGraw-Hill Book Co., New York, 508 p. Henley, S, 1972, Three computer programs for calculation of petrological and geochemical parameters from silicate analysis: Aust. Bur. Mira Res. Record 1972/106, 8 p. Kelley, J. C., 1971, Mathematical analysis of point coum data, in
Carver, R. E., (ed.), Procedures in sedimentary petrology: Wiley-Interscience, New York, p. 409-425. Koch, G. S., Jr., Link, R. F., 1970, Statistical analysis of geological data Vol. 1: John Wiley & Sons, New York, 375 p. Krynine, P. D., 1948, The megascol)ic study and field classification of sedimentary rocks: Jour. Geology, v. 56, no. 2, p. 130-165.
i
'SET ARRAYS, INITIALISE, N = i
N =~
w~
OF SAmPLeS I
DO LOOPS TO I N I T I A L I S E ~ TOTAL, SD, ETC. INITIALISE ARRAYS /
I LPRINT H E A D I ~
I "_.Do ooP
=
N>
I [INITIALISE A
B, DIFF,
PERCEN
l
%
DIAGRAM
, (~mD Da~a C~RDS]
/
|
CALCULATE ~, FREQ, EST, CONFID, [ M~Q, QFR, P/~, V/L r r c . 1
I I POINT IN TRIANGLE
Figure 1. Generalized flowchart for program MODES.
APPENDIX A
Listing of Program MODES In line 0038 A and B refer to first and second data cards respectively. 0015 0016 001 "~
C C
R E ~ , FROM(Ctq/ATLAS) MASTE~ MOOES ****************************************************************** pROGRAMMEMODES
C
AUTHOP - R.J,XORSCN,
0021 0022 0023
C C C
A PROGRAM~E FOR CALCULATING MODE~ OK SEDIMENT~ HSINC, TNF SWIFT AUTOMATICPUINT-COUNTER INPUT I~ ( I ) COMMENCING VALUES IN WINDOIPS Or POINT COUNTER. FORMAT
0024 0025 0026
C C C
0027 0028
C C
0018 0019
GEOLOGY DEPARTMENTp
IS I~F~.O (2) FINAL VAIUFS 13F6,0 (3) OUTPUT I S ( I )
UNIVERSITY OF NEW ENGLAND
IN WINDOU,~ OF POINT COUNTER.
FORMAT IS
SAMPLE NUM~IER IN FORMAT 16 TABLE OF CALCULATED PEIICENTAGE$ OF ELEMENTS
Modes: A FORTRAN IV program to calculate modal analyses from raw point-count data (2) (3)
MLO AND QFR VALUES FREQUENCY, E~TIMATE AND CONFIDENCE LIMITS FOR EACH ELEMENT (4) PlF AND VIL RATIOS (S) MEAN AND STANDARD DEVIATIONS FOR EACH ELEMENT, MLO AN~ QER (6) Q-E-R TRIANGULAR DIAGRAM MACHINE REQUIREMENT~ . . . . CORE . . . . LINE PRINTER 120 COLUMNS WIDE FOR A AND B THE DATA MU~T BE IN THE FOLLOWING SEQUENCE t~UARTZ PLAGIOCLASF K-FELDSPAR ~ORN~LENDE ACCESSORIES SECONDARY mINERALS ~ATRIXICEMENT ACID VOLCANIC LITMICS INTERMEbIATE -BASI~ VOLCANIC LITHICS HOLOHYALINE VOLCANIC LITHICS PLUTONIC FRAGMENTS SEDIMENTARY CLASTS METAMORPHIC CLAsTS
0029 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 0040 0041 0042 0043 0044 0045 0046 0047 0048
0049 0050 0051 0052 0053 0054 0055 0056 0057 0058 0O59 0060 0061 0062 006~ 0064 0065 0066 0067 0068 0069 oo?n 0071 0072 0073 007~ 0079 0076 0077 0078 0079 0080 0081 0082 008~ 0084
0085 0086 0087 0088 0089
0090 0091 0092 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0103 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113
109
C C
LIST OF NAMES REAL M E A N M ~ M E A N L t M E A N Q T , M E A N Q w M E A N E , M E A N R , M E A N e M , L p M S Q P L S Q INTEGER CR,DOTIPLUS,sTAR,SPACE INTEGER sYM(367 DIRE~SION FREQ(13),EST(13)sCONFID(13),A(13),B(13)#DIEF(137 DIMENSION MEAN(13)mSD(1~),PERCEN(137 DIMENSION TOTAL(13)pSQUaRE(13)fSQTOT(13) DIMENSION LINE(51,1017 DATA DOT/IH,/ DATA PLUS/IH*/ DATA STAR/IH*/ DATA SPACE/IH / DATA SYM(II,SYM(2),~y~(X),SYM(4),SY~(5),SYM(6),SYM(7),SYM(8),SYM(9 17,SYM(1D),SYM(II),SVM(I2),SYM(13),SYM(14),SYM(15)tSYM(16)pSVM(¶7)p 2SYM(18),sYM(19),SVM(20),SYM(21),SYM(22),SYM(23),SYM(24),SYM(25)/IH ~1,IR2,1R3,1HA,1H511R6,1WT,1HS,IH9,1HA,IHB,IHC,IHDpIHEIIMFaIHG,IHH, 41HJmIHKrIHL,IHMr1HN,IHP,IHQ,IHR/ D~TA SVM(26),SVM(27),~Y~(28),SYM(29),SY~(30),SYM(31),SYM(32)'SYM(33 I),SYM(54),SYM(35)pSYM(36)/IHSpIHT~IHU~IHV,IHW,IHX~IHY~IMZ~¶H'~IH÷, 21H*I CR=5 LP=6 CHI=21,03 SUMM~SUML,SUMQT,SUMQ,SUMF~SUMR=O.O MSQ~L~Q~QTSQ~OSQ~FSO,RSQ=O,O SUMM~Q~SUMLSQ~SMQTSQ,SUMQSQ,SLIMFSO~SUMRSQ=O.O MEANM,MEANL,MEANQT~EAN~,HEANF~MEANR=O,O N = I ~HERE I IS THE NUMBER OF SAMPLES POINT COUNTED N=5 K IS THE COUNTER
INITIALIZE TOTAL, SQUARF, SQTOT, MEAN, ~D DO 14 I=I,15 TOTAL(1)=O,O SQUARE(I)=O.O SQTOT(1)=O,O MEAN(1)=O,O SD(1)=O.O 14 CONTINUE C INITIALISE ARRAy(LINEI POR TRIANGULAR DIAGRAM DO I I=1,51 DO I J,I,101 LINE(I,J) = SPACE I CONTINUE LINEtlt51)=DOT DO 2 I=2,51 JlmS2-1 JZzSO+I LINE(I,JI)~DOT 2 LINE(I,J2)sDOT DO 3 J=1,IU1,2 3 LINE(51,J)=DOT C PRINT HEADING ~RITE(LP,70O) ZOO FORMAT(IH2) WRITE(LP,900) 900 FOR~AT(IH r120HNUMQER POINTS QTZ PLAG ~FEL HB IDV I.BV HOLO PLUT SFD MET M L Q 2R / I ) C DO LOOP FOR MULTIPLE SAMpLE~ DO 777 JmltN C
ACC
SEC Q
MAT ACT F
l lO 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 013~ 0131 0132 0133 0134 0135 0136 0137 01~8 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0165 016~ 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0175 0176 0177 0178 0179 0180 0181 0182 0183 0184 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197
R . J . KORSCH C C
COMMENCEPROGRAM FOR ONE SAMPLE INITIALIZE A,BrDIFFrPERCENT ETC. DO 57 I = I F 1 3 A(1)=O.O B(1)=O,O DIFF(1)=O.O PERCEN(1)=O.O rREQ(1)=O.O E~T(I)=O,O CONBID(1)=O,O 57 CONTINUE SUH,pERM,RERL,PFRQ,TOTA,QTOT,FTOT,RTOTeTOTB=O.O MtL,QT,O,F~RmO,O C READ DATA CARDS READ(CR,q)(A(1),I=I,13) IF(A(1).EQ,V9999,)GO TO 778 READ(CR,g)(B(1),l=1,13) 9 FORMAT(13F6,0) C READ SAMPLE NUMBER READtCR,53)NUMBER 33 FORMAT(I6) C CALCULATENUMBER OF POINTS FOR EACH ELEMENT, TOTAL NUMBFR OF C POINTSAND PERCENTAGES FOR EACfl ELEMENT ~0 10 I=I,13 DIFF(1)=B(1)-A(1) 10 SUM=sUM+DIFF(1) DO 12 I=I,13 IZ PERCEN(1)=((DIFF(1))*IOO.O)/SUM C CALCULATEFREQUENCY, ESTIMATE AND CONFIDENCE LIMITS FOR C EACH ELEMENT DO 11 I=Ir13 FREQ(1)=DIFF(I)/SUM EST(1)=FREQ(1)*(I-FREQ(1)) CONEID(1)=SQRT(CHI)*($Q~T(EST(I)/SUM)) 11 CONTINUE DO 2& I:I,13 TOTAL(1)=TOTAL(I)+PERCEN(1) SQUARE(1)=PERCEN{I)*pER~EN(1) SQTOT(1)tSQTOT(1)÷SQUARE(1) 24 CONT|NUE C CALCULATEM L AND Q VALHFS PERMmPERCEN(7) PERL=IOO,O-PERCEN(1)-PERCEN(5)-PERCEN(6)-PERCEN(7) PE~QmPEQCEN(1) TOTAmPERM+PERL+PERQ M=(PERM*IOO.O)/TOTA L=(PERL*IO0.O)/TOTA QT=(pERQ*IOO.O)/TOTA C CALCULATE Q F AND R VALtlES QTOTmPERCEN(1) FTOTmPERcEN(2)+PERCFN(3) RTOTmPERcEN(8)+PERCEN(9)+PERCEN(10)+PERCEN(II)+PERCFN(12)+PERCEN(I 13) TOTB=QTOT+FTOT+RTOT Q=(QTOT*IO0,O)/TOTB F=(FTOT*IO0.O)/TOTB R=(RTOT*IOO.O)/TOTB C C A L C U L A T EP/F AND V/L RATIOS FRAT = PERCEN(2)/FT~T VRAT =(PERCEN(8) + PERCFN(9) + PERCEN(IO))/RTOT C PRODUCECqMULATIVE TOTALS FOR MEANS SUMMmSUMM÷M MSQ=M÷M SUMMSQ~SUMMSQ+MSQ SUMLzSUML+L LSQ=L*L SUML~Q=~uMLSQ÷LSQ SUMQT=SUMQT+QT QTSQmQT*QT SMQTSQ=SMQTSQ÷QTSQ SUMQmSUMQ+Q QSQ=Q*Q SUMQSQ=SuMQSQ+QSQ SUMFaSUMF+F FSQ=F*F SUMFsQ=SuMFSQ+FSQ SUMR=SUMR+R RSQaReR SUMRsQ=SUMRSQ+RSQ K=K+I C PRINT RESULTS ~RIT~(LPrSOU)NUMBER~SUM,(PERCEN(I),I=l,13)rM,L~QTpQ~FpR 800 FORMAT(1HO#I6tF6.0w13rS.I,2(6X#3ES.I)) WRITE(LP,802)(FBEQ(1),|=1,13}
Modes: A FORTRAN IV program to calculate modal anal~,ses from raw point-count data 0198 0199 0200 0201 0202 0203 0204 0205 0206 0202 0208 0209 0210 0211 0212 0213 0216 0215 0216 0212 0218 0219 0220 0221 0222 0223 0226 0225 0226 0227 0228 0229 0230 0231 0232 0233 0236 0235 0236 0237 0238 0239 0260 0261 0242 0263 0246 0265 0246 0267 0268 0269 0250 0251 0252 0253 0256 0255 0256 0257 0258 0259 0260 0261 0262 0263 0266 0265 0266 0267 0268 0269 0270 0271 0272 0273 0276 0275 0276 0277 0278 0279
802 FORMAT(1H ,gNFREQUENCYo3X,13E5,2) WR[TE(LP,~O3)(EST(I),Izlp13) 803 FORMAT(IN ,~NESTIMATE,GX,13F5,2) WRITE(LR,~O4)(CONFID(1),I=I,I]) 806 FORMAT(IN ,IOHCONFIDENCF,2X,13FS.2) WRITE(LP,365)FRATrV~AT 345 FORMAT(IH ,10Xr?N P/F = ,FT.4,10x,TH V/L = ,F7,6) ~RITE(LPsS05) 805 FORMAT(IHO) C DETERMINE POSITION OF pnINT IN TRIANGLE AND STORE IN ARRAY(LINE) C FOR H'L'Q DIAGRAM REPlAtE e QY H ALEVELm51,0-O,5*Q*O.5 LEVEL=INT(ALEVEL) C FOR M'L-Q DIAGRAM REPLACE Q BY H AND REPLACE F R Y L ALON~uIOI,5-O,5OS*Q-F LONGmINT(ALONG) IF(LONG.GT,IOI,0R,IONG,LE,O.OR.1EVEL.GT.SI.0R.LEVEL.LE.O)GO TO 35 LINOmLINE(LEVEL,LONG) IF(LINO.EQ,SPACE)GO Tn X4 31 IF(LINO.EQ,SYM(36))GO TO 277 DO 78 J=1,35 IF(LINO.EQ,SyM(J))GQ TO 32 ?8 CONTINUE 54 J=O 32 J=J+1 LINE(LEVEL,LONG)=SYM(J) GO T~ 777 C FOR M-L-Q DIAGRAM REPLACE Q BY M AND REPLACE F R Y L 35 WRITE(2,qO2)Q,E,LONG,LEVEL 902 FORMAT(IH ,21MPOINT OUT OF TRIANGLE,2F8.2,216) C COMM~NCFEXECUTION OF NEXT sAMPLE 777 CONTINUE C CALCULATEMEANS /78 RK = K MEANMnSUMM/RK MEANL=SUMLIRK MEANQTmSUMQT/RK MEAN~=SUMQ/RK MEANP=SUMF/RK MEANRmSU~R/RK DO 26 I = 1 , 1 3 MEAN(1)mTOTAL(1)/RK 26 CONTINUE C CALCULATESTANDARD DEVIATIONS VARMm(SUMMSQ-((SUMM*SUMM)/RK))/(RK-I.0) VARL=(SUMLSQ-((SUML*SUML}/RK))/(RK-I.0) VARQT=(SMQTSQ-((SUMQT*SUMQT)/RK))/(RK-I.0) VARqm(SUMQSQ-((SUMQ*SUMQ)/RK))/(RK-I.0) VARFm(SUMFSQ-((SUME*SUMF)/RK))/(RK-I.0) VARRs(SUMRSQ-((SUMR*SUMR)/RK))/(RK-¶.O}
SDM=S~RT(VARM)
28 C
600 300 200 100 C
888 C
881 899 C
C 882
SDLsSQRT(VARL) SDQTmSQRT(VARQT) SDQ=SQRT(VARQ) SOF:$QRT(VARF) SDR=$ORT(VARR) DO 2~ I a I F I ~ SD(1)=SQRT((SQTOT(1)-((TOTAL(1)*TOTAL(1))IRK))/(RK-I.0)) CONTINUE PRINT MEANS AND STANDARD DEVIATIONS WRIT~(LP,~OD} FORMAT(1HOe~H MEANS) WRITF(LP,5OU)(MEAN(1)tI=I~I~)wMEANM,MEANL~EANQT,MEANQ~MFANF,MEANR FORMAT(IR e12X,13FS.I,2(6X,3F5,1)) WRITE(LP,~OU) FORMAT(IHQt2~H STANDARD DEVIATIONS} WRIT~(LP,IOU)(SD(1),I=I,13),SDM,SDL,SDQT,SDQ,SDF,SDR FORMAT(IH ,12X,13FS.I,2(GXw~FS,I)) PRINT TRIANGULAR ~IAGRA~ WRIT~(LP,HS~) FORMAT(IH~) WRITE(LP,881) FOR M-L-Q DIAGRAM RFPLACE JOUARTZ p ~ITH 'MATRIX' ~ORMAT(SIX,6HOUARTZ/) WRIT~(2,899)I(LINE(I,J),J=I,IOI),ImIF51) FORMAT(IH ,10X,101AI) WRITE(LP,~8~) FOP M'L-o DIAGRAM REPLACE ~FELDSPAR' ~ITR ILABILES~ AND ~ROCK FRAGMENTS' WITN ~OUARTZ ~ FORMAT(10X,~NFELDSPAR,?~X,14HROCK FRAGMENTS) STOP END
111
112
R.J. Ko~scH
%
%
~J
o
<
o
%
¢N
aO
%
G,
o
aO
~ . N
*00
* 0 ~ 0 e'~
E
0 0 0
~ 0 0 0
~
e~
o
N
0 0 0
0 0 0
o~o ~ogg
0~
0 0 0 0
~ 0 0 ~
~ 0 0 ~
> ~ m m m
CN~;
o 0 0 0
o o o m ~ m ~
0 0 0
0 0 0
e-
o
~2XX~
0~ c
0
00
0
~ggg" 0 - o *
0 0 ~
°2X2
~ggg ~00 *000
gg~
m ~
~gggg
0
~ •
o 0
* , 0
~
X
.
0
° •
~
0
Z
2~
C}
~ 0 0 0 0
~
•
Modes: A FORTRAN IV program to calculate modal analyses from raw point-count data Qt'I~T7
rELO~pA.
CAGEO Vo/. 3, No. I--H
~O¢~ ;P~G~FN~S
I13