FMS  2024.03
Flexible Modeling System
fms_diag_reduction_methods_mod

fms_diag_reduction_methods_mod contains routines that are meant to be used for error checking and setting up to do the reduction methods More...

Data Types

interface  do_time_max
 Does the time_max reduction method. See include/fms_diag_reduction_methods.inc. More...
 
interface  do_time_min
 Does the time_min reduction method. See include/fms_diag_reduction_methods.inc. More...
 
interface  do_time_sum_update
 Sum update updates the buffer for any reductions that involve summation (ie. time_sum, avg, rms, pow) TODO This needs to be extended to integers. More...
 
interface  time_update_done
 Finishes a reduction that involves an average (ie. time_avg, rms, pow) This takes the average at the end of the time step. More...
 

Functions/Subroutines

pure character(len=128) function, public check_indices_order (is_in, ie_in, js_in, je_in)
 Checks improper combinations of is, ie, js, and je. More...
 
 do_time_max_r4
 
 do_time_max_r8
 
 do_time_min_r4
 
 do_time_min_r8
 
 do_time_none_r4
 
 do_time_none_r8
 
 do_time_sum_update_r4
 
 do_time_sum_update_r8
 
logical function, dimension(:,:,:,:), allocatable, public init_mask (rmask, mask, field)
 Sets the logical mask based on mask or rmask. More...
 
pure real(kind=r8_kind) function, public set_weight (weight)
 Sets the weight based on the weight passed into send_data (1.0_r8_kind if the weight is not passed in) The weight will be saved as an r8 and converted to r4 as needed. More...
 
 sum_update_done_r4
 
 sum_update_done_r8
 

Detailed Description

fms_diag_reduction_methods_mod contains routines that are meant to be used for error checking and setting up to do the reduction methods


Data Type Documentation

◆ fms_diag_reduction_methods_mod::do_time_max

interface fms_diag_reduction_methods_mod::do_time_max

Does the time_max reduction method. See include/fms_diag_reduction_methods.inc.

Definition at line 56 of file fms_diag_reduction_methods.F90.

Private Member Functions

 do_time_max_r4
 
 do_time_max_r8
 

◆ fms_diag_reduction_methods_mod::do_time_min

interface fms_diag_reduction_methods_mod::do_time_min

Does the time_min reduction method. See include/fms_diag_reduction_methods.inc.

Definition at line 50 of file fms_diag_reduction_methods.F90.

Private Member Functions

 do_time_min_r4
 
 do_time_min_r8
 

◆ fms_diag_reduction_methods_mod::do_time_sum_update

interface fms_diag_reduction_methods_mod::do_time_sum_update

Sum update updates the buffer for any reductions that involve summation (ie. time_sum, avg, rms, pow) TODO This needs to be extended to integers.

Definition at line 63 of file fms_diag_reduction_methods.F90.

Private Member Functions

 do_time_sum_update_r4
 
 do_time_sum_update_r8
 

◆ fms_diag_reduction_methods_mod::time_update_done

interface fms_diag_reduction_methods_mod::time_update_done

Finishes a reduction that involves an average (ie. time_avg, rms, pow) This takes the average at the end of the time step.

Definition at line 70 of file fms_diag_reduction_methods.F90.

Private Member Functions

 sum_update_done_r4
 
 sum_update_done_r8
 

Function/Subroutine Documentation

◆ check_indices_order()

pure character(len=128) function, public fms_diag_reduction_methods_mod::check_indices_order ( integer, intent(in), optional  is_in,
integer, intent(in), optional  ie_in,
integer, intent(in), optional  js_in,
integer, intent(in), optional  je_in 
)

Checks improper combinations of is, ie, js, and je.

Returns
The error message, empty string if no errors were found
Note
accept_data works in either one or another of two modes.
  1. Input field is a window (e.g. FMS physics)
  2. Input field includes halo data It cannot handle a window of data that has halos. (A field with no windows or halos can be thought of as a special case of either mode.) The logic for indexing is quite different for these two modes, but is not clearly separated. If both the beggining and ending indices are present, then field is assumed to have halos. If only beggining indices are present, then field is assumed to be a window.
There are a number of ways a user could mess up this logic, depending on the combination of presence/absence of is,ie,js,je. The checks below should catch improper combinations.
Parameters
[in]je_inIndices passed to fms_diag_accept_data()
Returns
An error message used only for testing purpose!!!

Definition at line 89 of file fms_diag_reduction_methods.F90.

◆ init_mask()

logical function, dimension(:,:,:,:), allocatable, public fms_diag_reduction_methods_mod::init_mask ( class(*), dimension(:,:,:,:), intent(in), allocatable  rmask,
logical, dimension(:,:,:,:), intent(in), allocatable  mask,
class(*), dimension(:,:,:,:), intent(in)  field 
)

Sets the logical mask based on mask or rmask.

Returns
logical mask
Parameters
[in]maskThe location of the mask
[in]rmaskThe masking values
[in]fieldField_data
Returns
mask

Definition at line 120 of file fms_diag_reduction_methods.F90.

◆ set_weight()

pure real(kind=r8_kind) function, public fms_diag_reduction_methods_mod::set_weight ( class(*), intent(in), optional  weight)

Sets the weight based on the weight passed into send_data (1.0_r8_kind if the weight is not passed in) The weight will be saved as an r8 and converted to r4 as needed.

Returns
weight to use when averaging
Parameters
[in]weightThe weight use when averaging

Definition at line 147 of file fms_diag_reduction_methods.F90.