~ubuntu-branches/ubuntu/vivid/psicode/vivid

« back to all changes in this revision

Viewing changes to src/bin/input/read_chkpt.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck
  • Date: 2008-06-07 16:49:57 UTC
  • mfrom: (2.1.2 hardy)
  • Revision ID: james.westby@ubuntu.com-20080607164957-8pifvb133yjlkagn
Tags: 3.3.0-3
* debian/rules (DEB_MAKE_CHECK_TARGET): Do not abort test suite on
  failures.
* debian/rules (DEB_CONFIGURE_EXTRA_FLAGS): Set ${bindir} to /usr/lib/psi.
* debian/rules (install/psi3): Move psi3 file to /usr/bin.
* debian/patches/07_464867_move_executables.dpatch: New patch, add
  /usr/lib/psi to the $PATH, so that the moved executables are found.
  (closes: #464867)
* debian/patches/00list: Adjusted.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
#include "global.h"
9
9
#include "defines.h"
10
10
 
 
11
extern int *correlate(char *ptgroup, int irrep, int *nirreps_ref, int *nirreps);
 
12
 
11
13
void read_chkpt_geom()
12
14
{
13
 
  int i, errcod;
14
 
  int atom;
15
 
  double Z = 0.0;
 
15
  int i, j, errcod, disp_irrep, *correlation, *clsdpi_ref, *clsdpi, mm;
 
16
  int atom, nirreps_ref, nirreps, h, *openpi, *openpi_ref;
 
17
  int nso, nmo, h_ref, cnt, *cnt_orb_irr, *orbspi, *orbspi_ref, *orbs_off_ref, *so_off;
 
18
  int ref, *sopi, *sopi_ref, *orbs_off;
 
19
  double Z = 0.0, **scf, **scf_col, **scf_ref, escf_ref;
16
20
  double tmp = 0.0;
17
 
  char *atom_label;
 
21
  char *atom_label, *ptgrp_ref, *save_prefix;
18
22
 
 
23
  /*** read geometry with Zvals from chkpt file */
19
24
  chkpt_init(PSIO_OPEN_OLD);
20
25
  num_atoms = chkpt_rd_natom();
21
26
  num_allatoms = chkpt_rd_nallatom();
23
28
    punt("GEOMETRY in the checkpoint file is empty!");
24
29
  else if (num_atoms > MAXATOM)
25
30
    punt("There are more atoms than allowed!");
26
 
 
27
 
  /* Grab subgroup and get rid of a possible blank */
28
 
  subgroup = chkpt_rd_sym_label();
29
 
  if (subgroup[2] == ' ') subgroup[2] = '\0';
30
 
 
31
31
  full_geom = chkpt_rd_fgeom();
32
32
  geometry = (double **) malloc(num_atoms*sizeof(double *));
33
33
  atom_dummy = chkpt_rd_atom_dummy();
39
39
    }
40
40
  nuclear_charges = chkpt_rd_zvals();
41
41
  full_element = chkpt_rd_felement();
 
42
  /* Grab subgroup and get rid of a possible blank
 
43
  subgroup = chkpt_rd_sym_label();
 
44
  if (subgroup[2] == ' ') subgroup[2] = '\0';
 
45
  */
 
46
 
 
47
  /* these are set by optking */
 
48
  disp_irrep = chkpt_rd_disp_irrep();
 
49
  save_prefix = chkpt_rd_prefix();
 
50
 
 
51
  /*** read symmetry info and MOs for undisplaced geometry from
 
52
       root section of checkpoint file ***/
 
53
  chkpt_reset_prefix();
 
54
  chkpt_commit_prefix();
 
55
 
 
56
  ptgrp_ref = chkpt_rd_sym_label();
 
57
  clsdpi_ref = chkpt_rd_clsdpi(); /*closed MOs per irrep*/
 
58
  openpi_ref = chkpt_rd_openpi(); /*open MOs per irrep*/
 
59
 
 
60
  /* Lookup irrep correlation table */
 
61
  correlation = correlate(ptgrp_ref, disp_irrep, &nirreps_ref, &nirreps);
 
62
 
 
63
  if (print_lvl > 2) {
 
64
    fprintf(outfile,"Reference point group is %s.\n", ptgrp_ref);
 
65
    free(ptgrp_ref);
 
66
    fprintf(outfile,"Irrep of this displacement is %d.\n", disp_irrep);
 
67
    fprintf(outfile,"Irrep correlation:");
 
68
    for (i=0; i<nirreps_ref; ++i)
 
69
      fprintf(outfile," %d",correlation[i]);
 
70
    fprintf(outfile,"\n");
 
71
  }
 
72
 
 
73
  /* build orbital information for current point group */
 
74
  clsdpi = init_int_array(nirreps);
 
75
  openpi = init_int_array(nirreps);
 
76
  for (h=0; h < nirreps_ref; ++h) {
 
77
    clsdpi[ correlation[h] ] += clsdpi_ref[h];
 
78
    openpi[ correlation[h] ] += openpi_ref[h];
 
79
  }
 
80
 
 
81
  chkpt_set_prefix(save_prefix);
 
82
  chkpt_commit_prefix();
 
83
  free(save_prefix);
 
84
 
 
85
  /* write orbital information to chkpt file */
 
86
  chkpt_wt_nirreps(nirreps);
 
87
  chkpt_wt_clsdpi(clsdpi);
 
88
  chkpt_wt_openpi(openpi);
 
89
 
 
90
  if (print_lvl > 2) {
 
91
    fprintf(outfile,"clsdpi");
 
92
    for (h=0; h < nirreps; ++h)
 
93
      fprintf(outfile, " %d",clsdpi[h]);
 
94
    fprintf(outfile,"\n");
 
95
    fprintf(outfile,"openpi");
 
96
    for (h=0; h < nirreps; ++h)
 
97
      fprintf(outfile, " %d",openpi[h]);
 
98
    fprintf(outfile,"\n");
 
99
    fprintf(outfile,"orbspi");
 
100
    for (h=0; h < nirreps; ++h)
 
101
      fprintf(outfile, " %d",orbspi[h]);
 
102
    fprintf(outfile,"\n");
 
103
  }
 
104
 
42
105
  chkpt_close();
43
106
 
 
107
  free(clsdpi); free(clsdpi_ref);
 
108
  free(openpi); free(openpi_ref);
 
109
 
44
110
  element = (char **) malloc(sizeof(char *)*num_atoms);
45
111
  elemsymb_charges = init_array(num_atoms);
46
112
  for(i=0;i<num_atoms;i++) {