Skip to content

Commit

Permalink
Fixed calculation of PBL pressure range.
Browse files Browse the repository at this point in the history
  • Loading branch information
lars2015 committed Dec 18, 2024
1 parent 73cf94a commit f2a330a
Show file tree
Hide file tree
Showing 12 changed files with 4,868 additions and 4,870 deletions.
14 changes: 6 additions & 8 deletions src/mptrac.c
Original file line number Diff line number Diff line change
Expand Up @@ -7264,7 +7264,7 @@ void read_met_pbl(
for (int iy = 0; iy < met->ny; iy++) {

/* Set bottom level of PBL... */
const double pbl_bot = met->ps[ix][iy] + DZ2DP(dz, met->ps[ix][iy]);
const double pbl_bot = met->ps[ix][iy] * exp(-dz / H0);

/* Find lowest level near the bottom... */
int ip;
Expand Down Expand Up @@ -7347,7 +7347,7 @@ void read_met_pbl(
met->p[ip], theta0 + dtheta));

/* Check minimum value... */
double pbl_min = met->ps[ix][iy] + DZ2DP(zmin, met->ps[ix][iy]);
double pbl_min = met->ps[ix][iy] * exp(-zmin / H0);
if (met->pbl[ix][iy] > pbl_min || met->p[ip] > met->ps[ix][iy])
met->pbl[ix][iy] = (float) pbl_min;
}
Expand All @@ -7357,15 +7357,13 @@ void read_met_pbl(
#pragma omp parallel for default(shared) collapse(2)
for (int ix = 0; ix < met->nx; ix++)
for (int iy = 0; iy < met->ny; iy++) {

/* Check minimum value... */
double pbl_min =
met->ps[ix][iy] + DZ2DP(ctl->met_pbl_min, met->ps[ix][iy]);
double pbl_min = met->ps[ix][iy] * exp(-ctl->met_pbl_min / H0);
met->pbl[ix][iy] = MIN(met->pbl[ix][iy], (float) pbl_min);

/* Check maximum value... */
double pbl_max =
met->ps[ix][iy] + DZ2DP(ctl->met_pbl_max, met->ps[ix][iy]);
double pbl_max = met->ps[ix][iy] * exp(-ctl->met_pbl_max / H0);
met->pbl[ix][iy] = MAX(met->pbl[ix][iy], (float) pbl_max);
}
}
Expand Down
Binary file modified tests/compress_test/data.ref/ei_2011_06_05_00.bin
Binary file not shown.
Binary file modified tests/compress_test/data.ref/ei_2011_06_05_00.pck
Binary file not shown.
Binary file modified tests/compress_test/data.ref/ei_2011_06_05_00.zfp
Binary file not shown.
Binary file modified tests/compress_test/data.ref/ei_2011_06_05_00.zstd
Binary file not shown.
Binary file modified tests/compress_test/data.ref/pck2bin_2011_06_05_00.bin
Binary file not shown.
Binary file modified tests/compress_test/data.ref/zfp2bin_2011_06_05_00.bin
Binary file not shown.
Binary file modified tests/compress_test/data.ref/zstd2bin_2011_06_05_00.bin
Binary file not shown.
1,244 changes: 622 additions & 622 deletions tests/met_test/data.ref/map.tab

Large diffs are not rendered by default.

1,200 changes: 600 additions & 600 deletions tests/met_test/data.ref/prof.tab

Large diffs are not rendered by default.

1,302 changes: 651 additions & 651 deletions tests/met_test/data.ref/sample.tab

Large diffs are not rendered by default.

5,978 changes: 2,989 additions & 2,989 deletions tests/met_test/data.ref/zm.tab

Large diffs are not rendered by default.

0 comments on commit f2a330a

Please sign in to comment.