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

« back to all changes in this revision

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

  • 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
 
/*
2
 
** This functions gets an array of user specified charges (if it exists)
3
 
** Added to facilitate counterpoise corrections with ghost atoms
4
 
** July-2001 GST
5
 
*/
6
 
#define EXTERN
7
 
#include <stdio.h>
8
 
#include <stdlib.h>
9
 
#include <libciomr/libciomr.h>
10
 
#include <libipv1/ip_lib.h>
11
 
#include "input.h"
12
 
#include "global.h"
13
 
#include "defines.h"
14
 
 
15
 
void read_charges()
16
 
{
17
 
  int i, j, errcod;
18
 
 
19
 
  /* INIT GLOBAL ARRAYS */
20
 
  nuclear_charges = init_array(num_atoms);
21
 
  element = (char **) malloc(sizeof(char *)*num_atoms);
22
 
 
23
 
  if( ip_exist("CHARGES",0) ) {
24
 
    ip_count("CHARGES", &i, 0) ;
25
 
    if(i != num_atoms) {
26
 
      punt("Number of charges not equal to number of atoms (excluding dummy)");
27
 
      }
28
 
    errcod = ip_double_array("CHARGES", nuclear_charges, num_atoms) ;
29
 
    if (errcod != IPE_OK) {
30
 
      punt("Problem reading the CHARGES array.");
31
 
      }
32
 
    for(i=0;i<num_atoms;i++)
33
 
      element[i] = elem_name[(int)nuclear_charges[i]];
34
 
  }
35
 
  /* IF USER DOES NOT SPECIFY CHARGES, POINT TO DEFAULT CHARGES */
36
 
  else {
37
 
    for(i=0;i<num_atoms;i++) {
38
 
      nuclear_charges[i] = elemsymb_charges[i];
39
 
      element[i] = elem_name[(int)elemsymb_charges[i]];
40
 
    }
41
 
  }
42
 
}
43
 
 
44