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
2526
2529
2532
2535
2538
2541
2544
2547
2550
2553
2556
2559
2562
2565
2568
2571
2574
2577
2580
2583
2586
2589
2591 double met_p[EP];
2592
2595
2598
2600 double met_lev_hyam[EP];
2601
2603 double met_lev_hybm[EP];
2604
2607
2610
2613
2616
2619
2622
2625
2629
2632
2635
2638
2641
2644
2647
2648 /* ------------------------------------------------------------
2649 Geophysical module parameters...
2650 ------------------------------------------------------------ */
2651
2653 double sort_dt;
2654
2658
2660 char balloon[LEN];
2661
2664
2668
2671
2674
2677
2680
2683
2686
2689
2692
2695
2698
2701
2704
2707
2709 double conv_cin;
2710
2712 double conv_dt;
2713
2716
2719
2722
2725
2728
2731
2733 double bound_p0;
2734
2736 double bound_p1;
2737
2740
2743
2746
2749
2751 char species[LEN];
2752
2754 double molmass;
2755
2758
2761
2764
2766 char clim_hno3_filename[LEN];
2767
2769 char clim_oh_filename[LEN];
2770
2772 char clim_h2o2_filename[LEN];
2773
2775 char clim_ho2_filename[LEN];
2776
2778 char clim_o1d_filename[LEN];
2779
2781 char clim_o3_filename[LEN];
2782
2784 char clim_ccl4_timeseries[LEN];
2785
2787 char clim_ccl3f_timeseries[LEN];
2788
2790 char clim_ccl2f2_timeseries[LEN];
2791
2793 char clim_n2o_timeseries[LEN];
2794
2796 char clim_sf6_timeseries[LEN];
2797
2800
2803
2806
2809
2812
2815
2818
2821
2824
2827
2830
2833
2836
2839
2842
2845
2848
2851
2854
2857
2860
2863
2865 double oh_chem[4];
2866
2869
2872
2875
2877 double dt_kpp;
2878
2881
2883 double wet_depo_pre[2];
2884
2887
2890
2893
2896
2898 double wet_depo_ic_h[2];
2899
2901 double wet_depo_bc_h[2];
2902
2905
2908
2911
2914
2917
2919 double psc_h2o;
2920
2922 double psc_hno3;
2923
2924 /* ------------------------------------------------------------
2925 Output parameters...
2926 ------------------------------------------------------------ */
2927
2929 char atm_basename[LEN];
2930
2932 char atm_gpfile[LEN];
2933
2936
2939
2942
2946
2951
2954
2956 int atm_nc_quant[NQ];
2957
2960
2962 char csi_basename[LEN];
2963
2965 char csi_kernel[LEN];
2966
2969
2971 char csi_obsfile[LEN];
2972
2975
2978
2981
2983 double csi_z0;
2984
2986 double csi_z1;
2987
2990
2992 double csi_lon0;
2993
2995 double csi_lon1;
2996
2999
3001 double csi_lat0;
3002
3004 double csi_lat1;
3005
3007 char ens_basename[LEN];
3008
3011
3013 char grid_basename[LEN];
3014
3016 char grid_kernel[LEN];
3017
3019 char grid_gpfile[LEN];
3020
3023
3026
3029
3031 int grid_nc_quant[NQ];
3032
3035
3038
3040 double grid_z0;
3041
3043 double grid_z1;
3044
3047
3050
3053
3056
3059
3062
3065
3067 char prof_basename[LEN];
3068
3070 char prof_obsfile[LEN];
3071
3074
3076 double prof_z0;
3077
3079 double prof_z1;
3080
3083
3086
3089
3092
3095
3098
3100 char sample_basename[LEN];
3101
3103 char sample_kernel[LEN];
3104
3106 char sample_obsfile[LEN];
3107
3110
3113
3115 char stat_basename[LEN];
3116
3118 double stat_lon;
3119
3121 double stat_lat;
3122
3124 double stat_r;
3125
3127 double stat_t0;
3128
3130 double stat_t1;
3131
3133 char vtk_basename[LEN];
3134
3137
3140
3143
3146
3149
3150} ctl_t;
3151
3160typedef struct {
3161
3163 int np;
3164
3166 double time[NP];
3167
3169 double p[NP];
3170
3172 double lon[NP];
3173
3175 double lat[NP];
3176
3178 double q[NQ][NP];
3179
3180} atm_t;
3181
3188typedef struct {
3189
3191 double iso_var[NP];
3192
3194 double iso_ps[NP];
3195
3197 double iso_ts[NP];
3198
3201
3203 float uvwp[NP][3];
3204
3206 double rs[3 * NP + 1];
3207
3209 double dt[NP];
3210
3211} cache_t;
3212
3220typedef struct {
3221
3223 int np;
3224
3226 int nsza;
3227
3229 int no3c;
3230
3232 double p[CP];
3233
3235 double sza[CSZA];
3236
3238 double o3c[CO3];
3239
3241 double n2o[CP][CSZA][CO3];
3242
3244 double ccl4[CP][CSZA][CO3];
3245
3247 double ccl3f[CP][CSZA][CO3];
3248
3250 double ccl2f2[CP][CSZA][CO3];
3251
3253 double o2[CP][CSZA][CO3];
3254
3256 double o3_1[CP][CSZA][CO3];
3257
3259 double o3_2[CP][CSZA][CO3];
3260
3262 double h2o2[CP][CSZA][CO3];
3263
3265 double h2o[CP][CSZA][CO3];
3266
3267} clim_photo_t;
3268
3276typedef struct {
3277
3280
3282 double time[CTS];
3283
3285 double vmr[CTS];
3286
3287} clim_ts_t;
3288
3296typedef struct {
3297
3300
3302 int nlat;
3303
3305 int np;
3306
3308 double time[CT];
3309
3311 double lat[CY];
3312
3314 double p[CP];
3315
3317 double vmr[CT][CP][CY];
3318
3319} clim_zm_t;
3320
3328typedef struct {
3329
3332
3335
3337 double tropo_time[12];
3338
3340 double tropo_lat[73];
3341
3343 double tropo[12][73];
3344
3347
3350
3353
3356
3359
3362
3365
3368
3371
3374
3377
3378} clim_t;
3379
3387typedef struct {
3388
3390 double time;
3391
3393 int nx;
3394
3396 int ny;
3397
3399 int np;
3400
3402 int npl;
3403
3405 double lon[EX];
3406
3408 double lat[EY];
3409
3411 double p[EP];
3412
3414 double hybrid[EP];
3415
3417 float ps[EX][EY];
3418
3420 float ts[EX][EY];
3421
3423 float zs[EX][EY];
3424
3426 float us[EX][EY];
3427
3429 float vs[EX][EY];
3430
3432 float ess[EX][EY];
3433
3435 float nss[EX][EY];
3436
3438 float shf[EX][EY];
3439
3441 float lsm[EX][EY];
3442
3444 float sst[EX][EY];
3445
3447 float pbl[EX][EY];
3448
3450 float pt[EX][EY];
3451
3453 float tt[EX][EY];
3454
3456 float zt[EX][EY];
3457
3459 float h2ot[EX][EY];
3460
3462 float pct[EX][EY];
3463
3465 float pcb[EX][EY];
3466
3468 float cl[EX][EY];
3469
3471 float plcl[EX][EY];
3472
3474 float plfc[EX][EY];
3475
3477 float pel[EX][EY];
3478
3480 float cape[EX][EY];
3481
3483 float cin[EX][EY];
3484
3486 float o3c[EX][EY];
3487
3489 float z[EX][EY][EP];
3490
3492 float t[EX][EY][EP];
3493
3495 float u[EX][EY][EP];
3496
3498 float v[EX][EY][EP];
3499
3501 float w[EX][EY][EP];
3502
3504 float pv[EX][EY][EP];
3505
3507 float h2o[EX][EY][EP];
3508
3510 float o3[EX][EY][EP];
3511
3513 float lwc[EX][EY][EP];
3514
3516 float rwc[EX][EY][EP];
3517
3519 float iwc[EX][EY][EP];
3520
3522 float swc[EX][EY][EP];
3523
3525 float cc[EX][EY][EP];
3526
3528 float pl[EX][EY][EP];
3529
3531 float ul[EX][EY][EP];
3532
3534 float vl[EX][EY][EP];
3535
3537 float wl[EX][EY][EP];
3538
3540 float zetal[EX][EY][EP];
3541
3543 float zeta_dotl[EX][EY][EP];
3544
3545} met_t;
3546
3547/* ------------------------------------------------------------
3548 OpenACC routines...
3549 ------------------------------------------------------------ */
3550
3551#ifdef _OPENACC
3552#pragma acc routine (clim_oh)
3553#pragma acc routine (clim_photo)
3554#pragma acc routine (clim_tropo)
3555#pragma acc routine (clim_ts)
3556#pragma acc routine (clim_zm)
3557#pragma acc routine (intpol_check_lon_lat)
3558#pragma acc routine (intpol_met_4d_coord)
3559#pragma acc routine (intpol_met_space_3d)
3560#pragma acc routine (intpol_met_space_3d_ml)
3561#pragma acc routine (intpol_met_space_2d)
3562#pragma acc routine (intpol_met_time_3d)
3563#pragma acc routine (intpol_met_time_3d_ml)
3564#pragma acc routine (intpol_met_time_2d)
3565#pragma acc routine (kernel_weight)
3566#pragma acc routine (lapse_rate)
3567#pragma acc routine (locate_irr)
3568#pragma acc routine (locate_irr_float)
3569#pragma acc routine (locate_reg)
3570#pragma acc routine (locate_vert)
3571#pragma acc routine (nat_temperature)
3572#pragma acc routine (pbl_weight)
3573#pragma acc routine (sedi)
3574#pragma acc routine (stddev)
3575#pragma acc routine (sza_calc)
3576#pragma acc routine (tropo_weight)
3577#endif
3578
3579/* ------------------------------------------------------------
3580 Functions...
3581 ------------------------------------------------------------ */
3582
3605 void *data,
3606 size_t N);
3607
3622void cart2geo(
3623 const double *x,
3624 double *z,
3625 double *lon,
3626 double *lat);
3627
3650double clim_oh(
3651 const ctl_t * ctl,
3652 const clim_t * clim,
3653 const double t,
3654 const double lon,
3655 const double lat,
3656 const double p);
3657
3677 const ctl_t * ctl,
3678 clim_t * clim);
3679
3709double clim_photo(
3710 const double rate[CP][CSZA][CO3],
3711 const clim_photo_t * photo,
3712 const double p,
3713 const double sza,
3714 const double o3c);
3715
3741double clim_tropo(
3742 const clim_t * clim,
3743 const double t,
3744 const double lat);
3745
3764void clim_tropo_init(
3765 clim_t * clim);
3766
3783double clim_ts(
3784 const clim_ts_t * ts,
3785 const double t);
3786
3808double clim_zm(
3809 const clim_zm_t * zm,
3810 const double t,
3811 const double lat,
3812 const double p);
3813
3855 const ctl_t * ctl,
3856 const char *varname,
3857 float *array,
3858 const size_t nx,
3859 const size_t ny,
3860 const size_t np,
3861 const int decompress,
3862 FILE * inout);
3863
3896void compress_pck(
3897 const char *varname,
3898 float *array,
3899 const size_t nxy,
3900 const size_t nz,
3901 const int decompress,
3902 FILE * inout);
3903
3943 const char *varname,
3944 float *array,
3945 const int nx,
3946 const int ny,
3947 const int nz,
3948 const int precision,
3949 const double tolerance,
3950 const int decompress,
3951 FILE * inout);
3952
3989 const char *varname,
3990 float *array,
3991 const size_t n,
3992 const int decompress,
3993 FILE * inout);
3994
4017void day2doy(
4018 const int year,
4019 const int mon,
4020 const int day,
4021 int *doy);
4022
4044void doy2day(
4045 const int year,
4046 const int doy,
4047 int *mon,
4048 int *day);
4049
4076void fft_help(
4077 double *fcReal,
4078 double *fcImag,
4079 const int n);
4080
4107void geo2cart(
4108 const double z,
4109 const double lon,
4110 const double lat,
4111 double *x);
4112
4137void get_met_help(
4138 const ctl_t * ctl,
4139 const double t,
4140 const int direct,
4141 const char *metbase,
4142 const double dt_met,
4143 char *filename);
4144
4168void get_met_replace(
4169 char *orig,
4170 char *search,
4171 char *repl);
4172
4209void get_tropo(
4210 const int met_tropo,
4211 ctl_t * ctl,
4212 clim_t * clim,
4213 met_t * met,
4214 const double *lons,
4215 const int nx,
4216 const double *lats,
4217 const int ny,
4218 double *pt,
4219 double *zt,
4220 double *tt,
4221 double *qt,
4222 double *o3t,
4223 double *ps,
4224 double *zs);
4225
4247 const double *lons,
4248 const int nlon,
4249 const double *lats,
4250 const int nlat,
4251 const double lon,
4252 const double lat,
4253 double *lon2,
4254 double *lat2);
4255
4298 const met_t * met0,
4299 float height0[EX][EY][EP],
4300 float array0[EX][EY][EP],
4301 const met_t * met1,
4302 float height1[EX][EY][EP],
4303 float array1[EX][EY][EP],
4304 const double ts,
4305 const double height,
4306 const double lon,
4307 const double lat,
4308 double *var,
4309 int *ci,
4310 double *cw,
4311 const int init);
4312
4348 const met_t * met,
4349 float array[EX][EY][EP],
4350 const double p,
4351 const double lon,
4352 const double lat,
4353 double *var,
4354 int *ci,
4355 double *cw,
4356 const int init);
4357
4377 const met_t * met,
4378 float zs[EX][EY][EP],
4379 float vals[EX][EY][EP],
4380 const double z,
4381 const double lon,
4382 const double lat,
4383 double *val);
4384
4420 const met_t * met,
4421 float array[EX][EY],
4422 const double lon,
4423 const double lat,
4424 double *var,
4425 int *ci,
4426 double *cw,
4427 const int init);
4428
4463 const met_t * met0,
4464 float array0[EX][EY][EP],
4465 const met_t * met1,
4466 float array1[EX][EY][EP],
4467 const double ts,
4468 const double p,
4469 const double lon,
4470 const double lat,
4471 double *var,
4472 int *ci,
4473 double *cw,
4474 const int init);
4475
4499 const met_t * met0,
4500 float zs0[EX][EY][EP],
4501 float array0[EX][EY][EP],
4502 const met_t * met1,
4503 float zs1[EX][EY][EP],
4504 float array1[EX][EY][EP],
4505 const double ts,
4506 const double p,
4507 const double lon,
4508 const double lat,
4509 double *var);
4510
4546 const met_t * met0,
4547 float array0[EX][EY],
4548 const met_t * met1,
4549 float array1[EX][EY],
4550 const double ts,
4551 const double lon,
4552 const double lat,
4553 double *var,
4554 int *ci,
4555 double *cw,
4556 const int init);
4557
4595void intpol_tropo_3d(
4596 const double time0,
4597 float array0[EX][EY],
4598 const double time1,
4599 float array1[EX][EY],
4600 const double lons[EX],
4601 const double lats[EY],
4602 const int nlon,
4603 const int nlat,
4604 const double time,
4605 const double lon,
4606 const double lat,
4607 const int method,
4608 double *var,
4609 double *sigma);
4610
4637void jsec2time(
4638 const double jsec,
4639 int *year,
4640 int *mon,
4641 int *day,
4642 int *hour,
4643 int *min,
4644 int *sec,
4645 double *remain);
4646
4673double kernel_weight(
4674 const double kz[EP],
4675 const double kw[EP],
4676 const int nk,
4677 const double p);
4678
4717double lapse_rate(
4718 const double t,
4719 const double h2o);
4720
4750 ctl_t * ctl);
4751
4771int locate_irr(
4772 const double *xx,
4773 const int n,
4774 const double x);
4775
4802 const float *xx,
4803 const int n,
4804 const double x,
4805 const int ig);
4806
4827int locate_reg(
4828 const double *xx,
4829 const int n,
4830 const double x);
4831
4853void locate_vert(
4854 float profiles[EX][EY][EP],
4855 const int np,
4856 const int lon_ap_ind,
4857 const int lat_ap_ind,
4858 const double alt_ap,
4859 int *ind);
4860
4886void module_advect(
4887 const ctl_t * ctl,
4888 const cache_t * cache,
4889 met_t * met0,
4890 met_t * met1,
4891 atm_t * atm);
4892
4916 const ctl_t * ctl,
4917 const cache_t * cache,
4918 met_t * met0,
4919 met_t * met1,
4920 atm_t * atm);
4921
4959 const ctl_t * ctl,
4960 const cache_t * cache,
4961 const clim_t * clim,
4962 met_t * met0,
4963 met_t * met1,
4964 atm_t * atm);
4965
4983void module_chem_grid(
4984 const ctl_t * ctl,
4985 met_t * met0,
4986 met_t * met1,
4987 atm_t * atm,
4988 const double t);
4989
5016void module_chem_init(
5017 const ctl_t * ctl,
5018 const cache_t * cache,
5019 const clim_t * clim,
5020 met_t * met0,
5021 met_t * met1,
5022 atm_t * atm);
5023
5048 const ctl_t * ctl,
5049 cache_t * cache,
5050 met_t * met0,
5051 met_t * met1,
5052 atm_t * atm);
5053
5080void module_decay(
5081 const ctl_t * ctl,
5082 const cache_t * cache,
5083 const clim_t * clim,
5084 atm_t * atm);
5085
5122void module_diff_meso(
5123 const ctl_t * ctl,
5124 cache_t * cache,
5125 met_t * met0,
5126 met_t * met1,
5127 atm_t * atm);
5128
5162void module_diff_pbl(
5163 const ctl_t * ctl,
5164 cache_t * cache,
5165 met_t * met0,
5166 met_t * met1,
5167 atm_t * atm);
5168
5223void module_diff_turb(
5224 const ctl_t * ctl,
5225 cache_t * cache,
5226 const clim_t * clim,
5227 met_t * met0,
5228 met_t * met1,
5229 atm_t * atm);
5230
5250void module_dry_depo(
5251 const ctl_t * ctl,
5252 const cache_t * cache,
5253 met_t * met0,
5254 met_t * met1,
5255 atm_t * atm);
5256
5289void module_h2o2_chem(
5290 const ctl_t * ctl,
5291 const cache_t * cache,
5292 const clim_t * clim,
5293 met_t * met0,
5294 met_t * met1,
5295 atm_t * atm);
5296
5317 const ctl_t * ctl,
5318 cache_t * cache,
5319 met_t * met0,
5320 met_t * met1,
5321 atm_t * atm);
5322
5340void module_isosurf(
5341 const ctl_t * ctl,
5342 const cache_t * cache,
5343 met_t * met0,
5344 met_t * met1,
5345 atm_t * atm);
5346
5379 ctl_t * ctl,
5380 cache_t * cache,
5381 clim_t * clim,
5382 met_t * met0,
5383 met_t * met1,
5384 atm_t * atm);
5385
5404void module_meteo(
5405 const ctl_t * ctl,
5406 const cache_t * cache,
5407 const clim_t * clim,
5408 met_t * met0,
5409 met_t * met1,
5410 atm_t * atm);
5411
5429void module_mixing(
5430 const ctl_t * ctl,
5431 const clim_t * clim,
5432 atm_t * atm,
5433 const double t);
5434
5455 const ctl_t * ctl,
5456 const clim_t * clim,
5457 atm_t * atm,
5458 const int *ixs,
5459 const int *iys,
5460 const int *izs,
5461 const int qnt_idx);
5462
5495void module_oh_chem(
5496 const ctl_t * ctl,
5497 const cache_t * cache,
5498 const clim_t * clim,
5499 met_t * met0,
5500 met_t * met1,
5501 atm_t * atm);
5502
5530void module_position(
5531 const cache_t * cache,
5532 met_t * met0,
5533 met_t * met1,
5534 atm_t * atm);
5535
5560void module_rng_init(
5561 const int ntask);
5562
5588void module_rng(
5589 const ctl_t * ctl,
5590 double *rs,
5591 const size_t n,
5592 const int method);
5593
5616void module_sedi(
5617 const ctl_t * ctl,
5618 const cache_t * cache,
5619 met_t * met0,
5620 met_t * met1,
5621 atm_t * atm);
5622
5646void module_sort(
5647 const ctl_t * ctl,
5648 met_t * met0,
5649 atm_t * atm);
5650
5670void module_sort_help(
5671 double *a,
5672 const int *p,
5673 const int np);
5674
5698void module_timesteps(
5699 const ctl_t * ctl,
5700 cache_t * cache,
5701 met_t * met0,
5702 atm_t * atm,
5703 const double t);
5704
5726 ctl_t * ctl,
5727 const atm_t * atm);
5728
5762 const ctl_t * ctl,
5763 const cache_t * cache,
5764 const clim_t * clim,
5765 met_t * met0,
5766 met_t * met1,
5767 atm_t * atm);
5768
5798void module_wet_depo(
5799 const ctl_t * ctl,
5800 const cache_t * cache,
5801 met_t * met0,
5802 met_t * met1,
5803 atm_t * atm);
5804
5835void mptrac_alloc(
5836 ctl_t ** ctl,
5837 cache_t ** cache,
5838 clim_t ** clim,
5839 met_t ** met0,
5840 met_t ** met1,
5841 atm_t ** atm);
5842
5872void mptrac_free(
5873 ctl_t * ctl,
5874 cache_t * cache,
5875 clim_t * clim,
5876 met_t * met0,
5877 met_t * met1,
5878 atm_t * atm);
5879
5914void mptrac_get_met(
5915 ctl_t * ctl,
5916 clim_t * clim,
5917 const double t,
5918 met_t ** met0,
5919 met_t ** met1);
5920
5940void mptrac_init(
5941 ctl_t * ctl,
5942 cache_t * cache,
5943 clim_t * clim,
5944 atm_t * atm,
5945 const int ntask);
5946
5982int mptrac_read_atm(
5983 const char *filename,
5984 const ctl_t * ctl,
5985 atm_t * atm);
5986
6018void mptrac_read_clim(
6019 const ctl_t * ctl,
6020 clim_t * clim);
6021
6051void mptrac_read_ctl(
6052 const char *filename,
6053 int argc,
6054 char *argv[],
6055 ctl_t * ctl);
6056
6085int mptrac_read_met(
6086 const char *filename,
6087 const ctl_t * ctl,
6088 const clim_t * clim,
6089 met_t * met);
6090
6111 ctl_t * ctl,
6112 cache_t * cache,
6113 clim_t * clim,
6114 met_t ** met0,
6115 met_t ** met1,
6116 atm_t * atm,
6117 double t);
6118
6148void mptrac_write_atm(
6149 const char *filename,
6150 const ctl_t * ctl,
6151 const atm_t * atm,
6152 const double t);
6153
6189void mptrac_write_met(
6190 const char *filename,
6191 const ctl_t * ctl,
6192 met_t * met);
6193
6228 const char *dirname,
6229 const ctl_t * ctl,
6230 met_t * met0,
6231 met_t * met1,
6232 atm_t * atm,
6233 const double t);
6234
6266 const ctl_t * ctl,
6267 const cache_t * cache,
6268 const clim_t * clim,
6269 met_t ** met0,
6270 met_t ** met1,
6271 const atm_t * atm);
6272
6303 const ctl_t * ctl,
6304 const cache_t * cache,
6305 const clim_t * clim,
6306 met_t ** met0,
6307 met_t ** met1,
6308 const atm_t * atm);
6309
6337double nat_temperature(
6338 const double p,
6339 const double h2o,
6340 const double hno3);
6341
6362double pbl_weight(
6363 const ctl_t * ctl,
6364 const atm_t * atm,
6365 const int ip,
6366 const double pbl,
6367 const double ps);
6368
6401int read_atm_asc(
6402 const char *filename,
6403 const ctl_t * ctl,
6404 atm_t * atm);
6405
6436int read_atm_bin(
6437 const char *filename,
6438 const ctl_t * ctl,
6439 atm_t * atm);
6440
6465int read_atm_clams(
6466 const char *filename,
6467 const ctl_t * ctl,
6468 atm_t * atm);
6469
6499int read_atm_nc(
6500 const char *filename,
6501 const ctl_t * ctl,
6502 atm_t * atm);
6503
6532void read_clim_photo(
6533 const char *filename,
6534 clim_photo_t * photo);
6535
6553 const int ncid,
6554 const char *varname,
6555 const clim_photo_t * photo,
6556 double var[CP][CSZA][CO3]);
6557
6581int read_clim_ts(
6582 const char *filename,
6583 clim_ts_t * ts);
6584
6611void read_clim_zm(
6612 const char *filename,
6613 const char *varname,
6614 clim_zm_t * zm);
6615
6643void read_kernel(
6644 const char *filename,
6645 double kz[EP],
6646 double kw[EP],
6647 int *nk);
6648
6680int read_met_bin(
6681 const char *filename,
6682 const ctl_t * ctl,
6683 met_t * met);
6684
6710void read_met_bin_2d(
6711 FILE * in,
6712 const met_t * met,
6713 float var[EX][EY],
6714 const char *varname);
6715
6753void read_met_bin_3d(
6754 FILE * in,
6755 const ctl_t * ctl,
6756 const met_t * met,
6757 float var[EX][EY][EP],
6758 const char *varname,
6759 const float bound_min,
6760 const float bound_max);
6761
6788void read_met_cape(
6789 const ctl_t * ctl,
6790 const clim_t * clim,
6791 met_t * met);
6792
6815void read_met_cloud(
6816 met_t * met);
6817
6843void read_met_detrend(
6844 const ctl_t * ctl,
6845 met_t * met);
6846
6870 met_t * met);
6871
6898void read_met_geopot(
6899 const ctl_t * ctl,
6900 met_t * met);
6901
6933void read_met_grid(
6934 const char *filename,
6935 const int ncid,
6936 const ctl_t * ctl,
6937 met_t * met);
6938
6969void read_met_levels(
6970 const int ncid,
6971 const ctl_t * ctl,
6972 met_t * met);
6973
7002void read_met_ml2pl(
7003 const ctl_t * ctl,
7004 const met_t * met,
7005 float var[EX][EY][EP],
7006 const char *varname);
7007
7030 const ctl_t * ctl,
7031 met_t * met);
7032
7064int read_met_nc(
7065 const char *filename,
7066 const ctl_t * ctl,
7067 const clim_t * clim,
7068 met_t * met);
7069
7099int read_met_nc_2d(
7100 const int ncid,
7101 const char *varname,
7102 const char *varname2,
7103 const char *varname3,
7104 const char *varname4,
7105 const char *varname5,
7106 const char *varname6,
7107 const ctl_t * ctl,
7108 const met_t * met,
7109 float dest[EX][EY],
7110 const float scl,
7111 const int init);
7112
7143int read_met_nc_3d(
7144 const int ncid,
7145 const char *varname,
7146 const char *varname2,
7147 const char *varname3,
7148 const char *varname4,
7149 const ctl_t * ctl,
7150 const met_t * met,
7151 float dest[EX][EY][EP],
7152 const float scl);
7153
7199void read_met_pbl(
7200 const ctl_t * ctl,
7201 met_t * met);
7202
7235 met_t * met);
7236
7267 met_t * met);
7268
7299void read_met_pv(
7300 met_t * met);
7301
7324void read_met_ozone(
7325 met_t * met);
7326
7355void read_met_sample(
7356 const ctl_t * ctl,
7357 met_t * met);
7358
7399void read_met_surface(
7400 const int ncid,
7401 const ctl_t * ctl,
7402 met_t * met);
7403
7432void read_met_tropo(
7433 const ctl_t * ctl,
7434 const clim_t * clim,
7435 met_t * met);
7436
7468void read_obs(
7469 const char *filename,
7470 const ctl_t * ctl,
7471 double *rt,
7472 double *rz,
7473 double *rlon,
7474 double *rlat,
7475 double *robs,
7476 int *nobs);
7477
7505void read_obs_asc(
7506 const char *filename,
7507 double *rt,
7508 double *rz,
7509 double *rlon,
7510 double *rlat,
7511 double *robs,
7512 int *nobs);
7513
7540void read_obs_nc(
7541 const char *filename,
7542 double *rt,
7543 double *rz,
7544 double *rlon,
7545 double *rlat,
7546 double *robs,
7547 int *nobs);
7548
7582double scan_ctl(
7583 const char *filename,
7584 int argc,
7585 char *argv[],
7586 const char *varname,
7587 const int arridx,
7588 const char *defvalue,
7589 char *value);
7590
7617double sedi(
7618 const double p,
7619 const double T,
7620 const double rp,
7621 const double rhop);
7622
7652void spline(
7653 const double *x,
7654 const double *y,
7655 const int n,
7656 const double *x2,
7657 double *y2,
7658 const int n2,
7659 const int method);
7660
7683float stddev(
7684 const float *data,
7685 const int n);
7686
7706double sza_calc(
7707 const double sec,
7708 const double lon,
7709 const double lat);
7710
7735void time2jsec(
7736 const int year,
7737 const int mon,
7738 const int day,
7739 const int hour,
7740 const int min,
7741 const int sec,
7742 const double remain,
7743 double *jsec);
7744
7773void timer(
7774 const char *name,
7775 const char *group,
7776 const int output);
7777
7803double time_from_filename(
7804 const char *filename,
7805 const int offset);
7806
7824double tropo_weight(
7825 const clim_t * clim,
7826 const atm_t * atm,
7827 const int ip);
7828
7851void write_atm_asc(
7852 const char *filename,
7853 const ctl_t * ctl,
7854 const atm_t * atm,
7855 const double t);
7856
7880void write_atm_bin(
7881 const char *filename,
7882 const ctl_t * ctl,
7883 const atm_t * atm);
7884
7908void write_atm_clams(
7909 const char *filename,
7910 const ctl_t * ctl,
7911 const atm_t * atm);
7912
7938 const char *dirname,
7939 const ctl_t * ctl,
7940 const atm_t * atm,
7941 const double t);
7942
7966void write_atm_nc(
7967 const char *filename,
7968 const ctl_t * ctl,
7969 const atm_t * atm);
7970
7999void write_csi(
8000 const char *filename,
8001 const ctl_t * ctl,
8002 const atm_t * atm,
8003 const double t);
8004
8032void write_ens(
8033 const char *filename,
8034 const ctl_t * ctl,
8035 const atm_t * atm,
8036 const double t);
8037
8076void write_grid(
8077 const char *filename,
8078 const ctl_t * ctl,
8079 met_t * met0,
8080 met_t * met1,
8081 const atm_t * atm,
8082 const double t);
8083
8129void write_grid_asc(
8130 const char *filename,
8131 const ctl_t * ctl,
8132 const double *cd,
8133 double *mean[NQ],
8134 double *sigma[NQ],
8135 const double *vmr_impl,
8136 const double t,
8137 const double *z,
8138 const double *lon,
8139 const double *lat,
8140 const double *area,
8141 const double dz,
8142 const int *np);
8143
8186void write_grid_nc(
8187 const char *filename,
8188 const ctl_t * ctl,
8189 const double *cd,
8190 double *mean[NQ],
8191 double *sigma[NQ],
8192 const double *vmr_impl,
8193 const double t,
8194 const double *z,
8195 const double *lon,
8196 const double *lat,
8197 const double *area,
8198 const double dz,
8199 const int *np);
8200
8230void write_met_bin(
8231 const char *filename,
8232 const ctl_t * ctl,
8233 met_t * met);
8234
8262void write_met_bin_2d(
8263 FILE * out,
8264 met_t * met,
8265 float var[EX][EY],
8266 const char *varname);
8267
8305void write_met_bin_3d(
8306 FILE * out,
8307 const ctl_t * ctl,
8308 met_t * met,
8309 float var[EX][EY][EP],
8310 const char *varname,
8311 const int precision,
8312 const double tolerance);
8313
8341void write_met_nc(
8342 const char *filename,
8343 const ctl_t * ctl,
8344 met_t * met);
8345
8370void write_met_nc_2d(
8371 const int ncid,
8372 const char *varname,
8373 met_t * met,
8374 float var[EX][EY],
8375 const float scl);
8376
8402void write_met_nc_3d(
8403 const int ncid,
8404 const char *varname,
8405 met_t * met,
8406 float var[EX][EY][EP],
8407 const float scl);
8408
8439void write_prof(
8440 const char *filename,
8441 const ctl_t * ctl,
8442 met_t * met0,
8443 met_t * met1,
8444 const atm_t * atm,
8445 const double t);
8446
8478void write_sample(
8479 const char *filename,
8480 const ctl_t * ctl,
8481 met_t * met0,
8482 met_t * met1,
8483 const atm_t * atm,
8484 const double t);
8485
8512void write_station(
8513 const char *filename,
8514 const ctl_t * ctl,
8515 atm_t * atm,
8516 const double t);
8517
8546void write_vtk(
8547 const char *filename,
8548 const ctl_t * ctl,
8549 const atm_t * atm,
8550 const double t);
8551
8552#endif /* LIBTRAC_H */
void read_met_geopot(const ctl_t *ctl, met_t *met)
Calculates geopotential heights from meteorological data.
Definition: mptrac.c:6993
#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:5677
void day2doy(const int year, const int mon, const int day, int *doy)
Get day of year from date.
Definition: mptrac.c:900
void read_met_extrapolate(met_t *met)
Extrapolates meteorological data.
Definition: mptrac.c:6953
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:7253
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:7581
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:9485
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:10845
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:4195
void read_met_sample(const ctl_t *ctl, met_t *met)
Downsamples meteorological data based on specified parameters.
Definition: mptrac.c:8348
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:10606
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:8828
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:2084
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:3922
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:5373
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:3238
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:6101
void read_met_cloud(met_t *met)
Calculates cloud-related variables for each grid point.
Definition: mptrac.c:6792
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:2624
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:9001
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:1462
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:1395
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:6068
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:7956
void read_met_detrend(const ctl_t *ctl, met_t *met)
Detrends meteorological data.
Definition: mptrac.c:6849
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:7652
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:8656
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:8872
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:2509
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:2045
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:1095
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:2064
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:4268
void read_met_monotonize(const ctl_t *ctl, met_t *met)
Makes zeta and pressure profiles monotone.
Definition: mptrac.c:7496
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:6220
void read_met_periodic(met_t *met)
Applies periodic boundary conditions to meteorological data along longitudinal axis.
Definition: mptrac.c:8093
void module_timesteps_init(ctl_t *ctl, const atm_t *atm)
Initialize start time and time interval for time-stepping.
Definition: mptrac.c:3959
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:9954
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:3342
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:6192
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:7454
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:8900
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:7121
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:6562
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:1981
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:3063
void level_definitions(ctl_t *ctl)
Defines pressure levels for meteorological data.
Definition: mptrac.c:1775
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:10242
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:5565
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:9143
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:4389
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:1520
void fft_help(double *fcReal, double *fcImag, const int n)
Computes the Fast Fourier Transform (FFT) of a complex sequence.
Definition: mptrac.c:949
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:4060
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:665
double nat_temperature(const double p, const double h2o, const double hno3)
Calculates the nitric acid trihydrate (NAT) temperature.
Definition: mptrac.c:5868
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:9034
#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:6274
#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:3797
void timer(const char *name, const char *group, const int output)
Measures and reports elapsed time for named and grouped timers.
Definition: mptrac.c:9174
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:9300
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:1337
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:8520
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:1549
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:2551
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:6373
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:2266
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:8929
#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:2239
void module_sort_help(double *a, const int *p, const int np)
Reorder an array based on a given permutation.
Definition: mptrac.c:3886
float stddev(const float *data, const int n)
Calculates the standard deviation of a set of data.
Definition: mptrac.c:9081
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:1607
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:7810
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:6591
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:2011
double time_from_filename(const char *filename, const int offset)
Extracts and converts a timestamp from a filename to Julian seconds.
Definition: mptrac.c:9242
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:10904
void mptrac_read_clim(const ctl_t *ctl, clim_t *clim)
Reads various climatological data and populates the given climatology structure.
Definition: mptrac.c:4479
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:2362
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:9277
void write_met_nc(const char *filename, const ctl_t *ctl, met_t *met)
Writes meteorological data to a NetCDF file.
Definition: mptrac.c:10682
void module_rng_init(const int ntask)
Initialize random number generators for parallel tasks.
Definition: mptrac.c:3661
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:4408
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:1165
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:5621
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:5777
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:8319
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:4242
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:3692
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:1006
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:11293
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:9102
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:3432
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:919
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:1574
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:3610
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:10577
void read_met_pv(met_t *met)
Calculates potential vorticity (PV) from meteorological data.
Definition: mptrac.c:8213
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:5956
void get_met_replace(char *orig, char *search, char *repl)
Replaces occurrences of a substring in a string with another substring.
Definition: mptrac.c:1071
#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:2663
void module_sort(const ctl_t *ctl, met_t *met0, atm_t *atm)
Sort particles according to box index.
Definition: mptrac.c:3826
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:1698
int read_met_bin(const char *filename, const ctl_t *ctl, met_t *met)
Reads meteorological data from a binary file.
Definition: mptrac.c:6414
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:5428
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:9432
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:2865
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:6012
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:11379
#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:3990
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:4539
void read_met_polar_winds(met_t *met)
Applies a fix for polar winds in meteorological data.
Definition: mptrac.c:8154
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:2980
void compress_zstd(const char *varname, float *array, const size_t n, const int decompress, FILE *inout)
Compresses or decompresses an array of floats using the Zstandard (ZSTD) library.
void write_grid_nc(const char *filename, const ctl_t *ctl, const double *cd, double *mean[NQ], double *sigma[NQ], const double *vmr_impl, const double t, const double *z, const double *lon, const double *lat, const double *area, const double dz, const int *np)
Writes grid data to a NetCDF file.
Definition: mptrac.c:10346
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:5892
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:2740
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:10874
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:3133
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:3526
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:988
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:1731
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:5914
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:1138
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:11131
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:10051
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:2917
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:10476
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:9382
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:6677
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:5737
#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:1757
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:9692
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:9643
Air parcel data.
Definition: mptrac.h:3160
int np
Number of air parcels.
Definition: mptrac.h:3163
Cache data structure.
Definition: mptrac.h:3188
int iso_n
Isosurface balloon number of data points.
Definition: mptrac.h:3200
Climatological data in the form of photolysis rates.
Definition: mptrac.h:3220
int nsza
Number of solar zenith angles.
Definition: mptrac.h:3226
int np
Number of pressure levels.
Definition: mptrac.h:3223
int no3c
Number of total ozone columns.
Definition: mptrac.h:3229
Climatological data.
Definition: mptrac.h:3328
clim_ts_t ccl2f2
CFC-12 time series.
Definition: mptrac.h:3370
clim_photo_t photo
Photolysis rates.
Definition: mptrac.h:3346
clim_zm_t ho2
HO2 zonal means.
Definition: mptrac.h:3358
clim_zm_t hno3
HNO3 zonal means.
Definition: mptrac.h:3349
int tropo_ntime
Number of tropopause timesteps.
Definition: mptrac.h:3331
clim_ts_t sf6
SF6 time series.
Definition: mptrac.h:3376
clim_ts_t ccl4
CFC-10 time series.
Definition: mptrac.h:3364
clim_ts_t ccl3f
CFC-11 time series.
Definition: mptrac.h:3367
clim_zm_t o1d
O(1D) zonal means.
Definition: mptrac.h:3361
clim_zm_t h2o2
H2O2 zonal means.
Definition: mptrac.h:3355
int tropo_nlat
Number of tropopause latitudes.
Definition: mptrac.h:3334
clim_zm_t oh
OH zonal means.
Definition: mptrac.h:3352
clim_ts_t n2o
N2O time series.
Definition: mptrac.h:3373
Climatological data in the form of time series.
Definition: mptrac.h:3276
int ntime
Number of timesteps.
Definition: mptrac.h:3279
Climatological data in the form of zonal means.
Definition: mptrac.h:3296
int np
Number of pressure levels.
Definition: mptrac.h:3305
int ntime
Number of timesteps.
Definition: mptrac.h:3299
int nlat
Number of latitudes.
Definition: mptrac.h:3302
Control parameters.
Definition: mptrac.h:2169
double grid_z0
Lower altitude of gridded data [km].
Definition: mptrac.h:3040
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:3004
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:2892
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:2980
double molmass
Molar mass [g/mol].
Definition: mptrac.h:2754
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:2817
double chemgrid_z1
Upper altitude of chemistry grid [km].
Definition: mptrac.h:2841
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:2974
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:2742
double csi_lon1
Upper longitude of gridded CSI data [deg].
Definition: mptrac.h:2995
int qnt_u
Quantity array index for zonal wind.
Definition: mptrac.h:2269
double stat_lon
Longitude of station [deg].
Definition: mptrac.h:3118
double mixing_trop
Interparcel exchange parameter for mixing in the troposphere.
Definition: mptrac.h:2802
double sort_dt
Time step for sorting of particle data [s].
Definition: mptrac.h:2653
double mixing_z1
Upper altitude of mixing grid [km].
Definition: mptrac.h:2814
double stat_r
Search radius around station [km].
Definition: mptrac.h:3124
double wet_depo_bc_a
Coefficient A for wet deposition below cloud (exponential form).
Definition: mptrac.h:2886
int csi_ny
Number of latitudes of gridded CSI data.
Definition: mptrac.h:2998
int vtk_sphere
Spherical projection for VTK data (0=no, 1=yes).
Definition: mptrac.h:3148
double chemgrid_z0
Lower altitude of chemistry grid [km].
Definition: mptrac.h:2838
double met_pbl_min
Minimum depth of planetary boundary layer [km].
Definition: mptrac.h:2621
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:2856
double conv_cape
CAPE threshold for convection module [J/kg].
Definition: mptrac.h:2706
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:2543
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:3043
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:2573
double met_dt_out
Time step for sampling of meteo data along trajectories [s].
Definition: mptrac.h:2640
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:2989
double csi_lat0
Lower latitude of gridded CSI data [deg].
Definition: mptrac.h:3001
double turb_dz_trop
Vertical turbulent diffusion coefficient (troposphere) [m^2/s].
Definition: mptrac.h:2688
int met_pbl
Planetary boundary layer data (0=file, 1=z2p, 2=Richardson, 3=theta).
Definition: mptrac.h:2618
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:2697
int grid_nc_level
zlib compression level of netCDF grid data files (0=off).
Definition: mptrac.h:3028
int grid_nx
Number of longitudes of gridded data.
Definition: mptrac.h:3046
int atm_type
Type of atmospheric data files (0=ASCII, 1=binary, 2=netCDF, 3=CLaMS_traj, 4=CLaMS_pos).
Definition: mptrac.h:2945
double bound_mass
Boundary conditions mass per particle [kg].
Definition: mptrac.h:2715
double grid_lat0
Lower latitude of gridded data [deg].
Definition: mptrac.h:3058
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:2546
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:3049
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:2637
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:2859
int met_geopot_sy
Latitudinal smoothing of geopotential heights.
Definition: mptrac.h:2609
double met_cms_eps_u
cmultiscale compression epsilon for zonal wind.
Definition: mptrac.h:2534
double turb_dx_strat
Horizontal turbulent diffusion coefficient (stratosphere) [m^2/s].
Definition: mptrac.h:2682
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:2730
double stat_t1
Stop time for station output [s].
Definition: mptrac.h:3130
double turb_dx_trop
Horizontal turbulent diffusion coefficient (troposphere) [m^2/s].
Definition: mptrac.h:2679
int grid_type
Type of grid data files (0=ASCII, 1=netCDF).
Definition: mptrac.h:3064
double csi_lon0
Lower longitude of gridded CSI data [deg].
Definition: mptrac.h:2992
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:3034
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:2847
int bound_pbl
Boundary conditions planetary boundary layer (0=no, 1=yes).
Definition: mptrac.h:2748
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:2606
int met_sy
Smoothing for latitudes.
Definition: mptrac.h:2579
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:2670
int isosurf
Isosurface parameter (0=none, 1=pressure, 2=density, 3=theta, 4=balloon).
Definition: mptrac.h:2657
double bound_p1
Boundary conditions top pressure [hPa].
Definition: mptrac.h:2736
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:3073
double csi_dt_out
Time step for CSI output [s].
Definition: mptrac.h:2968
int met_cape
Convective available potential energy data (0=file, 1=calculate).
Definition: mptrac.h:2615
double csi_modmin
Minimum column density to trigger detection [kg/m^2].
Definition: mptrac.h:2977
int met_sx
Smoothing for longitudes.
Definition: mptrac.h:2576
double chemgrid_lon1
Upper longitude of chemistry grid [deg].
Definition: mptrac.h:2850
double turb_mesox
Horizontal scaling factor for mesoscale wind fluctuations.
Definition: mptrac.h:2694
double met_cms_eps_iwc
cmultiscale compression epsilon for cloud ice water content.
Definition: mptrac.h:2558
double met_cms_eps_swc
cmultiscale compression epsilon for cloud snow water content.
Definition: mptrac.h:2561
int met_zfp_prec
ZFP compression precision for all variables, except z and T.
Definition: mptrac.h:2509
double met_cms_eps_v
cmultiscale compression epsilon for meridional wind.
Definition: mptrac.h:2537
double prof_z0
Lower altitude of gridded profile data [km].
Definition: mptrac.h:3076
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:2721
double met_tropo_pv
Dynamical tropopause potential vorticity threshold [PVU].
Definition: mptrac.h:2631
int prof_nx
Number of longitudes of gridded profile data.
Definition: mptrac.h:3082
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:2628
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:2646
double mixing_strat
Interparcel exchange parameter for mixing in the stratosphere.
Definition: mptrac.h:2805
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:2986
double stat_t0
Start time for station output [s].
Definition: mptrac.h:3127
double oh_chem_beta
Beta parameter for diurnal variablity of OH.
Definition: mptrac.h:2868
double wet_depo_so2_ph
pH value used to calculate effective Henry constant of SO2.
Definition: mptrac.h:2904
double mixing_z0
Lower altitude of mixing grid [km].
Definition: mptrac.h:2811
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:2950
int met_nlev
Number of meteo data model levels.
Definition: mptrac.h:2597
double dt_kpp
Time step for KPP chemistry [s].
Definition: mptrac.h:2877
double dry_depo_dp
Dry deposition surface layer [hPa].
Definition: mptrac.h:2913
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:3136
double t_stop
Stop time of simulation [s].
Definition: mptrac.h:2470
double conv_dt
Time interval for convection module [s].
Definition: mptrac.h:2712
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:2564
double bound_lat0
Boundary conditions minimum longitude [deg].
Definition: mptrac.h:2727
double met_pbl_max
Maximum depth of planetary boundary layer [km].
Definition: mptrac.h:2624
int met_dx
Stride for longitudes.
Definition: mptrac.h:2567
int mixing_ny
Number of latitudes of mixing grid.
Definition: mptrac.h:2826
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:2880
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:2673
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:3145
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:2724
int met_cache
Preload meteo data into disk cache (0=no, 1=yes).
Definition: mptrac.h:2643
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:2594
int oh_chem_reaction
Reaction type for OH chemistry (0=none, 2=bimolecular, 3=termolecular).
Definition: mptrac.h:2862
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:3091
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:3112
double tdec_strat
Life time of particles in the stratosphere [s].
Definition: mptrac.h:2760
int obs_type
Type of observation data files (0=ASCII, 1=netCDF).
Definition: mptrac.h:2959
double met_cms_eps_lwc
cmultiscale compression epsilon for cloud liquid water content.
Definition: mptrac.h:2552
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:2528
double grid_lon1
Upper longitude of gridded data [deg].
Definition: mptrac.h:3052
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:2829
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:2663
double prof_z1
Upper altitude of gridded profile data [km].
Definition: mptrac.h:3079
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:2938
int kpp_chem
Switch for KPP chemistry module (0=off, 1=on).
Definition: mptrac.h:2874
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:2703
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:2983
int qnt_lapse
Quantity array index for lapse rate.
Definition: mptrac.h:2392
double stat_lat
Latitude of station [deg].
Definition: mptrac.h:3121
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:3055
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:2585
int conv_mix_pbl
Vertical mixing in the PBL (0=off, 1=on).
Definition: mptrac.h:2700
double bound_dps
Boundary conditions surface layer depth [hPa].
Definition: mptrac.h:2739
double met_cms_eps_t
cmultiscale compression epsilon for temperature.
Definition: mptrac.h:2531
int chemgrid_nz
Number of altitudes of chemistry grid.
Definition: mptrac.h:2835
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:2718
int mixing_nz
Number of altitudes of mixing grid.
Definition: mptrac.h:2808
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:2733
double mixing_lon0
Lower longitude of mixing grid [deg].
Definition: mptrac.h:2820
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:3037
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:3010
int atm_stride
Particle index stride for atmospheric data files.
Definition: mptrac.h:2941
int met_relhum
Try to read relative humidity (0=no, 1=yes).
Definition: mptrac.h:2612
double mixing_lat1
Upper latitude of mixing grid [deg].
Definition: mptrac.h:2832
double atm_dt_out
Time step for atmospheric data output [s].
Definition: mptrac.h:2935
double prof_lat1
Upper latitude of gridded profile data [deg].
Definition: mptrac.h:3097
int met_cms_batch
cmultiscale batch size.
Definition: mptrac.h:2518
double psc_h2o
H2O volume mixing ratio for PSC analysis.
Definition: mptrac.h:2919
int met_sp
Smoothing for pressure levels.
Definition: mptrac.h:2582
double prof_lon0
Lower longitude of gridded profile data [deg].
Definition: mptrac.h:3085
int chemgrid_nx
Number of longitudes of chemistry grid.
Definition: mptrac.h:2844
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:3094
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:2922
double prof_lon1
Upper longitude of gridded profile data [deg].
Definition: mptrac.h:3088
double met_cms_eps_rwc
cmultiscale compression epsilon for cloud rain water content.
Definition: mptrac.h:2555
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:2871
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:2910
int chemgrid_ny
Number of latitudes of chemistry grid.
Definition: mptrac.h:2853
double met_cms_eps_o3
cmultiscale compression epsilon for ozone.
Definition: mptrac.h:2549
int met_cms_zstd
cmultiscale zstd compression (0=off, 1=on).
Definition: mptrac.h:2521
int grid_sparse
Sparse output in grid data files (0=no, 1=yes).
Definition: mptrac.h:3025
double dry_depo_vdep
Dry deposition velocity [m/s].
Definition: mptrac.h:2916
int qnt_tt
Quantity array index for tropopause temperature.
Definition: mptrac.h:2248
int met_np
Number of target pressure levels.
Definition: mptrac.h:2588
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:2512
double mixing_dt
Time interval for mixing [s].
Definition: mptrac.h:2799
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:2515
double vtk_scale
Vertical scaling factor for VTK data.
Definition: mptrac.h:3142
double met_cms_eps_w
cmultiscale compression epsilon for vertical velocity.
Definition: mptrac.h:2540
double turb_dx_pbl
Horizontal turbulent diffusion coefficient (PBL) [m^2/s].
Definition: mptrac.h:2676
double conv_cin
CIN threshold for convection module [J/kg].
Definition: mptrac.h:2709
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:2667
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:2823
int atm_nc_level
zlib compression level of netCDF atmospheric data files (0=off).
Definition: mptrac.h:2953
int met_cms_heur
cmultiscale coarsening heuristics (0=default, 1=mean diff, 2=median diff, 3=max diff).
Definition: mptrac.h:2525
double wet_depo_ic_ret_ratio
Coefficients for wet deposition in cloud: retention ratio.
Definition: mptrac.h:2907
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:2895
double wet_depo_bc_b
Coefficient B for wet deposition below cloud (exponential form).
Definition: mptrac.h:2889
int met_dy
Stride for latitudes.
Definition: mptrac.h:2570
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:2691
double bound_zetas
Boundary conditions surface layer zeta [K].
Definition: mptrac.h:2745
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:2634
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:2757
double sample_dx
Horizontal radius for sample output [km].
Definition: mptrac.h:3109
int vtk_stride
Particle index stride for VTK data.
Definition: mptrac.h:3139
double turb_dz_pbl
Vertical turbulent diffusion coefficient (PBL) [m^2/s].
Definition: mptrac.h:2685
double grid_lat1
Upper latitude of gridded data [deg].
Definition: mptrac.h:3061
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:3022
int qnt_tdew
Quantity array index for dew point temperature.
Definition: mptrac.h:2404
Meteo data structure.
Definition: mptrac.h:3387
int nx
Number of longitudes.
Definition: mptrac.h:3393
int ny
Number of latitudes.
Definition: mptrac.h:3396
int np
Number of pressure levels.
Definition: mptrac.h:3399
int npl
Number of model levels.
Definition: mptrac.h:3402
double time
Time [s].
Definition: mptrac.h:3390