Skip to content

Commit

Permalink
#1715 Do not combined if there are no overlapping beteewn TQZ and UV …
Browse files Browse the repository at this point in the history
…records
  • Loading branch information
Howard Soh committed Mar 18, 2021
1 parent eeb6a57 commit 25d4dc2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions met/src/tools/other/pb2nc/pb2nc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3230,7 +3230,7 @@ int interpolate_by_pressure(int length, float *pres_data, float *var_data) {
<< var_data[idx_start] << " and " << var_data[idx_end] << "\n";
float data_diff = var_data[idx_end] - var_data[idx_start];
for (idx2 = idx_start+1; idx2<idx_end; idx2++) {
if (is_eq(pres_data[idx_end], pres_data[idx_start])) {
if (!is_eq(pres_data[idx_end], pres_data[idx_start])) {
float pres_ratio = (pres_data[idx2] - pres_data[idx_start])
/ (pres_data[idx_end] - pres_data[idx_start]);
var_data[idx2] = var_data[idx_start] + (data_diff * pres_ratio);
Expand Down Expand Up @@ -3266,9 +3266,9 @@ void interpolate_pqtzuv(float *prev_pqtzuv, float *cur_pqtzuv, float *next_pqtzu
|| (nint(next_pqtzuv[0]) == nint(cur_pqtzuv[0]))
|| (nint(prev_pqtzuv[0]) == nint(next_pqtzuv[0]))) {
mlog << Error << method_name
<< " Can't interpolate because of same pressure levels. prev: "
<< prev_pqtzuv[0] << ", cur: " << cur_pqtzuv[0]
<< ", next: " << prev_pqtzuv[0] << "\n";
<< " Can't interpolate because of same pressure levels. prev: "
<< prev_pqtzuv[0] << ", cur: " << cur_pqtzuv[0]
<< ", next: " << prev_pqtzuv[0] << "\n";
}
else {
float p_ratio = (cur_pqtzuv[0] - prev_pqtzuv[0]) / (next_pqtzuv[0] - prev_pqtzuv[0]);
Expand Down

0 comments on commit 25d4dc2

Please sign in to comment.