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

« back to all changes in this revision

Viewing changes to src/bin/detcasman/detcasman.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:
47
47
{
48
48
  int converged = 0;
49
49
  int i, errcod = 0;
 
50
  char *wfn;                   /* wavefunction type                        */
50
51
  int ncasiter = 0;            /* max cas iterations */
51
52
  char detci_string[80];       /* string containing system call for DETCI  */
 
53
  char rmstring[100];          /* remove command for diis.dat, etc         */
52
54
  double ci_conv;              /* desired CI convergence 
53
55
                                  (changes dynamically during CAS opt)     */
54
56
  double scale_conv;           /* CI convergence threshold = 
62
64
  errcod = ip_data("NCASITER","%d",&ncasiter,0);
63
65
  scale_conv = 0.01;
64
66
  errcod = ip_data("SCALE_CONV","%lf",&scale_conv,0);
65
 
  
 
67
  errcod = ip_string("WFN", &wfn,0);
 
68
  if (errcod == IPE_KEY_NOT_FOUND) {
 
69
    wfn = (char *) malloc(sizeof(char)*7);
 
70
    strcpy(wfn, "DETCAS");
 
71
  }
 
72
 
66
73
  /* First iteration prints DETCI information */
67
74
  ci_conv = calc_ci_conv(scale_conv, &energy_last);
68
75
 
97
104
 
98
105
  if (converged) {
99
106
    fprintf(outfile,"                  ORBITALS CONVERGED\n");
100
 
    fprintf(outfile,"\n  Final CASSCF Energy = %17.12lf\n", energy_last);
 
107
    fprintf(outfile,"\n  Final %s Energy = %17.12lf\n", wfn, energy_last);
101
108
  }
102
109
  else
103
110
    fprintf(outfile,"               ORBITALS DID NOT CONVERGE\n");
104
111
 
105
112
  if (converged) {
106
 
    system("rm -f detci_cfile.dat detci_sfile.dat");
107
 
    system("rm -f diis.dat orbs.dat thetas.dat");
 
113
    sprintf(rmstring, "rm -f %s.%s %s.%s %s.%s", psi_file_prefix, "diis.dat",
 
114
      psi_file_prefix, "orbs.dat", psi_file_prefix, "thetas.dat");
 
115
    system(rmstring);
108
116
  }
109
117
 
110
118
  quote();
152
160
  double scaled_rmsgrad, rmsgrad;
153
161
  double tval;
154
162
 
155
 
  sumfile = fopen(sumfile_name, "r");
 
163
  ffile_noexit(&sumfile,sumfile_name,2);
156
164
 
157
165
  if (sumfile == NULL) {
158
 
    return(1.0E-3);
 
166
    return(scale_conv * 0.1);
159
167
  }
160
168
 
161
169
  if (fscanf(sumfile, "%d", &entries) != 1) {
162
170
    fprintf(outfile,"detcasman: Trouble reading num entries in file %s\n",
163
171
            sumfile_name);
164
172
    fclose(sumfile);
165
 
    return(1.0E-3);
 
173
    return(scale_conv * 0.1);
166
174
  }
167
175
 
168
176
  for (i=0; i<entries; i++) {