Skip to content

Commit

Permalink
Update fms_diag_reduction_methods.F90
Browse files Browse the repository at this point in the history
  • Loading branch information
ganganoaa authored Jul 25, 2023
1 parent cd7beeb commit 10f0891
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions diag_manager/fms_diag_reduction_methods.F90
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ subroutine fms_diag_update_extremum(flag, buffer_obj, field_data, recon_bounds,
f3 = recon_bounds%get_fjs()
f4 = recon_bounds%get_fje()

if (flag .ne. 0 .and. flag .ne. 1) then
call mpp_error( FATAL, "fms_diag_reduction_methods_mod::fms_diag_update_extremum: flag must be either 0 or 1.")
if (flag .ne. 3 .and. flag .ne. 4) then
call mpp_error( FATAL, "fms_diag_reduction_methods_mod::fms_diag_update_extremum: flag must be either 3 or 4.")
end if

!! TODO: remap buffer before passing to subroutines update_scalar_extremum and update_array_extremum
Expand Down Expand Up @@ -419,7 +419,7 @@ end subroutine fms_diag_update_extremum
!> @brief Updates individual element of buffer
subroutine update_scalar_extremum(flag, field_data, buffer, mask, sample, recon_bounds, &
running_indx1, running_indx2)
integer, intent(in) :: flag !< 0 for minimum; 1 for maximum
integer, intent(in) :: flag !< Flag indicating maximum(time_max) or minimum(time_min)
class(*), intent(in) :: field_data(:,:,:,:) !< Field data
class(*), intent(inout) :: buffer(:,:,:,:,:) !< Remapped output buffer
logical, intent(in) :: mask(:,:,:,:) !< Update mask
Expand Down Expand Up @@ -466,7 +466,7 @@ subroutine update_scalar_extremum(flag, field_data, buffer, mask, sample, recon_
type is (real(kind=r4_kind))
select type (buffer)
type is (real(kind=r4_kind))
if (flag .eq. 0) then
if (flag .eq. time_min) then
! Update the buffer with the current minimum
where (mask(i-is+1+hi,j-js+1+hj,k,:) .AND. field_data(i-is+1+hi,j-js+1+hj,k,:) <&
buffer(i1,j1,k1,:,sample))
Expand All @@ -486,7 +486,7 @@ subroutine update_scalar_extremum(flag, field_data, buffer, mask, sample, recon_
type is (real(kind=r8_kind))
select type (buffer)
type is (real(kind=r8_kind))
if (flag .eq. 0) then
if (flag .eq. time_min) then
! Update the buffer with the current minimum
where (mask(i-is+1+hi,j-js+1+hj,k,:) .AND. field_data(i-is+1+hi,j-js+1+hj,k,:) <&
buffer(i1,j1,k1,:,sample))
Expand All @@ -506,7 +506,7 @@ subroutine update_scalar_extremum(flag, field_data, buffer, mask, sample, recon_
type is (integer(kind=i4_kind))
select type (buffer)
type is (integer(kind=i4_kind))
if (flag .eq. 0) then
if (flag .eq. time_min) then
! Update the buffer with the current minimum
where (mask(i-is+1+hi,j-js+1+hj,k,:) .AND. field_data(i-is+1+hi,j-js+1+hj,k,:) <&
buffer(i1,j1,k1,:,sample))
Expand All @@ -526,7 +526,7 @@ subroutine update_scalar_extremum(flag, field_data, buffer, mask, sample, recon_
type is (integer(kind=i8_kind))
select type (buffer)
type is (integer(kind=i8_kind))
if (flag .eq. 0) then
if (flag .eq. time_min) then
! Update the buffer with the current minimum
where (mask(i-is+1+hi,j-js+1+hj,k,:) .AND. field_data(i-is+1+hi,j-js+1+hj,k,:) <&
buffer(i1,j1,k1,:,sample))
Expand All @@ -550,7 +550,7 @@ end subroutine update_scalar_extremum

!> @brief Updates a chunk of buffer
subroutine update_array_extremum(flag, field_data, buffer, mask, sample, recon_bounds, reduced_k_range)
integer :: flag !< 0 for minimum; 1 for extremum
integer :: flag !< Flag indicating maximum(time_max) or minimum(time_min)
class(*), intent(in) :: field_data(:,:,:,:) !< Field data
class(*), intent(inout) :: buffer(:,:,:,:,:) !< Remapped output buffer
logical, intent(in) :: mask(:,:,:,:) !< Updated mask
Expand Down Expand Up @@ -589,7 +589,7 @@ subroutine update_array_extremum(flag, field_data, buffer, mask, sample, recon_b
type is (real(kind=r4_kind))
select type (buffer)
type is (real(kind=r4_kind))
if (flag .eq. 0) then
if (flag .eq. time_min) then
!> Update the buffer with the current minimum
if (reduced_k_range) then
! recon_bounds must have ks = ksr and ke = ker
Expand Down Expand Up @@ -621,7 +621,7 @@ subroutine update_array_extremum(flag, field_data, buffer, mask, sample, recon_b
type is (real(kind=r8_kind))
select type (buffer)
type is (real(kind=r8_kind))
if (flag .eq. 0) then
if (flag .eq. time_min) then
!> Update the buffer with the current minimum
if (reduced_k_range) then
! recon_bounds must have ks = ksr and ke = ker
Expand Down Expand Up @@ -653,7 +653,7 @@ subroutine update_array_extremum(flag, field_data, buffer, mask, sample, recon_b
type is (integer(kind=i4_kind))
select type (buffer)
type is (integer(kind=i4_kind))
if (flag .eq. 0) then
if (flag .eq. time_min) then
!> Update the buffer with the current minimum
if (reduced_k_range) then
! recon_bounds must have ks = ksr and ke = ker
Expand Down Expand Up @@ -685,7 +685,7 @@ subroutine update_array_extremum(flag, field_data, buffer, mask, sample, recon_b
type is (integer(kind=i8_kind))
select type (buffer)
type is (integer(kind=i8_kind))
if (flag .eq. 0) then
if (flag .eq. time_min) then
!> Update the buffer with the current minimum
if (reduced_k_range) then
! recon_bounds must have ks = ksr and ke = ker
Expand Down

0 comments on commit 10f0891

Please sign in to comment.