Skip to content

Commit

Permalink
Fixed downsampling for x:sum y:point z:point diags
Browse files Browse the repository at this point in the history
- previous code had averaging instead of summation for
  SPP (x:sum,y:point,z:point) diagnostics
- corrects an issue where these diagnostics were incorrect
  by approximately a factor of 2.
- Orginially found when analyzing the depth-integrated
  temperature advection diagnostic (T_ady_2d)
  • Loading branch information
jkrasting committed Apr 1, 2021
1 parent 6d4a483 commit 9792b23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/framework/MOM_diag_mediator.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4181,7 +4181,7 @@ subroutine downsample_field_2d(field_in, field_out, dl, method, mask, diag_cs, d
total_weight = total_weight +weight
ave = ave+field_in(ii,jj)*weight
enddo
field_out(i,j) = ave/(total_weight+epsilon) !Avoid zero mask at all aggregating cells where ave=0.0
field_out(i,j) = ave !Masked Sum (total_weight=1)
enddo ; enddo
elseif (method == PMP) then
do j=jsv_d,jev_d ; do i=isv_d,iev_d
Expand Down

0 comments on commit 9792b23

Please sign in to comment.