MPTRAC
mptrac.h
Go to the documentation of this file.
1/*
2 This file is part of MPTRAC.
3
4 MPTRAC is free software: you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8
9 MPTRAC is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with MPTRAC. If not, see <http://www.gnu.org/licenses/>.
16
17 Copyright (C) 2013-2025 Forschungszentrum Juelich GmbH
18*/
19
97#ifndef LIBTRAC_H
98#define LIBTRAC_H
99
100/* ------------------------------------------------------------
101 Includes...
102 ------------------------------------------------------------ */
103
104#include <ctype.h>
105#include <gsl/gsl_fft_complex.h>
106#include <gsl/gsl_math.h>
107#include <gsl/gsl_randist.h>
108#include <gsl/gsl_rng.h>
109#include <gsl/gsl_spline.h>
110#include <gsl/gsl_statistics.h>
111#include <math.h>
112#include <netcdf.h>
113#include <omp.h>
114#include <stdint.h>
115#include <stdio.h>
116#include <stdlib.h>
117#include <string.h>
118#include <time.h>
119#include <sys/time.h>
120
121#ifdef MPI
122#include "mpi.h"
123#endif
124
125#ifdef _OPENACC
126#include "openacc.h"
127#endif
128
129#ifdef CURAND
130#include "curand.h"
131#endif
132
133#ifdef ZFP
134#include "zfp.h"
135#endif
136
137#ifdef ZSTD
138#include "zstd.h"
139#endif
140
141#ifdef CMS
142#include "cmultiscale.h"
143#endif
144
145#ifdef KPP
146#include "chem_Parameters.h"
147#include "chem_Global.h"
148#include "chem_Sparse.h"
149#endif
150
151/* ------------------------------------------------------------
152 Constants...
153 ------------------------------------------------------------ */
154
156#ifndef AVO
157#define AVO 6.02214076e23
158#endif
159
161#ifndef CPD
162#define CPD 1003.5
163#endif
164
166#ifndef EPS
167#define EPS (MH2O / MA)
168#endif
169
171#ifndef G0
172#define G0 9.80665
173#endif
174
176#ifndef H0
177#define H0 7.0
178#endif
179
181#ifndef LV
182#define LV 2501000.
183#endif
184
186#ifndef KARMAN
187#define KARMAN 0.40
188#endif
189
191#ifndef KB
192#define KB 1.3806504e-23
193#endif
194
196#ifndef MA
197#define MA 28.9644
198#endif
199
201#ifndef MH2O
202#define MH2O 18.01528
203#endif
204
206#ifndef MO3
207#define MO3 48.00
208#endif
209
211#ifndef P0
212#define P0 1013.25
213#endif
214
216#ifndef RA
217#define RA (1e3 * RI / MA)
218#endif
219
221#ifndef RE
222#define RE 6367.421
223#endif
224
226#ifndef RI
227#define RI 8.3144598
228#endif
229
231#ifndef T0
232#define T0 273.15
233#endif
234
235/* ------------------------------------------------------------
236 Dimensions...
237 ------------------------------------------------------------ */
238
240#ifndef LEN
241#define LEN 5000
242#endif
243
245#ifndef NP
246#define NP 10000000
247#endif
248
250#ifndef NQ
251#define NQ 15
252#endif
253
255#ifndef NCSI
256#define NCSI 1000000
257#endif
258
260#ifndef EP
261#define EP 140
262#endif
263
265#ifndef EX
266#define EX 1202
267#endif
268
270#ifndef EY
271#define EY 602
272#endif
273
275#ifndef NENS
276#define NENS 2000
277#endif
278
280#ifndef NOBS
281#define NOBS 10000000
282#endif
283
285#ifndef NTHREADS
286#define NTHREADS 512
287#endif
288
290#ifndef CY
291#define CY 250
292#endif
293
295#ifndef CO3
296#define CO3 30
297#endif
298
300#ifndef CP
301#define CP 70
302#endif
303
305#ifndef CSZA
306#define CSZA 50
307#endif
308
310#ifndef CT
311#define CT 12
312#endif
313
315#ifndef CTS
316#define CTS 1000
317#endif
318
319/* ------------------------------------------------------------
320 Macros...
321 ------------------------------------------------------------ */
322
342#ifdef _OPENACC
343#define ALLOC(ptr, type, n) \
344 if(acc_get_num_devices(acc_device_nvidia) <= 0) \
345 ERRMSG("Not running on a GPU device!"); \
346 if((ptr=calloc((size_t)(n), sizeof(type)))==NULL) \
347 ERRMSG("Out of memory!");
348#else
349#define ALLOC(ptr, type, n) \
350 if((ptr=calloc((size_t)(n), sizeof(type)))==NULL) \
351 ERRMSG("Out of memory!");
352#endif
353
372#define ARRAY_2D(ix, iy, ny) \
373 ((ix) * (ny) + (iy))
374
391#define ARRAY_3D(ix, iy, ny, iz, nz) \
392 (((ix)*(ny) + (iy)) * (nz) + (iz))
393
416#define ARRHENIUS(a, b, t) \
417 ((a) * exp( -(b) / (t)))
418
440#define DEG2DX(dlon, lat) \
441 (RE * DEG2RAD(dlon) * cos(DEG2RAD(lat)))
442
461#define DEG2DY(dlat) \
462 (RE * DEG2RAD(dlat))
463
478#define DEG2RAD(deg) \
479 ((deg) * (M_PI / 180.0))
480
503#define DP2DZ(dp, p) \
504 (- (dp) * H0 / (p))
505
525#define DX2DEG(dx, lat) \
526 (((lat) < -89.999 || (lat) > 89.999) ? 0 \
527 : (dx) * 180. / (M_PI * RE * cos(DEG2RAD(lat))))
528
543#define DY2DEG(dy) \
544 ((dy) * 180. / (M_PI * RE))
545
562#define DZ2DP(dz, p) \
563 (-(dz) * (p) / H0)
564
578#define DIST(a, b) \
579 sqrt(DIST2(a, b))
580
594#define DIST2(a, b) \
595 ((a[0]-b[0])*(a[0]-b[0])+(a[1]-b[1])*(a[1]-b[1])+(a[2]-b[2])*(a[2]-b[2]))
596
610#define DOTP(a, b) \
611 (a[0]*b[0]+a[1]*b[1]+a[2]*b[2])
612
629#define FMOD(x, y) \
630 ((x) - (int) ((x) / (y)) * (y))
631
647#define FREAD(ptr, type, size, in) { \
648 if(fread(ptr, sizeof(type), size, in)!=size) \
649 ERRMSG("Error while reading!"); \
650 }
651
667#define FWRITE(ptr, type, size, out) { \
668 if(fwrite(ptr, sizeof(type), size, out)!=size) \
669 ERRMSG("Error while writing!"); \
670 }
671
682#define INTPOL_INIT \
683 double cw[4] = {0.0, 0.0, 0.0, 0.0}; int ci[3] = {0, 0, 0};
684
696#define INTPOL_2D(var, init) \
697 intpol_met_time_2d(met0, met0->var, met1, met1->var, \
698 atm->time[ip], atm->lon[ip], atm->lat[ip], \
699 &var, ci, cw, init);
700
713#define INTPOL_3D(var, init) \
714 intpol_met_time_3d(met0, met0->var, met1, met1->var, \
715 atm->time[ip], atm->p[ip], \
716 atm->lon[ip], atm->lat[ip], \
717 &var, ci, cw, init);
718
732#define INTPOL_SPACE_ALL(p, lon, lat) { \
733 intpol_met_space_3d(met, met->z, p, lon, lat, &z, ci, cw, 1); \
734 intpol_met_space_3d(met, met->t, p, lon, lat, &t, ci, cw, 0); \
735 intpol_met_space_3d(met, met->u, p, lon, lat, &u, ci, cw, 0); \
736 intpol_met_space_3d(met, met->v, p, lon, lat, &v, ci, cw, 0); \
737 intpol_met_space_3d(met, met->w, p, lon, lat, &w, ci, cw, 0); \
738 intpol_met_space_3d(met, met->pv, p, lon, lat, &pv, ci, cw, 0); \
739 intpol_met_space_3d(met, met->h2o, p, lon, lat, &h2o, ci, cw, 0); \
740 intpol_met_space_3d(met, met->o3, p, lon, lat, &o3, ci, cw, 0); \
741 intpol_met_space_3d(met, met->lwc, p, lon, lat, &lwc, ci, cw, 0); \
742 intpol_met_space_3d(met, met->rwc, p, lon, lat, &rwc, ci, cw, 0); \
743 intpol_met_space_3d(met, met->iwc, p, lon, lat, &iwc, ci, cw, 0); \
744 intpol_met_space_3d(met, met->swc, p, lon, lat, &swc, ci, cw, 0); \
745 intpol_met_space_3d(met, met->cc, p, lon, lat, &cc, ci, cw, 0); \
746 intpol_met_space_2d(met, met->ps, lon, lat, &ps, ci, cw, 0); \
747 intpol_met_space_2d(met, met->ts, lon, lat, &ts, ci, cw, 0); \
748 intpol_met_space_2d(met, met->zs, lon, lat, &zs, ci, cw, 0); \
749 intpol_met_space_2d(met, met->us, lon, lat, &us, ci, cw, 0); \
750 intpol_met_space_2d(met, met->vs, lon, lat, &vs, ci, cw, 0); \
751 intpol_met_space_2d(met, met->ess, ess, lat, &vs, ci, cw, 0); \
752 intpol_met_space_2d(met, met->nss, nss, lat, &vs, ci, cw, 0); \
753 intpol_met_space_2d(met, met->shf, shf, lat, &vs, ci, cw, 0); \
754 intpol_met_space_2d(met, met->lsm, lon, lat, &lsm, ci, cw, 0); \
755 intpol_met_space_2d(met, met->sst, lon, lat, &sst, ci, cw, 0); \
756 intpol_met_space_2d(met, met->pbl, lon, lat, &pbl, ci, cw, 0); \
757 intpol_met_space_2d(met, met->pt, lon, lat, &pt, ci, cw, 0); \
758 intpol_met_space_2d(met, met->tt, lon, lat, &tt, ci, cw, 0); \
759 intpol_met_space_2d(met, met->zt, lon, lat, &zt, ci, cw, 0); \
760 intpol_met_space_2d(met, met->h2ot, lon, lat, &h2ot, ci, cw, 0); \
761 intpol_met_space_2d(met, met->pct, lon, lat, &pct, ci, cw, 0); \
762 intpol_met_space_2d(met, met->pcb, lon, lat, &pcb, ci, cw, 0); \
763 intpol_met_space_2d(met, met->cl, lon, lat, &cl, ci, cw, 0); \
764 intpol_met_space_2d(met, met->plcl, lon, lat, &plcl, ci, cw, 0); \
765 intpol_met_space_2d(met, met->plfc, lon, lat, &plfc, ci, cw, 0); \
766 intpol_met_space_2d(met, met->pel, lon, lat, &pel, ci, cw, 0); \
767 intpol_met_space_2d(met, met->cape, lon, lat, &cape, ci, cw, 0); \
768 intpol_met_space_2d(met, met->cin, lon, lat, &cin, ci, cw, 0); \
769 intpol_met_space_2d(met, met->o3c, lon, lat, &o3c, ci, cw, 0); \
770 }
771
786#define INTPOL_TIME_ALL(time, p, lon, lat) { \
787 intpol_met_time_3d(met0, met0->z, met1, met1->z, time, p, lon, lat, &z, ci, cw, 1); \
788 intpol_met_time_3d(met0, met0->t, met1, met1->t, time, p, lon, lat, &t, ci, cw, 0); \
789 intpol_met_time_3d(met0, met0->u, met1, met1->u, time, p, lon, lat, &u, ci, cw, 0); \
790 intpol_met_time_3d(met0, met0->v, met1, met1->v, time, p, lon, lat, &v, ci, cw, 0); \
791 intpol_met_time_3d(met0, met0->w, met1, met1->w, time, p, lon, lat, &w, ci, cw, 0); \
792 intpol_met_time_3d(met0, met0->pv, met1, met1->pv, time, p, lon, lat, &pv, ci, cw, 0); \
793 intpol_met_time_3d(met0, met0->h2o, met1, met1->h2o, time, p, lon, lat, &h2o, ci, cw, 0); \
794 intpol_met_time_3d(met0, met0->o3, met1, met1->o3, time, p, lon, lat, &o3, ci, cw, 0); \
795 intpol_met_time_3d(met0, met0->lwc, met1, met1->lwc, time, p, lon, lat, &lwc, ci, cw, 0); \
796 intpol_met_time_3d(met0, met0->rwc, met1, met1->rwc, time, p, lon, lat, &rwc, ci, cw, 0); \
797 intpol_met_time_3d(met0, met0->iwc, met1, met1->iwc, time, p, lon, lat, &iwc, ci, cw, 0); \
798 intpol_met_time_3d(met0, met0->swc, met1, met1->swc, time, p, lon, lat, &swc, ci, cw, 0); \
799 intpol_met_time_3d(met0, met0->cc, met1, met1->cc, time, p, lon, lat, &cc, ci, cw, 0); \
800 intpol_met_time_2d(met0, met0->ps, met1, met1->ps, time, lon, lat, &ps, ci, cw, 0); \
801 intpol_met_time_2d(met0, met0->ts, met1, met1->ts, time, lon, lat, &ts, ci, cw, 0); \
802 intpol_met_time_2d(met0, met0->zs, met1, met1->zs, time, lon, lat, &zs, ci, cw, 0); \
803 intpol_met_time_2d(met0, met0->us, met1, met1->us, time, lon, lat, &us, ci, cw, 0); \
804 intpol_met_time_2d(met0, met0->vs, met1, met1->vs, time, lon, lat, &vs, ci, cw, 0); \
805 intpol_met_time_2d(met0, met0->ess, met1, met1->ess, time, lon, lat, &ess, ci, cw, 0); \
806 intpol_met_time_2d(met0, met0->nss, met1, met1->nss, time, lon, lat, &nss, ci, cw, 0); \
807 intpol_met_time_2d(met0, met0->shf, met1, met1->shf, time, lon, lat, &shf, ci, cw, 0); \
808 intpol_met_time_2d(met0, met0->lsm, met1, met1->lsm, time, lon, lat, &lsm, ci, cw, 0); \
809 intpol_met_time_2d(met0, met0->sst, met1, met1->sst, time, lon, lat, &sst, ci, cw, 0); \
810 intpol_met_time_2d(met0, met0->pbl, met1, met1->pbl, time, lon, lat, &pbl, ci, cw, 0); \
811 intpol_met_time_2d(met0, met0->pt, met1, met1->pt, time, lon, lat, &pt, ci, cw, 0); \
812 intpol_met_time_2d(met0, met0->tt, met1, met1->tt, time, lon, lat, &tt, ci, cw, 0); \
813 intpol_met_time_2d(met0, met0->zt, met1, met1->zt, time, lon, lat, &zt, ci, cw, 0); \
814 intpol_met_time_2d(met0, met0->h2ot, met1, met1->h2ot, time, lon, lat, &h2ot, ci, cw, 0); \
815 intpol_met_time_2d(met0, met0->pct, met1, met1->pct, time, lon, lat, &pct, ci, cw, 0); \
816 intpol_met_time_2d(met0, met0->pcb, met1, met1->pcb, time, lon, lat, &pcb, ci, cw, 0); \
817 intpol_met_time_2d(met0, met0->cl, met1, met1->cl, time, lon, lat, &cl, ci, cw, 0); \
818 intpol_met_time_2d(met0, met0->plcl, met1, met1->plcl, time, lon, lat, &plcl, ci, cw, 0); \
819 intpol_met_time_2d(met0, met0->plfc, met1, met1->plfc, time, lon, lat, &plfc, ci, cw, 0); \
820 intpol_met_time_2d(met0, met0->pel, met1, met1->pel, time, lon, lat, &pel, ci, cw, 0); \
821 intpol_met_time_2d(met0, met0->cape, met1, met1->cape, time, lon, lat, &cape, ci, cw, 0); \
822 intpol_met_time_2d(met0, met0->cin, met1, met1->cin, time, lon, lat, &cin, ci, cw, 0); \
823 intpol_met_time_2d(met0, met0->o3c, met1, met1->o3c, time, lon, lat, &o3c, ci, cw, 0); \
824 }
825
840#define LAPSE(p1, t1, p2, t2) \
841 (1e3 * G0 / RA * ((t2) - (t1)) / ((t2) + (t1)) \
842 * ((p2) + (p1)) / ((p2) - (p1)))
843
859#define LIN(x0, y0, x1, y1, x) \
860 ((y0)+((y1)-(y0))/((x1)-(x0))*((x)-(x0)))
861
886#define MAX(a,b) \
887 (((a)>(b))?(a):(b))
888
900#define MET_HEADER \
901 fprintf(out, \
902 "# $1 = time [s]\n" \
903 "# $2 = altitude [km]\n" \
904 "# $3 = longitude [deg]\n" \
905 "# $4 = latitude [deg]\n" \
906 "# $5 = pressure [hPa]\n" \
907 "# $6 = temperature [K]\n" \
908 "# $7 = zonal wind [m/s]\n" \
909 "# $8 = meridional wind [m/s]\n" \
910 "# $9 = vertical velocity [hPa/s]\n" \
911 "# $10 = H2O volume mixing ratio [ppv]\n"); \
912 fprintf(out, \
913 "# $11 = O3 volume mixing ratio [ppv]\n" \
914 "# $12 = geopotential height [km]\n" \
915 "# $13 = potential vorticity [PVU]\n" \
916 "# $14 = surface pressure [hPa]\n" \
917 "# $15 = surface temperature [K]\n" \
918 "# $16 = surface geopotential height [km]\n" \
919 "# $17 = surface zonal wind [m/s]\n" \
920 "# $18 = surface meridional wind [m/s]\n" \
921 "# $19 = eastward turbulent surface stress [N/m^2]\n" \
922 "# $20 = northward turbulent surface stress [N/m^2]\n"); \
923 fprintf(out, \
924 "# $21 = surface sensible heat flux [W/m^2]\n" \
925 "# $22 = land-sea mask [1]\n" \
926 "# $23 = sea surface temperature [K]\n" \
927 "# $24 = tropopause pressure [hPa]\n" \
928 "# $25 = tropopause geopotential height [km]\n" \
929 "# $26 = tropopause temperature [K]\n" \
930 "# $27 = tropopause water vapor [ppv]\n" \
931 "# $28 = cloud liquid water content [kg/kg]\n" \
932 "# $29 = cloud rain water content [kg/kg]\n" \
933 "# $30 = cloud ice water content [kg/kg]\n"); \
934 fprintf(out, \
935 "# $31 = cloud snow water content [kg/kg]\n" \
936 "# $32 = cloud cover [1]\n" \
937 "# $33 = total column cloud water [kg/m^2]\n" \
938 "# $34 = cloud top pressure [hPa]\n" \
939 "# $35 = cloud bottom pressure [hPa]\n" \
940 "# $36 = pressure at lifted condensation level (LCL) [hPa]\n" \
941 "# $37 = pressure at level of free convection (LFC) [hPa]\n" \
942 "# $38 = pressure at equilibrium level (EL) [hPa]\n" \
943 "# $39 = convective available potential energy (CAPE) [J/kg]\n" \
944 "# $40 = convective inhibition (CIN) [J/kg]\n"); \
945 fprintf(out, \
946 "# $41 = relative humidity over water [%%]\n" \
947 "# $42 = relative humidity over ice [%%]\n" \
948 "# $43 = dew point temperature [K]\n" \
949 "# $44 = frost point temperature [K]\n" \
950 "# $45 = NAT temperature [K]\n" \
951 "# $46 = HNO3 volume mixing ratio [ppv]\n" \
952 "# $47 = OH volume mixing ratio [ppv]\n" \
953 "# $48 = H2O2 volume mixing ratio [ppv]\n" \
954 "# $49 = HO2 volume mixing ratio [ppv]\n" \
955 "# $50 = O(1D) volume mixing ratio [ppv]\n"); \
956 fprintf(out, \
957 "# $51 = boundary layer pressure [hPa]\n" \
958 "# $52 = total column ozone [DU]\n" \
959 "# $53 = number of data points\n" \
960 "# $54 = number of tropopause data points\n" \
961 "# $55 = number of CAPE data points\n");
962
987#define MIN(a,b) \
988 (((a)<(b))?(a):(b))
989
1002#define MOLEC_DENS(p,t) \
1003 (AVO * 1e-6 * ((p) * 100) / (RI * (t)))
1004
1016#define NC(cmd) { \
1017 int nc_result=(cmd); \
1018 if(nc_result!=NC_NOERR) \
1019 ERRMSG("%s", nc_strerror(nc_result)); \
1020 }
1021
1045#define NC_DEF_VAR(varname, type, ndims, dims, long_name, units, level, quant) { \
1046 NC(nc_def_var(ncid, varname, type, ndims, dims, &varid)); \
1047 NC(nc_put_att_text(ncid, varid, "long_name", strnlen(long_name, LEN), long_name)); \
1048 NC(nc_put_att_text(ncid, varid, "units", strnlen(units, LEN), units)); \
1049 if((quant) > 0) \
1050 NC(nc_def_var_quantize(ncid, varid, NC_QUANTIZE_GRANULARBR, quant)); \
1051 if((level) != 0) { \
1052 NC(nc_def_var_deflate(ncid, varid, 1, 1, level)); \
1053 /* unsigned int ulevel = (unsigned int)level; */ \
1054 /* NC(nc_def_var_filter(ncid, varid, 32015, 1, (unsigned int[]){ulevel})); */ \
1055 } \
1056 }
1057
1075#define NC_GET_DOUBLE(varname, ptr, force) { \
1076 if(force) { \
1077 NC(nc_inq_varid(ncid, varname, &varid)); \
1078 NC(nc_get_var_double(ncid, varid, ptr)); \
1079 } else { \
1080 if(nc_inq_varid(ncid, varname, &varid) == NC_NOERR) { \
1081 NC(nc_get_var_double(ncid, varid, ptr)); \
1082 } else \
1083 WARN("netCDF variable %s is missing!", varname); \
1084 } \
1085 }
1086
1103#define NC_INQ_DIM(dimname, ptr, min, max) { \
1104 int dimid; size_t naux; \
1105 NC(nc_inq_dimid(ncid, dimname, &dimid)); \
1106 NC(nc_inq_dimlen(ncid, dimid, &naux)); \
1107 *ptr = (int)naux; \
1108 if ((*ptr) < (min) || (*ptr) > (max)) \
1109 ERRMSG("Dimension %s is out of range!", dimname); \
1110 }
1111
1126#define NC_PUT_DOUBLE(varname, ptr, hyperslab) { \
1127 NC(nc_inq_varid(ncid, varname, &varid)); \
1128 if(hyperslab) { \
1129 NC(nc_put_vara_double(ncid, varid, start, count, ptr)); \
1130 } else { \
1131 NC(nc_put_var_double(ncid, varid, ptr)); \
1132 } \
1133 }
1134
1150#define NC_PUT_FLOAT(varname, ptr, hyperslab) { \
1151 NC(nc_inq_varid(ncid, varname, &varid)); \
1152 if(hyperslab) { \
1153 NC(nc_put_vara_float(ncid, varid, start, count, ptr)); \
1154 } else { \
1155 NC(nc_put_var_float(ncid, varid, ptr)); \
1156 } \
1157 }
1158
1173#define NC_PUT_INT(varname, ptr, hyperslab) { \
1174 NC(nc_inq_varid(ncid, varname, &varid)); \
1175 if(hyperslab) { \
1176 NC(nc_put_vara_int(ncid, varid, start, count, ptr)); \
1177 } else { \
1178 NC(nc_put_var_int(ncid, varid, ptr)); \
1179 } \
1180 }
1181
1195#define NC_PUT_ATT(varname, attname, text) { \
1196 NC(nc_inq_varid(ncid, varname, &varid)); \
1197 NC(nc_put_att_text(ncid, varid, attname, strnlen(text, LEN), text)); \
1198 }
1199
1212#define NC_PUT_ATT_GLOBAL(attname, text) \
1213 NC(nc_put_att_text(ncid, NC_GLOBAL, attname, strnlen(text, LEN), text));
1214
1232#define NN(x0, y0, x1, y1, x) \
1233 (fabs((x) - (x0)) <= fabs((x) - (x1)) ? (y0) : (y1))
1234
1247#define NORM(a) \
1248 sqrt(DOTP(a, a))
1249
1265#ifdef _OPENACC
1266#define PARTICLE_LOOP(ip0, ip1, check_dt, ...) \
1267 const int ip0_const = ip0; \
1268 const int ip1_const = ip1; \
1269 _Pragma(__VA_ARGS__) \
1270 _Pragma("acc parallel loop independent gang vector") \
1271 for (int ip = ip0_const; ip < ip1_const; ip++) \
1272 if (!check_dt || cache->dt[ip] != 0)
1273#else
1274#define PARTICLE_LOOP(ip0, ip1, check_dt, ...) \
1275 const int ip0_const = ip0; \
1276 const int ip1_const = ip1; \
1277 _Pragma("omp parallel for default(shared)") \
1278 for (int ip = ip0_const; ip < ip1_const; ip++) \
1279 if (!check_dt || cache->dt[ip] != 0)
1280#endif
1281
1304#define P(z) \
1305 (P0 * exp(-(z) / H0))
1306
1328#define PSAT(t) \
1329 (6.112 * exp(17.62 * ((t) - T0) / (243.12 + (t) - T0)))
1330
1352#define PSICE(t) \
1353 (6.112 * exp(22.46 * ((t) - T0) / (272.62 + (t) - T0)))
1354
1379#define PW(p, h2o) \
1380 ((p) * MAX((h2o), 0.1e-6) / (1. + (1. - EPS) * MAX((h2o), 0.1e-6)))
1381
1396#define RAD2DEG(rad) \
1397 ((rad) * (180.0 / M_PI))
1398
1426#define RH(p, t, h2o) \
1427 (PW(p, h2o) / PSAT(t) * 100.)
1428
1456#define RHICE(p, t, h2o) \
1457 (PW(p, h2o) / PSICE(t) * 100.)
1458
1481#define RHO(p, t) \
1482 (100. * (p) / (RA * (t)))
1483
1500#define SET_ATM(qnt, val) \
1501 if (ctl->qnt >= 0) \
1502 atm->q[ctl->qnt][ip] = val;
1503
1523#define SET_QNT(qnt, name, longname, unit) \
1524 if (strcasecmp(ctl->qnt_name[iq], name) == 0) { \
1525 ctl->qnt = iq; \
1526 sprintf(ctl->qnt_longname[iq], longname); \
1527 sprintf(ctl->qnt_unit[iq], unit); \
1528 } else
1529
1544#define SH(h2o) \
1545 (EPS * MAX((h2o), 0.1e-6))
1546
1557#define SQR(x) \
1558 ((x)*(x))
1559
1571#define SWAP(x, y, type) \
1572 do {type tmp = x; x = y; y = tmp;} while(0);
1573
1595#define TDEW(p, h2o) \
1596 (T0 + 243.12 * log(PW((p), (h2o)) / 6.112) \
1597 / (17.62 - log(PW((p), (h2o)) / 6.112)))
1598
1620#define TICE(p, h2o) \
1621 (T0 + 272.62 * log(PW((p), (h2o)) / 6.112) \
1622 / (22.46 - log(PW((p), (h2o)) / 6.112)))
1623
1644#define THETA(p, t) \
1645 ((t) * pow(1000. / (p), 0.286))
1646
1673#define THETAVIRT(p, t, h2o) \
1674 (TVIRT(THETA((p), (t)), MAX((h2o), 0.1e-6)))
1675
1694#define TOK(line, tok, format, var) { \
1695 if(((tok)=strtok((line), " \t"))) { \
1696 if(sscanf(tok, format, &(var))!=1) continue; \
1697 } else ERRMSG("Error while reading!"); \
1698 }
1699
1719#define TVIRT(t, h2o) \
1720 ((t) * (1. + (1. - EPS) * MAX((h2o), 0.1e-6)))
1721
1741#define Z(p) \
1742 (H0 * log(P0 / (p)))
1743
1772#define ZDIFF(lnp0, t0, h2o0, lnp1, t1, h2o1) \
1773 (RI / MA / G0 * 0.5 * (TVIRT((t0), (h2o0)) + TVIRT((t1), (h2o1))) \
1774 * ((lnp0) - (lnp1)))
1775
1791#define ZETA(ps, p, t) \
1792 (((p) / (ps) <= 0.3 ? 1. : \
1793 sin(M_PI / 2. * (1. - (p) / (ps)) / (1. - 0.3))) \
1794 * THETA((p), (t)))
1795
1796/* ------------------------------------------------------------
1797 Log messages...
1798 ------------------------------------------------------------ */
1799
1801#ifndef LOGLEV
1802#define LOGLEV 2
1803#endif
1804
1834#define LOG(level, ...) { \
1835 if(level >= 2) \
1836 printf(" "); \
1837 if(level <= LOGLEV) { \
1838 printf(__VA_ARGS__); \
1839 printf("\n"); \
1840 } \
1841 }
1842
1871#define WARN(...) { \
1872 printf("\nWarning (%s, %s, l%d): ", __FILE__, __func__, __LINE__); \
1873 LOG(0, __VA_ARGS__); \
1874 }
1875
1904#define ERRMSG(...) { \
1905 printf("\nError (%s, %s, l%d): ", __FILE__, __func__, __LINE__); \
1906 LOG(0, __VA_ARGS__); \
1907 exit(EXIT_FAILURE); \
1908 }
1909
1939#define PRINT(format, var) \
1940 printf("Print (%s, %s, l%d): %s= "format"\n", \
1941 __FILE__, __func__, __LINE__, #var, var);
1942
1943/* ------------------------------------------------------------
1944 Timers...
1945 ------------------------------------------------------------ */
1946
1948#define NTIMER 100
1949
1963#define PRINT_TIMERS \
1964 timer("END", "END", 1);
1965
1984#define SELECT_TIMER(id, group, color) { \
1985 NVTX_POP; \
1986 NVTX_PUSH(id, color); \
1987 timer(id, group, 0); \
1988 }
1989
2003#define START_TIMERS \
2004 NVTX_PUSH("START", NVTX_CPU);
2005
2018#define STOP_TIMERS \
2019 NVTX_POP;
2020
2021/* ------------------------------------------------------------
2022 NVIDIA Tools Extension (NVTX)...
2023 ------------------------------------------------------------ */
2024
2025#ifdef NVTX
2026#include "nvToolsExt.h"
2027
2029#define NVTX_CPU 0xFFADD8E6
2030
2032#define NVTX_GPU 0xFF00008B
2033
2035#define NVTX_H2D 0xFFFFFF00
2036
2038#define NVTX_D2H 0xFFFF8800
2039
2041#define NVTX_READ 0xFFFFCCCB
2042
2044#define NVTX_WRITE 0xFF8B0000
2045
2047#define NVTX_RECV 0xFFCCFFCB
2048
2050#define NVTX_SEND 0xFF008B00
2051
2081#define NVTX_PUSH(range_title, range_color) { \
2082 nvtxEventAttributes_t eventAttrib = {0}; \
2083 eventAttrib.version = NVTX_VERSION; \
2084 eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE; \
2085 eventAttrib.messageType = NVTX_MESSAGE_TYPE_ASCII; \
2086 eventAttrib.colorType = NVTX_COLOR_ARGB; \
2087 eventAttrib.color = range_color; \
2088 eventAttrib.message.ascii = range_title; \
2089 nvtxRangePushEx(&eventAttrib); \
2090 }
2091
2104#define NVTX_POP { \
2105 nvtxRangePop(); \
2106 }
2107#else
2108
2109/* Empty definitions of NVTX_PUSH and NVTX_POP... */
2110#define NVTX_PUSH(range_title, range_color) {}
2111#define NVTX_POP {}
2112#endif
2113
2114/* ------------------------------------------------------------
2115 Thrust...
2116 ------------------------------------------------------------ */
2117
2143 double *__restrict__ c,
2144 int n,
2145 int *__restrict__ index);
2146
2147/* ------------------------------------------------------------
2148 Structs...
2149 ------------------------------------------------------------ */
2150
2158typedef struct {
2159
2160 /* ------------------------------------------------------------
2161 Quantity parameters...
2162 ------------------------------------------------------------ */
2163
2165 int nq;
2166
2168 char qnt_name[NQ][LEN];
2169
2171 char qnt_longname[NQ][LEN];
2172
2174 char qnt_unit[NQ][LEN];
2175
2177 char qnt_format[NQ][LEN];
2178
2181
2184
2187
2190
2193
2196
2199
2202
2205
2208
2211
2214
2217
2220
2223
2226
2229
2232
2235
2238
2241
2244
2247
2250
2253
2256
2259
2262
2265
2268
2271
2274
2277
2280
2283
2286
2289
2292
2295
2298
2301
2304
2307
2310
2313
2316
2319
2322
2325
2328
2331
2334
2337
2340
2343
2346
2349
2352
2355
2358
2361
2364
2367
2370
2373
2376
2379
2382
2385
2388
2391
2394
2397
2400
2403
2406
2409
2412
2415
2418
2421
2424
2427
2430
2433
2436
2439
2442
2445
2448
2451
2454
2456 double t_start;
2457
2459 double t_stop;
2460
2462 double dt_mod;
2463
2464 /* ------------------------------------------------------------
2465 Meteo data parameters...
2466 ------------------------------------------------------------ */
2467
2469 char metbase[LEN];
2470
2472 double dt_met;
2473
2476
2480
2484
2487
2490
2493
2496
2499
2502
2505
2508
2512
2515
2518
2521
2524
2527
2530
2533
2536
2539
2542
2545
2548
2551
2554
2557
2560
2563
2566
2569
2572
2575
2577 double met_p[EP];
2578
2581
2584
2587
2590
2593
2596
2599
2602
2606
2609
2612
2615
2618
2621
2624
2625 /* ------------------------------------------------------------
2626 Geophysical module parameters...
2627 ------------------------------------------------------------ */
2628
2630 double sort_dt;
2631
2635
2637 char balloon[LEN];
2638
2641
2644
2647
2650
2653
2656
2659
2662
2665
2668
2671
2674
2677
2680
2683
2685 double conv_cin;
2686
2688 double conv_dt;
2689
2692
2695
2698
2701
2704
2707
2709 double bound_p0;
2710
2712 double bound_p1;
2713
2716
2719
2722
2725
2727 char species[LEN];
2728
2730 double molmass;
2731
2734
2737
2740
2742 char clim_hno3_filename[LEN];
2743
2745 char clim_oh_filename[LEN];
2746
2748 char clim_h2o2_filename[LEN];
2749
2751 char clim_ho2_filename[LEN];
2752
2754 char clim_o1d_filename[LEN];
2755
2757 char clim_o3_filename[LEN];
2758
2760 char clim_ccl4_timeseries[LEN];
2761
2763 char clim_ccl3f_timeseries[LEN];
2764
2766 char clim_ccl2f2_timeseries[LEN];
2767
2769 char clim_n2o_timeseries[LEN];
2770
2772 char clim_sf6_timeseries[LEN];
2773
2776
2779
2782
2785
2788
2791
2794
2797
2800
2803
2806
2809
2812
2815
2818
2821
2824
2827
2830
2833
2836
2839
2841 double oh_chem[4];
2842
2845
2848
2851
2853 double dt_kpp;
2854
2857
2859 double wet_depo_pre[2];
2860
2863
2866
2869
2872
2874 double wet_depo_ic_h[2];
2875
2877 double wet_depo_bc_h[2];
2878
2881
2884
2887
2890
2893
2895 double psc_h2o;
2896
2898 double psc_hno3;
2899
2900 /* ------------------------------------------------------------
2901 Output parameters...
2902 ------------------------------------------------------------ */
2903
2905 char atm_basename[LEN];
2906
2908 char atm_gpfile[LEN];
2909
2912
2915
2918
2922
2927
2930
2932 int atm_nc_quant[NQ];
2933
2936
2938 char csi_basename[LEN];
2939
2941 char csi_kernel[LEN];
2942
2945
2947 char csi_obsfile[LEN];
2948
2951
2954
2957
2959 double csi_z0;
2960
2962 double csi_z1;
2963
2966
2968 double csi_lon0;
2969
2971 double csi_lon1;
2972
2975
2977 double csi_lat0;
2978
2980 double csi_lat1;
2981
2983 char ens_basename[LEN];
2984
2987
2989 char grid_basename[LEN];
2990
2992 char grid_kernel[LEN];
2993
2995 char grid_gpfile[LEN];
2996
2999
3002
3005
3007 int grid_nc_quant[NQ];
3008
3011
3014
3016 double grid_z0;
3017
3019 double grid_z1;
3020
3023
3026
3029
3032
3035
3038
3041
3043 char prof_basename[LEN];
3044
3046 char prof_obsfile[LEN];
3047
3050
3052 double prof_z0;
3053
3055 double prof_z1;
3056
3059
3062
3065
3068
3071
3074
3076 char sample_basename[LEN];
3077
3079 char sample_kernel[LEN];
3080
3082 char sample_obsfile[LEN];
3083
3086
3089
3091 char stat_basename[LEN];
3092
3094 double stat_lon;
3095
3097 double stat_lat;
3098
3100 double stat_r;
3101
3103 double stat_t0;
3104
3106 double stat_t1;
3107
3109 char vtk_basename[LEN];
3110
3113
3116
3119
3122
3125
3126} ctl_t;
3127
3136typedef struct {
3137
3139 int np;
3140
3142 double time[NP];
3143
3145 double p[NP];
3146
3148 double lon[NP];
3149
3151 double lat[NP];
3152
3154 double q[NQ][NP];
3155
3156} atm_t;
3157
3164typedef struct {
3165
3167 double iso_var[NP];
3168
3170 double iso_ps[NP];
3171
3173 double iso_ts[NP];
3174
3177
3179 float uvwp[NP][3];
3180
3182 double rs[3 * NP + 1];
3183
3185 double dt[NP];
3186
3187} cache_t;
3188
3196typedef struct {
3197
3199 int np;
3200
3202 int nsza;
3203
3205 int no3c;
3206
3208 double p[CP];
3209
3211 double sza[CSZA];
3212
3214 double o3c[CO3];
3215
3217 double n2o[CP][CSZA][CO3];
3218
3220 double ccl4[CP][CSZA][CO3];
3221
3223 double ccl3f[CP][CSZA][CO3];
3224
3226 double ccl2f2[CP][CSZA][CO3];
3227
3229 double o2[CP][CSZA][CO3];
3230
3232 double o3_1[CP][CSZA][CO3];
3233
3235 double o3_2[CP][CSZA][CO3];
3236
3238 double h2o2[CP][CSZA][CO3];
3239
3241 double h2o[CP][CSZA][CO3];
3242
3243} clim_photo_t;
3244
3252typedef struct {
3253
3256
3258 double time[CTS];
3259
3261 double vmr[CTS];
3262
3263} clim_ts_t;
3264
3272typedef struct {
3273
3276
3278 int nlat;
3279
3281 int np;
3282
3284 double time[CT];
3285
3287 double lat[CY];
3288
3290 double p[CP];
3291
3293 double vmr[CT][CP][CY];
3294
3295} clim_zm_t;
3296
3304typedef struct {
3305
3308
3311
3313 double tropo_time[12];
3314
3316 double tropo_lat[73];
3317
3319 double tropo[12][73];
3320
3323
3326
3329
3332
3335
3338
3341
3344
3347
3350
3353
3354} clim_t;
3355
3363typedef struct {
3364
3366 double time;
3367
3369 int nx;
3370
3372 int ny;
3373
3375 int np;
3376
3378 int npl;
3379
3381 double lon[EX];
3382
3384 double lat[EY];
3385
3387 double p[EP];
3388
3390 double hybrid[EP];
3391
3393 float ps[EX][EY];
3394
3396 float ts[EX][EY];
3397
3399 float zs[EX][EY];
3400
3402 float us[EX][EY];
3403
3405 float vs[EX][EY];
3406
3408 float ess[EX][EY];
3409
3411 float nss[EX][EY];
3412
3414 float shf[EX][EY];
3415
3417 float lsm[EX][EY];
3418
3420 float sst[EX][EY];
3421
3423 float pbl[EX][EY];
3424
3426 float pt[EX][EY];
3427
3429 float tt[EX][EY];
3430
3432 float zt[EX][EY];
3433
3435 float h2ot[EX][EY];
3436
3438 float pct[EX][EY];
3439
3441 float pcb[EX][EY];
3442
3444 float cl[EX][EY];
3445
3447 float plcl[EX][EY];
3448
3450 float plfc[EX][EY];
3451
3453 float pel[EX][EY];
3454
3456 float cape[EX][EY];
3457
3459 float cin[EX][EY];
3460
3462 float o3c[EX][EY];
3463
3465 float z[EX][EY][EP];
3466
3468 float t[EX][EY][EP];
3469
3471 float u[EX][EY][EP];
3472
3474 float v[EX][EY][EP];
3475
3477 float w[EX][EY][EP];
3478
3480 float pv[EX][EY][EP];
3481
3483 float h2o[EX][EY][EP];
3484
3486 float o3[EX][EY][EP];
3487
3489 float lwc[EX][EY][EP];
3490
3492 float rwc[EX][EY][EP];
3493
3495 float iwc[EX][EY][EP];
3496
3498 float swc[EX][EY][EP];
3499
3501 float cc[EX][EY][EP];
3502
3504 float pl[EX][EY][EP];
3505
3507 float ul[EX][EY][EP];
3508
3510 float vl[EX][EY][EP];
3511
3513 float wl[EX][EY][EP];
3514
3516 float zetal[EX][EY][EP];
3517
3519 float zeta_dotl[EX][EY][EP];
3520
3521} met_t;
3522
3523/* ------------------------------------------------------------
3524 OpenACC routines...
3525 ------------------------------------------------------------ */
3526
3527#ifdef _OPENACC
3528#pragma acc routine (clim_oh)
3529#pragma acc routine (clim_photo)
3530#pragma acc routine (clim_tropo)
3531#pragma acc routine (clim_ts)
3532#pragma acc routine (clim_zm)
3533#pragma acc routine (intpol_met_4d_coord)
3534#pragma acc routine (intpol_met_space_3d)
3535#pragma acc routine (intpol_met_space_3d_ml)
3536#pragma acc routine (intpol_met_space_2d)
3537#pragma acc routine (intpol_met_time_3d)
3538#pragma acc routine (intpol_met_time_3d_ml)
3539#pragma acc routine (intpol_met_time_2d)
3540#pragma acc routine (kernel_weight)
3541#pragma acc routine (lapse_rate)
3542#pragma acc routine (locate_irr)
3543#pragma acc routine (locate_irr_float)
3544#pragma acc routine (locate_reg)
3545#pragma acc routine (locate_vert)
3546#pragma acc routine (nat_temperature)
3547#pragma acc routine (pbl_weight)
3548#pragma acc routine (sedi)
3549#pragma acc routine (stddev)
3550#pragma acc routine (sza_calc)
3551#pragma acc routine (tropo_weight)
3552#endif
3553
3554/* ------------------------------------------------------------
3555 Functions...
3556 ------------------------------------------------------------ */
3557
3580 void *data,
3581 size_t N);
3582
3597void cart2geo(
3598 const double *x,
3599 double *z,
3600 double *lon,
3601 double *lat);
3602
3625double clim_oh(
3626 const ctl_t * ctl,
3627 const clim_t * clim,
3628 const double t,
3629 const double lon,
3630 const double lat,
3631 const double p);
3632
3652 const ctl_t * ctl,
3653 clim_t * clim);
3654
3684double clim_photo(
3685 const double rate[CP][CSZA][CO3],
3686 const clim_photo_t * photo,
3687 const double p,
3688 const double sza,
3689 const double o3c);
3690
3716double clim_tropo(
3717 const clim_t * clim,
3718 const double t,
3719 const double lat);
3720
3739void clim_tropo_init(
3740 clim_t * clim);
3741
3758double clim_ts(
3759 const clim_ts_t * ts,
3760 const double t);
3761
3783double clim_zm(
3784 const clim_zm_t * zm,
3785 const double t,
3786 const double lat,
3787 const double p);
3788
3830 const ctl_t * ctl,
3831 const char *varname,
3832 float *array,
3833 const size_t nx,
3834 const size_t ny,
3835 const size_t np,
3836 const int decompress,
3837 FILE * inout);
3838
3871void compress_pck(
3872 const char *varname,
3873 float *array,
3874 const size_t nxy,
3875 const size_t nz,
3876 const int decompress,
3877 FILE * inout);
3878
3918 const char *varname,
3919 float *array,
3920 const int nx,
3921 const int ny,
3922 const int nz,
3923 const int precision,
3924 const double tolerance,
3925 const int decompress,
3926 FILE * inout);
3927
3964 const char *varname,
3965 float *array,
3966 const size_t n,
3967 const int decompress,
3968 FILE * inout);
3969
3992void day2doy(
3993 const int year,
3994 const int mon,
3995 const int day,
3996 int *doy);
3997
4019void doy2day(
4020 const int year,
4021 const int doy,
4022 int *mon,
4023 int *day);
4024
4051void fft_help(
4052 double *fcReal,
4053 double *fcImag,
4054 const int n);
4055
4082void geo2cart(
4083 const double z,
4084 const double lon,
4085 const double lat,
4086 double *x);
4087
4112void get_met_help(
4113 const ctl_t * ctl,
4114 const double t,
4115 const int direct,
4116 const char *metbase,
4117 const double dt_met,
4118 char *filename);
4119
4143void get_met_replace(
4144 char *orig,
4145 char *search,
4146 char *repl);
4147
4184void get_tropo(
4185 const int met_tropo,
4186 ctl_t * ctl,
4187 clim_t * clim,
4188 met_t * met,
4189 const double *lons,
4190 const int nx,
4191 const double *lats,
4192 const int ny,
4193 double *pt,
4194 double *zt,
4195 double *tt,
4196 double *qt,
4197 double *o3t,
4198 double *ps,
4199 double *zs);
4200
4243 const met_t * met0,
4244 float height0[EX][EY][EP],
4245 float array0[EX][EY][EP],
4246 const met_t * met1,
4247 float height1[EX][EY][EP],
4248 float array1[EX][EY][EP],
4249 const double ts,
4250 const double height,
4251 const double lon,
4252 const double lat,
4253 double *var,
4254 int *ci,
4255 double *cw,
4256 const int init);
4257
4293 const met_t * met,
4294 float array[EX][EY][EP],
4295 const double p,
4296 const double lon,
4297 const double lat,
4298 double *var,
4299 int *ci,
4300 double *cw,
4301 const int init);
4302
4322 const met_t * met,
4323 float zs[EX][EY][EP],
4324 float vals[EX][EY][EP],
4325 const double z,
4326 const double lon,
4327 const double lat,
4328 double *val);
4329
4365 const met_t * met,
4366 float array[EX][EY],
4367 const double lon,
4368 const double lat,
4369 double *var,
4370 int *ci,
4371 double *cw,
4372 const int init);
4373
4408 const met_t * met0,
4409 float array0[EX][EY][EP],
4410 const met_t * met1,
4411 float array1[EX][EY][EP],
4412 const double ts,
4413 const double p,
4414 const double lon,
4415 const double lat,
4416 double *var,
4417 int *ci,
4418 double *cw,
4419 const int init);
4420
4444 const met_t * met0,
4445 float zs0[EX][EY][EP],
4446 float array0[EX][EY][EP],
4447 const met_t * met1,
4448 float zs1[EX][EY][EP],
4449 float array1[EX][EY][EP],
4450 const double ts,
4451 const double p,
4452 const double lon,
4453 const double lat,
4454 double *var);
4455
4491 const met_t * met0,
4492 float array0[EX][EY],
4493 const met_t * met1,
4494 float array1[EX][EY],
4495 const double ts,
4496 const double lon,
4497 const double lat,
4498 double *var,
4499 int *ci,
4500 double *cw,
4501 const int init);
4502
4540void intpol_tropo_3d(
4541 const double time0,
4542 float array0[EX][EY],
4543 const double time1,
4544 float array1[EX][EY],
4545 const double lons[EX],
4546 const double lats[EY],
4547 const int nlon,
4548 const int nlat,
4549 const double time,
4550 const double lon,
4551 const double lat,
4552 const int method,
4553 double *var,
4554 double *sigma);
4555
4582void jsec2time(
4583 const double jsec,
4584 int *year,
4585 int *mon,
4586 int *day,
4587 int *hour,
4588 int *min,
4589 int *sec,
4590 double *remain);
4591
4618double kernel_weight(
4619 const double kz[EP],
4620 const double kw[EP],
4621 const int nk,
4622 const double p);
4623
4662double lapse_rate(
4663 const double t,
4664 const double h2o);
4665
4695 ctl_t * ctl);
4696
4716int locate_irr(
4717 const double *xx,
4718 const int n,
4719 const double x);
4720
4747 const float *xx,
4748 const int n,
4749 const double x,
4750 const int ig);
4751
4772int locate_reg(
4773 const double *xx,
4774 const int n,
4775 const double x);
4776
4798void locate_vert(
4799 float profiles[EX][EY][EP],
4800 const int np,
4801 const int lon_ap_ind,
4802 const int lat_ap_ind,
4803 const double alt_ap,
4804 int *ind);
4805
4852void module_advect(
4853 const ctl_t * ctl,
4854 const cache_t * cache,
4855 met_t * met0,
4856 met_t * met1,
4857 atm_t * atm);
4858
4882 const ctl_t * ctl,
4883 const cache_t * cache,
4884 met_t * met0,
4885 met_t * met1,
4886 atm_t * atm);
4887
4925 const ctl_t * ctl,
4926 const cache_t * cache,
4927 const clim_t * clim,
4928 met_t * met0,
4929 met_t * met1,
4930 atm_t * atm);
4931
4949void module_chem_grid(
4950 const ctl_t * ctl,
4951 met_t * met0,
4952 met_t * met1,
4953 atm_t * atm,
4954 const double t);
4955
4982void module_chem_init(
4983 const ctl_t * ctl,
4984 const cache_t * cache,
4985 const clim_t * clim,
4986 met_t * met0,
4987 met_t * met1,
4988 atm_t * atm);
4989
5014 const ctl_t * ctl,
5015 cache_t * cache,
5016 met_t * met0,
5017 met_t * met1,
5018 atm_t * atm);
5019
5046void module_decay(
5047 const ctl_t * ctl,
5048 const cache_t * cache,
5049 const clim_t * clim,
5050 atm_t * atm);
5051
5088void module_diff_meso(
5089 const ctl_t * ctl,
5090 cache_t * cache,
5091 met_t * met0,
5092 met_t * met1,
5093 atm_t * atm);
5094
5128void module_diff_pbl(
5129 const ctl_t * ctl,
5130 cache_t * cache,
5131 met_t * met0,
5132 met_t * met1,
5133 atm_t * atm);
5134
5189void module_diff_turb(
5190 const ctl_t * ctl,
5191 cache_t * cache,
5192 const clim_t * clim,
5193 met_t * met0,
5194 met_t * met1,
5195 atm_t * atm);
5196
5216void module_dry_depo(
5217 const ctl_t * ctl,
5218 const cache_t * cache,
5219 met_t * met0,
5220 met_t * met1,
5221 atm_t * atm);
5222
5255void module_h2o2_chem(
5256 const ctl_t * ctl,
5257 const cache_t * cache,
5258 const clim_t * clim,
5259 met_t * met0,
5260 met_t * met1,
5261 atm_t * atm);
5262
5283 const ctl_t * ctl,
5284 cache_t * cache,
5285 met_t * met0,
5286 met_t * met1,
5287 atm_t * atm);
5288
5306void module_isosurf(
5307 const ctl_t * ctl,
5308 const cache_t * cache,
5309 met_t * met0,
5310 met_t * met1,
5311 atm_t * atm);
5312
5345 ctl_t * ctl,
5346 cache_t * cache,
5347 clim_t * clim,
5348 met_t * met0,
5349 met_t * met1,
5350 atm_t * atm);
5351
5370void module_meteo(
5371 const ctl_t * ctl,
5372 const cache_t * cache,
5373 const clim_t * clim,
5374 met_t * met0,
5375 met_t * met1,
5376 atm_t * atm);
5377
5395void module_mixing(
5396 const ctl_t * ctl,
5397 const clim_t * clim,
5398 atm_t * atm,
5399 const double t);
5400
5421 const ctl_t * ctl,
5422 const clim_t * clim,
5423 atm_t * atm,
5424 const int *ixs,
5425 const int *iys,
5426 const int *izs,
5427 const int qnt_idx);
5428
5461void module_oh_chem(
5462 const ctl_t * ctl,
5463 const cache_t * cache,
5464 const clim_t * clim,
5465 met_t * met0,
5466 met_t * met1,
5467 atm_t * atm);
5468
5496void module_position(
5497 const cache_t * cache,
5498 met_t * met0,
5499 met_t * met1,
5500 atm_t * atm);
5501
5526void module_rng_init(
5527 const int ntask);
5528
5554void module_rng(
5555 const ctl_t * ctl,
5556 double *rs,
5557 const size_t n,
5558 const int method);
5559
5582void module_sedi(
5583 const ctl_t * ctl,
5584 const cache_t * cache,
5585 met_t * met0,
5586 met_t * met1,
5587 atm_t * atm);
5588
5612void module_sort(
5613 const ctl_t * ctl,
5614 met_t * met0,
5615 atm_t * atm);
5616
5636void module_sort_help(
5637 double *a,
5638 const int *p,
5639 const int np);
5640
5664void module_timesteps(
5665 const ctl_t * ctl,
5666 cache_t * cache,
5667 met_t * met0,
5668 atm_t * atm,
5669 const double t);
5670
5692 ctl_t * ctl,
5693 const atm_t * atm);
5694
5728 const ctl_t * ctl,
5729 const cache_t * cache,
5730 const clim_t * clim,
5731 met_t * met0,
5732 met_t * met1,
5733 atm_t * atm);
5734
5764void module_wet_depo(
5765 const ctl_t * ctl,
5766 const cache_t * cache,
5767 met_t * met0,
5768 met_t * met1,
5769 atm_t * atm);
5770
5801void mptrac_alloc(
5802 ctl_t ** ctl,
5803 cache_t ** cache,
5804 clim_t ** clim,
5805 met_t ** met0,
5806 met_t ** met1,
5807 atm_t ** atm);
5808
5838void mptrac_free(
5839 ctl_t * ctl,
5840 cache_t * cache,
5841 clim_t * clim,
5842 met_t * met0,
5843 met_t * met1,
5844 atm_t * atm);
5845
5880void mptrac_get_met(
5881 ctl_t * ctl,
5882 clim_t * clim,
5883 const double t,
5884 met_t ** met0,
5885 met_t ** met1);
5886
5906void mptrac_init(
5907 ctl_t * ctl,
5908 cache_t * cache,
5909 clim_t * clim,
5910 atm_t * atm,
5911 const int ntask);
5912
5948int mptrac_read_atm(
5949 const char *filename,
5950 const ctl_t * ctl,
5951 atm_t * atm);
5952
5984void mptrac_read_clim(
5985 const ctl_t * ctl,
5986 clim_t * clim);
5987
6017void mptrac_read_ctl(
6018 const char *filename,
6019 int argc,
6020 char *argv[],
6021 ctl_t * ctl);
6022
6051int mptrac_read_met(
6052 const char *filename,
6053 const ctl_t * ctl,
6054 const clim_t * clim,
6055 met_t * met);
6056
6077 ctl_t * ctl,
6078 cache_t * cache,
6079 clim_t * clim,
6080 met_t ** met0,
6081 met_t ** met1,
6082 atm_t * atm,
6083 double t);
6084
6114void mptrac_write_atm(
6115 const char *filename,
6116 const ctl_t * ctl,
6117 const atm_t * atm,
6118 const double t);
6119
6155void mptrac_write_met(
6156 const char *filename,
6157 const ctl_t * ctl,
6158 met_t * met);
6159
6194 const char *dirname,
6195 const ctl_t * ctl,
6196 met_t * met0,
6197 met_t * met1,
6198 atm_t * atm,
6199 const double t);
6200
6232 const ctl_t * ctl,
6233 const cache_t * cache,
6234 const clim_t * clim,
6235 met_t ** met0,
6236 met_t ** met1,
6237 const atm_t * atm);
6238
6269 const ctl_t * ctl,
6270 const cache_t * cache,
6271 const clim_t * clim,
6272 met_t ** met0,
6273 met_t ** met1,
6274 const atm_t * atm);
6275
6303double nat_temperature(
6304 const double p,
6305 const double h2o,
6306 const double hno3);
6307
6328double pbl_weight(
6329 const ctl_t * ctl,
6330 const atm_t * atm,
6331 const int ip,
6332 const double pbl,
6333 const double ps);
6334
6367int read_atm_asc(
6368 const char *filename,
6369 const ctl_t * ctl,
6370 atm_t * atm);
6371
6402int read_atm_bin(
6403 const char *filename,
6404 const ctl_t * ctl,
6405 atm_t * atm);
6406
6441int read_atm_clams(
6442 const char *filename,
6443 const ctl_t * ctl,
6444 atm_t * atm);
6445
6475int read_atm_nc(
6476 const char *filename,
6477 const ctl_t * ctl,
6478 atm_t * atm);
6479
6508void read_clim_photo(
6509 const char *filename,
6510 clim_photo_t * photo);
6511
6529 const int ncid,
6530 const char *varname,
6531 const clim_photo_t * photo,
6532 double var[CP][CSZA][CO3]);
6533
6557int read_clim_ts(
6558 const char *filename,
6559 clim_ts_t * ts);
6560
6587void read_clim_zm(
6588 const char *filename,
6589 const char *varname,
6590 clim_zm_t * zm);
6591
6619void read_kernel(
6620 const char *filename,
6621 double kz[EP],
6622 double kw[EP],
6623 int *nk);
6624
6656int read_met_bin(
6657 const char *filename,
6658 const ctl_t * ctl,
6659 met_t * met);
6660
6686void read_met_bin_2d(
6687 FILE * in,
6688 const met_t * met,
6689 float var[EX][EY],
6690 const char *varname);
6691
6729void read_met_bin_3d(
6730 FILE * in,
6731 const ctl_t * ctl,
6732 const met_t * met,
6733 float var[EX][EY][EP],
6734 const char *varname,
6735 const float bound_min,
6736 const float bound_max);
6737
6764void read_met_cape(
6765 const ctl_t * ctl,
6766 const clim_t * clim,
6767 met_t * met);
6768
6791void read_met_cloud(
6792 met_t * met);
6793
6819void read_met_detrend(
6820 const ctl_t * ctl,
6821 met_t * met);
6822
6846 met_t * met);
6847
6874void read_met_geopot(
6875 const ctl_t * ctl,
6876 met_t * met);
6877
6909void read_met_grid(
6910 const char *filename,
6911 const int ncid,
6912 const ctl_t * ctl,
6913 met_t * met);
6914
6945void read_met_levels(
6946 const int ncid,
6947 const ctl_t * ctl,
6948 met_t * met);
6949
6978void read_met_ml2pl(
6979 const ctl_t * ctl,
6980 const met_t * met,
6981 float var[EX][EY][EP],
6982 const char *varname);
6983
7005 met_t * met);
7006
7038int read_met_nc(
7039 const char *filename,
7040 const ctl_t * ctl,
7041 const clim_t * clim,
7042 met_t * met);
7043
7073int read_met_nc_2d(
7074 const int ncid,
7075 const char *varname,
7076 const char *varname2,
7077 const char *varname3,
7078 const char *varname4,
7079 const char *varname5,
7080 const char *varname6,
7081 const ctl_t * ctl,
7082 const met_t * met,
7083 float dest[EX][EY],
7084 const float scl,
7085 const int init);
7086
7117int read_met_nc_3d(
7118 const int ncid,
7119 const char *varname,
7120 const char *varname2,
7121 const char *varname3,
7122 const char *varname4,
7123 const ctl_t * ctl,
7124 const met_t * met,
7125 float dest[EX][EY][EP],
7126 const float scl);
7127
7173void read_met_pbl(
7174 const ctl_t * ctl,
7175 met_t * met);
7176
7209 met_t * met);
7210
7241 met_t * met);
7242
7273void read_met_pv(
7274 met_t * met);
7275
7298void read_met_ozone(
7299 met_t * met);
7300
7329void read_met_sample(
7330 const ctl_t * ctl,
7331 met_t * met);
7332
7373void read_met_surface(
7374 const int ncid,
7375 const ctl_t * ctl,
7376 met_t * met);
7377
7406void read_met_tropo(
7407 const ctl_t * ctl,
7408 const clim_t * clim,
7409 met_t * met);
7410
7442void read_obs(
7443 const char *filename,
7444 const ctl_t * ctl,
7445 double *rt,
7446 double *rz,
7447 double *rlon,
7448 double *rlat,
7449 double *robs,
7450 int *nobs);
7451
7479void read_obs_asc(
7480 const char *filename,
7481 double *rt,
7482 double *rz,
7483 double *rlon,
7484 double *rlat,
7485 double *robs,
7486 int *nobs);
7487
7514void read_obs_nc(
7515 const char *filename,
7516 double *rt,
7517 double *rz,
7518 double *rlon,
7519 double *rlat,
7520 double *robs,
7521 int *nobs);
7522
7556double scan_ctl(
7557 const char *filename,
7558 int argc,
7559 char *argv[],
7560 const char *varname,
7561 const int arridx,
7562 const char *defvalue,
7563 char *value);
7564
7591double sedi(
7592 const double p,
7593 const double T,
7594 const double rp,
7595 const double rhop);
7596
7626void spline(
7627 const double *x,
7628 const double *y,
7629 const int n,
7630 const double *x2,
7631 double *y2,
7632 const int n2,
7633 const int method);
7634
7657float stddev(
7658 const float *data,
7659 const int n);
7660
7680double sza_calc(
7681 const double sec,
7682 const double lon,
7683 const double lat);
7684
7709void time2jsec(
7710 const int year,
7711 const int mon,
7712 const int day,
7713 const int hour,
7714 const int min,
7715 const int sec,
7716 const double remain,
7717 double *jsec);
7718
7747void timer(
7748 const char *name,
7749 const char *group,
7750 const int output);
7751
7777double time_from_filename(
7778 const char *filename,
7779 const int offset);
7780
7798double tropo_weight(
7799 const clim_t * clim,
7800 const atm_t * atm,
7801 const int ip);
7802
7825void write_atm_asc(
7826 const char *filename,
7827 const ctl_t * ctl,
7828 const atm_t * atm,
7829 const double t);
7830
7854void write_atm_bin(
7855 const char *filename,
7856 const ctl_t * ctl,
7857 const atm_t * atm);
7858
7882void write_atm_clams(
7883 const char *filename,
7884 const ctl_t * ctl,
7885 const atm_t * atm);
7886
7912 const char *dirname,
7913 const ctl_t * ctl,
7914 const atm_t * atm,
7915 const double t);
7916
7940void write_atm_nc(
7941 const char *filename,
7942 const ctl_t * ctl,
7943 const atm_t * atm);
7944
7973void write_csi(
7974 const char *filename,
7975 const ctl_t * ctl,
7976 const atm_t * atm,
7977 const double t);
7978
8006void write_ens(
8007 const char *filename,
8008 const ctl_t * ctl,
8009 const atm_t * atm,
8010 const double t);
8011
8050void write_grid(
8051 const char *filename,
8052 const ctl_t * ctl,
8053 met_t * met0,
8054 met_t * met1,
8055 const atm_t * atm,
8056 const double t);
8057
8103void write_grid_asc(
8104 const char *filename,
8105 const ctl_t * ctl,
8106 const double *cd,
8107 double *mean[NQ],
8108 double *sigma[NQ],
8109 const double *vmr_impl,
8110 const double t,
8111 const double *z,
8112 const double *lon,
8113 const double *lat,
8114 const double *area,
8115 const double dz,
8116 const int *np);
8117
8160void write_grid_nc(
8161 const char *filename,
8162 const ctl_t * ctl,
8163 const double *cd,
8164 double *mean[NQ],
8165 double *sigma[NQ],
8166 const double *vmr_impl,
8167 const double t,
8168 const double *z,
8169 const double *lon,
8170 const double *lat,
8171 const double *area,
8172 const double dz,
8173 const int *np);
8174
8204void write_met_bin(
8205 const char *filename,
8206 const ctl_t * ctl,
8207 met_t * met);
8208
8236void write_met_bin_2d(
8237 FILE * out,
8238 met_t * met,
8239 float var[EX][EY],
8240 const char *varname);
8241
8279void write_met_bin_3d(
8280 FILE * out,
8281 const ctl_t * ctl,
8282 met_t * met,
8283 float var[EX][EY][EP],
8284 const char *varname,
8285 const int precision,
8286 const double tolerance);
8287
8315void write_met_nc(
8316 const char *filename,
8317 const ctl_t * ctl,
8318 met_t * met);
8319
8344void write_met_nc_2d(
8345 const int ncid,
8346 const char *varname,
8347 met_t * met,
8348 float var[EX][EY],
8349 const float scl);
8350
8376void write_met_nc_3d(
8377 const int ncid,
8378 const char *varname,
8379 met_t * met,
8380 float var[EX][EY][EP],
8381 const float scl);
8382
8413void write_prof(
8414 const char *filename,
8415 const ctl_t * ctl,
8416 met_t * met0,
8417 met_t * met1,
8418 const atm_t * atm,
8419 const double t);
8420
8452void write_sample(
8453 const char *filename,
8454 const ctl_t * ctl,
8455 met_t * met0,
8456 met_t * met1,
8457 const atm_t * atm,
8458 const double t);
8459
8486void write_station(
8487 const char *filename,
8488 const ctl_t * ctl,
8489 atm_t * atm,
8490 const double t);
8491
8520void write_vtk(
8521 const char *filename,
8522 const ctl_t * ctl,
8523 const atm_t * atm,
8524 const double t);
8525
8526#endif /* LIBTRAC_H */
void read_met_geopot(const ctl_t *ctl, met_t *met)
Calculates geopotential heights from meteorological data.
Definition: mptrac.c:6973
#define LEN
Maximum length of ASCII data lines.
Definition: mptrac.h:241
void mptrac_write_atm(const char *filename, const ctl_t *ctl, const atm_t *atm, const double t)
Writes air parcel data to a file in various formats.
Definition: mptrac.c:5657
void day2doy(const int year, const int mon, const int day, int *doy)
Get day of year from date.
Definition: mptrac.c:897
void read_met_extrapolate(met_t *met)
Extrapolates meteorological data.
Definition: mptrac.c:6933
void read_met_levels(const int ncid, const ctl_t *ctl, met_t *met)
Reads meteorological variables at different vertical levels from a NetCDF file.
Definition: mptrac.c:7219
int read_met_nc(const char *filename, const ctl_t *ctl, const clim_t *clim, met_t *met)
Reads meteorological data from a NetCDF file and processes it.
Definition: mptrac.c:7497
void write_atm_clams_traj(const char *dirname, const ctl_t *ctl, const atm_t *atm, const double t)
Writes CLaMS trajectory data to a NetCDF file.
Definition: mptrac.c:9402
void write_met_nc_2d(const int ncid, const char *varname, met_t *met, float var[EX][EY], const float scl)
Writes a 2D meteorological variable to a NetCDF file.
Definition: mptrac.c:10762
void mptrac_alloc(ctl_t **ctl, cache_t **cache, clim_t **clim, met_t **met0, met_t **met1, atm_t **atm)
Allocates and initializes memory resources for MPTRAC.
Definition: mptrac.c:4187
void read_met_sample(const ctl_t *ctl, met_t *met)
Downsamples meteorological data based on specified parameters.
Definition: mptrac.c:8265
void write_met_bin_3d(FILE *out, const ctl_t *ctl, met_t *met, float var[EX][EY][EP], const char *varname, const int precision, const double tolerance)
Writes a 3-dimensional meteorological variable to a binary file.
Definition: mptrac.c:10523
void read_obs(const char *filename, const ctl_t *ctl, double *rt, double *rz, double *rlon, double *rlat, double *robs, int *nobs)
Reads observation data from a file and stores it in arrays.
Definition: mptrac.c:8745
void module_advect(const ctl_t *ctl, const cache_t *cache, met_t *met0, met_t *met1, atm_t *atm)
Performs the advection of atmospheric particles using meteorological data.
Definition: mptrac.c:2069
void module_timesteps(const ctl_t *ctl, cache_t *cache, met_t *met0, atm_t *atm, const double t)
Calculate time steps for air parcels based on specified conditions.
Definition: mptrac.c:3914
int mptrac_read_met(const char *filename, const ctl_t *ctl, const clim_t *clim, met_t *met)
Reads meteorological data from a file, supporting multiple formats and MPI broadcasting.
Definition: mptrac.c:5353
void module_meteo(const ctl_t *ctl, const cache_t *cache, const clim_t *clim, met_t *met0, met_t *met1, atm_t *atm)
Update atmospheric properties using meteorological data.
Definition: mptrac.c:3227
void read_clim_photo(const char *filename, clim_photo_t *photo)
Reads photolysis rates from a NetCDF file and populates the given photolysis structure.
Definition: mptrac.c:6081
void read_met_cloud(met_t *met)
Calculates cloud-related variables for each grid point.
Definition: mptrac.c:6772
void module_decay(const ctl_t *ctl, const cache_t *cache, const clim_t *clim, atm_t *atm)
Simulate exponential decay processes for atmospheric particles.
Definition: mptrac.c:2613
double sedi(const double p, const double T, const double rp, const double rhop)
Calculates the sedimentation velocity of a particle in air.
Definition: mptrac.c:8918
void intpol_met_space_2d(const met_t *met, float array[EX][EY], const double lon, const double lat, double *var, int *ci, double *cw, const int init)
Interpolates meteorological variables in 2D space.
Definition: mptrac.c:1442
void intpol_met_space_3d_ml(const met_t *met, float zs[EX][EY][EP], float vals[EX][EY][EP], const double z, const double lon, const double lat, double *val)
Interpolates meteorological data in 3D space.
Definition: mptrac.c:1373
int read_atm_nc(const char *filename, const ctl_t *ctl, atm_t *atm)
Reads air parcel data from a generic netCDF file and populates the given atmospheric structure.
Definition: mptrac.c:6048
void read_met_pbl(const ctl_t *ctl, met_t *met)
Computes the planetary boundary layer (PBL) pressure based on meteorological data.
Definition: mptrac.c:7873
void read_met_detrend(const ctl_t *ctl, met_t *met)
Detrends meteorological data.
Definition: mptrac.c:6829
int read_met_nc_2d(const int ncid, const char *varname, const char *varname2, const char *varname3, const char *varname4, const char *varname5, const char *varname6, const ctl_t *ctl, const met_t *met, float dest[EX][EY], const float scl, const int init)
Reads a 2-dimensional meteorological variable from a NetCDF file.
Definition: mptrac.c:7569
void read_met_tropo(const ctl_t *ctl, const clim_t *clim, met_t *met)
Calculates the tropopause and related meteorological variables based on various methods and stores th...
Definition: mptrac.c:8573
void read_obs_asc(const char *filename, double *rt, double *rz, double *rlon, double *rlat, double *robs, int *nobs)
Reads observation data from an ASCII file.
Definition: mptrac.c:8789
void module_chem_init(const ctl_t *ctl, const cache_t *cache, const clim_t *clim, met_t *met0, met_t *met1, atm_t *atm)
Initializes the chemistry modules by setting atmospheric composition.
Definition: mptrac.c:2498
int locate_reg(const double *xx, const int n, const double x)
Locate the index of the interval containing a given value in a regular grid.
Definition: mptrac.c:2030
void get_tropo(const int met_tropo, ctl_t *ctl, clim_t *clim, met_t *met, const double *lons, const int nx, const double *lats, const int ny, double *pt, double *zt, double *tt, double *qt, double *o3t, double *ps, double *zs)
Calculate tropopause data.
Definition: mptrac.c:1092
void locate_vert(float profiles[EX][EY][EP], const int np, const int lon_ap_ind, const int lat_ap_ind, const double alt_ap, int *ind)
Locate the four vertical indizes of a box for a given height value.
Definition: mptrac.c:2049
void mptrac_get_met(ctl_t *ctl, clim_t *clim, const double t, met_t **met0, met_t **met1)
Retrieves meteorological data for the specified time.
Definition: mptrac.c:4260
int read_clim_ts(const char *filename, clim_ts_t *ts)
Reads a climatological time series from a file and populates the given time series structure.
Definition: mptrac.c:6200
void read_met_periodic(met_t *met)
Applies periodic boundary conditions to meteorological data along longitudinal axis.
Definition: mptrac.c:8010
void module_timesteps_init(ctl_t *ctl, const atm_t *atm)
Initialize start time and time interval for time-stepping.
Definition: mptrac.c:3951
void write_ens(const char *filename, const ctl_t *ctl, const atm_t *atm, const double t)
Writes ensemble data to a file.
Definition: mptrac.c:9871
void compress_cms(const ctl_t *ctl, const char *varname, float *array, const size_t nx, const size_t ny, const size_t np, const int decompress, FILE *inout)
Compresses or decompresses a 3D array of floats using a custom multiscale compression algorithm.
void module_mixing(const ctl_t *ctl, const clim_t *clim, atm_t *atm, const double t)
Update atmospheric properties through interparcel mixing.
Definition: mptrac.c:3331
void compress_zfp(const char *varname, float *array, const int nx, const int ny, const int nz, const int precision, const double tolerance, const int decompress, FILE *inout)
Compresses or decompresses a 3D array of floats using the ZFP library.
double clim_zm(const clim_zm_t *zm, const double t, const double lat, const double p)
Interpolates monthly mean zonal mean climatological variables.
Definition: mptrac.c:401
#define EY
Maximum number of latitudes for meteo data.
Definition: mptrac.h:271
void read_clim_photo_help(const int ncid, const char *varname, const clim_photo_t *photo, double var[CP][CSZA][CO3])
Reads a 3D climatological photochemistry variable from a NetCDF file.
Definition: mptrac.c:6172
void read_met_ml2pl(const ctl_t *ctl, const met_t *met, float var[EX][EY][EP], const char *varname)
Interpolates meteorological data to specified pressure levels.
Definition: mptrac.c:7375
double clim_tropo(const clim_t *clim, const double t, const double lat)
Calculates the tropopause pressure based on climatological data.
Definition: mptrac.c:200
void read_obs_nc(const char *filename, double *rt, double *rz, double *rlon, double *rlat, double *robs, int *nobs)
Reads observation data from a NetCDF file.
Definition: mptrac.c:8817
void read_met_grid(const char *filename, const int ncid, const ctl_t *ctl, met_t *met)
Reads meteorological grid information from a NetCDF file.
Definition: mptrac.c:7101
void read_met_bin_2d(FILE *in, const met_t *met, float var[EX][EY], const char *varname)
Reads a 2-dimensional meteorological variable from a binary file and stores it in the provided array.
Definition: mptrac.c:6542
int locate_irr(const double *xx, const int n, const double x)
Locate the index of the interval containing a given value in a sorted array.
Definition: mptrac.c:1966
void module_isosurf_init(const ctl_t *ctl, cache_t *cache, met_t *met0, met_t *met1, atm_t *atm)
Initialize the isosurface module based on atmospheric data.
Definition: mptrac.c:3052
void level_definitions(ctl_t *ctl)
Defines pressure levels for meteorological data.
Definition: mptrac.c:1760
void write_grid_asc(const char *filename, const ctl_t *ctl, const double *cd, double *mean[NQ], double *sigma[NQ], const double *vmr_impl, const double t, const double *z, const double *lon, const double *lat, const double *area, const double dz, const int *np)
Writes grid data to an ASCII file.
Definition: mptrac.c:10159
void mptrac_update_device(const ctl_t *ctl, const cache_t *cache, const clim_t *clim, met_t **met0, met_t **met1, const atm_t *atm)
Updates device memory for specified data structures.
Definition: mptrac.c:5545
void time2jsec(const int year, const int mon, const int day, const int hour, const int min, const int sec, const double remain, double *jsec)
Converts time components to seconds since January 1, 2000, 12:00:00 UTC.
Definition: mptrac.c:9060
void mptrac_init(ctl_t *ctl, cache_t *cache, clim_t *clim, atm_t *atm, const int ntask)
Initializes the MPTRAC model and its associated components.
Definition: mptrac.c:4381
void intpol_met_time_3d(const met_t *met0, float array0[EX][EY][EP], const met_t *met1, float array1[EX][EY][EP], const double ts, const double p, const double lon, const double lat, double *var, int *ci, double *cw, const int init)
Interpolates meteorological data in 3D space and time.
Definition: mptrac.c:1502
void fft_help(double *fcReal, double *fcImag, const int n)
Computes the Fast Fourier Transform (FFT) of a complex sequence.
Definition: mptrac.c:946
void module_wet_depo(const ctl_t *ctl, const cache_t *cache, met_t *met0, met_t *met1, atm_t *atm)
Perform wet deposition calculations for air parcels.
Definition: mptrac.c:4052
void compress_pck(const char *varname, float *array, const size_t nxy, const size_t nz, const int decompress, FILE *inout)
Compresses or decompresses a 3D array of floats.
Definition: mptrac.c:657
double nat_temperature(const double p, const double h2o, const double hno3)
Calculates the nitric acid trihydrate (NAT) temperature.
Definition: mptrac.c:5848
void spline(const double *x, const double *y, const int n, const double *x2, double *y2, const int n2, const int method)
Performs spline interpolation or linear interpolation.
Definition: mptrac.c:8951
#define CP
Maximum number of pressure levels for climatological data.
Definition: mptrac.h:301
#define NQ
Maximum number of quantities per data point.
Definition: mptrac.h:251
double clim_photo(const double rate[CP][CSZA][CO3], const clim_photo_t *photo, const double p, const double sza, const double o3c)
Calculates the photolysis rate for a given set of atmospheric conditions.
Definition: mptrac.c:149
void read_clim_zm(const char *filename, const char *varname, clim_zm_t *zm)
Reads zonally averaged climatological data from a netCDF file and populates the given structure.
Definition: mptrac.c:6254
#define EX
Maximum number of longitudes for meteo data.
Definition: mptrac.h:266
void module_sedi(const ctl_t *ctl, const cache_t *cache, met_t *met0, met_t *met1, atm_t *atm)
Simulate sedimentation of particles in the atmosphere.
Definition: mptrac.c:3789
void timer(const char *name, const char *group, const int output)
Measures and reports elapsed time for named and grouped timers.
Definition: mptrac.c:9091
void read_met_monotonize(met_t *met)
Makes zeta and pressure profiles monotone.
Definition: mptrac.c:7417
void write_atm_asc(const char *filename, const ctl_t *ctl, const atm_t *atm, const double t)
Writes air parcel data to an ASCII file or gnuplot.
Definition: mptrac.c:9217
void intpol_met_space_3d(const met_t *met, float array[EX][EY][EP], const double p, const double lon, const double lat, double *var, int *ci, double *cw, const int init)
Interpolates meteorological variables in 3D space.
Definition: mptrac.c:1313
void read_met_surface(const int ncid, const ctl_t *ctl, met_t *met)
Reads surface meteorological data from a netCDF file and stores it in the meteorological data structu...
Definition: mptrac.c:8437
void intpol_met_time_3d_ml(const met_t *met0, float zs0[EX][EY][EP], float array0[EX][EY][EP], const met_t *met1, float zs1[EX][EY][EP], float array1[EX][EY][EP], const double ts, const double p, const double lon, const double lat, double *var)
Interpolates meteorological data in both space and time.
Definition: mptrac.c:1531
void module_convection(const ctl_t *ctl, cache_t *cache, met_t *met0, met_t *met1, atm_t *atm)
Performs convective mixing of atmospheric particles.
Definition: mptrac.c:2540
void read_kernel(const char *filename, double kz[EP], double kw[EP], int *nk)
Reads kernel function data from a file and populates the provided arrays.
Definition: mptrac.c:6353
void module_bound_cond(const ctl_t *ctl, const cache_t *cache, const clim_t *clim, met_t *met0, met_t *met1, atm_t *atm)
Apply boundary conditions to particles based on meteorological and climatological data.
Definition: mptrac.c:2255
double scan_ctl(const char *filename, int argc, char *argv[], const char *varname, const int arridx, const char *defvalue, char *value)
Scans a control file or command-line arguments for a specified variable.
Definition: mptrac.c:8846
#define CT
Maximum number of time steps for climatological data.
Definition: mptrac.h:311
void module_advect_init(const ctl_t *ctl, const cache_t *cache, met_t *met0, met_t *met1, atm_t *atm)
Initializes the advection module by setting up pressure fields.
Definition: mptrac.c:2228
void module_sort_help(double *a, const int *p, const int np)
Reorder an array based on a given permutation.
Definition: mptrac.c:3878
float stddev(const float *data, const int n)
Calculates the standard deviation of a set of data.
Definition: mptrac.c:8998
void intpol_tropo_3d(const double time0, float array0[EX][EY], const double time1, float array1[EX][EY], const double lons[EX], const double lats[EY], const int nlon, const int nlat, const double time, const double lon, const double lat, const int method, double *var, double *sigma)
Interpolates tropopause data in 3D (latitude, longitude, and time).
Definition: mptrac.c:1589
int read_met_nc_3d(const int ncid, const char *varname, const char *varname2, const char *varname3, const char *varname4, const ctl_t *ctl, const met_t *met, float dest[EX][EY][EP], const float scl)
Reads a 3-dimensional meteorological variable from a NetCDF file.
Definition: mptrac.c:7727
void read_met_bin_3d(FILE *in, const ctl_t *ctl, const met_t *met, float var[EX][EY][EP], const char *varname, const float bound_min, const float bound_max)
Reads 3D meteorological data from a binary file, potentially using different compression methods.
Definition: mptrac.c:6571
int locate_irr_float(const float *xx, const int n, const double x, const int ig)
Locate the index of the interval containing a given value in an irregularly spaced array.
Definition: mptrac.c:1996
double time_from_filename(const char *filename, const int offset)
Extracts and converts a timestamp from a filename to Julian seconds.
Definition: mptrac.c:9159
void write_prof(const char *filename, const ctl_t *ctl, met_t *met0, met_t *met1, const atm_t *atm, const double t)
Writes profile data to a specified file.
Definition: mptrac.c:10821
void mptrac_read_clim(const ctl_t *ctl, clim_t *clim)
Reads various climatological data and populates the given climatology structure.
Definition: mptrac.c:4471
void module_chem_grid(const ctl_t *ctl, met_t *met0, met_t *met1, atm_t *atm, const double t)
Calculate grid data for chemistry modules.
Definition: mptrac.c:2351
double tropo_weight(const clim_t *clim, const atm_t *atm, const int ip)
Computes a weighting factor based on tropopause pressure.
Definition: mptrac.c:9194
void write_met_nc(const char *filename, const ctl_t *ctl, met_t *met)
Writes meteorological data to a NetCDF file.
Definition: mptrac.c:10599
void module_rng_init(const int ntask)
Initialize random number generators for parallel tasks.
Definition: mptrac.c:3653
int mptrac_read_atm(const char *filename, const ctl_t *ctl, atm_t *atm)
Reads air parcel data from a specified file into the given atmospheric structure.
Definition: mptrac.c:4400
void intpol_met_4d_coord(const met_t *met0, float height0[EX][EY][EP], float array0[EX][EY][EP], const met_t *met1, float height1[EX][EY][EP], float array1[EX][EY][EP], const double ts, const double height, const double lon, const double lat, double *var, int *ci, double *cw, const int init)
Interpolates meteorological variables to a given position and time.
Definition: mptrac.c:1135
void mptrac_update_host(const ctl_t *ctl, const cache_t *cache, const clim_t *clim, met_t **met0, met_t **met1, const atm_t *atm)
Updates host memory for specified data structures.
Definition: mptrac.c:5601
void mptrac_write_output(const char *dirname, const ctl_t *ctl, met_t *met0, met_t *met1, atm_t *atm, const double t)
Writes various types of output data to files in a specified directory.
Definition: mptrac.c:5757
double clim_oh(const ctl_t *ctl, const clim_t *clim, const double t, const double lon, const double lat, const double p)
Calculates the hydroxyl radical (OH) concentration from climatology data, with an optional diurnal co...
Definition: mptrac.c:89
#define CTS
Maximum number of data points of climatological time series.
Definition: mptrac.h:316
void read_met_ozone(met_t *met)
Calculates the total column ozone from meteorological ozone data.
Definition: mptrac.c:8236
void broadcast_large_data(void *data, size_t N)
Broadcasts large data across all processes in an MPI communicator.
void mptrac_free(ctl_t *ctl, cache_t *cache, clim_t *clim, met_t *met0, met_t *met1, atm_t *atm)
Frees memory resources allocated for MPTRAC.
Definition: mptrac.c:4234
void clim_tropo_init(clim_t *clim)
Initializes the tropopause data in the climatology structure.
Definition: mptrac.c:228
void module_rng(const ctl_t *ctl, double *rs, const size_t n, const int method)
Generate random numbers using various methods and distributions.
Definition: mptrac.c:3684
void get_met_help(const ctl_t *ctl, const double t, const int direct, const char *metbase, const double dt_met, char *filename)
Generates a formatted filename for meteorological data files based on the input parameters.
Definition: mptrac.c:1003
void write_station(const char *filename, const ctl_t *ctl, atm_t *atm, const double t)
Writes station data to a specified file.
Definition: mptrac.c:11210
void cart2geo(const double *x, double *z, double *lon, double *lat)
Converts Cartesian coordinates to geographic coordinates.
Definition: mptrac.c:74
#define NP
Maximum number of atmospheric data points.
Definition: mptrac.h:246
double sza_calc(const double sec, const double lon, const double lat)
Calculates the solar zenith angle.
Definition: mptrac.c:9019
void module_mixing_help(const ctl_t *ctl, const clim_t *clim, atm_t *atm, const int *ixs, const int *iys, const int *izs, const int qnt_idx)
Perform interparcel mixing for a specific quantity.
Definition: mptrac.c:3421
void doy2day(const int year, const int doy, int *mon, int *day)
Converts a given day of the year (DOY) to a date (month and day).
Definition: mptrac.c:916
void intpol_met_time_2d(const met_t *met0, float array0[EX][EY], const met_t *met1, float array1[EX][EY], const double ts, const double lon, const double lat, double *var, int *ci, double *cw, const int init)
Interpolates meteorological data in 2D space and time.
Definition: mptrac.c:1556
void module_position(const cache_t *cache, met_t *met0, met_t *met1, atm_t *atm)
Update the positions and pressure levels of atmospheric particles.
Definition: mptrac.c:3599
void clim_oh_diurnal_correction(const ctl_t *ctl, clim_t *clim)
Applies a diurnal correction to the hydroxyl radical (OH) concentration in climatology data.
Definition: mptrac.c:116
void write_met_bin_2d(FILE *out, met_t *met, float var[EX][EY], const char *varname)
Writes a 2-dimensional meteorological variable to a binary file.
Definition: mptrac.c:10494
void read_met_pv(met_t *met)
Calculates potential vorticity (PV) from meteorological data.
Definition: mptrac.c:8130
int read_atm_bin(const char *filename, const ctl_t *ctl, atm_t *atm)
Reads air parcel data from a binary file and populates the given atmospheric structure.
Definition: mptrac.c:5936
void get_met_replace(char *orig, char *search, char *repl)
Replaces occurrences of a substring in a string with another substring.
Definition: mptrac.c:1068
#define CY
Maximum number of latitudes for climatological data.
Definition: mptrac.h:291
void module_diff_meso(const ctl_t *ctl, cache_t *cache, met_t *met0, met_t *met1, atm_t *atm)
Simulate mesoscale diffusion for atmospheric particles.
Definition: mptrac.c:2652
void module_sort(const ctl_t *ctl, met_t *met0, atm_t *atm)
Sort particles according to box index.
Definition: mptrac.c:3818
double clim_ts(const clim_ts_t *ts, const double t)
Interpolates a time series of climatological variables.
Definition: mptrac.c:383
void thrustSortWrapper(double *__restrict__ c, int n, int *__restrict__ index)
Wrapper to Thrust sorting function.
void jsec2time(const double jsec, int *year, int *mon, int *day, int *hour, int *min, int *sec, double *remain)
Converts Julian seconds to calendar date and time components.
Definition: mptrac.c:1683
int read_met_bin(const char *filename, const ctl_t *ctl, met_t *met)
Reads meteorological data from a binary file.
Definition: mptrac.c:6394
void mptrac_run_timestep(ctl_t *ctl, cache_t *cache, clim_t *clim, met_t **met0, met_t **met1, atm_t *atm, double t)
Executes a single timestep of the MPTRAC model simulation.
Definition: mptrac.c:5408
void write_atm_clams(const char *filename, const ctl_t *ctl, const atm_t *atm)
Writes air parcel data to a NetCDF file in the CLaMS format.
Definition: mptrac.c:9349
void module_diff_turb(const ctl_t *ctl, cache_t *cache, const clim_t *clim, met_t *met0, met_t *met1, atm_t *atm)
Applies turbulent diffusion processes to atmospheric particles.
Definition: mptrac.c:2854
int read_atm_clams(const char *filename, const ctl_t *ctl, atm_t *atm)
Reads air parcel data from a CLaMS netCDF file and populates the given atmospheric structure.
Definition: mptrac.c:5992
void write_vtk(const char *filename, const ctl_t *ctl, const atm_t *atm, const double t)
Writes VTK (Visualization Toolkit) data to a specified file.
Definition: mptrac.c:11296
#define EP
Maximum number of pressure levels for meteo data.
Definition: mptrac.h:261
void module_tracer_chem(const ctl_t *ctl, const cache_t *cache, const clim_t *clim, met_t *met0, met_t *met1, atm_t *atm)
Simulate chemical reactions involving long-lived atmospheric tracers.
Definition: mptrac.c:3982
void mptrac_read_ctl(const char *filename, int argc, char *argv[], ctl_t *ctl)
Reads control parameters from a configuration file and populates the given structure.
Definition: mptrac.c:4531
void read_met_polar_winds(met_t *met)
Applies a fix for polar winds in meteorological data.
Definition: mptrac.c:8071
void module_h2o2_chem(const ctl_t *ctl, const cache_t *cache, const clim_t *clim, met_t *met0, met_t *met1, atm_t *atm)
Perform chemical reactions involving H2O2 within cloud particles.
Definition: mptrac.c:2969
void compress_zstd(const char *varname, float *array, const size_t n, const int decompress, FILE *inout)
Compresses or decompresses an array of floats using the Zstandard (ZSTD) library.
void write_grid_nc(const char *filename, const ctl_t *ctl, const double *cd, double *mean[NQ], double *sigma[NQ], const double *vmr_impl, const double t, const double *z, const double *lon, const double *lat, const double *area, const double dz, const int *np)
Writes grid data to a NetCDF file.
Definition: mptrac.c:10263
double pbl_weight(const ctl_t *ctl, const atm_t *atm, const int ip, const double pbl, const double ps)
Computes a weighting factor based on planetary boundary layer pressure.
Definition: mptrac.c:5872
void module_diff_pbl(const ctl_t *ctl, cache_t *cache, met_t *met0, met_t *met1, atm_t *atm)
Computes particle diffusion within the planetary boundary layer (PBL).
Definition: mptrac.c:2729
void write_met_nc_3d(const int ncid, const char *varname, met_t *met, float var[EX][EY][EP], const float scl)
Writes a 3D meteorological variable to a NetCDF file.
Definition: mptrac.c:10791
void module_isosurf(const ctl_t *ctl, const cache_t *cache, met_t *met0, met_t *met1, atm_t *atm)
Apply the isosurface module to adjust atmospheric properties.
Definition: mptrac.c:3122
void module_kpp_chem(ctl_t *ctl, cache_t *cache, clim_t *clim, met_t *met0, met_t *met1, atm_t *atm)
KPP chemistry module.
#define CO3
Maximum number of total column ozone data for climatological data.
Definition: mptrac.h:296
void module_oh_chem(const ctl_t *ctl, const cache_t *cache, const clim_t *clim, met_t *met0, met_t *met1, atm_t *atm)
Perform hydroxyl chemistry calculations for atmospheric particles.
Definition: mptrac.c:3515
void geo2cart(const double z, const double lon, const double lat, double *x)
Converts geographic coordinates (longitude, latitude, altitude) to Cartesian coordinates.
Definition: mptrac.c:985
double kernel_weight(const double kz[EP], const double kw[EP], const int nk, const double p)
Calculates the kernel weight based on altitude and given kernel data.
Definition: mptrac.c:1716
int read_atm_asc(const char *filename, const ctl_t *ctl, atm_t *atm)
Reads air parcel data from an ASCII file and populates the given atmospheric structure.
Definition: mptrac.c:5894
void write_sample(const char *filename, const ctl_t *ctl, met_t *met0, met_t *met1, const atm_t *atm, const double t)
Writes sample data to a specified file.
Definition: mptrac.c:11048
void write_grid(const char *filename, const ctl_t *ctl, met_t *met0, met_t *met1, const atm_t *atm, const double t)
Writes grid data to a file in ASCII or netCDF format.
Definition: mptrac.c:9968
void module_dry_depo(const ctl_t *ctl, const cache_t *cache, met_t *met0, met_t *met1, atm_t *atm)
Simulate dry deposition of atmospheric particles.
Definition: mptrac.c:2906
void write_met_bin(const char *filename, const ctl_t *ctl, met_t *met)
Writes meteorological data in binary format to a specified file.
Definition: mptrac.c:10393
void write_atm_bin(const char *filename, const ctl_t *ctl, const atm_t *atm)
Writes air parcel data to a binary file.
Definition: mptrac.c:9299
void read_met_cape(const ctl_t *ctl, const clim_t *clim, met_t *met)
Calculates Convective Available Potential Energy (CAPE) for each grid point.
Definition: mptrac.c:6657
void mptrac_write_met(const char *filename, const ctl_t *ctl, met_t *met)
Writes meteorological data to a file, supporting multiple formats and compression options.
Definition: mptrac.c:5717
#define CSZA
Maximum number of solar zenith angles for climatological data.
Definition: mptrac.h:306
double lapse_rate(const double t, const double h2o)
Calculates the moist adiabatic lapse rate in Kelvin per kilometer.
Definition: mptrac.c:1742
void write_csi(const char *filename, const ctl_t *ctl, const atm_t *atm, const double t)
Writes Critical Success Index (CSI) data to a file.
Definition: mptrac.c:9609
void write_atm_nc(const char *filename, const ctl_t *ctl, const atm_t *atm)
Writes air parcel data to a NetCDF file.
Definition: mptrac.c:9560
Air parcel data.
Definition: mptrac.h:3136
int np
Number of air parcels.
Definition: mptrac.h:3139
Cache data structure.
Definition: mptrac.h:3164
int iso_n
Isosurface balloon number of data points.
Definition: mptrac.h:3176
Climatological data in the form of photolysis rates.
Definition: mptrac.h:3196
int nsza
Number of solar zenith angles.
Definition: mptrac.h:3202
int np
Number of pressure levels.
Definition: mptrac.h:3199
int no3c
Number of total ozone columns.
Definition: mptrac.h:3205
Climatological data.
Definition: mptrac.h:3304
clim_ts_t ccl2f2
CFC-12 time series.
Definition: mptrac.h:3346
clim_photo_t photo
Photolysis rates.
Definition: mptrac.h:3322
clim_zm_t ho2
HO2 zonal means.
Definition: mptrac.h:3334
clim_zm_t hno3
HNO3 zonal means.
Definition: mptrac.h:3325
int tropo_ntime
Number of tropopause timesteps.
Definition: mptrac.h:3307
clim_ts_t sf6
SF6 time series.
Definition: mptrac.h:3352
clim_ts_t ccl4
CFC-10 time series.
Definition: mptrac.h:3340
clim_ts_t ccl3f
CFC-11 time series.
Definition: mptrac.h:3343
clim_zm_t o1d
O(1D) zonal means.
Definition: mptrac.h:3337
clim_zm_t h2o2
H2O2 zonal means.
Definition: mptrac.h:3331
int tropo_nlat
Number of tropopause latitudes.
Definition: mptrac.h:3310
clim_zm_t oh
OH zonal means.
Definition: mptrac.h:3328
clim_ts_t n2o
N2O time series.
Definition: mptrac.h:3349
Climatological data in the form of time series.
Definition: mptrac.h:3252
int ntime
Number of timesteps.
Definition: mptrac.h:3255
Climatological data in the form of zonal means.
Definition: mptrac.h:3272
int np
Number of pressure levels.
Definition: mptrac.h:3281
int ntime
Number of timesteps.
Definition: mptrac.h:3275
int nlat
Number of latitudes.
Definition: mptrac.h:3278
Control parameters.
Definition: mptrac.h:2158
double grid_z0
Lower altitude of gridded data [km].
Definition: mptrac.h:3016
int qnt_o3
Quantity array index for ozone volume mixing ratio.
Definition: mptrac.h:2270
double csi_lat1
Upper latitude of gridded CSI data [deg].
Definition: mptrac.h:2980
int qnt_Coh
Quantity array index for OH volume mixing ratio (chemistry code).
Definition: mptrac.h:2417
double wet_depo_ic_a
Coefficient A for wet deposition in cloud (exponential form).
Definition: mptrac.h:2868
int met_nc_scale
Check netCDF scaling factors (0=no, 1=yes).
Definition: mptrac.h:2489
int qnt_pel
Quantity array index for pressure at equilibrium level (EL).
Definition: mptrac.h:2303
int csi_nz
Number of altitudes of gridded CSI data.
Definition: mptrac.h:2956
double molmass
Molar mass [g/mol].
Definition: mptrac.h:2730
int qnt_p
Quantity array index for pressure.
Definition: mptrac.h:2249
int qnt_Cccl2f2
Quantity array index for CFC-12 volume mixing ratio (chemistry code).
Definition: mptrac.h:2441
int mixing_nx
Number of longitudes of mixing grid.
Definition: mptrac.h:2793
double chemgrid_z1
Upper altitude of chemistry grid [km].
Definition: mptrac.h:2817
int qnt_m
Quantity array index for mass.
Definition: mptrac.h:2189
int qnt_aoa
Quantity array index for age of air.
Definition: mptrac.h:2450
int qnt_rhop
Quantity array index for particle density.
Definition: mptrac.h:2198
int qnt_swc
Quantity array index for cloud snow water content.
Definition: mptrac.h:2282
double csi_obsmin
Minimum observation index to trigger detection.
Definition: mptrac.h:2950
int qnt_pcb
Quantity array index for cloud bottom pressure.
Definition: mptrac.h:2291
double bound_dzs
Boundary conditions surface layer depth [km].
Definition: mptrac.h:2718
double csi_lon1
Upper longitude of gridded CSI data [deg].
Definition: mptrac.h:2971
int qnt_u
Quantity array index for zonal wind.
Definition: mptrac.h:2258
double stat_lon
Longitude of station [deg].
Definition: mptrac.h:3094
double mixing_trop
Interparcel exchange parameter for mixing in the troposphere.
Definition: mptrac.h:2778
double sort_dt
Time step for sorting of particle data [s].
Definition: mptrac.h:2630
double mixing_z1
Upper altitude of mixing grid [km].
Definition: mptrac.h:2790
double stat_r
Search radius around station [km].
Definition: mptrac.h:3100
double wet_depo_bc_a
Coefficient A for wet deposition below cloud (exponential form).
Definition: mptrac.h:2862
int csi_ny
Number of latitudes of gridded CSI data.
Definition: mptrac.h:2974
int vtk_sphere
Spherical projection for VTK data (0=no, 1=yes).
Definition: mptrac.h:3124
double chemgrid_z0
Lower altitude of chemistry grid [km].
Definition: mptrac.h:2814
double met_pbl_min
Minimum depth of planetary boundary layer [km].
Definition: mptrac.h:2598
int qnt_iwc
Quantity array index for cloud ice water content.
Definition: mptrac.h:2279
double chemgrid_lat0
Lower latitude of chemistry grid [deg].
Definition: mptrac.h:2832
double conv_cape
CAPE threshold for convection module [J/kg].
Definition: mptrac.h:2682
int qnt_Co1d
Quantity array index for O(1D) volume mixing ratio (chemistry code).
Definition: mptrac.h:2429
double met_cms_eps_pv
cmultiscale compression epsilon for potential vorticity.
Definition: mptrac.h:2529
int qnt_pw
Quantity array index for partial water vapor pressure.
Definition: mptrac.h:2357
double grid_z1
Upper altitude of gridded data [km].
Definition: mptrac.h:3019
int direction
Direction flag (1=forward calculation, -1=backward calculation).
Definition: mptrac.h:2453
int qnt_Cccl4
Quantity array index for CFC-10 volume mixing ratio (chemistry code).
Definition: mptrac.h:2435
int met_dp
Stride for pressure levels.
Definition: mptrac.h:2559
double met_dt_out
Time step for sampling of meteo data along trajectories [s].
Definition: mptrac.h:2617
int qnt_h2o2
Quantity array index for H2O2 volume mixing ratio (climatology).
Definition: mptrac.h:2321
int qnt_vh
Quantity array index for horizontal wind.
Definition: mptrac.h:2384
int csi_nx
Number of longitudes of gridded CSI data.
Definition: mptrac.h:2965
double csi_lat0
Lower latitude of gridded CSI data [deg].
Definition: mptrac.h:2977
double turb_dz_trop
Vertical turbulent diffusion coefficient (troposphere) [m^2/s].
Definition: mptrac.h:2664
int met_pbl
Planetary boundary layer data (0=file, 1=z2p, 2=Richardson, 3=theta).
Definition: mptrac.h:2595
int qnt_lwc
Quantity array index for cloud liquid water content.
Definition: mptrac.h:2273
double turb_mesoz
Vertical scaling factor for mesoscale wind fluctuations.
Definition: mptrac.h:2673
int grid_nc_level
zlib compression level of netCDF grid data files (0=off).
Definition: mptrac.h:3004
int grid_nx
Number of longitudes of gridded data.
Definition: mptrac.h:3022
int atm_type
Type of atmospheric data files (0=ASCII, 1=binary, 2=netCDF, 3=CLaMS_traj, 4=CLaMS_pos).
Definition: mptrac.h:2921
double bound_mass
Boundary conditions mass per particle [kg].
Definition: mptrac.h:2691
double grid_lat0
Lower latitude of gridded data [deg].
Definition: mptrac.h:3034
int qnt_ts
Quantity array index for surface temperature.
Definition: mptrac.h:2204
int qnt_loss_rate
Quantity array index for total loss rate.
Definition: mptrac.h:2348
double met_cms_eps_h2o
cmultiscale compression epsilon for water vapor.
Definition: mptrac.h:2532
int qnt_plfc
Quantity array index for pressure at level of free convection (LCF).
Definition: mptrac.h:2300
double grid_lon0
Lower longitude of gridded data [deg].
Definition: mptrac.h:3025
int qnt_o1d
Quantity array index for O(1D) volume mixing ratio (climatology).
Definition: mptrac.h:2327
int met_tropo_spline
Tropopause interpolation method (0=linear, 1=spline).
Definition: mptrac.h:2614
int qnt_tvirt
Quantity array index for virtual temperature.
Definition: mptrac.h:2378
double dt_met
Time step of meteo data [s].
Definition: mptrac.h:2472
double chemgrid_lat1
Upper latitude of chemistry grid [deg].
Definition: mptrac.h:2835
int met_geopot_sy
Latitudinal smoothing of geopotential heights.
Definition: mptrac.h:2586
double met_cms_eps_u
cmultiscale compression epsilon for zonal wind.
Definition: mptrac.h:2520
double turb_dx_strat
Horizontal turbulent diffusion coefficient (stratosphere) [m^2/s].
Definition: mptrac.h:2658
int qnt_vmr
Quantity array index for volume mixing ratio.
Definition: mptrac.h:2192
int qnt_lsm
Quantity array index for land-sea mask.
Definition: mptrac.h:2225
int qnt_theta
Quantity array index for potential temperature.
Definition: mptrac.h:2369
double bound_lat1
Boundary conditions maximum longitude [deg].
Definition: mptrac.h:2706
double stat_t1
Stop time for station output [s].
Definition: mptrac.h:3106
double turb_dx_trop
Horizontal turbulent diffusion coefficient (troposphere) [m^2/s].
Definition: mptrac.h:2655
int grid_type
Type of grid data files (0=ASCII, 1=netCDF).
Definition: mptrac.h:3040
double csi_lon0
Lower longitude of gridded CSI data [deg].
Definition: mptrac.h:2968
int qnt_pbl
Quantity array index for boundary layer pressure.
Definition: mptrac.h:2231
int grid_stddev
Include standard deviations in grid output (0=no, 1=yes).
Definition: mptrac.h:3010
int qnt_psice
Quantity array index for saturation pressure over ice.
Definition: mptrac.h:2354
double chemgrid_lon0
Lower longitude of chemistry grid [deg].
Definition: mptrac.h:2823
int bound_pbl
Boundary conditions planetary boundary layer (0=no, 1=yes).
Definition: mptrac.h:2724
int qnt_mloss_wet
Quantity array index for total mass loss due to wet deposition.
Definition: mptrac.h:2339
int met_geopot_sx
Longitudinal smoothing of geopotential heights.
Definition: mptrac.h:2583
int met_sy
Smoothing for latitudes.
Definition: mptrac.h:2565
int qnt_ps
Quantity array index for surface pressure.
Definition: mptrac.h:2201
int rng_type
Random number generator (0=GSL, 1=Squares, 2=cuRAND).
Definition: mptrac.h:2646
int isosurf
Isosurface parameter (0=none, 1=pressure, 2=density, 3=theta, 4=balloon).
Definition: mptrac.h:2634
double bound_p1
Boundary conditions top pressure [hPa].
Definition: mptrac.h:2712
int qnt_zs
Quantity array index for surface geopotential height.
Definition: mptrac.h:2207
int prof_nz
Number of altitudes of gridded profile data.
Definition: mptrac.h:3049
double csi_dt_out
Time step for CSI output [s].
Definition: mptrac.h:2944
int met_cape
Convective available potential energy data (0=file, 1=calculate).
Definition: mptrac.h:2592
double csi_modmin
Minimum column density to trigger detection [kg/m^2].
Definition: mptrac.h:2953
int met_sx
Smoothing for longitudes.
Definition: mptrac.h:2562
double chemgrid_lon1
Upper longitude of chemistry grid [deg].
Definition: mptrac.h:2826
double turb_mesox
Horizontal scaling factor for mesoscale wind fluctuations.
Definition: mptrac.h:2670
double met_cms_eps_iwc
cmultiscale compression epsilon for cloud ice water content.
Definition: mptrac.h:2544
double met_cms_eps_swc
cmultiscale compression epsilon for cloud snow water content.
Definition: mptrac.h:2547
int met_zfp_prec
ZFP compression precision for all variables, except z and T.
Definition: mptrac.h:2498
double met_cms_eps_v
cmultiscale compression epsilon for meridional wind.
Definition: mptrac.h:2523
double prof_z0
Lower altitude of gridded profile data [km].
Definition: mptrac.h:3052
int qnt_w
Quantity array index for vertical velocity.
Definition: mptrac.h:2264
double bound_vmr
Boundary conditions volume mixing ratio [ppv].
Definition: mptrac.h:2697
double met_tropo_pv
Dynamical tropopause potential vorticity threshold [PVU].
Definition: mptrac.h:2608
int prof_nx
Number of longitudes of gridded profile data.
Definition: mptrac.h:3058
int qnt_stat
Quantity array index for station flag.
Definition: mptrac.h:2186
int met_tropo
Tropopause definition (0=none, 1=clim, 2=cold point, 3=WMO_1st, 4=WMO_2nd, 5=dynamical).
Definition: mptrac.h:2605
int qnt_rp
Quantity array index for particle radius.
Definition: mptrac.h:2195
int met_mpi_share
Use MPI to share meteo (0=no, 1=yes).
Definition: mptrac.h:2623
double mixing_strat
Interparcel exchange parameter for mixing in the stratosphere.
Definition: mptrac.h:2781
int qnt_vz
Quantity array index for vertical velocity.
Definition: mptrac.h:2387
int qnt_ho2
Quantity array index for HO2 volume mixing ratio (climatology).
Definition: mptrac.h:2324
double csi_z1
Upper altitude of gridded CSI data [km].
Definition: mptrac.h:2962
double stat_t0
Start time for station output [s].
Definition: mptrac.h:3103
double oh_chem_beta
Beta parameter for diurnal variablity of OH.
Definition: mptrac.h:2844
double wet_depo_so2_ph
pH value used to calculate effective Henry constant of SO2.
Definition: mptrac.h:2880
double mixing_z0
Lower altitude of mixing grid [km].
Definition: mptrac.h:2787
int qnt_mloss_decay
Quantity array index for total mass loss due to exponential decay.
Definition: mptrac.h:2345
int atm_type_out
Type of atmospheric data files for output (-1=same as ATM_TYPE, 0=ASCII, 1=binary,...
Definition: mptrac.h:2926
double dt_kpp
Time step for KPP chemistry [s].
Definition: mptrac.h:2853
double dry_depo_dp
Dry deposition surface layer [hPa].
Definition: mptrac.h:2889
int qnt_shf
Quantity array index for surface sensible heat flux.
Definition: mptrac.h:2222
int qnt_vs
Quantity array index for surface meridional wind.
Definition: mptrac.h:2213
int qnt_Cco
Quantity array index for CO volume mixing ratio (chemistry code).
Definition: mptrac.h:2414
double vtk_dt_out
Time step for VTK data output [s].
Definition: mptrac.h:3112
double t_stop
Stop time of simulation [s].
Definition: mptrac.h:2459
double conv_dt
Time interval for convection module [s].
Definition: mptrac.h:2688
int qnt_hno3
Quantity array index for HNO3 volume mixing ratio (climatology).
Definition: mptrac.h:2315
int met_clams
Read MPTRAC or CLaMS meteo data (0=MPTRAC, 1=CLaMS).
Definition: mptrac.h:2486
int qnt_h2ot
Quantity array index for tropopause water vapor volume mixing ratio.
Definition: mptrac.h:2243
int qnt_rh
Quantity array index for relative humidity over water.
Definition: mptrac.h:2363
double met_cms_eps_cc
cmultiscale compression epsilon for cloud cover.
Definition: mptrac.h:2550
double bound_lat0
Boundary conditions minimum longitude [deg].
Definition: mptrac.h:2703
double met_pbl_max
Maximum depth of planetary boundary layer [km].
Definition: mptrac.h:2601
int met_dx
Stride for longitudes.
Definition: mptrac.h:2553
int mixing_ny
Number of latitudes of mixing grid.
Definition: mptrac.h:2802
int met_convention
Meteo data layout (0=[lev, lat, lon], 1=[lon, lat, lev]).
Definition: mptrac.h:2475
int qnt_zeta_d
Quantity array index for diagnosed zeta vertical coordinate.
Definition: mptrac.h:2375
int tracer_chem
Switch for first order tracer chemistry module (0=off, 1=on).
Definition: mptrac.h:2856
double dt_mod
Time step of simulation [s].
Definition: mptrac.h:2462
int diffusion
Diffusion scheme (0=off, 1=fixed-K, 2=PBL).
Definition: mptrac.h:2649
int qnt_tnat
Quantity array index for T_NAT.
Definition: mptrac.h:2402
int qnt_tice
Quantity array index for T_ice.
Definition: mptrac.h:2396
int qnt_zg
Quantity array index for geopotential height.
Definition: mptrac.h:2246
double vtk_offset
Vertical offset for VTK data [km].
Definition: mptrac.h:3121
int qnt_v
Quantity array index for meridional wind.
Definition: mptrac.h:2261
int qnt_mloss_dry
Quantity array index for total mass loss due to dry deposition.
Definition: mptrac.h:2342
double bound_vmr_trend
Boundary conditions volume mixing ratio trend [ppv/s].
Definition: mptrac.h:2700
int met_cache
Preload meteo data into disk cache (0=no, 1=yes).
Definition: mptrac.h:2620
int qnt_oh
Quantity array index for OH volume mixing ratio (climatology).
Definition: mptrac.h:2318
int qnt_Ch
Quantity array index for H volume mixing ratio (chemistry code).
Definition: mptrac.h:2420
int met_press_level_def
Use predefined pressure levels or not.
Definition: mptrac.h:2580
int oh_chem_reaction
Reaction type for OH chemistry (0=none, 2=bimolecular, 3=termolecular).
Definition: mptrac.h:2838
int qnt_h2o
Quantity array index for water vapor volume mixing ratio.
Definition: mptrac.h:2267
int prof_ny
Number of latitudes of gridded profile data.
Definition: mptrac.h:3067
int qnt_rhice
Quantity array index for relative humidity over ice.
Definition: mptrac.h:2366
int qnt_rho
Quantity array index for density of air.
Definition: mptrac.h:2255
double sample_dz
Layer depth for sample output [km].
Definition: mptrac.h:3088
double tdec_strat
Life time of particles in the stratosphere [s].
Definition: mptrac.h:2736
int obs_type
Type of observation data files (0=ASCII, 1=netCDF).
Definition: mptrac.h:2935
double met_cms_eps_lwc
cmultiscale compression epsilon for cloud liquid water content.
Definition: mptrac.h:2538
int qnt_us
Quantity array index for surface zonal wind.
Definition: mptrac.h:2210
double met_cms_eps_z
cmultiscale compression epsilon for geopotential height.
Definition: mptrac.h:2514
double grid_lon1
Upper longitude of gridded data [deg].
Definition: mptrac.h:3028
int qnt_Cn2o
Quantity array index for N2O volume mixing ratio (chemistry code).
Definition: mptrac.h:2444
int qnt_Cccl3f
Quantity array index for CFC-11 volume mixing ratio (chemistry code).
Definition: mptrac.h:2438
double mixing_lat0
Lower latitude of mixing grid [deg].
Definition: mptrac.h:2805
int qnt_pt
Quantity array index for tropopause pressure.
Definition: mptrac.h:2234
int qnt_cl
Quantity array index for total column cloud water.
Definition: mptrac.h:2294
int advect
Advection scheme (0=off, 1=Euler, 2=midpoint, 4=Runge-Kutta).
Definition: mptrac.h:2640
double prof_z1
Upper altitude of gridded profile data [km].
Definition: mptrac.h:3055
int qnt_t
Quantity array index for temperature.
Definition: mptrac.h:2252
int atm_filter
Time filter for atmospheric data output (0=none, 1=missval, 2=remove).
Definition: mptrac.h:2914
int kpp_chem
Switch for KPP chemistry module (0=off, 1=on).
Definition: mptrac.h:2850
int qnt_zeta
Quantity array index for zeta vertical coordinate.
Definition: mptrac.h:2372
double conv_pbl_trans
Depth of PBL transition layer (fraction of PBL depth).
Definition: mptrac.h:2679
int met_vert_coord
Vertical coordinate of input meteo data (0=pressure-level, 1=model-level_pfield, 2=model-level_abcoef...
Definition: mptrac.h:2479
double csi_z0
Lower altitude of gridded CSI data [km].
Definition: mptrac.h:2959
int qnt_lapse
Quantity array index for lapse rate.
Definition: mptrac.h:2381
double stat_lat
Latitude of station [deg].
Definition: mptrac.h:3097
int qnt_Cho2
Quantity array index for HO2 volume mixing ratio (chemistry code).
Definition: mptrac.h:2423
int grid_ny
Number of latitudes of gridded data.
Definition: mptrac.h:3031
int qnt_Csf6
Quantity array index for SF6 volume mixing ratio (chemistry code).
Definition: mptrac.h:2447
int qnt_Ch2o
Quantity array index for H2O volume mixing ratio (chemistry code).
Definition: mptrac.h:2408
double met_detrend
FWHM of horizontal Gaussian used for detrending [km].
Definition: mptrac.h:2571
int conv_mix_pbl
Vertical mixing in the PBL (0=off, 1=on).
Definition: mptrac.h:2676
double bound_dps
Boundary conditions surface layer depth [hPa].
Definition: mptrac.h:2715
double met_cms_eps_t
cmultiscale compression epsilon for temperature.
Definition: mptrac.h:2517
int chemgrid_nz
Number of altitudes of chemistry grid.
Definition: mptrac.h:2811
int qnt_cape
Quantity array index for convective available potential energy (CAPE).
Definition: mptrac.h:2306
double bound_mass_trend
Boundary conditions mass per particle trend [kg/s].
Definition: mptrac.h:2694
int mixing_nz
Number of altitudes of mixing grid.
Definition: mptrac.h:2784
int qnt_o3c
Quantity array index for total column ozone.
Definition: mptrac.h:2312
double bound_p0
Boundary conditions bottom pressure [hPa].
Definition: mptrac.h:2709
double mixing_lon0
Lower longitude of mixing grid [deg].
Definition: mptrac.h:2796
int qnt_Co3
Quantity array index for O3 volume mixing ratio (chemistry code).
Definition: mptrac.h:2411
int qnt_tsts
Quantity array index for T_STS.
Definition: mptrac.h:2399
int grid_nz
Number of altitudes of gridded data.
Definition: mptrac.h:3013
int qnt_nss
Quantity array index for northward turbulent surface stress.
Definition: mptrac.h:2219
double ens_dt_out
Time step for ensemble output [s].
Definition: mptrac.h:2986
int atm_stride
Particle index stride for atmospheric data files.
Definition: mptrac.h:2917
int met_relhum
Try to read relative humidity (0=no, 1=yes).
Definition: mptrac.h:2589
double mixing_lat1
Upper latitude of mixing grid [deg].
Definition: mptrac.h:2808
double atm_dt_out
Time step for atmospheric data output [s].
Definition: mptrac.h:2911
double prof_lat1
Upper latitude of gridded profile data [deg].
Definition: mptrac.h:3073
int met_cms_batch
cmultiscale batch size.
Definition: mptrac.h:2507
double psc_h2o
H2O volume mixing ratio for PSC analysis.
Definition: mptrac.h:2895
int met_sp
Smoothing for pressure levels.
Definition: mptrac.h:2568
double prof_lon0
Lower longitude of gridded profile data [deg].
Definition: mptrac.h:3061
int chemgrid_nx
Number of longitudes of chemistry grid.
Definition: mptrac.h:2820
int qnt_pct
Quantity array index for cloud top pressure.
Definition: mptrac.h:2288
int qnt_mloss_kpp
Quantity array index for total mass loss due to KPP chemistry.
Definition: mptrac.h:2336
int qnt_psat
Quantity array index for saturation pressure over water.
Definition: mptrac.h:2351
double prof_lat0
Lower latitude of gridded profile data [deg].
Definition: mptrac.h:3070
int qnt_cin
Quantity array index for convective inhibition (CIN).
Definition: mptrac.h:2309
double psc_hno3
HNO3 volume mixing ratio for PSC analysis.
Definition: mptrac.h:2898
double prof_lon1
Upper longitude of gridded profile data [deg].
Definition: mptrac.h:3064
double met_cms_eps_rwc
cmultiscale compression epsilon for cloud rain water content.
Definition: mptrac.h:2541
int met_nc_quant
Number of digits for quantization of netCDF meteo files (0=off).
Definition: mptrac.h:2495
int h2o2_chem_reaction
Reaction type for H2O2 chemistry (0=none, 1=SO2).
Definition: mptrac.h:2847
int qnt_Co3p
Quantity array index for O(3P) volume mixing ratio (chemistry code).
Definition: mptrac.h:2432
double wet_depo_bc_ret_ratio
Coefficients for wet deposition below cloud: retention ratio.
Definition: mptrac.h:2886
int chemgrid_ny
Number of latitudes of chemistry grid.
Definition: mptrac.h:2829
double met_cms_eps_o3
cmultiscale compression epsilon for ozone.
Definition: mptrac.h:2535
int grid_sparse
Sparse output in grid data files (0=no, 1=yes).
Definition: mptrac.h:3001
double dry_depo_vdep
Dry deposition velocity [m/s].
Definition: mptrac.h:2892
int qnt_tt
Quantity array index for tropopause temperature.
Definition: mptrac.h:2237
int met_np
Number of target pressure levels.
Definition: mptrac.h:2574
int qnt_ens
Quantity array index for ensemble IDs.
Definition: mptrac.h:2183
int met_nc_level
zlib compression level of netCDF meteo files (0=off).
Definition: mptrac.h:2492
double met_zfp_tol_t
ZFP compression tolerance for temperature.
Definition: mptrac.h:2501
double mixing_dt
Time interval for mixing [s].
Definition: mptrac.h:2775
int qnt_mloss_h2o2
Quantity array index for total mass loss due to H2O2 chemistry.
Definition: mptrac.h:2333
double met_zfp_tol_z
ZFP compression tolerance for geopotential height.
Definition: mptrac.h:2504
double vtk_scale
Vertical scaling factor for VTK data.
Definition: mptrac.h:3118
double met_cms_eps_w
cmultiscale compression epsilon for vertical velocity.
Definition: mptrac.h:2526
double turb_dx_pbl
Horizontal turbulent diffusion coefficient (PBL) [m^2/s].
Definition: mptrac.h:2652
double conv_cin
CIN threshold for convection module [J/kg].
Definition: mptrac.h:2685
int qnt_pv
Quantity array index for potential vorticity.
Definition: mptrac.h:2390
int advect_vert_coord
Vertical coordinate of air parcels (0=pressure, 1=zeta, 2=eta).
Definition: mptrac.h:2643
int qnt_mloss_oh
Quantity array index for total mass loss due to OH chemistry.
Definition: mptrac.h:2330
int qnt_Ch2o2
Quantity array index for H2O2 volume mixing ratio (chemistry code).
Definition: mptrac.h:2426
int qnt_sst
Quantity array index for sea surface temperature.
Definition: mptrac.h:2228
double mixing_lon1
Upper longitude of mixing grid [deg].
Definition: mptrac.h:2799
int atm_nc_level
zlib compression level of netCDF atmospheric data files (0=off).
Definition: mptrac.h:2929
int met_cms_heur
cmultiscale coarsening heuristics (0=default, 1=mean diff, 2=median diff, 3=max diff).
Definition: mptrac.h:2511
double wet_depo_ic_ret_ratio
Coefficients for wet deposition in cloud: retention ratio.
Definition: mptrac.h:2883
int qnt_sh
Quantity array index for specific humidity.
Definition: mptrac.h:2360
int qnt_ess
Quantity array index for eastward turbulent surface stress.
Definition: mptrac.h:2216
double wet_depo_ic_b
Coefficient B for wet deposition in cloud (exponential form).
Definition: mptrac.h:2871
double wet_depo_bc_b
Coefficient B for wet deposition below cloud (exponential form).
Definition: mptrac.h:2865
int met_dy
Stride for latitudes.
Definition: mptrac.h:2556
int qnt_Cx
Quantity array index for trace species x volume mixing ratio (chemistry code).
Definition: mptrac.h:2405
double turb_dz_strat
Vertical turbulent diffusion coefficient (stratosphere) [m^2/s].
Definition: mptrac.h:2667
double bound_zetas
Boundary conditions surface layer zeta [K].
Definition: mptrac.h:2721
int qnt_idx
Quantity array index for air parcel IDs.
Definition: mptrac.h:2180
double met_tropo_theta
Dynamical tropopause potential temperature threshold [K].
Definition: mptrac.h:2611
int qnt_rwc
Quantity array index for cloud rain water content.
Definition: mptrac.h:2276
double t_start
Start time of simulation [s].
Definition: mptrac.h:2456
int nq
Number of quantities.
Definition: mptrac.h:2165
double tdec_trop
Life time of particles in the troposphere [s].
Definition: mptrac.h:2733
double sample_dx
Horizontal radius for sample output [km].
Definition: mptrac.h:3085
int vtk_stride
Particle index stride for VTK data.
Definition: mptrac.h:3115
double turb_dz_pbl
Vertical turbulent diffusion coefficient (PBL) [m^2/s].
Definition: mptrac.h:2661
double grid_lat1
Upper latitude of gridded data [deg].
Definition: mptrac.h:3037
int qnt_zt
Quantity array index for tropopause geopotential height.
Definition: mptrac.h:2240
int met_type
Type of meteo data files (0=netCDF, 1=binary, 2=pck, 3=zfp, 4=zstd, 5=cms).
Definition: mptrac.h:2483
int qnt_cc
Quantity array index for cloud cover.
Definition: mptrac.h:2285
int qnt_plcl
Quantity array index for pressure at lifted condensation level (LCL).
Definition: mptrac.h:2297
double grid_dt_out
Time step for gridded data output [s].
Definition: mptrac.h:2998
int qnt_tdew
Quantity array index for dew point temperature.
Definition: mptrac.h:2393
Meteo data structure.
Definition: mptrac.h:3363
int nx
Number of longitudes.
Definition: mptrac.h:3369
int ny
Number of latitudes.
Definition: mptrac.h:3372
int np
Number of pressure levels.
Definition: mptrac.h:3375
int npl
Number of model levels.
Definition: mptrac.h:3378
double time
Time [s].
Definition: mptrac.h:3366