~ubuntu-branches/ubuntu/quantal/psicode/quantal

« back to all changes in this revision

Viewing changes to src/lib/libqt/slaterdset.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
 
/*!
3
 
  \file slaterdset.c
4
 
  Edward Valeev, June 2002
5
 
*/
6
 
 
7
 
#include <stdio.h>
8
 
#include <stdlib.h>
9
 
#include <string.h>
10
 
#include <libpsio/psio.h>
11
 
#include <libciomr/libciomr.h>
12
 
#include "slaterdset.h"
13
 
 
14
 
 
15
 
#define PSIO_INIT if (!psio_state()) { \
16
 
    psio_init(); \
17
 
    need_to_init_psio = 1; \
18
 
  }
19
 
 
20
 
#define PSIO_OPEN(u,n) if (!psio_open_check(u)) { \
21
 
    psio_open((u),n); \
22
 
    unit_opened = 0; \
23
 
  }
24
 
 
25
 
#define PSIO_CLOSE(u) if (!unit_opened) \
26
 
    psio_close((u),1);
27
 
 
28
 
#define PSIO_DONE if (need_to_init_psio) \
29
 
    psio_done();
30
 
 
31
 
 
32
 
/*! stringset_init()
33
 
 */
34
 
void stringset_init(StringSet *sset, int size, int nelec, int nfzc,
35
 
  short int *frozen_occ)
36
 
{
37
 
  int i;
38
 
 
39
 
  sset->size = size;
40
 
  sset->nelec = nelec;
41
 
  sset->nfzc = nfzc;
42
 
  sset->strings = (String *) malloc(size*sizeof(String));
43
 
  memset(sset->strings,0,size*sizeof(String));
44
 
  if (nfzc > 0) {
45
 
    sset->fzc_occ = (short int *) malloc(nfzc * sizeof(short int));
46
 
    for (i=0; i<nfzc; i++) {
47
 
      sset->fzc_occ[i] = frozen_occ[i];  
48
 
    }
49
 
  }
50
 
}
51
 
 
52
 
 
53
 
/*! stringset_delete()
54
 
 */
55
 
void stringset_delete(StringSet *sset)
56
 
{
57
 
  if (sset->nfzc > 0) free(sset->fzc_occ);
58
 
  sset->size = 0;
59
 
  sset->nelec = 0;
60
 
  sset->nfzc = 0;
61
 
  if (sset->strings) free(sset->strings);
62
 
  sset->strings = NULL;
63
 
}
64
 
 
65
 
/*! stringset_add
66
 
 */
67
 
void stringset_add(StringSet *sset, int index, unsigned char *Occ)
68
 
{
69
 
  int i;
70
 
  int nact = sset->nelec - sset->nfzc;
71
 
  String *s;
72
 
 
73
 
  if (index < sset->size && index >= 0) {
74
 
    s = sset->strings + index;
75
 
  }
76
 
  s->index = index;
77
 
  s->occ = (short int*) malloc(nact*sizeof(short int));
78
 
  for(i=0;i<nact;i++)
79
 
    s->occ[i] = Occ[i];
80
 
}
81
 
 
82
 
/*! stringset_reindex
83
 
 */
84
 
void stringset_reindex(StringSet* sset, short int* mo_map)
85
 
{
86
 
  int s, mo, core;
87
 
  short int* occ;
88
 
  int nstrings = sset->size;
89
 
  int nact = sset->nelec - sset->nfzc;
90
 
 
91
 
  for (core=0; core<sset->nfzc; core++) {
92
 
    sset->fzc_occ[core] = mo_map[sset->fzc_occ[core]];
93
 
  }
94
 
 
95
 
  for(s=0; s<nstrings; s++) {
96
 
    occ = (sset->strings + s)->occ;
97
 
    for(mo=0; mo<nact; mo++)
98
 
      occ[mo] = mo_map[occ[mo]];
99
 
  }
100
 
}
101
 
 
102
 
void stringset_write(ULI unit, char *prefix, StringSet *sset)
103
 
