f77proto.h 3.36 KB
Newer Older
thomas.forbriger's avatar
thomas.forbriger committed
1
2
3
4
5
/*! \file f77proto.h
 * \brief prototypes for Fortran interface (prototypes)
 * 
 * ----------------------------------------------------------------------------
 * 
thomas.forbriger's avatar
thomas.forbriger committed
6
 * $Id: f77proto.h,v 1.5 2006-03-28 16:03:11 tforb Exp $
thomas.forbriger's avatar
thomas.forbriger committed
7
8
9
10
 * \author Thomas Forbriger
 * \date 22/12/2002
 * 
 * prototypes for Fortran interface (prototypes)
11
 *
thomas.forbriger's avatar
thomas.forbriger committed
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * ----
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version. 
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 * ----
 *
28
29
 * \sa \ref page_fortran
 * \sa f77interface
thomas.forbriger's avatar
thomas.forbriger committed
30
31
32
33
34
 * 
 * Copyright (c) 2002 by Thomas Forbriger (IMG Frankfurt) 
 * 
 * REVISIONS and CHANGES 
 *  - 22/12/2002   V1.0   Thomas Forbriger
35
36
 *  - 27/12/2002   V1.1   (thof)
 *                        - now provides some documentation
thomas.forbriger's avatar
thomas.forbriger committed
37
38
39
40
41
 * 
 * ============================================================================
 */

// include guard
42
#ifndef AFF_F77PROTO_H_VERSION
thomas.forbriger's avatar
thomas.forbriger committed
43

44
#define AFF_F77PROTO_H_VERSION \
45
  "AFF_F77PROTO_H   V1.1"
46
#define AFF_F77PROTO_H_CVSID \
thomas.forbriger's avatar
thomas.forbriger committed
47
  "$Id: f77proto.h,v 1.5 2006-03-28 16:03:11 tforb Exp $"
thomas.forbriger's avatar
thomas.forbriger committed
48

49
#include<aff/array.h>
thomas.forbriger's avatar
thomas.forbriger committed
50

51
52
#include<complex>

53
54
55
56
57
58
/*! \brief This namespace collects all test functions for interfacing Fortran 77
 * 
 * \sa \ref page_fortran
 * \sa tests/f77test.cc
 * \sa tests/f77interface.cc
 */
59
namespace f77interface {
thomas.forbriger's avatar
thomas.forbriger committed
60

61
62
63
typedef aff::Array<std::complex<float> > Tcarray;
typedef aff::Array<std::complex<double> > Tzarray;

64
65
66
67
68
69
/*! \brief fill an AFF array thorugh a Fortran subroutine
 *
 * An aff::Array<int> object is passed to the Fortran subroutine fill and is
 * filled with values there. 
 * The concept is discussed on page "\ref page_fortran".
 */
70
int fill(const aff::Array<int>& fa);
71
72
73
74
75
76
77
78
79
80

/*! \brief fill the Fortran common-block array
 *
 * Two aff::Array<float> objects are passed to the Fortran subroutine
 * fillarray which calculates complex values from the elements of these arrays
 * and fills the array in common-block \c f77common which is defined in
 * tests/f77common.inc.
 *
 * The concept is discussed on page "\ref page_fortran".
 */
81
82
int fillarray(const aff::Array<float>& v1,
              const aff::Array<float>& v2);
83
84
85
86
87
88
89
90
91

/*! \brief returns results from Fortran subroutine sums
 *
 * The Fortran subroutine sums calculates column-sums from the array in the
 * common block. These values are return in an 
 * \code aff::Array<std::complex<float> > \endcode object.
 *
 * The concept is discussed on page "\ref page_fortran".
 */
92
Tcarray sums();
93
94
95
96
97
98
99
100
101
102

/*! \brief returns direct access to Fortran common block
 *
 * This function returns a 
 * \code aff::Array<std::complex<double> > \endcode object, which offers
 * direct read/write access to the array in the Fortran common block
 * f77common.
 *
 * The concept is discussed on page "\ref page_fortran".
 */
103
Tzarray viewcommon();
104
105
106
107
108

} // namespace f77interface


#endif // AFF_F77PROTO_H_VERSION (includeguard)
thomas.forbriger's avatar
thomas.forbriger committed
109
110

/* ----- END OF f77proto.h ----- */