29 module fms_diag_reduction_methods_mod
30 use platform_mod,
only: r8_kind, r4_kind
32 use fms_string_utils_mod,
only:
string
44 module procedure do_time_none_r4, do_time_none_r8
50 module procedure do_time_min_r4, do_time_min_r8
56 module procedure do_time_max_r4, do_time_max_r8
63 module procedure do_time_sum_update_r4, do_time_sum_update_r8
70 module procedure sum_update_done_r4, sum_update_done_r8
77 module procedure sum_mask_r4, sum_mask_r8
84 module procedure sum_mask_variant_r4, sum_mask_variant_r8
91 module procedure sum_no_mask_r4, sum_no_mask_r8
111 integer,
intent(in),
optional :: is_in, ie_in, js_in, je_in
112 character(len=128) :: error_msg
115 IF (
PRESENT(ie_in) )
THEN
116 IF ( .NOT.
PRESENT(is_in) )
THEN
117 error_msg =
'ie_in present without is_in'
120 IF (
PRESENT(js_in) .AND. .NOT.
PRESENT(je_in) )
THEN
121 error_msg =
'is_in and ie_in present, but js_in present without je_in'
126 IF (
PRESENT(je_in) )
THEN
127 IF ( .NOT.
PRESENT(js_in) )
THEN
128 error_msg =
'je_in present without js_in'
131 IF (
PRESENT(is_in) .AND. .NOT.
PRESENT(ie_in) )
THEN
132 error_msg =
'js_in and je_in present, but is_in present without ie_in'
142 LOGICAL,
DIMENSION(:,:,:,:),
allocatable,
INTENT(in) :: mask
143 CLASS(*),
DIMENSION(:,:,:,:),
allocatable,
INTENT(in) :: rmask
144 CLASS(*),
DIMENSION(:,:,:,:),
intent(in) :: field
146 logical,
allocatable,
dimension(:,:,:,:) :: oor_mask
148 ALLOCATE(oor_mask(
SIZE(field, 1),
SIZE(field, 2),
SIZE(field, 3),
SIZE(field, 4)))
151 if (
allocated(mask))
then
153 elseif (
allocated(rmask))
then
155 type is (real(kind=r8_kind))
156 WHERE (rmask < 0.5_r8_kind) oor_mask = .false.
157 type is (real(kind=r4_kind))
158 WHERE (rmask < 0.5_r4_kind) oor_mask = .false.
169 CLASS(*),
INTENT(in),
OPTIONAL :: weight
171 real(kind=r8_kind) :: out_weight
173 out_weight = 1.0_r8_kind
174 if (
present(weight))
then
176 type is (real(kind=r8_kind))
177 out_weight = real(weight, kind = r8_kind)
178 type is (real(kind=r4_kind))
179 out_weight = real(weight, kind = r8_kind)
184 #include "fms_diag_reduction_methods_r4.fh"
185 #include "fms_diag_reduction_methods_r8.fh"
187 end module fms_diag_reduction_methods_mod
189 !
close documentation grouping
integer, parameter time_diurnal
The reduction method is diurnal.
integer, parameter time_rms
The reudction method is root mean square of values.
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...
logical function, dimension(:,:,:,:), allocatable, public init_mask(rmask, mask, field)
Sets the logical mask based on mask or rmask.
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.
Does the time_max reduction method. See include/fms_diag_reduction_methods.inc.
Does the time_min reduction method. See include/fms_diag_reduction_methods.inc.
Sum update updates the buffer for any reductions that involve summation (ie. time_sum,...
Updates the buffer for any reductions that involve summation (ie. time_sum, avg, rms,...
Updates the buffer for any reductions that involve summation (ie. time_sum, avg, rms,...
Updates the buffer for any reductions that involve summation (ie. time_sum, avg, rms,...
Finishes a reduction that involves an average (ie. time_avg, rms, pow) This takes the average at the ...
character(:) function, allocatable, public string(v, fmt)
Converts a number or a Boolean value to a string.
Does the time_none reduction method. See include/fms_diag_reduction_methods.inc.
Data structure holding a 3D bounding box. It is commonlyused to represent the interval bounds or limi...