Skip to content

Commit

Permalink
Tweak abstol for grib1 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrichert committed Jul 20, 2023
1 parent ae9a21d commit 2c27a3a
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions tests/interp_mod_grib1.F90
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,16 @@ subroutine interp(grid, interp_opt)
data grd218 /3, 614, 428, 12190, -133459, 8, -95000, &
12191, 12191, 0, 64, 25000, 25000, 0, 0, 0, 0, 0, 0, 255, 180*0/

#if (LSIZE==D)
abstol=0.0001
#elif (LSIZE==4)
if ((trim(grid).eq."212") .and. (interp_opt.eq."6")) then
abstol=0.2
else
abstol=0.05
endif
#endif

select case (trim(grid))
case ('3')
output_kgds = grd3
Expand Down Expand Up @@ -242,7 +252,7 @@ subroutine interp(grid, interp_opt)
do j = 1, j_output
do i = 1, i_output
output_data4 = real(output_data(i,j),4)
if ( abs(output_data4 - baseline_data(i,j)) > 0.0001) then
if ( abs(output_data4 - baseline_data(i,j)) > abstol) then
avgdiff = avgdiff + abs(output_data4-baseline_data(i,j))
num_pts_diff = num_pts_diff + 1
if (abs(output_data4-baseline_data(i,j)) > abs(maxdiff))then
Expand Down Expand Up @@ -370,6 +380,16 @@ subroutine interp_vector(grid, interp_opt)
data grd218 /3, 614, 428, 12190, -133459, 8, -95000, &
12191, 12191, 0, 64, 25000, 25000, 0, 0, 0, 0, 0, 0, 255, 180*0/

#if (LSIZE==D)
abstol=0.0001
#elif (LSIZE==4)
if ((trim(grid).eq."212") .and. (interp_opt.eq."6")) then
abstol=0.2
else
abstol=0.05
endif
#endif

select case (trim(grid))
case ('3')
output_kgds = grd3
Expand Down Expand Up @@ -539,15 +559,15 @@ subroutine interp_vector(grid, interp_opt)
do j = 1, j_output
do i = 1, i_output
output_data4 = real(output_u_data(i,j),4)
if (abs(output_data4 - baseline_u_data(i,j)) > 0.0001) then
if (abs(output_data4 - baseline_u_data(i,j)) > abstol) then
avg_u_diff = avg_u_diff + abs(output_data4-baseline_u_data(i,j))
num_upts_diff = num_upts_diff + 1
if (abs(output_data4-baseline_u_data(i,j)) > abs(max_u_diff))then
max_u_diff = output_data4-baseline_u_data(i,j)
endif
endif
output_data4 = real(output_v_data(i,j),4)
if (abs(output_data4 - baseline_v_data(i,j)) > 0.0001) then
if (abs(output_data4 - baseline_v_data(i,j)) > abstol) then
avg_v_diff = avg_v_diff + abs(output_data4-baseline_v_data(i,j))
num_vpts_diff = num_vpts_diff + 1
if (abs(output_data4-baseline_v_data(i,j)) > abs(max_v_diff))then
Expand Down

0 comments on commit 2c27a3a

Please sign in to comment.