~ubuntu-branches/ubuntu/intrepid/psicode/intrepid

« back to all changes in this revision

Viewing changes to src/lib/libdpd/file4_mat_irrep_wrt.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck
  • Date: 2006-09-10 14:01:33 UTC
  • Revision ID: james.westby@ubuntu.com-20060910140133-ib2j86trekykfsfv
Tags: upstream-3.2.3
ImportĀ upstreamĀ versionĀ 3.2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "dpd.h"
 
2
 
 
3
int dpd_file4_mat_irrep_wrt(dpdfile4 *File, int irrep)
 
4
{
 
5
  int rowtot, coltot, my_irrep;
 
6
  psio_address irrep_ptr, next_address;
 
7
  long int size;
 
8
 
 
9
  if(File->incore) {
 
10
    dpd_file4_cache_dirty(File);  /* Flag this cache entry for writing */
 
11
    return 0;  /* We're keeping this data in core */
 
12
  }
 
13
 
 
14
  my_irrep = File->my_irrep;
 
15
  irrep_ptr = File->lfiles[irrep];
 
16
  rowtot = File->params->rowtot[irrep];
 
17
  coltot = File->params->coltot[irrep^my_irrep];
 
18
  size = ((long) rowtot) * ((long) coltot);
 
19
 
 
20
  if(rowtot && coltot)
 
21
    psio_write(File->filenum, File->label, (char *) File->matrix[irrep][0],
 
22
               size*((long) sizeof(double)), irrep_ptr, &next_address);
 
23
 
 
24
  return 0;
 
25
 
 
26
}