{
104
 
  int i, size, nact;
105
 
  int need_to_init_psio = 0;
106
 
  int unit_opened = 1;
107
 
  char *size_key, *nelec_key, *nfzc_key, *strings_key, *fzc_occ_key;
108
 
  psio_address ptr;
109
 
 
110
 
PSIO_INIT
111
 
PSIO_OPEN(unit,PSIO_OPEN_OLD)
112
 
 
113
 
  size_key = (char *) malloc(strlen(prefix) + strlen(STRINGSET_KEY_SIZE) + 3);
114
 
  sprintf(size_key,":%s:%s",prefix,STRINGSET_KEY_SIZE);
115
 
  nelec_key = (char *) malloc(strlen(prefix) + strlen(STRINGSET_KEY_NELEC) + 3);
116
 
  sprintf(nelec_key,":%s:%s",prefix,STRINGSET_KEY_NELEC);
117
 
  nfzc_key = (char *) malloc(strlen(prefix) + strlen(STRINGSET_KEY_NFZC) + 3);
118
 
  sprintf(nfzc_key,":%s:%s",prefix,STRINGSET_KEY_NFZC);
119
 
  fzc_occ_key = (char *) malloc(strlen(prefix) +
120
 
    strlen(STRINGSET_KEY_FZC_OCC) + 3);
121
 
  sprintf(fzc_occ_key,":%s:%s",prefix,STRINGSET_KEY_FZC_OCC);
122
 
  strings_key = (char *) malloc(strlen(prefix) + strlen(STRINGSET_KEY_STRINGS) + 3);
123
 
  sprintf(strings_key,":%s:%s",prefix,STRINGSET_KEY_STRINGS);
124
 
 
125
 
  psio_write_entry( unit, size_key, (char *)&sset->size, sizeof(int));
126
 
  psio_write_entry( unit, nelec_key, (char *)&sset->nelec, sizeof(int));
127
 
  psio_write_entry( unit, nfzc_key, (char *)&sset->nfzc, sizeof(int));
128
 
  if (sset->nfzc) {
129
 
    psio_write_entry( unit, fzc_occ_key, (char *)sset->fzc_occ, 
130
 
      sset->nfzc*sizeof(short int));
131
 
  }
132
 
 
133
 
  ptr = PSIO_ZERO;
134
 
  size = sset->size;
135
 
  nact = sset->nelec - sset->nfzc;
136
 
  for(i=0; i<size; i++) {
137
 
    psio_write( unit, strings_key, (char *) &(sset->strings[i].index), 
138
 
      sizeof(int), ptr, &ptr);
139
 
    psio_write( unit, strings_key, (char *) sset->strings[i].occ, 
140
 
      nact*sizeof(short int), ptr, &ptr);
141
 
  }
142
 
 
143
 
PSIO_CLOSE(unit)
144
 
PSIO_DONE
145
 
 
146
 
  free(size_key);
147
 
  free(nelec_key);
148
 
  free(nfzc_key);
149
 
  free(strings_key);
150
 
  free(fzc_occ_key);
151
 
}
152
 
 
153
 
 
154
 
void stringset_read(ULI unit, char *prefix, StringSet **stringset)
155
 
