8.2
general documentation
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-2024 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 
67 void 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 
83 void CS_PROCF (dmtmps, DMTMPS)
84 (
85  cs_real_t *tw
86 );
87 
88 /*----------------------------------------------------------------------------
89  * Get log name file information.
90  *
91  * When log file output is suppressed, it returns the name of the
92  * bit buck file ("/dev/null")
93  *
94  * Fortran interface
95  *
96  * subroutine cslogname (len, name)
97  * ********************
98  *
99  * integer len : <-- : maximum string length
100  * character* name : --> : Fortran string
101  *----------------------------------------------------------------------------*/
102 
103 void CS_PROCF (cslogname, CSLOGNAME)
104 (
105  const int *len,
106  char *dir
107  CS_ARGF_SUPP_CHAINE /* (possible 'length' arguments added
108  by many Fortran compilers) */
109 );
110 
111 /*=============================================================================
112  * Public function prototypes
113  *============================================================================*/
114 
115 /*----------------------------------------------------------------------------
116  * Replace default bft_printf() mechanism with internal mechanism.
117  *
118  * This variant is designed to allow switching from C to Fortran output,
119  * whithout disabling regular C stdout output when switched to Fortran.
120  *
121  * This allows redirecting or suppressing logging for different ranks.
122  *
123  * parameters:
124  * log_name <-- base file name for log, or NULL for stdout
125  * rn_log_flag <-- redirection for ranks > 0 log:
126  * false: to "/dev/null" (suppressed)
127  * true: redirected to <log_name>_n*.log" file;
128  *----------------------------------------------------------------------------*/
129 
130 void
131 cs_base_fortran_bft_printf_set(const char *log_name,
132  bool rn_log_flag);
133 
134 /*----------------------------------------------------------------------------
135  * Switch bft_printf() mechanism to C output.
136  *
137  * This function may only be called after cs_base_fortran_bft_printf_set()
138  *----------------------------------------------------------------------------*/
139 
140 void
142 
143 /*----------------------------------------------------------------------------
144  * Switch bft_printf() mechanism to Fortran output.
145  *
146  * This function may only be called after cs_base_fortran_bft_printf_set()
147  *----------------------------------------------------------------------------*/
148 
149 void
151 
152 /*----------------------------------------------------------------------------
153  * Wrappers for C functions
154  *----------------------------------------------------------------------------*/
155 
156 void
158 
159 void
161 
162 void
164 
165 void
167  cs_real_t *st_exp,
168  cs_real_t *st_imp);
169 
170 void
172 
173 void
175 
176 void
178 
179 void
181 
182 void
184 
185 void
187 
188 void
190 
191 /*----------------------------------------------------------------------------*/
192 
194 
195 #endif /* __CS_BASE_FORTRAN_H__ */
void cslogname(const int *len, char *dir CS_ARGF_SUPP_CHAINE)
Definition: cs_base_fortran.c:282
void cs_user_initialization_wrapper(void)
Definition: cs_base_fortran.c:558
void cs_user_boundary_conditions_wrapper(int *itypcl)
Definition: cs_base_fortran.c:524
void cs_user_extra_operations_initialize_wrapper(void)
Definition: cs_base_fortran.c:492
void dmtmps(cs_real_t *tw)
Definition: cs_base_fortran.c:259
void cs_user_boundary_conditions_setup_wrapper(void)
Definition: cs_base_fortran.c:518
void cs_user_finalize_setup_wrapper(void)
Definition: cs_base_fortran.c:570
void cs_base_fortran_bft_printf_to_f(void)
Definition: cs_base_fortran.c:449
void cs_user_physical_properties_wrapper(void)
Definition: cs_base_fortran.c:498
void cs_user_physical_properties_turb_viscosity_wrapper(void)
Definition: cs_base_fortran.c:504
void cs_user_source_terms_wrapper(int f_id, cs_real_t *st_exp, cs_real_t *st_imp)
Definition: cs_base_fortran.c:510
void csexit(const int *status)
Definition: cs_base_fortran.c:240
void cs_base_fortran_bft_printf_to_c(void)
Definition: cs_base_fortran.c:415
void cs_user_extra_operations_wrapper(void)
Definition: cs_base_fortran.c:552
void cs_user_porosity_wrapper(void)
Definition: cs_base_fortran.c:576
void cs_base_fortran_bft_printf_set(const char *log_name, bool rn_log_flag)
Definition: cs_base_fortran.c:333
void cs_user_parameters_wrapper(void)
Definition: cs_base_fortran.c:564
#define BEGIN_C_DECLS
Definition: cs_defs.h:528
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
#define CS_PROCF(x, y)
Definition: cs_defs.h:560
#define END_C_DECLS
Definition: cs_defs.h:529
#define CS_ARGF_SUPP_CHAINE
Definition: cs_defs.h:572