Skip to content

Commit

Permalink
Correct summing of elements in reduced_k_range time average
Browse files Browse the repository at this point in the history
Fixed an issue that had the reduced_k_range diagnostic output use the wrong number of elements to determine the time average.

Also fixed an issue that would have caused an issue with reduced_k_range, time averaged diurnal sampling

Fixed mom-ocean#28
  • Loading branch information
underwoo committed Dec 22, 2016
1 parent fc2fe19 commit 55d2c15
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions diag_manager/diag_manager.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2496,7 +2496,7 @@ LOGICAL FUNCTION send_data_3d(diag_field_id, field, time, is_in, js_in, ks_in, &
DO j=f3, f4
DO i=f1, f2
IF ( field(i,j,k) /= missvalue ) THEN
output_fields(out_num)%count_0d = output_fields(out_num)%count_0d + weight1
output_fields(out_num)%count_0d(sample) = output_fields(out_num)%count_0d(sample) + weight1
EXIT outer3
END IF
END DO
Expand Down Expand Up @@ -2688,7 +2688,7 @@ LOGICAL FUNCTION send_data_3d(diag_field_id, field, time, is_in, js_in, ks_in, &
END IF ! if mask present
END IF !if mask_variant
!$OMP CRITICAL
IF ( .NOT.need_compute )&
IF ( .NOT.need_compute .AND. .NOT.reduced_k_range )&
& output_fields(out_num)%num_elements(sample) =&
& output_fields(out_num)%num_elements(sample) + (ie-is+1)*(je-js+1)*(ke-ks+1)
IF ( reduced_k_range ) &
Expand Down

0 comments on commit 55d2c15

Please sign in to comment.