CORSIKA add-on package IACT/ATMO:  Version 1.70 (August 2025)
mc_atmprof.h
Go to the documentation of this file.
1 /* ============================================================================
2 
3  Copyright (C) 2019 Konrad Bernloehr
4 
5  This file is part of the eventio/hessio library and other packages.
6 
7  The eventio/hessio library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Lesser General Public
9  License as published by the Free Software Foundation; either
10  version 2.1 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public License
18  along with this library. If not, see <http://www.gnu.org/licenses/>.
19 
20 ============================================================================ */
21 
35 /* ========================================================= */
36 
37 #ifndef HAVE_MC_ATMPROF
38 
39 # define HAVE_MC_ATMPROF 1
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
48 {
49  int atmprof_id;
51  double obslev;
52  unsigned n_alt;
53  double *alt_km;
54  double *rho;
55  double *thick;
56  double *refidx_m1;
58  double hlay[6];
59  double aatm[5];
60  double batm[5];
61  double catm[5];
62  double datm[5];
63  double thickl[6];
64  double htoa;
65 };
66 typedef struct atmospheric_profile AtmProf;
67 
68 /* Make the common profile available */
70 /* Set the common profile from a separate copy. */
71 void set_common_atmprof(AtmProf *atmprof);
72 void show_atmprof (AtmProf *atmprof);
73 
74 void atmegs_(int *nlay, double *hlay, double *aatm,
75  double *batm, double *catm, double *datm, double *htoa);
76 void atmegs_default(void);
77 
86 double rhofc (double *height);
87 double thickc (double *height);
88 double refidc (double *height);
89 double refim1c (double *height);
90 double heighc (double *thick);
91 
92 #ifdef __cplusplus
93 }
94 #endif
95 
96 #endif
97 
void set_common_atmprof(AtmProf *atmprof)
Set the common profile from a separate copy.
Definition: mc_atmprof.c:60
void show_atmprof(AtmProf *atmprof)
Show a readable version of the tabulated atmospheric profile (basically like in the original tables,...
Definition: mc_atmprof.c:135
double rhofc(double *height)
C-called functions equivalent to the CORSIKA-built-in functions to evaluate the 5-layer parametrizati...
Definition: mc_atmprof.c:241
void atmegs_(int *nlay, double *hlay, double *aatm, double *batm, double *catm, double *datm, double *htoa)
Fill the 5-layer parameters into the common atmospheric profile structure for keeping track of that t...
Definition: mc_atmprof.c:180
AtmProf * get_common_atmprof(void)
Make this copy of the atmospheric profile available elsewhere.
Definition: mc_atmprof.c:50
Atmospheric profile as stored in atmprof*.dat files - the actually used columns only.
Definition: mc_atmprof.h:48
double hlay[6]
Layer bounderies a.s.l.
Definition: mc_atmprof.h:58
double * rho
Density [g/cm^3] at each level.
Definition: mc_atmprof.h:54
int atmprof_id
Profile ID number ('atmprof<i>.dat') or 99.
Definition: mc_atmprof.h:49
unsigned n_alt
Number of altitude levels.
Definition: mc_atmprof.h:52
int have_lay5_param
Is 1 if the 5-layer CORSIKA built-in parametrization is known, 0 if not.
Definition: mc_atmprof.h:57
double thickl[6]
Atmospheric thickness at given hlay heights.
Definition: mc_atmprof.h:63
double * thick
Vertical column density from space to given level [g/cm^2].
Definition: mc_atmprof.h:55
double catm[5]
See ATMC CORSIKA inputs card.
Definition: mc_atmprof.h:61
double datm[5]
Inverse of catm values (if non-zero)
Definition: mc_atmprof.h:62
double * refidx_m1
Index of refraction minus one (n-1) at given level.
Definition: mc_atmprof.h:56
double aatm[5]
See ATMA CORSIKA inputs card.
Definition: mc_atmprof.h:59
char * atmprof_fname
Original name of atmospheric profile loaded.
Definition: mc_atmprof.h:50
double htoa
Height (a.s.l.) at top of atmosphere [cm].
Definition: mc_atmprof.h:64
double batm[5]
See ATMB CORSIKA inputs card.
Definition: mc_atmprof.h:60
double obslev
Observation level [cm], a.s.l., as used in CORSIKA.
Definition: mc_atmprof.h:51
double * alt_km
Altitude a.s.l.
Definition: mc_atmprof.h:53