summaryrefslogtreecommitdiff
path: root/src/IO/FortranBindingsIO.c
blob: a70fa229284628a53eb96c1b06dffd003c1305a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
 /*@@
   @file      FortranBindingsIO.c
   @date      Thu Feb  18 14:27:18 1999
   @author    Gabrielle Allen
   @desc 
              Fortran bindings for the IO functions
   @enddesc 
   @version   $Id$
 @@*/ 

#include <stdlib.h>
#include "cctk_Flesh.h"
#include "cctk_FortranString.h"
#include "cctk_IO.h"
#include "cctk_IOMethods.h"

static const char *rcsid = "$Header$";

CCTK_FILEVERSION(IO_FortranBindingsIO_c)

/********************************************************************
 ********************* Local Routine Prototypes *********************
 ********************************************************************/

/********************************************************************
 ********************* Other Routine Prototypes *********************
 ********************************************************************/

void CCTK_FCALL CCTK_FNAME (CCTK_OutputGH)
                           (int *istat, const cGH *GH);
void CCTK_FCALL CCTK_FNAME (CCTK_OutputVar)
     (int *istat, const cGH *GH, ONE_FORTSTRING_ARG);
void CCTK_FCALL CCTK_FNAME (CCTKi_RegisterIOMethod)
                           (int *handle, TWO_FORTSTRING_ARG);

/********************************************************************
 *********************     Local Data   *****************************
 ********************************************************************/

/********************************************************************
 *********************     External Routines   **********************
 ********************************************************************/

 /*@@
   @routine    CCTK_OutputGH
   @date       
   @author     
   @desc
   Fortran binding for CCTK_OutputGH
   @enddesc
   @var        istat
   @vdesc      error code
   @vtype      int
   @vio        out
   @endvar
   @var        GH
   @vdesc      grid hierachy
   @vtype      const GH *
   @vio        in
   @endvar

   @returntype int
   @returndesc

   @endreturndesc
@@*/
void CCTK_FCALL CCTK_FNAME (CCTK_OutputGH)
                           (int *istat, const cGH *GH)
{
  *istat = CCTK_OutputGH (GH);
}

 /*@@
   @routine    CCTK_OutputVar
   @date       
   @author     
   @desc
   Fortran binding for CCTK_OutputVar
   @enddesc
   @var        istat
   @vdesc      error code
   @vtype      int
   @vio        out
   @endva
   @var        GH
   @vdesc      grid hierachy
   @vtype      const GH *
   @vio        in
   @endvar
   @var        name
   @vdesc      Name of variable to outut
   @vtype      const char *
   @vio        in
   @endvar
   @returntype int
   @returndesc

   @endreturndesc
@@*/
void CCTK_FCALL CCTK_FNAME (CCTK_OutputVar)
                           (int *istat, const cGH *GH, ONE_FORTSTRING_ARG)
{
  ONE_FORTSTRING_CREATE (var);
  *istat = CCTK_OutputVar (GH, var);
  free (var);
}


 /*@@
   @routine    CCTKi_RegisterIOMethod
   @date       
   @author     
   @desc

   @enddesc
@@*/

/* FIXME: This function is no longer needed, test can remove */

void CCTK_FCALL CCTK_FNAME (CCTKi_RegisterIOMethod)
                           (int *handle, TWO_FORTSTRING_ARG)
{
  TWO_FORTSTRING_CREATE (thorn, name);
  *handle = CCTKi_RegisterIOMethod (thorn, name);
  free (thorn);
  free (name);
}