From 46ed98e82da01cd2a27908a88e93da91f8c37d47 Mon Sep 17 00:00:00 2001 From: Lars Hoffmann Date: Tue, 12 Sep 2023 16:53:34 +0200 Subject: [PATCH] Added total column ozone to interpolation functions. --- src/libtrac.c | 2 ++ src/libtrac.h | 7 ++++++- src/met_map.c | 7 ++++--- src/met_prof.c | 9 +++++---- src/met_sample.c | 4 ++-- src/met_zm.c | 20 ++++++++++---------- src/trac.c | 4 +++- 7 files changed, 32 insertions(+), 21 deletions(-) diff --git a/src/libtrac.c b/src/libtrac.c index 6961d47fe..23562c14e 100644 --- a/src/libtrac.c +++ b/src/libtrac.c @@ -2230,6 +2230,7 @@ void read_ctl( ctl->qnt_pel = -1; ctl->qnt_cape = -1; ctl->qnt_cin = -1; + ctl->qnt_o3c = -1; ctl->qnt_hno3 = -1; ctl->qnt_oh = -1; ctl->qnt_h2o2 = -1; @@ -2332,6 +2333,7 @@ void read_ctl( SET_QNT(qnt_cape, "cape", "convective available potential energy", "J/kg") SET_QNT(qnt_cin, "cin", "convective inhibition", "J/kg") + SET_QNT(qnt_o3c, "o3c", "total column ozone", "DU") SET_QNT(qnt_hno3, "hno3", "nitric acid", "ppv") SET_QNT(qnt_oh, "oh", "hydroxyl radical", "ppv") SET_QNT(qnt_h2o2, "h2o2", "hydrogen peroxide", "ppv") diff --git a/src/libtrac.h b/src/libtrac.h index 54f52de9c..574431c4c 100644 --- a/src/libtrac.h +++ b/src/libtrac.h @@ -363,6 +363,7 @@ intpol_met_space_2d(met, met->pel, lon, lat, &pel, ci, cw, 0); \ intpol_met_space_2d(met, met->cape, lon, lat, &cape, ci, cw, 0); \ intpol_met_space_2d(met, met->cin, lon, lat, &cin, ci, cw, 0); \ + intpol_met_space_2d(met, met->o3c, lon, lat, &o3c, ci, cw, 0); \ } /*! Temporal interpolation of all meteo data. */ @@ -398,6 +399,7 @@ intpol_met_time_2d(met0, met0->pel, met1, met1->pel, time, lon, lat, &pel, ci, cw, 0); \ intpol_met_time_2d(met0, met0->cape, met1, met1->cape, time, lon, lat, &cape, ci, cw, 0); \ intpol_met_time_2d(met0, met0->cin, met1, met1->cin, time, lon, lat, &cin, ci, cw, 0); \ + intpol_met_time_2d(met0, met0->o3c, met1, met1->o3c, time, lon, lat, &o3c, ci, cw, 0); \ } /*! Calculate lapse rate between pressure levels. */ @@ -946,6 +948,9 @@ typedef struct { /*! Quantity array index for convective inhibition (CIN). */ int qnt_cin; + /*! Quantity array index for total column ozone. */ + int qnt_o3c; + /*! Quantity array index for nitric acid vmr. */ int qnt_hno3; @@ -1861,7 +1866,7 @@ typedef struct { /*! Convective inhibition [J/kg]. */ float cin[EX][EY]; - /*! Total ozone column [DU]. */ + /*! Total column ozone [DU]. */ float o3c[EX][EY]; /*! Geopotential height [km]. */ diff --git a/src/met_map.c b/src/met_map.c index d50cbc5eb..3bf458967 100644 --- a/src/met_map.c +++ b/src/met_map.c @@ -60,9 +60,9 @@ int main( tnatm[NX][NY], lwc, lwcm[NX][NY], iwc, iwcm[NX][NY], cc, ccm[NX][NY], z, zm[NX][NY], pv, pvm[NX][NY], zt, ztm[NX][NY], tt, ttm[NX][NY], pct, pctm[NX][NY], pcb, pcbm[NX][NY], cl, clm[NX][NY], plcl, - plclm[NX][NY], plfc, plfcm[NX][NY], pel, pelm[NX][NY], - cape, capem[NX][NY], cin, cinm[NX][NY], rhm[NX][NY], rhicem[NX][NY], - theta, ptop, pbot, t0, lon, lon0, lon1, lons[NX], dlon, + plclm[NX][NY], plfc, plfcm[NX][NY], pel, pelm[NX][NY], cape, + capem[NX][NY], cin, cinm[NX][NY], o3c, o3cm[NX][NY], rhm[NX][NY], + rhicem[NX][NY], theta, ptop, pbot, t0, lon, lon0, lon1, lons[NX], dlon, lat, lat0, lat1, lats[NY], dlat, cw[3]; static int i, ix, iy, np[NX][NY], npc[NX][NY], npt[NX][NY], nx, ny, ci[3]; @@ -184,6 +184,7 @@ int main( h2otm[ix][iy] += h2ot; npt[ix][iy]++; } + o3cm[ix][iy] += o3c; hno3m[ix][iy] += clim_zm(&clim->hno3, met->time, lats[iy], p0); tnatm[ix][iy] += nat_temperature(p0, h2o, diff --git a/src/met_prof.c b/src/met_prof.c index a944e9e83..933be6205 100644 --- a/src/met_prof.c +++ b/src/met_prof.c @@ -53,10 +53,10 @@ int main( iwc, iwcm[NZ], cc, ccm[NZ], ps, psm[NZ], ts, tsm[NZ], zs, zsm[NZ], us, usm[NZ], vs, vsm[NZ], lsm, lsmm[NZ], sst, sstm[NZ], pbl, pblm[NZ], pt, ptm[NZ], pct, pctm[NZ], pcb, pcbm[NZ], cl, clm[NZ], plcl, plclm[NZ], - plfc, plfcm[NZ], pel, pelm[NZ], cape, capem[NZ], cin, cinm[NZ], tt, - ttm[NZ], zm[NZ], zt, ztm[NZ], pv, pvm[NZ], plev[NZ], rhm[NZ], rhicem[NZ], - tdewm[NZ], ticem[NZ], tnatm[NZ], hno3m[NZ], ohm[NZ], h2o2m[NZ], - ho2m[NZ], o1dm[NZ], cw[3]; + plfc, plfcm[NZ], pel, pelm[NZ], cape, capem[NZ], cin, cinm[NZ], + o3c, o3cm[NZ], tt, ttm[NZ], zm[NZ], zt, ztm[NZ], pv, pvm[NZ], plev[NZ], + rhm[NZ], rhicem[NZ], tdewm[NZ], ticem[NZ], tnatm[NZ], hno3m[NZ], + ohm[NZ], h2o2m[NZ], ho2m[NZ], o1dm[NZ], cw[3]; static int i, iz, np[NZ], npc[NZ], npt[NZ], nz, ci[3]; @@ -168,6 +168,7 @@ int main( h2otm[iz] += h2ot; npt[iz]++; } + o3cm[iz] += o3c; rhm[iz] += RH(plev[iz], t, h2o); rhicem[iz] += RHICE(plev[iz], t, h2o); tdewm[iz] += TDEW(plev[iz], h2o); diff --git a/src/met_sample.c b/src/met_sample.c index 61f045e53..9c665ad49 100644 --- a/src/met_sample.c +++ b/src/met_sample.c @@ -43,8 +43,8 @@ int main( FILE *out; double h2o, h2ot, o3, lwc, iwc, cc, p0, p1, ps, ts, zs, us, vs, lsm, sst, - pbl, pt, pct, pcb, cl, plcl, plfc, pel, cape, cin, pv, t, tt, u, v, w, - z, zm, zref, zt, cw[3], time_old = -999, p_old = -999, lon_old = -999, + pbl, pt, pct, pcb, cl, plcl, plfc, pel, cape, cin, o3c, pv, t, tt, u, v, + w, z, zm, zref, zt, cw[3], time_old = -999, p_old = -999, lon_old = -999, lat_old = -999; int geopot, grid_time, grid_z, grid_lon, grid_lat, ip, it, ci[3]; diff --git a/src/met_zm.c b/src/met_zm.c index d741b4202..2d6618af8 100644 --- a/src/met_zm.c +++ b/src/met_zm.c @@ -53,16 +53,15 @@ int main( static double timem[NZ][NY], psm[NZ][NY], tsm[NZ][NY], zsm[NZ][NY], usm[NZ][NY], vsm[NZ][NY], lsmm[NZ][NY], sstm[NZ][NY], pblm[NZ][NY], ptm[NZ][NY], pctm[NZ][NY], pcbm[NZ][NY], clm[NZ][NY], plclm[NZ][NY], - plfcm[NZ][NY], pelm[NZ][NY], capem[NZ][NY], cinm[NZ][NY], ttm[NZ][NY], - ztm[NZ][NY], tm[NZ][NY], um[NZ][NY], vm[NZ][NY], wm[NZ][NY], h2om[NZ][NY], - h2otm[NZ][NY], pvm[NZ][NY], o3m[NZ][NY], lwcm[NZ][NY], iwcm[NZ][NY], - ccm[NZ][NY], zm[NZ][NY], rhm[NZ][NY], rhicem[NZ][NY], tdewm[NZ][NY], - ticem[NZ][NY], tnatm[NZ][NY], hno3m[NZ][NY], ohm[NZ][NY], h2o2m[NZ][NY], - ho2m[NZ][NY], o1dm[NZ][NY], z, z0, z1, dz, zt, tt, plev[NZ], - ps, ts, zs, us, vs, lsm, sst, pbl, pt, pct, pcb, plcl, plfc, pel, - cape, cin, cl, t, u, v, w, pv, h2o, h2ot, o3, - lwc, iwc, cc, lat, lat0, lat1, dlat, lats[NY], lon0, lon1, - lonm[NZ][NY], cw[3]; + plfcm[NZ][NY], pelm[NZ][NY], capem[NZ][NY], cinm[NZ][NY], o3cm[NZ][NY], + ttm[NZ][NY], ztm[NZ][NY], tm[NZ][NY], um[NZ][NY], vm[NZ][NY], wm[NZ][NY], + h2om[NZ][NY], h2otm[NZ][NY], pvm[NZ][NY], o3m[NZ][NY], lwcm[NZ][NY], + iwcm[NZ][NY], ccm[NZ][NY], zm[NZ][NY], rhm[NZ][NY], rhicem[NZ][NY], + tdewm[NZ][NY], ticem[NZ][NY], tnatm[NZ][NY], hno3m[NZ][NY], ohm[NZ][NY], + h2o2m[NZ][NY], ho2m[NZ][NY], o1dm[NZ][NY], z, z0, z1, dz, zt, tt, + plev[NZ], ps, ts, zs, us, vs, lsm, sst, pbl, pt, pct, pcb, plcl, plfc, + pel, cape, cin, o3c, cl, t, u, v, w, pv, h2o, h2ot, o3, lwc, iwc, cc, lat, + lat0, lat1, dlat, lats[NY], lon0, lon1, lonm[NZ][NY], cw[3]; static int i, ix, iy, iz, np[NZ][NY], npc[NZ][NY], npt[NZ][NY], ny, nz, ci[3]; @@ -180,6 +179,7 @@ int main( h2otm[iz][iy] += h2ot; npt[iz][iy]++; } + o3cm[iz][iy] += o3c; rhm[iz][iy] += RH(plev[iz], t, h2o); rhicem[iz][iy] += RHICE(plev[iz], t, h2o); tdewm[iz][iy] += TDEW(plev[iz], h2o); diff --git a/src/trac.c b/src/trac.c index f1f85fcc7..9a6c61884 100644 --- a/src/trac.c +++ b/src/trac.c @@ -1379,7 +1379,8 @@ void module_meteo( PARTICLE_LOOP(0, atm->np, 0, "acc data present(ctl,clim,met0,met1,atm,dt)") { double ps, ts, zs, us, vs, lsm, sst, pbl, pt, pct, pcb, cl, plcl, plfc, - pel, cape, cin, pv, t, tt, u, v, w, h2o, h2ot, o3, lwc, iwc, cc, z, zt; + pel, cape, cin, o3c, pv, t, tt, u, v, w, h2o, h2ot, o3, + lwc, iwc, cc, z, zt; /* Interpolate meteo data... */ INTPOL_INIT; @@ -1418,6 +1419,7 @@ void module_meteo( SET_ATM(qnt_pel, pel); SET_ATM(qnt_cape, cape); SET_ATM(qnt_cin, cin); + SET_ATM(qnt_o3c, o3c); SET_ATM(qnt_hno3, clim_zm(&clim->hno3, atm->time[ip], atm->lat[ip], atm->p[ip])); SET_ATM(qnt_oh, clim_oh(ctl, clim, atm->time[ip],