8.0
general documentation
Loading...
Searching...
No Matches
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-2023 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 * Call exit routine from Fortran code
58 *
59 * Fortran interface:
60 *
61 * subroutine csexit (status)
62 * *****************
63 *
64 * integer status : <-- : 0 for success, 1+ for error
65 *----------------------------------------------------------------------------*/
66
67void CS_PROCF (csexit, CSEXIT)
68(
69 const int *status
70);
71
72/*----------------------------------------------------------------------------
73 * Elapsed time since execution start
74 *
75 * Fortran interface:
76 *
77 * subroutine dmtmps (tw)
78 * *****************
79 *
80 * double precision tw : <-- : elapsed time
81 *----------------------------------------------------------------------------*/
82
83void CS_PROCF (dmtmps, DMTMPS)
84(
85 cs_real_t *tw
86);
87
88/*----------------------------------------------------------------------------
89 * Compute the gamma function of x.
90 *
91 * Fortran interface
92 *
93 * subroutine csgamma (x, g)
94 * ******************
95 *
96 * double precision x : <-- : input value
97 * double precision gamma : --> : output value
98 *----------------------------------------------------------------------------*/
99
100void CS_PROCF (csgamma, CSGAMMA)
101(
102 const cs_real_t *x,
104 );
105
106/*----------------------------------------------------------------------------
107 * Compute the erf function of x.
108 *
109 * Fortran interface
110 *
111 * subroutine cserf (x, g)
112 * ******************
113 *
114 * double precision x : <-- : input value
115 * double precision ferf : --> : output value
116 *----------------------------------------------------------------------------*/
117
118void CS_PROCF (cserf, CSERF)
119(
120 const cs_real_t *x,
122 );
123
124/*----------------------------------------------------------------------------
125 * Get log name file information.
126 *
127 * When log file output is suppressed, it returns the name of the
128 * bit buck file ("/dev/null")
129 *
130 * Fortran interface
131 *
132 * subroutine cslogname (len, name)
133 * ********************
134 *
135 * integer len : <-- : maximum string length
136 * character* name : --> : Fortran string
137 *----------------------------------------------------------------------------*/
138
139void CS_PROCF (cslogname, CSLOGNAME)
140(
141 const int *len,
142 char *dir
143 CS_ARGF_SUPP_CHAINE /* (possible 'length' arguments added
144 by many Fortran compilers) */
145);
146
147/*----------------------------------------------------------------------------
148 * Get package data path information.
149 *
150 * The aim of this function is to aviod issues with Fortran array bounds
151 * checking when compilers such as icc 11 consider a character array from C
152 * as an array of 1-character length strings.
153 *
154 * Fortran interface
155 *
156 * subroutine csdatadir (len, dir)
157 * ********************
158 *
159 * integer len : <-- : maximum string length
160 * character* dir : --> : Fortran string
161 *----------------------------------------------------------------------------*/
162
163void CS_PROCF (csdatadir, CSDATADIR)
164(
165 const int *len,
166 char *dir
167 CS_ARGF_SUPP_CHAINE /* (possible 'length' arguments added
168 by many Fortran compilers) */
169);
170
171/*=============================================================================
172 * Public function prototypes
173 *============================================================================*/
174
175/*----------------------------------------------------------------------------
176 * Replace default bft_printf() mechanism with internal mechanism.
177 *
178 * This variant is designed to allow switching from C to Fortran output,
179 * whithout disabling regular C stdout output when switched to Fortran.
180 *
181 * This allows redirecting or suppressing logging for different ranks.
182 *
183 * parameters:
184 * log_name <-- base file name for log, or NULL for stdout
185 * rn_log_flag <-- redirection for ranks > 0 log:
186 * false: to "/dev/null" (suppressed)
187 * true: redirected to <log_name>_n*.log" file;
188 *----------------------------------------------------------------------------*/
189
190void
191cs_base_fortran_bft_printf_set(const char *log_name,
192 bool rn_log_flag);
193
194/*----------------------------------------------------------------------------
195 * Switch bft_printf() mechanism to C output.
196 *
197 * This function may only be called after cs_base_fortran_bft_printf_set()
198 *----------------------------------------------------------------------------*/
199
200void
202
203/*----------------------------------------------------------------------------
204 * Switch bft_printf() mechanism to Fortran output.
205 *
206 * This function may only be called after cs_base_fortran_bft_printf_set()
207 *----------------------------------------------------------------------------*/
208
209void
211
212/*----------------------------------------------------------------------------
213 * Wrappers for C functions
214 *----------------------------------------------------------------------------*/
215
216void
218
219void
221
222void
224 cs_real_t *st_exp,
225 cs_real_t *st_imp);
226
227void
229
230void
232
233void
235 int *ialtyb,
236 int *impale);
237
238void
240
241void
243
244void
246
247void
249
250void
252
253/*----------------------------------------------------------------------------*/
254
256
257#endif /* __CS_BASE_FORTRAN_H__ */
void csdatadir(const int *len, char *dir CS_ARGF_SUPP_CHAINE)
Definition cs_base_fortran.c:382
void cslogname(const int *len, char *dir CS_ARGF_SUPP_CHAINE)
Definition cs_base_fortran.c:334
void cserf(const cs_real_t *x, cs_real_t *ferf)
Definition cs_base_fortran.c:305
void dmtmps(cs_real_t *tw)
Definition cs_base_fortran.c:259
void csexit(const int *status)
Definition cs_base_fortran.c:240
void csgamma(const cs_real_t *x, cs_real_t *gamma)
Definition cs_base_fortran.c:279
void cs_user_initialization_wrapper(void)
Definition cs_base_fortran.c:655
void cs_user_boundary_conditions_wrapper(int *itypcl)
Definition cs_base_fortran.c:610
void cs_user_extra_operations_initialize_wrapper(void)
Definition cs_base_fortran.c:584
void cs_user_boundary_conditions_setup_wrapper(void)
Definition cs_base_fortran.c:604
void cs_user_finalize_setup_wrapper(void)
Definition cs_base_fortran.c:667
void cs_base_fortran_bft_printf_to_f(void)
Definition cs_base_fortran.c:541
void cs_user_physical_properties_wrapper(void)
Definition cs_base_fortran.c:590
void cs_user_source_terms_wrapper(int f_id, cs_real_t *st_exp, cs_real_t *st_imp)
Definition cs_base_fortran.c:596
void cs_base_fortran_bft_printf_to_c(void)
Definition cs_base_fortran.c:507
void cs_user_extra_operations_wrapper(void)
Definition cs_base_fortran.c:649
void cs_user_porosity_wrapper(void)
Definition cs_base_fortran.c:673
void cs_base_fortran_bft_printf_set(const char *log_name, bool rn_log_flag)
Definition cs_base_fortran.c:425
void cs_user_boundary_conditions_ale_wrapper(int *itypcl, int *ialtyb, int *impale)
Definition cs_base_fortran.c:638
void cs_user_parameters_wrapper(void)
Definition cs_base_fortran.c:661
#define BEGIN_C_DECLS
Definition cs_defs.h:509
double cs_real_t
Floating-point value.
Definition cs_defs.h:319
#define CS_PROCF(x, y)
Definition cs_defs.h:523
#define END_C_DECLS
Definition cs_defs.h:510
#define CS_ARGF_SUPP_CHAINE
Definition cs_defs.h:535
@ gamma
Definition cs_field_pointer.h:221
double precision function ferf(x)
Erf function.
Definition spefun.f90:54