{
156
 
  int i, size, nelec, nfzc, nact;
157
 
  int need_to_init_psio = 0;
158
 
  int unit_opened = 1;
159
 
  char *size_key, *nelec_key, *nfzc_key, *fzc_occ_key, *strings_key;
160
 
  short int *fzc_occ;
161
 
  psio_address ptr;
162
 
  StringSet *sset = (StringSet *) malloc(sizeof(StringSet));
163
 
 
164
 
PSIO_INIT
165
 
PSIO_OPEN(unit,PSIO_OPEN_OLD)
166
 
 
167
 
  size_key = (char *) malloc( strlen(prefix) + strlen(STRINGSET_KEY_SIZE) + 3);
168
 
  sprintf(size_key,":%s:%s",prefix,STRINGSET_KEY_SIZE);
169
 
  nelec_key = (char *) malloc( strlen(prefix) + strlen(STRINGSET_KEY_NELEC) + 3);
170
 
  sprintf(nelec_key,":%s:%s",prefix,STRINGSET_KEY_NELEC);
171
 
  nfzc_key = (char *) malloc( strlen(prefix) + strlen(STRINGSET_KEY_NFZC) + 3);
172
 
  sprintf(nfzc_key,":%s:%s",prefix,STRINGSET_KEY_NFZC);
173
 
  fzc_occ_key = (char *) malloc(strlen(prefix) +
174
 
    strlen(STRINGSET_KEY_FZC_OCC) + 3);
175
 
  sprintf(fzc_occ_key,":%s:%s",prefix,STRINGSET_KEY_FZC_OCC);
176
 
  strings_key = (char *) malloc( strlen(prefix) + strlen(STRINGSET_KEY_STRINGS) + 3);
177
 
  sprintf(strings_key,":%s:%s",prefix,STRINGSET_KEY_STRINGS);
178
 
 
179
 
  psio_read_entry( unit, size_key, (char *)&size, sizeof(int));
180
 
  psio_read_entry( unit, nelec_key, (char *)&nelec, sizeof(int));
181
 
  psio_read_entry( unit, nfzc_key, (char *)&nfzc, sizeof(int));
182
 
  if (nfzc > 0) {
183
 
    fzc_occ = (short int *) malloc(nfzc*sizeof(short int));
184
 
    psio_read_entry( unit, fzc_occ_key, (char *)fzc_occ, 
185
 
      nfzc*sizeof(short int));
186
 
  }
187
 
  else fzc_occ = NULL;
188
 
 
189
 
  stringset_init(sset, size, nelec, nfzc, fzc_occ);
190
 
 
191
 
  nact = nelec - nfzc;
192
 
  ptr = PSIO_ZERO;
193
 
  for(i=0; i<size; i++) {
194
 
    psio_read( unit, strings_key, (char *) &(sset->strings[i].index), sizeof(int), ptr, &ptr);
195
 
    sset->strings[i].occ = (short int*) malloc(nact*sizeof(short int));
196
 
    psio_read( unit, strings_key, (char *) sset->strings[i].occ, nact*sizeof(short int), ptr, &ptr);
197
 
  }
198
 
 
199
 
PSIO_CLOSE(unit)
200
 
PSIO_DONE
201
 
 
202
 
  free(size_key);
203
 
  free(nelec_key);
204
 
  free(nfzc_key);
205
 
  free(fzc_occ_key);
206
 
  free(strings_key);
207
 
  if (nfzc > 0) free(fzc_occ);
208
 
  *stringset = sset;
209
 
}
210
 
 
211
 
 
212
 
/*! slaterdetset_init()
213
 
 */
214
 
void slaterdetset_init(SlaterDetSet *sdset, int size, StringSet *alphastrings, StringSet *betastrings)
215
 
{
216
 
  sdset->size = size;
217
 
  sdset->dets = (SlaterDet *) malloc(size*sizeof(SlaterDet));
218
 
  memset(sdset->dets,0,size*sizeof(SlaterDet));
219
 
  sdset->alphastrings = alphastrings;
220
 
  sdset->betastrings = betastrings;
221
 
}
222
 
 
223
 
/*! slaterdetset_delete()
224
 
 */
225
 
void slaterdetset_delete(SlaterDetSet *sdset)
226
 
{
227
 
  sdset->size = 0;
228
 
  if (sdset->dets) {
229
 
    free(sdset->dets);
230
 
    sdset->dets = NULL;
231
 
  }
232
 
  sdset->alphastrings = NULL;
233
 
  sdset->betastrings = NULL;
234
 
}
235
 
 
236
 
/*! slaterdetset_delete_full()
237
 
 */
238
 
void slaterdetset_delete_full(SlaterDetSet *sdset)
239
 
{
240
 
  sdset->size = 0;
241
 
  if (sdset->dets) {
242
 
    free(sdset->dets);
243
 
    sdset->dets = NULL;
244
 
  }
245
 
  if (sdset->alphastrings) {
246
 
    stringset_delete(sdset->alphastrings);
247
 
    sdset->alphastrings = NULL;
248
 
  }
249
 
  if (sdset->betastrings) {
250
 
    stringset_delete(sdset->betastrings);
251
 
    sdset->betastrings = NULL;
252
 
  }
253
 
}
254
 
 
255
 
/*! slaterdetset_add
256
 
 */
257
 
void slaterdetset_add(SlaterDetSet *sdset, int index, int alphastring, int betastring)
258
 
