~ubuntu-branches/ubuntu/karmic/psicode/karmic

« back to all changes in this revision

Viewing changes to src/bin/input/write_scf_to_chkpt.cc

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck, Michael Banck, Daniel Leidert
  • Date: 2009-02-23 00:12:02 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090223001202-rutldoy3dimfpesc
Tags: 3.4.0-1
* New upstream release.

[ Michael Banck ]
* debian/patches/01_DESTDIR.dpatch: Refreshed.
* debian/patches/02_FHS.dpatch: Removed, applied upstream.
* debian/patches/03_debian_docdir: Likewise.
* debian/patches/04_man.dpatch: Likewise.
* debian/patches/06_466828_fix_gcc_43_ftbfs.dpatch: Likewise.
* debian/patches/07_464867_move_executables: Fixed and refreshed.
* debian/patches/00list: Adjusted.
* debian/control: Improved description.
* debian/patches-held: Removed.
* debian/rules (install/psi3): Do not ship the ruby bindings for now.

[ Daniel Leidert ]
* debian/rules: Fix txtdir via DEB_MAKE_INSTALL_TARGET.
* debian/patches/01_DESTDIR.dpatch: Refreshed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*! \file
 
2
    \ingroup INPUT
 
3
    \brief Enter brief description of file here 
 
4
*/
 
5
#define EXTERN
 
6
#include <cstdio>
 
7
#include <cstdlib>
 
8
#include <cmath>
 
9
#include <cstring>
 
10
#include <libciomr/libciomr.h>
 
11
#include <libpsio/psio.h>
 
12
#include <libchkpt/chkpt.h>
 
13
#include <psifiles.h>
 
14
#include "input.h"
 
15
#include "global.h"
 
16
#include "defines.h"
 
17
 
 
18
namespace psi { namespace input {
 
19
 
 
20
void write_scf_calc();
 
21
 
 
22
/*-----------------------------------------------------------------------------------------------------------------
 
23
 
 
24
 -----------------------------------------------------------------------------------------------------------------*/
 
25
 
 
26
void write_scf_to_chkpt()
 
27
{
 
28
 
 
29
  double *arr_double;
 
30
 
 
31
  chkpt_init(PSIO_OPEN_OLD);
 
32
 
 
33
  /*-----------------
 
34
    Update constants
 
35
   -----------------*/
 
36
  chkpt_wt_nsymhf(num_so_typs);
 
37
  chkpt_wt_iopen(iopen);
 
38
  chkpt_wt_nmo(num_mo);
 
39
  chkpt_wt_ref(ref);
 
40
 
 
41
  /* write the data out */
 
42
  write_scf_calc();
 
43
  
 
44
  /* Update energies */
 
45
  chkpt_wt_escf(escf);
 
46
  chkpt_wt_eref(escf);
 
47
 
 
48
  chkpt_close();
 
49
  return;
 
50
}
 
51
 
 
52
void write_scf_calc()
 
53
{
 
54
  double *zero_array;
 
55
  zero_array = init_array(num_mo*(num_mo+1)/2);
 
56
      
 
57
  if (spinrestr_ref) {
 
58
    /* SCF eigenvector */
 
59
    chkpt_wt_scf(scf_evect_so);
 
60
    
 
61
    /* SCF eigenvalues */
 
62
    chkpt_wt_evals(zero_array);
 
63
  }
 
64
  else {
 
65
    /* SCF eigenvectors */
 
66
    chkpt_wt_alpha_scf(scf_evect_so_alpha);
 
67
    chkpt_wt_beta_scf(scf_evect_so_beta);
 
68
    
 
69
    /* SCF eigenvalues */
 
70
    chkpt_wt_alpha_evals(zero_array);
 
71
    chkpt_wt_beta_evals(zero_array);
 
72
  }
 
73
  free(zero_array);
 
74
 
 
75
  if(scf_evect_local != NULL) chkpt_wt_local_scf(scf_evect_local);
 
76
      
 
77
  /* irrep labels for non-empty blocks */
 
78
  chkpt_wt_irr_labs(irr_labels);
 
79
 
 
80
  /* MOs per block */
 
81
  chkpt_wt_orbspi(orbspi);
 
82
 
 
83
  /* doubly-occupied MOs per block */
 
84
  chkpt_wt_clsdpi(clsdpi);
 
85
 
 
86
  /* singly-occupied MOs per block */
 
87
  chkpt_wt_openpi(openpi);
 
88
  
 
89
  return;
 
90
}
 
91
 
 
92
}} // namespace psi::input