~ubuntu-branches/ubuntu/trusty/nwchem/trusty-proposed

« back to all changes in this revision

Viewing changes to src/tools/ga-5-1/ma/f2c.c

  • Committer: Package Import Robot
  • Author(s): Michael Banck, Daniel Leidert, Andreas Tille, Michael Banck
  • Date: 2013-07-04 12:14:55 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130704121455-5tvsx2qabor3nrui
Tags: 6.3-1
* New upstream release.
* Fixes anisotropic properties (Closes: #696361).
* New features include:
  + Multi-reference coupled cluster (MRCC) approaches
  + Hybrid DFT calculations with short-range HF 
  + New density-functionals including Minnesota (M08, M11) and HSE hybrid
    functionals
  + X-ray absorption spectroscopy (XAS) with TDDFT
  + Analytical gradients for the COSMO solvation model
  + Transition densities from TDDFT 
  + DFT+U and Electron-Transfer (ET) methods for plane wave calculations
  + Exploitation of space group symmetry in plane wave geometry optimizations
  + Local density of states (LDOS) collective variable added to Metadynamics
  + Various new XC functionals added for plane wave calculations, including
    hybrid and range-corrected ones
  + Electric field gradients with relativistic corrections 
  + Nudged Elastic Band optimization method
  + Updated basis sets and ECPs 

[ Daniel Leidert ]
* debian/watch: Fixed.

[ Andreas Tille ]
* debian/upstream: References

[ Michael Banck ]
* debian/upstream (Name): New field.
* debian/patches/02_makefile_flags.patch: Refreshed.
* debian/patches/06_statfs_kfreebsd.patch: Likewise.
* debian/patches/07_ga_target_force_linux.patch: Likewise.
* debian/patches/05_avoid_inline_assembler.patch: Removed, no longer needed.
* debian/patches/09_backported_6.1.1_fixes.patch: Likewise.
* debian/control (Build-Depends): Added gfortran-4.7 and gcc-4.7.
* debian/patches/10_force_gcc-4.7.patch: New patch, explicitly sets
  gfortran-4.7 and gcc-4.7, fixes test suite hang with gcc-4.8 (Closes:
  #701328, #713262).
* debian/testsuite: Added tests for COSMO analytical gradients and MRCC.
* debian/rules (MRCC_METHODS): New variable, required to enable MRCC methods.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#if HAVE_CONFIG_H
2
 
#   include "config.h"
3
 
#endif
4
 
 
5
 
/** @file
6
 
 * C wrapper routines.  In general, f2c_foo_ is called by FORTRAN routine
7
 
 * MA_foo, performs any necessary argument munging, then calls C routine
8
 
 * MA_foo.
9
 
 */
10
 
 
11
 
#include "farg.h"
12
 
#include "typesf2c.h"
13
 
#include "ma.h"
14
 
#include "scope.h"
15
 
 
16
 
#ifdef F2C_HIDDEN_STRING_LENGTH_AFTER_ARGS
17
 
public Boolean FATR f2c_alloc_get_(datatype, nelem, name, memhandle, index, namesize)
18
 
    Integer *datatype;
19
 
    Integer *nelem;
20
 
    char    *name;
21
 
    Integer *memhandle;
22
 
    MA_AccessIndex *index;
23
 
    int  namesize;   /* implicitly passed by FORTRAN */
24
 
#else /* F2C_HIDDEN_STRING_LENGTH_AFTER_ARGS */
25
 
public Boolean FATR f2c_alloc_get_(datatype, nelem, name, namesize, memhandle, index)
26
 
    Integer *datatype;
27
 
    Integer *nelem;
28
 
    char    *name;
29
 
    int  namesize;   /* implicitly passed by FORTRAN */
30
 
    Integer *memhandle;
31
 
    MA_AccessIndex *index;
32
 
#endif /* F2C_HIDDEN_STRING_LENGTH_AFTER_ARGS */
33
 
{
34
 
    Boolean value;
35
 
    char buf[MA_NAMESIZE];
36
 
 
37
 
    /* ensure that name is NUL-terminated */
38
 
    ga_f2cstring(name, namesize, buf, (Integer)sizeof(buf));
39
 
 
40
 
    value = MA_alloc_get(*datatype, *nelem, buf, memhandle, index);
41
 
 
42
 
    /* FORTRAN array indexing is 1-based, so increment index */
43
 
    (*index)++;
44
 
 
45
 
    return value;
46
 
}
47
 
 
48
 
 
49
 
#ifdef F2C_HIDDEN_STRING_LENGTH_AFTER_ARGS
50
 
public Boolean FATR f2c_allocate_heap_(datatype, nelem, name, memhandle, namesize)
51
 
    Integer *datatype;
52
 
    Integer *nelem;
53
 
    char    *name;
54
 
    Integer *memhandle;
55
 
    int  namesize;   /* implicitly passed by FORTRAN */
56
 
#else /* F2C_HIDDEN_STRING_LENGTH_AFTER_ARGS */
57
 
public Boolean FATR f2c_allocate_heap_(datatype, nelem, name, namesize, memhandle)
58
 
    Integer *datatype;
59
 
    Integer *nelem;
60
 
    char    *name;
61
 
    int  namesize;   /* implicitly passed by FORTRAN */
62
 
    Integer *memhandle;
63
 
#endif /* F2C_HIDDEN_STRING_LENGTH_AFTER_ARGS */
64
 
{
65
 
    char buf[MA_NAMESIZE];
66
 
 
67
 
    /* ensure that name is NUL-terminated */
68
 
    ga_f2cstring(name, namesize, buf, (Integer)sizeof(buf));
69
 
 
70
 
    return MA_allocate_heap(*datatype, *nelem, buf, memhandle);
71
 
}
72
 
 
73
 
 
74
 
public Boolean FATR f2c_chop_stack_(memhandle)
75
 
    Integer *memhandle;
76
 
{
77
 
    return MA_chop_stack(*memhandle);
78
 
}
79
 
 
80
 
 
81
 
public Boolean FATR f2c_free_heap_(memhandle)
82
 
    Integer *memhandle;
83
 
{
84
 
    return MA_free_heap(*memhandle);
85
 
}
86
 
 
87
 
 
88
 
public Boolean FATR f2c_free_heap_piece_(memhandle, nelem)
89
 
    Integer *memhandle;
90
 
    Integer *nelem;
91
 
{
92
 
    return MA_free_heap_piece(*memhandle, *nelem);
93
 
}
94
 
 
95
 
 
96
 
public Boolean FATR f2c_get_index_(memhandle, index)
97
 
    Integer *memhandle;
98
 
    MA_AccessIndex *index;
99
 
{
100
 
    Boolean value = MA_get_index(*memhandle, index);
101
 
 
102
 
    /* FORTRAN array indexing is 1-based, so increment index */
103
 
    (*index)++;
104
 
 
105
 
    return value;
106
 
}
107
 
 
108
 
 
109
 
public Boolean FATR f2c_get_next_memhandle_(ithandle, memhandle)
110
 
    Integer *ithandle;
111
 
    Integer *memhandle;
112
 
{
113
 
    return MA_get_next_memhandle(ithandle, memhandle);
114
 
}
115
 
 
116
 
 
117
 
public Boolean FATR f2c_get_numalign_(value)
118
 
    Integer *value;
119
 
{
120
 
    return MA_get_numalign(value);
121
 
}
122
 
 
123
 
 
124
 
public Boolean FATR f2c_inform_base_(datatype, address1, address2)
125
 
    Integer *datatype;
126
 
    Pointer address1;
127
 
    Pointer address2;
128
 
{
129
 
    return MAi_inform_base(*datatype, address1, address2);
130
 
}
131
 
 
132
 
 
133
 
public Boolean FATR f2c_init_(datatype, nominal_stack, nominal_heap)
134
 
    Integer *datatype;
135
 
    Integer *nominal_stack;
136
 
    Integer *nominal_heap;
137
 
{
138
 
    return MA_init(*datatype, *nominal_stack, *nominal_heap);
139
 
}
140
 
 
141
 
 
142
 
public Boolean FATR f2c_initialized_()
143
 
{
144
 
    return MA_initialized();
145
 
}
146
 
 
147
 
 
148
 
public Boolean FATR f2c_init_memhandle_iterator_(ithandle)
149
 
    Integer *ithandle;
150
 
{
151
 
    return MA_init_memhandle_iterator(ithandle);
152
 
}
153
 
 
154
 
 
155
 
public Integer FATR f2c_inquire_avail_(datatype)
156
 
    Integer *datatype;
157
 
{
158
 
    return MA_inquire_avail(*datatype);
159
 
}
160
 
 
161
 
 
162
 
public Integer FATR f2c_inquire_heap_(datatype)
163
 
    Integer *datatype;
164
 
{
165
 
    return MA_inquire_heap(*datatype);
166
 
}
167
 
 
168
 
 
169
 
public Integer FATR f2c_inquire_heap_check_stack_(datatype)
170
 
    Integer *datatype;
171
 
{
172
 
    return MA_inquire_heap_check_stack(*datatype);
173
 
}
174
 
 
175
 
 
176
 
public Integer FATR f2c_inquire_heap_no_partition_(datatype)
177
 
    Integer *datatype;
178
 
{
179
 
    return MA_inquire_heap_no_partition(*datatype);
180
 
}
181
 
 
182
 
 
183
 
public Integer FATR f2c_inquire_stack_(datatype)
184
 
    Integer *datatype;
185
 
{
186
 
    return MA_inquire_stack(*datatype);
187
 
}
188
 
 
189
 
 
190
 
public Integer FATR f2c_inquire_stack_check_heap_(datatype)
191
 
    Integer *datatype;
192
 
{
193
 
    return MA_inquire_stack_check_heap(*datatype);
194
 
}
195
 
 
196
 
 
197
 
public Integer FATR f2c_inquire_stack_no_partition_(datatype)
198
 
    Integer *datatype;
199
 
{
200
 
    return MA_inquire_stack_no_partition(*datatype);
201
 
}
202
 
 
203
 
 
204
 
public Boolean FATR f2c_pop_stack_(memhandle)
205
 
    Integer *memhandle;
206
 
{
207
 
    return MA_pop_stack(*memhandle);
208
 
}
209
 
 
210
 
 
211
 
public void FATR f2c_print_stats_(printroutines)
212
 
    Boolean *printroutines;
213
 
{
214
 
    MA_print_stats(*printroutines);
215
 
}
216
 
 
217
 
 
218
 
#ifdef F2C_HIDDEN_STRING_LENGTH_AFTER_ARGS
219
 
public Boolean FATR f2c_push_get_(datatype, nelem, name, memhandle, index, namesize)
220
 
    Integer *datatype;
221
 
    Integer *nelem;
222
 
    char    *name;
223
 
    Integer *memhandle;
224
 
    MA_AccessIndex *index;
225
 
    int  namesize;    /* implicitly passed by FORTRAN */
226
 
#else /* F2C_HIDDEN_STRING_LENGTH_AFTER_ARGS */
227
 
public Boolean FATR f2c_push_get_(datatype, nelem, name, namesize, memhandle, index)
228
 
    Integer *datatype;
229
 
    Integer *nelem;
230
 
    char    *name;
231
 
    int  namesize;    /* implicitly passed by FORTRAN */
232
 
    Integer *memhandle;
233
 
    MA_AccessIndex *index;
234
 
#endif /* F2C_HIDDEN_STRING_LENGTH_AFTER_ARGS */
235
 
{
236
 
    Boolean    value;
237
 
    char    buf[MA_NAMESIZE];
238
 
 
239
 
    /* ensure that name is NUL-terminated */
240
 
    ga_f2cstring(name, namesize, buf, (Integer)sizeof(buf));
241
 
 
242
 
    value = MA_push_get(*datatype, *nelem, buf, memhandle, index);
243
 
 
244
 
    /* FORTRAN array indexing is 1-based, so increment index */
245
 
    (*index)++;
246
 
 
247
 
    return value;
248
 
}
249
 
 
250
 
 
251
 
#ifdef F2C_HIDDEN_STRING_LENGTH_AFTER_ARGS
252
 
public Boolean FATR f2c_push_stack_(datatype, nelem, name, memhandle, namesize)
253
 
    Integer *datatype;
254
 
    Integer *nelem;
255
 
    char    *name;
256
 
    Integer *memhandle;
257
 
    int  namesize;    /* implicitly passed by FORTRAN */
258
 
#else /* F2C_HIDDEN_STRING_LENGTH_AFTER_ARGS */
259
 
public Boolean FATR f2c_push_stack_(datatype, nelem, name, namesize, memhandle)
260
 
    Integer *datatype;
261
 
    Integer *nelem;
262
 
    char    *name;
263
 
    int  namesize;
264
 
    Integer *memhandle;
265
 
#endif /* F2C_HIDDEN_STRING_LENGTH_AFTER_ARGS */
266
 
{
267
 
    char buf[MA_NAMESIZE];
268
 
 
269
 
    /* ensure that name is NUL-terminated */
270
 
    ga_f2cstring(name, namesize, buf, (Integer)sizeof(buf));
271
 
 
272
 
    return MA_push_stack(*datatype, *nelem, buf, memhandle);
273
 
}
274
 
 
275
 
 
276
 
public Boolean FATR f2c_set_auto_verify_(value)
277
 
    Integer *value;
278
 
{
279
 
    return MA_set_auto_verify((Boolean)*value);
280
 
}
281
 
 
282
 
 
283
 
public Boolean FATR f2c_set_error_print_(value)
284
 
    Integer *value;
285
 
{
286
 
    return MA_set_error_print((Boolean)*value);
287
 
}
288
 
 
289
 
 
290
 
public Boolean FATR f2c_set_hard_fail_(value)
291
 
    Integer *value;
292
 
{
293
 
    return MA_set_hard_fail((Boolean)*value);
294
 
}
295
 
 
296
 
 
297
 
public Boolean FATR f2c_set_numalign_(value)
298
 
    Integer *value;
299
 
{
300
 
    return MA_set_numalign(*value);
301
 
}
302
 
 
303
 
 
304
 
public Integer FATR f2c_sizeof_(datatype1, nelem1, datatype2)
305
 
    Integer *datatype1;
306
 
    Integer *nelem1;
307
 
    Integer *datatype2;
308
 
{
309
 
    return MA_sizeof(*datatype1, *nelem1, *datatype2);
310
 
}
311
 
 
312
 
 
313
 
public Integer FATR f2c_sizeof_overhead_(datatype)
314
 
    Integer *datatype;
315
 
{
316
 
    return MA_sizeof_overhead(*datatype);
317
 
}
318
 
 
319
 
 
320
 
public void FATR f2c_summarize_allocated_blocks_()
321
 
{
322
 
    /* FORTRAN indices are 1-based */
323
 
    MAi_summarize_allocated_blocks(1);
324
 
}
325
 
 
326
 
 
327
 
public void FATR f2c_trace_(value)
328
 
    Integer *value;
329
 
{
330
 
    MA_trace((Boolean)*value);
331
 
}
332
 
 
333
 
 
334
 
public Boolean FATR f2c_verify_allocator_stuff_()
335
 
{
336
 
    return MA_verify_allocator_stuff();
337
 
}