{
259
 
  SlaterDet *det;
260
 
  StringSet *alphaset = sdset->alphastrings;
261
 
  StringSet *betaset = sdset->betastrings;
262
 
 
263
 
  if (index < sdset->size && index >= 0) {
264
 
    det = sdset->dets + index;
265
 
  }
266
 
  det->index = index;
267
 
  if (alphastring < alphaset->size && alphastring >= 0)
268
 
    det->alphastring = alphastring;
269
 
  if (betastring < betaset->size && betastring >= 0)
270
 
    det->betastring = betastring;
271
 
}
272
 
 
273
 
void slaterdetset_write(ULI unit, char *prefix, SlaterDetSet *sdset)
274
 
{
275
 
  int i;
276
 
  int need_to_init_psio = 0;
277
 
  int unit_opened = 1;
278
 
  char *size_key, *set_key;
279
 
  char *alphaprefix, *betaprefix;
280
 
  psio_address ptr;
281
 
 
282
 
PSIO_INIT
283
 
PSIO_OPEN(unit,PSIO_OPEN_OLD)
284
 
 
285
 
  alphaprefix = (char *) malloc( strlen(prefix) + strlen(SDSET_KEY_ALPHASTRINGS) + 2);
286
 
  sprintf(alphaprefix,"%s:%s",prefix,SDSET_KEY_ALPHASTRINGS);
287
 
  betaprefix = (char *) malloc( strlen(prefix) + strlen(SDSET_KEY_BETASTRINGS) + 2);
288
 
  sprintf(betaprefix,"%s:%s",prefix,SDSET_KEY_BETASTRINGS);
289
 
 
290
 
  stringset_write( unit, alphaprefix, sdset->alphastrings);
291
 
  stringset_write( unit, betaprefix, sdset->betastrings);
292
 
  
293
 
  free(alphaprefix);
294
 
  free(betaprefix);
295
 
 
296
 
  size_key = (char *) malloc( strlen(prefix) + strlen(SDSET_KEY_SIZE) + 3);
297
 
  sprintf(size_key,":%s:%s",prefix,SDSET_KEY_SIZE);
298
 
  set_key = (char *) malloc( strlen(prefix) + strlen(SDSET_KEY_DETERMINANTS) + 3);
299
 
  sprintf(set_key,":%s:%s",prefix,SDSET_KEY_DETERMINANTS);
300
 
 
301
 
  psio_write_entry( unit, size_key, (char *)&sdset->size, sizeof(int));
302
 
  psio_write_entry( unit, set_key, (char *)sdset->dets, sdset->size*sizeof(SlaterDet));
303
 
 
304
 
PSIO_CLOSE(unit)
305
 
PSIO_DONE
306
 
 
307
 
  free(size_key);
308
 
  free(set_key);
309
 
}
310
 
 
311
 
void slaterdetset_read(ULI unit, char *prefix, SlaterDetSet **slaterdetset)
312
 
{
313
 
  int i, size;
314
 
  int need_to_init_psio = 0;
315
 
  int unit_opened = 1;
316
 
  char *size_key, *set_key;
317
 
  char *alphaprefix, *betaprefix;
318
 
  psio_address ptr;
319
 
  StringSet *alphastrings, *betastrings;
320
 
  SlaterDetSet *sdset = (SlaterDetSet *) malloc(sizeof(SlaterDetSet));
321
 
 
322
 
PSIO_INIT
323
 
PSIO_OPEN(unit,PSIO_OPEN_OLD)
324
 
 
325
 
  alphaprefix = (char *) malloc( strlen(prefix) + strlen(SDSET_KEY_ALPHASTRINGS) + 2);
326
 
  sprintf(alphaprefix,"%s:%s",prefix,SDSET_KEY_ALPHASTRINGS);
327
 
  betaprefix = (char *) malloc( strlen(prefix) + strlen(SDSET_KEY_BETASTRINGS) + 2);
328
 
  sprintf(betaprefix,"%s:%s",prefix,SDSET_KEY_BETASTRINGS);
329
 
 
330
 
  stringset_read( unit, alphaprefix, &alphastrings);
331
 
  stringset_read( unit, betaprefix, &betastrings);
332
 
  
333
 
  free(alphaprefix);
334
 
  free(betaprefix);
335
 
 
336
 
  size_key = (char *) malloc( strlen(prefix) + strlen(SDSET_KEY_SIZE) + 3);
337
 
  sprintf(size_key,":%s:%s",prefix,SDSET_KEY_SIZE);
338
 
  set_key = (char *) malloc( strlen(prefix) + strlen(SDSET_KEY_DETERMINANTS) + 3);
339
 
  sprintf(set_key,":%s:%s",prefix,SDSET_KEY_DETERMINANTS);
340
 
 
341
 
  psio_read_entry( unit, size_key, (char *)&size, sizeof(int));
342
 
  slaterdetset_init(sdset,size,alphastrings,betastrings);
343
 
  psio_read_entry( unit, set_key, (char *)sdset->dets, sdset->size*sizeof(SlaterDet));
344
 
 
345
 
PSIO_CLOSE(unit)
346
 
PSIO_DONE
347
 
 
348
 
  free(size_key);
349
 
  free(set_key);
350
 
 
351
 
  *slaterdetset = sdset;
352
 
}
353
 
 
354
 
 
355
 
