Class: Chem::G98::Link

Inherits:
Object
  • Object
show all
Defined in:
lib/chem/db/g98.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(major, minor, parameters, goto, gr) ⇒ Link

Returns a new instance of Link.



30
31
32
33
34
35
36
# File 'lib/chem/db/g98.rb', line 30

def initialize major, minor, parameters, goto, gr
  @major_number = major
  @minor_number = minor
  @parameters = parameters
  @goto = goto
  @gaussian_result = gr
end

Instance Attribute Details

Returns the value of attribute default_link.



29
30
31
# File 'lib/chem/db/g98.rb', line 29

def default_link
  @default_link
end

#gotoObject (readonly)

Returns the value of attribute goto.



29
30
31
# File 'lib/chem/db/g98.rb', line 29

def goto
  @goto
end

Returns the value of attribute jump_link.



28
29
30
# File 'lib/chem/db/g98.rb', line 28

def jump_link
  @jump_link
end

#major_numberObject (readonly)

Returns the value of attribute major_number.



29
30
31
# File 'lib/chem/db/g98.rb', line 29

def major_number
  @major_number
end

#minor_numberObject (readonly)

Returns the value of attribute minor_number.



29
30
31
# File 'lib/chem/db/g98.rb', line 29

def minor_number
  @minor_number
end

Returns the value of attribute next_link.



28
29
30
# File 'lib/chem/db/g98.rb', line 28

def next_link
  @next_link
end

#parametersObject (readonly)

Returns the value of attribute parameters.



29
30
31
# File 'lib/chem/db/g98.rb', line 29

def parameters
  @parameters
end

#stopObject

Returns the value of attribute stop.



28
29
30
# File 'lib/chem/db/g98.rb', line 28

def stop
  @stop
end

Instance Method Details

#parameter_to_sObject



44
45
46
47
48
49
50
# File 'lib/chem/db/g98.rb', line 44

def parameter_to_s
  s = ''
  @parameters.each do |key, value|
    s = s + key.to_s + '(' + value.to_s + ') '
  end
  return s
end

#process(lines) ⇒ Object



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
# File 'lib/chem/db/g98.rb', line 51

