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_math.h>
176#include <gsl/gsl_randist.h>
177#include <gsl/gsl_rng.h>
178#include <gsl/gsl_sort.h>
179#include <gsl/gsl_spline.h>
180#include <gsl/gsl_statistics.h>
181#include <math.h>
182#include <netcdf.h>
183#include <omp.h>
184#include <stdint.h>
185#include <stdio.h>
186#include <stdlib.h>
187#include <string.h>
188#include <time.h>
189#include <sys/time.h>
190
191#ifdef MPI
192#include "mpi.h"
193#endif
194
195#ifdef DD
196#include <netcdf_par.h>
197#endif
198
199#ifdef _OPENACC
200#include "openacc.h"
201#endif
202
203#ifdef CURAND
204#include "curand.h"
205#endif
206
207#ifdef THRUST
208#include "thrustsort.h"
209#endif
210
211#ifdef ZFP
212#include "zfp.h"
213#endif
214
215#ifdef ZSTD
216#include "zstd.h"
217#endif
218
219#ifdef LZ4
220#include "lz4.h"
221#endif
222
223#ifdef SZ3
224#include "SZ3c/sz3c.h"
225#endif
226
227#ifdef CMS
228#include "cmultiscale.h"
229#endif
230
231#ifdef KPP
232#include "chem_Parameters.h"
233#include "chem_Global.h"
234#include "chem_Sparse.h"
235#endif
236
237#ifdef ECCODES
238#include "eccodes.h"
239#else
241#define codes_handle void*
242#endif
243
244/* ------------------------------------------------------------
245 Constants...
246 ------------------------------------------------------------ */
247
249#ifndef AVO
250#define AVO 6.02214076e23
251#endif
252
254#ifndef CPD
255#define CPD 1003.5
256#endif
257
259#ifndef EPS
260#define EPS (MH2O / MA)
261#endif
262
264#ifndef G0
265#define G0 9.80665
266#endif
267
269#ifndef H0
270#define H0 7.0
271#endif
272
274#ifndef LV
275#define LV 2501000.
276#endif
277
279#ifndef KARMAN
280#define KARMAN 0.40
281#endif
282
284#ifndef KB
285#define KB 1.3806504e-23
286#endif
287
289#ifndef MA
290#define MA 28.9644
291#endif
292
294#ifndef MH2O
295#define MH2O 18.01528
296#endif
297
299#ifndef MO3
300#define MO3 48.00
301#endif
302
304#ifndef P0
305#define P0 1013.25
306#endif
307
309#ifndef RA
310#define RA (1e3 * RI / MA)
311#endif
312
314#ifndef RE
315#define RE 6367.421
316#endif
317
319#ifndef RI
320#define RI 8.3144598
321#endif
322
324#ifndef KAPPA
325#define KAPPA 0.286
326#endif
327
329#ifndef OMEGA_EARTH
330#define OMEGA_EARTH 7.2921e-5
331#endif
332
334#ifndef DOBSON_UNIT
335#define DOBSON_UNIT 2.1415e-5
336#endif
337
339#ifndef M_AIR_MOLECULE
340#define M_AIR_MOLECULE 4.8096e-26
341#endif
342
344#ifndef CHEM_REF_TEMP
345#define CHEM_REF_TEMP 298.15
346#endif
347
349#ifndef H2O2_SO2_RATE_REF
350#define H2O2_SO2_RATE_REF 9.1e7
351#endif
352
354#ifndef H2O2_SO2_RATE_TEMP
355#define H2O2_SO2_RATE_TEMP 29700.
356#endif
357
359#ifndef SO2_HENRY_REF
360#define SO2_HENRY_REF 1.3e-2
361#endif
362
364#ifndef SO2_HENRY_TEMP
365#define SO2_HENRY_TEMP 2900.
366#endif
367
369#ifndef H2O2_HENRY_REF
370#define H2O2_HENRY_REF 8.3e2
371#endif
372
374#ifndef H2O2_HENRY_TEMP
375#define H2O2_HENRY_TEMP 7600.
376#endif
377
379#ifndef SO2_CORR_A
380#define SO2_CORR_A 3.12541941e-06
381#endif
382
384#ifndef SO2_CORR_B
385#define SO2_CORR_B -5.72532259e-01
386#endif
387
389#ifndef O1D_RATE_CCL4_A
390#define O1D_RATE_CCL4_A 3.30e-10
391#endif
392
394#ifndef O1D_RATE_CCL4_B
395#define O1D_RATE_CCL4_B 0.
396#endif
397
399#ifndef O1D_RATE_CFC11_A
400#define O1D_RATE_CFC11_A 2.30e-10
401#endif
402
404#ifndef O1D_RATE_CFC11_B
405#define O1D_RATE_CFC11_B 0.
406#endif
407
409#ifndef O1D_RATE_CFC12_A
410#define O1D_RATE_CFC12_A 1.40e-10
411#endif
412
414#ifndef O1D_RATE_CFC12_B
415#define O1D_RATE_CFC12_B -25.
416#endif
417
419#ifndef O1D_RATE_N2O_A
420#define O1D_RATE_N2O_A 1.19e-10
421#endif
422
424#ifndef O1D_RATE_N2O_B
425#define O1D_RATE_N2O_B -20.
426#endif
427
429#ifndef SO2_DISS_K1_REF
430#define SO2_DISS_K1_REF 1.23e-2
431#endif
432
434#ifndef SO2_DISS_K1_TEMP
435#define SO2_DISS_K1_TEMP 2.01e3
436#endif
437
439#ifndef SO2_DISS_K2_REF
440#define SO2_DISS_K2_REF 6e-8
441#endif
442
444#ifndef SO2_DISS_K2_TEMP
445#define SO2_DISS_K2_TEMP 1.12e3
446#endif
447
449#ifndef WET_DEPO_T_LIQUID
450#define WET_DEPO_T_LIQUID T0
451#endif
452
454#ifndef WET_DEPO_T_ICE
455#define WET_DEPO_T_ICE 238.15
456#endif
457
459#ifndef WET_DEPO_T_LIQUID_BC
460#define WET_DEPO_T_LIQUID_BC 270.
461#endif
462
464#ifndef RADIO_HALF_LIFE_RN222
465#define RADIO_HALF_LIFE_RN222 (3.8235 * 86400.0)
466#endif
467
469#ifndef RADIO_HALF_LIFE_PB210
470#define RADIO_HALF_LIFE_PB210 (22.3 * 365.25 * 86400.0)
471#endif
472
474#ifndef RADIO_HALF_LIFE_BE7
475#define RADIO_HALF_LIFE_BE7 (53.22 * 86400.0)
476#endif
477
479#ifndef RADIO_HALF_LIFE_CS137
480#define RADIO_HALF_LIFE_CS137 (30.05 * 365.25 * 86400.0)
481#endif
482
484#ifndef RADIO_HALF_LIFE_I131
485#define RADIO_HALF_LIFE_I131 (8.02 * 86400.0)
486#endif
487
489#ifndef RADIO_HALF_LIFE_XE133
490#define RADIO_HALF_LIFE_XE133 (5.2474 * 86400.0)
491#endif
492
494#ifndef RADIO_DRY_VDEP_PB210
495#define RADIO_DRY_VDEP_PB210 0.002
496#endif
497
499#ifndef RADIO_DRY_VDEP_BE7
500#define RADIO_DRY_VDEP_BE7 0.001
501#endif
502
504#ifndef RADIO_DRY_VDEP_CS137
505#define RADIO_DRY_VDEP_CS137 0.002
506#endif
507
509#ifndef RADIO_DRY_VDEP_I131
510#define RADIO_DRY_VDEP_I131 0.0005
511#endif
512
514#ifndef RADIO_WET_COEFF_PB210
515#define RADIO_WET_COEFF_PB210 1e-4
516#endif
517
519#ifndef RADIO_WET_COEFF_BE7
520#define RADIO_WET_COEFF_BE7 5e-5
521#endif
522
524#ifndef RADIO_WET_COEFF_CS137
525#define RADIO_WET_COEFF_CS137 1e-4
526#endif
527
529#ifndef RADIO_WET_COEFF_I131
530#define RADIO_WET_COEFF_I131 5e-5
531#endif
532
534#ifndef T0
535#define T0 273.15
536#endif
537
538/* ------------------------------------------------------------
539 Dimensions...
540 ------------------------------------------------------------ */
541
543#ifndef EP
544#define EP 140
545#endif
546
548#ifndef EX
549#define EX 1444
550#endif
551
553#ifndef EY
554#define EY 724
555#endif
556
558#ifndef LEN
559#define LEN 5000
560#endif
561
563#ifndef METVAR
564#define METVAR 13
565#endif
566
568#ifndef NP
569#define NP 10000000
570#endif
571
573#ifndef NQ
574#define NQ 15
575#endif
576
578#ifndef NCSI
579#define NCSI 1000000
580#endif
581
583#ifndef NENS
584#define NENS 2000
585#endif
586
588#ifndef NOBS
589#define NOBS 10000000
590#endif
591
593#ifndef NTHREADS
594#define NTHREADS 512
595#endif
596
598#ifndef CY
599#define CY 250
600#endif
601
603#ifndef CO3
604#define CO3 30
605#endif
606
608#ifndef CP
609#define CP 70
610#endif
611
613#ifndef CSZA
614#define CSZA 50
615#endif
616
618#ifndef CT
619#define CT 12
620#endif
621
623#ifndef CTS
624#define CTS 1000
625#endif
626
628#ifndef DD_EX_GLOB
629#define DD_EX_GLOB (EX * 16)
630#endif
631
633#ifndef DD_EY_GLOB
634#define DD_EY_GLOB (EY * 16)
635#endif
636
637/* ------------------------------------------------------------
638 Macros...
639 ------------------------------------------------------------ */
640
660#ifdef _OPENACC
661#define ALLOC(ptr, type, n) \
662 if(acc_get_num_devices(acc_device_nvidia) <= 0) \
663 ERRMSG("Not running on a GPU device!"); \
664 if((ptr=calloc((size_t)(n), sizeof(type)))==NULL) \
665 ERRMSG("Out of memory!");
666#else
667#define ALLOC(ptr, type, n) \
668 if((ptr=calloc((size_t)(n), sizeof(type)))==NULL) \
669 ERRMSG("Out of memory!");
670#endif
671
690#define ARRAY_2D(ix, iy, ny) \
691 ((ix) * (ny) + (iy))
692
709#define ARRAY_3D(ix, iy, ny, iz, nz) \
710 (((ix)*(ny) + (iy)) * (nz) + (iz))
711
734#define ARRHENIUS(a, b, t) \
735 ((a) * exp( -(b) / (t)))
736
756#define CLAMP(v, lo, hi) \
757 (((v) < (lo)) ? (lo) : (((v) > (hi)) ? (hi) : (v)))
758
771#define COMPRESS_SPEED(nbytes, dt) \
772 ((dt) > 0 ? ((double)(nbytes)) / ((dt) * 1024. * 1024.) : NAN)
773
783#define COMPRESS_RATIO(raw_size, stored_size) \
784 ((double) (raw_size) / (double) (stored_size))
785
795#define COMPRESS_BPV(n, stored_size) \
796 ((8.0 * (double) (stored_size)) / (double) (n))
797
819#define DEG2DX(dlon, lat) \
820 (RE * DEG2RAD(dlon) * cos(DEG2RAD(lat)))
821
840#define DEG2DY(dlat) \
841 (RE * DEG2RAD(dlat))
842
857#define DEG2RAD(deg) \
858 ((deg) * (M_PI / 180.0))
859
882#define DP2DZ(dp, p) \
883 (- (dp) * H0 / (p))
884
904#define DX2DEG(dx, lat) \
905 (((lat) < -89.999 || (lat) > 89.999) ? 0 \
906 : (dx) * 180. / (M_PI * RE * cos(DEG2RAD(lat))))
907
922#define DY2DEG(dy) \
923 ((dy) * 180. / (M_PI * RE))
924
941#define DZ2DP(dz, p) \
942 (-(dz) * (p) / H0)
943
966#define DX2COORD(met, dx, lat) (((met)->coord_type == 0)? DX2DEG((dx) / 1000.0, (lat)) : ((dx) ))
967
989#define DY2COORD(met, dy) (((met)->coord_type == 0)? DY2DEG((dy) / 1000.0) : ((dy) ))
990
1004#define DIST(a, b) \
1005 sqrt(DIST2(a, b))
1006
1020#define DIST2(a, b) \
1021 ((a[0]-b[0])*(a[0]-b[0])+(a[1]-b[1])*(a[1]-b[1])+(a[2]-b[2])*(a[2]-b[2]))
1022
1036#define DOTP(a, b) \
1037 (a[0]*b[0]+a[1]*b[1]+a[2]*b[2])
1038
1050#define ECC(cmd) { \
1051 int ecc_result=(cmd); \
1052 if(ecc_result!=0) \
1053 ERRMSG("ECCODES error: %s", codes_get_error_message(ecc_result)); \
1054 }
1055
1069#define ECC_READ_2D(variable, target, scaling_factor, found_flag) { \
1070 if(strcmp(short_name, variable) == 0) { \
1071 if ((found_flag) == 0) \
1072 LOG(2, "Read 2-D variable: %s (GRIB)", variable); \
1073 for (int ix = 0; ix < met->nx; ix++) \
1074 for (int iy = 0; iy < met->ny; iy++) \
1075 target[ix][iy] = (float)(values[iy * met->nx + ix] * scaling_factor); \
1076 found_flag = 1; \
1077 } \
1078 }
1079
1094#define ECC_READ_3D(variable, level, target, scaling_factor, found_flag) { \
1095 if(strcmp(short_name, variable) == 0) { \
1096 if ((found_flag) == 0) \
1097 LOG(2, "Read 3-D variable: %s (GRIB)", variable); \
1098 for (int ix = 0; ix < met->nx; ix++) \
1099 for (int iy = 0; iy < met->ny; iy++) \
1100 target[ix][iy][level] = (float) (values[iy * met->nx + ix] * scaling_factor); \
1101 found_flag += 1; \
1102 } \
1103 }
1104
1121#define FMOD(x, y) \
1122 ((x) - (int) ((x) / (y)) * (y))
1123
1139#define FREAD(ptr, type, size, in) { \
1140 if(fread(ptr, sizeof(type), size, in)!=size) \
1141 ERRMSG("Error while reading!"); \
1142 }
1143
1159#define FWRITE(ptr, type, size, out) { \
1160 if(fwrite(ptr, sizeof(type), size, out)!=size) \
1161 ERRMSG("Error while writing!"); \
1162 }
1163
1174#define INTPOL_INIT \
1175 double cw[4] = {0.0, 0.0, 0.0, 0.0}; int ci[3] = {0, 0, 0};
1176
1188#define INTPOL_2D(var, init) \
1189 intpol_met_time_2d(met0, met0->var, met1, met1->var, \
1190 atm->time[ip], atm->lon[ip], atm->lat[ip], \
1191 &var, ci, cw, init);
1192
1205#define INTPOL_3D(var, init) \
1206 intpol_met_time_3d(met0, met0->var, met1, met1->var, \
1207 atm->time[ip], atm->p[ip], \
1208 atm->lon[ip], atm->lat[ip], \
1209 &var, ci, cw, init);
1210
1224#define INTPOL_SPACE_ALL(p, lon, lat) { \
1225 intpol_met_space_3d(met, met->z, p, lon, lat, &z, ci, cw, 1); \
1226 intpol_met_space_3d(met, met->t, p, lon, lat, &t, ci, cw, 0); \
1227 intpol_met_space_3d(met, met->u, p, lon, lat, &u, ci, cw, 0); \
1228 intpol_met_space_3d(met, met->v, p, lon, lat, &v, ci, cw, 0); \
1229 intpol_met_space_3d(met, met->w, p, lon, lat, &w, ci, cw, 0); \
1230 intpol_met_space_3d(met, met->pv, p, lon, lat, &pv, ci, cw, 0); \
1231 intpol_met_space_3d(met, met->h2o, p, lon, lat, &h2o, ci, cw, 0); \
1232 intpol_met_space_3d(met, met->o3, p, lon, lat, &o3, ci, cw, 0); \
1233 intpol_met_space_3d(met, met->lwc, p, lon, lat, &lwc, ci, cw, 0); \
1234 intpol_met_space_3d(met, met->rwc, p, lon, lat, &rwc, ci, cw, 0); \
1235 intpol_met_space_3d(met, met->iwc, p, lon, lat, &iwc, ci, cw, 0); \
1236 intpol_met_space_3d(met, met->swc, p, lon, lat, &swc, ci, cw, 0); \
1237 intpol_met_space_3d(met, met->cc, p, lon, lat, &cc, ci, cw, 0); \
1238 intpol_met_space_2d(met, met->ps, lon, lat, &ps, ci, cw, 0); \
1239 intpol_met_space_2d(met, met->ts, lon, lat, &ts, ci, cw, 0); \
1240 intpol_met_space_2d(met, met->zs, lon, lat, &zs, ci, cw, 0); \
1241 intpol_met_space_2d(met, met->us, lon, lat, &us, ci, cw, 0); \
1242 intpol_met_space_2d(met, met->vs, lon, lat, &vs, ci, cw, 0); \
1243 intpol_met_space_2d(met, met->ess, ess, lat, &ess, ci, cw, 0); \
1244 intpol_met_space_2d(met, met->nss, nss, lat, &nss, ci, cw, 0); \
1245 intpol_met_space_2d(met, met->shf, shf, lat, &shf, ci, cw, 0); \
1246 intpol_met_space_2d(met, met->lsm, lon, lat, &lsm, ci, cw, 0); \
1247 intpol_met_space_2d(met, met->sst, lon, lat, &sst, ci, cw, 0); \
1248 intpol_met_space_2d(met, met->pbl, lon, lat, &pbl, ci, cw, 0); \
1249 intpol_met_space_2d(met, met->pt, lon, lat, &pt, ci, cw, 0); \
1250 intpol_met_space_2d(met, met->tt, lon, lat, &tt, ci, cw, 0); \
1251 intpol_met_space_2d(met, met->zt, lon, lat, &zt, ci, cw, 0); \
1252 intpol_met_space_2d(met, met->h2ot, lon, lat, &h2ot, ci, cw, 0); \
1253 intpol_met_space_2d(met, met->pct, lon, lat, &pct, ci, cw, 0); \
1254 intpol_met_space_2d(met, met->pcb, lon, lat, &pcb, ci, cw, 0); \
1255 intpol_met_space_2d(met, met->cl, lon, lat, &cl, ci, cw, 0); \
1256 intpol_met_space_2d(met, met->plcl, lon, lat, &plcl, ci, cw, 0); \
1257 intpol_met_space_2d(met, met->plfc, lon, lat, &plfc, ci, cw, 0); \
1258 intpol_met_space_2d(met, met->pel, lon, lat, &pel, ci, cw, 0); \
1259 intpol_met_space_2d(met, met->cape, lon, lat, &cape, ci, cw, 0); \
1260 intpol_met_space_2d(met, met->cin, lon, lat, &cin, ci, cw, 0); \
1261 intpol_met_space_2d(met, met->o3c, lon, lat, &o3c, ci, cw, 0); \
1262 }
1263
1278#define INTPOL_TIME_ALL(time, p, lon, lat) { \
1279 intpol_met_time_3d(met0, met0->z, met1, met1->z, time, p, lon, lat, &z, ci, cw, 1); \
1280 intpol_met_time_3d(met0, met0->t, met1, met1->t, time, p, lon, lat, &t, ci, cw, 0); \
1281 intpol_met_time_3d(met0, met0->u, met1, met1->u, time, p, lon, lat, &u, ci, cw, 0); \
1282 intpol_met_time_3d(met0, met0->v, met1, met1->v, time, p, lon, lat, &v, ci, cw, 0); \
1283 intpol_met_time_3d(met0, met0->w, met1, met1->w, time, p, lon, lat, &w, ci, cw, 0); \
1284 intpol_met_time_3d(met0, met0->pv, met1, met1->pv, time, p, lon, lat, &pv, ci, cw, 0); \
1285 intpol_met_time_3d(met0, met0->h2o, met1, met1->h2o, time, p, lon, lat, &h2o, ci, cw, 0); \
1286 intpol_met_time_3d(met0, met0->o3, met1, met1->o3, time, p, lon, lat, &o3, ci, cw, 0); \
1287 intpol_met_time_3d(met0, met0->lwc, met1, met1->lwc, time, p, lon, lat, &lwc, ci, cw, 0); \
1288 intpol_met_time_3d(met0, met0->rwc, met1, met1->rwc, time, p, lon, lat, &rwc, ci, cw, 0); \
1289 intpol_met_time_3d(met0, met0->iwc, met1, met1->iwc, time, p, lon, lat, &iwc, ci, cw, 0); \
1290 intpol_met_time_3d(met0, met0->swc, met1, met1->swc, time, p, lon, lat, &swc, ci, cw, 0); \
1291 intpol_met_time_3d(met0, met0->cc, met1, met1->cc, time, p, lon, lat, &cc, ci, cw, 0); \
1292 intpol_met_time_2d(met0, met0->ps, met1, met1->ps, time, lon, lat, &ps, ci, cw, 0); \
1293 intpol_met_time_2d(met0, met0->ts, met1, met1->ts, time, lon, lat, &ts, ci, cw, 0); \
1294 intpol_met_time_2d(met0, met0->zs, met1, met1->zs, time, lon, lat, &zs, ci, cw, 0); \
1295 intpol_met_time_2d(met0, met0->us, met1, met1->us, time, lon, lat, &us, ci, cw, 0); \
1296 intpol_met_time_2d(met0, met0->vs, met1, met1->vs, time, lon, lat, &vs, ci, cw, 0); \
1297 intpol_met_time_2d(met0, met0->ess, met1, met1->ess, time, lon, lat, &ess, ci, cw, 0); \
1298 intpol_met_time_2d(met0, met0->nss, met1, met1->nss, time, lon, lat, &nss, ci, cw, 0); \
1299 intpol_met_time_2d(met0, met0->shf, met1, met1->shf, time, lon, lat, &shf, ci, cw, 0); \
1300 intpol_met_time_2d(met0, met0->lsm, met1, met1->lsm, time, lon, lat, &lsm, ci, cw, 0); \
1301 intpol_met_time_2d(met0, met0->sst, met1, met1->sst, time, lon, lat, &sst, ci, cw, 0); \
1302 intpol_met_time_2d(met0, met0->pbl, met1, met1->pbl, time, lon, lat, &pbl, ci, cw, 0); \
1303 intpol_met_time_2d(met0, met0->pt, met1, met1->pt, time, lon, lat, &pt, ci, cw, 0); \
1304 intpol_met_time_2d(met0, met0->tt, met1, met1->tt, time, lon, lat, &tt, ci, cw, 0); \
1305 intpol_met_time_2d(met0, met0->zt, met1, met1->zt, time, lon, lat, &zt, ci, cw, 0); \
1306 intpol_met_time_2d(met0, met0->h2ot, met1, met1->h2ot, time, lon, lat, &h2ot, ci, cw, 0); \
1307 intpol_met_time_2d(met0, met0->pct, met1, met1->pct, time, lon, lat, &pct, ci, cw, 0); \
1308 intpol_met_time_2d(met0, met0->pcb, met1, met1->pcb, time, lon, lat, &pcb, ci, cw, 0); \
1309 intpol_met_time_2d(met0, met0->cl, met1, met1->cl, time, lon, lat, &cl, ci, cw, 0); \
1310 intpol_met_time_2d(met0, met0->plcl, met1, met1->plcl, time, lon, lat, &plcl, ci, cw, 0); \
1311 intpol_met_time_2d(met0, met0->plfc, met1, met1->plfc, time, lon, lat, &plfc, ci, cw, 0); \
1312 intpol_met_time_2d(met0, met0->pel, met1, met1->pel, time, lon, lat, &pel, ci, cw, 0); \
1313 intpol_met_time_2d(met0, met0->cape, met1, met1->cape, time, lon, lat, &cape, ci, cw, 0); \
1314 intpol_met_time_2d(met0, met0->cin, met1, met1->cin, time, lon, lat, &cin, ci, cw, 0); \
1315 intpol_met_time_2d(met0, met0->o3c, met1, met1->o3c, time, lon, lat, &o3c, ci, cw, 0); \
1316 }
1317
1332#define LAPSE(p1, t1, p2, t2) \
1333 (1e3 * G0 / RA * ((t2) - (t1)) / ((t2) + (t1)) \
1334 * ((p2) + (p1)) / ((p2) - (p1)))
1335
1351#define LIN(x0, y0, x1, y1, x) \
1352 ((y0)+((y1)-(y0))/((x1)-(x0))*((x)-(x0)))
1353
1378#define MAX(a,b) \
1379 (((a)>(b))?(a):(b))
1380
1392#define MET_HEADER \
1393 fprintf(out, \
1394 "# $1 = time [s]\n" \
1395 "# $2 = altitude [km]\n" \
1396 "# $3 = longitude [deg]\n" \
1397 "# $4 = latitude [deg]\n" \
1398 "# $5 = pressure [hPa]\n" \
1399 "# $6 = temperature [K]\n" \
1400 "# $7 = zonal wind [m/s]\n" \
1401 "# $8 = meridional wind [m/s]\n" \
1402 "# $9 = vertical velocity [hPa/s]\n" \
1403 "# $10 = H2O volume mixing ratio [ppv]\n"); \
1404 fprintf(out, \
1405 "# $11 = O3 volume mixing ratio [ppv]\n" \
1406 "# $12 = geopotential height [km]\n" \
1407 "# $13 = potential vorticity [PVU]\n" \
1408 "# $14 = surface pressure [hPa]\n" \
1409 "# $15 = surface temperature [K]\n" \
1410 "# $16 = surface geopotential height [km]\n" \
1411 "# $17 = surface zonal wind [m/s]\n" \
1412 "# $18 = surface meridional wind [m/s]\n" \
1413 "# $19 = eastward turbulent surface stress [N/m^2]\n" \
1414 "# $20 = northward turbulent surface stress [N/m^2]\n"); \
1415 fprintf(out, \
1416 "# $21 = surface sensible heat flux [W/m^2]\n" \
1417 "# $22 = land-sea mask [1]\n" \
1418 "# $23 = sea surface temperature [K]\n" \
1419 "# $24 = tropopause pressure [hPa]\n" \
1420 "# $25 = tropopause geopotential height [km]\n" \
1421 "# $26 = tropopause temperature [K]\n" \
1422 "# $27 = tropopause water vapor [ppv]\n" \
1423 "# $28 = cloud liquid water content [kg/kg]\n" \
1424 "# $29 = cloud rain water content [kg/kg]\n" \
1425 "# $30 = cloud ice water content [kg/kg]\n"); \
1426 fprintf(out, \
1427 "# $31 = cloud snow water content [kg/kg]\n" \
1428 "# $32 = cloud cover [1]\n" \
1429 "# $33 = total column cloud water [kg/m^2]\n" \
1430 "# $34 = cloud top pressure [hPa]\n" \
1431 "# $35 = cloud bottom pressure [hPa]\n" \
1432 "# $36 = pressure at lifted condensation level (LCL) [hPa]\n" \
1433 "# $37 = pressure at level of free convection (LFC) [hPa]\n" \
1434 "# $38 = pressure at equilibrium level (EL) [hPa]\n" \
1435 "# $39 = convective available potential energy (CAPE) [J/kg]\n" \
1436 "# $40 = convective inhibition (CIN) [J/kg]\n"); \
1437 fprintf(out, \
1438 "# $41 = relative humidity over water [%%]\n" \
1439 "# $42 = relative humidity over ice [%%]\n" \
1440 "# $43 = dew point temperature [K]\n" \
1441 "# $44 = frost point temperature [K]\n" \
1442 "# $45 = NAT temperature [K]\n" \
1443 "# $46 = HNO3 volume mixing ratio [ppv]\n" \
1444 "# $47 = OH volume mixing ratio [ppv]\n" \
1445 "# $48 = H2O2 volume mixing ratio [ppv]\n" \
1446 "# $49 = HO2 volume mixing ratio [ppv]\n" \
1447 "# $50 = O(1D) volume mixing ratio [ppv]\n"); \
1448 fprintf(out, \
1449 "# $51 = boundary layer pressure [hPa]\n" \
1450 "# $52 = total column ozone [DU]\n" \
1451 "# $53 = number of data points\n" \
1452 "# $54 = number of tropopause data points\n" \
1453 "# $55 = number of CAPE data points\n");
1454
1479#define MIN(a,b) \
1480 (((a)<(b))?(a):(b))
1481
1494#define MOLEC_DENS(p,t) \
1495 (AVO * 1e-6 * ((p) * 100) / (RI * (t)))
1496
1508#define NC(cmd) { \
1509 int nc_result=(cmd); \
1510 if(nc_result!=NC_NOERR) \
1511 ERRMSG("%s", nc_strerror(nc_result)); \
1512 }
1513
1537#define NC_DEF_VAR(varname, type, ndims, dims, long_name, units, level, quant) { \
1538 NC(nc_def_var(ncid, varname, type, ndims, dims, &varid)); \
1539 NC(nc_put_att_text(ncid, varid, "long_name", strnlen(long_name, LEN), long_name)); \
1540 NC(nc_put_att_text(ncid, varid, "units", strnlen(units, LEN), units)); \
1541 if((quant) > 0) \
1542 NC(nc_def_var_quantize(ncid, varid, NC_QUANTIZE_GRANULARBR, quant)); \
1543 if((level) != 0) { \
1544 NC(nc_def_var_deflate(ncid, varid, 1, 1, level)); \
1545 /* unsigned int ulevel = (unsigned int)level; */ \
1546 /* NC(nc_def_var_filter(ncid, varid, 32015, 1, (unsigned int[]){ulevel})); */ \
1547 } \
1548 }
1549
1567#define NC_GET_DOUBLE(varname, ptr, force) { \
1568 if(force) { \
1569 NC(nc_inq_varid(ncid, varname, &varid)); \
1570 NC(nc_get_var_double(ncid, varid, ptr)); \
1571 } else { \
1572 if(nc_inq_varid(ncid, varname, &varid) == NC_NOERR) { \
1573 NC(nc_get_var_double(ncid, varid, ptr)); \
1574 } else \
1575 WARN("netCDF variable %s is missing!", varname); \
1576 } \
1577 }
1578
1597#define NC_INQ_DIM(dimname, ptr, min, max, check) { \
1598 int dimid; size_t naux; \
1599 NC(nc_inq_dimid(ncid, dimname, &dimid)); \
1600 NC(nc_inq_dimlen(ncid, dimid, &naux)); \
1601 *ptr = (int)naux; \
1602 if (check) \
1603 if ((*ptr) < (min) || (*ptr) > (max)) \
1604 ERRMSG("Dimension %s is out of range!", dimname); \
1605 }
1606
1621#define NC_PUT_DOUBLE(varname, ptr, hyperslab) { \
1622 NC(nc_inq_varid(ncid, varname, &varid)); \
1623 if(hyperslab) { \
1624 NC(nc_put_vara_double(ncid, varid, start, count, ptr)); \
1625 } else { \
1626 NC(nc_put_var_double(ncid, varid, ptr)); \
1627 } \
1628 }
1629
1645#define NC_PUT_FLOAT(varname, ptr, hyperslab) { \
1646 NC(nc_inq_varid(ncid, varname, &varid)); \
1647 if(hyperslab) { \
1648 NC(nc_put_vara_float(ncid, varid, start, count, ptr)); \
1649 } else { \
1650 NC(nc_put_var_float(ncid, varid, ptr)); \
1651 } \
1652 }
1653
1668#define NC_PUT_INT(varname, ptr, hyperslab) { \
1669 NC(nc_inq_varid(ncid, varname, &varid)); \
1670 if(hyperslab) { \
1671 NC(nc_put_vara_int(ncid, varid, start, count, ptr)); \
1672 } else { \
1673 NC(nc_put_var_int(ncid, varid, ptr)); \
1674 } \
1675 }
1676
1690#define NC_PUT_ATT(varname, attname, text) { \
1691 NC(nc_inq_varid(ncid, varname, &varid)); \
1692 NC(nc_put_att_text(ncid, varid, attname, strnlen(text, LEN), text)); \
1693 }
1694
1707#define NC_PUT_ATT_GLOBAL(attname, text) \
1708 NC(nc_put_att_text(ncid, NC_GLOBAL, attname, strnlen(text, LEN), text));
1709
1727#define NN(x0, y0, x1, y1, x) \
1728 (fabs((x) - (x0)) <= fabs((x) - (x1)) ? (y0) : (y1))
1729
1745#ifdef _OPENACC
1746#define PARTICLE_LOOP(ip0, ip1, check_dt, ...) \
1747 const int ip0_const = ip0; \
1748 const int ip1_const = ip1; \
1749 _Pragma(__VA_ARGS__) \
1750 _Pragma("acc parallel loop independent gang vector") \
1751 for (int ip = ip0_const; ip < ip1_const; ip++) \
1752 if (!check_dt || cache->dt[ip] != 0)
1753#else
1754#define PARTICLE_LOOP(ip0, ip1, check_dt, ...) \
1755 const int ip0_const = ip0; \
1756 const int ip1_const = ip1; \
1757 _Pragma("omp parallel for default(shared)") \
1758 for (int ip = ip0_const; ip < ip1_const; ip++) \
1759 if (!check_dt || cache->dt[ip] != 0)
1760#endif
1761
1784#define P(z) \
1785 (P0 * exp(-(z) / H0))
1786
1808#define PSAT(t) \
1809 (6.112 * exp(17.62 * ((t) - T0) / (243.12 + (t) - T0)))
1810
1832#define PSICE(t) \
1833 (6.112 * exp(22.46 * ((t) - T0) / (272.62 + (t) - T0)))
1834
1859#define PW(p, h2o) \
1860 ((p) * MAX((h2o), 0.1e-6) / (1. + (1. - EPS) * MAX((h2o), 0.1e-6)))
1861
1876#define RAD2DEG(rad) \
1877 ((rad) * (180.0 / M_PI))
1878
1906#define RH(p, t, h2o) \
1907 (PW(p, h2o) / PSAT(t) * 100.)
1908
1936#define RHICE(p, t, h2o) \
1937 (PW(p, h2o) / PSICE(t) * 100.)
1938
1961#define RHO(p, t) \
1962 (100. * (p) / (RA * (t)))
1963
1980#define SET_ATM(qnt, val) \
1981 if (ctl->qnt >= 0) \
1982 atm->q[ctl->qnt][ip] = val;
1983
2003#define SET_QNT(qnt, name, longname, unit) \
2004 if (strcasecmp(ctl->qnt_name[iq], name) == 0) { \
2005 ctl->qnt = iq; \
2006 sprintf(ctl->qnt_longname[iq], longname); \
2007 sprintf(ctl->qnt_unit[iq], unit); \
2008 } else
2009
2024#define SH(h2o) \
2025 (EPS * MAX((h2o), 0.1e-6))
2026
2037#define SQR(x) \
2038 ((x)*(x))
2039
2051#define SWAP(x, y, type) \
2052 do {type tmp = x; x = y; y = tmp;} while(0);
2053
2075#define TDEW(p, h2o) \
2076 (T0 + 243.12 * log(PW((p), (h2o)) / 6.112) \
2077 / (17.62 - log(PW((p), (h2o)) / 6.112)))
2078
2100#define TICE(p, h2o) \
2101 (T0 + 272.62 * log(PW((p), (h2o)) / 6.112) \
2102 / (22.46 - log(PW((p), (h2o)) / 6.112)))
2103
2124#define THETA(p, t) \
2125 ((t) * pow(1000. / (p), KAPPA))
2126
2153#define THETAVIRT(p, t, h2o) \
2154 (TVIRT(THETA((p), (t)), MAX((h2o), 0.1e-6)))
2155
2174#define TOK(line, tok, format, var) { \
2175 if(((tok)=strtok((line), " \t"))) { \
2176 if(sscanf(tok, format, &(var))!=1) continue; \
2177 } else ERRMSG("Error while reading!"); \
2178 }
2179
2199#define TVIRT(t, h2o) \
2200 ((t) * (1. + (1. - EPS) * MAX((h2o), 0.1e-6)))
2201
2213#define USAGE \
2214 do { \
2215 int iusage; \
2216 for (iusage = 1; iusage < argc; iusage++) \
2217 if (!strcmp(argv[iusage], "-h") \
2218 || !strcmp(argv[iusage], "--help")) { \
2219 usage(); \
2220 return EXIT_SUCCESS; \
2221 } \
2222 } while (0)
2223
2243#define Z(p) \
2244 (H0 * log(P0 / (p)))
2245
2274#define ZDIFF(lnp0, t0, h2o0, lnp1, t1, h2o1) \
2275 (RI / MA / G0 * 0.5 * (TVIRT((t0), (h2o0)) + TVIRT((t1), (h2o1))) \
2276 * ((lnp0) - (lnp1)))
2277
2293#define ZETA(ps, p, t) \
2294 (((p) / (ps) <= 0.3 ? 1. : \
2295 sin(M_PI / 2. * (1. - (p) / (ps)) / (1. - 0.3))) \
2296 * THETA((p), (t)))
2297
2298/* ------------------------------------------------------------
2299 Log messages...
2300 ------------------------------------------------------------ */
2301
2303#ifndef LOGLEV
2304#define LOGLEV 2
2305#endif
2306
2336#define LOG(level, ...) { \
2337 if(level >= 2) \
2338 printf(" "); \
2339 if(level <= LOGLEV) { \
2340 printf(__VA_ARGS__); \
2341 printf("\n"); \
2342 } \
2343 }
2344
2373#define WARN(...) { \
2374 printf("\nWarning (%s, %s, l%d): ", __FILE__, __func__, __LINE__); \
2375 LOG(0, __VA_ARGS__); \
2376 }
2377
2406#define ERRMSG(...) { \
2407 printf("\nError (%s, %s, l%d): ", __FILE__, __func__, __LINE__); \
2408 LOG(0, __VA_ARGS__); \
2409 exit(EXIT_FAILURE); \
2410 }
2411
2441#define PRINT(format, var) \
2442 printf("Print (%s, %s, l%d): %s= "format"\n", \
2443 __FILE__, __func__, __LINE__, #var, var);
2444
2445/* ------------------------------------------------------------
2446 Timers...
2447 ------------------------------------------------------------ */
2448
2450#define NTIMER 100
2451
2465#define PRINT_TIMERS \
2466 timer("END", "END", 1);
2467
2480#define SELECT_TIMER(id, group) \
2481 timer(id, group, 0);
2482
2483/* ------------------------------------------------------------
2484 Structs...
2485 ------------------------------------------------------------ */
2486
2494typedef struct {
2495
2496 /* ------------------------------------------------------------
2497 Quantity parameters...
2498 ------------------------------------------------------------ */
2499
2501 int nq;
2502
2504 char qnt_name[NQ][LEN];
2505
2507 char qnt_longname[NQ][LEN];
2508
2510 char qnt_unit[NQ][LEN];
2511
2513 char qnt_format[NQ][LEN];
2514
2517
2520
2523
2526
2529
2532
2535
2538
2541
2544
2547
2550
2553
2556
2559
2562
2565
2568
2571
2574
2577
2580
2583
2586
2589
2592
2595
2598
2601
2604
2607
2610
2613
2616
2619
2622
2625
2628
2631
2634
2637
2640
2643
2646
2649
2652
2655
2658
2661
2664
2667
2670
2673
2676
2679
2682
2685
2688
2691
2694
2697
2700
2703
2706
2709
2712
2715
2718
2721
2724
2727
2730
2733
2736
2739
2742
2745
2748
2751
2754
2757
2760
2763
2766
2769
2772
2775
2778
2781
2784
2787
2790
2793
2796
2799
2802
2805
2808
2811
2814
2817
2820
2823
2825 double t_start;
2826
2828 double t_stop;
2829
2831 double dt_mod;
2832
2833 /* ------------------------------------------------------------
2834 Meteo data parameters...
2835 ------------------------------------------------------------ */
2836
2838 char metbase[LEN];
2839
2841 double dt_met;
2842
2845
2848
2851
2854
2858
2861
2865
2868
2871
2874
2877
2880
2883
2886
2889
2891 int met_zfp_prec[METVAR];
2892
2894 double met_zfp_tol[METVAR];
2895
2897 int met_sz3_prec[METVAR];
2898
2900 double met_sz3_tol[METVAR];
2901
2903 int met_lossy_scale[METVAR];
2904
2906 char met_comp_logfile[LEN];
2907
2910
2913
2916
2919
2922
2924 double met_cms_eps[METVAR];
2925
2928
2931
2934
2937
2940
2943
2946
2949
2951 double met_p[EP];
2952
2955
2958
2960 double met_lev_hyam[EP];
2961
2963 double met_lev_hybm[EP];
2964
2967
2970
2973
2976
2979
2982
2985
2989
2992
2995
2998
3001
3004
3007
3008 /* ------------------------------------------------------------
3009 Geophysical module parameters...
3010 ------------------------------------------------------------ */
3011
3013 double sort_dt;
3014
3018
3020 char balloon[LEN];
3021
3024
3028
3031
3034
3037
3040
3043
3046
3049
3052
3055
3058
3061
3064
3067
3070
3073
3075 double conv_cin;
3076
3078 double conv_dt;
3079
3082
3085
3088
3091
3094
3097
3099 double bound_p0;
3100
3102 double bound_p1;
3103
3106
3109
3112
3115
3117 char species[LEN];
3118
3120 double molmass;
3121
3124
3127
3130
3132 char clim_hno3_filename[LEN];
3133
3135 char clim_oh_filename[LEN];
3136
3138 char clim_h2o2_filename[LEN];
3139
3141 char clim_ho2_filename[LEN];
3142
3144 char clim_o1d_filename[LEN];
3145
3147 char clim_o3_filename[LEN];
3148
3150 char clim_ccl4_timeseries[LEN];
3151
3153 char clim_ccl3f_timeseries[LEN];
3154
3156 char clim_ccl2f2_timeseries[LEN];
3157
3159 char clim_n2o_timeseries[LEN];
3160
3162 char clim_sf6_timeseries[LEN];
3163
3166
3169
3172
3175
3178
3181
3184
3187
3190
3193
3196
3199
3202
3205
3208
3211
3214
3217
3220
3223
3226
3229
3231 double oh_chem[4];
3232
3235
3238
3241
3243 double dt_kpp;
3244
3247
3250
3253
3255 double wet_depo_pre[2];
3256
3259
3262
3265
3268
3270 double wet_depo_ic_h[2];
3271
3273 double wet_depo_bc_h[2];
3274
3277
3280
3283
3286
3289
3291 double psc_h2o;
3292
3294 double psc_hno3;
3295
3296 /* ------------------------------------------------------------
3297 Output parameters...
3298 ------------------------------------------------------------ */
3299
3301 char depo_basename[LEN];
3302
3305
3308
3310 char atm_basename[LEN];
3311
3313 char atm_gpfile[LEN];
3314
3317
3320
3323
3327
3332
3335
3337 int atm_nc_quant[NQ];
3338
3341
3343 char csi_basename[LEN];
3344
3346 char csi_kernel[LEN];
3347
3350
3352 char csi_obsfile[LEN];
3353
3356
3359
3362
3364 double csi_z0;
3365
3367 double csi_z1;
3368
3371
3373 double csi_lon0;
3374
3376 double csi_lon1;
3377
3380
3382 double csi_lat0;
3383
3385 double csi_lat1;
3386
3388 int nens;
3389
3391 char ens_basename[LEN];
3392
3395
3397 char grid_basename[LEN];
3398
3400 char grid_kernel[LEN];
3401
3403 char grid_gpfile[LEN];
3404
3407
3410
3413
3415 int grid_nc_quant[NQ];
3416
3419
3422
3424 double grid_z0;
3425
3427 double grid_z1;
3428
3431
3434
3437
3440
3443
3446
3449
3451 char prof_basename[LEN];
3452
3454 char prof_obsfile[LEN];
3455
3458
3460 double prof_z0;
3461
3463 double prof_z1;
3464
3467
3470
3473
3476
3479
3482
3484 char sample_basename[LEN];
3485
3487 char sample_kernel[LEN];
3488
3490 char sample_obsfile[LEN];
3491
3494
3497
3499 char stat_basename[LEN];
3500
3502 double stat_lon;
3503
3505 double stat_lat;
3506
3508 double stat_r;
3509
3511 double stat_t0;
3512
3514 double stat_t1;
3515
3517 char vtk_basename[LEN];
3518
3521
3524
3527
3530
3533
3534 /* ------------------------------------------------------------
3535 Domain decomposition...
3536 ------------------------------------------------------------ */
3537
3539 int dd;
3540
3543
3546
3549
3552
3553} ctl_t;
3554
3563typedef struct {
3564
3566 int np;
3567
3569 double time[NP];
3570
3572 double p[NP];
3573
3575 double lon[NP];
3576
3578 double lat[NP];
3579
3581 double q[NQ][NP];
3582
3583} atm_t;
3584
3592typedef struct {
3593
3595 double time;
3596
3598 double p;
3599
3601 double lon;
3602
3604 double lat;
3605
3607 double q[NQ];
3608
3609} particle_t;
3610
3611
3618typedef struct {
3619
3621 double iso_var[NP];
3622
3624 double iso_ps[NP];
3625
3627 double iso_ts[NP];
3628
3631
3633 float uvwp[NP][3];
3634
3636 double rs[3 * NP + 1];
3637
3639 double dt[NP];
3640
3641} cache_t;
3642
3654typedef struct {
3655
3657 double Apb210[EX * EY];
3658
3660 double Abe7[EX * EY];
3661
3663 double Acs137[EX * EY];
3664
3666 double Ai131[EX * EY];
3667
3668} depo_t;
3669
3677typedef struct {
3678
3680 int np;
3681
3683 int nsza;
3684
3686 int no3c;
3687
3689 double p[CP];
3690
3692 double sza[CSZA];
3693
3695 double o3c[CO3];
3696
3698 double n2o[CP][CSZA][CO3];
3699
3701 double ccl4[CP][CSZA][CO3];
3702
3704 double ccl3f[CP][CSZA][CO3];
3705
3707 double ccl2f2[CP][CSZA][CO3];
3708
3710 double o2[CP][CSZA][CO3];
3711
3713 double o3_1[CP][CSZA][CO3];
3714
3716 double o3_2[CP][CSZA][CO3];
3717
3719 double h2o2[CP][CSZA][CO3];
3720
3722 double h2o[CP][CSZA][CO3];
3723
3724} clim_photo_t;
3725
3733typedef struct {
3734
3737
3739 double time[CTS];
3740
3742 double vmr[CTS];
3743
3744} clim_ts_t;
3745
3753typedef struct {
3754
3757
3759 int nlat;
3760
3762 int np;
3763
3765 double time[CT];
3766
3768 double lat[CY];
3769
3771 double p[CP];
3772
3774 double vmr[CT][CP][CY];
3775
3776} clim_zm_t;
3777
3785typedef struct {
3786
3789
3792
3794 double tropo_time[12];
3795
3797 double tropo_lat[73];
3798
3800 double tropo[12][73];
3801
3804
3807
3810
3813
3816
3819
3822
3825
3828
3831
3834
3835} clim_t;
3836
3844typedef struct {
3845
3847 double time;
3848
3849 /* Grid type: 0=lat/lon [deg], 1=UTM [m]. */
3851
3853 int nx;
3854
3856 int ny;
3857
3859 int np;
3860
3862 int npl;
3863
3865 double lon[EX];
3866
3868 double lat[EY];
3869
3871 double p[EP];
3872
3874 double hybrid[EP];
3875
3877 double hyam[EP];
3878
3880 double hybm[EP];
3881
3883 double eta[EP];
3884
3886 float ps[EX][EY];
3887
3889 float ts[EX][EY];
3890
3892 float zs[EX][EY];
3893
3895 float us[EX][EY];
3896
3898 float vs[EX][EY];
3899
3901 float ess[EX][EY];
3902
3904 float nss[EX][EY];
3905
3907 float shf[EX][EY];
3908
3910 float lsm[EX][EY];
3911
3913 float sst[EX][EY];
3914
3916 float pbl[EX][EY];
3917
3919 float pt[EX][EY];
3920
3922 float tt[EX][EY];
3923
3925 float zt[EX][EY];
3926
3928 float h2ot[EX][EY];
3929
3931 float pct[EX][EY];
3932
3934 float pcb[EX][EY];
3935
3937 float cl[EX][EY];
3938
3940 float plcl[EX][EY];
3941
3943 float plfc[EX][EY];
3944
3946 float pel[EX][EY];
3947
3949 float cape[EX][EY];
3950
3952 float cin[EX][EY];
3953
3955 float o3c[EX][EY];
3956
3958 float z[EX][EY][EP];
3959
3961 float t[EX][EY][EP];
3962
3964 float u[EX][EY][EP];
3965
3967 float v[EX][EY][EP];
3968
3970 float w[EX][EY][EP];
3971
3973 float pv[EX][EY][EP];
3974
3976 float h2o[EX][EY][EP];
3977
3979 float o3[EX][EY][EP];
3980
3982 float lwc[EX][EY][EP];
3983
3985 float rwc[EX][EY][EP];
3986
3988 float iwc[EX][EY][EP];
3989
3991 float swc[EX][EY][EP];
3992
3994 float cc[EX][EY][EP];
3995
3997 float pl[EX][EY][EP];
3998
4000 float ul[EX][EY][EP];
4001
4003 float vl[EX][EY][EP];
4004
4006 float wl[EX][EY][EP];
4007
4009 float zetal[EX][EY][EP];
4010
4012 float zeta_dotl[EX][EY][EP];
4013
4014} met_t;
4015
4021typedef struct {
4022
4023 /* ------------------------------------------------------------
4024 Global grid...
4025 ------------------------------------------------------------ */
4026
4029
4032
4034 double lon_glob[DD_EX_GLOB];
4035
4037 double lat_glob[DD_EY_GLOB];
4038
4039 /* ------------------------------------------------------------
4040 Subdomains...
4041 ------------------------------------------------------------ */
4042
4044 size_t subdomain_start[4];
4045
4047 size_t subdomain_count[4];
4048
4050 size_t halo_bnd_start[4];
4051
4053 size_t halo_bnd_count[4];
4054
4057
4060
4061 /* ------------------------------------------------------------
4062 Helpers...
4063 ------------------------------------------------------------ */
4064
4065#ifdef DD
4066
4068 MPI_Datatype MPI_Particle;
4069
4071 double sort_key[NP];
4072
4074 int perm[NP];
4075
4077 double tmp[NP];
4078
4079#endif
4080
4081} dd_t;
4082
4083/* ------------------------------------------------------------
4084 Functions...
4085 ------------------------------------------------------------ */
4086
4109 void *data,
4110 size_t N);
4111
4126void cart2geo(
4127 const double *x,
4128 double *z,
4129 double *lon,
4130 double *lat);
4131
4154double clim_oh(
4155 const ctl_t * ctl,
4156 const clim_t * clim,
4157 const double t,
4158 const double lon,
4159 const double lat,
4160 const double p);
4161
4181 const ctl_t * ctl,
4182 clim_t * clim);
4183
4213double clim_photo(
4214 const double rate[CP][CSZA][CO3],
4215 const clim_photo_t * photo,
4216 const double p,
4217 const double sza,
4218 const double o3c);
4219
4245double clim_tropo(
4246 const clim_t * clim,
4247 const double t,
4248 const double lat);
4249
4268void clim_tropo_init(
4269 clim_t * clim);
4270
4287double clim_ts(
4288 const clim_ts_t * ts,
4289 const double t);
4290
4312double clim_zm(
4313 const clim_zm_t * zm,
4314 const double t,
4315 const double lat,
4316 const double p);
4317
4342 FILE * out,
4343 const char *codec,
4344 const char *varname,
4345 const size_t lev,
4346 const double plev,
4347 const double ratio,
4348 const double bpv,
4349 const double t_comp,
4350 const double t_decomp,
4351 const size_t n,
4352 const size_t nbytes,
4353 const float *org,
4354 const float *cmp);
4355
4379 FILE * out,
4380 const char *codec,
4381 const char *varname,
4382 const met_t * met,
4383 const float *org_all,
4384 const float *cmp_all,
4385 const size_t nxy,
4386 const size_t nz,
4387 const double ratio,
4388 const double bpv,
4389 const double t_comp,
4390 const double t_decomp,
4391 const size_t nbytes);
4392
4411 const ctl_t * ctl,
4412 const met_t * met,
4413 const char *varname,
4414 float *array,
4415 const int decompress,
4416 FILE * level_log,
4417 FILE * inout);
4418
4435 float *array,
4436 const size_t nxy,
4437 const size_t nz,
4438 double *off,
4439 double *scl);
4440
4457 float *array,
4458 const size_t nxy,
4459 const size_t nz,
4460 const double *off,
4461 const double *scl);
4462
4480 FILE * in,
4481 const size_t nz,
4482 double **off,
4483 double **scl);
4484
4504 FILE * out,
4505 const int enabled,
4506 float *array,
4507 const size_t nxy,
4508 const size_t nz,
4509 double **off,
4510 double **scl);
4511
4512#ifdef ZSTD
4525ZSTD_CCtx *compress_zstd_create_cctx(
4526 const int level,
4527 const int nworkers);
4528#endif
4529
4542 const char *varname);
4543
4563void compress_pck(
4564 const ctl_t * ctl,
4565 const met_t * met,
4566 const char *varname,
4567 float *array,
4568 const int decompress,
4569 FILE * level_log,
4570 FILE * inout);
4571
4600 const ctl_t * ctl,
4601 const met_t * met,
4602 const char *varname,
4603 float *array,
4604 const int decompress,
4605 FILE * level_log,
4606 FILE * inout);
4607
4645 const ctl_t * ctl,
4646 const met_t * met,
4647 const char *varname,
4648 float *array,
4649 const int decompress,
4650 FILE * level_log,
4651 FILE * inout);
4652
4673 const ctl_t * ctl,
4674 const met_t * met,
4675 const char *varname,
4676 float *array,
4677 const int decompress,
4678 FILE * level_log,
4679 FILE * inout);
4680
4702 const ctl_t * ctl,
4703 const met_t * met,
4704 const char *varname,
4705 float *array,
4706 const int decompress,
4707 FILE * level_log,
4708 FILE * inout);
4709
4734double cos_sza(
4735 const double sec,
4736 const double lon,
4737 const double lat);
4738
4761void day2doy(
4762 const int year,
4763 const int mon,
4764 const int day,
4765 int *doy);
4766
4820 const ctl_t * ctl,
4821 const dd_t * dd,
4822 atm_t * atm,
4823 const int init);
4824
4877 const ctl_t * ctl,
4878 cache_t * cache,
4879 atm_t * atm,
4880 particle_t * particles,
4881 const int npart);
4882
4912 const ctl_t * ctl,
4913 const dd_t * dd,
4914 const double lon,
4915 const double lat);
4916
4973 const ctl_t * ctl,
4974 const dd_t * dd,
4975 particle_t ** particles,
4976 int *npart,
4977 int *capacity);
4978
5018 const ctl_t * ctl,
5019 dd_t * dd,
5020 atm_t * atm);
5021
5056 const dd_t * dd,
5057 double *lon,
5058 double *lat);
5059
5108 const ctl_t * ctl,
5109 cache_t * cache,
5110 const particle_t * particles,
5111 const int npart,
5112 atm_t * atm);
5113
5114
5160 const ctl_t * ctl,
5161 atm_t * atm,
5162 cache_t * cache,
5163 int *npart);
5164
5165
5211 dd_t * dd,
5212 const ctl_t * ctl,
5213 met_t * met,
5214 const int ncid);
5215
5274 const ctl_t * ctl,
5275 const met_t * met0,
5276 atm_t * atm,
5277 dd_t * dd,
5278 int *npart);
5279
5309 double *a,
5310 dd_t * dd,
5311 const int np);
5312
5334void doy2day(
5335 const int year,
5336 const int doy,
5337 int *mon,
5338 int *day);
5339
5366void fft_help(
5367 double *fcReal,
5368 double *fcImag,
5369 const int n);
5370
5397void geo2cart(
5398 const double z,
5399 const double lon,
5400 const double lat,
5401 double *x);
5402
5427void get_met_filename(
5428 const ctl_t * ctl,
5429 const double t,
5430 const int direct,
5431 const char *metbase,
5432 const double dt_met,
5433 char *filename);
5434
5458void get_met_replace(
5459 char *orig,
5460 const char *search,
5461 const char *repl);
5462
5499void get_tropo(
5500 const int met_tropo,
5501 ctl_t * ctl,
5502 const clim_t * clim,
5503 met_t * met,
5504 const double *lons,
5505 const int nx,
5506 const double *lats,
5507 const int ny,
5508 double *pt,
5509 double *zt,
5510 double *tt,
5511 double *qt,
5512 double *o3t,
5513 double *ps,
5514 double *zs);
5515
5537 const double *lons,
5538 const int nlon,
5539 const double *lats,
5540 const int nlat,
5541 const double lon,
5542 const double lat,
5543 double *lon2,
5544 double *lat2);
5545
5565 const double *lons,
5566 const int nlon,
5567 const double *lats,
5568 const int nlat,
5569 const double lon,
5570 const double lat,
5571 double *lon2,
5572 double *lat2);
5573
5616 const met_t * met0,
5617 float height0[EX][EY][EP],
5618 float array0[EX][EY][EP],
5619 const met_t * met1,
5620 float height1[EX][EY][EP],
5621 float array1[EX][EY][EP],
5622 const double ts,
5623 const double height,
5624 const double lon,
5625 const double lat,
5626 double *var,
5627 int *ci,
5628 double *cw,
5629 const int init);
5630
5666 const met_t * met,
5667 float array[EX][EY][EP],
5668 const double p,
5669 const double lon,
5670 const double lat,
5671 double *var,
5672 int *ci,
5673 double *cw,
5674 const int init);
5675
5711 const met_t * met,
5712 float array[EX][EY],
5713 const double lon,
5714 const double lat,
5715 double *var,
5716 int *ci,
5717 double *cw,
5718 const int init);
5719
5754 const met_t * met0,
5755 float array0[EX][EY][EP],
5756 const met_t * met1,
5757 float array1[EX][EY][EP],
5758 const double ts,
5759 const double p,
5760 const double lon,
5761 const double lat,
5762 double *var,
5763 int *ci,
5764 double *cw,
5765 const int init);
5766
5802 const met_t * met0,
5803 float array0[EX][EY],
5804 const met_t * met1,
5805 float array1[EX][EY],
5806 const double ts,
5807 const double lon,
5808 const double lat,
5809 double *var,
5810 int *ci,
5811 double *cw,
5812 const int init);
5813
5851void intpol_tropo_3d(
5852 const double time0,
5853 float array0[EX][EY],
5854 const double time1,
5855 float array1[EX][EY],
5856 const double lons[EX],
5857 const double lats[EY],
5858 const int nlon,
5859 const int nlat,
5860 const double time,
5861 const double lon,
5862 const double lat,
5863 const int method,
5864 double *var,
5865 double *sigma);
5866
5893void jsec2time(
5894 const double jsec,
5895 int *year,
5896 int *mon,
5897 int *day,
5898 int *hour,
5899 int *min,
5900 int *sec,
5901 double *remain);
5902
5929double kernel_weight(
5930 const double kz[EP],
5931 const double kw[EP],
5932 const int nk,
5933 const double p);
5934
5973double lapse_rate(
5974 const double t,
5975 const double h2o);
5976
6004 ctl_t * ctl);
6005
6025int locate_irr(
6026 const double *xx,
6027 const int n,
6028 const double x);
6029
6056 const float *xx,
6057 const int n,
6058 const double x,
6059 const int ig);
6060
6081int locate_reg(
6082 const double *xx,
6083 const int n,
6084 const double x);
6085
6107void locate_vert(
6108 float profiles[EX][EY][EP],
6109 const int np,
6110 const int lon_ap_ind,
6111 const int lat_ap_ind,
6112 const double alt_ap,
6113 int *ind);
6114
6140void module_advect(
6141 const ctl_t * ctl,
6142 const cache_t * cache,
6143 met_t * met0,
6144 met_t * met1,
6145 atm_t * atm);
6146
6170 const ctl_t * ctl,
6171 const cache_t * cache,
6172 met_t * met0,
6173 met_t * met1,
6174 atm_t * atm);
6175
6213 const ctl_t * ctl,
6214 const cache_t * cache,
6215 const clim_t * clim,
6216 met_t * met0,
6217 met_t * met1,
6218 atm_t * atm);
6219
6261void module_chem_grid(
6262 const ctl_t * ctl,
6263 met_t * met0,
6264 met_t * met1,
6265 atm_t * atm,
6266 const double t);
6267
6295void module_chem_init(
6296 const ctl_t * ctl,
6297 const cache_t * cache,
6298 const clim_t * clim,
6299 met_t * met0,
6300 met_t * met1,
6301 atm_t * atm);
6302
6327 const ctl_t * ctl,
6328 cache_t * cache,
6329 met_t * met0,
6330 met_t * met1,
6331 atm_t * atm);
6332
6378 double t,
6379 const ctl_t * ctl,
6380 cache_t * cache,
6381 dd_t * dd,
6382 atm_t * atm,
6383 met_t ** met);
6384
6411void module_decay(
6412 const ctl_t * ctl,
6413 const cache_t * cache,
6414 const clim_t * clim,
6415 atm_t * atm);
6416
6453void module_diff_meso(
6454 const ctl_t * ctl,
6455 cache_t * cache,
6456 met_t * met0,
6457 met_t * met1,
6458 atm_t * atm);
6459
6493void module_diff_pbl(
6494 const ctl_t * ctl,
6495 cache_t * cache,
6496 met_t * met0,
6497 met_t * met1,
6498 atm_t * atm);
6499
6554void module_diff_turb(
6555 const ctl_t * ctl,
6556 cache_t * cache,
6557 const clim_t * clim,
6558 met_t * met0,
6559 met_t * met1,
6560 atm_t * atm);
6561
6581void module_dry_depo(
6582 const ctl_t * ctl,
6583 const cache_t * cache,
6584 met_t * met0,
6585 met_t * met1,
6586 atm_t * atm);
6587
6620void module_h2o2_chem(
6621 const ctl_t * ctl,
6622 const cache_t * cache,
6623 const clim_t * clim,
6624 met_t * met0,
6625 met_t * met1,
6626 atm_t * atm);
6627
6648 const ctl_t * ctl,
6649 cache_t * cache,
6650 met_t * met0,
6651 met_t * met1,
6652 atm_t * atm);
6653
6671void module_isosurf(
6672 const ctl_t * ctl,
6673 const cache_t * cache,
6674 met_t * met0,
6675 met_t * met1,
6676 atm_t * atm);
6677
6710 ctl_t * ctl,
6711 cache_t * cache,
6712 clim_t * clim,
6713 met_t * met0,
6714 met_t * met1,
6715 atm_t * atm);
6716
6735void module_meteo(
6736 const ctl_t * ctl,
6737 const cache_t * cache,
6738 const clim_t * clim,
6739 met_t * met0,
6740 met_t * met1,
6741 atm_t * atm);
6742
6760void module_mixing(
6761 const ctl_t * ctl,
6762 const clim_t * clim,
6763 atm_t * atm,
6764 const double t);
6765
6794 const ctl_t * ctl,
6795 const clim_t * clim,
6796 atm_t * atm,
6797 const int *ixs,
6798 const int *iys,
6799 const int *izs,
6800 const int qnt_idx,
6801 const int use_ensemble);
6802
6835void module_oh_chem(
6836 const ctl_t * ctl,
6837 const cache_t * cache,
6838 const clim_t * clim,
6839 met_t * met0,
6840 met_t * met1,
6841 atm_t * atm);
6842
6870void module_position(
6871 const cache_t * cache,
6872 met_t * met0,
6873 met_t * met1,
6874 atm_t * atm);
6875
6900void module_rng_init(
6901 const int ntask);
6902
6928void module_rng(
6929 const ctl_t * ctl,
6930 double *rs,
6931 const size_t n,
6932 const int method);
6933
6969 const ctl_t * ctl,
6970 const cache_t * cache,
6971 atm_t * atm);
6972
6994 const ctl_t * ctl,
6995 const cache_t * cache,
6996 met_t * met0,
6997 met_t * met1,
6998 atm_t * atm,
6999 depo_t * depo);
7000
7023void module_sedi(
7024 const ctl_t * ctl,
7025 const cache_t * cache,
7026 met_t * met0,
7027 met_t * met1,
7028 atm_t * atm);
7029
7053void module_sort(
7054 const ctl_t * ctl,
7055 const met_t * met0,
7056 atm_t * atm);
7057
7077void module_sort_help(
7078 double *a,
7079 const int *p,
7080 const int np);
7081
7105void module_timesteps(
7106 const ctl_t * ctl,
7107 cache_t * cache,
7108 met_t * met0,
7109 atm_t * atm,
7110 const double t);
7111
7133 ctl_t * ctl,
7134 const atm_t * atm);
7135
7169 const ctl_t * ctl,
7170 const cache_t * cache,
7171 const clim_t * clim,
7172 met_t * met0,
7173 met_t * met1,
7174 atm_t * atm);
7175
7205void module_wet_depo(
7206 const ctl_t * ctl,
7207 const cache_t * cache,
7208 met_t * met0,
7209 met_t * met1,
7210 atm_t * atm);
7211
7246void mptrac_alloc(
7247 ctl_t ** ctl,
7248 cache_t ** cache,
7249 clim_t ** clim,
7250 met_t ** met0,
7251 met_t ** met1,
7252 atm_t ** atm,
7253 depo_t ** depo,
7254 dd_t ** dd);
7255
7286void mptrac_free(
7287 ctl_t * ctl,
7288 cache_t * cache,
7289 clim_t * clim,
7290 met_t * met0,
7291 met_t * met1,
7292 atm_t * atm,
7293 depo_t * depo,
7294 dd_t * dd);
7295
7331void mptrac_get_met(
7332 ctl_t * ctl,
7333 clim_t * clim,
7334 const double t,
7335 met_t ** met0,
7336 met_t ** met1,
7337 dd_t * dd);
7338
7359void mptrac_init(
7360 ctl_t * ctl,
7361 cache_t * cache,
7362 clim_t * clim,
7363 atm_t * atm,
7364 depo_t * depo,
7365 const int ntask);
7366
7402int mptrac_read_atm(
7403 const char *filename,
7404 const ctl_t * ctl,
7405 atm_t * atm);
7406
7438void mptrac_read_clim(
7439 const ctl_t * ctl,
7440 clim_t * clim);
7441
7471void mptrac_read_ctl(
7472 const char *filename,
7473 int argc,
7474 char *argv[],
7475 ctl_t * ctl);
7476
7507int mptrac_read_met(
7508 const char *filename,
7509 const ctl_t * ctl,
7510 const clim_t * clim,
7511 met_t * met,
7512 dd_t * dd);
7513
7536 ctl_t * ctl,
7537 cache_t * cache,
7538 clim_t * clim,
7539 met_t ** met0,
7540 met_t ** met1,
7541 atm_t * atm,
7542 depo_t * depo,
7543 double t,
7544 dd_t * dd);
7545
7575void mptrac_write_atm(
7576 const char *filename,
7577 const ctl_t * ctl,
7578 const atm_t * atm,
7579 const double t);
7580
7620void mptrac_write_met(
7621 const char *filename,
7622 const ctl_t * ctl,
7623 met_t * met);
7624
7661 const char *dirname,
7662 const ctl_t * ctl,
7663 met_t * met0,
7664 met_t * met1,
7665 atm_t * atm,
7666 depo_t * depo,
7667 const double t);
7668
7700 const ctl_t * ctl,
7701 const cache_t * cache,
7702 const clim_t * clim,
7703 met_t ** met0,
7704 met_t ** met1,
7705 const atm_t * atm);
7706
7737 const ctl_t * ctl,
7738 const cache_t * cache,
7739 const clim_t * clim,
7740 met_t ** met0,
7741 met_t ** met1,
7742 const atm_t * atm);
7743
7771double nat_temperature(
7772 const double p,
7773 const double h2o,
7774 const double hno3);
7775
7798double pbl_weight(
7799 const ctl_t * ctl,
7800 const atm_t * atm,
7801 const int ip,
7802 const double pbl,
7803 const double ps);
7804
7837int read_atm_asc(
7838 const char *filename,
7839 const ctl_t * ctl,
7840 atm_t * atm);
7841
7872int read_atm_bin(
7873 const char *filename,
7874 const ctl_t * ctl,
7875 atm_t * atm);
7876
7901int read_atm_clams(
7902 const char *filename,
7903 const ctl_t * ctl,
7904 atm_t * atm);
7905
7935int read_atm_nc(
7936 const char *filename,
7937 const ctl_t * ctl,
7938 atm_t * atm);
7939
7968void read_clim_photo(
7969 const char *filename,
7970 clim_photo_t * photo);
7971
7989 const int ncid,
7990 const char *varname,
7991 const clim_photo_t * photo,
7992 double var[CP][CSZA][CO3]);
7993
8017int read_clim_ts(
8018 const char *filename,
8019 clim_ts_t * ts);
8020
8047void read_clim_zm(
8048 const char *filename,
8049 const char *varname,
8050 clim_zm_t * zm);
8051
8079void read_kernel(
8080 const char *filename,
8081 double kz[EP],
8082 double kw[EP],
8083 int *nk);
8084
8116int read_met_bin(
8117 const char *filename,
8118 const ctl_t * ctl,
8119 met_t * met);
8120
8146void read_met_bin_2d(
8147 FILE * in,
8148 const met_t * met,
8149 float var[EX][EY],
8150 const char *varname);
8151
8189void read_met_bin_3d(
8190 FILE * in,
8191 const ctl_t * ctl,
8192 const met_t * met,
8193 float var[EX][EY][EP],
8194 const char *varname,
8195 const float bound_min,
8196 const float bound_max);
8197
8225void read_met_cape(
8226 const ctl_t * ctl,
8227 const clim_t * clim,
8228 met_t * met);
8229
8252void read_met_cloud(
8253 met_t * met);
8254
8280void read_met_detrend(
8281 const ctl_t * ctl,
8282 met_t * met);
8283
8307 met_t * met);
8308
8335void read_met_geopot(
8336 const ctl_t * ctl,
8337 met_t * met);
8338
8366 const char *filename,
8367 const ctl_t * ctl,
8368 met_t * met);
8369
8391 codes_handle ** handles,
8392 int count_handles,
8393 met_t * met);
8394
8415 codes_handle ** handles,
8416 const int num_messages,
8417 const ctl_t * ctl,
8418 met_t * met);
8419
8450 codes_handle ** handles,
8451 const int num_messages,
8452 const ctl_t * ctl,
8453 met_t * met);
8454
8483void read_met_ml2pl(
8484 const ctl_t * ctl,
8485 const met_t * met,
8486 float var[EX][EY][EP],
8487 const char *varname);
8488
8511 const ctl_t * ctl,
8512 met_t * met);
8513
8544int read_met_nc(
8545 const char *filename,
8546 const ctl_t * ctl,
8547 met_t * met,
8548 dd_t * dd);
8549
8584void read_met_nc_grid(
8585 const char *filename,
8586 const int ncid,
8587 const ctl_t * ctl,
8588 met_t * met,
8589 dd_t * dd);
8590
8623 const int ncid,
8624 const ctl_t * ctl,
8625 met_t * met,
8626 dd_t * dd);
8627
8659 const int ncid,
8660 const ctl_t * ctl,
8661 met_t * met,
8662 dd_t * dd);
8663
8696int read_met_nc_2d(
8697 const int ncid,
8698 const char *varname,
8699 const char *varname2,
8700 const char *varname3,
8701 const char *varname4,
8702 const char *varname5,
8703 const char *varname6,
8704 const ctl_t * ctl,
8705 const met_t * met,
8706 dd_t * dd,
8707 float dest[EX][EY],
8708 const float scl,
8709 const int init);
8710
8740int read_met_nc_3d(
8741 const int ncid,
8742 const char *varname,
8743 const char *varname2,
8744 const char *varname3,
8745 const char *varname4,
8746 const ctl_t * ctl,
8747 const met_t * met,
8748 dd_t * dd,
8749 float dest[EX][EY][EP],
8750 const float scl);
8751
8797void read_met_pbl(
8798 const ctl_t * ctl,
8799 met_t * met);
8800
8833 met_t * met);
8834
8865 met_t * met);
8866
8897void read_met_pv(
8898 met_t * met);
8899
8922void read_met_ozone(
8923 met_t * met);
8924
8953void read_met_sample(
8954 const ctl_t * ctl,
8955 met_t * met);
8956
8985void read_met_tropo(
8986 const ctl_t * ctl,
8987 const clim_t * clim,
8988 met_t * met);
8989
9021void read_obs(
9022 const char *filename,
9023 const ctl_t * ctl,
9024 double *rt,
9025 double *rz,
9026 double *rlon,
9027 double *rlat,
9028 double *robs,
9029 int *nobs);
9030
9058void read_obs_asc(
9059 const char *filename,
9060 double *rt,
9061 double *rz,
9062 double *rlon,
9063 double *rlat,
9064 double *robs,
9065 int *nobs);
9066
9093void read_obs_nc(
9094 const char *filename,
9095 double *rt,
9096 double *rz,
9097 double *rlon,
9098 double *rlat,
9099 double *robs,
9100 int *nobs);
9101
9135double scan_ctl(
9136 const char *filename,
9137 int argc,
9138 char *argv[],
9139 const char *varname,
9140 const int arridx,
9141 const char *defvalue,
9142 char *value);
9143
9170double sedi(
9171 const double p,
9172 const double T,
9173 const double rp,
9174 const double rhop);
9175
9205void spline(
9206 const double *x,
9207 const double *y,
9208 const int n,
9209 const double *x2,
9210 double *y2,
9211 const int n2,
9212 const int method);
9213
9236float stddev(
9237 const float *data,
9238 const int n);
9239
9264void time2jsec(
9265 const int year,
9266 const int mon,
9267 const int day,
9268 const int hour,
9269 const int min,
9270 const int sec,
9271 const double remain,
9272 double *jsec);
9273
9302void timer(
9303 const char *name,
9304 const char *group,
9305 const int output);
9306
9336double time_from_filename(
9337 const char *filename,
9338 const int offset,
9339 const int with_seconds);
9340
9359double tropo_weight(
9360 const ctl_t * ctl,
9361 const clim_t * clim,
9362 const atm_t * atm,
9363 const int ip);
9364
9387void write_atm_asc(
9388 const char *filename,
9389 const ctl_t * ctl,
9390 const atm_t * atm,
9391 const double t);
9392
9416void write_atm_bin(
9417 const char *filename,
9418 const ctl_t * ctl,
9419 const atm_t * atm);
9420
9444void write_atm_clams(
9445 const char *filename,
9446 const ctl_t * ctl,
9447 const atm_t * atm);
9448
9474 const char *dirname,
9475 const ctl_t * ctl,
9476 const atm_t * atm,
9477 const double t);
9478
9502void write_atm_nc(
9503 const char *filename,
9504 const ctl_t * ctl,
9505 const atm_t * atm);
9506
9535void write_csi(
9536 const char *filename,
9537 const ctl_t * ctl,
9538 const atm_t * atm,
9539 const double t);
9540
9582 const char *filename,
9583 const ctl_t * ctl,
9584 const atm_t * atm,
9585 const double t);
9586
9614void write_ens(
9615 const char *filename,
9616 const ctl_t * ctl,
9617 const atm_t * atm,
9618 const double t);
9619
9632void write_depo(
9633 const char *filename,
9634 const ctl_t * ctl,
9635 const depo_t * depo,
9636 const double t);
9637
9649void write_depo_asc(
9650 const char *filename,
9651 const ctl_t * ctl,
9652 const double *data,
9653 const double t,
9654 const double *lon,
9655 const double *lat,
9656 const double *area);
9657
9669void write_depo_nc(
9670 const char *filename,
9671 const ctl_t * ctl,
9672 const double *data,
9673 const double t,
9674 const double *lon,
9675 const double *lat,
9676 const double *area);
9677
9716void write_grid(
9717 const char *filename,
9718 const ctl_t * ctl,
9719 met_t * met0,
9720 met_t * met1,
9721 const atm_t * atm,
9722 const double t);
9723
9769void write_grid_asc(
9770 const char *filename,
9771 const ctl_t * ctl,
9772 const double *cd,
9773 double *mean[NQ],
9774 double *sigma[NQ],
9775 const double *vmr_impl,
9776 const double t,
9777 const double *z,
9778 const double *lon,
9779 const double *lat,
9780 const double *area,
9781 const double dz,
9782 const int *np);
9783
9826void write_grid_nc(
9827 const char *filename,
9828 const ctl_t * ctl,
9829 const double *cd,
9830 double *mean[NQ],
9831 double *sigma[NQ],
9832 const double *vmr_impl,
9833 const double t,
9834 const double *z,
9835 const double *lon,
9836 const double *lat,
9837 const double *area,
9838 const double dz,
9839 const int *np);
9840
9870void write_met_bin(
9871 const char *filename,
9872 const ctl_t * ctl,
9873 met_t * met);
9874
9902void write_met_bin_2d(
9903 FILE * out,
9904 met_t * met,
9905 float var[EX][EY],
9906 const char *varname);
9907
9947void write_met_bin_3d(
9948 FILE * out,
9949 const ctl_t * ctl,
9950 met_t * met,
9951 float var[EX][EY][EP],
9952 const char *varname,
9953 const int metvar,
9954 FILE * level_log);
9955
9983void write_met_nc(
9984 const char *filename,
9985 const ctl_t * ctl,
9986 met_t * met);
9987
10010void write_met_nc_2d(
10011 const int ncid,
10012 const char *varname,
10013 met_t * met,
10014 float var[EX][EY],
10015 const float scl);
10016
10040void write_met_nc_3d(
10041 const int ncid,
10042 const char *varname,
10043 met_t * met,
10044 float var[EX][EY][EP],
10045 const float scl);
10046
10077void write_prof(
10078 const char *filename,
10079 const ctl_t * ctl,
10080 met_t * met0,
10081 met_t * met1,
10082 const atm_t * atm,
10083 const double t);
10084
10116void write_sample(
10117 const char *filename,
10118 const ctl_t * ctl,
10119 met_t * met0,
10120 met_t * met1,
10121 const atm_t * atm,
10122 const double t);
10123
10150void write_station(
10151 const char *filename,
10152 const ctl_t * ctl,
10153 atm_t * atm,
10154 const double t);
10155
10184void write_vtk(
10185 const char *filename,
10186 const ctl_t * ctl,
10187 const atm_t * atm,
10188 const double t);
10189
10190/* ------------------------------------------------------------
10191 OpenACC routines...
10192 ------------------------------------------------------------ */
10193
10194#ifdef _OPENACC
10195#pragma acc routine (clim_oh)
10196#pragma acc routine (clim_photo)
10197#pragma acc routine (clim_tropo)
10198#pragma acc routine (clim_ts)
10199#pragma acc routine (clim_zm)
10200#pragma acc routine (cos_sza)
10201#pragma acc routine (dd_calc_subdomain_from_coords)
10202#pragma acc routine (dd_normalize_lon_lat)
10203#pragma acc routine (intpol_check_lon_lat)
10204#pragma acc routine (intpol_met_4d_zeta)
10205#pragma acc routine (intpol_met_space_3d)
10206#pragma acc routine (intpol_met_space_2d)
10207#pragma acc routine (intpol_met_time_3d)
10208#pragma acc routine (intpol_met_time_2d)
10209#pragma acc routine (kernel_weight)
10210#pragma acc routine (lapse_rate)
10211#pragma acc routine (locate_irr)
10212#pragma acc routine (locate_irr_float)
10213#pragma acc routine (locate_reg)
10214#pragma acc routine (locate_vert)
10215#pragma acc routine (nat_temperature)
10216#pragma acc routine (pbl_weight)
10217#pragma acc routine (sedi)
10218#pragma acc routine (stddev)
10219#pragma acc routine (tropo_weight)
10220#endif
10221
10222#endif /* LIBTRAC_H */
void read_met_geopot(const ctl_t *ctl, met_t *met)
Calculates geopotential heights from meteorological data.
Definition: mptrac.c:9510
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:559
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:13575
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:8117
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:9470
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:12978
int read_met_nc_2d(const int ncid, const char *varname, const char *varname2, const char *varname3, const char *varname4, const char *varname5, const char *varname6, const ctl_t *ctl, const met_t *met, 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:10160
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:14622
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:11401
void read_met_sample(const ctl_t *ctl, met_t *met)
Downsamples meteorological data based on specified parameters.
Definition: mptrac.c:11986
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:12333
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_timesteps(const ctl_t *ctl, cache_t *cache, met_t *met0, atm_t *atm, const double t)
Calculate time steps for air parcels based on specified conditions.
Definition: mptrac.c:5999
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:5062
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:8574
void read_met_cloud(met_t *met)
Calculates cloud-related variables for each grid point.
Definition: mptrac.c:9306
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:4227
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:12506
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:564
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
int read_met_nc_3d(const int ncid, const char *varname, const char *varname2, const char *varname3, const char *varname4, const ctl_t *ctl, const met_t *met, dd_t *dd, float dest[EX][EY][EP], const float scl)
Reads a 3-dimensional meteorological variable from a NetCDF file.
Definition: mptrac.c:10482
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:8541
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:11577
void read_met_detrend(const ctl_t *ctl, met_t *met)
Detrends meteorological data.
Definition: mptrac.c:9363
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:12159
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:12377
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:13646
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:4058
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:9963
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:11273
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:634
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:8693
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:11714
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:6046
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:13475
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:5169
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:554
void module_mixing_help(const ctl_t *ctl, const clim_t *clim, atm_t *atm, const int *ixs, const int *iys, const int *izs, const int qnt_idx, const int use_ensemble)
Perform subgrid-scale interparcel mixing of a given quantity.
Definition: mptrac.c:5249
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:8665
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:11231
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:12405
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:9047
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:4886
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:6377
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:13954
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:8005
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:8230
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:12607
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:241
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:6155
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:8334
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:12539
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:609
#define NQ
Maximum number of quantities per data point.
Definition: mptrac.h:574
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:8747
#define EX
Maximum number of longitudes for meteo data.
Definition: mptrac.h:549
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:5859
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:11358
void timer(const char *name, const char *group, const int output)
Measures and reports elapsed time for named and grouped timers.
Definition: mptrac.c:12638
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:12774
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:5887
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:4102
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:8846
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:12434
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:619
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_radio_decay(const ctl_t *ctl, const cache_t *cache, atm_t *atm)
Apply radioactive decay to atmospheric tracer species.
Definition: mptrac.c:5493
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:6438
void module_sort_help(double *a, const int *p, const int np)
Reorder an array based on a given permutation.
Definition: mptrac.c:5961
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:12586
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:9076
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:14683
void mptrac_read_clim(const ctl_t *ctl, clim_t *clim)
Reads various climatological data and populates the given climatology structure.
Definition: mptrac.c:6663
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 write_met_nc(const char *filename, const ctl_t *ctl, met_t *met)
Writes meteorological data to a NetCDF file.
Definition: mptrac.c:14440
void module_rng_init(const int ntask)
Initialize random number generators for parallel tasks.
Definition: mptrac.c:5723
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:6563
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:6588
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:8061
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:14347
#define CTS
Maximum number of data points of climatological time series.
Definition: mptrac.h:624
void read_met_ozone(met_t *met)
Calculates the total column ozone from meteorological ozone data.
Definition: mptrac.c:11957
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:6294
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:9825
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:5754
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:15083
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:12706
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:569
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
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 module_position(const cache_t *cache, met_t *met0, met_t *met1, atm_t *atm)
Update the positions and pressure levels of atmospheric particles.
Definition: mptrac.c:5435
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:14318
void read_met_pv(met_t *met)
Calculates potential vorticity (PV) from meteorological data.
Definition: mptrac.c:11837
#define DD_EX_GLOB
Maximum number of longitudes of global meteo data.
Definition: mptrac.h:629
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:8422
#define CY
Maximum number of latitudes for climatological data.
Definition: mptrac.h:599
void module_diff_meso(const ctl_t *ctl, cache_t *cache, met_t *met0, met_t *met1, atm_t *atm)
Simulate mesoscale diffusion for atmospheric particles.
Definition: mptrac.c:4266
void dd_sort_help(double *a, dd_t *dd, const int np)
Apply the sorting permutation to a particle data array.
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:8887
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:12922
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:4588
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:8478
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:13686
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:7742
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:7851
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:15172
#define EP
Maximum number of pressure levels for meteo data.
Definition: mptrac.h:544
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:6077
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:6723
void read_met_polar_winds(met_t *met)
Applies a fix for polar winds in meteorological data.
Definition: mptrac.c:11775
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:4801
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:14058
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:8358
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:4343
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:14652
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:4956
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:604
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:5351
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:9638
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:8380
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:14918
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:13752
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:4738
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:14188
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:12872
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:9186
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:8181
#define CSZA
Maximum number of solar zenith angles for climatological data.
Definition: mptrac.h:614
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:12748
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:5551
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:13188
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:13139
Air parcel data.
Definition: mptrac.h:3563
int np
Number of air parcels.
Definition: mptrac.h:3566
Cache data structure.
Definition: mptrac.h:3618
int iso_n
Isosurface balloon number of data points.
Definition: mptrac.h:3630
Climatological data in the form of photolysis rates.
Definition: mptrac.h:3677
int nsza
Number of solar zenith angles.
Definition: mptrac.h:3683
int np
Number of pressure levels.
Definition: mptrac.h:3680
int no3c
Number of total ozone columns.
Definition: mptrac.h:3686
Climatological data.
Definition: mptrac.h:3785
clim_ts_t ccl2f2
CFC-12 time series.
Definition: mptrac.h:3827
clim_photo_t photo
Photolysis rates.
Definition: mptrac.h:3803
clim_zm_t ho2
HO2 zonal means.
Definition: mptrac.h:3815
clim_zm_t hno3
HNO3 zonal means.
Definition: mptrac.h:3806
int tropo_ntime
Number of tropopause timesteps.
Definition: mptrac.h:3788
clim_ts_t sf6
SF6 time series.
Definition: mptrac.h:3833
clim_ts_t ccl4
CFC-10 time series.
Definition: mptrac.h:3821
clim_ts_t ccl3f
CFC-11 time series.
Definition: mptrac.h:3824
clim_zm_t o1d
O(1D) zonal means.
Definition: mptrac.h:3818
clim_zm_t h2o2
H2O2 zonal means.
Definition: mptrac.h:3812
int tropo_nlat
Number of tropopause latitudes.
Definition: mptrac.h:3791
clim_zm_t oh
OH zonal means.
Definition: mptrac.h:3809
clim_ts_t n2o
N2O time series.
Definition: mptrac.h:3830
Climatological data in the form of time series.
Definition: mptrac.h:3733
int ntime
Number of timesteps.
Definition: mptrac.h:3736
Climatological data in the form of zonal means.
Definition: mptrac.h:3753
int np
Number of pressure levels.
Definition: mptrac.h:3762
int ntime
Number of timesteps.
Definition: mptrac.h:3756
int nlat
Number of latitudes.
Definition: mptrac.h:3759
Control parameters.
Definition: mptrac.h:2494
double met_utm_ref_lon
Reference longitude [deg] for UTM grid.
Definition: mptrac.h:2853
double grid_z0
Lower altitude of gridded data [km].
Definition: mptrac.h:3424
int qnt_o3
Quantity array index for ozone volume mixing ratio.
Definition: mptrac.h:2606
double csi_lat1
Upper latitude of gridded CSI data [deg].
Definition: mptrac.h:3385
int qnt_Coh
Quantity array index for OH volume mixing ratio (chemistry code).
Definition: mptrac.h:2762
double wet_depo_ic_a
Coefficient A for wet deposition in cloud (exponential form).
Definition: mptrac.h:3264
int qnt_target_subdomain
Quantity array index for destination subdomain in domain decomposition.
Definition: mptrac.h:2819
int met_nc_scale
Check netCDF scaling factors (0=no, 1=yes).
Definition: mptrac.h:2870
int qnt_pel
Quantity array index for pressure at equilibrium level (EL).
Definition: mptrac.h:2639
int csi_nz
Number of altitudes of gridded CSI data.
Definition: mptrac.h:3361
double molmass
Molar mass [g/mol].
Definition: mptrac.h:3120
int qnt_p
Quantity array index for pressure.
Definition: mptrac.h:2585
int qnt_Cccl2f2
Quantity array index for CFC-12 volume mixing ratio (chemistry code).
Definition: mptrac.h:2786
int dd_halos_size
Domain decomposition size of halos given in grid-points.
Definition: mptrac.h:3548
int mixing_nx
Number of longitudes of mixing grid.
Definition: mptrac.h:3183
int met_zstd_nworkers
ZSTD number of worker threads (0=single-threaded, default=4).
Definition: mptrac.h:2882
double chemgrid_z1
Upper altitude of chemistry grid [km].
Definition: mptrac.h:3207
int qnt_m
Quantity array index for mass.
Definition: mptrac.h:2525
int qnt_aoa
Quantity array index for age of air.
Definition: mptrac.h:2795
int qnt_rhop
Quantity array index for particle density.
Definition: mptrac.h:2534
int qnt_swc
Quantity array index for cloud snow water content.
Definition: mptrac.h:2618
double csi_obsmin
Minimum observation index to trigger detection.
Definition: mptrac.h:3355
int qnt_pcb
Quantity array index for cloud bottom pressure.
Definition: mptrac.h:2627
double bound_dzs
Boundary conditions surface layer depth [km].
Definition: mptrac.h:3108
double csi_lon1
Upper longitude of gridded CSI data [deg].
Definition: mptrac.h:3376
int qnt_u
Quantity array index for zonal wind.
Definition: mptrac.h:2594
double stat_lon
Longitude of station [deg].
Definition: mptrac.h:3502
double mixing_trop
Interparcel exchange parameter for mixing in the troposphere.
Definition: mptrac.h:3168
double sort_dt
Time step for sorting of particle data [s].
Definition: mptrac.h:3013
double mixing_z1
Upper altitude of mixing grid [km].
Definition: mptrac.h:3180
double stat_r
Search radius around station [km].
Definition: mptrac.h:3508
double wet_depo_bc_a
Coefficient A for wet deposition below cloud (exponential form).
Definition: mptrac.h:3258
int met_zstd_level
ZSTD compression level (from -5 to 22, default=-3).
Definition: mptrac.h:2879
double met_utm_ref_lat
Reference latitude [deg] for UTM grid.
Definition: mptrac.h:2850
int csi_ny
Number of latitudes of gridded CSI data.
Definition: mptrac.h:3379
int vtk_sphere
Spherical projection for VTK data (0=no, 1=yes).
Definition: mptrac.h:3532
double chemgrid_z0
Lower altitude of chemistry grid [km].
Definition: mptrac.h:3204
double met_pbl_min
Minimum depth of planetary boundary layer [km].
Definition: mptrac.h:2981
int qnt_iwc
Quantity array index for cloud ice water content.
Definition: mptrac.h:2615
double chemgrid_lat0
Lower latitude of chemistry grid [deg].
Definition: mptrac.h:3222
double conv_cape
CAPE threshold for convection module [J/kg].
Definition: mptrac.h:3072
int qnt_Co1d
Quantity array index for O(1D) volume mixing ratio (chemistry code).
Definition: mptrac.h:2774
int qnt_pw
Quantity array index for partial water vapor pressure.
Definition: mptrac.h:2693
double grid_z1
Upper altitude of gridded data [km].
Definition: mptrac.h:3427
int direction
Direction flag (1=forward calculation, -1=backward calculation).
Definition: mptrac.h:2822
int qnt_Cccl4
Quantity array index for CFC-10 volume mixing ratio (chemistry code).
Definition: mptrac.h:2780
int met_dp
Stride for pressure levels.
Definition: mptrac.h:2933
double met_dt_out
Time step for sampling of meteo data along trajectories [s].
Definition: mptrac.h:3000
int qnt_h2o2
Quantity array index for H2O2 volume mixing ratio (climatology).
Definition: mptrac.h:2657
int qnt_vh
Quantity array index for horizontal wind.
Definition: mptrac.h:2729
int csi_nx
Number of longitudes of gridded CSI data.
Definition: mptrac.h:3370
double csi_lat0
Lower latitude of gridded CSI data [deg].
Definition: mptrac.h:3382
double turb_dz_trop
Vertical turbulent diffusion coefficient (troposphere) [m^2/s].
Definition: mptrac.h:3051
int met_pbl
Planetary boundary layer data (0=file, 1=z2p, 2=Richardson, 3=theta).
Definition: mptrac.h:2978
int qnt_lwc
Quantity array index for cloud liquid water content.
Definition: mptrac.h:2609
double turb_mesoz
Vertical scaling factor for mesoscale wind fluctuations.
Definition: mptrac.h:3060
int grid_nc_level
zlib compression level of netCDF grid data files (0=off).
Definition: mptrac.h:3412
int grid_nx
Number of longitudes of gridded data.
Definition: mptrac.h:3430
int atm_type
Type of atmospheric data files (0=ASCII, 1=binary, 2=netCDF, 3=CLaMS_traj, 4=CLaMS_pos).
Definition: mptrac.h:3326
double bound_mass
Boundary conditions mass per particle [kg].
Definition: mptrac.h:3081
double grid_lat0
Lower latitude of gridded data [deg].
Definition: mptrac.h:3442
int qnt_ts
Quantity array index for surface temperature.
Definition: mptrac.h:2540
int qnt_loss_rate
Quantity array index for total loss rate.
Definition: mptrac.h:2684
int qnt_plfc
Quantity array index for pressure at level of free convection (LCF).
Definition: mptrac.h:2636
int qnt_Acs137
Quantity array index for radioactive activity of Cs-137.
Definition: mptrac.h:2807
double grid_lon0
Lower longitude of gridded data [deg].
Definition: mptrac.h:3433
int qnt_o1d
Quantity array index for O(1D) volume mixing ratio (climatology).
Definition: mptrac.h:2663
int met_tropo_spline
Tropopause interpolation method (0=linear, 1=spline).
Definition: mptrac.h:2997
int qnt_tvirt
Quantity array index for virtual temperature.
Definition: mptrac.h:2723
double dt_met
Time step of meteo data [s].
Definition: mptrac.h:2841
double chemgrid_lat1
Upper latitude of chemistry grid [deg].
Definition: mptrac.h:3225
int met_geopot_sy
Latitudinal smoothing of geopotential heights.
Definition: mptrac.h:2969
double turb_dx_strat
Horizontal turbulent diffusion coefficient (stratosphere) [m^2/s].
Definition: mptrac.h:3045
int qnt_vmr
Quantity array index for volume mixing ratio.
Definition: mptrac.h:2528
int qnt_lsm
Quantity array index for land-sea mask.
Definition: mptrac.h:2561
int qnt_theta
Quantity array index for potential temperature.
Definition: mptrac.h:2705
double bound_lat1
Boundary conditions maximum longitude [deg].
Definition: mptrac.h:3096
double stat_t1
Stop time for station output [s].
Definition: mptrac.h:3514
double turb_dx_trop
Horizontal turbulent diffusion coefficient (troposphere) [m^2/s].
Definition: mptrac.h:3042
int grid_type
Type of grid data files (0=ASCII, 1=netCDF).
Definition: mptrac.h:3448
double csi_lon0
Lower longitude of gridded CSI data [deg].
Definition: mptrac.h:3373
int qnt_pbl
Quantity array index for boundary layer pressure.
Definition: mptrac.h:2567
int grid_stddev
Include standard deviations in grid output (0=no, 1=yes).
Definition: mptrac.h:3418
int qnt_psice
Quantity array index for saturation pressure over ice.
Definition: mptrac.h:2690
double chemgrid_lon0
Lower longitude of chemistry grid [deg].
Definition: mptrac.h:3213
int bound_pbl
Boundary conditions planetary boundary layer (0=no, 1=yes).
Definition: mptrac.h:3114
int qnt_mloss_wet
Quantity array index for total mass loss due to wet deposition.
Definition: mptrac.h:2675
int radio_decay
RADIO_DECAY switch for airborne and deposited activity (0=off, 1=on, default: 0).
Definition: mptrac.h:3249
int met_geopot_sx
Longitudinal smoothing of geopotential heights.
Definition: mptrac.h:2966
int met_sy
Smoothing for latitudes.
Definition: mptrac.h:2939
int qnt_ps
Quantity array index for surface pressure.
Definition: mptrac.h:2537
int rng_type
Random number generator (0=GSL, 1=Squares, 2=cuRAND).
Definition: mptrac.h:3030
int met_pck_zstd
Apply an additional ZSTD compression step to PCK payloads (0=off, 1=on).
Definition: mptrac.h:2888
int isosurf
Isosurface parameter (0=none, 1=pressure, 2=density, 3=theta, 4=balloon).
Definition: mptrac.h:3017
double bound_p1
Boundary conditions top pressure [hPa].
Definition: mptrac.h:3102
int qnt_zs
Quantity array index for surface geopotential height.
Definition: mptrac.h:2543
int prof_nz
Number of altitudes of gridded profile data.
Definition: mptrac.h:3457
double csi_dt_out
Time step for CSI output [s].
Definition: mptrac.h:3349
int met_cape
Convective available potential energy data (0=file, 1=calculate).
Definition: mptrac.h:2975
double csi_modmin
Minimum column density to trigger detection [kg/m^2].
Definition: mptrac.h:3358
int met_sx
Smoothing for longitudes.
Definition: mptrac.h:2936
double chemgrid_lon1
Upper longitude of chemistry grid [deg].
Definition: mptrac.h:3216
double depo_dt_out
DEPO_DT_OUT time interval for radioactive deposition output [s] (default: 86400).
Definition: mptrac.h:3304
double turb_mesox
Horizontal scaling factor for mesoscale wind fluctuations.
Definition: mptrac.h:3057
double prof_z0
Lower altitude of gridded profile data [km].
Definition: mptrac.h:3460
int qnt_w
Quantity array index for vertical velocity.
Definition: mptrac.h:2600
double bound_vmr
Boundary conditions volume mixing ratio [ppv].
Definition: mptrac.h:3087
double met_tropo_pv
Dynamical tropopause potential vorticity threshold [PVU].
Definition: mptrac.h:2991
int prof_nx
Number of longitudes of gridded profile data.
Definition: mptrac.h:3466
int qnt_stat
Quantity array index for station flag.
Definition: mptrac.h:2522
double dd_sort_dt
Sorting time interval for the compactification.
Definition: mptrac.h:3551
int met_tropo
Tropopause definition (0=none, 1=clim, 2=cold point, 3=WMO_1st, 4=WMO_2nd, 5=dynamical).
Definition: mptrac.h:2988
int qnt_rp
Quantity array index for particle radius.
Definition: mptrac.h:2531
int met_mpi_share
Use MPI to share meteo (0=no, 1=yes).
Definition: mptrac.h:3006
double mixing_strat
Interparcel exchange parameter for mixing in the stratosphere.
Definition: mptrac.h:3171
int qnt_vz
Quantity array index for vertical velocity.
Definition: mptrac.h:2732
int qnt_ho2
Quantity array index for HO2 volume mixing ratio (climatology).
Definition: mptrac.h:2660
double csi_z1
Upper altitude of gridded CSI data [km].
Definition: mptrac.h:3367
double stat_t0
Start time for station output [s].
Definition: mptrac.h:3511
double oh_chem_beta
Beta parameter for diurnal variablity of OH.
Definition: mptrac.h:3234
int dd
Domain decomposition (0=no, 1=yes, with 2x2 if not specified).
Definition: mptrac.h:3539
int qnt_eta
Quantity array index for eta vertical coordinate.
Definition: mptrac.h:2717
double wet_depo_so2_ph
pH value used to calculate effective Henry constant of SO2.
Definition: mptrac.h:3276
double mixing_z0
Lower altitude of mixing grid [km].
Definition: mptrac.h:3177
int qnt_mloss_decay
Quantity array index for total mass loss due to exponential decay.
Definition: mptrac.h:2681
int atm_type_out
Type of atmospheric data files for output (-1=same as ATM_TYPE, 0=ASCII, 1=binary,...
Definition: mptrac.h:3331
int met_cms_nd0x
cmultiscale number of cells of coarsest grid in x-direction.
Definition: mptrac.h:2915
int met_nlev
Number of meteo data model levels.
Definition: mptrac.h:2957
double dt_kpp
Time step for KPP chemistry [s].
Definition: mptrac.h:3243
double dry_depo_dp
Dry deposition surface layer [hPa].
Definition: mptrac.h:3285
int qnt_shf
Quantity array index for surface sensible heat flux.
Definition: mptrac.h:2558
int qnt_vs
Quantity array index for surface meridional wind.
Definition: mptrac.h:2549
int qnt_Cco
Quantity array index for CO volume mixing ratio (chemistry code).
Definition: mptrac.h:2759
double vtk_dt_out
Time step for VTK data output [s].
Definition: mptrac.h:3520
double t_stop
Stop time of simulation [s].
Definition: mptrac.h:2828
double conv_dt
Time interval for convection module [s].
Definition: mptrac.h:3078
int qnt_hno3
Quantity array index for HNO3 volume mixing ratio (climatology).
Definition: mptrac.h:2651
int met_clams
Read MPTRAC or CLaMS meteo data (0=MPTRAC, 1=CLaMS).
Definition: mptrac.h:2867
int qnt_h2ot
Quantity array index for tropopause water vapor volume mixing ratio.
Definition: mptrac.h:2579
int qnt_rh
Quantity array index for relative humidity over water.
Definition: mptrac.h:2699
int met_gp2z
Convert surface geopotential to geopotential height (0=no, 1=yes).
Definition: mptrac.h:2860
double bound_lat0
Boundary conditions minimum longitude [deg].
Definition: mptrac.h:3093
double met_pbl_max
Maximum depth of planetary boundary layer [km].
Definition: mptrac.h:2984
int met_dx
Stride for longitudes.
Definition: mptrac.h:2927
int mixing_ny
Number of latitudes of mixing grid.
Definition: mptrac.h:3192
int met_convention
Meteo data layout (0=[lev, lat, lon], 1=[lon, lat, lev]).
Definition: mptrac.h:2844
int qnt_zeta_d
Quantity array index for diagnosed zeta vertical coordinate.
Definition: mptrac.h:2711
int tracer_chem
Switch for first order tracer chemistry module (0=off, 1=on).
Definition: mptrac.h:3246
double dt_mod
Time step of simulation [s].
Definition: mptrac.h:2831
int diffusion
Diffusion switch (0=off, 1=on).
Definition: mptrac.h:3033
int qnt_tnat
Quantity array index for T_NAT.
Definition: mptrac.h:2747
int qnt_eta_dot
Quantity array index for velocity of eta vertical coordinate.
Definition: mptrac.h:2720
int qnt_tice
Quantity array index for T_ice.
Definition: mptrac.h:2741
int turb_pbl_scheme
PBL turbulence scheme (0=none, 1=closure).
Definition: mptrac.h:3036
int qnt_zg
Quantity array index for geopotential height.
Definition: mptrac.h:2582
double vtk_offset
Vertical offset for VTK data [km].
Definition: mptrac.h:3529
int qnt_v
Quantity array index for meridional wind.
Definition: mptrac.h:2597
int qnt_mloss_dry
Quantity array index for total mass loss due to dry deposition.
Definition: mptrac.h:2678
double bound_vmr_trend
Boundary conditions volume mixing ratio trend [ppv/s].
Definition: mptrac.h:3090
int met_cache
Preload meteo data into disk cache (0=no, 1=yes).
Definition: mptrac.h:3003
int qnt_oh
Quantity array index for OH volume mixing ratio (climatology).
Definition: mptrac.h:2654
int qnt_Ch
Quantity array index for H volume mixing ratio (chemistry code).
Definition: mptrac.h:2765
int met_press_level_def
Use predefined pressure levels or not.
Definition: mptrac.h:2954
int oh_chem_reaction
Reaction type for OH chemistry (0=none, 2=bimolecular, 3=termolecular).
Definition: mptrac.h:3228
int qnt_h2o
Quantity array index for water vapor volume mixing ratio.
Definition: mptrac.h:2603
int prof_ny
Number of latitudes of gridded profile data.
Definition: mptrac.h:3475
int qnt_rhice
Quantity array index for relative humidity over ice.
Definition: mptrac.h:2702
int qnt_rho
Quantity array index for density of air.
Definition: mptrac.h:2591
double sample_dz
Layer depth for sample output [km].
Definition: mptrac.h:3496
double tdec_strat
Life time of particles in the stratosphere [s].
Definition: mptrac.h:3126
int obs_type
Type of observation data files (0=ASCII, 1=netCDF).
Definition: mptrac.h:3340
int qnt_us
Quantity array index for surface zonal wind.
Definition: mptrac.h:2546
double grid_lon1
Upper longitude of gridded data [deg].
Definition: mptrac.h:3436
int qnt_Cn2o
Quantity array index for N2O volume mixing ratio (chemistry code).
Definition: mptrac.h:2789
int qnt_Cccl3f
Quantity array index for CFC-11 volume mixing ratio (chemistry code).
Definition: mptrac.h:2783
int depo_type
DEPO_TYPE of deposition files (0=ASCII, 1=netCDF, default: 0).
Definition: mptrac.h:3307
double mixing_lat0
Lower latitude of mixing grid [deg].
Definition: mptrac.h:3195
int nens
Number of ensembles.
Definition: mptrac.h:3388
int qnt_pt
Quantity array index for tropopause pressure.
Definition: mptrac.h:2570
int qnt_cl
Quantity array index for total column cloud water.
Definition: mptrac.h:2630
int advect
Advection scheme (1=Euler, 2=midpoint, 4=Runge-Kutta).
Definition: mptrac.h:3023
double prof_z1
Upper altitude of gridded profile data [km].
Definition: mptrac.h:3463
int qnt_t
Quantity array index for temperature.
Definition: mptrac.h:2588
int atm_filter
Time filter for atmospheric data output (0=none, 1=missval, 2=remove).
Definition: mptrac.h:3319
int kpp_chem
Switch for KPP chemistry module (0=off, 1=on).
Definition: mptrac.h:3240
int qnt_zeta
Quantity array index for zeta vertical coordinate.
Definition: mptrac.h:2708
double conv_pbl_trans
Depth of PBL transition layer (fraction of PBL pressure thickness).
Definition: mptrac.h:3069
int met_lz4_accel
LZ4 acceleration factor (>=1, default=8).
Definition: mptrac.h:2885
int qnt_Ai131
Quantity array index for radioactive activity of I-131.
Definition: mptrac.h:2810
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:2857
double csi_z0
Lower altitude of gridded CSI data [km].
Definition: mptrac.h:3364
int qnt_lapse
Quantity array index for lapse rate.
Definition: mptrac.h:2726
int qnt_Apb210
Quantity array index for radioactive activity of Pb-210.
Definition: mptrac.h:2801
double stat_lat
Latitude of station [deg].
Definition: mptrac.h:3505
int qnt_Cho2
Quantity array index for HO2 volume mixing ratio (chemistry code).
Definition: mptrac.h:2768
int grid_ny
Number of latitudes of gridded data.
Definition: mptrac.h:3439
int qnt_Csf6
Quantity array index for SF6 volume mixing ratio (chemistry code).
Definition: mptrac.h:2792
int qnt_Ch2o
Quantity array index for H2O volume mixing ratio (chemistry code).
Definition: mptrac.h:2753
double met_detrend
FWHM of horizontal Gaussian used for detrending [km].
Definition: mptrac.h:2945
int conv_mix_pbl
Vertical mixing in the PBL (0=off, 1=on).
Definition: mptrac.h:3066
double bound_dps
Boundary conditions surface layer depth [hPa].
Definition: mptrac.h:3105
int chemgrid_nz
Number of altitudes of chemistry grid.
Definition: mptrac.h:3201
int qnt_cape
Quantity array index for convective available potential energy (CAPE).
Definition: mptrac.h:2642
int qnt_zeta_dot
Quantity array index for velocity of zeta vertical coordinate.
Definition: mptrac.h:2714
double bound_mass_trend
Boundary conditions mass per particle trend [kg/s].
Definition: mptrac.h:3084
int met_cms_nd0y
cmultiscale number of cells of coarsest grid in y-direction.
Definition: mptrac.h:2918
int mixing_nz
Number of altitudes of mixing grid.
Definition: mptrac.h:3174
int qnt_o3c
Quantity array index for total column ozone.
Definition: mptrac.h:2648
double bound_p0
Boundary conditions bottom pressure [hPa].
Definition: mptrac.h:3099
double mixing_lon0
Lower longitude of mixing grid [deg].
Definition: mptrac.h:3186
int qnt_Co3
Quantity array index for O3 volume mixing ratio (chemistry code).
Definition: mptrac.h:2756
int qnt_tsts
Quantity array index for T_STS.
Definition: mptrac.h:2744
int grid_nz
Number of altitudes of gridded data.
Definition: mptrac.h:3421
int qnt_nss
Quantity array index for northward turbulent surface stress.
Definition: mptrac.h:2555
double ens_dt_out
Time step for ensemble output [s].
Definition: mptrac.h:3394
int atm_stride
Particle index stride for atmospheric data files.
Definition: mptrac.h:3322
int met_relhum
Try to read relative humidity (0=no, 1=yes).
Definition: mptrac.h:2972
double mixing_lat1
Upper latitude of mixing grid [deg].
Definition: mptrac.h:3198
double atm_dt_out
Time step for atmospheric data output [s].
Definition: mptrac.h:3316
double prof_lat1
Upper latitude of gridded profile data [deg].
Definition: mptrac.h:3481
int qnt_current_subdomain
Quantity array index for current subdomain in domain decomposition.
Definition: mptrac.h:2816
int met_cms_batch
cmultiscale batch size.
Definition: mptrac.h:2909
double psc_h2o
H2O volume mixing ratio for PSC analysis.
Definition: mptrac.h:3291
int met_sp
Smoothing for pressure levels.
Definition: mptrac.h:2942
double prof_lon0
Lower longitude of gridded profile data [deg].
Definition: mptrac.h:3469
int qnt_Axe133
Quantity array index for radioactive activity of Xe-133.
Definition: mptrac.h:2813
int chemgrid_nx
Number of longitudes of chemistry grid.
Definition: mptrac.h:3210
int qnt_pct
Quantity array index for cloud top pressure.
Definition: mptrac.h:2624
int qnt_mloss_kpp
Quantity array index for total mass loss due to KPP chemistry.
Definition: mptrac.h:2672
int qnt_psat
Quantity array index for saturation pressure over water.
Definition: mptrac.h:2687
double prof_lat0
Lower latitude of gridded profile data [deg].
Definition: mptrac.h:3478
int qnt_cin
Quantity array index for convective inhibition (CIN).
Definition: mptrac.h:2645
double turb_pbl_trans
Depth of turbulent PBL transition layer (fraction of PBL pressure thickness).
Definition: mptrac.h:3063
double psc_hno3
HNO3 volume mixing ratio for PSC analysis.
Definition: mptrac.h:3294
double prof_lon1
Upper longitude of gridded profile data [deg].
Definition: mptrac.h:3472
int met_nc_quant
Number of digits for quantization of netCDF meteo files (0=off).
Definition: mptrac.h:2876
int h2o2_chem_reaction
Reaction type for H2O2 chemistry (0=none, 1=SO2).
Definition: mptrac.h:3237
int qnt_Co3p
Quantity array index for O(3P) volume mixing ratio (chemistry code).
Definition: mptrac.h:2777
double wet_depo_bc_ret_ratio
Coefficients for wet deposition below cloud: retention ratio.
Definition: mptrac.h:3282
int chemgrid_ny
Number of latitudes of chemistry grid.
Definition: mptrac.h:3219
int qnt_Abe7
Quantity array index for radioactive activity of Be-7.
Definition: mptrac.h:2804
int met_cms_zstd
cmultiscale ZSTD compression (0=off, 1=on).
Definition: mptrac.h:2912
int met_cms_maxlev
cmultiscale maximum refinement level.
Definition: mptrac.h:2921
int grid_sparse
Sparse output in grid data files (0=no, 1=yes).
Definition: mptrac.h:3409
double dry_depo_vdep
Dry deposition velocity [m/s].
Definition: mptrac.h:3288
int qnt_tt
Quantity array index for tropopause temperature.
Definition: mptrac.h:2573
int met_np
Number of target pressure levels.
Definition: mptrac.h:2948
int qnt_ens
Quantity array index for ensemble IDs.
Definition: mptrac.h:2519
int met_nc_level
zlib compression level of netCDF meteo files (0=off).
Definition: mptrac.h:2873
double mixing_dt
Time interval for mixing [s].
Definition: mptrac.h:3165
int qnt_Arn222
Quantity array index for radioactive activity of Rn-222.
Definition: mptrac.h:2798
int qnt_mloss_h2o2
Quantity array index for total mass loss due to H2O2 chemistry.
Definition: mptrac.h:2669
double vtk_scale
Vertical scaling factor for VTK data.
Definition: mptrac.h:3526
double turb_dx_pbl
Horizontal turbulent diffusion coefficient (PBL) [m^2/s].
Definition: mptrac.h:3039
double conv_cin
CIN threshold for convection module [J/kg].
Definition: mptrac.h:3075
int qnt_pv
Quantity array index for potential vorticity.
Definition: mptrac.h:2735
int advect_vert_coord
Vertical velocity of air parcels (0=omega_on_plev, 1=zetadot_on_mlev, 2=omega_on_mlev,...
Definition: mptrac.h:3027
int qnt_mloss_oh
Quantity array index for total mass loss due to OH chemistry.
Definition: mptrac.h:2666
int qnt_Ch2o2
Quantity array index for H2O2 volume mixing ratio (chemistry code).
Definition: mptrac.h:2771
int qnt_sst
Quantity array index for sea surface temperature.
Definition: mptrac.h:2564
double mixing_lon1
Upper longitude of mixing grid [deg].
Definition: mptrac.h:3189
int atm_nc_level
zlib compression level of netCDF atmospheric data files (0=off).
Definition: mptrac.h:3334
double wet_depo_ic_ret_ratio
Coefficients for wet deposition in cloud: retention ratio.
Definition: mptrac.h:3279
int qnt_sh
Quantity array index for specific humidity.
Definition: mptrac.h:2696
int met_coord_type
Type of coordinates for meteo data (-1=detect, 0=lat/lon [deg], 1=UTM [m]).
Definition: mptrac.h:2847
int qnt_ess
Quantity array index for eastward turbulent surface stress.
Definition: mptrac.h:2552
double wet_depo_ic_b
Coefficient B for wet deposition in cloud (exponential form).
Definition: mptrac.h:3267
double wet_depo_bc_b
Coefficient B for wet deposition below cloud (exponential form).
Definition: mptrac.h:3261
int met_dy
Stride for latitudes.
Definition: mptrac.h:2930
int qnt_Cx
Quantity array index for trace species x volume mixing ratio (chemistry code).
Definition: mptrac.h:2750
double turb_dz_strat
Vertical turbulent diffusion coefficient (stratosphere) [m^2/s].
Definition: mptrac.h:3054
double bound_zetas
Boundary conditions surface layer zeta [K].
Definition: mptrac.h:3111
int radio_depo
RADIO_DEPO switch for radionuclide deposition (0=off, 1=on, default: 0).
Definition: mptrac.h:3252
int dd_subdomains_zonal
Domain decomposition zonal subdomain number.
Definition: mptrac.h:3542
int qnt_idx
Quantity array index for air parcel IDs.
Definition: mptrac.h:2516
double met_tropo_theta
Dynamical tropopause potential temperature threshold [K].
Definition: mptrac.h:2994
int qnt_rwc
Quantity array index for cloud rain water content.
Definition: mptrac.h:2612
double t_start
Start time of simulation [s].
Definition: mptrac.h:2825
int nq
Number of quantities.
Definition: mptrac.h:2501
double tdec_trop
Life time of particles in the troposphere [s].
Definition: mptrac.h:3123
double sample_dx
Horizontal radius for sample output [km].
Definition: mptrac.h:3493
int vtk_stride
Particle index stride for VTK data.
Definition: mptrac.h:3523
double turb_dz_pbl
Vertical turbulent diffusion coefficient (PBL) [m^2/s].
Definition: mptrac.h:3048
double grid_lat1
Upper latitude of gridded data [deg].
Definition: mptrac.h:3445
int dd_subdomains_meridional
Domain decomposition meridional subdomain number.
Definition: mptrac.h:3545
int qnt_zt
Quantity array index for tropopause geopotential height.
Definition: mptrac.h:2576
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:2864
int qnt_cc
Quantity array index for cloud cover.
Definition: mptrac.h:2621
int qnt_plcl
Quantity array index for pressure at lifted condensation level (LCL).
Definition: mptrac.h:2633
double grid_dt_out
Time step for gridded data output [s].
Definition: mptrac.h:3406
int qnt_tdew
Quantity array index for dew point temperature.
Definition: mptrac.h:2738
Domain decomposition data structure.
Definition: mptrac.h:4021
int halo_offset_end
Offset of the periodic halo block at the end of the local x-array.
Definition: mptrac.h:4059
int nx_glob
Number of global longitudes.
Definition: mptrac.h:4028
int halo_offset_start
Offset of the periodic halo block at the beginning of the local x-array.
Definition: mptrac.h:4056
int ny_glob
Number of global latitudes.
Definition: mptrac.h:4031
Ground inventories of deposited radionuclides.
Definition: mptrac.h:3654
Meteo data structure.
Definition: mptrac.h:3844
int coord_type
Definition: mptrac.h:3850
int nx
Number of longitudes.
Definition: mptrac.h:3853
int ny
Number of latitudes.
Definition: mptrac.h:3856
int np
Number of pressure levels.
Definition: mptrac.h:3859
int npl
Number of model levels.
Definition: mptrac.h:3862
double time
Time [s].
Definition: mptrac.h:3847
Particle data.
Definition: mptrac.h:3592
double p
Pressure [hPa].
Definition: mptrac.h:3598
double lat
Latitude [deg].
Definition: mptrac.h:3604
double time
Time [s].
Definition: mptrac.h:3595
double lon
Longitude [deg].
Definition: mptrac.h:3601