/*! slaterdetvector_init()
356
 
 */
357
 
void slaterdetvector_init(SlaterDetVector *sdvector, SlaterDetSet *sdset)
358
 
{
359
 
  sdvector->size = sdset->size;
360
 
  sdvector->sdset = sdset;
361
 
  sdvector->coeffs = init_array(sdvector->size);
362
 
}
363
 
 
364
 
/*! slaterdetvector_delete()
365
 
 */
366
 
void slaterdetvector_delete(SlaterDetVector *sdvector)
367
 
{
368
 
  sdvector->size = 0;
369
 
  sdvector->sdset = NULL;
370
 
  if (sdvector->coeffs) {
371
 
    free(sdvector->coeffs);
372
 
    sdvector->coeffs = NULL;
373
 
  }
374
 
}
375
 
 
376
 
 
377
 
/*! slaterdetvector_delete_full()
378
 
 */
379
 
void slaterdetvector_delete_full(SlaterDetVector *sdvector)
380
 
{
381
 
  sdvector->size = 0;
382
 
  if (sdvector->sdset) {
383
 
    slaterdetset_delete_full(sdvector->sdset);
384
 
    sdvector->sdset = NULL;
385
 
  }
386
 
  if (sdvector->coeffs) {
387
 
    free(sdvector->coeffs);
388
 
    sdvector->coeffs = NULL;
389
 
  }
390
 
}
391
 
 
392
 
 
393
 
/*! slaterdetvector_add
394
 
 */
395
 
void slaterdetvector_add(SlaterDetVector *sdvector, int index, double coeff)
396
 
{
397
 
  if (index < sdvector->size && index >= 0) {
398
 
    sdvector->coeffs[index] = coeff;
399
 
  }
400
 
}
401
 
 
402
 
 
403
 
/*! slaterdetvector_set
404
 
 */
405
 
void slaterdetvector_set(SlaterDetVector *sdvector, double *coeffs)
406
 
{
407
 
  int i;
408
 
  const int size = sdvector->size;
409
 
  double *v = sdvector->coeffs;
410
 
  if (v) {
411
 
    for(i=0; i<size; i++)
412
 
      v[i] = coeffs[i];
413
 
  }
414
 
}
415
 
 
416
 
 
417
 
/*
418
 
** Use this if we only need to write a single vector.  Otherwise, call
419
 
** slaterdetset_write(); slaterdetset_write_vect();
420
 
** to allow for multiple vectors per slaterdetset to be written to disk.
421
 
*/
422
 
void slaterdetvector_write(ULI unit, char *prefix, SlaterDetVector *vector)
423
 
{
424
 
  int need_to_init_psio = 0;
425
 
  int unit_opened = 1;
426
 
 
427
 
PSIO_INIT
428
 
PSIO_OPEN(unit,PSIO_OPEN_OLD)
429
 
 
430
 
  slaterdetset_write(unit, prefix, vector->sdset);
431
 
  slaterdetset_write_vect(unit, prefix, vector->coeffs, vector->size, 0);
432
 
 
433
 
PSIO_CLOSE(unit)
434
 
PSIO_DONE
435
 
 
436
 
}
437
 
 
438
 
 
439
 
