7.2
general documentation
cs_atmo.h
Go to the documentation of this file.
1 #ifndef __CS_ATMO_H__
2 #define __CS_ATMO_H__
3 
4 /*============================================================================
5  * Main for atmospheric related functions
6  *============================================================================*/
7 
8 /*
9  This file is part of code_saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2022 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  * Local Macro definitions
42  *============================================================================*/
43 
44 /*============================================================================
45  * Type definitions
46  *============================================================================*/
47 
48 /*----------------------------------------------------------------------------
49  * Atmospheric models
50  *----------------------------------------------------------------------------*/
51 
52 typedef enum {
53 
58 
60 
61 /*----------------------------------------------------------------------------
62  * Atmospheric nucleation models
63  *----------------------------------------------------------------------------*/
64 
65 typedef enum {
66 
71 
73 
74 /*----------------------------------------------------------------------------
75  * Atmospheric aerosol external library
76  *----------------------------------------------------------------------------*/
77 
78 typedef enum {
79 
82 
84 
85 /*============================================================================
86  * Type definitions
87  *============================================================================*/
88 
93 /*----------------------------------------------------------------------------
94  * Atmospheric model options descriptor
95  *----------------------------------------------------------------------------*/
96 
97 typedef struct {
98  /* Space and time reference of the run */
100  int syear;
102  int squant;
104  int shour;
106  int smin;
118  int nbmetd;
120  int nbmett;
123  int nbmetm;
124  int nbmaxt;
128 
131 
133 
134  /* Model options */
168 
171 
210  /* meteo u profiles */
212  /* meteo v profiles */
214 
215  /* Altitudes of the dynamic profiles */
217  /* Altitudes of the temperature profile */
219  /* Time (in seconds) of the meteo profile */
221  /* Hydrostatic pressure from Laplace integration */
223  /* potential temperature profile */
225 
227 
228 /*----------------------------------------------------------------------------
229  * Atmospheric model constants descriptor
230  *----------------------------------------------------------------------------*/
231 
232 typedef struct {
233  /* Space and time reference of the run */
236 
238 
239 /*----------------------------------------------------------------------------
240  * Atmospheric chemistry options descriptor
241  *----------------------------------------------------------------------------*/
242 
243 typedef struct {
244 
252  int model;
255 
256  /* Flag to deactivate photolysis */
258 
263 
271  int n_layer;
273  int n_size;
275  int *species_to_scalar_id; // used only in Fortran
279  int *chempoint;
280 
290 
291 /*============================================================================
292  * Static global variables
293  *============================================================================*/
294 
295 /* Pointer to atmo options structure */
297 
298 /* Pointer to atmo constants structure */
300 
301 /* Pointer to atmo chemistry structure */
303 
304 /*============================================================================
305  * Public function definitions
306  *============================================================================*/
307 
308 /*----------------------------------------------------------------------------*/
312 /*----------------------------------------------------------------------------*/
313 
314 void
316 
317 /*----------------------------------------------------------------------------*/
321 /*----------------------------------------------------------------------------*/
322 
323 void
325 
326 /*----------------------------------------------------------------------------*/
348 /*----------------------------------------------------------------------------*/
349 
350 void
352 
353 /*----------------------------------------------------------------------------*/
371 /*----------------------------------------------------------------------------*/
372 
373 void
375 
376 /*----------------------------------------------------------------------------*/
384 /*----------------------------------------------------------------------------*/
385 
386 cs_real_t
388  cs_real_t dlmo);
389 
390 /*----------------------------------------------------------------------------*/
398 /*----------------------------------------------------------------------------*/
399 
400 cs_real_t
402  cs_real_t dlmo);
403 
404 /*----------------------------------------------------------------------------*/
413 /*----------------------------------------------------------------------------*/
414 
415 cs_real_t
417  cs_real_t z0,
418  cs_real_t dlmo);
419 
420 /*----------------------------------------------------------------------------*/
429 /*----------------------------------------------------------------------------*/
430 
431 cs_real_t
433  cs_real_t z0,
434  cs_real_t dlmo);
435 
436 
437 /*----------------------------------------------------------------------------*/
443 /*----------------------------------------------------------------------------*/
444 
445 void
446 cs_atmo_set_meteo_file_name(const char *file_name);
447 
448 /*----------------------------------------------------------------------------*/
454 /*----------------------------------------------------------------------------*/
455 
456 void
457 cs_atmo_set_chem_conc_file_name(const char *file_name);
458 
459 /*----------------------------------------------------------------------------*/
465 /*----------------------------------------------------------------------------*/
466 
467 void
468 cs_atmo_set_aero_conc_file_name(const char *file_name);
469 
470 /*----------------------------------------------------------------------------*/
476 /*----------------------------------------------------------------------------*/
477 
478 void
479 cs_atmo_chemistry_set_spack_file_name(const char *file_name);
480 
481 /*----------------------------------------------------------------------------*/
487 /*----------------------------------------------------------------------------*/
488 
489 void
490 cs_atmo_chemistry_set_aerosol_file_name(const char *file_name);
491 
492 /*----------------------------------------------------------------------------*/
498 /*----------------------------------------------------------------------------*/
499 
500 void
502 
503 /*----------------------------------------------------------------------------*/
523 /*----------------------------------------------------------------------------*/
524 
525 void
527  cs_real_t xlong,
528  cs_real_t jour,
529  cs_real_t heurtu,
530  int imer,
531  cs_real_t *albe,
532  cs_real_t *muzero,
533  cs_real_t *omega,
534  cs_real_t *fo);
535 
536 /*----------------------------------------------------------------------------*/
540 /*----------------------------------------------------------------------------*/
541 
542 void
543 cs_atmo_log_setup(void);
544 
545 /*----------------------------------------------------------------------------*/
549 /*----------------------------------------------------------------------------*/
550 
551 void
553 
554 /*----------------------------------------------------------------------------*/
558 /*----------------------------------------------------------------------------*/
559 
560 void
562 
563 /*----------------------------------------------------------------------------*/
567 /*----------------------------------------------------------------------------*/
568 
569 void
570 cs_atmo_finalize(void);
571 
572 /*----------------------------------------------------------------------------*/
573 
575 
576 #endif /* __CS_ATMO_H__ */
int nbmaxt
Definition: cs_atmo.h:124
cs_real_t meteo_zi
Definition: cs_atmo.h:179
cs_atmo_chemistry_t * cs_glob_atmo_chemistry
int * species_to_field_id
Definition: cs_atmo.h:276
cs_real_t meteo_zref
Definition: cs_atmo.h:177
void cs_atmo_hydrostatic_profiles_compute(void)
Compute hydrostatic profiles of density and pressure.
Definition: cs_atmo.c:1504
Definition: cs_atmo.h:54
char * chem_conc_file_name
Definition: cs_atmo.h:285
void cs_atmo_compute_solar_angles(cs_real_t xlat, cs_real_t xlong, cs_real_t jour, cs_real_t heurtu, int imer, cs_real_t *albe, cs_real_t *muzero, cs_real_t *omega, cs_real_t *fo)
1D Radiative scheme - Solar data + zenithal angle)
Definition: cs_atmo.c:1983
cs_real_t meteo_ustar0
Definition: cs_atmo.h:195
cs_atmo_option_t * cs_glob_atmo_option
cs_real_t * z_temp_met
Definition: cs_atmo.h:218
void cs_atmo_set_meteo_file_name(const char *file_name)
This function set the file name of the meteo file.
Definition: cs_atmo.c:1732
cs_atmo_aerosol_type_t aerosol_model
Definition: cs_atmo.h:262
cs_real_t meteo_u2
Definition: cs_atmo.h:193
cs_real_t meteo_z0
Definition: cs_atmo.h:175
Definition: cs_atmo.h:55
cs_real_t meteo_psea
Definition: cs_atmo.h:209
int subgrid_model
Definition: cs_atmo.h:155
int smin
Definition: cs_atmo.h:106
double precision, dimension(ncharm), save omega
Definition: cpincl.f90:99
void cs_atmo_set_aero_conc_file_name(const char *file_name)
This function set the file name of the aerosol concentration file.
Definition: cs_atmo.c:1790
#define BEGIN_C_DECLS
Definition: cs_defs.h:510
int deposition_model
Definition: cs_atmo.h:138
int n_layer
Definition: cs_atmo.h:271
Definition: cs_atmo.h:56
bool compute_z_ground
Definition: cs_atmo.h:130
cs_real_t meteo_u1
Definition: cs_atmo.h:191
cs_real_t * time_met
Definition: cs_atmo.h:220
int sedimentation_model
Definition: cs_atmo.h:136
void cs_atmo_chemistry_set_aerosol_file_name(const char *file_name)
This function sets the file name to initialize the aerosol library.
Definition: cs_atmo.c:1847
cs_real_t cs_mo_phim(cs_real_t z, cs_real_t dlmo)
Universal function phim for neutral, stable and unstable.
Definition: cs_atmo.h:67
Definition: cs_atmo.h:68
double cs_real_t
Floating-point value.
Definition: cs_defs.h:322
bool chemistry_with_photolysis
Definition: cs_atmo.h:257
cs_real_t meteo_zu2
Definition: cs_atmo.h:183
int n_size
Definition: cs_atmo.h:273
cs_real_t ps
Definition: cs_atmo.h:235
Definition: cs_atmo.h:81
char * aero_file_name
Definition: cs_atmo.h:282
cs_real_t meteo_zt2
Definition: cs_atmo.h:187
cs_real_t y_l93
Definition: cs_atmo.h:116
int meteo_profile
Definition: cs_atmo.h:167
cs_real_t x_l93
Definition: cs_atmo.h:114
void cs_atmo_log_setup(void)
Print the atmospheric module options to setup.log.
Definition: cs_atmo.c:2074
void cs_atmo_chemistry_log_setup(void)
Print the atmospheric chemistry options to setup.log.
Definition: cs_atmo.c:2188
cs_real_t meteo_t0
Definition: cs_atmo.h:201
cs_atmo_constants_t * cs_glob_atmo_constants
Definition: cs_atmo.h:232
int n_reactions
Definition: cs_atmo.h:254
Definition: cs_atmo.h:243
char * spack_file_name
Definition: cs_atmo.h:274
cs_atmo_aerosol_type_t
Definition: cs_atmo.h:78
cs_real_t meteo_uref
Definition: cs_atmo.h:189
void cs_atmo_chemistry_set_spack_file_name(const char *file_name)
This function set the file name of the SPACK file.
Definition: cs_atmo.c:1822
int nucleation_model
Definition: cs_atmo.h:147
bool frozen_gas_chem
Definition: cs_atmo.h:265
Definition: cs_atmo.h:97
void cs_atmo_init_meteo_profiles(void)
Initialize meteo profiles if no meteo file is given.
Definition: cs_atmo.c:916
cs_real_t cs_mo_psim(cs_real_t z, cs_real_t z0, cs_real_t dlmo)
Universal function psim for neutral, stable and unstable.
int squant
Definition: cs_atmo.h:102
cs_real_t meteo_t2
Definition: cs_atmo.h:205
real(c_double), pointer, save xlat
latitude of the domain origin
Definition: atincl.f90:205
int open_bcs_treatment
Definition: cs_atmo.h:132
int shour
Definition: cs_atmo.h:104
int n_species
Definition: cs_atmo.h:253
int nbmetd
Definition: cs_atmo.h:118
cs_real_t latitude
Definition: cs_atmo.h:112
#define END_C_DECLS
Definition: cs_defs.h:511
int model
Definition: cs_atmo.h:252
char * meteo_file_name
Definition: cs_atmo.h:170
Definition: cs_atmo.h:69
Definition: cs_atmo.h:57
cs_real_t domain_orientation
Definition: cs_atmo.h:127
void cs_atmo_declare_chem_from_spack(void)
This function declare additional transported variables for atmospheric module for the chemistry defin...
Definition: cs_atmo.c:1871
cs_atmo_nucleation_type_t
Definition: cs_atmo.h:65
bool init_aero_with_lib
Definition: cs_atmo.h:269
cs_real_t meteo_t1
Definition: cs_atmo.h:203
cs_real_t meteo_dlmo
Definition: cs_atmo.h:173
Definition: cs_atmo.h:80
int nbmetm
Definition: cs_atmo.h:123
cs_real_t cs_mo_psih(cs_real_t z, cs_real_t z0, cs_real_t dlmo)
Universal function psih for neutral, stable and unstable.
int distribution_model
Definition: cs_atmo.h:160
cs_real_t * hyd_p_met
Definition: cs_atmo.h:222
cs_real_t * molar_mass
Definition: cs_atmo.h:278
cs_real_t * v_met
Definition: cs_atmo.h:213
cs_real_t meteo_zu1
Definition: cs_atmo.h:181
cs_real_t meteo_zt1
Definition: cs_atmo.h:185
int nbmett
Definition: cs_atmo.h:120
int syear
Definition: cs_atmo.h:100
cs_real_t * pot_t_met
Definition: cs_atmo.h:224
cs_real_t ssec
Definition: cs_atmo.h:108
void cs_atmo_z_ground_compute(void)
This function computes the ground elevation.
Definition: cs_atmo.c:1294
char * aero_conc_file_name
Definition: cs_atmo.h:288
Definition: cs_atmo.h:70
void cs_atmo_set_chem_conc_file_name(const char *file_name)
This function set the file name of the chemistry concentration file.
Definition: cs_atmo.c:1761
void cs_atmo_finalize(void)
Deallocate arrays for atmo module.
Definition: cs_atmo.c:2299
cs_real_t meteo_angle
Definition: cs_atmo.h:199
cs_real_t * u_met
Definition: cs_atmo.h:211
cs_atmo_model_t
Definition: cs_atmo.h:52
cs_real_t meteo_tstar
Definition: cs_atmo.h:207
cs_real_t meteo_wstar0
Definition: cs_atmo.h:197
cs_real_t cs_mo_phih(cs_real_t z, cs_real_t dlmo)
Universal function phih for neutral, stable and unstable.
cs_real_t * z_dyn_met
Definition: cs_atmo.h:216
cs_real_t longitude
Definition: cs_atmo.h:110
void cs_atmo_aerosol_log_setup(void)
Print the atmospheric aerosols options to setup.log.
Definition: cs_atmo.c:2253
bool init_gas_with_lib
Definition: cs_atmo.h:267
int * chempoint
Definition: cs_atmo.h:279
void cs_atmo_compute_meteo_profiles(void)
Compute meteo profiles if no meteo file is given.
Definition: cs_atmo.c:1084
int * species_to_scalar_id
Definition: cs_atmo.h:275