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-2026 Forschungszentrum Juelich GmbH
18*/
19
166#ifndef LIBTRAC_H
167#define LIBTRAC_H
168
169/* ------------------------------------------------------------
170 Includes...
171 ------------------------------------------------------------ */
172
173#include <ctype.h>
174#include <gsl/gsl_fft_complex.h>
175#include <gsl/gsl_randist.h>
176#include <gsl/gsl_rng.h>
177#include <gsl/gsl_sort.h>
178#include <gsl/gsl_spline.h>
179#include <gsl/gsl_statistics.h>
180#include <math.h>
181#include <netcdf.h>
182#include <omp.h>
183#include <stdint.h>
184#include <stdio.h>
185#include <stdlib.h>
186#include <string.h>
187#include <time.h>
188#include <sys/time.h>
189
190#ifdef MPI
191#include "mpi.h"
192#endif
193
194#ifdef DD
195#include <netcdf_par.h>
196#endif
197
198#ifdef _OPENACC
199#include "openacc.h"
200#endif
201
202#ifdef CURAND
203#include "curand.h"
204#endif
205
206#ifdef THRUST
207#include "thrustsort.h"
208#endif
209
210#ifdef ZFP
211#include "zfp.h"
212#endif
213
214#ifdef ZSTD
215#include "zstd.h"
216#endif
217
218#ifdef LZ4
219#include "lz4.h"
220#endif
221
222#ifdef SZ3
223#include "SZ3c/sz3c.h"
224#endif
225
226#ifdef CMS
227#include "cmultiscale.h"
228#endif
229
230#ifdef KPP
231#include "chem_Parameters.h"
232#include "chem_Global.h"
233#include "chem_Sparse.h"
234#endif
235
236#ifdef ECCODES
237#include "eccodes.h"
238#else
240#define codes_handle void*
241#endif
242
243/* ------------------------------------------------------------
244 Constants...
245 ------------------------------------------------------------ */
246
248#ifndef AVO
249#define AVO 6.02214076e23
250#endif
251
253#ifndef CPD
254#define CPD 1003.5
255#endif
256
258#ifndef EPS
259#define EPS (MH2O / MA)
260#endif
261
263#ifndef G0
264#define G0 9.80665
265#endif
266
268#ifndef H0
269#define H0 7.0
270#endif
271
273#ifndef LV
274#define LV 2501000.
275#endif
276
278#ifndef KARMAN
279#define KARMAN 0.40
280#endif
281
283#ifndef KB
284#define KB 1.3806504e-23
285#endif
286
288#ifndef MA
289#define MA 28.9644
290#endif
291
293#ifndef MH2O
294#define MH2O 18.01528
295#endif
296
298#ifndef MO3
299#define MO3 48.00
300#endif
301
303#ifndef P0
304#define P0 1013.25
305#endif
306
308#ifndef RA
309#define RA (1e3 * RI / MA)
310#endif
311
313#ifndef RE
314#define RE 6367.421
315#endif
316
318#ifndef RI
319#define RI 8.3144598
320#endif
321
323#ifndef KAPPA
324#define KAPPA 0.286
325#endif
326
328#ifndef OMEGA_EARTH
329#define OMEGA_EARTH 7.2921e-5
330#endif
331
333#ifndef DOBSON_UNIT
334#define DOBSON_UNIT 2.1415e-5
335#endif
336
338#ifndef M_AIR_MOLECULE
339#define M_AIR_MOLECULE 4.8096e-26
340#endif
341
343#ifndef CHEM_REF_TEMP
344#define CHEM_REF_TEMP 298.15
345#endif
346
348#ifndef H2O2_SO2_RATE_REF
349#define H2O2_SO2_RATE_REF 9.1e7
350#endif
351
353#ifndef H2O2_SO2_RATE_TEMP
354#define H2O2_SO2_RATE_TEMP 29700.
355#endif
356
358#ifndef SO2_HENRY_REF
359#define SO2_HENRY_REF 1.3e-2
360#endif
361
363#ifndef SO2_HENRY_TEMP
364#define SO2_HENRY_TEMP 2900.
365#endif
366
368#ifndef H2O2_HENRY_REF
369#define H2O2_HENRY_REF 8.3e2
370#endif
371
373#ifndef H2O2_HENRY_TEMP
374#define H2O2_HENRY_TEMP 7600.
375#endif
376
378#ifndef SO2_CORR_A
379#define SO2_CORR_A 3.12541941e-06
380#endif
381
383#ifndef SO2_CORR_B
384#define SO2_CORR_B -5.72532259e-01
385#endif
386
388#ifndef O1D_RATE_CCL4_A
389#define O1D_RATE_CCL4_A 3.30e-10
390#endif
391
393#ifndef O1D_RATE_CCL4_B
394#define O1D_RATE_CCL4_B 0.
395#endif
396
398#ifndef O1D_RATE_CFC11_A
399#define O1D_RATE_CFC11_A 2.30e-10
400#endif
401
403#ifndef O1D_RATE_CFC11_B
404#define O1D_RATE_CFC11_B 0.
405#endif
406
408#ifndef O1D_RATE_CFC12_A
409#define O1D_RATE_CFC12_A 1.40e-10
410#endif
411
413#ifndef O1D_RATE_CFC12_B
414#define O1D_RATE_CFC12_B -25.
415#endif
416
418#ifndef O1D_RATE_N2O_A
419#define O1D_RATE_N2O_A 1.19e-10
420#endif
421
423#ifndef O1D_RATE_N2O_B
424#define O1D_RATE_N2O_B -20.
425#endif
426
428#ifndef SO2_DISS_K1_REF
429#define SO2_DISS_K1_REF 1.23e-2
430#endif
431
433#ifndef SO2_DISS_K1_TEMP
434#define SO2_DISS_K1_TEMP 2.01e3
435#endif
436
438#ifndef SO2_DISS_K2_REF
439#define SO2_DISS_K2_REF 6e-8
440#endif
441
443#ifndef SO2_DISS_K2_TEMP
444#define SO2_DISS_K2_TEMP 1.12e3
445#endif
446
448#ifndef WET_DEPO_T_LIQUID
449#define WET_DEPO_T_LIQUID T0
450#endif
451
453#ifndef WET_DEPO_T_ICE
454#define WET_DEPO_T_ICE 238.15
455#endif
456
458#ifndef WET_DEPO_T_LIQUID_BC
459#define WET_DEPO_T_LIQUID_BC 270.
460#endif
461
463#ifndef RADIO_HALF_LIFE_RN222
464#define RADIO_HALF_LIFE_RN222 (3.8235 * 86400.0)
465#endif
466
468#ifndef RADIO_HALF_LIFE_PB210
469#define RADIO_HALF_LIFE_PB210 (22.3 * 365.25 * 86400.0)
470#endif
471
473#ifndef RADIO_HALF_LIFE_BE7
474#define RADIO_HALF_LIFE_BE7 (53.22 * 86400.0)
475#endif
476
478#ifndef RADIO_HALF_LIFE_CS137
479#define RADIO_HALF_LIFE_CS137 (30.05 * 365.25 * 86400.0)
480#endif
481
483#ifndef RADIO_HALF_LIFE_I131
484#define RADIO_HALF_LIFE_I131 (8.02 * 86400.0)
485#endif
486
488#ifndef RADIO_HALF_LIFE_XE133
489#define RADIO_HALF_LIFE_XE133 (5.2474 * 86400.0)
490#endif
491
493#ifndef RADIO_DRY_VDEP_PB210
494#define RADIO_DRY_VDEP_PB210 0.002
495#endif
496
498#ifndef RADIO_DRY_VDEP_BE7
499#define RADIO_DRY_VDEP_BE7 0.001
500#endif
501
503#ifndef RADIO_DRY_VDEP_CS137
504#define RADIO_DRY_VDEP_CS137 0.002
505#endif
506
508#ifndef RADIO_DRY_VDEP_I131
509#define RADIO_DRY_VDEP_I131 0.0005
510#endif
511
513#ifndef RADIO_WET_COEFF_PB210
514#define RADIO_WET_COEFF_PB210 1e-4
515#endif
516
518#ifndef RADIO_WET_COEFF_BE7
519#define RADIO_WET_COEFF_BE7 5e-5
520#endif
521
523#ifndef RADIO_WET_COEFF_CS137
524#define RADIO_WET_COEFF_CS137 1e-4
525#endif
526
528#ifndef RADIO_WET_COEFF_I131
529#define RADIO_WET_COEFF_I131 5e-5
530#endif
531
533#ifndef T0
534#define T0 273.15
535#endif
536
537/* ------------------------------------------------------------
538 Dimensions...
539 ------------------------------------------------------------ */
540
542#ifndef EP
543#define EP 140
544#endif
545
547#ifndef EX
548#define EX 1444
549#endif
550
552#ifndef EY
553#define EY 724
554#endif
555
557#ifndef LEN
558#define LEN 5000
559#endif
560
562#ifndef METVAR
563#define METVAR 13
564#endif
565
567#ifndef NP
568#define NP 10000000
569#endif
570
572#ifndef NQ
573#define NQ 15
574#endif
575
577#ifndef NCSI
578#define NCSI 1000000
579#endif
580
582#ifndef NENS
583#define NENS 2000
584#endif
585
587#ifndef NOBS
588#define NOBS 10000000
589#endif
590
592#ifndef NTHREADS
593#define NTHREADS 512
594#endif
595
597#ifndef CY
598#define CY 250
599#endif
600
602#ifndef CO3
603#define CO3 30
604#endif
605
607#ifndef CP
608#define CP 70
609#endif
610
612#ifndef CSZA
613#define CSZA 50
614#endif
615
617#ifndef CT
618#define CT 12
619#endif
620
622#ifndef CTS
623#define CTS 1000
624#endif
625
627#ifndef DD_EX_GLOB
628#define DD_EX_GLOB (EX * 16)
629#endif
630
632#ifndef DD_EY_GLOB
633#define DD_EY_GLOB (EY * 16)
634#endif
635
636/* ------------------------------------------------------------
637 Macros...
638 ------------------------------------------------------------ */
639
659#ifdef _OPENACC
660#define ALLOC(ptr, type, n) \
661 if(acc_get_num_devices(acc_device_nvidia) <= 0) \
662 ERRMSG("Not running on a GPU device!"); \
663 if((ptr=calloc((size_t)(n), sizeof(type)))==NULL) \
664 ERRMSG("Out of memory!");
665#else
666#define ALLOC(ptr, type, n) \
667 if((ptr=calloc((size_t)(n), sizeof(type)))==NULL) \
668 ERRMSG("Out of memory!");
669#endif
670
689#define ARRAY_2D(ix, iy, ny) \
690 ((ix) * (ny) + (iy))
691
708#define ARRAY_3D(ix, iy, ny, iz, nz) \
709 (((ix)*(ny) + (iy)) * (nz) + (iz))
710
733#define ARRHENIUS(a, b, t) \
734 ((a) * exp( -(b) / (t)))
735
755#define CLAMP(v, lo, hi) \
756 (((v) < (lo)) ? (lo) : (((v) > (hi)) ? (hi) : (v)))
757
770#define COMPRESS_SPEED(nbytes, dt) \
771 ((dt) > 0 ? ((double)(nbytes)) / ((dt) * 1024. * 1024.) : NAN)
772
782#define COMPRESS_RATIO(raw_size, stored_size) \
783 ((double) (raw_size) / (double) (stored_size))
784
794#define COMPRESS_BPV(n, stored_size) \
795 ((8.0 * (double) (stored_size)) / (double) (n))
796
818#define DEG2DX(dlon, lat) \
819 (RE * DEG2RAD(dlon) * cos(DEG2RAD(lat)))
820
839#define DEG2DY(dlat) \
840 (RE * DEG2RAD(dlat))
841
856#define DEG2RAD(deg) \
857 ((deg) * (M_PI / 180.0))
858
881#define DP2DZ(dp, p) \
882 (- (dp) * H0 / (p))
883
903#define DX2DEG(dx, lat) \
904 (((lat) < -89.999 || (lat) > 89.999) ? 0 \
905 : (dx) * 180. / (M_PI * RE * cos(DEG2RAD(lat))))
906
921#define DY2DEG(dy) \
922 ((dy) * 180. / (M_PI * RE))
923
940#define DZ2DP(dz, p) \
941 (-(dz) * (p) / H0)
942
965#define DX2COORD(met, dx, lat) (((met)->coord_type == 0)? DX2DEG((dx) / 1000.0, (lat)) : ((dx) ))
966
988#define DY2COORD(met, dy) (((met)->coord_type == 0)? DY2DEG((dy) / 1000.0) : ((dy) ))
989
1003#define DIST(a, b) \
1004 sqrt(DIST2(a, b))
1005
1019#define DIST2(a, b) \
1020 ((a[0]-b[0])*(a[0]-b[0])+(a[1]-b[1])*(a[1]-b[1])+(a[2]-b[2])*(a[2]-b[2]))
1021
1035#define DOTP(a, b) \
1036 (a[0]*b[0]+a[1]*b[1]+a[2]*b[2])
1037
1049#define ECC(cmd) { \
1050 int ecc_result=(cmd); \
1051 if(ecc_result!=0) \
1052 ERRMSG("ECCODES error: %s", codes_get_error_message(ecc_result)); \
1053 }
1054
1068#define ECC_READ_2D(variable, target, scaling_factor, found_flag) { \
1069 if(strcmp(short_name, variable) == 0) { \
1070 if ((found_flag) == 0) \
1071 LOG(2, "Read 2-D variable: %s (GRIB)", variable); \
1072 for (int ix = 0; ix < met->nx; ix++) \
1073 for (int iy = 0; iy < met->ny; iy++) \
1074 target[ix][iy] = (float)(values[iy * met->nx + ix] * scaling_factor); \
1075 found_flag = 1; \
1076 } \
1077 }
1078
1093#define ECC_READ_3D(variable, level, target, scaling_factor, found_flag) { \
1094 if(strcmp(short_name, variable) == 0) { \
1095 if ((found_flag) == 0) \
1096 LOG(2, "Read 3-D variable: %s (GRIB)", variable); \
1097 for (int ix = 0; ix < met->nx; ix++) \
1098 for (int iy = 0; iy < met->ny; iy++) \
1099 target[ix][iy][level] = (float) (values[iy * met->nx + ix] * scaling_factor); \
1100 found_flag += 1; \
1101 } \
1102 }
1103
1120#define FMOD(x, y) \
1121 ((x) - (int) ((x) / (y)) * (y))
1122
1138#define FREAD(ptr, type, size, in) { \
1139 if(fread(ptr, sizeof(type), size, in)!=size) \
1140 ERRMSG("Error while reading!"); \
1141 }
1142
1158#define FWRITE(ptr, type, size, out) { \
1159 if(fwrite(ptr, sizeof(type), size, out)!=size) \
1160 ERRMSG("Error while writing!"); \
1161 }
1162
1173#define INTPOL_INIT \
1174 double cw[4] = {0.0, 0.0, 0.0, 0.0}; int ci[3] = {0, 0, 0};
1175
1187#define INTPOL_2D(var, init) \
1188 intpol_met_time_2d(met0, met0->var, met1, met1->var, \
1189 atm->time[ip], atm->lon[ip], atm->lat[ip], \
1190 &var, ci, cw, init);
1191
1204#define INTPOL_3D(var, init) \
1205 intpol_met_time_3d(met0, met0->var, met1, met1->var, \
1206 atm->time[ip], atm->p[ip], \
1207 atm->lon[ip], atm->lat[ip], \
1208 &var, ci, cw, init);
1209
1223#define INTPOL_SPACE_ALL(p, lon, lat) { \
1224 intpol_met_space_3d(met, met->z, p, lon, lat, &z, ci, cw, 1); \
1225 intpol_met_space_3d(met, met->t, p, lon, lat, &t, ci, cw, 0); \
1226 intpol_met_space_3d(met, met->u, p, lon, lat, &u, ci, cw, 0); \
1227 intpol_met_space_3d(met, met->v, p, lon, lat, &v, ci, cw, 0); \
1228 intpol_met_space_3d(met, met->w, p, lon, lat, &w, ci, cw, 0); \
1229 intpol_met_space_3d(met, met->pv, p, lon, lat, &pv, ci, cw, 0); \
1230 intpol_met_space_3d(met, met->h2o, p, lon, lat, &h2o, ci, cw, 0); \
1231 intpol_met_space_3d(met, met->o3, p, lon, lat, &o3, ci, cw, 0); \
1232 intpol_met_space_3d(met, met->lwc, p, lon, lat, &lwc, ci, cw, 0); \
1233 intpol_met_space_3d(met, met->rwc, p, lon, lat, &rwc, ci, cw, 0); \
1234 intpol_met_space_3d(met, met->iwc, p, lon, lat, &iwc, ci, cw, 0); \
1235 intpol_met_space_3d(met, met->swc, p, lon, lat, &swc, ci, cw, 0); \
1236 intpol_met_space_3d(met, met->cc, p, lon, lat, &cc, ci, cw, 0); \
1237 intpol_met_space_2d(met, met->ps, lon, lat, &ps, ci, cw, 0); \
1238 intpol_met_space_2d(met, met->ts, lon, lat, &ts, ci, cw, 0); \
1239 intpol_met_space_2d(met, met->zs, lon, lat, &zs, ci, cw, 0); \
1240 intpol_met_space_2d(met, met->us, lon, lat, &us, ci, cw, 0); \
1241 intpol_met_space_2d(met, met->vs, lon, lat, &vs, ci, cw, 0); \
1242 intpol_met_space_2d(met, met->ess, ess, lat, &ess, ci, cw, 0); \
1243 intpol_met_space_2d(met, met->nss, nss, lat, &nss, ci, cw, 0); \
1244 intpol_met_space_2d(met, met->shf, shf, lat, &shf, ci, cw, 0); \
1245 intpol_met_space_2d(met, met->lsm, lon, lat, &lsm, ci, cw, 0); \
1246 intpol_met_space_2d(met, met->sst, lon, lat, &sst, ci, cw, 0); \
1247 intpol_met_space_2d(met, met->pbl, lon, lat, &pbl, ci, cw, 0); \
1248 intpol_met_space_2d(met, met->pt, lon, lat, &pt, ci, cw, 0); \
1249 intpol_met_space_2d(met, met->tt, lon, lat, &tt, ci, cw, 0); \
1250 intpol_met_space_2d(met, met->zt, lon, lat, &zt, ci, cw, 0); \
1251 intpol_met_space_2d(met, met->h2ot, lon, lat, &h2ot, ci, cw, 0); \
1252 intpol_met_space_2d(met, met->pct, lon, lat, &pct, ci, cw, 0); \
1253 intpol_met_space_2d(met, met->pcb, lon, lat, &pcb, ci, cw, 0); \
1254 intpol_met_space_2d(met, met->cl, lon, lat, &cl, ci, cw, 0); \
1255 intpol_met_space_2d(met, met->plcl, lon, lat, &plcl, ci, cw, 0); \
1256 intpol_met_space_2d(met, met->plfc, lon, lat, &plfc, ci, cw, 0); \
1257 intpol_met_space_2d(met, met->pel, lon, lat, &pel, ci, cw, 0); \
1258 intpol_met_space_2d(met, met->cape, lon, lat, &cape, ci, cw, 0); \
1259 intpol_met_space_2d(met, met->cin, lon, lat, &cin, ci, cw, 0); \
1260 intpol_met_space_2d(met, met->o3c, lon, lat, &o3c, ci, cw, 0); \
1261 }
1262
1277#define INTPOL_TIME_ALL(time, p, lon, lat) { \
1278 intpol_met_time_3d(met0, met0->z, met1, met1->z, time, p, lon, lat, &z, ci, cw, 1); \
1279 intpol_met_time_3d(met0, met0->t, met1, met1->t, time, p, lon, lat, &t, ci, cw, 0); \
1280 intpol_met_time_3d(met0, met0->u, met1, met1->u, time, p, lon, lat, &u, ci, cw, 0); \
1281 intpol_met_time_3d(met0, met0->v, met1, met1->v, time, p, lon, lat, &v, ci, cw, 0); \
1282 intpol_met_time_3d(met0, met0->w, met1, met1->w, time, p, lon, lat, &w, ci, cw, 0); \
1283 intpol_met_time_3d(met0, met0->pv, met1, met1->pv, time, p, lon, lat, &pv, ci, cw, 0); \
1284 intpol_met_time_3d(met0, met0->h2o, met1, met1->h2o, time, p, lon, lat, &h2o, ci, cw, 0); \
1285 intpol_met_time_3d(met0, met0->o3, met1, met1->o3, time, p, lon, lat, &o3, ci, cw, 0); \
1286 intpol_met_time_3d(met0, met0->lwc, met1, met1->lwc, time, p, lon, lat, &lwc, ci, cw, 0); \
1287 intpol_met_time_3d(met0, met0->rwc, met1, met1->rwc, time, p, lon, lat, &rwc, ci, cw, 0); \
1288 intpol_met_time_3d(met0, met0->iwc, met1, met1->iwc, time, p, lon, lat, &iwc, ci, cw, 0); \
1289 intpol_met_time_3d(met0, met0->swc, met1, met1->swc, time, p, lon, lat, &swc, ci, cw, 0); \
1290 intpol_met_time_3d(met0, met0->cc, met1, met1->cc, time, p, lon, lat, &cc, ci, cw, 0); \
1291 intpol_met_time_2d(met0, met0->ps, met1, met1->ps, time, lon, lat, &ps, ci, cw, 0); \
1292 intpol_met_time_2d(met0, met0->ts, met1, met1->ts, time, lon, lat, &ts, ci, cw, 0); \
1293 intpol_met_time_2d(met0, met0->zs, met1, met1->zs, time, lon, lat, &zs, ci, cw, 0); \
1294 intpol_met_time_2d(met0, met0->us, met1, met1->us, time, lon, lat, &us, ci, cw, 0); \
1295 intpol_met_time_2d(met0, met0->vs, met1, met1->vs, time, lon, lat, &vs, ci, cw, 0); \
1296 intpol_met_time_2d(met0, met0->ess, met1, met1->ess, time, lon, lat, &ess, ci, cw, 0); \
1297 intpol_met_time_2d(met0, met0->nss, met1, met1->nss, time, lon, lat, &nss, ci, cw, 0); \
1298 intpol_met_time_2d(met0, met0->shf, met1, met1->shf, time, lon, lat, &shf, ci, cw, 0); \
1299 intpol_met_time_2d(met0, met0->lsm, met1, met1->lsm, time, lon, lat, &lsm, ci, cw, 0); \
1300 intpol_met_time_2d(met0, met0->sst, met1, met1->sst, time, lon, lat, &sst, ci, cw, 0); \
1301 intpol_met_time_2d(met0, met0->pbl, met1, met1->pbl, time, lon, lat, &pbl, ci, cw, 0); \
1302 intpol_met_time_2d(met0, met0->pt, met1, met1->pt, time, lon, lat, &pt, ci, cw, 0); \
1303 intpol_met_time_2d(met0, met0->tt, met1, met1->tt, time, lon, lat, &tt, ci, cw, 0); \
1304 intpol_met_time_2d(met0, met0->zt, met1, met1->zt, time, lon, lat, &zt, ci, cw, 0); \
1305 intpol_met_time_2d(met0, met0->h2ot, met1, met1->h2ot, time, lon, lat, &h2ot, ci, cw, 0); \
1306 intpol_met_time_2d(met0, met0->pct, met1, met1->pct, time, lon, lat, &pct, ci, cw, 0); \
1307 intpol_met_time_2d(met0, met0->pcb, met1, met1->pcb, time, lon, lat, &pcb, ci, cw, 0); \
1308 intpol_met_time_2d(met0, met0->cl, met1, met1->cl, time, lon, lat, &cl, ci, cw, 0); \
1309 intpol_met_time_2d(met0, met0->plcl, met1, met1->plcl, time, lon, lat, &plcl, ci, cw, 0); \
1310 intpol_met_time_2d(met0, met0->plfc, met1, met1->plfc, time, lon, lat, &plfc, ci, cw, 0); \
1311 intpol_met_time_2d(met0, met0->pel, met1, met1->pel, time, lon, lat, &pel, ci, cw, 0); \
1312 intpol_met_time_2d(met0, met0->cape, met1, met1->cape, time, lon, lat, &cape, ci, cw, 0); \
1313 intpol_met_time_2d(met0, met0->cin, met1, met1->cin, time, lon, lat, &cin, ci, cw, 0); \
1314 intpol_met_time_2d(met0, met0->o3c, met1, met1->o3c, time, lon, lat, &o3c, ci, cw, 0); \
1315 }
1316
1331#define LAPSE(p1, t1, p2, t2) \
1332 (1e3 * G0 / RA * ((t2) - (t1)) / ((t2) + (t1)) \
1333 * ((p2) + (p1)) / ((p2) - (p1)))
1334
1350#define LIN(x0, y0, x1, y1, x) \
1351 ((y0)+((y1)-(y0))/((x1)-(x0))*((x)-(x0)))
1352
1377#define MAX(a,b) \
1378 (((a)>(b))?(a):(b))
1379
1391#define MET_HEADER \
1392 fprintf(out, \
1393 "# $1 = time [s]\n" \
1394 "# $2 = altitude [km]\n" \
1395 "# $3 = longitude [deg]\n" \
1396 "# $4 = latitude [deg]\n" \
1397 "# $5 = pressure [hPa]\n" \
1398 "# $6 = temperature [K]\n" \
1399 "# $7 = zonal wind [m/s]\n" \
1400 "# $8 = meridional wind [m/s]\n" \
1401 "# $9 = vertical velocity [hPa/s]\n" \
1402 "# $10 = H2O volume mixing ratio [ppv]\n"); \
1403 fprintf(out, \
1404 "# $11 = O3 volume mixing ratio [ppv]\n" \
1405 "# $12 = geopotential height [km]\n" \
1406 "# $13 = potential vorticity [PVU]\n" \
1407 "# $14 = surface pressure [hPa]\n" \
1408 "# $15 = surface temperature [K]\n" \
1409 "# $16 = surface geopotential height [km]\n" \
1410 "# $17 = surface zonal wind [m/s]\n" \
1411 "# $18 = surface meridional wind [m/s]\n" \
1412 "# $19 = eastward turbulent surface stress [N/m^2]\n" \
1413 "# $20 = northward turbulent surface stress [N/m^2]\n"); \
1414 fprintf(out, \
1415 "# $21 = surface sensible heat flux [W/m^2]\n" \
1416 "# $22 = land-sea mask [1]\n" \
1417 "# $23 = sea surface temperature [K]\n" \
1418 "# $24 = tropopause pressure [hPa]\n" \
1419 "# $25 = tropopause geopotential height [km]\n" \
1420 "# $26 = tropopause temperature [K]\n" \
1421 "# $27 = tropopause water vapor [ppv]\n" \
1422 "# $28 = cloud liquid water content [kg/kg]\n" \
1423 "# $29 = cloud rain water content [kg/kg]\n" \
1424 "# $30 = cloud ice water content [kg/kg]\n"); \
1425 fprintf(out, \
1426 "# $31 = cloud snow water content [kg/kg]\n" \
1427 "# $32 = cloud cover [1]\n" \
1428 "# $33 = total column cloud water [kg/m^2]\n" \
1429 "# $34 = cloud top pressure [hPa]\n" \
1430 "# $35 = cloud bottom pressure [hPa]\n" \
1431 "# $36 = pressure at lifted condensation level (LCL) [hPa]\n" \
1432 "# $37 = pressure at level of free convection (LFC) [hPa]\n" \
1433 "# $38 = pressure at equilibrium level (EL) [hPa]\n" \
1434 "# $39 = convective available potential energy (CAPE) [J/kg]\n" \
1435 "# $40 = convective inhibition (CIN) [J/kg]\n"); \
1436 fprintf(out, \
1437 "# $41 = relative humidity over water [%%]\n" \
1438 "# $42 = relative humidity over ice [%%]\n" \
1439 "# $43 = dew point temperature [K]\n" \
1440 "# $44 = frost point temperature [K]\n" \
1441 "# $45 = NAT temperature [K]\n" \
1442 "# $46 = HNO3 volume mixing ratio [ppv]\n" \
1443 "# $47 = OH volume mixing ratio [ppv]\n" \
1444 "# $48 = H2O2 volume mixing ratio [ppv]\n" \
1445 "# $49 = HO2 volume mixing ratio [ppv]\n" \
1446 "# $50 = O(1D) volume mixing ratio [ppv]\n"); \
1447 fprintf(out, \
1448 "# $51 = boundary layer pressure [hPa]\n" \
1449 "# $52 = total column ozone [DU]\n" \
1450 "# $53 = number of data points\n" \
1451 "# $54 = number of tropopause data points\n" \
1452 "# $55 = number of CAPE data points\n");
1453
1478#define MIN(a,b) \
1479 (((a)<(b))?(a):(b))
1480
1493#define MOLEC_DENS(p,t) \
1494 (AVO * 1e-6 * ((p) * 100) / (RI * (t)))
1495
1507#define NC(cmd) { \
1508 int nc_result=(cmd); \
1509 if(nc_result!=NC_NOERR) \
1510 ERRMSG("%s", nc_strerror(nc_result)); \
1511 }
1512
1536#define NC_DEF_VAR(varname, type, ndims, dims, long_name, units, level, quant) { \
1537 NC(nc_def_var(ncid, varname, type, ndims, dims, &varid)); \
1538 NC(nc_put_att_text(ncid, varid, "long_name", strnlen(long_name, LEN), long_name)); \
1539 NC(nc_put_att_text(ncid, varid, "units", strnlen(units, LEN), units)); \
1540 NC_DEF_VAR_QUANTIZE(quant); \
1541 if((level) != 0) { \
1542 NC(nc_def_var_deflate(ncid, varid, 1, 1, level)); \
1543 /* unsigned int ulevel = (unsigned int)level; */ \
1544 /* NC(nc_def_var_filter(ncid, varid, 32015, 1, (unsigned int[]){ulevel})); */ \
1545 } \
1546 }
1547
1548#ifdef NC_QUANTIZE_GRANULARBR
1549#define NC_DEF_VAR_QUANTIZE(quant) do { \
1550 if((quant) > 0) \
1551 NC(nc_def_var_quantize(ncid, varid, NC_QUANTIZE_GRANULARBR, quant)); \
1552 } while(0)
1553#else
1554#define NC_DEF_VAR_QUANTIZE(quant) do { \
1555 if((quant) > 0) \
1556 ERRMSG("NetCDF quantization is not supported by this NetCDF version"); \
1557 } while(0)
1558#endif
1559
1577#define NC_GET_DOUBLE(varname, ptr, force) { \
1578 if(force) { \
1579 NC(nc_inq_varid(ncid, varname, &varid)); \
1580 NC(nc_get_var_double(ncid, varid, ptr)); \
1581 } else { \
1582 if(nc_inq_varid(ncid, varname, &varid) == NC_NOERR) { \
1583 NC(nc_get_var_double(ncid, varid, ptr)); \
1584 } else \
1585 WARN("netCDF variable %s is missing!", varname); \
1586 } \
1587 }
1588
1607#define NC_INQ_DIM(dimname, ptr, min, max, check) { \
1608 int dimid; size_t naux; \
1609 NC(nc_inq_dimid(ncid, dimname, &dimid)); \
1610 NC(nc_inq_dimlen(ncid, dimid, &naux)); \
1611 *ptr = (int)naux; \
1612 if (check) \
1613 if ((*ptr) < (min) || (*ptr) > (max)) \
1614 ERRMSG("Dimension %s is out of range!", dimname); \
1615 }
1616
1631#define NC_PUT_DOUBLE(varname, ptr, hyperslab) { \
1632 NC(nc_inq_varid(ncid, varname, &varid)); \
1633 if(hyperslab) { \
1634 NC(nc_put_vara_double(ncid, varid, start, count, ptr)); \
1635 } else { \
1636 NC(nc_put_var_double(ncid, varid, ptr)); \
1637 } \
1638 }
1639
1655#define NC_PUT_FLOAT(varname, ptr, hyperslab) { \
1656 NC(nc_inq_varid(ncid, varname, &varid)); \
1657 if(hyperslab) { \
1658 NC(nc_put_vara_float(ncid, varid, start, count, ptr)); \
1659 } else { \
1660 NC(nc_put_var_float(ncid, varid, ptr)); \
1661 } \
1662 }
1663
1678#define NC_PUT_INT(varname, ptr, hyperslab) { \
1679 NC(nc_inq_varid(ncid, varname, &varid)); \
1680 if(hyperslab) { \
1681 NC(nc_put_vara_int(ncid, varid, start, count, ptr)); \
1682 } else { \
1683 NC(nc_put_var_int(ncid, varid, ptr)); \
1684 } \
1685 }
1686
1700#define NC_PUT_ATT(varname, attname, text) { \
1701 NC(nc_inq_varid(ncid, varname, &varid)); \
1702 NC(nc_put_att_text(ncid, varid, attname, strnlen(text, LEN), text)); \
1703 }
1704
1717#define NC_PUT_ATT_GLOBAL(attname, text) \
1718 NC(nc_put_att_text(ncid, NC_GLOBAL, attname, strnlen(text, LEN), text));
1719
1737#define NN(x0, y0, x1, y1, x) \
1738 (fabs((x) - (x0)) <= fabs((x) - (x1)) ? (y0) : (y1))
1739
1755#ifdef _OPENACC
1756#define PARTICLE_LOOP(ip0, ip1, check_dt, ...) \
1757 const int ip0_const = ip0; \
1758 const int ip1_const = ip1; \
1759 _Pragma(__VA_ARGS__) \
1760 _Pragma("acc parallel loop independent gang vector") \
1761 for (int ip = ip0_const; ip < ip1_const; ip++) \
1762 if (!check_dt || cache->dt[ip] != 0)
1763#else
1764#define PARTICLE_LOOP(ip0, ip1, check_dt, ...) \
1765 const int ip0_const = ip0; \
1766 const int ip1_const = ip1; \
1767 _Pragma("omp parallel for default(shared)") \
1768 for (int ip = ip0_const; ip < ip1_const; ip++) \
1769 if (!check_dt || cache->dt[ip] != 0)
1770#endif
1771
1794#define P(z) \
1795 (P0 * exp(-(z) / H0))
1796
1818#define PSAT(t) \
1819 (6.112 * exp(17.62 * ((t) - T0) / (243.12 + (t) - T0)))
1820
1842#define PSICE(t) \
1843 (6.112 * exp(22.46 * ((t) - T0) / (272.62 + (t) - T0)))
1844
1869#define PW(p, h2o) \
1870 ((p) * MAX((h2o), 0.1e-6) / (1. + (1. - EPS) * MAX((h2o), 0.1e-6)))
1871
1886#define RAD2DEG(rad) \
1887 ((rad) * (180.0 / M_PI))
1888
1916#define RH(p, t, h2o) \
1917 (PW(p, h2o) / PSAT(t) * 100.)
1918
1946#define RHICE(p, t, h2o) \
1947 (PW(p, h2o) / PSICE(t) * 100.)
1948
1971#define RHO(p, t) \
1972 (100. * (p) / (RA * (t)))
1973
1990#define SET_ATM(qnt, val) \
1991 if (ctl->qnt >= 0) \
1992 atm->q[ctl->qnt][ip] = val;
1993
2013#define SET_QNT(qnt, name, longname, unit) \
2014 if (strcasecmp(ctl->qnt_name[iq], name) == 0) { \
2015 ctl->qnt = iq; \
2016 sprintf(ctl->qnt_longname[iq], longname); \
2017 sprintf(ctl->qnt_unit[iq], unit); \
2018 } else
2019
2034#define SH(h2o) \
2035 (EPS * MAX((h2o), 0.1e-6))
2036
2047#define SQR(x) \
2048 ((x)*(x))
2049
2061#define SWAP(x, y, type) \
2062 do {type tmp = x; x = y; y = tmp;} while(0);
2063
2085#define TDEW(p, h2o) \
2086 (T0 + 243.12 * log(PW((p), (h2o)) / 6.112) \
2087 / (17.62 - log(PW((p), (h2o)) / 6.112)))
2088
2110#define TICE(p, h2o) \
2111 (T0 + 272.62 * log(PW((p), (h2o)) / 6.112) \
2112 / (22.46 - log(PW((p), (h2o)) / 6.112)))
2113
2134#define THETA(p, t) \
2135 ((t) * pow(1000. / (p), KAPPA))
2136
2163#define THETAVIRT(p, t, h2o) \
2164 (TVIRT(THETA((p), (t)), MAX((h2o), 0.1e-6)))
2165
2184#define TOK(line, tok, format, var) { \
2185 if(((tok)=strtok((line), " \t"))) { \
2186 if(sscanf(tok, format, &(var))!=1) continue; \
2187 } else ERRMSG("Error while reading!"); \
2188 }
2189
2209#define TVIRT(t, h2o) \
2210 ((t) * (1. + (1. - EPS) * MAX((h2o), 0.1e-6)))
2211
2223#define USAGE \
2224 do { \
2225 int iusage; \
2226 for (iusage = 1; iusage < argc; iusage++) \
2227 if (!strcmp(argv[iusage], "-h") \
2228 || !strcmp(argv[iusage], "--help")) { \
2229 usage(); \
2230 return EXIT_SUCCESS; \
2231 } \
2232 } while (0)
2233
2253#define Z(p) \
2254 (H0 * log(P0 / (p)))
2255
2284#define ZDIFF(lnp0, t0, h2o0, lnp1, t1, h2o1) \
2285 (RI / MA / G0 * 0.5 * (TVIRT((t0), (h2o0)) + TVIRT((t1), (h2o1))) \
2286 * ((lnp0) - (lnp1)))
2287
2303#define ZETA(ps, p, t) \
2304 (((p) / (ps) <= 0.3 ? 1. : \
2305 sin(M_PI / 2. * (1. - (p) / (ps)) / (1. - 0.3))) \
2306 * THETA((p), (t)))
2307
2308/* ------------------------------------------------------------
2309 Log messages...
2310 ------------------------------------------------------------ */
2311
2313#ifndef LOGLEV
2314#define LOGLEV 2
2315#endif
2316
2346#define LOG(level, ...) { \
2347 if(level >= 2) \
2348 printf(" "); \
2349 if(level <= LOGLEV) { \
2350 printf(__VA_ARGS__); \
2351 printf("\n"); \
2352 } \
2353 }
2354
2383#define WARN(...) { \
2384 printf("\nWarning (%s, %s, l%d): ", __FILE__, __func__, __LINE__); \
2385 LOG(0, __VA_ARGS__); \
2386 }
2387
2416#define ERRMSG(...) { \
2417 printf("\nError (%s, %s, l%d): ", __FILE__, __func__, __LINE__); \
2418 LOG(0, __VA_ARGS__); \
2419 exit(EXIT_FAILURE); \
2420 }
2421
2451#define PRINT(format, var) \
2452 printf("Print (%s, %s, l%d): %s= "format"\n", \
2453 __FILE__, __func__, __LINE__, #var, var);
2454
2455/* ------------------------------------------------------------
2456 Timers...
2457 ------------------------------------------------------------ */
2458
2460#define NTIMER 100
2461
2475#define PRINT_TIMERS \
2476 timer("END", "END", 1);
2477
2490#define SELECT_TIMER(id, group) \
2491 timer(id, group, 0);
2492
2493/* ------------------------------------------------------------
2494 Structs...
2495 ------------------------------------------------------------ */
2496
2504typedef struct {
2505
2506 /* ------------------------------------------------------------
2507 Quantity parameters...
2508 ------------------------------------------------------------ */
2509
2511 int nq;
2512
2514 char qnt_name[NQ][LEN];
2515
2517 char qnt_longname[NQ][LEN];
2518
2520 char qnt_unit[NQ][LEN];
2521
2523 char qnt_format[NQ][LEN];
2524
2527
2530
2533
2536
2539
2542
2545
2548
2551
2554
2557
2560
2563
2566
2569
2572
2575
2578
2581
2584
2587
2590
2593
2596
2599
2602
2605
2608
2611
2614
2617
2620
2623
2626
2629
2632
2635
2638
2641
2644
2647
2650
2653
2656
2659
2662
2665
2668
2671
2674
2677
2680
2683
2686
2689
2692
2695
2698
2701
2704
2707
2710
2713
2716
2719
2722
2725
2728
2731
2734
2737
2740
2743
2746
2749
2752
2755
2758
2761
2764
2767
2770
2773
2776
2779
2782
2785
2788
2791
2794
2797
2800
2803
2806
2809
2812
2815
2818
2821
2824
2827
2830
2833
2836
2838 double t_start;
2839
2841 double t_stop;
2842
2844 double dt_mod;
2845
2846 /* ------------------------------------------------------------
2847 Meteo data parameters...
2848 ------------------------------------------------------------ */
2849
2851 char metbase[LEN];
2852
2854 double dt_met;
2855
2858
2861
2864
2867
2871
2874
2878
2881
2884
2887
2890
2893
2896
2899
2902
2904 int met_zfp_prec[METVAR];
2905
2907 double met_zfp_tol[METVAR];
2908
2910 int met_sz3_prec[METVAR];
2911
2913 double met_sz3_tol[METVAR];
2914
2916 int met_lossy_scale[METVAR];
2917
2919 char met_comp_logfile[LEN];
2920
2923
2926
2929
2932
2935
2937 double met_cms_eps[METVAR];
2938
2941
2944
2947
2950
2953
2956
2959
2962
2964 double met_p[EP];
2965
2968
2971
2973 double met_lev_hyam[EP];
2974
2976 double met_lev_hybm[EP];
2977
2980
2983
2986
2989
2992
2995
2998
3002
3005
3008
3011
3014
3017
3020
3021 /* ------------------------------------------------------------
3022 Geophysical module parameters...
3023 ------------------------------------------------------------ */
3024
3026 double sort_dt;
3027
3031
3033 char balloon[LEN];
3034
3037
3041
3044
3047
3050
3053
3056
3059
3062
3065
3068
3071
3074
3077
3080
3083
3086
3088 double conv_cin;
3089
3091 double conv_dt;
3092
3095
3098
3101
3104
3107
3110
3112 double bound_p0;
3113
3115 double bound_p1;
3116
3119
3122
3125
3128
3130 char species[LEN];
3131
3133 double molmass;
3134
3137
3140
3143
3145 char clim_hno3_filename[LEN];
3146
3148 char clim_oh_filename[LEN];
3149
3151 char clim_h2o2_filename[LEN];
3152
3154 char clim_ho2_filename[LEN];
3155
3157 char clim_o1d_filename[LEN];
3158
3160 char clim_o3_filename[LEN];
3161
3163 char clim_ccl4_timeseries[LEN];
3164
3166 char clim_ccl3f_timeseries[LEN];
3167
3169 char clim_ccl2f2_timeseries[LEN];
3170
3172 char clim_n2o_timeseries[LEN];
3173
3175 char clim_sf6_timeseries[LEN];
3176
3179
3182
3185
3188
3191
3194
3197
3200
3203
3206
3209
3212
3215
3218
3221
3224
3227
3230
3233
3236
3239
3242
3244 double oh_chem[4];
3245
3248
3251
3254
3256 double dt_kpp;
3257
3260
3263
3266
3268 double wet_depo_pre[2];
3269
3272
3275
3278
3281
3283 double wet_depo_ic_h[2];
3284
3286 double wet_depo_bc_h[2];
3287
3290
3293
3296
3299
3302
3304 double psc_h2o;
3305
3307 double psc_hno3;
3308
3309 /* ------------------------------------------------------------
3310 Output parameters...
3311 ------------------------------------------------------------ */
3312
3314 char depo_basename[LEN];
3315
3318
3321
3323 char atm_basename[LEN];
3324
3326 char atm_gpfile[LEN];
3327
3330
3333
3336
3340
3345
3348
3350 int atm_nc_quant[NQ];
3351
3354
3356 char budget_basename[LEN];
3357
3360
3362 char csi_basename[LEN];
3363
3365 char csi_kernel[LEN];
3366
3369
3371 char csi_obsfile[LEN];
3372
3375
3378
3381
3383 double csi_z0;
3384
3386 double csi_z1;
3387
3390
3392 double csi_lon0;
3393
3395 double csi_lon1;
3396
3399
3401 double csi_lat0;
3402
3404 double csi_lat1;
3405
3407 int nens;
3408
3410 char ens_basename[LEN];
3411
3414
3416 char grid_basename[LEN];
3417
3419 char grid_kernel[LEN];
3420
3422 char grid_gpfile[LEN];
3423
3426
3429
3432
3434 int grid_nc_quant[NQ];
3435
3438
3441
3443 double grid_z0;
3444
3446 double grid_z1;
3447
3450
3453
3456
3459
3462
3465
3468
3470 char prof_basename[LEN];
3471
3473 char prof_obsfile[LEN];
3474
3477
3479 double prof_z0;
3480
3482 double prof_z1;
3483
3486
3489
3492
3495
3498
3501
3503 char sample_basename[LEN];
3504
3506 char sample_kernel[LEN];
3507
3509 char sample_obsfile[LEN];
3510
3513
3516
3518 char stat_basename[LEN];
3519
3521 double stat_lon;
3522
3524 double stat_lat;
3525
3527 double stat_r;
3528
3530 double stat_t0;
3531
3533 double stat_t1;
3534
3536 char vtk_basename[LEN];
3537
3540
3543
3546
3549
3552
3553 /* ------------------------------------------------------------
3554 Domain decomposition...
3555 ------------------------------------------------------------ */
3556
3558 int dd;
3559
3562
3565
3568
3571
3572} ctl_t;
3573
3582typedef struct {
3583
3585 int np;
3586
3588 double time[NP];
3589
3591 double p[NP];
3592
3594 double lon[NP];
3595
3597 double lat[NP];
3598
3600 double q[NQ][NP];
3601
3602} atm_t;
3603
3611typedef struct {
3612
3614 double time;
3615
3617 double p;
3618
3620 double lon;
3621
3623 double lat;
3624
3626 double q[NQ];
3627
3628} particle_t;
3629
3630
3637typedef struct {
3638
3640 double iso_var[NP];
3641
3643 double iso_ps[NP];
3644
3646 double iso_ts[NP];
3647
3650
3652 float uvwp[NP][3];
3653
3655 double rs[3 * NP + 1];
3656
3658 double dt[NP];
3659
3660} cache_t;
3661
3673typedef struct {
3674
3676 double Apb210[EX * EY];
3677
3679 double Abe7[EX * EY];
3680
3682 double Acs137[EX * EY];
3683
3685 double Ai131[EX * EY];
3686
3687} depo_t;
3688
3696typedef struct {
3697
3699 int np;
3700
3702 int nsza;
3703
3705 int no3c;
3706
3708 double p[CP];
3709
3711 double sza[CSZA];
3712
3714 double o3c[CO3];
3715
3717 double n2o[CP][CSZA][CO3];
3718
3720 double ccl4[CP][CSZA][CO3];
3721
3723 double ccl3f[CP][CSZA][CO3];
3724
3726 double ccl2f2[CP][CSZA][CO3];
3727
3729 double o2[CP][CSZA][CO3];
3730
3732 double o3_1[CP][CSZA][CO3];
3733
3735 double o3_2[CP][CSZA][CO3];
3736
3738 double h2o2[CP][CSZA][CO3];
3739
3741 double h2o[CP][CSZA][CO3];
3742
3743} clim_photo_t;
3744
3752typedef struct {
3753
3756
3758 double time[CTS];
3759
3761 double vmr[CTS];
3762
3763} clim_ts_t;
3764
3772typedef struct {
3773
3776
3778 int nlat;
3779
3781 int np;
3782
3784 double time[CT];
3785
3787 double lat[CY];
3788
3790 double p[CP];
3791
3793 double vmr[CT][CP][CY];
3794
3795} clim_zm_t;
3796
3804typedef struct {
3805
3808
3811
3813 double tropo_time[12];
3814
3816 double tropo_lat[73];
3817
3819 double tropo[12][73];
3820
3823
3826
3829
3832
3835
3838
3841
3844
3847
3850
3853
3854} clim_t;
3855
3863typedef struct {
3864
3866 double time;
3867
3868 /* Grid type: 0=lat/lon [deg], 1=UTM [m]. */
3870
3872 int nx;
3873
3875 int ny;
3876
3878 int np;
3879
3881 int npl;
3882
3884 double lon[EX];
3885
3887 double lat[EY];
3888
3890 double p[EP];
3891
3893 double hybrid[EP];
3894
3896 double hyam[EP];
3897
3899 double hybm[EP];
3900
3902 double eta[EP];
3903
3905 float ps[EX][EY];
3906
3908 float ts[EX][EY];
3909
3911 float zs[EX][EY];
3912
3914 float us[EX][EY];
3915
3917 float vs[EX][EY];
3918
3920 float ess[EX][EY];
3921
3923 float nss[EX][EY];
3924
3926 float shf[EX][EY];
3927
3929 float lsm[EX][EY];
3930
3932 float sst[EX][EY];
3933
3935 float pbl[EX][EY];
3936
3938 float pt[EX][EY];
3939
3941 float tt[EX][EY];
3942
3944 float zt[EX][EY];
3945
3947 float h2ot[EX][EY];
3948
3950 float pct[EX][EY];
3951
3953 float pcb[EX][EY];
3954
3956 float cl[EX][EY];
3957
3959 float plcl[EX][EY];
3960
3962 float plfc[EX][EY];
3963
3965 float pel[EX][EY];
3966
3968 float cape[EX][EY];
3969
3971 float cin[EX][EY];
3972
3974 float o3c[EX][EY];
3975
3977 float z[EX][EY][EP];
3978
3980 float t[EX][EY][EP];
3981
3983 float u[EX][EY][EP];
3984
3986 float v[EX][EY][EP];
3987
3989 float w[EX][EY][EP];
3990
3992 float pv[EX][EY][EP];
3993
3995 float h2o[EX][EY][EP];
3996
3998 float o3[EX][EY][EP];
3999
4001 float lwc[EX][EY][EP];
4002
4004 float rwc[EX][EY][EP];
4005
4007 float iwc[EX][EY][EP];
4008
4010 float swc[EX][EY][EP];
4011
4013 float cc[EX][EY][EP];
4014
4016 float pl[EX][EY][EP];
4017
4019 float ul[EX][EY][EP];
4020
4022 float vl[EX][EY][EP];
4023
4025 float wl[EX][EY][EP];
4026
4028 float zetal[EX][EY][EP];
4029
4031 float zeta_dotl[EX][EY][EP];
4032
4033} met_t;
4034
4040typedef struct {
4041
4042 /* ------------------------------------------------------------
4043 Global grid...
4044 ------------------------------------------------------------ */
4045
4048
4051
4053 double lon_glob[DD_EX_GLOB];
4054
4056 double lat_glob[DD_EY_GLOB];
4057
4058 /* ------------------------------------------------------------
4059 Subdomains...
4060 ------------------------------------------------------------ */
4061
4063 size_t subdomain_start[4];
4064
4066 size_t subdomain_count[4];
4067
4069 size_t halo_bnd_start[4];
4070
4072 size_t halo_bnd_count[4];
4073
4076
4079
4080 /* ------------------------------------------------------------
4081 Helpers...
4082 ------------------------------------------------------------ */
4083
4084#ifdef DD
4085
4087 MPI_Datatype MPI_Particle;
4088
4090 double sort_key[NP];
4091
4093 int perm[NP];
4094
4096 double tmp[NP];
4097
4098#endif
4099
4100} dd_t;
4101
4102/* ------------------------------------------------------------
4103 Functions...
4104 ------------------------------------------------------------ */
4105
4128 void *data,
4129 size_t N);
4130
4145void cart2geo(
4146 const double *x,
4147 double *z,
4148 double *lon,
4149 double *lat);
4150
4173double clim_oh(
4174 const ctl_t * ctl,
4175 const clim_t * clim,
4176 const double t,
4177 const double lon,
4178 const double lat,
4179 const double p);
4180
4200 const ctl_t * ctl,
4201 clim_t * clim);
4202
4232double clim_photo(
4233 const double rate[CP][CSZA][CO3],
4234 const clim_photo_t * photo,
4235 const double p,
4236 const double sza,
4237 const double o3c);
4238
4264double clim_tropo(
4265 const clim_t * clim,
4266 const double t,
4267 const double lat);
4268
4287void clim_tropo_init(
4288 clim_t * clim);
4289
4306double clim_ts(
4307 const clim_ts_t * ts,
4308 const double t);
4309
4331double clim_zm(
4332 const clim_zm_t * zm,
4333 const double t,
4334 const double lat,
4335 const double p);
4336
4361 FILE * out,
4362 const char *codec,
4363 const char *varname,
4364 const size_t lev,
4365 const double plev,
4366 const double ratio,
4367 const double bpv,
4368 const double t_comp,
4369 const double t_decomp,
4370 const size_t n,
4371 const size_t nbytes,
4372 const float *org,
4373 const float *cmp);
4374
4398 FILE * out,
4399 const char *codec,
4400 const char *varname,
4401 const met_t * met,
4402 const float *org_all,
4403 const float *cmp_all,
4404 const size_t nxy,
4405 const size_t nz,
4406 const double ratio,
4407 const double bpv,
4408 const double t_comp,
4409 const double t_decomp,
4410 const size_t nbytes);
4411
4430 const ctl_t * ctl,
4431 const met_t * met,
4432 const char *varname,
4433 float *array,
4434 const int decompress,
4435 FILE * level_log,
4436 FILE * inout);
4437
4454 float *array,
4455 const size_t nxy,
4456 const size_t nz,
4457 double *off,
4458 double *scl);
4459
4476 float *array,
4477 const size_t nxy,
4478 const size_t nz,
4479 const double *off,
4480 const double *scl);
4481
4499 FILE * in,
4500 const size_t nz,
4501 double **off,
4502 double **scl);
4503
4523 FILE * out,
4524 const int enabled,
4525 float *array,
4526 const size_t nxy,
4527 const size_t nz,
4528 double **off,
4529 double **scl);
4530
4531#ifdef ZSTD
4544ZSTD_CCtx *compress_zstd_create_cctx(
4545 const int level,
4546 const int nworkers);
4547#endif
4548
4561 const char *varname);
4562
4582void compress_pck(
4583 const ctl_t * ctl,
4584 const met_t * met,
4585 const char *varname,
4586 float *array,
4587 const int decompress,
4588 FILE * level_log,
4589 FILE * inout);
4590
4619 const ctl_t * ctl,
4620 const met_t * met,
4621 const char *varname,
4622 float *array,
4623 const int decompress,
4624 FILE * level_log,
4625 FILE * inout);
4626
4664 const ctl_t * ctl,
4665 const met_t * met,
4666 const char *varname,
4667 float *array,
4668 const int decompress,
4669 FILE * level_log,
4670 FILE * inout);
4671
4692 const ctl_t * ctl,
4693 const met_t * met,
4694 const char *varname,
4695 float *array,
4696 const int decompress,
4697 FILE * level_log,
4698 FILE * inout);
4699
4721 const ctl_t * ctl,
4722 const met_t * met,
4723 const char *varname,
4724 float *array,
4725 const int decompress,
4726 FILE * level_log,
4727 FILE * inout);
4728
4753double cos_sza(
4754 const double sec,
4755 const double lon,
4756 const double lat);
4757
4780void day2doy(
4781 const int year,
4782 const int mon,
4783 const int day,
4784 int *doy);
4785
4839 const ctl_t * ctl,
4840 const dd_t * dd,
4841 atm_t * atm,
4842 const int init);
4843
4896 const ctl_t * ctl,
4897 cache_t * cache,
4898 atm_t * atm,
4899 particle_t * particles,
4900 const int npart);
4901
4931 const ctl_t * ctl,
4932 const dd_t * dd,
4933 const double lon,
4934 const double lat);
4935
4992 const ctl_t * ctl,
4993 const dd_t * dd,
4994 particle_t ** particles,
4995 int *npart,
4996 int *capacity);
4997
5037 const ctl_t * ctl,
5038 dd_t * dd,
5039 atm_t * atm);
5040
5075 const dd_t * dd,
5076 double *lon,
5077 double *lat);
5078
5127 const ctl_t * ctl,
5128 cache_t * cache,
5129 const particle_t * particles,
5130 const int npart,
5131 atm_t * atm);
5132
5133
5179 const ctl_t * ctl,
5180 atm_t * atm,
5181 cache_t * cache,
5182 int *npart);
5183
5184
5230 dd_t * dd,
5231 const ctl_t * ctl,
5232 met_t * met,
5233 const int ncid);
5234
5293 const ctl_t * ctl,
5294 const met_t * met0,
5295 atm_t * atm,
5296 dd_t * dd,
5297 int *npart);
5298
5328 double *a,
5329 dd_t * dd,
5330 const int np);
5331
5353void doy2day(
5354 const int year,
5355 const int doy,
5356 int *mon,
5357 int *day);
5358
5385void fft_help(
5386 double *fcReal,
5387 double *fcImag,
5388 const int n);
5389
5416void geo2cart(
5417 const double z,
5418 const double lon,
5419 const double lat,
5420 double *x);
5421
5446void get_met_filename(
5447 const ctl_t * ctl,
5448 const double t,
5449 const int direct,
5450 const char *metbase,
5451 const double dt_met,
5452 char *filename);
5453
5477void get_met_replace(
5478 char *orig,
5479 const char *search,
5480 const char *repl);
5481
5518void get_tropo(
5519 const int met_tropo,
5520 ctl_t * ctl,
5521 const clim_t * clim,
5522 met_t * met,
5523 const double *lons,
5524 const int nx,
5525 const double *lats,
5526 const int ny,
5527 double *pt,
5528 double *zt,
5529 double *tt,
5530 double *qt,
5531 double *o3t,
5532 double *ps,
5533 double *zs);
5534
5556 const double *lons,
5557 const int nlon,
5558 const double *lats,
5559 const int nlat,
5560 const double lon,
5561 const double lat,
5562 double *lon2,
5563 double *lat2);
5564
5584 const double *lons,
5585 const int nlon,
5586 const double *lats,
5587 const int nlat,
5588 const double lon,
5589 const double lat,
5590 double *lon2,
5591 double *lat2);
5592
5635 const met_t * met0,
5636 float height0[EX][EY][EP],
5637 float array0[EX][EY][EP],
5638 const met_t * met1,
5639 float height1[EX][EY][EP],
5640 float array1[EX][EY][EP],
5641 const double ts,
5642 const double height,
5643 const double lon,
5644 const double lat,
5645 double *var,
5646 int *ci,
5647 double *cw,
5648 const int init);
5649
5685 const met_t * met,
5686 float array[EX][EY][EP],
5687 const double p,
5688 const double lon,
5689 const double lat,
5690 double *var,
5691 int *ci,
5692 double *cw,
5693 const int init);
5694
5730 const met_t * met,
5731 float array[EX][EY],
5732 const double lon,
5733 const double lat,
5734 double *var,
5735 int *ci,
5736 double *cw,
5737 const int init);
5738
5773 const met_t * met0,
5774 float array0[EX][EY][EP],
5775 const met_t * met1,
5776 float array1[EX][EY][EP],
5777 const double ts,
5778 const double p,
5779 const double lon,
5780 const double lat,
5781 double *var,
5782 int *ci,
5783 double *cw,
5784 const int init);
5785
5821 const met_t * met0,
5822 float array0[EX][EY],
5823 const met_t * met1,
5824 float array1[EX][EY],
5825 const double ts,
5826 const double lon,
5827 const double lat,
5828 double *var,
5829 int *ci,
5830 double *cw,
5831 const int init);
5832
5870void intpol_tropo_3d(
5871 const double time0,
5872 float array0[EX][EY],
5873 const double time1,
5874 float array1[EX][EY],
5875 const double lons[EX],
5876 const double lats[EY],
5877 const int nlon,
5878 const int nlat,
5879 const double time,
5880 const double lon,
5881 const double lat,
5882 const int method,
5883 double *var,
5884 double *sigma);
5885
5912void jsec2time(
5913 const double jsec,
5914 int *year,
5915 int *mon,
5916 int *day,
5917 int *hour,
5918 int *min,
5919 int *sec,
5920 double *remain);
5921
5948double kernel_weight(
5949 const double kz[EP],
5950 const double kw[EP],
5951 const int nk,
5952 const double p);
5953
5992double lapse_rate(
5993 const double t,
5994 const double h2o);
5995
6023 ctl_t * ctl);
6024
6044int locate_irr(
6045 const double *xx,
6046 const int n,
6047 const double x);
6048
6075 const float *xx,
6076 const int n,
6077 const double x,
6078 const int ig);
6079
6100int locate_reg(
6101 const double *xx,
6102 const int n,
6103 const double x);
6104
6126void locate_vert(
6127 float profiles[EX][EY][EP],
6128 const int np,
6129 const int lon_ap_ind,
6130 const int lat_ap_ind,
6131 const double alt_ap,
6132 int *ind);
6133
6159void module_advect(
6160 const ctl_t * ctl,
6161 const cache_t * cache,
6162 met_t * met0,
6163 met_t * met1,
6164 atm_t * atm);
6165
6189 const ctl_t * ctl,
6190 const cache_t * cache,
6191 met_t * met0,
6192 met_t * met1,
6193 atm_t * atm);
6194
6232 const ctl_t * ctl,
6233 const cache_t * cache,
6234 const clim_t * clim,
6235 met_t * met0,
6236 met_t * met1,
6237 atm_t * atm);
6238
6280void module_chem_grid(
6281 const ctl_t * ctl,
6282 met_t * met0,
6283 met_t * met1,
6284 atm_t * atm,
6285 const double t);
6286
6314void module_chem_init(
6315 const ctl_t * ctl,
6316 const cache_t * cache,
6317 const clim_t * clim,
6318 met_t * met0,
6319 met_t * met1,
6320 atm_t * atm);
6321
6346 const ctl_t * ctl,
6347 cache_t * cache,
6348 met_t * met0,
6349 met_t * met1,
6350 atm_t * atm);
6351
6397 double t,
6398 const ctl_t * ctl,
6399 cache_t * cache,
6400 dd_t * dd,
6401 atm_t * atm,
6402 met_t ** met);
6403
6430void module_decay(
6431 const ctl_t * ctl,
6432 const cache_t * cache,
6433 const clim_t * clim,
6434 atm_t * atm);
6435
6472void module_diff_meso(
6473 const ctl_t * ctl,
6474 cache_t * cache,
6475 const met_t * met0,
6476 const met_t * met1,
6477 atm_t * atm);
6478
6512void module_diff_pbl(
6513 const ctl_t * ctl,
6514 cache_t * cache,
6515 met_t * met0,
6516 met_t * met1,
6517 atm_t * atm);
6518
6573void module_diff_turb(
6574 const ctl_t * ctl,
6575 cache_t * cache,
6576 const clim_t * clim,
6577 met_t * met0,
6578 met_t * met1,
6579 atm_t * atm);
6580
6600void module_dry_depo(
6601 const ctl_t * ctl,
6602 const cache_t * cache,
6603 met_t * met0,
6604 met_t * met1,
6605 atm_t * atm);
6606
6639void module_h2o2_chem(
6640 const ctl_t * ctl,
6641 const cache_t * cache,
6642 const clim_t * clim,
6643 met_t * met0,
6644 met_t * met1,
6645 atm_t * atm);
6646
6667 const ctl_t * ctl,
6668 cache_t * cache,
6669 met_t * met0,
6670 met_t * met1,
6671 atm_t * atm);
6672
6690void module_isosurf(
6691 const ctl_t * ctl,
6692 const cache_t * cache,
6693 met_t * met0,
6694 met_t * met1,
6695 atm_t * atm);
6696
6729 ctl_t * ctl,
6730 cache_t * cache,
6731 clim_t * clim,
6732 met_t * met0,
6733 met_t * met1,
6734 atm_t * atm);
6735
6754void module_meteo(
6755 const ctl_t * ctl,
6756 const cache_t * cache,
6757 const clim_t * clim,
6758 met_t * met0,
6759 met_t * met1,
6760 atm_t * atm);
6761
6779void module_mixing(
6780 const ctl_t * ctl,
6781 const clim_t * clim,
6782 atm_t * atm,
6783 const double t);
6784
6815 const ctl_t * ctl,
6816 atm_t * atm,
6817 const int *ixs,
6818 const int *iys,
6819 const int *izs,
6820 const double *mixparam,
6821 const int qnt_idx,
6822 const int use_ensemble);
6823
6856void module_oh_chem(
6857 const ctl_t * ctl,
6858 const cache_t * cache,
6859 const clim_t * clim,
6860 met_t * met0,
6861 met_t * met1,
6862 atm_t * atm);
6863
6888void module_position(
6889 const cache_t * cache,
6890 met_t * met0,
6891 met_t * met1,
6892 atm_t * atm,
6893 const int reflect);
6894
6919void module_rng_init(
6920 const int ntask);
6921
6947void module_rng(
6948 const ctl_t * ctl,
6949 double *rs,
6950 const size_t n,
6951 const int method);
6952
6988 const ctl_t * ctl,
6989 const cache_t * cache,
6990 atm_t * atm);
6991
7013 const ctl_t * ctl,
7014 const cache_t * cache,
7015 met_t * met0,
7016 met_t * met1,
7017 atm_t * atm,
7018 depo_t * depo);
7019
7042void module_sedi(
7043 const ctl_t * ctl,
7044 const cache_t * cache,
7045 met_t * met0,
7046 met_t * met1,
7047 atm_t * atm);
7048
7072void module_sort(
7073 const ctl_t * ctl,
7074 const met_t * met0,
7075 atm_t * atm);
7076
7096void module_sort_help(
7097 double *a,
7098 const int *p,
7099 const int np);
7100
7124void module_timesteps(
7125 const ctl_t * ctl,
7126 cache_t * cache,
7127 const met_t * met0,
7128 atm_t * atm,
7129 const double t);
7130
7152 ctl_t * ctl,
7153 const atm_t * atm);
7154
7188 const ctl_t * ctl,
7189 const cache_t * cache,
7190 const clim_t * clim,
7191 met_t * met0,
7192 met_t * met1,
7193 atm_t * atm);
7194
7224void module_wet_depo(
7225 const ctl_t * ctl,
7226 const cache_t * cache,
7227 met_t * met0,
7228 met_t * met1,
7229 atm_t * atm);
7230
7265void mptrac_alloc(
7266 ctl_t ** ctl,
7267 cache_t ** cache,
7268 clim_t ** clim,
7269 met_t ** met0,
7270 met_t ** met1,
7271 atm_t ** atm,
7272 depo_t ** depo,
7273 dd_t ** dd);
7274
7305void mptrac_free(
7306 ctl_t * ctl,
7307 cache_t * cache,
7308 clim_t * clim,
7309 met_t * met0,
7310 met_t * met1,
7311 atm_t * atm,
7312 depo_t * depo,
7313 dd_t * dd);
7314
7350void mptrac_get_met(
7351 ctl_t * ctl,
7352 clim_t * clim,
7353 const double t,
7354 met_t ** met0,
7355 met_t ** met1,
7356 dd_t * dd);
7357
7378void mptrac_init(
7379 ctl_t * ctl,
7380 cache_t * cache,
7381 clim_t * clim,
7382 atm_t * atm,
7383 depo_t * depo,
7384 const int ntask);
7385
7421int mptrac_read_atm(
7422 const char *filename,
7423 const ctl_t * ctl,
7424 atm_t * atm);
7425
7457void mptrac_read_clim(
7458 const ctl_t * ctl,
7459 clim_t * clim);
7460
7490void mptrac_read_ctl(
7491 const char *filename,
7492 int argc,
7493 char *argv[],
7494 ctl_t * ctl);
7495
7526int mptrac_read_met(
7527 const char *filename,
7528 const ctl_t * ctl,
7529 const clim_t * clim,
7530 met_t * met,
7531 dd_t * dd);
7532
7555 ctl_t * ctl,
7556 cache_t * cache,
7557 clim_t * clim,
7558 met_t ** met0,
7559 met_t ** met1,
7560 atm_t * atm,
7561 depo_t * depo,
7562 double t,
7563 dd_t * dd);
7564
7594void mptrac_write_atm(
7595 const char *filename,
7596 const ctl_t * ctl,
7597 const atm_t * atm,
7598 const double t);
7599
7639void mptrac_write_met(
7640 const char *filename,
7641 const ctl_t * ctl,
7642 met_t * met);
7643
7680 const char *dirname,
7681 const ctl_t * ctl,
7682 met_t * met0,
7683 met_t * met1,
7684 atm_t * atm,
7685 depo_t * depo,
7686 const double t);
7687
7719 const ctl_t * ctl,
7720 const cache_t * cache,
7721 const clim_t * clim,
7722 met_t ** met0,
7723 met_t ** met1,
7724 const atm_t * atm);
7725
7756 const ctl_t * ctl,
7757 const cache_t * cache,
7758 const clim_t * clim,
7759 met_t ** met0,
7760 met_t ** met1,
7761 const atm_t * atm);
7762
7790double nat_temperature(
7791 const double p,
7792 const double h2o,
7793 const double hno3);
7794
7817double pbl_weight(
7818 const ctl_t * ctl,
7819 const atm_t * atm,
7820 const int ip,
7821 const double pbl,
7822 const double ps);
7823
7856int read_atm_asc(
7857 const char *filename,
7858 const ctl_t * ctl,
7859 atm_t * atm);
7860
7891int read_atm_bin(
7892 const char *filename,
7893 const ctl_t * ctl,
7894 atm_t * atm);
7895
7920int read_atm_clams(
7921 const char *filename,
7922 const ctl_t * ctl,
7923 atm_t * atm);
7924
7954int read_atm_nc(
7955 const char *filename,
7956 const ctl_t * ctl,
7957 atm_t * atm);
7958
7987void read_clim_photo(
7988 const char *filename,
7989 clim_photo_t * photo);
7990
8008 const int ncid,
8009 const char *varname,
8010 const clim_photo_t * photo,
8011 double var[CP][CSZA][CO3]);
8012
8036int read_clim_ts(
8037 const char *filename,
8038 clim_ts_t * ts);
8039
8066void read_clim_zm(
8067 const char *filename,
8068 const char *varname,
8069 clim_zm_t * zm);
8070
8098void read_kernel(
8099 const char *filename,
8100 double kz[EP],
8101 double kw[EP],
8102 int *nk);
8103
8135int read_met_bin(
8136 const char *filename,
8137 const ctl_t * ctl,
8138 met_t * met);
8139
8165void read_met_bin_2d(
8166 FILE * in,
8167 const met_t * met,
8168 float var[EX][EY],
8169 const char *varname);
8170
8208void read_met_bin_3d(
8209 FILE * in,
8210 const ctl_t * ctl,
8211 const met_t * met,
8212 float var[EX][EY][EP],
8213 const char *varname,
8214 const float bound_min,
8215 const float bound_max);
8216
8244void read_met_cape(
8245 const ctl_t * ctl,
8246 const clim_t * clim,
8247 met_t * met);
8248
8271void read_met_cloud(
8272 met_t * met);
8273
8299void read_met_detrend(
8300 const ctl_t * ctl,
8301 met_t * met);
8302
8326 met_t * met);
8327
8354void read_met_geopot(
8355 const ctl_t * ctl,
8356 met_t * met);
8357
8385 const char *filename,
8386 const ctl_t * ctl,
8387 met_t * met);
8388
8410 codes_handle ** handles,
8411 int count_handles,
8412 met_t * met);
8413
8434 codes_handle ** handles,
8435 const int num_messages,
8436 const ctl_t * ctl,
8437 met_t * met);
8438
8469 codes_handle ** handles,
8470 const int num_messages,
8471 const ctl_t * ctl,
8472 met_t * met);
8473
8502void read_met_ml2pl(
8503 const ctl_t * ctl,
8504 const met_t * met,
8505 float var[EX][EY][EP],
8506 const char *varname);
8507
8530 const ctl_t * ctl,
8531 met_t * met);
8532
8563int read_met_nc(
8564 const char *filename,
8565 const ctl_t * ctl,
8566 met_t * met,
8567 dd_t * dd);
8568
8603void read_met_nc_grid(
8604 const char *filename,
8605 const int ncid,
8606 const ctl_t * ctl,
8607 met_t * met,
8608 dd_t * dd);
8609
8642 const int ncid,
8643 const ctl_t * ctl,
8644 met_t * met,
8645 dd_t * dd);
8646
8678 const int ncid,
8679 const ctl_t * ctl,
8680 met_t * met,
8681 dd_t * dd);
8682
8711int read_met_nc_2d(
8712 const int ncid,
8713 const char *const varnames[],
8714 const size_t nvarnames,
8715 const ctl_t * ctl,
8716 const met_t * met,
8717 dd_t * dd,
8718 float dest[EX][EY],
8719 const float scl,
8720 const int init);
8721
8749int read_met_nc_3d(
8750 const int ncid,
8751 const char *const varnames[],
8752 const size_t nvarnames,
8753 const ctl_t * ctl,
8754 const met_t * met,
8755 dd_t * dd,
8756 float dest[EX][EY][EP],
8757 const float scl);
8758
8804void read_met_pbl(
8805 const ctl_t * ctl,
8806 met_t * met);
8807
8840 met_t * met);
8841
8872 met_t * met);
8873
8904void read_met_pv(
8905 met_t * met);
8906
8929void read_met_ozone(
8930 met_t * met);
8931
8960void read_met_sample(
8961 const ctl_t * ctl,
8962 met_t * met);
8963
8992void read_met_tropo(
8993 const ctl_t * ctl,
8994 const clim_t * clim,
8995 met_t * met);
8996
9028void read_obs(
9029 const char *filename,
9030 const ctl_t * ctl,
9031 double *rt,
9032 double *rz,
9033 double *rlon,
9034 double *rlat,
9035 double *robs,
9036 int *nobs);
9037
9065void read_obs_asc(
9066 const char *filename,
9067 double *rt,
9068 double *rz,
9069 double *rlon,
9070 double *rlat,
9071 double *robs,
9072 int *nobs);
9073
9100void read_obs_nc(
9101 const char *filename,
9102 double *rt,
9103 double *rz,
9104 double *rlon,
9105 double *rlat,
9106 double *robs,
9107 int *nobs);
9108
9142double scan_ctl(
9143 const char *filename,
9144 int argc,
9145 char *argv[],
9146 const char *varname,
9147 const int arridx,
9148 const char *defvalue,
9149 char *value);
9150
9177double sedi(
9178 const double p,
9179 const double T,
9180 const double rp,
9181 const double rhop);
9182
9212void spline(
9213 const double *x,
9214 const double *y,
9215 const int n,
9216 const double *x2,
9217 double *y2,
9218 const int n2,
9219 const int method);
9220
9243float stddev(
9244 const float *data,
9245 const int n);
9246
9271void time2jsec(
9272 const int year,
9273 const int mon,
9274 const int day,
9275 const int hour,
9276 const int min,
9277 const int sec,
9278 const double remain,
9279 double *jsec);
9280
9309void timer(
9310 const char *name,
9311 const char *group,
9312 const int output);
9313
9343double time_from_filename(
9344 const char *filename,
9345 const int offset,
9346 const int with_seconds);
9347
9366double tropo_weight(
9367 const ctl_t * ctl,
9368 const clim_t * clim,
9369 const atm_t * atm,
9370 const int ip);
9371
9394void write_atm_asc(
9395 const char *filename,
9396 const ctl_t * ctl,
9397 const atm_t * atm,
9398 const double t);
9399
9423void write_atm_bin(
9424 const char *filename,
9425 const ctl_t * ctl,
9426 const atm_t * atm);
9427
9451void write_atm_clams(
9452 const char *filename,
9453 const ctl_t * ctl,
9454 const atm_t * atm);
9455
9481 const char *dirname,
9482 const ctl_t * ctl,
9483 const atm_t * atm,
9484 const double t);
9485
9509void write_atm_nc(
9510 const char *filename,
9511 const ctl_t * ctl,
9512 const atm_t * atm);
9513
9530void write_budget(
9531 const char *filename,
9532 const ctl_t * ctl,
9533 const atm_t * atm,
9534 const double t);
9535
9564void write_csi(
9565 const char *filename,
9566 const ctl_t * ctl,
9567 const atm_t * atm,
9568 const double t);
9569
9611 const char *filename,
9612 const ctl_t * ctl,
9613 const atm_t * atm,
9614 const double t);
9615
9643void write_ens(
9644 const char *filename,
9645 const ctl_t * ctl,
9646 const atm_t * atm,
9647 const double t);
9648
9661void write_depo(
9662 const char *filename,
9663 const ctl_t * ctl,
9664 const depo_t * depo,
9665 const double t);
9666
9678void write_depo_asc(
9679 const char *filename,
9680 const ctl_t * ctl,
9681 const double *data,
9682 const double t,
9683 const double *lon,
9684 const double *lat,
9685 const double *area);
9686
9698void write_depo_nc(
9699 const char *filename,
9700 const ctl_t * ctl,
9701 const double *data,
9702 const double t,
9703 const double *lon,
9704 const double *lat,
9705 const double *area);
9706
9745void write_grid(
9746 const char *filename,
9747 const ctl_t * ctl,
9748 met_t * met0,
9749 met_t * met1,
9750 const atm_t * atm,
9751 const double t);
9752
9798void write_grid_asc(
9799 const char *filename,
9800 const ctl_t * ctl,
9801 const double *cd,
9802 double *mean[NQ],
9803 double *sigma[NQ],
9804 const double *vmr_impl,
9805 const double t,
9806 const double *z,
9807 const double *lon,
9808 const double *lat,
9809 const double *area,
9810 const double dz,
9811 const int *np);
9812
9855void write_grid_nc(
9856 const char *filename,
9857 const ctl_t * ctl,
9858 const double *cd,
9859 double *mean[NQ],
9860 double *sigma[NQ],
9861 const double *vmr_impl,
9862 const double t,
9863 const double *z,
9864 const double *lon,
9865 const double *lat,
9866 const double *area,
9867 const double dz,
9868 const int *np);
9869
9899void write_met_bin(
9900 const char *filename,
9901 const ctl_t * ctl,
9902 met_t * met);
9903
9931void write_met_bin_2d(
9932 FILE * out,
9933 met_t * met,
9934 float var[EX][EY],
9935 const char *varname);
9936
9976void write_met_bin_3d(
9977 FILE * out,
9978 const ctl_t * ctl,
9979 met_t * met,
9980 float var[EX][EY][EP],
9981 const char *varname,
9982 const int metvar,
9983 FILE * level_log);
9984
10012void write_met_nc(
10013 const char *filename,
10014 const ctl_t * ctl,
10015 met_t * met);
10016
10039void write_met_nc_2d(
10040 const int ncid,
10041 const char *varname,
10042 met_t * met,
10043 float var[EX][EY],
10044 const float scl);
10045
10069void write_met_nc_3d(
10070 const int ncid,
10071 const char *varname,
10072 met_t * met,
10073 float var[EX][EY][EP],
10074 const float scl);
10075
10106void write_prof(
10107 const char *filename,
10108 const ctl_t * ctl,
10109 met_t * met0,
10110 met_t * met1,
10111 const atm_t * atm,
10112 const double t);
10113
10145void write_sample(
10146 const char *filename,
10147 const ctl_t * ctl,
10148 met_t * met0,
10149 met_t * met1,
10150 const atm_t * atm,
10151 const double t);
10152
10179void write_station(
10180 const char *filename,
10181 const ctl_t * ctl,
10182 atm_t * atm,
10183 const double t);
10184
10213void write_vtk(
10214 const char *filename,
10215 const ctl_t * ctl,
10216 const atm_t * atm,
10217 const double t);
10218
10219/* ------------------------------------------------------------
10220 OpenACC routines...
10221 ------------------------------------------------------------ */
10222
10223#ifdef _OPENACC
10224#pragma acc routine (clim_oh)
10225#pragma acc routine (clim_photo)
10226#pragma acc routine (clim_tropo)
10227#pragma acc routine (clim_ts)
10228#pragma acc routine (clim_zm)
10229#pragma acc routine (cos_sza)
10230#pragma acc routine (dd_calc_subdomain_from_coords)
10231#pragma acc routine (dd_normalize_lon_lat)
10232#pragma acc routine (intpol_check_lon_lat)
10233#pragma acc routine (intpol_met_4d_zeta)
10234#pragma acc routine (intpol_met_space_3d)
10235#pragma acc routine (intpol_met_space_2d)
10236#pragma acc routine (intpol_met_time_3d)
10237#pragma acc routine (intpol_met_time_2d)
10238#pragma acc routine (kernel_weight)
10239#pragma acc routine (lapse_rate)
10240#pragma acc routine (locate_irr)
10241#pragma acc routine (locate_irr_float)
10242#pragma acc routine (locate_reg)
10243#pragma acc routine (locate_vert)
10244#pragma acc routine (nat_temperature)
10245#pragma acc routine (pbl_weight)
10246#pragma acc routine (sedi)
10247#pragma acc routine (stddev)
10248#pragma acc routine (tropo_weight)
10249#endif
10250
10251#endif /* LIBTRAC_H */
void read_met_geopot(const ctl_t *ctl, met_t *met)
Calculates geopotential heights from meteorological data.
Definition: mptrac.c:9579
void dd_init(const ctl_t *ctl, dd_t *dd, atm_t *atm)
Initialize the domain decomposition infrastructure.
#define LEN
Maximum length of ASCII data lines.
Definition: mptrac.h:558
void write_depo(const char *filename, const ctl_t *ctl, const depo_t *depo, const double t)
Convert cumulative ground inventories to Bq m^-2 and write them.
Definition: mptrac.c:13752
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:8177
void day2doy(const int year, const int mon, const int day, int *doy)
Get day of year from date.
Definition: mptrac.c:1898
void read_met_grib_surface(codes_handle **handles, const int num_messages, const ctl_t *ctl, met_t *met)
Reads surface meteorological data from a grib file and stores it in the meteorological data structure...
void read_met_extrapolate(met_t *met)
Extrapolates meteorological data.
Definition: mptrac.c:9539
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:13061
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:14799
void dd_read_met_nc_grid(dd_t *dd, const ctl_t *ctl, met_t *met, const int ncid)
Read meteorological grid information and construct the domain-decomposed grid with halo regions.
Definition: mptrac.c:11484
void read_met_sample(const ctl_t *ctl, met_t *met)
Downsamples meteorological data based on specified parameters.
Definition: mptrac.c:12069
int read_met_nc_2d(const int ncid, const char *const varnames[], const size_t nvarnames, const ctl_t *ctl, const met_t *met, dd_t *dd, float dest[EX][EY], const float scl, const int init)
Reads a 2-dimensional meteorological variable from a NetCDF file.
Definition: mptrac.c:10267
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:12416
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:3598
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:5069
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:8643
void read_met_cloud(met_t *met)
Calculates cloud-related variables for each grid point.
Definition: mptrac.c:9375
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:4234
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:12589
double cos_sza(const double sec, const double lon, const double lat)
Calculates the cosine of the solar zenith angle.
Definition: mptrac.c:1857
#define METVAR
Number of 3-D meteorological variables.
Definition: mptrac.h:563
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:3048
void compress_log_levels_3d(FILE *out, const char *codec, const char *varname, const met_t *met, const float *org_all, const float *cmp_all, const size_t nxy, const size_t nz, const double ratio, const double bpv, const double t_comp, const double t_decomp, const size_t nbytes)
Write per-level compression diagnostics for a full 3-D field.
Definition: mptrac.c:765
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:8610
void write_csi_ens(const char *filename, const ctl_t *ctl, const atm_t *atm, const double t)
Writes ensemble-based Critical Success Index (CSI) and other verification statistics to an output fil...
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:11660
void read_met_detrend(const ctl_t *ctl, met_t *met)
Detrends meteorological data.
Definition: mptrac.c:9432
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:12242
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:12460
void write_depo_asc(const char *filename, const ctl_t *ctl, const double *data, const double t, const double *lon, const double *lat, const double *area)
Write radioactive deposition densities as a gnuplot-compatible table.
Definition: mptrac.c:13823
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:4065
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:3559
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:3578
void compress_zfp(const ctl_t *ctl, const met_t *met, const char *varname, float *array, const int decompress, FILE *level_log, FILE *inout)
Compresses or decompresses a 3D array of floats using the ZFP library.
void read_met_nc_levels(const int ncid, const ctl_t *ctl, met_t *met, dd_t *dd)
Reads and processes meteorological level data from NetCDF files with domain decomposition.
Definition: mptrac.c:10049
void compress_pck(const ctl_t *ctl, const met_t *met, const char *varname, float *array, const int decompress, FILE *level_log, FILE *inout)
Compresses or decompresses a 3‑D float array using the PCK format.
Definition: mptrac.c:986
void read_met_monotonize(const ctl_t *ctl, met_t *met)
Makes zeta and pressure profiles monotone.
Definition: mptrac.c:11356
int dd_calc_subdomain_from_coords(const ctl_t *ctl, const dd_t *dd, const double lon, const double lat)
Determine MPI subdomain from particle coordinates.
#define DD_EY_GLOB
Maximum number of latitudes of global meteo data.
Definition: mptrac.h:633
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:8762
void intpol_check_cartesian(const double *lons, const int nlon, const double *lats, const int nlat, const double lon, const double lat, double *lon2, double *lat2)
Clamps UTM coordinates to the valid bounds.
Definition: mptrac.c:2782
void read_met_periodic(met_t *met)
Applies periodic boundary conditions to meteorological data along longitudinal axis.
Definition: mptrac.c:11797
int compress_metvar_index(const char *varname)
Maps a meteorological variable name to its internal MPTRAC variable index.
Definition: mptrac.c:969
void module_timesteps_init(ctl_t *ctl, const atm_t *atm)
Initialize start time and time interval for time-stepping.
Definition: mptrac.c:6086
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:13652
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:5195
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:414
#define EY
Maximum number of latitudes for meteo data.
Definition: mptrac.h:553
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:8734
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:11314
double clim_tropo(const clim_t *clim, const double t, const double lat)
Calculates the tropopause pressure based on climatological data.
Definition: mptrac.c:213
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:12488
void compress_sz3(const ctl_t *ctl, const met_t *met, const char *varname, float *array, const int decompress, FILE *level_log, FILE *inout)
Compresses or decompresses a 3-D float array using the SZ3 library.
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:9116
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:3495
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:4893
void mptrac_free(ctl_t *ctl, cache_t *cache, clim_t *clim, met_t *met0, met_t *met1, atm_t *atm, depo_t *depo, dd_t *dd)
Frees memory resources allocated for MPTRAC.
Definition: mptrac.c:6417
void level_definitions(ctl_t *ctl)
Defines pressure levels for meteorological data.
Definition: mptrac.c:3342
void intpol_met_4d_zeta(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:2808
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:14131
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:8065
void mptrac_write_output(const char *dirname, const ctl_t *ctl, met_t *met0, met_t *met1, atm_t *atm, depo_t *depo, const double t)
Writes various types of output data to files in a specified directory.
Definition: mptrac.c:8290
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:12690
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:3112
#define codes_handle
Placeholder when ECCODES is not available.
Definition: mptrac.h:240
void compress_zstd(const ctl_t *ctl, const met_t *met, const char *varname, float *array, const int decompress, FILE *level_log, FILE *inout)
Compresses or decompresses a float array using ZSTD.
void get_met_filename(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:2619
void fft_help(double *fcReal, double *fcImag, const int n)
Computes the Fast Fourier Transform (FFT) of a complex sequence.
Definition: mptrac.c:2562
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:6195
int compress_read_lossy_scale(FILE *in, const size_t nz, double **off, double **scl)
Read optional lossyscaling metadata for a 3-D field.
Definition: mptrac.c:874
double nat_temperature(const double p, const double h2o, const double hno3)
Calculates the nitric acid trihydrate (NAT) temperature.
Definition: mptrac.c:8403
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:12622
void compress_cms(const ctl_t *ctl, const met_t *met, const char *varname, float *array, const int decompress, FILE *level_log, FILE *inout)
Compresses or decompresses a 3-D meteorological field using cmultiscale.
#define CP
Maximum number of pressure levels for climatological data.
Definition: mptrac.h:608
#define NQ
Maximum number of quantities per data point.
Definition: mptrac.h:573
void dd_assign_subdomains(const ctl_t *ctl, const dd_t *dd, atm_t *atm, const int init)
Assign or update particle subdomain ownership.
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:156
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:8816
#define EX
Maximum number of longitudes for meteo data.
Definition: mptrac.h:548
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:5899
int read_met_nc(const char *filename, const ctl_t *ctl, met_t *met, dd_t *dd)
Reads meteorological data from a NetCDF file and processes it.
Definition: mptrac.c:11441
void timer(const char *name, const char *group, const int output)
Measures and reports elapsed time for named and grouped timers.
Definition: mptrac.c:12721
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:12857
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:2985
void module_sort(const ctl_t *ctl, const met_t *met0, atm_t *atm)
Sort particles according to box index.
Definition: mptrac.c:5927
void module_mixing_help(const ctl_t *ctl, atm_t *atm, const int *ixs, const int *iys, const int *izs, const double *mixparam, const int qnt_idx, const int use_ensemble)
Perform subgrid-scale interparcel mixing of a given quantity.
Definition: mptrac.c:5287
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:4109
void compress_scale_to_unit(float *array, const size_t nxy, const size_t nz, double *off, double *scl)
Scales each vertical level of a 3-D field independently to the interval [0,1].
Definition: mptrac.c:811
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:8915
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:3789
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:12517
void dd_normalize_lon_lat(const dd_t *dd, double *lon, double *lat)
Normalize geographic coordinates to the global grid convention.
#define CT
Maximum number of time steps for climatological data.
Definition: mptrac.h:618
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:3762
void module_position(const cache_t *cache, met_t *met0, met_t *met1, atm_t *atm, const int reflect)
Update the positions and pressure levels of atmospheric particles.
Definition: mptrac.c:5474
void module_radio_decay(const ctl_t *ctl, const cache_t *cache, atm_t *atm)
Apply radioactive decay to atmospheric tracer species.
Definition: mptrac.c:5533
int read_met_grib(const char *filename, const ctl_t *ctl, met_t *met)
Reads meteorological data from a grib file and processes it.
void dd_sort(const ctl_t *ctl, const met_t *met0, atm_t *atm, dd_t *dd, int *npart)
Sort local atmospheric particles and determine export counts for domain decomposition.
void mptrac_get_met(ctl_t *ctl, clim_t *clim, const double t, met_t **met0, met_t **met1, dd_t *dd)
Retrieves meteorological data for the specified time.
Definition: mptrac.c:6478
void module_sort_help(double *a, const int *p, const int np)
Reorder an array based on a given permutation.
Definition: mptrac.c:6001
void dd_particles2atm(const ctl_t *ctl, cache_t *cache, const particle_t *particles, const int npart, atm_t *atm)
Copy received particles from the communication buffer into the atmospheric state.
float stddev(const float *data, const int n)
Calculates the standard deviation of a set of data.
Definition: mptrac.c:12669
void compress_lz4(const ctl_t *ctl, const met_t *met, const char *varname, float *array, const int decompress, FILE *level_log, FILE *inout)
Compresses or decompresses a float array using LZ4.
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:3174
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:9145
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:3525
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:14860
void mptrac_read_clim(const ctl_t *ctl, clim_t *clim)
Reads various climatological data and populates the given climatology structure.
Definition: mptrac.c:6703
void module_chem_grid(const ctl_t *ctl, met_t *met0, met_t *met1, atm_t *atm, const double t)
Computes gridded chemical tracer concentrations (volume mixing ratio) from individual air parcel mass...
Definition: mptrac.c:3885
void module_diff_meso(const ctl_t *ctl, cache_t *cache, const met_t *met0, const met_t *met1, atm_t *atm)
Simulate mesoscale diffusion for atmospheric particles.
Definition: mptrac.c:4273
void write_met_nc(const char *filename, const ctl_t *ctl, met_t *met)
Writes meteorological data to a NetCDF file.
Definition: mptrac.c:14617
void module_rng_init(const int ntask)
Initialize random number generators for parallel tasks.
Definition: mptrac.c:5763
void mptrac_init(ctl_t *ctl, cache_t *cache, clim_t *clim, atm_t *atm, depo_t *depo, const int ntask)
Initializes the MPTRAC model and its associated components.
Definition: mptrac.c:6603
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:6628
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:8121
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
void read_met_grib_levels(codes_handle **handles, const int num_messages, const ctl_t *ctl, met_t *met)
Reads meteorological variables at different vertical levels from a grib file.
void write_met_bin_3d(FILE *out, const ctl_t *ctl, met_t *met, float var[EX][EY][EP], const char *varname, const int metvar, FILE *level_log)
Writes a 3-dimensional meteorological variable to a binary file.
Definition: mptrac.c:14524
#define CTS
Maximum number of data points of climatological time series.
Definition: mptrac.h:623
void read_met_ozone(met_t *met)
Calculates the total column ozone from meteorological ozone data.
Definition: mptrac.c:12040
void mptrac_alloc(ctl_t **ctl, cache_t **cache, clim_t **clim, met_t **met0, met_t **met1, atm_t **atm, depo_t **depo, dd_t **dd)
Allocates and initializes memory resources for MPTRAC.
Definition: mptrac.c:6334
void broadcast_large_data(void *data, size_t N)
Broadcasts large data across all processes in an MPI communicator.
void compress_write_lossy_scale(FILE *out, const int enabled, float *array, const size_t nxy, const size_t nz, double **off, double **scl)
Write optional lossyscaling metadata for a 3-D field.
Definition: mptrac.c:909
void read_met_nc_surface(const int ncid, const ctl_t *ctl, met_t *met, dd_t *dd)
Reads and processes surface meteorological data from NetCDF files with domain decomposition.
Definition: mptrac.c:9894
void clim_tropo_init(clim_t *clim)
Initializes the tropopause data in the climatology structure.
Definition: mptrac.c:241
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:5794
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:15260
void cart2geo(const double *x, double *z, double *lon, double *lat)
Converts Cartesian coordinates to geographic coordinates.
Definition: mptrac.c:74
double time_from_filename(const char *filename, const int offset, const int with_seconds)
Extracts and converts a timestamp from a filename to Julian seconds.
Definition: mptrac.c:12789
void dd_atm2particles(const ctl_t *ctl, cache_t *cache, atm_t *atm, particle_t *particles, const int npart)
Copy migratable atmospheric particles from the ATM state into a particle buffer.
#define NP
Maximum number of atmospheric data points.
Definition: mptrac.h:568
void dd_communicate_particles(const ctl_t *ctl, const dd_t *dd, particle_t **particles, int *npart, int *capacity)
Exchange particles between MPI ranks according to their destination rank.
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:2532
int read_met_nc_3d(const int ncid, const char *const varnames[], const size_t nvarnames, const ctl_t *ctl, const met_t *met, dd_t *dd, float dest[EX][EY][EP], const float scl)
Reads a 3-dimensional meteorological variable from a NetCDF file.
Definition: mptrac.c:10573
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:3141
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:124
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:14495
void read_met_pv(met_t *met)
Calculates potential vorticity (PV) from meteorological data.
Definition: mptrac.c:11920
#define DD_EX_GLOB
Maximum number of longitudes of global meteo data.
Definition: mptrac.h:628
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:8491
#define CY
Maximum number of latitudes for climatological data.
Definition: mptrac.h:598
void dd_sort_help(double *a, dd_t *dd, const int np)
Apply the sorting permutation to a particle data array.
void write_budget(const char *filename, const ctl_t *ctl, const atm_t *atm, const double t)
Writes a time series of the atmospheric tracer mass budget.
Definition: mptrac.c:13271
double clim_ts(const clim_ts_t *ts, const double t)
Interpolates a time series of climatological variables.
Definition: mptrac.c:396
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:3265
int read_met_bin(const char *filename, const ctl_t *ctl, met_t *met)
Reads meteorological data from a binary file.
Definition: mptrac.c:8956
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:13005
void get_met_replace(char *orig, const char *search, const char *repl)
Replaces occurrences of a substring in a string with another substring.
Definition: mptrac.c:2688
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:4595
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:8547
void write_depo_nc(const char *filename, const ctl_t *ctl, const double *data, const double t, const double *lon, const double *lat, const double *area)
Write radioactive deposition densities as a CF-style netCDF file.
Definition: mptrac.c:13863
void module_timesteps(const ctl_t *ctl, cache_t *cache, const met_t *met0, atm_t *atm, const double t)
Calculate time steps for air parcels based on specified conditions.
Definition: mptrac.c:6039
int mptrac_read_met(const char *filename, const ctl_t *ctl, const clim_t *clim, met_t *met, dd_t *dd)
Reads meteorological data from a file, supporting multiple formats and MPI broadcasting.
Definition: mptrac.c:7802
void mptrac_run_timestep(ctl_t *ctl, cache_t *cache, clim_t *clim, met_t **met0, met_t **met1, atm_t *atm, depo_t *depo, double t, dd_t *dd)
Executes a single timestep of the MPTRAC model simulation.
Definition: mptrac.c:7911
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:15349
#define EP
Maximum number of pressure levels for meteo data.
Definition: mptrac.h:543
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:6117
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:6763
void read_met_polar_winds(met_t *met)
Applies a fix for polar winds in meteorological data.
Definition: mptrac.c:11858
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:4808
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:14235
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:8427
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:4350
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:14829
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:4963
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:603
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:5390
void read_met_grib_grid(codes_handle **handles, int count_handles, met_t *met)
Reads global meteorological information from a grib file.
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:2601
void read_met_nc_grid(const char *filename, const int ncid, const ctl_t *ctl, met_t *met, dd_t *dd)
Reads meteorological grid data from NetCDF files with domain decomposition.
Definition: mptrac.c:9707
void get_tropo(const int met_tropo, ctl_t *ctl, const 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:2712
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:3298
void module_dd(double t, const ctl_t *ctl, cache_t *cache, dd_t *dd, atm_t *atm, met_t **met)
Perform domain decomposition and exchange particles between MPI ranks.
void compress_log_level(FILE *out, const char *codec, const char *varname, const size_t lev, const double plev, const double ratio, const double bpv, const double t_comp, const double t_decomp, const size_t n, const size_t nbytes, const float *org, const float *cmp)
Write one row of per-level compression diagnostics.
Definition: mptrac.c:666
void compress_unscale_from_unit(float *array, const size_t nxy, const size_t nz, const double *off, const double *scl)
Restores a levelwise [0,1]-scaled 3-D field to physical units.
Definition: mptrac.c:854
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:8449
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:2755
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:15095
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:13929
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:4745
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:14365
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:12955
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:9255
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:8241
#define CSZA
Maximum number of solar zenith angles for climatological data.
Definition: mptrac.h:613
double tropo_weight(const ctl_t *ctl, const clim_t *clim, const atm_t *atm, const int ip)
Computes a weighting factor based on tropopause pressure.
Definition: mptrac.c:12831
void dd_push(const ctl_t *ctl, atm_t *atm, cache_t *cache, int *npart)
Compact and stage non-local particles for domain decomposition transfer.
double lapse_rate(const double t, const double h2o)
Calculates the moist adiabatic lapse rate in Kelvin per kilometer.
Definition: mptrac.c:3324
void module_radio_depo(const ctl_t *ctl, const cache_t *cache, met_t *met0, met_t *met1, atm_t *atm, depo_t *depo)
Deposit supported radionuclides from air parcels onto the ground grid.
Definition: mptrac.c:5591
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:13365
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:13222
Air parcel data.
Definition: mptrac.h:3582
int np
Number of air parcels.
Definition: mptrac.h:3585
Cache data structure.
Definition: mptrac.h:3637
int iso_n
Isosurface balloon number of data points.
Definition: mptrac.h:3649
Climatological data in the form of photolysis rates.
Definition: mptrac.h:3696
int nsza
Number of solar zenith angles.
Definition: mptrac.h:3702
int np
Number of pressure levels.
Definition: mptrac.h:3699
int no3c
Number of total ozone columns.
Definition: mptrac.h:3705
Climatological data.
Definition: mptrac.h:3804
clim_ts_t ccl2f2
CFC-12 time series.
Definition: mptrac.h:3846
clim_photo_t photo
Photolysis rates.
Definition: mptrac.h:3822
clim_zm_t ho2
HO2 zonal means.
Definition: mptrac.h:3834
clim_zm_t hno3
HNO3 zonal means.
Definition: mptrac.h:3825
int tropo_ntime
Number of tropopause timesteps.
Definition: mptrac.h:3807
clim_ts_t sf6
SF6 time series.
Definition: mptrac.h:3852
clim_ts_t ccl4
CFC-10 time series.
Definition: mptrac.h:3840
clim_ts_t ccl3f
CFC-11 time series.
Definition: mptrac.h:3843
clim_zm_t o1d
O(1D) zonal means.
Definition: mptrac.h:3837
clim_zm_t h2o2
H2O2 zonal means.
Definition: mptrac.h:3831
int tropo_nlat
Number of tropopause latitudes.
Definition: mptrac.h:3810
clim_zm_t oh
OH zonal means.
Definition: mptrac.h:3828
clim_ts_t n2o
N2O time series.
Definition: mptrac.h:3849
Climatological data in the form of time series.
Definition: mptrac.h:3752
int ntime
Number of timesteps.
Definition: mptrac.h:3755
Climatological data in the form of zonal means.
Definition: mptrac.h:3772
int np
Number of pressure levels.
Definition: mptrac.h:3781
int ntime
Number of timesteps.
Definition: mptrac.h:3775
int nlat
Number of latitudes.
Definition: mptrac.h:3778
Control parameters.
Definition: mptrac.h:2504
double met_utm_ref_lon
Reference longitude [deg] for UTM grid.
Definition: mptrac.h:2866
double grid_z0
Lower altitude of gridded data [km].
Definition: mptrac.h:3443
int qnt_o3
Quantity array index for ozone volume mixing ratio.
Definition: mptrac.h:2616
double csi_lat1
Upper latitude of gridded CSI data [deg].
Definition: mptrac.h:3404
int qnt_Coh
Quantity array index for OH volume mixing ratio (chemistry code).
Definition: mptrac.h:2775
double wet_depo_ic_a
Coefficient A for wet deposition in cloud (exponential form).
Definition: mptrac.h:3277
int qnt_eta_d
Quantity array index for diagnosed eta vertical coordinate.
Definition: mptrac.h:2730
int qnt_target_subdomain
Quantity array index for destination subdomain in domain decomposition.
Definition: mptrac.h:2832
int met_nc_scale
Check netCDF scaling factors (0=no, 1=yes).
Definition: mptrac.h:2883
int qnt_pel
Quantity array index for pressure at equilibrium level (EL).
Definition: mptrac.h:2649
int csi_nz
Number of altitudes of gridded CSI data.
Definition: mptrac.h:3380
double molmass
Molar mass [g/mol].
Definition: mptrac.h:3133
int qnt_p
Quantity array index for pressure.
Definition: mptrac.h:2595
int qnt_Cccl2f2
Quantity array index for CFC-12 volume mixing ratio (chemistry code).
Definition: mptrac.h:2799
int dd_halos_size
Domain decomposition size of halos given in grid-points.
Definition: mptrac.h:3567
int mixing_nx
Number of longitudes of mixing grid.
Definition: mptrac.h:3196
int met_zstd_nworkers
ZSTD number of worker threads (0=single-threaded, default=4).
Definition: mptrac.h:2895
double chemgrid_z1
Upper altitude of chemistry grid [km].
Definition: mptrac.h:3220
int qnt_m
Quantity array index for mass.
Definition: mptrac.h:2535
int qnt_aoa
Quantity array index for age of air.
Definition: mptrac.h:2808
int qnt_rhop
Quantity array index for particle density.
Definition: mptrac.h:2544
int qnt_swc
Quantity array index for cloud snow water content.
Definition: mptrac.h:2628
double csi_obsmin
Minimum observation index to trigger detection.
Definition: mptrac.h:3374
int qnt_pcb
Quantity array index for cloud bottom pressure.
Definition: mptrac.h:2637
double bound_dzs
Boundary conditions surface layer depth [km].
Definition: mptrac.h:3121
double csi_lon1
Upper longitude of gridded CSI data [deg].
Definition: mptrac.h:3395
int qnt_u
Quantity array index for zonal wind.
Definition: mptrac.h:2604
double stat_lon
Longitude of station [deg].
Definition: mptrac.h:3521
double sort_dt
Time step for sorting of particle data [s].
Definition: mptrac.h:3026
double mixing_z1
Upper altitude of mixing grid [km].
Definition: mptrac.h:3193
double stat_r
Search radius around station [km].
Definition: mptrac.h:3527
double wet_depo_bc_a
Coefficient A for wet deposition below cloud (exponential form).
Definition: mptrac.h:3271
int met_zstd_level
ZSTD compression level (from -5 to 22, default=-3).
Definition: mptrac.h:2892
double met_utm_ref_lat
Reference latitude [deg] for UTM grid.
Definition: mptrac.h:2863
int csi_ny
Number of latitudes of gridded CSI data.
Definition: mptrac.h:3398
int vtk_sphere
Spherical projection for VTK data (0=no, 1=yes).
Definition: mptrac.h:3551
double chemgrid_z0
Lower altitude of chemistry grid [km].
Definition: mptrac.h:3217
double met_pbl_min
Minimum depth of planetary boundary layer [km].
Definition: mptrac.h:2994
int qnt_iwc
Quantity array index for cloud ice water content.
Definition: mptrac.h:2625
double chemgrid_lat0
Lower latitude of chemistry grid [deg].
Definition: mptrac.h:3235
double conv_cape
CAPE threshold for convection module [J/kg].
Definition: mptrac.h:3085
int qnt_Co1d
Quantity array index for O(1D) volume mixing ratio (chemistry code).
Definition: mptrac.h:2787
int qnt_pw
Quantity array index for partial water vapor pressure.
Definition: mptrac.h:2703
double grid_z1
Upper altitude of gridded data [km].
Definition: mptrac.h:3446
int direction
Direction flag (1=forward calculation, -1=backward calculation).
Definition: mptrac.h:2835
int qnt_Cccl4
Quantity array index for CFC-10 volume mixing ratio (chemistry code).
Definition: mptrac.h:2793
int met_dp
Stride for pressure levels.
Definition: mptrac.h:2946
double met_dt_out
Time step for sampling of meteo data along trajectories [s].
Definition: mptrac.h:3013
int qnt_h2o2
Quantity array index for H2O2 volume mixing ratio (climatology).
Definition: mptrac.h:2667
int qnt_vh
Quantity array index for horizontal wind.
Definition: mptrac.h:2742
int csi_nx
Number of longitudes of gridded CSI data.
Definition: mptrac.h:3389
double csi_lat0
Lower latitude of gridded CSI data [deg].
Definition: mptrac.h:3401
double turb_dz_trop
Vertical turbulent diffusion coefficient (troposphere) [m^2/s].
Definition: mptrac.h:3064
int met_pbl
Planetary boundary layer data (0=file, 1=z2p, 2=Richardson, 3=theta).
Definition: mptrac.h:2991
int qnt_lwc
Quantity array index for cloud liquid water content.
Definition: mptrac.h:2619
double turb_mesoz
Vertical scaling factor for mesoscale wind fluctuations.
Definition: mptrac.h:3073
int grid_nc_level
zlib compression level of netCDF grid data files (0=off).
Definition: mptrac.h:3431
int grid_nx
Number of longitudes of gridded data.
Definition: mptrac.h:3449
int atm_type
Type of atmospheric data files (0=ASCII, 1=binary, 2=netCDF, 3=CLaMS_traj, 4=CLaMS_pos).
Definition: mptrac.h:3339
double bound_mass
Boundary conditions mass per particle [kg].
Definition: mptrac.h:3094
double grid_lat0
Lower latitude of gridded data [deg].
Definition: mptrac.h:3461
int qnt_ts
Quantity array index for surface temperature.
Definition: mptrac.h:2550
int qnt_loss_rate
Quantity array index for total loss rate.
Definition: mptrac.h:2694
int qnt_plfc
Quantity array index for pressure at level of free convection (LCF).
Definition: mptrac.h:2646
int qnt_Acs137
Quantity array index for radioactive activity of Cs-137.
Definition: mptrac.h:2820
double grid_lon0
Lower longitude of gridded data [deg].
Definition: mptrac.h:3452
int qnt_o1d
Quantity array index for O(1D) volume mixing ratio (climatology).
Definition: mptrac.h:2673
int met_tropo_spline
Tropopause interpolation method (0=linear, 1=spline).
Definition: mptrac.h:3010
int qnt_tvirt
Quantity array index for virtual temperature.
Definition: mptrac.h:2736
double dt_met
Time step of meteo data [s].
Definition: mptrac.h:2854
double chemgrid_lat1
Upper latitude of chemistry grid [deg].
Definition: mptrac.h:3238
int met_geopot_sy
Latitudinal smoothing of geopotential heights.
Definition: mptrac.h:2982
double turb_dx_strat
Horizontal turbulent diffusion coefficient (stratosphere) [m^2/s].
Definition: mptrac.h:3058
int qnt_vmr
Quantity array index for volume mixing ratio.
Definition: mptrac.h:2538
int qnt_lsm
Quantity array index for land-sea mask.
Definition: mptrac.h:2571
int qnt_theta
Quantity array index for potential temperature.
Definition: mptrac.h:2715
double bound_lat1
Boundary conditions maximum longitude [deg].
Definition: mptrac.h:3109
double stat_t1
Stop time for station output [s].
Definition: mptrac.h:3533
double turb_dx_trop
Horizontal turbulent diffusion coefficient (troposphere) [m^2/s].
Definition: mptrac.h:3055
int grid_type
Type of grid data files (0=ASCII, 1=netCDF).
Definition: mptrac.h:3467
double csi_lon0
Lower longitude of gridded CSI data [deg].
Definition: mptrac.h:3392
int qnt_pbl
Quantity array index for boundary layer pressure.
Definition: mptrac.h:2577
int grid_stddev
Include standard deviations in grid output (0=no, 1=yes).
Definition: mptrac.h:3437
int qnt_psice
Quantity array index for saturation pressure over ice.
Definition: mptrac.h:2700
double chemgrid_lon0
Lower longitude of chemistry grid [deg].
Definition: mptrac.h:3226
int bound_pbl
Boundary conditions planetary boundary layer (0=no, 1=yes).
Definition: mptrac.h:3127
int qnt_mloss_wet
Quantity array index for total mass loss due to wet deposition.
Definition: mptrac.h:2685
int radio_decay
RADIO_DECAY switch for airborne and deposited activity (0=off, 1=on, default: 0).
Definition: mptrac.h:3262
int met_geopot_sx
Longitudinal smoothing of geopotential heights.
Definition: mptrac.h:2979
int met_sy
Smoothing for latitudes.
Definition: mptrac.h:2952
int qnt_ps
Quantity array index for surface pressure.
Definition: mptrac.h:2547
int rng_type
Random number generator (0=GSL, 1=Squares, 2=cuRAND).
Definition: mptrac.h:3043
int met_pck_zstd
Apply an additional ZSTD compression step to PCK payloads (0=off, 1=on).
Definition: mptrac.h:2901
int isosurf
Isosurface parameter (0=none, 1=pressure, 2=density, 3=theta, 4=balloon).
Definition: mptrac.h:3030
double bound_p1
Boundary conditions top pressure [hPa].
Definition: mptrac.h:3115
int qnt_zs
Quantity array index for surface geopotential height.
Definition: mptrac.h:2553
int prof_nz
Number of altitudes of gridded profile data.
Definition: mptrac.h:3476
double csi_dt_out
Time step for CSI output [s].
Definition: mptrac.h:3368
int met_cape
Convective available potential energy data (0=file, 1=calculate).
Definition: mptrac.h:2988
double csi_modmin
Minimum column density to trigger detection [kg/m^2].
Definition: mptrac.h:3377
int met_sx
Smoothing for longitudes.
Definition: mptrac.h:2949
double chemgrid_lon1
Upper longitude of chemistry grid [deg].
Definition: mptrac.h:3229
double depo_dt_out
DEPO_DT_OUT time interval for radioactive deposition output [s] (default: 86400).
Definition: mptrac.h:3317
double turb_mesox
Horizontal scaling factor for mesoscale wind fluctuations.
Definition: mptrac.h:3070
double prof_z0
Lower altitude of gridded profile data [km].
Definition: mptrac.h:3479
int qnt_w
Quantity array index for vertical velocity.
Definition: mptrac.h:2610
double bound_vmr
Boundary conditions volume mixing ratio [ppv].
Definition: mptrac.h:3100
double met_tropo_pv
Dynamical tropopause potential vorticity threshold [PVU].
Definition: mptrac.h:3004
int prof_nx
Number of longitudes of gridded profile data.
Definition: mptrac.h:3485
int qnt_stat
Quantity array index for station flag.
Definition: mptrac.h:2532
double dd_sort_dt
Sorting time interval for the compactification.
Definition: mptrac.h:3570
int met_tropo
Tropopause definition (0=none, 1=clim, 2=cold point, 3=WMO_1st, 4=WMO_2nd, 5=dynamical).
Definition: mptrac.h:3001
int qnt_rp
Quantity array index for particle radius.
Definition: mptrac.h:2541
int met_mpi_share
Use MPI to share meteo (0=no, 1=yes).
Definition: mptrac.h:3019
int qnt_vz
Quantity array index for vertical velocity.
Definition: mptrac.h:2745
int qnt_ho2
Quantity array index for HO2 volume mixing ratio (climatology).
Definition: mptrac.h:2670
double csi_z1
Upper altitude of gridded CSI data [km].
Definition: mptrac.h:3386
double stat_t0
Start time for station output [s].
Definition: mptrac.h:3530
double oh_chem_beta
Beta parameter for diurnal variability of OH.
Definition: mptrac.h:3247
int dd
Domain decomposition (0=no, 1=yes, with 2x2 if not specified).
Definition: mptrac.h:3558
int qnt_eta
Quantity array index for eta vertical coordinate.
Definition: mptrac.h:2727
double wet_depo_so2_ph
pH value used to calculate effective Henry constant of SO2.
Definition: mptrac.h:3289
double mixing_z0
Lower altitude of mixing grid [km].
Definition: mptrac.h:3190
int qnt_mloss_decay
Quantity array index for total mass loss due to exponential decay.
Definition: mptrac.h:2691
int atm_type_out
Type of atmospheric data files for output (-1=same as ATM_TYPE, 0=ASCII, 1=binary,...
Definition: mptrac.h:3344
int met_cms_nd0x
cmultiscale number of cells of coarsest grid in x-direction.
Definition: mptrac.h:2928
int met_nlev
Number of meteo data model levels.
Definition: mptrac.h:2970
double dt_kpp
Time step for KPP chemistry [s].
Definition: mptrac.h:3256
double dry_depo_dp
Dry deposition surface layer [hPa].
Definition: mptrac.h:3298
int qnt_shf
Quantity array index for surface sensible heat flux.
Definition: mptrac.h:2568
int qnt_vs
Quantity array index for surface meridional wind.
Definition: mptrac.h:2559
int qnt_Cco
Quantity array index for CO volume mixing ratio (chemistry code).
Definition: mptrac.h:2772
double vtk_dt_out
Time step for VTK data output [s].
Definition: mptrac.h:3539
double t_stop
Stop time of simulation [s].
Definition: mptrac.h:2841
double conv_dt
Time interval for convection module [s].
Definition: mptrac.h:3091
int qnt_hno3
Quantity array index for HNO3 volume mixing ratio (climatology).
Definition: mptrac.h:2661
int met_clams
Read MPTRAC or CLaMS meteo data (0=MPTRAC, 1=CLaMS).
Definition: mptrac.h:2880
int qnt_h2ot
Quantity array index for tropopause water vapor volume mixing ratio.
Definition: mptrac.h:2589
int qnt_rh
Quantity array index for relative humidity over water.
Definition: mptrac.h:2709
int met_gp2z
Convert surface geopotential to geopotential height (0=no, 1=yes).
Definition: mptrac.h:2873
double bound_lat0
Boundary conditions minimum longitude [deg].
Definition: mptrac.h:3106
double met_pbl_max
Maximum depth of planetary boundary layer [km].
Definition: mptrac.h:2997
int met_dx
Stride for longitudes.
Definition: mptrac.h:2940
int mixing_ny
Number of latitudes of mixing grid.
Definition: mptrac.h:3205
int met_convention
Meteo data layout (0=[lev, lat, lon], 1=[lon, lat, lev]).
Definition: mptrac.h:2857
int qnt_zeta_d
Quantity array index for diagnosed zeta vertical coordinate.
Definition: mptrac.h:2721
int tracer_chem
Switch for first order tracer chemistry module (0=off, 1=on).
Definition: mptrac.h:3259
double dt_mod
Time step of simulation [s].
Definition: mptrac.h:2844
int diffusion
Diffusion switch (0=off, 1=on).
Definition: mptrac.h:3046
int qnt_tnat
Quantity array index for T_NAT.
Definition: mptrac.h:2760
int qnt_eta_dot
Quantity array index for velocity of eta vertical coordinate.
Definition: mptrac.h:2733
int qnt_tice
Quantity array index for T_ice.
Definition: mptrac.h:2754
int turb_pbl_scheme
PBL turbulence scheme (0=none, 1=closure).
Definition: mptrac.h:3049
double budget_dt_out
Time step for mass budget output [s].
Definition: mptrac.h:3359
int qnt_zg
Quantity array index for geopotential height.
Definition: mptrac.h:2592
double vtk_offset
Vertical offset for VTK data [km].
Definition: mptrac.h:3548
int qnt_v
Quantity array index for meridional wind.
Definition: mptrac.h:2607
int qnt_mloss_dry
Quantity array index for total mass loss due to dry deposition.
Definition: mptrac.h:2688
double bound_vmr_trend
Boundary conditions volume mixing ratio trend [ppv/s].
Definition: mptrac.h:3103
int met_cache
Preload meteo data into disk cache (0=no, 1=yes).
Definition: mptrac.h:3016
int qnt_oh
Quantity array index for OH volume mixing ratio (climatology).
Definition: mptrac.h:2664
int qnt_Ch
Quantity array index for H volume mixing ratio (chemistry code).
Definition: mptrac.h:2778
int met_press_level_def
Use predefined pressure levels or not.
Definition: mptrac.h:2967
int oh_chem_reaction
Reaction type for OH chemistry (0=none, 2=bimolecular, 3=termolecular).
Definition: mptrac.h:3241
int qnt_h2o
Quantity array index for water vapor volume mixing ratio.
Definition: mptrac.h:2613
int prof_ny
Number of latitudes of gridded profile data.
Definition: mptrac.h:3494
int qnt_rhice
Quantity array index for relative humidity over ice.
Definition: mptrac.h:2712
int qnt_rho
Quantity array index for density of air.
Definition: mptrac.h:2601
double sample_dz
Layer depth for sample output [km].
Definition: mptrac.h:3515
double tdec_strat
Life time of particles in the stratosphere [s].
Definition: mptrac.h:3139
int obs_type
Type of observation data files (0=ASCII, 1=netCDF).
Definition: mptrac.h:3353
int qnt_us
Quantity array index for surface zonal wind.
Definition: mptrac.h:2556
double grid_lon1
Upper longitude of gridded data [deg].
Definition: mptrac.h:3455
int qnt_Cn2o
Quantity array index for N2O volume mixing ratio (chemistry code).
Definition: mptrac.h:2802
int qnt_Cccl3f
Quantity array index for CFC-11 volume mixing ratio (chemistry code).
Definition: mptrac.h:2796
int depo_type
DEPO_TYPE of deposition files (0=ASCII, 1=netCDF, default: 0).
Definition: mptrac.h:3320
double mixing_lat0
Lower latitude of mixing grid [deg].
Definition: mptrac.h:3208
int nens
Number of ensembles.
Definition: mptrac.h:3407
int qnt_pt
Quantity array index for tropopause pressure.
Definition: mptrac.h:2580
int qnt_cl
Quantity array index for total column cloud water.
Definition: mptrac.h:2640
int advect
Advection scheme (1=Euler, 2=midpoint, 4=Runge-Kutta).
Definition: mptrac.h:3036
double prof_z1
Upper altitude of gridded profile data [km].
Definition: mptrac.h:3482
int qnt_t
Quantity array index for temperature.
Definition: mptrac.h:2598
int atm_filter
Time filter for atmospheric data output (0=none, 1=missval, 2=remove).
Definition: mptrac.h:3332
int kpp_chem
Switch for KPP chemistry module (0=off, 1=on).
Definition: mptrac.h:3253
int qnt_zeta
Quantity array index for zeta vertical coordinate.
Definition: mptrac.h:2718
double conv_pbl_trans
Depth of PBL transition layer (fraction of PBL pressure thickness).
Definition: mptrac.h:3082
int met_lz4_accel
LZ4 acceleration factor (>=1, default=8).
Definition: mptrac.h:2898
int qnt_Ai131
Quantity array index for radioactive activity of I-131.
Definition: mptrac.h:2823
double mixing_tau_trop
E-folding time for interparcel mixing in the troposphere [s].
Definition: mptrac.h:3181
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:2870
double csi_z0
Lower altitude of gridded CSI data [km].
Definition: mptrac.h:3383
int qnt_lapse
Quantity array index for lapse rate.
Definition: mptrac.h:2739
int qnt_Apb210
Quantity array index for radioactive activity of Pb-210.
Definition: mptrac.h:2814
double stat_lat
Latitude of station [deg].
Definition: mptrac.h:3524
int qnt_Cho2
Quantity array index for HO2 volume mixing ratio (chemistry code).
Definition: mptrac.h:2781
int grid_ny
Number of latitudes of gridded data.
Definition: mptrac.h:3458
int qnt_Csf6
Quantity array index for SF6 volume mixing ratio (chemistry code).
Definition: mptrac.h:2805
int qnt_Ch2o
Quantity array index for H2O volume mixing ratio (chemistry code).
Definition: mptrac.h:2766
double met_detrend
FWHM of horizontal Gaussian used for detrending [km].
Definition: mptrac.h:2958
int conv_mix_pbl
Vertical mixing in the PBL (0=off, 1=on).
Definition: mptrac.h:3079
double bound_dps
Boundary conditions surface layer depth [hPa].
Definition: mptrac.h:3118
int chemgrid_nz
Number of altitudes of chemistry grid.
Definition: mptrac.h:3214
int qnt_cape
Quantity array index for convective available potential energy (CAPE).
Definition: mptrac.h:2652
int qnt_zeta_dot
Quantity array index for velocity of zeta vertical coordinate.
Definition: mptrac.h:2724
double bound_mass_trend
Boundary conditions mass per particle trend [kg/s].
Definition: mptrac.h:3097
int met_cms_nd0y
cmultiscale number of cells of coarsest grid in y-direction.
Definition: mptrac.h:2931
int mixing_nz
Number of altitudes of mixing grid.
Definition: mptrac.h:3187
int qnt_o3c
Quantity array index for total column ozone.
Definition: mptrac.h:2658
double bound_p0
Boundary conditions bottom pressure [hPa].
Definition: mptrac.h:3112
double mixing_lon0
Lower longitude of mixing grid [deg].
Definition: mptrac.h:3199
int qnt_Co3
Quantity array index for O3 volume mixing ratio (chemistry code).
Definition: mptrac.h:2769
int qnt_tsts
Quantity array index for T_STS.
Definition: mptrac.h:2757
int grid_nz
Number of altitudes of gridded data.
Definition: mptrac.h:3440
int qnt_nss
Quantity array index for northward turbulent surface stress.
Definition: mptrac.h:2565
double ens_dt_out
Time step for ensemble output [s].
Definition: mptrac.h:3413
int atm_stride
Particle index stride for atmospheric data files.
Definition: mptrac.h:3335
int met_relhum
Try to read relative humidity (0=no, 1=yes).
Definition: mptrac.h:2985
double mixing_lat1
Upper latitude of mixing grid [deg].
Definition: mptrac.h:3211
double atm_dt_out
Time step for atmospheric data output [s].
Definition: mptrac.h:3329
double prof_lat1
Upper latitude of gridded profile data [deg].
Definition: mptrac.h:3500
int qnt_current_subdomain
Quantity array index for current subdomain in domain decomposition.
Definition: mptrac.h:2829
int met_cms_batch
cmultiscale batch size.
Definition: mptrac.h:2922
double psc_h2o
H2O volume mixing ratio for PSC analysis.
Definition: mptrac.h:3304
int met_sp
Smoothing for pressure levels.
Definition: mptrac.h:2955
double prof_lon0
Lower longitude of gridded profile data [deg].
Definition: mptrac.h:3488
int qnt_Axe133
Quantity array index for radioactive activity of Xe-133.
Definition: mptrac.h:2826
int chemgrid_nx
Number of longitudes of chemistry grid.
Definition: mptrac.h:3223
int qnt_pct
Quantity array index for cloud top pressure.
Definition: mptrac.h:2634
int qnt_mloss_kpp
Quantity array index for total mass loss due to KPP chemistry.
Definition: mptrac.h:2682
int qnt_psat
Quantity array index for saturation pressure over water.
Definition: mptrac.h:2697
double prof_lat0
Lower latitude of gridded profile data [deg].
Definition: mptrac.h:3497
int qnt_cin
Quantity array index for convective inhibition (CIN).
Definition: mptrac.h:2655
double turb_pbl_trans
Depth of turbulent PBL transition layer (fraction of PBL pressure thickness).
Definition: mptrac.h:3076
double psc_hno3
HNO3 volume mixing ratio for PSC analysis.
Definition: mptrac.h:3307
double prof_lon1
Upper longitude of gridded profile data [deg].
Definition: mptrac.h:3491
int met_nc_quant
Number of digits for quantization of netCDF meteo files (0=off).
Definition: mptrac.h:2889
int h2o2_chem_reaction
Reaction type for H2O2 chemistry (0=none, 1=SO2).
Definition: mptrac.h:3250
int qnt_Co3p
Quantity array index for O(3P) volume mixing ratio (chemistry code).
Definition: mptrac.h:2790
double wet_depo_bc_ret_ratio
Coefficients for wet deposition below cloud: retention ratio.
Definition: mptrac.h:3295
int chemgrid_ny
Number of latitudes of chemistry grid.
Definition: mptrac.h:3232
int qnt_Abe7
Quantity array index for radioactive activity of Be-7.
Definition: mptrac.h:2817
int met_cms_zstd
cmultiscale ZSTD compression (0=off, 1=on).
Definition: mptrac.h:2925
int met_cms_maxlev
cmultiscale maximum refinement level.
Definition: mptrac.h:2934
int grid_sparse
Sparse output in grid data files (0=no, 1=yes).
Definition: mptrac.h:3428
double dry_depo_vdep
Dry deposition velocity [m/s].
Definition: mptrac.h:3301
int qnt_tt
Quantity array index for tropopause temperature.
Definition: mptrac.h:2583
int met_np
Number of target pressure levels.
Definition: mptrac.h:2961
int qnt_ens
Quantity array index for ensemble IDs.
Definition: mptrac.h:2529
int met_nc_level
zlib compression level of netCDF meteo files (0=off).
Definition: mptrac.h:2886
double mixing_dt
Time interval for mixing [s].
Definition: mptrac.h:3178
double mixing_tau_strat
E-folding time for interparcel mixing in the stratosphere [s].
Definition: mptrac.h:3184
int qnt_Arn222
Quantity array index for radioactive activity of Rn-222.
Definition: mptrac.h:2811
int qnt_mloss_h2o2
Quantity array index for total mass loss due to H2O2 chemistry.
Definition: mptrac.h:2679
double vtk_scale
Vertical scaling factor for VTK data.
Definition: mptrac.h:3545
double turb_dx_pbl
Horizontal turbulent diffusion coefficient (PBL) [m^2/s].
Definition: mptrac.h:3052
double conv_cin
CIN threshold for convection module [J/kg].
Definition: mptrac.h:3088
int qnt_pv
Quantity array index for potential vorticity.
Definition: mptrac.h:2748
int advect_vert_coord
Vertical velocity of air parcels (0=omega_on_plev, 1=zetadot_on_mlev, 2=omega_on_mlev,...
Definition: mptrac.h:3040
int qnt_mloss_oh
Quantity array index for total mass loss due to OH chemistry.
Definition: mptrac.h:2676
int qnt_Ch2o2
Quantity array index for H2O2 volume mixing ratio (chemistry code).
Definition: mptrac.h:2784
int qnt_sst
Quantity array index for sea surface temperature.
Definition: mptrac.h:2574
double mixing_lon1
Upper longitude of mixing grid [deg].
Definition: mptrac.h:3202
int atm_nc_level
zlib compression level of netCDF atmospheric data files (0=off).
Definition: mptrac.h:3347
double wet_depo_ic_ret_ratio
Coefficients for wet deposition in cloud: retention ratio.
Definition: mptrac.h:3292
int qnt_sh
Quantity array index for specific humidity.
Definition: mptrac.h:2706
int met_coord_type
Type of coordinates for meteo data (-1=detect, 0=lat/lon [deg], 1=UTM [m]).
Definition: mptrac.h:2860
int qnt_ess
Quantity array index for eastward turbulent surface stress.
Definition: mptrac.h:2562
double wet_depo_ic_b
Coefficient B for wet deposition in cloud (exponential form).
Definition: mptrac.h:3280
double wet_depo_bc_b
Coefficient B for wet deposition below cloud (exponential form).
Definition: mptrac.h:3274
int met_dy
Stride for latitudes.
Definition: mptrac.h:2943
int qnt_Cx
Quantity array index for trace species x volume mixing ratio (chemistry code).
Definition: mptrac.h:2763
double turb_dz_strat
Vertical turbulent diffusion coefficient (stratosphere) [m^2/s].
Definition: mptrac.h:3067
double bound_zetas
Boundary conditions surface layer zeta [K].
Definition: mptrac.h:3124
int radio_depo
RADIO_DEPO switch for radionuclide deposition (0=off, 1=on, default: 0).
Definition: mptrac.h:3265
int dd_subdomains_zonal
Domain decomposition zonal subdomain number.
Definition: mptrac.h:3561
int qnt_idx
Quantity array index for air parcel IDs.
Definition: mptrac.h:2526
double met_tropo_theta
Dynamical tropopause potential temperature threshold [K].
Definition: mptrac.h:3007
int qnt_rwc
Quantity array index for cloud rain water content.
Definition: mptrac.h:2622
double t_start
Start time of simulation [s].
Definition: mptrac.h:2838
int nq
Number of quantities.
Definition: mptrac.h:2511
double tdec_trop
Life time of particles in the troposphere [s].
Definition: mptrac.h:3136
double sample_dx
Horizontal radius for sample output [km].
Definition: mptrac.h:3512
int vtk_stride
Particle index stride for VTK data.
Definition: mptrac.h:3542
double turb_dz_pbl
Vertical turbulent diffusion coefficient (PBL) [m^2/s].
Definition: mptrac.h:3061
double grid_lat1
Upper latitude of gridded data [deg].
Definition: mptrac.h:3464
int dd_subdomains_meridional
Domain decomposition meridional subdomain number.
Definition: mptrac.h:3564
int qnt_zt
Quantity array index for tropopause geopotential height.
Definition: mptrac.h:2586
int met_type
Type of meteo data files (0=netCDF, 1=binary, 2=pck, 3=ZFP, 4=ZSTD, 5=cms, 6=grib,...
Definition: mptrac.h:2877
int qnt_cc
Quantity array index for cloud cover.
Definition: mptrac.h:2631
int qnt_plcl
Quantity array index for pressure at lifted condensation level (LCL).
Definition: mptrac.h:2643
double grid_dt_out
Time step for gridded data output [s].
Definition: mptrac.h:3425
int qnt_tdew
Quantity array index for dew point temperature.
Definition: mptrac.h:2751
Domain decomposition data structure.
Definition: mptrac.h:4040
int halo_offset_end
Offset of the periodic halo block at the end of the local x-array.
Definition: mptrac.h:4078
int nx_glob
Number of global longitudes.
Definition: mptrac.h:4047
int halo_offset_start
Offset of the periodic halo block at the beginning of the local x-array.
Definition: mptrac.h:4075
int ny_glob
Number of global latitudes.
Definition: mptrac.h:4050
Ground inventories of deposited radionuclides.
Definition: mptrac.h:3673
Meteo data structure.
Definition: mptrac.h:3863
int coord_type
Definition: mptrac.h:3869
int nx
Number of longitudes.
Definition: mptrac.h:3872
int ny
Number of latitudes.
Definition: mptrac.h:3875
int np
Number of pressure levels.
Definition: mptrac.h:3878
int npl
Number of model levels.
Definition: mptrac.h:3881
double time
Time [s].
Definition: mptrac.h:3866
Particle data.
Definition: mptrac.h:3611
double p
Pressure [hPa].
Definition: mptrac.h:3617
double lat
Latitude [deg].
Definition: mptrac.h:3623
double time
Time [s].
Definition: mptrac.h:3614
double lon
Longitude [deg].
Definition: mptrac.h:3620