I'm getting runtime error in this.
The code is from a journal which is couple of years old and it seems that it has errors in it.
I did use a program to copy the pdf file to text but there were some few errors and I did clean it up.
I'm getting a runtime error on the line above 37
P(J)=DNML(ZB)-DNML(ZA)
Can someone help me out here?
I do not have any knowledge in FORTRAN and I need this program working to do a project.
If you cannot help me could you at least tell me what part to study to solve the problem?
I studied C++ but all this declaring thingy is confusing me..
Anyway thanks in advanced and hope you can help me!
The code is here and it may be copyrighted so you may not be able to use for your own profit.....
C
C PART 1
C
C FIND THE STATES OF A MARKOV CHAIN
C REPRESENTATION OF A SHEWHART CONTROL CHART WITH
C SUPPLEMENTARY RUNS RULES OF THE FORM T(K,M,A,B).
C
INTEGER H,CK,CX,QH,SG,TMP,D,QQNS,DI(20),PS(58),L2(20)
INTEGER X(20,10),Q(400,10),QQ(400),S(20)
DOUBLE PRECISION ARL,CDF(41),CUM,LR(400)
DOUBLE PRECISION LH,LP,P(10),R(41),SHIFT
DOUBLE PRECISION STD,U(400),ZA,ZB,DNML
CHARACTER*1 ANS
CHARACTER*54 FNAME
DIMENSION K(20),M(20),NX(58),A(20),B(20)
C
C INPUT THE RULES DEFINING THE CHART
C
WRITE(*,*) 'HOW MANY RUNS RULES ARE DESIRED?'
READ(*,*) NT
DO 1 I=1,NT
WRITE(*,499) I
1 READ(*,*) K(I),M(I),A(I),B(I)
C
C FIND THE REGIONS OF THE CHART
C
R(1)=-9
DO 2 I=1,NT
R(2*I)=A(I)
2 R(2*I+1)=B(I)
R(2*NT+2)=9
MR1=2*NT
MR=MR1+1
NR=MR
3 CK=0
DO 5 J=1,MR
IF(R(J).EQ.R(J+1).AND.J.LE.NR) THEN
DO 4 L=J,NR
4 R(L)=R(L+1)
NR=NR-1
CK=1
ENDIF
IF(R(J).GT.R(J+1)) THEN
TP=R(J)
R(J)=R(J+1)
R(J+1)=TP
CK=1
ENDIF
5 CONTINUE
MR=MR-1
IF(MR.GT.NR) MR=NR
IF(CK.EQ.1.AND.MR.GE.1) GO TO 3
C
C FIND THE LENGTH OF THE STATE VECTOR
C AND THE POINTERS TO THE END OF THE SUBVECTOR
C ASSOCIATED WITH EACH RUNS RULE.
C
CK=0
NV=0
DO 6 I=1,NT
NV=NV+M(I)-1
IF(K(I).LT.M(I)) CK=1
6 CONTINUE
IF(CK.EQ.0) NV=NV+1
DI(1)=M(1)-1
DO 7 I=2,NT
DI(I)=DI(I-1)+M(I)-1
IF(M(I).EQ.1) DI(I)=0
7 CONTINUE
C
C DETERMINE THE VALUE OF THE PRESENT
C INDICATOR VARIABLE BY RUNS RULE AND REGION
C COMBINATION.
C
DO 9 I=1,NT
DO 8 J=1,NR
X(I,J)=0
IF(A(I).LE.R(J).AND.R(J+1).LE.B(I)) X(I,J)=1
8 CONTINUE
9 CONTINUE
C
C DETERMINE THE STATE TO STATE
C TRANSITIONS BY REGIONS.
C
QQ(1)=0
QQNS=2**NV-1
NS=1
H=1
10 QH=QQ(H)
DO 11 L=1,NV
PS(L)=QH-2*(QH/2)
11 QH=QH/2
DO 13 I=1,NT
S(I)=0
IF(M(I).GT.1) THEN
DO 12 L=DI(I)-M(I)+2,DI(I)
12 S(I)=S(I)+PS(L)
ENDIF
13 CONTINUE
DO 19 J=1,NR
SG=0
DO 16 I=1,NT
IF(SG.EQ.0) THEN
IF(S(I)+X(I,J).GE.K(I)) THEN
SG=1
ELSE
IF(M(I).GT.1) NX(DI(I)-M(I)+2)=X(I,J)
IF (M(I).GT.2) THEN
DO 14 L=DI(I)-M(I)+3,DI(I)
14 NX(L)=PS(L-1)
ENDIF
ENDIF
IF(X(I,J).EQ.0.AND.M(I).GT.1) THEN
TMP=S(I)-PS(DI(I))+1
L=DI(I)
CK=0
15 IF(NX(L).EQ.1) THEN
CK=1
IF(TMP.LT.K(I)) THEN
NX(L)=0
TMP=TMP-1
CK=0
ENDIF
ENDIF
L=L-1
TMP=TMP+1
IF(CK.EQ.0.AND.L.GE.DI(I)-M(I)+2) THEN
GO TO 15
ENDIF
ENDIF
ENDIF
16 CONTINUE
I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(Q(I,J).LT.QQNS) THEN
CK=0
L=1
32 IF(Q(I,J).EQ.QQ(L)) THEN
Q(I,J)=L
CK=1
ENDIF
L=L+1
IF(CK.EQ.0.AND.L.LT.NS) GO TO 32
ELSE
Q(I,J)=NS
ENDIF
33 CONTINUE
34 CONTINUE
C
C OUTPUT THE STATE, NEXT-STATE TRANSITION MATRIX
C
WRITE(*,*) 'OUTPUT THE (STATE, NEXT-STATE) MATRIX?'
READ(*,100) ANS
IF(ANS.EQ.'N'.OR.ANS.EQ.'n') GO TO 36
WRITE(*,*) 'NAME OF OUTPUT FILE? '
READ(*,101) FNAME
OPEN (50,FILE=FNAME)
WRITE(50,500) NS,NR
WRITE(50,501) (R(J),J=1,NR+1)
DO 35 I=1,NS
35 WRITE(50,502) I,(Q(I,J),J=1,NR)
CLOSE (50)
C
C PART 2
C
C COMPUTE THE CUMULATIVE DISTRIBUTION
C FUNCTION, THE AVERAGE RUN LENGTHn(ARL) AND THE
C STANDARD DEVIATION (STD) OF THE RUN LENGTH FOR A
C GIVEN (INPUTED) STANDARDIZED SHIFT IN THE MEAN.
C
36 WRITE(*,*) 'STANDARDIZED SHIFT DESIRED?'
READ(*,*) SHIFT
IST=1
DO 37 J=1,NR
ZA=R(J)-SHIFT
ZB=R(J+1)-SHIFT
P(J)=DNML(ZB)-DNML(ZA)
37 CONTINUE
DO 39 I=1,NS-1
U(I)=0.D0
DO 38 J=1,NR
IF(Q(I,J).NE.NS) U(I)=U(I)+P(J)
38 CONTINUE
39 U(I)=1.D0-U(I)
N=1
CUM=U(IST)
CDF(1)=CUM
ARL=CUM
STD=CUM
CK=0
40 N=N+1
DO 42 I=1,NS-1
LR(I)=0
DO 41 J=1,NR
IF(Q(I,J).NE.NS) LR(I)=LR(I)+P(J)*U(Q(I,J))
41 CONTINUE
42 CONTINUE
IF(U(IST).NE.0.0.AND.CUM.NE.1.0) THEN
LH=LR(IST)/U(IST)
LP=(1-CUM-LR(IST))/(1-CUM)
TP=ABS(LH-LP)
IF(N.GT.9.AND.TP.LT.0.000001) CK=1
ENDIF
IF(CUM.EQ.1.0D0) CK=1
IF(N.GT.40) CK=1
ARL=ARL+N*LR(IST)
STD=STD+N*N*LR(IST)
IF(CK.EQ.1) THEN
TP=N/(1-LH)+1/((1-LH)*(1-LH))
ARL=ARL+LH*LR(IST)*TP
TP=1-LH
TP=N*N/TP+(2*N-1)/(TP*TP)+2/(TP*TP*TP)
STD=STD+LH*LR(IST)*TP
ENDIF
DO 43 I=1,NS-1
43 U(I)=LR(I)
CUM=CUM+LR(IST)
CDF(N)=CUM
IF(CK.EQ.0) GO TO 40
STD=DSQRT(STD-ARL*ARL)
C
C PRINT THE CDF, ARL AND STD OF THE
C RUN LENGTH FOR THE GIVEN STANDARDIZED
C SHIFT IN THE MEAN.
C
WRITE(*,*) 'DO YOU WANT THE OUTPUT WRITTEN TO A FILE?'
READ(*,100) ANS
IF(ANS.EQ.'y') ANS='Y'
IF(ANS.EQ.'Y') THEN
WRITE(*,*) 'ENTER NAME OF OUTPUT FILE: '
READ(*,101) FNAME
OPEN(60,FILE=FNAME)
WRITE(60,503) SHIFT
DO 44 I=1,N
44 WRITE(60,504) I,CDF(I)
WRITE(60,505) N,N,N
WRITE(60,506) LH
WRITE(60,507) ARL,STD
CLOSE (60)
ENDIF
WRITE(*,503) SHIFT
DO 45 I=1,N
45 WRITE(*,504) I,CDF(I)
WRITE(*,505) N,N,N
WRITE(*,506) LH
WRITE(*,507) ARL,STD
100 FORMAT(A1)
101 FORMAT(A54)
499 FORMAT(' ENTER K,M,A,B FOR RULE',I3,':')
500 FORMAT(2(I4,1X))
501 FORMAT(10(F7.2))
502 FORMAT(12(1X,I4))
WRITE(*,503)'CUMULATIVE DISTRIBUTION FUNCTION','-- SHIFT ='
503 FORMAT(F5.2)
504 FORMAT(5X,'P[N<=',I2,'] =',F17.15)
C O=P[N<=+N]=P[N<=] + L*P[N=]*[1-L**N]/[1-L]
505 FORMAT(/16X,'.',/5X,'P[N<=',A2,'+N]=P[N<=',A2,']+L*P[N=',A2,
& ']*[1-L**N]/[1-L],',A10)
506 FORMAT(/5X,'WHERE N = 1,2,3, ... AND L=',F17.15,'.')
507 FORMAT(/5X,'ARL = ',F8.2/5X,'STD = ',F8.2)
STOP
END
The code is from a journal which is couple of years old and it seems that it has errors in it.
I did use a program to copy the pdf file to text but there were some few errors and I did clean it up.
I'm getting a runtime error on the line above 37
P(J)=DNML(ZB)-DNML(ZA)
Can someone help me out here?
I do not have any knowledge in FORTRAN and I need this program working to do a project.
If you cannot help me could you at least tell me what part to study to solve the problem?
I studied C++ but all this declaring thingy is confusing me..
Anyway thanks in advanced and hope you can help me!
The code is here and it may be copyrighted so you may not be able to use for your own profit.....
C
C PART 1
C
C FIND THE STATES OF A MARKOV CHAIN
C REPRESENTATION OF A SHEWHART CONTROL CHART WITH
C SUPPLEMENTARY RUNS RULES OF THE FORM T(K,M,A,B).
C
INTEGER H,CK,CX,QH,SG,TMP,D,QQNS,DI(20),PS(58),L2(20)
INTEGER X(20,10),Q(400,10),QQ(400),S(20)
DOUBLE PRECISION ARL,CDF(41),CUM,LR(400)
DOUBLE PRECISION LH,LP,P(10),R(41),SHIFT
DOUBLE PRECISION STD,U(400),ZA,ZB,DNML
CHARACTER*1 ANS
CHARACTER*54 FNAME
DIMENSION K(20),M(20),NX(58),A(20),B(20)
C
C INPUT THE RULES DEFINING THE CHART
C
WRITE(*,*) 'HOW MANY RUNS RULES ARE DESIRED?'
READ(*,*) NT
DO 1 I=1,NT
WRITE(*,499) I
1 READ(*,*) K(I),M(I),A(I),B(I)
C
C FIND THE REGIONS OF THE CHART
C
R(1)=-9
DO 2 I=1,NT
R(2*I)=A(I)
2 R(2*I+1)=B(I)
R(2*NT+2)=9
MR1=2*NT
MR=MR1+1
NR=MR
3 CK=0
DO 5 J=1,MR
IF(R(J).EQ.R(J+1).AND.J.LE.NR) THEN
DO 4 L=J,NR
4 R(L)=R(L+1)
NR=NR-1
CK=1
ENDIF
IF(R(J).GT.R(J+1)) THEN
TP=R(J)
R(J)=R(J+1)
R(J+1)=TP
CK=1
ENDIF
5 CONTINUE
MR=MR-1
IF(MR.GT.NR) MR=NR
IF(CK.EQ.1.AND.MR.GE.1) GO TO 3
C
C FIND THE LENGTH OF THE STATE VECTOR
C AND THE POINTERS TO THE END OF THE SUBVECTOR
C ASSOCIATED WITH EACH RUNS RULE.
C
CK=0
NV=0
DO 6 I=1,NT
NV=NV+M(I)-1
IF(K(I).LT.M(I)) CK=1
6 CONTINUE
IF(CK.EQ.0) NV=NV+1
DI(1)=M(1)-1
DO 7 I=2,NT
DI(I)=DI(I-1)+M(I)-1
IF(M(I).EQ.1) DI(I)=0
7 CONTINUE
C
C DETERMINE THE VALUE OF THE PRESENT
C INDICATOR VARIABLE BY RUNS RULE AND REGION
C COMBINATION.
C
DO 9 I=1,NT
DO 8 J=1,NR
X(I,J)=0
IF(A(I).LE.R(J).AND.R(J+1).LE.B(I)) X(I,J)=1
8 CONTINUE
9 CONTINUE
C
C DETERMINE THE STATE TO STATE
C TRANSITIONS BY REGIONS.
C
QQ(1)=0
QQNS=2**NV-1
NS=1
H=1
10 QH=QQ(H)
DO 11 L=1,NV
PS(L)=QH-2*(QH/2)
11 QH=QH/2
DO 13 I=1,NT
S(I)=0
IF(M(I).GT.1) THEN
DO 12 L=DI(I)-M(I)+2,DI(I)
12 S(I)=S(I)+PS(L)
ENDIF
13 CONTINUE
DO 19 J=1,NR
SG=0
DO 16 I=1,NT
IF(SG.EQ.0) THEN
IF(S(I)+X(I,J).GE.K(I)) THEN
SG=1
ELSE
IF(M(I).GT.1) NX(DI(I)-M(I)+2)=X(I,J)
IF (M(I).GT.2) THEN
DO 14 L=DI(I)-M(I)+3,DI(I)
14 NX(L)=PS(L-1)
ENDIF
ENDIF
IF(X(I,J).EQ.0.AND.M(I).GT.1) THEN
TMP=S(I)-PS(DI(I))+1
L=DI(I)
CK=0
15 IF(NX(L).EQ.1) THEN
CK=1
IF(TMP.LT.K(I)) THEN
NX(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1
IF(H.LT.NS) GO TO 26
I=I+1
IF(I.LT.NS-1) GO TO 25
IF(CK.EQ.1) GO TO 24
C
C NUMBER THE NEXT-STATE TRANSITIONS
C
DO 34 I=1,NS
DO 33 J=1,NR
IF(Q(I,J).LT.QQNS) THEN
CK=0
L=1
32 IF(Q(I,J).EQ.QQ(L)) THEN
Q(I,J)=L
CK=1
ENDIF
L=L+1
IF(CK.EQ.0.AND.L.LT.NS) GO TO 32
ELSE
Q(I,J)=NS
ENDIF
33 CONTINUE
34 CONTINUE
C
C OUTPUT THE STATE, NEXT-STATE TRANSITION MATRIX
C
WRITE(*,*) 'OUTPUT THE (STATE, NEXT-STATE) MATRIX?'
READ(*,100) ANS
IF(ANS.EQ.'N'.OR.ANS.EQ.'n') GO TO 36
WRITE(*,*) 'NAME OF OUTPUT FILE? '
READ(*,101) FNAME
OPEN (50,FILE=FNAME)
WRITE(50,500) NS,NR
WRITE(50,501) (R(J),J=1,NR+1)
DO 35 I=1,NS
35 WRITE(50,502) I,(Q(I,J),J=1,NR)
CLOSE (50)
C
C PART 2
C
C COMPUTE THE CUMULATIVE DISTRIBUTION
C FUNCTION, THE AVERAGE RUN LENGTHn(ARL) AND THE
C STANDARD DEVIATION (STD) OF THE RUN LENGTH FOR A
C GIVEN (INPUTED) STANDARDIZED SHIFT IN THE MEAN.
C
36 WRITE(*,*) 'STANDARDIZED SHIFT DESIRED?'
READ(*,*) SHIFT
IST=1
DO 37 J=1,NR
ZA=R(J)-SHIFT
ZB=R(J+1)-SHIFT
P(J)=DNML(ZB)-DNML(ZA)
37 CONTINUE
DO 39 I=1,NS-1
U(I)=0.D0
DO 38 J=1,NR
IF(Q(I,J).NE.NS) U(I)=U(I)+P(J)
38 CONTINUE
39 U(I)=1.D0-U(I)
N=1
CUM=U(IST)
CDF(1)=CUM
ARL=CUM
STD=CUM
CK=0
40 N=N+1
DO 42 I=1,NS-1
LR(I)=0
DO 41 J=1,NR
IF(Q(I,J).NE.NS) LR(I)=LR(I)+P(J)*U(Q(I,J))
41 CONTINUE
42 CONTINUE
IF(U(IST).NE.0.0.AND.CUM.NE.1.0) THEN
LH=LR(IST)/U(IST)
LP=(1-CUM-LR(IST))/(1-CUM)
TP=ABS(LH-LP)
IF(N.GT.9.AND.TP.LT.0.000001) CK=1
ENDIF
IF(CUM.EQ.1.0D0) CK=1
IF(N.GT.40) CK=1
ARL=ARL+N*LR(IST)
STD=STD+N*N*LR(IST)
IF(CK.EQ.1) THEN
TP=N/(1-LH)+1/((1-LH)*(1-LH))
ARL=ARL+LH*LR(IST)*TP
TP=1-LH
TP=N*N/TP+(2*N-1)/(TP*TP)+2/(TP*TP*TP)
STD=STD+LH*LR(IST)*TP
ENDIF
DO 43 I=1,NS-1
43 U(I)=LR(I)
CUM=CUM+LR(IST)
CDF(N)=CUM
IF(CK.EQ.0) GO TO 40
STD=DSQRT(STD-ARL*ARL)
C
C PRINT THE CDF, ARL AND STD OF THE
C RUN LENGTH FOR THE GIVEN STANDARDIZED
C SHIFT IN THE MEAN.
C
WRITE(*,*) 'DO YOU WANT THE OUTPUT WRITTEN TO A FILE?'
READ(*,100) ANS
IF(ANS.EQ.'y') ANS='Y'
IF(ANS.EQ.'Y') THEN
WRITE(*,*) 'ENTER NAME OF OUTPUT FILE: '
READ(*,101) FNAME
OPEN(60,FILE=FNAME)
WRITE(60,503) SHIFT
DO 44 I=1,N
44 WRITE(60,504) I,CDF(I)
WRITE(60,505) N,N,N
WRITE(60,506) LH
WRITE(60,507) ARL,STD
CLOSE (60)
ENDIF
WRITE(*,503) SHIFT
DO 45 I=1,N
45 WRITE(*,504) I,CDF(I)
WRITE(*,505) N,N,N
WRITE(*,506) LH
WRITE(*,507) ARL,STD
100 FORMAT(A1)
101 FORMAT(A54)
499 FORMAT(' ENTER K,M,A,B FOR RULE',I3,':')
500 FORMAT(2(I4,1X))
501 FORMAT(10(F7.2))
502 FORMAT(12(1X,I4))
WRITE(*,503)'CUMULATIVE DISTRIBUTION FUNCTION','-- SHIFT ='
503 FORMAT(F5.2)
504 FORMAT(5X,'P[N<=',I2,'] =',F17.15)
C O=P[N<=+N]=P[N<=] + L*P[N=]*[1-L**N]/[1-L]
505 FORMAT(/16X,'.',/5X,'P[N<=',A2,'+N]=P[N<=',A2,']+L*P[N=',A2,
& ']*[1-L**N]/[1-L],',A10)
506 FORMAT(/5X,'WHERE N = 1,2,3, ... AND L=',F17.15,'.')
507 FORMAT(/5X,'ARL = ',F8.2/5X,'STD = ',F8.2)
STOP
END