30 module fms_diag_reduction_methods_mod
31 use platform_mod,
only: r8_kind, r4_kind
33 use fms_string_utils_mod,
only:
string
45 module procedure do_time_none_r4, do_time_none_r8
51 module procedure do_time_min_r4, do_time_min_r8
57 module procedure do_time_max_r4, do_time_max_r8
64 module procedure do_time_sum_update_r4, do_time_sum_update_r8
71 module procedure sum_update_done_r4, sum_update_done_r8
91 integer,
intent(in),
optional :: is_in, ie_in, js_in, je_in
92 character(len=128) :: error_msg
95 IF (
PRESENT(ie_in) )
THEN
96 IF ( .NOT.
PRESENT(is_in) )
THEN
97 error_msg =
'ie_in present without is_in'
100 IF (
PRESENT(js_in) .AND. .NOT.
PRESENT(je_in) )
THEN
101 error_msg =
'is_in and ie_in present, but js_in present without je_in'
106 IF (
PRESENT(je_in) )
THEN
107 IF ( .NOT.
PRESENT(js_in) )
THEN
108 error_msg =
'je_in present without js_in'
111 IF (
PRESENT(is_in) .AND. .NOT.
PRESENT(ie_in) )
THEN
112 error_msg =
'js_in and je_in present, but is_in present without ie_in'
122 LOGICAL,
DIMENSION(:,:,:,:),
allocatable,
INTENT(in) :: mask
123 CLASS(*),
DIMENSION(:,:,:,:),
allocatable,
INTENT(in) :: rmask
124 CLASS(*),
DIMENSION(:,:,:,:),
intent(in) :: field
126 logical,
allocatable,
dimension(:,:,:,:) :: oor_mask
128 ALLOCATE(oor_mask(
SIZE(field, 1),
SIZE(field, 2),
SIZE(field, 3),
SIZE(field, 4)))
131 if (
allocated(mask))
then
133 elseif (
allocated(rmask))
then
135 type is (real(kind=r8_kind))
136 WHERE (rmask < 0.5_r8_kind) oor_mask = .false.
137 type is (real(kind=r4_kind))
138 WHERE (rmask < 0.5_r4_kind) oor_mask = .false.
149 CLASS(*),
INTENT(in),
OPTIONAL :: weight
151 real(kind=r8_kind) :: out_weight
153 out_weight = 1.0_r8_kind
154 if (
present(weight))
then
156 type is (real(kind=r8_kind))
157 out_weight = real(weight, kind = r8_kind)
158 type is (real(kind=r4_kind))
159 out_weight = real(weight, kind = r8_kind)
164 #include "fms_diag_reduction_methods_r4.fh"
165 #include "fms_diag_reduction_methods_r8.fh"
167 end module fms_diag_reduction_methods_mod
169 !
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,...
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...