/*
440
 
** This function already assumes we've already called slaterdetset_write()
441
 
** to write out the string and determinant information.  This is only 
442
 
** going to write out the coefficients.  This has been split out because
443
 
** we might want to write several roots for a given determinant setup.
444
 
**
445
 
** CDS 8/03
446
 
*/
447
 
void slaterdetset_write_vect(ULI unit, char *prefix, 
448
 
  double *coeffs, int size, int vectnum)
449
 
{
450
 
  int need_to_init_psio = 0;
451
 
  int unit_opened = 1;
452
 
  char *vector_key;
453
 
 
454
 
PSIO_INIT
455
 
PSIO_OPEN(unit,PSIO_OPEN_OLD)
456
 
 
457
 
  if (vectnum < 0 || vectnum > 99) {
458
 
    fprintf(stderr, "(slaterdetset_write_vect): vectnum out of bounds\n");
459
 
    abort();
460
 
  }
461
 
 
462
 
  vector_key = (char *) malloc(strlen(prefix)+strlen(SDVECTOR_KEY_VECTOR)+5);
463
 
  sprintf(vector_key,":%s:%s%2d",prefix,SDVECTOR_KEY_VECTOR,vectnum);
464
 
 
465
 
  psio_write_entry(unit, vector_key, (char *)coeffs, size*sizeof(double));
466
 
 
467
 
PSIO_CLOSE(unit)
468
 
PSIO_DONE
469
 
 
470
 
  free(vector_key);
471
 
}
472
 
 
473
 
 
474
 
 
475
 
/*
476
 
** Use this if we only need to read a single vector.  Otherwise, call
477
 
** slaterdetset_read(); slaterdetset_read_vect();
478
 
** to allow for multiple vectors per slaterdetset to be read from disk.
479
 
*/
480
 
void slaterdetvector_read(ULI unit, char *prefix, SlaterDetVector **sdvector)
481
 
{
482
 
  int need_to_init_psio = 0;
483
 
  int unit_opened = 1;
484
 
  SlaterDetSet *sdset;
485
 
  SlaterDetVector *vector = (SlaterDetVector *) malloc(sizeof(SlaterDetVector));
486
 
 
487
 
PSIO_INIT
488
 
PSIO_OPEN(unit,PSIO_OPEN_OLD)
489
 
 
490
 
  slaterdetset_read(unit, prefix, &sdset);
491
 
  slaterdetvector_init(vector,sdset);
492
 
  slaterdetset_read_vect(unit, prefix, vector->coeffs, vector->size, 0);
493
 
 
494
 
PSIO_CLOSE(unit)
495
 
PSIO_DONE
496
 
  
497
 
  *sdvector = vector;
498
 
}
499
 
 
500
 
 
501
 
/*
502
 
** This function already assumes we've already called slaterdetset_read()
503
 
** to read in the string and determinant information.  This is only 
504
 
** going to read in the coefficients.  This has been split out because
505
 
** we might want to read several roots for a given determinant setup.
506
 
**
507
 
** CDS 8/03
508
 
*/
509
 
void slaterdetset_read_vect(ULI unit, char *prefix, double *coeffs, 
510
 
  int size, int vectnum)
511
 
{
512
 
  int need_to_init_psio = 0;
513
 
  int unit_opened = 1;
514
 
  char *vector_key;
515
 
 
516
 
PSIO_INIT
517
 
PSIO_OPEN(unit,PSIO_OPEN_OLD)
518
 
 
519
 
  vector_key = (char *) malloc(strlen(prefix)+strlen(SDVECTOR_KEY_VECTOR)+5);
520
 
  sprintf(vector_key,":%s:%s%2d",prefix,SDVECTOR_KEY_VECTOR,vectnum);
521
 
 
522
 
  psio_read_entry(unit, vector_key, (char *)coeffs, size*sizeof(double));
523
 
 
524
 
PSIO_CLOSE(unit)
525
 
PSIO_DONE
526
 
  
527
 
  free(vector_key);
528
 
 
529
 
}
530
 
 
531
 
 
532