-
Notifications
You must be signed in to change notification settings - Fork 2
/
PEP
1871 lines (1870 loc) · 61.1 KB
/
PEP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
***********************************************************************
* CATEGORY.: ROCKET CALCULATIONS
* GROUP....: FORTRAN PROGRAMS
* AUTHOR...: LANCE HAYNIE <LANCE@HAYNIEMAIL.COM>
* DATE.....: 2017-09-14
* PURPOSE..: PROPELLANT EVALUATION PROGRAM
************************************************************************
* NOTES
* UPDATED FOR Z/OS FROM ORIGINAL VERSION OF NEWPEP PROVIDED BY NSWC
* PREVIOUS VERSION UPDATED BY MARTIN MARIETTA, ORLANDO ON 5/89
* ORIGINAL COMPILER IBM PROFESSIONAL FORTRAN VERSION 1.0 (1984)
* UPDATED COMPILER VS FORTRAN VERSION 2 RELEASE 6
* HAYNIE RESEARCH AND DEVELOPMENT NOR ANY OF ITS EMPLOYEES WARRANT OR
* SUPPORT THIS PROGRAM IN ANY WAY
************************************************************************
* MODIFICATIONS
* 2017-09-14 - LHAYNIE - INITIAL VERSION
************************************************************************
*PROPELLANT EVALUATION PROGRAM FOR Z/OS
*COPYRIGHT (C) 2017 HAYNIE RESEARCH & DEVELOPMENT
*
*THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
*IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
*THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
*(AT YOUR OPTION) ANY LATER VERSION.
*
*THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
*BUT WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF
*MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE
*GNU GENERAL PUBLIC LICENSE FOR MORE DETAILS.
*
*YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE ALONG
*WITH THIS PROGRAM; IF NOT, WRITE TO THE FREE SOFTWARE FOUNDATION, INC.,
*51 FRANKLIN STREET, FIFTH FLOOR, BOSTON, MA 02110-1301 USA
*
PROGRAM PEP
COMMON A(12,12), KR(20), AMAT(10,12), JAT(12), IN, IS,
1FIE(10,6), IE(10,6), ALP(12), W27, N, DH(10), RHO(10),
2WATE(10), W1(6), W43, IG, NP, VNT(401), W47, NAME, SER
3,FLOOR,ITAG(100),WING(10)
COMMON/CHARA/BLOK,JE,ASPEC,SPECIE
CHARACTER*30 BLOK(10),PROFL1,PROFL2
CHARACTER*2 JE(10,6), ASPEC(12)
CHARACTER*8 SPECIE(400)
COMMON /IBRIUM/ TL(400,2), TU(400,2), W3(400), VNU(400,12), QA,
1TAU, H(400), SD(400), Y(400), JC, IR(400,2), DMU(400), VLNK(400),
2IOJ(12), RA(400,2), RB(400,2), RC(400,2), RD(400,2), RE(400,2),
3RF(400,2), CH(400,2), JM, W48, CP, FN, C(12,400), LL(400)
COMMON/MOON/TSTEST,TE,IRUN,IOUNIT,IEND
COMMON /FJB/ IO6
COMMON /FI/ SYS,PEPFIL,JANFIL,OUTFIL
CHARACTER*2 SYS,JUNK
CHARACTER*40 PEPFIL,JANFIL,OUTFIL,JUNKFIL
C OPEN DATA INPUT FILES
OPEN (10,FILE='SETUP')
READ (10,1001) SYS
READ (10,1002) PEPFIL
READ (10,1002) JUNKFIL
READ (10,1002) JANFIL
READ (10,1002) OUTFIL
1001 FORMAT (A2)
1002 FORMAT (A40)
CALL OPENFL
IRUN = 0
TCH = 3000.
8 TE= AMAX1(TCH, 500.0)
TSTEST = 0.
TE = AMIN1(TE,6000.)
CALL PUT IN (LE)
C THE NEXT STATEMENT DELETES CALCULATION WHEN INPUT ERRORS ARE FOUND.
IF (LE .EQ. 1) GOTO 9999
PR = W1(5)
IF (KR(19) .EQ. 1) GO TO 15
CALL GUESS (TE,PR)
15 IF (KR(7) .EQ. 0) GO TO 14
TE = W1(6)
VNT(NP) = ALOG(.08205*W1(6)/W1(5))
CALL EQUIL (TE, PR, HE, SE, 1)
PR = FN*VNT(NP)
SYSENT = SE
GO TO 114
14 CALL H BAL (TE, PR, SYSENT, 1)
TCH = TE
HE = W1(4)
CHN = FN
114 CALL OUT (PR,TE,HE,SYSENT,1)
IF (KR(1) .EQ. 1) GO TO 9998
IF (W1(5) .GE. W1(6)) GO TO 125
WRITE ( 6,3)
3 FORMAT (/' WHY IS THE EXIT PRESSURE .GE. THE CHAMBER PRESSURE.')
GO TO 8
125 CALL DESIGN (TE, PR, HE, SYSENT, 0, 1)
PR = W1(6)
CALL S BAL (TE, PR, HE, SYSENT, TCH, 0)
IF (KR(11) .EQ. 0) GO TO 999
WRITE(6,998)W27,(KR(I),I=1,20)
998 FORMAT(G14.4,20I2)
CALL OUT (PR,TE,HE,SYSENT,2)
999 CALL DESIGN (TE, PR, HE, SYSENT, 0, 2)
TE = .5*(TCH+TE)
CALL S BAL (TE, PR, HE, SYSENT, TCH, 1)
CALL OUT (PR,TE,HE,SYSENT,2)
FLOOR=W27*1.E-7
CALL DESIGN (TE, PR, HE, SYSENT, 1, 2)
IF (KR(3) .EQ. 0) CALL DESNOZ
9998 IF(IEND.EQ.0)GOTO 9999
GO TO 8
9999 CONTINUE
STOP
END
BLOCK DATA
COMMON /LLIST/ ATWT(100)
DATA ATWT / 1.008, 4.003, 6.94, 9.013, 10.82, 12.011,
1 14.008, 16., 19., 20.183, 22.991, 24.32, 26.98, 28.09, 30.975,
2 32.066,35.457, 39.944, 39.1, 40.08, 44.96, 47.9, 50.95, 52.01,
4 54.94, 55.85, 58.94, 58.71, 63.54, 65.38, 69.72, 72.6, 74.92,
5 78.96,79.916, 83.80, 85.48, 87.63, 88.91, 91.22, 92.91, 95.95,
6 99.,101.1, 102.91, 106.4, 107.88, 112.41, 114.82, 118.7, 121.76,
7 127.61, 126.91, 131.3, 132.91, 137.36, 138.92, 140.13, 140.91,
8 144.27,147., 150.35, 152., 157.26, 158.93, 162.51,164.94,167.27,
9 168.94,173.04, 174.99, 178.50, 180.95, 183.86, 186.22, 190.2,
1 192.2,195.09, 197., 220.61, 204.39, 207.21, 208.99, 210., 210.,
2 222.,2.014,226.,92.906,232.,231.,238.,237.,237.,12.011,9.013,
3 10.82,24.32,26.98, 253. /
END
SUBROUTINE ADJUST
COMMENT. ADJUSTS GRAM ATOM BALANCE ERRORS BY MODIFYING THE BASIS.
CALLED BY DEFIOJ
COMMON A(12,12), KR(20), AMAT(10,12), JAT(12), IN, IS,
1FIE(10,6), IE(10,6), ALP(12), W27, N, DH(10), RHO(10),
2WATE(10), W1(6), W43, IG, NP, VNT(401), W47, NAME, SER
3,FLOOR,ITAG(100),WING(10)
COMMON/CHARA/BLOK,JE,ASPEC,SPECIE
CHARACTER*30 BLOK(10)
CHARACTER*2 JE(10,6), ASPEC(12)
CHARACTER*8 SPECIE(400)
COMMON /IBRIUM/ TL(400,2), TU(400,2), W3(400), VNU(400,12), QA,
1TAU, H(400), SD(400), Y(400), JC, IR(400,2), DMU(400), VLNK(400),
2IOJ(12), RA(400,2), RB(400,2), RC(400,2), RD(400,2), RE(400,2),
3RF(400,2), CH(400,2), JM, W48, CP, FN, C(12,400), LL(400)
COMMON /FJB/ IO6
DIMENSION EP(12), X(12)
DO 1 I = 1,IS
EP(I) = ALP(I)
DO 1 J = 1,N
1 EP(I) = EP(I) - C(I,J)*VNT(J)
DO 2 K = 1,IS
X(K) = 0.
DO 2 I = 1,IS
2 X(K) = X(K) + A(I,K)*EP(I)
DO 3 K = 1,IS
J = IOJ(K)
3 VNT(J) = VNT(J) + X(K)
77 FORMAT (1P 12E10.2)
IF (KR(16) .EQ. 0) GO TO 99
WRITE (IO6,77) (ALP(J), J = 1,IS)
WRITE (IO6,77) ( EP(J), J = 1,IS)
WRITE (IO6,77) (X(J) , J = 1,IS)
99 RETURN
END
SUBROUTINE BOOST(W43,SSI)
COMMENT. COMPUTES DRAG FREE BOOST VELOCITIES FROM IMPULSE AND DENSITY.
C IF NOT DESIRED, DELETE THE CALL IN SUBROUTINE DESIGN.
DIMENSION W42(20), W44(20)
COMMON /FJB/ IO6
DATA JM/18 /
DATA W42 / 5.,10.,15.,25.,30.,55.,60.,69.,71.,88.,
1 100.,150.,175.,200.,300.,1000.,3000.,5000.,5000.,5000. /
227 FORMAT(/6(F5.0,'/',F6.0)/6(F5.0,'/',F6.0)/6(F6.0,'/',F5.0))
230 FORMAT(//'BOOST VELOCITIES FOR PROPELLANT DENSITY OF ',F8.5,
1' (S.G. OF ',F8.3, ')')
W48 = 1728.*W43
VQ = W43/.036128
VI = SSI*32.174
DO 127 J = 1, JM
127 W44(J) = VI*ALOG(1.0+ W48/ W42(J))
WRITE (IO6,230) W43, VQ
WRITE (IO6,227)(W42(J), W44(J), J=1,JM)
RETURN
END
SUBROUTINE DEFIOJ
C COMPUTES SERIAL NUMBER FOR AN OPTIMUM BASIS A LA HN BROWNE JR.
COMMON A(12,12), KR(20), AMAT(10,12), JAT(12), IN, IS,
1FIE(10,6), IE(10,6), ALP(12), W27, N, DH(10), RHO(10),
2WATE(10), W1(6), W43, IG, NP, VNT(401), W47, NAME, SER
3,FLOOR,ITAG(100),WING(10)
COMMON/CHARA/BLOK,JE,ASPEC,SPECIE
CHARACTER*30 BLOK(10)
CHARACTER*2 JE(10,6), ASPEC(12)
CHARACTER*8 SPECIE(400)
COMMON /IBRIUM/ TL(400,2), TU(400,2), W3(400), VNU(400,12), QA,
1TAU, H(400), SD(400), Y(400), JC, IR(400,2), DMU(400), VLNK(400),
2IOJ(12), RA(400,2), RB(400,2), RC(400,2), RD(400,2), RE(400,2),
3RF(400,2), CH(400,2), JM, W48, CP, FN, C(12,400), LL(400)
COMMON /FJB/ IO6
CALL SLITET(1,K000FX)
GO TO(7,11),K000FX
7 CALL SLITE (1)
CALL RANK(IR,W3,N)
DO 1 I = 1,N
1 LL(I) = 9
IF = 0
DO 6 I = 1,IS
3 IF = IF + 1
IF (IF-N) 9,9,8
8 WRITE (IO6,10)
10 FORMAT (17H0CANT FIND BASIS )
STOP
9 DO 4 J = 1,IS
K = IR(IF,1)
4 A(J,I) = C(J,K)
CALL LINDEP(I)
CALL SLITET(2,K000FX)
GO TO (66,3), K000FX
66 LL(K) = 0
6 IOJ(I) = K
CALL ADJUST
11 RETURN
END
SUBROUTINE EQUIL(TE,PR,HE,ENTR,IX)
COMMON A(12,12), KR(20), AMAT(10,12), JAT(12), IN, IS,
1FIE(10,6), IE(10,6), ALP(12), W27, N, DH(10), RHO(10),
2WATE(10), W1(6), W43, IG, NP, VNT(401), W47, NAME, SER
3,FLOOR,ITAG(100),WING(10)
COMMON/CHARA/BLOK,JE,ASPEC,SPECIE
COMMON /FJB/ IO6
CHARACTER*30 BLOK(10)
CHARACTER*2 JE(10,6), ASPEC(12)
C. THIS ROUTINE COMPUTES CHEMICAL EQUILIBRIUM FOR A PRESSURE,
C TEMPERATURE POINT. OTHER OUTPUTS ARE ENTHALPY AND ENTROPY. HEAT
C (CP) AND MOLES OF GAS ARE AVAILABLE THRU COMMON.
C THIS ROUTINE IS CALLED BY PEP, HBAL, SBAL, AND TSBAL.
C UNITS ARE TE (DEG. K.) PR (ATM.) HE (CAL/SYS WT.) ENTR (CAL/D
C /SYS. WT.) SYSTEM WEIGHT IS W27 IN COMMON.
C. IX IS 0 FOR FROZEN EVALUATION OF THERMODYNAMIC VARIABLES.
C IX IS 1 FOR EQULIBRIUM EVALUATIONS (IX = 2 FOR KINETIC IN SOME VER
C. IN ADDITION TO PRESSURE TEMPERATURE POINTS THIS ROUTINE MAY BE
C FREELY FOR VOLUME TEMPERATURE POINTS BY USING THE FOLLOWING MODIFIE
C CALL SEQUENCE. VNT(NP)=ALOG(.08205*TE/V)) KR(17) = 1 CALL EQU
C (TE, PR, HE, ENTR, IX) KR(17) = 0 PR=FN*VNT(NP)
C V IS THE SYSTEM VOLUME IN LITERS/SYS. WT.
CHARACTER*8 SPECIE(400)
COMMON /IBRIUM/ TL(400,2), TU(400,2), W3(400), VNU(400,12), QA,
1TAU, H(400), SD(400), Y(400), JC, IR(400,2), DMU(400), VLNK(400),
2IOJ(12), RA(400,2), RB(400,2), RC(400,2), RD(400,2), RE(400,2),
3RF(400,2), CH(400,2), JM, W48, CP, FN, C(12,400), LL(400)
COMMON/MOON/TSTEST,TEEE,IJUNK(3)
DIMENSION X(12), XM(12)
8 FORMAT (I5,F10.0, F12.3)
9 FORMAT (1P 10E13.4)
1734 CALL GIBBS(TE)
CALL FIXBAS
1735 IF (IX - 1) 21,12,12
12 DO 38 J = 1,IS
X(J) = 0.
XM(J) = 0.
DO 31 I = 1,N
IF (C(J,I) .EQ. 0.) GO TO 31
XM(J) = AMAX1(VNT(I), XM(J))
X(J) = X(J) + C(J,I)*VNT(I)
31 CONTINUE
IF (ABS(ALP(J) - X(J))/XM(J) .LT. .00001) GO TO 38
CALL SLITE(1)
GO TO 39
38 CONTINUE
39 CALL DEFIOJ
CALL REACT (TE)
DO 211 I = 1,N
211 W3(I) = 50.0 -VLNK(I)
CALL RANK(IR,W3,N)
11 DO 22 JC = 1,20
CALL TWITCH(PR,0)
CALL SLITET(4,K000FX)
GO TO(146,17),K000FX
146 IF (KR(13)-1) 15,14,15
14 WRITE (IO6,8)JC,TE,PR
WRITE (IO6,9)(VNT(I), I = 1,N)
15 DO 23 ICC = 1,3
25 CALL TWITCH(PR,1)
CALL SLITET(4,K000FX)
GO TO(23,22),K000FX
23 CONTINUE
22 CONTINUE
CALL SLITE (3)
21 FNN=AMAX1(FN,FLOOR)
VNT(NP) = ALOG(PR/FNN)
17 CALL THERMO (TE, HE, ENTR)
VNT(NP) = EXP(VNT(NP))
TET = TE
RETURN
END
SUBROUTINE FIXBAS
COMMON A(12,12), KR(20), AMAT(10,12), JAT(12), IN, IS,
1FIE(10,6), IE(10,6), ALP(12), W27, N, DH(10), RHO(10),
2WATE(10), W1(6), W43, IG, NP, VNT(401), W47, NAME, SER
3,FLOOR,ITAG(100),WING(10)
COMMON/CHARA/BLOK,JE,ASPEC,SPECIE
CHARACTER*30 BLOK(10)
CHARACTER*2 JE(10,6), ASPEC(12)
CHARACTER*8 SPECIE(400)
COMMON /IBRIUM/ TL(400,2), TU(400,2), W3(400), VNU(400,12), QA,
1TAU, H(400), SD(400), Y(400), JC, IR(400,2), DMU(400), VLNK(400),
2IOJ(12), RA(400,2), RB(400,2), RC(400,2), RD(400,2), RE(400,2),
3RF(400,2), CH(400,2), JM, W48, CP, FN, C(12,400), LL(400)
IF (IG .EQ. N) GO TO 99
IGP = IG+1
DO 9 J = 1,IS
II = IOJ(J)
IF (DMU(II) .LT. .9E+12) GO TO 9
DO 8 I = IGP,N
IQ = 99
IF (VNU(I,J) .EQ. 0.) GO TO 8
IQ = 88
IF (DMU(I) .GE. .9E+12) GO TO 8
DO 7 K = 1,IS
IF (K .EQ. J) GO TO 7
IQ = K
IF (VNU(I,K) .NE. 0.) GO TO 8
7 CONTINUE
VA = VNT(II)
VNT(II) = VNT(I)
VNT(I) = VA
IOJ(J) = I
LL(I) = 0
LL(II) = 9
GO TO 9
8 CONTINUE
9 CONTINUE
99 RETURN
END
SUBROUTINE GUESS(TE,PR)
COMMENT. THIS ROUTINE COMES UP WITH A CRUDE COMPOSITION GUESS BUT IT S
C TO GET CALCUATIONS OFF TO A FASTER START.
COMMON A(12,12), KR(20), AMAT(10,12), JAT(12), IN, IS,
1FIE(10,6), IE(10,6), ALP(12), W27, N, DH(10), RHO(10),
2WATE(10), W1(6), W43, IG, NP, VNT(401), W47, NAME, SER
3,FLOOR,ITAG(100),WING(10)
COMMON/CHARA/BLOK,JE,ASPEC,SPECIE
CHARACTER*30 BLOK(10)
CHARACTER*2 JE(10,6), ASPEC(12)
CHARACTER*8 SPECIE(400)
COMMON /IBRIUM/ TL(400,2), TU(400,2), W3(400), VNU(400,12), QA,
1TAU, H(400), SD(400), Y(400), JC, IR(400,2), DMU(400), VLNK(400),
2IOJ(12), RA(400,2), RB(400,2), RC(400,2), RD(400,2), RE(400,2),
3RF(400,2), CH(400,2), JM, W48, CP, FN, C(12,400), LL(400)
FLOOR=W27/10.**(8+KR(5))
DO 89 J = 1,N
VA = 0.0
DO 88 I = 1,IS
88 VA = VA + SQRT(ABS(C(I,J)))
89 W3(J) = 10.0-VA
CALL SLITE (1)
CALL GIBBS (TE)
DO 14 I = 1,N
14 VNT(I) = 0.0
CALL DEFIOJ
771 CALL REACT(TE)
DO 1 I = 1,N
1 VLNK(I) = -VLNK(I)
CALL RANK(IR,VLNK,N)
DO 3 I = 1,N
J = IR(I,1)
IF (LL(J) .LE. 0) GO TO 3
IF (DMU(J) .GE. .9E+12) GO TO 3
CALL SETUP(Y,XMIN,XMAX,J)
XMIN = .50*XMAX
VNT(J) = XMIN + VNT(J)
DO 4 L = 1,IS
K = IOJ(L)
IF (K .EQ. 0) GO TO 4
VNT(K) = VNT(K) - VNU(J,L)*XMIN
4 CONTINUE
3 CONTINUE
CALL SLITE (0)
CALL SLITE (1)
DO 7 I = 1,N
7 W3(I) = VNT(I)
RETURN
END
SUBROUTINE H BAL (TE,PR, ENTR, LL)
COMMENT. THIS ROUTINE COMPUTES A PRESSURE ENTHALPY POINT.
C INPUT ENTHALPY IS W1(4) IN COMMON. IX WORKS THE SAME AS FOR EQUIL (WH
C A VOLUME INPUT INSTEAD OF PRESSUR WORKS THE SAME WAY AS FOR EQUIL A
COMMON A(12,12), KR(20), AMAT(10,12), JAT(12), IN, IS,
1FIE(10,6), IE(10,6), ALP(12), W27, N, DH(10), RHO(10),
2WATE(10), W1(6), W43, IG, NP, VNT(401), W47, NAME, SER
3,FLOOR,ITAG(100),WING(10)
COMMON/CHARA/BLOK,JE,ASPEC,SPECIE
CHARACTER*30 BLOK(10)
CHARACTER*2 JE(10,6), ASPEC(12)
CHARACTER*8 SPECIE(400)
COMMON /IBRIUM/ TL(400,2), TU(400,2), W3(400), VNU(400,12), QA,
1TAU, H(400), SD(400), Y(400), JC, IR(400,2), DMU(400), VLNK(400),
2IOJ(12), RA(400,2), RB(400,2), RC(400,2), RD(400,2), RE(400,2),
3RF(400,2), CH(400,2), JM, W48, CP, FN, C(12,400),JUNK(400)
COMMON/SCRATC /HN(400,2),RJ(200)
COMMON /OPT/Y1(10),NI,XISP,XRHO,XISPEX,IFLGEX,EXPAN,PRESEX
COMMON /FJB/ IO6
236 FORMAT (' *****NO TEMPERATURE CONVERGENCE-DONT TRUST RESULTS!')
FTU = 6000.0
FTL=75.
CALL EQUIL (TE,PR,HE,ENTR,LL)
LIM = 20
DO 11 I = 1,LIM
CALL SLITET(3,K000FX)
GO TO(111,200),K000FX
200 IF (HE - W1(4)) 201,14,202
201 FTL = TE
FLP = VNT(NP)
HLP = HE
DO 70 L = 1,N
70 HN(L,1) = VNT(L)
GO TO 111
202 FTU = TE
FUP = VNT(NP)
HUP = HE
DO 71 L = 1,N
71 HN(L,2) = VNT(L)
111 K = I
CF= AMAX1(1.0,CF)
CF = AMIN1(16.0, CF)
DT = (W1(4) - HE)/(CF*CP)
DT= AMIN1(DT, .5*(FTU-TE))
DT= AMAX1(DT, .5*(FTL-TE))
TE = TE + DT
HOLD = HE
IF (FTU-FTL .LT. 2.) GO TO 21
IF (ABS(DT) .LT. .1) GO TO 14
CALL EQUIL (TE,PR,HE,ENTR,LL)
11 CF = (HE - HOLD)/(CP*DT)
WRITE (IO6,236)
IF (NI.NE.0)WRITE (3,236)
21 VA = (HUP-W1(4))/(HUP-HLP)
VB = (W1(4)-HLP)/(HUP-HLP)
CP = 0.
DO 22 L = 1,N
CP = CP + VNT(L)*Y(L)
IF (LL .NE. 1) GO TO 14
22 VNT(L) = VA*HN(L,1) + VB*HN(L,2)
14 ENTR = ENTR + (W1(4) - HE)/TE
RETURN
END
FUNCTION IPHASE(L)
COMMENT THIS ROUTINE DETERMINES WHAT CONDENSED PHASES ARE PRESENT.
COMMON A(12,12), KR(20), AMAT(10,12), JAT(12), IN, IS,
1FIE(10,6), IE(10,6), ALP(12), W27, N, DH(10), RHO(10),
2WATE(10), W1(6), W43, IG, NP, VNT(401), W47, NAME, SER
3,FLOOR,ITAG(100),WING(10)
COMMON/CHARA/BLOK,JE,ASPEC,SPECIE
CHARACTER*8 SPECIE(400)
CHARACTER*30 BLOK(10)
CHARACTER*2 JE(10,6), ASPEC(12)
IPHASE = 0
IF (IG .EQ. N) GO TO 99
INC = 1
IGP = IG+1
DO 12 I = IGP,N
IF (VNT(I) .LE. FLOOR) GO TO 12
IPHASE = IPHASE + INC
C 12 INC = INC + INC
12 INC = INC + 1
99 RETURN
END
SUBROUTINE LINDEP (I)
COMMENT. THIS ROUTINE ESTABLISHES LINEAR DEPENDENCE BY THE GRAM SCHMIDT-
C TION AND THEN INVERTS THE A MATRIX BY THE METHOD OF CONJUGATE GRADIE
COMMON A(12,12), KR(20), AMAT(10,12), JAT(12), IN, IS,
1FIE(10,6), IE(10,6), ALP(12), W27, N, DH(10), RHO(10),
2WATE(10), W1(6), W43, IG, NP, VNT(401), W47, NAME, SER
3,FLOOR,ITAG(100),WING(10)
COMMON/CHARA/BLOK,JE,ASPEC,SPECIE
CHARACTER*8 SPECIE(400)
CHARACTER*30 BLOK(10)
CHARACTER*2 JE(10,6), ASPEC(12)
DIMENSION SS(12), D(12,12)
D(I,I) = 1.
IF (I .GT. IS) GO TO 887
IF (I .EQ. 1) GO TO 8
IM = I -1
DO 7 J = 1,IM
D(J,I) = 0.
R = 0.0
DO 2 K = 1,IS
IF (A(K,I) .EQ. 0.) GO TO 2
IF (A(K,J) .EQ. 0.) GO TO 2
R = R + A(K,J)*A(K,I)
2 CONTINUE
IF (R .EQ. 0.) GO TO 7
Q = R/SS(J)
VA = 0.
DO 3 K = 1,IS
A(K,I) = A(K,I) - Q*A(K,J)
IF (A(K,I) .EQ. 0.) GO TO 3
VA = VA + ABS(A(K,I))
3 CONTINUE
IF (VA .LT. .1) GO TO 6
DO 17 K = 1,J
17 D(K,I) = D(K,I) - Q*D(K,J)
7 CONTINUE
8 SS(I) = 0.
DO 4 J = 1,IS
4 SS(I) = SS(I) + A(J,I)**2
CALL SLITE (2)
IF (I .LT. IS) GO TO 6
887 DO 13 J = 1,IS
DO 13 K = 1,IS
VA = 0.
DO 12 L = J,IS
12 VA = VA + D(J,L)*A(K,L)/SS(L)
13 A(K,J) = VA
871 FORMAT (7F18.6)
6 RETURN
END
SUBROUTINE ONED (HSTAG,TZ,PZ,HZ,VZ,TO,PO,HO,VO,PS,AS,GT,GC,GV,LL
.)
COMMENT. CONTINUITY EQUATION FOR 1 DIMENSIONAL FLOW FOR ADIABATIC (19)
C OR ISOTHERMAL (20) MODELS.
COMMON A(12,12),KR(20),RJUNK(644),JUNK(178)
COMMON /FJB/ IO6
IF (KR(11) .NE. 0) WRITE (IO6,1122)PZ,PO
IF (KR(11) .NE. 0) WRITE (IO6,1128) HZ,HO
1128 FORMAT (' HX,HO',2E14.4)
IF (KR(11) .NE. 0) WRITE (IO6,1124)TZ,TO
1124 FORMAT(' TZ,TO',2E14.4)
IF (KR(11) .NE. 0) WRITE (IO6,1123)VZ,VO
1122 FORMAT (' PX,PO',2E14.4)
1123 FORMAT(' VZ,VO',2E14.4)
GT = ALOG(TO/TZ)/ALOG(PZ/PO)
GV = ALOG(PO/PZ)/ALOG(VZ/VO)
IF (KR(11) .NE. 0) WRITE (IO6,1125)GV,GT
1125 FORMAT (' GV,GT',2E14.4)
LL = 1
IF (ABS(TZ-TO) .GT. 3.) GO TO 19
LL = 2
GC = (HO-HZ)/ALOG(PO/PZ)
IF (KR(11) .NE. 0) WRITE (IO6,1127) GC,HSTAG
1127 FORMAT (' GC,HSTAG',2E14.4)
PSTAR = PZ*EXP(-GV/2. + (HSTAG-HZ)/GC)
HSTAR = HZ + GC*ALOG(PSTAR/PZ)
IF (KR(11) .NE. 0) WRITE (IO6,1129)PSTAR,HSTAR
1129 FORMAT (' PSTAR,HSTAR', 2E14.4)
VSTAR = VZ*(PZ/PSTAR)**(1./GV)
GO TO 20
19 GC = (HO-HZ)/(PO*VO - PZ*VZ)
PSTAG = PZ*(1. +(HSTAG - HZ)/GC/PZ/VZ)**(GV/(GV-1.))
PSTAR = PSTAG*(2./(GV+1.))**(GV/(GV-1.))
VSTAR = VZ*(PZ/PSTAR)**(1./GV)
HSTAR = HZ + GC*(PSTAR*VSTAR - PZ*VZ)
20 QUAD=AMAX1((HSTAG-HSTAR),1.0E-10)
C 20 AS = VSTAR/SQRT(HSTAG-HSTAR)
AS = VSTAR/SQRT(QUAD)
PS = PSTAR
RETURN
END
SUBROUTINE RANK(IR,Y,N)
COMMENT. RANKS VECTOR Y IN DESCENDING ORDER, RANKINGS APPEAR IN IR(I,1)
DIMENSION X(400), Y(400), IR(400,2)
DO 1 I = 1,N
IR(I,2) = IR(I,1)
1 X(I) = AMAX1(Y(I), .0)
DO 4 I = 1,N
S = -1.0
DO 3 J = 1,N
IF (S - X(J)) 2,3,3
2 IR(I,1) = J
S = X(J)
3 CONTINUE
J = IR(I,1)
4 X(J) = -1.0
RETURN
END
SUBROUTINE REACT(TE)
COMMENT. THIS ROUTINE COMPUTES THE STOICHIOMETRIC COEFFICIENTS AND LOG E
C UM CONSTANTS FOR ALL REACTIONS IN TERMS OF THE CURRENT BASIS.
COMMON A(12,12), KR(20), AMAT(10,12), JAT(12), IN, IS,
1FIE(10,6), IE(10,6), ALP(12), W27, N, DH(10), RHO(10),
2WATE(10), W1(6), W43, IG, NP, VNT(401), W47, NAME, SER
3,FLOOR,ITAG(100),WING(10)
COMMON/CHARA/BLOK,JE,ASPEC,SPECIE
CHARACTER*30 BLOK(10)
CHARACTER*2 JE(10,6), ASPEC(12)
CHARACTER*8 SPECIE(400)
COMMON /IBRIUM/ TL(400,2), TU(400,2), W3(400), VNU(400,12), QA,
1TAU, H(400), SD(400), Y(400), JC, IR(400,2), DMU(400), VLNK(400),
2IOJ(12), RA(400,2), RB(400,2), RC(400,2), RD(400,2), RE(400,2),
3RF(400,2), CH(400,2), JM, W48, CP, FN, C(12,400), LL(400)
COMMON /FJB/ IO6
CALL SLITET(1,K000FX)
GO TO(21,31),K000FX
21 DO 11 K = 1,IS
DO 11 J = 1,N
VNU(J,K) = 0.0
DO 1 I = 1,IS
1 VNU(J,K) = VNU(J,K) + A(I,K)*C(I,J)
IF (ABS(VNU(J,K)) - .0051) 10,10,11
10 VNU(J,K) = 0.0
11 CONTINUE
31 VA = 1./1.9871/TE
DO 3 I = 1,N
VB = 0.0
DO 2 LS = 1,IS
IF (VNU(I,LS)) 17,2,17
17 J = IOJ(LS)
VB = VB + VNU(I,LS)*DMU(J)
2 CONTINUE
VLNK(I) = VA*(DMU(I) - VB)
3 CONTINUE
IF (KR(14) -1) 7,4,7
4 WRITE (IO6,5)
WRITE (IO6,6)(VLNK(I), I = 1,N)
WRITE (IO6,8)(IOJ(I), I = 1,IS)
8 FORMAT (10(5X,I7))
5 FORMAT (22H0LOGS OF EQUIL CONST,S)
6 FORMAT (' ',1PE11.4, 9E12.4)
7 RETURN
END
SUBROUTINE S BAL (TE, PR, HE, SYSENT, TCH, LL)
COMMON A(12,12), KR(20), AMAT(10,12), JAT(12), IN, IS,
1FIE(10,6), IE(10,6), ALP(12), W27, N, DH(10), RHO(10),
2WATE(10), W1(6), W43, IG, NP, VNT(401), W47, NAME, SER
3,FLOOR,ITAG(100),WING(10)
COMMON/CHARA/BLOK,JE,ASPEC,SPECIE
CHARACTER*30 BLOK(10)
CHARACTER*2 JE(10,6), ASPEC(12)
CHARACTER*8 SPECIE(400)
COMMON /IBRIUM/ TL(400,2), TU(400,2), W3(400), VNU(400,12), QA,
1TAU, H(400), SD(400), Y(400), JC, IR(400,2), DMU(400), VLNK(400),
2IOJ(12), RA(400,2), RB(400,2), RC(400,2), RD(400,2), RE(400,2),
3RF(400,2), CH(400,2), JM, W48, CP, FN, C(12,400),JUNK(400)
COMMON/SCRATC /HN(400,2),RJ(200)
COMMON /OPT/Y1(10),NI,XISP,XRHO,XISPEX,IFLGEX,EXPAN,PRESEX
COMMON /FJB/ IO6
236 FORMAT (' *****NO TEMPERATURE CONVERGENCE-DONT TRUST RESULTS!')
DIMENSION FAC(2)
FTU = TCH
FTL=75.
LIM = 20
CALL EQUIL(TE,PR,HE,ENTR,LL)
CF = FAC(LL+1)
DO 15 J = 1,LIM
CALL SLITET(3,K000FX)
GO TO(4115,210),K000FX
210 IF (ENTR - SYSENT) 211,18,212
211 FTL = TE
FLP = VNT(NP)
SLP = ENTR
DO 70 L = 1,N
70 HN(L,1) = VNT(L)
GO TO 4115
212 FTU = TE
FUP = VNT(NP)
SUP = ENTR
DO 71 L = 1,N
71 HN(L,2) = VNT(L)
4115 CF= AMAX1(1.0,CF)
CF = AMIN1(16.0, CF)
VQ = (SYSENT - ENTR)/CP/CF
DT = TE*VQ
IF (VQ) 131,133,133
131 DT = TE*(EXP(VQ) - 1.0)
133 DT= AMIN1(DT, .5*(FTU-TE))
DT= AMAX1(DT, .5*(FTL-TE))
TE = TE + DT
HENT = ENTR
IF (FTU-FTL .LT. 2.) GO TO 21
IF (ABS(SYSENT-ENTR)/SYSENT .LT. .0001) GO TO 18
CALL EQUIL (TE,PR,HE,ENTR,LL)
15 CF= ((ENTR-HENT)/(CP*ALOG(TE/(TE-DT))))
WRITE (IO6,236)
IF (NI.NE.0)WRITE (3,236)
21 VA = (SUP-SYSENT)/(SUP-SLP)
VB = (SYSENT-SLP)/(SUP-SLP)
CP = 0.
DO 22 L = 1,N
CP = CP + VNT(L)*Y(L)
IF (LL .NE. 1) GO TO 18
22 VNT(L) = VA*HN(L,1) + VB*HN(L,2)
18 HE = HE + TE*(SYSENT - ENTR)
FAC(LL+1) = CF
RETURN
END
SUBROUTINE SETUP(X,XMIN,XMAX, J)
COMMENT. THIS ROUTINE DETERMINES THE MAXIMUM AND THE MINIMUM CHANGE
C ALLOWABLE IN REACTION COORDINATE J BEFORE NEGATIVE CONCENTRATIONS AR
C IT ALSO SETS UP THE FUGACITY COEFFICIENTS FOR REACTION J IN X(J).
COMMON A(12,12), KR(20), AMAT(10,12), JAT(12), IN, IS,
1FIE(10,6), IE(10,6), ALP(12), W27, N, DH(10), RHO(10),
2WATE(10), W1(6), W43, IG, NP, VNT(401), W47, NAME, SER
3,FLOOR,ITAG(100),WING(10)
COMMON/CHARA/BLOK,JE,ASPEC,SPECIE
CHARACTER*30 BLOK(10)
CHARACTER*2 JE(10,6), ASPEC(12)
CHARACTER*8 SPECIE(400)
INTEGER K
COMMON /IBRIUM/ TL(400,2), TU(400,2), W3(400), VNU(400,12), QA,
1TAU, H(400), SD(400), Y(400), JC, IR(400,2), DMU(400), VLNK(400),
2IOJ(12), RA(400,2), RB(400,2), RC(400,2), RD(400,2), RE(400,2),
3RF(400,2), CH(400,2), JM, W48, CP, FN, C(12,400), LL(400)
DIMENSION X(30)
XMAX = .100000000E+16
XMIN =-.100000000E+16
DO 9 I = 1,IS
X(I) = 0.
IF (VNU(J,I) .EQ. 0.) GO TO 9
K = IOJ(I)
VQ = VNT(K)
IF (IG .LT. K) GO TO 6
4 X(I) = VNU(J,I)
6 IF(VNU(J,I)) 3,9,7
7 XMAX= AMIN1(XMAX, VQ/VNU(J,I))
GO TO 9
3 XMIN= AMAX1(XMIN, VQ/VNU(J,I))
9 CONTINUE
RETURN
END
SUBROUTINE SLITE(J)
COMMON /L/ LIT(4)
IF (J .EQ. 0) GO TO 9
LIT(J)=1
RETURN
9 DO 10 I=1,4
10 LIT(I)=0
RETURN
END
SUBROUTINE SLITET(J,K)
COMMON /L/ LIT(4)
K=2
IF (LIT(J) .EQ. 0) GO TO 99
K=1
LIT(J)=0
99 RETURN
END
SUBROUTINE STOICH(LE)
COMMON A(12,12), KR(20), AMAT(10,12), JAT(12), IN, IS,
1FIE(10,6), IE(10,6), ALP(12), W27, N, DH(10), RHO(10),
2WATE(10), W1(6), W43, IG, NP, VNT(401), W47, NAME, SER
3,FLOOR,ITAG(100),WING(10)
COMMON/CHARA/BLOK,JE,ASPEC,SPECIE
CHARACTER*8 SPECIE(400)
CHARACTER*30 BLOK(10)
CHARACTER*2 JE(10,6), ASPEC(12)
COMMENT PROPELLANT STOICHIOMETRY ROUTINE CALLED BY PUTIN.
COMMENT. ALIASES. U1= UNBURNED BERYLLIUM, U2 = UNBURNED BORON,
C U3 = UNBURNED MAGNESIUM, U4 = UNBURNED ALUMINUM,
C U5 = UNBURNED CARBON, DON,T USE U6. THESE INERTS MELT AND
C EVAPORATE BUT DO NOT REACT. GAS SPECIES MAY BE ELIMINATED FROM PE
C TAPE TO PREVENT EVAPORATION.
CHARACTER*2 SYMB(100)
COMMON /FJB/ IO6
DATA SYMB / 'H ','HE','LI','BE','B ','C ','N ','O ',
X'F ','NE','NA','MG','AL','SI','P ','S ','CL','AR','K ','CA',
Y'SC','TI','V ','CR','MN','FE','CO','NI','CU','ZN','GA','GE',
Z'AS','SE','BR','KR','RB','SR','Y ','ZR','NB','MO','TC','RU',
X'RH','PD','AG','CD','IN','SN','SB','TE','I ','XE','CS','BA',
Y'LA','CE','PR','ND','PM','SM','EU','GD','TB','DY','HO','ER',
Z'TM','YB','LU','HF','TA','W ','RE','OS','IR','PT','AU','HG','TL',
X'PB','BI','PO','AT','RN','FR','RA','AC','TH','PA','U ','NP',
Y'U6','U5','U1','U2','U3','U4','FM'/
1 FORMAT ('0WHAT,S ',A2)
2 FORMAT (/' INGREDIENT CARD ',I2,' GOOFED UP.')
DO 11 I = 1,100
11 ITAG(I) = 0
DO 19 I = 1,IN
DO 18 J = 1,6
IF (FIE(I,J)) 14,19,12
12 DO 17 L = 1,100
IF (JE(I,J) .NE. SYMB(L)) GO TO 17
ITAG(L) = 1
IE(I,J) = L
GO TO 18
17 CONTINUE
WRITE ( IO6,1) IE(I,J)
14 WRITE ( IO6,2) I
LE = 1
18 CONTINUE
19 CONTINUE
IS = 1
DO 25 I = 1,100
IF (ITAG(I)) 25,25,20
20 ASPEC(IS) = SYMB(I)
JAT(IS) = I
IS = IS + 1
25 CONTINUE
IS = IS - 1
DO 31 I = 1,IN
DO 26 J = 1,12
26 AMAT(I,J) = 0.
DO 29 K = 1,IS
DO 28 J = 1,6
IF (IE(I,J) - JAT(K)) 28,27,28
27 AMAT(I,K) = FIE(I,J)
GO TO 29
28 CONTINUE
29 CONTINUE
31 CONTINUE
RETURN
END
SUBROUTINE TABLO(II,JJ,KK)
COMMENT. WHEN THE BASIS IS NO LONGER OPTIMUM, THIS ROUTINE CHANGES IT
C THE TABLEAU METHOD OF LINEAR PROGRAMMING.
COMMON A(12,12), KR(20), AMAT(10,12), JAT(12), IN, IS,
1FIE(10,6), IE(10,6), ALP(12), W27, N, DH(10), RHO(10),
2WATE(10), W1(6), W43, IG, NP, VNT(401), W47, NAME, SER
3,FLOOR,ITAG(100),WING(10)
COMMON/CHARA/BLOK,JE,ASPEC,SPECIE
CHARACTER*30 BLOK(10)
CHARACTER*2 JE(10,6), ASPEC(12)
CHARACTER*8 SPECIE(400)
COMMON /IBRIUM/ TL(400,2), TU(400,2), W3(400), VNU(400,12), QA,
1TAU, H(400), SD(400), Y(400), JC, IR(400,2), DMU(400), VLNK(400),
2IOJ(12), RA(400,2), RB(400,2), RC(400,2), RD(400,2), RE(400,2),
3RF(400,2), CH(400,2), JM, W48, CP, FN, C(12,400), LL(400)
COMMON/MOON/TSTEST,TE,JUNK(3)
COMMON /FJB/ IO6
DO 19 L = 1,N
IF (LL(L) .LT. 0) GO TO 19
IF (L .EQ. JJ) GO TO 19
IF (ABS(VNU(L,KK)) .LT. .0001) GO TO 19
VA = -VNU(L,KK)/VNU(JJ,KK)
DO 15 M = 1,IS
15 VNU(L,M) = VNU(L,M) + VA*VNU(JJ,M)
VNU(L,KK) = -VA
DO 16 M = 1,IS
IF (ABS(VNU(L,M)) .GT. .00001) GO TO 16
VNU(L,M) = 0.
16 CONTINUE
19 CONTINUE
DO 20 M = 1,IS
20 VNU(JJ,M) = 0.
VNU(JJ,KK) = 1.
IOJ(KK) = JJ
LL(JJ) = 0
LL(II) = 9
CALL REACT(TE)
IF (KR(15) .NE. 1) GO TO 99
WRITE (IO6,999)II,JJ,KK,SPECIE(II),SPECIE(JJ)
999 FORMAT (3I5, 3X, A8, ' REPLACED BY ', A8)
99 RETURN
END
SUBROUTINE THERMO(TE,HE,ENTR)
COMMENT. COMPUTES SYSTEM ENTHALPY, ENTROPY AND HEAT CAPACITY
COMMON A(12,12), KR(20), AMAT(10,12), JAT(12), IN, IS,
1FIE(10,6), IE(10,6), ALP(12), W27, N, DH(10), RHO(10),
2WATE(10), W1(6), W43, IG, NP, VNT(401), W47, NAME, SER
3,FLOOR,ITAG(100),WING(10)
COMMON/CHARA/BLOK,JE,ASPEC,SPECIE
CHARACTER*30 BLOK(10)
CHARACTER*2 JE(10,6), ASPEC(12)
CHARACTER*8 SPECIE(400)
COMMON /IBRIUM/ TL(400,2), TU(400,2), W3(400), VNU(400,12), QA,
1TAU, H(400), SD(400), Y(400), JC, IR(400,2), DMU(400), VLNK(400),
2IOJ(12), RA(400,2), RB(400,2), RC(400,2), RD(400,2), RE(400,2),
3RF(400,2), CH(400,2), JM, W48, CP, FN, C(12,400), LL(400)
VH = 0.0
VS = 0.0
CP = 0.0
DO 11 I = 1,N
CP = CP + VNT(I)*Y(I)
VH = VH + VNT(I)*H(I)
11 VS = VS + VNT(I)*SD(I)
FN = 0.0
VSM = 0.0
DO 12 I = 1,IG
IF(VNT(I) .LE. 0.)GO TO 12
FN = FN + VNT(I)
VSM= VSM+ VNT(I)*ALOG(VNT(I))
12 CONTINUE
VSM = 1.9871*(VSM + FN*VNT(NP))
HE = VH
ENTR = VS - VSM
RETURN
END
SUBROUTINE TSALT(TE,PR,HE,ENTR,PUPI,PLOI)
COMMENT. THIS SUBROUTINE COMPUTES COMPOSITION, PRESSURE AND ENTHALPY
C GIVEN TEMPERATURE AND ENTROPY. IT IS CALLED BY TSBAL.
COMMON A(12,12),KR(20),RJUNK(644),IJUNK(178)
COMMON/MOON/TSTEST,TEEE,JUNK(3)
COMMON /FJB/ IO6
TSTEST = -217.1934
PLO = PLOI
PUP = PUPI
PR=(PUP+PLO)/2.
DO 22 JI = 1,20
CALL EQUIL(TE,PR,HE,SE,1)
IF (KR(13) .NE. 0) WRITE(IO6,9)JI,TE,SE,PUP,PLO
9 FORMAT (' TSBAL ',I5,F8.1,3F12.3)
IF (SE .GT. ENTR) PLO=PR
IF (SE .LT. ENTR) PUP=PR
PR=(PUP+PLO)/2.
PR1=PUP-PLO
PR2=PR1/PLO
IF (PR2.LT.8.E-5) GO TO 23
22 CONTINUE
WRITE (IO6,1)
1 FORMAT (' TSALT STOP')
CALL SLITE (3)
23 TSTEST = 0.
RETURN
END
SUBROUTINE TSBAL(TE,PR,HE,ENTR,PUPI,PLOI)
COMMENT. THIS SUBROUTINE COMPUTES COMPOSITION, PRESSURE AND ENTHALPY
C GIVEN TEMPERATURE AND ENTROPY. IT IS CALLED BY TSBAL.
COMMON A(12,12), KR(20), AMAT(10,12), JAT(12), IN, IS,
1FIE(10,6), IE(10,6), ALP(12), W27, N, DH(10), RHO(10),
2WATE(10), W1(6), W43, IG, NP, VNT(401), W47, NAME, SER
3,FLOOR,ITAG(100),WING(10)
COMMON/CHARA/BLOK,JE,ASPEC,SPECIE
CHARACTER*30 BLOK(10)
CHARACTER*2 JE(10,6), ASPEC(12)
CHARACTER*8 SPECIE(400)
COMMON /IBRIUM/ TL(400,2), TU(400,2), W3(400), VNU(400,12), QA,
1TAU, H(400), SD(400), Y(400), JC, IR(400,2), DMU(400), VLNK(400),
2IOJ(12), RA(400,2), RB(400,2), RC(400,2), RD(400,2), RE(400,2),
3RF(400,2), CH(400,2), JM, W48, CP, FN, C(12,400),JUNK(400)
COMMON /FJB/ IO6
DIMENSION X(12), XM(12)
8 FORMAT (I5,F10.0, F12.3)
9 FORMAT (1P 10E13.4)
KR(18)=1
PR=.5*(PUPI +PLOI)
1734 CALL GIBBS(TE)
CALL FIXBAS
DO 38 J = 1,IS
X(J) = 0.
XM(J) = 0.
DO 31 I = 1,N
IF (C(J,I) .EQ. 0.) GO TO 31
XM(J) = AMAX1(VNT(I), XM(J))
X(J) = X(J) + C(J,I)*VNT(I)
31 CONTINUE
IF (ABS(ALP(J) - X(J))/XM(J) .LT. .00001) GO TO 38
CALL SLITE(1)
GO TO 39
38 CONTINUE
39 CALL DEFIOJ
CALL REACT (TE)
DO 211 I = 1,N
211 W3(I) = 50.0 -VLNK(I)
CALL RANK(IR,W3,N)
DO 22 JC = 1,20
PR=AMAX1(PLOI,PR)
PR=AMIN1(PUPI,PR)
CALL TWITCH(PR,0)
CALL THERMO (TE,HE,STRY)
VX=1.
IF (JC .GT. 5) VX=2.
IF (JC .GT. 10) VX=4.
PR=PR*EXP(-(ENTR-STRY)/(FN*VX)/1.9871)
CALL SLITET(4,K000FX)
GO TO(146,17),K000FX
146 IF (KR(13)-1) 15,14,15
14 WRITE (IO6,8)JC,TE,PR
WRITE (IO6,9)(VNT(I), I = 1,N)
15 DO 23 ICC = 1,3
CALL TWITCH(PR,1)
CALL THERMO (TE,HE,STRY)
PR=PR*EXP(-(ENTR-STRY)/(FN*VX)/1.9871)
CALL SLITET(4,K000FX)
GO TO(23,22),K000FX
23 CONTINUE
22 CONTINUE
KR(18)=0
CALL TSALT(TE,PR,HE,ENTR,PUPI,PLOI)
17 VNT(NP) = EXP(VNT(NP))
RETURN
END
FUNCTION TWID (X)
COMMENT. COMPUTES THE EQUILIBRIUM FUNCTION.
COMMON A(12,12), KR(20), AMAT(10,12), JAT(12), IN, IS,
1FIE(10,6), IE(10,6), ALP(12), W27, N, DH(10), RHO(10),
2WATE(10), W1(6), W43, IG, NP, VNT(401), W47, NAME, SER
3,FLOOR,ITAG(100),WING(10)
COMMON/CHARA/BLOK,JE,ASPEC,SPECIE
CHARACTER*30 BLOK(10)
CHARACTER*2 JE(10,6), ASPEC(12)
CHARACTER*8 SPECIE(400)
COMMON /IBRIUM/ TL(400,2), TU(400,2), W3(400), VNU(400,12), QA,
1TAU, H(400), SD(400), Y(400), JC, IR(400,2), DMU(400), VLNK(400),
2IOJ(12), RA(400,2), RB(400,2), RC(400,2), RD(400,2), RE(400,2),
3RF(400,2), CH(400,2), JM, W48, CP, FN, C(12,400), LL(400)
DIMENSION X(30)
VA = 0.0
TWID = 0.0
DO 1 I = 1,IS
IF (X(I) .EQ. 0.) GO TO 1
11 VA = VA + X(I)
K = IOJ(I)
IF (VNT(K) .LE. 0.) GO TO 1
111 TWID= TWID+ X(I)*ALOG(VNT(K))
1 CONTINUE
TWID = TWID + VA*VNT(NP)
RETURN
END
SUBROUTINE DESIGN (TE,PR,HE,SYSENT,J,I)
COMMON A(12,12), KR(20), AMAT(10,12), JAT(12), IN, IS,
1FIE(10,6), IE(10,6), ALP(12), W27, N, DH(10), RHO(10),
2WATE(10), W1(6), W43, IG, NP, VNT(401), W47, NAME, SER
3,FLOOR,ITAG(100),WING(10)
COMMON/CHARA/BLOK,JE,ASPEC,SPECIE