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
108#ifndef LIBTRAC_H
109#define LIBTRAC_H
110
111/* ------------------------------------------------------------
112 Includes...
113 ------------------------------------------------------------ */
114
115#include <ctype.h>
116#include <gsl/gsl_fft_complex.h>
117#include <gsl/gsl_math.h>
118#include <gsl/gsl_randist.h>
119#include <gsl/gsl_rng.h>
120#include <gsl/gsl_spline.h>
121#include <gsl/gsl_statistics.h>
122#include <math.h>
123#include <netcdf.h>
124#include <omp.h>
125#include <stdint.h>
126#include <stdio.h>
127#include <stdlib.h>
128#include <string.h>
129#include <time.h>
130#include <sys/time.h>
131
132#ifdef MPI
133#include "mpi.h"
134#endif
135
136#ifdef _OPENACC
137#include "openacc.h"
138#endif
139
140#ifdef CURAND
141#include "curand.h"
142#endif
143
144#ifdef ZFP
145#include "zfp.h"
146#endif
147
148#ifdef ZSTD
149#include "zstd.h"
150#endif
151
152#ifdef CMS
153#include "cmultiscale.h"
154#endif
155
156#ifdef KPP
157#include "chem_Parameters.h"
158#include "chem_Global.h"
159#include "chem_Sparse.h"
160#endif
161
162/* ------------------------------------------------------------
163 Constants...
164 ------------------------------------------------------------ */
165
167#ifndef AVO
168#define AVO 6.02214076e23
169#endif
170
172#ifndef CPD
173#define CPD 1003.5
174#endif
175
177#ifndef EPS
178#define EPS (MH2O / MA)
179#endif
180
182#ifndef G0
183#define G0 9.80665
184#endif
185
187#ifndef H0
188#define H0 7.0
189#endif
190
192#ifndef LV
193#define LV 2501000.
194#endif
195
197#ifndef KARMAN
198#define KARMAN 0.40
199#endif
200
202#ifndef KB
203#define KB 1.3806504e-23
204#endif
205
207#ifndef MA
208#define MA 28.9644
209#endif
210
212#ifndef MH2O
213#define MH2O 18.01528
214#endif
215
217#ifndef MO3
218#define MO3 48.00
219#endif
220
222#ifndef P0
223#define P0 1013.25
224#endif
225
227#ifndef RA
228#define RA (1e3 * RI / MA)
229#endif
230
232#ifndef RE
233#define RE 6367.421
234#endif
235
237#ifndef RI
238#define RI 8.3144598
239#endif
240
242#ifndef T0
243#define T0 273.15
244#endif
245
246/* ------------------------------------------------------------
247 Dimensions...
248 ------------------------------------------------------------ */
249
251#ifndef LEN
252#define LEN 5000
253#endif
254
256#ifndef NP
257#define NP 10000000
258#endif
259
261#ifndef NQ
262#define NQ 15
263#endif
264
266#ifndef NCSI
267#define NCSI 1000000
268#endif
269
271#ifndef EP
272#define EP 140
273#endif
274
276#ifndef EX
277#define EX 1202
278#endif
279
281#ifndef EY
282#define EY 602
283#endif
284
286#ifndef NENS
287#define NENS 2000
288#endif
289
291#ifndef NOBS
292#define NOBS 10000000
293#endif
294
296#ifndef NTHREADS
297#define NTHREADS 512
298#endif
299
301#ifndef CY
302#define CY 250
303#endif
304
306#ifndef CO3
307#define CO3 30
308#endif
309
311#ifndef CP
312#define CP 70
313#endif
314
316#ifndef CSZA
317#define CSZA 50
318#endif
319
321#ifndef CT
322#define CT 12
323#endif
324
326#ifndef CTS
327#define CTS 1000
328#endif
329
330/* ------------------------------------------------------------
331 Macros...
332 ------------------------------------------------------------ */
333
353#ifdef _OPENACC
354#define ALLOC(ptr, type, n) \
355 if(acc_get_num_devices(acc_device_nvidia) <= 0) \
356 ERRMSG("Not running on a GPU device!"); \
357 if((ptr=calloc((size_t)(n), sizeof(type)))==NULL) \
358 ERRMSG("Out of memory!");
359#else
360#define ALLOC(ptr, type, n) \
361 if((ptr=calloc((size_t)(n), sizeof(type)))==NULL) \
362 ERRMSG("Out of memory!");
363#endif
364
383#define ARRAY_2D(ix, iy, ny) \
384 ((ix) * (ny) + (iy))
385
402#define ARRAY_3D(ix, iy, ny, iz, nz) \
403 (((ix)*(ny) + (iy)) * (nz) + (iz))
404
427#define ARRHENIUS(a, b, t) \
428 ((a) * exp( -(b) / (t)))
429
451#define DEG2DX(dlon, lat) \
452 (RE * DEG2RAD(dlon) * cos(DEG2RAD(lat)))
453
472#define DEG2DY(dlat) \
473 (RE * DEG2RAD(dlat))
474
489#define DEG2RAD(deg) \
490 ((deg) * (M_PI / 180.0))
491
514#define DP2DZ(dp, p) \
515 (- (dp) * H0 / (p))
516
536#define DX2DEG(dx, lat) \
537 (((lat) < -89.999 || (lat) > 89.999) ? 0 \
538 : (dx) * 180. / (M_PI * RE * cos(DEG2RAD(lat))))
539
554#define DY2DEG(dy) \
555 ((dy) * 180. / (M_PI * RE))
556
573#define DZ2DP(dz, p) \
574 (-(dz) * (p) / H0)
575
589#define DIST(a, b) \
590 sqrt(DIST2(a, b))
591
605#define DIST2(a, b) \
606 ((a[0]-b[0])*(a[0]-b[0])+(a[1]-b[1])*(a[1]-b[1])+(a[2]-b[2])*(a[2]-b[2]))
607
621#define DOTP(a, b) \
622 (a[0]*b[0]+a[1]*b[1]+a[2]*b[2])
623
640#define FMOD(x, y) \
641 ((x) - (int) ((x) / (y)) * (y))
642
658#define FREAD(ptr, type, size, in) { \
659 if(fread(ptr, sizeof(type), size, in)!=size) \
660 ERRMSG("Error while reading!"); \
661 }
662
678#define FWRITE(ptr, type, size, out) { \
679 if(fwrite(ptr, sizeof(type), size, out)!=size) \
680 ERRMSG("Error while writing!"); \
681 }
682
693#define INTPOL_INIT \
694 double cw[4] = {0.0, 0.0, 0.0, 0.0}; int ci[3] = {0, 0, 0};
695
707#define INTPOL_2D(var, init) \
708 intpol_met_time_2d(met0, met0->var, met1, met1->var, \
709 atm->time[ip], atm->lon[ip], atm->lat[ip], \
710 &var, ci, cw, init);
711
724#define INTPOL_3D(var, init) \
725 intpol_met_time_3d(met0, met0->var, met1, met1->var, \
726 atm->time[ip], atm->p[ip], \
727 atm->lon[ip], atm->lat[ip], \
728 &var, ci, cw, init);
729
743#define INTPOL_SPACE_ALL(p, lon, lat) { \
744 intpol_met_space_3d(met, met->z, p, lon, lat, &z, ci, cw, 1); \
745 intpol_met_space_3d(met, met->t, p, lon, lat, &t, ci, cw, 0); \
746 intpol_met_space_3d(met, met->u, p, lon, lat, &u, ci, cw, 0); \
747 intpol_met_space_3d(met, met->v, p, lon, lat, &v, ci, cw, 0); \
748 intpol_met_space_3d(met, met->w, p, lon, lat, &w, ci, cw, 0); \
749 intpol_met_space_3d(met, met->pv, p, lon, lat, &pv, ci, cw, 0); \
750 intpol_met_space_3d(met, met->h2o, p, lon, lat, &h2o, ci, cw, 0); \
751 intpol_met_space_3d(met, met->o3, p, lon, lat, &o3, ci, cw, 0); \
752 intpol_met_space_3d(met, met->lwc, p, lon, lat, &lwc, ci, cw, 0); \
753 intpol_met_space_3d(met, met->rwc, p, lon, lat, &rwc, ci, cw, 0); \
754 intpol_met_space_3d(met, met->iwc, p, lon, lat, &iwc, ci, cw, 0); \
755 intpol_met_space_3d(met, met->swc, p, lon, lat, &swc, ci, cw, 0); \
756 intpol_met_space_3d(met, met->cc, p, lon, lat, &cc, ci, cw, 0); \
757 intpol_met_space_2d(met, met->ps, lon, lat, &ps, ci, cw, 0); \
758 intpol_met_space_2d(met, met->ts, lon, lat, &ts, ci, cw, 0); \
759 intpol_met_space_2d(met, met->zs, lon, lat, &zs, ci, cw, 0); \
760 intpol_met_space_2d(met, met->us, lon, lat, &us, ci, cw, 0); \
761 intpol_met_space_2d(met, met->vs, lon, lat, &vs, ci, cw, 0); \
762 intpol_met_space_2d(met, met->ess, ess, lat, &ess, ci, cw, 0); \
763 intpol_met_space_2d(met, met->nss, nss, lat, &nss, ci, cw, 0); \
764 intpol_met_space_2d(met, met->shf, shf, lat, &shf, ci, cw, 0); \
765 intpol_met_space_2d(met, met->lsm, lon, lat, &lsm, ci, cw, 0); \
766 intpol_met_space_2d(met, met->sst, lon, lat, &sst, ci, cw, 0); \
767 intpol_met_space_2d(met, met->pbl, lon, lat, &pbl, ci, cw, 0); \
768 intpol_met_space_2d(met, met->pt, lon, lat, &pt, ci, cw, 0); \
769 intpol_met_space_2d(met, met->tt, lon, lat, &tt, ci, cw, 0); \
770 intpol_met_space_2d(met, met->zt, lon, lat, &zt, ci, cw, 0); \
771 intpol_met_space_2d(met, met->h2ot, lon, lat, &h2ot, ci, cw, 0); \
772 intpol_met_space_2d(met, met->pct, lon, lat, &pct, ci, cw, 0); \
773 intpol_met_space_2d(met, met->pcb, lon, lat, &pcb, ci, cw, 0); \
774 intpol_met_space_2d(met, met->cl, lon, lat, &cl, ci, cw, 0); \
775 intpol_met_space_2d(met, met->plcl, lon, lat, &plcl, ci, cw, 0); \
776 intpol_met_space_2d(met, met->plfc, lon, lat, &plfc, ci, cw, 0); \
777 intpol_met_space_2d(met, met->pel, lon, lat, &pel, ci, cw, 0); \
778 intpol_met_space_2d(met, met->cape, lon, lat, &cape, ci, cw, 0); \
779 intpol_met_space_2d(met, met->cin, lon, lat, &cin, ci, cw, 0); \
780 intpol_met_space_2d(met, met->o3c, lon, lat, &o3c, ci, cw, 0); \
781 }
782
797#define INTPOL_TIME_ALL(time, p, lon, lat) { \
798 intpol_met_time_3d(met0, met0->z, met1, met1->z, time, p, lon, lat, &z, ci, cw, 1); \
799 intpol_met_time_3d(met0, met0->t, met1, met1->t, time, p, lon, lat, &t, ci, cw, 0); \
800 intpol_met_time_3d(met0, met0->u, met1, met1->u, time, p, lon, lat, &u, ci, cw, 0); \
801 intpol_met_time_3d(met0, met0->v, met1, met1->v, time, p, lon, lat, &v, ci, cw, 0); \
802 intpol_met_time_3d(met0, met0->w, met1, met1->w, time, p, lon, lat, &w, ci, cw, 0); \
803 intpol_met_time_3d(met0, met0->pv, met1, met1->pv, time, p, lon, lat, &pv, ci, cw, 0); \
804 intpol_met_time_3d(met0, met0->h2o, met1, met1->h2o, time, p, lon, lat, &h2o, ci, cw, 0); \
805 intpol_met_time_3d(met0, met0->o3, met1, met1->o3, time, p, lon, lat, &o3, ci, cw, 0); \
806 intpol_met_time_3d(met0, met0->lwc, met1, met1->lwc, time, p, lon, lat, &lwc, ci, cw, 0); \
807 intpol_met_time_3d(met0, met0->rwc, met1, met1->rwc, time, p, lon, lat, &rwc, ci, cw, 0); \
808 intpol_met_time_3d(met0, met0->iwc, met1, met1->iwc, time, p, lon, lat, &iwc, ci, cw, 0); \
809 intpol_met_time_3d(met0, met0->swc, met1, met1->swc, time, p, lon, lat, &swc, ci, cw, 0); \
810 intpol_met_time_3d(met0, met0->cc, met1, met1->cc, time, p, lon, lat, &cc, ci, cw, 0); \
811 intpol_met_time_2d(met0, met0->ps, met1, met1->ps, time, lon, lat, &ps, ci, cw, 0); \
812 intpol_met_time_2d(met0, met0->ts, met1, met1->ts, time, lon, lat, &ts, ci, cw, 0); \
813 intpol_met_time_2d(met0, met0->zs, met1, met1->zs, time, lon, lat, &zs, ci, cw, 0); \
814 intpol_met_time_2d(met0, met0->us, met1, met1->us, time, lon, lat, &us, ci, cw, 0); \
815 intpol_met_time_2d(met0, met0->vs, met1, met1->vs, time, lon, lat, &vs, ci, cw, 0); \
816 intpol_met_time_2d(met0, met0->ess, met1, met1->ess, time, lon, lat, &ess, ci, cw, 0); \
817 intpol_met_time_2d(met0, met0->nss, met1, met1->nss, time, lon, lat, &nss, ci, cw, 0); \
818 intpol_met_time_2d(met0, met0->shf, met1, met1->shf, time, lon, lat, &shf, ci, cw, 0); \
819 intpol_met_time_2d(met0, met0->lsm, met1, met1->lsm, time, lon, lat, &lsm, ci, cw, 0); \
820 intpol_met_time_2d(met0, met0->sst, met1, met1->sst, time, lon, lat, &sst, ci, cw, 0); \
821 intpol_met_time_2d(met0, met0->pbl, met1, met1->pbl, time, lon, lat, &pbl, ci, cw, 0); \
822 intpol_met_time_2d(met0, met0->pt, met1, met1->pt, time, lon, lat, &pt, ci, cw, 0); \
823 intpol_met_time_2d(met0, met0->tt, met1, met1->tt, time, lon, lat, &tt, ci, cw, 0); \
824 intpol_met_time_2d(met0, met0->zt, met1, met1->zt, time, lon, lat, &zt, ci, cw, 0); \
825 intpol_met_time_2d(met0, met0->h2ot, met1, met1->h2ot, time, lon, lat, &h2ot, ci, cw, 0); \
826 intpol_met_time_2d(met0, met0->pct, met1, met1->pct, time, lon, lat, &pct, ci, cw, 0); \
827 intpol_met_time_2d(met0, met0->pcb, met1, met1->pcb, time, lon, lat, &pcb, ci, cw, 0); \
828 intpol_met_time_2d(met0, met0->cl, met1, met1->cl, time, lon, lat, &cl, ci, cw, 0); \
829 intpol_met_time_2d(met0, met0->plcl, met1, met1->plcl, time, lon, lat, &plcl, ci, cw, 0); \
830 intpol_met_time_2d(met0, met0->plfc, met1, met1->plfc, time, lon, lat, &plfc, ci, cw, 0); \
831 intpol_met_time_2d(met0, met0->pel, met1, met1->pel, time, lon, lat, &pel, ci, cw, 0); \
832 intpol_met_time_2d(met0, met0->cape, met1, met1->cape, time, lon, lat, &cape, ci, cw, 0); \
833 intpol_met_time_2d(met0, met0->cin, met1, met1->cin, time, lon, lat, &cin, ci, cw, 0); \
834 intpol_met_time_2d(met0, met0->o3c, met1, met1->o3c, time, lon, lat, &o3c, ci, cw, 0); \
835 }
836
851#define LAPSE(p1, t1, p2, t2) \
852 (1e3 * G0 / RA * ((t2) - (t1)) / ((t2) + (t1)) \
853 * ((p2) + (p1)) / ((p2) - (p1)))
854
870#define LIN(x0, y0, x1, y1, x) \
871 ((y0)+((y1)-(y0))/((x1)-(x0))*((x)-(x0)))
872
897#define MAX(a,b) \
898 (((a)>(b))?(a):(b))
899
911#define MET_HEADER \
912 fprintf(out, \
913 "# $1 = time [s]\n" \
914 "# $2 = altitude [km]\n" \
915 "# $3 = longitude [deg]\n" \
916 "# $4 = latitude [deg]\n" \
917 "# $5 = pressure [hPa]\n" \
918 "# $6 = temperature [K]\n" \
919 "# $7 = zonal wind [m/s]\n" \
920 "# $8 = meridional wind [m/s]\n" \
921 "# $9 = vertical velocity [hPa/s]\n" \
922 "# $10 = H2O volume mixing ratio [ppv]\n"); \
923 fprintf(out, \
924 "# $11 = O3 volume mixing ratio [ppv]\n" \
925 "# $12 = geopotential height [km]\n" \
926 "# $13 = potential vorticity [PVU]\n" \
927 "# $14 = surface pressure [hPa]\n" \
928 "# $15 = surface temperature [K]\n" \
929 "# $16 = surface geopotential height [km]\n" \
930 "# $17 = surface zonal wind [m/s]\n" \
931 "# $18 = surface meridional wind [m/s]\n" \
932 "# $19 = eastward turbulent surface stress [N/m^2]\n" \
933 "# $20 = northward turbulent surface stress [N/m^2]\n"); \
934 fprintf(out, \
935 "# $21 = surface sensible heat flux [W/m^2]\n" \
936 "# $22 = land-sea mask [1]\n" \
937 "# $23 = sea surface temperature [K]\n" \
938 "# $24 = tropopause pressure [hPa]\n" \
939 "# $25 = tropopause geopotential height [km]\n" \
940 "# $26 = tropopause temperature [K]\n" \
941 "# $27 = tropopause water vapor [ppv]\n" \
942 "# $28 = cloud liquid water content [kg/kg]\n" \
943 "# $29 = cloud rain water content [kg/kg]\n" \
944 "# $30 = cloud ice water content [kg/kg]\n"); \
945 fprintf(out, \
946 "# $31 = cloud snow water content [kg/kg]\n" \
947 "# $32 = cloud cover [1]\n" \
948 "# $33 = total column cloud water [kg/m^2]\n" \
949 "# $34 = cloud top pressure [hPa]\n" \
950 "# $35 = cloud bottom pressure [hPa]\n" \
951 "# $36 = pressure at lifted condensation level (LCL) [hPa]\n" \
952 "# $37 = pressure at level of free convection (LFC) [hPa]\n" \
953 "# $38 = pressure at equilibrium level (EL) [hPa]\n" \
954 "# $39 = convective available potential energy (CAPE) [J/kg]\n" \
955 "# $40 = convective inhibition (CIN) [J/kg]\n"); \
956 fprintf(out, \
957 "# $41 = relative humidity over water [%%]\n" \
958 "# $42 = relative humidity over ice [%%]\n" \
959 "# $43 = dew point temperature [K]\n" \
960 "# $44 = frost point temperature [K]\n" \
961 "# $45 = NAT temperature [K]\n" \
962 "# $46 = HNO3 volume mixing ratio [ppv]\n" \
963 "# $47 = OH volume mixing ratio [ppv]\n" \
964 "# $48 = H2O2 volume mixing ratio [ppv]\n" \
965 "# $49 = HO2 volume mixing ratio [ppv]\n" \
966 "# $50 = O(1D) volume mixing ratio [ppv]\n"); \
967 fprintf(out, \
968 "# $51 = boundary layer pressure [hPa]\n" \
969 "# $52 = total column ozone [DU]\n" \
970 "# $53 = number of data points\n" \
971 "# $54 = number of tropopause data points\n" \
972 "# $55 = number of CAPE data points\n");
973
998#define MIN(a,b) \
999 (((a)<(b))?(a):(b))
1000
1013#define MOLEC_DENS(p,t) \
1014 (AVO * 1e-6 * ((p) * 100) / (RI * (t)))
1015
1027#define NC(cmd) { \
1028 int nc_result=(cmd); \
1029 if(nc_result!=NC_NOERR) \
1030 ERRMSG("%s", nc_strerror(nc_result)); \
1031 }
1032
1056#define NC_DEF_VAR(varname, type, ndims, dims, long_name, units, level, quant) { \
1057 NC(nc_def_var(ncid, varname, type, ndims, dims, &varid)); \
1058 NC(nc_put_att_text(ncid, varid, "long_name", strnlen(long_name, LEN), long_name)); \
1059 NC(nc_put_att_text(ncid, varid, "units", strnlen(units, LEN), units)); \
1060 if((quant) > 0) \
1061 NC(nc_def_var_quantize(ncid, varid, NC_QUANTIZE_GRANULARBR, quant)); \
1062 if((level) != 0) { \
1063 NC(nc_def_var_deflate(ncid, varid, 1, 1, level)); \
1064 /* unsigned int ulevel = (unsigned int)level; */ \
1065 /* NC(nc_def_var_filter(ncid, varid, 32015, 1, (unsigned int[]){ulevel})); */ \
1066 } \
1067 }
1068
1086#define NC_GET_DOUBLE(varname, ptr, force) { \
1087 if(force) { \
1088 NC(nc_inq_varid(ncid, varname, &varid)); \
1089 NC(nc_get_var_double(ncid, varid, ptr)); \
1090 } else { \
1091 if(nc_inq_varid(ncid, varname, &varid) == NC_NOERR) { \
1092 NC(nc_get_var_double(ncid, varid, ptr)); \
1093 } else \
1094 WARN("netCDF variable %s is missing!", varname); \
1095 } \
1096 }
1097
1114#define NC_INQ_DIM(dimname, ptr, min, max) { \
1115 int dimid; size_t naux; \
1116 NC(nc_inq_dimid(ncid, dimname, &dimid)); \
1117 NC(nc_inq_dimlen(ncid, dimid, &naux)); \
1118 *ptr = (int)naux; \
1119 if ((*ptr) < (min) || (*ptr) > (max)) \
1120 ERRMSG("Dimension %s is out of range!", dimname); \
1121 }
1122
1137#define NC_PUT_DOUBLE(varname, ptr, hyperslab) { \
1138 NC(nc_inq_varid(ncid, varname, &varid)); \
1139 if(hyperslab) { \
1140 NC(nc_put_vara_double(ncid, varid, start, count, ptr)); \
1141 } else { \
1142 NC(nc_put_var_double(ncid, varid, ptr)); \
1143 } \
1144 }
1145
1161#define NC_PUT_FLOAT(varname, ptr, hyperslab) { \
1162 NC(nc_inq_varid(ncid, varname, &varid)); \
1163 if(hyperslab) { \
1164 NC(nc_put_vara_float(ncid, varid, start, count, ptr)); \
1165 } else { \
1166 NC(nc_put_var_float(ncid, varid, ptr)); \
1167 } \
1168 }
1169
1184#define NC_PUT_INT(varname, ptr, hyperslab) { \
1185 NC(nc_inq_varid(ncid, varname, &varid)); \
1186 if(hyperslab) { \
1187 NC(nc_put_vara_int(ncid, varid, start, count, ptr)); \
1188 } else { \
1189 NC(nc_put_var_int(ncid, varid, ptr)); \
1190 } \
1191 }
1192
1206#define NC_PUT_ATT(varname, attname, text) { \
1207 NC(nc_inq_varid(ncid, varname, &varid)); \
1208 NC(nc_put_att_text(ncid, varid, attname, strnlen(text, LEN), text)); \
1209 }
1210
1223#define NC_PUT_ATT_GLOBAL(attname, text) \
1224 NC(nc_put_att_text(ncid, NC_GLOBAL, attname, strnlen(text, LEN), text));
1225
1243#define NN(x0, y0, x1, y1, x) \
1244 (fabs((x) - (x0)) <= fabs((x) - (x1)) ? (y0) : (y1))
1245
1258#define NORM(a) \
1259 sqrt(DOTP(a, a))
1260
1276#ifdef _OPENACC
1277#define PARTICLE_LOOP(ip0, ip1, check_dt, ...) \
1278 const int ip0_const = ip0; \
1279 const int ip1_const = ip1; \
1280 _Pragma(__VA_ARGS__) \
1281 _Pragma("acc parallel loop independent gang vector") \
1282 for (int ip = ip0_const; ip < ip1_const; ip++) \
1283 if (!check_dt || cache->dt[ip] != 0)
1284#else
1285#define PARTICLE_LOOP(ip0, ip1, check_dt, ...) \
1286 const int ip0_const = ip0; \
1287 const int ip1_const = ip1; \
1288 _Pragma("omp parallel for default(shared)") \
1289 for (int ip = ip0_const; ip < ip1_const; ip++) \
1290 if (!check_dt || cache->dt[ip] != 0)
1291#endif
1292
1315#define P(z) \
1316 (P0 * exp(-(z) / H0))
1317
1339#define PSAT(t) \
1340 (6.112 * exp(17.62 * ((t) - T0) / (243.12 + (t) - T0)))
1341
1363#define PSICE(t) \
1364 (6.112 * exp(22.46 * ((t) - T0) / (272.62 + (t) - T0)))
1365
1390#define PW(p, h2o) \
1391 ((p) * MAX((h2o), 0.1e-6) / (1. + (1. - EPS) * MAX((h2o), 0.1e-6)))
1392
1407#define RAD2DEG(rad) \
1408 ((rad) * (180.0 / M_PI))
1409
1437#define RH(p, t, h2o) \
1438 (PW(p, h2o) / PSAT(t) * 100.)
1439
1467#define RHICE(p, t, h2o) \
1468 (PW(p, h2o) / PSICE(t) * 100.)
1469
1492#define RHO(p, t) \
1493 (100. * (p) / (RA * (t)))
1494
1511#define SET_ATM(qnt, val) \
1512 if (ctl->qnt >= 0) \
1513 atm->q[ctl->qnt][ip] = val;
1514
1534#define SET_QNT(qnt, name, longname, unit) \
1535 if (strcasecmp(ctl->qnt_name[iq], name) == 0) { \
1536 ctl->qnt = iq; \
1537 sprintf(ctl->qnt_longname[iq], longname); \
1538 sprintf(ctl->qnt_unit[iq], unit); \
1539 } else
1540
1555#define SH(h2o) \
1556 (EPS * MAX((h2o), 0.1e-6))
1557
1568#define SQR(x) \
1569 ((x)*(x))
1570
1582#define SWAP(x, y, type) \
1583 do {type tmp = x; x = y; y = tmp;} while(0);
1584
1606#define TDEW(p, h2o) \
1607 (T0 + 243.12 * log(PW((p), (h2o)) / 6.112) \
1608 / (17.62 - log(PW((p), (h2o)) / 6.112)))
1609
1631#define TICE(p, h2o) \
1632 (T0 + 272.62 * log(PW((p), (h2o)) / 6.112) \
1633 / (22.46 - log(PW((p), (h2o)) / 6.112)))
1634
1655#define THETA(p, t) \
1656 ((t) * pow(1000. / (p), 0.286))
1657
1684#define THETAVIRT(p, t, h2o) \
1685 (TVIRT(THETA((p), (t)), MAX((h2o), 0.1e-6)))
1686
1705#define TOK(line, tok, format, var) { \
1706 if(((tok)=strtok((line), " \t"))) { \
1707 if(sscanf(tok, format, &(var))!=1) continue; \
1708 } else ERRMSG("Error while reading!"); \
1709 }
1710
1730#define TVIRT(t, h2o) \
1731 ((t) * (1. + (1. - EPS) * MAX((h2o), 0.1e-6)))
1732
1752#define Z(p) \
1753 (H0 * log(P0 / (p)))
1754
1783#define ZDIFF(lnp0, t0, h2o0, lnp1, t1, h2o1) \
1784 (RI / MA / G0 * 0.5 * (TVIRT((t0), (h2o0)) + TVIRT((t1), (h2o1))) \
1785 * ((lnp0) - (lnp1)))
1786
1802#define ZETA(ps, p, t) \
1803 (((p) / (ps) <= 0.3 ? 1. : \
1804 sin(M_PI / 2. * (1. - (p) / (ps)) / (1. - 0.3))) \
1805 * THETA((p), (t)))
1806
1807/* ------------------------------------------------------------
1808 Log messages...
1809 ------------------------------------------------------------ */
1810
1812#ifndef LOGLEV
1813#define LOGLEV 2
1814#endif
1815
1845#define LOG(level, ...) { \
1846 if(level >= 2) \
1847 printf(" "); \
1848 if(level <= LOGLEV) { \
1849 printf(__VA_ARGS__); \
1850 printf("\n"); \
1851 } \
1852 }
1853
1882#define WARN(...) { \
1883 printf("\nWarning (%s, %s, l%d): ", __FILE__, __func__, __LINE__); \
1884 LOG(0, __VA_ARGS__); \
1885 }
1886
1915#define ERRMSG(...) { \
1916 printf("\nError (%s, %s, l%d): ", __FILE__, __func__, __LINE__); \
1917 LOG(0, __VA_ARGS__); \
1918 exit(EXIT_FAILURE); \
1919 }
1920
1950#define PRINT(format, var) \
1951 printf("Print (%s, %s, l%d): %s= "format"\n", \
1952 __FILE__, __func__, __LINE__, #var, var);
1953
1954/* ------------------------------------------------------------
1955 Timers...
1956 ------------------------------------------------------------ */
1957
1959#define NTIMER 100
1960
1974#define PRINT_TIMERS \
1975 timer("END", "END", 1);
1976
1995#define SELECT_TIMER(id, group, color) { \
1996 NVTX_POP; \
1997 NVTX_PUSH(id, color); \
1998 timer(id, group, 0); \
1999 }
2000
2014#define START_TIMERS \
2015 NVTX_PUSH("START", NVTX_CPU);
2016
2029#define STOP_TIMERS \
2030 NVTX_POP;
2031
2032/* ------------------------------------------------------------
2033 NVIDIA Tools Extension (NVTX)...
2034 ------------------------------------------------------------ */
2035
2036#ifdef NVTX
2037#include "nvToolsExt.h"
2038
2040#define NVTX_CPU 0xFFADD8E6
2041
2043#define NVTX_GPU 0xFF00008B
2044
2046#define NVTX_H2D 0xFFFFFF00
2047
2049#define NVTX_D2H 0xFFFF8800
2050
2052#define NVTX_READ 0xFFFFCCCB
2053
2055#define NVTX_WRITE 0xFF8B0000
2056
2058#define NVTX_RECV 0xFFCCFFCB
2059
2061#define NVTX_SEND 0xFF008B00
2062
2092#define NVTX_PUSH(range_title, range_color) { \
2093 nvtxEventAttributes_t eventAttrib = {0}; \
2094 eventAttrib.version = NVTX_VERSION; \
2095 eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE; \
2096 eventAttrib.messageType = NVTX_MESSAGE_TYPE_ASCII; \
2097 eventAttrib.colorType = NVTX_COLOR_ARGB; \
2098 eventAttrib.color = range_color; \
2099 eventAttrib.message.ascii = range_title; \
2100 nvtxRangePushEx(&eventAttrib); \
2101 }
2102
2115#define NVTX_POP { \
2116 nvtxRangePop(); \
2117 }
2118#else
2119
2120/* Empty definitions of NVTX_PUSH and NVTX_POP... */
2121#define NVTX_PUSH(range_title, range_color) {}
2122#define NVTX_POP {}
2123#endif
2124
2125/* ------------------------------------------------------------
2126 Thrust...
2127 ------------------------------------------------------------ */
2128
2154 double *__restrict__ c,
2155 int n,
2156 int *__restrict__ index);
2157
2158/* ------------------------------------------------------------
2159 Structs...
2160 ------------------------------------------------------------ */
2161
2169typedef struct {
2170
2171 /* ------------------------------------------------------------
2172 Quantity parameters...
2173 ------------------------------------------------------------ */
2174
2176 int nq;
2177
2179 char qnt_name[NQ][LEN];
2180
2182 char qnt_longname[NQ][LEN];
2183
2185 char qnt_unit[NQ][LEN];
2186
2188 char qnt_format[NQ][LEN];
2189
2192
2195
2198
2201
2204
2207
2210
2213
2216
2219
2222
2225
2228
2231
2234
2237
2240
2243
2246
2249
2252
2255
2258
2261
2264
2267
2270
2273
2276
2279
2282
2285
2288
2291
2294
2297
2300
2303
2306
2309
2312
2315
2318
2321
2324
2327
2330
2333
2336
2339
2342
2345
2348
2351
2354
2357
2360
2363
2366
2369
2372
2375
2378
2381
2384
2387
2390
2393
2396
2399
2402
2405
2408
2411
2414
2417
2420
2423
2426
2429
2432
2435
2438
2441
2444
2447
2450
2453
2456
2459
2462
2465
2467 double t_start;
2468
2470 double t_stop;
2471
2473 double dt_mod;
2474
2475 /* ------------------------------------------------------------
2476 Meteo data parameters...
2477 ------------------------------------------------------------ */
2478
2480 char metbase[LEN];
2481
2483 double dt_met;
2484
2487
2491
2495
2498
2501
2504
2507
2510
2513
2516
2519
2522
2525
2529
2532
2535
2538
2541
2544
2547
2550
2553
2556
2559
2562
2565
2568
2571
2574
2577
2580
2583
2586
2589
2592
2594 double met_p[EP];
2595
2598
2601
2603 double met_lev_hyam[EP];
2604
2606 double met_lev_hybm[EP];
2607
2610
2613
2616
2619
2622
2625
2628
2632
2635
2638
2641
2644
2647
2650
2651 /* ------------------------------------------------------------
2652 Geophysical module parameters...
2653 ------------------------------------------------------------ */
2654
2656 double sort_dt;
2657
2661
2663 char balloon[LEN];
2664
2667
2671
2674
2677
2680
2683
2686
2689
2692
2695
2698
2701
2704
2707
2710
2712 double conv_cin;
2713
2715 double conv_dt;
2716
2719
2722
2725
2728
2731
2734
2736 double bound_p0;
2737
2739 double bound_p1;
2740
2743
2746
2749
2752
2754 char species[LEN];
2755
2757 double molmass;
2758
2761
2764
2767
2769 char clim_hno3_filename[LEN];
2770
2772 char clim_oh_filename[LEN];
2773
2775 char clim_h2o2_filename[LEN];
2776
2778 char clim_ho2_filename[LEN];
2779
2781 char clim_o1d_filename[LEN];
2782
2784 char clim_o3_filename[LEN];
2785
2787 char clim_ccl4_timeseries[LEN];
2788
2790 char clim_ccl3f_timeseries[LEN];
2791
2793 char clim_ccl2f2_timeseries[LEN];
2794
2796 char clim_n2o_timeseries[LEN];
2797
2799 char clim_sf6_timeseries[LEN];
2800
2803
2806
2809
2812
2815
2818
2821
2824
2827
2830
2833
2836
2839
2842
2845
2848
2851
2854
2857
2860
2863
2866
2868 double oh_chem[4];
2869
2872
2875
2878
2880 double dt_kpp;
2881
2884
2886 double wet_depo_pre[2];
2887
2890
2893
2896
2899
2901 double wet_depo_ic_h[2];
2902
2904 double wet_depo_bc_h[2];
2905
2908
2911
2914
2917
2920
2922 double psc_h2o;
2923
2925 double psc_hno3;
2926
2927 /* ------------------------------------------------------------
2928 Output parameters...
2929 ------------------------------------------------------------ */
2930
2932 char atm_basename[LEN];
2933
2935 char atm_gpfile[LEN];
2936
2939
2942
2945
2949
2954
2957
2959 int atm_nc_quant[NQ];
2960
2963
2965 char csi_basename[LEN];
2966
2968 char csi_kernel[LEN];
2969
2972
2974 char csi_obsfile[LEN];
2975
2978
2981
2984
2986 double csi_z0;
2987
2989 double csi_z1;
2990
2993
2995 double csi_lon0;
2996
2998 double csi_lon1;
2999
3002
3004 double csi_lat0;
3005
3007 double csi_lat1;
3008
3010 char ens_basename[LEN];
3011
3014
3016 char grid_basename[LEN];
3017
3019 char grid_kernel[LEN];
3020
3022 char grid_gpfile[LEN];
3023
3026
3029
3032
3034 int grid_nc_quant[NQ];
3035
3038
3041
3043 double grid_z0;
3044
3046 double grid_z1;
3047
3050
3053
3056
3059
3062
3065
3068
3070 char prof_basename[LEN];
3071
3073 char prof_obsfile[LEN];
3074
3077
3079 double prof_z0;
3080
3082 double prof_z1;
3083
3086
3089
3092
3095
3098
3101
3103 char sample_basename[LEN];
3104
3106 char sample_kernel[LEN];
3107
3109 char sample_obsfile[LEN];
3110
3113
3116
3118 char stat_basename[LEN];
3119
3121 double stat_lon;
3122
3124 double stat_lat;
3125
3127 double stat_r;
3128
3130 double stat_t0;
3131
3133 double stat_t1;
3134
3136 char vtk_basename[LEN];
3137
3140
3143
3146
3149
3152
3153} ctl_t;
3154
3163typedef struct {
3164
3166 int np;
3167
3169 double time[NP];
3170
3172 double p[NP];
3173
3175 double lon[NP];
3176
3178 double lat[NP];
3179
3181 double q[NQ][NP];
3182
3183} atm_t;
3184
3191typedef struct {
3192
3194 double iso_var[NP];
3195
3197 double iso_ps[NP];
3198
3200 double iso_ts[NP];
3201
3204
3206 float uvwp[NP][3];
3207
3209 double rs[3 * NP + 1];
3210
3212 double dt[NP];
3213
3214} cache_t;
3215
3223typedef struct {
3224
3226 int np;
3227
3229 int nsza;
3230
3232 int no3c;
3233
3235 double p[CP];
3236
3238 double sza[CSZA];
3239
3241 double o3c[CO3];
3242
3244 double n2o[CP][CSZA][CO3];
3245
3247 double ccl4[CP][CSZA][CO3];
3248
3250 double ccl3f[CP][CSZA][CO3];
3251
3253 double ccl2f2[CP][CSZA][CO3];
3254
3256 double o2[CP][CSZA][CO3];
3257
3259 double o3_1[CP][CSZA][CO3];
3260
3262 double o3_2[CP][CSZA][CO3];
3263
3265 double h2o2[CP][CSZA][CO3];
3266
3268 double h2o[CP][CSZA][CO3];
3269
3270} clim_photo_t;
3271
3279typedef struct {
3280
3283
3285 double time[CTS];
3286
3288 double vmr[CTS];
3289
3290} clim_ts_t;
3291
3299typedef struct {
3300
3303
3305 int nlat;
3306
3308 int np;
3309
3311 double time[CT];
3312
3314 double lat[CY];
3315
3317 double p[CP];
3318
3320 double vmr[CT][CP][CY];
3321
3322} clim_zm_t;
3323
3331typedef struct {
3332
3335
3338
3340 double tropo_time[12];
3341
3343 double tropo_lat[73];
3344
3346 double tropo[12][73];
3347
3350
3353
3356
3359
3362
3365
3368
3371
3374
3377
3380
3381} clim_t;
3382
3390typedef struct {
3391
3393 double time;
3394
3396 int nx;
3397
3399 int ny;
3400
3402 int np;
3403
3405 int npl;
3406
3408 double lon[EX];
3409
3411 double lat[EY];
3412
3414 double p[EP];
3415
3417 double hybrid[EP];
3418
3420 float ps[EX][EY];
3421
3423 float ts[EX][EY];
3424
3426 float zs[EX][EY];
3427
3429 float us[EX][EY];
3430
3432 float vs[EX][EY];
3433
3435 float ess[EX][EY];
3436
3438 float nss[EX][EY];
3439
3441 float shf[EX][EY];
3442
3444 float lsm[EX][EY];
3445
3447 float sst[EX][EY];
3448
3450 float pbl[EX][EY];
3451
3453 float pt[EX][EY];
3454
3456 float tt[EX][EY];
3457
3459 float zt[EX][EY];
3460
3462 float h2ot[EX][EY];
3463
3465 float pct[EX][EY];
3466
3468 float pcb[EX][EY];
3469
3471 float cl[EX][EY];
3472
3474 float plcl[EX][EY];
3475
3477 float plfc[EX][EY];
3478
3480 float pel[EX][EY];
3481
3483 float cape[EX][EY];
3484
3486 float cin[EX][EY];
3487
3489 float o3c[EX][EY];
3490
3492 float z[EX][EY][EP];
3493
3495 float t[EX][EY][EP];
3496
3498 float u[EX][EY][EP];
3499
3501 float v[EX][EY][EP];
3502
3504 float w[EX][EY][EP];
3505
3507 float pv[EX][EY][EP];
3508
3510 float h2o[EX][EY][EP];
3511
3513 float o3[EX][EY][EP];
3514
3516 float lwc[EX][EY][EP];
3517
3519 float rwc[EX][EY][EP];
3520
3522 float iwc[EX][EY][EP];
3523
3525 float swc[EX][EY][EP];
3526
3528 float cc[EX][EY][EP];
3529
3531 float pl[EX][EY][EP];
3532
3534 float ul[EX][EY][EP];
3535
3537 float vl[EX][EY][EP];
3538
3540 float wl[EX][EY][EP];
3541
3543 float zetal[EX][EY][EP];
3544
3546 float zeta_dotl[EX][EY][EP];
3547
3548} met_t;
3549
3550/* ------------------------------------------------------------
3551 OpenACC routines...
3552 ------------------------------------------------------------ */
3553
3554#ifdef _OPENACC
3555#pragma acc routine (clim_oh)
3556#pragma acc routine (clim_photo)
3557#pragma acc routine (clim_tropo)
3558#pragma acc routine (clim_ts)
3559#pragma acc routine (clim_zm)
3560#pragma acc routine (intpol_check_lon_lat)
3561#pragma acc routine (intpol_met_4d_coord)
3562#pragma acc routine (intpol_met_space_3d)
3563#pragma acc routine (intpol_met_space_3d_ml)
3564#pragma acc routine (intpol_met_space_2d)
3565#pragma acc routine (intpol_met_time_3d)
3566#pragma acc routine (intpol_met_time_3d_ml)
3567#pragma acc routine (intpol_met_time_2d)
3568#pragma acc routine (kernel_weight)
3569#pragma acc routine (lapse_rate)
3570#pragma acc routine (locate_irr)
3571#pragma acc routine (locate_irr_float)
3572#pragma acc routine (locate_reg)
3573#pragma acc routine (locate_vert)
3574#pragma acc routine (nat_temperature)
3575#pragma acc routine (pbl_weight)
3576#pragma acc routine (sedi)
3577#pragma acc routine (stddev)
3578#pragma acc routine (sza_calc)
3579#pragma acc routine (tropo_weight)
3580#endif
3581
3582/* ------------------------------------------------------------
3583 Functions...
3584 ------------------------------------------------------------ */
3585
3608 void *data,
3609 size_t N);
3610
3625void cart2geo(
3626 const double *x,
3627 double *z,
3628 double *lon,
3629 double *lat);
3630
3653double clim_oh(
3654 const ctl_t * ctl,
3655 const clim_t * clim,
3656 const double t,
3657 const double lon,
3658 const double lat,
3659 const double p);
3660
3680 const ctl_t * ctl,
3681 clim_t * clim);
3682
3712double clim_photo(
3713 const double rate[CP][CSZA][CO3],
3714 const clim_photo_t * photo,
3715 const double p,
3716 const double sza,
3717 const double o3c);
3718
3744double clim_tropo(
3745 const clim_t * clim,
3746 const double t,
3747 const double lat);
3748
3767void clim_tropo_init(
3768 clim_t * clim);
3769
3786double clim_ts(
3787 const clim_ts_t * ts,
3788 const double t);
3789
3811double clim_zm(
3812 const clim_zm_t * zm,
3813 const double t,
3814 const double lat,
3815 const double p);
3816
3858 const ctl_t * ctl,
3859 const char *varname,
3860 float *array,
3861 const size_t nx,
3862 const size_t ny,
3863 const size_t np,
3864 const int decompress,
3865 FILE * inout);
3866
3899void compress_pck(
3900 const char *varname,
3901 float *array,
3902 const size_t nxy,
3903 const size_t nz,
3904 const int decompress,
3905 FILE * inout);
3906
3946 const char *varname,
3947 float *array,
3948 const int nx,
3949 const int ny,
3950 const int nz,
3951 const int precision,
3952 const double tolerance,
3953 const int decompress,
3954 FILE * inout);
3955
3978 const char *varname,
3979 float *array,
3980 const size_t n,
3981 const int decompress,
3982 const int level,
3983 FILE * inout);
3984
4007void day2doy(
4008 const int year,
4009 const int mon,
4010 const int day,
4011 int *doy);
4012
4034void doy2day(
4035 const int year,
4036 const int doy,
4037 int *mon,
4038 int *day);
4039
4066void fft_help(
4067 double *fcReal,
4068 double *fcImag,
4069 const int n);
4070
4097void geo2cart(
4098 const double z,
4099 const double lon,
4100 const double lat,
4101 double *x);
4102
4127void get_met_help(
4128 const ctl_t * ctl,
4129 const double t,
4130 const int direct,
4131 const char *metbase,
4132 const double dt_met,
4133 char *filename);
4134
4158void get_met_replace(
4159 char *orig,
4160 char *search,
4161 char *repl);
4162
4199void get_tropo(
4200 const int met_tropo,
4201 ctl_t * ctl,
4202 clim_t * clim,
4203 met_t * met,
4204 const double *lons,
4205 const int nx,
4206 const double *lats,
4207 const int ny,
4208 double *pt,
4209 double *zt,
4210 double *tt,
4211 double *qt,
4212 double *o3t,
4213 double *ps,
4214 double *zs);
4215
4237 const double *lons,
4238 const int nlon,
4239 const double *lats,
4240 const int nlat,
4241 const double lon,
4242 const double lat,
4243 double *lon2,
4244 double *lat2);
4245
4288 const met_t * met0,
4289 float height0[EX][EY][EP],
4290 float array0[EX][EY][EP],
4291 const met_t * met1,
4292 float height1[EX][EY][EP],
4293 float array1[EX][EY][EP],
4294 const double ts,
4295 const double height,
4296 const double lon,
4297 const double lat,
4298 double *var,
4299 int *ci,
4300 double *cw,
4301 const int init);
4302
4338 const met_t * met,
4339 float array[EX][EY][EP],
4340 const double p,
4341 const double lon,
4342 const double lat,
4343 double *var,
4344 int *ci,
4345 double *cw,
4346 const int init);
4347
4367 const met_t * met,
4368 float zs[EX][EY][EP],
4369 float vals[EX][EY][EP],
4370 const double z,
4371 const double lon,
4372 const double lat,
4373 double *val);
4374
4410 const met_t * met,
4411 float array[EX][EY],
4412 const double lon,
4413 const double lat,
4414 double *var,
4415 int *ci,
4416 double *cw,
4417 const int init);
4418
4453 const met_t * met0,
4454 float array0[EX][EY][EP],
4455 const met_t * met1,
4456 float array1[EX][EY][EP],
4457 const double ts,
4458 const double p,
4459 const double lon,
4460 const double lat,
4461 double *var,
4462 int *ci,
4463 double *cw,
4464 const int init);
4465
4489 const met_t * met0,
4490 float zs0[EX][EY][EP],
4491 float array0[EX][EY][EP],
4492 const met_t * met1,
4493 float zs1[EX][EY][EP],
4494 float array1[EX][EY][EP],
4495 const double ts,
4496 const double p,
4497 const double lon,
4498 const double lat,
4499 double *var);
4500
4536 const met_t * met0,
4537 float array0[EX][EY],
4538 const met_t * met1,
4539 float array1[EX][EY],
4540 const double ts,
4541 const double lon,
4542 const double lat,
4543 double *var,
4544 int *ci,
4545 double *cw,
4546 const int init);
4547
4585void intpol_tropo_3d(
4586 const double time0,
4587 float array0[EX][EY],
4588 const double time1,
4589 float array1[EX][EY],
4590 const double lons[EX],
4591 const double lats[EY],
4592 const int nlon,
4593 const int nlat,
4594 const double time,
4595 const double lon,
4596 const double lat,
4597 const int method,
4598 double *var,
4599 double *sigma);
4600
4627void jsec2time(
4628 const double jsec,
4629 int *year,
4630 int *mon,
4631 int *day,
4632 int *hour,
4633 int *min,
4634 int *sec,
4635 double *remain);
4636
4663double kernel_weight(
4664 const double kz[EP],
4665 const double kw[EP],
4666 const int nk,
4667 const double p);
4668
4707double lapse_rate(
4708 const double t,
4709 const double h2o);
4710
4740 ctl_t * ctl);
4741
4761int locate_irr(
4762 const double *xx,
4763 const int n,
4764 const double x);
4765
4792 const float *xx,
4793 const int n,
4794 const double x,
4795 const int ig);
4796
4817int locate_reg(
4818 const double *xx,
4819 const int n,
4820 const double x);
4821
4843void locate_vert(
4844 float profiles[EX][EY][EP],
4845 const int np,
4846 const int lon_ap_ind,
4847 const int lat_ap_ind,
4848 const double alt_ap,
4849 int *ind);
4850
4876void module_advect(
4877 const ctl_t * ctl,
4878 const cache_t * cache,
4879 met_t * met0,
4880 met_t * met1,
4881 atm_t * atm);
4882
4906 const ctl_t * ctl,
4907 const cache_t * cache,
4908 met_t * met0,
4909 met_t * met1,
4910 atm_t * atm);
4911
4949 const ctl_t * ctl,
4950 const cache_t * cache,
4951 const clim_t * clim,
4952 met_t * met0,
4953 met_t * met1,
4954 atm_t * atm);
4955
4973void module_chem_grid(
4974 const ctl_t * ctl,
4975 met_t * met0,
4976 met_t * met1,
4977 atm_t * atm,
4978 const double t);
4979
5006void module_chem_init(
5007 const ctl_t * ctl,
5008 const cache_t * cache,
5009 const clim_t * clim,
5010 met_t * met0,
5011 met_t * met1,
5012 atm_t * atm);
5013
5038 const ctl_t * ctl,
5039 cache_t * cache,
5040 met_t * met0,
5041 met_t * met1,
5042 atm_t * atm);
5043
5070void module_decay(
5071 const ctl_t * ctl,
5072 const cache_t * cache,
5073 const clim_t * clim,
5074 atm_t * atm);
5075
5112void module_diff_meso(
5113 const ctl_t * ctl,
5114 cache_t * cache,
5115 met_t * met0,
5116 met_t * met1,
5117 atm_t * atm);
5118
5152void module_diff_pbl(
5153 const ctl_t * ctl,
5154 cache_t * cache,
5155 met_t * met0,
5156 met_t * met1,
5157 atm_t * atm);
5158
5213void module_diff_turb(
5214 const ctl_t * ctl,
5215 cache_t * cache,
5216 const clim_t * clim,
5217 met_t * met0,
5218 met_t * met1,
5219 atm_t * atm);
5220
5240void module_dry_depo(
5241 const ctl_t * ctl,
5242 const cache_t * cache,
5243 met_t * met0,
5244 met_t * met1,
5245 atm_t * atm);
5246
5279void module_h2o2_chem(
5280 const ctl_t * ctl,
5281 const cache_t * cache,
5282 const clim_t * clim,
5283 met_t * met0,
5284 met_t * met1,
5285 atm_t * atm);
5286
5307 const ctl_t * ctl,
5308 cache_t * cache,
5309 met_t * met0,
5310 met_t * met1,
5311 atm_t * atm);
5312
5330void module_isosurf(
5331 const ctl_t * ctl,
5332 const cache_t * cache,
5333 met_t * met0,
5334 met_t * met1,
5335 atm_t * atm);
5336
5369 ctl_t * ctl,
5370 cache_t * cache,
5371 clim_t * clim,
5372 met_t * met0,
5373 met_t * met1,
5374 atm_t * atm);
5375
5394void module_meteo(
5395 const ctl_t * ctl,
5396 const cache_t * cache,
5397 const clim_t * clim,
5398 met_t * met0,
5399 met_t * met1,
5400 atm_t * atm);
5401
5419void module_mixing(
5420 const ctl_t * ctl,
5421 const clim_t * clim,
5422 atm_t * atm,
5423 const double t);
5424
5445 const ctl_t * ctl,
5446 const clim_t * clim,
5447 atm_t * atm,
5448 const int *ixs,
5449 const int *iys,
5450 const int *izs,
5451 const int qnt_idx);
5452
5485void module_oh_chem(
5486 const ctl_t * ctl,
5487 const cache_t * cache,
5488 const clim_t * clim,
5489 met_t * met0,
5490 met_t * met1,
5491 atm_t * atm);
5492
5520void module_position(
5521 const cache_t * cache,
5522 met_t * met0,
5523 met_t * met1,
5524 atm_t * atm);
5525
5550void module_rng_init(
5551 const int ntask);
5552
5578void module_rng(
5579 const ctl_t * ctl,
5580 double *rs,
5581 const size_t n,
5582 const int method);
5583
5606void module_sedi(
5607 const ctl_t * ctl,
5608 const cache_t * cache,
5609 met_t * met0,
5610 met_t * met1,
5611 atm_t * atm);
5612
5636void module_sort(
5637 const ctl_t * ctl,
5638 met_t * met0,
5639 atm_t * atm);
5640
5660void module_sort_help(
5661 double *a,
5662 const int *p,
5663 const int np);
5664
5688void module_timesteps(
5689 const ctl_t * ctl,
5690 cache_t * cache,
5691 met_t * met0,
5692 atm_t * atm,
5693 const double t);
5694
5716 ctl_t * ctl,
5717 const atm_t * atm);
5718
5752 const ctl_t * ctl,
5753 const cache_t * cache,
5754 const clim_t * clim,
5755 met_t * met0,
5756 met_t * met1,
5757 atm_t * atm);
5758
5788void module_wet_depo(
5789 const ctl_t * ctl,
5790 const cache_t * cache,
5791 met_t * met0,
5792 met_t * met1,
5793 atm_t * atm);
5794
5825void mptrac_alloc(
5826 ctl_t ** ctl,
5827 cache_t ** cache,
5828 clim_t ** clim,
5829 met_t ** met0,
5830 met_t ** met1,
5831 atm_t ** atm);
5832
5862void mptrac_free(
5863 ctl_t * ctl,
5864 cache_t * cache,
5865 clim_t * clim,
5866 met_t * met0,
5867 met_t * met1,
5868 atm_t * atm);
5869
5904void mptrac_get_met(
5905 ctl_t * ctl,
5906 clim_t * clim,
5907 const double t,
5908 met_t ** met0,
5909 met_t ** met1);
5910
5930void mptrac_init(
5931 ctl_t * ctl,
5932 cache_t * cache,
5933 clim_t * clim,
5934 atm_t * atm,
5935 const int ntask);
5936
5972int mptrac_read_atm(
5973 const char *filename,
5974 const ctl_t * ctl,
5975 atm_t * atm);
5976
6008void mptrac_read_clim(
6009 const ctl_t * ctl,
6010 clim_t * clim);
6011
6041void mptrac_read_ctl(
6042 const char *filename,
6043 int argc,
6044 char *argv[],
6045 ctl_t * ctl);
6046
6075int mptrac_read_met(
6076 const char *filename,
6077 const ctl_t * ctl,
6078 const clim_t * clim,
6079 met_t * met);
6080
6101 ctl_t * ctl,
6102 cache_t * cache,
6103 clim_t * clim,
6104 met_t ** met0,
6105 met_t ** met1,
6106 atm_t * atm,
6107 double t);
6108
6138void mptrac_write_atm(
6139 const char *filename,
6140 const ctl_t * ctl,
6141 const atm_t * atm,
6142 const double t);
6143
6179void mptrac_write_met(
6180 const char *filename,
6181 const ctl_t * ctl,
6182 met_t * met);
6183
6218 const char *dirname,
6219 const ctl_t * ctl,
6220 met_t * met0,
6221 met_t * met1,
6222 atm_t * atm,
6223 const double t);
6224
6256 const ctl_t * ctl,
6257 const cache_t * cache,
6258 const clim_t * clim,
6259 met_t ** met0,
6260 met_t ** met1,
6261 const atm_t * atm);
6262
6293 const ctl_t * ctl,
6294 const cache_t * cache,
6295 const clim_t * clim,
6296 met_t ** met0,
6297 met_t ** met1,
6298 const atm_t * atm);
6299
6327double nat_temperature(
6328 const double p,
6329 const double h2o,
6330 const double hno3);
6331
6352double pbl_weight(
6353 const ctl_t * ctl,
6354 const atm_t * atm,
6355 const int ip,
6356 const double pbl,
6357 const double ps);
6358
6391int read_atm_asc(
6392 const char *filename,
6393 const ctl_t * ctl,
6394 atm_t * atm);
6395
6426int read_atm_bin(
6427 const char *filename,
6428 const ctl_t * ctl,
6429 atm_t * atm);
6430
6455int read_atm_clams(
6456 const char *filename,
6457 const ctl_t * ctl,
6458 atm_t * atm);
6459
6489int read_atm_nc(
6490 const char *filename,
6491 const ctl_t * ctl,
6492 atm_t * atm);
6493
6522void read_clim_photo(
6523 const char *filename,
6524 clim_photo_t * photo);
6525
6543 const int ncid,
6544 const char *varname,
6545 const clim_photo_t * photo,
6546 double var[CP][CSZA][CO3]);
6547
6571int read_clim_ts(
6572 const char *filename,
6573 clim_ts_t * ts);
6574
6601void read_clim_zm(
6602 const char *filename,
6603 const char *varname,
6604 clim_zm_t * zm);
6605
6633void read_kernel(
6634 const char *filename,
6635 double kz[EP],
6636 double kw[EP],
6637 int *nk);
6638
6670int read_met_bin(
6671 const char *filename,
6672 const ctl_t * ctl,
6673 met_t * met);
6674
6700void read_met_bin_2d(
6701 FILE * in,
6702 const met_t * met,
6703 float var[EX][EY],
6704 const char *varname);
6705
6743void read_met_bin_3d(
6744 FILE * in,
6745 const ctl_t * ctl,
6746 const met_t * met,
6747 float var[EX][EY][EP],
6748 const char *varname,
6749 const float bound_min,
6750 const float bound_max);
6751
6778void read_met_cape(
6779 const ctl_t * ctl,
6780 const clim_t * clim,
6781 met_t * met);
6782
6805void read_met_cloud(
6806 met_t * met);
6807
6833void read_met_detrend(
6834 const ctl_t * ctl,
6835 met_t * met);
6836
6860 met_t * met);
6861
6888void read_met_geopot(
6889 const ctl_t * ctl,
6890 met_t * met);
6891
6923void read_met_grid(
6924 const char *filename,
6925 const int ncid,
6926 const ctl_t * ctl,
6927 met_t * met);
6928
6959void read_met_levels(
6960 const int ncid,
6961 const ctl_t * ctl,
6962 met_t * met);
6963
6992void read_met_ml2pl(
6993 const ctl_t * ctl,
6994 const met_t * met,
6995 float var[EX][EY][EP],
6996 const char *varname);
6997
7020 const ctl_t * ctl,
7021 met_t * met);
7022
7054int read_met_nc(
7055 const char *filename,
7056 const ctl_t * ctl,
7057 const clim_t * clim,
7058 met_t * met);
7059
7089int read_met_nc_2d(
7090 const int ncid,
7091 const char *varname,
7092 const char *varname2,
7093 const char *varname3,
7094 const char *varname4,
7095 const char *varname5,
7096 const char *varname6,
7097 const ctl_t * ctl,
7098 const met_t * met,
7099 float dest[EX][EY],
7100 const float scl,
7101 const int init);
7102
7133int read_met_nc_3d(
7134 const int ncid,
7135 const char *varname,
7136 const char *varname2,
7137 const char *varname3,
7138 const char *varname4,
7139 const ctl_t * ctl,
7140 const met_t * met,
7141 float dest[EX][EY][EP],
7142 const float scl);
7143
7189void read_met_pbl(
7190 const ctl_t * ctl,
7191 met_t * met);
7192
7225 met_t * met);
7226
7257 met_t * met);
7258
7289void read_met_pv(
7290 met_t * met);
7291
7314void read_met_ozone(
7315 met_t * met);
7316
7345void read_met_sample(
7346 const ctl_t * ctl,
7347 met_t * met);
7348
7389void read_met_surface(
7390 const int ncid,
7391 const ctl_t * ctl,
7392 met_t * met);
7393
7422void read_met_tropo(
7423 const ctl_t * ctl,
7424 const clim_t * clim,
7425 met_t * met);
7426
7458void read_obs(
7459 const char *filename,
7460 const ctl_t * ctl,
7461 double *rt,
7462 double *rz,
7463 double *rlon,
7464 double *rlat,
7465 double *robs,
7466 int *nobs);
7467
7495void read_obs_asc(
7496 const char *filename,
7497 double *rt,
7498 double *rz,
7499 double *rlon,
7500 double *rlat,
7501 double *robs,
7502 int *nobs);
7503
7530void read_obs_nc(
7531 const char *filename,
7532 double *rt,
7533 double *rz,
7534 double *rlon,
7535 double *rlat,
7536 double *robs,
7537 int *nobs);
7538
7572double scan_ctl(
7573 const char *filename,
7574 int argc,
7575 char *argv[],
7576 const char *varname,
7577 const int arridx,
7578 const char *defvalue,
7579 char *value);
7580
7607double sedi(
7608 const double p,
7609 const double T,
7610 const double rp,
7611 const double rhop);
7612
7642void spline(
7643 const double *x,
7644 const double *y,
7645 const int n,
7646 const double *x2,
7647 double *y2,
7648 const int n2,
7649 const int method);
7650
7673float stddev(
7674 const float *data,
7675 const int n);
7676
7696double sza_calc(
7697 const double sec,
7698 const double lon,
7699 const double lat);
7700
7725void time2jsec(
7726 const int year,
7727 const int mon,
7728 const int day,
7729 const int hour,
7730 const int min,
7731 const int sec,
7732 const double remain,
7733 double *jsec);
7734
7763void timer(
7764 const char *name,
7765 const char *group,
7766 const int output);
7767
7793double time_from_filename(
7794 const char *filename,
7795 const int offset);
7796
7814double tropo_weight(
7815 const clim_t * clim,
7816 const atm_t * atm,
7817 const int ip);
7818
7841void write_atm_asc(
7842 const char *filename,
7843 const ctl_t * ctl,
7844 const atm_t * atm,
7845 const double t);
7846
7870void write_atm_bin(
7871 const char *filename,
7872 const ctl_t * ctl,
7873 const atm_t * atm);
7874
7898void write_atm_clams(
7899 const char *filename,
7900 const ctl_t * ctl,
7901 const atm_t * atm);
7902
7928 const char *dirname,
7929 const ctl_t * ctl,
7930 const atm_t * atm,
7931 const double t);
7932
7956void write_atm_nc(
7957 const char *filename,
7958 const ctl_t * ctl,
7959 const atm_t * atm);
7960
7989void write_csi(
7990 const char *filename,
7991 const ctl_t * ctl,
7992 const atm_t * atm,
7993 const double t);
7994
8022void write_ens(
8023 const char *filename,
8024 const ctl_t * ctl,
8025 const atm_t * atm,
8026 const double t);
8027
8066void write_grid(
8067 const char *filename,
8068 const ctl_t * ctl,
8069 met_t * met0,
8070 met_t * met1,
8071 const atm_t * atm,
8072 const double t);
8073
8119void write_grid_asc(
8120 const char *filename,
8121 const ctl_t * ctl,
8122 const double *cd,
8123 double *mean[NQ],
8124 double *sigma[NQ],
8125 const double *vmr_impl,
8126 const double t,
8127 const double *z,
8128 const double *lon,
8129 const double *lat,
8130 const double *area,
8131 const double dz,
8132 const int *np);
8133
8176void write_grid_nc(
8177 const char *filename,
8178 const ctl_t * ctl,
8179 const double *cd,
8180 double *mean[NQ],
8181 double *sigma[NQ],
8182 const double *vmr_impl,
8183 const double t,
8184 const double *z,
8185 const double *lon,
8186 const double *lat,
8187 const double *area,
8188 const double dz,
8189 const int *np);
8190
8220void write_met_bin(
8221 const char *filename,
8222 const ctl_t * ctl,
8223 met_t * met);
8224
8252void write_met_bin_2d(
8253 FILE * out,
8254 met_t * met,
8255 float var[EX][EY],
8256 const char *varname);
8257
8295void write_met_bin_3d(
8296 FILE * out,
8297 const ctl_t * ctl,
8298 met_t * met,
8299 float var[EX][EY][EP],
8300 const char *varname,
8301 const int precision,
8302 const double tolerance);
8303
8331void write_met_nc(
8332 const char *filename,
8333 const ctl_t * ctl,
8334 met_t * met);
8335
8360void write_met_nc_2d(
8361 const int ncid,
8362 const char *varname,
8363 met_t * met,
8364 float var[EX][EY],
8365 const float scl);
8366
8392void write_met_nc_3d(
8393 const int ncid,
8394 const char *varname,
8395 met_t * met,
8396 float var[EX][EY][EP],
8397 const float scl);
8398
8429void write_prof(
8430 const char *filename,
8431 const ctl_t * ctl,
8432 met_t * met0,
8433 met_t * met1,
8434 const atm_t * atm,
8435 const double t);
8436
8468void write_sample(
8469 const char *filename,
8470 const ctl_t * ctl,
8471 met_t * met0,
8472 met_t * met1,
8473 const atm_t * atm,
8474 const double t);
8475
8502void write_station(
8503 const char *filename,
8504 const ctl_t * ctl,
8505 atm_t * atm,
8506 const double t);
8507
8536void write_vtk(
8537 const char *filename,
8538 const ctl_t * ctl,
8539 const atm_t * atm,
8540 const double t);
8541
8542#endif /* LIBTRAC_H */
void read_met_geopot(const ctl_t *ctl, met_t *met)
Calculates geopotential heights from meteorological data.
Definition: mptrac.c:7038
void compress_zstd(const char *varname, float *array, const size_t n, const int decompress, const int level, FILE *inout)
Compresses or decompresses a float array using Zstandard (ZSTD).
#define LEN
Maximum length of ASCII data lines.
Definition: mptrac.h:252
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:5722
void day2doy(const int year, const int mon, const int day, int *doy)
Get day of year from date.
Definition: mptrac.c:942
void read_met_extrapolate(met_t *met)
Extrapolates meteorological data.
Definition: mptrac.c:6998
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:7300
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:7641
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:9545
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:10905
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:4238
void read_met_sample(const ctl_t *ctl, met_t *met)
Downsamples meteorological data based on specified parameters.
Definition: mptrac.c:8408
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:10666
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:8888
void module_advect(const ctl_t *ctl, const cache_t *cache, met_t *met0, met_t *met1, atm_t *atm)
Advances particle positions using different advection schemes.
Definition: mptrac.c:2130
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:3965
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:5418
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:3281
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:6146
void read_met_cloud(met_t *met)
Calculates cloud-related variables for each grid point.
Definition: mptrac.c:6837
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:2667
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:9061
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:1504
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:1437
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:6113
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:8016
void read_met_detrend(const ctl_t *ctl, met_t *met)
Detrends meteorological data.
Definition: mptrac.c:6894
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:7712
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:8716
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:8932
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:2552
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:2091
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:1137
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:2110
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:4311
void read_met_monotonize(const ctl_t *ctl, met_t *met)
Makes zeta and pressure profiles monotone.
Definition: mptrac.c:7556
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:6265
void read_met_periodic(met_t *met)
Applies periodic boundary conditions to meteorological data along longitudinal axis.
Definition: mptrac.c:8153
void module_timesteps_init(ctl_t *ctl, const atm_t *atm)
Initialize start time and time interval for time-stepping.
Definition: mptrac.c:4002
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:10014
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:3385
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:282
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:6237
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:7514
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:8960
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:7166
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:6607
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:2027
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:3106
void level_definitions(ctl_t *ctl)
Defines pressure levels for meteorological data.
Definition: mptrac.c:1817
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:10302
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:5610
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:9203
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:4432
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:1562
void fft_help(double *fcReal, double *fcImag, const int n)
Computes the Fast Fourier Transform (FFT) of a complex sequence.
Definition: mptrac.c:991
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:4103
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:706
double nat_temperature(const double p, const double h2o, const double hno3)
Calculates the nitric acid trihydrate (NAT) temperature.
Definition: mptrac.c:5913
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:9094
#define CP
Maximum number of pressure levels for climatological data.
Definition: mptrac.h:312
#define NQ
Maximum number of quantities per data point.
Definition: mptrac.h:262
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:6319
#define EX
Maximum number of longitudes for meteo data.
Definition: mptrac.h:277
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:3840
void timer(const char *name, const char *group, const int output)
Measures and reports elapsed time for named and grouped timers.
Definition: mptrac.c:9234
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:9360
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:1379
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:8580
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:1591
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:2594
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:6418
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:2309
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:8989
#define CT
Maximum number of time steps for climatological data.
Definition: mptrac.h:322
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:2282
void module_sort_help(double *a, const int *p, const int np)
Reorder an array based on a given permutation.
Definition: mptrac.c:3929
float stddev(const float *data, const int n)
Calculates the standard deviation of a set of data.
Definition: mptrac.c:9141
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:1649
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:7870
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:6636
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:2057
double time_from_filename(const char *filename, const int offset)
Extracts and converts a timestamp from a filename to Julian seconds.
Definition: mptrac.c:9302
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:10964
void mptrac_read_clim(const ctl_t *ctl, clim_t *clim)
Reads various climatological data and populates the given climatology structure.
Definition: mptrac.c:4522
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:2405
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:9337
void write_met_nc(const char *filename, const ctl_t *ctl, met_t *met)
Writes meteorological data to a NetCDF file.
Definition: mptrac.c:10742
void module_rng_init(const int ntask)
Initialize random number generators for parallel tasks.
Definition: mptrac.c:3704
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:4451
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:1207
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:5666
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:5822
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:327
void read_met_ozone(met_t *met)
Calculates the total column ozone from meteorological ozone data.
Definition: mptrac.c:8379
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:4285
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:3735
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:1048
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:11353
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:257
double sza_calc(const double sec, const double lon, const double lat)
Calculates the solar zenith angle.
Definition: mptrac.c:9162
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:3475
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:961
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:1616
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:3653
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:10637
void read_met_pv(met_t *met)
Calculates potential vorticity (PV) from meteorological data.
Definition: mptrac.c:8273
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:6001
void get_met_replace(char *orig, char *search, char *repl)
Replaces occurrences of a substring in a string with another substring.
Definition: mptrac.c:1113
#define CY
Maximum number of latitudes for climatological data.
Definition: mptrac.h:302
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:2706
void module_sort(const ctl_t *ctl, met_t *met0, atm_t *atm)
Sort particles according to box index.
Definition: mptrac.c:3869
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:1740
int read_met_bin(const char *filename, const ctl_t *ctl, met_t *met)
Reads meteorological data from a binary file.
Definition: mptrac.c:6459
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:5473
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:9492
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:2908
int read_atm_clams(const char *filename, const ctl_t *ctl, atm_t *atm)
Reads atmospheric data from a CLAMS NetCDF file.
Definition: mptrac.c:6057
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:11439
#define EP
Maximum number of pressure levels for meteo data.
Definition: mptrac.h:272
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:4033
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:4582
void read_met_polar_winds(met_t *met)
Applies a fix for polar winds in meteorological data.
Definition: mptrac.c:8214
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:3023
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:10406
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:5937
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:2783
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:10934
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:3176
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:307
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:3569
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:1030
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:1773
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:5959
void intpol_check_lon_lat(const double *lons, const int nlon, const double *lats, const int nlat, const double lon, const double lat, double *lon2, double *lat2)
Adjusts longitude and latitude to ensure they fall within valid bounds.
Definition: mptrac.c:1180
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:11191
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:10111
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:2960
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:10536
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:9442
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:6722
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:5782
#define CSZA
Maximum number of solar zenith angles for climatological data.
Definition: mptrac.h:317
double lapse_rate(const double t, const double h2o)
Calculates the moist adiabatic lapse rate in Kelvin per kilometer.
Definition: mptrac.c:1799
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:9752
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:9703
Air parcel data.
Definition: mptrac.h:3163
int np
Number of air parcels.
Definition: mptrac.h:3166
Cache data structure.
Definition: mptrac.h:3191
int iso_n
Isosurface balloon number of data points.
Definition: mptrac.h:3203
Climatological data in the form of photolysis rates.
Definition: mptrac.h:3223
int nsza
Number of solar zenith angles.
Definition: mptrac.h:3229
int np
Number of pressure levels.
Definition: mptrac.h:3226
int no3c
Number of total ozone columns.
Definition: mptrac.h:3232
Climatological data.
Definition: mptrac.h:3331
clim_ts_t ccl2f2
CFC-12 time series.
Definition: mptrac.h:3373
clim_photo_t photo
Photolysis rates.
Definition: mptrac.h:3349
clim_zm_t ho2
HO2 zonal means.
Definition: mptrac.h:3361
clim_zm_t hno3
HNO3 zonal means.
Definition: mptrac.h:3352
int tropo_ntime
Number of tropopause timesteps.
Definition: mptrac.h:3334
clim_ts_t sf6
SF6 time series.
Definition: mptrac.h:3379
clim_ts_t ccl4
CFC-10 time series.
Definition: mptrac.h:3367
clim_ts_t ccl3f
CFC-11 time series.
Definition: mptrac.h:3370
clim_zm_t o1d
O(1D) zonal means.
Definition: mptrac.h:3364
clim_zm_t h2o2
H2O2 zonal means.
Definition: mptrac.h:3358
int tropo_nlat
Number of tropopause latitudes.
Definition: mptrac.h:3337
clim_zm_t oh
OH zonal means.
Definition: mptrac.h:3355
clim_ts_t n2o
N2O time series.
Definition: mptrac.h:3376
Climatological data in the form of time series.
Definition: mptrac.h:3279
int ntime
Number of timesteps.
Definition: mptrac.h:3282
Climatological data in the form of zonal means.
Definition: mptrac.h:3299
int np
Number of pressure levels.
Definition: mptrac.h:3308
int ntime
Number of timesteps.
Definition: mptrac.h:3302
int nlat
Number of latitudes.
Definition: mptrac.h:3305
Control parameters.
Definition: mptrac.h:2169
double grid_z0
Lower altitude of gridded data [km].
Definition: mptrac.h:3043
int qnt_o3
Quantity array index for ozone volume mixing ratio.
Definition: mptrac.h:2281
double csi_lat1
Upper latitude of gridded CSI data [deg].
Definition: mptrac.h:3007
int qnt_Coh
Quantity array index for OH volume mixing ratio (chemistry code).
Definition: mptrac.h:2428
double wet_depo_ic_a
Coefficient A for wet deposition in cloud (exponential form).
Definition: mptrac.h:2895
int met_nc_scale
Check netCDF scaling factors (0=no, 1=yes).
Definition: mptrac.h:2500
int qnt_pel
Quantity array index for pressure at equilibrium level (EL).
Definition: mptrac.h:2314
int csi_nz
Number of altitudes of gridded CSI data.
Definition: mptrac.h:2983
double molmass
Molar mass [g/mol].
Definition: mptrac.h:2757
int qnt_p
Quantity array index for pressure.
Definition: mptrac.h:2260
int qnt_Cccl2f2
Quantity array index for CFC-12 volume mixing ratio (chemistry code).
Definition: mptrac.h:2452
int mixing_nx
Number of longitudes of mixing grid.
Definition: mptrac.h:2820
double chemgrid_z1
Upper altitude of chemistry grid [km].
Definition: mptrac.h:2844
int qnt_m
Quantity array index for mass.
Definition: mptrac.h:2200
int qnt_aoa
Quantity array index for age of air.
Definition: mptrac.h:2461
int qnt_rhop
Quantity array index for particle density.
Definition: mptrac.h:2209
int qnt_swc
Quantity array index for cloud snow water content.
Definition: mptrac.h:2293
double csi_obsmin
Minimum observation index to trigger detection.
Definition: mptrac.h:2977
int qnt_pcb
Quantity array index for cloud bottom pressure.
Definition: mptrac.h:2302
double bound_dzs
Boundary conditions surface layer depth [km].
Definition: mptrac.h:2745
double csi_lon1
Upper longitude of gridded CSI data [deg].
Definition: mptrac.h:2998
int qnt_u
Quantity array index for zonal wind.
Definition: mptrac.h:2269
double stat_lon
Longitude of station [deg].
Definition: mptrac.h:3121
double mixing_trop
Interparcel exchange parameter for mixing in the troposphere.
Definition: mptrac.h:2805
double sort_dt
Time step for sorting of particle data [s].
Definition: mptrac.h:2656
double mixing_z1
Upper altitude of mixing grid [km].
Definition: mptrac.h:2817
double stat_r
Search radius around station [km].
Definition: mptrac.h:3127
double wet_depo_bc_a
Coefficient A for wet deposition below cloud (exponential form).
Definition: mptrac.h:2889
int met_zstd_level
ZSTD compression level (from -5 to 22).
Definition: mptrac.h:2509
int csi_ny
Number of latitudes of gridded CSI data.
Definition: mptrac.h:3001
int vtk_sphere
Spherical projection for VTK data (0=no, 1=yes).
Definition: mptrac.h:3151
double chemgrid_z0
Lower altitude of chemistry grid [km].
Definition: mptrac.h:2841
double met_pbl_min
Minimum depth of planetary boundary layer [km].
Definition: mptrac.h:2624
int qnt_iwc
Quantity array index for cloud ice water content.
Definition: mptrac.h:2290
double chemgrid_lat0
Lower latitude of chemistry grid [deg].
Definition: mptrac.h:2859
double conv_cape
CAPE threshold for convection module [J/kg].
Definition: mptrac.h:2709
int qnt_Co1d
Quantity array index for O(1D) volume mixing ratio (chemistry code).
Definition: mptrac.h:2440
double met_cms_eps_pv
cmultiscale compression epsilon for potential vorticity.
Definition: mptrac.h:2546
int qnt_pw
Quantity array index for partial water vapor pressure.
Definition: mptrac.h:2368
double grid_z1
Upper altitude of gridded data [km].
Definition: mptrac.h:3046
int direction
Direction flag (1=forward calculation, -1=backward calculation).
Definition: mptrac.h:2464
int qnt_Cccl4
Quantity array index for CFC-10 volume mixing ratio (chemistry code).
Definition: mptrac.h:2446
int met_dp
Stride for pressure levels.
Definition: mptrac.h:2576
double met_dt_out
Time step for sampling of meteo data along trajectories [s].
Definition: mptrac.h:2643
int qnt_h2o2
Quantity array index for H2O2 volume mixing ratio (climatology).
Definition: mptrac.h:2332
int qnt_vh
Quantity array index for horizontal wind.
Definition: mptrac.h:2395
int csi_nx
Number of longitudes of gridded CSI data.
Definition: mptrac.h:2992
double csi_lat0
Lower latitude of gridded CSI data [deg].
Definition: mptrac.h:3004
double turb_dz_trop
Vertical turbulent diffusion coefficient (troposphere) [m^2/s].
Definition: mptrac.h:2691
int met_pbl
Planetary boundary layer data (0=file, 1=z2p, 2=Richardson, 3=theta).
Definition: mptrac.h:2621
int qnt_lwc
Quantity array index for cloud liquid water content.
Definition: mptrac.h:2284
double turb_mesoz
Vertical scaling factor for mesoscale wind fluctuations.
Definition: mptrac.h:2700
int grid_nc_level
zlib compression level of netCDF grid data files (0=off).
Definition: mptrac.h:3031
int grid_nx
Number of longitudes of gridded data.
Definition: mptrac.h:3049
int atm_type
Type of atmospheric data files (0=ASCII, 1=binary, 2=netCDF, 3=CLaMS_traj, 4=CLaMS_pos).
Definition: mptrac.h:2948
double bound_mass
Boundary conditions mass per particle [kg].
Definition: mptrac.h:2718
double grid_lat0
Lower latitude of gridded data [deg].
Definition: mptrac.h:3061
int qnt_ts
Quantity array index for surface temperature.
Definition: mptrac.h:2215
int qnt_loss_rate
Quantity array index for total loss rate.
Definition: mptrac.h:2359
double met_cms_eps_h2o
cmultiscale compression epsilon for water vapor.
Definition: mptrac.h:2549
int qnt_plfc
Quantity array index for pressure at level of free convection (LCF).
Definition: mptrac.h:2311
double grid_lon0
Lower longitude of gridded data [deg].
Definition: mptrac.h:3052
int qnt_o1d
Quantity array index for O(1D) volume mixing ratio (climatology).
Definition: mptrac.h:2338
int met_tropo_spline
Tropopause interpolation method (0=linear, 1=spline).
Definition: mptrac.h:2640
int qnt_tvirt
Quantity array index for virtual temperature.
Definition: mptrac.h:2389
double dt_met
Time step of meteo data [s].
Definition: mptrac.h:2483
double chemgrid_lat1
Upper latitude of chemistry grid [deg].
Definition: mptrac.h:2862
int met_geopot_sy
Latitudinal smoothing of geopotential heights.
Definition: mptrac.h:2612
double met_cms_eps_u
cmultiscale compression epsilon for zonal wind.
Definition: mptrac.h:2537
double turb_dx_strat
Horizontal turbulent diffusion coefficient (stratosphere) [m^2/s].
Definition: mptrac.h:2685
int qnt_vmr
Quantity array index for volume mixing ratio.
Definition: mptrac.h:2203
int qnt_lsm
Quantity array index for land-sea mask.
Definition: mptrac.h:2236
int qnt_theta
Quantity array index for potential temperature.
Definition: mptrac.h:2380
double bound_lat1
Boundary conditions maximum longitude [deg].
Definition: mptrac.h:2733
double stat_t1
Stop time for station output [s].
Definition: mptrac.h:3133
double turb_dx_trop
Horizontal turbulent diffusion coefficient (troposphere) [m^2/s].
Definition: mptrac.h:2682
int grid_type
Type of grid data files (0=ASCII, 1=netCDF).
Definition: mptrac.h:3067
double csi_lon0
Lower longitude of gridded CSI data [deg].
Definition: mptrac.h:2995
int qnt_pbl
Quantity array index for boundary layer pressure.
Definition: mptrac.h:2242
int grid_stddev
Include standard deviations in grid output (0=no, 1=yes).
Definition: mptrac.h:3037
int qnt_psice
Quantity array index for saturation pressure over ice.
Definition: mptrac.h:2365
double chemgrid_lon0
Lower longitude of chemistry grid [deg].
Definition: mptrac.h:2850
int bound_pbl
Boundary conditions planetary boundary layer (0=no, 1=yes).
Definition: mptrac.h:2751
int qnt_mloss_wet
Quantity array index for total mass loss due to wet deposition.
Definition: mptrac.h:2350
int met_geopot_sx
Longitudinal smoothing of geopotential heights.
Definition: mptrac.h:2609
int met_sy
Smoothing for latitudes.
Definition: mptrac.h:2582
int qnt_ps
Quantity array index for surface pressure.
Definition: mptrac.h:2212
int rng_type
Random number generator (0=GSL, 1=Squares, 2=cuRAND).
Definition: mptrac.h:2673
int isosurf
Isosurface parameter (0=none, 1=pressure, 2=density, 3=theta, 4=balloon).
Definition: mptrac.h:2660
double bound_p1
Boundary conditions top pressure [hPa].
Definition: mptrac.h:2739
int qnt_zs
Quantity array index for surface geopotential height.
Definition: mptrac.h:2218
int prof_nz
Number of altitudes of gridded profile data.
Definition: mptrac.h:3076
double csi_dt_out
Time step for CSI output [s].
Definition: mptrac.h:2971
int met_cape
Convective available potential energy data (0=file, 1=calculate).
Definition: mptrac.h:2618
double csi_modmin
Minimum column density to trigger detection [kg/m^2].
Definition: mptrac.h:2980
int met_sx
Smoothing for longitudes.
Definition: mptrac.h:2579
double chemgrid_lon1
Upper longitude of chemistry grid [deg].
Definition: mptrac.h:2853
double turb_mesox
Horizontal scaling factor for mesoscale wind fluctuations.
Definition: mptrac.h:2697
double met_cms_eps_iwc
cmultiscale compression epsilon for cloud ice water content.
Definition: mptrac.h:2561
double met_cms_eps_swc
cmultiscale compression epsilon for cloud snow water content.
Definition: mptrac.h:2564
int met_zfp_prec
ZFP compression precision for all variables, except z and T.
Definition: mptrac.h:2512
double met_cms_eps_v
cmultiscale compression epsilon for meridional wind.
Definition: mptrac.h:2540
double prof_z0
Lower altitude of gridded profile data [km].
Definition: mptrac.h:3079
int qnt_w
Quantity array index for vertical velocity.
Definition: mptrac.h:2275
double bound_vmr
Boundary conditions volume mixing ratio [ppv].
Definition: mptrac.h:2724
double met_tropo_pv
Dynamical tropopause potential vorticity threshold [PVU].
Definition: mptrac.h:2634
int prof_nx
Number of longitudes of gridded profile data.
Definition: mptrac.h:3085
int qnt_stat
Quantity array index for station flag.
Definition: mptrac.h:2197
int met_tropo
Tropopause definition (0=none, 1=clim, 2=cold point, 3=WMO_1st, 4=WMO_2nd, 5=dynamical).
Definition: mptrac.h:2631
int qnt_rp
Quantity array index for particle radius.
Definition: mptrac.h:2206
int met_mpi_share
Use MPI to share meteo (0=no, 1=yes).
Definition: mptrac.h:2649
double mixing_strat
Interparcel exchange parameter for mixing in the stratosphere.
Definition: mptrac.h:2808
int qnt_vz
Quantity array index for vertical velocity.
Definition: mptrac.h:2398
int qnt_ho2
Quantity array index for HO2 volume mixing ratio (climatology).
Definition: mptrac.h:2335
double csi_z1
Upper altitude of gridded CSI data [km].
Definition: mptrac.h:2989
double stat_t0
Start time for station output [s].
Definition: mptrac.h:3130
double oh_chem_beta
Beta parameter for diurnal variablity of OH.
Definition: mptrac.h:2871
double wet_depo_so2_ph
pH value used to calculate effective Henry constant of SO2.
Definition: mptrac.h:2907
double mixing_z0
Lower altitude of mixing grid [km].
Definition: mptrac.h:2814
int qnt_mloss_decay
Quantity array index for total mass loss due to exponential decay.
Definition: mptrac.h:2356
int atm_type_out
Type of atmospheric data files for output (-1=same as ATM_TYPE, 0=ASCII, 1=binary,...
Definition: mptrac.h:2953
int met_nlev
Number of meteo data model levels.
Definition: mptrac.h:2600
double dt_kpp
Time step for KPP chemistry [s].
Definition: mptrac.h:2880
double dry_depo_dp
Dry deposition surface layer [hPa].
Definition: mptrac.h:2916
int qnt_shf
Quantity array index for surface sensible heat flux.
Definition: mptrac.h:2233
int qnt_vs
Quantity array index for surface meridional wind.
Definition: mptrac.h:2224
int qnt_Cco
Quantity array index for CO volume mixing ratio (chemistry code).
Definition: mptrac.h:2425
double vtk_dt_out
Time step for VTK data output [s].
Definition: mptrac.h:3139
double t_stop
Stop time of simulation [s].
Definition: mptrac.h:2470
double conv_dt
Time interval for convection module [s].
Definition: mptrac.h:2715
int qnt_hno3
Quantity array index for HNO3 volume mixing ratio (climatology).
Definition: mptrac.h:2326
int met_clams
Read MPTRAC or CLaMS meteo data (0=MPTRAC, 1=CLaMS).
Definition: mptrac.h:2497
int qnt_h2ot
Quantity array index for tropopause water vapor volume mixing ratio.
Definition: mptrac.h:2254
int qnt_rh
Quantity array index for relative humidity over water.
Definition: mptrac.h:2374
double met_cms_eps_cc
cmultiscale compression epsilon for cloud cover.
Definition: mptrac.h:2567
double bound_lat0
Boundary conditions minimum longitude [deg].
Definition: mptrac.h:2730
double met_pbl_max
Maximum depth of planetary boundary layer [km].
Definition: mptrac.h:2627
int met_dx
Stride for longitudes.
Definition: mptrac.h:2570
int mixing_ny
Number of latitudes of mixing grid.
Definition: mptrac.h:2829
int met_convention
Meteo data layout (0=[lev, lat, lon], 1=[lon, lat, lev]).
Definition: mptrac.h:2486
int qnt_zeta_d
Quantity array index for diagnosed zeta vertical coordinate.
Definition: mptrac.h:2386
int tracer_chem
Switch for first order tracer chemistry module (0=off, 1=on).
Definition: mptrac.h:2883
double dt_mod
Time step of simulation [s].
Definition: mptrac.h:2473
int diffusion
Diffusion scheme (0=off, 1=fixed-K, 2=PBL).
Definition: mptrac.h:2676
int qnt_tnat
Quantity array index for T_NAT.
Definition: mptrac.h:2413
int qnt_tice
Quantity array index for T_ice.
Definition: mptrac.h:2407
int qnt_zg
Quantity array index for geopotential height.
Definition: mptrac.h:2257
double vtk_offset
Vertical offset for VTK data [km].
Definition: mptrac.h:3148
int qnt_v
Quantity array index for meridional wind.
Definition: mptrac.h:2272
int qnt_mloss_dry
Quantity array index for total mass loss due to dry deposition.
Definition: mptrac.h:2353
double bound_vmr_trend
Boundary conditions volume mixing ratio trend [ppv/s].
Definition: mptrac.h:2727
int met_cache
Preload meteo data into disk cache (0=no, 1=yes).
Definition: mptrac.h:2646
int qnt_oh
Quantity array index for OH volume mixing ratio (climatology).
Definition: mptrac.h:2329
int qnt_Ch
Quantity array index for H volume mixing ratio (chemistry code).
Definition: mptrac.h:2431
int met_press_level_def
Use predefined pressure levels or not.
Definition: mptrac.h:2597
int oh_chem_reaction
Reaction type for OH chemistry (0=none, 2=bimolecular, 3=termolecular).
Definition: mptrac.h:2865
int qnt_h2o
Quantity array index for water vapor volume mixing ratio.
Definition: mptrac.h:2278
int prof_ny
Number of latitudes of gridded profile data.
Definition: mptrac.h:3094
int qnt_rhice
Quantity array index for relative humidity over ice.
Definition: mptrac.h:2377
int qnt_rho
Quantity array index for density of air.
Definition: mptrac.h:2266
double sample_dz
Layer depth for sample output [km].
Definition: mptrac.h:3115
double tdec_strat
Life time of particles in the stratosphere [s].
Definition: mptrac.h:2763
int obs_type
Type of observation data files (0=ASCII, 1=netCDF).
Definition: mptrac.h:2962
double met_cms_eps_lwc
cmultiscale compression epsilon for cloud liquid water content.
Definition: mptrac.h:2555
int qnt_us
Quantity array index for surface zonal wind.
Definition: mptrac.h:2221
double met_cms_eps_z
cmultiscale compression epsilon for geopotential height.
Definition: mptrac.h:2531
double grid_lon1
Upper longitude of gridded data [deg].
Definition: mptrac.h:3055
int qnt_Cn2o
Quantity array index for N2O volume mixing ratio (chemistry code).
Definition: mptrac.h:2455
int qnt_Cccl3f
Quantity array index for CFC-11 volume mixing ratio (chemistry code).
Definition: mptrac.h:2449
double mixing_lat0
Lower latitude of mixing grid [deg].
Definition: mptrac.h:2832
int qnt_pt
Quantity array index for tropopause pressure.
Definition: mptrac.h:2245
int qnt_cl
Quantity array index for total column cloud water.
Definition: mptrac.h:2305
int advect
Advection scheme (0=off, 1=Euler, 2=midpoint, 4=Runge-Kutta).
Definition: mptrac.h:2666
double prof_z1
Upper altitude of gridded profile data [km].
Definition: mptrac.h:3082
int qnt_t
Quantity array index for temperature.
Definition: mptrac.h:2263
int atm_filter
Time filter for atmospheric data output (0=none, 1=missval, 2=remove).
Definition: mptrac.h:2941
int kpp_chem
Switch for KPP chemistry module (0=off, 1=on).
Definition: mptrac.h:2877
int qnt_zeta
Quantity array index for zeta vertical coordinate.
Definition: mptrac.h:2383
double conv_pbl_trans
Depth of PBL transition layer (fraction of PBL depth).
Definition: mptrac.h:2706
int met_vert_coord
Vertical coordinate of input meteo data (0=plev, 1=mlev_p_file, 2=mlev_ab_file, 3=mlev_ab_full,...
Definition: mptrac.h:2490
double csi_z0
Lower altitude of gridded CSI data [km].
Definition: mptrac.h:2986
int qnt_lapse
Quantity array index for lapse rate.
Definition: mptrac.h:2392
double stat_lat
Latitude of station [deg].
Definition: mptrac.h:3124
int qnt_Cho2
Quantity array index for HO2 volume mixing ratio (chemistry code).
Definition: mptrac.h:2434
int grid_ny
Number of latitudes of gridded data.
Definition: mptrac.h:3058
int qnt_Csf6
Quantity array index for SF6 volume mixing ratio (chemistry code).
Definition: mptrac.h:2458
int qnt_Ch2o
Quantity array index for H2O volume mixing ratio (chemistry code).
Definition: mptrac.h:2419
double met_detrend
FWHM of horizontal Gaussian used for detrending [km].
Definition: mptrac.h:2588
int conv_mix_pbl
Vertical mixing in the PBL (0=off, 1=on).
Definition: mptrac.h:2703
double bound_dps
Boundary conditions surface layer depth [hPa].
Definition: mptrac.h:2742
double met_cms_eps_t
cmultiscale compression epsilon for temperature.
Definition: mptrac.h:2534
int chemgrid_nz
Number of altitudes of chemistry grid.
Definition: mptrac.h:2838
int qnt_cape
Quantity array index for convective available potential energy (CAPE).
Definition: mptrac.h:2317
double bound_mass_trend
Boundary conditions mass per particle trend [kg/s].
Definition: mptrac.h:2721
int mixing_nz
Number of altitudes of mixing grid.
Definition: mptrac.h:2811
int qnt_o3c
Quantity array index for total column ozone.
Definition: mptrac.h:2323
double bound_p0
Boundary conditions bottom pressure [hPa].
Definition: mptrac.h:2736
double mixing_lon0
Lower longitude of mixing grid [deg].
Definition: mptrac.h:2823
int qnt_Co3
Quantity array index for O3 volume mixing ratio (chemistry code).
Definition: mptrac.h:2422
int qnt_tsts
Quantity array index for T_STS.
Definition: mptrac.h:2410
int grid_nz
Number of altitudes of gridded data.
Definition: mptrac.h:3040
int qnt_nss
Quantity array index for northward turbulent surface stress.
Definition: mptrac.h:2230
double ens_dt_out
Time step for ensemble output [s].
Definition: mptrac.h:3013
int atm_stride
Particle index stride for atmospheric data files.
Definition: mptrac.h:2944
int met_relhum
Try to read relative humidity (0=no, 1=yes).
Definition: mptrac.h:2615
double mixing_lat1
Upper latitude of mixing grid [deg].
Definition: mptrac.h:2835
double atm_dt_out
Time step for atmospheric data output [s].
Definition: mptrac.h:2938
double prof_lat1
Upper latitude of gridded profile data [deg].
Definition: mptrac.h:3100
int met_cms_batch
cmultiscale batch size.
Definition: mptrac.h:2521
double psc_h2o
H2O volume mixing ratio for PSC analysis.
Definition: mptrac.h:2922
int met_sp
Smoothing for pressure levels.
Definition: mptrac.h:2585
double prof_lon0
Lower longitude of gridded profile data [deg].
Definition: mptrac.h:3088
int chemgrid_nx
Number of longitudes of chemistry grid.
Definition: mptrac.h:2847
int qnt_pct
Quantity array index for cloud top pressure.
Definition: mptrac.h:2299
int qnt_mloss_kpp
Quantity array index for total mass loss due to KPP chemistry.
Definition: mptrac.h:2347
int qnt_psat
Quantity array index for saturation pressure over water.
Definition: mptrac.h:2362
double prof_lat0
Lower latitude of gridded profile data [deg].
Definition: mptrac.h:3097
int qnt_cin
Quantity array index for convective inhibition (CIN).
Definition: mptrac.h:2320
double psc_hno3
HNO3 volume mixing ratio for PSC analysis.
Definition: mptrac.h:2925
double prof_lon1
Upper longitude of gridded profile data [deg].
Definition: mptrac.h:3091
double met_cms_eps_rwc
cmultiscale compression epsilon for cloud rain water content.
Definition: mptrac.h:2558
int met_nc_quant
Number of digits for quantization of netCDF meteo files (0=off).
Definition: mptrac.h:2506
int h2o2_chem_reaction
Reaction type for H2O2 chemistry (0=none, 1=SO2).
Definition: mptrac.h:2874
int qnt_Co3p
Quantity array index for O(3P) volume mixing ratio (chemistry code).
Definition: mptrac.h:2443
double wet_depo_bc_ret_ratio
Coefficients for wet deposition below cloud: retention ratio.
Definition: mptrac.h:2913
int chemgrid_ny
Number of latitudes of chemistry grid.
Definition: mptrac.h:2856
double met_cms_eps_o3
cmultiscale compression epsilon for ozone.
Definition: mptrac.h:2552
int met_cms_zstd
cmultiscale zstd compression (0=off, 1=on).
Definition: mptrac.h:2524
int grid_sparse
Sparse output in grid data files (0=no, 1=yes).
Definition: mptrac.h:3028
double dry_depo_vdep
Dry deposition velocity [m/s].
Definition: mptrac.h:2919
int qnt_tt
Quantity array index for tropopause temperature.
Definition: mptrac.h:2248
int met_np
Number of target pressure levels.
Definition: mptrac.h:2591
int qnt_ens
Quantity array index for ensemble IDs.
Definition: mptrac.h:2194
int met_nc_level
zlib compression level of netCDF meteo files (0=off).
Definition: mptrac.h:2503
double met_zfp_tol_t
ZFP compression tolerance for temperature.
Definition: mptrac.h:2515
double mixing_dt
Time interval for mixing [s].
Definition: mptrac.h:2802
int qnt_mloss_h2o2
Quantity array index for total mass loss due to H2O2 chemistry.
Definition: mptrac.h:2344
double met_zfp_tol_z
ZFP compression tolerance for geopotential height.
Definition: mptrac.h:2518
double vtk_scale
Vertical scaling factor for VTK data.
Definition: mptrac.h:3145
double met_cms_eps_w
cmultiscale compression epsilon for vertical velocity.
Definition: mptrac.h:2543
double turb_dx_pbl
Horizontal turbulent diffusion coefficient (PBL) [m^2/s].
Definition: mptrac.h:2679
double conv_cin
CIN threshold for convection module [J/kg].
Definition: mptrac.h:2712
int qnt_pv
Quantity array index for potential vorticity.
Definition: mptrac.h:2401
int advect_vert_coord
Vertical velocity of air parcels (0=omega_on_plev, 1=zetadot_on_mlev, 2=omega_on_mlev).
Definition: mptrac.h:2670
int qnt_mloss_oh
Quantity array index for total mass loss due to OH chemistry.
Definition: mptrac.h:2341
int qnt_Ch2o2
Quantity array index for H2O2 volume mixing ratio (chemistry code).
Definition: mptrac.h:2437
int qnt_sst
Quantity array index for sea surface temperature.
Definition: mptrac.h:2239
double mixing_lon1
Upper longitude of mixing grid [deg].
Definition: mptrac.h:2826
int atm_nc_level
zlib compression level of netCDF atmospheric data files (0=off).
Definition: mptrac.h:2956
int met_cms_heur
cmultiscale coarsening heuristics (0=default, 1=mean diff, 2=median diff, 3=max diff).
Definition: mptrac.h:2528
double wet_depo_ic_ret_ratio
Coefficients for wet deposition in cloud: retention ratio.
Definition: mptrac.h:2910
int qnt_sh
Quantity array index for specific humidity.
Definition: mptrac.h:2371
int qnt_ess
Quantity array index for eastward turbulent surface stress.
Definition: mptrac.h:2227
double wet_depo_ic_b
Coefficient B for wet deposition in cloud (exponential form).
Definition: mptrac.h:2898
double wet_depo_bc_b
Coefficient B for wet deposition below cloud (exponential form).
Definition: mptrac.h:2892
int met_dy
Stride for latitudes.
Definition: mptrac.h:2573
int qnt_Cx
Quantity array index for trace species x volume mixing ratio (chemistry code).
Definition: mptrac.h:2416
double turb_dz_strat
Vertical turbulent diffusion coefficient (stratosphere) [m^2/s].
Definition: mptrac.h:2694
double bound_zetas
Boundary conditions surface layer zeta [K].
Definition: mptrac.h:2748
int qnt_idx
Quantity array index for air parcel IDs.
Definition: mptrac.h:2191
double met_tropo_theta
Dynamical tropopause potential temperature threshold [K].
Definition: mptrac.h:2637
int qnt_rwc
Quantity array index for cloud rain water content.
Definition: mptrac.h:2287
double t_start
Start time of simulation [s].
Definition: mptrac.h:2467
int nq
Number of quantities.
Definition: mptrac.h:2176
double tdec_trop
Life time of particles in the troposphere [s].
Definition: mptrac.h:2760
double sample_dx
Horizontal radius for sample output [km].
Definition: mptrac.h:3112
int vtk_stride
Particle index stride for VTK data.
Definition: mptrac.h:3142
double turb_dz_pbl
Vertical turbulent diffusion coefficient (PBL) [m^2/s].
Definition: mptrac.h:2688
double grid_lat1
Upper latitude of gridded data [deg].
Definition: mptrac.h:3064
int qnt_zt
Quantity array index for tropopause geopotential height.
Definition: mptrac.h:2251
int met_type
Type of meteo data files (0=netCDF, 1=binary, 2=pck, 3=zfp, 4=zstd, 5=cms).
Definition: mptrac.h:2494
int qnt_cc
Quantity array index for cloud cover.
Definition: mptrac.h:2296
int qnt_plcl
Quantity array index for pressure at lifted condensation level (LCL).
Definition: mptrac.h:2308
double grid_dt_out
Time step for gridded data output [s].
Definition: mptrac.h:3025
int qnt_tdew
Quantity array index for dew point temperature.
Definition: mptrac.h:2404
Meteo data structure.
Definition: mptrac.h:3390
int nx
Number of longitudes.
Definition: mptrac.h:3396
int ny
Number of latitudes.
Definition: mptrac.h:3399
int np
Number of pressure levels.
Definition: mptrac.h:3402
int npl
Number of model levels.
Definition: mptrac.h:3405
double time
Time [s].
Definition: mptrac.h:3393