diff --git a/src/Makefile b/src/Makefile index e5e874531..430f05a5c 100644 --- a/src/Makefile +++ b/src/Makefile @@ -30,7 +30,7 @@ GPU ?= 0 GPU_PIN ?= 0 # Static compilation... -STATIC ?= 0 +STATIC ?= 1 # Optimization flags... OPTI ?= -O3 diff --git a/src/mptrac.c b/src/mptrac.c index dbcf0ce20..c68b45160 100644 --- a/src/mptrac.c +++ b/src/mptrac.c @@ -2136,10 +2136,14 @@ void locate_vert( double height_ap, int *ind) { - ind[0] = locate_irr_float(profiles[lon_ap_ind][lat_ap_ind], np, height_ap, 0); - ind[1] = locate_irr_float(profiles[lon_ap_ind + 1][lat_ap_ind], np, height_ap, ind[0]); - ind[2] = locate_irr_float(profiles[lon_ap_ind][lat_ap_ind + 1], np, height_ap, ind[1]); - ind[3] = locate_irr_float(profiles[lon_ap_ind + 1][lat_ap_ind + 1], np, height_ap, ind[2]); + ind[0] = locate_irr_float(profiles[lon_ap_ind][lat_ap_ind], + np, height_ap, 0); + ind[1] = locate_irr_float(profiles[lon_ap_ind + 1][lat_ap_ind], + np, height_ap, ind[0]); + ind[2] = locate_irr_float(profiles[lon_ap_ind][lat_ap_ind + 1], + np, height_ap, ind[1]); + ind[3] = locate_irr_float(profiles[lon_ap_ind + 1][lat_ap_ind + 1], + np, height_ap, ind[2]); } /*****************************************************************************/ @@ -2950,20 +2954,20 @@ void module_h2o2_chem( /* Henry constant of H2O2... */ double H_h2o2 = 8.3e2 * exp(7600 * (1 / t - 1 / 298.15)) * RI * t; - /* Correction factor for high SO2 concentration (When qnt_Cx is difined, the correction switch on)... */ + /* Correction factor for high SO2 concentration + (if qnt_Cx is defined, the correction is switched on)... */ double cor = 1; if (ctl->qnt_Cx >= 0) - cor = - atm->q[ctl->qnt_Cx][ip] > + cor = atm->q[ctl->qnt_Cx][ip] > low ? a * pow(atm->q[ctl->qnt_Cx][ip], b) : 1; - + double h2o2 = H_h2o2 * clim_zm(&clim->h2o2, atm->time[ip], atm->lat[ip], atm->p[ip]) * M * cor * 1000 / AVO; /* unit: mol/L */ /* Volume water content in cloud [m^3 m^(-3)]... */ double rho_air = 100 * atm->p[ip] / (RI * t) * MA / 1000; - double CWC = (lwc + rwc) * rho_air / 1000; // TODO: check this? wrong units? + double CWC = (lwc + rwc) * rho_air / 1000; // TODO: check this? wrong units? /* Calculate exponential decay (Rolph et al., 1992)... */ double rate_coef = k * K_1S * h2o2 * H_SO2 * CWC; @@ -4973,7 +4977,8 @@ void read_ctl( ctl->met_vert_coord = (int) scan_ctl(filename, argc, argv, "MET_VERT_COORD", -1, "0", NULL); if (ctl->advect_vert_coord == 2 && ctl->met_vert_coord != 1) - ERRMSG("Using advect_vert_coord = 2 requires meteo data on model levels!"); + ERRMSG + ("Using ADVECT_VERT_COORD = 2 requires meteo data on model levels!"); ctl->met_clams = (int) scan_ctl(filename, argc, argv, "MET_CLAMS", -1, "0", NULL); ctl->advect_cpl_zeta_and_press_modules = @@ -5050,7 +5055,8 @@ void read_ctl( if (ctl->met_np > EP) ERRMSG("Too many levels!"); ctl->met_press_level_def = - (int) scan_ctl(filename, argc, argv, "MET_PRESS_LEVEL_DEF", -1, "-1", NULL); + (int) scan_ctl(filename, argc, argv, "MET_PRESS_LEVEL_DEF", -1, "-1", + NULL); if (ctl->met_press_level_def >= 0) { level_definitions(ctl); } else { diff --git a/src/mptrac.h b/src/mptrac.h index fd01075ad..c2dba07df 100644 --- a/src/mptrac.h +++ b/src/mptrac.h @@ -2129,11 +2129,13 @@ void thrustSortWrapper( * @brief Control parameters. * * This structure contains all control parameters used by the MPTRAC - * model. The struct is used to collect to easily pass the control + * model. The struct is used to collect and to easily pass the control * parameters on to the various functions. */ typedef struct { + /* TODO: finally sort ctl parameters once Fortran wrapper is working! */ + /*! Coupled use of pressure based modules and diabatic advection. (0= no coupling, 1= coupling) */ int advect_cpl_zeta_and_press_modules; @@ -2150,6 +2152,10 @@ typedef struct { /*! Read MPTRAC or CLaMS meteo data (0=MPTRAC, 1=CLaMS). */ int met_clams; + /* ------------------------------------------------------------ + Quantity parameters... + ------------------------------------------------------------ */ + /*! Number of quantities. */ int nq; @@ -2441,6 +2447,10 @@ typedef struct { /*! Time step of simulation [s]. */ double dt_mod; + /* ------------------------------------------------------------ + Meteo data parameters... + ------------------------------------------------------------ */ + /*! Basename for meteo data. */ char metbase[LEN]; @@ -2566,6 +2576,10 @@ typedef struct { /*! Use MPI to share meteo (0=no, 1=yes). */ int met_mpi_share; + /* ------------------------------------------------------------ + Geophysical module parameters... + ------------------------------------------------------------ */ + /*! Time step for sorting of particle data [s]. */ double sort_dt; @@ -2825,6 +2839,10 @@ typedef struct { /*! HNO3 volume mixing ratio for PSC analysis. */ double psc_hno3; + /* ------------------------------------------------------------ + Output parameters... + ------------------------------------------------------------ */ + /*! Basename of atmospheric data files. */ char atm_basename[LEN];