105#include <gsl/gsl_fft_complex.h>
106#include <gsl/gsl_math.h>
107#include <gsl/gsl_randist.h>
108#include <gsl/gsl_rng.h>
109#include <gsl/gsl_spline.h>
110#include <gsl/gsl_statistics.h>
142#include "cmultiscale.h"
146#include "chem_Parameters.h"
147#include "chem_Global.h"
148#include "chem_Sparse.h"
157#define AVO 6.02214076e23
167#define EPS (MH2O / MA)
187#define KB 1.3806504e-23
212#define RA (1e3 * RI / MA)
338#define ALLOC(ptr, type, n) \
339 if(acc_get_num_devices(acc_device_nvidia) <= 0) \
340 ERRMSG("Not running on a GPU device!"); \
341 if((ptr=calloc((size_t)(n), sizeof(type)))==NULL) \
342 ERRMSG("Out of memory!");
344#define ALLOC(ptr, type, n) \
345 if((ptr=calloc((size_t)(n), sizeof(type)))==NULL) \
346 ERRMSG("Out of memory!");
367#define ARRAY_2D(ix, iy, ny) \
386#define ARRAY_3D(ix, iy, ny, iz, nz) \
387 (((ix)*(ny) + (iy)) * (nz) + (iz))
411#define ARRHENIUS(a, b, t) \
412 ((a) * exp( -(b) / (t)))
435#define DEG2DX(dlon, lat) \
436 ((dlon) * M_PI * RE / 180. * cos((lat) / 180. * M_PI))
456#define DEG2DY(dlat) \
457 ((dlat) * M_PI * RE / 180.)
479#define DP2DZ(dp, p) \
501#define DX2DEG(dx, lat) \
502 (((lat) < -89.999 || (lat) > 89.999) ? 0 \
503 : (dx) * 180. / (M_PI * RE * cos((lat) / 180. * M_PI)))
520 ((dy) * 180. / (M_PI * RE))
536#define DZ2DP(dz, p) \
569 ((a[0]-b[0])*(a[0]-b[0])+(a[1]-b[1])*(a[1]-b[1])+(a[2]-b[2])*(a[2]-b[2]))
585 (a[0]*b[0]+a[1]*b[1]+a[2]*b[2])
604 ((x) - (int) ((x) / (y)) * (y))
621#define FREAD(ptr, type, size, in) { \
622 if(fread(ptr, sizeof(type), size, in)!=size) \
623 ERRMSG("Error while reading!"); \
641#define FWRITE(ptr, type, size, out) { \
642 if(fwrite(ptr, sizeof(type), size, out)!=size) \
643 ERRMSG("Error while writing!"); \
657 double cw[4] = {0.0, 0.0, 0.0, 0.0}; int ci[3] = {0, 0, 0};
670#define INTPOL_2D(var, init) \
671 intpol_met_time_2d(met0, met0->var, met1, met1->var, \
672 atm->time[ip], atm->lon[ip], atm->lat[ip], \
687#define INTPOL_3D(var, init) \
688 intpol_met_time_3d(met0, met0->var, met1, met1->var, \
689 atm->time[ip], atm->p[ip], \
690 atm->lon[ip], atm->lat[ip], \
706#define INTPOL_SPACE_ALL(p, lon, lat) { \
707 intpol_met_space_3d(met, met->z, p, lon, lat, &z, ci, cw, 1); \
708 intpol_met_space_3d(met, met->t, p, lon, lat, &t, ci, cw, 0); \
709 intpol_met_space_3d(met, met->u, p, lon, lat, &u, ci, cw, 0); \
710 intpol_met_space_3d(met, met->v, p, lon, lat, &v, ci, cw, 0); \
711 intpol_met_space_3d(met, met->w, p, lon, lat, &w, ci, cw, 0); \
712 intpol_met_space_3d(met, met->pv, p, lon, lat, &pv, ci, cw, 0); \
713 intpol_met_space_3d(met, met->h2o, p, lon, lat, &h2o, ci, cw, 0); \
714 intpol_met_space_3d(met, met->o3, p, lon, lat, &o3, ci, cw, 0); \
715 intpol_met_space_3d(met, met->lwc, p, lon, lat, &lwc, ci, cw, 0); \
716 intpol_met_space_3d(met, met->rwc, p, lon, lat, &rwc, ci, cw, 0); \
717 intpol_met_space_3d(met, met->iwc, p, lon, lat, &iwc, ci, cw, 0); \
718 intpol_met_space_3d(met, met->swc, p, lon, lat, &swc, ci, cw, 0); \
719 intpol_met_space_3d(met, met->cc, p, lon, lat, &cc, ci, cw, 0); \
720 intpol_met_space_2d(met, met->ps, lon, lat, &ps, ci, cw, 0); \
721 intpol_met_space_2d(met, met->ts, lon, lat, &ts, ci, cw, 0); \
722 intpol_met_space_2d(met, met->zs, lon, lat, &zs, ci, cw, 0); \
723 intpol_met_space_2d(met, met->us, lon, lat, &us, ci, cw, 0); \
724 intpol_met_space_2d(met, met->vs, lon, lat, &vs, ci, cw, 0); \
725 intpol_met_space_2d(met, met->lsm, lon, lat, &lsm, ci, cw, 0); \
726 intpol_met_space_2d(met, met->sst, lon, lat, &sst, ci, cw, 0); \
727 intpol_met_space_2d(met, met->pbl, lon, lat, &pbl, ci, cw, 0); \
728 intpol_met_space_2d(met, met->pt, lon, lat, &pt, ci, cw, 0); \
729 intpol_met_space_2d(met, met->tt, lon, lat, &tt, ci, cw, 0); \
730 intpol_met_space_2d(met, met->zt, lon, lat, &zt, ci, cw, 0); \
731 intpol_met_space_2d(met, met->h2ot, lon, lat, &h2ot, ci, cw, 0); \
732 intpol_met_space_2d(met, met->pct, lon, lat, &pct, ci, cw, 0); \
733 intpol_met_space_2d(met, met->pcb, lon, lat, &pcb, ci, cw, 0); \
734 intpol_met_space_2d(met, met->cl, lon, lat, &cl, ci, cw, 0); \
735 intpol_met_space_2d(met, met->plcl, lon, lat, &plcl, ci, cw, 0); \
736 intpol_met_space_2d(met, met->plfc, lon, lat, &plfc, ci, cw, 0); \
737 intpol_met_space_2d(met, met->pel, lon, lat, &pel, ci, cw, 0); \
738 intpol_met_space_2d(met, met->cape, lon, lat, &cape, ci, cw, 0); \
739 intpol_met_space_2d(met, met->cin, lon, lat, &cin, ci, cw, 0); \
740 intpol_met_space_2d(met, met->o3c, lon, lat, &o3c, ci, cw, 0); \
757#define INTPOL_TIME_ALL(time, p, lon, lat) { \
758 intpol_met_time_3d(met0, met0->z, met1, met1->z, time, p, lon, lat, &z, ci, cw, 1); \
759 intpol_met_time_3d(met0, met0->t, met1, met1->t, time, p, lon, lat, &t, ci, cw, 0); \
760 intpol_met_time_3d(met0, met0->u, met1, met1->u, time, p, lon, lat, &u, ci, cw, 0); \
761 intpol_met_time_3d(met0, met0->v, met1, met1->v, time, p, lon, lat, &v, ci, cw, 0); \
762 intpol_met_time_3d(met0, met0->w, met1, met1->w, time, p, lon, lat, &w, ci, cw, 0); \
763 intpol_met_time_3d(met0, met0->pv, met1, met1->pv, time, p, lon, lat, &pv, ci, cw, 0); \
764 intpol_met_time_3d(met0, met0->h2o, met1, met1->h2o, time, p, lon, lat, &h2o, ci, cw, 0); \
765 intpol_met_time_3d(met0, met0->o3, met1, met1->o3, time, p, lon, lat, &o3, ci, cw, 0); \
766 intpol_met_time_3d(met0, met0->lwc, met1, met1->lwc, time, p, lon, lat, &lwc, ci, cw, 0); \
767 intpol_met_time_3d(met0, met0->rwc, met1, met1->rwc, time, p, lon, lat, &rwc, ci, cw, 0); \
768 intpol_met_time_3d(met0, met0->iwc, met1, met1->iwc, time, p, lon, lat, &iwc, ci, cw, 0); \
769 intpol_met_time_3d(met0, met0->swc, met1, met1->swc, time, p, lon, lat, &swc, ci, cw, 0); \
770 intpol_met_time_3d(met0, met0->cc, met1, met1->cc, time, p, lon, lat, &cc, ci, cw, 0); \
771 intpol_met_time_2d(met0, met0->ps, met1, met1->ps, time, lon, lat, &ps, ci, cw, 0); \
772 intpol_met_time_2d(met0, met0->ts, met1, met1->ts, time, lon, lat, &ts, ci, cw, 0); \
773 intpol_met_time_2d(met0, met0->zs, met1, met1->zs, time, lon, lat, &zs, ci, cw, 0); \
774 intpol_met_time_2d(met0, met0->us, met1, met1->us, time, lon, lat, &us, ci, cw, 0); \
775 intpol_met_time_2d(met0, met0->vs, met1, met1->vs, time, lon, lat, &vs, ci, cw, 0); \
776 intpol_met_time_2d(met0, met0->lsm, met1, met1->lsm, time, lon, lat, &lsm, ci, cw, 0); \
777 intpol_met_time_2d(met0, met0->sst, met1, met1->sst, time, lon, lat, &sst, ci, cw, 0); \
778 intpol_met_time_2d(met0, met0->pbl, met1, met1->pbl, time, lon, lat, &pbl, ci, cw, 0); \
779 intpol_met_time_2d(met0, met0->pt, met1, met1->pt, time, lon, lat, &pt, ci, cw, 0); \
780 intpol_met_time_2d(met0, met0->tt, met1, met1->tt, time, lon, lat, &tt, ci, cw, 0); \
781 intpol_met_time_2d(met0, met0->zt, met1, met1->zt, time, lon, lat, &zt, ci, cw, 0); \
782 intpol_met_time_2d(met0, met0->h2ot, met1, met1->h2ot, time, lon, lat, &h2ot, ci, cw, 0); \
783 intpol_met_time_2d(met0, met0->pct, met1, met1->pct, time, lon, lat, &pct, ci, cw, 0); \
784 intpol_met_time_2d(met0, met0->pcb, met1, met1->pcb, time, lon, lat, &pcb, ci, cw, 0); \
785 intpol_met_time_2d(met0, met0->cl, met1, met1->cl, time, lon, lat, &cl, ci, cw, 0); \
786 intpol_met_time_2d(met0, met0->plcl, met1, met1->plcl, time, lon, lat, &plcl, ci, cw, 0); \
787 intpol_met_time_2d(met0, met0->plfc, met1, met1->plfc, time, lon, lat, &plfc, ci, cw, 0); \
788 intpol_met_time_2d(met0, met0->pel, met1, met1->pel, time, lon, lat, &pel, ci, cw, 0); \
789 intpol_met_time_2d(met0, met0->cape, met1, met1->cape, time, lon, lat, &cape, ci, cw, 0); \
790 intpol_met_time_2d(met0, met0->cin, met1, met1->cin, time, lon, lat, &cin, ci, cw, 0); \
791 intpol_met_time_2d(met0, met0->o3c, met1, met1->o3c, time, lon, lat, &o3c, ci, cw, 0); \
808#define LAPSE(p1, t1, p2, t2) \
809 (1e3 * G0 / RA * ((t2) - (t1)) / ((t2) + (t1)) \
810 * ((p2) + (p1)) / ((p2) - (p1)))
827#define LIN(x0, y0, x1, y1, x) \
828 ((y0)+((y1)-(y0))/((x1)-(x0))*((x)-(x0)))
870 "# $1 = time [s]\n" \
871 "# $2 = altitude [km]\n" \
872 "# $3 = longitude [deg]\n" \
873 "# $4 = latitude [deg]\n" \
874 "# $5 = pressure [hPa]\n" \
875 "# $6 = temperature [K]\n" \
876 "# $7 = zonal wind [m/s]\n" \
877 "# $8 = meridional wind [m/s]\n" \
878 "# $9 = vertical velocity [hPa/s]\n" \
879 "# $10 = H2O volume mixing ratio [ppv]\n"); \
881 "# $11 = O3 volume mixing ratio [ppv]\n" \
882 "# $12 = geopotential height [km]\n" \
883 "# $13 = potential vorticity [PVU]\n" \
884 "# $14 = surface pressure [hPa]\n" \
885 "# $15 = surface temperature [K]\n" \
886 "# $16 = surface geopotential height [km]\n" \
887 "# $17 = surface zonal wind [m/s]\n" \
888 "# $18 = surface meridional wind [m/s]\n" \
889 "# $19 = land-sea mask [1]\n" \
890 "# $20 = sea surface temperature [K]\n"); \
892 "# $21 = tropopause pressure [hPa]\n" \
893 "# $22 = tropopause geopotential height [km]\n" \
894 "# $23 = tropopause temperature [K]\n" \
895 "# $24 = tropopause water vapor [ppv]\n" \
896 "# $25 = cloud liquid water content [kg/kg]\n" \
897 "# $26 = cloud rain water content [kg/kg]\n" \
898 "# $27 = cloud ice water content [kg/kg]\n" \
899 "# $28 = cloud snow water content [kg/kg]\n" \
900 "# $29 = cloud cover [1]\n" \
901 "# $30 = total column cloud water [kg/m^2]\n"); \
903 "# $31 = cloud top pressure [hPa]\n" \
904 "# $32 = cloud bottom pressure [hPa]\n" \
905 "# $33 = pressure at lifted condensation level (LCL) [hPa]\n" \
906 "# $34 = pressure at level of free convection (LFC) [hPa]\n" \
907 "# $35 = pressure at equilibrium level (EL) [hPa]\n" \
908 "# $36 = convective available potential energy (CAPE) [J/kg]\n" \
909 "# $37 = convective inhibition (CIN) [J/kg]\n" \
910 "# $38 = relative humidity over water [%%]\n" \
911 "# $39 = relative humidity over ice [%%]\n" \
912 "# $40 = dew point temperature [K]\n"); \
914 "# $41 = frost point temperature [K]\n" \
915 "# $42 = NAT temperature [K]\n" \
916 "# $43 = HNO3 volume mixing ratio [ppv]\n" \
917 "# $44 = OH volume mixing ratio [ppv]\n" \
918 "# $45 = H2O2 volume mixing ratio [ppv]\n" \
919 "# $46 = HO2 volume mixing ratio [ppv]\n" \
920 "# $47 = O(1D) volume mixing ratio [ppv]\n" \
921 "# $48 = boundary layer pressure [hPa]\n" \
922 "# $49 = total column ozone [DU]\n" \
923 "# $50 = number of data points\n"); \
925 "# $51 = number of tropopause data points\n" \
926 "# $52 = number of CAPE data points\n");
967#define MOLEC_DENS(p,t) \
968 (AVO * 1e-6 * ((p) * 100) / (RI * (t)))
982 int nc_result=(cmd); \
983 if(nc_result!=NC_NOERR) \
984 ERRMSG("%s", nc_strerror(nc_result)); \
1003#define NC_DEF_VAR(varname, type, ndims, dims, long_name, units) { \
1004 NC(nc_def_var(ncid, varname, type, ndims, dims, &varid)); \
1005 NC(nc_put_att_text(ncid, varid, "long_name", strnlen(long_name, LEN), long_name)); \
1006 NC(nc_put_att_text(ncid, varid, "units", strnlen(units, LEN), units)); \
1026#define NC_GET_DOUBLE(varname, ptr, force) { \
1028 NC(nc_inq_varid(ncid, varname, &varid)); \
1029 NC(nc_get_var_double(ncid, varid, ptr)); \
1031 if(nc_inq_varid(ncid, varname, &varid) == NC_NOERR) { \
1032 NC(nc_get_var_double(ncid, varid, ptr)); \
1034 WARN("netCDF variable %s is missing!", varname); \
1054#define NC_INQ_DIM(dimname, ptr, min, max) { \
1055 int dimid; size_t naux; \
1056 NC(nc_inq_dimid(ncid, dimname, &dimid)); \
1057 NC(nc_inq_dimlen(ncid, dimid, &naux)); \
1059 if ((*ptr) < (min) || (*ptr) > (max)) \
1060 ERRMSG("Dimension %s is out of range!", dimname); \
1077#define NC_PUT_DOUBLE(varname, ptr, hyperslab) { \
1078 NC(nc_inq_varid(ncid, varname, &varid)); \
1080 NC(nc_put_vara_double(ncid, varid, start, count, ptr)); \
1082 NC(nc_put_var_double(ncid, varid, ptr)); \
1101#define NC_PUT_FLOAT(varname, ptr, hyperslab) { \
1102 NC(nc_inq_varid(ncid, varname, &varid)); \
1104 NC(nc_put_vara_float(ncid, varid, start, count, ptr)); \
1106 NC(nc_put_var_float(ncid, varid, ptr)); \
1124#define NC_PUT_INT(varname, ptr, hyperslab) { \
1125 NC(nc_inq_varid(ncid, varname, &varid)); \
1127 NC(nc_put_vara_int(ncid, varid, start, count, ptr)); \
1129 NC(nc_put_var_int(ncid, varid, ptr)); \
1146#define NC_PUT_ATT(varname, attname, text) { \
1147 NC(nc_inq_varid(ncid, varname, &varid)); \
1148 NC(nc_put_att_text(ncid, varid, attname, strnlen(text, LEN), text)); \
1163#define NC_PUT_ATT_GLOBAL(attname, text) \
1164 NC(nc_put_att_text(ncid, NC_GLOBAL, attname, strnlen(text, LEN), text));
1183#define NN(x0, y0, x1, y1, x) \
1184 (fabs((x) - (x0)) <= fabs((x) - (x1)) ? (y0) : (y1))
1217#define PARTICLE_LOOP(ip0, ip1, check_dt, ...) \
1218 const int ip0_const = ip0; \
1219 const int ip1_const = ip1; \
1220 _Pragma(__VA_ARGS__) \
1221 _Pragma("acc parallel loop independent gang vector") \
1222 for (int ip = ip0_const; ip < ip1_const; ip++) \
1223 if (!check_dt || dt[ip] != 0)
1225#define PARTICLE_LOOP(ip0, ip1, check_dt, ...) \
1226 const int ip0_const = ip0; \
1227 const int ip1_const = ip1; \
1228 _Pragma("omp parallel for default(shared)") \
1229 for (int ip = ip0_const; ip < ip1_const; ip++) \
1230 if (!check_dt || dt[ip] != 0)
1256 (P0 * exp(-(z) / H0))
1280 (6.112 * exp(17.62 * ((t) - T0) / (243.12 + (t) - T0)))
1304 (6.112 * exp(22.46 * ((t) - T0) / (272.62 + (t) - T0)))
1331 ((p) * MAX((h2o), 0.1e-6) / (1. + (1. - EPS) * MAX((h2o), 0.1e-6)))
1360#define RH(p, t, h2o) \
1361 (PW(p, h2o) / PSAT(t) * 100.)
1390#define RHICE(p, t, h2o) \
1391 (PW(p, h2o) / PSICE(t) * 100.)
1416 (100. * (p) / (RA * (t)))
1446#define ROETH_PHOTOL(a, b, c, sza) \
1447 ((c)*(sza) < M_PI/2. ? (a) * exp((b) * (1 - 1/cos((c) * (sza)))) : 0)
1465#define SET_ATM(qnt, val) \
1466 if (ctl->qnt >= 0) \
1467 atm->q[ctl->qnt][ip] = val;
1488#define SET_QNT(qnt, name, longname, unit) \
1489 if (strcasecmp(ctl->qnt_name[iq], name) == 0) { \
1491 sprintf(ctl->qnt_longname[iq], longname); \
1492 sprintf(ctl->qnt_unit[iq], unit); \
1510 (EPS * MAX((h2o), 0.1e-6))
1536#define SWAP(x, y, type) \
1537 do {type tmp = x; x = y; y = tmp;} while(0);
1560#define TDEW(p, h2o) \
1561 (T0 + 243.12 * log(PW((p), (h2o)) / 6.112) \
1562 / (17.62 - log(PW((p), (h2o)) / 6.112)))
1585#define TICE(p, h2o) \
1586 (T0 + 272.62 * log(PW((p), (h2o)) / 6.112) \
1587 / (22.46 - log(PW((p), (h2o)) / 6.112)))
1609#define THETA(p, t) \
1610 ((t) * pow(1000. / (p), 0.286))
1638#define THETAVIRT(p, t, h2o) \
1639 (TVIRT(THETA((p), (t)), MAX((h2o), 0.1e-6)))
1659#define TOK(line, tok, format, var) { \
1660 if(((tok)=strtok((line), " \t"))) { \
1661 if(sscanf(tok, format, &(var))!=1) continue; \
1662 } else ERRMSG("Error while reading!"); \
1684#define TVIRT(t, h2o) \
1685 ((t) * (1. + (1. - EPS) * MAX((h2o), 0.1e-6)))
1707 (H0 * log(P0 / (p)))
1737#define ZDIFF(lnp0, t0, h2o0, lnp1, t1, h2o1) \
1738 (RI / MA / G0 * 0.5 * (TVIRT((t0), (h2o0)) + TVIRT((t1), (h2o1))) \
1739 * ((lnp0) - (lnp1)))
1768#define ZETA(ps, p, t) \
1769 (((p) / (ps) <= 0.3 ? 1. : \
1770 sin(M_PI / 2. * (1. - (p) / (ps)) / (1. - 0.3))) \
1811#define LOG(level, ...) { \
1814 if(level <= LOGLEV) { \
1815 printf(__VA_ARGS__); \
1848#define WARN(...) { \
1849 printf("\nWarning (%s, %s, l%d): ", __FILE__, __func__, __LINE__); \
1850 LOG(0, __VA_ARGS__); \
1881#define ERRMSG(...) { \
1882 printf("\nError (%s, %s, l%d): ", __FILE__, __func__, __LINE__); \
1883 LOG(0, __VA_ARGS__); \
1884 exit(EXIT_FAILURE); \
1916#define PRINT(format, var) \
1917 printf("Print (%s, %s, l%d): %s= "format"\n", \
1918 __FILE__, __func__, __LINE__, #var, var);
1940#define PRINT_TIMERS \
1941 timer("END", "END", 1);
1961#define SELECT_TIMER(id, group, color) { \
1963 NVTX_PUSH(id, color); \
1964 timer(id, group, 0); \
1980#define START_TIMERS \
1981 NVTX_PUSH("START", NVTX_CPU);
1995#define STOP_TIMERS \
2003#include "nvToolsExt.h"
2006#define NVTX_CPU 0xFFADD8E6
2009#define NVTX_GPU 0xFF00008B
2012#define NVTX_H2D 0xFFFFFF00
2015#define NVTX_D2H 0xFFFF8800
2018#define NVTX_READ 0xFFFFCCCB
2021#define NVTX_WRITE 0xFF8B0000
2024#define NVTX_RECV 0xFFCCFFCB
2027#define NVTX_SEND 0xFF008B00
2058#define NVTX_PUSH(range_title, range_color) { \
2059 nvtxEventAttributes_t eventAttrib = {0}; \
2060 eventAttrib.version = NVTX_VERSION; \
2061 eventAttrib.size = NVTX_EVENT_ATTRIB_STRUCT_SIZE; \
2062 eventAttrib.messageType = NVTX_MESSAGE_TYPE_ASCII; \
2063 eventAttrib.colorType = NVTX_COLOR_ARGB; \
2064 eventAttrib.color = range_color; \
2065 eventAttrib.message.ascii = range_title; \
2066 nvtxRangePushEx(&eventAttrib); \
2087#define NVTX_PUSH(range_title, range_color) {}
2120 double *__restrict__ c,
2122 int *__restrict__ index);
2705 char clim_ccl4_timeseries[
LEN];
2708 char clim_ccl3f_timeseries[
LEN];
2711 char clim_ccl2f2_timeseries[
LEN];
2714 char clim_n2o_timeseries[
LEN];
2717 char clim_sf6_timeseries[
LEN];
2804 double wet_depo_pre[2];
2819 double wet_depo_ic_h[3];
2822 double wet_depo_bc_h[2];
3237 double tropo_time[12];
3240 double tropo_lat[73];
3243 double tropo[12][73];
4173 float height0[
EX][
EY][
EP],
4174 float array0[
EX][
EY][
EP],
4176 float height1[
EX][
EY][
EP],
4177 float array1[
EX][
EY][
EP],
4294 float array[
EX][
EY],
4337 float array0[
EX][
EY][
EP],
4339 float array1[
EX][
EY][
EP],
4373 float array0[
EX][
EY][
EP],
4375 float array1[
EX][
EY][
EP],
4418 float array0[
EX][
EY],
4420 float array1[
EX][
EY],
4468 float array0[
EX][
EY],
4470 float array1[
EX][
EY],
4545 const double kz[
EP],
4546 const double kw[
EP],
4701 float profiles[
EX][
EY][
EP],
4754 float profiles[
EX][
EY][
EP],
5721 const char *filename,
5758 const char *filename,
5793 const char *filename,
5832 const char *filename,
5866 const char *filename,
5934 const char *filename,
5961 const char *filename,
5991 const char *filename,
6025 const char *filename,
6058 const char *filename,
6107 const char *filename,
6360 const char *filename,
6834 const char *filename,
6871 const char *filename,
6906 const char *filename,
6948 const char *filename,
6951 const char *varname,
6953 const char *defvalue,
7107 const double remain,
7169 const char *filename,
7235 const char *filename,
7263 const char *filename,
7292 const char *filename,
7320 const char *filename,
7349 const char *dirname,
7378 const char *filename,
7411 const char *filename,
7444 const char *filename,
7488 const char *filename,
7541 const char *filename,
7598 const char *filename,
7645 const char *filename,
7762 const char *dirname,
7800 const char *filename,
7839 const char *filename,
7873 const char *filename,
7907 const char *filename,
7917#pragma acc routine (clim_oh)
7918#pragma acc routine (clim_photo)
7919#pragma acc routine (clim_tropo)
7920#pragma acc routine (clim_ts)
7921#pragma acc routine (clim_zm)
7922#pragma acc routine (intpol_met_4d_coord)
7923#pragma acc routine (intpol_met_space_3d)
7924#pragma acc routine (intpol_met_space_3d_ml)
7925#pragma acc routine (intpol_met_space_2d)
7926#pragma acc routine (intpol_met_time_3d)
7927#pragma acc routine (intpol_met_time_3d_ml)
7928#pragma acc routine (intpol_met_time_2d)
7929#pragma acc routine (kernel_weight)
7930#pragma acc routine (lapse_rate)
7931#pragma acc routine (locate_irr)
7932#pragma acc routine (locate_irr_float)
7933#pragma acc routine (locate_reg)
7934#pragma acc routine (locate_vert)
7935#pragma acc routine (locate_irr_3d)
7936#pragma acc routine (nat_temperature)
7937#pragma acc routine (sedi)
7938#pragma acc routine (stddev)
7939#pragma acc routine (sza_calc)
7940#pragma acc routine (tropo_weight)
void module_mixing_help(ctl_t *ctl, clim_t *clim, atm_t *atm, const int *ixs, const int *iys, const int *izs, int qnt_idx)
Perform interparcel mixing for a specific quantity.
int write_met(const char *filename, ctl_t *ctl, met_t *met)
Writes meteorological data to a binary file.
void read_met_bin_2d(FILE *in, met_t *met, float var[EX][EY], char *varname)
Reads a 2-dimensional meteorological variable from a binary file and stores it in the provided array.
void module_chem_init(ctl_t *ctl, clim_t *clim, met_t *met0, met_t *met1, atm_t *atm)
Initializes the chemistry modules by setting atmospheric composition.
void intpol_met_time_2d(met_t *met0, float array0[EX][EY], met_t *met1, float array1[EX][EY], double ts, double lon, double lat, double *var, int *ci, double *cw, int init)
Interpolates meteorological data in 2D space and time.
#define LEN
Maximum length of ASCII data lines.
void module_timesteps(ctl_t *ctl, met_t *met0, atm_t *atm, double *dt, double t)
Calculate time steps for air parcels based on specified conditions.
void day2doy(const int year, const int mon, const int day, int *doy)
Get day of year from date.
void read_met_extrapolate(met_t *met)
Extrapolates meteorological data.
int read_atm_nc(const char *filename, ctl_t *ctl, atm_t *atm)
Reads air parcel data from a generic netCDF file and populates the given atmospheric structure.
void write_grid_asc(const char *filename, ctl_t *ctl, double *cd, double *mean[NQ], double *sigma[NQ], double *vmr_impl, double t, double *z, double *lon, double *lat, double *area, double dz, int *np)
Writes grid data to an ASCII file.
void module_kpp_chem(ctl_t *ctl, clim_t *clim, met_t *met0, met_t *met1, atm_t *atm, double *dt)
KPP chemistry module.
void compress_cms(ctl_t *ctl, char *varname, float *array, size_t nx, size_t ny, size_t np, int decompress, FILE *inout)
Compresses or decompresses a 3D array of floats using a custom multiscale compression algorithm.
int read_atm(const char *filename, ctl_t *ctl, atm_t *atm)
Reads air parcel data from a specified file into the given atmospheric structure.
void read_met_levels(int ncid, ctl_t *ctl, met_t *met)
Reads meteorological variables at different vertical levels from a NetCDF file.
void timer(const char *name, const char *group, int output)
Measures and reports elapsed time for named and grouped timers.
void read_clim_photo(const char *filename, clim_photo_t *photo)
Reads photolysis rates from a NetCDF file and populates the given photolysis structure.
void read_met_cloud(met_t *met)
Calculates cloud-related variables for each grid point.
double sedi(const double p, const double T, const double rp, const double rhop)
Calculates the sedimentation velocity of a particle in air.
void module_sedi(ctl_t *ctl, met_t *met0, met_t *met1, atm_t *atm, double *dt)
Simulate sedimentation of particles in the atmosphere.
void compress_zstd(char *varname, float *array, size_t n, int decompress, FILE *inout)
Compresses or decompresses an array of floats using the Zstandard (ZSTD) library.
void module_advect_init(ctl_t *ctl, met_t *met0, met_t *met1, atm_t *atm)
Initializes the advection module by setting up pressure fields.
void read_met_grid(const char *filename, int ncid, ctl_t *ctl, met_t *met)
Reads meteorological grid information from a NetCDF file.
void write_met_bin_3d(FILE *out, ctl_t *ctl, met_t *met, float var[EX][EY][EP], char *varname, int precision, double tolerance)
Writes a 3-dimensional meteorological variable to a binary file.
void read_clim(ctl_t *ctl, clim_t *clim)
Reads various climatological data and populates the given climatology structure.
void module_wet_deposition(ctl_t *ctl, met_t *met0, met_t *met1, atm_t *atm, double *dt)
Perform wet deposition calculations for air parcels.
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.
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.
int read_met_nc_2d(int ncid, char *varname, char *varname2, char *varname3, char *varname4, ctl_t *ctl, met_t *met, float dest[EX][EY], float scl, int init)
Reads a 2-dimensional meteorological variable from a NetCDF file.
void write_vtk(const char *filename, ctl_t *ctl, atm_t *atm, double t)
Writes VTK (Visualization Toolkit) data to a specified file.
void module_sort(ctl_t *ctl, met_t *met0, atm_t *atm)
Sort particles according to box index.
int read_atm_asc(const char *filename, ctl_t *ctl, atm_t *atm)
Reads air parcel data from an ASCII file and populates the given atmospheric structure.
void module_rng_init(int ntask)
Initialize random number generators for parallel tasks.
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.
void write_atm_asc(const char *filename, ctl_t *ctl, atm_t *atm, double t)
Writes air parcel data to an ASCII file or gnuplot.
void write_grid_nc(const char *filename, ctl_t *ctl, double *cd, double *mean[NQ], double *sigma[NQ], double *vmr_impl, double t, double *z, double *lon, double *lat, double *area, double dz, int *np)
Writes grid data to a NetCDF file.
void read_met_periodic(met_t *met)
Applies periodic boundary conditions to meteorological data along longitudinal axis.
void module_chemgrid(ctl_t *ctl, met_t *met0, met_t *met1, atm_t *atm, double t)
Calculate grid data for chemistry modules.
void clim_oh_diurnal_correction(ctl_t *ctl, clim_t *clim)
Applies a diurnal correction to the hydroxyl radical (OH) concentration in climatology data.
double clim_zm(const clim_zm_t *zm, const double t, const double lat, const double p)
Interpolates monthly mean zonal mean climatological variables.
#define EY
Maximum number of latitudes for meteo data.
void module_tracer_chem(ctl_t *ctl, clim_t *clim, met_t *met0, met_t *met1, atm_t *atm, double *dt)
Simulate chemical reactions involving long-lived atmospheric tracers.
double clim_tropo(const clim_t *clim, const double t, const double lat)
Calculates the tropopause pressure based on climatological data.
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.
void intpol_met_space_3d_ml(met_t *met, float array[EX][EY][EP], double p, double lon, double lat, double *var)
Interpolates a meteorological variable in 3D space (longitude, latitude, pressure).
void intpol_met_time_3d(met_t *met0, float array0[EX][EY][EP], met_t *met1, float array1[EX][EY][EP], double ts, double p, double lon, double lat, double *var, int *ci, double *cw, int init)
Interpolates meteorological data in 3D space and time.
void write_met_bin_2d(FILE *out, met_t *met, float var[EX][EY], char *varname)
Writes a 2-dimensional meteorological variable to a binary file.
void fft_help(double *fcReal, double *fcImag, int n)
Computes the Fast Fourier Transform (FFT) of a complex sequence.
void module_rng(ctl_t *ctl, double *rs, size_t n, int method)
Generate random numbers using various methods and distributions.
void module_advect(ctl_t *ctl, met_t *met0, met_t *met1, atm_t *atm, double *dt)
Performs the advection of atmospheric particles using meteorological data.
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.
void get_tropo(int met_tropo, ctl_t *ctl, clim_t *clim, met_t *met, double *lons, int nx, double *lats, int ny, double *pt, double *zt, double *tt, double *qt, double *o3t, double *ps, double *zs)
Calculate tropopause data.
void level_definitions(ctl_t *ctl)
Defines pressure levels for meteorological data.
void write_atm_clams_traj(const char *dirname, ctl_t *ctl, atm_t *atm, double t)
Writes CLaMS trajectory data to a NetCDF file.
void read_obs(const char *filename, 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.
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.
void write_grid(const char *filename, ctl_t *ctl, met_t *met0, met_t *met1, atm_t *atm, double t)
Writes grid data to a file in ASCII or netCDF format.
void read_clim_zm(const char *filename, char *varname, clim_zm_t *zm)
Reads zonally averaged climatological data from a netCDF file and populates the given structure.
void read_met_pbl(met_t *met)
Calculates the planetary boundary layer (PBL) height for each grid point.
double nat_temperature(const double p, const double h2o, const double hno3)
Calculates the nitric acid trihydrate (NAT) temperature.
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.
#define CP
Maximum number of pressure levels for climatological data.
void read_met_tropo(ctl_t *ctl, clim_t *clim, met_t *met)
Calculates the tropopause and related meteorological variables based on various methods and stores th...
int read_atm_clams(const char *filename, ctl_t *ctl, atm_t *atm)
Reads air parcel data from a CLaMS netCDF file and populates the given atmospheric structure.
void write_sample(const char *filename, ctl_t *ctl, met_t *met0, met_t *met1, atm_t *atm, double t)
Writes sample data to a specified file.
#define NQ
Maximum number of quantities per data point.
void module_bound_cond(ctl_t *ctl, clim_t *clim, met_t *met0, met_t *met1, atm_t *atm, double *dt)
Apply boundary conditions to particles based on meteorological and climatological data.
void module_timesteps_init(ctl_t *ctl, atm_t *atm)
Initialize start time and time interval for time-stepping.
int read_atm_bin(const char *filename, ctl_t *ctl, atm_t *atm)
Reads air parcel data from a binary file and populates the given atmospheric structure.
void read_met_sample(ctl_t *ctl, met_t *met)
Downsamples meteorological data based on specified parameters.
void module_h2o2_chem(ctl_t *ctl, clim_t *clim, met_t *met0, met_t *met1, atm_t *atm, double *dt)
Perform chemical reactions involving H2O2 within cloud particles.
void write_station(const char *filename, ctl_t *ctl, atm_t *atm, double t)
Writes station data to a specified file.
#define EX
Maximum number of longitudes for meteo data.
void read_met_monotonize(met_t *met)
Makes zeta and pressure profiles monotone.
void write_atm(const char *filename, ctl_t *ctl, atm_t *atm, double t)
Writes air parcel data to a file in various formats.
void write_csi(const char *filename, ctl_t *ctl, atm_t *atm, double t)
Writes Critical Success Index (CSI) data to a file.
void intpol_tropo_3d(double time0, float array0[EX][EY], double time1, float array1[EX][EY], double lons[EX], double lats[EY], int nlon, int nlat, double time, double lon, double lat, int method, double *var, double *sigma)
Interpolates tropopause data in 3D (latitude, longitude, and time).
void read_met_ml2pl(ctl_t *ctl, met_t *met, float var[EX][EY][EP], char *varname)
Interpolates meteorological data to specified pressure levels.
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.
void module_mixing(ctl_t *ctl, clim_t *clim, atm_t *atm, double t)
Update atmospheric properties through interparcel mixing.
void module_position(ctl_t *ctl, met_t *met0, met_t *met1, atm_t *atm, double *dt)
Update the positions and pressure levels of atmospheric particles.
void module_meteo(ctl_t *ctl, clim_t *clim, met_t *met0, met_t *met1, atm_t *atm, double *dt)
Update atmospheric properties using meteorological data.
#define CT
Maximum number of time steps for climatological data.
void get_met(ctl_t *ctl, clim_t *clim, double t, met_t **met0, met_t **met1)
Retrieves meteorological data for the specified time.
void module_oh_chem(ctl_t *ctl, clim_t *clim, met_t *met0, met_t *met1, atm_t *atm, double *dt)
Perform hydroxyl chemistry calculations for atmospheric particles.
void module_sort_help(double *a, const int *p, const int np)
Reorder an array based on a given permutation.
float stddev(const float *data, const int n)
Calculates the standard deviation of a set of data.
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.
void read_met_bin_3d(FILE *in, ctl_t *ctl, met_t *met, float var[EX][EY][EP], char *varname, float bound_min, float bound_max)
Reads 3D meteorological data from a binary file, potentially using different compression methods.
void module_isosurf_init(ctl_t *ctl, met_t *met0, met_t *met1, atm_t *atm, cache_t *cache)
Initialize the isosurface module based on atmospheric data.
int read_met_nc_3d(int ncid, char *varname, char *varname2, char *varname3, char *varname4, ctl_t *ctl, met_t *met, float dest[EX][EY][EP], float scl)
Reads a 3-dimensional meteorological variable from a NetCDF file.
void read_met_detrend(ctl_t *ctl, met_t *met)
Detrends meteorological data.
double time_from_filename(const char *filename, int offset)
Extracts and converts a timestamp from a filename to Julian seconds.
void module_dry_deposition(ctl_t *ctl, met_t *met0, met_t *met1, atm_t *atm, double *dt)
Simulate dry deposition of atmospheric particles.
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...
#define CTS
Maximum number of data points of climatological time series.
void read_met_ozone(met_t *met)
Calculates the total column ozone from meteorological ozone data.
void intpol_met_time_3d_ml(met_t *met0, float array0[EX][EY][EP], met_t *met1, float array1[EX][EY][EP], double ts, double p, double lon, double lat, double *var)
Interpolates a meteorological variable in time and 3D space (longitude, latitude, pressure).
void write_atm_clams(const char *filename, ctl_t *ctl, atm_t *atm)
Writes air parcel data to a NetCDF file in the CLaMS format.
void broadcast_large_data(void *data, size_t N)
Broadcasts large data across all processes in an MPI communicator.
void clim_tropo_init(clim_t *clim)
Initializes the tropopause data in the climatology structure.
void cart2geo(const double *x, double *z, double *lon, double *lat)
Converts Cartesian coordinates to geographic coordinates.
#define NP
Maximum number of atmospheric data points.
double sza_calc(const double sec, const double lon, const double lat)
Calculates the solar zenith angle.
void read_met_surface(int ncid, met_t *met, ctl_t *ctl)
Reads surface meteorological data from a netCDF file and stores it in the meteorological data structu...
void module_decay(ctl_t *ctl, clim_t *clim, atm_t *atm, double *dt)
Simulate exponential decay processes for atmospheric particles.
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).
void intpol_met_space_3d(met_t *met, float array[EX][EY][EP], double p, double lon, double lat, double *var, int *ci, double *cw, int init)
Interpolates meteorological variables in 3D space.
void read_ctl(const char *filename, int argc, char *argv[], ctl_t *ctl)
Reads control parameters from a configuration file and populates the given structure.
int locate_irr_3d(float profiles[EX][EY][EP], int np, int ind_lon, int ind_lat, double x)
Locate the index of the interval containing a given value in a 3D irregular grid.
int read_met(const char *filename, ctl_t *ctl, clim_t *clim, met_t *met)
Reads meteorological data from a file and populates the provided structures.
void read_met_pv(met_t *met)
Calculates potential vorticity (PV) from meteorological data.
void module_isosurf(ctl_t *ctl, met_t *met0, met_t *met1, atm_t *atm, cache_t *cache, double *dt)
Apply the isosurface module to adjust atmospheric properties.
void get_met_replace(char *orig, char *search, char *repl)
Replaces occurrences of a substring in a string with another substring.
#define CY
Maximum number of latitudes for climatological data.
void write_atm_bin(const char *filename, ctl_t *ctl, atm_t *atm)
Writes air parcel data to a binary file.
double clim_ts(const clim_ts_t *ts, const double t)
Interpolates a time series of climatological variables.
void thrustSortWrapper(double *__restrict__ c, int n, int *__restrict__ index)
Wrapper to Thrust sorting function.
void jsec2time(const double jsec, int *year, int *mon, int *day, int *hour, int *min, int *sec, double *remain)
Converts Julian seconds to calendar date and time components.
void intpol_met_4d_coord(met_t *met0, float height0[EX][EY][EP], float array0[EX][EY][EP], met_t *met1, float height1[EX][EY][EP], float array1[EX][EY][EP], double ts, double height, double lon, double lat, double *var, int *ci, double *cw, int init)
Interpolates meteorological variables to a given position and time.
double scan_ctl(const char *filename, int argc, char *argv[], const char *varname, int arridx, const char *defvalue, char *value)
Scans a control file or command-line arguments for a specified variable.
void write_atm_nc(const char *filename, ctl_t *ctl, atm_t *atm)
Writes air parcel data to a NetCDF file.
void module_convection(ctl_t *ctl, met_t *met0, met_t *met1, atm_t *atm, double *dt, double *rs)
Simulate convective processes for atmospheric particles.
void get_met_help(ctl_t *ctl, double t, int direct, char *metbase, double dt_met, char *filename)
Helper function to generate the filename for meteorological data.
void intpol_met_space_2d(met_t *met, float array[EX][EY], double lon, double lat, double *var, int *ci, double *cw, int init)
Interpolates meteorological variables in 2D space.
#define EP
Maximum number of pressure levels for meteo data.
void module_diffusion_meso(ctl_t *ctl, met_t *met0, met_t *met1, atm_t *atm, cache_t *cache, double *dt, double *rs)
Simulate mesoscale diffusion for atmospheric particles.
void read_met_polar_winds(met_t *met)
Applies a fix for polar winds in meteorological data.
void compress_zfp(char *varname, float *array, int nx, int ny, int nz, int precision, double tolerance, int decompress, FILE *inout)
Compresses or decompresses a 3D array of floats using the ZFP library.
#define CO3
Maximum number of total column ozone data for climatological data.
void geo2cart(const double z, const double lon, const double lat, double *x)
Converts geographic coordinates (longitude, latitude, altitude) to Cartesian coordinates.
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.
void module_diffusion_turb(ctl_t *ctl, clim_t *clim, atm_t *atm, double *dt, double *rs)
Simulate turbulent diffusion for atmospheric particles.
void read_met_cape(clim_t *clim, met_t *met)
Calculates Convective Available Potential Energy (CAPE) for each grid point.
double tropo_weight(const clim_t *clim, const double t, const double lat, const double p)
Computes the weighting factor for a given pressure with respect to the tropopause.
void read_met_geopot(ctl_t *ctl, met_t *met)
Calculates geopotential heights from meteorological data.
void write_output(const char *dirname, ctl_t *ctl, met_t *met0, met_t *met1, atm_t *atm, double t)
Writes various types of output data to files in a specified directory.
void write_prof(const char *filename, ctl_t *ctl, met_t *met0, met_t *met1, atm_t *atm, double t)
Writes profile data to a specified file.
void compress_pck(char *varname, float *array, size_t nxy, size_t nz, int decompress, FILE *inout)
Compresses or decompresses a 3D array of floats.
void write_ens(const char *filename, ctl_t *ctl, atm_t *atm, double t)
Writes ensemble data to a file.
void locate_vert(float profiles[EX][EY][EP], int np, int lon_ap_ind, int lat_ap_ind, double alt_ap, int *ind)
Locate the four vertical indizes of a box for a given height value.
#define CSZA
Maximum number of solar zenith angles for climatological data.
double lapse_rate(const double t, const double h2o)
Calculates the moist adiabatic lapse rate in Kelvin per kilometer.
double clim_photo(double rate[CP][CSZA][CO3], clim_photo_t *photo, double p, double sza, double o3c)
Calculates the photolysis rate for a given set of atmospheric conditions.
int np
Number of air parcels.
int iso_n
Isosurface balloon number of data points.
Climatological data in the form of photolysis rates.
int nsza
Number of solar zenith angles.
int np
Number of pressure levels.
int no3c
Number of total ozone columns.
clim_ts_t ccl2f2
CFC-12 time series.
clim_photo_t photo
Photolysis rates.
clim_zm_t ho2
HO2 zonal means.
clim_zm_t hno3
HNO3 zonal means.
int tropo_ntime
Number of tropopause timesteps.
clim_ts_t sf6
SF6 time series.
clim_ts_t ccl4
CFC-10 time series.
clim_ts_t ccl3f
CFC-11 time series.
clim_zm_t o1d
O(1D) zonal means.
clim_zm_t h2o2
H2O2 zonal means.
int tropo_nlat
Number of tropopause latitudes.
clim_zm_t oh
OH zonal means.
clim_ts_t n2o
N2O time series.
Climatological data in the form of time series.
int ntime
Number of timesteps.
Climatological data in the form of zonal means.
int np
Number of pressure levels.
int ntime
Number of timesteps.
int nlat
Number of latitudes.
double grid_z0
Lower altitude of gridded data [km].
int qnt_o3
Quantity array index for ozone volume mixing ratio.
double csi_lat1
Upper latitude of gridded CSI data [deg].
int qnt_Coh
Quantity array index for OH volume mixing ratio (chemistry code).
double wet_depo_ic_a
Coefficient A for wet deposition in cloud (exponential form).
int met_nc_scale
Check netCDF scaling factors (0=no, 1=yes).
int qnt_pel
Quantity array index for pressure at equilibrium level (EL).
int csi_nz
Number of altitudes of gridded CSI data.
double molmass
Molar mass [g/mol].
int qnt_p
Quantity array index for pressure.
int qnt_Cccl2f2
Quantity array index for CFC-12 volume mixing ratio (chemistry code).
int mixing_nx
Number of longitudes of mixing grid.
double chemgrid_z1
Upper altitude of chemistry grid [km].
int qnt_m
Quantity array index for mass.
int qnt_aoa
Quantity array index for age of air.
int qnt_rhop
Quantity array index for particle density.
int qnt_swc
Quantity array index for cloud snow water content.
double csi_obsmin
Minimum observation index to trigger detection.
int qnt_pcb
Quantity array index for cloud bottom pressure.
double bound_dzs
Boundary conditions surface layer depth [km].
double csi_lon1
Upper longitude of gridded CSI data [deg].
int qnt_u
Quantity array index for zonal wind.
double stat_lon
Longitude of station [deg].
double mixing_trop
Interparcel exchange parameter for mixing in the troposphere.
double sort_dt
Time step for sorting of particle data [s].
double mixing_z1
Upper altitude of mixing grid [km].
double stat_r
Search radius around station [km].
double wet_depo_bc_a
Coefficient A for wet deposition below cloud (exponential form).
int csi_ny
Number of latitudes of gridded CSI data.
int vtk_sphere
Spherical projection for VTK data (0=no, 1=yes).
double chemgrid_z0
Lower altitude of chemistry grid [km].
int qnt_iwc
Quantity array index for cloud ice water content.
double chemgrid_lat0
Lower latitude of chemistry grid [deg].
double conv_cape
CAPE threshold for convection module [J/kg].
int qnt_Co1d
Quantity array index for O(1D) volume mixing ratio (chemistry code).
double met_cms_eps_pv
cmultiscale compression epsilon for potential vorticity.
int qnt_pw
Quantity array index for partial water vapor pressure.
double grid_z1
Upper altitude of gridded data [km].
int direction
Direction flag (1=forward calculation, -1=backward calculation).
int qnt_Cccl4
Quantity array index for CFC-10 volume mixing ratio (chemistry code).
int met_dp
Stride for pressure levels.
double met_dt_out
Time step for sampling of meteo data along trajectories [s].
int qnt_h2o2
Quantity array index for H2O2 volume mixing ratio (climatology).
int qnt_vh
Quantity array index for horizontal wind.
int csi_nx
Number of longitudes of gridded CSI data.
double csi_lat0
Lower latitude of gridded CSI data [deg].
double turb_dz_trop
Vertical turbulent diffusion coefficient (troposphere) [m^2/s].
int qnt_lwc
Quantity array index for cloud liquid water content.
double turb_mesoz
Vertical scaling factor for mesoscale wind fluctuations.
int grid_nx
Number of longitudes of gridded data.
int atm_type
Type of atmospheric data files (0=ASCII, 1=binary, 2=netCDF, 3=CLaMS).
double bound_mass
Boundary conditions mass per particle [kg].
double grid_lat0
Lower latitude of gridded data [deg].
int qnt_ts
Quantity array index for surface temperature.
int qnt_loss_rate
Quantity array index for total loss rate.
double met_cms_eps_h2o
cmultiscale compression epsilon for water vapor.
int qnt_plfc
Quantity array index for pressure at level of free convection (LCF).
double grid_lon0
Lower longitude of gridded data [deg].
int qnt_o1d
Quantity array index for O(1D) volume mixing ratio (climatology).
int met_tropo_spline
Tropopause interpolation method (0=linear, 1=spline).
int qnt_tvirt
Quantity array index for virtual temperature.
double dt_met
Time step of meteo data [s].
double chemgrid_lat1
Upper latitude of chemistry grid [deg].
int met_geopot_sy
Latitudinal smoothing of geopotential heights.
double met_cms_eps_u
cmultiscale compression epsilon for zonal wind.
double turb_dx_strat
Horizontal turbulent diffusion coefficient (stratosphere) [m^2/s].
int qnt_vmr
Quantity array index for volume mixing ratio.
int qnt_lsm
Quantity array index for land-sea mask.
int qnt_theta
Quantity array index for potential temperature.
double bound_lat1
Boundary conditions maximum longitude [deg].
double stat_t1
Stop time for station output [s].
double turb_dx_trop
Horizontal turbulent diffusion coefficient (troposphere) [m^2/s].
int grid_type
Type of grid data files (0=ASCII, 1=netCDF).
double csi_lon0
Lower longitude of gridded CSI data [deg].
int qnt_pbl
Quantity array index for boundary layer pressure.
int grid_stddev
Include standard deviations in grid output (0=no, 1=yes).
int qnt_psice
Quantity array index for saturation pressure over ice.
double chemgrid_lon0
Lower longitude of chemistry grid [deg].
int bound_pbl
Boundary conditions planetary boundary layer (0=no, 1=yes).
int qnt_mloss_wet
Quantity array index for total mass loss due to wet deposition.
int met_geopot_sx
Longitudinal smoothing of geopotential heights.
int met_sy
Smoothing for latitudes.
int qnt_ps
Quantity array index for surface pressure.
int rng_type
Random number generator (0=GSL, 1=Squares, 2=cuRAND).
int isosurf
Isosurface parameter (0=none, 1=pressure, 2=density, 3=theta, 4=balloon).
double bound_p1
Boundary conditions top pressure [hPa].
int qnt_zs
Quantity array index for surface geopotential height.
int prof_nz
Number of altitudes of gridded profile data.
double csi_dt_out
Time step for CSI output [s].
double csi_modmin
Minimum column density to trigger detection [kg/m^2].
int met_sx
Smoothing for longitudes.
double chemgrid_lon1
Upper longitude of chemistry grid [deg].
double turb_mesox
Horizontal scaling factor for mesoscale wind fluctuations.
double met_cms_eps_iwc
cmultiscale compression epsilon for cloud ice water content.
int conv_mix_bot
Lower level for mixing (0=particle pressure, 1=surface).
double met_cms_eps_swc
cmultiscale compression epsilon for cloud snow water content.
int met_zfp_prec
ZFP compression precision for all variables, except z and T.
double met_cms_eps_v
cmultiscale compression epsilon for meridional wind.
double prof_z0
Lower altitude of gridded profile data [km].
int qnt_w
Quantity array index for vertical velocity.
double bound_vmr
Boundary conditions volume mixing ratio [ppv].
double met_tropo_pv
Dynamical tropopause potential vorticity threshold [PVU].
int prof_nx
Number of longitudes of gridded profile data.
int qnt_stat
Quantity array index for station flag.
int met_tropo
Tropopause definition (0=none, 1=clim, 2=cold point, 3=WMO_1st, 4=WMO_2nd, 5=dynamical).
int qnt_rp
Quantity array index for particle radius.
int met_mpi_share
Use MPI to share meteo (0=no, 1=yes).
double mixing_strat
Interparcel exchange parameter for mixing in the stratosphere.
int qnt_vz
Quantity array index for vertical velocity.
int qnt_ho2
Quantity array index for HO2 volume mixing ratio (climatology).
double csi_z1
Upper altitude of gridded CSI data [km].
double stat_t0
Start time for station output [s].
double oh_chem_beta
Beta parameter for diurnal variablity of OH.
double mixing_z0
Lower altitude of mixing grid [km].
int qnt_mloss_decay
Quantity array index for total mass loss due to exponential decay.
int atm_type_out
Type of atmospheric data files for output (-1=same as ATM_TYPE, 0=netCDF, 1=binary,...
double dt_kpp
Time step for KPP chemistry [s].
double dry_depo_dp
Dry deposition surface layer [hPa].
int qnt_vs
Quantity array index for surface meridional wind.
int qnt_Cco
Quantity array index for CO volume mixing ratio (chemistry code).
double vtk_dt_out
Time step for VTK data output [s].
double t_stop
Stop time of simulation [s].
double conv_dt
Time interval for convection module [s].
int qnt_hno3
Quantity array index for HNO3 volume mixing ratio (climatology).
int met_clams
Read MPTRAC or CLaMS meteo data (0=MPTRAC, 1=CLaMS).
int qnt_h2ot
Quantity array index for tropopause water vapor volume mixing ratio.
int qnt_rh
Quantity array index for relative humidity over water.
double met_cms_eps_cc
cmultiscale compression epsilon for cloud cover.
double bound_lat0
Boundary conditions minimum longitude [deg].
int met_dx
Stride for longitudes.
int mixing_ny
Number of latitudes of mixing grid.
int met_convention
Meteo data layout (0=[lev, lat, lon], 1 = [lon, lat, lev]).
int qnt_zeta_d
Quantity array index for diagnosed zeta vertical coordinate.
int tracer_chem
Switch for first order tracer chemistry module (0=off, 1=on).
double dt_mod
Time step of simulation [s].
int qnt_tnat
Quantity array index for T_NAT.
int qnt_tice
Quantity array index for T_ice.
int qnt_zg
Quantity array index for geopotential height.
double vtk_offset
Vertical offset for VTK data [km].
int qnt_v
Quantity array index for meridional wind.
int qnt_mloss_dry
Quantity array index for total mass loss due to dry deposition.
double bound_vmr_trend
Boundary conditions volume mixing ratio trend [ppv/s].
int met_cache
Preload meteo data into disk cache (0=no, 1=yes).
int qnt_oh
Quantity array index for OH volume mixing ratio (climatology).
int qnt_Ch
Quantity array index for H volume mixing ratio (chemistry code).
int met_press_level_def
Use predefined pressure levels or not.
int oh_chem_reaction
Reaction type for OH chemistry (0=none, 2=bimolecular, 3=termolecular).
int qnt_h2o
Quantity array index for water vapor volume mixing ratio.
int prof_ny
Number of latitudes of gridded profile data.
int qnt_rhice
Quantity array index for relative humidity over ice.
int qnt_rho
Quantity array index for density of air.
double sample_dz
Layer depth for sample output [km].
double tdec_strat
Life time of particles in the stratosphere [s].
int obs_type
Type of observation data files (0=ASCII, 1=netCDF).
double met_cms_eps_lwc
cmultiscale compression epsilon for cloud liquid water content.
int qnt_us
Quantity array index for surface zonal wind.
double met_cms_eps_z
cmultiscale compression epsilon for geopotential height.
double grid_lon1
Upper longitude of gridded data [deg].
int conv_mix_top
Upper level for mixing (0=particle pressure, 1=EL).
int qnt_Cn2o
Quantity array index for N2O volume mixing ratio (chemistry code).
int qnt_Cccl3f
Quantity array index for CFC-11 volume mixing ratio (chemistry code).
double mixing_lat0
Lower latitude of mixing grid [deg].
int qnt_pt
Quantity array index for tropopause pressure.
int qnt_cl
Quantity array index for total column cloud water.
int advect
Advection scheme (0=off, 1=Euler, 2=midpoint, 4=Runge-Kutta).
double prof_z1
Upper altitude of gridded profile data [km].
int reflect
Reflection of particles at top and bottom boundary (0=no, 1=yes).
int qnt_t
Quantity array index for temperature.
int atm_filter
Time filter for atmospheric data output (0=none, 1=missval, 2=remove).
int kpp_chem
Switch for KPP chemistry module (0=off, 1=on).
int qnt_zeta
Quantity array index for zeta vertical coordinate.
int met_vert_coord
Vertical coordinate of input meteo data (0=pressure-level, 1=model-level).
double csi_z0
Lower altitude of gridded CSI data [km].
int qnt_lapse
Quantity array index for lapse rate.
double stat_lat
Latitude of station [deg].
int qnt_Cho2
Quantity array index for HO2 volume mixing ratio (chemistry code).
int grid_ny
Number of latitudes of gridded data.
int qnt_Csf6
Quantity array index for SF6 volume mixing ratio (chemistry code).
int qnt_Ch2o
Quantity array index for H2O volume mixing ratio (chemistry code).
double met_detrend
FWHM of horizontal Gaussian used for detrending [km].
double bound_dps
Boundary conditions surface layer depth [hPa].
double met_cms_eps_t
cmultiscale compression epsilon for temperature.
int chemgrid_nz
Number of altitudes of chemistry grid.
int qnt_cape
Quantity array index for convective available potential energy (CAPE).
double bound_mass_trend
Boundary conditions mass per particle trend [kg/s].
int mixing_nz
Number of altitudes of mixing grid.
int qnt_o3c
Quantity array index for total column ozone.
double bound_p0
Boundary conditions bottom pressure [hPa].
double mixing_lon0
Lower longitude of mixing grid [deg].
int qnt_Co3
Quantity array index for O3 volume mixing ratio (chemistry code).
int qnt_tsts
Quantity array index for T_STS.
int grid_nz
Number of altitudes of gridded data.
double ens_dt_out
Time step for ensemble output [s].
int atm_stride
Particle index stride for atmospheric data files.
int advect_cpl_zeta_and_press_modules
Coupled use of pressure based modules and diabatic advection.
int met_relhum
Try to read relative humidity (0=no, 1=yes).
double mixing_lat1
Upper latitude of mixing grid [deg].
double atm_dt_out
Time step for atmospheric data output [s].
double prof_lat1
Upper latitude of gridded profile data [deg].
double psc_h2o
H2O volume mixing ratio for PSC analysis.
int met_sp
Smoothing for pressure levels.
double prof_lon0
Lower longitude of gridded profile data [deg].
int chemgrid_nx
Number of longitudes of chemistry grid.
int qnt_pct
Quantity array index for cloud top pressure.
int qnt_mloss_kpp
Quantity array index for total mass loss due to KPP chemistry.
int qnt_psat
Quantity array index for saturation pressure over water.
double prof_lat0
Lower latitude of gridded profile data [deg].
int qnt_cin
Quantity array index for convective inhibition (CIN).
double psc_hno3
HNO3 volume mixing ratio for PSC analysis.
double prof_lon1
Upper longitude of gridded profile data [deg].
double met_cms_eps_rwc
cmultiscale compression epsilon for cloud rain water content.
int h2o2_chem_reaction
Reaction type for H2O2 chemistry (0=none, 1=SO2).
int qnt_Co3p
Quantity array index for O(3P) volume mixing ratio (chemistry code).
double wet_depo_bc_ret_ratio
Coefficients for wet deposition below cloud: retention ratio.
int chemgrid_ny
Number of latitudes of chemistry grid.
double met_cms_eps_o3
cmultiscale compression epsilon for ozone.
int grid_sparse
Sparse output in grid data files (0=no, 1=yes).
double dry_depo_vdep
Dry deposition velocity [m/s].
int qnt_tt
Quantity array index for tropopause temperature.
int met_np
Number of target pressure levels.
int qnt_ens
Quantity array index for ensemble IDs.
double met_zfp_tol_t
ZFP compression tolerance for temperature.
double mixing_dt
Time interval for mixing [s].
int qnt_mloss_h2o2
Quantity array index for total mass loss due to H2O2 chemistry.
double met_zfp_tol_z
ZFP compression tolerance for geopotential height.
double vtk_scale
Vertical scaling factor for VTK data.
double met_cms_eps_w
cmultiscale compression epsilon for vertical velocity.
double conv_cin
CIN threshold for convection module [J/kg].
int qnt_pv
Quantity array index for potential vorticity.
int advect_vert_coord
Vertical coordinate of air parcels (0=pressure, 1=zeta, 2=eta).
int qnt_mloss_oh
Quantity array index for total mass loss due to OH chemistry.
int qnt_Ch2o2
Quantity array index for H2O2 volume mixing ratio (chemistry code).
int qnt_sst
Quantity array index for sea surface temperature.
double mixing_lon1
Upper longitude of mixing grid [deg].
int met_cms_heur
cmultiscale coarsening heuristics (0=default, 1=mean diff, 2=median diff, 3=max diff).
double wet_depo_ic_ret_ratio
Coefficients for wet deposition in cloud: retention ratio.
int qnt_sh
Quantity array index for specific humidity.
double wet_depo_ic_b
Coefficient B for wet deposition in cloud (exponential form).
double wet_depo_bc_b
Coefficient B for wet deposition below cloud (exponential form).
int met_dy
Stride for latitudes.
int qnt_Cx
Quantity array index for trace species x volume mixing ratio (chemistry code).
double turb_dz_strat
Vertical turbulent diffusion coefficient (stratosphere) [m^2/s].
double bound_zetas
Boundary conditions surface layer zeta [K].
int qnt_idx
Quantity array index for air parcel IDs.
double met_tropo_theta
Dynamical tropopause potential temperature threshold [K].
int qnt_rwc
Quantity array index for cloud rain water content.
double t_start
Start time of simulation [s].
int nq
Number of quantities.
double tdec_trop
Life time of particles in the troposphere [s].
double sample_dx
Horizontal radius for sample output [km].
int vtk_stride
Particle index stride for VTK data.
double grid_lat1
Upper latitude of gridded data [deg].
int qnt_zt
Quantity array index for tropopause geopotential height.
int met_type
Type of meteo data files (0=netCDF, 1=binary, 2=pck, 3=zfp, 4=zstd).
int qnt_cc
Quantity array index for cloud cover.
int qnt_plcl
Quantity array index for pressure at lifted condensation level (LCL).
double grid_dt_out
Time step for gridded data output [s].
int qnt_tdew
Quantity array index for dew point temperature.
int nx
Number of longitudes.
int ny
Number of latitudes.
int np
Number of pressure levels.
int npl
Number of model levels.