def process lines
  case (@major_number * 100 + @minor_number)
  when 101 # Initializes program and controls overlaying
    lines.proceed 3
    n_atoms = 0
    @gaussian_result.atoms = atoms = Hash.new
    if lines.next_line.split.length < 2 # Z-Matrix
      @gaussian_result.has_z_matrix_coordinate = true
      var = Hash.new
      atoms_tmp = Array.new
      while /^ \w+/ =~ lines.next_line
        lines.proceed
        atoms_tmp.push lines.now
        n_atoms = n_atoms + 1 if lines.now.split[0] != 'X'
      end
      lines.proceed
      if /Variables:/ =~ lines.now
        lines.proceed
        while /^  \w+/ =~ lines.now
          sp = lines.now.split
          var[sp[0]] = sp[1].to_f
          lines.proceed
        end
      end
      n = 1
      atoms_tmp.each do |atom_line|
        atom = G98Atom.new n_atoms, @gaussian_result
        atom_array = atom_line.split
        atom.element = atom_array[0]
        if atom_array.length >= 2
          if /\d/ !~ atom_array[2]
            length = var[atom_array[2]]
          else
            length = atom_array[2].to_f
          end
          atom.distance(atoms[atom_array[1].to_i], length)
        end
        if atom_array.length >= 4
          if /\d/ !~ atom_array[4]
            angle = var[atom_array[4]]
          else
            angle = atom_array[4].to_f
          end
          atom.angle(atoms[atom_array[3].to_i], angle)
        end
        if atom_array.length >= 7
          if /\d/ !~ atom_array[6]
            angle_a = var[atom_array[6]]
          else
            angle_a = atom_array[6].to_f
          end
          if /\d/ !~ atom_array[7]
            angle_b = var[atom_array[7]]
          else
            angle_b = atom_array[7].to_f
          end
          atom.dihedral(atoms[atom_array[5].to_i], angle_a, angle_b)
        end
        atoms[n] = atom
        n = n + 1
      end
    else # Cartessian Matrix
      @gaussian_result.has_cartessian_coordinate = true
      while /^ \w+/ =~ lines.next_line && / The following ModRedundant/ !~ lines.next_line
        lines.proceed
        atom_array = lines.now.split
        atom = G98Atom.new n_atoms + 1, @gaussian_result
        atom.element, atom.x, atom.y, atom.z = atom_array
        atoms[n_atoms + 1] = atom
        n_atoms = n_atoms + 1 if lines.now.split[0] != 'X'
      end
    end
    @gaussian_result.n_atoms = n_atoms
    @gaussian_result.atoms = atoms
    lines.proceed
    #      @stop = true
  when 103 # Berny optimization to minima and TS, STQN transition state searches
    @next_link = @jump_link if @jump_link
    lines.proceed 2
    while /GradGradGrad/ !~ lines.now
      if(/ Optimization completed./ =~ lines.now)
        #  	if(/ Predicted change in Energy=/ =~ lines.now && / Optimization completed./ =~ lines.next_line)
        @next_link = @default_link
      end
      lines.proceed
    end
    #        lines.proceed 2
    #        lines.proceed while / Predicted change in Energy=/ !~ lines.now
    #        puts lines.now
    #        is_loop = true if / Optimization completed./ =~ lines.now
    #  #        lines.proceed while /^ Predicted change in Energy=/ !~ lines.now
    #  #        lines.proceed
    #  #        is_loop = true if / Optimization completed./ =~ lines.now
    #        lines.proceed while /GradGradGrad/ !~ lines.now
    lines.proceed
  when 105 # MS optimization
  when 106 # Numerical differentiation of forces/dipoles to obtain polarizability/hyperpolarizability
  when 107 # Linear-synchronous-transit (LST) transition state search
  when 108 # Potential energy surface scan
  when 109 # Newton-Raphson optimization
  when 110 # Double numerical differentiation of energies to produce frequencies
  when 111 # Double num. diff. of energies to compute polarizabilities & hyperpolarizabilities
  when 113 # EF optimization using analytic gradients
  when 114 # EF numerical optimization (using only energies)
  when 115 # Follows reaction path using the intrinsic reaction coordinate (IRC)
  when 116 # Numerical self-consistent reaction field (SCRF)
  when 117 # Post-SCF SCRF
  when 118 # Trajectory calculations
  when 120 # Controls ONIOM calculations
  when 202 # Reorients coordinates, calculates symmetry, and checks variable
    # IOp(15) : Symmetry control.
    # 1: Unconditionally turn symmetry off. Note that Symm is still called, and will determine the
    #    framework group. However, the molecule is not oriented.
    while / Stoichiometry/ !~ lines.now && /Error/ !~ lines.now
      lines.proceed
    end
    if /Error/ =~ lines.now
      lines.proceed 6
      return
    end
    @gaussian_result.stoichiometry = lines.now.split[1]
    lines.proceed
    @gaussian_result.symmetricity = lines.now.split[2]
    if /KH/ !~ @gaussian_result.symmetricity
      unless @parameters.has_key?(15) && @parameters[15] == 1
        lines.proceed while /Standard orientation:/ !~ lines.now
        lines.proceed 5
        1.upto @gaussian_result.n_atoms do |num|
          o_array = lines.now.split
          @gaussian_result.atoms[o_array[0].to_i].x = o_array[3].to_f
          @gaussian_result.atoms[o_array[0].to_i].y = o_array[4].to_f
          @gaussian_result.atoms[o_array[0].to_i].z = o_array[5].to_f
          lines.proceed
        end
        lines.proceed
      end
      while(/^ Isotopes:/ !~ lines.now)
        lines.proceed
      end
      while /-$/ =~ lines.now || /,\D+-\d/ =~ lines.next_line
        lines.proceed
      end
      lines.proceed
    else
      lines.proceed 3
    end
  when 301 # Generate basis set information
    @gaussian_result.standard_basis = lines.now.split(':')[1].chop # Standard basis: VSTO-3G (5D, 7F)
    lines.proceed
    if / Basis set in the form of general basis input:/ =~ lines.now # with GFINPUT Keyword (24=10)
      while /^$/ !~ lines.next_line
        lines.proceed #  1 0
      end
      lines.proceed 2#^$
    end
    while / There are/ =~ lines.now
      lines.proceed
    end
    lines.proceed while /\d+ basis functions/ !~ lines.now
    @gaussian_result.n_orbitals = lines.now.split[0].to_i
    lines.proceed
    @gaussian_result.n_electron = lines.now.split[0].to_i
    lines.proceed
    @gaussian_result.nuclear_repulsion_energy = lines.now.split[3].to_f
    lines.proceed
  when 302 # Calculates overlap, kinetic, and potential integrals
    lines.proceed 3 # No discrimination between 302 and 303. More Gaussian results needed!
  when 303 # Calculates multipole integrals
    ;
  when 308 # Computes dipole velocity and RxD integrals
  when 309 # Computes ECP integrals
  when 310 # Computes spdf 2-electron integrals in a primitive fashion
  when 311 # Computes sp 2-electron integrals
  when 314 # Computes spdf 2-electron integrals
  when 316 # Prints 2-electron integrals
  when 319 # Computes 1-electron integrals for approximate spin orbital coupling
  when 401 # Forms the initial MO guess
    @gaussian_result.guess = lines.now.chop if @gaussian_result.guess == nil# Projected INDO Guess.
    lines.proceed
    if / Initial guess orbital symmetries:/ =~ lines.now
      lines.proceed 2
      while /\(A.\)/ =~ lines.now
        lines.proceed
      end
    end
  when 402 # Performs semi-empirical and molecular mechanics calculations
    while / Dipole moment=/ !~ lines.now
      lines.proceed
    end
    lines.now.split[4].to_f# Assertive Programming
    lines.proceed
  when 405 # Initializes an MCSCF calculation
  when 502 # Iteratively solves the SCF equations (conven. UHF & ROHF, all direct methods, SCRF)
    lines.proceed while / SCF Done:/ !~ lines.now
    @gaussian_result.energy = lines.now.split[4].to_f
    lines.proceed
    lines.now.split[5].to_f
    lines.proceed 2
    #      lines.proceed if / Axes restored/ =~ lines.now
    if / Annihilation of the first spin contaminant:/ =~ lines.now
      lines.proceed 2
    end
    if / Final SCRF E-Field is:/ =~ lines.now
      lines.proceed 15
    end
    if /---------/ =~ lines.now && /DeltaG/ =~ lines.next_line
      #      if /---------/ =~ lines.now
      while /DeltaG/ !~ lines.now
        lines.proceed
      end
      @gaussian_result.scrf_delta_g = lines.now.split[4].to_f
      lines.proceed 2
    end
    #        lines.proceed
  when 503 # Iteratively solves the SCF equations using direct minimization
  when 506 # Performs an ROHF or GVB-PP calculation
  when 508 # Quadratically convergent SCF program
  when 510 # MC-SCF
  when 601 # Population and related analyses (including multipole moments)
    #        puts 'l601 : '+ lines.now
    #        lines.proceed
    #        puts 'l601 : '+ lines.now
    #        lines.proceed
    #        puts 'l601 : '+ lines.now
    #        lines.proceed
    #        puts 'l601 : '+ lines.now
    #        lines.proceed 4
    lines.proceed 7
    if / Orbital Symmetries:/ =~ lines.now
      lines.proceed while / electronic state/ !~ lines.now
      lines.proceed
    end
    lines.proceed while / Alpha / =~ lines.now || / Beta / =~ lines.now
    if /     Molecular Orbital Coefficients/ =~ lines.now
      if(@parameters.has_key?(7))# Population = Full
        n = @gaussian_result.n_orbitals / 5.0
        n_orbital_col = n.ceil
      else
        n_orbital_col = 2
      end
      lines.proceed #     Molecular Orbital Coefficients
      last_occupy_or_virtual = ''
      1.upto(n_orbital_col) do |cycle|
        lines.proceed #                           1         2         3         4         5
        mo_array = lines.now.split
        0.upto( mo_array.length - 1 ) do |n_mo|
          /\((.+)\)/ =~ mo_array[n_mo] ; sym = $+
          /\)--(.)/ =~ mo_array[n_mo]
          occupy_or_virtual = ($+ != nil ? $+ : mo_array[n_mo])
          @gaussian_result.mo[(cycle - 1) * 5 + n_mo] =
            MolecularOrbital.new(((cycle - 1) * 5 + n_mo), sym, occupy_or_virtual)
          if last_occupy_or_virtual == 'O' && occupy_or_virtual == 'V'
            @gaussian_result.homo = @gaussian_result.mo[(cycle - 1) * 5 + n_mo - 1]
            @gaussian_result.lumo = @gaussian_result.mo[(cycle - 1) * 5 + n_mo]
          elsif(@gaussian_result.homo == nil && n_orbital_col == cycle && mo_array.length - 1 == n_mo)
            # No LUMO ! Example Br-
            @gaussian_result.homo = @gaussian_result.mo[(cycle - 1) * 5 + n_mo - 1]
            @gaussian_result.lumo = nil
          end
          last_occupy_or_virtual = occupy_or_virtual
        end
        lines.proceed
        ev_array = lines.now.split
        0.upto (ev_array.length - 3) do |n_ev|
          @gaussian_result.mo[(cycle - 1) * 5 + n_ev].eigen_value = ev_array[n_ev + 2].to_f
        end
        lines.proceed
        1.upto(@gaussian_result.n_orbitals) do | num |
          coef_array = [lines.now[0..3].strip, lines.now[5..8].strip, lines.now[9..10].strip,
            lines.now[11..21].strip]
          0.upto (mo_array.length - 1) do |n_mo|
            coef_array << lines.now[(21 + n_mo*10)..(31 + n_mo*10)]
          end
          plus = 0
          #  	    if /^[[:alpha:]]+/ =~ coef_array[2]
          if coef_array[1] != ''
            atom = @gaussian_result.atoms[coef_array[1].to_i]
          end
          1.upto( mo_array.length ) do |n_ao|
            atom.ao(coef_array[3]).push(coef_array[n_ao + 2].to_i)
            @gaussian_result.mo[(cycle - 1) * 5 + n_ao - 1].push([atom.index, coef_array[3]], coef_array[3 + n_ao].to_f)
            #  	      @gaussian_result.mo[(cycle - 1) * 5 + n_ao].push(coef_array[n_ao + plus + 2].to_f)
          end
          lines.proceed
        end
      end
      lines.proceed #      DENSITY MATRIX.
      density_time = @gaussian_result.n_orbitals
      while(density_time >0)
        lines.proceed #                           1         2         3         4         5
        lines.proceed density_time
        density_time = density_time - 5
      end
      lines.proceed #    Full Mulliken population analysis:
      mulliken_time = @gaussian_result.n_orbitals
      while(mulliken_time > 0)
        lines.proceed #                           1         2         3         4         5
        lines.proceed mulliken_time
        mulliken_time = mulliken_time - 5
      end
      lines.proceed #     Gross orbital populations:
      1.upto(@gaussian_result.n_orbitals) do |num|
        lines.proceed
      end
      lines.proceed #          Condensed to atoms (all electrons):
    end
    n = (@gaussian_result.n_atoms) / 6.0
    if /Condensed to / =~ lines.now
      lines.proceed
      if /              1/ =~ lines.now # BUG of Gaussian98 !?
        1.upto(n.ceil) do |num|
          @gaussian_result.exist_condensed_to_atom = true
          lines.proceed
          1.upto(@gaussian_result.n_atoms) do |nn|
            array = lines.now.split
            1.upto(array.length - 2) do |col|
              @gaussian_result.atoms[array[0].to_i].density[(num - 1)* 6 + col] = array[col + 1].to_f
            end
            lines.proceed
          end
        end
      end
    end
    lines.proceed 2
    1.upto(@gaussian_result.n_atoms) do | num |
      @gaussian_result.atoms[lines.now.split[0].to_i].total_atomic_charge = lines.now.split[2].to_f
      lines.proceed
    end
    @gaussian_result.sum_of_mulliken_charge = lines.now.split[4].to_f
    lines.proceed
    lines.proceed # Atomic charges with hydrogens summed into heavy atoms:
    lines.proceed #              1
    1.upto(@gaussian_result.n_atoms) do |num|
      @gaussian_result.atoms[lines.now.split[0].to_i].heavy_charge = lines.now.split[2].to_f
      lines.proceed
    end
    lines.proceed
    if /Atomic-Atomic Spin Densities./ =~ lines.now
      lines.proceed
      n = @gaussian_result.n_atoms / 6.0
      1.upto n.ceil do |num|
        lines.proceed @gaussian_result.n_atoms
      end
      lines.proceed
      lines.proceed # Total atomic spin densities:
      lines.proceed #              1
      lines.proceed @gaussian_result.n_atoms
      lines.proceed
      if /Isotropic Fermi / =~ lines.now
        lines.proceed
        1.upto(@gaussian_result.n_atoms) do |num|
          lines.proceed
        end
      end
      lines.proceed
    end
    #        if(@parameters.has_key?(7) && (@parameters[7] == 3 || @parameters[7] == 2))
    if/ Electronic spatial extent/ =~ lines.now
      #      if(@parameters.has_key?(28))
      @gaussian_result.electronic_spatial_extent = lines.now.split[5].to_f
      lines.proceed 3
      @gaussian_result.dipole_moment_total = lines.now.split[7].to_f
      lines.proceed while / N-N=/ !~ lines.now
      lines.proceed
      if / Symmetry/ =~ lines.now
        lines.proceed while / Symmetry/ =~ lines.now
      end
    end
    if /Exact polarizability/ =~ lines.now
      lines.now.split[7].to_f #Assertive programming ;)
      lines.proceed while /Thermochemistry/ != lines.now
      lines.proceed while / TOTAL BOT/ !~ lines.now
      lines.proceed while / ROTATIONAL/ !~ lines.now
      lines.proceed
    end
    #      @stop = true
  when 602 # 1-electron properties (potential, field, and field gradient)
  when 604 # Evaluates MOs or density over a grid of points
    lines.proceed while / LenV=/ !~ lines.now
  when 607 # Performs NBO analyses
  when 608 # Non-iterative DFT energies
  when 609 # Atoms in Molecules properties
  when 701 # 1-electron integral first or second derivatives
    lines.proceed if /solvent charges in/ =~ lines.now
  when 702 # 2-electron integral first or second derivatives (sp)
    lines.proceed if /Density matrix is not symmetric/ =~ lines.now
  when 703 # 2-electron integral first or second derivatives (spdf)
  when 709 # Forms the ECP integral derivative contribution to gradients
  when 716 # Processes information for optimizations and frequencies
    # ***** Axes restored to original set *****
    lines.proceed if /Axes restored/ =~ lines.now
    if /Rotating electric field/ =~ lines.now
      lines.proceed while /Axes restored/ !~ lines.now
      lines.proceed
    end
    lines.proceed # -------------------------------------------------------------------
    lines.proceed # Center     Atomic                   Forces (Hartrees/Bohr)
    lines.proceed # Number     Number              X              Y              Z
    lines.proceed # -------------------------------------------------------------------
    1.upto(@gaussian_result.n_atoms) do |num|
      lines.now.split[4].to_f #Assertive Programming ;)
      lines.proceed
    end
    lines.proceed # -------------------------------------------------------------------
    lines.proceed # Cartesian Forces:  Max     2.919256220 RMS     1.058248881
  when 801 # Initializes transformation of 2-electron integrals
    lines.proceed 2
  when 802 # Performs integral transformation (N3 in-core)
  when 803 # Complete basis set (CBS) extrapolation
  when 804 # Integral transformation
    #        if /^$/ =~ lines.now
    #  	lines.proceed 3 # **** Warning!!: The largest alpha MO coefficient is  0.39613240D+02
    #        else
    #  	lines.proceed # Estimate disk for full transformation     8758468 words.
    #        end
    while !(/ANorm/ =~ lines.now && /^ E2=/ =~ lines.next_line)
      lines.proceed
    end
    lines.proceed 2
  when 811 # Transforms integral derivatives & computes their contributions to MP2 2nd derivatives
    lines.proceed # Form MO integral derivatives with frozen-active canonical formalism.
    lines.proceed # MDV=     6291456.
    lines.proceed # Discarding MO integrals.
    lines.proceed #             Reordered first order wavefunction length =       176418
    lines.proceed if /In DefCFB/ =~ lines.now
    lines.proceed if /Large arrays: / =~ lines.now
  when 901 # Anti-symmetrizes 2-electron integrals
  when 902 # Determines the stability of the Hartree-Fock wavefunction
  when 903 # Old in-core MP2
  when 905 # Complex MP2
  when 906 # Semi-direct MP2
    #      puts 'l906 : ' + lines.now
    #      lines.proceed 12
    lines.proceed while / E2 =/ !~ lines.now
    lines.proceed
  when 908 # OVGF (closed shell)
  when 909 # OVGF (open shell)
  when 913 # Calculates post-SCF energies and gradient terms
    while /^ QCISD\(T\)=/ !~ lines.now
      lines.proceed
    end
    lines.proceed 1
  when 914 # CI-Single, RPA and Zindo excited states; SCF stability
    lines.proceed while /       state/ !~ lines.now
    lines.proceed
    n_state = 0
    while / Ground to excited state/ !~ lines.now
      n_state = n_state + 1
      lines.proceed
    end
    while / Excitation energies and oscillator strengths:/ !~ lines.now
      lines.proceed
    end
    1.upto n_state do |num|
      lines.proceed while / Excited State / !~ lines.now
      lines.proceed
      lines.proceed while /\d+ ->/ =~ lines.now
    end
  when 915 # Computes fifth order quantities (for MP5, QCISD (TQ) and BD (TQ))
  when 918 # Reoptimizes the wavefunction
  when 1002 # Iteratively solves the CPHF equations; computes various properteis
    #      lines.proceed while /degrees of freedom in the / !~ lines.now
    #        lines.proceed # Petite list used in FoFDir.
    #        lines.proceed #MinBra= 0 MaxBra= 2 Meth= 1.
    #        lines.proceed #IRaf=       0 NMat=   1 IRICut=       1 DoRegI=T DoRafI=F ISym2E= 1 JSym2E=1.
    #        lines.proceed while /vectors were produced by pass/ =~ lines.now
    while /Inverted reduced A of dimension/ !~ lines.now
      lines.proceed
    end
    lines.proceed
    if / Calculating GIAO nuclear magnetic shielding tensors./ =~ lines.now
      1.upto @gaussian_result.n_atoms do |num|
        lines.proceed while /Eigenvalues:/ !~ lines.now
        lines.proceed
      end
    end
    #  	while /^$/ !~ lines.now
    #  	  lines.proceed
    #  	end
    #        end
    #        lines.proceed
  when 1003 # Iteratively solves the CP-MCSCF equations
  when 1014 # Computes analytic CI-Single second derivatives
  when 1101 # Computes 1-electron integral derivatives
  when 1102 # Computes dipole derivative integrals
  when 1110 # 2-electron integral derivative condition to F
    lines.proceed if /G2DrvN: will do/ =~ lines.now
    lines.proceed if /FoFDir used for/ =~ lines.now
  when 1111 # 2 PDM and post-SCF derivatives
  when 1112 # MP2 second derivatives
    lines.proceed if /R2 and R3 integrals will be/ =~ lines.now
    lines.proceed while / Incrementing Polarizabilities/ !~ lines.now
    lines.proceed 2
  when 9999 # Finalizes calculation and output
    while !lines.eof?
      if / Normal termination/ =~ lines.now
        #	  puts ' ****** Normal termination ****** '
      end
      lines.proceed
    end
	@stop = true
  else
    puts 'Not implemented Link Number!!'
    printf " major : %d   minor : %d\n", @major_number, @minor_number,to_s
  end
rescue
  puts 'exception at ' + (@major_number * 100 + @minor_number).to_s
  raise
end

#to_sObject



41
42
43
# File 'lib/chem/db/g98.rb', line 41

def to_s
  sprintf("%2d%02d %2s ", @major_number, @minor_number, @goto.to_s) + parameter_to_s
end