Neal, I just checked an old program I wrote that used F77 virtual arrays. Just to make sure nothing had changed much I recompiled it and rebuilt it and ran it and everything ran fine. The errors you are seeing might result from out of bounds array references. I noticed in my old build command file that it accepted a command line debug switch (e.g. @CALIB.CMD D ) which compiled the F77 with array bounds checking “/CK” that generates extra code to test that each attempt to reference an array element is valid. It also links in the PDP-11 Symbolic debugger and turns off compiler optimization.
I had some additional programs and data files (this was all part of my Master’s thesis) that ran on a PDP-11/44 in the day. It lacked floating point and we ran a DECUS FPP emulator so our floating point was slow. A batch file that ran all the data through the suite of programs took a little over an hour. On my 11/83 today it takes 26 minutes and on a Mentec M100-04 (~11/93) it takes 19 minutes. Their were a number of generated FTIR spectrum plots that were spooled to a HP7550 plotter from the batch job.
Best,
Mark
Here is the F77 code:
PROGRAM CALIB
PARAMETER (MS=15, MP=1000, MC=4)
VIRTUAL R(MC+1,MP), S(MS,MP), U(MP), W(MP)
VIRTUAL X(MC+1,MS), Y(MS), Z(MC+1,MS)
REAL*8 R, S, U, X, Y, Z
REAL*8 DET, SE, YD, YE, C(MS,MC), T(MC+1)
INTEGER*2 I, J, K, NS, NP, NC
CHARACTER FNAM*24, TITLE*40
C
C NS Number of Spectra
C MS Maximum Number of Spectra
C NP Number of Points in a Spectrum
C MP Maximum Number of Points in a Spectrum
C NC Number of Components in the Sample Composition
C MC Maximum Number of Components
C S Spectra Matrix NS spectra x NP points
C C Composition Matrix NS spectra x NC components
C X Regression Matrix NS spectra x NC+1 components
C Y Regression Matrix NS spectra x a spectral point
C R Regression Coefficient Matrix NC+1 x NP
C T Temporary Coefficient Storage
C U Uncertainty Vector NP values = Standard Error
C of Estimate for each Regression performed
C
TYPE 100,'Enter Name of parameter file '
100 FORMAT (1X,A,$)
ACCEPT 110,FNAM
110 FORMAT(A)
OPEN (UNIT=2, STATUS='OLD', FILE=FNAM,
+CARRIAGECONTROL='LIST', READONLY)
C
C The parameter file has the Number of Spectra,
C the Number of points in each Spectrum, and
C the number of components, the each record
C after that is the name of one of the NS files
C containing the Spectral Data
C
READ (2,*) NS, NP, NC
DO 140 I=1,NS
READ (2,120) FNAM
120 FORMAT (A)
C
TYPE *,'Opening File ',FNAM
OPEN (UNIT=1, STATUS='OLD', FILE=FNAM,
+CARRIAGECONTROL='LIST', READONLY)
C
C For each Spectrum read the Title,
C the Component Levels and the NP point spectrum
C
READ (1,120) TITLE
READ (1,*) (C(I,J),J=1,NC)
DO 130 J=1,NP
130 READ (1,*) W(J), S(I,J)
TYPE *,'Finished reading Data for ',TITLE
140 CLOSE (UNIT=1)
CLOSE (UNIT=2)
C
C Build the Component Matrix X used for all Regressions
C
DO 150 I=1,NS
X(1,I)=1.
DO 150 J=1,NC
150 X(J+1,I)=C(I,J)
C
C Build the Y Matrix for each spectral point
C And perform a regression
C
DO 190 I=1,NP
DO 160 J=1,NS
160 Y(J)=S(J,I)
C
CALL REGRES (X, Y, NS, NC+1, T, DET, Z)
IF (DET.EQ.0.0) THEN
TYPE 170
170 FORMAT (' Regression Failed',/,
+' Sample Compositions are Colinear')
STOP
ENDIF
DO 180 J=1,NC+1
180 R(J,I)=T(J)
190 CONTINUE
TYPE *,'Determinant is ',DET
C
C Calculate the Uncertainties which are the RMS averages
C of the deviations of the predictions from the actual
C spectra, also known as the standard error of estimate
C
DO 220 I=1,NP
SE=0.
DO 210 J=1,NS
YE=0.
DO 200 K=1,NC+1
200 YE=YE+X(K,J)*R(K,I)
YD=S(J,I)-YE
210 SE=SE+YD*YD
220 U(I)=SQRT(ABS(SE/NS))
C
C Store the Regression Coefficients in a file that has
C NC+1 coefficients for each record plus an uncertainty
C and NS records for each point in the spectra
C
OPEN (UNIT=1, STATUS='NEW', FILE='REGRES.DAT',
+CARRIAGECONTROL='LIST')
C
WRITE (1,230) NP, NC
230 FORMAT (2I6)
240 FORMAT (F8.0,5F12.6)
DO 250 I=1,NP
250 WRITE (1,240) W(I),(R(J,I),J=1,NC+1),U(I)
CLOSE (UNIT=1)
END
Here is the build command file:
.IF P1 EQ "D" F77 CALIB/DS=CALIB/-OP/DB/CK
.IF P1 NE "D" F77 CALIB/DS=CALIB
.IF <EXSTAT> <> 1 .EXIT
.IF P1 EQ "D" F77 REGRES/DS=REGRES/-OP/DB/CK
.IF P1 NE "D" F77 REGRES/DS=REGRES
.IF <EXSTAT> <> 1 .EXIT
.IF P1 EQ "D" F77 MATINV/DS=MATINV/-OP/DB/CK
.IF P1 NE "D" F77 MATINV/DS=MATINV
.IF <EXSTAT> <> 1 .EXIT
.OPEN CALIB.TKB
.IF P1 EQ "D" .DATA CALIB/ID,,CALIB=CALIB,REGRES,MATINV,LB:[1,1]F77DBG/DA,LB:[1,1]F77FCS/LB
.IF P1 NE "D" .DATA CALIB/ID=CALIB,REGRES,MATINV,LB:[1,1]F77FCS/LB
.DATA /
.DATA SUPLIB=FCSFSL:SV
.DATA //
.CLOSE
TKB @CALIB.TKB
PUR *.OBJ,*.TSK,*.STB,*.TKB