home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hall of Fame
/
HallofFameCDROM.cdr
/
oilfield
/
spe-25.lzh
/
ECON.FOR
< prev
next >
Wrap
Text File
|
1987-12-17
|
24KB
|
299 lines
COMMON/I1/PRESX(50),BY(50),XX,N,FINT SHJ00040
DIMENSION NY(50),QGAS(50),QOIL(50),YGAS(50),YOIL(50),PW(50),DOLR SHJ00050
1(50),X(50) SHJ00060
DIMENSION GPRICE(50),OPRICE(50),YREV(50),OPCO(50),WIN(50) SHJ00070
DIMENSION OIN(50),NYEAR(50),OVCO(50),CFL(50) SHJ00080
DIMENSION DRATE(50),ITITLE(80),WCO(50),OCO(50),CPW(50) SHJ00090
DIMENSION JTITLE(80) SHJ00100
10 FORMAT(' ') SHJ00110
C READ PROJECT DESIGNATION SHJ00120
C READ STARTING YEAR OF EVALUATION SHJ00130
READ(5,38)(ITITLE(IJ),IJ=1,36) SHJ00140
READ(5,38)(JTITLE(IJ),IJ=1,36) SHJ00150
38 FORMAT(36A2) SHJ00160
WRITE(6,39)(ITITLE(IJ),IJ=1,36) SHJ00170
WRITE(6,39)(JTITLE(IJ),IJ=1,36) SHJ00180
39 FORMAT(10X,36A2) SHJ00190
READ(5,15)IYEAR,IORGVN,NDATA SHJ00200
15 FORMAT(3I4) SHJ00210
C WELL DIFFERENTIATE BETWEEN MAIN PRODUCT STREAM 1.0 FOR GAS 0.0 FOR OILSHJ00220
READ(5,4)WELL SHJ00230
4 FORMAT(F5.0) SHJ00240
C READ TIME : INVESTMENTS : WELL COST ($), OTHER COSTS ($) SHJ00250
READ(5,6)WC,OC SHJ00260
6 FORMAT(2F15.2) SHJ00270
C READ OPERATING COST ($/MONTH),INFLATION RATE (DEC/YEAR) SHJ00280
READ(5,6)OPC,RI SHJ00290
C READ NO. OF LONG TERM INVESTMENTS (MAX. =9) SHJ00300
READ(5,9)NO SHJ00310
9 FORMAT(I1) SHJ00320
IF(NO.EQ.0) GO TO 13 SHJ00330
DO 12 IZ =1,NO SHJ00340
C READ YEAR OF EXPENSE, WELL COST,$,AND OTHER COSTS,$ SHJ00350
READ(5,16)NYEAR(IZ),WCO(IZ),OCO(IZ) SHJ00360
16 FORMAT (I5,2F10.0) SHJ00370
12 CONTINUE SHJ00380
13 CONTINUE SHJ00390
IF(WELL.EQ.0.0) GO TO 17 SHJ00400
C READ GAS RESERVES,MMCF,GAS RATE,MCF/D,CONDENSATE RATE,BARREL/MCF, SHJ00410
C DECLINE RATE,DECIMAL,CONSTANT PERIOD,YEARS,SALES DELAY, SHJ00420
C MONTHS (MAX.=24) SHJ00430
READ(5,19)GRES,QGAS(1),BPM,DR,CP,SD SHJ00440
19 FORMAT (2F15.0,4F10.2) SHJ00450
C READ STARTING PRICES : GAS ($/MCF),CONDNESATE($/BBL.),AND SHJ00460
C ESCALATION RATE (DECIMAL/YEAR) SHJ00470
READ(5,21)GPRICE(1),OPRICE(1),CR SHJ00480
21 FORMAT(3F10.2) SHJ00490
GO TO 22 SHJ00500
17 CONTINUE SHJ00510
C READ RESERVES (MBO),OIL RATE,BOPD,DECLINE RATE,DECIMAL,GOR SHJ00520
C SCF/BARREL,CONSTANT PERIOD,YEARS,SALES DELAY,MONTH SHJ00530
C (MAX.=24) SHJ00540
READ(5,19)ORES,QOIL(1),DR,GOR,CP,SD SHJ00550
C READ STARTING PRICES :OIL($/BBL),GAS($/MCF),AND ESCALATION RATE SHJ00560
C (DECIMAL/YEAR) SHJ00570
READ(5,21)OPRICE(1),GPRICE(1),ER SHJ00580
22 CONTINUE SHJ00590
C CALCULATE TIME ZERO COSTS,OVERHEAD AND CASH FLOWS SHJ00600
WC=WC/1000.0 SHJ00610
OC=OC/1000.0 SHJ00620
TC=WC + OC SHJ00630
OH=TC*0.20 SHJ00640
CFL(1)=0.0-(TC+OH) SHJ00650
DOLR(1)=CFL(1) SHJ00660
C INITIALIZE NECESSARY VALUES TO TIME ZERO SHJ00670
OPCO(1)=(OPC*12.0/1000.0)/(1.0+RI) SHJ00680
SUMREV=0.0 SHJ00690
SUMOIL=0.0 SHJ00700
SUMGAS=0.0 SHJ00710
X(1)=0.0 SHJ00720
NY(1)=IYEAR-1 SHJ00730
IX=NDATA SHJ00740
SUMOPC=0.0 SHJ00750
OPCONE=SUMOPC SHJ00760
SUMLTW=WC SHJ00770
SUMLTO=OC SHJ00780
SUMOVC=OH SHJ00790
YGAS(1)=0.0 SHJ00800
YOIL(1)=0.0 SHJ00810
GPRICE(1)=GPRICE(1)/(1.0+ER) SHJ00820
OPRICE(1)=OPRICE(1)/(1.0+ER) SHJ00830
YREV(1)=0.0 SHJ00840
WIN(1) =WC SHJ00850
OIN(1) =OC SHJ00860
OVCO(1)=OH SHJ00870
C TIME ZERO OIL AND GAS RATES SHJ00880
IF(WELL.EQ.0.0)QGAS(1)=QOIL(1)*GOR/1000.0 SHJ00890
IF(WELL.NE.0.0)QOIL(1)=QGAS(1)*BPM SHJ00900
C SHJ00910
C CACULATE PRODUCTION REVENUE AND COSTS FOR ALL YEARS SHJ00920
NOP1=NO+1 SHJ00930
DO 100 I =2,IX SHJ00940
JIM = I-1 SHJ00950
X(I) = X(JIM) + 1.0 SHJ00960
NY (I) = NY(JIM)+1 SHJ00970
IF(IORGVN.EQ.1) GO TO 60 SHJ00980
IF(CP.GE.X(1)) XDR =0.0 SHJ00990
IF(CP.LT.X(I))XDR = DR SHJ01000
SDF =1.0 SHJ01010
IF(SD.LE.12.0.AND.I.EQ.2) SDF =1.0 - (SD/12.0) SHJ01020
IF(SD.GT.12.0.AND.I.EQ.2) SDF =0.0 SHJ01030
IF(SD.GT.12.0.AND.I.EQ.3) SDF =1.0 - ((SD-12.0)/(12.0)) SHJ01040
QGAS(I) = QGAS(JIM)*(1.0-(XDR*SDF)) SHJ01050
QOIL(I) = QOIL(JIM)*(1.0-(XDR*SDF)) SHJ01060
IF(QGAS(I).EQ.QGAS(JIM))GO TO 25 SHJ01070
IF(QOIL(I).EQ.QOIL(JIM))GO TO 25 SHJ01080
YGAS(I)=((QGAS(JIM)-QGAS(I))*365.*SDF)/(ALOG(QGAS(JIM)/QGAS(I))) SHJ01090
YOIL(I)=((QOIL(JIM)-QOIL(I))*365.*SDF)/(ALOG(QOIL(JIM)/QOIL(I))) SHJ01100
GO TO 26 SHJ01110
25 CONTINUE SHJ01120
YGAS(I)= QGAS(I)*365.*SDF SHJ01130
YOIL(I)= QOIL(I)*365.*SDF SHJ01140
GO TO 26 SHJ01150
C 60 DO 26 I = 1, NDATA SHJ01160
60 READ(5,500)QOIL(I) SHJ01170
500 FORMAT(F15.0) SHJ01180
QGAS(I) = QOIL(I)*GOR/1000.0 SHJ01190
YGAS(I) = QGAS(I)*365.0 SHJ01200
YOIL(I) = QOIL(I)*365.0 SHJ01210
26 CONTINUE SHJ01220
YGAS(I) = YGAS(I)/1000.0 SHJ01230
YOIL(I) = YOIL(I)/1000.0 SHJ01240
SUMGAS = SUMGAS + YGAS(I) SHJ01250
SUMOIL = SUMOIL + YOIL(I) SHJ01260
C REVENUE SHJ01270
GPRICE(I) = GPRICE(JIM)*(1.0 + ER) SHJ01280
OPRICE(I) = OPRICE(JIM)*(1.0 + ER) SHJ01290
YREV(I) =(YOIL(I)*OPRICE(I))+(YGAS(I)*GPRICE(I)) SHJ01300
SUMREV = SUMREV + YREV(I) SHJ01310
C OPERATING COST SHJ01320
OPCO(I) = OPCO(JIM)*(1.0+RI) SHJ01330
SUMOPC = SUMOPC+OPCO(I) SHJ01340
C LONG TERM INVESTMENTS SHJ01350
WIN(I) = 0.0 SHJ01360
OIN(I) = 0.0 SHJ01370
IF(NO.EQ.0) GO TO 27 SHJ01380
DO 110 J = 1,NO SHJ01390
IF(NY(I).EQ.NYEAR(J)) WIN(I) = WCO(J)*EXP(RI*X(I)) SHJ01400
IF(NY(I).EQ.NYEAR(J)) OIN(I) = OCO(J)*EXP(RI*X(I)) SHJ01410
110 CONTINUE SHJ01420
WIN(I) = WIN(I)/1000.0 SHJ01430
OIN(I) = OIN(I)/1000.0 SHJ01440
27 CONTINUE SHJ01450
SUMLTW = SUMLTW + WIN(I) SHJ01460
SUMLTO = SUMLTO + OIN(I) SHJ01470
C OVERHEAD COSTS ( 20% OF TOTAL COSTS ) SHJ01480
OVCO(I) = 0.2*(OPCO(I) + WIN(I) + OIN(I)) SHJ01490
SUMOVC = SUMOVC + OVCO(I) SHJ01500
C YEARLY CASH FLOW SHJ01510
CFL(I) = YREV(I)-(OPCO(I) + OIN(I) + WIN(I) + OVCO(I)) SHJ01520
C CUMULATIVE CASH FLOW SHJ01530
DOLR(I) = DOLR(JIM) + CFL(I) SHJ01540
C STOP DO LOOP IF REVENUE IS LESS THAN 1.2 TIMES OPERATING COST OR SHJ01550
C IF RESERVES ARE EXHAUSTED SHJ01560
IF (YREV(I).LE.(1.2*OPCO(I))) IX =I SHJ01570
IF(WELL.EQ.0.0.AND.SUMOIL.GE.ORES) IX = I SHJ01580
IF(WELL.NE.0.0.AND.SUMGAS.GE.GRES) IX = I SHJ01590
IF(IX.EQ.I) GO TO 101 SHJ01600
100 CONTINUE SHJ01610
101 CONTINUE SHJ01620
C CALCULATE PRESENT WORTH AT DISCOUNT RATES FROM 1.1 TO 0.0 IN SHJ01630
C INCREMENTS OF 0.1 SHJ01640
DRATE(1) = 1.1 SHJ01650
BY(1) = DRATE(1) SHJ01660
PW(1) = 0.0 - 1.0 SHJ01670
PRESX(1) = PW(1) SHJ01680
DO 120 L = 2,12 SHJ01690
PW(L) = 0.0 SHJ01700
DRATE(L) = DRATE(L-1) - 0.1 SHJ01710
DO 115 IK = 1,IX SHJ01720
CPW(IK) =CFL(IK)*EXP(0.0-DRATE(L)*X(IK)) SHJ01730
PW(L) = PW(L) + CPW(IK) SHJ01740
115 CONTINUE SHJ01750
PRESX(L) = PW(L) SHJ01760
BY(L) = DRATE(L) SHJ01770
120 CONTINUE SHJ01780
C CALCULATE PROFITABILITY INDEX SHJ01790
XAXIS = 0.0 SHJ01800
NN = 48 SHJ01810
N = NN SHJ01820
XX = XAXIS SHJ01830
PI = 0.0 SHJ01840
IF(PW(2).GE.0.0) PI = 100.0 SHJ01850
IF(PW(2).GE.0.0) GO TO 28 SHJ01860
CALL TLUP SHJ01870
PI = FINT SHJ01880
PI = PI*100.0 SHJ01890
28 CONTINUE SHJ01900
C WRITE(6,7000)PI SHJ01910
C7000 FORMAT(10X,F15.5) SHJ01920
C CALCULATEPAYOUT TIME IN MONTHS SHJ01930
DO 1000 J = 1,IX SHJ01940
PRESX(J) = DOLR(J) SHJ01950
BY(J) = X(J) SHJ01960
1000 CONTINUE SHJ01970
XX = XAXIS SHJ01980
N = IX SHJ01990
CALL TLUP SHJ02000
POUT = FINT SHJ02010
POUT = POUT*12.0 SHJ02020
C WRITE(6,7000)POUT SHJ02030
C CALCULATE R.O.I. UNDISCOUNTED SHJ02040
ROI = DOLR(IX)/(0.0-DOLR(1)) SHJ02050
C CASH POSITION AND MAXIMUM CASH OUTLAY CONVERSION TO DOLLARS FROM MS SHJ02060
CAP = DOLR(IX)*1000.0 SHJ02070
COM = (0.0-DOLR(1))*1000.0 SHJ02080
C WRITE OUTPUT SHJ02090
WRITE(6,10) SHJ02100
WRITE(6,10) SHJ02110
WRITE(6,10) SHJ02120
WRITE(6,10) SHJ02130
WRITE(6,201) SHJ02140
201 FORMAT(20X,'ECONOMICS :',/,20X,11('*'),/) SHJ02150
202 FORMAT(9X,'PAYOUT =',7X,F15.2,'MONTHS',/, SHJ02160
110X,'R.O.I. =',5X,F15.0,/, SHJ02170
210X,'P.I. =',5X,F15.2,/, SHJ02180
310X,'CASH POSITION =',2X,'$',2X,F15.0,/, SHJ02190
410X,'MAX.CASH OUTLAY =',2X,'$',2X,F15.0,/,10X,43('*'),//) SHJ02200
214 FORMAT(10X,'DISCOUNT RATE',10X,'PRESENT WORTH',/,11X,36('*') SHJ02210
1,//) SHJ02220
215 FORMAT(10X,F12.4,10X,F12.0,/) SHJ02230
203 FORMAT(10X,'RESERVES :',/,11X,8('*'),/) SHJ02240
204 FORMAT(9X,'WELL LIFE =',6X,I3,5X,'YEARS',/, SHJ02250
110X,'CUM. OIL PRODUCED =',F12.0,2X,'MBBLS',/, SHJ02260
210X,'CUM. GAS PRODUCED =',F12.0,2X,'MMCF',/,10X,38('*'),/) SHJ02270
207 FORMAT(20X,'CASH FLOW TABLE, THOUSAND DOLLARS',/,21X,33('*') SHJ02280
1,//) SHJ02290
208 FORMAT(1X,'YEAR',3X,'OIL PRODUCTION',2X,'OIL RATE',2X, SHJ02300
1'GAS PRODUCTION',2X,'GAS RATE',3X,'OIL PRICE',2X,'GAS PRICE', SHJ02310
25X,'TOTAL REVENUE',/,13X,'MBO',10X,'STB/D',8X,'MMCF',9X,'MCF/D' SHJ02320
3,7X,'$/BO',5X,'$/MCF',/,1X,100('*'),//) SHJ02330
211 FORMAT(1X,'YEAR',8X,'WELL COSTS',2X,'OTHER COSTS',5X, SHJ02340
1'OPERATING COSTS',2X,'OVERHEAD COSTS',2X,'CASH FLOW',2X, SHJ02350
2'CUMULATIVE',/,87X,'CASH FLOW',/,1X,100('*'),//) SHJ02360
212 FORMAT(1X,'TIME0',7X,F10.0,3X,F10.0,7X,F10.0,6X,F10.0,2X, SHJ02370
1F10.0,2X,F10.0,/) SHJ02380
29 FORMAT(1X,I4,8X,F10.0,3X,F10.0,7X,F10.0,6X,F10.0,2X,F10.0, SHJ02390
22X,F10.0,/) SHJ02400
209 FORMAT(1X,I4,5X,F12.0,2X,F8.0,5X,F10.0,2X,F8.0,3X,F8.0, SHJ02410
13X,F8.0,5X,F12.0,/) SHJ02420
WRITE(6,202)POUT,ROI,PI,CAP,COM SHJ02430
WRITE(6,214) SHJ02440
DO 41 MN = 2,12 SHJ02450
WRITE(6,215)DRATE(MN),PW(MN) SHJ02460
41 CONTINUE SHJ02470
WRITE(6,10) SHJ02480
WRITE(6,10) SHJ02490
WRITE(6,203) SHJ02500
WRITE(6,10) SHJ02510
WRITE(6,204) IX,SUMOIL,SUMGAS SHJ02520
WRITE(6,10) SHJ02530
WRITE(6,10) SHJ02540
WRITE(6,10) SHJ02550
WRITE(6,10) SHJ02560
WRITE(6,207) SHJ02570
WRITE(6,10) SHJ02580
WRITE(6,10) SHJ02590
WRITE(6,208) SHJ02600
WRITE(6,10) SHJ02610
DO 30 K = 2,IX SHJ02620
WRITE(6,209)NY(K),YOIL(K),QOIL(K),YGAS(K),QGAS(K),OPRICE(K), SHJ02630
1GPRICE(K),YREV(K) SHJ02640
30 CONTINUE SHJ02650
WRITE(6,210) SUMOIL,SUMGAS,SUMREV SHJ02660
210 FORMAT(2X,100('-'),/,'TOTAL',5X,F12.0,15X,F10.0,37X,F12.0) SHJ02670
WRITE(6,10) SHJ02680
WRITE(6,10) SHJ02690
WRITE(6,211) SHJ02700
WRITE(6,212)WC,OC,OPCONE,OH,CFL(1),DOLR(1) SHJ02710
DO 40 M = 2,IX SHJ02720
WRITE(6,29)NY(M),WIN(M),OIN(M),OPCO(M),OVCO(M),CFL(M),DOLR(M) SHJ02730
40 CONTINUE SHJ02740
WRITE(6,213)SUMLTW,SUMLTO,SUMOPC,SUMOVC,DOLR(IX) SHJ02750
213 FORMAT(2X,100('-'),/,'TOTAL',8X,F10.0,3X,F10.0,7X,F10.0,6X, SHJ02760
*F10.0,2X,F10.0,/) SHJ02770
702 FORMAT(2X,100('-'),//) SHJ02780
999 CONTINUE SHJ02790
WRITE(6,10) SHJ02800
WRITE(6,10) SHJ02810
STOP SHJ02820
END SHJ02830
SUBROUTINE TLUP SHJ02840
COMMON/I1/PRESX(50),BY(50),XX,N,FINT SHJ02850
C THE FOLLOWING FUNCTION PERFORMS LINEAR INTERPOLATION SHJ02860
C ---------------------------------------------------- SHJ02870
IF(XX.GT.PRESX(1)) GO TO 1 SHJ02880
FINT = (BY(1)/PRESX(1))*XX SHJ02890
GO TO 22 SHJ02900
1 CONTINUE SHJ02910
DO 21 K = 2,N SHJ02920
IF(XX-PRESX(K))11,11,21 SHJ02930
11 SLOPE = (BY(K)-BY(K-1))/(PRESX(K)-PRESX(K-1)) SHJ02940
B = BY(K)-SLOPE*PRESX(K) SHJ02950
FINT = SLOPE*XX + B SHJ02960
GO TO 22 SHJ02970
21 CONTINUE SHJ02980
22 CONTINUE SHJ02990
RETURN SHJ03000
END SHJ03010