Code_Saturne
CFD tool
cs_base_fortran.h
Go to the documentation of this file.
1 #ifndef __CS_BASE_FORTRAN_H__
2 #define __CS_BASE_FORTRAN_H__
3 
4 /*============================================================================
5  * Initializtion and handling of Fortran-related mechanisms
6  *============================================================================*/
7 
8 /*
9  This file is part of Code_Saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2012 EDF S.A.
12 
13  This program is free software; you can redistribute it and/or modify it under
14  the terms of the GNU General Public License as published by the Free Software
15  Foundation; either version 2 of the License, or (at your option) any later
16  version.
17 
18  This program is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21  details.
22 
23  You should have received a copy of the GNU General Public License along with
24  this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
25  Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 */
27 
28 /*----------------------------------------------------------------------------*/
29 
30 /*----------------------------------------------------------------------------
31  * Local headers
32  *----------------------------------------------------------------------------*/
33 
34 #include "cs_base.h"
35 
36 /*----------------------------------------------------------------------------*/
37 
39 
40 /*=============================================================================
41  * Macro definitions
42  *============================================================================*/
43 
44 /*============================================================================
45  * Type definitions
46  *============================================================================*/
47 
48 /*============================================================================
49  * Static global variables
50  *============================================================================*/
51 
52 /*============================================================================
53  * Public function prototypes for Fortran API
54  *============================================================================*/
55 
56 /*----------------------------------------------------------------------------
57  * Create a directory, or check it exists.
58  *
59  * Fortran interface
60  *
61  * SUBROUTINE CSMKDR (DIRNAM, DIRLEN)
62  * *****************
63  *
64  * CHARACTER* DIRNAM : --> : Directory name
65  * INTEGER DIRLEN : --> : Directory name length
66  *----------------------------------------------------------------------------*/
67 
68 void CS_PROCF (csmkdr, CSMKDR)
69 (
70  const char *dirnam,
71  const cs_int_t *dirlen
72 );
73 
74 /*----------------------------------------------------------------------------
75  * Compute the gamma function of x.
76  *
77  * Fortran interface
78  *
79  * subroutine csgamma (x, g)
80  * ******************
81  *
82  * double precision x : <-- : input value
83  * double precision gamma : --> : output value
84  *----------------------------------------------------------------------------*/
85 
86 void CS_PROCF (csgamma, CSGAMMA)
87 (
88  const cs_real_t *x,
90  );
91 
92 /*----------------------------------------------------------------------------
93  * Copy a Fortan string buffer to a C string buffer
94  *
95  * The aim of this function is to aviod issues with Fortran array bounds
96  * checking when compilers such as icc 11 consider a character array from C
97  * as an array of 1-character length strings.
98  *
99  * Fortran interface
100  *
101  * SUBROUTINE CSSF2C (LEN, CSTR, FSTR)
102  * *****************
103  *
104  * INTEGER LEN : --> : String length
105  * CHARACTER* FSTR : --> : Fortran string
106  * CHARACTER* CSTR : <-- : C string
107  *----------------------------------------------------------------------------*/
108 
109 void CS_PROCF (cssf2c, CSSF2C)
110 (
111  const cs_int_t *len,
112  const char *fstr,
113  char *cstr
114  CS_ARGF_SUPP_CHAINE /* (possible 'length' arguments added
115  by many Fortran compilers) */
116 );
117 
118 /*=============================================================================
119  * Public function prototypes
120  *============================================================================*/
121 
122 /*----------------------------------------------------------------------------
123  * Replace default bft_printf() mechanism with internal mechanism.
124  *
125  * This is necessary for good consistency of messages output from C or
126  * from Fortran, and to handle parallel and serial logging options.
127  *
128  * parameters:
129  * r0_log_flag <-- redirection for rank 0 log;
130  * 0: not redirected; 1: redirected to "listing" file
131  * rn_log_flag <-- redirection for ranks > 0 log:
132  * 0: not redirected; 1: redirected to "listing_n*" file;
133  * 2: redirected to "/dev/null" (suppressed)
134  *----------------------------------------------------------------------------*/
135 
136 void
137 cs_base_fortran_bft_printf_set(int r0_log_flag,
138  int rn_log_flag);
139 
141 
142 #endif /* __CS_BASE_FORTRAN_H__ */
size_t len
Definition: mei_scanner.c:639
#define BEGIN_C_DECLS
Definition: cs_defs.h:365
#define CS_ARGF_SUPP_CHAINE
Definition: cs_defs.h:394
int cs_int_t
Definition: cs_defs.h:263
void cssf2c(const cs_int_t *len, const char *fstr, char *cstr CS_ARGF_SUPP_CHAINE)
Definition: cs_base_fortran.c:250
double precision, dimension(ncharm), save gamma
Definition: cpincl.f90:105
#define END_C_DECLS
Definition: cs_defs.h:366
void cs_base_fortran_bft_printf_set(int r0_log_flag, int rn_log_flag)
Definition: cs_base_fortran.c:280
double cs_real_t
Definition: cs_defs.h:264
void csgamma(const cs_real_t *x, cs_real_t *gamma)
Definition: cs_base_fortran.c:219
#define CS_PROCF(x, y)
Definition: cs_defs.h:379
BEGIN_C_DECLS void csmkdr(const char *dirnam, const cs_int_t *dirlen)
Definition: cs_base_fortran.c:186