nuc123

Upload: rohin-kumar

Post on 30-Oct-2015

87 views

Category:

Documents


0 download

DESCRIPTION

NUC123

TRANSCRIPT

  • /home/parminder/Desktop/par/nuc.fPage 1 of 31 Mon 05 Sep 2011 02:43:03 AM EDT 1 C========================IDENTIFICATION DIVISION=============================

    === 2 3 PROGRAM nuc123 4 5 C----------LINKAGES. 6 C CALLED BY - none 7 C CALLS - [subroutine] help, setcom, setmod, run, output 8 9 C----------REMARKS. 10 C Control program - 11 C Offers user the main menu and channels through to various options. 12 C Implementation - 13 C To run this program, NUC123.FOR must be linked with NUCCOM 14 C (containing the computation subroutines), NUCRAT (with the 15 C reaction rates), and NUCINT (with an interface subroutine). 16 C This program has been written to be compatible with 17 C ANSI FORTRAN-77 with the exception of the END DO statement 18 C used to limit the number of statement labels. 19 C The code was developed on the VAX/VMS system. 20 C Notes - 21 C The program utilizes Wagoner's code as the core of the computational 22 C routines. 23 C Documentation - 24 C Kawano, L., 1992, Fermilab preprint FERMILAB-PUB-92/04-A, 25 C Kellogg Radiation Lab preprint OAP-714. 26 C Copy - 27 C Version 4.1 (December 1991) 28 29 C----------PARAMETERS. 30 PARAMETER (ir=1) !Input unit number. 31 PARAMETER (iw=1) !Output unit number. 32 PARAMETER (nrec=88) !Number of nuclear reactions. 33 PARAMETER (nnuc=26) !Number of nuclides in calculation. 34 35 C----------COMMON AREAS. 36 COMMON /recpr0/ reacpr !Reaction parameter valu

    es. 37 COMMON /recpr/ iform,ii,jj,kk,ll,rev,q9 !Reaction parameter name

    s. 38 COMMON /rates/ f,r !Reaction rates. 39 COMMON /compr0/ cy0,ct0,t9i0,t9f0,ytmin0,inc0 !Default comp parameters

    . 40 COMMON /compr/ cy,ct,t9i,t9f,ytmin,inc !Computation parameters. 41 COMMON /modpr0/ c0,cosmo0,xi0 !Default model parameter

    s. 42 COMMON /modpr/ g,tau,xnu,c,cosmo,xi !Model parameters. 43 COMMON /varpr0/ dt0,eta0 !Default variationl para

    ms. 44 COMMON /varpr/ dt1,eta1 !Variational parameters. 45 COMMON /chek/ itime !Computation location. 46 COMMON /runopt/ irun,isize,jsize !Run options. 47 COMMON /outopt/ nout,outfile !Output option. 48 49 50 C==========================DECLARATION DIVISION==============================

    === 51

    - 1 -

  • /home/parminder/Desktop/par/nuc.fPage 2 of 31 Mon 05 Sep 2011 02:43:03 AM EDT 52 C----------REACTION PARAMETERS FROM BLOCK DATA. 53 REAL reacpr(nrec,8) !Reaction parameters. 54 55 C----------REACTION PARAMETERS. 56 INTEGER iform(nrec) !Reaction type code (1-11). 57 INTEGER ii(nrec) !Incoming nuclide type (1-26). 58 INTEGER jj(nrec) !Incoming light nuclide type (1-6). 59 INTEGER kk(nrec) !Outgoing light nuclide type (1-6). 60 INTEGER ll(nrec) !Outgoing nuclide type (1-26). 61 REAL rev(nrec) !Reverse reaction coefficient. 62 REAL q9(nrec) !Energy released in reaction. 63 64 C----------REACTION RATES. 65 REAL f(nrec) !Forward reaction rate coefficients. 66 REAL r(nrec) !Reverse reaction rate coefficients. 67 68 C----------DEFAULT COMPUTATION PARAMETERS. 69 REAL cy0 !Default cy. 70 REAL ct0 !Default ct. 71 REAL t9i0 !Default t9i. 72 REAL t9f0 !Default t9f. 73 REAL ytmin0 !Default ytmin. 74 INTEGER inc0 !Default accumulation increment. 75 76 C----------COMPUTATIONAL PARAMETERS. 77 REAL cy !Time step limiting constant on abundances

    . 78 REAL ct !Time step limiting constant on temperatur

    e. 79 REAL t9i !Initial temperature (in 10**9 K). 80 REAL t9f !Final temperature (in 10**9 k). 81 REAL ytmin !Smallest abundances allowed. 82 INTEGER inc !Accumulation increment. 83 84 C----------DEFAULT MODEL PARAMETERS. 85 REAL c0(3) !Default c. 86 REAL cosmo0 !Default cosmological constant. 87 REAL xi0(3) !Default neutrino degeneracy parameters. 88 89 C----------EARLY UNIVERSE MODEL PARAMETERS. 90 REAL c(3) !c(1) is variation of gravitational consta

    nt. 91 | !c(2) is neutron lifetime (sec). 92 | !c(3) is number of neutrino species. 93 REAL cosmo !Cosmological constant. 94 REAL xi(3) !Neutrino degeneracy parameters. 95 96 C----------DEFAULT VARIATIONAL PARAMETERS. 97 REAL dt0 !Default initial time step. 98 REAL eta0 !Default baryon-to-photon ratio. 99 100 C----------VARIATIONAL PARAMETERS. 101 REAL dt1 !Initial time step. 102 REAL eta1 !Baryon-to-photon ratio. 103 104 C----------COMPUTATION LOCATION. 105 INTEGER itime !Time check. 106

    - 2 -

  • /home/parminder/Desktop/par/nuc.fPage 3 of 31 Mon 05 Sep 2011 02:43:03 AM EDT 107 C----------RUN OPTION. 108 INTEGER irun !Run network size. 109 INTEGER isize !Number of nuclides in computation. 110 INTEGER jsize !Number of reactions in computation. 111 112 C----------OUTPUT FILE STATUS. 113 INTEGER nout !Number of output requests. 114 LOGICAL outfile !Indicates if output file used. 115 116 C----------USER RESPONSE VARIABLES. 117 INTEGER inum !Selection number. 118 119 120 C===========================PROCEDURE DIVISION===============================

    === 121 122 C10--------OPEN FILES AND PRINT GREETING-------------------------------------

    --- 123 124 OPEN (unit=1, file='/dev/tty', status='old') !User terminal. 125 OPEN (unit=2, file='nuc123.dat', status='new') !Output file. 126 itime = 1 !Time = beginning of program. 127 CALL check !Check interface subroutine. 128 WRITE (iw,1000) 129 1000 FORMAT ((/), 130 | 2(' ',4x,'NN',6x,'NN UU',6x,'UU',4x,8('C'),6x,'11',8x, 131 | 6('2'),6x,6('3'),/), 132 | 2(' ',4x,'NN',6x,'NN UU',6x,'UU CC',12x,'1111',6x, 133 | '22',6x,'22 33',6x,'33',/), 134 | 2(' ',4x,'NNNN NN UU',6x,'UU CC',14x,'11',14x, 135 | '22',10x,'33',/), 136 | 2(' ',4x,'NN NN NN UU',6x,'UU CC',14x,'11',12x, 137 | '22',10x,'33',/), 138 | 2(' ',4x,'NN NNNN UU',6x,'UU CC',14x,'11',10x, 139 | '22',14x,'33',/), 140 | 2(' ',4x,'NN',6x,'NN UU',6x,'UU CC',14x,'11',8x, 141 | '22',8x,'33',6x,'33',/), 142 | 2(' ',4x,'NN',6x,'NN ',10('U'),4x,8('C'),4x,6('1'),4x, 143 | 10('2'),4x,6('3'),/),/, 144 | ' ',26x,'WRITTEN BY PARMINDER SINGH',///, 145 | ' ','(Press to continue): ',$) 146 147 C20--------INPUT INITIALIZATION INFORMATION AND PAUSE------------------------

    --- 148 149 DO i = 1,nrec 150 C..........READ IN REACTION PARAMETERS. 151 iform(i) = int(reacpr(i,2))!Reaction type. 152 ii(i) = int(reacpr(i,3))!Incoming nuclide type. 153 jj(i) = int(reacpr(i,4))!Incoming nuclide type. 154 kk(i) = int(reacpr(i,5))!Outgoing nuclide type. 155 ll(i) = int(reacpr(i,6))!Outgoing nuclide type. 156 rev(i) = reacpr(i,7) !Reverse reaction coefficient. 157 q9(i) = reacpr(i,8) !Energy released. 158 C..........INITIALIZE REACTION RATES. 159 f(i) = 0. !Forward rate coeff. 160 r(i) = 0. !Reverse rate coeff. 161 C..........SET RUN OPTIONS TO DEFAULT.

    - 3 -

  • /home/parminder/Desktop/par/nuc.fPage 4 of 31 Mon 05 Sep 2011 02:43:03 AM EDT 162 END DO 163 irun = 1 !Do full run. 164 isize = nnuc !Use all 26 nuclides. 165 jsize = nrec !Use all 88 reactions. 166 C..........SET OUTPUT OPTION TO DEFAULT. 167 nout = 0 !No output requests. 168 outfile = .false. !Output file not used. 169 C..........SET VALUES TO DEFAULT. 170 cy = cy0 !Time step limiting constant on abundances

    . 171 ct = ct0 !Time step limiting constant on temperatur

    e. 172 t9i = t9i0 !Initial temperature. 173 t9f = t9f0 !Final temperature. 174 ytmin = ytmin0 !Smallest abundances allowed. 175 inc = inc0 !Accumulation increment. 176 c(1) = c0(1) !Variation of gravitational constant. 177 c(2) = c0(2) !Neutron lifetime. 178 c(3) = c0(3) !Number of neutrino species. 179 cosmo = cosmo0 !Cosmological constant. 180 xi(1) = xi0(1) !Electron degeneracy parameter. 181 xi(2) = xi0(2) !Muon degeneray parameter. 182 xi(3) = xi0(3) !Tauon degeneracy parameter. 183 dt1 = dt0 !Initial time step. 184 eta1 = eta0 !Baryon-to-photon ratio. 185 C..........ACCEPT RETURN TO CONTINUE. 186 READ (ir,*) !Pause. 187 188 C30--------PRINT MENU AND AWAIT RESPONSE-------------------------------------

    --- 189 190 C..........RETURN FROM LOOPING. 191 300 CONTINUE 192 C..........DISPLAY MENU. 193 WRITE (iw,3000) 194 3000 FORMAT (8(/), 195 | ' ',32x,'MENU SELECTION',/, 196 | ' ',32x,'---- ---------',//, 197 | ' ',24x,'1. HELP',/, 198 | ' ',24x,'2. SET COMPUTATION PARAMETERS',/, 199 | ' ',24x,'3. SET MODEL PARAMETERS',/, 200 | ' ',24x,'4. RUN',/, 201 | ' ',24x,'5. OUTPUT',/, 202 | ' ',24x,'6. EXIT',8(/), 203 | ' ',24x,'Enter selection (1-6): ',$) 204 C..........READ IN SELECTION NUMBER. 205 READ (ir,3001) inum 206 3001 FORMAT(i1) 207 208 C40--------BRANCH TO APPROPRIATE SECTION-------------------------------------

    --- 209 210 GO TO (410,420,430,440,450,460),inum 211 GO TO 460 !Improper input or . 212 410 CONTINUE !Help section. 213 CALL help 214 GO TO 500 215 420 CONTINUE !Set computation parameters section.

    - 4 -

  • /home/parminder/Desktop/par/nuc.fPage 5 of 31 Mon 05 Sep 2011 02:43:03 AM EDT 216 CALL setcom 217 GO TO 500 218 430 CONTINUE !Set model parameters section. 219 CALL setmod 220 GO TO 500 221 440 CONTINUE !Run section. 222 itime = 2 !Time = beginning of run section. 223 CALL check !Check interface subroutine. 224 CALL run 225 itime = 9 !Time = end of run section. 226 CALL check !Check interface subroutine. 227 GO TO 500 228 450 CONTINUE !Output section. 229 CALL output 230 GO TO 500 231 460 CONTINUE !Exit section. 232 IF (outfile) THEN 233 CLOSE (unit=2,status='keep') !Close output file. 234 ELSE 235 CLOSE (unit=2,status='delete') !File not used - dispose. 236 END IF 237 CLOSE (unit=1) !End terminal session. 238 itime = 10 !Time = end of program. 239 CALL check !Check interface subroutine. 240 STOP 241 242 C50---------GO BACK TO MENU--------------------------------------------------

    --- 243 244 500 CONTINUE 245 GO TO 300 246 247 END 248 249 250 251 C========================IDENTIFICATION DIVISION=============================

    === 252 253 SUBROUTINE help 254 255 C----------LINKAGES. 256 C CALLED BY - [program] nuc123 257 C CALLS - none 258 259 C----------REMARKS. 260 C Displays description and workings of the program. 261 262 C----------PARAMETERS. 263 PARAMETER (ir=1) !Input unit number. 264 PARAMETER (iw=1) !Output unit number. 265 266 267 C==========================DECLARATION DIVISION==============================

    === 268 269 C----------USER RESPONSE VARIABLES. 270 INTEGER inum !Selection number.

    - 5 -

  • /home/parminder/Desktop/par/nuc.fPage 6 of 31 Mon 05 Sep 2011 02:43:03 AM EDT 271 272 273 C===========================PROCEDURE DIVISION===============================

    === 274 275 C10--------PRINT HELP SELECTION----------------------------------------------

    --- 276 277 C..........RETURN FROM LOOPING. 278 100 CONTINUE 279 C..........DISPLAY MENU. 280 WRITE (iw,1000) 281 1000 FORMAT (8(/), 282 | ' ',32x,'HELP SELECTION',/, 283 | ' ',32x,'---- ---------',//, 284 | ' ',24x,'1. INTRODUCTION',/, 285 | ' ',24x,'2. SETTING UP A RUN',/, 286 | ' ',24x,'3. RUNNING THE PROGRAM',/, 287 | ' ',24x,'4. OUTPUT OPTIONS',/, 288 | ' ',24x,'5. GENERAL METHOD OF COMPUTATION',/, 289 | ' ',24x,'6. USING THE INTERFACE SUBROUTINE',/, 290 | ' ',24x,'7. EXIT',7(/), 291 | ' ',24x,'Enter selection (1-7): ',$) 292 C..........READ IN SELECTION NUMBER. 293 READ (ir,1001) inum 294 1001 FORMAT (i1) 295 296 C20--------BRANCH TO APPROPRIATE SECTION-------------------------------------

    --- 297 298 GO TO (210,220,230,240,250,260,270),inum 299 GO TO 270 !Improper input or . 300 301 C21--------INTRODUCTION SECTION----------------------------------------------

    --- 302 303 210 CONTINUE !Setting up a run section. 304 WRITE (iw,2100) 305 2100 FORMAT (/, 306 | ' ',31x,'INTRODUCTION',/, 307 | ' ',31x,'------------',2(/), 308 | ' ','Welcome to the wonderful world of primor', 309 | 'dial nucleosynthesis. NUC123 is a ',/, 310 | ' ','FORTRAN program designed to provide the ', 311 | 'early universe researcher with the tools',/, 312 | ' ','necessary for the investigation of primo', 313 | 'rdial nucleosynthesis. Its menu-driven ',/, 314 | ' ','interface allows the user to first set c', 315 | 'omputation parameters (such as the time ',/, 316 | ' ','step) and model parameters (such as the ', 317 | 'neutron lifetime and number of neutri- ',/, 318 | ' ','nos) before doing single runs or multipl', 319 | 'e runs (in which desired model parame- ',/, 320 | ' ','ters are varied over a desired range.) ', 321 | 'After the run, the user can utilize the ',/, 322 | ' ','menu to either produce an output file or', 323 | ' to view the most recent run on the ',/, 324 | ' ','screen. The program comes with an empty',

    - 6 -

  • /home/parminder/Desktop/par/nuc.fPage 7 of 31 Mon 05 Sep 2011 02:43:03 AM EDT 325 | ' subroutine CHECK into which the user ',/, 326 | ' ','may wish to put additional code to add t', 327 | 'o the computation in an original manner.',10(/), 328 | ' ','(Enter to go back to help menu): ',$) 329 READ (ir,*) 330 GO TO 300 331 332 C22--------SET UP RUN SECTION------------------------------------------------

    --- 333 334 220 CONTINUE !Setting up a run section. 335 WRITE (iw,2200) 336 2200 FORMAT (/, 337 | ' ',29x,'SETTING UP A RUN',/, 338 | ' ',29x,'------- -- - ---',2(/), 339 | ' ','I. Setting computation parameters. ',/, 340 | ' ',' The accuracy of the computation and t', 341 | 'he relevant temperature region can be ',/, 342 | ' ',' set by the following parameters: ',/, 343 | ' ',' A. Time step limiting constant 1 (d', 344 | 'efault value of 0.3) ',/, 345 | ' ',' B. Time step limiting constant 2 (d', 346 | 'efault value of 0.03) ',/, 347 | ' ',' C. Initial time step (default value', 348 | ' of 10**-4) ',/, 349 | ' ',' D. Initial temperature (default val', 350 | 'ue of 10**2) ',/, 351 | ' ',' This is the temperature at the be', 352 | 'ginning of the run in units of 10**9 K ',/, 353 | ' ',' E. Final temperature (default value', 354 | ' of 10**-2) ',/, 355 | ' ',' This is the termination temperatu', 356 | 're of the run in units of 10**9 K ',/, 357 | ' ',' F. Smallest abundances allowed (def', 358 | 'ault value of 10**-25) ',/, 359 | ' ',' Elemental abundances are not allo', 360 | 'wed to drop below this value ',/, 361 | ' ',' G. # of iterations for each accumula', 362 | 'tion (default value of 30) ',/, 363 | ' ',' This is the number of iterations ', 364 | 'before values are put in an output array',6(/), 365 | ' ','(Enter 1 to continue, to end): ',$) 366 READ (ir,1001) inum 367 IF (inum.eq.1) THEN 368 WRITE (iw,2202) 369 2202 FORMAT (/, 370 | ' ','II. Setting model parameters. ',/, 371 | ' ',' Default values here give what is know', 372 | 'n as the standard model with best guess ',/, 373 | ' ',' figure on the neutron lifetime of 888', 374 | '.541 seconds. Nonstandard scenarios can',/, 375 | ' ',' be investigated by varying the follow', 376 | 'ing parameters: ',/, 377 | ' ',' A. The gravitational constant ',/, 378 | ' ',' (The default value of one here gi', 379 | 'ves the usual 6.6720e-8 dyne*cm**2/g**2)',/, 380 | ' ',' B. Neutron life-time (default value', 381 | ' of 888.541 seconds) ',/,

    - 7 -

  • /home/parminder/Desktop/par/nuc.fPage 8 of 31 Mon 05 Sep 2011 02:43:03 AM EDT 382 | ' ',' C. Number of neutrino species (defa', 383 | 'ult value of 3 light neutrinos) ',/, 384 | ' ',' D. Final baryon-to-photon ratio (se', 385 | 't to log(eta) = -9.5) ',/, 386 | ' ',' E. Cosmological constant (default v', 387 | 'alue of 0) ',/, 388 | ' ',' F. Neutrino degeneracy parameters (', 389 | 'default values all 0) ',/, 390 | ' ',' There are 3 separate parameters f', 391 | 'or the electron, muon, and tau neutrinos',11(/), 392 | ' ','(Enter to go back to help menu): ',$) 393 READ (ir,*) 394 GO TO 300 395 ELSE 396 GO TO 300 397 END IF !(inum.eq.1) 398 399 C23--------RUN PROGRAM SECTION-----------------------------------------------

    --- 400 401 230 CONTINUE !Running the program section. 402 WRITE (iw,2300) 403 2300 FORMAT (/, 404 | ' ',28x,'RUNNING THE PROGRAM',/, 405 | ' ',28x,'------- --- -------',2(/), 406 | ' ','I. Setting run speed. ',/, 407 | ' ',' The code can be run at 3 different se', 408 | 'ttings of speed. The running of the ',/, 409 | ' ',' code can be speeded up by reducing th', 410 | 'e number of nuclides and reactions. The',/, 411 | ' ',' complete computation takes into accou', 412 | 'nt the following nuclides: n, p, d, t, ',/, 413 | ' ',' He3, He4, Li6, Li7, Be7, Li8, B8, Be9', 414 | ',B10, B11, C11, B12, C12, N12, C13, N13,',/, 415 | ' ',' C14, N14, O14, N15, O15, and O16. ',/, 416 | ' ',' The given CPU percentages and abundan', 417 | 'ce variations are with regard to a ',/, 418 | ' ',' single run with all default parameter', 419 | ' values. ',/, 420 | ' ',' A. 26 nuclides, 88 reactions (defaul', 421 | 't) ',/, 422 | ' ',' nuclides from n to O16 ',/, 423 | ' ',' B. 18 nuclides, 60 reactions ',/, 424 | ' ',' nuclides from n to N12 ',/, 425 | ' ',' (63% CPU time, variation = .1%) ',/, 426 | ' ',' C. 9 nuclides, 25 reactions ',/, 427 | ' ',' nuclides from n to Be7 ',/, 428 | ' ',' (20% CPU time, variation = .5%) ',4(/), 429 | ' ','(Enter 1 to continue, to end): ',$) 430 READ (ir,1001) inum 431 IF (inum.eq.1) THEN 432 WRITE (iw,2302) 433 2302 FORMAT (/, 434 | ' ','II. Do single run. ',/, 435 | ' ',' A. Interactive. ',/, 436 | ' ',' In an interactive session, the us', 437 | 'er can readily input the computational ',/, 438 | ' ',' and model parameters and begin th',

    - 8 -

  • /home/parminder/Desktop/par/nuc.fPage 9 of 31 Mon 05 Sep 2011 02:43:03 AM EDT 439 | 'e computation process. The run itself ',/, 440 | ' ',' is commenced when option 2, "GO",', 441 | ' in the "RUN" section is requested. ',//, 442 | ' ',' B. Batch. ',/, 443 | ' ',' To run the program in a batch mod', 444 | 'e, it must be altered slightly so that ',/, 445 | ' ',' the I/O takes place with files in', 446 | 'stead of a terminal. This is done by ',/, 447 | ' ',' setting different values for the ', 448 | 'input and output unit number parameters ',/, 449 | ' ',' "ir" and "iw" and assigning them ', 450 | 'to different files in NUC123. In the ',/, 451 | ' ',' file assigned the "ir" unit numbe', 452 | 'r, one must place the responses to the ',/, 453 | ' ',' queries of the program. ',10(/), 454 | ' ','(Enter 1 to continue, to end): ',$) 455 READ (ir,1001) inum 456 IF (inum.eq.1) THEN 457 WRITE (iw,2304) 458 2304 FORMAT (/, 459 | ' ','III. Do multiple runs. ',/, 460 | ' ',' A wide range of early universe model', 461 | 's can be covered by doing many runs ',/, 462 | ' ',' while one or more parameters are var', 463 | 'ied over a range of interest. The ',/, 464 | ' ',' parameters that can be varied are th', 465 | 'e following: ',/, 466 | ' ',' A. Eta ', 467 | ' - Logrithmic variation ',/, 468 | ' ',' B. Gravitational constant ', 469 | ' - Linear variation ',/, 470 | ' ',' C. Neutron lifetime ', 471 | ' - Linear variation ',/, 472 | ' ',' D. Number of neutrino species ', 473 | ' - Linear variation ',/, 474 | ' ',' E. Cosmological constant ', 475 | ' - Linear variation ',/, 476 | ' ',' F. Neutrino degeneracy parameters ', 477 | ' - Linear variation ',/, 478 | ' ',' 1. Electron neutrino ',/, 479 | ' ',' 2. Muon neutrino ',/, 480 | ' ',' 3. Tauon neutrino ',/, 481 | ' ',' At most 3 parameters can be varied. ', 482 | ' The first parameter inputted will be ',/, 483 | ' ',' will be varied in the outermost loop', 484 | ' and the third parameter inputted will ',/, 485 | ' ',' be varied in the innermost loop. ',7(/), 486 | ' ','(Enter to go back to help menu): ',$) 487 READ (ir,*) 488 GO TO 300 489 ELSE 490 GO TO 300 491 END IF !(inum.eq.1) 492 ELSE 493 GO TO 300 494 END IF !(inum.eq.1) 495 496 C24--------OUTPUT OPTIONS SECTION--------------------------------------------

    - 9 -

  • /home/parminder/Desktop/par/nuc.fPage 10 of 31 Mon 05 Sep 2011 02:43:03 AM EDT

    -- 497 498 240 CONTINUE !Output options section. 499 WRITE (iw,2400) 500 2400 FORMAT (/, 501 | ' ',30x,'OUTPUT OPTIONS',/, 502 | ' ',30x,'------ -------',2(/), 503 | ' ','I. Request output file. ',/, 504 | ' ',' After a run, the user can request the', 505 | ' program to put the resulting numbers ',/, 506 | ' ',' into an output file. This can be don', 507 | 'e as many times as desired and all the ',/, 508 | ' ',' information will be put in one new fi', 509 | 'le under the name of "NUC123.DAT." If ',/, 510 | ' ',' there is no request during the entire', 511 | ' running of the program, this file is ',/, 512 | ' ',' not created. If an output file is re', 513 | 'quested after a multiple run, only the ',/, 514 | ' ',' information from the very last run wi', 515 | 'll be given. The output file will give ',/, 516 | ' ',' the computational and model parameter', 517 | 's for each run and will contain the ',/, 518 | ' ',' following information: ',/, 519 | ' ',' A. Temperatures in decreasing order ',/, 520 | ' ',' B. Abundances for n, p, d, t, He3, H', 521 | 'e4, Li6, Li7, Be7, and Li8 & up ',/, 522 | ' ',' (p and He4 are in mass fraction, ', 523 | 'the rest in ratios to the p abundance) ',/, 524 | ' ',' C. Time, time interval, chemical pot', 525 | 'ential of the electron ',/, 526 | ' ',' D. Energy densities for photons, ele', 527 | 'ctrons, electron neutrinos, and baryons ',/, 528 | ' ',' E. Baryon-to-photon ratio, expansion', 529 | ' rate of the universe ',5(/), 530 | ' ','(Enter 1 to continue, to end): ',$) 531 READ (ir,1001) inum 532 IF (inum.eq.1) THEN 533 WRITE (iw,2402) 534 2402 FORMAT (/, 535 | ' ','II. Request output on screen. ',/, 536 | ' ',' Instead of waiting to print out an o', 537 | 'utput file, the user can immediately ',/, 538 | ' ',' access the results of the latest run', 539 | ' by requesting the output on the ',/, 540 | ' ',' screen. There are four screens on e', 541 | 'ach of which are displayed the ',/, 542 | ' ',' computational and model parameters a', 543 | 'nd the temperature: ',/, 544 | ' ',' A. Abundances for d, t, He3, He4, a', 545 | 'nd Li7 ',/, 546 | ' ',' (He4 in mass fraction, rest as a', 547 | ' ratio with the p abundance) ',/, 548 | ' ',' B. Abundances for n, p, Li6, Be7, a', 549 | 'nd Li8 & up ',/, 550 | ' ',' (p in mass fraction, rest as a r', 551 | 'atio with the p abundance) ',/, 552 | ' ',' C. Energy densities for photons, el', 553 | 'ectrons, electron neutrinos, & baryons ',/,

    - 10 -

  • /home/parminder/Desktop/par/nuc.fPage 11 of 31 Mon 05 Sep 2011 02:43:03 AM EDT 554 | ' ',' D. Time, time interval, chemical po', 555 | 'tential of the electron, ',/, 556 | ' ',' baryon-to-photon ratio, and expa', 557 | 'nsion rate of the universe ',11(/), 558 | ' ','(Enter to go back to help menu): ',$) 559 READ (ir,*) 560 GO TO 300 561 ELSE 562 GO TO 300 563 END IF !(inum.eq.1) 564 565 C25--------METHOD OF COMPUTATION SECTION-------------------------------------

    --- 566 567 250 CONTINUE !General method of computation section. 568 WRITE (iw,2500) 569 2500 FORMAT (/, 570 | ' ',22x,'GENERAL METHOD OF COMPUTATION',/, 571 | ' ',22x,'------- ------ -- -----------',2(/), 572 | ' ','I. Time evolution algorithm. ',/, 573 | ' ',' The program utilizes a 2-point Runge-', 574 | 'Kutta scheme (located in subroutine ',/, 575 | ' ',' DRIVER) to time-evolve the temperatur', 576 | 'e, the quantity hv (the ratio of the ',/, 577 | ' ',' baryon density to T**3), the chemical', 578 | ' potential of the electron, and the ',/, 579 | ' ',' nuclide abundances. In the 2-point R', 580 | 'unge-Kutta routine, a variable v at time',/, 581 | ' ',' t0 (= v0) is evolved to a time t1 by ', 582 | 'adding to v0 the average of the ',/, 583 | ' ',' derivatives evaluated at t0 and at t1', 584 | ' multiplied by dt: ',/, 585 | ' ',' v1 = v0 + 0.5(dvdt(t0)+dvdt(t1)) ',/, 586 | ' ',' where dvdt(t1) is gotten by first fin', 587 | 'ding v1'' = v0 + dvdt(t0). The ',/, 588 | ' ',' derivatives of the nuclide abundances', 589 | ' are first computed and these are used ',/, 590 | ' ',' to find the derivatives of t9, hv, an', 591 | 'd phie (this is done in subroutine ',/, 592 | ' ',' DERIVS). To compute the time derivat', 593 | 'ives of the nuclide abundances, a matrix',/, 594 | ' ',' equation is set up (in subroutine SOL', 595 | ') and is solved (in subroutine EQSLIN) ',/, 596 | ' ',' by gaussian elimination utilizing imp', 597 | 'licit differentiation. ',6(/), 598 | ' ','(Enter 1 to continue, to end): ',$) 599 READ (ir,1001) inum 600 IF (inum.eq.1) THEN 601 WRITE (iw,2502) 602 2502 FORMAT (/ 603 | ' ','II. Hierarchy of Subroutines. ',/, 604 | ' ',' NUC123 ', 605 | ' Main program (main menu) ',/, 606 | ' ',' HELP ', 607 | ' Help option ',/, 608 | ' ',' SETCOM ', 609 | ' Set computational parameters',/, 610 | ' ',' SETMOD ',

    - 11 -

  • /home/parminder/Desktop/par/nuc.fPage 12 of 31 Mon 05 Sep 2011 02:43:03 AM EDT 611 | ' Set model parameters ',/, 612 | ' ',' RUN ', 613 | ' Run computation code ',/, 614 | ' ',' DRIVER ', 615 | ' Main routine (Runge-Kutta loop) ',/, 616 | ' ',' START ', 617 | ' Initialization routine ',/, 618 | ' ',' RATE0 ', 619 | ' Computes weak decay rates ',/, 620 | ' ',' DERIVS ', 621 | ' Computes time derivatives ',/, 622 | ' ',' THERM ', 623 | ' Computes energy densities ',/, 624 | ' ',' BESSEL ', 625 | ' Gives functions of Kn ',/, 626 | ' ',' KNUX ', 627 | ' Computes modified Bessel fcn Kn ',/, 628 | ' ',' NUDENS ', 629 | ' Computes neutrino energy density ',/, 630 | ' ',' RATE1-4 ', 631 | ' Computes rates for reactions',/, 632 | ' ',' SOL ', 633 | ' Builds A matrix for eqn dy/dt = Ay ',/, 634 | ' ',' EQSLIN ', 635 | ' Solves dy/dt=Ay by gaussian elim ',/, 636 | ' ',' ACCUM ', 637 | ' Output accumulator ',/, 638 | ' ',' OUTPUT ', 639 | ' Allows user to output result',4(/), 640 | ' ','(Enter to go back to help menu): ',$) 641 READ (ir,*) 642 GO TO 300 643 ELSE 644 GO TO 300 645 END IF !(inum.eq.1) 646 647 C26--------USING INTERFACE SUBROUTINE SECTION. 648 649 260 CONTINUE !Using the interface subroutine section. 650 WRITE (iw,2600) 651 2600 FORMAT (/, 652 | ' ',22x,'USING THE INTERFACE SUBROUTINE',/, 653 | ' ',22x,'----- --- --------- ----------',2(/), 654 | ' ','I. Purpose. ',/, 655 | ' ',' The interface subroutine CHECK is des', 656 | 'igned to be an outlet of the program ',/, 657 | ' ',' into which alterations can be easily ', 658 | 'plugged. Programs are normally modified',/, 659 | ' ',' by searching through the program, ide', 660 | 'ntifying the appropriate areas for ',/, 661 | ' ',' alterations, and interspersing new co', 662 | 'mmands while deleting some old ones. ',/, 663 | ' ',' This process can get tricky unless on', 664 | 'e actively documents the alterations: ',/, 665 | ' ',' one might lose track of all of the mo', 666 | 'difications and deletions. Thus, it is ',/, 667 | ' ',' worthwhile to put most if not all of ', 668 | 'the necessary changes into one ',/,

    - 12 -

  • /home/parminder/Desktop/par/nuc.fPage 13 of 31 Mon 05 Sep 2011 02:43:03 AM EDT 669 | ' ',' subroutine which is to be called from', 670 | ' strategic locations in the main ',/, 671 | ' ',' program. Furthermore, by putting cha', 672 | 'nges into one small subroutine, one need',/, 673 | ' ',' only to compile the subroutine CHECK ', 674 | 'each time instead of the entire nucleo- ',/, 675 | ' ',' synthesis code. ',8(/), 676 | ' ','(Enter 1 to continue, to end): ',$) 677 READ (ir,1001) inum 678 IF (inum.eq.1) THEN 679 WRITE (iw,2602) 680 2602 FORMAT (/, 681 | ' ','II. Description. ',/, 682 | ' ',' Subroutine CHECK is an empty subrouti', 683 | 'ne with a large COMMON area, giving the ',/, 684 | ' ',' user ready access to all of the impor', 685 | 'tant variables in the computations. The',/, 686 | ' ',' routine is called from various locati', 687 | 'ons in the main program and the location',/, 688 | ' ',' spot in the program is labeled by the' 689 | ' flag "itime". The set call locations ',/, 690 | ' ',' are given below: ',/, 691 | ' ',' A. itime = 1 (NUC123, very beginning', 692 | ' of program run) ',/, 693 | ' ',' (appropriate for opening files, i', 694 | 'nitializing variables) ',/, 695 | ' ',' B. itime = 2 (NUC123, right before g', 696 | 'oing into the RUN section) ',/, 697 | ' ',' C. itime = 3 (RUN, right before goin', 698 | 'g into DRIVER to do the computations) ',/, 699 | ' ',' D. itime = 4 (DRIVER, in 1st R-K loo', 700 | 'p after computing derivatives in DERIVS)',/, 701 | ' ',' E. itime = 7 (DRIVER, in 2nd R-K loo', 702 | 'p after computing derivatives in DERIVS)',/, 703 | ' ',' F. itime = 8 (RUN, right after comin', 704 | 'g back from DRIVER) ',/, 705 | ' ',' G. itime = 9 (NUC123, right after co', 706 | 'ming back from the RUN section) ',/, 707 | ' ',' H. itime =10 (NUC123, very end of pr', 708 | 'ogram run) ',/, 709 | ' ',' (appropriate for closing files) ',/, 710 | ' ',' The difference between the (2,9) pair', 711 | 'ing and the (3,8) pairing is that for a ',/, 712 | ' ',' multiple run, the (3,8) pairing would', 713 | ' be called before and after every run ',/, 714 | ' ',' but the (2,9) pairing would be called', 715 | ' before and after the entire sequence. ',4(/), 716 | ' ','(Enter 1 to continue, to end): ',$) 717 READ (ir,1001) inum 718 IF (inum.eq.1) THEN 719 WRITE (iw,2604) 720 2604 FORMAT (/, 721 | ' ','III. Implementation. ',/, 722 | ' ',' The additional program statements ar', 723 | 'e needed in the subroutine CHECK. If a',/, 724 | ' ',' particular command is to be executed', 725 | ' when the computer is at a certain ',/, 726 | ' ',' location in the program -- say label',

    - 13 -

  • /home/parminder/Desktop/par/nuc.fPage 14 of 31 Mon 05 Sep 2011 02:43:03 AM EDT 727 | 'ed by itime = 8 -- then in CHECK, one ',/, 728 | ' ',' must place the command under the sta', 729 | 'tement, IF (itime.eq.8).... The user ',/, 730 | ' ',' is at leisure to place his own locat', 731 | 'ion indicators (5,6) and CALL CHECK ',/, 732 | ' ',' statements anywhere in the program a', 733 | 's long as there is a COMMON /chek/ ',/, 734 | ' ',' statement in the particular subrouti', 735 | 'ne to carry the value of itime along. ',15(/), 736 | ' ','(Enter to go back to help menu): ',$) 737 READ (ir,*) 738 GO TO 300 739 ELSE 740 GO TO 300 741 END IF !(inum.eq.1) 742 ELSE 743 GO TO 300 744 END IF !(inum.eq.1) 745 746 C27--------EXIT SECTION------------------------------------------------------

    --- 747 748 270 CONTINUE !Exit section. 749 RETURN 750 751 C30--------GO BACK TO MAIN MENU----------------------------------------------

    --- 752 753 300 CONTINUE 754 GO TO 100 755 756 END 757 758 759 760 C========================IDENTIFICATION DIVISION=============================

    === 761 762 SUBROUTINE setcom 763 764 C----------LINKAGES. 765 C CALLED BY - [program] nuc123 766 C CALLS - none 767 768 C----------REMARKS. 769 C Allows resetting of computation parameters. 770 771 C----------PARAMETERS. 772 PARAMETER (ir=1) !Input unit number. 773 PARAMETER (iw=1) !Output unit number. 774 775 C----------COMMON AREAS. 776 COMMON /compr0/ cy0,ct0,t9i0,t9f0,ytmin0,inc0 !Default comp parameters

    . 777 COMMON /compr/ cy,ct,t9i,t9f,ytmin,inc !Computation parameters. 778 COMMON /varpr0/ dt0,eta0 !Default variationl para

    ms. 779 COMMON /varpr/ dt1,eta1 !Variational parameters.

    - 14 -

  • /home/parminder/Desktop/par/nuc.fPage 15 of 31 Mon 05 Sep 2011 02:43:03 AM EDT 780 781 782 C==========================DECLARATION DIVISION==============================

    === 783 784 C----------DEFAULT COMPUTATION PARAMETERS. 785 REAL cy0 !Default cy. 786 REAL ct0 !Default ct. 787 REAL t9i0 !Default t9i. 788 REAL t9f0 !Default t9f. 789 REAL ytmin0 !Default ytmin. 790 INTEGER inc0 !Default accumulation increment. 791 792 C----------COMPUTATION PARAMETERS. 793 REAL cy !Time step limiting constant on abundances

    . 794 REAL ct !Time step limiting constant on temperatur

    e. 795 REAL t9i !Initial temperature (in 10**9 K). 796 REAL t9f !Final temperature (in 10**9 K). 797 REAL ytmin !Smallest abundances allowed. 798 INTEGER inc !Accumulation increment. 799 800 C----------DEFAULT VARIATIONAL PARAMETERS. 801 REAL dt0 !Default initial dt. 802 803 C----------VARIATIONAL PARAMETERS. 804 REAL dt1 !Initial time step. 805 806 C----------LOCAL VARIABLES. 807 INTEGER inum !Selection number. 808 809 810 C===========================PROCEDURE DIVISION===============================

    === 811 812 C10--------PRINT RESET SELECTION AND AWAIT RESPONSE--------------------------

    --- 813 814 C..........RETURN FROM LOOPING. 815 100 CONTINUE 816 C..........DISPLAY RESET SELECTIONS. 817 WRITE (iw,1000) cy,ct,dt1,t9i,t9f,ytmin,float(inc) 818 1000 FORMAT (8(/), 819 | ' ',21x,'SET COMPUTATION PARAMETERS SELECTION',/, 820 | ' ',21x,'--- ----------- ---------- ---------',//, 821 | ' ',10x,' 1. CHANGE TIME-STEP LIMITING CONSTANT 1 FROM ', 822 | f5.3,/, 823 | ' ',10x,' 2. CHANGE TIME-STEP LIMITING CONSTANT 2 FROM ', 824 | f5.3,/, 825 | ' ',10x,' 3. CHANGE INITIAL TIME-STEP FROM ', 826 | 1pe8.2,' SECONDS',/, 827 | ' ',10x,' 4. CHANGE INITIAL TEMPERATURE FROM ', 828 | 1pe8.2,' (10**9 K)',/, 829 | ' ',10x,' 5. CHANGE FINAL TEMPERATURE FROM ', 830 | 1pe8.2,' (10**9 K)',/, 831 | ' ',10x,' 6. CHANGE SMALLEST ABUNDANCES ALLOWED FROM ', 832 | 1pe8.2,/,

    - 15 -

  • /home/parminder/Desktop/par/nuc.fPage 16 of 31 Mon 05 Sep 2011 02:43:03 AM EDT 833 | ' ',10x,' 7. CHANGE ACCUMULATION INCREMENT FROM ', 834 | 1pe8.2,' ITERATIONS',/, 835 | ' ',10x,' 8. RESET ALL TO DEFAULT VALUES',/, 836 | ' ',10x,' 9. EXIT',5(/), 837 | ' ',10x,'Enter selection (1-9): ',$) 838 C..........READ IN SELECTION NUMBER. 839 READ (ir,1001) inum 840 1001 FORMAT (i1) 841 842 C20--------BRANCH TO APPROPRIATE SECTION-------------------------------------

    --- 843 844 GO TO (210,220,230,240,250,260,270,280,300),inum 845 GO TO 300 !Improper input or . 846 210 CONTINUE !Change time step limiting const 1 section

    . 847 WRITE (iw,2100) 848 2100 FORMAT (' ','Enter value for time step limiting constant 1: ',$) 849 READ (ir,*) cy 850 2101 FORMAT (f5.3) 851 GO TO 400 852 220 CONTINUE !Change time step limiting const 2 section

    . 853 WRITE (iw,2200) 854 2200 FORMAT (' ','Enter value for time step limiting constant 2: ',$) 855 READ (ir,*) ct 856 GO TO 400 857 230 CONTINUE !Change initial time step section. 858 WRITE (iw,2300) 859 2300 FORMAT (' ','Enter value for initial time step: ',$) 860 READ (ir,*) dt1 861 GO TO 400 862 240 CONTINUE !Change initial temperature section. 863 WRITE (iw,2400) 864 2400 FORMAT (' ','Enter value for initial temperature: ',$) 865 READ (ir,*) t9i 866 GO TO 400 867 250 CONTINUE !Change final temperature section. 868 WRITE (iw,2500) 869 2500 FORMAT (' ','Enter value for final temperature: ',$) 870 READ (ir,*) t9f 871 GO TO 400 872 260 CONTINUE !Change smallest abundances allowed sectio

    n. 873 WRITE (iw,2600) 874 2600 FORMAT (' ','Enter value for smallest abundances allowed: ',$) 875 READ (ir,*) ytmin 876 GO TO 400 877 270 CONTINUE !Change accumulation increment section. 878 WRITE (iw,2700) 879 2700 FORMAT (' ','Enter value for accumulation increment: ',$) 880 READ (ir,*) inc 881 GO TO 400 882 280 CONTINUE !Reset all to default values section. 883 cy = cy0 !Time step limiting constant on abundances

    . 884 ct = ct0 !Time step limiting constant on temperatur

    e.- 16 -

  • /home/parminder/Desktop/par/nuc.fPage 17 of 31 Mon 05 Sep 2011 02:43:03 AM EDT 885 dt1 = dt0 !Time step. 886 t9i = t9i0 !Initial temperature. 887 t9f = t9f0 !Final temperature. 888 ytmin = ytmin0 !Smallest abundances allowed. 889 inc = inc0 !Accumulation increment. 890 WRITE (iw,2800) 891 2800 FORMAT (' ','All values reset to default - Press ' 892 | 'to continue: ',$) 893 READ (ir,*) 894 GO TO 400 895 300 CONTINUE !Exit section. 896 RETURN 897 898 C40--------GO BACK TO MENU---------------------------------------------------

    --- 899 900 400 CONTINUE 901 GO TO 100 902 903 END 904 905 906 907 C========================IDENTIFICATION DIVISION=============================

    === 908 909 SUBROUTINE setmod 910 911 C----------LINKAGES. 912 C CALLED BY - [program] nuc123 913 C CALLS - none 914 915 C----------REMARKS. 916 C Allows resetting of model parameters. 917 918 C----------PARAMETERS. 919 PARAMETER (ir=1) !Input unit number. 920 PARAMETER (iw=1) !Output unit number. 921 922 C----------COMMON AREAS. 923 COMMON /modpr0/ c0,cosmo0,xi0 !Default model parameter

    s. 924 COMMON /modpr/ g,tau,xnu,c,cosmo,xi !Model parameters. 925 COMMON /varpr0/ dt0,eta0 !Default variationl para

    ms. 926 COMMON /varpr/ dt1,eta1 !Variational parameters. 927 928 929 C==========================DECLARATION DIVISION==============================

    === 930 931 C----------DEFAULT MODEL PARAMETERS. 932 REAL c0(3) !Default c. 933 REAL cosmo0 !Default cosmological constant. 934 REAL xi0(3) !Default neutrino degeneracy parameters. 935 936 C----------EARLY UNIVERSE MODEL PARAMETERS. 937 REAL c(3) !c(1) is variation of gravitational consta

    - 17 -

  • /home/parminder/Desktop/par/nuc.fPage 18 of 31 Mon 05 Sep 2011 02:43:03 AM EDT

    t. 938 | !c(2) is neutron lifetime (sec). 939 | !c(3) is number of neutrino species. 940 REAL cosmo !Cosmological constant. 941 REAL xi(3) !Neutrino degeneracy parameters. 942 943 C----------DEFAULT VARIATIONAL PARAMETERS. 944 REAL eta0 !Default eta. 945 946 C----------VARIATIONAL PARAMETERS. 947 REAL eta1 !Intial baryon-to-photon ratio. 948 949 C----------USER RESPONSE VARIABLES. 950 INTEGER inum !Selection number. 951 952 953 C===========================PROCEDURE DIVISION===============================

    === 954 955 C10--------PRINT RESET SELECTION AND AWAIT RESPONSE--------------------------

    --- 956 957 C..........RETURN FROM LOOPING. 958 100 CONTINUE 959 C..........DISPLAY RESET SELECTIONS. 960 WRITE (iw,1000) c(1),c(2),c(3),eta1,cosmo,xi(1),xi(2),xi(3) 961 1000 FORMAT (8(/), 962 | ' ',24x,'SET MODEL PARAMETERS SELECTION',/, 963 | ' ',24x,'--- ----- ---------- ---------',//, 964 | ' ',10x,' 1. CHANGE GRAVITATIONAL CONSTANT FROM ', 965 | 1pe10.3,/, 966 | ' ',10x,' 2. CHANGE NEUTRON LIFETIME FROM ', 967 | 1pe10.3,' SECONDS',/, 968 | ' ',10x,' 3. CHANGE NUMBER OF NEUTRINO SPECIES FROM ', 969 | 1pe10.3,/, 970 | ' ',10x,' 4. CHANGE FINAL BARYON-TO-PHOTON RATIO FROM ', 971 | 1pe10.3,/, 972 | ' ',10x,' 5. CHANGE COSMOLOGICAL CONSTANT FROM ', 973 | 1pe10.3,/, 974 | ' ',10x,' 6. CHANGE XI-ELECTRON FROM ', 975 | 1pe10.3,/, 976 | ' ',10x,' 7. CHANGE XI-MUON FROM ', 977 | 1pe10.3,/, 978 | ' ',10x,' 8. CHANGE XI-TAUON FROM ', 979 | 1pe10.3,/, 980 | ' ',10x,' 9. RESET ALL TO DEFAULT VALUES',/, 981 | ' ',10x,'10. EXIT',4(/), 982 | ' ',10x,' Enter selection (1-10): ',$) 983 C..........READ IN SELECTION NUMBER. 984 READ (ir,1001) inum 985 1001 FORMAT (i2) 986 987 C20--------BRANCH TO APPROPRIATE SECTION-------------------------------------

    --- 988 989 GO TO (210,220,230,240,250,260,270,280,290,300),inum 990 GO TO 300 !Improper input or . 991 210 CONTINUE !Change gravitational constant section.

    - 18 -

  • /home/parminder/Desktop/par/nuc.fPage 19 of 31 Mon 05 Sep 2011 02:43:03 AM EDT 992 WRITE (iw,2100) 993 2100 FORMAT (' ','Enter value for variation of gravitational ', 994 | 'constant: ',$) 995 READ (ir,*) c(1) 996 GO TO 400 997 220 CONTINUE !Change neutron lifetime section. 998 WRITE (iw,2200) 999 2200 FORMAT (' ','Enter value for neutron lifetime (sec): ',$)1000 READ (ir,*) c(2)1001 GO TO 4001002 230 CONTINUE !Change number of neutrino species section

    .1003 WRITE (iw,2300)1004 2300 FORMAT (' ','Enter value for number of neutrino species: ',$)1005 READ (ir,*) c(3)1006 GO TO 4001007 240 CONTINUE !Change baryon-to-photon ratio section.1008 WRITE (iw,2400)1009 2400 FORMAT (' ','Enter value for baryon-to-photon ratio: ',$)1010 READ (ir,*) eta11011 GO TO 4001012 250 CONTINUE !Change cosmological constant section.1013 WRITE (iw,2500)1014 2500 FORMAT (' ','Enter value for cosmological constant: ',$)1015 READ (ir,*) cosmo1016 GO TO 4001017 260 CONTINUE !Change neutrino degeneracy section.1018 WRITE (iw,2600)1019 2600 FORMAT (' ','Enter value for xi electron: ',$)1020 READ (ir,*) xi(1)1021 GO TO 4001022 270 CONTINUE !Change neutrino degeneracy section.1023 WRITE (iw,2700)1024 2700 FORMAT (' ','Enter value for xi muon: ',$)1025 READ (ir,*) xi(2)1026 GO TO 4001027 280 CONTINUE !Change neutrino degeneracy section.1028 WRITE (iw,2800)1029 2800 FORMAT (' ','Enter value for xi tauon: ',$)1030 READ (ir,*) xi(3)1031 IF ((xi(3).ne.0.).and.(c(3).lt.3.)) THEN1032 c(3) = 3.1033 WRITE (iw,2802)1034 2802 FORMAT (' ','Number of neutrinos set to 3')1035 WRITE (iw,2804)1036 2804 FORMAT (' ','Press to continue: ',$)1037 READ (ir,*)1038 END IF1039 GO TO 4001040 290 CONTINUE !Reset all to default values section.1041 c(1) = c0(1)1042 c(2) = c0(2)1043 c(3) = c0(3)1044 cosmo = cosmo01045 xi(1) = xi0(1)1046 xi(2) = xi0(2)1047 xi(3) = xi0(3)1048 eta1 = eta0

    - 19 -

  • /home/parminder/Desktop/par/nuc.fPage 20 of 31 Mon 05 Sep 2011 02:43:03 AM EDT1049 WRITE (iw,2900)1050 2900 FORMAT (' ','All values reset to default - Press '1051 | 'to continue: ',$)1052 READ (ir,*)1053 GO TO 4001054 300 CONTINUE !Exit section.1055 RETURN1056 1057 C40--------GO BACK TO MENU---------------------------------------------------

    ---1058 1059 400 CONTINUE1060 GO TO 1001061 1062 END1063 1064 1065 1066 C========================IDENTIFICATION DIVISION=============================

    ===1067 1068 SUBROUTINE run1069 1070 C----------LINKAGES.1071 C CALLED BY - [program] nuc1231072 C CALLS - [subroutine] driver1073 1074 C----------REMARKS.1075 C Activates computation routine.1076 1077 C----------PARAMETERS.1078 PARAMETER (ir=1) !Input unit number.1079 PARAMETER (iw=1) !Output unit number.1080 PARAMETER (nrec=88) !Number of nuclear reactions.1081 PARAMETER (lrec=64) !Total # of nuclear reactions for irun = 2

    .1082 PARAMETER (krec=34) !Total # of nuclear reactions for irun = 3

    .1083 PARAMETER (nnuc=26) !Number of nuclides in calculation.1084 PARAMETER (lnuc=18) !Total # of nuclides for irun = 2.1085 PARAMETER (knuc=9) !Total # of nuclides for irun = 3.1086 1087 C----------COMMON AREAS.1088 COMMON /modpr/ g,tau,xnu,c,cosmo,xi !Model parameters.1089 COMMON /varpr/ dt1,eta1 !Variational parameters.1090 COMMON /chek/ itime !Computation location.1091 COMMON /runopt/ irun,isize,jsize !Run options.1092 1093 1094 C==========================DECLARATION DIVISION==============================

    ===1095 1096 C----------MODEL PARAMETERS.1097 REAL eta1 !Baryon-to-photon ratio.1098 REAL c(3) !c(1) is variation of gravitational consta

    nt.1099 | !c(2) is neutron lifetime (sec).1100 | !c(3) is number of neutrino species.

    - 20 -

  • /home/parminder/Desktop/par/nuc.fPage 21 of 31 Mon 05 Sep 2011 02:43:03 AM EDT1101 REAL cosmo !Cosmological constant.1102 REAL xi(3) !Neutrino degeneracy parameters.1103 1104 C----------RUN OPTION.1105 INTEGER irun !Run network size.1106 INTEGER isize !Number of nuclides in computation.1107 INTEGER jsize !Number of reactions in computation.1108 1109 C----------USER INTERACTION VARIABLES.1110 REAL rnumb1 !Run parameter for outer loop.1111 REAL rnumb2 !Run parameter for middle loop.1112 REAL rnumb3 !Run parameter for inner loop.1113 REAL rnum1(3) !Run parameter starting value.1114 REAL rnum2(3) !Run parameter end value.1115 REAL rnum3(3) !Run parameter increment.1116 INTEGER inumb !Selection number.1117 INTEGER inum(3) !Selection number.1118 INTEGER jnum !Number of loopings to be done.1119 INTEGER knum !Number of loopings rejected.1120 INTEGER lnumb1 !Run parameter for outer loop.1121 INTEGER lnumb2 !Run parameter for middle loop.1122 INTEGER lnumb3 !Run parameter for inner loop.1123 INTEGER lnum(3) !Run parameter end value.1124 CHARACTER lchose !User response (alphanumeric).1125 1126 C----------FLAG AND LABELS.1127 INTEGER itime !Computation location.1128 CHARACTER*22 vtype(8) !Label for quantities being varied.1129 1130 C----------EQUIVALENCE VARIABLE.1131 REAL qvary(7) !Array set equal to c, cosmo, and xi.1132 1133 C----------EQUIVALENCE STATEMENTS.1134 EQUIVALENCE (qvary(1),c(1)), (qvary(4),cosmo), (qvary(5),xi(1))1135 1136 1137 C==============================DATA DIVISION=================================

    ===1138 1139 C----------LABELS FOR QUANTITIES BEING VARIED.1140 DATA vtype /'baryon/photon ratio ',1141 | 'gravitational constant',1142 | 'neutron lifetime ',1143 | '# of neutrino species ',1144 | 'cosmological constant ',1145 | 'xi-electron ',1146 | 'xi-muon ',1147 | 'xi-tauon '/1148 1149 1150 C===========================PROCEDURE DIVISION===============================

    ===1151 1152 C10--------PRINT RUN SELECTION AND AWAIT RESPONSE----------------------------

    ---1153 1154 C..........RETURN FROM LOOPING.1155 100 CONTINUE

    - 21 -

  • /home/parminder/Desktop/par/nuc.fPage 22 of 31 Mon 05 Sep 2011 02:43:03 AM EDT1156 C..........DISPLAY RUN SELECTIONS.1157 WRITE (iw,1000)1158 1000 FORMAT (8(/),1159 | ' ',32x,'RUN SELECTION',/,1160 | ' ',32x,'--- ---------',//,1161 | ' ',27x,' 1. SET RUN NETWORK',/,1162 | ' ',27x,' 2. GO',/,1163 | ' ',27x,' 3. DO MULTIPLE RUNS',/,1164 | ' ',27x,' 4. EXIT',10(/),1165 | ' ',27x,' Enter selection (1-4): ',$)1166 C..........READ IN SELECTION NUMBER.1167 READ (ir,1001) inumb1168 1001 FORMAT (i1)1169 1170 C20--------BRANCH TO APPROPRIATE SECTION-------------------------------------

    ---1171 1172 GO TO (210,220,230,240),inumb1173 GO TO 240 !Improper input or .1174 1175 C21--------SET RUN NETWORK SECTION-------------------------------------------

    ---1176 1177 210 CONTINUE1178 WRITE (iw,2100)1179 2100 FORMAT (' ','Enter network size (1-26 nuclides (default); ',1180 | '2-18; 3-9): ',$)1181 READ (ir,*) inumb !Read in selection number.1182 IF ((inumb.ne.1).and.(inumb.ne.2).and.(inumb.ne.3)) inumb = 1 !Defau

    lt.1183 IF (inumb.ne.irun) THEN !Run network changed from previously.1184 irun = inumb !Run network size selection.1185 END IF1186 IF (irun.eq.1) THEN !Maximal network size.1187 isize = nnuc1188 jsize = nrec1189 ELSE1190 IF (irun.eq.2) THEN !Abridged network size.1191 isize = lnuc1192 jsize = lrec1193 ELSE1194 IF (irun.eq.3) THEN !Minimal network size.1195 isize = knuc1196 jsize = krec1197 END IF1198 END IF1199 END IF !(irun.eq.1) 1200 WRITE (iw,2104) irun1201 2104 FORMAT (' ','Run network set to ',i1,' - Press ',1202 | 'to continue: ',$)1203 READ (ir,*)1204 GO TO 3001205 1206 C22--------GO SECTION--------------------------------------------------------

    ---1207 1208 220 CONTINUE1209 WRITE (iw,2200)

    - 22 -

  • /home/parminder/Desktop/par/nuc.fPage 23 of 31 Mon 05 Sep 2011 02:43:03 AM EDT1210 2200 FORMAT (' ','Begin computation run....')1211 itime = 31212 CALL check !Call interface subr before computation.1213 CALL driver !Do nucleosynthesis computation.1214 itime = 81215 CALL check !Call interface subr after computation.1216 WRITE (iw,2202)1217 2202 FORMAT (' ','Computation completed - Press to '1218 | 'continue: ',$)1219 READ (ir,*)1220 GO TO 3001221 1222 C23--------DO MULTIPLE RUNS SECTION------------------------------------------

    ---1223 1224 C..........GET NUMBER OF LOOPINGS.1225 230 CONTINUE1226 WRITE (iw,2300)1227 2300 FORMAT (' ','Enter the number of loopings to be done (1 ',1228 | '(default); 2; 3): ',$)1229 READ (ir,*) jnum !Read in number of loopings to be done.1230 IF ((jnum.ne.1).and.(jnum.ne.2).and.(jnum.ne.3)) THEN1231 jnum = 1 !Default number of loopings.1232 END IF1233 knum = 0. !No loopings rejected for now.1234 DO i = 1,31235 IF (i.gt.jnum) THEN1236 rnum1(i) = 0. !Initialize initial parameter.1237 rnum2(i) = 0. !Initialize terminal parameter.1238 rnum3(i) = 1. !Initialize incremental parameter.1239 inum(i) = 0 !Initialize selection number.1240 ELSE1241 C..........OBTAIN QUANTITY TO VARY.1242 WRITE (iw,2302)1243 2302 FORMAT (8(/),1244 | ' ',30x,'QUANTITY TO VARY',/,1245 | ' ',30x,'-------- -- ----',//,1246 | ' ',25x,' 1. ETA (LOGRITHMIC VARIATION)',/,1247 | ' ',25x,' 2. G (LINEAR VARIATION)',/,1248 | ' ',25x,' 3. TAU (LINEAR VARIATION)',/,1249 | ' ',25x,' 4. # NEUTRINOS (LINEAR VARIATION)',/,1250 | ' ',25x,' 5. LAMBDA (LINEAR VARIATION)',/,1251 | ' ',25x,' 6. XI-ELECTRON (LINEAR VARIATION)',/,1252 | ' ',25x,' 7. XI-MUON (LINEAR VARIATION)',/,1253 | ' ',25x,' 8. XI-TAUON (LINEAR VARIATION)',/,1254 | ' ',25x,' 9. NO SELECTION',5(/),1255 | ' ',25x,' Enter selection (1-9): ',$)1256 READ (ir,1001) inum(i)1257 IF ((inum(i).lt.1).or.(inum(i).gt.8)) THEN !No selection made.1258 WRITE (iw,2304)1259 2304 FORMAT (' ','No selection made - Reduce number of ',1260 | 'loopings by one',/,1261 | ' ','Press to continue: ',$)1262 READ (ir,*)1263 knum = knum + 1 !Step up number of loopings rejected.1264 rnum1(i) = 0. !Initialize initial parameter.1265 rnum2(i) = 0. !Initialize terminal parameter.1266 rnum3(i) = 1. !Initialize incremental parameter.

    - 23 -

  • /home/parminder/Desktop/par/nuc.fPage 24 of 31 Mon 05 Sep 2011 02:43:03 AM EDT1267 inum(i) = 0 !Initialize selection number.1268 ELSE !((inum(i).ge.1).and.(inum(i).le.8)) 1269 C..........INPUT RUN SPECIFICATIONS.1270 231 CONTINUE1271 WRITE (iw,2306)1272 2306 FORMAT (' ','Enter minimum value: ',$)1273 READ (ir,*) rnum1(i) !Read in starting value.1274 WRITE (iw,2308)1275 2308 FORMAT (' ','Enter maximum value: ',$)1276 READ (ir,*) rnum2(i) !Read in terminating value.1277 232 CONTINUE1278 WRITE (iw,2310)1279 2310 FORMAT (' ','Enter increment: ',$)1280 READ (ir,*) rnum3(i) !Read in incremental value.1281 IF (rnum3(i).eq.0.) THEN !Trouble with 0 division later on.1282 WRITE (iw,2312)1283 2312 FORMAT (' ','Zero increment not allowed: trouble with ',1284 | 'dividing by zero')1285 GO TO 2321286 END IF 1287 WRITE (iw,2314) rnum1(i), rnum2(i), rnum3(i) !Display input in

    fo.1288 2314 FORMAT (' ','Run from ',1pe12.5,' to ',1pe12.5,1289 | ' in increments of ',1pe12.5)1290 WRITE (iw,2316)1291 2316 FORMAT (' ','Confirm these values (Y or N): ',$)1292 READ (ir,2301) lchose !Get confirmation

    .1293 2301 FORMAT (a1)1294 IF ((lchose.ne.'Y').and.(lchose.ne.'y')) GO TO 2311295 END IF !((inum(i).lt.1).or.(inum(i).gt.8)) 1296 END IF !(i.gt.jnum) 1297 END DO !i = 1,31298 jnum = jnum-knum !Number of valid loopings.1299 IF (jnum.ne.0) THEN !Run requested.1300 C..........WRITE OUT QUANTITY TO VARY, RUN SPECIFICATIONS.1301 DO l = 1,jnum+knum !Check all loopings.1302 IF (inum(l).ne.0) THEN !Proper selection was made.1303 WRITE (iw,2318) vtype(inum(l)),rnum1(l), !Display run para

    ms.1304 | rnum2(l), rnum3(l)1305 2318 FORMAT (' ','Run ',a22,/,1306 | ' from ',1pe12.5,' to ',1pe12.5,1307 | ' in increments of ',1pe12.5)1308 C..........GET LOGS OF eta VALUES FOR LOGRITHMIC INCREMENTATION.1309 IF (inum(l).eq.1) THEN !Work with exponents for eta increments

    .1310 rnum1(l) = log10(rnum1(l))1311 rnum2(l) = log10(rnum2(l))1312 END IF1313 END IF1314 END DO1315 C..........COMPUTE NUMBER OF RUNS FOR EACH LOOPING.1316 DO l = 1,31317 lnum(l) = nint((rnum2(l)-rnum1(l)+rnum3(l))/rnum3(l))1318 END DO1319 C..........DO MULTIPLE RUNS.1320 WRITE (iw,2200) !Inform user of beginning of computation.

    - 24 -

  • /home/parminder/Desktop/par/nuc.fPage 25 of 31 Mon 05 Sep 2011 02:43:03 AM EDT1321 DO lnumb1 = 0,lnum(1)-1 !Outer loop.1322 rnumb1 = rnum1(1)+float(lnumb1)*rnum3(1) !Value of param for run

    .1323 IF ((inum(1).ge.1).and.(inum(1).le.8)) THEN1324 IF (inum(1).eq.1) THEN1325 eta1 = 10**rnumb1 !Vary baryon-to-photon ratio.1326 ELSE 1327 qvary(inum(1)-1) = rnumb1 !Vary other quantities.1328 END IF1329 END IF1330 DO lnumb2 = 0,lnum(2)-1 !Middle loop.1331 rnumb2 = rnum1(2)+float(lnumb2)*rnum3(2) !Value of param for r

    un.1332 IF ((inum(2).ge.1).and.(inum(2).le.8)) THEN1333 IF (inum(2).eq.1) THEN1334 eta1 = 10**rnumb2 !Vary baryon-to-photon ratio.1335 ELSE 1336 qvary(inum(2)-1) = rnumb2 !Vary other quantities.1337 END IF1338 END IF1339 DO lnumb3 = 0,lnum(3)-1 !Inner loop.1340 rnumb3 = rnum1(3)+float(lnumb3)*rnum3(3) !Value of parameter

    .1341 IF ((inum(3).ge.1).and.(inum(3).le.8)) THEN1342 IF (inum(3).eq.1) THEN1343 eta1 = 10**rnumb3 !Vary baryon-to-photon ratio.1344 ELSE 1345 qvary(inum(3)-1) = rnumb3 !Vary other quantities.1346 END IF1347 END IF1348 itime = 31349 CALL check !Check interface subr before computation.1350 CALL driver !Do nucleosynthesis computation.1351 itime = 81352 CALL check !Check interface subroutine after computat

    ion.1353 END DO !lnumb3 = 0,lnum(3)-1 1354 END DO !lnumb2 = 0,lnum(2)-1 1355 END DO !lnumb1 = 0,lnum(1)-1 1356 WRITE (iw,2202) !Inform user of completion of computation.1357 ELSE !(jnum.eq.0)1358 WRITE (iw,2320)1359 2320 FORMAT (' ','No selection made - ',1360 | 'Press to continue: ',$) 1361 END IF !(jnum.ne.0) 1362 READ (ir,*)1363 GO TO 3001364 1365 C24--------EXIT SECTION------------------------------------------------------

    ---1366 1367 240 CONTINUE1368 RETURN1369 1370 C30--------GO BACK TO MENU---------------------------------------------------

    ---1371 1372 300 CONTINUE

    - 25 -

  • /home/parminder/Desktop/par/nuc.fPage 26 of 31 Mon 05 Sep 2011 02:43:03 AM EDT1373 GO TO 1001374 1375 END1376 1377 1378 1379 C========================IDENTIFICATION DIVISION=============================

    ===1380 1381 SUBROUTINE output1382 1383 C----------LINKAGES.1384 C CALLED BY - [program] nuc1231385 C CALLS - none1386 1387 C----------REMARKS.1388 C Outputs computational results either into an output file or onto 1389 C the screen1390 1391 C----------PARAMETERS.1392 PARAMETER (ir=1) !Input unit number.1393 PARAMETER (iw=1) !Output unit number.1394 PARAMETER (nnuc=26) !Number of nuclides in calculation.1395 PARAMETER (itmax=40) !Maximum # of line to be printed.1396 1397 C----------COMMON AREAS.1398 COMMON /compr/ cy,ct,t9i,t9f,ytmin,inc !Computation parameters.1399 COMMON /modpr/ g,tau,xnu,c,cosmo,xi !Model parameters.1400 COMMON /flags/ ltime,is,ip,it,mbad !Flags, counters.1401 COMMON /outdat/ xout,thmout,t9out,tout,dtout, !Output data.1402 | etaout,hubout1403 COMMON /outopt/ nout,outfile !Output option.1404 1405 1406 C==========================DECLARATION DIVISION==============================

    ===1407 1408 C----------COMPUTATION SETTINGS.1409 REAL cy !Time step limiting constant on abundances

    .1410 REAL ct !Time step limiting constant on temperatur

    e.1411 REAL t9i !Initial temperature (in 10**9 K).1412 REAL t9f !Final temperature (in 10**9 K).1413 REAL ytmin !Smallest abundances allowed.1414 1415 C----------EARLY UNIVERSE MODEL PARAMETERS.1416 REAL c(3) !c(1) is variation of gravitational consta

    nt.1417 | !c(2) is neutron lifetime (sec).1418 | !c(3) is number of neutrino species.1419 REAL cosmo !Cosmological constant.1420 REAL xi(3) !Neutrino degeneracy parameters.1421 1422 C----------COUNTER.1423 INTEGER it !# times accumulated in output buffer.1424 1425 C----------OUTPUT ARRAYS.

    - 26 -

  • /home/parminder/Desktop/par/nuc.fPage 27 of 31 Mon 05 Sep 2011 02:43:03 AM EDT1426 REAL xout(itmax,nnuc) !Nuclide mass fractions.1427 REAL thmout(itmax,6) !Thermodynamic variables.1428 REAL t9out(itmax) !Temperature (in units of 10**9 K).1429 REAL tout(itmax) !Time.1430 REAL dtout(itmax) !Time step.1431 REAL etaout(itmax) !Baryon-to-photon ratio.1432 REAL hubout(itmax) !Expansion rate.1433 1434 C----------OUTPUT FILE STATUS.1435 INTEGER nout !Number of output requests.1436 LOGICAL outfile !Indicates if output file used.1437 1438 C----------USER INTERACTION VARIABLES.1439 INTEGER inum !Selection number.1440 1441 1442 C===========================PROCEDURE DIVISION===============================

    ===1443 1444 C10--------PRINT OUTPUT SELECTION AND AWAIT RESPONSE-------------------------

    ---1445 1446 C..........RETURN FROM LOOPING.1447 100 CONTINUE1448 C..........DISPLAY OUTPUT SELECTIONS.1449 WRITE (iw,1000)1450 1000 FORMAT (8(/),1451 | ' ',30x,'OUTPUT SELECTION',/,1452 | ' ',30x,'------ ---------',//,1453 | ' ',25x,' 1. REQUEST OUTPUT FILE',/,1454 | ' ',25x,' 2. REQUEST OUTPUT ON SCREEN',/,1455 | ' ',25x,' 3. EXIT',11(/),1456 | ' ',25x,' Enter selection (1-3): ',$)1457 C..........READ IN SELECTION NUMBER.1458 READ (ir,1001) inum1459 1001 FORMAT (i1)1460 C..........BRANCH TO APPROPRIATE SECTION.1461 GO TO (200,300,400),inum1462 GO TO 400 !Improper input or .1463 1464 C20--------REQUEST OUTPUT SECTION--------------------------------------------

    ---1465 1466 200 CONTINUE1467 c DO j = 1,it !Temperature in MeV.1468 c t9out(j) = t9out(j)*.086171469 c END DO1470 c DO j = 1,it !Energy density as fraction of total.1471 c thmout(j,1) = thmout(j,1)/thmout(j,6) !Rhog.1472 c thmout(j,2) = thmout(j,2)/thmout(j,6) !Rhoe.1473 c thmout(j,3) = thmout(j,3)/thmout(j,6) !Rhone.1474 c thmout(j,4) = thmout(j,4)/thmout(j,6) !Rhob.1475 c END DO1476 C..........PRINT CAPTION. 1477 nout = nout + 1 !Keep track of number of output requests.1478 IF (nout.eq.1) THEN1479 WRITE (2,2000)1480 2000 FORMAT (54x,'NUCLIDE ABUNDANCE YIELDS',/,

    - 27 -

  • /home/parminder/Desktop/par/nuc.fPage 28 of 31 Mon 05 Sep 2011 02:43:03 AM EDT1481 | 54x,'------- --------- ------',//)1482 END IF1483 WRITE (2,2002) cy,ct,t9i,t9f,ytmin1484 2002 FORMAT (' Computational parameters:',/,1485 | ' cy = ',f5.3,'/ ct = ',f5.3,1486 | '/ initial temp = ',1pe8.2,1487 | '/ final temp = ',1pe8.2,1488 | '/ smallest abundances allowed = ',1pe8.2)1489 WRITE (2,2004) c(1),c(2),c(3),cosmo,xi(1),xi(2),xi(3)1490 2004 FORMAT (' Model parameters:',/,1491 | ' g = ',f5.2,'/ tau = ',f6.2,1492 | '/ # nu = ',f5.2,'/ lambda = ',1pe10.3,1493 | '/ xi-e = ',e10.3,'/ xi-m = ',e10.3,1494 | '/ xi-t = ',e10.3,/)1495 C..........PRINT HEADINGS, ABUNDANCES FOR NEUTRON TO LI8. 1496 WRITE (2,2006)1497 2006 FORMAT (4x,'Temp',8x,'N/H',10x,'P',10x,'D/H',9x,'T/H',8x,1498 | 'He3/H',8x,'He4',8x,'Li6/H',7x,'Li7/H',7x,1499 | 'Be7/H',6x,'Li8/H&up',/,132('-'))1500 DO j = 1,it1501 WRITE (2,2008) t9out(j),(xout(j,i),i=1,10)1502 2008 FORMAT (1pe10.3,1p10e12.3)1503 END DO1504 C..........PRINT THERMODYNAMIC QUANTITIES. 1505 WRITE (2,2010)1506 2010 FORMAT (' ',/,4x,'Temp',9x,'T',10x,'rhog',8x,'rhoe',7x,1507 | 'rhone',8x,'rhob',8x,'phie',9x,'dt',9x,1508 | 'eta',10x,'H',/,132('-')) 1509 DO j = 1,it1510 WRITE (2,2012) t9out(j),tout(j),(thmout(j,i),i=1,5),dtout(j),1511 | etaout(j),hubout(j)1512 2012 FORMAT (1pe10.3,9e12.3)1513 END DO1514 WRITE (2,2014)1515 2014 FORMAT (///)1516 outfile = .true. !Output file requested. 1517 WRITE (iw,2016)1518 2016 FORMAT (' ','Output file requested - Press to '1519 | 'continue: ',$)1520 READ (ir,*)1521 GO TO 5001522 1523 C30--------REQUEST OUTPUT ON SCREEN SECTION----------------------------------

    ---1524 1525 C..........RETURN FROM LOOPING.1526 300 CONTINUE1527 c DO j = 1,it !Temperature in MeV.1528 c t9out(j) = t9out(j)*.08617 1529 c END DO1530 c DO j = 1,it !Energy density as fraction of total.1531 c thmout(j,1) = thmout(j,1)/thmout(j,6) !Rhog.1532 c thmout(j,2) = thmout(j,2)/thmout(j,6) !Rhoe.1533 c thmout(j,3) = thmout(j,3)/thmout(j,6) !Rhone.1534 c thmout(j,4) = thmout(j,4)/thmout(j,6) !Rhob.1535 c END DO1536 C..........DISPLAY SCREEN OUTPUT SELECTIONS.1537 WRITE (iw,3000)

    - 28 -

  • /home/parminder/Desktop/par/nuc.fPage 29 of 31 Mon 05 Sep 2011 02:43:03 AM EDT1538 3000 FORMAT (8(/),1539 | ' ',26x,'SCREEN OUTPUT SELECTION',/,1540 | ' ',26x,'------ ------ ---------',//,1541 | ' ',25x,' 1. DISPLAY D,T,HE3,HE4,LI7',/,1542 | ' ',25x,' 2. DISPLAY N,P,LI6,BE7,LI8&UP',/,1543 | ' ',25x,' 3. DISPLAY RHOG,RHOE,RHONE,RHOB',/,1544 | ' ',25x,' 4. DISPLAY T,DT,PHIE,ETA,H',/,1545 | ' ',25x,' 5. EXIT',9(/),1546 | ' ',25x,' Enter selection (1-5): ',$)1547 C..........READ IN SELECTION NUMBER.1548 READ (ir,1001) inum1549 GO TO (310,320,330,340,350),inum1550 GO TO 350 !Improper input or .1551 310 CONTINUE !Display d,t,he3,he4,li7.1552 C..........PRINT CAPTION.1553 WRITE (iw,2014)1554 WRITE (iw,3100) cy,ct,t9i,t9f,ytmin1555 3100 FORMAT (' ','Computational parameters:',/,1556 | ' ',' cy = ',f5.3,'/ ct = ',f5.3,1557 | '/ initial temp = ',1pe8.2,1558 | '/ final temp = ',1pe8.2,/,1559 | ' ',' smallest abundances allowed = ',1pe8.2)1560 WRITE (iw,3102) c(1),c(2),c(3),cosmo,xi(1),xi(2),xi(3)1561 3102 FORMAT (' ','Model parameters:',/,1562 | ' ',' g = ',f5.2,'/ tau = ',f6.2,1563 | '/ # nu = ',f5.2,'/ lambda = ',1pe10.3,/,1564 | ' ',' xi-e = ',e10.3,'/ xi-m = ',e10.3,1565 | '/ xi-t = ',e10.3,/)1566 C..........PRINT HEADINGS, ABUNDANCES FOR D,T,HE3,HE4,LI7. 1567 WRITE (iw,3104)1568 3104 FORMAT (4x,'Temp',8x,'D/H',9x,'T/H',8x,'He3/H',8x,1569 | 'He4',8x,'Li7/H',/,' ',80('-'))1570 DO j = 1,it1571 WRITE (iw,3106) t9out(j),(xout(j,i),i=3,6),xout(j,8)1572 3106 FORMAT (1pe10.3,1p5e12.3)1573 END DO1574 WRITE (iw,2014)1575 WRITE (iw,3108)1576 3108 FORMAT (' ','Press to continue: ',$)1577 READ (ir,*)1578 GO TO 3601579 320 CONTINUE !Display n,p,li6,be7,li8&up.1580 C..........PRINT CAPTION.1581 WRITE (iw,2014)1582 WRITE (iw,3100) cy,ct,t9i,t9f,ytmin1583 WRITE (iw,3102) c(1),c(2),c(3),cosmo,xi(1),xi(2),xi(3)1584 C..........PRINT HEADINGS, ABUNDANCES FOR N,P,LI6,BE7,LI8&UP.1585 WRITE (iw,3204)1586 3204 FORMAT (4x,'Temp',8x,'N/H',10x,'P',9x,1587 | 'Li6/H',7x,'Be7/H',6x,'Li8/H&up',/,' ',80('-'))1588 DO j = 1,it1589 WRITE (iw,3106) t9out(j),(xout(j,i),i=1,2),xout(j,7),1590 | (xout(j,i),i=9,10)1591 END DO1592 WRITE (iw,2014)1593 WRITE (iw,3108)1594 READ (ir,*)1595 GO TO 360

    - 29 -

  • /home/parminder/Desktop/par/nuc.fPage 30 of 31 Mon 05 Sep 2011 02:43:03 AM EDT1596 330 CONTINUE !Display rhog,rhoe,rhone,rhob.1597 C..........PRINT CAPTION.1598 WRITE (iw,2014)1599 WRITE (iw,3100) cy,ct,t9i,t9f,ytmin1600 WRITE (iw,3102) c(1),c(2),c(3),cosmo,xi(1),xi(2),xi(3)1601 C..........PRINT ENERGY DENSITIES.1602 WRITE (iw,3304)1603 3304 FORMAT (4x,'Temp',8x,'rhog',8x,'rhoe',7x,'rhone',8x,'rhob',1604 | /,' ',80('-'))1605 DO j = 1,it1606 WRITE (iw,3306) t9out(j),(thmout(j,i),i=1,4)1607 3306 FORMAT (1pe10.3,4e12.3)1608 END DO1609 WRITE (iw,2014)1610 WRITE (iw,3108)1611 READ (ir,*)1612 GO TO 3601613 340 CONTINUE !Display t,dt,phie,eta,hubcst.1614 C..........PRINT CAPTION.1615 WRITE (iw,2014)1616 WRITE (iw,3100) cy,ct,t9i,t9f,ytmin1617 WRITE (iw,3102) c(1),c(2),c(3),cosmo,xi(1),xi(2),xi(3)1618 C..........PRINT THERMODYNAMIC QUANTITIES. 1619 WRITE (iw,3404)1620 3404 FORMAT (4x,'Temp',8x,'time',8x,'phie',9x,'dt',9x,'eta',10x,1621 | 'H',/,' ',80('-'))1622 DO j = 1,it1623 WRITE (iw,3406) t9out(j),tout(j),thmout(j,5),dtout(j),1624 | etaout(j),hubout(j)1625 3406 FORMAT (1pe10.3,5e12.3)1626 END DO1627 WRITE (iw,2014)1628 WRITE (iw,3108)1629 READ (ir,*)1630 GO TO 3601631 350 CONTINUE !Exit.1632 GO TO 5001633 360 CONTINUE1634 GO TO 3001635 1636 C40--------EXIT SECTION------------------------------------------------------

    ---1637 1638 400 CONTINUE1639 RETURN1640 1641 C50--------GO BACK TO MENU---------------------------------------------------

    ---1642 1643 500 CONTINUE1644 GO TO 1001645 1646 END1647

    - 30 -

  • /home/parminder/Desktop/par/nuc.fPage 31 of 31 Mon 05 Sep 2011 02:43:03 AM EDT1648

    - 31 -