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

« back to all changes in this revision

Viewing changes to src/bin/cscf/init_uhf.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 CSCF
 
3
    \brief Enter brief description of file here 
 
4
*/
 
5
/**************************************************
 
6
 
 
7
    init_uhf.c - separate code to initialize UHF
 
8
 
 
9
    By Shawn Brown
 
10
 
 
11
**************************************************/
 
12
 
 
13
#define EXTERN
 
14
#include "includes.h"
 
15
#include "common.h"
 
16
#include <libchkpt/chkpt.h>
 
17
 
 
18
namespace psi { namespace cscf {
 
19
 
 
20
void init_uhf()
 
21
{
 
22
   int i,m,jj;
 
23
   int nn,isadr;
 
24
   int nkind,junk;
 
25
   int degen[20],*num_so;
 
26
   char char_dum[80];
 
27
   char **irr_labs;
 
28
   struct spin *sp;
 
29
 
 
30
   ioff[0] = 0;
 
31
   for (i = 1; i < 1024 ; i++) {
 
32
      ioff[i] = ioff[i-1] + i;
 
33
      }
 
34
 
 
35
/* EFV 10/24/98 All requests for file30 should be handled with libfile30
 
36
   but for now I'll use wreadw */
 
37
   num_ir = chkpt_rd_nirreps();
 
38
   num_so = chkpt_rd_sopi();
 
39
   repnuc = chkpt_rd_enuc();
 
40
   irr_labs = chkpt_rd_irr_labs();
 
41
 
 
42
/* now initialize scf_info */
 
43
   
 
44
   n_so_typs=0;
 
45
   nsfmax=0;
 
46
   nbasis=0;
 
47
   
 
48
   scf_info = (struct symm *) malloc(sizeof(struct symm)*num_ir);
 
49
   
 
50
/* STB 6/30/99 Initialize structures to hold the information with spin
 
51
   spin in mind */
 
52
   
 
53
   spin_info = (struct spin *) malloc(sizeof(struct spin)*2);
 
54
 
 
55
   /* compute nsfmax */
 
56
   for(i=0; i < num_ir; i++) { nn = num_so[i]; if(nn > nsfmax) nsfmax = nn; }
 
57
 
 
58
   
 
59
   for(m=0;m<2;m++){
 
60
       spin_info[m].scf_spin = 
 
61
           (struct symm *) malloc(sizeof(struct symm)*num_ir);
 
62
   }
 
63
   
 
64
   jj=0;
 
65
   for(i=0; i < num_ir ; i++) {
 
66
       scf_info[i].num_so = nn = num_so[i];
 
67
/* EFV 10/24/98 degeneracy = 1
 
68
   scf_info[i].degeneracy = degen[i]; */
 
69
       scf_info[i].nclosed = 0;
 
70
       scf_info[i].nopen = 0;
 
71
       scf_info[i].nhalf = 0;
 
72
       scf_info[i].os_num = 0;
 
73
       scf_info[i].ideg = 0;
 
74
       
 
75
       scf_info[i].irrep_label = irr_labs[i];
 
76
/*      scf_info[i].irrep_label[4] = '\0';*/
 
77
       jj += 4;
 
78
       
 
79
       nbasis += nn;
 
80
       if (nn) {
 
81
           n_so_typs++;
 
82
           
 
83
           scf_info[i].smat = init_array(ioff[nn]);
 
84
           scf_info[i].tmat = init_array(ioff[nn]);
 
85
           scf_info[i].hmat = init_array(ioff[nn]);
 
86
           scf_info[i].sahalf = block_matrix(nn,nn);
 
87
           scf_info[i].pinv = block_matrix(nn,nn);
 
88
           scf_info[i].occ_num = init_array(nn);
 
89
           /* STB (6/30/99) - There is no P matrix in UHF only
 
90
              J and K/2 */
 
91
           
 
92
           scf_info[i].dpmat = init_array(ioff[nn]);
 
93
           scf_info[i].pmat = init_array(ioff[nn]);
 
94
           scf_info[i].cmat = block_matrix(nn,nn);
 
95
           /* STB(4/1/98) - Added array to store the eigenvalues of the
 
96
              core hamiltonian for mo guessing*/
 
97
           scf_info[i].hevals = init_array(nn);
 
98
           for(m=0;m<2;m++){
 
99
               sp = &spin_info[m];
 
100
           sp->scf_spin[i].irrep_label = scf_info[i].irrep_label;
 
101
               sp->scf_spin[i].dpmat = init_array(ioff[nn]);
 
102
               sp->scf_spin[i].dpmato = NULL;
 
103
               sp->scf_spin[i].pmat = init_array(ioff[nn]);
 
104
               sp->scf_spin[i].pmato = NULL;
 
105
               sp->scf_spin[i].fock_pac = init_array(ioff[nn]);
 
106
               sp->scf_spin[i].gmat = init_array(ioff[nn]);
 
107
               sp->scf_spin[i].gmato = NULL;
 
108
               sp->scf_spin[i].occ_num = init_array(nn);
 
109
               sp->scf_spin[i].fock_evals = init_array(nn);
 
110
               sp->scf_spin[i].cmat = block_matrix(nn,nn);
 
111
               /* TDC(6/19/96) - Added array for saving original MO vector */
 
112
               sp->scf_spin[i].cmat_orig = block_matrix(nn,nn);
 
113
               /* STB(4/1/98) - Added array to store the eigenvalues of the
 
114
                  core hamiltonian for mo guessing*/
 
115
               sp->scf_spin[i].hevals = init_array(nn);
 
116
               /* Need separate XC Fock for KS DFT */
 
117
               if (ksdft)
 
118
                 sp->scf_spin[i].xcmat = init_array(ioff[nn]);
 
119
           }
 
120
       }
 
121
   }
 
122
   /* read in number of atoms and nuclear charges and total number of MO*/
 
123
   natom = chkpt_rd_natom();
 
124
   zvals = chkpt_rd_zvals();
 
125
   nbfso = chkpt_rd_nso();
 
126
   
 
127
   /* Character label for Spin */
 
128
   spin_info[0].spinlabel = "Alpha";
 
129
   spin_info[1].spinlabel = "Beta";
 
130
/* Initialize arrays to hold energy and symmetry arrays */
 
131
   ener_tot = init_array(nbfso);
 
132
   symm_tot = init_int_array(nbfso);
 
133
   
 
134
 
135
 
 
136
}} // namespace psi::cscf