| 1 |
|
| 2 |
|
| 3 |
PROGRAM b1b2b3 |
| 4 |
C |
| 5 |
C February 12, 2004 |
| 6 |
C 1. Find atomic symbols for reactant species. |
| 7 |
C 2. Find species ID lists for B1, B2, and B3. |
| 8 |
C |
| 9 |
C Input consists of one record for each reactant species ID |
| 10 |
C plus a ENDR record followed by one record of atomic |
| 11 |
C symbols. - 12/18/2001 Using atomTemp a72 |
| 12 |
C The reactant species ID's must start in column 2. |
| 13 |
C The symbols must be: |
| 14 |
C 1) All capital letters |
| 15 |
C 2) Start in column 2 |
| 16 |
C 3) In one line (record) |
| 17 |
C 4) Left-adjusted in field-widths of 3 characters |
| 18 |
C eg. " C H V MG " (quotes not part of input) |
| 19 |
C When trying to find reactant species ID's, the first record is |
| 20 |
C blank and is followed by the atomic symbol list. |
| 21 |
C When trying to find omit and only lists, any species ID's from |
| 22 |
C the reactants are listed followed by a blank. Then if there |
| 23 |
C are any atoms from user defined reactants, those atomic symbols |
| 24 |
C are listed in the final record. The final record will be blank |
| 25 |
C if there are no user defined reactants. |
| 26 |
C Output lists appear in files B1, B2, and B3 for gases, condensed |
| 27 |
C and reactant-only species respectively. |
| 28 |
C |
| 29 |
PARAMETER (IOTHM=14,iob1=10,iob2=11,iob3=12) |
| 30 |
C |
| 31 |
DOUBLE PRECISION b(5),t1,t2,mw,cft(9,3),Tg(4) |
| 32 |
C |
| 33 |
CHARACTER el(5)*2,date*6,sub*15,Thdate*10,sub0*15,atoms(24)*3 |
| 34 |
CHARACTER Rids(24)*15, atomTemp*72 |
| 35 |
C |
| 36 |
OPEN (5,FILE='input.txt',STATUS='old',FORM='formatted') |
| 37 |
OPEN (IOTHM,FILE='thermo.lib',STATUS='old',FORM='unformatted') |
| 38 |
OPEN (iob1,FILE='B1.txt',STATUS='unknown',FORM='formatted') |
| 39 |
OPEN (iob2,FILE='B2.txt',STATUS='unknown',FORM='formatted') |
| 40 |
OPEN (iob3,FILE='B3.txt',STATUS='unknown',FORM='formatted') |
| 41 |
C |
| 42 |
WRITE (iob1,20) ' ' |
| 43 |
WRITE (iob2,20) ' ' |
| 44 |
WRITE (iob3,20) ' ' |
| 45 |
REWIND iob1 |
| 46 |
REWIND iob2 |
| 47 |
REWIND iob3 |
| 48 |
do 12 i=1,24 |
| 49 |
Atoms(i)=' ' |
| 50 |
Rids(i) = ' ' |
| 51 |
12 continue |
| 52 |
Natom = 0 |
| 53 |
Nrid = 0 |
| 54 |
C |
| 55 |
C Read reactant names (Rids)--blank if none. |
| 56 |
C |
| 57 |
|
| 58 |
|
| 59 |
DO 25 i=1,24 |
| 60 |
READ (5,15) Rids(i) |
| 61 |
15 FORMAT (1X, a ) |
| 62 |
print *, Rids(i) |
| 63 |
IF (Rids(i)(1:4).EQ.'ENDR') THEN |
| 64 |
READ (5,20) atomTemp |
| 65 |
20 FORMAT (1X, a72 ) |
| 66 |
print *, atomTemp |
| 67 |
GOTO 30 |
| 68 |
ENDIF |
| 69 |
Nrid = Nrid + 1 |
| 70 |
|
| 71 |
25 CONTINUE |
| 72 |
|
| 73 |
30 CONTINUE |
| 74 |
n= 1 |
| 75 |
|
| 76 |
DO 40 K=1,24 |
| 77 |
|
| 78 |
Atoms(K) = atomTemp(n:n+2) |
| 79 |
Natom = Natom + 1 |
| 80 |
if ( Atoms(K) .eq. ' ' ) GOTO 60 |
| 81 |
n=n+3 |
| 82 |
|
| 83 |
40 CONTINUE |
| 84 |
C |
| 85 |
C Read atomic symbols (Atoms)--3 blank Char ' ' if none. |
| 86 |
C |
| 87 |
|
| 88 |
|
| 89 |
60 continue |
| 90 |
|
| 91 |
C |
| 92 |
C SEARCH thermo.lib SPECIES NAMES (sub) |
| 93 |
C |
| 94 |
C SOME DEFINITIONS: |
| 95 |
C ntgas = NUMBER OF GASEOUS SPECIES IN thermo.lib. |
| 96 |
C ntot = NTGAS PLUS NUMBER OF TEMPERATURE INTERVALS FOR CONDENSED. |
| 97 |
C nall = NTOT PLUS THE NUMBER OF REACTANT SPECIES IN THERMO.LIB. |
| 98 |
C Ng = NUMBER OF GASES WITH STORED COEFFICIENTS. |
| 99 |
C Nc = NUMBER OF CONDENSED INTERVALS WITH STORED COEFFICIENTS. |
| 100 |
C Ngc = Ng + Nc |
| 101 |
C Thdate = DATE OF LAST thermo.lib UPDATE. |
| 102 |
C |
| 103 |
100 IF (Nrid .EQ. 0) goto 210 |
| 104 |
C |
| 105 |
C Find atomic symbols for reactant species in thermo.lib |
| 106 |
C |
| 107 |
110 REWIND IOTHM |
| 108 |
READ (IOTHM) Tg,ntgas,ntot,nall,Thdate |
| 109 |
sub0 = ' ' |
| 110 |
C BEGIN LOOP FOR READING SPECIES DATA FROM THERMO.LIB. |
| 111 |
Iid = 0 |
| 112 |
DO 200 itot = 1,nall |
| 113 |
IF (itot.le.ntot) THEN |
| 114 |
icf=3 |
| 115 |
io = iob1 |
| 116 |
if ( itot.GT.ntgas ) then |
| 117 |
icf=1 |
| 118 |
io = iob2 |
| 119 |
endif |
| 120 |
READ (IOTHM) sub,nint,date,(el(j),b(j),j=1,5),Ifaz,t1,t2, |
| 121 |
& mw,((cft(i,j),i=1,9),j=1,icf) |
| 122 |
ELSE |
| 123 |
io = iob3 |
| 124 |
READ (IOTHM) sub,nint,date,(el(j),b(j),j=1,5),ifaz,t1,t2,mw,eform |
| 125 |
IF (nint.GT.0) READ (IOTHM) ((cft(i,j),i=1,9),j=1,nint) |
| 126 |
ENDIF |
| 127 |
C |
| 128 |
IF ( sub.EQ.sub0 ) go to 200 |
| 129 |
sub0 = sub |
| 130 |
IF (sub(1:1).EQ.'*') sub = sub(2:) |
| 131 |
DO 114 i=1,Nrid |
| 132 |
if ( Rids(i).EQ.sub) goto 116 |
| 133 |
114 CONTINUE |
| 134 |
goto 200 |
| 135 |
116 Iid = Iid + 1 |
| 136 |
print *, sub |
| 137 |
DO 140 k = 1,5 |
| 138 |
if ( b(k).EQ.0. ) GOTO 140 |
| 139 |
IF ( Natom.EQ.0 ) THEN |
| 140 |
NAtom = Natom +1 |
| 141 |
Atoms(Natom) = el(k) |
| 142 |
goto 140 |
| 143 |
ELSE |
| 144 |
Nd = Natom |
| 145 |
DO 120 i = 1,Nd |
| 146 |
if ( Atoms(i).EQ.el(k) ) GOTO 140 |
| 147 |
Natom = Natom + 1 |
| 148 |
Atoms(Natom) = el(k) |
| 149 |
goto 140 |
| 150 |
120 CONTINUE |
| 151 |
ENDIF |
| 152 |
140 CONTINUE |
| 153 |
IF ( Iid.GE.Nrid ) goto 210 |
| 154 |
200 CONTINUE |
| 155 |
C |
| 156 |
C Find species ID's for B1, B2, and B3 for atomic symbols (Atoms). |
| 157 |
C |
| 158 |
210 REWIND IOTHM |
| 159 |
READ (IOTHM) Tg,ntgas,ntot,nall,Thdate |
| 160 |
sub0 = ' ' |
| 161 |
C BEGIN LOOP FOR READING SPECIES DATA FROM THERMO.LIB. |
| 162 |
DO 400 itot = 1,nall |
| 163 |
IF (itot.le.ntot) THEN |
| 164 |
icf=3 |
| 165 |
io = iob1 |
| 166 |
if ( itot.GT.ntgas ) then |
| 167 |
icf=1 |
| 168 |
io = iob2 |
| 169 |
endif |
| 170 |
READ (IOTHM) sub,nint,date,(el(j),b(j),j=1,5),Ifaz,t1,t2, |
| 171 |
& mw,((cft(i,j),i=1,9),j=1,icf) |
| 172 |
ELSE |
| 173 |
io = iob3 |
| 174 |
READ (IOTHM) sub,nint,date,(el(j),b(j),j=1,5),ifaz,t1,t2,mw,eform |
| 175 |
IF (nint.GT.0) READ (IOTHM) ((cft(i,j),i=1,9),j=1,nint) |
| 176 |
ENDIF |
| 177 |
C |
| 178 |
IF ( sub.EQ.sub0 ) go to 400 |
| 179 |
sub0 = sub |
| 180 |
IF (sub(1:1).EQ.'*') sub = sub(2:) |
| 181 |
DO 300 k = 1,5 |
| 182 |
DO 260 i = 1,Natom |
| 183 |
if ( b(k).EQ.0. ) GOTO 350 |
| 184 |
if ( Atoms(i).EQ.el(k) ) GOTO 300 |
| 185 |
260 CONTINUE |
| 186 |
GOTO 400 |
| 187 |
300 CONTINUE |
| 188 |
C |
| 189 |
350 WRITE (io,355) sub |
| 190 |
355 FORMAT ( a15 ) |
| 191 |
400 CONTINUE |
| 192 |
C |
| 193 |
500 CLOSE (IOTHM) |
| 194 |
CLOSE ( 5) |
| 195 |
CLOSE (iob1) |
| 196 |
CLOSE (iob2) |
| 197 |
CLOSE (iob3) |
| 198 |
STOP |
| 199 |
END |